diff --git a/tools/ui/node_modules/loupe/lib/promise.d.ts b/tools/ui/node_modules/loupe/lib/promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d62fc9052562fc0feee6cbe0e95aea9d5d7a012 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/promise.d.ts @@ -0,0 +1,5 @@ +import type { Options } from './types.js'; +type GetPromiseValue = (value: Promise, options: Options) => string; +declare const getPromiseValue: GetPromiseValue; +export default getPromiseValue; +//# sourceMappingURL=promise.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/promise.d.ts.map b/tools/ui/node_modules/loupe/lib/promise.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..58baf4272908d2744af437152fc60309a943b5e4 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../src/promise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,KAAK,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;AAC5E,QAAA,MAAM,eAAe,EAAE,eAAoC,CAAA;AAC3D,eAAe,eAAe,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/promise.js b/tools/ui/node_modules/loupe/lib/promise.js new file mode 100644 index 0000000000000000000000000000000000000000..8fb9d3a90edc8a64f16c4d0ec4071ffff08fd49f --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/promise.js @@ -0,0 +1,2 @@ +const getPromiseValue = () => 'Promise{…}'; +export default getPromiseValue; diff --git a/tools/ui/node_modules/loupe/lib/regexp.d.ts b/tools/ui/node_modules/loupe/lib/regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec77ec93367bd0e312f3dbfa951f682e1726f483 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/regexp.d.ts @@ -0,0 +1,3 @@ +import type { Options } from './types.js'; +export default function inspectRegExp(value: RegExp, options: Options): string; +//# sourceMappingURL=regexp.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/regexp.d.ts.map b/tools/ui/node_modules/loupe/lib/regexp.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7d8295eedaf45b1b2e4848b5073a5548a3f6b7e3 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/regexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"regexp.d.ts","sourceRoot":"","sources":["../src/regexp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAK7E"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/regexp.js b/tools/ui/node_modules/loupe/lib/regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..0a35f49f9f6b1054de912ca44b2b6a855db6d209 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/regexp.js @@ -0,0 +1,7 @@ +import { truncate } from './helpers.js'; +export default function inspectRegExp(value, options) { + const flags = value.toString().split('/')[2]; + const sourceLength = options.truncate - (2 + flags.length); + const source = value.source; + return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, 'regexp'); +} diff --git a/tools/ui/node_modules/loupe/lib/set.d.ts b/tools/ui/node_modules/loupe/lib/set.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..280de62ea5c30cd1001dcb4736cf4b5eb0d9328f --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/set.d.ts @@ -0,0 +1,3 @@ +import type { Options } from './types.js'; +export default function inspectSet(set: Set, options: Options): string; +//# sourceMappingURL=set.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/set.d.ts.map b/tools/ui/node_modules/loupe/lib/set.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1436d03d7498ddaba59a91a93780d10061bb44d1 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/set.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../src/set.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAWzC,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAI9E"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/set.js b/tools/ui/node_modules/loupe/lib/set.js new file mode 100644 index 0000000000000000000000000000000000000000..51b81adda98cb74852f5125c86c0a1a95993b702 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/set.js @@ -0,0 +1,15 @@ +import { inspectList } from './helpers.js'; +// IE11 doesn't support `Array.from(set)` +function arrayFromSet(set) { + const values = []; + set.forEach(value => { + values.push(value); + }); + return values; +} +export default function inspectSet(set, options) { + if (set.size === 0) + return 'Set{}'; + options.truncate -= 7; + return `Set{ ${inspectList(arrayFromSet(set), options)} }`; +} diff --git a/tools/ui/node_modules/loupe/lib/string.d.ts b/tools/ui/node_modules/loupe/lib/string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e178fb0a79ec33928cb9c00d0ff0d1451ac60c4 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/string.d.ts @@ -0,0 +1,3 @@ +import type { Options } from './types.js'; +export default function inspectString(string: string, options: Options): string; +//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/string.d.ts.map b/tools/ui/node_modules/loupe/lib/string.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..0471e49d18bc8b47897016db5e36311f1a3caf18 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AA2BzC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAK9E"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/string.js b/tools/ui/node_modules/loupe/lib/string.js new file mode 100644 index 0000000000000000000000000000000000000000..49c966580a8abfff4758d1c2785144dd18300761 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/string.js @@ -0,0 +1,24 @@ +import { truncate } from './helpers.js'; +const stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5" + + '\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', 'g'); +const escapeCharacters = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + "'": "\\'", + '\\': '\\\\', +}; +const hex = 16; +const unicodeLength = 4; +function escape(char) { + return (escapeCharacters[char] || + `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`); +} +export default function inspectString(string, options) { + if (stringEscapeChars.test(string)) { + string = string.replace(stringEscapeChars, escape); + } + return options.stylize(`'${truncate(string, options.truncate - 2)}'`, 'string'); +} diff --git a/tools/ui/node_modules/loupe/lib/symbol.d.ts b/tools/ui/node_modules/loupe/lib/symbol.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81015e73a14db5f49b68a09453ba0680c359aea0 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/symbol.d.ts @@ -0,0 +1,2 @@ +export default function inspectSymbol(value: Symbol): string; +//# sourceMappingURL=symbol.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/symbol.d.ts.map b/tools/ui/node_modules/loupe/lib/symbol.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..45786f134c260acfa0bb12d62b180215f228d166 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/symbol.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK3D"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/symbol.js b/tools/ui/node_modules/loupe/lib/symbol.js new file mode 100644 index 0000000000000000000000000000000000000000..ca8dd68edd674c2b2c71b6a6902e363f5d483275 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/symbol.js @@ -0,0 +1,6 @@ +export default function inspectSymbol(value) { + if ('description' in Symbol.prototype) { + return value.description ? `Symbol(${value.description})` : 'Symbol()'; + } + return value.toString(); +} diff --git a/tools/ui/node_modules/loupe/lib/typedarray.d.ts b/tools/ui/node_modules/loupe/lib/typedarray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0bdc4ecf448457155afbfb3c04685f812ccb24c2 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/typedarray.d.ts @@ -0,0 +1,5 @@ +import type { Options } from './types.js'; +type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; +export default function inspectTypedArray(array: TypedArray, options: Options): string; +export {}; +//# sourceMappingURL=typedarray.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/typedarray.d.ts.map b/tools/ui/node_modules/loupe/lib/typedarray.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6d11f73985a0103ba964fa984ee7613f39be882c --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/typedarray.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typedarray.d.ts","sourceRoot":"","sources":["../src/typedarray.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAW,OAAO,EAAE,MAAM,YAAY,CAAA;AAElD,KAAK,UAAU,GACX,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,YAAY,GACZ,YAAY,CAAA;AAchB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CA8BrF"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/typedarray.js b/tools/ui/node_modules/loupe/lib/typedarray.js new file mode 100644 index 0000000000000000000000000000000000000000..e8257f69269aad648f73ac8cf560ac8caf0705bb --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/typedarray.js @@ -0,0 +1,38 @@ +import { inspectList, inspectProperty, truncate, truncator } from './helpers.js'; +const getArrayName = (array) => { + // We need to special case Node.js' Buffers, which report to be Uint8Array + // @ts-ignore + if (typeof Buffer === 'function' && array instanceof Buffer) { + return 'Buffer'; + } + if (array[Symbol.toStringTag]) { + return array[Symbol.toStringTag]; + } + return array.constructor.name; +}; +export default function inspectTypedArray(array, options) { + const name = getArrayName(array); + options.truncate -= name.length + 4; + // Object.keys will always output the Array indices first, so we can slice by + // `array.length` to get non-index properties + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) + return `${name}[]`; + // As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply + // stylise the toString() value of them + let output = ''; + for (let i = 0; i < array.length; i++) { + const string = `${options.stylize(truncate(array[i], options.truncate), 'number')}${i === array.length - 1 ? '' : ', '}`; + options.truncate -= string.length; + if (array[i] !== array.length && options.truncate <= 3) { + output += `${truncator}(${array.length - array[i] + 1})`; + break; + } + output += string; + } + let propertyContents = ''; + if (nonIndexProperties.length) { + propertyContents = inspectList(nonIndexProperties.map(key => [key, array[key]]), options, inspectProperty); + } + return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ''} ]`; +} diff --git a/tools/ui/node_modules/loupe/lib/types.d.ts b/tools/ui/node_modules/loupe/lib/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1abae2373bb18efdc124f21f1a9751c8d8773fa1 --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/types.d.ts @@ -0,0 +1,15 @@ +export type Inspect = (value: unknown, options: Options) => string; +export interface Options { + showHidden: boolean; + depth: number; + colors: boolean; + customInspect: boolean; + showProxy: boolean; + maxArrayLength: number; + breakLength: number; + truncate: number; + seen: unknown[]; + inspect: Inspect; + stylize: (value: string, styleType: string) => string; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/types.d.ts.map b/tools/ui/node_modules/loupe/lib/types.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e0ab591ff31096379afc794775d031be6a30da8f --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;AAElE,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,aAAa,EAAE,OAAO,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;CACtD"} \ No newline at end of file diff --git a/tools/ui/node_modules/loupe/lib/types.js b/tools/ui/node_modules/loupe/lib/types.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/loupe/lib/types.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/loupe/loupe.js b/tools/ui/node_modules/loupe/loupe.js new file mode 100644 index 0000000000000000000000000000000000000000..a90bcbc712e965e68b2887fb184874d733172e03 --- /dev/null +++ b/tools/ui/node_modules/loupe/loupe.js @@ -0,0 +1,622 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + custom: () => custom, + default: () => index_default, + inspect: () => inspect, + registerConstructor: () => registerConstructor, + registerStringTag: () => registerStringTag +}); +module.exports = __toCommonJS(index_exports); + +// src/helpers.ts +var ansiColors = { + bold: ["1", "22"], + dim: ["2", "22"], + italic: ["3", "23"], + underline: ["4", "24"], + // 5 & 6 are blinking + inverse: ["7", "27"], + hidden: ["8", "28"], + strike: ["9", "29"], + // 10-20 are fonts + // 21-29 are resets for 1-9 + black: ["30", "39"], + red: ["31", "39"], + green: ["32", "39"], + yellow: ["33", "39"], + blue: ["34", "39"], + magenta: ["35", "39"], + cyan: ["36", "39"], + white: ["37", "39"], + brightblack: ["30;1", "39"], + brightred: ["31;1", "39"], + brightgreen: ["32;1", "39"], + brightyellow: ["33;1", "39"], + brightblue: ["34;1", "39"], + brightmagenta: ["35;1", "39"], + brightcyan: ["36;1", "39"], + brightwhite: ["37;1", "39"], + grey: ["90", "39"] +}; +var styles = { + special: "cyan", + number: "yellow", + bigint: "yellow", + boolean: "yellow", + undefined: "grey", + null: "bold", + string: "green", + symbol: "green", + date: "magenta", + regexp: "red" +}; +var truncator = "\u2026"; +function colorise(value, styleType) { + const color = ansiColors[styles[styleType]] || ansiColors[styleType] || ""; + if (!color) { + return String(value); + } + return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`; +} +function normaliseOptions({ + showHidden = false, + depth = 2, + colors = false, + customInspect = true, + showProxy = false, + maxArrayLength = Infinity, + breakLength = Infinity, + seen = [], + // eslint-disable-next-line no-shadow + truncate: truncate2 = Infinity, + stylize = String +} = {}, inspect2) { + const options = { + showHidden: Boolean(showHidden), + depth: Number(depth), + colors: Boolean(colors), + customInspect: Boolean(customInspect), + showProxy: Boolean(showProxy), + maxArrayLength: Number(maxArrayLength), + breakLength: Number(breakLength), + truncate: Number(truncate2), + seen, + inspect: inspect2, + stylize + }; + if (options.colors) { + options.stylize = colorise; + } + return options; +} +function isHighSurrogate(char) { + return char >= "\uD800" && char <= "\uDBFF"; +} +function truncate(string, length, tail = truncator) { + string = String(string); + const tailLength = tail.length; + const stringLength = string.length; + if (tailLength > length && stringLength > tailLength) { + return tail; + } + if (stringLength > length && stringLength > tailLength) { + let end = length - tailLength; + if (end > 0 && isHighSurrogate(string[end - 1])) { + end = end - 1; + } + return `${string.slice(0, end)}${tail}`; + } + return string; +} +function inspectList(list, options, inspectItem, separator = ", ") { + inspectItem = inspectItem || options.inspect; + const size = list.length; + if (size === 0) return ""; + const originalLength = options.truncate; + let output = ""; + let peek = ""; + let truncated = ""; + for (let i = 0; i < size; i += 1) { + const last = i + 1 === list.length; + const secondToLast = i + 2 === list.length; + truncated = `${truncator}(${list.length - i})`; + const value = list[i]; + options.truncate = originalLength - output.length - (last ? 0 : separator.length); + const string = peek || inspectItem(value, options) + (last ? "" : separator); + const nextLength = output.length + string.length; + const truncatedLength = nextLength + truncated.length; + if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) { + break; + } + if (!last && !secondToLast && truncatedLength > originalLength) { + break; + } + peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator); + if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) { + break; + } + output += string; + if (!last && !secondToLast && nextLength + peek.length >= originalLength) { + truncated = `${truncator}(${list.length - i - 1})`; + break; + } + truncated = ""; + } + return `${output}${truncated}`; +} +function quoteComplexKey(key) { + if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { + return key; + } + return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); +} +function inspectProperty([key, value], options) { + options.truncate -= 2; + if (typeof key === "string") { + key = quoteComplexKey(key); + } else if (typeof key !== "number") { + key = `[${options.inspect(key, options)}]`; + } + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key}: ${value}`; +} + +// src/array.ts +function inspectArray(array, options) { + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) return "[]"; + options.truncate -= 4; + const listContents = inspectList(array, options); + options.truncate -= listContents.length; + let propertyContents = ""; + if (nonIndexProperties.length) { + propertyContents = inspectList( + nonIndexProperties.map((key) => [key, array[key]]), + options, + inspectProperty + ); + } + return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`; +} + +// src/typedarray.ts +var getArrayName = (array) => { + if (typeof Buffer === "function" && array instanceof Buffer) { + return "Buffer"; + } + if (array[Symbol.toStringTag]) { + return array[Symbol.toStringTag]; + } + return array.constructor.name; +}; +function inspectTypedArray(array, options) { + const name = getArrayName(array); + options.truncate -= name.length + 4; + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) return `${name}[]`; + let output = ""; + for (let i = 0; i < array.length; i++) { + const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`; + options.truncate -= string.length; + if (array[i] !== array.length && options.truncate <= 3) { + output += `${truncator}(${array.length - array[i] + 1})`; + break; + } + output += string; + } + let propertyContents = ""; + if (nonIndexProperties.length) { + propertyContents = inspectList( + nonIndexProperties.map((key) => [key, array[key]]), + options, + inspectProperty + ); + } + return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`; +} + +// src/date.ts +function inspectDate(dateObject, options) { + const stringRepresentation = dateObject.toJSON(); + if (stringRepresentation === null) { + return "Invalid Date"; + } + const split = stringRepresentation.split("T"); + const date = split[0]; + return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date"); +} + +// src/function.ts +function inspectFunction(func, options) { + const functionType = func[Symbol.toStringTag] || "Function"; + const name = func.name; + if (!name) { + return options.stylize(`[${functionType}]`, "special"); + } + return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special"); +} + +// src/map.ts +function inspectMapEntry([key, value], options) { + options.truncate -= 4; + key = options.inspect(key, options); + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key} => ${value}`; +} +function mapToEntries(map) { + const entries = []; + map.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +} +function inspectMap(map, options) { + if (map.size === 0) return "Map{}"; + options.truncate -= 7; + return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`; +} + +// src/number.ts +var isNaN = Number.isNaN || ((i) => i !== i); +function inspectNumber(number, options) { + if (isNaN(number)) { + return options.stylize("NaN", "number"); + } + if (number === Infinity) { + return options.stylize("Infinity", "number"); + } + if (number === -Infinity) { + return options.stylize("-Infinity", "number"); + } + if (number === 0) { + return options.stylize(1 / number === Infinity ? "+0" : "-0", "number"); + } + return options.stylize(truncate(String(number), options.truncate), "number"); +} + +// src/bigint.ts +function inspectBigInt(number, options) { + let nums = truncate(number.toString(), options.truncate - 1); + if (nums !== truncator) nums += "n"; + return options.stylize(nums, "bigint"); +} + +// src/regexp.ts +function inspectRegExp(value, options) { + const flags = value.toString().split("/")[2]; + const sourceLength = options.truncate - (2 + flags.length); + const source = value.source; + return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp"); +} + +// src/set.ts +function arrayFromSet(set) { + const values = []; + set.forEach((value) => { + values.push(value); + }); + return values; +} +function inspectSet(set, options) { + if (set.size === 0) return "Set{}"; + options.truncate -= 7; + return `Set{ ${inspectList(arrayFromSet(set), options)} }`; +} + +// src/string.ts +var stringEscapeChars = new RegExp( + "['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", + "g" +); +var escapeCharacters = { + "\b": "\\b", + " ": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + "'": "\\'", + "\\": "\\\\" +}; +var hex = 16; +var unicodeLength = 4; +function escape(char) { + return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`; +} +function inspectString(string, options) { + if (stringEscapeChars.test(string)) { + string = string.replace(stringEscapeChars, escape); + } + return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string"); +} + +// src/symbol.ts +function inspectSymbol(value) { + if ("description" in Symbol.prototype) { + return value.description ? `Symbol(${value.description})` : "Symbol()"; + } + return value.toString(); +} + +// src/promise.ts +var getPromiseValue = () => "Promise{\u2026}"; +var promise_default = getPromiseValue; + +// src/object.ts +function inspectObject(object, options) { + const properties = Object.getOwnPropertyNames(object); + const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : []; + if (properties.length === 0 && symbols.length === 0) { + return "{}"; + } + options.truncate -= 4; + options.seen = options.seen || []; + if (options.seen.includes(object)) { + return "[Circular]"; + } + options.seen.push(object); + const propertyContents = inspectList( + properties.map((key) => [key, object[key]]), + options, + inspectProperty + ); + const symbolContents = inspectList( + symbols.map((key) => [key, object[key]]), + options, + inspectProperty + ); + options.seen.pop(); + let sep = ""; + if (propertyContents && symbolContents) { + sep = ", "; + } + return `{ ${propertyContents}${sep}${symbolContents} }`; +} + +// src/class.ts +var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false; +function inspectClass(value, options) { + let name = ""; + if (toStringTag && toStringTag in value) { + name = value[toStringTag]; + } + name = name || value.constructor.name; + if (!name || name === "_class") { + name = ""; + } + options.truncate -= name.length; + return `${name}${inspectObject(value, options)}`; +} + +// src/arguments.ts +function inspectArguments(args, options) { + if (args.length === 0) return "Arguments[]"; + options.truncate -= 13; + return `Arguments[ ${inspectList(args, options)} ]`; +} + +// src/error.ts +var errorKeys = [ + "stack", + "line", + "column", + "name", + "message", + "fileName", + "lineNumber", + "columnNumber", + "number", + "description", + "cause" +]; +function inspectObject2(error, options) { + const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1); + const name = error.name; + options.truncate -= name.length; + let message = ""; + if (typeof error.message === "string") { + message = truncate(error.message, options.truncate); + } else { + properties.unshift("message"); + } + message = message ? `: ${message}` : ""; + options.truncate -= message.length + 5; + options.seen = options.seen || []; + if (options.seen.includes(error)) { + return "[Circular]"; + } + options.seen.push(error); + const propertyContents = inspectList( + properties.map((key) => [key, error[key]]), + options, + inspectProperty + ); + return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`; +} + +// src/html.ts +function inspectAttribute([key, value], options) { + options.truncate -= 3; + if (!value) { + return `${options.stylize(String(key), "yellow")}`; + } + return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`; +} +function inspectNodeCollection(collection, options) { + return inspectList(collection, options, inspectNode, "\n"); +} +function inspectNode(node, options) { + switch (node.nodeType) { + case 1: + return inspectHTML(node, options); + case 3: + return options.inspect(node.data, options); + default: + return options.inspect(node, options); + } +} +function inspectHTML(element, options) { + const properties = element.getAttributeNames(); + const name = element.tagName.toLowerCase(); + const head = options.stylize(`<${name}`, "special"); + const headClose = options.stylize(`>`, "special"); + const tail = options.stylize(``, "special"); + options.truncate -= name.length * 2 + 5; + let propertyContents = ""; + if (properties.length > 0) { + propertyContents += " "; + propertyContents += inspectList( + properties.map((key) => [key, element.getAttribute(key)]), + options, + inspectAttribute, + " " + ); + } + options.truncate -= propertyContents.length; + const truncate2 = options.truncate; + let children = inspectNodeCollection(element.children, options); + if (children && children.length > truncate2) { + children = `${truncator}(${element.children.length})`; + } + return `${head}${propertyContents}${headClose}${children}${tail}`; +} + +// src/index.ts +var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function"; +var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect"; +var nodeInspect = Symbol.for("nodejs.util.inspect.custom"); +var constructorMap = /* @__PURE__ */ new WeakMap(); +var stringTagMap = {}; +var baseTypesMap = { + undefined: (value, options) => options.stylize("undefined", "undefined"), + null: (value, options) => options.stylize("null", "null"), + boolean: (value, options) => options.stylize(String(value), "boolean"), + Boolean: (value, options) => options.stylize(String(value), "boolean"), + number: inspectNumber, + Number: inspectNumber, + bigint: inspectBigInt, + BigInt: inspectBigInt, + string: inspectString, + String: inspectString, + function: inspectFunction, + Function: inspectFunction, + symbol: inspectSymbol, + // A Symbol polyfill will return `Symbol` not `symbol` from typedetect + Symbol: inspectSymbol, + Array: inspectArray, + Date: inspectDate, + Map: inspectMap, + Set: inspectSet, + RegExp: inspectRegExp, + Promise: promise_default, + // WeakSet, WeakMap are totally opaque to us + WeakSet: (value, options) => options.stylize("WeakSet{\u2026}", "special"), + WeakMap: (value, options) => options.stylize("WeakMap{\u2026}", "special"), + Arguments: inspectArguments, + Int8Array: inspectTypedArray, + Uint8Array: inspectTypedArray, + Uint8ClampedArray: inspectTypedArray, + Int16Array: inspectTypedArray, + Uint16Array: inspectTypedArray, + Int32Array: inspectTypedArray, + Uint32Array: inspectTypedArray, + Float32Array: inspectTypedArray, + Float64Array: inspectTypedArray, + Generator: () => "", + DataView: () => "", + ArrayBuffer: () => "", + Error: inspectObject2, + HTMLCollection: inspectNodeCollection, + NodeList: inspectNodeCollection +}; +var inspectCustom = (value, options, type, inspectFn) => { + if (chaiInspect in value && typeof value[chaiInspect] === "function") { + return value[chaiInspect](options); + } + if (nodeInspect in value && typeof value[nodeInspect] === "function") { + return value[nodeInspect](options.depth, options, inspectFn); + } + if ("inspect" in value && typeof value.inspect === "function") { + return value.inspect(options.depth, options); + } + if ("constructor" in value && constructorMap.has(value.constructor)) { + return constructorMap.get(value.constructor)(value, options); + } + if (stringTagMap[type]) { + return stringTagMap[type](value, options); + } + return ""; +}; +var toString = Object.prototype.toString; +function inspect(value, opts = {}) { + const options = normaliseOptions(opts, inspect); + const { customInspect } = options; + let type = value === null ? "null" : typeof value; + if (type === "object") { + type = toString.call(value).slice(8, -1); + } + if (type in baseTypesMap) { + return baseTypesMap[type](value, options); + } + if (customInspect && value) { + const output = inspectCustom(value, options, type, inspect); + if (output) { + if (typeof output === "string") return output; + return inspect(output, options); + } + } + const proto = value ? Object.getPrototypeOf(value) : false; + if (proto === Object.prototype || proto === null) { + return inspectObject(value, options); + } + if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) { + return inspectHTML(value, options); + } + if ("constructor" in value) { + if (value.constructor !== Object) { + return inspectClass(value, options); + } + return inspectObject(value, options); + } + if (value === Object(value)) { + return inspectObject(value, options); + } + return options.stylize(String(value), type); +} +function registerConstructor(constructor, inspector) { + if (constructorMap.has(constructor)) { + return false; + } + constructorMap.set(constructor, inspector); + return true; +} +function registerStringTag(stringTag, inspector) { + if (stringTag in stringTagMap) { + return false; + } + stringTagMap[stringTag] = inspector; + return true; +} +var custom = chaiInspect; +var index_default = inspect; diff --git a/tools/ui/node_modules/loupe/package.json b/tools/ui/node_modules/loupe/package.json new file mode 100644 index 0000000000000000000000000000000000000000..de69efdbc4cb6c109acc97149706c1fff1e463b8 --- /dev/null +++ b/tools/ui/node_modules/loupe/package.json @@ -0,0 +1,73 @@ +{ + "name": "loupe", + "version": "3.2.1", + "description": "Inspect utility for Node.js and browsers", + "homepage": "https://github.com/chaijs/loupe", + "license": "MIT", + "author": "Veselin Todorov ", + "contributors": [ + "Keith Cirkel (https://github.com/keithamus)" + ], + "type": "module", + "main": "./lib/index.js", + "module": "./lib/index.js", + "browser": { + "./index.js": "./loupe.js", + "util": false + }, + "repository": { + "type": "git", + "url": "https://github.com/chaijs/loupe" + }, + "files": [ + "loupe.js", + "lib/*" + ], + "scripts": { + "bench": "node bench", + "lint": "eslint .", + "semantic-release": "semantic-release pre && npm publish && semantic-release post", + "test": "npm run test:node && npm run test:browser", + "pretest:browser": "npx playwright install-deps && npx playwright install && npm run build", + "test:browser": "wtr", + "pretest:node": "npm run build", + "test:node": "mocha", + "build": "npm run build:lib && npm run build:esm-bundle && npm run build:cjs-bundle", + "build:lib": "tsc", + "build:esm-bundle": "esbuild --bundle src/index.ts --outfile=loupe.js --format=esm", + "build:cjs-bundle": "esbuild --bundle src/index.ts --outfile=loupe.js --format=cjs", + "upload-coverage": "codecov" + }, + "prettier": { + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "trailingComma": "es5", + "arrowParens": "avoid", + "bracketSpacing": true + }, + "devDependencies": { + "@web/dev-server-esbuild": "^1.0.3", + "@web/test-runner": "^0.19.0", + "@web/test-runner-playwright": "^0.11.0", + "benchmark": "^2.1.4", + "chai": "^5.0.0-alpha.0", + "codecov": "^3.8.3", + "core-js": "^3.8.3", + "cross-env": "^7.0.3", + "esbuild": "^0.24.2", + "eslint": "^9.19.0", + "eslint-config-prettier": "^10.0.1", + "eslint-config-strict": "^14.0.1", + "eslint-plugin-filenames": "^1.3.2", + "eslint-plugin-prettier": "^5.2.3", + "husky": "^9.1.7", + "mocha": "^11.1.0", + "nyc": "^17.1.0", + "prettier": "^3.0.0", + "simple-assert": "^2.0.0", + "typescript": "^5.0.0-beta" + } +} diff --git a/tools/ui/node_modules/lowlight/index.d.ts b/tools/ui/node_modules/lowlight/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8b86090445d40fb9864166d4e89d6f51ef6d8ddf --- /dev/null +++ b/tools/ui/node_modules/lowlight/index.d.ts @@ -0,0 +1,22 @@ +export type {LanguageFn} from 'highlight.js' +export type {AutoOptions, Options} from './lib/index.js' +export {grammars as all} from './lib/all.js' +export {grammars as common} from './lib/common.js' +export {createLowlight} from './lib/index.js' + +// Register data on hast. +declare module 'hast' { + interface RootData { + /** + * Field exposed by `lowlight` to contain the detected programming language + * name. + */ + language?: string | undefined + + /** + * Field exposed by `lowlight` to contain a relevance: how sure `lowlight` + * is that the given code is in the language. + */ + relevance?: number | undefined + } +} diff --git a/tools/ui/node_modules/lowlight/index.js b/tools/ui/node_modules/lowlight/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dccb43e6d89cdd9230920de3add423d79e9ed003 --- /dev/null +++ b/tools/ui/node_modules/lowlight/index.js @@ -0,0 +1,4 @@ +// Note: types exposed from `index.d.ts`. +export {grammars as all} from './lib/all.js' +export {grammars as common} from './lib/common.js' +export {createLowlight} from './lib/index.js' diff --git a/tools/ui/node_modules/lowlight/lib/all.d.ts b/tools/ui/node_modules/lowlight/lib/all.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a689c61e72459f4b0ae03fafacc2789a4855c4aa --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/all.d.ts @@ -0,0 +1,8 @@ +/** + * Map of grammars. + * + * @type {Record} + */ +export const grammars: Record; +import type { LanguageFn } from 'highlight.js'; +//# sourceMappingURL=all.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/all.d.ts.map b/tools/ui/node_modules/lowlight/lib/all.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e292f8005e39c992dd97849a5b807634c3bab0b7 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/all.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["all.js"],"names":[],"mappings":"AAkKA;;;;GAIG;AACH,uBAFU,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA+JnC;gCAnU4B,cAAc"} \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/all.js b/tools/ui/node_modules/lowlight/lib/all.js new file mode 100644 index 0000000000000000000000000000000000000000..81e9b60f94c192df958577ff765b43a598ee255a --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/all.js @@ -0,0 +1,324 @@ +/** + * @import {LanguageFn} from 'highlight.js' + */ + +import $1c from 'highlight.js/lib/languages/1c' +import abnf from 'highlight.js/lib/languages/abnf' +import accesslog from 'highlight.js/lib/languages/accesslog' +import actionscript from 'highlight.js/lib/languages/actionscript' +import ada from 'highlight.js/lib/languages/ada' +import angelscript from 'highlight.js/lib/languages/angelscript' +import apache from 'highlight.js/lib/languages/apache' +import applescript from 'highlight.js/lib/languages/applescript' +import arcade from 'highlight.js/lib/languages/arcade' +import armasm from 'highlight.js/lib/languages/armasm' +import asciidoc from 'highlight.js/lib/languages/asciidoc' +import aspectj from 'highlight.js/lib/languages/aspectj' +import autohotkey from 'highlight.js/lib/languages/autohotkey' +import autoit from 'highlight.js/lib/languages/autoit' +import avrasm from 'highlight.js/lib/languages/avrasm' +import awk from 'highlight.js/lib/languages/awk' +import axapta from 'highlight.js/lib/languages/axapta' +import basic from 'highlight.js/lib/languages/basic' +import bnf from 'highlight.js/lib/languages/bnf' +import brainfuck from 'highlight.js/lib/languages/brainfuck' +import cal from 'highlight.js/lib/languages/cal' +import capnproto from 'highlight.js/lib/languages/capnproto' +import ceylon from 'highlight.js/lib/languages/ceylon' +import clean from 'highlight.js/lib/languages/clean' +import clojure from 'highlight.js/lib/languages/clojure' +import clojureRepl from 'highlight.js/lib/languages/clojure-repl' +import cmake from 'highlight.js/lib/languages/cmake' +import coffeescript from 'highlight.js/lib/languages/coffeescript' +import coq from 'highlight.js/lib/languages/coq' +import cos from 'highlight.js/lib/languages/cos' +import crmsh from 'highlight.js/lib/languages/crmsh' +import crystal from 'highlight.js/lib/languages/crystal' +import csp from 'highlight.js/lib/languages/csp' +import d from 'highlight.js/lib/languages/d' +import dart from 'highlight.js/lib/languages/dart' +import delphi from 'highlight.js/lib/languages/delphi' +import django from 'highlight.js/lib/languages/django' +import dns from 'highlight.js/lib/languages/dns' +import dockerfile from 'highlight.js/lib/languages/dockerfile' +import dos from 'highlight.js/lib/languages/dos' +import dsconfig from 'highlight.js/lib/languages/dsconfig' +import dts from 'highlight.js/lib/languages/dts' +import dust from 'highlight.js/lib/languages/dust' +import ebnf from 'highlight.js/lib/languages/ebnf' +import elixir from 'highlight.js/lib/languages/elixir' +import elm from 'highlight.js/lib/languages/elm' +import erb from 'highlight.js/lib/languages/erb' +import erlang from 'highlight.js/lib/languages/erlang' +import erlangRepl from 'highlight.js/lib/languages/erlang-repl' +import excel from 'highlight.js/lib/languages/excel' +import fix from 'highlight.js/lib/languages/fix' +import flix from 'highlight.js/lib/languages/flix' +import fortran from 'highlight.js/lib/languages/fortran' +import fsharp from 'highlight.js/lib/languages/fsharp' +import gams from 'highlight.js/lib/languages/gams' +import gauss from 'highlight.js/lib/languages/gauss' +import gcode from 'highlight.js/lib/languages/gcode' +import gherkin from 'highlight.js/lib/languages/gherkin' +import glsl from 'highlight.js/lib/languages/glsl' +import gml from 'highlight.js/lib/languages/gml' +import golo from 'highlight.js/lib/languages/golo' +import gradle from 'highlight.js/lib/languages/gradle' +import groovy from 'highlight.js/lib/languages/groovy' +import haml from 'highlight.js/lib/languages/haml' +import handlebars from 'highlight.js/lib/languages/handlebars' +import haskell from 'highlight.js/lib/languages/haskell' +import haxe from 'highlight.js/lib/languages/haxe' +import hsp from 'highlight.js/lib/languages/hsp' +import http from 'highlight.js/lib/languages/http' +import hy from 'highlight.js/lib/languages/hy' +import inform7 from 'highlight.js/lib/languages/inform7' +import irpf90 from 'highlight.js/lib/languages/irpf90' +import isbl from 'highlight.js/lib/languages/isbl' +import jbossCli from 'highlight.js/lib/languages/jboss-cli' +import julia from 'highlight.js/lib/languages/julia' +import juliaRepl from 'highlight.js/lib/languages/julia-repl' +import lasso from 'highlight.js/lib/languages/lasso' +import latex from 'highlight.js/lib/languages/latex' +import ldif from 'highlight.js/lib/languages/ldif' +import leaf from 'highlight.js/lib/languages/leaf' +import lisp from 'highlight.js/lib/languages/lisp' +import livecodeserver from 'highlight.js/lib/languages/livecodeserver' +import livescript from 'highlight.js/lib/languages/livescript' +import llvm from 'highlight.js/lib/languages/llvm' +import lsl from 'highlight.js/lib/languages/lsl' +import mathematica from 'highlight.js/lib/languages/mathematica' +import matlab from 'highlight.js/lib/languages/matlab' +import maxima from 'highlight.js/lib/languages/maxima' +import mel from 'highlight.js/lib/languages/mel' +import mercury from 'highlight.js/lib/languages/mercury' +import mipsasm from 'highlight.js/lib/languages/mipsasm' +import mizar from 'highlight.js/lib/languages/mizar' +import mojolicious from 'highlight.js/lib/languages/mojolicious' +import monkey from 'highlight.js/lib/languages/monkey' +import moonscript from 'highlight.js/lib/languages/moonscript' +import n1ql from 'highlight.js/lib/languages/n1ql' +import nestedtext from 'highlight.js/lib/languages/nestedtext' +import nginx from 'highlight.js/lib/languages/nginx' +import nim from 'highlight.js/lib/languages/nim' +import nix from 'highlight.js/lib/languages/nix' +import nodeRepl from 'highlight.js/lib/languages/node-repl' +import nsis from 'highlight.js/lib/languages/nsis' +import ocaml from 'highlight.js/lib/languages/ocaml' +import openscad from 'highlight.js/lib/languages/openscad' +import oxygene from 'highlight.js/lib/languages/oxygene' +import parser3 from 'highlight.js/lib/languages/parser3' +import pf from 'highlight.js/lib/languages/pf' +import pgsql from 'highlight.js/lib/languages/pgsql' +import pony from 'highlight.js/lib/languages/pony' +import powershell from 'highlight.js/lib/languages/powershell' +import processing from 'highlight.js/lib/languages/processing' +import profile from 'highlight.js/lib/languages/profile' +import prolog from 'highlight.js/lib/languages/prolog' +import properties from 'highlight.js/lib/languages/properties' +import protobuf from 'highlight.js/lib/languages/protobuf' +import puppet from 'highlight.js/lib/languages/puppet' +import purebasic from 'highlight.js/lib/languages/purebasic' +import q from 'highlight.js/lib/languages/q' +import qml from 'highlight.js/lib/languages/qml' +import reasonml from 'highlight.js/lib/languages/reasonml' +import rib from 'highlight.js/lib/languages/rib' +import roboconf from 'highlight.js/lib/languages/roboconf' +import routeros from 'highlight.js/lib/languages/routeros' +import rsl from 'highlight.js/lib/languages/rsl' +import ruleslanguage from 'highlight.js/lib/languages/ruleslanguage' +import sas from 'highlight.js/lib/languages/sas' +import scala from 'highlight.js/lib/languages/scala' +import scheme from 'highlight.js/lib/languages/scheme' +import scilab from 'highlight.js/lib/languages/scilab' +import smali from 'highlight.js/lib/languages/smali' +import smalltalk from 'highlight.js/lib/languages/smalltalk' +import sml from 'highlight.js/lib/languages/sml' +import sqf from 'highlight.js/lib/languages/sqf' +import stan from 'highlight.js/lib/languages/stan' +import stata from 'highlight.js/lib/languages/stata' +import step21 from 'highlight.js/lib/languages/step21' +import stylus from 'highlight.js/lib/languages/stylus' +import subunit from 'highlight.js/lib/languages/subunit' +import taggerscript from 'highlight.js/lib/languages/taggerscript' +import tap from 'highlight.js/lib/languages/tap' +import tcl from 'highlight.js/lib/languages/tcl' +import thrift from 'highlight.js/lib/languages/thrift' +import tp from 'highlight.js/lib/languages/tp' +import twig from 'highlight.js/lib/languages/twig' +import vala from 'highlight.js/lib/languages/vala' +import vbscript from 'highlight.js/lib/languages/vbscript' +import vbscriptHtml from 'highlight.js/lib/languages/vbscript-html' +import verilog from 'highlight.js/lib/languages/verilog' +import vhdl from 'highlight.js/lib/languages/vhdl' +import vim from 'highlight.js/lib/languages/vim' +import wren from 'highlight.js/lib/languages/wren' +import x86asm from 'highlight.js/lib/languages/x86asm' +import xl from 'highlight.js/lib/languages/xl' +import xquery from 'highlight.js/lib/languages/xquery' +import zephir from 'highlight.js/lib/languages/zephir' +import {grammars as base} from './common.js' + +/** + * Map of grammars. + * + * @type {Record} + */ +export const grammars = { + ...base, + '1c': $1c, + abnf, + accesslog, + actionscript, + ada, + angelscript, + apache, + applescript, + arcade, + armasm, + asciidoc, + aspectj, + autohotkey, + autoit, + avrasm, + awk, + axapta, + basic, + bnf, + brainfuck, + cal, + capnproto, + ceylon, + clean, + clojure, + 'clojure-repl': clojureRepl, + cmake, + coffeescript, + coq, + cos, + crmsh, + crystal, + csp, + d, + dart, + delphi, + django, + dns, + dockerfile, + dos, + dsconfig, + dts, + dust, + ebnf, + elixir, + elm, + erb, + erlang, + 'erlang-repl': erlangRepl, + excel, + fix, + flix, + fortran, + fsharp, + gams, + gauss, + gcode, + gherkin, + glsl, + gml, + golo, + gradle, + groovy, + haml, + handlebars, + haskell, + haxe, + hsp, + http, + hy, + inform7, + irpf90, + isbl, + 'jboss-cli': jbossCli, + julia, + 'julia-repl': juliaRepl, + lasso, + latex, + ldif, + leaf, + lisp, + livecodeserver, + livescript, + llvm, + lsl, + mathematica, + matlab, + maxima, + mel, + mercury, + mipsasm, + mizar, + mojolicious, + monkey, + moonscript, + n1ql, + nestedtext, + nginx, + nim, + nix, + 'node-repl': nodeRepl, + nsis, + ocaml, + openscad, + oxygene, + parser3, + pf, + pgsql, + pony, + powershell, + processing, + profile, + prolog, + properties, + protobuf, + puppet, + purebasic, + q, + qml, + reasonml, + rib, + roboconf, + routeros, + rsl, + ruleslanguage, + sas, + scala, + scheme, + scilab, + smali, + smalltalk, + sml, + sqf, + stan, + stata, + step21, + stylus, + subunit, + taggerscript, + tap, + tcl, + thrift, + tp, + twig, + vala, + vbscript, + 'vbscript-html': vbscriptHtml, + verilog, + vhdl, + vim, + wren, + x86asm, + xl, + xquery, + zephir +} diff --git a/tools/ui/node_modules/lowlight/lib/common.d.ts b/tools/ui/node_modules/lowlight/lib/common.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11db966123a6231dbcb43f5a939caf3998060687 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/common.d.ts @@ -0,0 +1,8 @@ +/** + * Map of grammars. + * + * @type {Record} + */ +export const grammars: Record; +import type { LanguageFn } from 'highlight.js'; +//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/common.d.ts.map b/tools/ui/node_modules/lowlight/lib/common.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..72165fdae2f0e0f261b8d166ac27700344e05d13 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/common.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.js"],"names":[],"mappings":"AA2CA;;;;GAIG;AACH,uBAFU,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAwCnC;gCArF4B,cAAc"} \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/common.js b/tools/ui/node_modules/lowlight/lib/common.js new file mode 100644 index 0000000000000000000000000000000000000000..2e691773b7e857d1f8d0040d693d57cd27fe07a6 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/common.js @@ -0,0 +1,86 @@ +/** + * @import {LanguageFn} from 'highlight.js' + */ + +import arduino from 'highlight.js/lib/languages/arduino' +import bash from 'highlight.js/lib/languages/bash' +import c from 'highlight.js/lib/languages/c' +import cpp from 'highlight.js/lib/languages/cpp' +import csharp from 'highlight.js/lib/languages/csharp' +import css from 'highlight.js/lib/languages/css' +import diff from 'highlight.js/lib/languages/diff' +import go from 'highlight.js/lib/languages/go' +import graphql from 'highlight.js/lib/languages/graphql' +import ini from 'highlight.js/lib/languages/ini' +import java from 'highlight.js/lib/languages/java' +import javascript from 'highlight.js/lib/languages/javascript' +import json from 'highlight.js/lib/languages/json' +import kotlin from 'highlight.js/lib/languages/kotlin' +import less from 'highlight.js/lib/languages/less' +import lua from 'highlight.js/lib/languages/lua' +import makefile from 'highlight.js/lib/languages/makefile' +import markdown from 'highlight.js/lib/languages/markdown' +import objectivec from 'highlight.js/lib/languages/objectivec' +import perl from 'highlight.js/lib/languages/perl' +import php from 'highlight.js/lib/languages/php' +import phpTemplate from 'highlight.js/lib/languages/php-template' +import plaintext from 'highlight.js/lib/languages/plaintext' +import python from 'highlight.js/lib/languages/python' +import pythonRepl from 'highlight.js/lib/languages/python-repl' +import r from 'highlight.js/lib/languages/r' +import ruby from 'highlight.js/lib/languages/ruby' +import rust from 'highlight.js/lib/languages/rust' +import scss from 'highlight.js/lib/languages/scss' +import shell from 'highlight.js/lib/languages/shell' +import sql from 'highlight.js/lib/languages/sql' +import swift from 'highlight.js/lib/languages/swift' +import typescript from 'highlight.js/lib/languages/typescript' +import vbnet from 'highlight.js/lib/languages/vbnet' +import wasm from 'highlight.js/lib/languages/wasm' +import xml from 'highlight.js/lib/languages/xml' +import yaml from 'highlight.js/lib/languages/yaml' + +/** + * Map of grammars. + * + * @type {Record} + */ +export const grammars = { + arduino, + bash, + c, + cpp, + csharp, + css, + diff, + go, + graphql, + ini, + java, + javascript, + json, + kotlin, + less, + lua, + makefile, + markdown, + objectivec, + perl, + php, + 'php-template': phpTemplate, + plaintext, + python, + 'python-repl': pythonRepl, + r, + ruby, + rust, + scss, + shell, + sql, + swift, + typescript, + vbnet, + wasm, + xml, + yaml +} diff --git a/tools/ui/node_modules/lowlight/lib/index.d.ts b/tools/ui/node_modules/lowlight/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3b6f0575616ae9724975bd098bda7339150aa24 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/index.d.ts @@ -0,0 +1,197 @@ +/** + * Create a `lowlight` instance. + * + * @param {Readonly> | null | undefined} [grammars] + * Grammars to add (optional). + * @returns + * Lowlight. + */ +export function createLowlight(grammars?: Readonly> | null | undefined): { + highlight: (language: string, value: string, options?: Readonly | null | undefined) => Root; + highlightAuto: (value: string, options?: Readonly | null | undefined) => Root; + listLanguages: () => Array; + register: { + /** + * Register languages. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import xml from 'highlight.js/lib/languages/xml' + * + * const lowlight = createLowlight() + * + * lowlight.register({xml}) + * + * // Note: `html` is an alias for `xml`. + * console.log(lowlight.highlight('html', 'Emphasis')) + * ``` + * + * Yields: + * + * ```js + * {type: 'root', children: [Array], data: {language: 'html', relevance: 2}} + * ``` + * + * @overload + * @param {Readonly>} grammars + * @returns {undefined} + * + * @overload + * @param {string} name + * @param {LanguageFn} grammar + * @returns {undefined} + * + * @param {Readonly> | string} grammarsOrName + * Grammars or programming language name. + * @param {LanguageFn | undefined} [grammar] + * Grammar, if with name. + * @returns {undefined} + * Nothing. + */ + (grammars: Readonly>): undefined; + /** + * Register languages. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import xml from 'highlight.js/lib/languages/xml' + * + * const lowlight = createLowlight() + * + * lowlight.register({xml}) + * + * // Note: `html` is an alias for `xml`. + * console.log(lowlight.highlight('html', 'Emphasis')) + * ``` + * + * Yields: + * + * ```js + * {type: 'root', children: [Array], data: {language: 'html', relevance: 2}} + * ``` + * + * @overload + * @param {Readonly>} grammars + * @returns {undefined} + * + * @overload + * @param {string} name + * @param {LanguageFn} grammar + * @returns {undefined} + * + * @param {Readonly> | string} grammarsOrName + * Grammars or programming language name. + * @param {LanguageFn | undefined} [grammar] + * Grammar, if with name. + * @returns {undefined} + * Nothing. + */ + (name: string, grammar: LanguageFn): undefined; + }; + registerAlias: { + /** + * Register aliases. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import markdown from 'highlight.js/lib/languages/markdown' + * + * const lowlight = createLowlight() + * + * lowlight.register({markdown}) + * + * // lowlight.highlight('mdown', 'Emphasis') + * // ^ would throw: Error: Unknown language: `mdown` is not registered + * + * lowlight.registerAlias({markdown: ['mdown', 'mkdn', 'mdwn', 'ron']}) + * lowlight.highlight('mdown', 'Emphasis') + * // ^ Works! + * ``` + * + * @overload + * @param {Readonly | string>>} aliases + * @returns {undefined} + * + * @overload + * @param {string} language + * @param {ReadonlyArray | string} alias + * @returns {undefined} + * + * @param {Readonly | string>> | string} aliasesOrName + * Map of programming language names to one or more aliases, or programming + * language name. + * @param {ReadonlyArray | string | undefined} [alias] + * One or more aliases for the programming language, if with `name`. + * @returns {undefined} + * Nothing. + */ + (aliases: Readonly | string>>): undefined; + /** + * Register aliases. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import markdown from 'highlight.js/lib/languages/markdown' + * + * const lowlight = createLowlight() + * + * lowlight.register({markdown}) + * + * // lowlight.highlight('mdown', 'Emphasis') + * // ^ would throw: Error: Unknown language: `mdown` is not registered + * + * lowlight.registerAlias({markdown: ['mdown', 'mkdn', 'mdwn', 'ron']}) + * lowlight.highlight('mdown', 'Emphasis') + * // ^ Works! + * ``` + * + * @overload + * @param {Readonly | string>>} aliases + * @returns {undefined} + * + * @overload + * @param {string} language + * @param {ReadonlyArray | string} alias + * @returns {undefined} + * + * @param {Readonly | string>> | string} aliasesOrName + * Map of programming language names to one or more aliases, or programming + * language name. + * @param {ReadonlyArray | string | undefined} [alias] + * One or more aliases for the programming language, if with `name`. + * @returns {undefined} + * Nothing. + */ + (language: string, alias: ReadonlyArray | string): undefined; + }; + registered: (aliasOrName: string) => boolean; +}; +/** + * Extra fields. + */ +export type ExtraOptions = { + /** + * List of allowed languages (default: all registered languages). + */ + subset?: ReadonlyArray | null | undefined; +}; +/** + * Configuration for `highlight`. + */ +export type Options = { + /** + * Class prefix (default: `'hljs-'`). + */ + prefix?: string | null | undefined; +}; +/** + * Configuration for `highlightAuto`. + */ +export type AutoOptions = Options & ExtraOptions; +import type { LanguageFn } from 'highlight.js'; +import type { Root } from 'hast'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/index.d.ts.map b/tools/ui/node_modules/lowlight/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..0d210bc56b91ed14d4f57b8f667e86bd502dcb94 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA4BA;;;;;;;GAOG;AACH,0CALW,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;0BAuCrD,MAAM,SAEN,MAAM,YAEN,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAElC,IAAI;2BA6DN,MAAM,YAEN,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,KAEtC,IAAI;yBA0DJ,KAAK,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA8Bf,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAClC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGX,MAAM,WACN,UAAU,GACR,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8CX,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,GACtD,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAGX,MAAM,SACN,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,GAC5B,SAAS;;8BAmDX,MAAM,KAEJ,OAAO;EAMrB;;;;;;;;aAlVa,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS;;;;;;;;;aAKxC,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;0BAG1B,OAAO,GAAG,YAAY;gCAdgD,cAAc;0BADvC,MAAM"} \ No newline at end of file diff --git a/tools/ui/node_modules/lowlight/lib/index.js b/tools/ui/node_modules/lowlight/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f1a74bae42b0687e8de8be3b22ad85d2d8ca42d6 --- /dev/null +++ b/tools/ui/node_modules/lowlight/lib/index.js @@ -0,0 +1,482 @@ +/** + * @import {ElementContent, Element, RootData, Root} from 'hast' + * @import {Emitter, HLJSOptions as HljsOptions, HighlightResult, LanguageFn} from 'highlight.js' + */ + +/** + * @typedef {Object} ExtraOptions + * Extra fields. + * @property {ReadonlyArray | null | undefined} [subset] + * List of allowed languages (default: all registered languages). + * + * @typedef Options + * Configuration for `highlight`. + * @property {string | null | undefined} [prefix='hljs-'] + * Class prefix (default: `'hljs-'`). + * + * @typedef {Options & ExtraOptions} AutoOptions + * Configuration for `highlightAuto`. + */ + +import {ok as assert} from 'devlop' +import HighlightJs from 'highlight.js/lib/core' + +/** @type {AutoOptions} */ +const emptyOptions = {} + +const defaultPrefix = 'hljs-' + +/** + * Create a `lowlight` instance. + * + * @param {Readonly> | null | undefined} [grammars] + * Grammars to add (optional). + * @returns + * Lowlight. + */ +export function createLowlight(grammars) { + const high = HighlightJs.newInstance() + + if (grammars) { + register(grammars) + } + + return { + highlight, + highlightAuto, + listLanguages, + register, + registerAlias, + registered + } + + /** + * Highlight `value` (code) as `language` (name). + * + * @example + * ```js + * import {common, createLowlight} from 'lowlight' + * + * const lowlight = createLowlight(common) + * + * console.log(lowlight.highlight('css', 'em { color: red }')) + * ``` + * + * Yields: + * + * ```js + * {type: 'root', children: [Array], data: {language: 'css', relevance: 3}} + * ``` + * + * @param {string} language + * Programming language name. + * @param {string} value + * Code to highlight. + * @param {Readonly | null | undefined} [options={}] + * Configuration (optional). + * @returns {Root} + * Tree; with the following `data` fields: `language` (`string`), detected + * programming language name; `relevance` (`number`), how sure lowlight is + * that the given code is in the language. + */ + function highlight(language, value, options) { + assert(typeof language === 'string', 'expected `string` as `name`') + assert(typeof value === 'string', 'expected `string` as `value`') + const settings = options || emptyOptions + const prefix = + typeof settings.prefix === 'string' ? settings.prefix : defaultPrefix + + if (!high.getLanguage(language)) { + throw new Error('Unknown language: `' + language + '` is not registered') + } + + // See: + high.configure({__emitter: HastEmitter, classPrefix: prefix}) + + const result = /** @type {HighlightResult & {_emitter: HastEmitter}} */ ( + high.highlight(value, {ignoreIllegals: true, language}) + ) + + // `highlight.js` seems to use this (currently) for broken grammars, so let’s + // keep it in there just to be sure. + /* c8 ignore next 5 */ + if (result.errorRaised) { + throw new Error('Could not highlight with `Highlight.js`', { + cause: result.errorRaised + }) + } + + const root = result._emitter.root + + // Cast because it is always defined. + const data = /** @type {RootData} */ (root.data) + + data.language = result.language + data.relevance = result.relevance + + return root + } + + /** + * Highlight `value` (code) and guess its programming language. + * + * @example + * ```js + * import {common, createLowlight} from 'lowlight' + * + * const lowlight = createLowlight(common) + * + * console.log(lowlight.highlightAuto('"hello, " + name + "!"')) + * ``` + * + * Yields: + * + * ```js + * {type: 'root', children: [Array], data: {language: 'arduino', relevance: 2}} + * ``` + * + * @param {string} value + * Code to highlight. + * @param {Readonly | null | undefined} [options={}] + * Configuration (optional). + * @returns {Root} + * Tree; with the following `data` fields: `language` (`string`), detected + * programming language name; `relevance` (`number`), how sure lowlight is + * that the given code is in the language. + */ + function highlightAuto(value, options) { + assert(typeof value === 'string', 'expected `string` as `value`') + const settings = options || emptyOptions + const subset = settings.subset || listLanguages() + + let index = -1 + let relevance = 0 + /** @type {Root | undefined} */ + let result + + while (++index < subset.length) { + const name = subset[index] + + if (!high.getLanguage(name)) continue + + const current = highlight(name, value, options) + + if ( + current.data && + current.data.relevance !== undefined && + current.data.relevance > relevance + ) { + relevance = current.data.relevance + result = current + } + } + + return ( + result || { + type: 'root', + children: [], + data: {language: undefined, relevance} + } + ) + } + + /** + * List registered languages. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import markdown from 'highlight.js/lib/languages/markdown' + * + * const lowlight = createLowlight() + * + * console.log(lowlight.listLanguages()) // => [] + * + * lowlight.register({markdown}) + * + * console.log(lowlight.listLanguages()) // => ['markdown'] + * ``` + * + * @returns {Array} + * Names of registered language. + */ + function listLanguages() { + return high.listLanguages() + } + + /** + * Register languages. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import xml from 'highlight.js/lib/languages/xml' + * + * const lowlight = createLowlight() + * + * lowlight.register({xml}) + * + * // Note: `html` is an alias for `xml`. + * console.log(lowlight.highlight('html', 'Emphasis')) + * ``` + * + * Yields: + * + * ```js + * {type: 'root', children: [Array], data: {language: 'html', relevance: 2}} + * ``` + * + * @overload + * @param {Readonly>} grammars + * @returns {undefined} + * + * @overload + * @param {string} name + * @param {LanguageFn} grammar + * @returns {undefined} + * + * @param {Readonly> | string} grammarsOrName + * Grammars or programming language name. + * @param {LanguageFn | undefined} [grammar] + * Grammar, if with name. + * @returns {undefined} + * Nothing. + */ + function register(grammarsOrName, grammar) { + if (typeof grammarsOrName === 'string') { + assert(grammar !== undefined, 'expected `grammar`') + high.registerLanguage(grammarsOrName, grammar) + } else { + /** @type {string} */ + let name + + for (name in grammarsOrName) { + if (Object.hasOwn(grammarsOrName, name)) { + high.registerLanguage(name, grammarsOrName[name]) + } + } + } + } + + /** + * Register aliases. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import markdown from 'highlight.js/lib/languages/markdown' + * + * const lowlight = createLowlight() + * + * lowlight.register({markdown}) + * + * // lowlight.highlight('mdown', 'Emphasis') + * // ^ would throw: Error: Unknown language: `mdown` is not registered + * + * lowlight.registerAlias({markdown: ['mdown', 'mkdn', 'mdwn', 'ron']}) + * lowlight.highlight('mdown', 'Emphasis') + * // ^ Works! + * ``` + * + * @overload + * @param {Readonly | string>>} aliases + * @returns {undefined} + * + * @overload + * @param {string} language + * @param {ReadonlyArray | string} alias + * @returns {undefined} + * + * @param {Readonly | string>> | string} aliasesOrName + * Map of programming language names to one or more aliases, or programming + * language name. + * @param {ReadonlyArray | string | undefined} [alias] + * One or more aliases for the programming language, if with `name`. + * @returns {undefined} + * Nothing. + */ + function registerAlias(aliasesOrName, alias) { + if (typeof aliasesOrName === 'string') { + assert(alias !== undefined) + high.registerAliases( + // Note: copy needed because hljs doesn’t accept readonly arrays yet. + typeof alias === 'string' ? alias : [...alias], + {languageName: aliasesOrName} + ) + } else { + /** @type {string} */ + let key + + for (key in aliasesOrName) { + if (Object.hasOwn(aliasesOrName, key)) { + const aliases = aliasesOrName[key] + high.registerAliases( + // Note: copy needed because hljs doesn’t accept readonly arrays yet. + typeof aliases === 'string' ? aliases : [...aliases], + {languageName: key} + ) + } + } + } + } + + /** + * Check whether an alias or name is registered. + * + * @example + * ```js + * import {createLowlight} from 'lowlight' + * import javascript from 'highlight.js/lib/languages/javascript' + * + * const lowlight = createLowlight({javascript}) + * + * console.log(lowlight.registered('funkyscript')) // => `false` + * + * lowlight.registerAlias({javascript: 'funkyscript'}) + * console.log(lowlight.registered('funkyscript')) // => `true` + * ``` + * + * @param {string} aliasOrName + * Name of a language or alias for one. + * @returns {boolean} + * Whether `aliasOrName` is registered. + */ + function registered(aliasOrName) { + return Boolean(high.getLanguage(aliasOrName)) + } +} + +/** @type {Emitter} */ +class HastEmitter { + /** + * @param {Readonly} options + * Configuration. + * @returns + * Instance. + */ + constructor(options) { + /** @type {HljsOptions} */ + this.options = options + /** @type {Root} */ + this.root = { + type: 'root', + children: [], + data: {language: undefined, relevance: 0} + } + /** @type {[Root, ...Array]} */ + this.stack = [this.root] + } + + /** + * @param {string} value + * Text to add. + * @returns {undefined} + * Nothing. + * + */ + addText(value) { + if (value === '') return + + const current = this.stack[this.stack.length - 1] + const tail = current.children[current.children.length - 1] + + if (tail && tail.type === 'text') { + tail.value += value + } else { + current.children.push({type: 'text', value}) + } + } + + /** + * + * @param {unknown} rawName + * Name to add. + * @returns {undefined} + * Nothing. + */ + startScope(rawName) { + this.openNode(String(rawName)) + } + + /** + * @returns {undefined} + * Nothing. + */ + endScope() { + this.closeNode() + } + + /** + * @param {HastEmitter} other + * Other emitter. + * @param {string} name + * Name of the sublanguage. + * @returns {undefined} + * Nothing. + */ + __addSublanguage(other, name) { + const current = this.stack[this.stack.length - 1] + // Assume only element content. + const results = /** @type {Array} */ (other.root.children) + + if (name) { + current.children.push({ + type: 'element', + tagName: 'span', + properties: {className: [name]}, + children: results + }) + } else { + current.children.push(...results) + } + } + + /** + * @param {string} name + * Name to add. + * @returns {undefined} + * Nothing. + */ + openNode(name) { + const self = this + // First “class” gets the prefix. Rest gets a repeated underscore suffix. + // See: + // See: + const className = name.split('.').map(function (d, i) { + return i ? d + '_'.repeat(i) : self.options.classPrefix + d + }) + const current = this.stack[this.stack.length - 1] + /** @type {Element} */ + const child = { + type: 'element', + tagName: 'span', + properties: {className}, + children: [] + } + + current.children.push(child) + this.stack.push(child) + } + + /** + * @returns {undefined} + * Nothing. + */ + closeNode() { + this.stack.pop() + } + + /** + * @returns {undefined} + * Nothing. + */ + finalize() {} + + /** + * @returns {string} + * Nothing. + */ + toHTML() { + return '' + } +} diff --git a/tools/ui/node_modules/lowlight/license b/tools/ui/node_modules/lowlight/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/lowlight/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/lowlight/package.json b/tools/ui/node_modules/lowlight/package.json new file mode 100644 index 0000000000000000000000000000000000000000..72a1cfab16dfb2d3e6a88659635b2cfc9ab25ee6 --- /dev/null +++ b/tools/ui/node_modules/lowlight/package.json @@ -0,0 +1,114 @@ +{ + "name": "lowlight", + "version": "3.3.0", + "description": "Virtual syntax highlighting for virtual DOMs and non-HTML things", + "license": "MIT", + "keywords": [ + "syntax", + "code", + "ast", + "virtual", + "dom", + "highlight", + "highlighting" + ], + "repository": "wooorm/lowlight", + "bugs": "https://github.com/wooorm/lowlight/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Ezra Lalonde ", + "Shu Uesugi " + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.0.0", + "highlight.js": "~11.11.0" + }, + "devDependencies": { + "@types/mdast": "^4.0.0", + "@types/node": "^22.0.0", + "@types/unist": "^3.0.0", + "c8": "^10.0.0", + "chalk": "^5.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "mdast-zone": "^6.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unified": "^11.0.0", + "xo": "^0.60.0" + }, + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix", + "generate": "node --conditions development script/build-registry.js", + "prepack": "npm run generate && npm run build && npm run format", + "test": "npm run generate && npm run build && npm run format && npm run test-coverage", + "test-api": "node --conditions development test/index.js", + "test-coverage": "c8 --100 --check-coverage --reporter lcov npm run test-api" + }, + "prettier": { + "bracketSpacing": false, + "singleQuote": true, + "semi": false, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm", + "./script/support.js" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/consistent-type-definitions": "off" + } + }, + { + "files": [ + "script/**/*.js", + "test/**/*.js" + ], + "rules": { + "no-await-in-loop": "off" + } + } + ], + "prettier": true, + "rules": { + "n/file-extension-in-import": "off", + "unicorn/no-this-assignment": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-type-error": "off" + } + } +} diff --git a/tools/ui/node_modules/lowlight/readme.md b/tools/ui/node_modules/lowlight/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..67a46f670504cd581e96d0ef7f07ce3b9321c7a7 --- /dev/null +++ b/tools/ui/node_modules/lowlight/readme.md @@ -0,0 +1,786 @@ + + +# lowlight + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Virtual syntax highlighting for virtual DOMs and non-HTML things based on +[`highlight.js`][highlight-js]. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`all`](#all) + * [`common`](#common) + * [`createLowlight([grammars])`](#createlowlightgrammars) + * [`lowlight.highlight(language, value[, options])`](#lowlighthighlightlanguage-value-options) + * [`lowlight.highlightAuto(value[, options])`](#lowlighthighlightautovalue-options) + * [`lowlight.listLanguages()`](#lowlightlistlanguages) + * [`lowlight.register(grammars)`](#lowlightregistergrammars) + * [`lowlight.registerAlias(aliases)`](#lowlightregisteraliasaliases) + * [`lowlight.registered(aliasOrlanguage)`](#lowlightregisteredaliasorlanguage) + * [`AutoOptions`](#autooptions) + * [`LanguageFn`](#languagefn) + * [`Options`](#options) +* [Examples](#examples) + * [Example: serializing hast as html](#example-serializing-hast-as-html) + * [Example: turning hast into preact, react, etc](#example-turning-hast-into-preact-react-etc) +* [Types](#types) +* [Data](#data) +* [CSS](#css) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Projects](#projects) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package uses [`highlight.js`][highlight-js] for syntax highlighting and +outputs objects (ASTs) instead of a string of HTML. +It can support 190+ programming languages. + +## When should I use this? + +This package is useful when you want to perform syntax highlighting in a place +where serialized HTML wouldn’t work or wouldn’t work well. +For example, you can use lowlight when you want to show code in a CLI by +rendering to ANSI sequences, when you’re using virtual DOM frameworks (such as +React or Preact) so that diffing can be performant, or when you’re working with +ASTs (rehype). + +You can use the similar [`refractor`][refractor] if you want to use [Prism][] +grammars instead. +If you’re looking for a *really good* (but rather heavy) alternative, use +[`starry-night`][starry-night]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install lowlight +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {all, common, createLowlight} from 'https://esm.sh/lowlight@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {common, createLowlight} from 'lowlight' + +const lowlight = createLowlight(common) + +const tree = lowlight.highlight('js', '"use strict";') + +console.dir(tree, {depth: undefined}) +``` + +Yields: + +```js +{ + type: 'root', + children: [ + { + type: 'element', + tagName: 'span', + properties: {className: ['hljs-meta']}, + children: [{type: 'text', value: '"use strict"'}] + }, + {type: 'text', value: ';'} + ], + data: {language: 'js', relevance: 10} +} +``` + +## API + +This package exports the identifiers [`all`][api-all], +[`common`][api-common], and +[`createLowlight`][api-create-lowlight]. +There is no default export. + +### `all` + +Map of all (±190) grammars ([`Record`][api-language-fn]). + +### `common` + +Map of common (37) grammars ([`Record`][api-language-fn]). + +### `createLowlight([grammars])` + +Create a `lowlight` instance. + +###### Parameters + +* `grammars` ([`Record`][api-language-fn], optional) + — grammars to add + +###### Returns + +Lowlight (`Lowlight`). + +### `lowlight.highlight(language, value[, options])` + +Highlight `value` (code) as `language` (name). + +###### Parameters + +* `language` (`string`) + — programming language [name][names] +* `value` (`string`) + — code to highlight +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +Tree ([`Root`][hast-root]); with the following `data` fields: `language` +(`string`), detected programming language name; `relevance` (`number`), how +sure lowlight is that the given code is in the language. + +###### Example + +```js +import {common, createLowlight} from 'lowlight' + +const lowlight = createLowlight(common) + +console.log(lowlight.highlight('css', 'em { color: red }')) +``` + +Yields: + +```js +{type: 'root', children: [Array], data: {language: 'css', relevance: 3}} +``` + +### `lowlight.highlightAuto(value[, options])` + +Highlight `value` (code) and guess its programming language. + +###### Parameters + +* `value` (`string`) + — code to highlight +* `options` ([`AutoOptions`][api-auto-options], optional) + — configuration + +###### Returns + +Tree ([`Root`][hast-root]); with the following `data` fields: `language` +(`string`), detected programming language name; `relevance` (`number`), how +sure lowlight is that the given code is in the language. + +###### Example + +```js +import {common, createLowlight} from 'lowlight' + +const lowlight = createLowlight(common) + +console.log(lowlight.highlightAuto('"hello, " + name + "!"')) +``` + +Yields: + +```js +{type: 'root', children: [Array], data: {language: 'arduino', relevance: 2}} +``` + +### `lowlight.listLanguages()` + +List registered languages. + +###### Returns + +[Names][] of registered language (`Array`). + +###### Example + +```js +import {createLowlight} from 'lowlight' +import markdown from 'highlight.js/lib/languages/markdown' + +const lowlight = createLowlight() + +console.log(lowlight.listLanguages()) // => [] + +lowlight.register({markdown}) + +console.log(lowlight.listLanguages()) // => ['markdown'] +``` + +### `lowlight.register(grammars)` + +Register languages. + +###### Signatures + +* `register(name, grammar)` +* `register(grammars)` + +###### Parameters + +* `name` (`string`) + — programming language [name][names] +* `grammar` ([`LanguageFn`][api-language-fn]) + — grammar +* `grammars` ([`Record`][api-language-fn], optional) + — grammars + +###### Returns + +Nothing (`undefined`). + +###### Example + +```js +import {createLowlight} from 'lowlight' +import xml from 'highlight.js/lib/languages/xml' + +const lowlight = createLowlight() + +lowlight.register({xml}) + +// Note: `html` is an alias for `xml`. +console.log(lowlight.highlight('html', 'Emphasis')) +``` + +Yields: + +```js +{type: 'root', children: [Array], data: {language: 'html', relevance: 2}} +``` + +### `lowlight.registerAlias(aliases)` + +Register aliases. + +###### Signatures + +* `registerAlias(aliases)` +* `registerAlias(name, alias)` + +###### Parameters + +* `aliases` (`Record | string>`) + — map of programming language [names][] to one or more aliases +* `name` (`string`) + — programming language [name][names] +* `alias` (`Array | string`) + — one or more aliases for the programming language + +###### Returns + +Nothing (`undefined`). + +###### Example + +```js +import {createLowlight} from 'lowlight' +import markdown from 'highlight.js/lib/languages/markdown' + +const lowlight = createLowlight() + +lowlight.register({markdown}) + +// lowlight.highlight('mdown', 'Emphasis') +// ^ would throw: Error: Unknown language: `mdown` is not registered + +lowlight.registerAlias({markdown: ['mdown', 'mkdn', 'mdwn', 'ron']}) +lowlight.highlight('mdown', 'Emphasis') +// ^ Works! +``` + +### `lowlight.registered(aliasOrlanguage)` + +Check whether an alias or name is registered. + +###### Parameters + +* `aliasOrlanguage` (`string`) + — [name][names] of a language or alias for one + +###### Returns + +Whether `aliasOrName` is registered (`boolean`). + +###### Example + +```js +import {createLowlight} from 'lowlight' +import javascript from 'highlight.js/lib/languages/javascript' + +const lowlight = createLowlight({javascript}) + +console.log(lowlight.registered('funkyscript')) // => `false` + +lowlight.registerAlias({javascript: 'funkyscript'}) +console.log(lowlight.registered('funkyscript')) // => `true` +``` + +### `AutoOptions` + +Configuration for `highlightAuto` (TypeScript type). + +###### Fields + +* `prefix` (`string`, default: `'hljs-'`) + — class prefix +* `subset` (`Array`, default: all registered languages) + — list of allowed languages + +### `LanguageFn` + +Highlight.js grammar (TypeScript type). + +###### Type + +```ts +type {LanguageFn} from 'highlight.js' +``` + +### `Options` + +Configuration for `highlight` (TypeScript type). + +###### Fields + +* `prefix` (`string`, default: `'hljs-'`) + — class prefix + +## Examples + +### Example: serializing hast as html + +hast trees as returned by lowlight can be serialized with +[`hast-util-to-html`][hast-util-to-html]: + +```js +import {common, createLowlight} from 'lowlight' +import {toHtml} from 'hast-util-to-html' + +const lowlight = createLowlight(common) + +const tree = lowlight.highlight('js', '"use strict";') + +console.log(toHtml(tree)) +``` + +Yields: + +```html +"use strict"; +``` + +### Example: turning hast into preact, react, etc + +hast trees as returned by lowlight can be turned into nodes of any framework +that supports JSX, such as preact, react, solid, svelte, vue, and more, with +[`hast-util-to-jsx-runtime`][hast-util-to-jsx-runtime]: + +```js +import {toJsxRuntime} from 'hast-util-to-jsx-runtime' +// @ts-expect-error: react types don’t type these. +import {Fragment, jsx, jsxs} from 'react/jsx-runtime' +import {common, createLowlight} from 'lowlight' + +const lowlight = createLowlight(common) + +const tree = lowlight.highlight('js', '"use strict";') + +console.log(toJsxRuntime(tree, {Fragment, jsx, jsxs})) +``` + +Yields: + +```js +{ + $$typeof: Symbol(react.element), + type: Symbol(react.fragment), + key: null, + ref: null, + props: {children: [[Object], ';']}, + _owner: null, + _store: {} +} +``` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types +[`AutoOptions`][api-auto-options], +[`LanguageFn`][api-language-fn], and +[`Options`][api-options]. + +It also registers `root.data` with `@types/hast`. +If you’re working with the data fields, make sure to import this package +somewhere in your types, as that registers the new fields on the file. + +```js +/** + * @import {Root} from 'hast' + * @import {} from 'lowlight' + */ + +import {VFile} from 'vfile' + +/** @type {Root} */ +const root = {type: 'root', children: []} + +console.log(root.data?.language) //=> TS now knows that this is a `string?`. +``` + + + + + +## Data + +If you’re using `createLowlight()`, no syntaxes are included yet. +You can import `all` or `common` and pass them, such as with +`createLowlight(all)`. +Checked syntaxes are included in `common`. +All syntaxes are included in `all`. + +You can also manually import syntaxes from `highlight.js/lib/languages/xxx`, +where `xxx` is the name, such as `'highlight.js/lib/languages/wasm'`. + + + +* [ ] `1c` — 1C:Enterprise +* [ ] `abnf` — Augmented Backus-Naur Form +* [ ] `accesslog` — Apache Access Log +* [ ] `actionscript` (`as`) — ActionScript +* [ ] `ada` — Ada +* [ ] `angelscript` (`asc`) — AngelScript +* [ ] `apache` (`apacheconf`) — Apache config +* [ ] `applescript` (`osascript`) — AppleScript +* [ ] `arcade` — ArcGIS Arcade +* [x] `arduino` (`ino`) — Arduino +* [ ] `armasm` (`arm`) — ARM Assembly +* [ ] `asciidoc` (`adoc`) — AsciiDoc +* [ ] `aspectj` — AspectJ +* [ ] `autohotkey` (`ahk`) — AutoHotkey +* [ ] `autoit` — AutoIt +* [ ] `avrasm` — AVR Assembly +* [ ] `awk` — Awk +* [ ] `axapta` (`x++`) — X++ +* [x] `bash` (`sh`, `zsh`) — Bash +* [ ] `basic` — BASIC +* [ ] `bnf` — Backus–Naur Form +* [ ] `brainfuck` (`bf`) — Brainfuck +* [x] `c` (`h`) — C +* [ ] `cal` — C/AL +* [ ] `capnproto` (`capnp`) — Cap’n Proto +* [ ] `ceylon` — Ceylon +* [ ] `clean` (`icl`, `dcl`) — Clean +* [ ] `clojure` (`clj`, `edn`) — Clojure +* [ ] `clojure-repl` — Clojure REPL +* [ ] `cmake` (`cmake.in`) — CMake +* [ ] `coffeescript` (`coffee`, `cson`, `iced`) — CoffeeScript +* [ ] `coq` — Coq +* [ ] `cos` (`cls`) — Caché Object Script +* [x] `cpp` (`cc`, `c++`, `h++`, `hpp`, `hh`, `hxx`, `cxx`) — C++ +* [ ] `crmsh` (`crm`, `pcmk`) — crmsh +* [ ] `crystal` (`cr`) — Crystal +* [x] `csharp` (`cs`, `c#`) — C# +* [ ] `csp` — CSP +* [x] `css` — CSS +* [ ] `d` — D +* [ ] `dart` — Dart +* [ ] `delphi` (`dpr`, `dfm`, `pas`, `pascal`) — Delphi +* [x] `diff` (`patch`) — Diff +* [ ] `django` (`jinja`) — Django +* [ ] `dns` (`bind`, `zone`) — DNS Zone +* [ ] `dockerfile` (`docker`) — Dockerfile +* [ ] `dos` (`bat`, `cmd`) — Batch file (DOS) +* [ ] `dsconfig` — undefined +* [ ] `dts` — Device Tree +* [ ] `dust` (`dst`) — Dust +* [ ] `ebnf` — Extended Backus-Naur Form +* [ ] `elixir` (`ex`, `exs`) — Elixir +* [ ] `elm` — Elm +* [ ] `erb` — ERB +* [ ] `erlang` (`erl`) — Erlang +* [ ] `erlang-repl` — Erlang REPL +* [ ] `excel` (`xlsx`, `xls`) — Excel formulae +* [ ] `fix` — FIX +* [ ] `flix` — Flix +* [ ] `fortran` (`f90`, `f95`) — Fortran +* [ ] `fsharp` (`fs`, `f#`) — F# +* [ ] `gams` (`gms`) — GAMS +* [ ] `gauss` (`gss`) — GAUSS +* [ ] `gcode` (`nc`) — G-code (ISO 6983) +* [ ] `gherkin` (`feature`) — Gherkin +* [ ] `glsl` — GLSL +* [ ] `gml` — GML +* [x] `go` (`golang`) — Go +* [ ] `golo` — Golo +* [ ] `gradle` — Gradle +* [x] `graphql` (`gql`) — GraphQL +* [ ] `groovy` — Groovy +* [ ] `haml` — HAML +* [ ] `handlebars` (`hbs`, `html.hbs`, `html.handlebars`, `htmlbars`) — Handlebars +* [ ] `haskell` (`hs`) — Haskell +* [ ] `haxe` (`hx`) — Haxe +* [ ] `hsp` — HSP +* [ ] `http` (`https`) — HTTP +* [ ] `hy` (`hylang`) — Hy +* [ ] `inform7` (`i7`) — Inform 7 +* [x] `ini` (`toml`) — TOML, also INI +* [ ] `irpf90` — IRPF90 +* [ ] `isbl` — ISBL +* [x] `java` (`jsp`) — Java +* [x] `javascript` (`js`, `jsx`, `mjs`, `cjs`) — JavaScript +* [ ] `jboss-cli` (`wildfly-cli`) — JBoss CLI +* [x] `json` (`jsonc`) — JSON +* [ ] `julia` — Julia +* [ ] `julia-repl` (`jldoctest`) — Julia REPL +* [x] `kotlin` (`kt`, `kts`) — Kotlin +* [ ] `lasso` (`ls`, `lassoscript`) — Lasso +* [ ] `latex` (`tex`) — LaTeX +* [ ] `ldif` — LDIF +* [ ] `leaf` — Leaf +* [x] `less` — Less +* [ ] `lisp` — Lisp +* [ ] `livecodeserver` — LiveCode +* [ ] `livescript` (`ls`) — LiveScript +* [ ] `llvm` — LLVM IR +* [ ] `lsl` — LSL (Linden Scripting Language) +* [x] `lua` (`pluto`) — Lua +* [x] `makefile` (`mk`, `mak`, `make`) — Makefile +* [x] `markdown` (`md`, `mkdown`, `mkd`) — Markdown +* [ ] `mathematica` (`mma`, `wl`) — Mathematica +* [ ] `matlab` — Matlab +* [ ] `maxima` — Maxima +* [ ] `mel` — MEL +* [ ] `mercury` (`m`, `moo`) — Mercury +* [ ] `mipsasm` (`mips`) — MIPS Assembly +* [ ] `mizar` — Mizar +* [ ] `mojolicious` — Mojolicious +* [ ] `monkey` — Monkey +* [ ] `moonscript` (`moon`) — MoonScript +* [ ] `n1ql` — N1QL +* [ ] `nestedtext` (`nt`) — Nested Text +* [ ] `nginx` (`nginxconf`) — Nginx config +* [ ] `nim` — Nim +* [ ] `nix` (`nixos`) — Nix +* [ ] `node-repl` — Node REPL +* [ ] `nsis` — NSIS +* [x] `objectivec` (`mm`, `objc`, `obj-c`, `obj-c++`, `objective-c++`) — Objective-C +* [ ] `ocaml` (`ml`) — OCaml +* [ ] `openscad` (`scad`) — OpenSCAD +* [ ] `oxygene` — Oxygene +* [ ] `parser3` — Parser3 +* [x] `perl` (`pl`, `pm`) — Perl +* [ ] `pf` (`pf.conf`) — Packet Filter config +* [ ] `pgsql` (`postgres`, `postgresql`) — PostgreSQL +* [x] `php` — undefined +* [x] `php-template` — PHP template +* [x] `plaintext` (`text`, `txt`) — Plain text +* [ ] `pony` — Pony +* [ ] `powershell` (`pwsh`, `ps`, `ps1`) — PowerShell +* [ ] `processing` (`pde`) — Processing +* [ ] `profile` — Python profiler +* [ ] `prolog` — Prolog +* [ ] `properties` — .properties +* [ ] `protobuf` (`proto`) — Protocol Buffers +* [ ] `puppet` (`pp`) — Puppet +* [ ] `purebasic` (`pb`, `pbi`) — PureBASIC +* [x] `python` (`py`, `gyp`, `ipython`) — Python +* [x] `python-repl` (`pycon`) — undefined +* [ ] `q` (`k`, `kdb`) — Q +* [ ] `qml` (`qt`) — QML +* [x] `r` — R +* [ ] `reasonml` (`re`) — ReasonML +* [ ] `rib` — RenderMan RIB +* [ ] `roboconf` (`graph`, `instances`) — Roboconf +* [ ] `routeros` (`mikrotik`) — MikroTik RouterOS script +* [ ] `rsl` — RenderMan RSL +* [x] `ruby` (`rb`, `gemspec`, `podspec`, `thor`, `irb`) — Ruby +* [ ] `ruleslanguage` — Oracle Rules Language +* [x] `rust` (`rs`) — Rust +* [ ] `sas` — SAS +* [ ] `scala` — Scala +* [ ] `scheme` (`scm`) — Scheme +* [ ] `scilab` (`sci`) — Scilab +* [x] `scss` — SCSS +* [x] `shell` (`console`, `shellsession`) — Shell Session +* [ ] `smali` — Smali +* [ ] `smalltalk` (`st`) — Smalltalk +* [ ] `sml` (`ml`) — SML (Standard ML) +* [ ] `sqf` — SQF +* [x] `sql` — SQL +* [ ] `stan` (`stanfuncs`) — Stan +* [ ] `stata` (`do`, `ado`) — Stata +* [ ] `step21` (`p21`, `step`, `stp`) — STEP Part 21 +* [ ] `stylus` (`styl`) — Stylus +* [ ] `subunit` — SubUnit +* [x] `swift` — Swift +* [ ] `taggerscript` — Tagger Script +* [ ] `tap` — Test Anything Protocol +* [ ] `tcl` (`tk`) — Tcl +* [ ] `thrift` — Thrift +* [ ] `tp` — TP +* [ ] `twig` (`craftcms`) — Twig +* [x] `typescript` (`ts`, `tsx`, `mts`, `cts`) — TypeScript +* [ ] `vala` — Vala +* [x] `vbnet` (`vb`) — Visual Basic .NET +* [ ] `vbscript` (`vbs`) — VBScript +* [ ] `vbscript-html` — VBScript in HTML +* [ ] `verilog` (`v`, `sv`, `svh`) — Verilog +* [ ] `vhdl` — VHDL +* [ ] `vim` — Vim Script +* [x] `wasm` — WebAssembly +* [ ] `wren` — Wren +* [ ] `x86asm` — Intel x86 Assembly +* [ ] `xl` (`tao`) — XL +* [x] `xml` (`html`, `xhtml`, `rss`, `atom`, `xjb`, `xsd`, `xsl`, `plist`, `wsf`, `svg`) — HTML, XML +* [ ] `xquery` (`xpath`, `xq`, `xqm`) — XQuery +* [x] `yaml` (`yml`) — YAML +* [ ] `zephir` (`zep`) — Zephir + + + +## CSS + +`lowlight` does not inject CSS for the syntax highlighted code (because well, +lowlight doesn’t have to be turned into HTML and might not run in a browser!). +If you are in a browser, you can use any `highlight.js` theme. +For example, to get GitHub Dark from cdnjs: + +```html + +``` + +## Compatibility + +This package is compatible with maintained versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`lowlight@^3`, compatible with Node.js 16. + +## Security + +This package is safe. + +## Related + +* [`refractor`][refractor] + — the same as lowlight but with [Prism][] +* [`starry-night`][starry-night] + — similar but like GitHub and really good + +## Projects + +* [`emphasize`](https://github.com/wooorm/emphasize) + — syntax highlighting in ANSI (for the terminal) +* [`react-lowlight`](https://github.com/rexxars/react-lowlight) + — syntax highlighter for [React][] +* [`react-syntax-highlighter`](https://github.com/conorhastings/react-syntax-highlighter) + — [React][] component for syntax highlighting +* [`rehype-highlight`](https://github.com/rehypejs/rehype-highlight) + — [**rehype**](https://github.com/rehypejs/rehype) plugin to highlight code + blocks +* [`jstransformer-lowlight`](https://github.com/ai/jstransformer-lowlight) + — syntax highlighting for [JSTransformers](https://github.com/jstransformers) + and [Pug](https://pugjs.org/language/filters.html) + +## Contribute + +Yes please! +See [How to Contribute to Open Source][contribute]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/wooorm/lowlight/workflows/main/badge.svg + +[build]: https://github.com/wooorm/lowlight/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/lowlight.svg + +[coverage]: https://codecov.io/github/wooorm/lowlight + +[downloads-badge]: https://img.shields.io/npm/dm/lowlight.svg + +[downloads]: https://www.npmjs.com/package/lowlight + +[size-badge]: https://img.shields.io/bundlephobia/minzip/lowlight.svg + +[size]: https://bundlephobia.com/result?p=lowlight + +[npm]: https://docs.npmjs.com/cli/install + +[esmsh]: https://esm.sh + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[typescript]: https://www.typescriptlang.org + +[contribute]: https://opensource.guide/how-to-contribute/ + +[hast-root]: https://github.com/syntax-tree/hast#root + +[highlight-js]: https://github.com/highlightjs/highlight.js + +[names]: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md + +[react]: https://facebook.github.io/react/ + +[prism]: https://github.com/PrismJS/prism + +[refractor]: https://github.com/wooorm/refractor + +[starry-night]: https://github.com/wooorm/starry-night + +[hast-util-to-html]: https://github.com/syntax-tree/hast-util-to-html + +[hast-util-to-jsx-runtime]: https://github.com/syntax-tree/hast-util-to-jsx-runtime + +[api-all]: #all + +[api-auto-options]: #autooptions + +[api-common]: #common + +[api-create-lowlight]: #createlowlightgrammars + +[api-language-fn]: #languagefn + +[api-options]: #options diff --git a/tools/ui/node_modules/lz-string/LICENSE b/tools/ui/node_modules/lz-string/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ff5cc14ffa1ce8e8bf645e7ac9656d4c2e1eb39e --- /dev/null +++ b/tools/ui/node_modules/lz-string/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 pieroxy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/lz-string/README.md b/tools/ui/node_modules/lz-string/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5b934f1c9d6491b28e67d56350fe21d53d31d3b6 --- /dev/null +++ b/tools/ui/node_modules/lz-string/README.md @@ -0,0 +1,45 @@ +lz-string +========= +LZ-based compression algorithm for JavaScript + +## Warning (migrating from version 1.3.4 - nov 2014) +Files have changed locations and name since a recent release. The new release file is in `libs/lz-string.min.js` (or in `libs/lz-string.js` if you don't care for the minified version) + +Sorry about the mess in other repos. This will not happen again. + +## Note on server side + +If you are using one of the ports of lz-string to decode on the server what was encoded in the browser, you might want to use version 1.3.7 as the version 1.3.8 introduced a slight change in the encoding. While the JS versions are completely cross-compatible, the PHP, Go, ... versions might not be as forgiving. + +## Install via [npm](https://npmjs.org/) + +```shell +$ npm install -g lz-string +$ lz-string input.js > output.txt +``` + +## Home page +Home page for this program with examples, documentation and a live demo: http://pieroxy.net/blog/pages/lz-string/index.html + +## Other languages +This lib has numerous ports to other languages, for server side processing, mostly. Here they are: + + +* **Java:** [by Diogo Duailibe](https://github.com/diogoduailibe/lzstring4j) +* **Java:** [by rufushuang, with base64 support and better performances](https://github.com/rufushuang/lz-string4java) +* **C#:** [by Jawa-the-Hutt](https://github.com/jawa-the-hutt/lz-string-csharp) +* **C#:** [by kreudom, another implementation in C#, more up to date](https://github.com/kreudom/lz-string-csharp) +* **PHP:** [by nullpunkt](https://github.com/nullpunkt/lz-string-php) +* **Python3:** [by eduardtomasek](https://github.com/eduardtomasek/lz-string-python) +* **Another Python:** [by marcel-dancak](https://github.com/marcel-dancak/lz-string-python) +* **Go** [I helped a friend to write a Go implementation of the decompression algorithm](https://github.com/pieroxy/lz-string-go) +* **Go** [Austin wrote the decompression part as well](https://github.com/Lazarus/lz-string-go) +* **Elixir** [by Michael Shapiro](https://github.com/koudelka/elixir-lz-string) +* **C++/QT** [by AmiArt](https://github.com/AmiArt/qt-lzstring) +* **C++** [by Andrey Krasnov, another implementation in C++11](https://github.com/andykras/lz-string-cpp) +* **VB.NET** [by gsemac](https://github.com/gsemac/lz-string-vb) +* **Salesforce Apex** (Java like language): [bilal did the port](https://github.com/bilalfastian/LZ4String) +* **Kotlin:** [from Zen Liu](https://github.com/ZenLiuCN/lz-string4k) +* **Dart:** [from skipness](https://github.com/skipness/lzstring-dart) +* **Haxe:** [from markknol](https://github.com/markknol/hx-lzstring) +* **Rust:** [from adumbidiot](https://github.com/adumbidiot/lz-str-rs) diff --git a/tools/ui/node_modules/lz-string/bin/bin.js b/tools/ui/node_modules/lz-string/bin/bin.js new file mode 100644 index 0000000000000000000000000000000000000000..113ae313b6c297d253872f0b0584a7e9ce775b2e --- /dev/null +++ b/tools/ui/node_modules/lz-string/bin/bin.js @@ -0,0 +1,13 @@ +#! /usr/bin/env node +var lzString = require('../libs/lz-string.js'); +var fs = require('fs'); + +if (process.argv.length < 3) { + console.error('Usage: lz-string '); + process.exit(1); +} + +console.log(lzString.compress(fs.readFileSync(process.argv[2], { + encoding: 'utf8', +}))); + diff --git a/tools/ui/node_modules/lz-string/bower.json b/tools/ui/node_modules/lz-string/bower.json new file mode 100644 index 0000000000000000000000000000000000000000..e63d706ac054726953c8238a2417d15acf916dc4 --- /dev/null +++ b/tools/ui/node_modules/lz-string/bower.json @@ -0,0 +1,11 @@ +{ + "name": "lz-string", + "version": "1.4.5", + "main": "libs/lz-string.min.js", + "ignore": [ + "bin/", + "reference/", + "tests/" + ], + "keywords": ["compression", "lzw", "string"] +} diff --git a/tools/ui/node_modules/lz-string/libs/base64-string.js b/tools/ui/node_modules/lz-string/libs/base64-string.js new file mode 100644 index 0000000000000000000000000000000000000000..4bb19aa2a7d2c7a28eb79cb04b058941708a893e --- /dev/null +++ b/tools/ui/node_modules/lz-string/libs/base64-string.js @@ -0,0 +1,285 @@ +// Copyright (c) 2013 Pieroxy +// This work is free. You can redistribute it and/or modify it +// under the terms of the WTFPL, Version 2 +// For more information see LICENSE.txt or http://www.wtfpl.net/ +// +// This lib is part of the lz-string project. +// For more information, the home page: +// http://pieroxy.net/blog/pages/lz-string/index.html +// +// Base64 compression / decompression for already compressed content (gif, png, jpg, mp3, ...) +// version 1.4.1 +var Base64String = { + + compressToUTF16 : function (input) { + var output = [], + i,c, + current, + status = 0; + + input = this.compress(input); + + for (i=0 ; i> 1)+32)); + current = (c & 1) << 14; + break; + case 1: + output.push(String.fromCharCode((current + (c >> 2))+32)); + current = (c & 3) << 13; + break; + case 2: + output.push(String.fromCharCode((current + (c >> 3))+32)); + current = (c & 7) << 12; + break; + case 3: + output.push(String.fromCharCode((current + (c >> 4))+32)); + current = (c & 15) << 11; + break; + case 4: + output.push(String.fromCharCode((current + (c >> 5))+32)); + current = (c & 31) << 10; + break; + case 5: + output.push(String.fromCharCode((current + (c >> 6))+32)); + current = (c & 63) << 9; + break; + case 6: + output.push(String.fromCharCode((current + (c >> 7))+32)); + current = (c & 127) << 8; + break; + case 7: + output.push(String.fromCharCode((current + (c >> 8))+32)); + current = (c & 255) << 7; + break; + case 8: + output.push(String.fromCharCode((current + (c >> 9))+32)); + current = (c & 511) << 6; + break; + case 9: + output.push(String.fromCharCode((current + (c >> 10))+32)); + current = (c & 1023) << 5; + break; + case 10: + output.push(String.fromCharCode((current + (c >> 11))+32)); + current = (c & 2047) << 4; + break; + case 11: + output.push(String.fromCharCode((current + (c >> 12))+32)); + current = (c & 4095) << 3; + break; + case 12: + output.push(String.fromCharCode((current + (c >> 13))+32)); + current = (c & 8191) << 2; + break; + case 13: + output.push(String.fromCharCode((current + (c >> 14))+32)); + current = (c & 16383) << 1; + break; + case 14: + output.push(String.fromCharCode((current + (c >> 15))+32, (c & 32767)+32)); + status = 0; + break; + } + } + output.push(String.fromCharCode(current + 32)); + return output.join(''); + }, + + + decompressFromUTF16 : function (input) { + var output = [], + current,c, + status=0, + i = 0; + + while (i < input.length) { + c = input.charCodeAt(i) - 32; + + switch (status++) { + case 0: + current = c << 1; + break; + case 1: + output.push(String.fromCharCode(current | (c >> 14))); + current = (c&16383) << 2; + break; + case 2: + output.push(String.fromCharCode(current | (c >> 13))); + current = (c&8191) << 3; + break; + case 3: + output.push(String.fromCharCode(current | (c >> 12))); + current = (c&4095) << 4; + break; + case 4: + output.push(String.fromCharCode(current | (c >> 11))); + current = (c&2047) << 5; + break; + case 5: + output.push(String.fromCharCode(current | (c >> 10))); + current = (c&1023) << 6; + break; + case 6: + output.push(String.fromCharCode(current | (c >> 9))); + current = (c&511) << 7; + break; + case 7: + output.push(String.fromCharCode(current | (c >> 8))); + current = (c&255) << 8; + break; + case 8: + output.push(String.fromCharCode(current | (c >> 7))); + current = (c&127) << 9; + break; + case 9: + output.push(String.fromCharCode(current | (c >> 6))); + current = (c&63) << 10; + break; + case 10: + output.push(String.fromCharCode(current | (c >> 5))); + current = (c&31) << 11; + break; + case 11: + output.push(String.fromCharCode(current | (c >> 4))); + current = (c&15) << 12; + break; + case 12: + output.push(String.fromCharCode(current | (c >> 3))); + current = (c&7) << 13; + break; + case 13: + output.push(String.fromCharCode(current | (c >> 2))); + current = (c&3) << 14; + break; + case 14: + output.push(String.fromCharCode(current | (c >> 1))); + current = (c&1) << 15; + break; + case 15: + output.push(String.fromCharCode(current | c)); + status=0; + break; + } + + + i++; + } + + return this.decompress(output.join('')); + //return output; + + }, + + + // private property + _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + + decompress : function (input) { + var output = []; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 1; + var odd = input.charCodeAt(0) >> 8; + + while (i < input.length*2 && (i < input.length*2-1 || odd==0)) { + + if (i%2==0) { + chr1 = input.charCodeAt(i/2) >> 8; + chr2 = input.charCodeAt(i/2) & 255; + if (i/2+1 < input.length) + chr3 = input.charCodeAt(i/2+1) >> 8; + else + chr3 = NaN; + } else { + chr1 = input.charCodeAt((i-1)/2) & 255; + if ((i+1)/2 < input.length) { + chr2 = input.charCodeAt((i+1)/2) >> 8; + chr3 = input.charCodeAt((i+1)/2) & 255; + } else + chr2=chr3=NaN; + } + i+=3; + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2) || (i==input.length*2+1 && odd)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3) || (i==input.length*2 && odd)) { + enc4 = 64; + } + + output.push(this._keyStr.charAt(enc1)); + output.push(this._keyStr.charAt(enc2)); + output.push(this._keyStr.charAt(enc3)); + output.push(this._keyStr.charAt(enc4)); + } + + return output.join(''); + }, + + compress : function (input) { + var output = [], + ol = 1, + output_, + chr1, chr2, chr3, + enc1, enc2, enc3, enc4, + i = 0, flush=false; + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + if (ol%2==0) { + output_ = chr1 << 8; + flush = true; + + if (enc3 != 64) { + output.push(String.fromCharCode(output_ | chr2)); + flush = false; + } + if (enc4 != 64) { + output_ = chr3 << 8; + flush = true; + } + } else { + output.push(String.fromCharCode(output_ | chr1)); + flush = false; + + if (enc3 != 64) { + output_ = chr2 << 8; + flush = true; + } + if (enc4 != 64) { + output.push(String.fromCharCode(output_ | chr3)); + flush = false; + } + } + ol+=3; + } + + if (flush) { + output.push(String.fromCharCode(output_)); + output = output.join(''); + output = String.fromCharCode(output.charCodeAt(0)|256) + output.substring(1); + } else { + output = output.join(''); + } + + return output; + + } +} diff --git a/tools/ui/node_modules/lz-string/libs/lz-string.js b/tools/ui/node_modules/lz-string/libs/lz-string.js new file mode 100644 index 0000000000000000000000000000000000000000..de663ae434219ccd5fc8fb7917f60199d17c7d39 --- /dev/null +++ b/tools/ui/node_modules/lz-string/libs/lz-string.js @@ -0,0 +1,506 @@ +// Copyright (c) 2013 Pieroxy +// This work is free. You can redistribute it and/or modify it +// under the terms of the WTFPL, Version 2 +// For more information see LICENSE.txt or http://www.wtfpl.net/ +// +// For more information, the home page: +// http://pieroxy.net/blog/pages/lz-string/testing.html +// +// LZ-based compression algorithm, version 1.4.5 +var LZString = (function() { + +// private property +var f = String.fromCharCode; +var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$"; +var baseReverseDic = {}; + +function getBaseValue(alphabet, character) { + if (!baseReverseDic[alphabet]) { + baseReverseDic[alphabet] = {}; + for (var i=0 ; i>> 8; + buf[i*2+1] = current_value % 256; + } + return buf; + }, + + //decompress from uint8array (UCS-2 big endian format) + decompressFromUint8Array:function (compressed) { + if (compressed===null || compressed===undefined){ + return LZString.decompress(compressed); + } else { + var buf=new Array(compressed.length/2); // 2 bytes per character + for (var i=0, TotalLen=buf.length; i> 1; + } + } else { + value = 1; + for (i=0 ; i> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + delete context_dictionaryToCreate[context_w]; + } else { + value = context_dictionary[context_w]; + for (i=0 ; i> 1; + } + + + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + // Add wc to the dictionary. + context_dictionary[context_wc] = context_dictSize++; + context_w = String(context_c); + } + } + + // Output the code for w. + if (context_w !== "") { + if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) { + if (context_w.charCodeAt(0)<256) { + for (i=0 ; i> 1; + } + } else { + value = 1; + for (i=0 ; i> 1; + } + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + delete context_dictionaryToCreate[context_w]; + } else { + value = context_dictionary[context_w]; + for (i=0 ; i> 1; + } + + + } + context_enlargeIn--; + if (context_enlargeIn == 0) { + context_enlargeIn = Math.pow(2, context_numBits); + context_numBits++; + } + } + + // Mark the end of the stream + value = 2; + for (i=0 ; i> 1; + } + + // Flush the last char + while (true) { + context_data_val = (context_data_val << 1); + if (context_data_position == bitsPerChar-1) { + context_data.push(getCharFromInt(context_data_val)); + break; + } + else context_data_position++; + } + return context_data.join(''); + }, + + decompress: function (compressed) { + if (compressed == null) return ""; + if (compressed == "") return null; + return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); }); + }, + + _decompress: function (length, resetValue, getNextValue) { + var dictionary = [], + next, + enlargeIn = 4, + dictSize = 4, + numBits = 3, + entry = "", + result = [], + i, + w, + bits, resb, maxpower, power, + c, + data = {val:getNextValue(0), position:resetValue, index:1}; + + for (i = 0; i < 3; i += 1) { + dictionary[i] = i; + } + + bits = 0; + maxpower = Math.pow(2,2); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + + switch (next = bits) { + case 0: + bits = 0; + maxpower = Math.pow(2,8); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + c = f(bits); + break; + case 1: + bits = 0; + maxpower = Math.pow(2,16); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + c = f(bits); + break; + case 2: + return ""; + } + dictionary[3] = c; + w = c; + result.push(c); + while (true) { + if (data.index > length) { + return ""; + } + + bits = 0; + maxpower = Math.pow(2,numBits); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + + switch (c = bits) { + case 0: + bits = 0; + maxpower = Math.pow(2,8); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + + dictionary[dictSize++] = f(bits); + c = dictSize-1; + enlargeIn--; + break; + case 1: + bits = 0; + maxpower = Math.pow(2,16); + power=1; + while (power!=maxpower) { + resb = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = resetValue; + data.val = getNextValue(data.index++); + } + bits |= (resb>0 ? 1 : 0) * power; + power <<= 1; + } + dictionary[dictSize++] = f(bits); + c = dictSize-1; + enlargeIn--; + break; + case 2: + return result.join(''); + } + + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + + if (dictionary[c]) { + entry = dictionary[c]; + } else { + if (c === dictSize) { + entry = w + w.charAt(0); + } else { + return null; + } + } + result.push(entry); + + // Add w+entry[0] to the dictionary. + dictionary[dictSize++] = w + entry.charAt(0); + enlargeIn--; + + w = entry; + + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + + } + } +}; + return LZString; +})(); + +if (typeof define === 'function' && define.amd) { + define(function () { return LZString; }); +} else if( typeof module !== 'undefined' && module != null ) { + module.exports = LZString +} else if( typeof angular !== 'undefined' && angular != null ) { + angular.module('LZString', []) + .factory('LZString', function () { + return LZString; + }); +} diff --git a/tools/ui/node_modules/lz-string/libs/lz-string.min.js b/tools/ui/node_modules/lz-string/libs/lz-string.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f7c26ae2b4b5c6652e25e5796f1ecfb02c6e7e08 --- /dev/null +++ b/tools/ui/node_modules/lz-string/libs/lz-string.min.js @@ -0,0 +1 @@ +var LZString=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return LZString}); \ No newline at end of file diff --git a/tools/ui/node_modules/lz-string/package.json b/tools/ui/node_modules/lz-string/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5fe17e0ae162a21a757a5f2d0c8312ad825c913e --- /dev/null +++ b/tools/ui/node_modules/lz-string/package.json @@ -0,0 +1,42 @@ +{ + "name": "lz-string", + "version": "1.5.0", + "license": "MIT", + "filename": "lz-string.js", + "description": "LZ-based compression algorithm", + "homepage": "http://pieroxy.net/blog/pages/lz-string/index.html", + "keywords": [ + "lz", + "compression", + "string" + ], + "main": "libs/lz-string.js", + "typings": "typings/lz-string.d.ts", + "bin": { + "lz-string": "bin/bin.js" + }, + "scripts": {}, + "dependencies": {}, + "devDependencies": {}, + "repository": { + "type": "git", + "url": "https://github.com/pieroxy/lz-string.git" + }, + "bugs": { + "url": "https://github.com/pieroxy/lz-string/issues" + }, + "directories": { + "test": "tests" + }, + "author": "pieroxy ", + "autoupdate": { + "source": "git", + "target": "git://github.com/pieroxy/lz-string.git", + "basePath": "libs/", + "files": [ + "lz-string.js", + "lz-string.min.js", + "base64-string.js" + ] + } +} diff --git a/tools/ui/node_modules/lz-string/reference/lz-string-1.0.2.js b/tools/ui/node_modules/lz-string/reference/lz-string-1.0.2.js new file mode 100644 index 0000000000000000000000000000000000000000..86aafd0878d4e38765ff7ae0bfa50af4a2a4b074 --- /dev/null +++ b/tools/ui/node_modules/lz-string/reference/lz-string-1.0.2.js @@ -0,0 +1,204 @@ +// Copyright © 2013 Pieroxy +// This work is free. You can redistribute it and/or modify it +// under the terms of the WTFPL, Version 2 +// For more information see LICENSE.txt or http://www.wtfpl.net/ +// +// LZ-based compression algorithm, version 1.0.2-rc1 +var LZString = { + + writeBit : function(value, data) { + data.val = (data.val << 1) | value; + if (data.position == 15) { + data.position = 0; + data.string += String.fromCharCode(data.val); + data.val = 0; + } else { + data.position++; + } + }, + + writeBits : function(numBits, value, data) { + if (typeof(value)=="string") + value = value.charCodeAt(0); + for (var i=0 ; i> 1; + } + }, + + produceW : function (context) { + if (Object.prototype.hasOwnProperty.call(context.dictionaryToCreate,context.w)) { + if (context.w.charCodeAt(0)<256) { + this.writeBits(context.numBits, 0, context.data); + this.writeBits(8, context.w, context.data); + } else { + this.writeBits(context.numBits, 1, context.data); + this.writeBits(16, context.w, context.data); + } + this.decrementEnlargeIn(context); + delete context.dictionaryToCreate[context.w]; + } else { + this.writeBits(context.numBits, context.dictionary[context.w], context.data); + } + this.decrementEnlargeIn(context); + }, + + decrementEnlargeIn : function(context) { + context.enlargeIn--; + if (context.enlargeIn == 0) { + context.enlargeIn = Math.pow(2, context.numBits); + context.numBits++; + } + }, + + compress: function (uncompressed) { + var context = { + dictionary: {}, + dictionaryToCreate: {}, + c:"", + wc:"", + w:"", + enlargeIn: 2, // Compensate for the first entry which should not count + dictSize: 3, + numBits: 2, + result: "", + data: {string:"", val:0, position:0} + }, i; + + for (i = 0; i < uncompressed.length; i += 1) { + context.c = uncompressed.charAt(i); + if (!Object.prototype.hasOwnProperty.call(context.dictionary,context.c)) { + context.dictionary[context.c] = context.dictSize++; + context.dictionaryToCreate[context.c] = true; + } + + context.wc = context.w + context.c; + if (Object.prototype.hasOwnProperty.call(context.dictionary,context.wc)) { + context.w = context.wc; + } else { + this.produceW(context); + // Add wc to the dictionary. + context.dictionary[context.wc] = context.dictSize++; + context.w = String(context.c); + } + } + + // Output the code for w. + if (context.w !== "") { + this.produceW(context); + } + + // Mark the end of the stream + this.writeBits(context.numBits, 2, context.data); + + // Flush the last char + while (context.data.val>0) this.writeBit(0,context.data) + return context.data.string; + }, + + readBit : function(data) { + var res = data.val & data.position; + data.position >>= 1; + if (data.position == 0) { + data.position = 32768; + data.val = data.string.charCodeAt(data.index++); + } + //data.val = (data.val << 1); + return res>0 ? 1 : 0; + }, + + readBits : function(numBits, data) { + var res = 0; + var maxpower = Math.pow(2,numBits); + var power=1; + while (power!=maxpower) { + res |= this.readBit(data) * power; + power <<= 1; + } + return res; + }, + + decompress: function (compressed) { + var dictionary = {}, + next, + enlargeIn = 4, + dictSize = 4, + numBits = 3, + entry = "", + result = "", + i, + w, + c, + errorCount=0, + literal, + data = {string:compressed, val:compressed.charCodeAt(0), position:32768, index:1}; + + for (i = 0; i < 3; i += 1) { + dictionary[i] = i; + } + + next = this.readBits(2, data); + switch (next) { + case 0: + c = String.fromCharCode(this.readBits(8, data)); + break; + case 1: + c = String.fromCharCode(this.readBits(16, data)); + break; + case 2: + return ""; + } + dictionary[3] = c; + w = result = c; + while (true) { + c = this.readBits(numBits, data); + + switch (c) { + case 0: + if (errorCount++ > 10000) return "Error"; + c = String.fromCharCode(this.readBits(8, data)); + dictionary[dictSize++] = c; + c = dictSize-1; + enlargeIn--; + break; + case 1: + c = String.fromCharCode(this.readBits(16, data)); + dictionary[dictSize++] = c; + c = dictSize-1; + enlargeIn--; + break; + case 2: + return result; + } + + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + + if (dictionary[c]) { + entry = dictionary[c]; + } else { + if (c === dictSize) { + entry = w + w.charAt(0); + } else { + return null; + } + } + result += entry; + + // Add w+entry[0] to the dictionary. + dictionary[dictSize++] = w + entry.charAt(0); + enlargeIn--; + + w = entry; + + if (enlargeIn == 0) { + enlargeIn = Math.pow(2, numBits); + numBits++; + } + + } + return result; + } +}; diff --git a/tools/ui/node_modules/lz-string/tests/SpecRunner.html b/tools/ui/node_modules/lz-string/tests/SpecRunner.html new file mode 100644 index 0000000000000000000000000000000000000000..22c10b8b0f6cce7b4aee1024781248110ab5af44 --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/SpecRunner.html @@ -0,0 +1,51 @@ + + + + LZString tests + + + + + + + + + + + + + + + + + + + diff --git a/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/MIT.LICENSE b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/MIT.LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7c435baaec86c0ebe2eb56b0550c11820c181b05 --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/MIT.LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2008-2011 Pivotal Labs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine-html.js b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine-html.js new file mode 100644 index 0000000000000000000000000000000000000000..543d56963eb4a36750fef86842213505a7da0657 --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine-html.js @@ -0,0 +1,681 @@ +jasmine.HtmlReporterHelpers = {}; + +jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) { + var el = document.createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(document.createTextNode(child)); + } else { + if (child) { + el.appendChild(child); + } + } + } + + for (var attr in attrs) { + if (attr == "className") { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; +}; + +jasmine.HtmlReporterHelpers.getSpecStatus = function(child) { + var results = child.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.skipped) { + status = 'skipped'; + } + + return status; +}; + +jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) { + var parentDiv = this.dom.summary; + var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite'; + var parent = child[parentSuite]; + + if (parent) { + if (typeof this.views.suites[parent.id] == 'undefined') { + this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views); + } + parentDiv = this.views.suites[parent.id].element; + } + + parentDiv.appendChild(childElement); +}; + + +jasmine.HtmlReporterHelpers.addHelpers = function(ctor) { + for(var fn in jasmine.HtmlReporterHelpers) { + ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn]; + } +}; + +jasmine.HtmlReporter = function(_doc) { + var self = this; + var doc = _doc || window.document; + + var reporterView; + + var dom = {}; + + // Jasmine Reporter Public Interface + self.logRunningSpecs = false; + + self.reportRunnerStarting = function(runner) { + var specs = runner.specs() || []; + + if (specs.length == 0) { + return; + } + + createReporterDom(runner.env.versionString()); + doc.body.appendChild(dom.reporter); + setExceptionHandling(); + + reporterView = new jasmine.HtmlReporter.ReporterView(dom); + reporterView.addSpecs(specs, self.specFilter); + }; + + self.reportRunnerResults = function(runner) { + reporterView && reporterView.complete(); + }; + + self.reportSuiteResults = function(suite) { + reporterView.suiteComplete(suite); + }; + + self.reportSpecStarting = function(spec) { + if (self.logRunningSpecs) { + self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); + } + }; + + self.reportSpecResults = function(spec) { + reporterView.specComplete(spec); + }; + + self.log = function() { + var console = jasmine.getGlobal().console; + if (console && console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie + } + } + }; + + self.specFilter = function(spec) { + if (!focusedSpecName()) { + return true; + } + + return spec.getFullName().indexOf(focusedSpecName()) === 0; + }; + + return self; + + function focusedSpecName() { + var specName; + + (function memoizeFocusedSpec() { + if (specName) { + return; + } + + var paramMap = []; + var params = jasmine.HtmlReporter.parameters(doc); + + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); + } + + specName = paramMap.spec; + })(); + + return specName; + } + + function createReporterDom(version) { + dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' }, + dom.banner = self.createDom('div', { className: 'banner' }, + self.createDom('span', { className: 'title' }, "Jasmine "), + self.createDom('span', { className: 'version' }, version)), + + dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}), + dom.alert = self.createDom('div', {className: 'alert'}, + self.createDom('span', { className: 'exceptions' }, + self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'), + self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))), + dom.results = self.createDom('div', {className: 'results'}, + dom.summary = self.createDom('div', { className: 'summary' }), + dom.details = self.createDom('div', { id: 'details' })) + ); + } + + function noTryCatch() { + return window.location.search.match(/catch=false/); + } + + function searchWithCatch() { + var params = jasmine.HtmlReporter.parameters(window.document); + var removed = false; + var i = 0; + + while (!removed && i < params.length) { + if (params[i].match(/catch=/)) { + params.splice(i, 1); + removed = true; + } + i++; + } + if (jasmine.CATCH_EXCEPTIONS) { + params.push("catch=false"); + } + + return params.join("&"); + } + + function setExceptionHandling() { + var chxCatch = document.getElementById('no_try_catch'); + + if (noTryCatch()) { + chxCatch.setAttribute('checked', true); + jasmine.CATCH_EXCEPTIONS = false; + } + chxCatch.onclick = function() { + window.location.search = searchWithCatch(); + }; + } +}; +jasmine.HtmlReporter.parameters = function(doc) { + var paramStr = doc.location.search.substring(1); + var params = []; + + if (paramStr.length > 0) { + params = paramStr.split('&'); + } + return params; +} +jasmine.HtmlReporter.sectionLink = function(sectionName) { + var link = '?'; + var params = []; + + if (sectionName) { + params.push('spec=' + encodeURIComponent(sectionName)); + } + if (!jasmine.CATCH_EXCEPTIONS) { + params.push("catch=false"); + } + if (params.length > 0) { + link += params.join("&"); + } + + return link; +}; +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter); +jasmine.HtmlReporter.ReporterView = function(dom) { + this.startedAt = new Date(); + this.runningSpecCount = 0; + this.completeSpecCount = 0; + this.passedCount = 0; + this.failedCount = 0; + this.skippedCount = 0; + + this.createResultsMenu = function() { + this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'}, + this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'), + ' | ', + this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing')); + + this.summaryMenuItem.onclick = function() { + dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, ''); + }; + + this.detailsMenuItem.onclick = function() { + showDetails(); + }; + }; + + this.addSpecs = function(specs, specFilter) { + this.totalSpecCount = specs.length; + + this.views = { + specs: {}, + suites: {} + }; + + for (var i = 0; i < specs.length; i++) { + var spec = specs[i]; + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views); + if (specFilter(spec)) { + this.runningSpecCount++; + } + } + }; + + this.specComplete = function(spec) { + this.completeSpecCount++; + + if (isUndefined(this.views.specs[spec.id])) { + this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom); + } + + var specView = this.views.specs[spec.id]; + + switch (specView.status()) { + case 'passed': + this.passedCount++; + break; + + case 'failed': + this.failedCount++; + break; + + case 'skipped': + this.skippedCount++; + break; + } + + specView.refresh(); + this.refresh(); + }; + + this.suiteComplete = function(suite) { + var suiteView = this.views.suites[suite.id]; + if (isUndefined(suiteView)) { + return; + } + suiteView.refresh(); + }; + + this.refresh = function() { + + if (isUndefined(this.resultsMenu)) { + this.createResultsMenu(); + } + + // currently running UI + if (isUndefined(this.runningAlert)) { + this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" }); + dom.alert.appendChild(this.runningAlert); + } + this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount); + + // skipped specs UI + if (isUndefined(this.skippedAlert)) { + this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" }); + } + + this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; + + if (this.skippedCount === 1 && isDefined(dom.alert)) { + dom.alert.appendChild(this.skippedAlert); + } + + // passing specs UI + if (isUndefined(this.passedAlert)) { + this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" }); + } + this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount); + + // failing specs UI + if (isUndefined(this.failedAlert)) { + this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"}); + } + this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount); + + if (this.failedCount === 1 && isDefined(dom.alert)) { + dom.alert.appendChild(this.failedAlert); + dom.alert.appendChild(this.resultsMenu); + } + + // summary info + this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount); + this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing"; + }; + + this.complete = function() { + dom.alert.removeChild(this.runningAlert); + + this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all"; + + if (this.failedCount === 0) { + dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount))); + } else { + showDetails(); + } + + dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s")); + }; + + return this; + + function showDetails() { + if (dom.reporter.className.search(/showDetails/) === -1) { + dom.reporter.className += " showDetails"; + } + } + + function isUndefined(obj) { + return typeof obj === 'undefined'; + } + + function isDefined(obj) { + return !isUndefined(obj); + } + + function specPluralizedFor(count) { + var str = count + " spec"; + if (count > 1) { + str += "s" + } + return str; + } + +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView); + + +jasmine.HtmlReporter.SpecView = function(spec, dom, views) { + this.spec = spec; + this.dom = dom; + this.views = views; + + this.symbol = this.createDom('li', { className: 'pending' }); + this.dom.symbolSummary.appendChild(this.symbol); + + this.summary = this.createDom('div', { className: 'specSummary' }, + this.createDom('a', { + className: 'description', + href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()), + title: this.spec.getFullName() + }, this.spec.description) + ); + + this.detail = this.createDom('div', { className: 'specDetail' }, + this.createDom('a', { + className: 'description', + href: '?spec=' + encodeURIComponent(this.spec.getFullName()), + title: this.spec.getFullName() + }, this.spec.getFullName()) + ); +}; + +jasmine.HtmlReporter.SpecView.prototype.status = function() { + return this.getSpecStatus(this.spec); +}; + +jasmine.HtmlReporter.SpecView.prototype.refresh = function() { + this.symbol.className = this.status(); + + switch (this.status()) { + case 'skipped': + break; + + case 'passed': + this.appendSummaryToSuiteDiv(); + break; + + case 'failed': + this.appendSummaryToSuiteDiv(); + this.appendFailureDetail(); + break; + } +}; + +jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() { + this.summary.className += ' ' + this.status(); + this.appendToSummary(this.spec, this.summary); +}; + +jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() { + this.detail.className += ' ' + this.status(); + + var resultItems = this.spec.results().getItems(); + var messagesDiv = this.createDom('div', { className: 'messages' }); + + for (var i = 0; i < resultItems.length; i++) { + var result = resultItems[i]; + + if (result.type == 'log') { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); + } else if (result.type == 'expect' && result.passed && !result.passed()) { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); + + if (result.trace.stack) { + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + } + } + } + + if (messagesDiv.childNodes.length > 0) { + this.detail.appendChild(messagesDiv); + this.dom.details.appendChild(this.detail); + } +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) { + this.suite = suite; + this.dom = dom; + this.views = views; + + this.element = this.createDom('div', { className: 'suite' }, + this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description) + ); + + this.appendToSummary(this.suite, this.element); +}; + +jasmine.HtmlReporter.SuiteView.prototype.status = function() { + return this.getSpecStatus(this.suite); +}; + +jasmine.HtmlReporter.SuiteView.prototype.refresh = function() { + this.element.className += " " + this.status(); +}; + +jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView); + +/* @deprecated Use jasmine.HtmlReporter instead + */ +jasmine.TrivialReporter = function(doc) { + this.document = doc || document; + this.suiteDivs = {}; + this.logRunningSpecs = false; +}; + +jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { + var el = document.createElement(type); + + for (var i = 2; i < arguments.length; i++) { + var child = arguments[i]; + + if (typeof child === 'string') { + el.appendChild(document.createTextNode(child)); + } else { + if (child) { el.appendChild(child); } + } + } + + for (var attr in attrs) { + if (attr == "className") { + el[attr] = attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + } + + return el; +}; + +jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { + var showPassed, showSkipped; + + this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' }, + this.createDom('div', { className: 'banner' }, + this.createDom('div', { className: 'logo' }, + this.createDom('span', { className: 'title' }, "Jasmine"), + this.createDom('span', { className: 'version' }, runner.env.versionString())), + this.createDom('div', { className: 'options' }, + "Show ", + showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), + this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), + showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), + this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") + ) + ), + + this.runnerDiv = this.createDom('div', { className: 'runner running' }, + this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), + this.runnerMessageSpan = this.createDom('span', {}, "Running..."), + this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) + ); + + this.document.body.appendChild(this.outerDiv); + + var suites = runner.suites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + var suiteDiv = this.createDom('div', { className: 'suite' }, + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), + this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); + this.suiteDivs[suite.id] = suiteDiv; + var parentDiv = this.outerDiv; + if (suite.parentSuite) { + parentDiv = this.suiteDivs[suite.parentSuite.id]; + } + parentDiv.appendChild(suiteDiv); + } + + this.startedAt = new Date(); + + var self = this; + showPassed.onclick = function(evt) { + if (showPassed.checked) { + self.outerDiv.className += ' show-passed'; + } else { + self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); + } + }; + + showSkipped.onclick = function(evt) { + if (showSkipped.checked) { + self.outerDiv.className += ' show-skipped'; + } else { + self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); + } + }; +}; + +jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { + var results = runner.results(); + var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; + this.runnerDiv.setAttribute("class", className); + //do it twice for IE + this.runnerDiv.setAttribute("className", className); + var specs = runner.specs(); + var specCount = 0; + for (var i = 0; i < specs.length; i++) { + if (this.specFilter(specs[i])) { + specCount++; + } + } + var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); + message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; + this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); + + this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); +}; + +jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { + var results = suite.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.totalCount === 0) { // todo: change this to check results.skipped + status = 'skipped'; + } + this.suiteDivs[suite.id].className += " " + status; +}; + +jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { + if (this.logRunningSpecs) { + this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); + } +}; + +jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { + var results = spec.results(); + var status = results.passed() ? 'passed' : 'failed'; + if (results.skipped) { + status = 'skipped'; + } + var specDiv = this.createDom('div', { className: 'spec ' + status }, + this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), + this.createDom('a', { + className: 'description', + href: '?spec=' + encodeURIComponent(spec.getFullName()), + title: spec.getFullName() + }, spec.description)); + + + var resultItems = results.getItems(); + var messagesDiv = this.createDom('div', { className: 'messages' }); + for (var i = 0; i < resultItems.length; i++) { + var result = resultItems[i]; + + if (result.type == 'log') { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); + } else if (result.type == 'expect' && result.passed && !result.passed()) { + messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); + + if (result.trace.stack) { + messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + } + } + } + + if (messagesDiv.childNodes.length > 0) { + specDiv.appendChild(messagesDiv); + } + + this.suiteDivs[spec.suite.id].appendChild(specDiv); +}; + +jasmine.TrivialReporter.prototype.log = function() { + var console = jasmine.getGlobal().console; + if (console && console.log) { + if (console.log.apply) { + console.log.apply(console, arguments); + } else { + console.log(arguments); // ie fix: console.log.apply doesn't exist on ie + } + } +}; + +jasmine.TrivialReporter.prototype.getLocation = function() { + return this.document.location; +}; + +jasmine.TrivialReporter.prototype.specFilter = function(spec) { + var paramMap = {}; + var params = this.getLocation().search.substring(1).split('&'); + for (var i = 0; i < params.length; i++) { + var p = params[i].split('='); + paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); + } + + if (!paramMap.spec) { + return true; + } + return spec.getFullName().indexOf(paramMap.spec) === 0; +}; diff --git a/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.css b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.css new file mode 100644 index 0000000000000000000000000000000000000000..8c008dc7221b2395341e0a6701f40f02a83a0ca6 --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.css @@ -0,0 +1,82 @@ +body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } + +#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } +#HTMLReporter a { text-decoration: none; } +#HTMLReporter a:hover { text-decoration: underline; } +#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } +#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } +#HTMLReporter #jasmine_content { position: fixed; right: 100%; } +#HTMLReporter .version { color: #aaaaaa; } +#HTMLReporter .banner { margin-top: 14px; } +#HTMLReporter .duration { color: #aaaaaa; float: right; } +#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } +#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } +#HTMLReporter .symbolSummary li.passed { font-size: 14px; } +#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } +#HTMLReporter .symbolSummary li.failed { line-height: 9px; } +#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } +#HTMLReporter .symbolSummary li.skipped { font-size: 14px; } +#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } +#HTMLReporter .symbolSummary li.pending { line-height: 11px; } +#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } +#HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; } +#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } +#HTMLReporter .runningAlert { background-color: #666666; } +#HTMLReporter .skippedAlert { background-color: #aaaaaa; } +#HTMLReporter .skippedAlert:first-child { background-color: #333333; } +#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } +#HTMLReporter .passingAlert { background-color: #a6b779; } +#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } +#HTMLReporter .failingAlert { background-color: #cf867e; } +#HTMLReporter .failingAlert:first-child { background-color: #b03911; } +#HTMLReporter .results { margin-top: 14px; } +#HTMLReporter #details { display: none; } +#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } +#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } +#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } +#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } +#HTMLReporter.showDetails .summary { display: none; } +#HTMLReporter.showDetails #details { display: block; } +#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } +#HTMLReporter .summary { margin-top: 14px; } +#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } +#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } +#HTMLReporter .summary .specSummary.failed a { color: #b03911; } +#HTMLReporter .description + .suite { margin-top: 0; } +#HTMLReporter .suite { margin-top: 14px; } +#HTMLReporter .suite a { color: #333333; } +#HTMLReporter #details .specDetail { margin-bottom: 28px; } +#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } +#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } +#HTMLReporter .resultMessage span.result { display: block; } +#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } + +#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } +#TrivialReporter a:visited, #TrivialReporter a { color: #303; } +#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } +#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } +#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } +#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } +#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } +#TrivialReporter .runner.running { background-color: yellow; } +#TrivialReporter .options { text-align: right; font-size: .8em; } +#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } +#TrivialReporter .suite .suite { margin: 5px; } +#TrivialReporter .suite.passed { background-color: #dfd; } +#TrivialReporter .suite.failed { background-color: #fdd; } +#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } +#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } +#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } +#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } +#TrivialReporter .spec.skipped { background-color: #bbb; } +#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } +#TrivialReporter .passed { background-color: #cfc; display: none; } +#TrivialReporter .failed { background-color: #fbb; } +#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } +#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } +#TrivialReporter .resultMessage .mismatch { color: black; } +#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } +#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } +#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } +#TrivialReporter #jasmine_content { position: fixed; right: 100%; } +#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; } diff --git a/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.js b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.js new file mode 100644 index 0000000000000000000000000000000000000000..6b3459b913ffe7d15f30f8a93d5f7b6d5939ab7e --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/lib/jasmine-1.3.1/jasmine.js @@ -0,0 +1,2600 @@ +var isCommonJS = typeof window == "undefined" && typeof exports == "object"; + +/** + * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. + * + * @namespace + */ +var jasmine = {}; +if (isCommonJS) exports.jasmine = jasmine; +/** + * @private + */ +jasmine.unimplementedMethod_ = function() { + throw new Error("unimplemented method"); +}; + +/** + * Use jasmine.undefined instead of undefined, since undefined is just + * a plain old variable and may be redefined by somebody else. + * + * @private + */ +jasmine.undefined = jasmine.___undefined___; + +/** + * Show diagnostic messages in the console if set to true + * + */ +jasmine.VERBOSE = false; + +/** + * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. + * + */ +jasmine.DEFAULT_UPDATE_INTERVAL = 250; + +/** + * Maximum levels of nesting that will be included when an object is pretty-printed + */ +jasmine.MAX_PRETTY_PRINT_DEPTH = 40; + +/** + * Default timeout interval in milliseconds for waitsFor() blocks. + */ +jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; + +/** + * By default exceptions thrown in the context of a test are caught by jasmine so that it can run the remaining tests in the suite. + * Set to false to let the exception bubble up in the browser. + * + */ +jasmine.CATCH_EXCEPTIONS = true; + +jasmine.getGlobal = function() { + function getGlobal() { + return this; + } + + return getGlobal(); +}; + +/** + * Allows for bound functions to be compared. Internal use only. + * + * @ignore + * @private + * @param base {Object} bound 'this' for the function + * @param name {Function} function to find + */ +jasmine.bindOriginal_ = function(base, name) { + var original = base[name]; + if (original.apply) { + return function() { + return original.apply(base, arguments); + }; + } else { + // IE support + return jasmine.getGlobal()[name]; + } +}; + +jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); +jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); +jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); +jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); + +jasmine.MessageResult = function(values) { + this.type = 'log'; + this.values = values; + this.trace = new Error(); // todo: test better +}; + +jasmine.MessageResult.prototype.toString = function() { + var text = ""; + for (var i = 0; i < this.values.length; i++) { + if (i > 0) text += " "; + if (jasmine.isString_(this.values[i])) { + text += this.values[i]; + } else { + text += jasmine.pp(this.values[i]); + } + } + return text; +}; + +jasmine.ExpectationResult = function(params) { + this.type = 'expect'; + this.matcherName = params.matcherName; + this.passed_ = params.passed; + this.expected = params.expected; + this.actual = params.actual; + this.message = this.passed_ ? 'Passed.' : params.message; + + var trace = (params.trace || new Error(this.message)); + this.trace = this.passed_ ? '' : trace; +}; + +jasmine.ExpectationResult.prototype.toString = function () { + return this.message; +}; + +jasmine.ExpectationResult.prototype.passed = function () { + return this.passed_; +}; + +/** + * Getter for the Jasmine environment. Ensures one gets created + */ +jasmine.getEnv = function() { + var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); + return env; +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isArray_ = function(value) { + return jasmine.isA_("Array", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isString_ = function(value) { + return jasmine.isA_("String", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isNumber_ = function(value) { + return jasmine.isA_("Number", value); +}; + +/** + * @ignore + * @private + * @param {String} typeName + * @param value + * @returns {Boolean} + */ +jasmine.isA_ = function(typeName, value) { + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; +}; + +/** + * Pretty printer for expecations. Takes any object and turns it into a human-readable string. + * + * @param value {Object} an object to be outputted + * @returns {String} + */ +jasmine.pp = function(value) { + var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); + stringPrettyPrinter.format(value); + return stringPrettyPrinter.string; +}; + +/** + * Returns true if the object is a DOM Node. + * + * @param {Object} obj object to check + * @returns {Boolean} + */ +jasmine.isDomNode = function(obj) { + return obj.nodeType > 0; +}; + +/** + * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. + * + * @example + * // don't care about which function is passed in, as long as it's a function + * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); + * + * @param {Class} clazz + * @returns matchable object of the type clazz + */ +jasmine.any = function(clazz) { + return new jasmine.Matchers.Any(clazz); +}; + +/** + * Returns a matchable subset of a JSON object. For use in expectations when you don't care about all of the + * attributes on the object. + * + * @example + * // don't care about any other attributes than foo. + * expect(mySpy).toHaveBeenCalledWith(jasmine.objectContaining({foo: "bar"}); + * + * @param sample {Object} sample + * @returns matchable object for the sample + */ +jasmine.objectContaining = function (sample) { + return new jasmine.Matchers.ObjectContaining(sample); +}; + +/** + * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. + * + * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine + * expectation syntax. Spies can be checked if they were called or not and what the calling params were. + * + * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). + * + * Spies are torn down at the end of every spec. + * + * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. + * + * @example + * // a stub + * var myStub = jasmine.createSpy('myStub'); // can be used anywhere + * + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // actual foo.not will not be called, execution stops + * spyOn(foo, 'not'); + + // foo.not spied upon, execution will continue to implementation + * spyOn(foo, 'not').andCallThrough(); + * + * // fake example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // foo.not(val) will return val + * spyOn(foo, 'not').andCallFake(function(value) {return value;}); + * + * // mock example + * foo.not(7 == 7); + * expect(foo.not).toHaveBeenCalled(); + * expect(foo.not).toHaveBeenCalledWith(true); + * + * @constructor + * @see spyOn, jasmine.createSpy, jasmine.createSpyObj + * @param {String} name + */ +jasmine.Spy = function(name) { + /** + * The name of the spy, if provided. + */ + this.identity = name || 'unknown'; + /** + * Is this Object a spy? + */ + this.isSpy = true; + /** + * The actual function this spy stubs. + */ + this.plan = function() { + }; + /** + * Tracking of the most recent call to the spy. + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy.mostRecentCall.args = [1, 2]; + */ + this.mostRecentCall = {}; + + /** + * Holds arguments for each call to the spy, indexed by call count + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy(7, 8); + * mySpy.mostRecentCall.args = [7, 8]; + * mySpy.argsForCall[0] = [1, 2]; + * mySpy.argsForCall[1] = [7, 8]; + */ + this.argsForCall = []; + this.calls = []; +}; + +/** + * Tells a spy to call through to the actual implemenatation. + * + * @example + * var foo = { + * bar: function() { // do some stuff } + * } + * + * // defining a spy on an existing property: foo.bar + * spyOn(foo, 'bar').andCallThrough(); + */ +jasmine.Spy.prototype.andCallThrough = function() { + this.plan = this.originalValue; + return this; +}; + +/** + * For setting the return value of a spy. + * + * @example + * // defining a spy from scratch: foo() returns 'baz' + * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); + * + * // defining a spy on an existing property: foo.bar() returns 'baz' + * spyOn(foo, 'bar').andReturn('baz'); + * + * @param {Object} value + */ +jasmine.Spy.prototype.andReturn = function(value) { + this.plan = function() { + return value; + }; + return this; +}; + +/** + * For throwing an exception when a spy is called. + * + * @example + * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' + * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); + * + * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' + * spyOn(foo, 'bar').andThrow('baz'); + * + * @param {String} exceptionMsg + */ +jasmine.Spy.prototype.andThrow = function(exceptionMsg) { + this.plan = function() { + throw exceptionMsg; + }; + return this; +}; + +/** + * Calls an alternate implementation when a spy is called. + * + * @example + * var baz = function() { + * // do some stuff, return something + * } + * // defining a spy from scratch: foo() calls the function baz + * var foo = jasmine.createSpy('spy on foo').andCall(baz); + * + * // defining a spy on an existing property: foo.bar() calls an anonymnous function + * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); + * + * @param {Function} fakeFunc + */ +jasmine.Spy.prototype.andCallFake = function(fakeFunc) { + this.plan = fakeFunc; + return this; +}; + +/** + * Resets all of a spy's the tracking variables so that it can be used again. + * + * @example + * spyOn(foo, 'bar'); + * + * foo.bar(); + * + * expect(foo.bar.callCount).toEqual(1); + * + * foo.bar.reset(); + * + * expect(foo.bar.callCount).toEqual(0); + */ +jasmine.Spy.prototype.reset = function() { + this.wasCalled = false; + this.callCount = 0; + this.argsForCall = []; + this.calls = []; + this.mostRecentCall = {}; +}; + +jasmine.createSpy = function(name) { + + var spyObj = function() { + spyObj.wasCalled = true; + spyObj.callCount++; + var args = jasmine.util.argsToArray(arguments); + spyObj.mostRecentCall.object = this; + spyObj.mostRecentCall.args = args; + spyObj.argsForCall.push(args); + spyObj.calls.push({object: this, args: args}); + return spyObj.plan.apply(this, arguments); + }; + + var spy = new jasmine.Spy(name); + + for (var prop in spy) { + spyObj[prop] = spy[prop]; + } + + spyObj.reset(); + + return spyObj; +}; + +/** + * Determines whether an object is a spy. + * + * @param {jasmine.Spy|Object} putativeSpy + * @returns {Boolean} + */ +jasmine.isSpy = function(putativeSpy) { + return putativeSpy && putativeSpy.isSpy; +}; + +/** + * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something + * large in one call. + * + * @param {String} baseName name of spy class + * @param {Array} methodNames array of names of methods to make spies + */ +jasmine.createSpyObj = function(baseName, methodNames) { + if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { + throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); + } + var obj = {}; + for (var i = 0; i < methodNames.length; i++) { + obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); + } + return obj; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the current spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.log = function() { + var spec = jasmine.getEnv().currentSpec; + spec.log.apply(spec, arguments); +}; + +/** + * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. + * + * @example + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops + * + * @see jasmine.createSpy + * @param obj + * @param methodName + * @return {jasmine.Spy} a Jasmine spy that can be chained with all spy methods + */ +var spyOn = function(obj, methodName) { + return jasmine.getEnv().currentSpec.spyOn(obj, methodName); +}; +if (isCommonJS) exports.spyOn = spyOn; + +/** + * Creates a Jasmine spec that will be added to the current suite. + * + * // TODO: pending tests + * + * @example + * it('should be true', function() { + * expect(true).toEqual(true); + * }); + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var it = function(desc, func) { + return jasmine.getEnv().it(desc, func); +}; +if (isCommonJS) exports.it = it; + +/** + * Creates a disabled Jasmine spec. + * + * A convenience method that allows existing specs to be disabled temporarily during development. + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var xit = function(desc, func) { + return jasmine.getEnv().xit(desc, func); +}; +if (isCommonJS) exports.xit = xit; + +/** + * Starts a chain for a Jasmine expectation. + * + * It is passed an Object that is the actual value and should chain to one of the many + * jasmine.Matchers functions. + * + * @param {Object} actual Actual value to test against and expected value + * @return {jasmine.Matchers} + */ +var expect = function(actual) { + return jasmine.getEnv().currentSpec.expect(actual); +}; +if (isCommonJS) exports.expect = expect; + +/** + * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. + * + * @param {Function} func Function that defines part of a jasmine spec. + */ +var runs = function(func) { + jasmine.getEnv().currentSpec.runs(func); +}; +if (isCommonJS) exports.runs = runs; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +var waits = function(timeout) { + jasmine.getEnv().currentSpec.waits(timeout); +}; +if (isCommonJS) exports.waits = waits; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); +}; +if (isCommonJS) exports.waitsFor = waitsFor; + +/** + * A function that is called before each spec in a suite. + * + * Used for spec setup, including validating assumptions. + * + * @param {Function} beforeEachFunction + */ +var beforeEach = function(beforeEachFunction) { + jasmine.getEnv().beforeEach(beforeEachFunction); +}; +if (isCommonJS) exports.beforeEach = beforeEach; + +/** + * A function that is called after each spec in a suite. + * + * Used for restoring any state that is hijacked during spec execution. + * + * @param {Function} afterEachFunction + */ +var afterEach = function(afterEachFunction) { + jasmine.getEnv().afterEach(afterEachFunction); +}; +if (isCommonJS) exports.afterEach = afterEach; + +/** + * Defines a suite of specifications. + * + * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared + * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization + * of setup in some tests. + * + * @example + * // TODO: a simple suite + * + * // TODO: a simple suite with a nested describe block + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var describe = function(description, specDefinitions) { + return jasmine.getEnv().describe(description, specDefinitions); +}; +if (isCommonJS) exports.describe = describe; + +/** + * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var xdescribe = function(description, specDefinitions) { + return jasmine.getEnv().xdescribe(description, specDefinitions); +}; +if (isCommonJS) exports.xdescribe = xdescribe; + + +// Provide the XMLHttpRequest class for IE 5.x-6.x: +jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { + function tryIt(f) { + try { + return f(); + } catch(e) { + } + return null; + } + + var xhr = tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.6.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.3.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP"); + }) || + tryIt(function() { + return new ActiveXObject("Microsoft.XMLHTTP"); + }); + + if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); + + return xhr; +} : XMLHttpRequest; +/** + * @namespace + */ +jasmine.util = {}; + +/** + * Declare that a child class inherit it's prototype from the parent class. + * + * @private + * @param {Function} childClass + * @param {Function} parentClass + */ +jasmine.util.inherit = function(childClass, parentClass) { + /** + * @private + */ + var subclass = function() { + }; + subclass.prototype = parentClass.prototype; + childClass.prototype = new subclass(); +}; + +jasmine.util.formatException = function(e) { + var lineNumber; + if (e.line) { + lineNumber = e.line; + } + else if (e.lineNumber) { + lineNumber = e.lineNumber; + } + + var file; + + if (e.sourceURL) { + file = e.sourceURL; + } + else if (e.fileName) { + file = e.fileName; + } + + var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); + + if (file && lineNumber) { + message += ' in ' + file + ' (line ' + lineNumber + ')'; + } + + return message; +}; + +jasmine.util.htmlEscape = function(str) { + if (!str) return str; + return str.replace(/&/g, '&') + .replace(//g, '>'); +}; + +jasmine.util.argsToArray = function(args) { + var arrayOfArgs = []; + for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); + return arrayOfArgs; +}; + +jasmine.util.extend = function(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; +}; + +/** + * Environment for Jasmine + * + * @constructor + */ +jasmine.Env = function() { + this.currentSpec = null; + this.currentSuite = null; + this.currentRunner_ = new jasmine.Runner(this); + + this.reporter = new jasmine.MultiReporter(); + + this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; + this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; + this.lastUpdate = 0; + this.specFilter = function() { + return true; + }; + + this.nextSpecId_ = 0; + this.nextSuiteId_ = 0; + this.equalityTesters_ = []; + + // wrap matchers + this.matchersClass = function() { + jasmine.Matchers.apply(this, arguments); + }; + jasmine.util.inherit(this.matchersClass, jasmine.Matchers); + + jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); +}; + + +jasmine.Env.prototype.setTimeout = jasmine.setTimeout; +jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; +jasmine.Env.prototype.setInterval = jasmine.setInterval; +jasmine.Env.prototype.clearInterval = jasmine.clearInterval; + +/** + * @returns an object containing jasmine version build info, if set. + */ +jasmine.Env.prototype.version = function () { + if (jasmine.version_) { + return jasmine.version_; + } else { + throw new Error('Version not set'); + } +}; + +/** + * @returns string containing jasmine version build info, if set. + */ +jasmine.Env.prototype.versionString = function() { + if (!jasmine.version_) { + return "version unknown"; + } + + var version = this.version(); + var versionString = version.major + "." + version.minor + "." + version.build; + if (version.release_candidate) { + versionString += ".rc" + version.release_candidate; + } + versionString += " revision " + version.revision; + return versionString; +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSpecId = function () { + return this.nextSpecId_++; +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSuiteId = function () { + return this.nextSuiteId_++; +}; + +/** + * Register a reporter to receive status updates from Jasmine. + * @param {jasmine.Reporter} reporter An object which will receive status updates. + */ +jasmine.Env.prototype.addReporter = function(reporter) { + this.reporter.addReporter(reporter); +}; + +jasmine.Env.prototype.execute = function() { + this.currentRunner_.execute(); +}; + +jasmine.Env.prototype.describe = function(description, specDefinitions) { + var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); + + var parentSuite = this.currentSuite; + if (parentSuite) { + parentSuite.add(suite); + } else { + this.currentRunner_.add(suite); + } + + this.currentSuite = suite; + + var declarationError = null; + try { + specDefinitions.call(suite); + } catch(e) { + declarationError = e; + } + + if (declarationError) { + this.it("encountered a declaration exception", function() { + throw declarationError; + }); + } + + this.currentSuite = parentSuite; + + return suite; +}; + +jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { + if (this.currentSuite) { + this.currentSuite.beforeEach(beforeEachFunction); + } else { + this.currentRunner_.beforeEach(beforeEachFunction); + } +}; + +jasmine.Env.prototype.currentRunner = function () { + return this.currentRunner_; +}; + +jasmine.Env.prototype.afterEach = function(afterEachFunction) { + if (this.currentSuite) { + this.currentSuite.afterEach(afterEachFunction); + } else { + this.currentRunner_.afterEach(afterEachFunction); + } + +}; + +jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { + return { + execute: function() { + } + }; +}; + +jasmine.Env.prototype.it = function(description, func) { + var spec = new jasmine.Spec(this, this.currentSuite, description); + this.currentSuite.add(spec); + this.currentSpec = spec; + + if (func) { + spec.runs(func); + } + + return spec; +}; + +jasmine.Env.prototype.xit = function(desc, func) { + return { + id: this.nextSpecId(), + runs: function() { + } + }; +}; + +jasmine.Env.prototype.compareRegExps_ = function(a, b, mismatchKeys, mismatchValues) { + if (a.source != b.source) + mismatchValues.push("expected pattern /" + b.source + "/ is not equal to the pattern /" + a.source + "/"); + + if (a.ignoreCase != b.ignoreCase) + mismatchValues.push("expected modifier i was" + (b.ignoreCase ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.global != b.global) + mismatchValues.push("expected modifier g was" + (b.global ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.multiline != b.multiline) + mismatchValues.push("expected modifier m was" + (b.multiline ? " " : " not ") + "set and does not equal the origin modifier"); + + if (a.sticky != b.sticky) + mismatchValues.push("expected modifier y was" + (b.sticky ? " " : " not ") + "set and does not equal the origin modifier"); + + return (mismatchValues.length === 0); +}; + +jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { + if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { + return true; + } + + a.__Jasmine_been_here_before__ = b; + b.__Jasmine_been_here_before__ = a; + + var hasKey = function(obj, keyName) { + return obj !== null && obj[keyName] !== jasmine.undefined; + }; + + for (var property in b) { + if (!hasKey(a, property) && hasKey(b, property)) { + mismatchKeys.push("expected has key '" + property + "', but missing from actual."); + } + } + for (property in a) { + if (!hasKey(b, property) && hasKey(a, property)) { + mismatchKeys.push("expected missing key '" + property + "', but present in actual."); + } + } + for (property in b) { + if (property == '__Jasmine_been_here_before__') continue; + if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { + mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); + } + } + + if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { + mismatchValues.push("arrays were not the same length"); + } + + delete a.__Jasmine_been_here_before__; + delete b.__Jasmine_been_here_before__; + return (mismatchKeys.length === 0 && mismatchValues.length === 0); +}; + +jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { + mismatchKeys = mismatchKeys || []; + mismatchValues = mismatchValues || []; + + for (var i = 0; i < this.equalityTesters_.length; i++) { + var equalityTester = this.equalityTesters_[i]; + var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); + if (result !== jasmine.undefined) return result; + } + + if (a === b) return true; + + if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { + return (a == jasmine.undefined && b == jasmine.undefined); + } + + if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { + return a === b; + } + + if (a instanceof Date && b instanceof Date) { + return a.getTime() == b.getTime(); + } + + if (a.jasmineMatches) { + return a.jasmineMatches(b); + } + + if (b.jasmineMatches) { + return b.jasmineMatches(a); + } + + if (a instanceof jasmine.Matchers.ObjectContaining) { + return a.matches(b); + } + + if (b instanceof jasmine.Matchers.ObjectContaining) { + return b.matches(a); + } + + if (jasmine.isString_(a) && jasmine.isString_(b)) { + return (a == b); + } + + if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { + return (a == b); + } + + if (a instanceof RegExp && b instanceof RegExp) { + return this.compareRegExps_(a, b, mismatchKeys, mismatchValues); + } + + if (typeof a === "object" && typeof b === "object") { + return this.compareObjects_(a, b, mismatchKeys, mismatchValues); + } + + //Straight check + return (a === b); +}; + +jasmine.Env.prototype.contains_ = function(haystack, needle) { + if (jasmine.isArray_(haystack)) { + for (var i = 0; i < haystack.length; i++) { + if (this.equals_(haystack[i], needle)) return true; + } + return false; + } + return haystack.indexOf(needle) >= 0; +}; + +jasmine.Env.prototype.addEqualityTester = function(equalityTester) { + this.equalityTesters_.push(equalityTester); +}; +/** No-op base class for Jasmine reporters. + * + * @constructor + */ +jasmine.Reporter = function() { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerResults = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecStarting = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecResults = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.log = function(str) { +}; + +/** + * Blocks are functions with executable code that make up a spec. + * + * @constructor + * @param {jasmine.Env} env + * @param {Function} func + * @param {jasmine.Spec} spec + */ +jasmine.Block = function(env, func, spec) { + this.env = env; + this.func = func; + this.spec = spec; +}; + +jasmine.Block.prototype.execute = function(onComplete) { + if (!jasmine.CATCH_EXCEPTIONS) { + this.func.apply(this.spec); + } + else { + try { + this.func.apply(this.spec); + } catch (e) { + this.spec.fail(e); + } + } + onComplete(); +}; +/** JavaScript API reporter. + * + * @constructor + */ +jasmine.JsApiReporter = function() { + this.started = false; + this.finished = false; + this.suites_ = []; + this.results_ = {}; +}; + +jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { + this.started = true; + var suites = runner.topLevelSuites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + this.suites_.push(this.summarize_(suite)); + } +}; + +jasmine.JsApiReporter.prototype.suites = function() { + return this.suites_; +}; + +jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { + var isSuite = suiteOrSpec instanceof jasmine.Suite; + var summary = { + id: suiteOrSpec.id, + name: suiteOrSpec.description, + type: isSuite ? 'suite' : 'spec', + children: [] + }; + + if (isSuite) { + var children = suiteOrSpec.children(); + for (var i = 0; i < children.length; i++) { + summary.children.push(this.summarize_(children[i])); + } + } + return summary; +}; + +jasmine.JsApiReporter.prototype.results = function() { + return this.results_; +}; + +jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { + return this.results_[specId]; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { + this.finished = true; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { + this.results_[spec.id] = { + messages: spec.results().getItems(), + result: spec.results().failedCount > 0 ? "failed" : "passed" + }; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.log = function(str) { +}; + +jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ + var results = {}; + for (var i = 0; i < specIds.length; i++) { + var specId = specIds[i]; + results[specId] = this.summarizeResult_(this.results_[specId]); + } + return results; +}; + +jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ + var summaryMessages = []; + var messagesLength = result.messages.length; + for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { + var resultMessage = result.messages[messageIndex]; + summaryMessages.push({ + text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, + passed: resultMessage.passed ? resultMessage.passed() : true, + type: resultMessage.type, + message: resultMessage.message, + trace: { + stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined + } + }); + } + + return { + result : result.result, + messages : summaryMessages + }; +}; + +/** + * @constructor + * @param {jasmine.Env} env + * @param actual + * @param {jasmine.Spec} spec + */ +jasmine.Matchers = function(env, actual, spec, opt_isNot) { + this.env = env; + this.actual = actual; + this.spec = spec; + this.isNot = opt_isNot || false; + this.reportWasCalled_ = false; +}; + +// todo: @deprecated as of Jasmine 0.11, remove soon [xw] +jasmine.Matchers.pp = function(str) { + throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); +}; + +// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] +jasmine.Matchers.prototype.report = function(result, failing_message, details) { + throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); +}; + +jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { + for (var methodName in prototype) { + if (methodName == 'report') continue; + var orig = prototype[methodName]; + matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); + } +}; + +jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { + return function() { + var matcherArgs = jasmine.util.argsToArray(arguments); + var result = matcherFunction.apply(this, arguments); + + if (this.isNot) { + result = !result; + } + + if (this.reportWasCalled_) return result; + + var message; + if (!result) { + if (this.message) { + message = this.message.apply(this, arguments); + if (jasmine.isArray_(message)) { + message = message[this.isNot ? 1 : 0]; + } + } else { + var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); + message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; + if (matcherArgs.length > 0) { + for (var i = 0; i < matcherArgs.length; i++) { + if (i > 0) message += ","; + message += " " + jasmine.pp(matcherArgs[i]); + } + } + message += "."; + } + } + var expectationResult = new jasmine.ExpectationResult({ + matcherName: matcherName, + passed: result, + expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], + actual: this.actual, + message: message + }); + this.spec.addMatcherResult(expectationResult); + return jasmine.undefined; + }; +}; + + + + +/** + * toBe: compares the actual to the expected using === + * @param expected + */ +jasmine.Matchers.prototype.toBe = function(expected) { + return this.actual === expected; +}; + +/** + * toNotBe: compares the actual to the expected using !== + * @param expected + * @deprecated as of 1.0. Use not.toBe() instead. + */ +jasmine.Matchers.prototype.toNotBe = function(expected) { + return this.actual !== expected; +}; + +/** + * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. + * + * @param expected + */ +jasmine.Matchers.prototype.toEqual = function(expected) { + return this.env.equals_(this.actual, expected); +}; + +/** + * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual + * @param expected + * @deprecated as of 1.0. Use not.toEqual() instead. + */ +jasmine.Matchers.prototype.toNotEqual = function(expected) { + return !this.env.equals_(this.actual, expected); +}; + +/** + * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes + * a pattern or a String. + * + * @param expected + */ +jasmine.Matchers.prototype.toMatch = function(expected) { + return new RegExp(expected).test(this.actual); +}; + +/** + * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch + * @param expected + * @deprecated as of 1.0. Use not.toMatch() instead. + */ +jasmine.Matchers.prototype.toNotMatch = function(expected) { + return !(new RegExp(expected).test(this.actual)); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeDefined = function() { + return (this.actual !== jasmine.undefined); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeUndefined = function() { + return (this.actual === jasmine.undefined); +}; + +/** + * Matcher that compares the actual to null. + */ +jasmine.Matchers.prototype.toBeNull = function() { + return (this.actual === null); +}; + +/** + * Matcher that compares the actual to NaN. + */ +jasmine.Matchers.prototype.toBeNaN = function() { + this.message = function() { + return [ "Expected " + jasmine.pp(this.actual) + " to be NaN." ]; + }; + + return (this.actual !== this.actual); +}; + +/** + * Matcher that boolean not-nots the actual. + */ +jasmine.Matchers.prototype.toBeTruthy = function() { + return !!this.actual; +}; + + +/** + * Matcher that boolean nots the actual. + */ +jasmine.Matchers.prototype.toBeFalsy = function() { + return !this.actual; +}; + + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called. + */ +jasmine.Matchers.prototype.toHaveBeenCalled = function() { + if (arguments.length > 0) { + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to have been called.", + "Expected spy " + this.actual.identity + " not to have been called." + ]; + }; + + return this.actual.wasCalled; +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was not called. + * + * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead + */ +jasmine.Matchers.prototype.wasNotCalled = function() { + if (arguments.length > 0) { + throw new Error('wasNotCalled does not take arguments'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to not have been called.", + "Expected spy " + this.actual.identity + " to have been called." + ]; + }; + + return !this.actual.wasCalled; +}; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. + * + * @example + * + */ +jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + this.message = function() { + var invertedMessage = "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was."; + var positiveMessage = ""; + if (this.actual.callCount === 0) { + positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called."; + } else { + positiveMessage = "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but actual calls were " + jasmine.pp(this.actual.argsForCall).replace(/^\[ | \]$/g, '') + } + return [positiveMessage, invertedMessage]; + }; + + return this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; + +/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasNotCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", + "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" + ]; + }; + + return !this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** + * Matcher that checks that the expected item is an element in the actual Array. + * + * @param {Object} expected + */ +jasmine.Matchers.prototype.toContain = function(expected) { + return this.env.contains_(this.actual, expected); +}; + +/** + * Matcher that checks that the expected item is NOT an element in the actual Array. + * + * @param {Object} expected + * @deprecated as of 1.0. Use not.toContain() instead. + */ +jasmine.Matchers.prototype.toNotContain = function(expected) { + return !this.env.contains_(this.actual, expected); +}; + +jasmine.Matchers.prototype.toBeLessThan = function(expected) { + return this.actual < expected; +}; + +jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { + return this.actual > expected; +}; + +/** + * Matcher that checks that the expected item is equal to the actual item + * up to a given level of decimal precision (default 2). + * + * @param {Number} expected + * @param {Number} precision, as number of decimal places + */ +jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { + if (!(precision === 0)) { + precision = precision || 2; + } + return Math.abs(expected - this.actual) < (Math.pow(10, -precision) / 2); +}; + +/** + * Matcher that checks that the expected exception was thrown by the actual. + * + * @param {String} [expected] + */ +jasmine.Matchers.prototype.toThrow = function(expected) { + var result = false; + var exception; + if (typeof this.actual != 'function') { + throw new Error('Actual is not a function'); + } + try { + this.actual(); + } catch (e) { + exception = e; + } + if (exception) { + result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); + } + + var not = this.isNot ? "not " : ""; + + this.message = function() { + if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { + return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); + } else { + return "Expected function to throw an exception."; + } + }; + + return result; +}; + +jasmine.Matchers.Any = function(expectedClass) { + this.expectedClass = expectedClass; +}; + +jasmine.Matchers.Any.prototype.jasmineMatches = function(other) { + if (this.expectedClass == String) { + return typeof other == 'string' || other instanceof String; + } + + if (this.expectedClass == Number) { + return typeof other == 'number' || other instanceof Number; + } + + if (this.expectedClass == Function) { + return typeof other == 'function' || other instanceof Function; + } + + if (this.expectedClass == Object) { + return typeof other == 'object'; + } + + return other instanceof this.expectedClass; +}; + +jasmine.Matchers.Any.prototype.jasmineToString = function() { + return ''; +}; + +jasmine.Matchers.ObjectContaining = function (sample) { + this.sample = sample; +}; + +jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) { + mismatchKeys = mismatchKeys || []; + mismatchValues = mismatchValues || []; + + var env = jasmine.getEnv(); + + var hasKey = function(obj, keyName) { + return obj != null && obj[keyName] !== jasmine.undefined; + }; + + for (var property in this.sample) { + if (!hasKey(other, property) && hasKey(this.sample, property)) { + mismatchKeys.push("expected has key '" + property + "', but missing from actual."); + } + else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) { + mismatchValues.push("'" + property + "' was '" + (other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]) + "' in expected, but was '" + (this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + "' in actual."); + } + } + + return (mismatchKeys.length === 0 && mismatchValues.length === 0); +}; + +jasmine.Matchers.ObjectContaining.prototype.jasmineToString = function () { + return ""; +}; +// Mock setTimeout, clearTimeout +// Contributed by Pivotal Computer Systems, www.pivotalsf.com + +jasmine.FakeTimer = function() { + this.reset(); + + var self = this; + self.setTimeout = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); + return self.timeoutsMade; + }; + + self.setInterval = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); + return self.timeoutsMade; + }; + + self.clearTimeout = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + + self.clearInterval = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + +}; + +jasmine.FakeTimer.prototype.reset = function() { + this.timeoutsMade = 0; + this.scheduledFunctions = {}; + this.nowMillis = 0; +}; + +jasmine.FakeTimer.prototype.tick = function(millis) { + var oldMillis = this.nowMillis; + var newMillis = oldMillis + millis; + this.runFunctionsWithinRange(oldMillis, newMillis); + this.nowMillis = newMillis; +}; + +jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { + var scheduledFunc; + var funcsToRun = []; + for (var timeoutKey in this.scheduledFunctions) { + scheduledFunc = this.scheduledFunctions[timeoutKey]; + if (scheduledFunc != jasmine.undefined && + scheduledFunc.runAtMillis >= oldMillis && + scheduledFunc.runAtMillis <= nowMillis) { + funcsToRun.push(scheduledFunc); + this.scheduledFunctions[timeoutKey] = jasmine.undefined; + } + } + + if (funcsToRun.length > 0) { + funcsToRun.sort(function(a, b) { + return a.runAtMillis - b.runAtMillis; + }); + for (var i = 0; i < funcsToRun.length; ++i) { + try { + var funcToRun = funcsToRun[i]; + this.nowMillis = funcToRun.runAtMillis; + funcToRun.funcToCall(); + if (funcToRun.recurring) { + this.scheduleFunction(funcToRun.timeoutKey, + funcToRun.funcToCall, + funcToRun.millis, + true); + } + } catch(e) { + } + } + this.runFunctionsWithinRange(oldMillis, nowMillis); + } +}; + +jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { + this.scheduledFunctions[timeoutKey] = { + runAtMillis: this.nowMillis + millis, + funcToCall: funcToCall, + recurring: recurring, + timeoutKey: timeoutKey, + millis: millis + }; +}; + +/** + * @namespace + */ +jasmine.Clock = { + defaultFakeTimer: new jasmine.FakeTimer(), + + reset: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.reset(); + }, + + tick: function(millis) { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.tick(millis); + }, + + runFunctionsWithinRange: function(oldMillis, nowMillis) { + jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); + }, + + scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { + jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); + }, + + useMock: function() { + if (!jasmine.Clock.isInstalled()) { + var spec = jasmine.getEnv().currentSpec; + spec.after(jasmine.Clock.uninstallMock); + + jasmine.Clock.installMock(); + } + }, + + installMock: function() { + jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; + }, + + uninstallMock: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.installed = jasmine.Clock.real; + }, + + real: { + setTimeout: jasmine.getGlobal().setTimeout, + clearTimeout: jasmine.getGlobal().clearTimeout, + setInterval: jasmine.getGlobal().setInterval, + clearInterval: jasmine.getGlobal().clearInterval + }, + + assertInstalled: function() { + if (!jasmine.Clock.isInstalled()) { + throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); + } + }, + + isInstalled: function() { + return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; + }, + + installed: null +}; +jasmine.Clock.installed = jasmine.Clock.real; + +//else for IE support +jasmine.getGlobal().setTimeout = function(funcToCall, millis) { + if (jasmine.Clock.installed.setTimeout.apply) { + return jasmine.Clock.installed.setTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.setTimeout(funcToCall, millis); + } +}; + +jasmine.getGlobal().setInterval = function(funcToCall, millis) { + if (jasmine.Clock.installed.setInterval.apply) { + return jasmine.Clock.installed.setInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.setInterval(funcToCall, millis); + } +}; + +jasmine.getGlobal().clearTimeout = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearTimeout(timeoutKey); + } +}; + +jasmine.getGlobal().clearInterval = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearInterval(timeoutKey); + } +}; + +/** + * @constructor + */ +jasmine.MultiReporter = function() { + this.subReporters_ = []; +}; +jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); + +jasmine.MultiReporter.prototype.addReporter = function(reporter) { + this.subReporters_.push(reporter); +}; + +(function() { + var functionNames = [ + "reportRunnerStarting", + "reportRunnerResults", + "reportSuiteResults", + "reportSpecStarting", + "reportSpecResults", + "log" + ]; + for (var i = 0; i < functionNames.length; i++) { + var functionName = functionNames[i]; + jasmine.MultiReporter.prototype[functionName] = (function(functionName) { + return function() { + for (var j = 0; j < this.subReporters_.length; j++) { + var subReporter = this.subReporters_[j]; + if (subReporter[functionName]) { + subReporter[functionName].apply(subReporter, arguments); + } + } + }; + })(functionName); + } +})(); +/** + * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults + * + * @constructor + */ +jasmine.NestedResults = function() { + /** + * The total count of results + */ + this.totalCount = 0; + /** + * Number of passed results + */ + this.passedCount = 0; + /** + * Number of failed results + */ + this.failedCount = 0; + /** + * Was this suite/spec skipped? + */ + this.skipped = false; + /** + * @ignore + */ + this.items_ = []; +}; + +/** + * Roll up the result counts. + * + * @param result + */ +jasmine.NestedResults.prototype.rollupCounts = function(result) { + this.totalCount += result.totalCount; + this.passedCount += result.passedCount; + this.failedCount += result.failedCount; +}; + +/** + * Adds a log message. + * @param values Array of message parts which will be concatenated later. + */ +jasmine.NestedResults.prototype.log = function(values) { + this.items_.push(new jasmine.MessageResult(values)); +}; + +/** + * Getter for the results: message & results. + */ +jasmine.NestedResults.prototype.getItems = function() { + return this.items_; +}; + +/** + * Adds a result, tracking counts (total, passed, & failed) + * @param {jasmine.ExpectationResult|jasmine.NestedResults} result + */ +jasmine.NestedResults.prototype.addResult = function(result) { + if (result.type != 'log') { + if (result.items_) { + this.rollupCounts(result); + } else { + this.totalCount++; + if (result.passed()) { + this.passedCount++; + } else { + this.failedCount++; + } + } + } + this.items_.push(result); +}; + +/** + * @returns {Boolean} True if everything below passed + */ +jasmine.NestedResults.prototype.passed = function() { + return this.passedCount === this.totalCount; +}; +/** + * Base class for pretty printing for expectation results. + */ +jasmine.PrettyPrinter = function() { + this.ppNestLevel_ = 0; +}; + +/** + * Formats a value in a nice, human-readable string. + * + * @param value + */ +jasmine.PrettyPrinter.prototype.format = function(value) { + this.ppNestLevel_++; + try { + if (value === jasmine.undefined) { + this.emitScalar('undefined'); + } else if (value === null) { + this.emitScalar('null'); + } else if (value === jasmine.getGlobal()) { + this.emitScalar(''); + } else if (value.jasmineToString) { + this.emitScalar(value.jasmineToString()); + } else if (typeof value === 'string') { + this.emitString(value); + } else if (jasmine.isSpy(value)) { + this.emitScalar("spy on " + value.identity); + } else if (value instanceof RegExp) { + this.emitScalar(value.toString()); + } else if (typeof value === 'function') { + this.emitScalar('Function'); + } else if (typeof value.nodeType === 'number') { + this.emitScalar('HTMLNode'); + } else if (value instanceof Date) { + this.emitScalar('Date(' + value + ')'); + } else if (value.__Jasmine_been_here_before__) { + this.emitScalar(''); + } else if (jasmine.isArray_(value) || typeof value == 'object') { + value.__Jasmine_been_here_before__ = true; + if (jasmine.isArray_(value)) { + this.emitArray(value); + } else { + this.emitObject(value); + } + delete value.__Jasmine_been_here_before__; + } else { + this.emitScalar(value.toString()); + } + } finally { + this.ppNestLevel_--; + } +}; + +jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { + for (var property in obj) { + if (!obj.hasOwnProperty(property)) continue; + if (property == '__Jasmine_been_here_before__') continue; + fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && + obj.__lookupGetter__(property) !== null) : false); + } +}; + +jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; + +jasmine.StringPrettyPrinter = function() { + jasmine.PrettyPrinter.call(this); + + this.string = ''; +}; +jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); + +jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { + this.append(value); +}; + +jasmine.StringPrettyPrinter.prototype.emitString = function(value) { + this.append("'" + value + "'"); +}; + +jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) { + this.append("Array"); + return; + } + + this.append('[ '); + for (var i = 0; i < array.length; i++) { + if (i > 0) { + this.append(', '); + } + this.format(array[i]); + } + this.append(' ]'); +}; + +jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { + if (this.ppNestLevel_ > jasmine.MAX_PRETTY_PRINT_DEPTH) { + this.append("Object"); + return; + } + + var self = this; + this.append('{ '); + var first = true; + + this.iterateObject(obj, function(property, isGetter) { + if (first) { + first = false; + } else { + self.append(', '); + } + + self.append(property); + self.append(' : '); + if (isGetter) { + self.append(''); + } else { + self.format(obj[property]); + } + }); + + this.append(' }'); +}; + +jasmine.StringPrettyPrinter.prototype.append = function(value) { + this.string += value; +}; +jasmine.Queue = function(env) { + this.env = env; + + // parallel to blocks. each true value in this array means the block will + // get executed even if we abort + this.ensured = []; + this.blocks = []; + this.running = false; + this.index = 0; + this.offset = 0; + this.abort = false; +}; + +jasmine.Queue.prototype.addBefore = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.blocks.unshift(block); + this.ensured.unshift(ensure); +}; + +jasmine.Queue.prototype.add = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.blocks.push(block); + this.ensured.push(ensure); +}; + +jasmine.Queue.prototype.insertNext = function(block, ensure) { + if (ensure === jasmine.undefined) { + ensure = false; + } + + this.ensured.splice((this.index + this.offset + 1), 0, ensure); + this.blocks.splice((this.index + this.offset + 1), 0, block); + this.offset++; +}; + +jasmine.Queue.prototype.start = function(onComplete) { + this.running = true; + this.onComplete = onComplete; + this.next_(); +}; + +jasmine.Queue.prototype.isRunning = function() { + return this.running; +}; + +jasmine.Queue.LOOP_DONT_RECURSE = true; + +jasmine.Queue.prototype.next_ = function() { + var self = this; + var goAgain = true; + + while (goAgain) { + goAgain = false; + + if (self.index < self.blocks.length && !(this.abort && !this.ensured[self.index])) { + var calledSynchronously = true; + var completedSynchronously = false; + + var onComplete = function () { + if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { + completedSynchronously = true; + return; + } + + if (self.blocks[self.index].abort) { + self.abort = true; + } + + self.offset = 0; + self.index++; + + var now = new Date().getTime(); + if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { + self.env.lastUpdate = now; + self.env.setTimeout(function() { + self.next_(); + }, 0); + } else { + if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { + goAgain = true; + } else { + self.next_(); + } + } + }; + self.blocks[self.index].execute(onComplete); + + calledSynchronously = false; + if (completedSynchronously) { + onComplete(); + } + + } else { + self.running = false; + if (self.onComplete) { + self.onComplete(); + } + } + } +}; + +jasmine.Queue.prototype.results = function() { + var results = new jasmine.NestedResults(); + for (var i = 0; i < this.blocks.length; i++) { + if (this.blocks[i].results) { + results.addResult(this.blocks[i].results()); + } + } + return results; +}; + + +/** + * Runner + * + * @constructor + * @param {jasmine.Env} env + */ +jasmine.Runner = function(env) { + var self = this; + self.env = env; + self.queue = new jasmine.Queue(env); + self.before_ = []; + self.after_ = []; + self.suites_ = []; +}; + +jasmine.Runner.prototype.execute = function() { + var self = this; + if (self.env.reporter.reportRunnerStarting) { + self.env.reporter.reportRunnerStarting(this); + } + self.queue.start(function () { + self.finishCallback(); + }); +}; + +jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.splice(0,0,beforeEachFunction); +}; + +jasmine.Runner.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.splice(0,0,afterEachFunction); +}; + + +jasmine.Runner.prototype.finishCallback = function() { + this.env.reporter.reportRunnerResults(this); +}; + +jasmine.Runner.prototype.addSuite = function(suite) { + this.suites_.push(suite); +}; + +jasmine.Runner.prototype.add = function(block) { + if (block instanceof jasmine.Suite) { + this.addSuite(block); + } + this.queue.add(block); +}; + +jasmine.Runner.prototype.specs = function () { + var suites = this.suites(); + var specs = []; + for (var i = 0; i < suites.length; i++) { + specs = specs.concat(suites[i].specs()); + } + return specs; +}; + +jasmine.Runner.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Runner.prototype.topLevelSuites = function() { + var topLevelSuites = []; + for (var i = 0; i < this.suites_.length; i++) { + if (!this.suites_[i].parentSuite) { + topLevelSuites.push(this.suites_[i]); + } + } + return topLevelSuites; +}; + +jasmine.Runner.prototype.results = function() { + return this.queue.results(); +}; +/** + * Internal representation of a Jasmine specification, or test. + * + * @constructor + * @param {jasmine.Env} env + * @param {jasmine.Suite} suite + * @param {String} description + */ +jasmine.Spec = function(env, suite, description) { + if (!env) { + throw new Error('jasmine.Env() required'); + } + if (!suite) { + throw new Error('jasmine.Suite() required'); + } + var spec = this; + spec.id = env.nextSpecId ? env.nextSpecId() : null; + spec.env = env; + spec.suite = suite; + spec.description = description; + spec.queue = new jasmine.Queue(env); + + spec.afterCallbacks = []; + spec.spies_ = []; + + spec.results_ = new jasmine.NestedResults(); + spec.results_.description = description; + spec.matchersClass = null; +}; + +jasmine.Spec.prototype.getFullName = function() { + return this.suite.getFullName() + ' ' + this.description + '.'; +}; + + +jasmine.Spec.prototype.results = function() { + return this.results_; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.Spec.prototype.log = function() { + return this.results_.log(arguments); +}; + +jasmine.Spec.prototype.runs = function (func) { + var block = new jasmine.Block(this.env, func, this); + this.addToQueue(block); + return this; +}; + +jasmine.Spec.prototype.addToQueue = function (block) { + if (this.queue.isRunning()) { + this.queue.insertNext(block); + } else { + this.queue.add(block); + } +}; + +/** + * @param {jasmine.ExpectationResult} result + */ +jasmine.Spec.prototype.addMatcherResult = function(result) { + this.results_.addResult(result); +}; + +jasmine.Spec.prototype.expect = function(actual) { + var positive = new (this.getMatchersClass_())(this.env, actual, this); + positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); + return positive; +}; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +jasmine.Spec.prototype.waits = function(timeout) { + var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); + this.addToQueue(waitsFunc); + return this; +}; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + var latchFunction_ = null; + var optional_timeoutMessage_ = null; + var optional_timeout_ = null; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + switch (typeof arg) { + case 'function': + latchFunction_ = arg; + break; + case 'string': + optional_timeoutMessage_ = arg; + break; + case 'number': + optional_timeout_ = arg; + break; + } + } + + var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); + this.addToQueue(waitsForFunc); + return this; +}; + +jasmine.Spec.prototype.fail = function (e) { + var expectationResult = new jasmine.ExpectationResult({ + passed: false, + message: e ? jasmine.util.formatException(e) : 'Exception', + trace: { stack: e.stack } + }); + this.results_.addResult(expectationResult); +}; + +jasmine.Spec.prototype.getMatchersClass_ = function() { + return this.matchersClass || this.env.matchersClass; +}; + +jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { + var parent = this.getMatchersClass_(); + var newMatchersClass = function() { + parent.apply(this, arguments); + }; + jasmine.util.inherit(newMatchersClass, parent); + jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); + this.matchersClass = newMatchersClass; +}; + +jasmine.Spec.prototype.finishCallback = function() { + this.env.reporter.reportSpecResults(this); +}; + +jasmine.Spec.prototype.finish = function(onComplete) { + this.removeAllSpies(); + this.finishCallback(); + if (onComplete) { + onComplete(); + } +}; + +jasmine.Spec.prototype.after = function(doAfter) { + if (this.queue.isRunning()) { + this.queue.add(new jasmine.Block(this.env, doAfter, this), true); + } else { + this.afterCallbacks.unshift(doAfter); + } +}; + +jasmine.Spec.prototype.execute = function(onComplete) { + var spec = this; + if (!spec.env.specFilter(spec)) { + spec.results_.skipped = true; + spec.finish(onComplete); + return; + } + + this.env.reporter.reportSpecStarting(this); + + spec.env.currentSpec = spec; + + spec.addBeforesAndAftersToQueue(); + + spec.queue.start(function () { + spec.finish(onComplete); + }); +}; + +jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { + var runner = this.env.currentRunner(); + var i; + + for (var suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); + } + } + for (i = 0; i < runner.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); + } + for (i = 0; i < this.afterCallbacks.length; i++) { + this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this), true); + } + for (suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, suite.after_[i], this), true); + } + } + for (i = 0; i < runner.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, runner.after_[i], this), true); + } +}; + +jasmine.Spec.prototype.explodes = function() { + throw 'explodes function should not have been called'; +}; + +jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { + if (obj == jasmine.undefined) { + throw "spyOn could not find an object to spy upon for " + methodName + "()"; + } + + if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { + throw methodName + '() method does not exist'; + } + + if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { + throw new Error(methodName + ' has already been spied upon'); + } + + var spyObj = jasmine.createSpy(methodName); + + this.spies_.push(spyObj); + spyObj.baseObj = obj; + spyObj.methodName = methodName; + spyObj.originalValue = obj[methodName]; + + obj[methodName] = spyObj; + + return spyObj; +}; + +jasmine.Spec.prototype.removeAllSpies = function() { + for (var i = 0; i < this.spies_.length; i++) { + var spy = this.spies_[i]; + spy.baseObj[spy.methodName] = spy.originalValue; + } + this.spies_ = []; +}; + +/** + * Internal representation of a Jasmine suite. + * + * @constructor + * @param {jasmine.Env} env + * @param {String} description + * @param {Function} specDefinitions + * @param {jasmine.Suite} parentSuite + */ +jasmine.Suite = function(env, description, specDefinitions, parentSuite) { + var self = this; + self.id = env.nextSuiteId ? env.nextSuiteId() : null; + self.description = description; + self.queue = new jasmine.Queue(env); + self.parentSuite = parentSuite; + self.env = env; + self.before_ = []; + self.after_ = []; + self.children_ = []; + self.suites_ = []; + self.specs_ = []; +}; + +jasmine.Suite.prototype.getFullName = function() { + var fullName = this.description; + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { + fullName = parentSuite.description + ' ' + fullName; + } + return fullName; +}; + +jasmine.Suite.prototype.finish = function(onComplete) { + this.env.reporter.reportSuiteResults(this); + this.finished = true; + if (typeof(onComplete) == 'function') { + onComplete(); + } +}; + +jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.unshift(beforeEachFunction); +}; + +jasmine.Suite.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.unshift(afterEachFunction); +}; + +jasmine.Suite.prototype.results = function() { + return this.queue.results(); +}; + +jasmine.Suite.prototype.add = function(suiteOrSpec) { + this.children_.push(suiteOrSpec); + if (suiteOrSpec instanceof jasmine.Suite) { + this.suites_.push(suiteOrSpec); + this.env.currentRunner().addSuite(suiteOrSpec); + } else { + this.specs_.push(suiteOrSpec); + } + this.queue.add(suiteOrSpec); +}; + +jasmine.Suite.prototype.specs = function() { + return this.specs_; +}; + +jasmine.Suite.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Suite.prototype.children = function() { + return this.children_; +}; + +jasmine.Suite.prototype.execute = function(onComplete) { + var self = this; + this.queue.start(function () { + self.finish(onComplete); + }); +}; +jasmine.WaitsBlock = function(env, timeout, spec) { + this.timeout = timeout; + jasmine.Block.call(this, env, null, spec); +}; + +jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); + +jasmine.WaitsBlock.prototype.execute = function (onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); + } + this.env.setTimeout(function () { + onComplete(); + }, this.timeout); +}; +/** + * A block which waits for some condition to become true, with timeout. + * + * @constructor + * @extends jasmine.Block + * @param {jasmine.Env} env The Jasmine environment. + * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. + * @param {Function} latchFunction A function which returns true when the desired condition has been met. + * @param {String} message The message to display if the desired condition hasn't been met within the given time period. + * @param {jasmine.Spec} spec The Jasmine spec. + */ +jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { + this.timeout = timeout || env.defaultTimeoutInterval; + this.latchFunction = latchFunction; + this.message = message; + this.totalTimeSpentWaitingForLatch = 0; + jasmine.Block.call(this, env, null, spec); +}; +jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); + +jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; + +jasmine.WaitsForBlock.prototype.execute = function(onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); + } + var latchFunctionResult; + try { + latchFunctionResult = this.latchFunction.apply(this.spec); + } catch (e) { + this.spec.fail(e); + onComplete(); + return; + } + + if (latchFunctionResult) { + onComplete(); + } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { + var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); + this.spec.fail({ + name: 'timeout', + message: message + }); + + this.abort = true; + onComplete(); + } else { + this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; + var self = this; + this.env.setTimeout(function() { + self.execute(onComplete); + }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); + } +}; + +jasmine.version_= { + "major": 1, + "minor": 3, + "build": 1, + "revision": 1354556913 +}; diff --git a/tools/ui/node_modules/lz-string/tests/lz-string-spec.js b/tools/ui/node_modules/lz-string/tests/lz-string-spec.js new file mode 100644 index 0000000000000000000000000000000000000000..150fc25dc8cc3897126155f3002b599ec7986d7d --- /dev/null +++ b/tools/ui/node_modules/lz-string/tests/lz-string-spec.js @@ -0,0 +1,226 @@ +var compressionTests = function(compress, decompress, uint8array_mode) { + it('compresses and decompresses "Hello world!"', function() { + var compressed = compress('Hello world!'); + expect(compressed).not.toBe('Hello world!'); + var decompressed = decompress(compressed); + expect(decompressed).toBe('Hello world!'); + }); + + it('compresses and decompresses null', function() { + var compressed = compress(null); + if (uint8array_mode===false){ + expect(compressed).toBe(''); + expect(typeof compressed).toBe(typeof ''); + } else { //uint8array + expect(compressed instanceof Uint8Array).toBe(true); + expect(compressed.length).toBe(0); //empty array + } + var decompressed = decompress(compressed); + expect(decompressed).toBe(null); + }); + + it('compresses and decompresses undefined', function() { + var compressed = compress(); + if (uint8array_mode===false){ + expect(compressed).toBe(''); + expect(typeof compressed).toBe(typeof ''); + } else { //uint8array + expect(compressed instanceof Uint8Array).toBe(true); + expect(compressed.length).toBe(0); //empty array + } + var decompressed = decompress(compressed); + expect(decompressed).toBe(null); + }); + + it('decompresses null', function() { + var decompressed = decompress(null); + expect(decompressed).toBe(''); + }); + + it('compresses and decompresses an empty string', function() { + var compressed = compress(''); + if (uint8array_mode===false){ + expect(compressed).not.toBe(''); + expect(typeof compressed).toBe(typeof ''); + } else { //uint8array + expect(compressed instanceof Uint8Array).toBe(true); + expect(compressed.length).not.toBe(0); //not an empty array when compress + } + var decompressed = decompress(compressed); + expect(decompressed).toBe(''); + }); + + it('compresses and decompresses all printable UTF-16 characters', + function() { + var testString = ''; + var i; + for (i = 32; i < 127; ++i) { + testString += String.fromCharCode(i); + } + for (i = 128 + 32; i < 55296; ++i) { + testString += String.fromCharCode(i); + } + for (i = 63744; i < 65536; ++i) { + testString += String.fromCharCode(i); + } + var compressed = compress(testString); + expect(compressed).not.toBe(testString); + var decompressed = decompress(compressed); + expect(decompressed).toBe(testString); + }); + + it('compresses and decompresses a string that repeats', + function() { + var testString = 'aaaaabaaaaacaaaaadaaaaaeaaaaa'; + var compressed = compress(testString); + expect(compressed).not.toBe(testString); + expect(compressed.length).toBeLessThan(testString.length); + var decompressed = decompress(compressed); + expect(decompressed).toBe(testString); + }); + + it('compresses and decompresses a long string', + function() { + var testString = ''; + var i; + for (i=0 ; i<1000 ; i++) + testString += Math.random() + " "; + + var compressed = compress(testString); + expect(compressed).not.toBe(testString); + expect(compressed.length).toBeLessThan(testString.length); + var decompressed = decompress(compressed); + expect(decompressed).toBe(testString); + }); +}; + +describe('LZString', function() { + describe('base 64', function() { + compressionTests(LZString.compressToBase64 + ,LZString.decompressFromBase64 + ,false //uint8array_mode: false + ); + }); + describe('UTF-16', function() { + compressionTests(LZString.compressToUTF16 + ,LZString.decompressFromUTF16 + ,false //uint8array_mode: false + ); + }); + describe('URI Encoded', function() { + compressionTests(LZString.compressToEncodedURIComponent + ,LZString.decompressFromEncodedURIComponent + ,false //uint8array_mode: false + ); + }); + describe('uint8array', function() { + compressionTests(LZString.compressToUint8Array + ,LZString.decompressFromUint8Array + ,true //uint8array_mode: true + ); + }); + describe('raw', function() { + compressionTests(LZString.compress + ,LZString.decompress + ,false //uint8array_mode: false + ); + }); +}); + + +describe('Specific URL Encoded', function() { + it("check that all chars are URL safe", function() { + var testString = ''; + var i; + for (i=0 ; i<1000 ; i++) + testString += Math.random() + " "; + + var compressed = LZString.compressToEncodedURIComponent(testString); + expect(compressed.indexOf("=")).toBe(-1); + expect(compressed.indexOf("/")).toBe(-1); + var decompressed = LZString.decompressFromEncodedURIComponent(compressed); + expect(decompressed).toBe(testString); + }); + it("check that + and ' ' are interchangeable in decompression", function() { + var decompressed = 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.'; + var compressed = "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR 0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c-I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi A4-plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgAAA$$"; + var decomp2 = LZString.decompressFromEncodedURIComponent(compressed); + expect(decompressed).toBe(decomp2); + }); +}); + + +var testEncBinCompat = function(comp, expectedDec, expectedComp) { + var compressed = comp(expectedDec); + expect(compressed).toEqual(expectedComp); +}; + +var testDecBinCompat = function(dec, expectedDec, expectedComp) { + var decompressed = dec(expectedComp); + expect(decompressed).toEqual(expectedDec); +}; + +describe('Binary encoding compatibility tests (optional)', function() { + it('base64', function() { + testEncBinCompat(LZString.compressToBase64, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c/I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4/plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgA" + ); + }); + it('uriEncoding', function() { + testEncBinCompat(LZString.compressToEncodedURIComponent, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c-I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4-plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgA" + ); + }); + it('UInt8Array', function() { + testEncBinCompat(LZString.compressToUint8Array, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + new Uint8Array([8,133,112,78,9,96,118,14,96,4,1,112,33,130,16,123,55,70,1,163,180,13,103,128,206,121,64,21,128,166,3,24,33,64,38,167,168,128,22,21,196,126,210,237,4,8,66,150,56,72,161,224,11,106,36,20,54,96,41,16,0,230,138,17,10,185,132,50,161,64,13,166,146,84,147,111,167,0,17,40,164,84,193,163,156,201,12,89,70,226,139,64,13,205,180,38,9,89,9,148,136,84,6,70,40,80,224,64,229,236,61,92,161,240,0,232,224,0,85,61,77,205,45,173,109,116,144,192,192,1,61,216,209,68,216,208,0,204,88,35,9,221,60,0,140,208,233,50,1,200,73,53,51,68,172,224,160,171,101,113,202,64,16,114,242,88,131,210,216,10,32,12,24,1,221,121,153,73,8,137,145,178,228,187,112,41,69,203,232,233,13,161,139,217,56,160,99,226,80,234,225,71,173,187,77,241,101,55,145,80,48,224,156,32,136,33,203,52,217,36,214,193,54,57,160,99,129,245,152,208,65,238,216,0,85,8,11,140,15,112,66,212,72,0,65,39,149,14,0,3,23,209,156,160,214,81,49,14,6,177,114,105,44,130,31,58,14,65,3,210,104,224,230,64,154,35,196,21,25,160,192,248,18,57,91,44,131,2,216,248,176,77,162,66,197,97,179,156,41,221,107,11,142,3,37,51,65,12,65,112,187,23,143,146,41,139,46,232,52,12,64,7,33,69,24,56,204,28,148,185,209,207,200,217,48,168,138,34,8,23,166,43,144,201,110,127,34,3,78,0,73,129,228,160,8,0,45,16,196,98,170,74,115,82,190,6,56,68,74,32,128,192,192,40,54,25,77,128,210,106,77,90,107,34,34,197,203,105,3,232,45,200,109,188,22,57,182,169,177,198,30,98,168,134,36,96,3,170,176,68,186,166,186,80,75,196,65,160,224,154,36,50,140,7,111,42,87,12,50,235,160,185,207,166,224,136,142,132,201,166,79,238,192,160,6,42,224,37,46,12,84,67,208,100,176,67,138,166,142,235,67,6,182,88,119,18,93,119,10,48,160,213,249,225,159,84,129,131,227,161,128,64,240,30,70,45,11,34,128,213,186,222,109,54,79,150,192,145,81,38,133,2,157,177,156,203,128,80,10,5,106,2,27,15,100,241,16,144,16,58,11,54,205,87,25,5,163,65,186,103,194,129,101,19,40,27,36,41,54,86,140,5,49,137,15,159,50,208,116,92,8,131,44,187,16,16,228,80,207,30,205,129,241,177,110,158,14,128,10,10,220,64,17,20,24,128,4,145,16,10,51,11,243,129,107,101,1,132,81,54,99,77,0,208,136,18,16,241,92,106,80,41,137,141,47,96,158,229,129,151,54,14,135,194,32,230,0,134,41,64,241,155,65,98,136,216,52,128,162,144,42,47,128,227,250,101,45,67,193,186,42,68,4,209,183,26,4,72,180,86,95,15,131,181,200,202,52,199,64,178,40,136,0,0]) + ); + }); + it('UTF16', function() { + testEncBinCompat(LZString.compressToUTF16, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "\u0462\u5C33\u414C\u0780\u7320\u1025\u6063\u0230\u3DBB\u51A0\u3496\u40F6\u3C26\u3A05K\u00C6\u01AC\u0870\u04F4\u7AA8\u00D0\u5731\u7DC5\u6D24\u0441\u25AE\u0934\u1E20\u5B71\u1070\u6CE0\u2930\u0093\u22A4\u2177\u1863\u152AV\u4D44\u54B3\u37F3\u4024\u2534\u456C\u0D3C\u7344\u18D2\u4702\u45C0\u0393\u36A4\u60B5\u486C\u5241\u282C\u4648\u2890\u1059\u3DA7\u55EA\u0FA0\u03C3\u4020\u555D\u2706\u4B8B\u2DCE\u492C\u0620\u0517\u31C2\u44F8\u6820\u3336\u0481\u1DF3\u6024\u3363\u5284\u01E8\u24BA\u4CF1\u15BC\u0A2A\u5B4B\u4749@\u7312\u2C61\u74D6\u0164\u00E1\u402E\u7606\u32B2\u08A9\u48F9\u394E\u6E25\u147C\u5F67\u2456\u4337\u5958\u5051\u78B4\u1D7C\u149A\u6DFA\u37E5\u4A8F\u1170\u1890\u2728\u1124\u1CD3\u26E9\u137B\u028C\u39C0\u31E0\u7D86\u1A28\u1F0D\u4022\u5440\u1738\u0F90\u218A\u1220\u0844\u7970\u7020\u0C7F\u2359\u20F6\u28B8\u43A1\u564E\u26B2\u6430\u7D08\u1CA2\u03F2\u3490\u39B0\u1364\u3C61\u28ED\u0323\u7044\u397B\u1661\u40D6\u1F36\u04FA\u1236\u15A6\u6758\u29FD\u35A5\u63A0\u64C6\u3430\u622B\u430C\u2F3F\u1249\u45B7\u3A2D\u01A8\u0092\u0A48\u6103\u1859\u14D9\u6907\u7256\u2635\u08C2\u1060\u5EB8\u5741\u498E\u3FB1\u00F3\u4029\u183E\u2520\u2020\u5A41\u4482\u5545\u1CF4\u57E0\u63A4\u2271\u0223\u01A0\u2856\u0CC6\u6054\u4D69\u55C6\u5931\u0B37\u16F2\u0408\u1704\u1B8F\u02E7\u1B8A\u4DAE\u1899\u4571\u0644\u3021\u6ACC\u08B7\u2A8B\u52A2\u2F31\u0361\u60BA\u1239\u2321\u6E05\u2590\u61B7\u2EA2\u73BF\u2700\u4467\u2152\u34E9\u7F0C\u0520\u18CB\u406A\u2E2C\u2A41\u7439\u1628\u38CA\u3497\u2D2C\u0D8C\u5897\u094E\u5DE2\u4634\u0D7F\u4F2C\u7D72\u0327\u63C1\u4040\u3C27\u48E5\u50D2\u1426\u570B\u3CFA\u366F\u4B80\u2474\u24F0\u5049\u6DAC\u734E\u00C0\u0A25\u3521\u06E3\u6CBE\u1129\u00A1\u684C\u6DBA\u5739\u02F1\u508E\u4D18\u2836\u28B9\u208C\u4872\u3676\u4622\u4C82\u2213\u734D\u03C2\u7042\u0679\u3B30\u0892\u1453\u63F9\u583F\u0DAB\u3A98\u1D20\u0A2A\u6E40\u0465\u0330i\u08A0\u28EC\u1807\u018B\u32A0\u6134\u26EC\u34F0\u06A4\u2068\u2202\u5C8A\u2834\u6283\u260C\u0A0E\u2C2C\u5CF8\u1D2F\u4240\u7320\u21AA\u283E\u19D4\u0B34\u2380\u6921\u22B0\u1537\u6058\u7F6C\u52F4\u1E2D\u68C9\u0829\u51D7\u0D22\u124D\u0AEB\u7118\u1DCE\u2348\u69AE\u40D2\u1464\u0020\u0020" + ); + }); +}); +describe('Binary decoding compatibility tests (mandatory)', function() { + it('base64 - old encoding', function() { + testDecBinCompat(LZString.decompressFromBase64, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c/I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4/plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgAAA==" + ); + }); + it('base64', function() { + testDecBinCompat(LZString.decompressFromBase64, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c/I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4/plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgA" + ); + }); + it('uriEncoding - old encoding', function() { + testDecBinCompat(LZString.decompressFromEncodedURIComponent, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c-I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4-plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgA" + ); + }); + it('uriEncoding', function() { + testDecBinCompat(LZString.decompressFromEncodedURIComponent, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "CIVwTglgdg5gBAFwIYIQezdGAaO0DWeAznlAFYCmAxghQCanqIAWFcR+0u0ECEKWOEih4AtqJBQ2YCkQAOaKEQq5hDKhQA2mklSTb6cAESikVMGjnMkMWUbii0ANzbQmCVkJlIhUBkYoUOBA5ew9XKHwAOjgAFU9Tc0trW10kMDAAT3Y0UTY0ADMWCMJ3TwAjNDpMgHISTUzRKzgoKtlccpAEHLyWIPS2AogDBgB3XmZSQiJkbLku3ApRcvo6Q2hi9k4oGPiUOrhR627TfFlN5FQMOCcIIghyzTZJNbBNjmgY4H1mNBB7tgAVQgLjA9wQtRIAEEnlQ4AAxfRnKDWUTEOBrFyaSyCHzoOQQPSaODmQJojxBUZoMD4EjlbLIMC2PiwTaJCxWGznCndawuOAyUzQQxBcLsXj5Ipiy7oNAxAByFFGDjMHJS50c-I2TCoiiIIF6YrkMlufyIDTgBJgeSgCAAtEMRiqkpzUr4GOERKIIDAwCg2GU2A0mpNWmsiIsXLaQPoLchtvBY5tqmxxh5iqIYkYAOqsES6prpQS8RBoOCaJDKMB28qVwwy66C5z6bgiI6EyaZP7sCgBirgJS4MVEPQZLBDiqaO60MGtlh3El13CjCg1fnhn1SBg+OhgEDwHkYtCyKA1brebTZPlsCRUSaFAp2xnMuAUAoFagIbD2TxEJAQOgs2zVcZBaNBumfCgWUTKBskKTZWjAUxiQ+fMtB0XAiDLLsQEORQzx7NgfGxbp4OgAoK3EARFBiABJEQCjML84FrZQGEUTZjTQDQiBIQ8VxqUCmJjS9gnuWBlzYOh8Ig5gCGKUDxm0FiiNg0gKKQKi+A4-plLUPBuipEBNG3GgRItFZfD4O1yMo0x0CyKIgAAA$$" + ); + }); + it('UInt8Array', function() { + testDecBinCompat(LZString.decompressFromUint8Array, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + new Uint8Array([8,133,112,78,9,96,118,14,96,4,1,112,33,130,16,123,55,70,1,163,180,13,103,128,206,121,64,21,128,166,3,24,33,64,38,167,168,128,22,21,196,126,210,237,4,8,66,150,56,72,161,224,11,106,36,20,54,96,41,16,0,230,138,17,10,185,132,50,161,64,13,166,146,84,147,111,167,0,17,40,164,84,193,163,156,201,12,89,70,226,139,64,13,205,180,38,9,89,9,148,136,84,6,70,40,80,224,64,229,236,61,92,161,240,0,232,224,0,85,61,77,205,45,173,109,116,144,192,192,1,61,216,209,68,216,208,0,204,88,35,9,221,60,0,140,208,233,50,1,200,73,53,51,68,172,224,160,171,101,113,202,64,16,114,242,88,131,210,216,10,32,12,24,1,221,121,153,73,8,137,145,178,228,187,112,41,69,203,232,233,13,161,139,217,56,160,99,226,80,234,225,71,173,187,77,241,101,55,145,80,48,224,156,32,136,33,203,52,217,36,214,193,54,57,160,99,129,245,152,208,65,238,216,0,85,8,11,140,15,112,66,212,72,0,65,39,149,14,0,3,23,209,156,160,214,81,49,14,6,177,114,105,44,130,31,58,14,65,3,210,104,224,230,64,154,35,196,21,25,160,192,248,18,57,91,44,131,2,216,248,176,77,162,66,197,97,179,156,41,221,107,11,142,3,37,51,65,12,65,112,187,23,143,146,41,139,46,232,52,12,64,7,33,69,24,56,204,28,148,185,209,207,200,217,48,168,138,34,8,23,166,43,144,201,110,127,34,3,78,0,73,129,228,160,8,0,45,16,196,98,170,74,115,82,190,6,56,68,74,32,128,192,192,40,54,25,77,128,210,106,77,90,107,34,34,197,203,105,3,232,45,200,109,188,22,57,182,169,177,198,30,98,168,134,36,96,3,170,176,68,186,166,186,80,75,196,65,160,224,154,36,50,140,7,111,42,87,12,50,235,160,185,207,166,224,136,142,132,201,166,79,238,192,160,6,42,224,37,46,12,84,67,208,100,176,67,138,166,142,235,67,6,182,88,119,18,93,119,10,48,160,213,249,225,159,84,129,131,227,161,128,64,240,30,70,45,11,34,128,213,186,222,109,54,79,150,192,145,81,38,133,2,157,177,156,203,128,80,10,5,106,2,27,15,100,241,16,144,16,58,11,54,205,87,25,5,163,65,186,103,194,129,101,19,40,27,36,41,54,86,140,5,49,137,15,159,50,208,116,92,8,131,44,187,16,16,228,80,207,30,205,129,241,177,110,158,14,128,10,10,220,64,17,20,24,128,4,145,16,10,51,11,243,129,107,101,1,132,81,54,99,77,0,208,136,18,16,241,92,106,80,41,137,141,47,96,158,229,129,151,54,14,135,194,32,230,0,134,41,64,241,155,65,98,136,216,52,128,162,144,42,47,128,227,250,101,45,67,193,186,42,68,4,209,183,26,4,72,180,86,95,15,131,181,200,202,52,199,64,178,40,136,0,0]) + ); + }); + it('UTF16', function() { + testDecBinCompat(LZString.decompressFromUTF16, + 'During tattooing, ink is injected into the skin, initiating an immune response, and cells called "macrophages" move into the area and "eat up" the ink. The macrophages carry some of the ink to the body\'s lymph nodes, but some that are filled with ink stay put, embedded in the skin. That\'s what makes the tattoo visible under the skin. Dalhousie Uiversity\'s Alec Falkenham is developing a topical cream that works by targeting the macrophages that have remained at the site of the tattoo. New macrophages move in to consume the previously pigment-filled macrophages and then migrate to the lymph nodes, eventually taking all the dye with them. "When comparing it to laser-based tattoo removal, in which you see the burns, the scarring, the blisters, in this case, we\'ve designed a drug that doesn\'t really have much off-target effect," he said. "We\'re not targeting any of the normal skin cells, so you won\'t see a lot of inflammation. In fact, based on the process that we\'re actually using, we don\'t think there will be any inflammation at all and it would actually be anti-inflammatory.', + "\u0462\u5C33\u414C\u0780\u7320\u1025\u6063\u0230\u3DBB\u51A0\u3496\u40F6\u3C26\u3A05K\u00C6\u01AC\u0870\u04F4\u7AA8\u00D0\u5731\u7DC5\u6D24\u0441\u25AE\u0934\u1E20\u5B71\u1070\u6CE0\u2930\u0093\u22A4\u2177\u1863\u152AV\u4D44\u54B3\u37F3\u4024\u2534\u456C\u0D3C\u7344\u18D2\u4702\u45C0\u0393\u36A4\u60B5\u486C\u5241\u282C\u4648\u2890\u1059\u3DA7\u55EA\u0FA0\u03C3\u4020\u555D\u2706\u4B8B\u2DCE\u492C\u0620\u0517\u31C2\u44F8\u6820\u3336\u0481\u1DF3\u6024\u3363\u5284\u01E8\u24BA\u4CF1\u15BC\u0A2A\u5B4B\u4749@\u7312\u2C61\u74D6\u0164\u00E1\u402E\u7606\u32B2\u08A9\u48F9\u394E\u6E25\u147C\u5F67\u2456\u4337\u5958\u5051\u78B4\u1D7C\u149A\u6DFA\u37E5\u4A8F\u1170\u1890\u2728\u1124\u1CD3\u26E9\u137B\u028C\u39C0\u31E0\u7D86\u1A28\u1F0D\u4022\u5440\u1738\u0F90\u218A\u1220\u0844\u7970\u7020\u0C7F\u2359\u20F6\u28B8\u43A1\u564E\u26B2\u6430\u7D08\u1CA2\u03F2\u3490\u39B0\u1364\u3C61\u28ED\u0323\u7044\u397B\u1661\u40D6\u1F36\u04FA\u1236\u15A6\u6758\u29FD\u35A5\u63A0\u64C6\u3430\u622B\u430C\u2F3F\u1249\u45B7\u3A2D\u01A8\u0092\u0A48\u6103\u1859\u14D9\u6907\u7256\u2635\u08C2\u1060\u5EB8\u5741\u498E\u3FB1\u00F3\u4029\u183E\u2520\u2020\u5A41\u4482\u5545\u1CF4\u57E0\u63A4\u2271\u0223\u01A0\u2856\u0CC6\u6054\u4D69\u55C6\u5931\u0B37\u16F2\u0408\u1704\u1B8F\u02E7\u1B8A\u4DAE\u1899\u4571\u0644\u3021\u6ACC\u08B7\u2A8B\u52A2\u2F31\u0361\u60BA\u1239\u2321\u6E05\u2590\u61B7\u2EA2\u73BF\u2700\u4467\u2152\u34E9\u7F0C\u0520\u18CB\u406A\u2E2C\u2A41\u7439\u1628\u38CA\u3497\u2D2C\u0D8C\u5897\u094E\u5DE2\u4634\u0D7F\u4F2C\u7D72\u0327\u63C1\u4040\u3C27\u48E5\u50D2\u1426\u570B\u3CFA\u366F\u4B80\u2474\u24F0\u5049\u6DAC\u734E\u00C0\u0A25\u3521\u06E3\u6CBE\u1129\u00A1\u684C\u6DBA\u5739\u02F1\u508E\u4D18\u2836\u28B9\u208C\u4872\u3676\u4622\u4C82\u2213\u734D\u03C2\u7042\u0679\u3B30\u0892\u1453\u63F9\u583F\u0DAB\u3A98\u1D20\u0A2A\u6E40\u0465\u0330i\u08A0\u28EC\u1807\u018B\u32A0\u6134\u26EC\u34F0\u06A4\u2068\u2202\u5C8A\u2834\u6283\u260C\u0A0E\u2C2C\u5CF8\u1D2F\u4240\u7320\u21AA\u283E\u19D4\u0B34\u2380\u6921\u22B0\u1537\u6058\u7F6C\u52F4\u1E2D\u68C9\u0829\u51D7\u0D22\u124D\u0AEB\u7118\u1DCE\u2348\u69AE\u40D2\u1464\u0020\u0020" + ); + }); +}); diff --git a/tools/ui/node_modules/lz-string/typings/lz-string.d.ts b/tools/ui/node_modules/lz-string/typings/lz-string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6be13f555b9ea327ac7acb566c778c9b32f6bc0 --- /dev/null +++ b/tools/ui/node_modules/lz-string/typings/lz-string.d.ts @@ -0,0 +1,14 @@ +export function compressToBase64(input: string): string; +export function decompressFromBase64(input: string): string; + +export function compressToUTF16(input: string): string; +export function decompressFromUTF16(compressed: string): string; + +export function compressToUint8Array(uncompressed: string): Uint8Array; +export function decompressFromUint8Array(compressed: Uint8Array): string; + +export function compressToEncodedURIComponent(input: string): string; +export function decompressFromEncodedURIComponent(compressed: string): string; + +export function compress(input: string): string; +export function decompress(compressed: string): string; diff --git a/tools/ui/node_modules/magic-string/LICENSE b/tools/ui/node_modules/magic-string/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..667e8b45e4051a6f32008aafa25ecd8aefaaa1f9 --- /dev/null +++ b/tools/ui/node_modules/magic-string/LICENSE @@ -0,0 +1,7 @@ +Copyright 2018 Rich Harris + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/magic-string/README.md b/tools/ui/node_modules/magic-string/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2dc316c1c342ccd3e81e6f92f9d3e516c60fa28c --- /dev/null +++ b/tools/ui/node_modules/magic-string/README.md @@ -0,0 +1,325 @@ +# magic-string + + + build status + + + npm version + + + license + + +Suppose you have some source code. You want to make some light modifications to it - replacing a few characters here and there, wrapping it with a header and footer, etc - and ideally you'd like to generate a [source map](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/) at the end of it. You've thought about using something like [recast](https://github.com/benjamn/recast) (which allows you to generate an AST from some JavaScript, manipulate it, and reprint it with a sourcemap without losing your comments and formatting), but it seems like overkill for your needs (or maybe the source code isn't JavaScript). + +Your requirements are, frankly, rather niche. But they're requirements that I also have, and for which I made magic-string. It's a small, fast utility for manipulating strings and generating sourcemaps. + +## Installation + +magic-string works in both node.js and browser environments. For node, install with npm: + +```bash +npm i magic-string +``` + +To use in browser, grab the [magic-string.umd.js](https://unpkg.com/magic-string/dist/magic-string.umd.js) file and add it to your page: + +```html + +``` + +(It also works with various module systems, if you prefer that sort of thing - it has a dependency on [vlq](https://github.com/Rich-Harris/vlq).) + +## Usage + +These examples assume you're in node.js, or something similar: + +```js +import MagicString from 'magic-string'; +import fs from 'fs'; + +const s = new MagicString('problems = 99'); + +s.update(0, 8, 'answer'); +s.toString(); // 'answer = 99' + +s.update(11, 13, '42'); // character indices always refer to the original string +s.toString(); // 'answer = 42' + +s.prepend('var ').append(';'); // most methods are chainable +s.toString(); // 'var answer = 42;' + +const map = s.generateMap({ + source: 'source.js', + file: 'converted.js.map', + includeContent: true, +}); // generates a v3 sourcemap + +fs.writeFileSync('converted.js', s.toString()); +fs.writeFileSync('converted.js.map', map.toString()); +``` + +You can pass an options argument: + +```js +const s = new MagicString(someCode, { + // these options will be used if you later call `bundle.addSource( s )` - see below + filename: 'foo.js', + indentExclusionRanges: [ + /*...*/ + ], + // mark source as ignore in DevTools, see below #Bundling + ignoreList: false, + // adjust the incoming position - see below + offset: 0, +}); +``` + +## Properties + +### s.offset + +Sets the offset property to adjust the incoming position for the following APIs: `slice`, `update`, `overwrite`, `appendLeft`, `prependLeft`, `appendRight`, `prependRight`, `move`, `reset`, and `remove`. + +Example usage: + +```ts +const s = new MagicString('hello world', { offset: 0 }); +s.offset = 6; +s.slice() === 'world'; +``` + +## Methods + +### s.addSourcemapLocation( index ) + +Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is `false` (see below). + +### s.append( content ) + +Appends the specified content to the end of the string. Returns `this`. + +### s.appendLeft( index, content ) + +Appends the specified `content` at the `index` in the original string. If a range _ending_ with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependLeft(...)`. + +### s.appendRight( index, content ) + +Appends the specified `content` at the `index` in the original string. If a range _starting_ with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependRight(...)`. + +### s.clone() + +Does what you'd expect. + +### s.generateDecodedMap( options ) + +Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. See `generateMap` documentation below for options details. Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + +### s.generateMap( options ) + +Generates a [version 3 sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). All options are, well, optional: + +- `file` - the filename where you plan to write the sourcemap +- `source` - the filename of the file containing the original source +- `includeContent` - whether to include the original content in the map's `sourcesContent` array +- `hires` - whether the mapping should be high-resolution. Hi-res mappings map every single character, meaning (for example) your devtools will always be able to pinpoint the exact location of function calls and so on. With lo-res mappings, devtools may only be able to identify the correct line - but they're quicker to generate and less bulky. You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary instead of per character, suitable for string semantics that are separated by words. If sourcemap locations have been specified with `s.addSourcemapLocation()`, they will be used here. + +The returned sourcemap has two (non-enumerable) methods attached for convenience: + +- `toString` - returns the equivalent of `JSON.stringify(map)` +- `toUrl` - returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + +```js +code += '\n//# sourceMappingURL=' + map.toUrl(); +``` + +### s.hasChanged() + +Indicates if the string has been changed. + +### s.indent( prefix[, options] ) + +Prefixes each line of the string with `prefix`. If `prefix` is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. Returns `this`. + +The `options` argument can have an `exclude` property, which is an array of `[start, end]` character ranges. These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + +### s.insertLeft( index, content ) + +**DEPRECATED** since 0.17 – use `s.appendLeft(...)` instead + +### s.insertRight( index, content ) + +**DEPRECATED** since 0.17 – use `s.prependRight(...)` instead + +### s.isEmpty() + +Returns true if the resulting source is empty (disregarding white space). + +### s.locate( index ) + +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) + +### s.locateOrigin( index ) + +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) + +### s.move( start, end, index ) + +Moves the characters from `start` and `end` to `index`. Returns `this`. + +### s.overwrite( start, end, content[, options] ) + +Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in that range. The same restrictions as `s.remove()` apply. Returns `this`. + +The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and a `contentOnly` property which determines whether only the content is overwritten, or anything that was appended/prepended to the range as well. + +It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + +### s.prepend( content ) + +Prepends the string with the specified content. Returns `this`. + +### s.prependLeft ( index, content ) + +Same as `s.appendLeft(...)`, except that the inserted content will go _before_ any previous appends or prepends at `index` + +### s.prependRight ( index, content ) + +Same as `s.appendRight(...)`, except that the inserted content will go _before_ any previous appends or prepends at `index` + +### s.replace( regexpOrString, substitution ) + +String replacement with RegExp or string. The `substitution` parameter supports strings and functions. Returns `this`. + +```ts +import MagicString from 'magic-string'; + +const s = new MagicString(source); + +s.replace('foo', 'bar'); +s.replace('foo', (str, index, s) => str + '-' + index); +s.replace(/foo/g, 'bar'); +s.replace(/(\w)(\d+)/g, (_, $1, $2) => $1.toUpperCase() + $2); +``` + +The differences from [`String.replace`](<(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)>): + +- It will always match against the **original string** +- It mutates the magic string state (use `.clone()` to be immutable) + +### s.replaceAll( regexpOrString, substitution ) + +Same as `s.replace`, but replace all matched strings instead of just one. +If `regexpOrString` is a regex, then it must have the global (`g`) flag set, or a `TypeError` is thrown. Matches the behavior of the builtin [`String.property.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll). Returns `this`. + +### s.remove( start, end ) + +Removes the characters from `start` to `end` (of the original string, **not** the generated string). Removing the same content twice, or making removals that partially overlap, will cause an error. Returns `this`. + +### s.reset( start, end ) + +Resets the characters from `start` to `end` (of the original string, **not** the generated string). +It can be used to restore previously removed characters and discard unwanted changes. + +### s.slice( start, end ) + +Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. Throws error if the indices are for characters that were already removed. + +### s.snip( start, end ) + +Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + +### s.toString() + +Returns the generated string. + +### s.trim([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. Returns `this`. + +### s.trimStart([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. Returns `this`. + +### s.trimEnd([ charType ]) + +Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. Returns `this`. + +### s.trimLines() + +Removes empty lines from the start and end. Returns `this`. + +### s.update( start, end, content[, options] ) + +Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. Returns `this`. + +The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and an `overwrite` property which defaults to `false` and determines whether anything that was appended/prepended to the range will be overwritten along with the original content. + +`s.update(start, end, content)` is equivalent to `s.overwrite(start, end, content, { contentOnly: true })`. + +## Bundling + +To concatenate several sources, use `MagicString.Bundle`: + +```js +const bundle = new MagicString.Bundle(); + +bundle.addSource({ + filename: 'foo.js', + content: new MagicString('var answer = 42;'), +}); + +bundle.addSource({ + filename: 'bar.js', + content: new MagicString('console.log( answer )'), +}); + +// Sources can be marked as ignore-listed, which provides a hint to debuggers +// to not step into this code and also don't show the source files depending +// on user preferences. +bundle.addSource({ + filename: 'some-3rdparty-library.js', + content: new MagicString('function myLib(){}'), + ignoreList: false, // <-- +}); + +// Advanced: a source can include an `indentExclusionRanges` property +// alongside `filename` and `content`. This will be passed to `s.indent()` +// - see documentation above + +bundle + .indent() // optionally, pass an indent string, otherwise it will be guessed + .prepend('(function () {\n') + .append('}());'); + +bundle.toString(); +// (function () { +// var answer = 42; +// console.log( answer ); +// }()); + +// options are as per `s.generateMap()` above +const map = bundle.generateMap({ + file: 'bundle.js', + includeContent: true, + hires: true, +}); +``` + +As an alternative syntax, if you a) don't have `filename` or `indentExclusionRanges` options, or b) passed those in when you used `new MagicString(...)`, you can simply pass the `MagicString` instance itself: + +```js +const bundle = new MagicString.Bundle(); +const source = new MagicString(someCode, { + filename: 'foo.js', +}); + +bundle.addSource(source); +``` + +## License + +MIT diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.cjs.d.ts b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..76cc537d1c2ccc67239a09dda1bc3c23654ef85c --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.d.ts @@ -0,0 +1,289 @@ +export interface BundleOptions { + intro?: string; + separator?: string; +} + +export interface SourceMapOptions { + /** + * Whether the mapping should be high-resolution. + * Hi-res mappings map every single character, meaning (for example) your devtools will always + * be able to pinpoint the exact location of function calls and so on. + * With lo-res mappings, devtools may only be able to identify the correct + * line - but they're quicker to generate and less bulky. + * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary + * instead of per character, suitable for string semantics that are separated by words. + * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here. + */ + hires?: boolean | 'boundary'; + /** + * The filename where you plan to write the sourcemap. + */ + file?: string; + /** + * The filename of the file containing the original source. + */ + source?: string; + /** + * Whether to include the original content in the map's sourcesContent array. + */ + includeContent?: boolean; +} + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; + +export interface DecodedSourceMap { + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: SourceMapSegment[][]; + x_google_ignoreList?: number[]; +} + +export class SourceMap { + constructor(properties: DecodedSourceMap); + + version: number; + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: string; + x_google_ignoreList?: number[]; + debugId?: string; + + /** + * Returns the equivalent of `JSON.stringify(map)` + */ + toString(): string; + /** + * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + * `generateMap(options?: SourceMapOptions): SourceMap;` + */ + toUrl(): string; +} + +export class Bundle { + constructor(options?: BundleOptions); + /** + * Adds the specified source to the bundle, which can either be a `MagicString` object directly, + * or an options object that holds a magic string `content` property and optionally provides + * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint + * (which defaults to `false`). The `filename` is used when constructing the source map for the + * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint + * is used to populate the `x_google_ignoreList` extension field in the source map, which is a + * mechanism for tools to signal to debuggers that certain sources should be ignored by default + * (depending on user preferences). + */ + addSource( + source: MagicString | { filename?: string; content: MagicString; ignoreList?: boolean }, + ): this; + append(str: string, options?: BundleOptions): this; + clone(): this; + generateMap( + options?: SourceMapOptions, + ): Omit & { sourcesContent: Array }; + generateDecodedMap( + options?: SourceMapOptions, + ): Omit & { sourcesContent: Array }; + getIndentString(): string; + indent(indentStr?: string): this; + indentExclusionRanges: ExclusionRange | Array; + prepend(str: string): this; + toString(): string; + trimLines(): this; + trim(charType?: string): this; + trimStart(charType?: string): this; + trimEnd(charType?: string): this; + isEmpty(): boolean; + length(): number; +} + +export type ExclusionRange = [number, number]; + +export interface MagicStringOptions { + filename?: string; + indentExclusionRanges?: ExclusionRange | Array; + offset?: number; +} + +export interface IndentOptions { + exclude?: ExclusionRange | Array; + indentStart?: boolean; +} + +export interface OverwriteOptions { + storeName?: boolean; + contentOnly?: boolean; +} + +export interface UpdateOptions { + storeName?: boolean; + overwrite?: boolean; +} + +export default class MagicString { + constructor(str: string, options?: MagicStringOptions); + /** + * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. + */ + addSourcemapLocation(char: number): void; + /** + * Appends the specified content to the end of the string. + */ + append(content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *ending* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependLeft(...)`. + */ + appendLeft(index: number, content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *starting* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependRight(...)`. + */ + appendRight(index: number, content: string): this; + /** + * Does what you'd expect. + */ + clone(): this; + /** + * Generates a version 3 sourcemap. + */ + generateMap(options?: SourceMapOptions): SourceMap; + /** + * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. + * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + */ + generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap; + getIndentString(): string; + + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + */ + indent(options?: IndentOptions): this; + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + * + * The options argument can have an exclude property, which is an array of [start, end] character ranges. + * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + */ + indent(indentStr?: string, options?: IndentOptions): this; + indentExclusionRanges: ExclusionRange | Array; + + /** + * Moves the characters from `start` and `end` to `index`. + */ + move(start: number, end: number, index: number): this; + /** + * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in + * that range. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + * + * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + */ + overwrite( + start: number, + end: number, + content: string, + options?: boolean | OverwriteOptions, + ): this; + /** + * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + */ + update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this; + /** + * Prepends the string with the specified content. + */ + prepend(content: string): this; + /** + * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index + */ + prependLeft(index: number, content: string): this; + /** + * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + */ + prependRight(index: number, content: string): this; + /** + * Removes the characters from `start` to `end` (of the original string, **not** the generated string). + * Removing the same content twice, or making removals that partially overlap, will cause an error. + */ + remove(start: number, end: number): this; + /** + * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string). + */ + reset(start: number, end: number): this; + /** + * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. + * Throws error if the indices are for characters that were already removed. + */ + slice(start: number, end: number): string; + /** + * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + */ + snip(start: number, end: number): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. + */ + trim(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. + */ + trimStart(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. + */ + trimEnd(charType?: string): this; + /** + * Removes empty lines from the start and end. + */ + trimLines(): this; + /** + * String replacement with RegExp or string. + */ + replace( + regex: RegExp | string, + replacement: string | ((substring: string, ...args: any[]) => string), + ): this; + /** + * Same as `s.replace`, but replace all matched strings instead of just one. + */ + replaceAll( + regex: RegExp | string, + replacement: string | ((substring: string, ...args: any[]) => string), + ): this; + + lastChar(): string; + lastLine(): string; + /** + * Returns true if the resulting source is empty (disregarding white space). + */ + isEmpty(): boolean; + length(): number; + + /** + * Indicates if the string has been changed. + */ + hasChanged(): boolean; + + original: string; + /** + * Returns the generated string. + */ + toString(): string; + + offset: number; +} diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js new file mode 100644 index 0000000000000000000000000000000000000000..bf3cd1d4350284994f1202d5af20278d30480aea --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js @@ -0,0 +1,1594 @@ +'use strict'; + +var sourcemapCodec = require('@jridgewell/sourcemap-codec'); + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = sourcemapCodec.encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + charInHiresBoundary = false; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + offset: { writable: true, value: options.offset || 0 }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (this.outro) { + mappings.advance(this.outro); + } + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + start = start + this.offset; + end = end + this.offset; + index = index + this.offset; + + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + start = start + this.offset; + end = end + this.offset; + + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length - this.offset) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + let previousChunk = chunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + + // Prevent infinite loop (e.g. via empty chunks, where start === end) + if (chunk === previousChunk) return; + + previousChunk = chunk; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + if (typeof replacement === 'function') { + replacement = replacement(string, index, original); + } + if (string !== replacement) { + this.overwrite(index, index + string.length, replacement); + } + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + let _replacement = replacement; + if (typeof replacement === 'function') { + _replacement = replacement(previous, index, original); + } + if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +} + +MagicString.Bundle = Bundle; +MagicString.SourceMap = SourceMap; +MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 + +module.exports = MagicString; +//# sourceMappingURL=magic-string.cjs.js.map diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js.map b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js.map new file mode 100644 index 0000000000000000000000000000000000000000..685274fcbe173196855de500b9a8cf339132247e --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.cjs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.cjs.js","sources":["../src/BitSet.js","../src/Chunk.js","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js","../src/index-legacy.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + ''\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t\tcharInHiresBoundary = false;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t\toffset: { writable: true, value: options.offset || 0 },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\tif (this.outro) {\n\t\t\tmappings.advance(this.outro);\n\t\t}\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t);\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t);\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tindex = index + this.offset;\n\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t);\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length - this.offset) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tlet previousChunk = chunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\n\t\t\t// Prevent infinite loop (e.g. via empty chunks, where start === end)\n\t\t\tif (chunk === previousChunk) return;\n\n\t\t\tpreviousChunk = chunk;\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\treplacement = replacement(string, index, original);\n\t\t\t}\n\t\t\tif (string !== replacement) {\n\t\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tlet _replacement = replacement;\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\t_replacement = replacement(previous, index, original);\n\t\t\t}\n\t\t\tif (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n","import MagicString from './MagicString.js';\nimport Bundle from './Bundle.js';\nimport SourceMap from './SourceMap.js';\n\nMagicString.Bundle = Bundle;\nMagicString.SourceMap = SourceMap;\nMagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121\n\nexport default MagicString;\n"],"names":["encode"],"mappings":";;;;AAAe,MAAM,MAAM,CAAC;AAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;AAClB,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,YAAY,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;AAC3D,CAAC;;AAED,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AACpC,CAAC;;AAED,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC;AACD;;ACZe,MAAM,KAAK,CAAC;AAC3B,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;AAClC,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK;AACpB,EAAE,IAAI,CAAC,GAAG,GAAG,GAAG;AAChB,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO;;AAEzB,EAAE,IAAI,CAAC,KAAK,GAAG,EAAE;AACjB,EAAE,IAAI,CAAC,KAAK,GAAG,EAAE;;AAEjB,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO;AACxB,EAAE,IAAI,CAAC,SAAS,GAAG,KAAK;AACxB,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK;;AAErB,EAMS;AACT,GAAG,IAAI,CAAC,QA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AW,CAAC,SAAS,GAAG,SAAS;AACjC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.es.d.mts b/tools/ui/node_modules/magic-string/dist/magic-string.es.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..76cc537d1c2ccc67239a09dda1bc3c23654ef85c --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.es.d.mts @@ -0,0 +1,289 @@ +export interface BundleOptions { + intro?: string; + separator?: string; +} + +export interface SourceMapOptions { + /** + * Whether the mapping should be high-resolution. + * Hi-res mappings map every single character, meaning (for example) your devtools will always + * be able to pinpoint the exact location of function calls and so on. + * With lo-res mappings, devtools may only be able to identify the correct + * line - but they're quicker to generate and less bulky. + * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary + * instead of per character, suitable for string semantics that are separated by words. + * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here. + */ + hires?: boolean | 'boundary'; + /** + * The filename where you plan to write the sourcemap. + */ + file?: string; + /** + * The filename of the file containing the original source. + */ + source?: string; + /** + * Whether to include the original content in the map's sourcesContent array. + */ + includeContent?: boolean; +} + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; + +export interface DecodedSourceMap { + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: SourceMapSegment[][]; + x_google_ignoreList?: number[]; +} + +export class SourceMap { + constructor(properties: DecodedSourceMap); + + version: number; + file: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: string; + x_google_ignoreList?: number[]; + debugId?: string; + + /** + * Returns the equivalent of `JSON.stringify(map)` + */ + toString(): string; + /** + * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: + * `generateMap(options?: SourceMapOptions): SourceMap;` + */ + toUrl(): string; +} + +export class Bundle { + constructor(options?: BundleOptions); + /** + * Adds the specified source to the bundle, which can either be a `MagicString` object directly, + * or an options object that holds a magic string `content` property and optionally provides + * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint + * (which defaults to `false`). The `filename` is used when constructing the source map for the + * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint + * is used to populate the `x_google_ignoreList` extension field in the source map, which is a + * mechanism for tools to signal to debuggers that certain sources should be ignored by default + * (depending on user preferences). + */ + addSource( + source: MagicString | { filename?: string; content: MagicString; ignoreList?: boolean }, + ): this; + append(str: string, options?: BundleOptions): this; + clone(): this; + generateMap( + options?: SourceMapOptions, + ): Omit & { sourcesContent: Array }; + generateDecodedMap( + options?: SourceMapOptions, + ): Omit & { sourcesContent: Array }; + getIndentString(): string; + indent(indentStr?: string): this; + indentExclusionRanges: ExclusionRange | Array; + prepend(str: string): this; + toString(): string; + trimLines(): this; + trim(charType?: string): this; + trimStart(charType?: string): this; + trimEnd(charType?: string): this; + isEmpty(): boolean; + length(): number; +} + +export type ExclusionRange = [number, number]; + +export interface MagicStringOptions { + filename?: string; + indentExclusionRanges?: ExclusionRange | Array; + offset?: number; +} + +export interface IndentOptions { + exclude?: ExclusionRange | Array; + indentStart?: boolean; +} + +export interface OverwriteOptions { + storeName?: boolean; + contentOnly?: boolean; +} + +export interface UpdateOptions { + storeName?: boolean; + overwrite?: boolean; +} + +export default class MagicString { + constructor(str: string, options?: MagicStringOptions); + /** + * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. + */ + addSourcemapLocation(char: number): void; + /** + * Appends the specified content to the end of the string. + */ + append(content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *ending* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependLeft(...)`. + */ + appendLeft(index: number, content: string): this; + /** + * Appends the specified content at the index in the original string. + * If a range *starting* with index is subsequently moved, the insert will be moved with it. + * See also `s.prependRight(...)`. + */ + appendRight(index: number, content: string): this; + /** + * Does what you'd expect. + */ + clone(): this; + /** + * Generates a version 3 sourcemap. + */ + generateMap(options?: SourceMapOptions): SourceMap; + /** + * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. + * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. + */ + generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap; + getIndentString(): string; + + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + */ + indent(options?: IndentOptions): this; + /** + * Prefixes each line of the string with prefix. + * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. + * + * The options argument can have an exclude property, which is an array of [start, end] character ranges. + * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. + */ + indent(indentStr?: string, options?: IndentOptions): this; + indentExclusionRanges: ExclusionRange | Array; + + /** + * Moves the characters from `start` and `end` to `index`. + */ + move(start: number, end: number, index: number): this; + /** + * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in + * that range. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + * + * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. + */ + overwrite( + start: number, + end: number, + content: string, + options?: boolean | OverwriteOptions, + ): this; + /** + * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. + * + * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored + * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only + * the content is overwritten, or anything that was appended/prepended to the range as well. + */ + update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this; + /** + * Prepends the string with the specified content. + */ + prepend(content: string): this; + /** + * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index + */ + prependLeft(index: number, content: string): this; + /** + * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` + */ + prependRight(index: number, content: string): this; + /** + * Removes the characters from `start` to `end` (of the original string, **not** the generated string). + * Removing the same content twice, or making removals that partially overlap, will cause an error. + */ + remove(start: number, end: number): this; + /** + * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string). + */ + reset(start: number, end: number): this; + /** + * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. + * Throws error if the indices are for characters that were already removed. + */ + slice(start: number, end: number): string; + /** + * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. + */ + snip(start: number, end: number): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. + */ + trim(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. + */ + trimStart(charType?: string): this; + /** + * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. + */ + trimEnd(charType?: string): this; + /** + * Removes empty lines from the start and end. + */ + trimLines(): this; + /** + * String replacement with RegExp or string. + */ + replace( + regex: RegExp | string, + replacement: string | ((substring: string, ...args: any[]) => string), + ): this; + /** + * Same as `s.replace`, but replace all matched strings instead of just one. + */ + replaceAll( + regex: RegExp | string, + replacement: string | ((substring: string, ...args: any[]) => string), + ): this; + + lastChar(): string; + lastLine(): string; + /** + * Returns true if the resulting source is empty (disregarding white space). + */ + isEmpty(): boolean; + length(): number; + + /** + * Indicates if the string has been changed. + */ + hasChanged(): boolean; + + original: string; + /** + * Returns the generated string. + */ + toString(): string; + + offset: number; +} diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs b/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c7999fc86b67064ca32bb313dc4ce96992258a4c --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs @@ -0,0 +1,1588 @@ +import { encode } from '@jridgewell/sourcemap-codec'; + +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } +} + +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} + +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } +} + +const btoa = /*#__PURE__*/ getBtoa(); + +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} + +function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); +} + +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); +} + +const toString = Object.prototype.toString; + +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} + +function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; +} + +const wordRegex = /\w/; + +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + charInHiresBoundary = false; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} + +const n = '\n'; + +const warned = { + insertLeft: false, + insertRight: false, + storeName: false, +}; + +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + offset: { writable: true, value: options.offset || 0 }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (this.outro) { + mappings.advance(this.outro); + } + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + start = start + this.offset; + end = end + this.offset; + index = index + this.offset; + + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + start = start + this.offset; + end = end + this.offset; + + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length - this.offset) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + let previousChunk = chunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + + // Prevent infinite loop (e.g. via empty chunks, where start === end) + if (chunk === previousChunk) return; + + previousChunk = chunk; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + if (typeof replacement === 'function') { + replacement = replacement(string, index, original); + } + if (string !== replacement) { + this.overwrite(index, index + string.length, replacement); + } + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + let _replacement = replacement; + if (typeof replacement === 'function') { + _replacement = replacement(previous, index, original); + } + if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } +} + +const hasOwnProp = Object.prototype.hasOwnProperty; + +class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } +} + +export { Bundle, SourceMap, MagicString as default }; +//# sourceMappingURL=magic-string.es.mjs.map diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs.map b/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..a60bcc8ae6d8d7f86c36e833d4e01a623ea804fe --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.es.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.es.mjs","sources":["../src/BitSet.js","../src/Chunk.js","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + ''\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t\tcharInHiresBoundary = false;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t\toffset: { writable: true, value: options.offset || 0 },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\tif (this.outro) {\n\t\t\tmappings.advance(this.outro);\n\t\t}\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t);\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t);\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tindex = index + this.offset;\n\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t);\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length - this.offset) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tlet previousChunk = chunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\n\t\t\t// Prevent infinite loop (e.g. via empty chunks, where start === end)\n\t\t\tif (chunk === previousChunk) return;\n\n\t\t\tpreviousChunk = chunk;\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\treplacement = replacement(string, index, original);\n\t\t\t}\n\t\t\tif (string !== replacement) {\n\t\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tlet _replacement = replacement;\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\t_replacement = replacement(previous, index, original);\n\t\t\t}\n\t\t\tif (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n"],"names":[],"mappings":";;AAAe,MAAM,MAAM,CAAC;AAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;AAClB,EAAE,IAAI,CAAC,IAAI,GAAG,GAAG,YAAY,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;AAC3D,CAAC;;AAED,CAAC,GAAG,CAAC,CAAC,EAAE;AACR,EAAE,IAAI,CAAC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MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACtD,EAAE;;AAEF,EAAE,OAAO,IAAI;AACb,CAAC;;AAED,CAAC,OAAO,CAAC,QAAQ,EAAE;AACnB,EAAE,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC;;AAEnD,EAAE,IAAI,MAAM;AACZ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;;AAEjC,EAAE,GAAG;AACL,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;AAC7B,GAAG,IAAI,CAAC,MAAM,EAAE;AAChB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;AAC3C,IAAI;AACJ,GAAG;AACH,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC;;AAEnD,EAAE,OAAO,IAAI;AACb,CAAC;AACD;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.umd.js b/tools/ui/node_modules/magic-string/dist/magic-string.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..0c399cdc22999f768c7baa670c4f18f9f7be3c46 --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.umd.js @@ -0,0 +1,1682 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MagicString = factory()); +})(this, (function () { 'use strict'; + + class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + + has(n) { + return !!(this.bits[n >> 5] & (1 << (n & 31))); + } + } + + class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + + this.intro = ''; + this.outro = ''; + + this.content = content; + this.storeName = false; + this.edited = false; + + { + this.previous = null; + this.next = null; + } + } + + appendLeft(content) { + this.outro += content; + } + + appendRight(content) { + this.intro = this.intro + content; + } + + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + + return chunk; + } + + contains(index) { + return this.start < index && index < this.end; + } + + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + + this.edited = true; + + return this; + } + + prependLeft(content) { + this.outro = content + this.outro; + } + + prependRight(content) { + this.intro = content + this.intro; + } + + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + + split(index) { + const sliceIndex = index - this.start; + + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + + this.original = originalBefore; + + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + + this.end = index; + + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + + return newChunk; + } + + toString() { + return this.intro + this.content + this.outro; + } + + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + const trimmed = this.content.replace(rx, ''); + + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } + } + + // src/vlq.ts + var comma = ",".charCodeAt(0); + var semicolon = ";".charCodeAt(0); + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var intToChar = new Uint8Array(64); + var charToInt = new Uint8Array(128); + for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; + } + function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; + } + + // src/strings.ts + var bufLength = 1024 * 16; + var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } + } : { + decode(buf) { + let out = ""; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } + }; + var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } + }; + function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); + } + + function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return (str) => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return (str) => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); + }; + } + } + + const btoa = /*#__PURE__*/ getBtoa(); + + class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + if (typeof properties.debugId !== 'undefined') { + this.debugId = properties.debugId; + } + } + + toString() { + return JSON.stringify(this); + } + + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } + } + + function guessIndent(code) { + const lines = code.split('\n'); + + const tabbed = lines.filter((line) => /^\t+/.test(line)); + const spaced = lines.filter((line) => /^ {2,}/.test(line)); + + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + + return new Array(min + 1).join(' '); + } + + function getRelativePath(from, to) { + const fromParts = from.split(/[/\\]/); + const toParts = to.split(/[/\\]/); + + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + + return fromParts.concat(toParts).join('/'); + } + + const toString = Object.prototype.toString; + + function isObject(thing) { + return toString.call(thing) === '[object Object]'; + } + + function getLocator(source) { + const originalLines = source.split('\n'); + const lineOffsets = []; + + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = (i + j) >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { line, column }; + }; + } + + const wordRegex = /\w/; + + class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + const contentLengthMinusOne = content.length - 1; + let contentLineEnd = content.indexOf('\n', 0); + let previousContentLineEnd = -1; + // Loop through each line in the content and add a segment, but stop if the last line is empty, + // else code afterwards would fill one line too many + while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\n', contentLineEnd + 1); + } + + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + + this.pending = null; + } + + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + + while (originalCharIndex < chunk.end) { + if (original[originalCharIndex] === '\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + charInHiresBoundary = false; + } else { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + + originalCharIndex += 1; + } + + this.pending = null; + } + + advance(str) { + if (!str) return; + + const lines = str.split('\n'); + + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + + this.generatedCodeColumn += lines[lines.length - 1].length; + } + } + + const n = '\n'; + + const warned = { + insertLeft: false, + insertRight: false, + storeName: false, + }; + + class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + + Object.defineProperties(this, { + original: { writable: true, value: string }, + outro: { writable: true, value: '' }, + intro: { writable: true, value: '' }, + firstChunk: { writable: true, value: chunk }, + lastChunk: { writable: true, value: chunk }, + lastSearchedChunk: { writable: true, value: chunk }, + byStart: { writable: true, value: {} }, + byEnd: { writable: true, value: {} }, + filename: { writable: true, value: options.filename }, + indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, + sourcemapLocations: { writable: true, value: new BitSet() }, + storedNames: { writable: true, value: {} }, + indentStr: { writable: true, value: undefined }, + ignoreList: { writable: true, value: options.ignoreList }, + offset: { writable: true, value: options.offset || 0 }, + }); + + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.outro += content; + return this; + } + + appendLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + + appendRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + + clone() { + const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset }); + + let originalChunk = this.firstChunk; + let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); + + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + + clonedChunk = nextClonedChunk; + } + + originalChunk = nextOriginalChunk; + } + + cloned.lastChunk = clonedChunk; + + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + + cloned.intro = this.intro; + cloned.outro = this.outro; + + return cloned; + } + + generateDecodedMap(options) { + options = options || {}; + + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + + const locate = getLocator(this.original); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (this.outro) { + mappings.advance(this.outro); + } + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: [ + options.source ? getRelativePath(options.file || '', options.source) : options.file || '', + ], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\t' : this.indentStr; + } + + indent(indentStr, options) { + const pattern = /^[^\r\n]/gm; + + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\t'; + } + + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + + if (options.exclude) { + const exclusions = + typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach((exclusion) => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = (match) => { + if (shouldIndentNextCharacter) return `${indentStr}${match}`; + shouldIndentNextCharacter = true; + return match; + }; + + this.intro = this.intro.replace(pattern, replacer); + + let charIndex = 0; + let chunk = this.firstChunk; + + while (chunk) { + const end = chunk.end; + + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; + } + } + } else { + charIndex = chunk.start; + + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + + if (char === '\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + + charIndex += 1; + } + } + + charIndex = chunk.end; + chunk = chunk.next; + } + + this.outro = this.outro.replace(pattern, replacer); + + return this; + } + + insert() { + throw new Error( + 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)', + ); + } + + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn( + 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead', + ); + warned.insertLeft = true; + } + + return this.appendLeft(index, content); + } + + insertRight(index, content) { + if (!warned.insertRight) { + console.warn( + 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead', + ); + warned.insertRight = true; + } + + return this.prependRight(index, content); + } + + move(start, end, index) { + start = start + this.offset; + end = end + this.offset; + index = index + this.offset; + + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + + this._split(start); + this._split(end); + this._split(index); + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + const oldLeft = first.previous; + const oldRight = last.next; + + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + + first.previous = newLeft; + last.next = newRight || null; + + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, { ...options, overwrite: !options.contentOnly }); + } + + update(start, end, content, options) { + start = start + this.offset; + end = end + this.offset; + + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) + throw new Error( + 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead', + ); + + this._split(start); + this._split(end); + + if (options === true) { + if (!warned.storeName) { + console.warn( + 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string', + ); + warned.storeName = true; + } + + options = { storeName: true }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true, + }); + } + + const first = this.byStart[start]; + const last = this.byEnd[end]; + + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + + this.intro = content + this.intro; + return this; + } + + prependLeft(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byEnd[index]; + + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + + prependRight(index, content) { + index = index + this.offset; + + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + + this._split(index); + + const chunk = this.byStart[index]; + + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + + remove(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + reset(start, end) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + if (start === end) return this; + + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + + this._split(start); + this._split(end); + + let chunk = this.byStart[start]; + + while (chunk) { + chunk.reset(); + + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while ((chunk = chunk.previous)); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while ((chunk = chunk.previous)); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + + slice(start = 0, end = this.original.length - this.offset) { + start = start + this.offset; + end = end + this.offset; + + if (this.original.length !== 0) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + } + + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + + chunk = chunk.next; + } + + if (chunk && chunk.edited && chunk.start !== start) + throw new Error(`Cannot use replaced character ${start} as slice start anchor.`); + + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) + throw new Error(`Cannot use replaced character ${end} as slice end anchor.`); + + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + + result += chunk.content.slice(sliceStart, sliceEnd); + + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + + if (containsEnd) { + break; + } + + chunk = chunk.next; + } + + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + + return clone; + } + + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + + let chunk = this.lastSearchedChunk; + let previousChunk = chunk; + const searchForward = index > chunk.end; + + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + + // Prevent infinite loop (e.g. via empty chunks, where start === end) + if (chunk === previousChunk) return; + + previousChunk = chunk; + } + } + + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error( + `Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`, + ); + } + + const newChunk = chunk.split(index); + + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + + if (chunk === this.lastChunk) this.lastChunk = newChunk; + + this.lastSearchedChunk = chunk; + return true; + } + + toString() { + let str = this.intro; + + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + + return str + this.outro; + } + + isEmpty() { + let chunk = this.firstChunk; + do { + if ( + (chunk.intro.length && chunk.intro.trim()) || + (chunk.content.length && chunk.content.trim()) || + (chunk.outro.length && chunk.outro.trim()) + ) + return false; + } while ((chunk = chunk.next)); + return true; + } + + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while ((chunk = chunk.next)); + return length; + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + + let chunk = this.lastChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + + return false; + } + + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + + let chunk = this.firstChunk; + + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + + return false; + } + + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + + hasChanged() { + return this.original !== this.toString(); + } + + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return `$${i}`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while ((match = re.exec(str))) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach((match) => { + if (match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) { + const replacement = getReplacement(match, this.original); + if (replacement !== match[0]) { + this.overwrite(match.index, match.index + match[0].length, replacement); + } + } + } + return this; + } + + _replaceString(string, replacement) { + const { original } = this; + const index = original.indexOf(string); + + if (index !== -1) { + if (typeof replacement === 'function') { + replacement = replacement(string, index, original); + } + if (string !== replacement) { + this.overwrite(index, index + string.length, replacement); + } + } + + return this; + } + + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + + return this._replaceRegexp(searchValue, replacement); + } + + _replaceAllString(string, replacement) { + const { original } = this; + const stringLength = string.length; + for ( + let index = original.indexOf(string); + index !== -1; + index = original.indexOf(string, index + stringLength) + ) { + const previous = original.slice(index, index + stringLength); + let _replacement = replacement; + if (typeof replacement === 'function') { + _replacement = replacement(previous, index, original); + } + if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement); + } + + return this; + } + + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + + if (!searchValue.global) { + throw new TypeError( + 'MagicString.prototype.replaceAll called with a non-global RegExp argument', + ); + } + + return this._replaceRegexp(searchValue, replacement); + } + } + + const hasOwnProp = Object.prototype.hasOwnProperty; + + class Bundle { + constructor(options = {}) { + this.intro = options.intro || ''; + this.separator = options.separator !== undefined ? options.separator : '\n'; + this.sources = []; + this.uniqueSources = []; + this.uniqueSourceIndexByFilename = {}; + } + + addSource(source) { + if (source instanceof MagicString) { + return this.addSource({ + content: source, + filename: source.filename, + separator: this.separator, + }); + } + + if (!isObject(source) || !source.content) { + throw new Error( + 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', + ); + } + + ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { + if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; + }); + + if (source.separator === undefined) { + // TODO there's a bunch of this sort of thing, needs cleaning up + source.separator = this.separator; + } + + if (source.filename) { + if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { + this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; + this.uniqueSources.push({ filename: source.filename, content: source.content.original }); + } else { + const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; + if (source.content.original !== uniqueSource.content) { + throw new Error(`Illegal source: same filename (${source.filename}), different contents`); + } + } + } + + this.sources.push(source); + return this; + } + + append(str, options) { + this.addSource({ + content: new MagicString(str), + separator: (options && options.separator) || '', + }); + + return this; + } + + clone() { + const bundle = new Bundle({ + intro: this.intro, + separator: this.separator, + }); + + this.sources.forEach((source) => { + bundle.addSource({ + filename: source.filename, + content: source.content.clone(), + separator: source.separator, + }); + }); + + return bundle; + } + + generateDecodedMap(options = {}) { + const names = []; + let x_google_ignoreList = undefined; + this.sources.forEach((source) => { + Object.keys(source.content.storedNames).forEach((name) => { + if (!~names.indexOf(name)) names.push(name); + }); + }); + + const mappings = new Mappings(options.hires); + + if (this.intro) { + mappings.advance(this.intro); + } + + this.sources.forEach((source, i) => { + if (i > 0) { + mappings.advance(this.separator); + } + + const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; + const magicString = source.content; + const locate = getLocator(magicString.original); + + if (magicString.intro) { + mappings.advance(magicString.intro); + } + + magicString.firstChunk.eachNext((chunk) => { + const loc = locate(chunk.start); + + if (chunk.intro.length) mappings.advance(chunk.intro); + + if (source.filename) { + if (chunk.edited) { + mappings.addEdit( + sourceIndex, + chunk.content, + loc, + chunk.storeName ? names.indexOf(chunk.original) : -1, + ); + } else { + mappings.addUneditedChunk( + sourceIndex, + chunk, + magicString.original, + loc, + magicString.sourcemapLocations, + ); + } + } else { + mappings.advance(chunk.content); + } + + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + + if (magicString.outro) { + mappings.advance(magicString.outro); + } + + if (source.ignoreList && sourceIndex !== -1) { + if (x_google_ignoreList === undefined) { + x_google_ignoreList = []; + } + x_google_ignoreList.push(sourceIndex); + } + }); + + return { + file: options.file ? options.file.split(/[/\\]/).pop() : undefined, + sources: this.uniqueSources.map((source) => { + return options.file ? getRelativePath(options.file, source.filename) : source.filename; + }), + sourcesContent: this.uniqueSources.map((source) => { + return options.includeContent ? source.content : null; + }), + names, + mappings: mappings.raw, + x_google_ignoreList, + }; + } + + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + + getIndentString() { + const indentStringCounts = {}; + + this.sources.forEach((source) => { + const indentStr = source.content._getRawIndentString(); + + if (indentStr === null) return; + + if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; + indentStringCounts[indentStr] += 1; + }); + + return ( + Object.keys(indentStringCounts).sort((a, b) => { + return indentStringCounts[a] - indentStringCounts[b]; + })[0] || '\t' + ); + } + + indent(indentStr) { + if (!arguments.length) { + indentStr = this.getIndentString(); + } + + if (indentStr === '') return this; // noop + + let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; + + this.sources.forEach((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); + + source.content.indent(indentStr, { + exclude: source.indentExclusionRanges, + indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) + }); + + trailingNewline = source.content.lastChar() === '\n'; + }); + + if (this.intro) { + this.intro = + indentStr + + this.intro.replace(/^[^\n]/gm, (match, index) => { + return index > 0 ? indentStr + match : match; + }); + } + + return this; + } + + prepend(str) { + this.intro = str + this.intro; + return this; + } + + toString() { + const body = this.sources + .map((source, i) => { + const separator = source.separator !== undefined ? source.separator : this.separator; + const str = (i > 0 ? separator : '') + source.content.toString(); + + return str; + }) + .join(''); + + return this.intro + body; + } + + isEmpty() { + if (this.intro.length && this.intro.trim()) return false; + if (this.sources.some((source) => !source.content.isEmpty())) return false; + return true; + } + + length() { + return this.sources.reduce( + (length, source) => length + source.content.length(), + this.intro.length, + ); + } + + trimLines() { + return this.trim('[\\r\\n]'); + } + + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + + trimStart(charType) { + const rx = new RegExp('^' + (charType || '\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + + if (!this.intro) { + let source; + let i = 0; + + do { + source = this.sources[i++]; + if (!source) { + break; + } + } while (!source.content.trimStartAborted(charType)); + } + + return this; + } + + trimEnd(charType) { + const rx = new RegExp((charType || '\\s') + '+$'); + + let source; + let i = this.sources.length - 1; + + do { + source = this.sources[i--]; + if (!source) { + this.intro = this.intro.replace(rx, ''); + break; + } + } while (!source.content.trimEndAborted(charType)); + + return this; + } + } + + MagicString.Bundle = Bundle; + MagicString.SourceMap = SourceMap; + MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 + + return MagicString; + +})); +//# sourceMappingURL=magic-string.umd.js.map diff --git a/tools/ui/node_modules/magic-string/dist/magic-string.umd.js.map b/tools/ui/node_modules/magic-string/dist/magic-string.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..43addb8cc38f33dee27f172eda886e39018a4c84 --- /dev/null +++ b/tools/ui/node_modules/magic-string/dist/magic-string.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"magic-string.umd.js","sources":["../src/BitSet.js","../src/Chunk.js","../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../src/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/utils/getLocator.js","../src/utils/Mappings.js","../src/MagicString.js","../src/Bundle.js","../src/index-legacy.js"],"sourcesContent":["export default class BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n","export default class Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\tif (DEBUG) {\n\t\t\t// we make these non-enumerable, for sanity while debugging\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tprevious: { writable: true, value: null },\n\t\t\t\tnext: { writable: true, value: null },\n\t\t\t});\n\t\t} else {\n\t\t\tthis.previous = null;\n\t\t\tthis.next = null;\n\t\t}\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\treset() {\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\t\tif (this.edited) {\n\t\t\tthis.content = this.original;\n\t\t\tthis.storeName = false;\n\t\t\tthis.edited = false;\n\t\t}\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// after split we should save the edit content record into the correct chunk\n\t\t\t// to make sure sourcemap correct\n\t\t\t// For example:\n\t\t\t// ' test'.trim()\n\t\t\t// split -> ' ' + 'test'\n\t\t\t// ✔️ edit -> '' + 'test'\n\t\t\t// ✖️ edit -> 'test' + ''\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tthis.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tconst newChunk = this.split(this.end - trimmed.length);\n\t\t\t\tif (this.edited) {\n\t\t\t\t\t// save the change, if it has been edited\n\t\t\t\t\tnewChunk.edit(trimmed, this.storeName, true);\n\t\t\t\t}\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n","// src/vlq.ts\nvar comma = \",\".charCodeAt(0);\nvar semicolon = \";\".charCodeAt(0);\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar intToChar = new Uint8Array(64);\nvar charToInt = new Uint8Array(128);\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\nfunction decodeInteger(reader, relative) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = reader.next();\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -2147483648 | -value;\n }\n return relative + value;\n}\nfunction encodeInteger(builder, num, relative) {\n let delta = num - relative;\n delta = delta < 0 ? -delta << 1 | 1 : delta << 1;\n do {\n let clamped = delta & 31;\n delta >>>= 5;\n if (delta > 0) clamped |= 32;\n builder.write(intToChar[clamped]);\n } while (delta > 0);\n return num;\n}\nfunction hasMoreVlq(reader, max) {\n if (reader.pos >= max) return false;\n return reader.peek() !== comma;\n}\n\n// src/strings.ts\nvar bufLength = 1024 * 16;\nvar td = typeof TextDecoder !== \"undefined\" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== \"undefined\" ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n }\n} : {\n decode(buf) {\n let out = \"\";\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n }\n};\nvar StringWriter = class {\n constructor() {\n this.pos = 0;\n this.out = \"\";\n this.buffer = new Uint8Array(bufLength);\n }\n write(v) {\n const { buffer } = this;\n buffer[this.pos++] = v;\n if (this.pos === bufLength) {\n this.out += td.decode(buffer);\n this.pos = 0;\n }\n }\n flush() {\n const { buffer, out, pos } = this;\n return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;\n }\n};\nvar StringReader = class {\n constructor(buffer) {\n this.pos = 0;\n this.buffer = buffer;\n }\n next() {\n return this.buffer.charCodeAt(this.pos++);\n }\n peek() {\n return this.buffer.charCodeAt(this.pos);\n }\n indexOf(char) {\n const { buffer, pos } = this;\n const idx = buffer.indexOf(char, pos);\n return idx === -1 ? buffer.length : idx;\n }\n};\n\n// src/scopes.ts\nvar EMPTY = [];\nfunction decodeOriginalScopes(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const scopes = [];\n const stack = [];\n let line = 0;\n for (; reader.pos < length; reader.pos++) {\n line = decodeInteger(reader, line);\n const column = decodeInteger(reader, 0);\n if (!hasMoreVlq(reader, length)) {\n const last = stack.pop();\n last[2] = line;\n last[3] = column;\n continue;\n }\n const kind = decodeInteger(reader, 0);\n const fields = decodeInteger(reader, 0);\n const hasName = fields & 1;\n const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];\n let vars = EMPTY;\n if (hasMoreVlq(reader, length)) {\n vars = [];\n do {\n const varsIndex = decodeInteger(reader, 0);\n vars.push(varsIndex);\n } while (hasMoreVlq(reader, length));\n }\n scope.vars = vars;\n scopes.push(scope);\n stack.push(scope);\n }\n return scopes;\n}\nfunction encodeOriginalScopes(scopes) {\n const writer = new StringWriter();\n for (let i = 0; i < scopes.length; ) {\n i = _encodeOriginalScopes(scopes, i, writer, [0]);\n }\n return writer.flush();\n}\nfunction _encodeOriginalScopes(scopes, index, writer, state) {\n const scope = scopes[index];\n const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;\n if (index > 0) writer.write(comma);\n state[0] = encodeInteger(writer, startLine, state[0]);\n encodeInteger(writer, startColumn, 0);\n encodeInteger(writer, kind, 0);\n const fields = scope.length === 6 ? 1 : 0;\n encodeInteger(writer, fields, 0);\n if (scope.length === 6) encodeInteger(writer, scope[5], 0);\n for (const v of vars) {\n encodeInteger(writer, v, 0);\n }\n for (index++; index < scopes.length; ) {\n const next = scopes[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeOriginalScopes(scopes, index, writer, state);\n }\n writer.write(comma);\n state[0] = encodeInteger(writer, endLine, state[0]);\n encodeInteger(writer, endColumn, 0);\n return index;\n}\nfunction decodeGeneratedRanges(input) {\n const { length } = input;\n const reader = new StringReader(input);\n const ranges = [];\n const stack = [];\n let genLine = 0;\n let definitionSourcesIndex = 0;\n let definitionScopeIndex = 0;\n let callsiteSourcesIndex = 0;\n let callsiteLine = 0;\n let callsiteColumn = 0;\n let bindingLine = 0;\n let bindingColumn = 0;\n do {\n const semi = reader.indexOf(\";\");\n let genColumn = 0;\n for (; reader.pos < semi; reader.pos++) {\n genColumn = decodeInteger(reader, genColumn);\n if (!hasMoreVlq(reader, semi)) {\n const last = stack.pop();\n last[2] = genLine;\n last[3] = genColumn;\n continue;\n }\n const fields = decodeInteger(reader, 0);\n const hasDefinition = fields & 1;\n const hasCallsite = fields & 2;\n const hasScope = fields & 4;\n let callsite = null;\n let bindings = EMPTY;\n let range;\n if (hasDefinition) {\n const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);\n definitionScopeIndex = decodeInteger(\n reader,\n definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0\n );\n definitionSourcesIndex = defSourcesIndex;\n range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];\n } else {\n range = [genLine, genColumn, 0, 0];\n }\n range.isScope = !!hasScope;\n if (hasCallsite) {\n const prevCsi = callsiteSourcesIndex;\n const prevLine = callsiteLine;\n callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);\n const sameSource = prevCsi === callsiteSourcesIndex;\n callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);\n callsiteColumn = decodeInteger(\n reader,\n sameSource && prevLine === callsiteLine ? callsiteColumn : 0\n );\n callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];\n }\n range.callsite = callsite;\n if (hasMoreVlq(reader, semi)) {\n bindings = [];\n do {\n bindingLine = genLine;\n bindingColumn = genColumn;\n const expressionsCount = decodeInteger(reader, 0);\n let expressionRanges;\n if (expressionsCount < -1) {\n expressionRanges = [[decodeInteger(reader, 0)]];\n for (let i = -1; i > expressionsCount; i--) {\n const prevBl = bindingLine;\n bindingLine = decodeInteger(reader, bindingLine);\n bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);\n const expression = decodeInteger(reader, 0);\n expressionRanges.push([expression, bindingLine, bindingColumn]);\n }\n } else {\n expressionRanges = [[expressionsCount]];\n }\n bindings.push(expressionRanges);\n } while (hasMoreVlq(reader, semi));\n }\n range.bindings = bindings;\n ranges.push(range);\n stack.push(range);\n }\n genLine++;\n reader.pos = semi + 1;\n } while (reader.pos < length);\n return ranges;\n}\nfunction encodeGeneratedRanges(ranges) {\n if (ranges.length === 0) return \"\";\n const writer = new StringWriter();\n for (let i = 0; i < ranges.length; ) {\n i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);\n }\n return writer.flush();\n}\nfunction _encodeGeneratedRanges(ranges, index, writer, state) {\n const range = ranges[index];\n const {\n 0: startLine,\n 1: startColumn,\n 2: endLine,\n 3: endColumn,\n isScope,\n callsite,\n bindings\n } = range;\n if (state[0] < startLine) {\n catchupLine(writer, state[0], startLine);\n state[0] = startLine;\n state[1] = 0;\n } else if (index > 0) {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, range[1], state[1]);\n const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);\n encodeInteger(writer, fields, 0);\n if (range.length === 6) {\n const { 4: sourcesIndex, 5: scopesIndex } = range;\n if (sourcesIndex !== state[2]) {\n state[3] = 0;\n }\n state[2] = encodeInteger(writer, sourcesIndex, state[2]);\n state[3] = encodeInteger(writer, scopesIndex, state[3]);\n }\n if (callsite) {\n const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;\n if (sourcesIndex !== state[4]) {\n state[5] = 0;\n state[6] = 0;\n } else if (callLine !== state[5]) {\n state[6] = 0;\n }\n state[4] = encodeInteger(writer, sourcesIndex, state[4]);\n state[5] = encodeInteger(writer, callLine, state[5]);\n state[6] = encodeInteger(writer, callColumn, state[6]);\n }\n if (bindings) {\n for (const binding of bindings) {\n if (binding.length > 1) encodeInteger(writer, -binding.length, 0);\n const expression = binding[0][0];\n encodeInteger(writer, expression, 0);\n let bindingStartLine = startLine;\n let bindingStartColumn = startColumn;\n for (let i = 1; i < binding.length; i++) {\n const expRange = binding[i];\n bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);\n bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);\n encodeInteger(writer, expRange[0], 0);\n }\n }\n }\n for (index++; index < ranges.length; ) {\n const next = ranges[index];\n const { 0: l, 1: c } = next;\n if (l > endLine || l === endLine && c >= endColumn) {\n break;\n }\n index = _encodeGeneratedRanges(ranges, index, writer, state);\n }\n if (state[0] < endLine) {\n catchupLine(writer, state[0], endLine);\n state[0] = endLine;\n state[1] = 0;\n } else {\n writer.write(comma);\n }\n state[1] = encodeInteger(writer, endColumn, state[1]);\n return index;\n}\nfunction catchupLine(writer, lastLine, line) {\n do {\n writer.write(semicolon);\n } while (++lastLine < line);\n}\n\n// src/sourcemap-codec.ts\nfunction decode(mappings) {\n const { length } = mappings;\n const reader = new StringReader(mappings);\n const decoded = [];\n let genColumn = 0;\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n do {\n const semi = reader.indexOf(\";\");\n const line = [];\n let sorted = true;\n let lastCol = 0;\n genColumn = 0;\n while (reader.pos < semi) {\n let seg;\n genColumn = decodeInteger(reader, genColumn);\n if (genColumn < lastCol) sorted = false;\n lastCol = genColumn;\n if (hasMoreVlq(reader, semi)) {\n sourcesIndex = decodeInteger(reader, sourcesIndex);\n sourceLine = decodeInteger(reader, sourceLine);\n sourceColumn = decodeInteger(reader, sourceColumn);\n if (hasMoreVlq(reader, semi)) {\n namesIndex = decodeInteger(reader, namesIndex);\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];\n } else {\n seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];\n }\n } else {\n seg = [genColumn];\n }\n line.push(seg);\n reader.pos++;\n }\n if (!sorted) sort(line);\n decoded.push(line);\n reader.pos = semi + 1;\n } while (reader.pos <= length);\n return decoded;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const writer = new StringWriter();\n let sourcesIndex = 0;\n let sourceLine = 0;\n let sourceColumn = 0;\n let namesIndex = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) writer.write(semicolon);\n if (line.length === 0) continue;\n let genColumn = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n if (j > 0) writer.write(comma);\n genColumn = encodeInteger(writer, segment[0], genColumn);\n if (segment.length === 1) continue;\n sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);\n sourceLine = encodeInteger(writer, segment[2], sourceLine);\n sourceColumn = encodeInteger(writer, segment[3], sourceColumn);\n if (segment.length === 4) continue;\n namesIndex = encodeInteger(writer, segment[4], namesIndex);\n }\n }\n return writer.flush();\n}\nexport {\n decode,\n decodeGeneratedRanges,\n decodeOriginalScopes,\n encode,\n encodeGeneratedRanges,\n encodeOriginalScopes\n};\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","import { encode } from '@jridgewell/sourcemap-codec';\n\nfunction getBtoa() {\n\tif (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {\n\t\treturn (str) => globalThis.btoa(unescape(encodeURIComponent(str)));\n\t} else if (typeof Buffer === 'function') {\n\t\treturn (str) => Buffer.from(str, 'utf-8').toString('base64');\n\t} else {\n\t\treturn () => {\n\t\t\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n\t\t};\n\t}\n}\n\nconst btoa = /*#__PURE__*/ getBtoa();\n\nexport default class SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t\tif (typeof properties.x_google_ignoreList !== 'undefined') {\n\t\t\tthis.x_google_ignoreList = properties.x_google_ignoreList;\n\t\t}\n\t\tif (typeof properties.debugId !== 'undefined') {\n\t\t\tthis.debugId = properties.debugId;\n\t\t}\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n","export default function guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n","export default function getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n","const toString = Object.prototype.toString;\n\nexport default function isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n","export default function getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n","const wordRegex = /\\w/;\n\nexport default class Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst contentLengthMinusOne = content.length - 1;\n\t\t\tlet contentLineEnd = content.indexOf('\\n', 0);\n\t\t\tlet previousContentLineEnd = -1;\n\t\t\t// Loop through each line in the content and add a segment, but stop if the last line is empty,\n\t\t\t// else code afterwards would fill one line too many\n\t\t\twhile (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {\n\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\t\tif (nameIndex >= 0) {\n\t\t\t\t\tsegment.push(nameIndex);\n\t\t\t\t}\n\t\t\t\tthis.rawSegments.push(segment);\n\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\n\t\t\t\tpreviousContentLineEnd = contentLineEnd;\n\t\t\t\tcontentLineEnd = content.indexOf('\\n', contentLineEnd + 1);\n\t\t\t}\n\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\n\t\t\tthis.advance(content.slice(previousContentLineEnd + 1));\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t\tthis.advance(content);\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\t\t// when iterating each char, check if it's in a word boundary\n\t\tlet charInHiresBoundary = false;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t\tcharInHiresBoundary = false;\n\t\t\t} else {\n\t\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\n\t\t\t\t\tif (this.hires === 'boundary') {\n\t\t\t\t\t\t// in hires \"boundary\", group segments per word boundary than per char\n\t\t\t\t\t\tif (wordRegex.test(original[originalCharIndex])) {\n\t\t\t\t\t\t\t// for first char in the boundary found, start the boundary by pushing a segment\n\t\t\t\t\t\t\tif (!charInHiresBoundary) {\n\t\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\t\tcharInHiresBoundary = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// for non-word char, end the boundary by pushing a segment\n\t\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t\t\tcharInHiresBoundary = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.rawSegments.push(segment);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n","import BitSet from './BitSet.js';\nimport Chunk from './Chunk.js';\nimport SourceMap from './SourceMap.js';\nimport guessIndent from './utils/guessIndent.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\nimport Stats from './utils/Stats.js';\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nexport default class MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: undefined },\n\t\t\tignoreList: { writable: true, value: options.ignoreList },\n\t\t\toffset: { writable: true, value: options.offset || 0 },\n\t\t});\n\n\t\tif (DEBUG) {\n\t\t\tObject.defineProperty(this, 'stats', { value: new Stats() });\n\t\t}\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendLeft');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendLeft');\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('appendRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('appendRight');\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\tif (this.outro) {\n\t\t\tmappings.advance(this.outro);\n\t\t}\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: [\n\t\t\t\toptions.source ? getRelativePath(options.file || '', options.source) : options.file || '',\n\t\t\t],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : undefined,\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\t_ensureindentStr() {\n\t\tif (this.indentStr === undefined) {\n\t\t\tthis.indentStr = guessIndent(this.original);\n\t\t}\n\t}\n\n\t_getRawIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr;\n\t}\n\n\tgetIndentString() {\n\t\tthis._ensureindentStr();\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tif (indentStr === undefined) {\n\t\t\tthis._ensureindentStr();\n\t\t\tindentStr = this.indentStr || '\\t';\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',\n\t\t\t);\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',\n\t\t\t);\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\t\tindex = index + this.offset;\n\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tif (DEBUG) this.stats.time('move');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\n\t\tif (DEBUG) this.stats.timeEnd('move');\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\toptions = options || {};\n\t\treturn this.update(start, end, content, { ...options, overwrite: !options.contentOnly });\n\t}\n\n\tupdate(start, end, content, options) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',\n\t\t\t);\n\n\t\tif (DEBUG) this.stats.time('overwrite');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',\n\t\t\t\t);\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst overwrite = options !== undefined ? options.overwrite : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, !overwrite);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('overwrite');\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tindex = index + this.offset;\n\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tif (DEBUG) this.stats.time('insertRight');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('insertRight');\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('remove');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('remove');\n\t\treturn this;\n\t}\n\n\treset(start, end) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tif (DEBUG) this.stats.time('reset');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.reset();\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\n\t\tif (DEBUG) this.stats.timeEnd('reset');\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length - this.offset) {\n\t\tstart = start + this.offset;\n\t\tend = end + this.offset;\n\n\t\tif (this.original.length !== 0) {\n\t\t\twhile (start < 0) start += this.original.length;\n\t\t\twhile (end < 0) end += this.original.length;\n\t\t}\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tif (DEBUG) this.stats.time('_split');\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tlet previousChunk = chunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\n\t\t\t// Prevent infinite loop (e.g. via empty chunks, where start === end)\n\t\t\tif (chunk === previousChunk) return;\n\n\t\t\tpreviousChunk = chunk;\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`,\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\tif (DEBUG) this.stats.timeEnd('_split');\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\t_replaceRegexp(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null) {\n\t\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null) {\n\t\t\t\tconst replacement = getReplacement(match, this.original);\n\t\t\t\tif (replacement !== match[0]) {\n\t\t\t\t\tthis.overwrite(match.index, match.index + match[0].length, replacement);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t_replaceString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst index = original.indexOf(string);\n\n\t\tif (index !== -1) {\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\treplacement = replacement(string, index, original);\n\t\t\t}\n\t\t\tif (string !== replacement) {\n\t\t\t\tthis.overwrite(index, index + string.length, replacement);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceString(searchValue, replacement);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n\n\t_replaceAllString(string, replacement) {\n\t\tconst { original } = this;\n\t\tconst stringLength = string.length;\n\t\tfor (\n\t\t\tlet index = original.indexOf(string);\n\t\t\tindex !== -1;\n\t\t\tindex = original.indexOf(string, index + stringLength)\n\t\t) {\n\t\t\tconst previous = original.slice(index, index + stringLength);\n\t\t\tlet _replacement = replacement;\n\t\t\tif (typeof replacement === 'function') {\n\t\t\t\t_replacement = replacement(previous, index, original);\n\t\t\t}\n\t\t\tif (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\treplaceAll(searchValue, replacement) {\n\t\tif (typeof searchValue === 'string') {\n\t\t\treturn this._replaceAllString(searchValue, replacement);\n\t\t}\n\n\t\tif (!searchValue.global) {\n\t\t\tthrow new TypeError(\n\t\t\t\t'MagicString.prototype.replaceAll called with a non-global RegExp argument',\n\t\t\t);\n\t\t}\n\n\t\treturn this._replaceRegexp(searchValue, replacement);\n\t}\n}\n","import MagicString from './MagicString.js';\nimport SourceMap from './SourceMap.js';\nimport getRelativePath from './utils/getRelativePath.js';\nimport isObject from './utils/isObject.js';\nimport getLocator from './utils/getLocator.js';\nimport Mappings from './utils/Mappings.js';\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nexport default class Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`',\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tlet x_google_ignoreList = undefined;\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\n\t\t\tif (source.ignoreList && sourceIndex !== -1) {\n\t\t\t\tif (x_google_ignoreList === undefined) {\n\t\t\t\t\tx_google_ignoreList = [];\n\t\t\t\t}\n\t\t\t\tx_google_ignoreList.push(sourceIndex);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : undefined,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t\tx_google_ignoreList,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content._getRawIndentString();\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length,\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n","import MagicString from './MagicString.js';\nimport Bundle from './Bundle.js';\nimport SourceMap from './SourceMap.js';\n\nMagicString.Bundle = Bundle;\nMagicString.SourceMap = SourceMap;\nMagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121\n\nexport default MagicString;\n"],"names":[],"mappings":";;;;;;CAAe,MAAM,MAAM,CAAC;CAC5B,CAAC,WAAW,CAAC,GAAG,EAAE;CA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CAAC,SAAS,GAAG,SAAS;CACjC,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC;;;;;;;;","x_google_ignoreList":[2]} \ No newline at end of file diff --git a/tools/ui/node_modules/magic-string/package.json b/tools/ui/node_modules/magic-string/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5ba3ac61182878be0656b71eb03b106726ba76a9 --- /dev/null +++ b/tools/ui/node_modules/magic-string/package.json @@ -0,0 +1,67 @@ +{ + "name": "magic-string", + "version": "0.30.21", + "type": "commonjs", + "description": "Modify strings, generate sourcemaps", + "keywords": [ + "string", + "string manipulation", + "sourcemap", + "templating", + "transpilation" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Rich-Harris/magic-string.git" + }, + "license": "MIT", + "author": "Rich Harris", + "main": "./dist/magic-string.cjs.js", + "module": "./dist/magic-string.es.mjs", + "sideEffects": false, + "jsnext:main": "./dist/magic-string.es.mjs", + "types": "./dist/magic-string.cjs.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./dist/magic-string.es.mjs", + "require": "./dist/magic-string.cjs.js" + } + }, + "files": [ + "dist/*", + "index.d.ts", + "README.md" + ], + "devDependencies": { + "@eslint/js": "^9.38.0", + "@rollup/plugin-node-resolve": "^16.0.3", + "@rollup/plugin-replace": "^6.0.2", + "benchmark": "^2.1.4", + "bumpp": "^10.3.1", + "conventional-changelog-cli": "^5.0.0", + "eslint": "^9.38.0", + "prettier": "^3.6.2", + "publint": "^0.3.15", + "rollup": "^4.52.5", + "source-map-js": "^1.2.1", + "source-map-support": "^0.5.21", + "vitest": "^4.0.2" + }, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + }, + "scripts": { + "build": "rollup -c", + "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "format": "prettier --single-quote --print-width 100 --use-tabs --write .", + "lint": "eslint src test && publint", + "lint:fix": "eslint src test --fix", + "release": "bumpp -x \"pnpm run changelog\" --all", + "pretest": "pnpm run build", + "test": "vitest run", + "test:dev": "vitest", + "bench": "pnpm run build && node benchmark/index.mjs", + "watch": "rollup -cw" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/magicast/LICENSE b/tools/ui/node_modules/magicast/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aa4f7e2653f71f0ab00c212ab8d9578c1cf97a9e --- /dev/null +++ b/tools/ui/node_modules/magicast/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pooya Parsa and Anthony Fu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/magicast/README.md b/tools/ui/node_modules/magicast/README.md new file mode 100644 index 0000000000000000000000000000000000000000..25026196198ab76984c350ca8809f6b0f2fd7fd8 --- /dev/null +++ b/tools/ui/node_modules/magicast/README.md @@ -0,0 +1,210 @@ +# 🧀 Magicast + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![bundle][bundle-src]][bundle-href] +[![Codecov][codecov-src]][codecov-href] +[![License][license-src]][license-href] +[![JSDocs][jsdocs-src]][jsdocs-href] + +Programmatically modify JavaScript and TypeScript source codes with a simplified, elegant and familiar syntax. Built on top of the [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) parsed by [recast](https://github.com/benjamn/recast) and [babel](https://babeljs.io/). + +❯ 🧙🏼 **Magical** modify a JS/TS file and write back magically just like JSON!
+❯ 🔀 **Exports/Import** manipulate module's imports and exports at ease
+❯ 💼 **Function Arguments** easily manipulate arguments passed to a function call, like `defineConfig()`
+❯ 🎨 **Smart Formatting** preseves the formatting style (quotes, tabs, etc.) from the original code
+❯ 🧑‍💻 **Readable** get rid of the complexity of AST manipulation and make your code super readable
+ +## Install + +Install npm package: + +```sh +yarn add --dev magicast + +npm install -D magicast + +pnpm add -D magicast +``` + +Import utilities: + +```js +import { parseModule, generateCode, builders, createNode } from "magicast"; +``` + +## Examples + +**Example:** Modify a file: + +`config.js`: + +```js +export default { + foo: ["a"], +}; +``` + +Code to modify and append `b` to `foo` prop of defaultExport: + +```js +import { loadFile, writeFile } from "magicast"; + +const mod = await loadFile("config.js"); + +mod.exports.default.foo.push("b"); + +await writeFile(mod, "config.js"); +``` + +Updated `config.js`: + +```js +export default { + foo: ["a", "b"], +}; +``` + +**Example:** Directly use AST utils: + +```js +import { parseModule, generateCode } from "magicast"; + +// Parse to AST +const mod = parseModule(`export default { }`); + +// Ensure foo is an array +mod.exports.default.foo ||= []; +// Add a new array member +mod.exports.default.foo.push("b"); +mod.exports.default.foo.unshift("a"); + +// Generate code +const { code, map } = generateCode(mod); +``` + +Generated code: + +```js +export default { + foo: ["a", "b"], +}; +``` + +**Example:** Get the AST directly: + +```js +import { parseModule, generateCode } from "magicast"; + +const mod = parseModule(`export default { }`); + +const ast = mod.exports.default.$ast; +// do something with ast +``` + +**Example:** Function arguments: + +```js +import { parseModule, generateCode } from "magicast"; + +const mod = parseModule(`export default defineConfig({ foo: 'bar' })`); + +// Support for both bare object export and `defineConfig` wrapper +const options = + mod.exports.default.$type === "function-call" + ? mod.exports.default.$args[0] + : mod.exports.default; + +console.log(options.foo); // bar +``` + +**Example:** Create a function call: + +```js +import { parseModule, generateCode, builders } from "magicast"; + +const mod = parseModule(`export default {}`); + +const options = (mod.exports.default.list = builders.functionCall( + "create", + [1, 2, 3], +)); + +console.log(mod.generateCode()); // export default { list: create([1, 2, 3]) } +``` + +## Notes + +As JavaScript is a very dynamic language, you should be aware that Magicast's convention **CAN NOT cover all possible cases**. Magicast serves as a simple and maintainable interface to update static-ish JavaScript code. When interacting with Magicast node, be aware that every option might have chance to throw an error depending on the input code. We recommend to always wrap the code in a `try/catch` block (even better to do some defensive coding), for example: + +```ts +import { loadFile, writeFile } from "magicast"; + +function updateConfig() { + try { + const mod = await loadFile("config.js"); + + mod.exports.default.foo.push("b"); + + await writeFile(mod); + } catch { + console.error("Unable to update config.js"); + console.error( + "Please update it manually with the following instructions: ...", + ); + // handle error + } +} +``` + +## Browser / Worker Support + +The main export of `magicast` contains filesystem utilities. If you want to use it in a browser or worker, import from `magicast/core` instead. + +```js +import { parseModule } from "magicast/core"; +``` + +## High Level Helpers + +We also experiment to provide a few high level helpers to make common tasks easier. You could import them from `magicast/helpers`. They might be moved to a separate package in the future. + +```js +import { + deepMergeObject, + addNuxtModule, + addVitePlugin, + // ... +} from "magicast/helpers"; +``` + +We recommend to check out the [source code](./src/helpers) and [test cases](./test/helpers) for more details. + +## Development + +- Clone this repository +- Install latest LTS version of [Node.js](https://nodejs.org/en/) +- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` +- Install dependencies using `pnpm install` +- Run interactive tests using `pnpm dev` + +## License + +Made with 💛 + +Published under [MIT License](./LICENSE). + + + +[npm-version-src]: https://img.shields.io/npm/v/magicast?style=flat&colorA=18181B&colorB=F0DB4F +[npm-version-href]: https://npmjs.com/package/magicast +[npm-downloads-src]: https://img.shields.io/npm/dm/magicast?style=flat&colorA=18181B&colorB=F0DB4F +[npm-downloads-href]: https://npmjs.com/package/magicast +[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/magicast/main?style=flat&colorA=18181B&colorB=F0DB4F +[codecov-href]: https://codecov.io/gh/unjs/magicast +[bundle-src]: https://img.shields.io/bundlephobia/minzip/magicast?style=flat&colorA=18181B&colorB=F0DB4F +[bundle-href]: https://bundlephobia.com/result?p=magicast +[license-src]: https://img.shields.io/github/license/unjs/magicast.svg?style=flat&colorA=18181B&colorB=F0DB4F +[license-href]: https://github.com/unjs/magicast/blob/main/LICENSE +[jsdocs-src]: https://img.shields.io/badge/jsDocs.io-reference-18181B?style=flat&colorA=18181B&colorB=F0DB4F +[jsdocs-href]: https://www.jsdocs.io/package/magicast diff --git a/tools/ui/node_modules/magicast/dist/builders-mk_DIY8_.js b/tools/ui/node_modules/magicast/dist/builders-mk_DIY8_.js new file mode 100644 index 0000000000000000000000000000000000000000..6de58c49310ec3bb2e6f3fc45a9ecd18a4716a15 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/builders-mk_DIY8_.js @@ -0,0 +1,8512 @@ +import * as babelParser from "@babel/parser"; +//#region \0rolldown/runtime.js +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +//#endregion +//#region vendor/ast-types/src/shared.ts +function shared_default(fork) { + var types = fork.use(typesPlugin); + var Type = types.Type; + var builtin = types.builtInTypes; + var isNumber = builtin.number; + function geq(than) { + return Type.from((value) => isNumber.check(value) && value >= than, isNumber + " >= " + than); + } + const defaults = { + "null": function() { + return null; + }, + "emptyArray": function() { + return []; + }, + "false": function() { + return false; + }, + "true": function() { + return true; + }, + "undefined": function() {}, + "use strict": function() { + return "use strict"; + } + }; + var naiveIsPrimitive = Type.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined); + return { + geq, + defaults, + isPrimitive: Type.from((value) => { + if (value === null) return true; + var type = typeof value; + if (type === "object" || type === "function") return false; + return true; + }, naiveIsPrimitive.toString()) + }; +} +//#endregion +//#region vendor/ast-types/src/types.ts +const Op = Object.prototype; +const objToStr = Op.toString; +const hasOwn$6 = Op.hasOwnProperty; +var BaseType = class { + assert(value, deep) { + if (!this.check(value, deep)) { + var str = shallowStringify(value); + throw new Error(str + " does not match type " + this); + } + return true; + } + arrayOf() { + return new ArrayType(this); + } +}; +var ArrayType = class extends BaseType { + elemType; + kind = "ArrayType"; + constructor(elemType) { + super(); + this.elemType = elemType; + } + toString() { + return "[" + this.elemType + "]"; + } + check(value, deep) { + return Array.isArray(value) && value.every((elem) => this.elemType.check(elem, deep)); + } +}; +var IdentityType = class extends BaseType { + value; + kind = "IdentityType"; + constructor(value) { + super(); + this.value = value; + } + toString() { + return String(this.value); + } + check(value, deep) { + const result = value === this.value; + if (!result && typeof deep === "function") deep(this, value); + return result; + } +}; +var ObjectType = class extends BaseType { + fields; + kind = "ObjectType"; + constructor(fields) { + super(); + this.fields = fields; + } + toString() { + return "{ " + this.fields.join(", ") + " }"; + } + check(value, deep) { + return objToStr.call(value) === objToStr.call({}) && this.fields.every((field) => { + return field.type.check(value[field.name], deep); + }); + } +}; +var OrType = class extends BaseType { + types; + kind = "OrType"; + constructor(types) { + super(); + this.types = types; + } + toString() { + return this.types.join(" | "); + } + check(value, deep) { + if (this.types.some((type) => type.check(value, !!deep))) return true; + if (typeof deep === "function") deep(this, value); + return false; + } +}; +var PredicateType = class extends BaseType { + name; + predicate; + kind = "PredicateType"; + constructor(name, predicate) { + super(); + this.name = name; + this.predicate = predicate; + } + toString() { + return this.name; + } + check(value, deep) { + const result = this.predicate(value, deep); + if (!result && typeof deep === "function") deep(this, value); + return result; + } +}; +var Def = class Def { + type; + typeName; + baseNames = []; + ownFields = Object.create(null); + allSupertypes = Object.create(null); + supertypeList = []; + allFields = Object.create(null); + fieldNames = []; + finalized = false; + buildable = false; + buildParams = []; + constructor(type, typeName) { + this.type = type; + this.typeName = typeName; + } + isSupertypeOf(that) { + if (that instanceof Def) { + if (this.finalized !== true || that.finalized !== true) throw new Error(""); + return hasOwn$6.call(that.allSupertypes, this.typeName); + } else throw new Error(that + " is not a Def"); + } + checkAllFields(value, deep) { + var allFields = this.allFields; + if (this.finalized !== true) throw new Error("" + this.typeName); + function checkFieldByName(name) { + var field = allFields[name]; + var type = field.type; + var child = field.getValue(value); + return type.check(child, deep); + } + return value !== null && typeof value === "object" && Object.keys(allFields).every(checkFieldByName); + } + bases(...supertypeNames) { + var bases = this.baseNames; + if (this.finalized) { + if (supertypeNames.length !== bases.length) throw new Error(""); + for (var i = 0; i < supertypeNames.length; i++) if (supertypeNames[i] !== bases[i]) throw new Error(""); + return this; + } + supertypeNames.forEach((baseName) => { + if (bases.indexOf(baseName) < 0) bases.push(baseName); + }); + return this; + } +}; +var Field = class { + name; + type; + defaultFn; + hidden; + constructor(name, type, defaultFn, hidden) { + this.name = name; + this.type = type; + this.defaultFn = defaultFn; + this.hidden = !!hidden; + } + toString() { + return JSON.stringify(this.name) + ": " + this.type; + } + getValue(obj) { + var value = obj[this.name]; + if (typeof value !== "undefined") return value; + if (typeof this.defaultFn === "function") value = this.defaultFn.call(obj); + return value; + } +}; +function shallowStringify(value) { + if (Array.isArray(value)) return "[" + value.map(shallowStringify).join(", ") + "]"; + if (value && typeof value === "object") return "{ " + Object.keys(value).map(function(key) { + return key + ": " + value[key]; + }).join(", ") + " }"; + return JSON.stringify(value); +} +function typesPlugin(_fork) { + const Type = { + or(...types) { + return new OrType(types.map((type) => Type.from(type))); + }, + from(value, name) { + if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) return value; + if (value instanceof Def) return value.type; + if (isArray.check(value)) { + if (value.length !== 1) throw new Error("only one element type is permitted for typed arrays"); + return new ArrayType(Type.from(value[0])); + } + if (isObject.check(value)) return new ObjectType(Object.keys(value).map((name) => { + return new Field(name, Type.from(value[name], name)); + })); + if (typeof value === "function") { + var bicfIndex = builtInCtorFns.indexOf(value); + if (bicfIndex >= 0) return builtInCtorTypes[bicfIndex]; + if (typeof name !== "string") throw new Error("missing name"); + return new PredicateType(name, value); + } + return new IdentityType(value); + }, + def(typeName) { + return hasOwn$6.call(defCache, typeName) ? defCache[typeName] : defCache[typeName] = new DefImpl(typeName); + }, + hasDef(typeName) { + return hasOwn$6.call(defCache, typeName); + } + }; + var builtInCtorFns = []; + var builtInCtorTypes = []; + function defBuiltInType(name, example) { + const objStr = objToStr.call(example); + const type = new PredicateType(name, (value) => objToStr.call(value) === objStr); + if (example && typeof example.constructor === "function") { + builtInCtorFns.push(example.constructor); + builtInCtorTypes.push(type); + } + return type; + } + const isString = defBuiltInType("string", "truthy"); + const isFunction = defBuiltInType("function", function() {}); + const isArray = defBuiltInType("array", []); + const isObject = defBuiltInType("object", {}); + const isRegExp = defBuiltInType("RegExp", /./); + const isDate = defBuiltInType("Date", /* @__PURE__ */ new Date()); + const isNumber = defBuiltInType("number", 3); + const isBoolean = defBuiltInType("boolean", true); + const isNull = defBuiltInType("null", null); + const isUndefined = defBuiltInType("undefined", void 0); + const builtInTypes = { + string: isString, + function: isFunction, + array: isArray, + object: isObject, + RegExp: isRegExp, + Date: isDate, + number: isNumber, + boolean: isBoolean, + null: isNull, + undefined: isUndefined, + BigInt: typeof BigInt === "function" ? defBuiltInType("BigInt", BigInt(1234)) : new PredicateType("BigInt", () => false) + }; + var defCache = Object.create(null); + function defFromValue(value) { + if (value && typeof value === "object") { + var type = value.type; + if (typeof type === "string" && hasOwn$6.call(defCache, type)) { + var d = defCache[type]; + if (d.finalized) return d; + } + } + return null; + } + class DefImpl extends Def { + constructor(typeName) { + super(new PredicateType(typeName, (value, deep) => this.check(value, deep)), typeName); + } + check(value, deep) { + if (this.finalized !== true) throw new Error("prematurely checking unfinalized type " + this.typeName); + if (value === null || typeof value !== "object") return false; + var vDef = defFromValue(value); + if (!vDef) { + if (this.typeName === "SourceLocation" || this.typeName === "Position") return this.checkAllFields(value, deep); + return false; + } + if (deep && vDef === this) return this.checkAllFields(value, deep); + if (!this.isSupertypeOf(vDef)) return false; + if (!deep) return true; + return vDef.checkAllFields(value, deep) && this.checkAllFields(value, false); + } + build(...buildParams) { + this.buildParams = buildParams; + if (this.buildable) return this; + this.field("type", String, () => this.typeName); + this.buildable = true; + const addParam = (built, param, arg, isArgAvailable) => { + if (hasOwn$6.call(built, param)) return; + var all = this.allFields; + if (!hasOwn$6.call(all, param)) throw new Error("" + param); + var field = all[param]; + var type = field.type; + var value; + if (isArgAvailable) value = arg; + else if (field.defaultFn) value = field.defaultFn.call(built); + else { + var message = "no value or default function given for field " + JSON.stringify(param) + " of " + this.typeName + "(" + this.buildParams.map(function(name) { + return all[name]; + }).join(", ") + ")"; + throw new Error(message); + } + if (!type.check(value)) throw new Error(shallowStringify(value) + " does not match field " + field + " of type " + this.typeName); + built[param] = value; + }; + const builder = (...args) => { + var argc = args.length; + if (!this.finalized) throw new Error("attempting to instantiate unfinalized type " + this.typeName); + var built = Object.create(nodePrototype); + this.buildParams.forEach(function(param, i) { + if (i < argc) addParam(built, param, args[i], true); + else addParam(built, param, null, false); + }); + Object.keys(this.allFields).forEach(function(param) { + addParam(built, param, null, false); + }); + if (built.type !== this.typeName) throw new Error(""); + return built; + }; + builder.from = (obj) => { + if (!this.finalized) throw new Error("attempting to instantiate unfinalized type " + this.typeName); + var built = Object.create(nodePrototype); + Object.keys(this.allFields).forEach(function(param) { + if (hasOwn$6.call(obj, param)) addParam(built, param, obj[param], true); + else addParam(built, param, null, false); + }); + if (built.type !== this.typeName) throw new Error(""); + return built; + }; + Object.defineProperty(builders, getBuilderName(this.typeName), { + enumerable: true, + value: builder + }); + return this; + } + field(name, type, defaultFn, hidden) { + if (this.finalized) { + console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName)); + return this; + } + this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden); + return this; + } + finalize() { + if (!this.finalized) { + var allFields = this.allFields; + var allSupertypes = this.allSupertypes; + this.baseNames.forEach((name) => { + var def = defCache[name]; + if (def instanceof Def) { + def.finalize(); + extend(allFields, def.allFields); + extend(allSupertypes, def.allSupertypes); + } else { + var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(this.typeName); + throw new Error(message); + } + }); + extend(allFields, this.ownFields); + allSupertypes[this.typeName] = this; + this.fieldNames.length = 0; + for (var fieldName in allFields) if (hasOwn$6.call(allFields, fieldName) && !allFields[fieldName].hidden) this.fieldNames.push(fieldName); + Object.defineProperty(namedTypes, this.typeName, { + enumerable: true, + value: this.type + }); + this.finalized = true; + populateSupertypeList(this.typeName, this.supertypeList); + if (this.buildable && this.supertypeList.lastIndexOf("Expression") >= 0) wrapExpressionBuilderWithStatement(this.typeName); + } + } + } + function getSupertypeNames(typeName) { + if (!hasOwn$6.call(defCache, typeName)) throw new Error(""); + var d = defCache[typeName]; + if (d.finalized !== true) throw new Error(""); + return d.supertypeList.slice(1); + } + function computeSupertypeLookupTable(candidates) { + var table = {}; + var typeNames = Object.keys(defCache); + var typeNameCount = typeNames.length; + for (var i = 0; i < typeNameCount; ++i) { + var typeName = typeNames[i]; + var d = defCache[typeName]; + if (d.finalized !== true) throw new Error("" + typeName); + for (var j = 0; j < d.supertypeList.length; ++j) { + var superTypeName = d.supertypeList[j]; + if (hasOwn$6.call(candidates, superTypeName)) { + table[typeName] = superTypeName; + break; + } + } + } + return table; + } + var builders = Object.create(null); + var nodePrototype = {}; + function defineMethod(name, func) { + var old = nodePrototype[name]; + if (isUndefined.check(func)) delete nodePrototype[name]; + else { + isFunction.assert(func); + Object.defineProperty(nodePrototype, name, { + enumerable: true, + configurable: true, + value: func + }); + } + return old; + } + function getBuilderName(typeName) { + return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) { + var len = upperCasePrefix.length; + switch (len) { + case 0: return ""; + case 1: return upperCasePrefix.toLowerCase(); + default: return upperCasePrefix.slice(0, len - 1).toLowerCase() + upperCasePrefix.charAt(len - 1); + } + }); + } + function getStatementBuilderName(typeName) { + typeName = getBuilderName(typeName); + return typeName.replace(/(Expression)?$/, "Statement"); + } + var namedTypes = {}; + function getFieldNames(object) { + var d = defFromValue(object); + if (d) return d.fieldNames.slice(0); + if ("type" in object) throw new Error("did not recognize object of type " + JSON.stringify(object.type)); + return Object.keys(object); + } + function getFieldValue(object, fieldName) { + var d = defFromValue(object); + if (d) { + var field = d.allFields[fieldName]; + if (field) return field.getValue(object); + } + return object && object[fieldName]; + } + function eachField(object, callback, context) { + getFieldNames(object).forEach(function(name) { + callback.call(this, name, getFieldValue(object, name)); + }, context); + } + function someField(object, callback, context) { + return getFieldNames(object).some(function(name) { + return callback.call(this, name, getFieldValue(object, name)); + }, context); + } + function wrapExpressionBuilderWithStatement(typeName) { + var wrapperName = getStatementBuilderName(typeName); + if (builders[wrapperName]) return; + var wrapped = builders[getBuilderName(typeName)]; + if (!wrapped) return; + const builder = function(...args) { + return builders.expressionStatement(wrapped.apply(builders, args)); + }; + builder.from = function(...args) { + return builders.expressionStatement(wrapped.from.apply(builders, args)); + }; + builders[wrapperName] = builder; + } + function populateSupertypeList(typeName, list) { + list.length = 0; + list.push(typeName); + var lastSeen = Object.create(null); + for (var pos = 0; pos < list.length; ++pos) { + typeName = list[pos]; + var d = defCache[typeName]; + if (d.finalized !== true) throw new Error(""); + if (hasOwn$6.call(lastSeen, typeName)) delete list[lastSeen[typeName]]; + lastSeen[typeName] = pos; + list.push.apply(list, d.baseNames); + } + for (var to = 0, from = to, len = list.length; from < len; ++from) if (hasOwn$6.call(list, from)) list[to++] = list[from]; + list.length = to; + } + function extend(into, from) { + Object.keys(from).forEach(function(name) { + into[name] = from[name]; + }); + return into; + } + function finalize() { + Object.keys(defCache).forEach(function(name) { + defCache[name].finalize(); + }); + } + return { + Type, + builtInTypes, + getSupertypeNames, + computeSupertypeLookupTable, + builders, + defineMethod, + getBuilderName, + getStatementBuilderName, + namedTypes, + getFieldNames, + getFieldValue, + eachField, + someField, + finalize + }; +} +//#endregion +//#region vendor/ast-types/src/path.ts +var hasOwn$5 = Object.prototype.hasOwnProperty; +function pathPlugin(fork) { + var types = fork.use(typesPlugin); + var isArray = types.builtInTypes.array; + var isNumber = types.builtInTypes.number; + const Path = function Path(value, parentPath, name) { + if (!(this instanceof Path)) throw new Error("Path constructor cannot be invoked without 'new'"); + if (parentPath) { + if (!(parentPath instanceof Path)) throw new Error(""); + } else { + parentPath = null; + name = null; + } + this.value = value; + this.parentPath = parentPath; + this.name = name; + this.__childCache = null; + }; + var Pp = Path.prototype; + function getChildCache(path) { + return path.__childCache || (path.__childCache = Object.create(null)); + } + function getChildPath(path, name) { + var cache = getChildCache(path); + var actualChildValue = path.getValueProperty(name); + var childPath = cache[name]; + if (!hasOwn$5.call(cache, name) || childPath.value !== actualChildValue) childPath = cache[name] = new path.constructor(actualChildValue, path, name); + return childPath; + } + Pp.getValueProperty = function getValueProperty(name) { + return this.value[name]; + }; + Pp.get = function get(...names) { + var path = this; + var count = names.length; + for (var i = 0; i < count; ++i) path = getChildPath(path, names[i]); + return path; + }; + Pp.each = function each(callback, context) { + var childPaths = []; + var len = this.value.length; + var i = 0; + for (var i = 0; i < len; ++i) if (hasOwn$5.call(this.value, i)) childPaths[i] = this.get(i); + context = context || this; + for (i = 0; i < len; ++i) if (hasOwn$5.call(childPaths, i)) callback.call(context, childPaths[i]); + }; + Pp.map = function map(callback, context) { + var result = []; + this.each(function(childPath) { + result.push(callback.call(this, childPath)); + }, context); + return result; + }; + Pp.filter = function filter(callback, context) { + var result = []; + this.each(function(childPath) { + if (callback.call(this, childPath)) result.push(childPath); + }, context); + return result; + }; + function emptyMoves() {} + function getMoves(path, offset, start, end) { + isArray.assert(path.value); + if (offset === 0) return emptyMoves; + var length = path.value.length; + if (length < 1) return emptyMoves; + var argc = arguments.length; + if (argc === 2) { + start = 0; + end = length; + } else if (argc === 3) { + start = Math.max(start, 0); + end = length; + } else { + start = Math.max(start, 0); + end = Math.min(end, length); + } + isNumber.assert(start); + isNumber.assert(end); + var moves = Object.create(null); + var cache = getChildCache(path); + for (var i = start; i < end; ++i) if (hasOwn$5.call(path.value, i)) { + var childPath = path.get(i); + if (childPath.name !== i) throw new Error(""); + var newIndex = i + offset; + childPath.name = newIndex; + moves[newIndex] = childPath; + delete cache[i]; + } + delete cache.length; + return function() { + for (var newIndex in moves) { + var childPath = moves[newIndex]; + if (childPath.name !== +newIndex) throw new Error(""); + cache[newIndex] = childPath; + path.value[newIndex] = childPath.value; + } + }; + } + Pp.shift = function shift() { + var move = getMoves(this, -1); + var result = this.value.shift(); + move(); + return result; + }; + Pp.unshift = function unshift(...args) { + var move = getMoves(this, args.length); + var result = this.value.unshift.apply(this.value, args); + move(); + return result; + }; + Pp.push = function push(...args) { + isArray.assert(this.value); + delete getChildCache(this).length; + return this.value.push.apply(this.value, args); + }; + Pp.pop = function pop() { + isArray.assert(this.value); + var cache = getChildCache(this); + delete cache[this.value.length - 1]; + delete cache.length; + return this.value.pop(); + }; + Pp.insertAt = function insertAt(index) { + var argc = arguments.length; + var move = getMoves(this, argc - 1, index); + if (move === emptyMoves && argc <= 1) return this; + index = Math.max(index, 0); + for (var i = 1; i < argc; ++i) this.value[index + i - 1] = arguments[i]; + move(); + return this; + }; + Pp.insertBefore = function insertBefore(...args) { + var pp = this.parentPath; + var argc = args.length; + var insertAtArgs = [this.name]; + for (var i = 0; i < argc; ++i) insertAtArgs.push(args[i]); + return pp.insertAt.apply(pp, insertAtArgs); + }; + Pp.insertAfter = function insertAfter(...args) { + var pp = this.parentPath; + var argc = args.length; + var insertAtArgs = [this.name + 1]; + for (var i = 0; i < argc; ++i) insertAtArgs.push(args[i]); + return pp.insertAt.apply(pp, insertAtArgs); + }; + function repairRelationshipWithParent(path) { + if (!(path instanceof Path)) throw new Error(""); + var pp = path.parentPath; + if (!pp) return path; + var parentValue = pp.value; + var parentCache = getChildCache(pp); + if (parentValue[path.name] === path.value) parentCache[path.name] = path; + else if (isArray.check(parentValue)) { + var i = parentValue.indexOf(path.value); + if (i >= 0) parentCache[path.name = i] = path; + } else { + parentValue[path.name] = path.value; + parentCache[path.name] = path; + } + if (parentValue[path.name] !== path.value) throw new Error(""); + if (path.parentPath.get(path.name) !== path) throw new Error(""); + return path; + } + Pp.replace = function replace(replacement) { + var results = []; + var parentValue = this.parentPath.value; + var parentCache = getChildCache(this.parentPath); + var count = arguments.length; + repairRelationshipWithParent(this); + if (isArray.check(parentValue)) { + var originalLength = parentValue.length; + var move = getMoves(this.parentPath, count - 1, this.name + 1); + var spliceArgs = [this.name, 1]; + for (var i = 0; i < count; ++i) spliceArgs.push(arguments[i]); + if (parentValue.splice.apply(parentValue, spliceArgs)[0] !== this.value) throw new Error(""); + if (parentValue.length !== originalLength - 1 + count) throw new Error(""); + move(); + if (count === 0) { + delete this.value; + delete parentCache[this.name]; + this.__childCache = null; + } else { + if (parentValue[this.name] !== replacement) throw new Error(""); + if (this.value !== replacement) { + this.value = replacement; + this.__childCache = null; + } + for (i = 0; i < count; ++i) results.push(this.parentPath.get(this.name + i)); + if (results[0] !== this) throw new Error(""); + } + } else if (count === 1) { + if (this.value !== replacement) this.__childCache = null; + this.value = parentValue[this.name] = replacement; + results.push(this); + } else if (count === 0) { + delete parentValue[this.name]; + delete this.value; + this.__childCache = null; + } else throw new Error("Could not replace path"); + return results; + }; + return Path; +} +//#endregion +//#region vendor/ast-types/src/scope.ts +var hasOwn$4 = Object.prototype.hasOwnProperty; +function scopePlugin(fork) { + var types = fork.use(typesPlugin); + var Type = types.Type; + var namedTypes = types.namedTypes; + var Node = namedTypes.Node; + var Expression = namedTypes.Expression; + var isArray = types.builtInTypes.array; + var b = types.builders; + const Scope = function Scope(path, parentScope) { + if (!(this instanceof Scope)) throw new Error("Scope constructor cannot be invoked without 'new'"); + if (!TypeParameterScopeType.check(path.value)) ScopeType.assert(path.value); + var depth; + if (parentScope) { + if (!(parentScope instanceof Scope)) throw new Error(""); + depth = parentScope.depth + 1; + } else { + parentScope = null; + depth = 0; + } + Object.defineProperties(this, { + path: { value: path }, + node: { value: path.value }, + isGlobal: { + value: !parentScope, + enumerable: true + }, + depth: { value: depth }, + parent: { value: parentScope }, + bindings: { value: {} }, + types: { value: {} } + }); + }; + var ScopeType = Type.or(namedTypes.Program, namedTypes.Function, namedTypes.CatchClause); + var TypeParameterScopeType = Type.or(namedTypes.Function, namedTypes.ClassDeclaration, namedTypes.ClassExpression, namedTypes.InterfaceDeclaration, namedTypes.TSInterfaceDeclaration, namedTypes.TypeAlias, namedTypes.TSTypeAliasDeclaration); + var FlowOrTSTypeParameterType = Type.or(namedTypes.TypeParameter, namedTypes.TSTypeParameter); + Scope.isEstablishedBy = function(node) { + return ScopeType.check(node) || TypeParameterScopeType.check(node); + }; + var Sp = Scope.prototype; + Sp.didScan = false; + Sp.declares = function(name) { + this.scan(); + return hasOwn$4.call(this.bindings, name); + }; + Sp.declaresType = function(name) { + this.scan(); + return hasOwn$4.call(this.types, name); + }; + Sp.declareTemporary = function(prefix) { + if (prefix) { + if (!/^[a-z$_]/i.test(prefix)) throw new Error(""); + } else prefix = "t$"; + prefix += this.depth.toString(36) + "$"; + this.scan(); + var index = 0; + while (this.declares(prefix + index)) ++index; + var name = prefix + index; + return this.bindings[name] = types.builders.identifier(name); + }; + Sp.injectTemporary = function(identifier, init) { + identifier || (identifier = this.declareTemporary()); + var bodyPath = this.path.get("body"); + if (namedTypes.BlockStatement.check(bodyPath.value)) bodyPath = bodyPath.get("body"); + bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init || null)])); + return identifier; + }; + Sp.scan = function(force) { + if (force || !this.didScan) { + for (var name in this.bindings) delete this.bindings[name]; + for (var name in this.types) delete this.types[name]; + scanScope(this.path, this.bindings, this.types); + this.didScan = true; + } + }; + Sp.getBindings = function() { + this.scan(); + return this.bindings; + }; + Sp.getTypes = function() { + this.scan(); + return this.types; + }; + function scanScope(path, bindings, scopeTypes) { + var node = path.value; + if (TypeParameterScopeType.check(node)) { + const params = path.get("typeParameters", "params"); + if (isArray.check(params.value)) params.each((childPath) => { + addTypeParameter(childPath, scopeTypes); + }); + } + if (ScopeType.check(node)) if (namedTypes.CatchClause.check(node)) addPattern(path.get("param"), bindings); + else recursiveScanScope(path, bindings, scopeTypes); + } + function recursiveScanScope(path, bindings, scopeTypes) { + var node = path.value; + if (path.parent && namedTypes.FunctionExpression.check(path.parent.node) && path.parent.node.id) addPattern(path.parent.get("id"), bindings); + if (!node) {} else if (isArray.check(node)) path.each((childPath) => { + recursiveScanChild(childPath, bindings, scopeTypes); + }); + else if (namedTypes.Function.check(node)) { + path.get("params").each((paramPath) => { + addPattern(paramPath, bindings); + }); + recursiveScanChild(path.get("body"), bindings, scopeTypes); + recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes); + } else if (namedTypes.TypeAlias && namedTypes.TypeAlias.check(node) || namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node) || namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) addTypePattern(path.get("id"), scopeTypes); + else if (namedTypes.VariableDeclarator.check(node)) { + addPattern(path.get("id"), bindings); + recursiveScanChild(path.get("init"), bindings, scopeTypes); + } else if (node.type === "ImportSpecifier" || node.type === "ImportNamespaceSpecifier" || node.type === "ImportDefaultSpecifier") addPattern(path.get(node.local ? "local" : node.name ? "name" : "id"), bindings); + else if (Node.check(node) && !Expression.check(node)) types.eachField(node, function(name, child) { + var childPath = path.get(name); + if (!pathHasValue(childPath, child)) throw new Error(""); + recursiveScanChild(childPath, bindings, scopeTypes); + }); + } + function pathHasValue(path, value) { + if (path.value === value) return true; + if (Array.isArray(path.value) && path.value.length === 0 && Array.isArray(value) && value.length === 0) return true; + return false; + } + function recursiveScanChild(path, bindings, scopeTypes) { + var node = path.value; + if (!node || Expression.check(node)) {} else if (namedTypes.FunctionDeclaration.check(node) && node.id !== null) addPattern(path.get("id"), bindings); + else if (namedTypes.ClassDeclaration && namedTypes.ClassDeclaration.check(node) && node.id !== null) { + addPattern(path.get("id"), bindings); + recursiveScanScope(path.get("typeParameters"), bindings, scopeTypes); + } else if (namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) addTypePattern(path.get("id"), scopeTypes); + else if (ScopeType.check(node)) { + if (namedTypes.CatchClause.check(node) && namedTypes.Identifier.check(node.param)) { + var catchParamName = node.param.name; + var hadBinding = hasOwn$4.call(bindings, catchParamName); + recursiveScanScope(path.get("body"), bindings, scopeTypes); + if (!hadBinding) delete bindings[catchParamName]; + } + } else recursiveScanScope(path, bindings, scopeTypes); + } + function addPattern(patternPath, bindings) { + var pattern = patternPath.value; + namedTypes.Pattern.assert(pattern); + if (namedTypes.Identifier.check(pattern)) if (hasOwn$4.call(bindings, pattern.name)) bindings[pattern.name].push(patternPath); + else bindings[pattern.name] = [patternPath]; + else if (namedTypes.AssignmentPattern && namedTypes.AssignmentPattern.check(pattern)) addPattern(patternPath.get("left"), bindings); + else if (namedTypes.ObjectPattern && namedTypes.ObjectPattern.check(pattern)) patternPath.get("properties").each(function(propertyPath) { + var property = propertyPath.value; + if (namedTypes.Pattern.check(property)) addPattern(propertyPath, bindings); + else if (namedTypes.Property.check(property) || namedTypes.ObjectProperty && namedTypes.ObjectProperty.check(property)) addPattern(propertyPath.get("value"), bindings); + else if (namedTypes.SpreadProperty && namedTypes.SpreadProperty.check(property)) addPattern(propertyPath.get("argument"), bindings); + }); + else if (namedTypes.ArrayPattern && namedTypes.ArrayPattern.check(pattern)) patternPath.get("elements").each(function(elementPath) { + var element = elementPath.value; + if (namedTypes.Pattern.check(element)) addPattern(elementPath, bindings); + else if (namedTypes.SpreadElement && namedTypes.SpreadElement.check(element)) addPattern(elementPath.get("argument"), bindings); + }); + else if (namedTypes.PropertyPattern && namedTypes.PropertyPattern.check(pattern)) addPattern(patternPath.get("pattern"), bindings); + else if (namedTypes.SpreadElementPattern && namedTypes.SpreadElementPattern.check(pattern) || namedTypes.RestElement && namedTypes.RestElement.check(pattern) || namedTypes.SpreadPropertyPattern && namedTypes.SpreadPropertyPattern.check(pattern)) addPattern(patternPath.get("argument"), bindings); + } + function addTypePattern(patternPath, types) { + var pattern = patternPath.value; + namedTypes.Pattern.assert(pattern); + if (namedTypes.Identifier.check(pattern)) if (hasOwn$4.call(types, pattern.name)) types[pattern.name].push(patternPath); + else types[pattern.name] = [patternPath]; + } + function addTypeParameter(parameterPath, types) { + var parameter = parameterPath.value; + FlowOrTSTypeParameterType.assert(parameter); + if (hasOwn$4.call(types, parameter.name)) types[parameter.name].push(parameterPath); + else types[parameter.name] = [parameterPath]; + } + Sp.lookup = function(name) { + for (var scope = this; scope; scope = scope.parent) if (scope.declares(name)) break; + return scope; + }; + Sp.lookupType = function(name) { + for (var scope = this; scope; scope = scope.parent) if (scope.declaresType(name)) break; + return scope; + }; + Sp.getGlobalScope = function() { + var scope = this; + while (!scope.isGlobal) scope = scope.parent; + return scope; + }; + return Scope; +} +//#endregion +//#region vendor/ast-types/src/node-path.ts +function nodePathPlugin(fork) { + var types = fork.use(typesPlugin); + var n = types.namedTypes; + var b = types.builders; + var isNumber = types.builtInTypes.number; + var isArray = types.builtInTypes.array; + var Path = fork.use(pathPlugin); + var Scope = fork.use(scopePlugin); + const NodePath = function NodePath(value, parentPath, name) { + if (!(this instanceof NodePath)) throw new Error("NodePath constructor cannot be invoked without 'new'"); + Path.call(this, value, parentPath, name); + }; + var NPp = NodePath.prototype = Object.create(Path.prototype, { constructor: { + value: NodePath, + enumerable: false, + writable: true, + configurable: true + } }); + Object.defineProperties(NPp, { + node: { get: function() { + Object.defineProperty(this, "node", { + configurable: true, + value: this._computeNode() + }); + return this.node; + } }, + parent: { get: function() { + Object.defineProperty(this, "parent", { + configurable: true, + value: this._computeParent() + }); + return this.parent; + } }, + scope: { get: function() { + Object.defineProperty(this, "scope", { + configurable: true, + value: this._computeScope() + }); + return this.scope; + } } + }); + NPp.replace = function() { + delete this.node; + delete this.parent; + delete this.scope; + return Path.prototype.replace.apply(this, arguments); + }; + NPp.prune = function() { + var remainingNodePath = this.parent; + this.replace(); + return cleanUpNodesAfterPrune(remainingNodePath); + }; + NPp._computeNode = function() { + var value = this.value; + if (n.Node.check(value)) return value; + var pp = this.parentPath; + return pp && pp.node || null; + }; + NPp._computeParent = function() { + var value = this.value; + var pp = this.parentPath; + if (!n.Node.check(value)) { + while (pp && !n.Node.check(pp.value)) pp = pp.parentPath; + if (pp) pp = pp.parentPath; + } + while (pp && !n.Node.check(pp.value)) pp = pp.parentPath; + return pp || null; + }; + NPp._computeScope = function() { + var value = this.value; + var pp = this.parentPath; + var scope = pp && pp.scope; + if (n.Node.check(value) && Scope.isEstablishedBy(value)) scope = new Scope(this, scope); + return scope || null; + }; + NPp.getValueProperty = function(name) { + return types.getFieldValue(this.value, name); + }; + /** + * Determine whether this.node needs to be wrapped in parentheses in order + * for a parser to reproduce the same local AST structure. + * + * For instance, in the expression `(1 + 2) * 3`, the BinaryExpression + * whose operator is "+" needs parentheses, because `1 + 2 * 3` would + * parse differently. + * + * If assumeExpressionContext === true, we don't worry about edge cases + * like an anonymous FunctionExpression appearing lexically first in its + * enclosing statement and thus needing parentheses to avoid being parsed + * as a FunctionDeclaration with a missing name. + */ + NPp.needsParens = function(assumeExpressionContext) { + var pp = this.parentPath; + if (!pp) return false; + var node = this.value; + if (!n.Expression.check(node)) return false; + if (node.type === "Identifier") return false; + while (!n.Node.check(pp.value)) { + pp = pp.parentPath; + if (!pp) return false; + } + var parent = pp.value; + switch (node.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": return parent.type === "MemberExpression" && this.name === "object" && parent.object === node; + case "BinaryExpression": + case "LogicalExpression": switch (parent.type) { + case "CallExpression": return this.name === "callee" && parent.callee === node; + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": return true; + case "MemberExpression": return this.name === "object" && parent.object === node; + case "BinaryExpression": + case "LogicalExpression": { + const n = node; + const pp = PRECEDENCE[parent.operator]; + const np = PRECEDENCE[n.operator]; + if (pp > np) return true; + if (pp === np && this.name === "right") { + if (parent.right !== n) throw new Error("Nodes must be equal"); + return true; + } + } + default: return false; + } + case "SequenceExpression": switch (parent.type) { + case "ForStatement": return false; + case "ExpressionStatement": return this.name !== "expression"; + default: return true; + } + case "YieldExpression": switch (parent.type) { + case "BinaryExpression": + case "LogicalExpression": + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "CallExpression": + case "MemberExpression": + case "NewExpression": + case "ConditionalExpression": + case "YieldExpression": return true; + default: return false; + } + case "Literal": return parent.type === "MemberExpression" && isNumber.check(node.value) && this.name === "object" && parent.object === node; + case "AssignmentExpression": + case "ConditionalExpression": switch (parent.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "BinaryExpression": + case "LogicalExpression": return true; + case "CallExpression": return this.name === "callee" && parent.callee === node; + case "ConditionalExpression": return this.name === "test" && parent.test === node; + case "MemberExpression": return this.name === "object" && parent.object === node; + default: return false; + } + default: if (parent.type === "NewExpression" && this.name === "callee" && parent.callee === node) return containsCallExpression(node); + } + if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) return true; + return false; + }; + function isBinary(node) { + return n.BinaryExpression.check(node) || n.LogicalExpression.check(node); + } + var PRECEDENCE = {}; + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + [ + "==", + "===", + "!=", + "!==" + ], + [ + "<", + ">", + "<=", + ">=", + "in", + "instanceof" + ], + [ + ">>", + "<<", + ">>>" + ], + ["+", "-"], + [ + "*", + "/", + "%" + ] + ].forEach(function(tier, i) { + tier.forEach(function(op) { + PRECEDENCE[op] = i; + }); + }); + function containsCallExpression(node) { + if (n.CallExpression.check(node)) return true; + if (isArray.check(node)) return node.some(containsCallExpression); + if (n.Node.check(node)) return types.someField(node, function(_name, child) { + return containsCallExpression(child); + }); + return false; + } + NPp.canBeFirstInStatement = function() { + var node = this.node; + return !n.FunctionExpression.check(node) && !n.ObjectExpression.check(node); + }; + NPp.firstInStatement = function() { + return firstInStatement(this); + }; + function firstInStatement(path) { + for (var node, parent; path.parent; path = path.parent) { + node = path.node; + parent = path.parent.node; + if (n.BlockStatement.check(parent) && path.parent.name === "body" && path.name === 0) { + if (parent.body[0] !== node) throw new Error("Nodes must be equal"); + return true; + } + if (n.ExpressionStatement.check(parent) && path.name === "expression") { + if (parent.expression !== node) throw new Error("Nodes must be equal"); + return true; + } + if (n.SequenceExpression.check(parent) && path.parent.name === "expressions" && path.name === 0) { + if (parent.expressions[0] !== node) throw new Error("Nodes must be equal"); + continue; + } + if (n.CallExpression.check(parent) && path.name === "callee") { + if (parent.callee !== node) throw new Error("Nodes must be equal"); + continue; + } + if (n.MemberExpression.check(parent) && path.name === "object") { + if (parent.object !== node) throw new Error("Nodes must be equal"); + continue; + } + if (n.ConditionalExpression.check(parent) && path.name === "test") { + if (parent.test !== node) throw new Error("Nodes must be equal"); + continue; + } + if (isBinary(parent) && path.name === "left") { + if (parent.left !== node) throw new Error("Nodes must be equal"); + continue; + } + if (n.UnaryExpression.check(parent) && !parent.prefix && path.name === "argument") { + if (parent.argument !== node) throw new Error("Nodes must be equal"); + continue; + } + return false; + } + return true; + } + /** + * Pruning certain nodes will result in empty or incomplete nodes, here we clean those nodes up. + */ + function cleanUpNodesAfterPrune(remainingNodePath) { + if (n.VariableDeclaration.check(remainingNodePath.node)) { + var declarations = remainingNodePath.get("declarations").value; + if (!declarations || declarations.length === 0) return remainingNodePath.prune(); + } else if (n.ExpressionStatement.check(remainingNodePath.node)) { + if (!remainingNodePath.get("expression").value) return remainingNodePath.prune(); + } else if (n.IfStatement.check(remainingNodePath.node)) cleanUpIfStatementAfterPrune(remainingNodePath); + return remainingNodePath; + } + function cleanUpIfStatementAfterPrune(ifStatement) { + var testExpression = ifStatement.get("test").value; + var alternate = ifStatement.get("alternate").value; + var consequent = ifStatement.get("consequent").value; + if (!consequent && !alternate) { + var testExpressionStatement = b.expressionStatement(testExpression); + ifStatement.replace(testExpressionStatement); + } else if (!consequent && alternate) { + var negatedTestExpression = b.unaryExpression("!", testExpression, true); + if (n.UnaryExpression.check(testExpression) && testExpression.operator === "!") negatedTestExpression = testExpression.argument; + ifStatement.get("test").replace(negatedTestExpression); + ifStatement.get("consequent").replace(alternate); + ifStatement.get("alternate").replace(); + } + } + return NodePath; +} +//#endregion +//#region vendor/ast-types/src/path-visitor.ts +var hasOwn$3 = Object.prototype.hasOwnProperty; +function pathVisitorPlugin(fork) { + var types = fork.use(typesPlugin); + var NodePath = fork.use(nodePathPlugin); + var isArray = types.builtInTypes.array; + var isObject = types.builtInTypes.object; + var isFunction = types.builtInTypes.function; + var undefined; + const PathVisitor = function PathVisitor() { + if (!(this instanceof PathVisitor)) throw new Error("PathVisitor constructor cannot be invoked without 'new'"); + this._reusableContextStack = []; + this._methodNameTable = computeMethodNameTable(this); + this._shouldVisitComments = hasOwn$3.call(this._methodNameTable, "Block") || hasOwn$3.call(this._methodNameTable, "Line"); + this.Context = makeContextConstructor(this); + this._visiting = false; + this._changeReported = false; + }; + function computeMethodNameTable(visitor) { + var typeNames = Object.create(null); + for (var methodName in visitor) if (/^visit[A-Z]/.test(methodName)) typeNames[methodName.slice(5)] = true; + var supertypeTable = types.computeSupertypeLookupTable(typeNames); + var methodNameTable = Object.create(null); + var typeNameKeys = Object.keys(supertypeTable); + var typeNameCount = typeNameKeys.length; + for (var i = 0; i < typeNameCount; ++i) { + var typeName = typeNameKeys[i]; + methodName = "visit" + supertypeTable[typeName]; + if (isFunction.check(visitor[methodName])) methodNameTable[typeName] = methodName; + } + return methodNameTable; + } + PathVisitor.fromMethodsObject = function fromMethodsObject(methods) { + if (methods instanceof PathVisitor) return methods; + if (!isObject.check(methods)) return new PathVisitor(); + const Visitor = function Visitor() { + if (!(this instanceof Visitor)) throw new Error("Visitor constructor cannot be invoked without 'new'"); + PathVisitor.call(this); + }; + var Vp = Visitor.prototype = Object.create(PVp); + Vp.constructor = Visitor; + extend(Vp, methods); + extend(Visitor, PathVisitor); + isFunction.assert(Visitor.fromMethodsObject); + isFunction.assert(Visitor.visit); + return new Visitor(); + }; + function extend(target, source) { + for (var property in source) if (hasOwn$3.call(source, property)) target[property] = source[property]; + return target; + } + PathVisitor.visit = function visit(node, methods) { + return PathVisitor.fromMethodsObject(methods).visit(node); + }; + var PVp = PathVisitor.prototype; + PVp.visit = function() { + if (this._visiting) throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead."); + this._visiting = true; + this._changeReported = false; + this._abortRequested = false; + var argc = arguments.length; + var args = new Array(argc); + for (var i = 0; i < argc; ++i) args[i] = arguments[i]; + if (!(args[0] instanceof NodePath)) args[0] = new NodePath({ root: args[0] }).get("root"); + this.reset.apply(this, args); + var didNotThrow; + try { + var root = this.visitWithoutReset(args[0]); + didNotThrow = true; + } finally { + this._visiting = false; + if (!didNotThrow && this._abortRequested) return args[0].value; + } + return root; + }; + PVp.AbortRequest = function AbortRequest() {}; + PVp.abort = function() { + var visitor = this; + visitor._abortRequested = true; + var request = new visitor.AbortRequest(); + request.cancel = function() { + visitor._abortRequested = false; + }; + throw request; + }; + PVp.reset = function(_path) {}; + PVp.visitWithoutReset = function(path) { + if (this instanceof this.Context) return this.visitor.visitWithoutReset(path); + if (!(path instanceof NodePath)) throw new Error(""); + var value = path.value; + var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type]; + if (methodName) { + var context = this.acquireContext(path); + try { + return context.invokeVisitorMethod(methodName); + } finally { + this.releaseContext(context); + } + } else return visitChildren(path, this); + }; + function visitChildren(path, visitor) { + if (!(path instanceof NodePath)) throw new Error(""); + if (!(visitor instanceof PathVisitor)) throw new Error(""); + var value = path.value; + if (isArray.check(value)) path.each(visitor.visitWithoutReset, visitor); + else if (!isObject.check(value)) {} else { + var childNames = types.getFieldNames(value); + if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) childNames.push("comments"); + var childCount = childNames.length; + var childPaths = []; + for (var i = 0; i < childCount; ++i) { + var childName = childNames[i]; + if (!hasOwn$3.call(value, childName)) value[childName] = types.getFieldValue(value, childName); + childPaths.push(path.get(childName)); + } + for (var i = 0; i < childCount; ++i) visitor.visitWithoutReset(childPaths[i]); + } + return path.value; + } + PVp.acquireContext = function(path) { + if (this._reusableContextStack.length === 0) return new this.Context(path); + return this._reusableContextStack.pop().reset(path); + }; + PVp.releaseContext = function(context) { + if (!(context instanceof this.Context)) throw new Error(""); + this._reusableContextStack.push(context); + context.currentPath = null; + }; + PVp.reportChanged = function() { + this._changeReported = true; + }; + PVp.wasChangeReported = function() { + return this._changeReported; + }; + function makeContextConstructor(visitor) { + function Context(path) { + if (!(this instanceof Context)) throw new Error(""); + if (!(this instanceof PathVisitor)) throw new Error(""); + if (!(path instanceof NodePath)) throw new Error(""); + Object.defineProperty(this, "visitor", { + value: visitor, + writable: false, + enumerable: true, + configurable: false + }); + this.currentPath = path; + this.needToCallTraverse = true; + Object.seal(this); + } + if (!(visitor instanceof PathVisitor)) throw new Error(""); + var Cp = Context.prototype = Object.create(visitor); + Cp.constructor = Context; + extend(Cp, sharedContextProtoMethods); + return Context; + } + var sharedContextProtoMethods = Object.create(null); + sharedContextProtoMethods.reset = function reset(path) { + if (!(this instanceof this.Context)) throw new Error(""); + if (!(path instanceof NodePath)) throw new Error(""); + this.currentPath = path; + this.needToCallTraverse = true; + return this; + }; + sharedContextProtoMethods.invokeVisitorMethod = function invokeVisitorMethod(methodName) { + if (!(this instanceof this.Context)) throw new Error(""); + if (!(this.currentPath instanceof NodePath)) throw new Error(""); + var result = this.visitor[methodName].call(this, this.currentPath); + if (result === false) this.needToCallTraverse = false; + else if (result !== undefined) { + this.currentPath = this.currentPath.replace(result)[0]; + if (this.needToCallTraverse) this.traverse(this.currentPath); + } + if (this.needToCallTraverse !== false) throw new Error("Must either call this.traverse or return false in " + methodName); + var path = this.currentPath; + return path && path.value; + }; + sharedContextProtoMethods.traverse = function traverse(path, newVisitor) { + if (!(this instanceof this.Context)) throw new Error(""); + if (!(path instanceof NodePath)) throw new Error(""); + if (!(this.currentPath instanceof NodePath)) throw new Error(""); + this.needToCallTraverse = false; + return visitChildren(path, PathVisitor.fromMethodsObject(newVisitor || this.visitor)); + }; + sharedContextProtoMethods.visit = function visit(path, newVisitor) { + if (!(this instanceof this.Context)) throw new Error(""); + if (!(path instanceof NodePath)) throw new Error(""); + if (!(this.currentPath instanceof NodePath)) throw new Error(""); + this.needToCallTraverse = false; + return PathVisitor.fromMethodsObject(newVisitor || this.visitor).visitWithoutReset(path); + }; + sharedContextProtoMethods.reportChanged = function reportChanged() { + this.visitor.reportChanged(); + }; + sharedContextProtoMethods.abort = function abort() { + this.needToCallTraverse = false; + this.visitor.abort(); + }; + return PathVisitor; +} +//#endregion +//#region vendor/ast-types/src/equiv.ts +function equiv_default(fork) { + var types = fork.use(typesPlugin); + var getFieldNames = types.getFieldNames; + var getFieldValue = types.getFieldValue; + var isArray = types.builtInTypes.array; + var isObject = types.builtInTypes.object; + var isDate = types.builtInTypes.Date; + var isRegExp = types.builtInTypes.RegExp; + var hasOwn = Object.prototype.hasOwnProperty; + function astNodesAreEquivalent(a, b, problemPath) { + if (isArray.check(problemPath)) problemPath.length = 0; + else problemPath = null; + return areEquivalent(a, b, problemPath); + } + astNodesAreEquivalent.assert = function(a, b) { + var problemPath = []; + if (!astNodesAreEquivalent(a, b, problemPath)) if (problemPath.length === 0) { + if (a !== b) throw new Error("Nodes must be equal"); + } else throw new Error("Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join("")); + }; + function subscriptForProperty(property) { + if (/[_$a-z][_$a-z0-9]*/i.test(property)) return "." + property; + return "[" + JSON.stringify(property) + "]"; + } + function areEquivalent(a, b, problemPath) { + if (a === b) return true; + if (isArray.check(a)) return arraysAreEquivalent(a, b, problemPath); + if (isObject.check(a)) return objectsAreEquivalent(a, b, problemPath); + if (isDate.check(a)) return isDate.check(b) && +a === +b; + if (isRegExp.check(a)) return isRegExp.check(b) && a.source === b.source && a.global === b.global && a.multiline === b.multiline && a.ignoreCase === b.ignoreCase; + return a == b; + } + function arraysAreEquivalent(a, b, problemPath) { + isArray.assert(a); + var aLength = a.length; + if (!isArray.check(b) || b.length !== aLength) { + if (problemPath) problemPath.push("length"); + return false; + } + for (var i = 0; i < aLength; ++i) { + if (problemPath) problemPath.push(i); + if (i in a !== i in b) return false; + if (!areEquivalent(a[i], b[i], problemPath)) return false; + if (problemPath) { + var problemPathTail = problemPath.pop(); + if (problemPathTail !== i) throw new Error("" + problemPathTail); + } + } + return true; + } + function objectsAreEquivalent(a, b, problemPath) { + isObject.assert(a); + if (!isObject.check(b)) return false; + if (a.type !== b.type) { + if (problemPath) problemPath.push("type"); + return false; + } + var aNames = getFieldNames(a); + var aNameCount = aNames.length; + var bNames = getFieldNames(b); + var bNameCount = bNames.length; + if (aNameCount === bNameCount) { + for (var i = 0; i < aNameCount; ++i) { + var name = aNames[i]; + var aChild = getFieldValue(a, name); + var bChild = getFieldValue(b, name); + if (problemPath) problemPath.push(name); + if (!areEquivalent(aChild, bChild, problemPath)) return false; + if (problemPath) { + var problemPathTail = problemPath.pop(); + if (problemPathTail !== name) throw new Error("" + problemPathTail); + } + } + return true; + } + if (!problemPath) return false; + var seenNames = Object.create(null); + for (i = 0; i < aNameCount; ++i) seenNames[aNames[i]] = true; + for (i = 0; i < bNameCount; ++i) { + name = bNames[i]; + if (!hasOwn.call(seenNames, name)) { + problemPath.push(name); + return false; + } + delete seenNames[name]; + } + for (name in seenNames) { + problemPath.push(name); + break; + } + return false; + } + return astNodesAreEquivalent; +} +//#endregion +//#region vendor/ast-types/src/fork.ts +function fork_default(plugins) { + const fork = createFork(); + const types = fork.use(typesPlugin); + plugins.forEach(fork.use); + types.finalize(); + const PathVisitor = fork.use(pathVisitorPlugin); + return { + Type: types.Type, + builtInTypes: types.builtInTypes, + namedTypes: types.namedTypes, + builders: types.builders, + defineMethod: types.defineMethod, + getFieldNames: types.getFieldNames, + getFieldValue: types.getFieldValue, + eachField: types.eachField, + someField: types.someField, + getSupertypeNames: types.getSupertypeNames, + getBuilderName: types.getBuilderName, + astNodesAreEquivalent: fork.use(equiv_default), + finalize: types.finalize, + Path: fork.use(pathPlugin), + NodePath: fork.use(nodePathPlugin), + PathVisitor, + use: fork.use, + visit: PathVisitor.visit + }; +} +function createFork() { + const used = []; + const usedResult = []; + function use(plugin) { + var idx = used.indexOf(plugin); + if (idx === -1) { + idx = used.length; + used.push(plugin); + usedResult[idx] = plugin(fork); + } + return usedResult[idx]; + } + var fork = { use }; + return fork; +} +//#endregion +//#region vendor/ast-types/src/def/operators/core.ts +function core_default$1() { + return { + BinaryOperators: [ + "==", + "!=", + "===", + "!==", + "<", + "<=", + ">", + ">=", + "<<", + ">>", + ">>>", + "+", + "-", + "*", + "/", + "%", + "&", + "|", + "^", + "in", + "instanceof" + ], + AssignmentOperators: [ + "=", + "+=", + "-=", + "*=", + "/=", + "%=", + "<<=", + ">>=", + ">>>=", + "|=", + "^=", + "&=" + ], + LogicalOperators: ["||", "&&"] + }; +} +//#endregion +//#region vendor/ast-types/src/def/operators/es2016.ts +function es2016_default$1(fork) { + const result = fork.use(core_default$1); + if (result.BinaryOperators.indexOf("**") < 0) result.BinaryOperators.push("**"); + if (result.AssignmentOperators.indexOf("**=") < 0) result.AssignmentOperators.push("**="); + return result; +} +//#endregion +//#region vendor/ast-types/src/def/operators/es2020.ts +function es2020_default$1(fork) { + const result = fork.use(es2016_default$1); + if (result.LogicalOperators.indexOf("??") < 0) result.LogicalOperators.push("??"); + return result; +} +//#endregion +//#region vendor/ast-types/src/def/operators/es2021.ts +function es2021_default$1(fork) { + const result = fork.use(es2020_default$1); + result.LogicalOperators.forEach((op) => { + const assignOp = op + "="; + if (result.AssignmentOperators.indexOf(assignOp) < 0) result.AssignmentOperators.push(assignOp); + }); + return result; +} +//#endregion +//#region vendor/ast-types/src/def/core.ts +function core_default(fork) { + var Type = fork.use(typesPlugin).Type; + var def = Type.def; + var or = Type.or; + var shared = fork.use(shared_default); + var defaults = shared.defaults; + var geq = shared.geq; + const { BinaryOperators, AssignmentOperators, LogicalOperators } = fork.use(core_default$1); + def("Printable").field("loc", or(def("SourceLocation"), null), defaults["null"], true); + def("Node").bases("Printable").field("type", String).field("comments", or([def("Comment")], null), defaults["null"], true); + def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or(String, null), defaults["null"]); + def("Position").field("line", geq(1)).field("column", geq(0)); + def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or(String, null), defaults["null"]); + def("Program").bases("Node").build("body").field("body", [def("Statement")]); + def("Function").bases("Node").field("id", or(def("Identifier"), null), defaults["null"]).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("generator", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]); + def("Statement").bases("Node"); + def("EmptyStatement").bases("Statement").build(); + def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]); + def("ExpressionStatement").bases("Statement").build("expression").field("expression", def("Expression")); + def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or(def("Statement"), null), defaults["null"]); + def("LabeledStatement").bases("Statement").build("label", "body").field("label", def("Identifier")).field("body", def("Statement")); + def("BreakStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults["null"]); + def("ContinueStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults["null"]); + def("WithStatement").bases("Statement").build("object", "body").field("object", def("Expression")).field("body", def("Statement")); + def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean, defaults["false"]); + def("ReturnStatement").bases("Statement").build("argument").field("argument", or(def("Expression"), null)); + def("ThrowStatement").bases("Statement").build("argument").field("argument", def("Expression")); + def("TryStatement").bases("Statement").build("block", "handler", "finalizer").field("block", def("BlockStatement")).field("handler", or(def("CatchClause"), null), function() { + return this.handlers && this.handlers[0] || null; + }).field("handlers", [def("CatchClause")], function() { + return this.handler ? [this.handler] : []; + }, true).field("guardedHandlers", [def("CatchClause")], defaults.emptyArray).field("finalizer", or(def("BlockStatement"), null), defaults["null"]); + def("CatchClause").bases("Node").build("param", "guard", "body").field("param", def("Pattern")).field("guard", or(def("Expression"), null), defaults["null"]).field("body", def("BlockStatement")); + def("WhileStatement").bases("Statement").build("test", "body").field("test", def("Expression")).field("body", def("Statement")); + def("DoWhileStatement").bases("Statement").build("body", "test").field("body", def("Statement")).field("test", def("Expression")); + def("ForStatement").bases("Statement").build("init", "test", "update", "body").field("init", or(def("VariableDeclaration"), def("Expression"), null)).field("test", or(def("Expression"), null)).field("update", or(def("Expression"), null)).field("body", def("Statement")); + def("ForInStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement")); + def("DebuggerStatement").bases("Statement").build(); + def("Declaration").bases("Statement"); + def("FunctionDeclaration").bases("Function", "Declaration").build("id", "params", "body").field("id", def("Identifier")); + def("FunctionExpression").bases("Function", "Expression").build("id", "params", "body"); + def("VariableDeclaration").bases("Declaration").build("kind", "declarations").field("kind", or("var", "let", "const")).field("declarations", [def("VariableDeclarator")]); + def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or(def("Expression"), null), defaults["null"]); + def("Expression").bases("Node"); + def("ThisExpression").bases("Expression").build(); + def("ArrayExpression").bases("Expression").build("elements").field("elements", [or(def("Expression"), null)]); + def("ObjectExpression").bases("Expression").build("properties").field("properties", [def("Property")]); + def("Property").bases("Node").build("kind", "key", "value").field("kind", or("init", "get", "set")).field("key", or(def("Literal"), def("Identifier"))).field("value", def("Expression")); + def("SequenceExpression").bases("Expression").build("expressions").field("expressions", [def("Expression")]); + var UnaryOperator = or("-", "+", "!", "~", "typeof", "void", "delete"); + def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean, defaults["true"]); + const BinaryOperator = or(...BinaryOperators); + def("BinaryExpression").bases("Expression").build("operator", "left", "right").field("operator", BinaryOperator).field("left", def("Expression")).field("right", def("Expression")); + const AssignmentOperator = or(...AssignmentOperators); + def("AssignmentExpression").bases("Expression").build("operator", "left", "right").field("operator", AssignmentOperator).field("left", or(def("Pattern"), def("MemberExpression"))).field("right", def("Expression")); + var UpdateOperator = or("++", "--"); + def("UpdateExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UpdateOperator).field("argument", def("Expression")).field("prefix", Boolean); + var LogicalOperator = or(...LogicalOperators); + def("LogicalExpression").bases("Expression").build("operator", "left", "right").field("operator", LogicalOperator).field("left", def("Expression")).field("right", def("Expression")); + def("ConditionalExpression").bases("Expression").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Expression")).field("alternate", def("Expression")); + def("NewExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]); + def("CallExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]); + def("MemberExpression").bases("Expression").build("object", "property", "computed").field("object", def("Expression")).field("property", or(def("Identifier"), def("Expression"))).field("computed", Boolean, function() { + var type = this.property.type; + if (type === "Literal" || type === "MemberExpression" || type === "BinaryExpression") return true; + return false; + }); + def("Pattern").bases("Node"); + def("SwitchCase").bases("Node").build("test", "consequent").field("test", or(def("Expression"), null)).field("consequent", [def("Statement")]); + def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean, defaults["false"]); + def("Literal").bases("Expression").build("value").field("value", or(String, Boolean, null, Number, RegExp, BigInt)); + def("Comment").bases("Printable").field("value", String).field("leading", Boolean, defaults["true"]).field("trailing", Boolean, defaults["false"]); +} +//#endregion +//#region vendor/ast-types/src/def/es6.ts +function es6_default(fork) { + fork.use(core_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]); + def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field("typeAnnotation", or(def("TypeAnnotation"), def("TSTypeAnnotation"), null), defaults["null"]); + def("SpreadElementPattern").bases("Pattern").build("argument").field("argument", def("Pattern")); + def("FunctionDeclaration").build("id", "params", "body", "generator", "expression").field("id", or(def("Identifier"), null)); + def("FunctionExpression").build("id", "params", "body", "generator", "expression"); + def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null, defaults["null"]).field("body", or(def("BlockStatement"), def("Expression"))).field("generator", false, defaults["false"]); + def("ForOfStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Pattern"))).field("right", def("Expression")).field("body", def("Statement")); + def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or(def("Expression"), null)).field("delegate", Boolean, defaults["false"]); + def("GeneratorExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null)); + def("ComprehensionExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null)); + def("ComprehensionBlock").bases("Node").build("left", "right", "each").field("left", def("Pattern")).field("right", def("Expression")).field("each", Boolean); + def("Property").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("method", Boolean, defaults["false"]).field("shorthand", Boolean, defaults["false"]).field("computed", Boolean, defaults["false"]); + def("ObjectProperty").field("shorthand", Boolean, defaults["false"]); + def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean, defaults["false"]); + def("ObjectPattern").bases("Pattern").build("properties").field("properties", [or(def("PropertyPattern"), def("Property"))]); + def("ArrayPattern").bases("Pattern").build("elements").field("elements", [or(def("Pattern"), null)]); + def("SpreadElement").bases("Node").build("argument").field("argument", def("Expression")); + def("ArrayExpression").field("elements", [or(def("Expression"), def("SpreadElement"), def("RestElement"), null)]); + def("NewExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]); + def("CallExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]); + def("AssignmentPattern").bases("Pattern").build("left", "right").field("left", def("Pattern")).field("right", def("Expression")); + def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean, defaults["false"]).field("static", Boolean, defaults["false"]); + const ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("StaticBlock")); + def("ClassProperty").bases("Declaration").build("key").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean, defaults["false"]); + def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition", ClassBodyElement); + def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]); + def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults["null"]); + def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or(def("Identifier"), null), defaults["null"]).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults["null"]); + def("Super").bases("Expression").build(); + def("Specifier").bases("Node"); + def("ModuleSpecifier").bases("Specifier").field("local", or(def("Identifier"), null), defaults["null"]).field("id", or(def("Identifier"), null), defaults["null"]).field("name", or(def("Identifier"), null), defaults["null"]); + def("ImportSpecifier").bases("ModuleSpecifier").build("imported", "local").field("imported", def("Identifier")); + def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"); + def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"); + def("ImportDeclaration").bases("Declaration").build("specifiers", "source", "importKind").field("specifiers", [or(def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier"))], defaults.emptyArray).field("source", def("Literal")).field("importKind", or("value", "type"), function() { + return "value"; + }); + def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); + def("ExportSpecifier").bases("ModuleSpecifier").build("local", "exported").field("exported", def("Identifier")); + def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration", or(def("Declaration"), def("Expression"))); + def("ExportAllDeclaration").bases("Declaration").build("source").field("source", def("Literal")); + def("TaggedTemplateExpression").bases("Expression").build("tag", "quasi").field("tag", def("Expression")).field("quasi", def("TemplateLiteral")); + def("TemplateLiteral").bases("Expression").build("quasis", "expressions").field("quasis", [def("TemplateElement")]).field("expressions", [def("Expression")]); + def("TemplateElement").bases("Node").build("value", "tail").field("value", { + "cooked": String, + "raw": String + }).field("tail", Boolean); + def("MetaProperty").bases("Expression").build("meta", "property").field("meta", def("Identifier")).field("property", def("Identifier")); +} +//#endregion +//#region vendor/ast-types/src/def/es2016.ts +function es2016_default(fork) { + fork.use(es2016_default$1); + fork.use(es6_default); +} +//#endregion +//#region vendor/ast-types/src/def/es2017.ts +function es2017_default(fork) { + fork.use(es2016_default); + const def = fork.use(typesPlugin).Type.def; + const defaults = fork.use(shared_default).defaults; + def("Function").field("async", Boolean, defaults["false"]); + def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression")); +} +//#endregion +//#region vendor/ast-types/src/def/es2018.ts +function es2018_default(fork) { + fork.use(es2017_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("ForOfStatement").field("await", Boolean, defaults["false"]); + def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression")); + def("ObjectExpression").field("properties", [or(def("Property"), def("SpreadProperty"), def("SpreadElement"))]); + def("TemplateElement").field("value", { + "cooked": or(String, null), + "raw": String + }); + def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument", def("Pattern")); + def("ObjectPattern").field("properties", [or(def("PropertyPattern"), def("Property"), def("RestElement"), def("SpreadPropertyPattern"))]); +} +//#endregion +//#region vendor/ast-types/src/def/es2019.ts +function es2019_default(fork) { + fork.use(es2018_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]); +} +//#endregion +//#region vendor/ast-types/src/def/es2020.ts +function es2020_default(fork) { + fork.use(es2020_default$1); + fork.use(es2019_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("ImportExpression").bases("Expression").build("source").field("source", def("Expression")); + def("ExportAllDeclaration").bases("Declaration").build("source", "exported").field("source", def("Literal")).field("exported", or(def("Identifier"), null, void 0), defaults["null"]); + def("ChainElement").bases("Node").field("optional", Boolean, defaults["false"]); + def("CallExpression").bases("Expression", "ChainElement"); + def("MemberExpression").bases("Expression", "ChainElement"); + def("ChainExpression").bases("Expression").build("expression").field("expression", def("ChainElement")); + def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean, defaults["true"]); + def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean, defaults["true"]); +} +//#endregion +//#region vendor/ast-types/src/def/es2021.ts +function es2021_default(fork) { + fork.use(es2021_default$1); + fork.use(es2020_default); +} +//#endregion +//#region vendor/ast-types/src/def/es2022.ts +function es2022_default(fork) { + fork.use(es2021_default); + const def = fork.use(typesPlugin).Type.def; + def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]); +} +//#endregion +//#region vendor/ast-types/src/def/es-proposals.ts +function es_proposals_default(fork) { + fork.use(es2022_default); + const types = fork.use(typesPlugin); + const Type = types.Type; + const def = types.Type.def; + const or = Type.or; + const defaults = fork.use(shared_default).defaults; + def("AwaitExpression").build("argument", "all").field("argument", or(def("Expression"), null)).field("all", Boolean, defaults["false"]); + def("Decorator").bases("Node").build("expression").field("expression", def("Expression")); + def("Property").field("decorators", or([def("Decorator")], null), defaults["null"]); + def("MethodDefinition").field("decorators", or([def("Decorator")], null), defaults["null"]); + def("PrivateName").bases("Expression", "Pattern").build("id").field("id", def("Identifier")); + def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or(def("Expression"), null), defaults["null"]); + def("ImportAttribute").bases("Node").build("key", "value").field("key", or(def("Identifier"), def("Literal"))).field("value", def("Expression")); + [ + "ImportDeclaration", + "ExportAllDeclaration", + "ExportNamedDeclaration" + ].forEach((decl) => { + def(decl).field("assertions", [def("ImportAttribute")], defaults.emptyArray); + }); + def("RecordExpression").bases("Expression").build("properties").field("properties", [or(def("ObjectProperty"), def("ObjectMethod"), def("SpreadElement"))]); + def("TupleExpression").bases("Expression").build("elements").field("elements", [or(def("Expression"), def("SpreadElement"), null)]); + def("ModuleExpression").bases("Node").build("body").field("body", def("Program")); +} +//#endregion +//#region vendor/ast-types/src/def/jsx.ts +function jsx_default(fork) { + fork.use(es_proposals_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(def("Literal"), def("JSXExpressionContainer"), def("JSXElement"), def("JSXFragment"), null), defaults["null"]); + def("JSXIdentifier").bases("Identifier").build("name").field("name", String); + def("JSXNamespacedName").bases("Node").build("namespace", "name").field("namespace", def("JSXIdentifier")).field("name", def("JSXIdentifier")); + def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean, defaults.false); + const JSXElementName = or(def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression")); + def("JSXSpreadAttribute").bases("Node").build("argument").field("argument", def("Expression")); + const JSXAttributes = [or(def("JSXAttribute"), def("JSXSpreadAttribute"))]; + def("JSXExpressionContainer").bases("Expression").build("expression").field("expression", or(def("Expression"), def("JSXEmptyExpression"))); + const JSXChildren = [or(def("JSXText"), def("JSXExpressionContainer"), def("JSXSpreadChild"), def("JSXElement"), def("JSXFragment"), def("Literal"))]; + def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or(def("JSXClosingElement"), null), defaults["null"]).field("children", JSXChildren, defaults.emptyArray).field("name", JSXElementName, function() { + return this.openingElement.name; + }, true).field("selfClosing", Boolean, function() { + return this.openingElement.selfClosing; + }, true).field("attributes", JSXAttributes, function() { + return this.openingElement.attributes; + }, true); + def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes, defaults.emptyArray).field("selfClosing", Boolean, defaults["false"]); + def("JSXClosingElement").bases("Node").build("name").field("name", JSXElementName); + def("JSXFragment").bases("Expression").build("openingFragment", "closingFragment", "children").field("openingFragment", def("JSXOpeningFragment")).field("closingFragment", def("JSXClosingFragment")).field("children", JSXChildren, defaults.emptyArray); + def("JSXOpeningFragment").bases("Node").build(); + def("JSXClosingFragment").bases("Node").build(); + def("JSXText").bases("Literal").build("value", "raw").field("value", String).field("raw", String, function() { + return this.value; + }); + def("JSXEmptyExpression").bases("Node").build(); + def("JSXSpreadChild").bases("Node").build("expression").field("expression", def("Expression")); +} +//#endregion +//#region vendor/ast-types/src/def/type-annotations.ts +function type_annotations_default(fork) { + var types = fork.use(typesPlugin); + var def = types.Type.def; + var or = types.Type.or; + var defaults = fork.use(shared_default).defaults; + var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null); + var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null); + def("Identifier").field("typeAnnotation", TypeAnnotation, defaults["null"]); + def("ObjectPattern").field("typeAnnotation", TypeAnnotation, defaults["null"]); + def("Function").field("returnType", TypeAnnotation, defaults["null"]).field("typeParameters", TypeParamDecl, defaults["null"]); + def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or(def("Expression"), null)).field("static", Boolean, defaults["false"]).field("typeAnnotation", TypeAnnotation, defaults["null"]); + ["ClassDeclaration", "ClassExpression"].forEach((typeName) => { + def(typeName).field("typeParameters", TypeParamDecl, defaults["null"]).field("superTypeParameters", or(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults["null"]).field("implements", or([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults.emptyArray); + }); +} +//#endregion +//#region vendor/ast-types/src/def/flow.ts +function flow_default(fork) { + fork.use(es_proposals_default); + fork.use(type_annotations_default); + const types = fork.use(typesPlugin); + const def = types.Type.def; + const or = types.Type.or; + const defaults = fork.use(shared_default).defaults; + def("Flow").bases("Node"); + def("FlowType").bases("Flow"); + def("AnyTypeAnnotation").bases("FlowType").build(); + def("EmptyTypeAnnotation").bases("FlowType").build(); + def("MixedTypeAnnotation").bases("FlowType").build(); + def("VoidTypeAnnotation").bases("FlowType").build(); + def("SymbolTypeAnnotation").bases("FlowType").build(); + def("NumberTypeAnnotation").bases("FlowType").build(); + def("BigIntTypeAnnotation").bases("FlowType").build(); + def("NumberLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String); + def("NumericLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String); + def("BigIntLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", null).field("raw", String); + def("StringTypeAnnotation").bases("FlowType").build(); + def("StringLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", String).field("raw", String); + def("BooleanTypeAnnotation").bases("FlowType").build(); + def("BooleanLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Boolean).field("raw", String); + def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", def("FlowType")); + def("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation", def("FlowType")); + def("NullLiteralTypeAnnotation").bases("FlowType").build(); + def("NullTypeAnnotation").bases("FlowType").build(); + def("ThisTypeAnnotation").bases("FlowType").build(); + def("ExistsTypeAnnotation").bases("FlowType").build(); + def("ExistentialTypeParam").bases("FlowType").build(); + def("FunctionTypeAnnotation").bases("FlowType").build("params", "returnType", "rest", "typeParameters").field("params", [def("FunctionTypeParam")]).field("returnType", def("FlowType")).field("rest", or(def("FunctionTypeParam"), null)).field("typeParameters", or(def("TypeParameterDeclaration"), null)); + def("FunctionTypeParam").bases("Node").build("name", "typeAnnotation", "optional").field("name", or(def("Identifier"), null)).field("typeAnnotation", def("FlowType")).field("optional", Boolean); + def("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType", def("FlowType")); + def("ObjectTypeAnnotation").bases("FlowType").build("properties", "indexers", "callProperties").field("properties", [or(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty"))]).field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray).field("callProperties", [def("ObjectTypeCallProperty")], defaults.emptyArray).field("inexact", or(Boolean, void 0), defaults["undefined"]).field("exact", Boolean, defaults["false"]).field("internalSlots", [def("ObjectTypeInternalSlot")], defaults.emptyArray); + def("Variance").bases("Node").build("kind").field("kind", or("plus", "minus")); + const LegacyVariance = or(def("Variance"), "plus", "minus", null); + def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance, defaults["null"]); + def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance, defaults["null"]).field("static", Boolean, defaults["false"]); + def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean, defaults["false"]); + def("QualifiedTypeIdentifier").bases("Node").build("qualification", "id").field("qualification", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("id", def("Identifier")); + def("GenericTypeAnnotation").bases("FlowType").build("id", "typeParameters").field("id", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("typeParameters", or(def("TypeParameterInstantiation"), null)); + def("MemberTypeAnnotation").bases("FlowType").build("object", "property").field("object", def("Identifier")).field("property", or(def("MemberTypeAnnotation"), def("GenericTypeAnnotation"))); + def("IndexedAccessType").bases("FlowType").build("objectType", "indexType").field("objectType", def("FlowType")).field("indexType", def("FlowType")); + def("OptionalIndexedAccessType").bases("FlowType").build("objectType", "indexType", "optional").field("objectType", def("FlowType")).field("indexType", def("FlowType")).field("optional", Boolean); + def("UnionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); + def("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); + def("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument", def("FlowType")); + def("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument", def("FlowType")); + def("ObjectTypeInternalSlot").bases("Node").build("id", "value", "optional", "static", "method").field("id", def("Identifier")).field("value", def("FlowType")).field("optional", Boolean).field("static", Boolean).field("method", Boolean); + def("TypeParameterDeclaration").bases("Node").build("params").field("params", [def("TypeParameter")]); + def("TypeParameterInstantiation").bases("Node").build("params").field("params", [def("FlowType")]); + def("TypeParameter").bases("FlowType").build("name", "variance", "bound", "default").field("name", String).field("variance", LegacyVariance, defaults["null"]).field("bound", or(def("TypeAnnotation"), null), defaults["null"]).field("default", or(def("FlowType"), null), defaults["null"]); + def("ClassProperty").field("variance", LegacyVariance, defaults["null"]); + def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or(def("Expression"), null), defaults["null"]).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); + def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or([def("InterfaceExtends")], null), defaults["null"]); + def("InterfaceDeclaration").bases("Declaration").build("id", "body", "extends").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null), defaults["null"]).field("body", def("ObjectTypeAnnotation")).field("extends", [def("InterfaceExtends")]); + def("DeclareInterface").bases("InterfaceDeclaration").build("id", "body", "extends"); + def("InterfaceExtends").bases("Node").build("id").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); + def("TypeAlias").bases("Declaration").build("id", "typeParameters", "right").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("right", def("FlowType")); + def("DeclareTypeAlias").bases("TypeAlias").build("id", "typeParameters", "right"); + def("OpaqueType").bases("Declaration").build("id", "typeParameters", "impltype", "supertype").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("impltype", def("FlowType")).field("supertype", or(def("FlowType"), null)); + def("DeclareOpaqueType").bases("OpaqueType").build("id", "typeParameters", "supertype").field("impltype", or(def("FlowType"), null)); + def("TypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TypeAnnotation")); + def("TupleTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); + def("DeclareVariable").bases("Statement").build("id").field("id", def("Identifier")); + def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier")).field("predicate", or(def("FlowPredicate"), null), defaults["null"]); + def("DeclareClass").bases("InterfaceDeclaration").build("id"); + def("DeclareModule").bases("Statement").build("id", "body").field("id", or(def("Identifier"), def("Literal"))).field("body", def("BlockStatement")); + def("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation", def("TypeAnnotation")); + def("DeclareExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or(def("DeclareVariable"), def("DeclareFunction"), def("DeclareClass"), def("FlowType"), def("TypeAlias"), def("DeclareOpaqueType"), def("InterfaceDeclaration"), null)).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); + def("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source", or(def("Literal"), null), defaults["null"]); + def("ImportDeclaration").field("importKind", or("value", "type", "typeof"), () => "value"); + def("FlowPredicate").bases("Flow"); + def("InferredPredicate").bases("FlowPredicate").build(); + def("DeclaredPredicate").bases("FlowPredicate").build("value").field("value", def("Expression")); + def("Function").field("predicate", or(def("FlowPredicate"), null), defaults["null"]); + def("CallExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]); + def("NewExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]); + def("EnumDeclaration").bases("Declaration").build("id", "body").field("id", def("Identifier")).field("body", or(def("EnumBooleanBody"), def("EnumNumberBody"), def("EnumStringBody"), def("EnumSymbolBody"))); + def("EnumBooleanBody").build("members", "explicitType").field("members", [def("EnumBooleanMember")]).field("explicitType", Boolean); + def("EnumNumberBody").build("members", "explicitType").field("members", [def("EnumNumberMember")]).field("explicitType", Boolean); + def("EnumStringBody").build("members", "explicitType").field("members", or([def("EnumStringMember")], [def("EnumDefaultedMember")])).field("explicitType", Boolean); + def("EnumSymbolBody").build("members").field("members", [def("EnumDefaultedMember")]); + def("EnumBooleanMember").build("id", "init").field("id", def("Identifier")).field("init", or(def("Literal"), Boolean)); + def("EnumNumberMember").build("id", "init").field("id", def("Identifier")).field("init", def("Literal")); + def("EnumStringMember").build("id", "init").field("id", def("Identifier")).field("init", def("Literal")); + def("EnumDefaultedMember").build("id").field("id", def("Identifier")); +} +//#endregion +//#region vendor/ast-types/src/def/esprima.ts +function esprima_default(fork) { + fork.use(es_proposals_default); + var types = fork.use(typesPlugin); + var defaults = fork.use(shared_default).defaults; + var def = types.Type.def; + var or = types.Type.or; + def("VariableDeclaration").field("declarations", [or(def("VariableDeclarator"), def("Identifier"))]); + def("Property").field("value", or(def("Expression"), def("Pattern"))); + def("ArrayPattern").field("elements", [or(def("Pattern"), def("SpreadElement"), null)]); + def("ObjectPattern").field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"))]); + def("ExportSpecifier").bases("ModuleSpecifier").build("id", "name"); + def("ExportBatchSpecifier").bases("Specifier").build(); + def("ExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or(def("Declaration"), def("Expression"), null)).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); + def("Block").bases("Comment").build("value", "leading", "trailing"); + def("Line").bases("Comment").build("value", "leading", "trailing"); +} +//#endregion +//#region vendor/ast-types/src/def/babel-core.ts +function babel_core_default(fork) { + fork.use(es_proposals_default); + const types = fork.use(typesPlugin); + const defaults = fork.use(shared_default).defaults; + const def = types.Type.def; + const or = types.Type.or; + const { undefined: isUndefined } = types.builtInTypes; + def("Noop").bases("Statement").build(); + def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]); + def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression")); + def("ParenthesizedExpression").bases("Expression").build("expression").field("expression", def("Expression")); + def("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier")); + def("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier")); + def("CommentBlock").bases("Comment").build("value", "leading", "trailing"); + def("CommentLine").bases("Comment").build("value", "leading", "trailing"); + def("Directive").bases("Node").build("value").field("value", def("DirectiveLiteral")); + def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String, defaults["use strict"]); + def("InterpreterDirective").bases("Node").build("value").field("value", String); + def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults.emptyArray); + def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults.emptyArray).field("interpreter", or(def("InterpreterDirective"), null), defaults["null"]); + function makeLiteralExtra(rawValueType = String, toRaw) { + return [ + "extra", + { + rawValue: rawValueType, + raw: String + }, + function getDefault() { + const value = types.getFieldValue(this, "value"); + return { + rawValue: value, + raw: toRaw ? toRaw(value) : String(value) + }; + } + ]; + } + def("StringLiteral").bases("Literal").build("value").field("value", String).field(...makeLiteralExtra(String, (val) => JSON.stringify(val))); + def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or(String, null), defaults["null"]).field(...makeLiteralExtra(Number)); + def("BigIntLiteral").bases("Literal").build("value").field("value", or(String, Number)).field(...makeLiteralExtra(String, (val) => val + "n")); + def("DecimalLiteral").bases("Literal").build("value").field("value", String).field(...makeLiteralExtra(String, (val) => val + "m")); + def("NullLiteral").bases("Literal").build().field("value", null, defaults["null"]); + def("BooleanLiteral").bases("Literal").build("value").field("value", Boolean); + def("RegExpLiteral").bases("Literal").build("pattern", "flags").field("pattern", String).field("flags", String).field("value", RegExp, function() { + return new RegExp(this.pattern, this.flags); + }).field(...makeLiteralExtra(or(RegExp, isUndefined), (exp) => `/${exp.pattern}/${exp.flags || ""}`)).field("regex", { + pattern: String, + flags: String + }, function() { + return { + pattern: this.pattern, + flags: this.flags + }; + }); + var ObjectExpressionProperty = or(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement")); + def("ObjectExpression").bases("Expression").build("properties").field("properties", [ObjectExpressionProperty]); + def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or("method", "get", "set")).field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]).field("accessibility", or(def("Literal"), null), defaults["null"]).field("decorators", or([def("Decorator")], null), defaults["null"]); + def("ObjectProperty").bases("Node").build("key", "value").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("accessibility", or(def("Literal"), null), defaults["null"]).field("computed", Boolean, defaults["false"]); + var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("ClassAccessorProperty"), def("StaticBlock")); + def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]); + def("ClassMethod").bases("Declaration", "Function").build("kind", "key", "params", "body", "computed", "static").field("key", or(def("Literal"), def("Identifier"), def("Expression"))); + def("ClassPrivateMethod").bases("Declaration", "Function").build("key", "params", "body", "kind", "computed", "static").field("key", def("PrivateName")); + def("ClassAccessorProperty").bases("Declaration").build("key", "value", "decorators", "computed", "static").field("key", or(def("Literal"), def("Identifier"), def("PrivateName"), def("Expression"))).field("value", or(def("Expression"), null), defaults["null"]); + ["ClassMethod", "ClassPrivateMethod"].forEach((typeName) => { + def(typeName).field("kind", or("get", "set", "method", "constructor"), () => "method").field("body", def("BlockStatement")).field("access", or("public", "private", "protected", null), defaults["null"]); + }); + [ + "ClassMethod", + "ClassPrivateMethod", + "ClassAccessorProperty" + ].forEach((typeName) => { + def(typeName).field("computed", Boolean, defaults["false"]).field("static", Boolean, defaults["false"]).field("abstract", Boolean, defaults["false"]).field("accessibility", or("public", "private", "protected", null), defaults["null"]).field("decorators", or([def("Decorator")], null), defaults["null"]).field("definite", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("override", Boolean, defaults["false"]).field("readonly", Boolean, defaults["false"]); + }); + var ObjectPatternProperty = or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"), def("ObjectProperty"), def("RestProperty"), def("RestElement")); + def("ObjectPattern").bases("Pattern").build("properties").field("properties", [ObjectPatternProperty]).field("decorators", or([def("Decorator")], null), defaults["null"]); + def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression")); + def("RestProperty").bases("Node").build("argument").field("argument", def("Expression")); + def("ForAwaitStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement")); + def("Import").bases("Expression").build(); +} +//#endregion +//#region vendor/ast-types/src/def/babel.ts +function babel_default(fork) { + const def = fork.use(typesPlugin).Type.def; + fork.use(babel_core_default); + fork.use(flow_default); + def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String); + def("TopicReference").bases("Expression").build(); +} +//#endregion +//#region vendor/ast-types/src/def/typescript.ts +function typescript_default(fork) { + fork.use(babel_core_default); + fork.use(type_annotations_default); + var types = fork.use(typesPlugin); + var n = types.namedTypes; + var def = types.Type.def; + var or = types.Type.or; + var defaults = fork.use(shared_default).defaults; + var StringLiteral = types.Type.from(function(value, deep) { + if (n.StringLiteral && n.StringLiteral.check(value, deep)) return true; + if (n.Literal && n.Literal.check(value, deep) && typeof value.value === "string") return true; + return false; + }, "StringLiteral"); + def("TSType").bases("Node"); + var TSEntityName = or(def("Identifier"), def("TSQualifiedName")); + def("TSTypeReference").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("typeName", "typeParameters").field("typeName", TSEntityName); + def("TSHasOptionalTypeParameterInstantiation").field("typeParameters", or(def("TSTypeParameterInstantiation"), null), defaults["null"]); + def("TSHasOptionalTypeParameters").field("typeParameters", or(def("TSTypeParameterDeclaration"), null, void 0), defaults["null"]); + def("TSHasOptionalTypeAnnotation").field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]); + def("TSQualifiedName").bases("Node").build("left", "right").field("left", TSEntityName).field("right", TSEntityName); + def("TSAsExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")).field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); + def("TSTypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")); + def("TSSatisfiesExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")); + def("TSNonNullExpression").bases("Expression", "Pattern").build("expression").field("expression", def("Expression")); + [ + "TSAnyKeyword", + "TSBigIntKeyword", + "TSBooleanKeyword", + "TSNeverKeyword", + "TSNullKeyword", + "TSNumberKeyword", + "TSObjectKeyword", + "TSStringKeyword", + "TSSymbolKeyword", + "TSUndefinedKeyword", + "TSUnknownKeyword", + "TSVoidKeyword", + "TSIntrinsicKeyword", + "TSThisType" + ].forEach((keywordType) => { + def(keywordType).bases("TSType").build(); + }); + def("TSArrayType").bases("TSType").build("elementType").field("elementType", def("TSType")); + def("TSLiteralType").bases("TSType").build("literal").field("literal", or(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression"), def("BigIntLiteral"))); + def("TemplateLiteral").field("expressions", or([def("Expression")], [def("TSType")])); + ["TSUnionType", "TSIntersectionType"].forEach((typeName) => { + def(typeName).bases("TSType").build("types").field("types", [def("TSType")]); + }); + def("TSConditionalType").bases("TSType").build("checkType", "extendsType", "trueType", "falseType").field("checkType", def("TSType")).field("extendsType", def("TSType")).field("trueType", def("TSType")).field("falseType", def("TSType")); + def("TSInferType").bases("TSType").build("typeParameter").field("typeParameter", def("TSTypeParameter")); + def("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); + var ParametersType = [or(def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern"))]; + ["TSFunctionType", "TSConstructorType"].forEach((typeName) => { + def(typeName).bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters").field("parameters", ParametersType); + }); + def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("id", or(def("Identifier"), null), defaults["null"]).field("params", [def("Pattern")]).field("returnType", or(def("TSTypeAnnotation"), def("Noop"), null), defaults["null"]); + def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("params", [def("Pattern")]).field("abstract", Boolean, defaults["false"]).field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]).field("static", Boolean, defaults["false"]).field("computed", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("key", or(def("Identifier"), def("StringLiteral"), def("NumericLiteral"), def("Expression"))).field("kind", or("get", "set", "method", "constructor"), function getDefault() { + return "method"; + }).field("access", or("public", "private", "protected", void 0), defaults["undefined"]).field("decorators", or([def("Decorator")], null), defaults["null"]).field("returnType", or(def("TSTypeAnnotation"), def("Noop"), null), defaults["null"]); + def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or(Boolean, "+", "-"), defaults["false"]).field("typeParameter", def("TSTypeParameter")).field("optional", or(Boolean, "+", "-"), defaults["false"]).field("typeAnnotation", or(def("TSType"), null), defaults["null"]); + def("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes", [or(def("TSType"), def("TSNamedTupleMember"))]); + def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean, defaults["false"]).field("elementType", def("TSType")); + def("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); + def("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); + def("TSIndexedAccessType").bases("TSType").build("objectType", "indexType").field("objectType", def("TSType")).field("indexType", def("TSType")); + def("TSTypeOperator").bases("TSType").build("operator").field("operator", String).field("typeAnnotation", def("TSType")); + def("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", or(def("TSType"), def("TSTypeAnnotation"))); + def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean, defaults["false"]); + def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean, defaults["false"]).field("readonly", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("initializer", or(def("Expression"), null), defaults["null"]); + def("TSMethodSignature").bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("parameters", ParametersType); + def("TSTypePredicate").bases("TSTypeAnnotation", "TSType").build("parameterName", "typeAnnotation", "asserts").field("parameterName", or(def("Identifier"), def("TSThisType"))).field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]).field("asserts", Boolean, defaults["false"]); + ["TSCallSignatureDeclaration", "TSConstructSignatureDeclaration"].forEach((typeName) => { + def(typeName).bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", ParametersType); + }); + def("TSEnumMember").bases("Node").build("id", "initializer").field("id", or(def("Identifier"), StringLiteral)).field("initializer", or(def("Expression"), null), defaults["null"]); + def("TSTypeQuery").bases("TSType").build("exprName").field("exprName", or(TSEntityName, def("TSImportType"))); + var TSTypeMember = or(def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature")); + def("TSTypeLiteral").bases("TSType").build("members").field("members", [TSTypeMember]); + def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", or(def("Identifier"), String)).field("constraint", or(def("TSType"), void 0), defaults["undefined"]).field("default", or(def("TSType"), void 0), defaults["undefined"]); + def("TSTypeAssertion").bases("Expression", "Pattern").build("typeAnnotation", "expression").field("typeAnnotation", def("TSType")).field("expression", def("Expression")).field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); + def("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params", [def("TSTypeParameter")]); + def("TSInstantiationExpression").bases("Expression", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", def("Expression")); + def("TSTypeParameterInstantiation").bases("Node").build("params").field("params", [def("TSType")]); + def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean, defaults["false"]).field("declare", Boolean, defaults["false"]).field("members", [def("TSEnumMember")]).field("initializer", or(def("Expression"), null), defaults["null"]); + def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean, defaults["false"]).field("typeAnnotation", def("TSType")); + def("TSModuleBlock").bases("Node").build("body").field("body", [def("Statement")]); + def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or(StringLiteral, TSEntityName)).field("declare", Boolean, defaults["false"]).field("global", Boolean, defaults["false"]).field("body", or(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults["null"]); + def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or(TSEntityName, void 0), defaults["undefined"]); + def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean, defaults["false"]).field("moduleReference", or(TSEntityName, def("TSExternalModuleReference"))); + def("TSExternalModuleReference").bases("Declaration").build("expression").field("expression", StringLiteral); + def("TSExportAssignment").bases("Statement").build("expression").field("expression", def("Expression")); + def("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id", def("Identifier")); + def("TSInterfaceBody").bases("Node").build("body").field("body", [TSTypeMember]); + def("TSExpressionWithTypeArguments").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", TSEntityName); + def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean, defaults["false"]).field("extends", or([def("TSExpressionWithTypeArguments")], null), defaults["null"]).field("body", def("TSInterfaceBody")); + def("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]).field("readonly", Boolean, defaults["false"]).field("parameter", or(def("Identifier"), def("AssignmentPattern"))); + def("ClassProperty").field("access", or("public", "private", "protected", void 0), defaults["undefined"]); + def("ClassAccessorProperty").bases("Declaration", "TSHasOptionalTypeAnnotation"); + def("ClassBody").field("body", [or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassAccessorProperty"), def("ClassMethod"), def("ClassPrivateMethod"), def("StaticBlock"), def("TSDeclareMethod"), TSTypeMember)]); +} +//#endregion +//#region vendor/ast-types/src/gen/namedTypes.ts +let namedTypes$1; +(function(_namedTypes) {})(namedTypes$1 || (namedTypes$1 = {})); +//#endregion +//#region vendor/ast-types/src/main.ts +const { astNodesAreEquivalent, builders: builders$1, builtInTypes, defineMethod, eachField, finalize, getBuilderName, getFieldNames, getFieldValue, getSupertypeNames, namedTypes: n$3, NodePath, Path, PathVisitor, someField, Type, use, visit } = fork_default([ + es_proposals_default, + jsx_default, + flow_default, + esprima_default, + babel_default, + typescript_default +]); +Object.assign(namedTypes$1, n$3); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js +var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => { + var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function(number) { + if (0 <= number && number < intToCharMap.length) return intToCharMap[number]; + throw new TypeError("Must be between 0 and 63: " + number); + }; + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function(charCode) { + var bigA = 65; + var bigZ = 90; + var littleA = 97; + var littleZ = 122; + var zero = 48; + var nine = 57; + var plus = 43; + var slash = 47; + var littleOffset = 26; + var numberOffset = 52; + if (bigA <= charCode && charCode <= bigZ) return charCode - bigA; + if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset; + if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset; + if (charCode == plus) return 62; + if (charCode == slash) return 63; + return -1; + }; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js +var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => { + var base64 = require_base64(); + var VLQ_BASE_SHIFT = 5; + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + var VLQ_BASE_MASK = VLQ_BASE - 1; + var VLQ_CONTINUATION_BIT = VLQ_BASE; + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; + } + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative ? -shifted : shifted; + } + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + var vlq = toVLQSigned(aValue); + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) digit |= VLQ_CONTINUATION_BIT; + encoded += base64.encode(digit); + } while (vlq > 0); + return encoded; + }; + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + do { + if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value."); + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js +var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) return aArgs[aName]; + else if (arguments.length === 3) return aDefaultValue; + else throw new Error("\"" + aName + "\" is a required argument."); + } + exports.getArg = getArg; + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) return null; + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + function urlGenerate(aParsedUrl) { + var url = ""; + if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":"; + url += "//"; + if (aParsedUrl.auth) url += aParsedUrl.auth + "@"; + if (aParsedUrl.host) url += aParsedUrl.host; + if (aParsedUrl.port) url += ":" + aParsedUrl.port; + if (aParsedUrl.path) url += aParsedUrl.path; + return url; + } + exports.urlGenerate = urlGenerate; + var MAX_CACHED_INPUTS = 32; + /** + * Takes some function `f(input) -> result` and returns a memoized version of + * `f`. + * + * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The + * memoization is a dumb-simple, linear least-recently-used cache. + */ + function lruMemoize(f) { + var cache = []; + return function(input) { + for (var i = 0; i < cache.length; i++) if (cache[i].input === input) { + var temp = cache[0]; + cache[0] = cache[i]; + cache[i] = temp; + return cache[0].result; + } + var result = f(input); + cache.unshift({ + input, + result + }); + if (cache.length > MAX_CACHED_INPUTS) cache.pop(); + return result; + }; + } + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + var normalize = lruMemoize(function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) return aPath; + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + var parts = []; + var start = 0; + var i = 0; + while (true) { + start = i; + i = path.indexOf("/", start); + if (i === -1) { + parts.push(path.slice(start)); + break; + } else { + parts.push(path.slice(start, i)); + while (i < path.length && path[i] === "/") i++; + } + } + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === ".") parts.splice(i, 1); + else if (part === "..") up++; + else if (up > 0) if (part === "") { + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + path = parts.join("/"); + if (path === "") path = isAbsolute ? "/" : "."; + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + }); + exports.normalize = normalize; + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") aRoot = "."; + if (aPath === "") aPath = "."; + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) aRoot = aRootUrl.path || "/"; + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme; + return urlGenerate(aPathUrl); + } + if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath; + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath); + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + exports.isAbsolute = function(aPath) { + return aPath.charAt(0) === "/" || urlRegexp.test(aPath); + }; + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") aRoot = "."; + aRoot = aRoot.replace(/\/$/, ""); + var level = 0; + while (aPath.indexOf(aRoot + "/") !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) return aPath; + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath; + ++level; + } + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + var supportsNullProto = function() { + return !("__proto__" in Object.create(null)); + }(); + function identity(s) { + return s; + } + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) return "$" + aStr; + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + function fromSetString(aStr) { + if (isProtoString(aStr)) return aStr.slice(1); + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + function isProtoString(s) { + if (!s) return false; + var length = s.length; + if (length < 9) return false; + if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) return false; + for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false; + return true; + } + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) return cmp; + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) return cmp; + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) return cmp; + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) return cmp; + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) return cmp; + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) return cmp; + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) return cmp; + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) return cmp; + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) return cmp; + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) return cmp; + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) return cmp; + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) return cmp; + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) return cmp; + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) return cmp; + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) return cmp; + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) return cmp; + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) return cmp; + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) return cmp; + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) return 0; + if (aStr1 === null) return 1; + if (aStr2 === null) return -1; + if (aStr1 > aStr2) return 1; + return -1; + } + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) return cmp; + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) return cmp; + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) return cmp; + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) return cmp; + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) return cmp; + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); + } + exports.parseSourceMapInput = parseSourceMapInput; + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ""; + if (sourceRoot) { + if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/"; + sourceURL = sourceRoot + sourceURL; + } + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) throw new Error("sourceMapURL could not be parsed"); + if (parsed.path) { + var index = parsed.path.lastIndexOf("/"); + if (index >= 0) parsed.path = parsed.path.substring(0, index + 1); + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js +var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => { + var util = require_util(); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null); + } + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates); + return set; + }; + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) this._array.push(aStr); + if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx); + else this._set[sStr] = idx; + }; + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) return this._set.has(aStr); + else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) return idx; + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) return this._set[sStr]; + } + throw new Error("\"" + aStr + "\" is not in the set."); + }; + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx]; + throw new Error("No element indexed by " + aIdx); + }; + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + exports.ArraySet = ArraySet; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js +var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => { + var util = require_util(); + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + this._last = { + generatedLine: -1, + generatedColumn: 0 + }; + } + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + exports.MappingList = MappingList; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js +var require_source_map_generator = /* @__PURE__ */ __commonJSMin(((exports) => { + var base64VLQ = require_base64_vlq(); + var util = require_util(); + var ArraySet = require_array_set().ArraySet; + var MappingList = require_mapping_list().MappingList; + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) aArgs = {}; + this._file = util.getArg(aArgs, "file", null); + this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); + this._skipValidation = util.getArg(aArgs, "skipValidation", false); + this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + SourceMapGenerator.prototype._version = 3; + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { + file: aSourceMapConsumer.file, + sourceRoot + })); + aSourceMapConsumer.eachMapping(function(mapping) { + var newMapping = { generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } }; + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) newMapping.source = util.relative(sourceRoot, newMapping.source); + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + if (mapping.name != null) newMapping.name = mapping.name; + } + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function(sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) sourceRelative = util.relative(sourceRoot, sourceFile); + if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative); + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) generator.setSourceContent(sourceFile, content); + }); + return generator; + }; + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, "generated"); + var original = util.getArg(aArgs, "original", null); + var source = util.getArg(aArgs, "source", null); + var name = util.getArg(aArgs, "name", null); + if (!this._skipValidation) { + if (this._validateMapping(generated, original, source, name) === false) return; + } + if (source != null) { + source = String(source); + if (!this._sources.has(source)) this._sources.add(source); + } + if (name != null) { + name = String(name); + if (!this._names.has(name)) this._names.add(name); + } + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source, + name + }); + }; + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) source = util.relative(this._sourceRoot, source); + if (aSourceContent != null) { + if (!this._sourcesContents) this._sourcesContents = Object.create(null); + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null; + } + }; + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted."); + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile); + var newSources = new ArraySet(); + var newNames = new ArraySet(); + this._mappings.unsortedForEach(function(mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + mapping.source = original.source; + if (aSourceMapPath != null) mapping.source = util.join(aSourceMapPath, mapping.source); + if (sourceRoot != null) mapping.source = util.relative(sourceRoot, mapping.source); + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) mapping.name = original.name; + } + } + var source = mapping.source; + if (source != null && !newSources.has(source)) newSources.add(source); + var name = mapping.name; + if (name != null && !newNames.has(name)) newNames.add(name); + }, this); + this._sources = newSources; + this._names = newNames; + aSourceMapConsumer.sources.forEach(function(sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) sourceFile = util.join(aSourceMapPath, sourceFile); + if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile); + this.setSourceContent(sourceFile, content); + } + }, this); + }; + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { + if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { + var message = "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."; + if (this._ignoreInvalidMapping) { + if (typeof console !== "undefined" && console.warn) console.warn(message); + return false; + } else throw new Error(message); + } + if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return; + else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return; + else { + var message = "Invalid mapping: " + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + }); + if (this._ignoreInvalidMapping) { + if (typeof console !== "undefined" && console.warn) console.warn(message); + return false; + } else throw new Error(message); + } + }; + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ""; + var next; + var mapping; + var nameIdx; + var sourceIdx; + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = ""; + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ";"; + previousGeneratedLine++; + } + } else if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue; + next += ","; + } + next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + result += next; + } + return result; + }; + SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function(source) { + if (!this._sourcesContents) return null; + if (aSourceRoot != null) source = util.relative(aSourceRoot, source); + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; + }, this); + }; + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) map.file = this._file; + if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot; + if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + return map; + }; + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + exports.SourceMapGenerator = SourceMapGenerator; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js +var require_binary_search = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) return mid; + else if (cmp > 0) { + if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1; + else return mid; + } else { + if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + if (aBias == exports.LEAST_UPPER_BOUND) return mid; + else return aLow < 0 ? -1 : aLow; + } + } + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) return -1; + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) return -1; + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break; + --index; + } + return index; + }; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js +var require_quick_sort = /* @__PURE__ */ __commonJSMin(((exports) => { + function SortTemplate(comparator) { + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + Math.random() * (high - low)); + } + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + if (p < r) { + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + swap(ary, pivotIndex, r); + var pivot = ary[r]; + for (var j = p; j < r; j++) if (comparator(ary[j], pivot, false) <= 0) { + i += 1; + swap(ary, i, j); + } + swap(ary, i + 1, j); + var q = i + 1; + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + return doQuickSort; + } + function cloneSort(comparator) { + let template = SortTemplate.toString(); + return new Function(`return ${template}`)()(comparator); + } + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + let sortCache = /* @__PURE__ */ new WeakMap(); + exports.quickSort = function(ary, comparator, start = 0) { + let doQuickSort = sortCache.get(comparator); + if (doQuickSort === void 0) { + doQuickSort = cloneSort(comparator); + sortCache.set(comparator, doQuickSort); + } + doQuickSort(ary, comparator, start, ary.length - 1); + }; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js +var require_source_map_consumer = /* @__PURE__ */ __commonJSMin(((exports) => { + var util = require_util(); + var binarySearch = require_binary_search(); + var ArraySet = require_array_set().ArraySet; + var base64VLQ = require_base64_vlq(); + var quickSort = require_quick_sort().quickSort; + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap); + return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + }; + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", { + configurable: true, + enumerable: true, + get: function() { + if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot); + return this.__generatedMappings; + } + }); + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", { + configurable: true, + enumerable: true, + get: function() { + if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot); + return this.__originalMappings; + } + }); + SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: throw new Error("Unknown order of iteration."); + } + var sourceRoot = this.sourceRoot; + var boundCallback = aCallback.bind(context); + var names = this._names; + var sources = this._sources; + var sourceMapURL = this._sourceMapURL; + for (var i = 0, n = mappings.length; i < n; i++) { + var mapping = mappings[i]; + var source = mapping.source === null ? null : sources.at(mapping.source); + if (source !== null) source = util.computeSourceURL(sourceRoot, source, sourceMapURL); + boundCallback({ + source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : names.at(mapping.name) + }); + } + }; + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, "line"); + var needle = { + source: util.getArg(aArgs, "source"), + originalLine: line, + originalColumn: util.getArg(aArgs, "column", 0) + }; + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) return []; + var mappings = []; + var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + if (aArgs.column === void 0) { + var originalLine = mapping.originalLine; + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }); + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }); + mapping = this._originalMappings[++index]; + } + } + } + return mappings; + }; + exports.SourceMapConsumer = SourceMapConsumer; + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap); + var version = util.getArg(sourceMap, "version"); + var sources = util.getArg(sourceMap, "sources"); + var names = util.getArg(sourceMap, "names", []); + var sourceRoot = util.getArg(sourceMap, "sourceRoot", null); + var sourcesContent = util.getArg(sourceMap, "sourcesContent", null); + var mappings = util.getArg(sourceMap, "mappings"); + var file = util.getArg(sourceMap, "file", null); + if (version != this._version) throw new Error("Unsupported version: " + version); + if (sourceRoot) sourceRoot = util.normalize(sourceRoot); + sources = sources.map(String).map(util.normalize).map(function(source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; + }); + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + this._absoluteSources = this._sources.toArray().map(function(s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource); + if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource); + var i; + for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i; + return -1; + }; + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function(s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping(); + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name); + destOriginalMappings.push(destMapping); + } + destGeneratedMappings.push(destMapping); + } + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + return smc; + }; + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() { + return this._absoluteSources.slice(); + } }); + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; + function sortGenerated(array, start) { + let l = array.length; + let n = array.length - start; + if (n <= 1) return; + else if (n == 2) { + let a = array[start]; + let b = array[start + 1]; + if (compareGenerated(a, b) > 0) { + array[start] = b; + array[start + 1] = a; + } + } else if (n < 20) for (let i = start; i < l; i++) for (let j = i; j > start; j--) { + let a = array[j - 1]; + let b = array[j]; + if (compareGenerated(a, b) <= 0) break; + array[j - 1] = b; + array[j] = a; + } + else quickSort(array, compareGenerated, start); + } + BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var temp = {}; + var originalMappings = []; + var generatedMappings = [], mapping, segment, end, value; + let subarrayStart = 0; + while (index < length) if (aStr.charAt(index) === ";") { + generatedLine++; + index++; + previousGeneratedColumn = 0; + sortGenerated(generatedMappings, subarrayStart); + subarrayStart = generatedMappings.length; + } else if (aStr.charAt(index) === ",") index++; + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break; + aStr.slice(index, end); + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + if (segment.length === 2) throw new Error("Found a source, but no line and column"); + if (segment.length === 3) throw new Error("Found a source and line, but no column"); + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + if (segment.length > 1) { + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + mapping.originalLine += 1; + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + if (segment.length > 4) { + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + generatedMappings.push(mapping); + if (typeof mapping.originalLine === "number") { + let currentSource = mapping.source; + while (originalMappings.length <= currentSource) originalMappings.push(null); + if (originalMappings[currentSource] === null) originalMappings[currentSource] = []; + originalMappings[currentSource].push(mapping); + } + } + sortGenerated(generatedMappings, subarrayStart); + this.__generatedMappings = generatedMappings; + for (var i = 0; i < originalMappings.length; i++) if (originalMappings[i] != null) quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); + this.__originalMappings = [].concat(...originalMappings); + }; + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { + if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]); + if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]); + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + mapping.lastGeneratedColumn = Infinity; + } + }; + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") + }; + var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)); + if (index >= 0) { + var mapping = this._generatedMappings[index]; + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, "source", null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, "name", null); + if (name !== null) name = this._names.at(name); + return { + source, + line: util.getArg(mapping, "originalLine", null), + column: util.getArg(mapping, "originalColumn", null), + name + }; + } + } + return { + source: null, + line: null, + column: null, + name: null + }; + }; + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) return false; + return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) { + return sc == null; + }); + }; + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) return null; + var index = this._findSourceIndex(aSource); + if (index >= 0) return this.sourcesContent[index]; + var relativeSource = aSource; + if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource); + var url; + if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; + if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + if (nullOnMissing) return null; + else throw new Error("\"" + relativeSource + "\" is not in the SourceMap."); + }; + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, "source"); + source = this._findSourceIndex(source); + if (source < 0) return { + line: null, + column: null, + lastColumn: null + }; + var needle = { + source, + originalLine: util.getArg(aArgs, "line"), + originalColumn: util.getArg(aArgs, "column") + }; + var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)); + if (index >= 0) { + var mapping = this._originalMappings[index]; + if (mapping.source === needle.source) return { + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) + }; + } + return { + line: null, + column: null, + lastColumn: null + }; + }; + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap); + var version = util.getArg(sourceMap, "version"); + var sections = util.getArg(sourceMap, "sections"); + if (version != this._version) throw new Error("Unsupported version: " + version); + this._sources = new ArraySet(); + this._names = new ArraySet(); + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function(s) { + if (s.url) throw new Error("Support for url field in sections not implemented."); + var offset = util.getArg(s, "offset"); + var offsetLine = util.getArg(offset, "line"); + var offsetColumn = util.getArg(offset, "column"); + if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping."); + lastOffset = offset; + return { + generatedOffset: { + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL) + }; + }); + } + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() { + var sources = []; + for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]); + return sources; + } }); + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") + }; + var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) return cmp; + return needle.generatedColumn - section.generatedOffset.generatedColumn; + }); + var section = this._sections[sectionIndex]; + if (!section) return { + source: null, + line: null, + column: null, + name: null + }; + return section.consumer.originalPositionFor({ + line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + bias: aArgs.bias + }); + }; + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function(s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var content = this._sections[i].consumer.sourceContentFor(aSource, true); + if (content || content === "") return content; + } + if (nullOnMissing) return null; + else throw new Error("\"" + aSource + "\" is not in the SourceMap."); + }; + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) continue; + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) return { + line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) + }; + } + return { + line: null, + column: null + }; + }; + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + var source = section.consumer._sources.at(mapping.source); + if (source !== null) source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + var adjustedMapping = { + source, + generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name + }; + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping); + } + } + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; +})); +//#endregion +//#region node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js +var require_source_node = /* @__PURE__ */ __commonJSMin(((exports) => { + var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; + var util = require_util(); + var REGEX_NEWLINE = /(\r?\n)/; + var NEWLINE_CODE = 10; + var isSourceNode = "$$$isSourceNode$$$"; + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + var node = new SourceNode(); + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + return getNextLine() + (getNextLine() || ""); + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0; + } + }; + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + var lastMapping = null; + aSourceMapConsumer.eachMapping(function(mapping) { + if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) { + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + } else { + var nextLine = remainingLines[remainingLinesIndex] || ""; + var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + lastMapping = mapping; + return; + } + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ""; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine()); + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + aSourceMapConsumer.sources.forEach(function(sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile); + node.setSourceContent(sourceFile, content); + } + }); + return node; + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === void 0) node.add(code); + else { + var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; + node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); + } + } + }; + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) { + this.add(chunk); + }, this); + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) this.children.push(aChunk); + } else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); + return this; + }; + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]); + else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk); + else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); + return this; + }; + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) chunk.walk(aFn); + else if (chunk !== "") aFn(chunk, { + source: this.source, + line: this.line, + column: this.column, + name: this.name + }); + } + }; + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len - 1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement); + else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + else this.children.push("".replace(aPattern, aReplacement)); + return this; + }; + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn); + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + }; + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function(chunk) { + str += chunk; + }); + return str; + }; + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function(chunk, original) { + generated.code += chunk; + if (original.source !== null && original.line !== null && original.column !== null) { + if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ generated: { + line: generated.line, + column: generated.column + } }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } else generated.column++; + }); + this.walkSourceContents(function(sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + return { + code: generated.code, + map + }; + }; + exports.SourceNode = SourceNode; +})); +//#endregion +//#region vendor/recast/lib/util.ts +var import_source_map = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => { + exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator; + exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer; + exports.SourceNode = require_source_node().SourceNode; +})))()); +const n$2 = namedTypes$1; +const SourceMapConsumer = import_source_map.SourceMapConsumer; +const SourceMapGenerator = import_source_map.SourceMapGenerator; +const hasOwn$2 = Object.prototype.hasOwnProperty; +function getLineTerminator() { + return "\n"; +} +function getOption(options, key, defaultValue) { + if (options && hasOwn$2.call(options, key)) return options[key]; + return defaultValue; +} +function getUnionOfKeys(...args) { + const result = {}; + const argc = args.length; + for (let i = 0; i < argc; ++i) { + const keys = Object.keys(args[i]); + const keyCount = keys.length; + for (let j = 0; j < keyCount; ++j) result[keys[j]] = true; + } + return result; +} +function comparePos(pos1, pos2) { + return pos1.line - pos2.line || pos1.column - pos2.column; +} +function copyPos(pos) { + return { + line: pos.line, + column: pos.column + }; +} +function composeSourceMaps(formerMap, latterMap) { + if (formerMap) { + if (!latterMap) return formerMap; + } else return latterMap || null; + const smcFormer = new SourceMapConsumer(formerMap); + const smcLatter = new SourceMapConsumer(latterMap); + const smg = new SourceMapGenerator({ + file: latterMap.file, + sourceRoot: latterMap.sourceRoot + }); + const sourcesToContents = {}; + smcLatter.eachMapping(function(mapping) { + const origPos = smcFormer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + const sourceName = origPos.source; + if (sourceName === null) return; + smg.addMapping({ + source: sourceName, + original: copyPos(origPos), + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + }, + name: mapping.name + }); + const sourceContent = smcFormer.sourceContentFor(sourceName); + if (sourceContent && !hasOwn$2.call(sourcesToContents, sourceName)) { + sourcesToContents[sourceName] = sourceContent; + smg.setSourceContent(sourceName, sourceContent); + } + }); + return smg.toJSON(); +} +function getTrueLoc(node, lines) { + if (!node.loc) return null; + const result = { + start: node.loc.start, + end: node.loc.end + }; + function include(node) { + expandLoc(result, node.loc); + } + if (node.declaration && node.declaration.decorators && isExportDeclaration(node)) node.declaration.decorators.forEach(include); + if (comparePos(result.start, result.end) < 0) { + result.start = copyPos(result.start); + lines.skipSpaces(result.start, false, true); + if (comparePos(result.start, result.end) < 0) { + result.end = copyPos(result.end); + lines.skipSpaces(result.end, true, true); + } + } + if (node.comments) node.comments.forEach(include); + return result; +} +function expandLoc(parentLoc, childLoc) { + if (parentLoc && childLoc) { + if (comparePos(childLoc.start, parentLoc.start) < 0) parentLoc.start = childLoc.start; + if (comparePos(parentLoc.end, childLoc.end) < 0) parentLoc.end = childLoc.end; + } +} +function fixFaultyLocations(node, lines) { + const loc = node.loc; + if (loc) { + if (loc.start.line < 1) loc.start.line = 1; + if (loc.end.line < 1) loc.end.line = 1; + } + if (node.type === "File") { + loc.start = lines.firstPos(); + loc.end = lines.lastPos(); + } + fixForLoopHead(node, lines); + fixTemplateLiteral(node, lines); + if (loc && node.decorators) node.decorators.forEach(function(decorator) { + expandLoc(loc, decorator.loc); + }); + else if (node.declaration && isExportDeclaration(node)) { + node.declaration.loc = null; + const decorators = node.declaration.decorators; + if (decorators) decorators.forEach(function(decorator) { + expandLoc(loc, decorator.loc); + }); + } else if (n$2.MethodDefinition && n$2.MethodDefinition.check(node) || n$2.Property.check(node) && (node.method || node.shorthand)) { + node.value.loc = null; + if (n$2.FunctionExpression.check(node.value)) node.value.id = null; + } else if (node.type === "ObjectTypeProperty") { + const loc = node.loc; + let end = loc && loc.end; + if (end) { + end = copyPos(end); + if (lines.prevPos(end) && lines.charAt(end) === ",") { + if (end = lines.skipSpaces(end, true, true)) loc.end = end; + } + } + } +} +function fixForLoopHead(node, lines) { + if (node.type !== "ForStatement") return; + function fix(child) { + const loc = child && child.loc; + const start = loc && loc.start; + const end = loc && copyPos(loc.end); + while (start && end && comparePos(start, end) < 0) { + lines.prevPos(end); + if (lines.charAt(end) === ";") { + loc.end.line = end.line; + loc.end.column = end.column; + } else break; + } + } + fix(node.init); + fix(node.test); + fix(node.update); +} +function fixTemplateLiteral(node, lines) { + if (node.type !== "TemplateLiteral") return; + if (node.quasis.length === 0) return; + if (node.loc) { + const afterLeftBackTickPos = copyPos(node.loc.start); + const firstQuasi = node.quasis[0]; + if (comparePos(firstQuasi.loc.start, afterLeftBackTickPos) < 0) firstQuasi.loc.start = afterLeftBackTickPos; + const rightBackTickPos = copyPos(node.loc.end); + const lastQuasi = node.quasis[node.quasis.length - 1]; + if (comparePos(rightBackTickPos, lastQuasi.loc.end) < 0) lastQuasi.loc.end = rightBackTickPos; + } + node.expressions.forEach(function(expr, i) { + const dollarCurlyPos = lines.skipSpaces(expr.loc.start, true, false); + if (lines.prevPos(dollarCurlyPos) && lines.charAt(dollarCurlyPos) === "{" && lines.prevPos(dollarCurlyPos) && lines.charAt(dollarCurlyPos) === "$") { + const quasiBefore = node.quasis[i]; + if (comparePos(dollarCurlyPos, quasiBefore.loc.end) < 0) quasiBefore.loc.end = dollarCurlyPos; + } + const rightCurlyPos = lines.skipSpaces(expr.loc.end, false, false); + if (lines.charAt(rightCurlyPos) === "}") { + const quasiAfter = node.quasis[i + 1]; + if (comparePos(quasiAfter.loc.start, rightCurlyPos) < 0) quasiAfter.loc.start = rightCurlyPos; + } + }); +} +function isExportDeclaration(node) { + if (node) switch (node.type) { + case "ExportDeclaration": + case "ExportDefaultDeclaration": + case "ExportDefaultSpecifier": + case "DeclareExportDeclaration": + case "ExportNamedDeclaration": + case "ExportAllDeclaration": return true; + } + return false; +} +function getParentExportDeclaration(path) { + const parentNode = path.getParentNode(); + if (path.getName() === "declaration" && isExportDeclaration(parentNode)) return parentNode; + return null; +} +function isTrailingCommaEnabled(options, context) { + const trailingComma = options.trailingComma; + if (typeof trailingComma === "object") return !!trailingComma[context]; + return !!trailingComma; +} +//#endregion +//#region vendor/recast/lib/options.ts +const defaults = { + tabWidth: 4, + useTabs: false, + reuseWhitespace: true, + lineTerminator: getLineTerminator(), + wrapColumn: 74, + sourceFileName: null, + sourceMapName: null, + sourceRoot: null, + inputSourceMap: null, + range: false, + tolerant: true, + quote: null, + trailingComma: false, + arrayBracketSpacing: false, + objectCurlySpacing: true, + arrowParensAlways: false, + flowObjectCommas: true, + tokens: true +}; +const hasOwn$1 = defaults.hasOwnProperty; +function normalize(opts) { + const options = opts || defaults; + function get(key) { + return hasOwn$1.call(options, key) ? options[key] : defaults[key]; + } + return { + tabWidth: +get("tabWidth"), + useTabs: !!get("useTabs"), + reuseWhitespace: !!get("reuseWhitespace"), + lineTerminator: get("lineTerminator"), + wrapColumn: Math.max(get("wrapColumn"), 0), + sourceFileName: get("sourceFileName"), + sourceMapName: get("sourceMapName"), + sourceRoot: get("sourceRoot"), + inputSourceMap: get("inputSourceMap"), + parser: get("esprima") || get("parser"), + range: get("range"), + tolerant: get("tolerant"), + quote: get("quote"), + trailingComma: get("trailingComma"), + arrayBracketSpacing: get("arrayBracketSpacing"), + objectCurlySpacing: get("objectCurlySpacing"), + arrowParensAlways: get("arrowParensAlways"), + flowObjectCommas: get("flowObjectCommas"), + tokens: !!get("tokens") + }; +} +//#endregion +//#region vendor/recast/lib/mapping.ts +var Mapping = class Mapping { + sourceLines; + sourceLoc; + targetLoc; + constructor(sourceLines, sourceLoc, targetLoc = sourceLoc) { + this.sourceLines = sourceLines; + this.sourceLoc = sourceLoc; + this.targetLoc = targetLoc; + } + slice(lines, start, end = lines.lastPos()) { + const sourceLines = this.sourceLines; + let sourceLoc = this.sourceLoc; + let targetLoc = this.targetLoc; + function skip(name) { + const sourceFromPos = sourceLoc[name]; + const targetFromPos = targetLoc[name]; + let targetToPos = start; + if (name === "end") targetToPos = end; + return skipChars(sourceLines, sourceFromPos, lines, targetFromPos, targetToPos); + } + if (comparePos(start, targetLoc.start) <= 0) if (comparePos(targetLoc.end, end) <= 0) targetLoc = { + start: subtractPos(targetLoc.start, start.line, start.column), + end: subtractPos(targetLoc.end, start.line, start.column) + }; + else if (comparePos(end, targetLoc.start) <= 0) return null; + else { + sourceLoc = { + start: sourceLoc.start, + end: skip("end") + }; + targetLoc = { + start: subtractPos(targetLoc.start, start.line, start.column), + end: subtractPos(end, start.line, start.column) + }; + } + else { + if (comparePos(targetLoc.end, start) <= 0) return null; + if (comparePos(targetLoc.end, end) <= 0) { + sourceLoc = { + start: skip("start"), + end: sourceLoc.end + }; + targetLoc = { + start: { + line: 1, + column: 0 + }, + end: subtractPos(targetLoc.end, start.line, start.column) + }; + } else { + sourceLoc = { + start: skip("start"), + end: skip("end") + }; + targetLoc = { + start: { + line: 1, + column: 0 + }, + end: subtractPos(end, start.line, start.column) + }; + } + } + return new Mapping(this.sourceLines, sourceLoc, targetLoc); + } + add(line, column) { + return new Mapping(this.sourceLines, this.sourceLoc, { + start: addPos(this.targetLoc.start, line, column), + end: addPos(this.targetLoc.end, line, column) + }); + } + subtract(line, column) { + return new Mapping(this.sourceLines, this.sourceLoc, { + start: subtractPos(this.targetLoc.start, line, column), + end: subtractPos(this.targetLoc.end, line, column) + }); + } + indent(by, skipFirstLine = false, noNegativeColumns = false) { + if (by === 0) return this; + let targetLoc = this.targetLoc; + const startLine = targetLoc.start.line; + const endLine = targetLoc.end.line; + if (skipFirstLine && startLine === 1 && endLine === 1) return this; + targetLoc = { + start: targetLoc.start, + end: targetLoc.end + }; + if (!skipFirstLine || startLine > 1) { + const startColumn = targetLoc.start.column + by; + targetLoc.start = { + line: startLine, + column: noNegativeColumns ? Math.max(0, startColumn) : startColumn + }; + } + if (!skipFirstLine || endLine > 1) { + const endColumn = targetLoc.end.column + by; + targetLoc.end = { + line: endLine, + column: noNegativeColumns ? Math.max(0, endColumn) : endColumn + }; + } + return new Mapping(this.sourceLines, this.sourceLoc, targetLoc); + } +}; +function addPos(toPos, line, column) { + return { + line: toPos.line + line - 1, + column: toPos.line === 1 ? toPos.column + column : toPos.column + }; +} +function subtractPos(fromPos, line, column) { + return { + line: fromPos.line - line + 1, + column: fromPos.line === line ? fromPos.column - column : fromPos.column + }; +} +function skipChars(sourceLines, sourceFromPos, targetLines, targetFromPos, targetToPos) { + const targetComparison = comparePos(targetFromPos, targetToPos); + if (targetComparison === 0) return sourceFromPos; + let sourceCursor, targetCursor; + if (targetComparison < 0) { + sourceCursor = sourceLines.skipSpaces(sourceFromPos) || sourceLines.lastPos(); + targetCursor = targetLines.skipSpaces(targetFromPos) || targetLines.lastPos(); + const lineDiff = targetToPos.line - targetCursor.line; + sourceCursor.line += lineDiff; + targetCursor.line += lineDiff; + if (lineDiff > 0) { + sourceCursor.column = 0; + targetCursor.column = 0; + } + while (comparePos(targetCursor, targetToPos) < 0 && targetLines.nextPos(targetCursor, true)); + } else { + sourceCursor = sourceLines.skipSpaces(sourceFromPos, true) || sourceLines.firstPos(); + targetCursor = targetLines.skipSpaces(targetFromPos, true) || targetLines.firstPos(); + const lineDiff = targetToPos.line - targetCursor.line; + sourceCursor.line += lineDiff; + targetCursor.line += lineDiff; + if (lineDiff < 0) { + sourceCursor.column = sourceLines.getLineLength(sourceCursor.line); + targetCursor.column = targetLines.getLineLength(targetCursor.line); + } + while (comparePos(targetToPos, targetCursor) < 0 && targetLines.prevPos(targetCursor, true)); + } + return sourceCursor; +} +//#endregion +//#region vendor/recast/lib/lines.ts +var Lines = class Lines { + infos; + length; + name; + mappings = []; + cachedSourceMap = null; + cachedTabWidth = void 0; + constructor(infos, sourceFileName = null) { + this.infos = infos; + this.length = infos.length; + this.name = sourceFileName || null; + if (this.name) this.mappings.push(new Mapping(this, { + start: this.firstPos(), + end: this.lastPos() + })); + } + toString(options) { + return this.sliceString(this.firstPos(), this.lastPos(), options); + } + getSourceMap(sourceMapName, sourceRoot) { + if (!sourceMapName) return null; + const targetLines = this; + function updateJSON(json) { + json = json || {}; + json.file = sourceMapName; + if (sourceRoot) json.sourceRoot = sourceRoot; + return json; + } + if (targetLines.cachedSourceMap) return updateJSON(targetLines.cachedSourceMap.toJSON()); + const smg = new import_source_map.SourceMapGenerator(updateJSON()); + const sourcesToContents = {}; + targetLines.mappings.forEach(function(mapping) { + const sourceCursor = mapping.sourceLines.skipSpaces(mapping.sourceLoc.start) || mapping.sourceLines.lastPos(); + const targetCursor = targetLines.skipSpaces(mapping.targetLoc.start) || targetLines.lastPos(); + while (comparePos(sourceCursor, mapping.sourceLoc.end) < 0 && comparePos(targetCursor, mapping.targetLoc.end) < 0) { + mapping.sourceLines.charAt(sourceCursor); + targetLines.charAt(targetCursor); + const sourceName = mapping.sourceLines.name; + smg.addMapping({ + source: sourceName, + original: { + line: sourceCursor.line, + column: sourceCursor.column + }, + generated: { + line: targetCursor.line, + column: targetCursor.column + } + }); + if (!hasOwn.call(sourcesToContents, sourceName)) { + const sourceContent = mapping.sourceLines.toString(); + smg.setSourceContent(sourceName, sourceContent); + sourcesToContents[sourceName] = sourceContent; + } + targetLines.nextPos(targetCursor, true); + mapping.sourceLines.nextPos(sourceCursor, true); + } + }); + targetLines.cachedSourceMap = smg; + return smg.toJSON(); + } + bootstrapCharAt(pos) { + const line = pos.line, column = pos.column, strings = this.toString().split(lineTerminatorSeqExp), string = strings[line - 1]; + if (typeof string === "undefined") return ""; + if (column === string.length && line < strings.length) return "\n"; + if (column >= string.length) return ""; + return string.charAt(column); + } + charAt(pos) { + let line = pos.line, column = pos.column, info = this.infos[line - 1], c = column; + if (typeof info === "undefined" || c < 0) return ""; + const indent = this.getIndentAt(line); + if (c < indent) return " "; + c += info.sliceStart - indent; + if (c === info.sliceEnd && line < this.length) return "\n"; + if (c >= info.sliceEnd) return ""; + return info.line.charAt(c); + } + stripMargin(width, skipFirstLine) { + if (width === 0) return this; + if (skipFirstLine && this.length === 1) return this; + const lines = new Lines(this.infos.map(function(info, i) { + if (info.line && (i > 0 || !skipFirstLine)) info = { + ...info, + indent: Math.max(0, info.indent - width) + }; + return info; + })); + if (this.mappings.length > 0) { + const newMappings = lines.mappings; + this.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(width, skipFirstLine, true)); + }); + } + return lines; + } + indent(by) { + if (by === 0) return this; + const lines = new Lines(this.infos.map(function(info) { + if (info.line && !info.locked) info = { + ...info, + indent: info.indent + by + }; + return info; + })); + if (this.mappings.length > 0) { + const newMappings = lines.mappings; + this.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(by)); + }); + } + return lines; + } + indentTail(by) { + if (by === 0) return this; + if (this.length < 2) return this; + const lines = new Lines(this.infos.map(function(info, i) { + if (i > 0 && info.line && !info.locked) info = { + ...info, + indent: info.indent + by + }; + return info; + })); + if (this.mappings.length > 0) { + const newMappings = lines.mappings; + this.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(by, true)); + }); + } + return lines; + } + lockIndentTail() { + if (this.length < 2) return this; + return new Lines(this.infos.map((info, i) => ({ + ...info, + locked: i > 0 + }))); + } + getIndentAt(line) { + return Math.max(this.infos[line - 1].indent, 0); + } + guessTabWidth() { + if (typeof this.cachedTabWidth === "number") return this.cachedTabWidth; + const counts = []; + let lastIndent = 0; + for (let line = 1, last = this.length; line <= last; ++line) { + const info = this.infos[line - 1]; + if (isOnlyWhitespace(info.line.slice(info.sliceStart, info.sliceEnd))) continue; + const diff = Math.abs(info.indent - lastIndent); + counts[diff] = ~~counts[diff] + 1; + lastIndent = info.indent; + } + let maxCount = -1; + let result = 2; + for (let tabWidth = 1; tabWidth < counts.length; tabWidth += 1) if (hasOwn.call(counts, tabWidth) && counts[tabWidth] > maxCount) { + maxCount = counts[tabWidth]; + result = tabWidth; + } + return this.cachedTabWidth = result; + } + startsWithComment() { + if (this.infos.length === 0) return false; + const firstLineInfo = this.infos[0], sliceStart = firstLineInfo.sliceStart, sliceEnd = firstLineInfo.sliceEnd, firstLine = firstLineInfo.line.slice(sliceStart, sliceEnd).trim(); + return firstLine.length === 0 || firstLine.slice(0, 2) === "//" || firstLine.slice(0, 2) === "/*"; + } + isOnlyWhitespace() { + return isOnlyWhitespace(this.toString()); + } + isPrecededOnlyByWhitespace(pos) { + const info = this.infos[pos.line - 1]; + const indent = Math.max(info.indent, 0); + const diff = pos.column - indent; + if (diff <= 0) return true; + const start = info.sliceStart; + const end = Math.min(start + diff, info.sliceEnd); + return isOnlyWhitespace(info.line.slice(start, end)); + } + getLineLength(line) { + const info = this.infos[line - 1]; + return this.getIndentAt(line) + info.sliceEnd - info.sliceStart; + } + nextPos(pos, skipSpaces = false) { + const l = Math.max(pos.line, 0); + if (Math.max(pos.column, 0) < this.getLineLength(l)) { + pos.column += 1; + return skipSpaces ? !!this.skipSpaces(pos, false, true) : true; + } + if (l < this.length) { + pos.line += 1; + pos.column = 0; + return skipSpaces ? !!this.skipSpaces(pos, false, true) : true; + } + return false; + } + prevPos(pos, skipSpaces = false) { + let l = pos.line, c = pos.column; + if (c < 1) { + l -= 1; + if (l < 1) return false; + c = this.getLineLength(l); + } else c = Math.min(c - 1, this.getLineLength(l)); + pos.line = l; + pos.column = c; + return skipSpaces ? !!this.skipSpaces(pos, true, true) : true; + } + firstPos() { + return { + line: 1, + column: 0 + }; + } + lastPos() { + return { + line: this.length, + column: this.getLineLength(this.length) + }; + } + skipSpaces(pos, backward = false, modifyInPlace = false) { + if (pos) pos = modifyInPlace ? pos : { + line: pos.line, + column: pos.column + }; + else if (backward) pos = this.lastPos(); + else pos = this.firstPos(); + if (backward) { + while (this.prevPos(pos)) if (!isOnlyWhitespace(this.charAt(pos)) && this.nextPos(pos)) return pos; + return null; + } else { + while (isOnlyWhitespace(this.charAt(pos))) if (!this.nextPos(pos)) return null; + return pos; + } + } + trimLeft() { + const pos = this.skipSpaces(this.firstPos(), false, true); + return pos ? this.slice(pos) : emptyLines; + } + trimRight() { + const pos = this.skipSpaces(this.lastPos(), true, true); + return pos ? this.slice(this.firstPos(), pos) : emptyLines; + } + trim() { + const start = this.skipSpaces(this.firstPos(), false, true); + if (start === null) return emptyLines; + const end = this.skipSpaces(this.lastPos(), true, true); + if (end === null) return emptyLines; + return this.slice(start, end); + } + eachPos(callback, startPos = this.firstPos(), skipSpaces = false) { + const pos = this.firstPos(); + if (startPos) pos.line = startPos.line, pos.column = startPos.column; + if (skipSpaces && !this.skipSpaces(pos, false, true)) return; + do + callback.call(this, pos); + while (this.nextPos(pos, skipSpaces)); + } + bootstrapSlice(start, end) { + const strings = this.toString().split(lineTerminatorSeqExp).slice(start.line - 1, end.line); + if (strings.length > 0) { + strings.push(strings.pop().slice(0, end.column)); + strings[0] = strings[0].slice(start.column); + } + return fromString(strings.join("\n")); + } + slice(start, end) { + if (!end) { + if (!start) return this; + end = this.lastPos(); + } + if (!start) throw new Error("cannot slice with end but not start"); + const sliced = this.infos.slice(start.line - 1, end.line); + if (start.line === end.line) sliced[0] = sliceInfo(sliced[0], start.column, end.column); + else { + sliced[0] = sliceInfo(sliced[0], start.column); + sliced.push(sliceInfo(sliced.pop(), 0, end.column)); + } + const lines = new Lines(sliced); + if (this.mappings.length > 0) { + const newMappings = lines.mappings; + this.mappings.forEach(function(mapping) { + const sliced = mapping.slice(this, start, end); + if (sliced) newMappings.push(sliced); + }, this); + } + return lines; + } + bootstrapSliceString(start, end, options) { + return this.slice(start, end).toString(options); + } + sliceString(start = this.firstPos(), end = this.lastPos(), options) { + const { tabWidth, useTabs, reuseWhitespace, lineTerminator } = normalize(options); + const parts = []; + for (let line = start.line; line <= end.line; ++line) { + let info = this.infos[line - 1]; + if (line === start.line) if (line === end.line) info = sliceInfo(info, start.column, end.column); + else info = sliceInfo(info, start.column); + else if (line === end.line) info = sliceInfo(info, 0, end.column); + const indent = Math.max(info.indent, 0); + const before = info.line.slice(0, info.sliceStart); + if (reuseWhitespace && isOnlyWhitespace(before) && countSpaces(before, tabWidth) === indent) { + parts.push(info.line.slice(0, info.sliceEnd)); + continue; + } + let tabs = 0; + let spaces = indent; + if (useTabs) { + tabs = Math.floor(indent / tabWidth); + spaces -= tabs * tabWidth; + } + let result = ""; + if (tabs > 0) result += new Array(tabs + 1).join(" "); + if (spaces > 0) result += new Array(spaces + 1).join(" "); + result += info.line.slice(info.sliceStart, info.sliceEnd); + parts.push(result); + } + return parts.join(lineTerminator); + } + isEmpty() { + return this.length < 2 && this.getLineLength(1) < 1; + } + join(elements) { + const separator = this; + const infos = []; + const mappings = []; + let prevInfo; + function appendLines(linesOrNull) { + if (linesOrNull === null) return; + if (prevInfo) { + const info = linesOrNull.infos[0]; + const indent = new Array(info.indent + 1).join(" "); + const prevLine = infos.length; + const prevColumn = Math.max(prevInfo.indent, 0) + prevInfo.sliceEnd - prevInfo.sliceStart; + prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent + info.line.slice(info.sliceStart, info.sliceEnd); + prevInfo.locked = prevInfo.locked || info.locked; + prevInfo.sliceEnd = prevInfo.line.length; + if (linesOrNull.mappings.length > 0) linesOrNull.mappings.forEach(function(mapping) { + mappings.push(mapping.add(prevLine, prevColumn)); + }); + } else if (linesOrNull.mappings.length > 0) mappings.push.apply(mappings, linesOrNull.mappings); + linesOrNull.infos.forEach(function(info, i) { + if (!prevInfo || i > 0) { + prevInfo = { ...info }; + infos.push(prevInfo); + } + }); + } + function appendWithSeparator(linesOrNull, i) { + if (i > 0) appendLines(separator); + appendLines(linesOrNull); + } + elements.map(function(elem) { + const lines = fromString(elem); + if (lines.isEmpty()) return null; + return lines; + }).forEach((linesOrNull, i) => { + if (separator.isEmpty()) appendLines(linesOrNull); + else appendWithSeparator(linesOrNull, i); + }); + if (infos.length < 1) return emptyLines; + const lines = new Lines(infos); + lines.mappings = mappings; + return lines; + } + concat(...args) { + const list = [this]; + list.push.apply(list, args); + return emptyLines.join(list); + } +}; +const fromStringCache = {}; +const hasOwn = fromStringCache.hasOwnProperty; +const maxCacheKeyLen = 10; +function countSpaces(spaces, tabWidth) { + let count = 0; + const len = spaces.length; + for (let i = 0; i < len; ++i) switch (spaces.charCodeAt(i)) { + case 9: { + const next = Math.ceil(count / tabWidth) * tabWidth; + if (next === count) count += tabWidth; + else count = next; + break; + } + case 11: + case 12: + case 13: + case 65279: break; + default: + count += 1; + break; + } + return count; +} +const leadingSpaceExp = /^\s*/; +const lineTerminatorSeqExp = /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/; +/** +* @param {Object} options - Options object that configures printing. +*/ +function fromString(string, options) { + if (string instanceof Lines) return string; + string += ""; + const tabWidth = options && options.tabWidth; + const tabless = string.indexOf(" ") < 0; + const cacheable = !options && tabless && string.length <= maxCacheKeyLen; + if (cacheable && hasOwn.call(fromStringCache, string)) return fromStringCache[string]; + const lines = new Lines(string.split(lineTerminatorSeqExp).map(function(line) { + const spaces = leadingSpaceExp.exec(line)[0]; + return { + line, + indent: countSpaces(spaces, tabWidth), + locked: false, + sliceStart: spaces.length, + sliceEnd: line.length + }; + }), normalize(options).sourceFileName); + if (cacheable) fromStringCache[string] = lines; + return lines; +} +function isOnlyWhitespace(string) { + return !/\S/.test(string); +} +function sliceInfo(info, startCol, endCol) { + let sliceStart = info.sliceStart; + let sliceEnd = info.sliceEnd; + let indent = Math.max(info.indent, 0); + let lineLength = indent + sliceEnd - sliceStart; + if (typeof endCol === "undefined") endCol = lineLength; + startCol = Math.max(startCol, 0); + endCol = Math.min(endCol, lineLength); + endCol = Math.max(endCol, startCol); + if (endCol < indent) { + indent = endCol; + sliceEnd = sliceStart; + } else sliceEnd -= lineLength - endCol; + lineLength = endCol; + lineLength -= startCol; + if (startCol < indent) indent -= startCol; + else { + startCol -= indent; + indent = 0; + sliceStart += startCol; + } + if (info.indent === indent && info.sliceStart === sliceStart && info.sliceEnd === sliceEnd) return info; + return { + line: info.line, + indent, + locked: false, + sliceStart, + sliceEnd + }; +} +function concat(elements) { + return emptyLines.join(elements); +} +const emptyLines = fromString(""); +//#endregion +//#region vendor/recast/lib/comments.ts +const n$1 = namedTypes$1; +const isArray$3 = builtInTypes.array; +const isObject$3 = builtInTypes.object; +const childNodesCache = /* @__PURE__ */ new WeakMap(); +function getSortedChildNodes(node, lines, resultArray) { + if (!node) return resultArray; + fixFaultyLocations(node, lines); + if (resultArray) { + if (n$1.Node.check(node) && n$1.SourceLocation.check(node.loc)) { + let i = resultArray.length - 1; + for (; i >= 0; --i) { + const child = resultArray[i]; + if (child && child.loc && comparePos(child.loc.end, node.loc.start) <= 0) break; + } + resultArray.splice(i + 1, 0, node); + return resultArray; + } + } else { + const childNodes = childNodesCache.get(node); + if (childNodes) return childNodes; + } + let names; + if (isArray$3.check(node)) names = Object.keys(node); + else if (isObject$3.check(node)) names = getFieldNames(node); + else return resultArray; + if (!resultArray) childNodesCache.set(node, resultArray = []); + for (let i = 0, nameCount = names.length; i < nameCount; ++i) getSortedChildNodes(node[names[i]], lines, resultArray); + return resultArray; +} +function decorateComment(node, comment, lines) { + const childNodes = getSortedChildNodes(node, lines); + let left = 0; + let right = childNodes && childNodes.length; + let precedingNode; + let followingNode; + while (typeof right === "number" && left < right) { + const middle = left + right >> 1; + const child = childNodes[middle]; + if (comparePos(child.loc.start, comment.loc.start) <= 0 && comparePos(comment.loc.end, child.loc.end) <= 0) { + decorateComment(comment.enclosingNode = child, comment, lines); + return; + } + if (comparePos(child.loc.end, comment.loc.start) <= 0) { + precedingNode = child; + left = middle + 1; + continue; + } + if (comparePos(comment.loc.end, child.loc.start) <= 0) { + followingNode = child; + right = middle; + continue; + } + throw new Error("Comment location overlaps with node location"); + } + if (precedingNode) comment.precedingNode = precedingNode; + if (followingNode) comment.followingNode = followingNode; +} +function attach(comments, ast, lines) { + if (!isArray$3.check(comments)) return; + const tiesToBreak = []; + comments.forEach(function(comment) { + comment.loc.lines = lines; + decorateComment(ast, comment, lines); + const pn = comment.precedingNode; + const en = comment.enclosingNode; + const fn = comment.followingNode; + if (pn && fn) { + const tieCount = tiesToBreak.length; + if (tieCount > 0) { + if (tiesToBreak[tieCount - 1].followingNode !== comment.followingNode) breakTies(tiesToBreak, lines); + } + tiesToBreak.push(comment); + } else if (pn) { + breakTies(tiesToBreak, lines); + addTrailingComment(pn, comment); + } else if (fn) { + breakTies(tiesToBreak, lines); + addLeadingComment(fn, comment); + } else if (en) { + breakTies(tiesToBreak, lines); + addDanglingComment(en, comment); + } else throw new Error("AST contains no nodes at all?"); + }); + breakTies(tiesToBreak, lines); + comments.forEach(function(comment) { + delete comment.precedingNode; + delete comment.enclosingNode; + delete comment.followingNode; + }); +} +function breakTies(tiesToBreak, lines) { + const tieCount = tiesToBreak.length; + if (tieCount === 0) return; + const pn = tiesToBreak[0].precedingNode; + const fn = tiesToBreak[0].followingNode; + let gapEndPos = fn.loc.start; + let indexOfFirstLeadingComment = tieCount; + let comment; + for (; indexOfFirstLeadingComment > 0; --indexOfFirstLeadingComment) { + comment = tiesToBreak[indexOfFirstLeadingComment - 1]; + const gap = lines.sliceString(comment.loc.end, gapEndPos); + if (/\S/.test(gap)) break; + gapEndPos = comment.loc.start; + } + while (indexOfFirstLeadingComment <= tieCount && (comment = tiesToBreak[indexOfFirstLeadingComment]) && (comment.type === "Line" || comment.type === "CommentLine") && comment.loc.start.column > fn.loc.start.column) ++indexOfFirstLeadingComment; + if (indexOfFirstLeadingComment) { + const { enclosingNode } = tiesToBreak[indexOfFirstLeadingComment - 1]; + if (enclosingNode?.type === "CallExpression") --indexOfFirstLeadingComment; + } + tiesToBreak.forEach(function(comment, i) { + if (i < indexOfFirstLeadingComment) addTrailingComment(pn, comment); + else addLeadingComment(fn, comment); + }); + tiesToBreak.length = 0; +} +function addCommentHelper(node, comment) { + (node.comments || (node.comments = [])).push(comment); +} +function addLeadingComment(node, comment) { + comment.leading = true; + comment.trailing = false; + addCommentHelper(node, comment); +} +function addDanglingComment(node, comment) { + comment.leading = false; + comment.trailing = false; + addCommentHelper(node, comment); +} +function addTrailingComment(node, comment) { + comment.leading = false; + comment.trailing = true; + addCommentHelper(node, comment); +} +function printLeadingComment(commentPath, print) { + const comment = commentPath.getValue(); + n$1.Comment.assert(comment); + const loc = comment.loc; + const lines = loc && loc.lines; + const parts = [print(commentPath)]; + if (comment.trailing) parts.push("\n"); + else if (lines instanceof Lines) { + const trailingSpace = lines.slice(loc.end, lines.skipSpaces(loc.end) || lines.lastPos()); + if (trailingSpace.length === 1) parts.push(trailingSpace); + else parts.push(new Array(trailingSpace.length).join("\n")); + } else parts.push("\n"); + return concat(parts); +} +function printTrailingComment(commentPath, print) { + const comment = commentPath.getValue(commentPath); + n$1.Comment.assert(comment); + const loc = comment.loc; + const lines = loc && loc.lines; + const parts = []; + if (lines instanceof Lines) { + const fromPos = lines.skipSpaces(loc.start, true) || lines.firstPos(); + const leadingSpace = lines.slice(fromPos, loc.start); + if (leadingSpace.length === 1) parts.push(leadingSpace); + else parts.push(new Array(leadingSpace.length).join("\n")); + } + parts.push(print(commentPath)); + return concat(parts); +} +function printComments(path, print) { + const value = path.getValue(); + const innerLines = print(path); + const comments = n$1.Node.check(value) && getFieldValue(value, "comments"); + if (!comments || comments.length === 0) return innerLines; + const leadingParts = []; + const trailingParts = [innerLines]; + path.each(function(commentPath) { + const comment = commentPath.getValue(); + const leading = getFieldValue(comment, "leading"); + const trailing = getFieldValue(comment, "trailing"); + if (leading || trailing && !(n$1.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) leadingParts.push(printLeadingComment(commentPath, print)); + else if (trailing) trailingParts.push(printTrailingComment(commentPath, print)); + }, "comments"); + leadingParts.push.apply(leadingParts, trailingParts); + return concat(leadingParts); +} +//#endregion +//#region vendor/recast/lib/parser.ts +const b$6 = builders$1; +const isObject$2 = builtInTypes.object; +const isArray$2 = builtInTypes.array; +function parse(source, options) { + options = normalize(options); + const lines = fromString(source, options); + const sourceWithoutTabs = lines.toString({ + tabWidth: options.tabWidth, + reuseWhitespace: false, + useTabs: false + }); + let comments = []; + const ast = options.parser.parse(sourceWithoutTabs, { + jsx: true, + loc: true, + locations: true, + range: options.range, + comment: true, + onComment: comments, + tolerant: getOption(options, "tolerant", true), + ecmaVersion: 6, + sourceType: getOption(options, "sourceType", "module") + }); + const tokens = Array.isArray(ast.tokens) ? ast.tokens : false; + delete ast.tokens; + tokens.forEach(function(token) { + if (typeof token.value !== "string") token.value = lines.sliceString(token.loc.start, token.loc.end); + }); + if (Array.isArray(ast.comments)) { + comments = ast.comments; + delete ast.comments; + } + if (ast.loc) fixFaultyLocations(ast, lines); + else ast.loc = { + start: lines.firstPos(), + end: lines.lastPos() + }; + ast.loc.lines = lines; + ast.loc.indent = 0; + let file; + let program; + if (ast.type === "Program") { + program = ast; + file = b$6.file(ast, options.sourceFileName || null); + file.loc = { + start: lines.firstPos(), + end: lines.lastPos(), + lines, + indent: 0 + }; + } else if (ast.type === "File") { + file = ast; + program = file.program; + } + if (options.tokens) file.tokens = tokens; + const trueProgramLoc = getTrueLoc({ + type: program.type, + loc: program.loc, + body: [], + comments + }, lines); + program.loc.start = trueProgramLoc.start; + program.loc.end = trueProgramLoc.end; + attach(comments, program.body.length ? file.program : file, lines); + return new TreeCopier(lines, tokens).copy(file); +} +const TreeCopier = function TreeCopier(lines, tokens) { + this.lines = lines; + this.tokens = tokens; + this.startTokenIndex = 0; + this.endTokenIndex = tokens.length; + this.indent = 0; + this.seen = /* @__PURE__ */ new Map(); +}; +const TCp = TreeCopier.prototype; +TCp.copy = function(node) { + if (this.seen.has(node)) return this.seen.get(node); + if (isArray$2.check(node)) { + const copy = new Array(node.length); + this.seen.set(node, copy); + node.forEach(function(item, i) { + copy[i] = this.copy(item); + }, this); + return copy; + } + if (!isObject$2.check(node)) return node; + fixFaultyLocations(node, this.lines); + const copy = Object.create(Object.getPrototypeOf(node), { original: { + value: node, + configurable: false, + enumerable: false, + writable: true + } }); + this.seen.set(node, copy); + const loc = node.loc; + const oldIndent = this.indent; + let newIndent = oldIndent; + const oldStartTokenIndex = this.startTokenIndex; + const oldEndTokenIndex = this.endTokenIndex; + if (loc) { + if (node.type === "Block" || node.type === "Line" || node.type === "CommentBlock" || node.type === "CommentLine" || this.lines.isPrecededOnlyByWhitespace(loc.start)) newIndent = this.indent = loc.start.column; + loc.lines = this.lines; + loc.tokens = this.tokens; + loc.indent = newIndent; + this.findTokenRange(loc); + } + const keys = Object.keys(node); + const keyCount = keys.length; + for (let i = 0; i < keyCount; ++i) { + const key = keys[i]; + if (key === "loc") copy[key] = node[key]; + else if (key === "tokens" && node.type === "File") copy[key] = node[key]; + else copy[key] = this.copy(node[key]); + } + this.indent = oldIndent; + this.startTokenIndex = oldStartTokenIndex; + this.endTokenIndex = oldEndTokenIndex; + return copy; +}; +TCp.findTokenRange = function(loc) { + while (this.startTokenIndex > 0) { + const token = loc.tokens[this.startTokenIndex]; + if (comparePos(loc.start, token.loc.start) < 0) --this.startTokenIndex; + else break; + } + while (this.endTokenIndex < loc.tokens.length) { + const token = loc.tokens[this.endTokenIndex]; + if (comparePos(token.loc.end, loc.end) < 0) ++this.endTokenIndex; + else break; + } + while (this.startTokenIndex < this.endTokenIndex) { + const token = loc.tokens[this.startTokenIndex]; + if (comparePos(token.loc.start, loc.start) < 0) ++this.startTokenIndex; + else break; + } + loc.start.token = this.startTokenIndex; + while (this.endTokenIndex > this.startTokenIndex) { + const token = loc.tokens[this.endTokenIndex - 1]; + if (comparePos(loc.end, token.loc.end) < 0) --this.endTokenIndex; + else break; + } + loc.end.token = this.endTokenIndex; +}; +//#endregion +//#region vendor/recast/lib/fast-path.ts +const n = namedTypes$1; +const isArray$1 = builtInTypes.array; +const isNumber = builtInTypes.number; +const PRECEDENCE = {}; +[ + ["??"], + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + [ + "==", + "===", + "!=", + "!==" + ], + [ + "<", + ">", + "<=", + ">=", + "in", + "instanceof" + ], + [ + ">>", + "<<", + ">>>" + ], + ["+", "-"], + [ + "*", + "/", + "%" + ], + ["**"] +].forEach(function(tier, i) { + tier.forEach(function(op) { + PRECEDENCE[op] = i; + }); +}); +const FastPath = function FastPath(value) { + this.stack = [value]; +}; +const FPp = FastPath.prototype; +FastPath.from = function(obj) { + if (obj instanceof FastPath) return obj.copy(); + if (obj instanceof NodePath) { + const copy = Object.create(FastPath.prototype); + const stack = [obj.value]; + for (let pp; pp = obj.parentPath; obj = pp) stack.push(obj.name, pp.value); + copy.stack = stack.reverse(); + return copy; + } + return new FastPath(obj); +}; +FPp.copy = function copy() { + const copy = Object.create(FastPath.prototype); + copy.stack = this.stack.slice(0); + return copy; +}; +FPp.getName = function getName() { + const s = this.stack; + const len = s.length; + if (len > 1) return s[len - 2]; + return null; +}; +FPp.getValue = function getValue() { + const s = this.stack; + return s[s.length - 1]; +}; +FPp.valueIsDuplicate = function() { + const s = this.stack; + const valueIndex = s.length - 1; + return s.lastIndexOf(s[valueIndex], valueIndex - 1) >= 0; +}; +function getNodeHelper(path, count) { + const s = path.stack; + for (let i = s.length - 1; i >= 0; i -= 2) { + const value = s[i]; + if (n.Node.check(value) && --count < 0) return value; + } + return null; +} +FPp.getNode = function getNode(count = 0) { + return getNodeHelper(this, ~~count); +}; +FPp.getParentNode = function getParentNode(count = 0) { + return getNodeHelper(this, ~~count + 1); +}; +FPp.getRootValue = function getRootValue() { + const s = this.stack; + if (s.length % 2 === 0) return s[1]; + return s[0]; +}; +FPp.call = function call(callback) { + const s = this.stack; + const origLen = s.length; + let value = s[origLen - 1]; + const argc = arguments.length; + for (let i = 1; i < argc; ++i) { + const name = arguments[i]; + value = value[name]; + s.push(name, value); + } + const result = callback(this); + s.length = origLen; + return result; +}; +FPp.each = function each(callback) { + const s = this.stack; + const origLen = s.length; + let value = s[origLen - 1]; + const argc = arguments.length; + for (let i = 1; i < argc; ++i) { + const name = arguments[i]; + value = value[name]; + s.push(name, value); + } + for (let i = 0; i < value.length; ++i) if (i in value) { + s.push(i, value[i]); + callback(this); + s.length -= 2; + } + s.length = origLen; +}; +FPp.map = function map(callback) { + const s = this.stack; + const origLen = s.length; + let value = s[origLen - 1]; + const argc = arguments.length; + for (let i = 1; i < argc; ++i) { + const name = arguments[i]; + value = value[name]; + s.push(name, value); + } + const result = new Array(value.length); + for (let i = 0; i < value.length; ++i) if (i in value) { + s.push(i, value[i]); + result[i] = callback(this, i); + s.length -= 2; + } + s.length = origLen; + return result; +}; +FPp.hasParens = function() { + const node = this.getNode(); + const prevToken = this.getPrevToken(node); + if (!prevToken) return false; + const nextToken = this.getNextToken(node); + if (!nextToken) return false; + if (prevToken.value === "(") { + if (nextToken.value === ")") return true; + if (!this.canBeFirstInStatement() && this.firstInStatement() && !this.needsParens(true)) return true; + } + return false; +}; +FPp.getPrevToken = function(node) { + node = node || this.getNode(); + const loc = node && node.loc; + const tokens = loc && loc.tokens; + if (tokens && loc.start.token > 0) { + const token = tokens[loc.start.token - 1]; + if (token) { + const rootLoc = this.getRootValue().loc; + if (comparePos(rootLoc.start, token.loc.start) <= 0) return token; + } + } + return null; +}; +FPp.getNextToken = function(node) { + node = node || this.getNode(); + const loc = node && node.loc; + const tokens = loc && loc.tokens; + if (tokens && loc.end.token < tokens.length) { + const token = tokens[loc.end.token]; + if (token) { + const rootLoc = this.getRootValue().loc; + if (comparePos(token.loc.end, rootLoc.end) <= 0) return token; + } + } + return null; +}; +FPp.needsParens = function(assumeExpressionContext) { + const node = this.getNode(); + if (node.type === "AssignmentExpression" && node.left.type === "ObjectPattern") return true; + const parent = this.getParentNode(); + const name = this.getName(); + if (this.getValue() !== node) return false; + if (n.Statement.check(node)) return false; + if (node.type === "Identifier") return false; + if (parent && parent.type === "ParenthesizedExpression") return false; + if (node.extra && node.extra.parenthesized) return true; + if (!parent) return false; + if (node.type === "UnaryExpression" && parent.type === "BinaryExpression" && name === "left" && parent.left === node && parent.operator === "**") return true; + switch (node.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": return parent.type === "MemberExpression" && name === "object" && parent.object === node; + case "BinaryExpression": + case "LogicalExpression": + switch (parent.type) { + case "CallExpression": return name === "callee" && parent.callee === node; + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": return true; + case "MemberExpression": return name === "object" && parent.object === node; + case "BinaryExpression": + case "LogicalExpression": { + const pp = PRECEDENCE[parent.operator]; + const np = PRECEDENCE[node.operator]; + if (pp > np) return true; + if (pp === np && name === "right") return true; + break; + } + default: return false; + } + break; + case "SequenceExpression": switch (parent.type) { + case "ReturnStatement": return false; + case "ForStatement": return false; + case "ExpressionStatement": return name !== "expression"; + default: return true; + } + case "OptionalIndexedAccessType": return node.optional && parent.type === "IndexedAccessType"; + case "IntersectionTypeAnnotation": + case "UnionTypeAnnotation": return parent.type === "NullableTypeAnnotation"; + case "Literal": return parent.type === "MemberExpression" && isNumber.check(node.value) && name === "object" && parent.object === node; + case "NumericLiteral": return parent.type === "MemberExpression" && name === "object" && parent.object === node; + case "YieldExpression": + case "AwaitExpression": + case "AssignmentExpression": + case "ConditionalExpression": switch (parent.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "BinaryExpression": + case "LogicalExpression": return true; + case "CallExpression": + case "NewExpression": return name === "callee" && parent.callee === node; + case "ConditionalExpression": return name === "test" && parent.test === node; + case "MemberExpression": return name === "object" && parent.object === node; + default: return false; + } + case "ArrowFunctionExpression": + if (n.CallExpression.check(parent) && name === "callee" && parent.callee === node) return true; + if (n.MemberExpression.check(parent) && name === "object" && parent.object === node) return true; + if (n.TSAsExpression && n.TSAsExpression.check(parent) && name === "expression" && parent.expression === node) return true; + return isBinary(parent); + case "ObjectExpression": + if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node) return true; + break; + case "TSAsExpression": + if (parent.type === "ArrowFunctionExpression" && name === "body" && parent.body === node && node.expression.type === "ObjectExpression") return true; + break; + case "CallExpression": if (name === "declaration" && n.ExportDefaultDeclaration.check(parent) && n.FunctionExpression.check(node.callee)) return true; + } + if (parent.type === "NewExpression" && name === "callee" && parent.callee === node) return containsCallExpression(node); + if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) return true; + return false; +}; +function isBinary(node) { + return n.BinaryExpression.check(node) || n.LogicalExpression.check(node); +} +function containsCallExpression(node) { + if (n.CallExpression.check(node)) return true; + if (isArray$1.check(node)) return node.some(containsCallExpression); + if (n.Node.check(node)) return someField(node, (_name, child) => containsCallExpression(child)); + return false; +} +FPp.canBeFirstInStatement = function() { + const node = this.getNode(); + if (n.FunctionExpression.check(node)) return false; + if (n.ObjectExpression.check(node)) return false; + if (n.ClassExpression.check(node)) return false; + return true; +}; +FPp.firstInStatement = function() { + const s = this.stack; + let parentName, parent; + let childName, child; + for (let i = s.length - 1; i >= 0; i -= 2) { + if (n.Node.check(s[i])) { + childName = parentName; + child = parent; + parentName = s[i - 1]; + parent = s[i]; + } + if (!parent || !child) continue; + if (n.BlockStatement.check(parent) && parentName === "body" && childName === 0) return true; + if (n.ExpressionStatement.check(parent) && childName === "expression") return true; + if (n.AssignmentExpression.check(parent) && childName === "left") return true; + if (n.ArrowFunctionExpression.check(parent) && childName === "body") return true; + if (n.SequenceExpression.check(parent) && s[i + 1] === "expressions" && childName === 0) continue; + if (n.CallExpression.check(parent) && childName === "callee") continue; + if (n.MemberExpression.check(parent) && childName === "object") continue; + if (n.ConditionalExpression.check(parent) && childName === "test") continue; + if (isBinary(parent) && childName === "left") continue; + if (n.UnaryExpression.check(parent) && !parent.prefix && childName === "argument") continue; + return false; + } + return true; +}; +//#endregion +//#region vendor/recast/lib/patcher.ts +const Printable = namedTypes$1.Printable; +const Expression = namedTypes$1.Expression; +const ReturnStatement = namedTypes$1.ReturnStatement; +const SourceLocation = namedTypes$1.SourceLocation; +const isObject$1 = builtInTypes.object; +const isArray = builtInTypes.array; +const isString$1 = builtInTypes.string; +const riskyAdjoiningCharExp = /[0-9a-z_$]/i; +const Patcher = function Patcher(lines) { + const self = this, replacements = []; + self.replace = function(loc, lines) { + if (isString$1.check(lines)) lines = fromString(lines); + replacements.push({ + lines, + start: loc.start, + end: loc.end + }); + }; + self.get = function(loc) { + loc = loc || { + start: { + line: 1, + column: 0 + }, + end: { + line: lines.length, + column: lines.getLineLength(lines.length) + } + }; + let sliceFrom = loc.start, toConcat = []; + function pushSlice(from, to) { + toConcat.push(lines.slice(from, to)); + } + replacements.sort((a, b) => comparePos(a.start, b.start)).forEach(function(rep) { + if (comparePos(sliceFrom, rep.start) > 0) {} else { + pushSlice(sliceFrom, rep.start); + toConcat.push(rep.lines); + sliceFrom = rep.end; + } + }); + pushSlice(sliceFrom, loc.end); + return concat(toConcat); + }; +}; +const Pp = Patcher.prototype; +Pp.tryToReprintComments = function(newNode, oldNode, print) { + const patcher = this; + if (!newNode.comments && !oldNode.comments) return true; + const newPath = FastPath.from(newNode); + const oldPath = FastPath.from(oldNode); + newPath.stack.push("comments", getSurroundingComments(newNode)); + oldPath.stack.push("comments", getSurroundingComments(oldNode)); + const reprints = []; + const ableToReprintComments = findArrayReprints(newPath, oldPath, reprints); + if (ableToReprintComments && reprints.length > 0) reprints.forEach(function(reprint) { + const oldComment = reprint.oldPath.getValue(); + patcher.replace(oldComment.loc, print(reprint.newPath).indentTail(oldComment.loc.indent)); + }); + return ableToReprintComments; +}; +function getSurroundingComments(node) { + const result = []; + if (node.comments && node.comments.length > 0) node.comments.forEach(function(comment) { + if (comment.leading || comment.trailing) result.push(comment); + }); + return result; +} +Pp.deleteComments = function(node) { + if (!node.comments) return; + const patcher = this; + node.comments.forEach(function(comment) { + if (comment.leading) patcher.replace({ + start: comment.loc.start, + end: node.loc.lines.skipSpaces(comment.loc.end, false, false) + }, ""); + else if (comment.trailing) patcher.replace({ + start: node.loc.lines.skipSpaces(comment.loc.start, true, false), + end: comment.loc.end + }, ""); + }); +}; +function getReprinter(path) { + const node = path.getValue(); + if (!Printable.check(node)) return; + const orig = node.original; + const origLoc = orig && orig.loc; + const lines = origLoc && origLoc.lines; + const reprints = []; + if (!lines || !findReprints(path, reprints)) return; + return function(print) { + const patcher = new Patcher(lines); + reprints.forEach(function(reprint) { + const newNode = reprint.newPath.getValue(); + const oldNode = reprint.oldPath.getValue(); + SourceLocation.assert(oldNode.loc, true); + const needToPrintNewPathWithComments = !patcher.tryToReprintComments(newNode, oldNode, print); + if (needToPrintNewPathWithComments) patcher.deleteComments(oldNode); + let newLines = print(reprint.newPath, { + includeComments: needToPrintNewPathWithComments, + avoidRootParens: oldNode.type === newNode.type && reprint.oldPath.hasParens() + }).indentTail(oldNode.loc.indent); + const nls = needsLeadingSpace(lines, oldNode.loc, newLines); + const nts = needsTrailingSpace(lines, oldNode.loc, newLines); + if (nls || nts) { + const newParts = []; + nls && newParts.push(" "); + newParts.push(newLines); + nts && newParts.push(" "); + newLines = concat(newParts); + } + patcher.replace(oldNode.loc, newLines); + }); + const patchedLines = patcher.get(origLoc).indentTail(-orig.loc.indent); + if (path.needsParens()) return concat([ + "(", + patchedLines, + ")" + ]); + return patchedLines; + }; +} +function needsLeadingSpace(oldLines, oldLoc, newLines) { + const posBeforeOldLoc = copyPos(oldLoc.start); + const charBeforeOldLoc = oldLines.prevPos(posBeforeOldLoc) && oldLines.charAt(posBeforeOldLoc); + const newFirstChar = newLines.charAt(newLines.firstPos()); + return charBeforeOldLoc && riskyAdjoiningCharExp.test(charBeforeOldLoc) && newFirstChar && riskyAdjoiningCharExp.test(newFirstChar); +} +function needsTrailingSpace(oldLines, oldLoc, newLines) { + const charAfterOldLoc = oldLines.charAt(oldLoc.end); + const newLastPos = newLines.lastPos(); + const newLastChar = newLines.prevPos(newLastPos) && newLines.charAt(newLastPos); + return newLastChar && riskyAdjoiningCharExp.test(newLastChar) && charAfterOldLoc && riskyAdjoiningCharExp.test(charAfterOldLoc); +} +function findReprints(newPath, reprints) { + const newNode = newPath.getValue(); + Printable.assert(newNode); + const oldNode = newNode.original; + Printable.assert(oldNode); + if (newNode.type !== oldNode.type) return false; + const canReprint = findChildReprints(newPath, new FastPath(oldNode), reprints); + if (!canReprint) reprints.length = 0; + return canReprint; +} +function findAnyReprints(newPath, oldPath, reprints) { + const newNode = newPath.getValue(); + if (newNode === oldPath.getValue()) return true; + if (isArray.check(newNode)) return findArrayReprints(newPath, oldPath, reprints); + if (isObject$1.check(newNode)) return findObjectReprints(newPath, oldPath, reprints); + return false; +} +function findArrayReprints(newPath, oldPath, reprints) { + const newNode = newPath.getValue(); + const oldNode = oldPath.getValue(); + if (newNode === oldNode || newPath.valueIsDuplicate() || oldPath.valueIsDuplicate()) return true; + isArray.assert(newNode); + const len = newNode.length; + if (!(isArray.check(oldNode) && oldNode.length === len)) return false; + for (let i = 0; i < len; ++i) { + newPath.stack.push(i, newNode[i]); + oldPath.stack.push(i, oldNode[i]); + const canReprint = findAnyReprints(newPath, oldPath, reprints); + newPath.stack.length -= 2; + oldPath.stack.length -= 2; + if (!canReprint) return false; + } + return true; +} +function findObjectReprints(newPath, oldPath, reprints) { + const newNode = newPath.getValue(); + isObject$1.assert(newNode); + if (newNode.original === null) return false; + const oldNode = oldPath.getValue(); + if (!isObject$1.check(oldNode)) return false; + if (newNode === oldNode || newPath.valueIsDuplicate() || oldPath.valueIsDuplicate()) return true; + if (Printable.check(newNode)) { + if (!Printable.check(oldNode)) return false; + const newParentNode = newPath.getParentNode(); + const oldParentNode = oldPath.getParentNode(); + if (oldParentNode !== null && oldParentNode.type === "FunctionTypeAnnotation" && newParentNode !== null && newParentNode.type === "FunctionTypeAnnotation") { + const oldNeedsParens = oldParentNode.params.length !== 1 || !!oldParentNode.params[0].name; + const newNeedParens = newParentNode.params.length !== 1 || !!newParentNode.params[0].name; + if (!oldNeedsParens && newNeedParens) return false; + } + if (newNode.type === oldNode.type) { + const childReprints = []; + if (findChildReprints(newPath, oldPath, childReprints)) reprints.push.apply(reprints, childReprints); + else if (oldNode.loc) reprints.push({ + oldPath: oldPath.copy(), + newPath: newPath.copy() + }); + else return false; + return true; + } + if (Expression.check(newNode) && Expression.check(oldNode) && oldNode.loc) { + reprints.push({ + oldPath: oldPath.copy(), + newPath: newPath.copy() + }); + return true; + } + return false; + } + return findChildReprints(newPath, oldPath, reprints); +} +function findChildReprints(newPath, oldPath, reprints) { + const newNode = newPath.getValue(); + const oldNode = oldPath.getValue(); + isObject$1.assert(newNode); + isObject$1.assert(oldNode); + if (newNode.original === null) return false; + if (newPath.needsParens() && !oldPath.hasParens()) return false; + const keys = getUnionOfKeys(oldNode, newNode); + if (oldNode.type === "File" || newNode.type === "File") delete keys.tokens; + delete keys.loc; + const originalReprintCount = reprints.length; + for (let k in keys) { + if (k.charAt(0) === "_") continue; + newPath.stack.push(k, getFieldValue(newNode, k)); + oldPath.stack.push(k, getFieldValue(oldNode, k)); + const canReprint = findAnyReprints(newPath, oldPath, reprints); + newPath.stack.length -= 2; + oldPath.stack.length -= 2; + if (!canReprint) return false; + } + if (ReturnStatement.check(newPath.getNode()) && reprints.length > originalReprintCount) return false; + return true; +} +//#endregion +//#region vendor/recast/lib/printer.ts +const namedTypes = namedTypes$1; +const isString = builtInTypes.string; +const isObject = builtInTypes.object; +const PrintResult = function PrintResult(code, sourceMap) { + isString.assert(code); + this.code = code; + if (sourceMap) { + isObject.assert(sourceMap); + this.map = sourceMap; + } +}; +const PRp = PrintResult.prototype; +let warnedAboutToString = false; +PRp.toString = function() { + if (!warnedAboutToString) { + console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."); + warnedAboutToString = true; + } + return this.code; +}; +const emptyPrintResult = new PrintResult(""); +const Printer = function Printer(config) { + const explicitTabWidth = config && config.tabWidth; + config = normalize(config); + config.sourceFileName = null; + function makePrintFunctionWith(options, overrides) { + options = Object.assign({}, options, overrides); + return (path) => print(path, options); + } + function print(path, options) { + options = options || {}; + if (options.includeComments) return printComments(path, makePrintFunctionWith(options, { includeComments: false })); + const oldTabWidth = config.tabWidth; + if (!explicitTabWidth) { + const loc = path.getNode().loc; + if (loc && loc.lines && loc.lines.guessTabWidth) config.tabWidth = loc.lines.guessTabWidth(); + } + const reprinter = getReprinter(path); + const lines = reprinter ? reprinter(print) : genericPrint(path, config, options, makePrintFunctionWith(options, { + includeComments: true, + avoidRootParens: false + })); + config.tabWidth = oldTabWidth; + return lines; + } + this.print = function(ast) { + if (!ast) return emptyPrintResult; + const lines = print(FastPath.from(ast), { + includeComments: true, + avoidRootParens: false + }); + return new PrintResult(lines.toString(config), composeSourceMaps(config.inputSourceMap, lines.getSourceMap(config.sourceMapName, config.sourceRoot))); + }; + this.printGenerically = function(ast) { + if (!ast) return emptyPrintResult; + function printGenerically(path) { + return printComments(path, (path) => genericPrint(path, config, { + includeComments: true, + avoidRootParens: false + }, printGenerically)); + } + const path = FastPath.from(ast); + const oldReuseWhitespace = config.reuseWhitespace; + config.reuseWhitespace = false; + const pr = new PrintResult(printGenerically(path).toString(config)); + config.reuseWhitespace = oldReuseWhitespace; + return pr; + }; +}; +function genericPrint(path, config, options, printPath) { + const node = path.getValue(); + const parts = []; + const linesWithoutParens = genericPrintNoParens(path, config, printPath); + if (!node || linesWithoutParens.isEmpty()) return linesWithoutParens; + let shouldAddParens = false; + const decoratorsLines = printDecorators(path, printPath); + if (decoratorsLines.isEmpty()) { + if (!options.avoidRootParens) shouldAddParens = path.needsParens(); + } else parts.push(decoratorsLines); + if (shouldAddParens) parts.unshift("("); + parts.push(linesWithoutParens); + if (shouldAddParens) parts.push(")"); + return concat(parts); +} +function genericPrintNoParens(path, options, print) { + const n = path.getValue(); + if (!n) return fromString(""); + if (typeof n === "string") return fromString(n, options); + namedTypes.Printable.assert(n); + const parts = []; + switch (n.type) { + case "File": return path.call(print, "program"); + case "Program": + if (n.directives) path.each(function(childPath) { + parts.push(print(childPath), ";\n"); + }, "directives"); + if (n.interpreter) parts.push(path.call(print, "interpreter")); + parts.push(path.call((bodyPath) => printStatementSequence(bodyPath, options, print), "body")); + return concat(parts); + case "Noop": + case "EmptyStatement": return fromString(""); + case "ExpressionStatement": return concat([path.call(print, "expression"), ";"]); + case "ParenthesizedExpression": return concat([ + "(", + path.call(print, "expression"), + ")" + ]); + case "BinaryExpression": + case "LogicalExpression": + case "AssignmentExpression": return fromString(" ").join([ + path.call(print, "left"), + n.operator, + path.call(print, "right") + ]); + case "AssignmentPattern": return concat([ + path.call(print, "left"), + " = ", + path.call(print, "right") + ]); + case "MemberExpression": + case "OptionalMemberExpression": { + parts.push(path.call(print, "object")); + const property = path.call(print, "property"); + const optional = getFieldValue(n, "optional"); + if (n.computed) parts.push(optional ? "?.[" : "[", property, "]"); + else parts.push(optional ? "?." : ".", property); + return concat(parts); + } + case "ChainExpression": return path.call(print, "expression"); + case "MetaProperty": return concat([ + path.call(print, "meta"), + ".", + path.call(print, "property") + ]); + case "BindExpression": + if (n.object) parts.push(path.call(print, "object")); + parts.push("::", path.call(print, "callee")); + return concat(parts); + case "Path": return fromString(".").join(n.body); + case "Identifier": return concat([ + fromString(n.name, options), + n.optional ? "?" : "", + path.call(print, "typeAnnotation") + ]); + case "SpreadElement": + case "SpreadElementPattern": + case "RestProperty": + case "SpreadProperty": + case "SpreadPropertyPattern": + case "ObjectTypeSpreadProperty": + case "RestElement": return concat([ + "...", + path.call(print, "argument"), + path.call(print, "typeAnnotation") + ]); + case "FunctionDeclaration": + case "FunctionExpression": + case "TSDeclareFunction": + if (n.declare) parts.push("declare "); + if (n.async) parts.push("async "); + parts.push("function"); + if (n.generator) parts.push("*"); + if (n.id) parts.push(" ", path.call(print, "id"), path.call(print, "typeParameters")); + else if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); + if (n.body) parts.push(" ", path.call(print, "body")); + return concat(parts); + case "ArrowFunctionExpression": + if (n.async) parts.push("async "); + if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + if (!options.arrowParensAlways && n.params.length === 1 && !n.rest && n.params[0].type === "Identifier" && !n.params[0].typeAnnotation && !n.returnType) parts.push(path.call(print, "params", 0)); + else parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); + parts.push(" => ", path.call(print, "body")); + return concat(parts); + case "MethodDefinition": return printMethod(path, options, print); + case "YieldExpression": + parts.push("yield"); + if (n.delegate) parts.push("*"); + if (n.argument) parts.push(" ", path.call(print, "argument")); + return concat(parts); + case "AwaitExpression": + parts.push("await"); + if (n.all) parts.push("*"); + if (n.argument) parts.push(" ", path.call(print, "argument")); + return concat(parts); + case "ModuleExpression": return concat([ + "module {\n", + path.call(print, "body").indent(options.tabWidth), + "\n}" + ]); + case "ModuleDeclaration": + parts.push("module", path.call(print, "id")); + if (n.source) parts.push("from", path.call(print, "source")); + else parts.push(path.call(print, "body")); + return fromString(" ").join(parts); + case "ImportSpecifier": + if (n.importKind && n.importKind !== "value") parts.push(n.importKind + " "); + if (n.imported) { + parts.push(path.call(print, "imported")); + if (n.local && n.local.name !== n.imported.name) parts.push(" as ", path.call(print, "local")); + } else if (n.id) { + parts.push(path.call(print, "id")); + if (n.name) parts.push(" as ", path.call(print, "name")); + } + return concat(parts); + case "ExportSpecifier": + if (n.exportKind && n.exportKind !== "value") parts.push(n.exportKind + " "); + if (n.local) { + parts.push(path.call(print, "local")); + if (n.exported && n.exported.name !== n.local.name) parts.push(" as ", path.call(print, "exported")); + } else if (n.id) { + parts.push(path.call(print, "id")); + if (n.name) parts.push(" as ", path.call(print, "name")); + } + return concat(parts); + case "ExportBatchSpecifier": return fromString("*"); + case "ImportNamespaceSpecifier": + parts.push("* as "); + if (n.local) parts.push(path.call(print, "local")); + else if (n.id) parts.push(path.call(print, "id")); + return concat(parts); + case "ImportDefaultSpecifier": + if (n.local) return path.call(print, "local"); + return path.call(print, "id"); + case "TSExportAssignment": return concat(["export = ", path.call(print, "expression")]); + case "ExportDeclaration": + case "ExportDefaultDeclaration": + case "ExportNamedDeclaration": return printExportDeclaration(path, options, print); + case "ExportAllDeclaration": + parts.push("export *"); + if (n.exported) parts.push(" as ", path.call(print, "exported")); + parts.push(" from ", path.call(print, "source"), ";"); + return concat(parts); + case "TSNamespaceExportDeclaration": + parts.push("export as namespace ", path.call(print, "id")); + return maybeAddSemicolon(concat(parts)); + case "ExportNamespaceSpecifier": return concat(["* as ", path.call(print, "exported")]); + case "ExportDefaultSpecifier": return path.call(print, "exported"); + case "Import": return fromString("import", options); + case "ImportExpression": return concat([ + "import(", + path.call(print, "source"), + ")" + ]); + case "ImportDeclaration": + parts.push("import "); + if (n.importKind && n.importKind !== "value") parts.push(n.importKind + " "); + if (n.specifiers && n.specifiers.length > 0) { + const unbracedSpecifiers = []; + const bracedSpecifiers = []; + path.each(function(specifierPath) { + const spec = specifierPath.getValue(); + if (spec.type === "ImportSpecifier") bracedSpecifiers.push(print(specifierPath)); + else if (spec.type === "ImportDefaultSpecifier" || spec.type === "ImportNamespaceSpecifier") unbracedSpecifiers.push(print(specifierPath)); + }, "specifiers"); + unbracedSpecifiers.forEach((lines, i) => { + if (i > 0) parts.push(", "); + parts.push(lines); + }); + if (bracedSpecifiers.length > 0) { + let lines = fromString(", ").join(bracedSpecifiers); + if (lines.getLineLength(1) > options.wrapColumn) lines = concat([fromString(",\n").join(bracedSpecifiers).indent(options.tabWidth), ","]); + if (unbracedSpecifiers.length > 0) parts.push(", "); + if (lines.length > 1) parts.push("{\n", lines, "\n}"); + else if (options.objectCurlySpacing) parts.push("{ ", lines, " }"); + else parts.push("{", lines, "}"); + } + parts.push(" from "); + } + parts.push(path.call(print, "source"), maybePrintImportAssertions(path, options, print), ";"); + return concat(parts); + case "ImportAttribute": return concat([ + path.call(print, "key"), + ": ", + path.call(print, "value") + ]); + case "StaticBlock": parts.push("static "); + case "BlockStatement": { + const naked = path.call((bodyPath) => printStatementSequence(bodyPath, options, print), "body"); + if (naked.isEmpty()) { + if (!n.directives || n.directives.length === 0) { + parts.push("{}"); + return concat(parts); + } + } + parts.push("{\n"); + if (n.directives) path.each(function(childPath) { + parts.push(maybeAddSemicolon(print(childPath).indent(options.tabWidth)), n.directives.length > 1 || !naked.isEmpty() ? "\n" : ""); + }, "directives"); + parts.push(naked.indent(options.tabWidth)); + parts.push("\n}"); + return concat(parts); + } + case "ReturnStatement": + parts.push("return"); + if (n.argument) { + const argLines = path.call(print, "argument"); + if (argLines.startsWithComment() || argLines.length > 1 && namedTypes.JSXElement && namedTypes.JSXElement.check(n.argument)) parts.push(" (\n", argLines.indent(options.tabWidth), "\n)"); + else parts.push(" ", argLines); + } + parts.push(";"); + return concat(parts); + case "CallExpression": + case "OptionalCallExpression": + parts.push(path.call(print, "callee")); + if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + if (n.typeArguments) parts.push(path.call(print, "typeArguments")); + if (getFieldValue(n, "optional")) parts.push("?."); + parts.push(printArgumentsList(path, options, print)); + return concat(parts); + case "RecordExpression": parts.push("#"); + case "ObjectExpression": + case "ObjectPattern": + case "ObjectTypeAnnotation": { + const isTypeAnnotation = n.type === "ObjectTypeAnnotation"; + const separator = options.flowObjectCommas ? "," : isTypeAnnotation ? ";" : ","; + const fields = []; + let allowBreak = false; + if (isTypeAnnotation) { + fields.push("indexers", "callProperties"); + if (n.internalSlots != null) fields.push("internalSlots"); + } + fields.push("properties"); + let len = 0; + fields.forEach(function(field) { + len += n[field].length; + }); + const oneLine = isTypeAnnotation && len === 1 || len === 0; + const leftBrace = n.exact ? "{|" : "{"; + const rightBrace = n.exact ? "|}" : "}"; + parts.push(oneLine ? leftBrace : leftBrace + "\n"); + const leftBraceIndex = parts.length - 1; + let i = 0; + fields.forEach(function(field) { + path.each(function(childPath) { + let lines = print(childPath); + if (!oneLine) lines = lines.indent(options.tabWidth); + const multiLine = !isTypeAnnotation && lines.length > 1; + if (multiLine && allowBreak) parts.push("\n"); + parts.push(lines); + if (i < len - 1) { + parts.push(separator + (multiLine ? "\n\n" : "\n")); + allowBreak = !multiLine; + } else if (len !== 1 && isTypeAnnotation) parts.push(separator); + else if (!oneLine && isTrailingCommaEnabled(options, "objects") && childPath.getValue().type !== "RestElement") parts.push(separator); + i++; + }, field); + }); + if (n.inexact) { + const line = fromString("...", options); + if (oneLine) { + if (len > 0) parts.push(separator, " "); + parts.push(line); + } else parts.push("\n", line.indent(options.tabWidth)); + } + parts.push(oneLine ? rightBrace : "\n" + rightBrace); + if (i !== 0 && oneLine && options.objectCurlySpacing) { + parts[leftBraceIndex] = leftBrace + " "; + parts[parts.length - 1] = " " + rightBrace; + } + if (n.typeAnnotation) parts.push(path.call(print, "typeAnnotation")); + return concat(parts); + } + case "PropertyPattern": return concat([ + path.call(print, "key"), + ": ", + path.call(print, "pattern") + ]); + case "ObjectProperty": + case "Property": { + if (n.method || n.kind === "get" || n.kind === "set") return printMethod(path, options, print); + if (n.shorthand && n.value.type === "AssignmentPattern") return path.call(print, "value"); + const key = path.call(print, "key"); + if (n.computed) parts.push("[", key, "]"); + else parts.push(key); + if (!n.shorthand || n.key.name !== n.value.name) parts.push(": ", path.call(print, "value")); + return concat(parts); + } + case "ClassMethod": + case "ObjectMethod": + case "ClassPrivateMethod": + case "TSDeclareMethod": return printMethod(path, options, print); + case "PrivateName": return concat(["#", path.call(print, "id")]); + case "Decorator": return concat(["@", path.call(print, "expression")]); + case "TupleExpression": parts.push("#"); + case "ArrayExpression": + case "ArrayPattern": { + const len = n.elements.length; + const printed = path.map(print, "elements"); + const oneLine = fromString(", ").join(printed).getLineLength(1) <= options.wrapColumn; + if (oneLine) if (options.arrayBracketSpacing) parts.push("[ "); + else parts.push("["); + else parts.push("[\n"); + path.each(function(elemPath) { + const i = elemPath.getName(); + if (!elemPath.getValue()) parts.push(","); + else { + let lines = printed[i]; + if (oneLine) { + if (i > 0) parts.push(" "); + } else lines = lines.indent(options.tabWidth); + parts.push(lines); + if (i < len - 1 || !oneLine && isTrailingCommaEnabled(options, "arrays")) parts.push(","); + if (!oneLine) parts.push("\n"); + } + }, "elements"); + if (oneLine && options.arrayBracketSpacing) parts.push(" ]"); + else parts.push("]"); + if (n.typeAnnotation) parts.push(path.call(print, "typeAnnotation")); + return concat(parts); + } + case "SequenceExpression": return fromString(", ").join(path.map(print, "expressions")); + case "ThisExpression": return fromString("this"); + case "Super": return fromString("super"); + case "NullLiteral": return fromString("null"); + case "RegExpLiteral": return fromString(getPossibleRaw(n) || `/${n.pattern}/${n.flags || ""}`, options); + case "BigIntLiteral": return fromString(getPossibleRaw(n) || n.value + "n", options); + case "NumericLiteral": return fromString(getPossibleRaw(n) || n.value, options); + case "DecimalLiteral": return fromString(getPossibleRaw(n) || n.value + "m", options); + case "StringLiteral": return fromString(nodeStr(n.value, options)); + case "BooleanLiteral": + case "Literal": return fromString(getPossibleRaw(n) || (typeof n.value === "string" ? nodeStr(n.value, options) : n.value), options); + case "Directive": return path.call(print, "value"); + case "DirectiveLiteral": return fromString(getPossibleRaw(n) || nodeStr(n.value, options), options); + case "InterpreterDirective": return fromString(`#!${n.value}\n`, options); + case "ModuleSpecifier": + if (n.local) throw new Error("The ESTree ModuleSpecifier type should be abstract"); + return fromString(nodeStr(n.value, options), options); + case "UnaryExpression": + parts.push(n.operator); + if (/[a-z]$/.test(n.operator)) parts.push(" "); + parts.push(path.call(print, "argument")); + return concat(parts); + case "UpdateExpression": + parts.push(path.call(print, "argument"), n.operator); + if (n.prefix) parts.reverse(); + return concat(parts); + case "ConditionalExpression": return concat([ + path.call(print, "test"), + " ? ", + path.call(print, "consequent"), + " : ", + path.call(print, "alternate") + ]); + case "NewExpression": + parts.push("new ", path.call(print, "callee")); + if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + if (n.typeArguments) parts.push(path.call(print, "typeArguments")); + if (n.arguments) parts.push(printArgumentsList(path, options, print)); + return concat(parts); + case "VariableDeclaration": { + if (n.declare) parts.push("declare "); + parts.push(n.kind, " "); + let maxLen = 0; + const printed = path.map(function(childPath) { + const lines = print(childPath); + maxLen = Math.max(lines.length, maxLen); + return lines; + }, "declarations"); + if (maxLen === 1) parts.push(fromString(", ").join(printed)); + else if (printed.length > 1) parts.push(fromString(",\n").join(printed).indentTail(n.kind.length + 1)); + else parts.push(printed[0]); + const parentNode = path.getParentNode(); + if (!namedTypes.ForStatement.check(parentNode) && !namedTypes.ForInStatement.check(parentNode) && !(namedTypes.ForOfStatement && namedTypes.ForOfStatement.check(parentNode)) && !(namedTypes.ForAwaitStatement && namedTypes.ForAwaitStatement.check(parentNode))) parts.push(";"); + return concat(parts); + } + case "VariableDeclarator": return n.init ? fromString(" = ").join([path.call(print, "id"), path.call(print, "init")]) : path.call(print, "id"); + case "WithStatement": return concat([ + "with (", + path.call(print, "object"), + ") ", + path.call(print, "body") + ]); + case "IfStatement": { + const con = adjustClause(path.call(print, "consequent"), options); + parts.push("if (", path.call(print, "test"), ")", con); + if (n.alternate) parts.push(endsWithBrace(con) ? " else" : "\nelse", adjustClause(path.call(print, "alternate"), options)); + return concat(parts); + } + case "ForStatement": { + const init = path.call(print, "init"); + const head = concat([ + "for (", + fromString(init.length > 1 ? ";\n" : "; ").join([ + init, + path.call(print, "test"), + path.call(print, "update") + ]).indentTail(5), + ")" + ]); + let clause = adjustClause(path.call(print, "body"), options); + parts.push(head); + if (head.length > 1) { + parts.push("\n"); + clause = clause.trimLeft(); + } + parts.push(clause); + return concat(parts); + } + case "WhileStatement": return concat([ + "while (", + path.call(print, "test"), + ")", + adjustClause(path.call(print, "body"), options) + ]); + case "ForInStatement": return concat([ + n.each ? "for each (" : "for (", + path.call(print, "left"), + " in ", + path.call(print, "right"), + ")", + adjustClause(path.call(print, "body"), options) + ]); + case "ForOfStatement": + case "ForAwaitStatement": + parts.push("for "); + if (n.await || n.type === "ForAwaitStatement") parts.push("await "); + parts.push("(", path.call(print, "left"), " of ", path.call(print, "right"), ")", adjustClause(path.call(print, "body"), options)); + return concat(parts); + case "DoWhileStatement": { + const doBody = concat(["do", adjustClause(path.call(print, "body"), options)]); + parts.push(doBody); + if (endsWithBrace(doBody)) parts.push(" while"); + else parts.push("\nwhile"); + parts.push(" (", path.call(print, "test"), ");"); + return concat(parts); + } + case "DoExpression": return concat([ + "do {\n", + path.call((bodyPath) => printStatementSequence(bodyPath, options, print), "body").indent(options.tabWidth), + "\n}" + ]); + case "BreakStatement": + parts.push("break"); + if (n.label) parts.push(" ", path.call(print, "label")); + parts.push(";"); + return concat(parts); + case "ContinueStatement": + parts.push("continue"); + if (n.label) parts.push(" ", path.call(print, "label")); + parts.push(";"); + return concat(parts); + case "LabeledStatement": return concat([ + path.call(print, "label"), + ":\n", + path.call(print, "body") + ]); + case "TryStatement": + parts.push("try ", path.call(print, "block")); + if (n.handler) parts.push(" ", path.call(print, "handler")); + else if (n.handlers) path.each(function(handlerPath) { + parts.push(" ", print(handlerPath)); + }, "handlers"); + if (n.finalizer) parts.push(" finally ", path.call(print, "finalizer")); + return concat(parts); + case "CatchClause": + parts.push("catch "); + if (n.param) parts.push("(", path.call(print, "param")); + if (n.guard) parts.push(" if ", path.call(print, "guard")); + if (n.param) parts.push(") "); + parts.push(path.call(print, "body")); + return concat(parts); + case "ThrowStatement": return concat([ + "throw ", + path.call(print, "argument"), + ";" + ]); + case "SwitchStatement": return concat([ + "switch (", + path.call(print, "discriminant"), + ") {\n", + fromString("\n").join(path.map(print, "cases")), + "\n}" + ]); + case "SwitchCase": + if (n.test) parts.push("case ", path.call(print, "test"), ":"); + else parts.push("default:"); + if (n.consequent.length > 0) parts.push("\n", path.call((consequentPath) => printStatementSequence(consequentPath, options, print), "consequent").indent(options.tabWidth)); + return concat(parts); + case "DebuggerStatement": return fromString("debugger;"); + case "JSXAttribute": + parts.push(path.call(print, "name")); + if (n.value) parts.push("=", path.call(print, "value")); + return concat(parts); + case "JSXIdentifier": return fromString(n.name, options); + case "JSXNamespacedName": return fromString(":").join([path.call(print, "namespace"), path.call(print, "name")]); + case "JSXMemberExpression": return fromString(".").join([path.call(print, "object"), path.call(print, "property")]); + case "JSXSpreadAttribute": return concat([ + "{...", + path.call(print, "argument"), + "}" + ]); + case "JSXSpreadChild": return concat([ + "{...", + path.call(print, "expression"), + "}" + ]); + case "JSXExpressionContainer": return concat([ + "{", + path.call(print, "expression"), + "}" + ]); + case "JSXElement": + case "JSXFragment": { + const openingPropName = "opening" + (n.type === "JSXElement" ? "Element" : "Fragment"); + const closingPropName = "closing" + (n.type === "JSXElement" ? "Element" : "Fragment"); + const openingLines = path.call(print, openingPropName); + if (n[openingPropName].selfClosing) return openingLines; + return concat([ + openingLines, + concat(path.map(function(childPath) { + const child = childPath.getValue(); + if (namedTypes.Literal.check(child) && typeof child.value === "string") { + if (/\S/.test(child.value)) return child.value.replace(/^\s+|\s+$/g, ""); + else if (/\n/.test(child.value)) return "\n"; + } + return print(childPath); + }, "children")).indentTail(options.tabWidth), + path.call(print, closingPropName) + ]); + } + case "JSXOpeningElement": { + parts.push("<", path.call(print, "name")); + const attrParts = []; + path.each(function(attrPath) { + attrParts.push(" ", print(attrPath)); + }, "attributes"); + let attrLines = concat(attrParts); + if (attrLines.length > 1 || attrLines.getLineLength(1) > options.wrapColumn) { + attrParts.forEach(function(part, i) { + if (part === " ") attrParts[i] = "\n"; + }); + attrLines = concat(attrParts).indentTail(options.tabWidth); + } + parts.push(attrLines, n.selfClosing ? " />" : ">"); + return concat(parts); + } + case "JSXClosingElement": return concat([ + "" + ]); + case "JSXOpeningFragment": return fromString("<>"); + case "JSXClosingFragment": return fromString(""); + case "JSXText": return fromString(n.value, options); + case "JSXEmptyExpression": return fromString(""); + case "TypeAnnotatedIdentifier": return concat([ + path.call(print, "annotation"), + " ", + path.call(print, "identifier") + ]); + case "ClassBody": + if (n.body.length === 0) return fromString("{}"); + return concat([ + "{\n", + path.call((bodyPath) => printStatementSequence(bodyPath, options, print), "body").indent(options.tabWidth), + "\n}" + ]); + case "ClassPropertyDefinition": + parts.push("static ", path.call(print, "definition")); + if (!namedTypes.MethodDefinition.check(n.definition)) parts.push(";"); + return concat(parts); + case "ClassProperty": { + if (n.declare) parts.push("declare "); + const access = n.accessibility || n.access; + if (typeof access === "string") parts.push(access, " "); + if (n.static) parts.push("static "); + if (n.abstract) parts.push("abstract "); + if (n.readonly) parts.push("readonly "); + let key = path.call(print, "key"); + if (n.computed) key = concat([ + "[", + key, + "]" + ]); + if (n.variance) key = concat([printVariance(path, print), key]); + parts.push(key); + if (n.optional) parts.push("?"); + if (n.definite) parts.push("!"); + if (n.typeAnnotation) parts.push(path.call(print, "typeAnnotation")); + if (n.value) parts.push(" = ", path.call(print, "value")); + parts.push(";"); + return concat(parts); + } + case "ClassPrivateProperty": + if (n.static) parts.push("static "); + parts.push(path.call(print, "key")); + if (n.typeAnnotation) parts.push(path.call(print, "typeAnnotation")); + if (n.value) parts.push(" = ", path.call(print, "value")); + parts.push(";"); + return concat(parts); + case "ClassAccessorProperty": + parts.push(...printClassMemberModifiers(n), "accessor "); + if (n.computed) parts.push("[", path.call(print, "key"), "]"); + else parts.push(path.call(print, "key")); + if (n.optional) parts.push("?"); + if (n.definite) parts.push("!"); + if (n.typeAnnotation) parts.push(path.call(print, "typeAnnotation")); + if (n.value) parts.push(" = ", path.call(print, "value")); + parts.push(";"); + return concat(parts); + case "ClassDeclaration": + case "ClassExpression": + case "DeclareClass": + if (n.declare) parts.push("declare "); + if (n.abstract) parts.push("abstract "); + parts.push("class"); + if (n.id) parts.push(" ", path.call(print, "id")); + if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + if (n.superClass) parts.push(" extends ", path.call(print, "superClass"), path.call(print, "superTypeParameters")); + if (n.extends && n.extends.length > 0) parts.push(" extends ", fromString(", ").join(path.map(print, "extends"))); + if (n["implements"] && n["implements"].length > 0) parts.push(" implements ", fromString(", ").join(path.map(print, "implements"))); + parts.push(" ", path.call(print, "body")); + if (n.type === "DeclareClass") return printFlowDeclaration(path, parts); + else return concat(parts); + case "TemplateElement": return fromString(n.value.raw, options).lockIndentTail(); + case "TemplateLiteral": { + const expressions = path.map(print, "expressions"); + parts.push("`"); + path.each(function(childPath) { + const i = childPath.getName(); + parts.push(print(childPath)); + if (i < expressions.length) parts.push("${", expressions[i], "}"); + }, "quasis"); + parts.push("`"); + return concat(parts).lockIndentTail(); + } + case "TaggedTemplateExpression": return concat([path.call(print, "tag"), path.call(print, "quasi")]); + case "Node": + case "Printable": + case "SourceLocation": + case "Position": + case "Statement": + case "Function": + case "Pattern": + case "Expression": + case "Declaration": + case "Specifier": + case "NamedSpecifier": + case "Comment": + case "Flow": + case "FlowType": + case "FlowPredicate": + case "MemberTypeAnnotation": + case "Type": + case "TSHasOptionalTypeParameterInstantiation": + case "TSHasOptionalTypeParameters": + case "TSHasOptionalTypeAnnotation": + case "ChainElement": throw new Error("unprintable type: " + JSON.stringify(n.type)); + case "CommentBlock": + case "Block": return concat([ + "/*", + fromString(n.value, options), + "*/" + ]); + case "CommentLine": + case "Line": return concat(["//", fromString(n.value, options)]); + case "TypeAnnotation": + if (n.typeAnnotation) { + if (n.typeAnnotation.type !== "FunctionTypeAnnotation") parts.push(": "); + parts.push(path.call(print, "typeAnnotation")); + return concat(parts); + } + return fromString(""); + case "ExistentialTypeParam": + case "ExistsTypeAnnotation": return fromString("*", options); + case "EmptyTypeAnnotation": return fromString("empty", options); + case "AnyTypeAnnotation": return fromString("any", options); + case "MixedTypeAnnotation": return fromString("mixed", options); + case "ArrayTypeAnnotation": return concat([path.call(print, "elementType"), "[]"]); + case "TupleTypeAnnotation": { + const printed = path.map(print, "types"); + const oneLine = fromString(", ").join(printed).getLineLength(1) <= options.wrapColumn; + if (oneLine) if (options.arrayBracketSpacing) parts.push("[ "); + else parts.push("["); + else parts.push("[\n"); + path.each(function(elemPath) { + const i = elemPath.getName(); + if (!elemPath.getValue()) parts.push(","); + else { + let lines = printed[i]; + if (oneLine) { + if (i > 0) parts.push(" "); + } else lines = lines.indent(options.tabWidth); + parts.push(lines); + if (i < n.types.length - 1 || !oneLine && isTrailingCommaEnabled(options, "arrays")) parts.push(","); + if (!oneLine) parts.push("\n"); + } + }, "types"); + if (oneLine && options.arrayBracketSpacing) parts.push(" ]"); + else parts.push("]"); + return concat(parts); + } + case "BooleanTypeAnnotation": return fromString("boolean", options); + case "BooleanLiteralTypeAnnotation": return fromString("" + n.value, options); + case "InterfaceTypeAnnotation": + parts.push("interface"); + if (n.extends && n.extends.length > 0) parts.push(" extends ", fromString(", ").join(path.map(print, "extends"))); + parts.push(" ", path.call(print, "body")); + return concat(parts); + case "DeclareFunction": return printFlowDeclaration(path, [ + "function ", + path.call(print, "id"), + ";" + ]); + case "DeclareModule": return printFlowDeclaration(path, [ + "module ", + path.call(print, "id"), + " ", + path.call(print, "body") + ]); + case "DeclareModuleExports": return printFlowDeclaration(path, ["module.exports", path.call(print, "typeAnnotation")]); + case "DeclareVariable": return printFlowDeclaration(path, [ + "var ", + path.call(print, "id"), + ";" + ]); + case "DeclareExportDeclaration": + case "DeclareExportAllDeclaration": return concat(["declare ", printExportDeclaration(path, options, print)]); + case "EnumDeclaration": return concat([ + "enum ", + path.call(print, "id"), + path.call(print, "body") + ]); + case "EnumBooleanBody": + case "EnumNumberBody": + case "EnumStringBody": + case "EnumSymbolBody": + if (n.type === "EnumSymbolBody" || n.explicitType) parts.push(" of ", n.type.slice(4, -4).toLowerCase()); + parts.push(" {\n", fromString("\n").join(path.map(print, "members")).indent(options.tabWidth), "\n}"); + return concat(parts); + case "EnumDefaultedMember": return concat([path.call(print, "id"), ","]); + case "EnumBooleanMember": + case "EnumNumberMember": + case "EnumStringMember": return concat([ + path.call(print, "id"), + " = ", + path.call(print, "init"), + "," + ]); + case "InferredPredicate": return fromString("%checks", options); + case "DeclaredPredicate": return concat([ + "%checks(", + path.call(print, "value"), + ")" + ]); + case "FunctionTypeAnnotation": { + const parent = path.getParentNode(0); + const isArrowFunctionTypeAnnotation = !(namedTypes.ObjectTypeCallProperty.check(parent) || namedTypes.ObjectTypeInternalSlot.check(parent) && parent.method || namedTypes.DeclareFunction.check(path.getParentNode(2))); + if (isArrowFunctionTypeAnnotation && !namedTypes.FunctionTypeParam.check(parent) && !namedTypes.TypeAlias.check(parent)) parts.push(": "); + const hasTypeParameters = !!n.typeParameters; + const needsParens = hasTypeParameters || n.params.length !== 1 || n.params[0].name; + parts.push(hasTypeParameters ? path.call(print, "typeParameters") : "", needsParens ? "(" : "", printFunctionParams(path, options, print), needsParens ? ")" : ""); + if (n.returnType) parts.push(isArrowFunctionTypeAnnotation ? " => " : ": ", path.call(print, "returnType")); + return concat(parts); + } + case "FunctionTypeParam": { + const name = path.call(print, "name"); + parts.push(name); + if (n.optional) parts.push("?"); + if (name.infos[0].line) parts.push(": "); + parts.push(path.call(print, "typeAnnotation")); + return concat(parts); + } + case "GenericTypeAnnotation": return concat([path.call(print, "id"), path.call(print, "typeParameters")]); + case "DeclareInterface": parts.push("declare "); + case "InterfaceDeclaration": + case "TSInterfaceDeclaration": + if (n.declare) parts.push("declare "); + parts.push("interface ", path.call(print, "id"), path.call(print, "typeParameters"), " "); + if (n["extends"] && n["extends"].length > 0) parts.push("extends ", fromString(", ").join(path.map(print, "extends")), " "); + if (n.body) parts.push(path.call(print, "body")); + return concat(parts); + case "ClassImplements": + case "InterfaceExtends": return concat([path.call(print, "id"), path.call(print, "typeParameters")]); + case "IntersectionTypeAnnotation": return fromString(" & ").join(path.map(print, "types")); + case "NullableTypeAnnotation": return concat(["?", path.call(print, "typeAnnotation")]); + case "NullLiteralTypeAnnotation": return fromString("null", options); + case "ThisTypeAnnotation": return fromString("this", options); + case "NumberTypeAnnotation": return fromString("number", options); + case "ObjectTypeCallProperty": return path.call(print, "value"); + case "ObjectTypeIndexer": + if (n.static) parts.push("static "); + parts.push(printVariance(path, print), "["); + if (n.id) parts.push(path.call(print, "id"), ": "); + parts.push(path.call(print, "key"), "]: ", path.call(print, "value")); + return concat(parts); + case "ObjectTypeProperty": return concat([ + printVariance(path, print), + path.call(print, "key"), + n.optional ? "?" : "", + ": ", + path.call(print, "value") + ]); + case "ObjectTypeInternalSlot": return concat([ + n.static ? "static " : "", + "[[", + path.call(print, "id"), + "]]", + n.optional ? "?" : "", + n.value.type !== "FunctionTypeAnnotation" ? ": " : "", + path.call(print, "value") + ]); + case "QualifiedTypeIdentifier": return concat([ + path.call(print, "qualification"), + ".", + path.call(print, "id") + ]); + case "StringLiteralTypeAnnotation": return fromString(nodeStr(n.value, options), options); + case "NumberLiteralTypeAnnotation": + case "NumericLiteralTypeAnnotation": return fromString(JSON.stringify(n.value), options); + case "BigIntLiteralTypeAnnotation": return fromString(n.raw, options); + case "StringTypeAnnotation": return fromString("string", options); + case "DeclareTypeAlias": parts.push("declare "); + case "TypeAlias": return concat([ + "type ", + path.call(print, "id"), + path.call(print, "typeParameters"), + " = ", + path.call(print, "right"), + ";" + ]); + case "DeclareOpaqueType": parts.push("declare "); + case "OpaqueType": + parts.push("opaque type ", path.call(print, "id"), path.call(print, "typeParameters")); + if (n["supertype"]) parts.push(": ", path.call(print, "supertype")); + if (n["impltype"]) parts.push(" = ", path.call(print, "impltype")); + parts.push(";"); + return concat(parts); + case "TypeCastExpression": return concat([ + "(", + path.call(print, "expression"), + path.call(print, "typeAnnotation"), + ")" + ]); + case "TypeParameterDeclaration": + case "TypeParameterInstantiation": return concat([ + "<", + fromString(", ").join(path.map(print, "params")), + ">" + ]); + case "Variance": + if (n.kind === "plus") return fromString("+"); + if (n.kind === "minus") return fromString("-"); + return fromString(""); + case "TypeParameter": + if (n.variance) parts.push(printVariance(path, print)); + parts.push(path.call(print, "name")); + if (n.bound) parts.push(path.call(print, "bound")); + if (n["default"]) parts.push("=", path.call(print, "default")); + return concat(parts); + case "TypeofTypeAnnotation": return concat([fromString("typeof ", options), path.call(print, "argument")]); + case "IndexedAccessType": + case "OptionalIndexedAccessType": return concat([ + path.call(print, "objectType"), + n.optional ? "?." : "", + "[", + path.call(print, "indexType"), + "]" + ]); + case "UnionTypeAnnotation": return fromString(" | ").join(path.map(print, "types")); + case "VoidTypeAnnotation": return fromString("void", options); + case "NullTypeAnnotation": return fromString("null", options); + case "SymbolTypeAnnotation": return fromString("symbol", options); + case "BigIntTypeAnnotation": return fromString("bigint", options); + case "TSType": throw new Error("unprintable type: " + JSON.stringify(n.type)); + case "TSNumberKeyword": return fromString("number", options); + case "TSBigIntKeyword": return fromString("bigint", options); + case "TSObjectKeyword": return fromString("object", options); + case "TSBooleanKeyword": return fromString("boolean", options); + case "TSStringKeyword": return fromString("string", options); + case "TSSymbolKeyword": return fromString("symbol", options); + case "TSAnyKeyword": return fromString("any", options); + case "TSVoidKeyword": return fromString("void", options); + case "TSIntrinsicKeyword": return fromString("intrinsic", options); + case "TSThisType": return fromString("this", options); + case "TSNullKeyword": return fromString("null", options); + case "TSUndefinedKeyword": return fromString("undefined", options); + case "TSUnknownKeyword": return fromString("unknown", options); + case "TSNeverKeyword": return fromString("never", options); + case "TSArrayType": return concat([path.call(print, "elementType"), "[]"]); + case "TSLiteralType": return path.call(print, "literal"); + case "TSUnionType": return fromString(" | ").join(path.map(print, "types")); + case "TSIntersectionType": return fromString(" & ").join(path.map(print, "types")); + case "TSConditionalType": + parts.push(path.call(print, "checkType"), " extends ", path.call(print, "extendsType"), " ? ", path.call(print, "trueType"), " : ", path.call(print, "falseType")); + return concat(parts); + case "TSInferType": + parts.push("infer ", path.call(print, "typeParameter")); + return concat(parts); + case "TSParenthesizedType": return concat([ + "(", + path.call(print, "typeAnnotation"), + ")" + ]); + case "TSFunctionType": return concat([ + path.call(print, "typeParameters"), + "(", + printFunctionParams(path, options, print), + ") => ", + path.call(print, "typeAnnotation", "typeAnnotation") + ]); + case "TSConstructorType": return concat([ + "new ", + path.call(print, "typeParameters"), + "(", + printFunctionParams(path, options, print), + ") => ", + path.call(print, "typeAnnotation", "typeAnnotation") + ]); + case "TSMappedType": + parts.push(n.readonly ? "readonly " : "", "[", path.call(print, "typeParameter"), "]", n.optional ? "?" : ""); + if (n.typeAnnotation) parts.push(": ", path.call(print, "typeAnnotation"), ";"); + return concat([ + "{\n", + concat(parts).indent(options.tabWidth), + "\n}" + ]); + case "TSTupleType": return concat([ + "[", + fromString(", ").join(path.map(print, "elementTypes")), + "]" + ]); + case "TSNamedTupleMember": + parts.push(path.call(print, "label")); + if (n.optional) parts.push("?"); + parts.push(": ", path.call(print, "elementType")); + return concat(parts); + case "TSRestType": return concat(["...", path.call(print, "typeAnnotation")]); + case "TSOptionalType": return concat([path.call(print, "typeAnnotation"), "?"]); + case "TSIndexedAccessType": return concat([ + path.call(print, "objectType"), + "[", + path.call(print, "indexType"), + "]" + ]); + case "TSTypeOperator": return concat([ + path.call(print, "operator"), + " ", + path.call(print, "typeAnnotation") + ]); + case "TSTypeLiteral": { + const members = fromString("\n").join(path.map(print, "members").map((member) => { + if (lastNonSpaceCharacter(member) !== ";") return member.concat(";"); + return member; + })); + if (members.isEmpty()) return fromString("{}", options); + parts.push("{\n", members.indent(options.tabWidth), "\n}"); + return concat(parts); + } + case "TSEnumMember": + parts.push(path.call(print, "id")); + if (n.initializer) parts.push(" = ", path.call(print, "initializer")); + return concat(parts); + case "TSTypeQuery": return concat(["typeof ", path.call(print, "exprName")]); + case "TSParameterProperty": + if (n.accessibility) parts.push(n.accessibility, " "); + if (n.export) parts.push("export "); + if (n.static) parts.push("static "); + if (n.readonly) parts.push("readonly "); + parts.push(path.call(print, "parameter")); + return concat(parts); + case "TSTypeReference": return concat([path.call(print, "typeName"), path.call(print, "typeParameters")]); + case "TSQualifiedName": return concat([ + path.call(print, "left"), + ".", + path.call(print, "right") + ]); + case "TSAsExpression": + case "TSSatisfiesExpression": { + const expression = path.call(print, "expression"); + parts.push(expression, n.type === "TSSatisfiesExpression" ? " satisfies " : " as ", path.call(print, "typeAnnotation")); + return concat(parts); + } + case "TSTypeCastExpression": return concat([path.call(print, "expression"), path.call(print, "typeAnnotation")]); + case "TSNonNullExpression": return concat([path.call(print, "expression"), "!"]); + case "TSTypeAnnotation": return concat([": ", path.call(print, "typeAnnotation")]); + case "TSIndexSignature": return concat([ + n.readonly ? "readonly " : "", + "[", + path.map(print, "parameters"), + "]", + path.call(print, "typeAnnotation") + ]); + case "TSPropertySignature": + parts.push(printVariance(path, print), n.readonly ? "readonly " : ""); + if (n.computed) parts.push("[", path.call(print, "key"), "]"); + else parts.push(path.call(print, "key")); + parts.push(n.optional ? "?" : "", path.call(print, "typeAnnotation")); + return concat(parts); + case "TSMethodSignature": + if (n.computed) parts.push("[", path.call(print, "key"), "]"); + else parts.push(path.call(print, "key")); + if (n.optional) parts.push("?"); + parts.push(path.call(print, "typeParameters"), "(", printFunctionParams(path, options, print), ")", path.call(print, "typeAnnotation")); + return concat(parts); + case "TSTypePredicate": + if (n.asserts) parts.push("asserts "); + parts.push(path.call(print, "parameterName")); + if (n.typeAnnotation) parts.push(" is ", path.call(print, "typeAnnotation", "typeAnnotation")); + return concat(parts); + case "TSCallSignatureDeclaration": return concat([ + path.call(print, "typeParameters"), + "(", + printFunctionParams(path, options, print), + ")", + path.call(print, "typeAnnotation") + ]); + case "TSConstructSignatureDeclaration": + if (n.typeParameters) parts.push("new", path.call(print, "typeParameters")); + else parts.push("new "); + parts.push("(", printFunctionParams(path, options, print), ")", path.call(print, "typeAnnotation")); + return concat(parts); + case "TSTypeAliasDeclaration": return concat([ + n.declare ? "declare " : "", + "type ", + path.call(print, "id"), + path.call(print, "typeParameters"), + " = ", + path.call(print, "typeAnnotation"), + ";" + ]); + case "TSTypeParameter": { + parts.push(path.call(print, "name")); + const parent = path.getParentNode(0); + const isInMappedType = namedTypes.TSMappedType.check(parent); + if (n.constraint) parts.push(isInMappedType ? " in " : " extends ", path.call(print, "constraint")); + if (n["default"]) parts.push(" = ", path.call(print, "default")); + return concat(parts); + } + case "TSTypeAssertion": + parts.push("<", path.call(print, "typeAnnotation"), "> ", path.call(print, "expression")); + return concat(parts); + case "TSTypeParameterDeclaration": + case "TSTypeParameterInstantiation": return concat([ + "<", + fromString(", ").join(path.map(print, "params")), + ">" + ]); + case "TSEnumDeclaration": { + parts.push(n.declare ? "declare " : "", n.const ? "const " : "", "enum ", path.call(print, "id")); + const memberLines = fromString(",\n").join(path.map(print, "members")); + if (memberLines.isEmpty()) parts.push(" {}"); + else parts.push(" {\n", memberLines.indent(options.tabWidth), "\n}"); + return concat(parts); + } + case "TSExpressionWithTypeArguments": return concat([path.call(print, "expression"), path.call(print, "typeParameters")]); + case "TSInterfaceBody": { + const lines = fromString("\n").join(path.map(print, "body").map((element) => { + if (lastNonSpaceCharacter(element) !== ";") return element.concat(";"); + return element; + })); + if (lines.isEmpty()) return fromString("{}", options); + return concat([ + "{\n", + lines.indent(options.tabWidth), + "\n}" + ]); + } + case "TSImportType": + parts.push("import(", path.call(print, "argument"), ")"); + if (n.qualifier) parts.push(".", path.call(print, "qualifier")); + if (n.typeParameters) parts.push(path.call(print, "typeParameters")); + return concat(parts); + case "TSImportEqualsDeclaration": + if (n.isExport) parts.push("export "); + parts.push("import ", path.call(print, "id"), " = ", path.call(print, "moduleReference")); + return maybeAddSemicolon(concat(parts)); + case "TSExternalModuleReference": return concat([ + "require(", + path.call(print, "expression"), + ")" + ]); + case "TSModuleDeclaration": + if (path.getParentNode().type === "TSModuleDeclaration") parts.push("."); + else { + if (n.declare) parts.push("declare "); + if (!n.global) if (n.id.type === "StringLiteral" || n.id.type === "Literal" && typeof n.id.value === "string") parts.push("module "); + else if (n.loc && n.loc.lines && n.id.loc) if (n.loc.lines.sliceString(n.loc.start, n.id.loc.start).indexOf("module") >= 0) parts.push("module "); + else parts.push("namespace "); + else parts.push("namespace "); + } + parts.push(path.call(print, "id")); + if (n.body) { + parts.push(" "); + parts.push(path.call(print, "body")); + } + return concat(parts); + case "TSModuleBlock": { + const naked = path.call((bodyPath) => printStatementSequence(bodyPath, options, print), "body"); + if (naked.isEmpty()) parts.push("{}"); + else parts.push("{\n", naked.indent(options.tabWidth), "\n}"); + return concat(parts); + } + case "TSInstantiationExpression": + parts.push(path.call(print, "expression"), path.call(print, "typeParameters")); + return concat(parts); + case "V8IntrinsicIdentifier": return concat(["%", path.call(print, "name")]); + case "TopicReference": return fromString("#"); + default: + debugger; + throw new Error("unknown type: " + JSON.stringify(n.type)); + } +} +function printDecorators(path, printPath) { + const parts = []; + const node = path.getValue(); + if (node.decorators && node.decorators.length > 0 && !getParentExportDeclaration(path)) path.each(function(decoratorPath) { + parts.push(printPath(decoratorPath), "\n"); + }, "decorators"); + else if (isExportDeclaration(node) && node.declaration && node.declaration.decorators) path.each(function(decoratorPath) { + parts.push(printPath(decoratorPath), "\n"); + }, "declaration", "decorators"); + return concat(parts); +} +function printStatementSequence(path, options, print) { + const filtered = []; + let sawComment = false; + path.each(function(stmtPath) { + const stmt = stmtPath.getValue(); + if (!stmt) return; + if (stmt.type === "EmptyStatement" && !(stmt.comments && stmt.comments.length > 0)) return; + if (namedTypes.Comment.check(stmt)) sawComment = true; + else if (namedTypes.Statement.check(stmt)); + else isString.assert(stmt); + filtered.push({ + node: stmt, + printed: print(stmtPath) + }); + }); + if (sawComment) {} + let prevTrailingSpace = null; + const len = filtered.length; + const parts = []; + filtered.forEach(function(info, i) { + const printed = info.printed; + const stmt = info.node; + const multiLine = printed.length > 1; + const notFirst = i > 0; + const notLast = i < len - 1; + let leadingSpace; + let trailingSpace; + const lines = stmt && stmt.loc && stmt.loc.lines; + const trueLoc = lines && options.reuseWhitespace && getTrueLoc(stmt, lines); + if (notFirst) if (trueLoc) { + const beforeStart = lines.skipSpaces(trueLoc.start, true); + const beforeStartLine = beforeStart ? beforeStart.line : 1; + const leadingGap = trueLoc.start.line - beforeStartLine; + leadingSpace = Array(leadingGap + 1).join("\n"); + } else leadingSpace = multiLine ? "\n\n" : "\n"; + else leadingSpace = ""; + if (notLast) if (trueLoc) { + const afterEnd = lines.skipSpaces(trueLoc.end); + const trailingGap = (afterEnd ? afterEnd.line : lines.length) - trueLoc.end.line; + trailingSpace = Array(trailingGap + 1).join("\n"); + } else trailingSpace = multiLine ? "\n\n" : "\n"; + else trailingSpace = ""; + parts.push(maxSpace(prevTrailingSpace, leadingSpace), printed); + if (notLast) prevTrailingSpace = trailingSpace; + else if (trailingSpace) parts.push(trailingSpace); + }); + return concat(parts); +} +function maxSpace(s1, s2) { + if (!s1 && !s2) return fromString(""); + if (!s1) return fromString(s2); + if (!s2) return fromString(s1); + const spaceLines1 = fromString(s1); + const spaceLines2 = fromString(s2); + if (spaceLines2.length > spaceLines1.length) return spaceLines2; + return spaceLines1; +} +function printClassMemberModifiers(node) { + const parts = []; + if (node.declare) parts.push("declare "); + const access = node.accessibility || node.access; + if (typeof access === "string") parts.push(access, " "); + if (node.static) parts.push("static "); + if (node.override) parts.push("override "); + if (node.abstract) parts.push("abstract "); + if (node.readonly) parts.push("readonly "); + return parts; +} +function printMethod(path, options, print) { + const node = path.getNode(); + const kind = node.kind; + const parts = []; + let nodeValue = node.value; + if (!namedTypes.FunctionExpression.check(nodeValue)) nodeValue = node; + parts.push(...printClassMemberModifiers(node)); + if (nodeValue.async) parts.push("async "); + if (nodeValue.generator) parts.push("*"); + if (kind === "get" || kind === "set") parts.push(kind, " "); + let key = path.call(print, "key"); + if (node.computed) key = concat([ + "[", + key, + "]" + ]); + parts.push(key); + if (node.optional) parts.push("?"); + if (node === nodeValue) { + parts.push(path.call(print, "typeParameters"), "(", printFunctionParams(path, options, print), ")", path.call(print, "returnType")); + if (node.body) parts.push(" ", path.call(print, "body")); + else parts.push(";"); + } else { + parts.push(path.call(print, "value", "typeParameters"), "(", path.call((valuePath) => printFunctionParams(valuePath, options, print), "value"), ")", path.call(print, "value", "returnType")); + if (nodeValue.body) parts.push(" ", path.call(print, "value", "body")); + else parts.push(";"); + } + return concat(parts); +} +function printArgumentsList(path, options, print) { + const printed = path.map(print, "arguments"); + const trailingComma = isTrailingCommaEnabled(options, "parameters"); + let joined = fromString(", ").join(printed); + if (joined.getLineLength(1) > options.wrapColumn) { + joined = fromString(",\n").join(printed); + return concat([ + "(\n", + joined.indent(options.tabWidth), + trailingComma ? ",\n)" : "\n)" + ]); + } + return concat([ + "(", + joined, + ")" + ]); +} +function printFunctionParams(path, options, print) { + const fun = path.getValue(); + let params; + let printed = []; + if (fun.params) { + params = fun.params; + printed = path.map(print, "params"); + } else if (fun.parameters) { + params = fun.parameters; + printed = path.map(print, "parameters"); + } + if (fun.defaults) path.each(function(defExprPath) { + const i = defExprPath.getName(); + const p = printed[i]; + if (p && defExprPath.getValue()) printed[i] = concat([ + p, + " = ", + print(defExprPath) + ]); + }, "defaults"); + if (fun.rest) printed.push(concat(["...", path.call(print, "rest")])); + let joined = fromString(", ").join(printed); + if (joined.length > 1 || joined.getLineLength(1) > options.wrapColumn) { + joined = fromString(",\n").join(printed); + if (isTrailingCommaEnabled(options, "parameters") && !fun.rest && params[params.length - 1].type !== "RestElement") joined = concat([joined, ",\n"]); + else joined = concat([joined, "\n"]); + return concat(["\n", joined.indent(options.tabWidth)]); + } + return joined; +} +function maybePrintImportAssertions(path, options, print) { + const n = path.getValue(); + if (n.assertions && n.assertions.length > 0) { + const parts = [" assert {"]; + const printed = path.map(print, "assertions"); + const flat = fromString(", ").join(printed); + if (flat.length > 1 || flat.getLineLength(1) > options.wrapColumn) parts.push("\n", fromString(",\n").join(printed).indent(options.tabWidth), "\n}"); + else parts.push(" ", flat, " }"); + return concat(parts); + } + return fromString(""); +} +function printExportDeclaration(path, options, print) { + const decl = path.getValue(); + const parts = ["export "]; + if (decl.exportKind && decl.exportKind === "type") { + if (!decl.declaration) parts.push("type "); + } + const shouldPrintSpaces = options.objectCurlySpacing; + namedTypes.Declaration.assert(decl); + if (decl["default"] || decl.type === "ExportDefaultDeclaration") parts.push("default "); + if (decl.declaration) parts.push(path.call(print, "declaration")); + else if (decl.specifiers) { + if (decl.specifiers.length === 1 && decl.specifiers[0].type === "ExportBatchSpecifier") parts.push("*"); + else if (decl.specifiers.length === 0) parts.push("{}"); + else if (decl.specifiers[0].type === "ExportDefaultSpecifier") { + const unbracedSpecifiers = []; + const bracedSpecifiers = []; + path.each(function(specifierPath) { + if (specifierPath.getValue().type === "ExportDefaultSpecifier") unbracedSpecifiers.push(print(specifierPath)); + else bracedSpecifiers.push(print(specifierPath)); + }, "specifiers"); + unbracedSpecifiers.forEach((lines, i) => { + if (i > 0) parts.push(", "); + parts.push(lines); + }); + if (bracedSpecifiers.length > 0) { + let lines = fromString(", ").join(bracedSpecifiers); + if (lines.getLineLength(1) > options.wrapColumn) lines = concat([fromString(",\n").join(bracedSpecifiers).indent(options.tabWidth), ","]); + if (unbracedSpecifiers.length > 0) parts.push(", "); + if (lines.length > 1) parts.push("{\n", lines, "\n}"); + else if (options.objectCurlySpacing) parts.push("{ ", lines, " }"); + else parts.push("{", lines, "}"); + } + } else parts.push(shouldPrintSpaces ? "{ " : "{", fromString(", ").join(path.map(print, "specifiers")), shouldPrintSpaces ? " }" : "}"); + if (decl.source) parts.push(" from ", path.call(print, "source"), maybePrintImportAssertions(path, options, print)); + } + let lines = concat(parts); + if (lastNonSpaceCharacter(lines) !== ";" && !(decl.declaration && (decl.declaration.type === "FunctionDeclaration" || decl.declaration.type === "ClassDeclaration" || decl.declaration.type === "TSModuleDeclaration" || decl.declaration.type === "TSInterfaceDeclaration" || decl.declaration.type === "TSEnumDeclaration"))) lines = concat([lines, ";"]); + return lines; +} +function printFlowDeclaration(path, parts) { + if (getParentExportDeclaration(path)) {} else parts.unshift("declare "); + return concat(parts); +} +function printVariance(path, print) { + return path.call(function(variancePath) { + const value = variancePath.getValue(); + if (value) { + if (value === "plus") return fromString("+"); + if (value === "minus") return fromString("-"); + return print(variancePath); + } + return fromString(""); + }, "variance"); +} +function adjustClause(clause, options) { + if (clause.length > 1) return concat([" ", clause]); + return concat(["\n", maybeAddSemicolon(clause).indent(options.tabWidth)]); +} +function lastNonSpaceCharacter(lines) { + const pos = lines.lastPos(); + do { + const ch = lines.charAt(pos); + if (/\S/.test(ch)) return ch; + } while (lines.prevPos(pos)); +} +function endsWithBrace(lines) { + return lastNonSpaceCharacter(lines) === "}"; +} +function swapQuotes(str) { + return str.replace(/['"]/g, (m) => m === "\"" ? "'" : "\""); +} +function getPossibleRaw(node) { + const value = getFieldValue(node, "value"); + const extra = getFieldValue(node, "extra"); + if (extra && typeof extra.raw === "string" && value == extra.rawValue) return extra.raw; + if (node.type === "Literal") { + const raw = node.raw; + if (typeof raw === "string" && value == raw) return raw; + } +} +function jsSafeStringify(str) { + return JSON.stringify(str).replace(/[\u2028\u2029]/g, function(m) { + return "\\u" + m.charCodeAt(0).toString(16); + }); +} +function nodeStr(str, options) { + isString.assert(str); + switch (options.quote) { + case "auto": { + const double = jsSafeStringify(str); + const single = swapQuotes(jsSafeStringify(swapQuotes(str))); + return double.length > single.length ? single : double; + } + case "single": return swapQuotes(jsSafeStringify(swapQuotes(str))); + default: return jsSafeStringify(str); + } +} +function maybeAddSemicolon(lines) { + const eoc = lastNonSpaceCharacter(lines); + if (!eoc || "\n};".indexOf(eoc) < 0) return concat([lines, ";"]); + return lines; +} +//#endregion +//#region vendor/recast/main.ts +/** +* Reprint a modified syntax tree using as much of the original source +* code as possible. +*/ +function print(node, options) { + return new Printer(options).print(node); +} +//#endregion +//#region src/babel.ts +let _babelParser; +function getBabelParser() { + if (_babelParser) return _babelParser; + const babelOptions = _getBabelOptions(); + _babelParser = { parse(source, options) { + return babelParser.parse(source, { + ...babelOptions, + ...options + }); + } }; + return _babelParser; +} +function _getBabelOptions() { + return { + sourceType: "module", + strictMode: false, + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + startLine: 1, + tokens: true, + plugins: [ + "asyncGenerators", + "bigInt", + "classPrivateMethods", + "classPrivateProperties", + "classProperties", + "classStaticBlock", + "decimal", + "decorators-legacy", + "doExpressions", + "dynamicImport", + "exportDefaultFrom", + "exportExtensions", + "exportNamespaceFrom", + "functionBind", + "functionSent", + "importAssertions", + "importMeta", + "nullishCoalescingOperator", + "numericSeparator", + "objectRestSpread", + "optionalCatchBinding", + "optionalChaining", + ["pipelineOperator", { proposal: "minimal" }], + ["recordAndTuple", { syntaxType: "hash" }], + "throwExpressions", + "topLevelAwait", + "v8intrinsic", + "jsx", + "typescript" + ] + }; +} +//#endregion +//#region src/error.ts +var MagicastError = class extends Error { + rawMessage; + options; + constructor(message, options) { + super(""); + this.name = "MagicastError"; + this.rawMessage = message; + this.options = options; + if (options?.ast && options?.code && options.ast.loc) { + const { line, column } = options.ast.loc.start; + const lines = options.code.split("\n"); + const start = Math.max(0, line - 3); + const end = Math.min(lines.length, line + 3); + const codeFrame = lines.slice(start, end).map((lineCode, i) => { + lineCode = `${(start + i + 1).toString().padStart(3, " ")} | ${lineCode}`; + if (start + i === line - 1) lineCode += `\n${" ".repeat(6 + column)}^`; + return lineCode; + }); + message += `\n\n${codeFrame.join("\n")}\n`; + } + this.message = message; + } +}; +//#endregion +//#region src/proxy/_utils.ts +const LITERALS_AST = new Set([ + "Literal", + "StringLiteral", + "NumericLiteral", + "BooleanLiteral", + "NullLiteral", + "BigIntLiteral" +]); +const LITERALS_TYPEOF = new Set([ + "string", + "number", + "boolean", + "bigint", + "symbol", + "undefined" +]); +const b$5 = builders$1; +function isValidPropName(name) { + return /^[$A-Z_a-z][\w$]*$/.test(name); +} +const PROXY_KEY = "__magicast_proxy"; +function literalToAst(value, seen = /* @__PURE__ */ new Set()) { + if (value === void 0) return b$5.identifier("undefined"); + if (value === null) return b$5.literal(null); + if (LITERALS_TYPEOF.has(typeof value)) return b$5.literal(value); + if (seen.has(value)) throw new MagicastError("Can not serialize circular reference"); + seen.add(value); + if (value[PROXY_KEY]) return value.$ast; + if (value instanceof RegExp) { + const regex = b$5.regExpLiteral(value.source, value.flags); + delete regex.extra.raw; + return regex; + } + if (value instanceof Set) return b$5.newExpression(b$5.identifier("Set"), [b$5.arrayExpression([...value].map((n) => literalToAst(n, seen)))]); + if (value instanceof Date) return b$5.newExpression(b$5.identifier("Date"), [b$5.literal(value.toISOString())]); + if (value instanceof Map) return b$5.newExpression(b$5.identifier("Map"), [b$5.arrayExpression([...value].map(([key, value]) => { + return b$5.arrayExpression([literalToAst(key, seen), literalToAst(value, seen)]); + }))]); + if (Array.isArray(value)) return b$5.arrayExpression(value.map((n) => literalToAst(n, seen))); + if (typeof value === "object") return b$5.objectExpression(Object.entries(value).map(([key, value]) => { + return b$5.property("init", /^[$A-Z_a-z][\w$]*$/g.test(key) ? b$5.identifier(key) : b$5.literal(key), literalToAst(value, seen)); + })); + return b$5.literal(value); +} +function makeProxyUtils(node, extend = {}) { + const obj = extend; + obj[PROXY_KEY] = true; + obj.$ast = node; + obj.$type ||= "object"; + return obj; +} +const propertyDescriptor = { + enumerable: true, + configurable: true +}; +function createProxy(node, extend, handler) { + const utils = makeProxyUtils(node, extend); + return new Proxy({}, { + ownKeys() { + return Object.keys(utils).filter((i) => i !== PROXY_KEY && !i.startsWith("$")); + }, + getOwnPropertyDescriptor() { + return propertyDescriptor; + }, + has(_target, key) { + if (key in utils) return true; + return false; + }, + ...handler, + get(target, key, receiver) { + if (key in utils) return utils[key]; + if (handler.get) return handler.get(target, key, receiver); + }, + set(target, key, value, receiver) { + if (key in utils) { + utils[key] = value; + return true; + } + if (handler.set) return handler.set(target, key, value, receiver); + return false; + } + }); +} +//#endregion +//#region src/proxy/imports.ts +const b$4 = builders$1; +const _importProxyCache = /* @__PURE__ */ new WeakMap(); +function createImportProxy(node, specifier, root) { + if (_importProxyCache.has(specifier)) return _importProxyCache.get(specifier); + const proxy = createProxy(specifier, { + get $declaration() { + return node; + }, + get imported() { + if (specifier.type === "ImportDefaultSpecifier") return "default"; + if (specifier.type === "ImportNamespaceSpecifier") return "*"; + if (specifier.imported.type === "Identifier") return specifier.imported.name; + return specifier.imported.value; + }, + set imported(value) { + if (specifier.type !== "ImportSpecifier") throw new MagicastError("Changing import name is not yet implemented"); + if (specifier.imported.type === "Identifier") specifier.imported.name = value; + else specifier.imported.value = value; + }, + get local() { + return specifier.local.name; + }, + set local(value) { + specifier.local.name = value; + }, + get from() { + return node.source.value; + }, + set from(value) { + if (value === node.source.value) return; + node.specifiers = node.specifiers.filter((s) => s !== specifier); + if (node.specifiers.length === 0) root.body = root.body.filter((s) => s !== node); + const declaration = root.body.find((i) => i.type === "ImportDeclaration" && i.source.value === value); + if (declaration) declaration.specifiers.push(specifier); + else root.body.unshift(b$4.importDeclaration([specifier], b$4.stringLiteral(value))); + }, + toJSON() { + return { + imported: this.imported, + local: this.local, + from: this.from + }; + } + }, { ownKeys() { + return [ + "imported", + "local", + "from", + "toJSON" + ]; + } }); + _importProxyCache.set(specifier, proxy); + return proxy; +} +function createImportsProxy(root, mod) { + const getAllImports = () => { + const imports = []; + for (const n of root.body) if (n.type === "ImportDeclaration") for (const specifier of n.specifiers) imports.push(createImportProxy(n, specifier, root)); + return imports; + }; + const updateImport = (key, value, order) => { + const imports = getAllImports(); + const item = imports.find((i) => i.local === key); + const local = value.local || key; + if (item) { + item.imported = value.imported; + item.local = local; + item.from = value.from; + return true; + } + const specifier = value.imported === "default" ? b$4.importDefaultSpecifier(b$4.identifier(local)) : value.imported === "*" ? b$4.importNamespaceSpecifier(b$4.identifier(local)) : b$4.importSpecifier(b$4.identifier(value.imported), b$4.identifier(local)); + const declaration = imports.find((i) => i.from === value.from)?.$declaration; + if (declaration) declaration.specifiers.push(specifier); + else if (order === "prepend" || imports.length === 0) root.body.unshift(b$4.importDeclaration([specifier], b$4.stringLiteral(value.from))); + else { + const lastImport = imports.at(-1).$declaration; + const lastImportIndex = root.body.indexOf(lastImport); + root.body.splice(lastImportIndex + 1, 0, b$4.importDeclaration([specifier], b$4.stringLiteral(value.from))); + } + return true; + }; + const removeImport = (key) => { + const item = getAllImports().find((i) => i.local === key); + if (!item) return false; + const node = item.$declaration; + const specifier = item.$ast; + node.specifiers = node.specifiers.filter((s) => s !== specifier); + if (node.specifiers.length === 0) root.body = root.body.filter((n) => n !== node); + return true; + }; + return createProxy(root, { + $type: "imports", + $add(item) { + updateImport(item.local || item.imported, item, "prepend"); + }, + $prepend(item) { + updateImport(item.local || item.imported, item, "prepend"); + }, + $append(item) { + updateImport(item.local || item.imported, item, "append"); + }, + get $items() { + return getAllImports(); + }, + toJSON() { + return getAllImports().reduce((acc, i) => { + acc[i.local] = i; + return acc; + }, {}); + } + }, { + get(_, prop) { + return getAllImports().find((i) => i.local === prop); + }, + set(_, prop, value) { + return updateImport(prop, value, "prepend"); + }, + deleteProperty(_, prop) { + return removeImport(prop); + }, + ownKeys() { + return getAllImports().map((i) => i.local); + }, + has(_, prop) { + return getAllImports().some((i) => i.local === prop); + } + }); +} +//#endregion +//#region src/proxy/array.ts +function proxifyArrayElements(node, elements, mod) { + const utils = makeProxyUtils(node, { + $type: "array", + push(value) { + elements.push(literalToAst(value)); + }, + pop() { + return proxify(elements.pop(), mod); + }, + unshift(value) { + elements.unshift(literalToAst(value)); + }, + shift() { + return proxify(elements.shift(), mod); + }, + splice(start, deleteCount, ...items) { + return elements.splice(start, deleteCount, ...items.map((n) => literalToAst(n))).map((n) => proxify(n, mod)); + }, + toJSON() { + return elements.map((n) => proxify(n, mod)); + } + }); + return new Proxy([], { + get(target, key, receiver) { + if (key in utils) return utils[key]; + const self = receiver; + if (key === "map") return (callback) => { + const results = []; + let index = 0; + for (const item of self) { + results.push(callback(item, index, self)); + index++; + } + return results; + }; + if (key === "filter") return (callback) => { + const results = []; + let index = 0; + for (const item of self) { + if (callback(item, index, self)) results.push(item); + index++; + } + return results; + }; + if (key === "forEach") return (callback) => { + let index = 0; + for (const item of self) { + callback(item, index, self); + index++; + } + }; + if (key === "reduce") return (callback, ...initialValue) => { + const array = [...self]; + if (array.length === 0 && initialValue.length === 0) throw new TypeError("Reduce of empty array with no initial value"); + let accumulator; + let startIndex = 0; + if (initialValue.length > 0) accumulator = initialValue[0]; + else { + accumulator = array[0]; + startIndex = 1; + } + for (let i = startIndex; i < array.length; i++) accumulator = callback(accumulator, array[i], i, array); + return accumulator; + }; + if (key === "find") return (callback) => { + let index = 0; + for (const item of self) { + if (callback(item, index, self)) return item; + index++; + } + }; + if (key === "findIndex") return (callback) => { + let index = 0; + for (const item of self) { + if (callback(item, index, self)) return index; + index++; + } + return -1; + }; + if (key === "includes") return (searchElement, fromIndex) => { + return [...self].includes(searchElement, fromIndex); + }; + if (key === "length") return elements.length; + if (key === Symbol.iterator) return function* () { + for (const item of elements) yield proxify(item, mod); + }; + if (typeof key === "symbol") return Reflect.get(target, key, receiver); + const index = +key; + if (!Number.isNaN(index)) { + const prop = elements[index]; + if (prop) return proxify(prop, mod); + } + return Reflect.get(target, key, receiver); + }, + set(target, key, value, receiver) { + if (typeof key === "symbol") return Reflect.set(target, key, value, receiver); + const index = +key; + if (!Number.isNaN(index)) { + elements[index] = literalToAst(value); + return true; + } + return Reflect.set(target, key, value, receiver); + }, + deleteProperty(target, key) { + if (typeof key === "symbol") return Reflect.deleteProperty(target, key); + const index = +key; + if (!Number.isNaN(index)) { + elements[index] = literalToAst(void 0); + return true; + } + return Reflect.deleteProperty(target, key); + }, + ownKeys() { + return ["length", ...elements.map((_, i) => i.toString())]; + }, + getOwnPropertyDescriptor(target, key) { + if (key in utils) return { + configurable: true, + enumerable: true, + value: utils[key] + }; + if (key === "length") return { + value: elements.length, + writable: true, + enumerable: false, + configurable: false + }; + if (typeof key === "symbol") return Reflect.getOwnPropertyDescriptor(target, key); + const index = +key; + if (!Number.isNaN(index) && index < elements.length) return { + value: proxify(elements[index], mod), + writable: true, + enumerable: true, + configurable: true + }; + return Reflect.getOwnPropertyDescriptor(target, key); + } + }); +} +function proxifyArray(node, mod) { + if (!("elements" in node)) return; + return proxifyArrayElements(node, node.elements, mod); +} +//#endregion +//#region src/proxy/function-call.ts +function proxifyFunctionCall(node, mod) { + if (node.type !== "CallExpression") throw new MagicastError("Not a function call"); + function stringifyExpression(node) { + if (node.type === "Identifier") return node.name; + if (node.type === "Import") return "import"; + if (node.type === "MemberExpression") return `${stringifyExpression(node.object)}.${stringifyExpression(node.property)}`; + throw new MagicastError("Not implemented"); + } + const argumentsProxy = proxifyArrayElements(node, node.arguments, mod); + return createProxy(node, { + $type: "function-call", + $callee: stringifyExpression(node.callee), + $args: argumentsProxy + }, {}); +} +//#endregion +//#region src/proxy/arrow-function-expression.ts +function proxifyArrowFunctionExpression(node, mod) { + if (node.type !== "ArrowFunctionExpression") throw new MagicastError("Not an arrow function expression"); + const utils = makeProxyUtils(node, { + $type: "arrow-function-expression", + $params: proxifyArrayElements(node, node.params, mod), + $body: proxify(node.body, mod) + }); + return new Proxy(() => {}, { + get(target, key, receiver) { + if (key in utils) return utils[key]; + return Reflect.get(target, key, receiver); + }, + apply() { + throw new MagicastError("Calling proxified functions is not supported. Use `generateCode` to get the code string."); + } + }); +} +//#endregion +//#region src/proxy/object.ts +const b$3 = builders$1; +function proxifyObject(node, mod) { + if (!("properties" in node)) return; + const getPropName = (prop, throwError = false) => { + const propType = prop.type; + if (propType === "Property" || propType === "ObjectProperty" || propType === "ObjectMethod") { + const propKey = prop.key; + if (propKey.type === "Identifier") return propKey.name; + if (propKey.type === "StringLiteral" || propKey.type === "NumericLiteral" || propKey.type === "BooleanLiteral") return propKey.value.toString(); + } + if (throwError) throw new MagicastError(`Casting "${prop.type}" is not supported`, { + ast: prop, + code: mod?.$code + }); + }; + const getProp = (key) => { + const stringKey = String(key); + for (const prop of node.properties) if (getPropName(prop) === stringKey) { + const propType = prop.type; + if (propType === "Property" || propType === "ObjectProperty") return prop.value; + if (prop.type === "ObjectMethod") { + const funcExpr = b$3.functionExpression(null, prop.params, prop.body, prop.generator, prop.async); + funcExpr.async = prop.async; + funcExpr.loc = prop.loc; + return funcExpr; + } + } + }; + const replaceOrAddProp = (key, value) => { + const prop = node.properties.find((p) => getPropName(p) === key); + if (prop) { + const propType = prop.type; + if (propType === "Property" || propType === "ObjectProperty") prop.value = value; + else if (prop.type === "ObjectMethod") { + const newProp = b$3.property("init", b$3.identifier(key), value); + const index = node.properties.indexOf(prop); + if (index !== -1) node.properties[index] = newProp; + } + } else { + const newProp = b$3.property("init", isValidPropName(key) ? b$3.identifier(key) : b$3.stringLiteral(key), value); + node.properties.push(newProp); + } + }; + return createProxy(node, { + $type: "object", + toJSON() { + return node.properties.reduce((acc, prop) => { + const propName = getPropName(prop); + if (propName) { + const propType = prop.type; + if (propType === "Property" || propType === "ObjectProperty") acc[propName] = proxify(prop.value, mod); + else if (prop.type === "ObjectMethod") { + const funcExpr = b$3.functionExpression(null, prop.params, prop.body, prop.generator, prop.async); + funcExpr.async = prop.async; + funcExpr.loc = prop.loc; + acc[propName] = proxify(funcExpr, mod); + } + } + return acc; + }, {}); + } + }, { + get(_, key) { + const prop = getProp(key); + if (prop) return proxify(prop, mod); + }, + set(_, key, value) { + if (typeof key !== "string") key = String(key); + replaceOrAddProp(key, literalToAst(value)); + return true; + }, + deleteProperty(_, key) { + if (typeof key !== "string") key = String(key); + const index = node.properties.findIndex((p) => getPropName(p) === key); + if (index !== -1) node.properties.splice(index, 1); + return true; + }, + ownKeys() { + return node.properties.map((p) => getPropName(p)).filter(Boolean); + }, + getOwnPropertyDescriptor(target, key) { + if (typeof key === "string" && Array.from(this.ownKeys(target)).includes(key)) return { + enumerable: true, + configurable: true + }; + }, + has(_, key) { + if (typeof key === "string") return Array.from(this.ownKeys(_)).includes(key); + return false; + } + }); +} +//#endregion +//#region src/proxy/new-expression.ts +function proxifyNewExpression(node, mod) { + if (node.type !== "NewExpression") throw new MagicastError("Not a new expression"); + function stringifyExpression(node) { + if (node.type === "Identifier") return node.name; + if (node.type === "MemberExpression") return `${stringifyExpression(node.object)}.${stringifyExpression(node.property)}`; + throw new MagicastError("Not implemented"); + } + const argumentsProxy = proxifyArrayElements(node, node.arguments, mod); + return createProxy(node, { + $type: "new-expression", + $callee: stringifyExpression(node.callee), + $args: argumentsProxy + }, {}); +} +//#endregion +//#region src/proxy/identifier.ts +function proxifyIdentifier(node) { + if (node.type !== "Identifier") throw new MagicastError("Not an identifier"); + return createProxy(node, { + $type: "identifier", + $name: node.name + }, {}); +} +//#endregion +//#region src/proxy/logical-expression.ts +function proxifyLogicalExpression(node) { + if (node.type !== "LogicalExpression") throw new MagicastError("Not a logical expression"); + return createProxy(node, { $type: "logicalExpression" }, {}); +} +//#endregion +//#region src/proxy/member-expression.ts +function proxifyMemberExpression(node, mod) { + if (node.type !== "MemberExpression") throw new MagicastError("Not a member expression"); + return createProxy(node, { + $type: "member-expression", + $object: proxify(node.object, mod), + $property: proxify(node.property, mod) + }, {}); +} +//#endregion +//#region src/proxy/binary-expression.ts +function proxifyBinaryExpression(node, mod) { + return createProxy(node, { + $type: "binary-expression", + $left: proxify(node.left, mod), + $right: proxify(node.right, mod), + $operator: node.operator + }, {}); +} +//#endregion +//#region src/proxy/block-statement.ts +function proxifyBlockStatement(node, mod) { + return createProxy(node, { + $type: "block-statement", + $body: proxifyArrayElements(node, node.body, mod) + }, {}); +} +//#endregion +//#region src/proxy/function-expression.ts +function proxifyFunctionExpression(node, mod) { + const utils = makeProxyUtils(node, { + $type: "function-expression", + $params: proxifyArrayElements(node, node.params, mod), + $body: proxify(node.body, mod) + }); + return new Proxy(() => {}, { + get(target, key, receiver) { + if (key in utils) return utils[key]; + return Reflect.get(target, key, receiver); + }, + apply() { + throw new MagicastError("Calling proxified functions is not supported. Use `generateCode` to get the code string."); + } + }); +} +//#endregion +//#region src/proxy/await-expression.ts +function proxifyAwaitExpression(node, mod) { + if (node.type !== "AwaitExpression") throw new MagicastError("Not an await expression"); + return createProxy(node, { + $type: "await-expression", + $argument: proxify(node.argument, mod) + }, {}); +} +//#endregion +//#region src/proxy/proxify.ts +const _cache = /* @__PURE__ */ new WeakMap(); +function proxify(node, mod) { + if (LITERALS_TYPEOF.has(typeof node)) return node; + if (node.type === "Identifier" && node.name === "undefined") return; + if (node.type === "RegExpLiteral") { + const { pattern, flags } = node; + return new RegExp(pattern, flags); + } + if (LITERALS_AST.has(node.type)) return node.value; + if (_cache.has(node)) return _cache.get(node); + let proxy; + switch (node.type) { + case "ObjectExpression": + proxy = proxifyObject(node, mod); + break; + case "ArrayExpression": + proxy = proxifyArray(node, mod); + break; + case "CallExpression": + proxy = proxifyFunctionCall(node, mod); + break; + case "ArrowFunctionExpression": + proxy = proxifyArrowFunctionExpression(node, mod); + break; + case "FunctionExpression": + proxy = proxifyFunctionExpression(node, mod); + break; + case "NewExpression": + proxy = proxifyNewExpression(node, mod); + break; + case "Identifier": + proxy = proxifyIdentifier(node); + break; + case "LogicalExpression": + proxy = proxifyLogicalExpression(node); + break; + case "MemberExpression": + proxy = proxifyMemberExpression(node); + break; + case "BinaryExpression": + proxy = proxifyBinaryExpression(node, mod); + break; + case "AwaitExpression": + proxy = proxifyAwaitExpression(node, mod); + break; + case "BlockStatement": + proxy = proxifyBlockStatement(node, mod); + break; + case "TSAsExpression": + case "TSSatisfiesExpression": + proxy = proxify(node.expression, mod); + break; + default: throw new MagicastError(`Casting "${node.type}" is not supported`, { + ast: node, + code: mod?.$code + }); + } + _cache.set(node, proxy); + return proxy; +} +//#endregion +//#region src/proxy/exports.ts +const b$2 = builders$1; +function createExportsProxy(root, mod) { + const findExport = (key) => { + const type = key === "default" ? "ExportDefaultDeclaration" : "ExportNamedDeclaration"; + for (const n of root.body) if (n.type === type) { + if (key === "default") return n.declaration; + if (n.declaration) { + if (n.declaration.type === "VariableDeclaration") { + const dec = n.declaration.declarations[0]; + if ("name" in dec.id && dec.id.name === key) return dec.init; + } + if (n.declaration.type === "FunctionDeclaration" && n.declaration.id && n.declaration.id.name === key) { + const decl = n.declaration; + const funcExpr = b$2.functionExpression(decl.id, decl.params, decl.body, decl.generator, decl.async); + funcExpr.async = decl.async; + funcExpr.loc = decl.loc; + return funcExpr; + } + } + } + }; + const updateOrAddExport = (key, value) => { + const type = key === "default" ? "ExportDefaultDeclaration" : "ExportNamedDeclaration"; + const node = literalToAst(value); + for (const n of root.body) if (n.type === type) { + if (key === "default") { + n.declaration = node; + return; + } + if (n.declaration) { + if (n.declaration.type === "VariableDeclaration") { + const dec = n.declaration.declarations[0]; + if ("name" in dec.id && dec.id.name === key) { + dec.init = node; + return; + } + } + if (n.declaration.type === "FunctionDeclaration" && n.declaration.id && n.declaration.id.name === key) { + const newExport = b$2.exportNamedDeclaration(b$2.variableDeclaration("const", [b$2.variableDeclarator(b$2.identifier(key), node)])); + const index = root.body.indexOf(n); + if (index !== -1) root.body[index] = newExport; + return; + } + } + } + root.body.push(key === "default" ? b$2.exportDefaultDeclaration(node) : b$2.exportNamedDeclaration(b$2.variableDeclaration("const", [b$2.variableDeclarator(b$2.identifier(key), node)]))); + }; + return createProxy(root, { $type: "exports" }, { + get(_, prop) { + const node = findExport(prop); + if (node) return proxify(node, mod); + }, + set(_, prop, value) { + updateOrAddExport(prop, value); + return true; + }, + ownKeys() { + return root.body.flatMap((i) => { + if (i.type === "ExportDefaultDeclaration") return ["default"]; + if (i.type === "ExportNamedDeclaration" && i.declaration) { + if (i.declaration.type === "VariableDeclaration") return i.declaration.declarations.map((d) => "name" in d.id ? d.id.name : ""); + if (i.declaration.type === "FunctionDeclaration") return i.declaration.id ? [i.declaration.id.name] : []; + } + return []; + }).filter(Boolean); + }, + deleteProperty(_, prop) { + const type = prop === "default" ? "ExportDefaultDeclaration" : "ExportNamedDeclaration"; + for (let i = 0; i < root.body.length; i++) { + const n = root.body[i]; + if (n.type === type) { + if (prop === "default") { + root.body.splice(i, 1); + return true; + } + if (n.declaration) { + if (n.declaration.type === "VariableDeclaration") { + const dec = n.declaration.declarations[0]; + if ("name" in dec.id && dec.id.name === prop) { + root.body.splice(i, 1); + return true; + } + } + if (n.declaration.type === "FunctionDeclaration" && n.declaration.id && n.declaration.id.name === prop) { + root.body.splice(i, 1); + return true; + } + } + } + } + return false; + } + }); +} +//#endregion +//#region src/proxy/module.ts +function proxifyModule(ast, code) { + const root = ast.program; + if (root.type !== "Program") throw new MagicastError(`Cannot proxify ${ast.type} as module`); + const util = { + $code: code, + $type: "module" + }; + const mod = createProxy(root, util, { ownKeys() { + return [ + "imports", + "exports", + "generate" + ]; + } }); + util.exports = createExportsProxy(root, mod); + util.imports = createImportsProxy(root, mod); + util.generate = (options) => generateCode(mod, options); + return mod; +} +//#endregion +//#region src/format.ts +function detectCodeFormat(code, userStyles = {}) { + const detect = { + wrapColumn: userStyles.wrapColumn === void 0, + indent: userStyles.tabWidth === void 0 || userStyles.useTabs === void 0, + quote: userStyles.quote === void 0, + arrowParens: userStyles.arrowParensAlways === void 0, + trailingComma: userStyles.trailingComma === void 0 + }; + let codeIndent = 2; + let tabUsages = 0; + let semiUsages = 0; + let maxLineLength = 0; + let multiLineTrailingCommaUsages = 0; + const syntaxDetectRegex = /(?"[^"]+")|(?'[^']+')|(?\([^),]+\)\s*=>)|(?,\s*[\]}])/g; + const syntaxUsages = { + doubleQuote: 0, + singleQuote: 0, + singleParam: 0, + trailingComma: 0 + }; + const lines = (code || "").split("\n"); + let previousLineTrailing = false; + for (const line of lines) { + const trimmitedLine = line.trim(); + if (trimmitedLine.length === 0) continue; + if (detect.wrapColumn && line.length > maxLineLength) maxLineLength = line.length; + if (detect.indent) { + const lineIndent = line.match(/^\s+/)?.[0] || ""; + if (lineIndent.length > 0) { + if (lineIndent.length > 0 && lineIndent.length < codeIndent) codeIndent = lineIndent.length; + if (lineIndent[0] === " ") tabUsages++; + else if (lineIndent.length > 0) tabUsages--; + } + } + if (trimmitedLine.at(-1) === ";") semiUsages++; + else if (trimmitedLine.length > 0) semiUsages--; + if (detect.quote || detect.arrowParens) { + const matches = trimmitedLine.matchAll(syntaxDetectRegex); + for (const match of matches) { + if (!match.groups) continue; + for (const key in syntaxUsages) if (match.groups[key]) syntaxUsages[key]++; + } + } + if (detect.trailingComma) { + if (line.startsWith("}") || line.startsWith("]")) if (previousLineTrailing) multiLineTrailingCommaUsages++; + else multiLineTrailingCommaUsages--; + previousLineTrailing = trimmitedLine.endsWith(","); + } + } + return { + wrapColumn: maxLineLength, + useTabs: tabUsages > 0, + tabWidth: codeIndent, + quote: syntaxUsages.singleQuote > syntaxUsages.doubleQuote ? "single" : "double", + arrowParensAlways: syntaxUsages.singleParam > 0, + trailingComma: multiLineTrailingCommaUsages > 0 || syntaxUsages.trailingComma > 0, + useSemi: semiUsages > 0, + arrayBracketSpacing: void 0, + objectCurlySpacing: void 0, + ...userStyles + }; +} +//#endregion +//#region src/code.ts +const b$1 = builders$1; +function parseModule(code, options) { + return proxifyModule(parse(code, { + parser: options?.parser || getBabelParser(), + ...options + }), code); +} +function parseExpression(code, options) { + const root = parse("(" + code + ")", { + parser: options?.parser || getBabelParser(), + ...options + }); + let body = root.program.body[0]; + if (body.type === "ExpressionStatement") body = body.expression; + if (body.extra?.parenthesized) body.extra.parenthesized = false; + const mod = { + $ast: root, + $code: " " + code + " ", + $type: "module" + }; + return proxify(body, mod); +} +function generateCode(node, options = {}) { + let ast = node.$ast || node; + if (ast.type === "FunctionExpression") ast = b$1.expressionStatement(ast); + const formatOptions = options.format === false || !("$code" in node) ? {} : detectCodeFormat(node.$code, options.format); + const { code, map } = print(ast, { + ...options, + ...formatOptions + }); + return { + code, + map + }; +} +//#endregion +//#region src/builders.ts +const b = builders$1; +const builders = { + /** + * Create a function call node. + */ + functionCall(callee, ...args) { + return proxifyFunctionCall(b.callExpression(b.identifier(callee), args.map((i) => literalToAst(i)))); + }, + /** + * Create a new expression node. + */ + newExpression(callee, ...args) { + return proxifyNewExpression(b.newExpression(b.identifier(callee), args.map((i) => literalToAst(i)))); + }, + /** + * Create a binary expression node. + */ + binaryExpression(left, operator, right) { + return proxifyBinaryExpression(b.binaryExpression(operator, literalToAst(left), literalToAst(right))); + }, + /** + * Create an await expression node. + */ + awaitExpression(argument) { + const argAst = argument?.$ast || literalToAst(argument); + return proxifyAwaitExpression(b.awaitExpression(argAst)); + }, + /** + * Create a proxified version of a literal value. + */ + literal(value) { + return literalToAst(value); + }, + /** + * Parse a raw expression and return a proxified version of it. + * + * ```ts + * const obj = builders.raw("{ foo: 1 }"); + * console.log(obj.foo); // 1 + * ``` + */ + raw(code) { + return parseExpression(code); + } +}; +//#endregion +export { detectCodeFormat as a, parseModule as i, generateCode as n, MagicastError as o, parseExpression as r, builders as t }; diff --git a/tools/ui/node_modules/magicast/dist/core.d.ts b/tools/ui/node_modules/magicast/dist/core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..81ce983dcda90fa7e055966723edba5a03985048 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/core.d.ts @@ -0,0 +1,57 @@ +import { C as ProxifiedObject, D as CodeFormatOptions, E as ProxyType, O as detectCodeFormat, S as ProxifiedNewExpression, T as ProxyBase, _ as ProxifiedImportItem, a as Token, b as ProxifiedMemberExpression, c as Proxified, d as ProxifiedAwaitExpression, f as ProxifiedBinaryExpression, g as ProxifiedIdentifier, h as ProxifiedFunctionExpression, i as ParsedFileNode, k as Options, l as ProxifiedArray, m as ProxifiedFunctionCall, n as GenerateOptions, o as BinaryOperator, p as ProxifiedBlockStatement, r as Loc, s as ImportItemInput, t as ASTNode, u as ProxifiedArrowFunctionExpression, v as ProxifiedImportsMap, w as ProxifiedValue, x as ProxifiedModule, y as ProxifiedLogicalExpression } from "./types-D5FmR3uJ.js"; + +//#region src/code.d.ts +declare function parseModule(code: string, options?: Options): ProxifiedModule; +declare function parseExpression(code: string, options?: Options): Proxified; +declare function generateCode(node: { + $ast: ASTNode; +} | ASTNode | ProxifiedModule, options?: GenerateOptions): { + code: string; + map?: any; +}; +//#endregion +//#region src/error.d.ts +interface MagicastErrorOptions { + ast?: ASTNode; + code?: string; +} +declare class MagicastError extends Error { + rawMessage: string; + options?: MagicastErrorOptions; + constructor(message: string, options?: MagicastErrorOptions); +} +//#endregion +//#region src/builders.d.ts +declare const builders: { + /** + * Create a function call node. + */ + functionCall(callee: string, ...args: any[]): Proxified; + /** + * Create a new expression node. + */ + newExpression(callee: string, ...args: any[]): Proxified; + /** + * Create a binary expression node. + */ + binaryExpression(left: any, operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "&" | "|" | "^" | "in" | "instanceof" | "**", right: any): Proxified; + /** + * Create an await expression node. + */ + awaitExpression(argument: any): Proxified; + /** + * Create a proxified version of a literal value. + */ + literal(value: any): Proxified; + /** + * Parse a raw expression and return a proxified version of it. + * + * ```ts + * const obj = builders.raw("{ foo: 1 }"); + * console.log(obj.foo); // 1 + * ``` + */ + raw(code: string): Proxified; +}; +//#endregion +export { ASTNode, BinaryOperator, CodeFormatOptions, GenerateOptions, ImportItemInput, Loc, MagicastError, MagicastErrorOptions, ParsedFileNode, Proxified, ProxifiedArray, ProxifiedArrowFunctionExpression, ProxifiedAwaitExpression, ProxifiedBinaryExpression, ProxifiedBlockStatement, ProxifiedFunctionCall, ProxifiedFunctionExpression, ProxifiedIdentifier, ProxifiedImportItem, ProxifiedImportsMap, ProxifiedLogicalExpression, ProxifiedMemberExpression, ProxifiedModule, ProxifiedNewExpression, ProxifiedObject, ProxifiedValue, ProxyBase, ProxyType, Token, builders, detectCodeFormat, generateCode, parseExpression, parseModule }; \ No newline at end of file diff --git a/tools/ui/node_modules/magicast/dist/core.js b/tools/ui/node_modules/magicast/dist/core.js new file mode 100644 index 0000000000000000000000000000000000000000..1f17d1556e03714d144fae1907c58cc0484f5e56 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/core.js @@ -0,0 +1,2 @@ +import { a as detectCodeFormat, i as parseModule, n as generateCode, o as MagicastError, r as parseExpression, t as builders } from "./builders-mk_DIY8_.js"; +export { MagicastError, builders, detectCodeFormat, generateCode, parseExpression, parseModule }; diff --git a/tools/ui/node_modules/magicast/dist/helpers.d.ts b/tools/ui/node_modules/magicast/dist/helpers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d63a2f590e4776a79350410d5eae93ac1ec82f83 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/helpers.d.ts @@ -0,0 +1,74 @@ +import { C as ProxifiedObject, c as Proxified, m as ProxifiedFunctionCall, x as ProxifiedModule } from "./types-D5FmR3uJ.js"; +import { VariableDeclarator } from "@babel/types"; + +//#region src/helpers/deep-merge.d.ts +declare function deepMergeObject(magicast: Proxified, object: any): void; +//#endregion +//#region src/helpers/nuxt.d.ts +declare function addNuxtModule(magicast: ProxifiedModule, name: string, optionsKey?: string, options?: any): void; +//#endregion +//#region src/helpers/vite.d.ts +interface AddVitePluginOptions { + /** + * The import path of the plugin + */ + from: string; + /** + * The import name of the plugin + * @default "default" + */ + imported?: string; + /** + * The name of local variable + */ + constructor: string; + /** + * The options of the plugin + */ + options?: Record; + /** + * The index in the plugins array where the plugin should be inserted at. + * By default, the plugin is appended to the array. + */ + index?: number; +} +interface UpdateVitePluginConfigOptions { + /** + * The import path of the plugin + */ + from: string; + /** + * The import name of the plugin + * @default "default" + */ + imported?: string; +} +declare function addVitePlugin(magicast: ProxifiedModule, plugin: AddVitePluginOptions): boolean; +declare function findVitePluginCall(magicast: ProxifiedModule, plugin: UpdateVitePluginConfigOptions | string): ProxifiedFunctionCall | undefined; +declare function updateVitePluginConfig(magicast: ProxifiedModule, plugin: UpdateVitePluginConfigOptions | string, handler: Record | ((args: any[]) => any[])): boolean; +//#endregion +//#region src/helpers/config.d.ts +declare function getDefaultExportOptions(magicast: ProxifiedModule): ProxifiedObject; +/** + * Returns the vite config object from a variable declaration thats + * exported as the default export. + * + * Example: + * + * ```js + * const config = {}; + * export default config; + * ``` + * + * @param magicast the module + * + * @returns an object containing the proxified config object and the + * declaration "parent" to attach the modified config to later. + * If no config declaration is found, undefined is returned. + */ +declare function getConfigFromVariableDeclaration(magicast: ProxifiedModule): { + declaration: VariableDeclarator; + config: ProxifiedObject | undefined; +}; +//#endregion +export { AddVitePluginOptions, UpdateVitePluginConfigOptions, addNuxtModule, addVitePlugin, deepMergeObject, findVitePluginCall, getConfigFromVariableDeclaration, getDefaultExportOptions, updateVitePluginConfig }; \ No newline at end of file diff --git a/tools/ui/node_modules/magicast/dist/helpers.js b/tools/ui/node_modules/magicast/dist/helpers.js new file mode 100644 index 0000000000000000000000000000000000000000..209621cee4d6e40a792328fd6522f3c5a3ed35d2 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/helpers.js @@ -0,0 +1,115 @@ +import { n as generateCode, o as MagicastError, r as parseExpression, t as builders } from "./builders-mk_DIY8_.js"; +//#region src/helpers/deep-merge.ts +function deepMergeObject(magicast, object) { + if (typeof object === "object" && object !== null) for (const key in object) { + const magicastValue = magicast[key]; + const objectValue = object[key]; + if (magicastValue === objectValue) continue; + if (typeof magicastValue === "object" && magicastValue !== null && typeof objectValue === "object" && objectValue !== null) deepMergeObject(magicastValue, objectValue); + else magicast[key] = objectValue; + } +} +//#endregion +//#region src/helpers/config.ts +function getDefaultExportOptions(magicast) { + return configFromNode(magicast.exports.default); +} +/** +* Returns the vite config object from a variable declaration thats +* exported as the default export. +* +* Example: +* +* ```js +* const config = {}; +* export default config; +* ``` +* +* @param magicast the module +* +* @returns an object containing the proxified config object and the +* declaration "parent" to attach the modified config to later. +* If no config declaration is found, undefined is returned. +*/ +function getConfigFromVariableDeclaration(magicast) { + if (magicast.exports.default.$type !== "identifier") throw new MagicastError(`Not supported: Cannot modify this kind of default export (${magicast.exports.default.$type})`); + const configDecalarationId = magicast.exports.default.$name; + for (const node of magicast.$ast.body) if (node.type === "VariableDeclaration") { + for (const declaration of node.declarations) if (declaration.id.type === "Identifier" && declaration.id.name === configDecalarationId && declaration.init) { + const code = generateCode(declaration.init.type === "TSSatisfiesExpression" ? declaration.init.expression : declaration.init).code; + return { + declaration, + config: configFromNode(parseExpression(code)) + }; + } + } + throw new MagicastError("Couldn't find config declaration"); +} +function configFromNode(node) { + if (node.$type === "function-call") return node.$args[0]; + return node; +} +//#endregion +//#region src/helpers/nuxt.ts +function addNuxtModule(magicast, name, optionsKey, options) { + const config = getDefaultExportOptions(magicast); + config.modules ||= []; + if (!config.modules.includes(name)) config.modules.push(name); + if (optionsKey) { + config[optionsKey] ||= {}; + deepMergeObject(config[optionsKey], options); + } +} +//#endregion +//#region src/helpers/vite.ts +function addVitePlugin(magicast, plugin) { + const config = getDefaultExportOptions(magicast); + if (config.$type === "identifier") insertPluginIntoVariableDeclarationConfig(magicast, plugin); + else insertPluginIntoConfig(plugin, config); + magicast.imports.$prepend({ + from: plugin.from, + local: plugin.constructor, + imported: plugin.imported || "default" + }); + return true; +} +function findVitePluginCall(magicast, plugin) { + const _plugin = typeof plugin === "string" ? { + from: plugin, + imported: "default" + } : plugin; + const config = getDefaultExportOptions(magicast); + const constructor = magicast.imports.$items.find((i) => i.from === _plugin.from && i.imported === (_plugin.imported || "default"))?.local; + return config.plugins?.find((p) => p && p.$type === "function-call" && p.$callee === constructor); +} +function updateVitePluginConfig(magicast, plugin, handler) { + const item = findVitePluginCall(magicast, plugin); + if (!item) return false; + if (typeof handler === "function") item.$args = handler(item.$args); + else if (item.$args[0]) deepMergeObject(item.$args[0], handler); + else item.$args[0] = handler; + return true; +} +/** +* Insert @param plugin into a config object that's declared as a variable in +* the module (@param magicast). +*/ +function insertPluginIntoVariableDeclarationConfig(magicast, plugin) { + const { config: configObject, declaration } = getConfigFromVariableDeclaration(magicast); + insertPluginIntoConfig(plugin, configObject); + if (declaration.init) { + if (declaration.init.type === "ObjectExpression") declaration.init = generateCode(configObject).code; + else if (declaration.init.type === "CallExpression" && declaration.init.callee.type === "Identifier") declaration.init = generateCode(builders.functionCall(declaration.init.callee.name, configObject)).code; + else if (declaration.init.type === "TSSatisfiesExpression") { + if (declaration.init.expression.type === "ObjectExpression") declaration.init.expression = generateCode(configObject).code; + if (declaration.init.expression.type === "CallExpression" && declaration.init.expression.callee.type === "Identifier") declaration.init.expression = generateCode(builders.functionCall(declaration.init.expression.callee.name, configObject)).code; + } + } +} +function insertPluginIntoConfig(plugin, config) { + const insertionIndex = plugin.index ?? config.plugins?.length ?? 0; + config.plugins ||= []; + config.plugins.splice(insertionIndex, 0, plugin.options ? builders.functionCall(plugin.constructor, plugin.options) : builders.functionCall(plugin.constructor)); +} +//#endregion +export { addNuxtModule, addVitePlugin, deepMergeObject, findVitePluginCall, getConfigFromVariableDeclaration, getDefaultExportOptions, updateVitePluginConfig }; diff --git a/tools/ui/node_modules/magicast/dist/index.d.ts b/tools/ui/node_modules/magicast/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b204473ff9933935b828b92faf44e3f594ec05ab --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/index.d.ts @@ -0,0 +1,10 @@ +import { C as ProxifiedObject, D as CodeFormatOptions, E as ProxyType, O as detectCodeFormat, S as ProxifiedNewExpression, T as ProxyBase, _ as ProxifiedImportItem, a as Token, b as ProxifiedMemberExpression, c as Proxified, d as ProxifiedAwaitExpression, f as ProxifiedBinaryExpression, g as ProxifiedIdentifier, h as ProxifiedFunctionExpression, i as ParsedFileNode, k as Options, l as ProxifiedArray, m as ProxifiedFunctionCall, n as GenerateOptions, o as BinaryOperator, p as ProxifiedBlockStatement, r as Loc, s as ImportItemInput, t as ASTNode, u as ProxifiedArrowFunctionExpression, v as ProxifiedImportsMap, w as ProxifiedValue, x as ProxifiedModule, y as ProxifiedLogicalExpression } from "./types-D5FmR3uJ.js"; +import { MagicastError, MagicastErrorOptions, builders, generateCode, parseExpression, parseModule } from "./core.js"; + +//#region src/file.d.ts +declare function loadFile(filename: string, options?: Options): Promise>; +declare function writeFile(node: { + $ast: ASTNode; +} | ASTNode, filename: string, options?: Options): Promise; +//#endregion +export { ASTNode, BinaryOperator, CodeFormatOptions, GenerateOptions, ImportItemInput, Loc, MagicastError, MagicastErrorOptions, ParsedFileNode, Proxified, ProxifiedArray, ProxifiedArrowFunctionExpression, ProxifiedAwaitExpression, ProxifiedBinaryExpression, ProxifiedBlockStatement, ProxifiedFunctionCall, ProxifiedFunctionExpression, ProxifiedIdentifier, ProxifiedImportItem, ProxifiedImportsMap, ProxifiedLogicalExpression, ProxifiedMemberExpression, ProxifiedModule, ProxifiedNewExpression, ProxifiedObject, ProxifiedValue, ProxyBase, ProxyType, Token, builders, detectCodeFormat, generateCode, loadFile, parseExpression, parseModule, writeFile }; \ No newline at end of file diff --git a/tools/ui/node_modules/magicast/dist/index.js b/tools/ui/node_modules/magicast/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c9410c663b9cd8153f54171289a6bc35d538a23d --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/index.js @@ -0,0 +1,16 @@ +import { a as detectCodeFormat, i as parseModule, n as generateCode, o as MagicastError, r as parseExpression, t as builders } from "./builders-mk_DIY8_.js"; +import "./core.js"; +import { promises } from "node:fs"; +//#region src/file.ts +async function loadFile(filename, options = {}) { + const contents = await promises.readFile(filename, "utf8"); + options.sourceFileName = options.sourceFileName ?? filename; + return parseModule(contents, options); +} +async function writeFile(node, filename, options) { + const { code, map } = generateCode("$ast" in node ? node.$ast : node, options); + await promises.writeFile(filename, code); + if (map) await promises.writeFile(filename + ".map", map); +} +//#endregion +export { MagicastError, builders, detectCodeFormat, generateCode, loadFile, parseExpression, parseModule, writeFile }; diff --git a/tools/ui/node_modules/magicast/dist/types-D5FmR3uJ.d.ts b/tools/ui/node_modules/magicast/dist/types-D5FmR3uJ.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..faad7291e1b2bdafb735e288a3940f52e549a6e4 --- /dev/null +++ b/tools/ui/node_modules/magicast/dist/types-D5FmR3uJ.d.ts @@ -0,0 +1,285 @@ +import { ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, Node as ASTNode, Program } from "@babel/types"; + +//#region node_modules/.pnpm/recast@0.23.11/node_modules/recast/lib/options.d.ts +/** + * All Recast API functions take second parameter with configuration options, + * documented in options.js + */ +interface Options extends DeprecatedOptions { + /** + * If you want to use a different branch of esprima, or any other module + * that supports a .parse function, pass that module object to + * recast.parse as options.parser (legacy synonym: options.esprima). + * @default require("recast/parsers/esprima") + */ + parser?: any; + /** + * Number of spaces the pretty-printer should use per tab for + * indentation. If you do not pass this option explicitly, it will be + * (quite reliably!) inferred from the original code. + * @default 4 + */ + tabWidth?: number; + /** + * If you really want the pretty-printer to use tabs instead of spaces, + * make this option true. + * @default false + */ + useTabs?: boolean; + /** + * The reprinting code leaves leading whitespace untouched unless it has + * to reindent a line, or you pass false for this option. + * @default true + */ + reuseWhitespace?: boolean; + /** + * Override this option to use a different line terminator, e.g. \r\n. + * @default require("os").EOL || "\n" + */ + lineTerminator?: string; + /** + * Some of the pretty-printer code (such as that for printing function + * parameter lists) makes a valiant attempt to prevent really long + * lines. You can adjust the limit by changing this option; however, + * there is no guarantee that line length will fit inside this limit. + * @default 74 + */ + wrapColumn?: number; + /** + * Pass a string as options.sourceFileName to recast.parse to tell the + * reprinter to keep track of reused code so that it can construct a + * source map automatically. + * @default null + */ + sourceFileName?: string | null; + /** + * Pass a string as options.sourceMapName to recast.print, and (provided + * you passed options.sourceFileName earlier) the PrintResult of + * recast.print will have a .map property for the generated source map. + * @default null + */ + sourceMapName?: string | null; + /** + * If provided, this option will be passed along to the source map + * generator as a root directory for relative source file paths. + * @default null + */ + sourceRoot?: string | null; + /** + * If you provide a source map that was generated from a previous call + * to recast.print as options.inputSourceMap, the old source map will be + * composed with the new source map. + * @default null + */ + inputSourceMap?: string | null; + /** + * If you want esprima to generate .range information (recast only uses + * .loc internally), pass true for this option. + * @default false + */ + range?: boolean; + /** + * If you want esprima not to throw exceptions when it encounters + * non-fatal errors, keep this option true. + * @default true + */ + tolerant?: boolean; + /** + * If you want to override the quotes used in string literals, specify + * either "single", "double", or "auto" here ("auto" will select the one + * which results in the shorter literal) Otherwise, use double quotes. + * @default null + */ + quote?: "single" | "double" | "auto" | null; + /** + * Controls the printing of trailing commas in object literals, array + * expressions and function parameters. + * + * This option could either be: + * * Boolean - enable/disable in all contexts (objects, arrays and function params). + * * Object - enable/disable per context. + * + * Example: + * trailingComma: { + * objects: true, + * arrays: true, + * parameters: false, + * } + * + * @default false + */ + trailingComma?: boolean; + /** + * Controls the printing of spaces inside array brackets. + * See: http://eslint.org/docs/rules/array-bracket-spacing + * @default false + */ + arrayBracketSpacing?: boolean; + /** + * Controls the printing of spaces inside object literals, + * destructuring assignments, and import/export specifiers. + * See: http://eslint.org/docs/rules/object-curly-spacing + * @default true + */ + objectCurlySpacing?: boolean; + /** + * If you want parenthesis to wrap single-argument arrow function + * parameter lists, pass true for this option. + * @default false + */ + arrowParensAlways?: boolean; + /** + * There are 2 supported syntaxes (`,` and `;`) in Flow Object Types; + * The use of commas is in line with the more popular style and matches + * how objects are defined in JS, making it a bit more natural to write. + * @default true + */ + flowObjectCommas?: boolean; + /** + * Whether to return an array of .tokens on the root AST node. + * @default true + */ + tokens?: boolean; +} +interface DeprecatedOptions { + /** @deprecated */ + esprima?: any; +} +//#endregion +//#region src/format.d.ts +interface CodeFormatOptions { + tabWidth?: number; + useTabs?: boolean; + wrapColumn?: number; + quote?: "single" | "double"; + trailingComma?: boolean; + arrayBracketSpacing?: boolean; + objectCurlySpacing?: boolean; + arrowParensAlways?: boolean; + useSemi?: boolean; +} +declare function detectCodeFormat(code: string, userStyles?: CodeFormatOptions): CodeFormatOptions; +//#endregion +//#region src/proxy/types.d.ts +interface ProxyBase { + $ast: ASTNode; +} +type ProxifiedArray = { [K in keyof T]: Proxified } & ProxyBase & { + $type: "array"; +}; +type ProxifiedFunctionCall = ProxyBase & { + $type: "function-call"; + $args: ProxifiedArray; + $callee: string; +}; +type ProxifiedNewExpression = ProxyBase & { + $type: "new-expression"; + $args: ProxifiedArray; + $callee: string; +}; +type ProxifiedArrowFunctionExpression = ProxyBase & { + $type: "arrow-function-expression"; + $params: ProxifiedArray; + $body: ProxifiedValue; +}; +type ProxifiedFunctionExpression = ProxyBase & { + $type: "function-expression"; + $params: ProxifiedArray; + $body: ProxifiedBlockStatement; +}; +type ProxifiedObject = { [K in keyof T]: Proxified } & ProxyBase & { + $type: "object"; +}; +type ProxifiedIdentifier = ProxyBase & { + $type: "identifier"; + $name: string; +}; +type ProxifiedLogicalExpression = ProxyBase & { + $type: "logicalExpression"; +}; +type ProxifiedMemberExpression = ProxyBase & { + $type: "memberExpression"; +}; +type BinaryOperator = "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>"; +type ProxifiedBinaryExpression = ProxyBase & { + $type: "binaryExpression"; + $left: Proxified; + $right: Proxified; + $operator: BinaryOperator; +}; +type ProxifiedAwaitExpression = ProxyBase & { + $type: "await-expression"; + $argument: Proxified; +}; +type ProxifiedBlockStatement = ProxyBase & { + $type: "blockStatement"; + $body: ProxifiedArray; +}; +type Proxified = T extends number | string | null | undefined | boolean | bigint | symbol ? T : T extends any[] ? { [K in keyof T]: Proxified } & ProxyBase & { + $type: "array"; +} : T extends object ? ProxyBase & { [K in keyof T]: Proxified } & { + $type: "object"; +} : T; +type ProxifiedModule> = ProxyBase & { + $type: "module"; + $code: string; + exports: ProxifiedObject; + imports: ProxifiedImportsMap; + generate: (options?: GenerateOptions) => { + code: string; + map?: any; + }; +}; +type ProxifiedImportsMap = Record & ProxyBase & { + $type: "imports"; /** @deprecated Use `$prepend` instead */ + $add: (item: ImportItemInput) => void; + $prepend: (item: ImportItemInput) => void; + $append: (item: ImportItemInput) => void; + $items: ProxifiedImportItem[]; +}; +interface ProxifiedImportItem extends ProxyBase { + $type: "import"; + $ast: ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier; + $declaration: ImportDeclaration; + imported: string; + local: string; + from: string; +} +interface ImportItemInput { + local?: string; + imported: string; + from: string; +} +type ProxifiedValue = ProxifiedArray | ProxifiedFunctionCall | ProxifiedNewExpression | ProxifiedIdentifier | ProxifiedLogicalExpression | ProxifiedMemberExpression | ProxifiedObject | ProxifiedModule | ProxifiedImportsMap | ProxifiedImportItem | ProxifiedArrowFunctionExpression | ProxifiedFunctionExpression | ProxifiedBinaryExpression | ProxifiedAwaitExpression | ProxifiedBlockStatement; +type ProxyType = ProxifiedValue["$type"]; +//#endregion +//#region src/types.d.ts +interface Loc { + start?: { + line?: number; + column?: number; + token?: number; + }; + end?: { + line?: number; + column?: number; + token?: number; + }; + lines?: any; +} +interface Token { + type: string; + value: string; + loc?: Loc; +} +interface ParsedFileNode { + type: "file"; + program: Program; + loc: Loc; + comments: null | any; +} +type GenerateOptions = Options & { + format?: false | CodeFormatOptions; +}; +//#endregion +export { ProxifiedObject as C, CodeFormatOptions as D, ProxyType as E, detectCodeFormat as O, ProxifiedNewExpression as S, ProxyBase as T, ProxifiedImportItem as _, Token as a, ProxifiedMemberExpression as b, Proxified as c, ProxifiedAwaitExpression as d, ProxifiedBinaryExpression as f, ProxifiedIdentifier as g, ProxifiedFunctionExpression as h, ParsedFileNode as i, Options as k, ProxifiedArray as l, ProxifiedFunctionCall as m, GenerateOptions as n, BinaryOperator as o, ProxifiedBlockStatement as p, Loc as r, ImportItemInput as s, ASTNode as t, ProxifiedArrowFunctionExpression as u, ProxifiedImportsMap as v, ProxifiedValue as w, ProxifiedModule as x, ProxifiedLogicalExpression as y }; \ No newline at end of file diff --git a/tools/ui/node_modules/magicast/package.json b/tools/ui/node_modules/magicast/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e74adfee3cc57d2f5a20a7ec1bcfdc48ddd028bb --- /dev/null +++ b/tools/ui/node_modules/magicast/package.json @@ -0,0 +1,76 @@ +{ + "name": "magicast", + "version": "0.5.3", + "description": "Modify a JS/TS file and write back magically just like JSON!", + "repository": "unjs/magicast", + "license": "MIT", + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./core": "./dist/core.js", + "./helpers": "./dist/helpers.js", + "./package.json": "./package.json" + }, + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "dependencies": { + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" + }, + "devDependencies": { + "@types/node": "^25.7.0", + "@vitest/coverage-v8": "^4.1.6", + "@vitest/ui": "^4.1.6", + "ast-types": "^0.16.1", + "bumpp": "^11.1.0", + "eslint": "^9.39.4", + "eslint-config-unjs": "^0.6.2", + "giget": "^3.2.0", + "jiti": "^2.7.0", + "nano-staged": "^1.0.2", + "prettier": "^3.8.3", + "recast": "^0.23.11", + "simple-git-hooks": "^2.13.1", + "source-map": "npm:source-map-js@latest", + "taze": "^19.11.0", + "tsdown": "^0.22.0", + "tsx": "^4.21.0", + "typescript": "^6.0.3", + "vitest": "^4.1.6", + "magicast": "0.5.3" + }, + "resolutions": { + "source-map": "npm:source-map-js@latest" + }, + "simple-git-hooks": { + "pre-commit": "pnpm nano-staged" + }, + "nano-staged": { + "*.{ts,js,mjs,cjs}": [ + "eslint --fix", + "prettier -w" + ] + }, + "inlinedDependencies": { + "recast": "0.23.11", + "source-map-js": "1.2.1" + }, + "scripts": { + "build": "tsdown", + "dev": "vitest dev", + "dev:ui": "vitest dev --ui", + "lint": "eslint --cache . && prettier -c .", + "lint:fix": "eslint --cache . --fix && prettier -c . -w", + "typecheck": "tsc --noEmit", + "release": "pnpm run test run && bumpp", + "test": "vitest", + "test:build": "TEST_BUILD=true vitest", + "test:full": "pnpm run test --run && pnpm run build && pnpm run test:build --run" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/make-dir/index.d.ts b/tools/ui/node_modules/make-dir/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a7825121eb61e3fa7c877517e38982b99f544ef --- /dev/null +++ b/tools/ui/node_modules/make-dir/index.d.ts @@ -0,0 +1,66 @@ +/// +import * as fs from 'fs'; + +declare namespace makeDir { + interface Options { + /** + Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). + + @default 0o777 + */ + readonly mode?: number; + + /** + Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + + Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function. + + @default require('fs') + */ + readonly fs?: typeof fs; + } +} + +declare const makeDir: { + /** + Make a directory and its parents if needed - Think `mkdir -p`. + + @param path - Directory to create. + @returns The path to the created directory. + + @example + ``` + import makeDir = require('make-dir'); + + (async () => { + const path = await makeDir('unicorn/rainbow/cake'); + + console.log(path); + //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' + + // Multiple directories: + const paths = await Promise.all([ + makeDir('unicorn/rainbow'), + makeDir('foo/bar') + ]); + + console.log(paths); + // [ + // '/Users/sindresorhus/fun/unicorn/rainbow', + // '/Users/sindresorhus/fun/foo/bar' + // ] + })(); + ``` + */ + (path: string, options?: makeDir.Options): Promise; + + /** + Synchronously make a directory and its parents if needed - Think `mkdir -p`. + + @param path - Directory to create. + @returns The path to the created directory. + */ + sync(path: string, options?: makeDir.Options): string; +}; + +export = makeDir; diff --git a/tools/ui/node_modules/make-dir/index.js b/tools/ui/node_modules/make-dir/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2c0814ebe5927aca265416e0a0437fd5902fb348 --- /dev/null +++ b/tools/ui/node_modules/make-dir/index.js @@ -0,0 +1,155 @@ +'use strict'; +const fs = require('fs'); +const path = require('path'); +const {promisify} = require('util'); +const semverGte = require('semver/functions/gte'); + +const useNativeRecursiveOption = semverGte(process.version, '10.12.0'); + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); + + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`); + error.code = 'EINVAL'; + throw error; + } + } +}; + +const processOptions = options => { + const defaults = { + mode: 0o777, + fs + }; + + return { + ...defaults, + ...options + }; +}; + +const permissionError = pth => { + // This replicates the exception of `fs.mkdir` with native the + // `recusive` option when run on an invalid drive under Windows. + const error = new Error(`operation not permitted, mkdir '${pth}'`); + error.code = 'EPERM'; + error.errno = -4048; + error.path = pth; + error.syscall = 'mkdir'; + return error; +}; + +const makeDir = async (input, options) => { + checkPath(input); + options = processOptions(options); + + const mkdir = promisify(options.fs.mkdir); + const stat = promisify(options.fs.stat); + + if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) { + const pth = path.resolve(input); + + await mkdir(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = async pth => { + try { + await mkdir(pth, options.mode); + + return pth; + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + await make(path.dirname(pth)); + + return make(pth); + } + + try { + const stats = await stat(pth); + if (!stats.isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch { + throw error; + } + + return pth; + } + }; + + return make(path.resolve(input)); +}; + +module.exports = makeDir; + +module.exports.sync = (input, options) => { + checkPath(input); + options = processOptions(options); + + if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { + const pth = path.resolve(input); + + fs.mkdirSync(pth, { + mode: options.mode, + recursive: true + }); + + return pth; + } + + const make = pth => { + try { + options.fs.mkdirSync(pth, options.mode); + } catch (error) { + if (error.code === 'EPERM') { + throw error; + } + + if (error.code === 'ENOENT') { + if (path.dirname(pth) === pth) { + throw permissionError(pth); + } + + if (error.message.includes('null bytes')) { + throw error; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!options.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch { + throw error; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; diff --git a/tools/ui/node_modules/make-dir/license b/tools/ui/node_modules/make-dir/license new file mode 100644 index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de --- /dev/null +++ b/tools/ui/node_modules/make-dir/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/make-dir/package.json b/tools/ui/node_modules/make-dir/package.json new file mode 100644 index 0000000000000000000000000000000000000000..db305b178907549e33c61f4a4d3088d82ba4fcae --- /dev/null +++ b/tools/ui/node_modules/make-dir/package.json @@ -0,0 +1,63 @@ +{ + "name": "make-dir", + "version": "4.0.0", + "description": "Make a directory and its parents if needed - Think `mkdir -p`", + "license": "MIT", + "repository": "sindresorhus/make-dir", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "mkdir", + "mkdirp", + "make", + "directories", + "folders", + "directory", + "folder", + "path", + "parent", + "parents", + "intermediate", + "recursively", + "recursive", + "create", + "fs", + "filesystem", + "file-system" + ], + "dependencies": { + "semver": "^7.5.3" + }, + "devDependencies": { + "@types/graceful-fs": "^4.1.3", + "@types/node": "^14.14.6", + "ava": "^2.4.0", + "codecov": "^3.2.0", + "graceful-fs": "^4.1.15", + "nyc": "^15.0.0", + "path-type": "^4.0.0", + "tempy": "^1.0.0", + "tsd": "^0.13.1", + "xo": "^0.34.2" + }, + "nyc": { + "reporter": [ + "text", + "lcov" + ] + } +} diff --git a/tools/ui/node_modules/make-dir/readme.md b/tools/ui/node_modules/make-dir/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..13fa8fdd1ef23364dda037269154c1449f3ae71b --- /dev/null +++ b/tools/ui/node_modules/make-dir/readme.md @@ -0,0 +1,125 @@ +# make-dir [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) + +> Make a directory and its parents if needed - Think `mkdir -p` + +## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) + +- Promise API *(Async/await ready!)* +- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) +- 100% test coverage +- CI-tested on macOS, Linux, and Windows +- Actively maintained +- Doesn't bundle a CLI +- Uses the native `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs) + +## Install + +``` +$ npm install make-dir +``` + +## Usage + +``` +$ pwd +/Users/sindresorhus/fun +$ tree +. +``` + +```js +const makeDir = require('make-dir'); + +(async () => { + const path = await makeDir('unicorn/rainbow/cake'); + + console.log(path); + //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' +})(); +``` + +``` +$ tree +. +└── unicorn + └── rainbow + └── cake +``` + +Multiple directories: + +```js +const makeDir = require('make-dir'); + +(async () => { + const paths = await Promise.all([ + makeDir('unicorn/rainbow'), + makeDir('foo/bar') + ]); + + console.log(paths); + /* + [ + '/Users/sindresorhus/fun/unicorn/rainbow', + '/Users/sindresorhus/fun/foo/bar' + ] + */ +})(); +``` + +## API + +### makeDir(path, options?) + +Returns a `Promise` for the path to the created directory. + +### makeDir.sync(path, options?) + +Returns the path to the created directory. + +#### path + +Type: `string` + +Directory to create. + +#### options + +Type: `object` + +##### mode + +Type: `integer`\ +Default: `0o777` + +Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). + +##### fs + +Type: `object`\ +Default: `require('fs')` + +Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + +Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function. + +## Related + +- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module +- [del](https://github.com/sindresorhus/del) - Delete files and directories +- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching +- [cpy](https://github.com/sindresorhus/cpy) - Copy files +- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line +- [move-file](https://github.com/sindresorhus/move-file) - Move a file + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/tools/ui/node_modules/markdown-table/index.d.ts b/tools/ui/node_modules/markdown-table/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7c5ddf28edc0869c741bacbf86bbca6972e43f1 --- /dev/null +++ b/tools/ui/node_modules/markdown-table/index.d.ts @@ -0,0 +1,171 @@ +/** + * Generate a markdown + * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) + * table. + * + * @param {ReadonlyArray>} table + * Table data (matrix of strings). + * @param {Readonly | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Result. + */ +export function markdownTable(table: ReadonlyArray>, options?: Readonly | null | undefined): string; +/** + * Configuration. + */ +export type MarkdownTableOptions = Options; +/** + * Configuration. + */ +export type Options = { + /** + * Whether to align the delimiters (default: `true`); + * they are aligned by default: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * Pass `false` to make them staggered: + * + * ```markdown + * | Alpha | B | + * | - | - | + * | C | Delta | + * ``` + */ + alignDelimiters?: boolean | null | undefined; + /** + * How to align columns (default: `''`); + * one style for all columns or styles for their respective columns; + * each style is either `'l'` (left), `'r'` (right), or `'c'` (center); + * other values are treated as `''`, which doesn’t place the colon in the + * alignment row but does align left; + * *only the lowercased first character is used, so `Right` is fine.* + */ + align?: ReadonlyArray | string | null | undefined; + /** + * Whether to end each row with the delimiter (default: `true`). + * + * > 👉 **Note**: please don’t use this: it could create fragile structures + * > that aren’t understandable to some markdown parsers. + * + * When `true`, there are ending delimiters: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there are no ending delimiters: + * + * ```markdown + * | Alpha | B + * | ----- | ----- + * | C | Delta + * ``` + */ + delimiterEnd?: boolean | null | undefined; + /** + * Whether to begin each row with the delimiter (default: `true`). + * + * > 👉 **Note**: please don’t use this: it could create fragile structures + * > that aren’t understandable to some markdown parsers. + * + * When `true`, there are starting delimiters: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there are no starting delimiters: + * + * ```markdown + * Alpha | B | + * ----- | ----- | + * C | Delta | + * ``` + */ + delimiterStart?: boolean | null | undefined; + /** + * Whether to add a space of padding between delimiters and cells + * (default: `true`). + * + * When `true`, there is padding: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there is no padding: + * + * ```markdown + * |Alpha|B | + * |-----|-----| + * |C |Delta| + * ``` + */ + padding?: boolean | null | undefined; + /** + * Function to detect the length of table cell content (optional); + * this is used when aligning the delimiters (`|`) between table cells; + * full-width characters and emoji mess up delimiter alignment when viewing + * the markdown source; + * to fix this, you can pass this function, + * which receives the cell content and returns its “visible” size; + * note that what is and isn’t visible depends on where the text is displayed. + * + * Without such a function, the following: + * + * ```js + * markdownTable([ + * ['Alpha', 'Bravo'], + * ['中文', 'Charlie'], + * ['👩‍❤️‍👩', 'Delta'] + * ]) + * ``` + * + * Yields: + * + * ```markdown + * | Alpha | Bravo | + * | - | - | + * | 中文 | Charlie | + * | 👩‍❤️‍👩 | Delta | + * ``` + * + * With [`string-width`](https://github.com/sindresorhus/string-width): + * + * ```js + * import stringWidth from 'string-width' + * + * markdownTable( + * [ + * ['Alpha', 'Bravo'], + * ['中文', 'Charlie'], + * ['👩‍❤️‍👩', 'Delta'] + * ], + * {stringLength: stringWidth} + * ) + * ``` + * + * Yields: + * + * ```markdown + * | Alpha | Bravo | + * | ----- | ------- | + * | 中文 | Charlie | + * | 👩‍❤️‍👩 | Delta | + * ``` + */ + stringLength?: ((value: string) => number) | null | undefined; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/markdown-table/index.d.ts.map b/tools/ui/node_modules/markdown-table/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..bf2f00e75a8cb3205a3c59ef5a676f99f7d087d4 --- /dev/null +++ b/tools/ui/node_modules/markdown-table/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6JA;;;;;;;;;;;GAWG;AACH,qCAPW,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,YAEvD,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAElC,MAAM,CAsMlB;;;;mCA1WY,OAAO;;;;;;;;;;;;;;;;;;;;;;;sBAON,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;YAiB1B,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;mBAOpE,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;qBAqB1B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;cAqB1B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmB1B,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS"} \ No newline at end of file diff --git a/tools/ui/node_modules/markdown-table/index.js b/tools/ui/node_modules/markdown-table/index.js new file mode 100644 index 0000000000000000000000000000000000000000..35be1cdb9c906f0086e2a8ef3d06806d6cf4f5b8 --- /dev/null +++ b/tools/ui/node_modules/markdown-table/index.js @@ -0,0 +1,393 @@ +// To do: next major: remove. +/** + * @typedef {Options} MarkdownTableOptions + * Configuration. + */ + +/** + * @typedef Options + * Configuration. + * @property {boolean | null | undefined} [alignDelimiters=true] + * Whether to align the delimiters (default: `true`); + * they are aligned by default: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * Pass `false` to make them staggered: + * + * ```markdown + * | Alpha | B | + * | - | - | + * | C | Delta | + * ``` + * @property {ReadonlyArray | string | null | undefined} [align] + * How to align columns (default: `''`); + * one style for all columns or styles for their respective columns; + * each style is either `'l'` (left), `'r'` (right), or `'c'` (center); + * other values are treated as `''`, which doesn’t place the colon in the + * alignment row but does align left; + * *only the lowercased first character is used, so `Right` is fine.* + * @property {boolean | null | undefined} [delimiterEnd=true] + * Whether to end each row with the delimiter (default: `true`). + * + * > 👉 **Note**: please don’t use this: it could create fragile structures + * > that aren’t understandable to some markdown parsers. + * + * When `true`, there are ending delimiters: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there are no ending delimiters: + * + * ```markdown + * | Alpha | B + * | ----- | ----- + * | C | Delta + * ``` + * @property {boolean | null | undefined} [delimiterStart=true] + * Whether to begin each row with the delimiter (default: `true`). + * + * > 👉 **Note**: please don’t use this: it could create fragile structures + * > that aren’t understandable to some markdown parsers. + * + * When `true`, there are starting delimiters: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there are no starting delimiters: + * + * ```markdown + * Alpha | B | + * ----- | ----- | + * C | Delta | + * ``` + * @property {boolean | null | undefined} [padding=true] + * Whether to add a space of padding between delimiters and cells + * (default: `true`). + * + * When `true`, there is padding: + * + * ```markdown + * | Alpha | B | + * | ----- | ----- | + * | C | Delta | + * ``` + * + * When `false`, there is no padding: + * + * ```markdown + * |Alpha|B | + * |-----|-----| + * |C |Delta| + * ``` + * @property {((value: string) => number) | null | undefined} [stringLength] + * Function to detect the length of table cell content (optional); + * this is used when aligning the delimiters (`|`) between table cells; + * full-width characters and emoji mess up delimiter alignment when viewing + * the markdown source; + * to fix this, you can pass this function, + * which receives the cell content and returns its “visible” size; + * note that what is and isn’t visible depends on where the text is displayed. + * + * Without such a function, the following: + * + * ```js + * markdownTable([ + * ['Alpha', 'Bravo'], + * ['中文', 'Charlie'], + * ['👩‍❤️‍👩', 'Delta'] + * ]) + * ``` + * + * Yields: + * + * ```markdown + * | Alpha | Bravo | + * | - | - | + * | 中文 | Charlie | + * | 👩‍❤️‍👩 | Delta | + * ``` + * + * With [`string-width`](https://github.com/sindresorhus/string-width): + * + * ```js + * import stringWidth from 'string-width' + * + * markdownTable( + * [ + * ['Alpha', 'Bravo'], + * ['中文', 'Charlie'], + * ['👩‍❤️‍👩', 'Delta'] + * ], + * {stringLength: stringWidth} + * ) + * ``` + * + * Yields: + * + * ```markdown + * | Alpha | Bravo | + * | ----- | ------- | + * | 中文 | Charlie | + * | 👩‍❤️‍👩 | Delta | + * ``` + */ + +/** + * @param {string} value + * Cell value. + * @returns {number} + * Cell size. + */ +function defaultStringLength(value) { + return value.length +} + +/** + * Generate a markdown + * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables)) + * table. + * + * @param {ReadonlyArray>} table + * Table data (matrix of strings). + * @param {Readonly | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Result. + */ +export function markdownTable(table, options) { + const settings = options || {} + // To do: next major: change to spread. + const align = (settings.align || []).concat() + const stringLength = settings.stringLength || defaultStringLength + /** @type {Array} Character codes as symbols for alignment per column. */ + const alignments = [] + /** @type {Array>} Cells per row. */ + const cellMatrix = [] + /** @type {Array>} Sizes of each cell per row. */ + const sizeMatrix = [] + /** @type {Array} */ + const longestCellByColumn = [] + let mostCellsPerRow = 0 + let rowIndex = -1 + + // This is a superfluous loop if we don’t align delimiters, but otherwise we’d + // do superfluous work when aligning, so optimize for aligning. + while (++rowIndex < table.length) { + /** @type {Array} */ + const row = [] + /** @type {Array} */ + const sizes = [] + let columnIndex = -1 + + if (table[rowIndex].length > mostCellsPerRow) { + mostCellsPerRow = table[rowIndex].length + } + + while (++columnIndex < table[rowIndex].length) { + const cell = serialize(table[rowIndex][columnIndex]) + + if (settings.alignDelimiters !== false) { + const size = stringLength(cell) + sizes[columnIndex] = size + + if ( + longestCellByColumn[columnIndex] === undefined || + size > longestCellByColumn[columnIndex] + ) { + longestCellByColumn[columnIndex] = size + } + } + + row.push(cell) + } + + cellMatrix[rowIndex] = row + sizeMatrix[rowIndex] = sizes + } + + // Figure out which alignments to use. + let columnIndex = -1 + + if (typeof align === 'object' && 'length' in align) { + while (++columnIndex < mostCellsPerRow) { + alignments[columnIndex] = toAlignment(align[columnIndex]) + } + } else { + const code = toAlignment(align) + + while (++columnIndex < mostCellsPerRow) { + alignments[columnIndex] = code + } + } + + // Inject the alignment row. + columnIndex = -1 + /** @type {Array} */ + const row = [] + /** @type {Array} */ + const sizes = [] + + while (++columnIndex < mostCellsPerRow) { + const code = alignments[columnIndex] + let before = '' + let after = '' + + if (code === 99 /* `c` */) { + before = ':' + after = ':' + } else if (code === 108 /* `l` */) { + before = ':' + } else if (code === 114 /* `r` */) { + after = ':' + } + + // There *must* be at least one hyphen-minus in each alignment cell. + let size = + settings.alignDelimiters === false + ? 1 + : Math.max( + 1, + longestCellByColumn[columnIndex] - before.length - after.length + ) + + const cell = before + '-'.repeat(size) + after + + if (settings.alignDelimiters !== false) { + size = before.length + size + after.length + + if (size > longestCellByColumn[columnIndex]) { + longestCellByColumn[columnIndex] = size + } + + sizes[columnIndex] = size + } + + row[columnIndex] = cell + } + + // Inject the alignment row. + cellMatrix.splice(1, 0, row) + sizeMatrix.splice(1, 0, sizes) + + rowIndex = -1 + /** @type {Array} */ + const lines = [] + + while (++rowIndex < cellMatrix.length) { + const row = cellMatrix[rowIndex] + const sizes = sizeMatrix[rowIndex] + columnIndex = -1 + /** @type {Array} */ + const line = [] + + while (++columnIndex < mostCellsPerRow) { + const cell = row[columnIndex] || '' + let before = '' + let after = '' + + if (settings.alignDelimiters !== false) { + const size = + longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0) + const code = alignments[columnIndex] + + if (code === 114 /* `r` */) { + before = ' '.repeat(size) + } else if (code === 99 /* `c` */) { + if (size % 2) { + before = ' '.repeat(size / 2 + 0.5) + after = ' '.repeat(size / 2 - 0.5) + } else { + before = ' '.repeat(size / 2) + after = before + } + } else { + after = ' '.repeat(size) + } + } + + if (settings.delimiterStart !== false && !columnIndex) { + line.push('|') + } + + if ( + settings.padding !== false && + // Don’t add the opening space if we’re not aligning and the cell is + // empty: there will be a closing space. + !(settings.alignDelimiters === false && cell === '') && + (settings.delimiterStart !== false || columnIndex) + ) { + line.push(' ') + } + + if (settings.alignDelimiters !== false) { + line.push(before) + } + + line.push(cell) + + if (settings.alignDelimiters !== false) { + line.push(after) + } + + if (settings.padding !== false) { + line.push(' ') + } + + if ( + settings.delimiterEnd !== false || + columnIndex !== mostCellsPerRow - 1 + ) { + line.push('|') + } + } + + lines.push( + settings.delimiterEnd === false + ? line.join('').replace(/ +$/, '') + : line.join('') + ) + } + + return lines.join('\n') +} + +/** + * @param {string | null | undefined} [value] + * Value to serialize. + * @returns {string} + * Result. + */ +function serialize(value) { + return value === null || value === undefined ? '' : String(value) +} + +/** + * @param {string | null | undefined} value + * Value. + * @returns {number} + * Alignment. + */ +function toAlignment(value) { + const code = typeof value === 'string' ? value.codePointAt(0) : 0 + + return code === 67 /* `C` */ || code === 99 /* `c` */ + ? 99 /* `c` */ + : code === 76 /* `L` */ || code === 108 /* `l` */ + ? 108 /* `l` */ + : code === 82 /* `R` */ || code === 114 /* `r` */ + ? 114 /* `r` */ + : 0 +} diff --git a/tools/ui/node_modules/markdown-table/license b/tools/ui/node_modules/markdown-table/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/markdown-table/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/markdown-table/package.json b/tools/ui/node_modules/markdown-table/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9e669109261f1dbe7064d9c89f91f416d3574728 --- /dev/null +++ b/tools/ui/node_modules/markdown-table/package.json @@ -0,0 +1,77 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/wooorm/markdown-table/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "description": "Generate a markdown (GFM) table", + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "chalk": "^5.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "strip-ansi": "^7.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.59.0" + }, + "files": [ + "index.d.ts.map", + "index.d.ts", + "index.js" + ], + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "keywords": [ + "align", + "markdown", + "rows", + "table", + "tabular", + "text" + ], + "license": "MIT", + "main": "index.js", + "name": "markdown-table", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "wooorm/markdown-table", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --check-coverage --reporter lcov -- npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "strict": true + }, + "types": "index.d.ts", + "type": "module", + "version": "3.0.4", + "xo": { + "prettier": true, + "rules": { + "complexity": "off", + "unicorn/prefer-switch": "off" + } + } +} diff --git a/tools/ui/node_modules/markdown-table/readme.md b/tools/ui/node_modules/markdown-table/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..86e8a225118eb33537be0346e6b66a0851692b52 --- /dev/null +++ b/tools/ui/node_modules/markdown-table/readme.md @@ -0,0 +1,344 @@ +# markdown-table + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Generate a markdown ([GFM][]) table. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`markdownTable(table[, options])`](#markdowntabletable-options) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Inspiration](#inspiration) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a simple package that takes table data and generates a [GitHub flavored +markdown (GFM)][gfm] table. + +## When should I use this? + +You can use this package when you want to generate the source code of a GFM +table from some data. + +This is a simple solution in that it doesn’t handle escapes or HTML or any of +that. +For a complete but heavier solution, build an AST and serialize it with +[`mdast-util-to-markdown`][mdast-util-to-markdown] (with +[`mdast-util-gfm`][mdast-util-gfm]). + +## Install + +This package is [ESM only][esm]. +In Node.js (version 14.14+, 16.0+), install with [npm][]: + +```sh +npm install markdown-table +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {markdownTable} from 'https://esm.sh/markdown-table@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Typical usage (defaults to align left): + +```js +import {markdownTable} from 'markdown-table' + +markdownTable([ + ['Branch', 'Commit'], + ['main', '0123456789abcdef'], + ['staging', 'fedcba9876543210'] +]) +``` + +Yields: + +```markdown +| Branch | Commit | +| ------- | ---------------- | +| main | 0123456789abcdef | +| staging | fedcba9876543210 | +``` + +With align: + +```js +markdownTable( + [ + ['Beep', 'No.', 'Boop'], + ['beep', '1024', 'xyz'], + ['boop', '3388450', 'tuv'], + ['foo', '10106', 'qrstuv'], + ['bar', '45', 'lmno'] + ], + {align: ['l', 'c', 'r']} +) +``` + +Yields: + +```markdown +| Beep | No. | Boop | +| :--- | :-----: | -----: | +| beep | 1024 | xyz | +| boop | 3388450 | tuv | +| foo | 10106 | qrstuv | +| bar | 45 | lmno | +``` + +## API + +This package exports the identifier `markdownTable`. +There is no default export. + +### `markdownTable(table[, options])` + +Generate a markdown table from table data (matrix of strings). + +##### `options` + +Configuration (optional). + +###### `options.align` + +One style for all columns, or styles for their respective columns (`string` or +`Array`). +Each style is either `'l'` (left), `'r'` (right), or `'c'` (center). +Other values are treated as `''`, which doesn’t place the colon in the alignment +row but does align left. +*Only the lowercased first character is used, so `Right` is fine.* + +###### `options.padding` + +Whether to add a space of padding between delimiters and cells (`boolean`, +default: `true`). + +When `true`, there is padding: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there is no padding: + +```markdown +|Alpha|B | +|-----|-----| +|C |Delta| +``` + +###### `options.delimiterStart` + +Whether to begin each row with the delimiter (`boolean`, default: `true`). + +> 👉 **Note**: please don’t use this: it could create fragile structures that +> aren’t understandable to some markdown parsers. + +When `true`, there are starting delimiters: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there are no starting delimiters: + +```markdown +Alpha | B | +----- | ----- | +C | Delta | +``` + +###### `options.delimiterEnd` + +Whether to end each row with the delimiter (`boolean`, default: `true`). + +> 👉 **Note**: please don’t use this: it could create fragile structures that +> aren’t understandable to some markdown parsers. + +When `true`, there are ending delimiters: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +When `false`, there are no ending delimiters: + +```markdown +| Alpha | B +| ----- | ----- +| C | Delta +``` + +###### `options.alignDelimiters` + +Whether to align the delimiters (`boolean`, default: `true`). +By default, they are aligned: + +```markdown +| Alpha | B | +| ----- | ----- | +| C | Delta | +``` + +Pass `false` to make them staggered: + +```markdown +| Alpha | B | +| - | - | +| C | Delta | +``` + +###### `options.stringLength` + +Function to detect the length of table cell content (`Function`, default: +`s => s.length`). +This is used when aligning the delimiters (`|`) between table cells. +Full-width characters and emoji mess up delimiter alignment when viewing the +markdown source. +To fix this, you can pass this function, which receives the cell content and +returns its “visible” size. +Note that what is and isn’t visible depends on where the text is displayed. + +Without such a function, the following: + +```js +markdownTable([ + ['Alpha', 'Bravo'], + ['中文', 'Charlie'], + ['👩‍❤️‍👩', 'Delta'] +]) +``` + +Yields: + +```markdown +| Alpha | Bravo | +| - | - | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +With [`string-width`][string-width]: + +```js +import stringWidth from 'string-width' + +markdownTable( + [ + ['Alpha', 'Bravo'], + ['中文', 'Charlie'], + ['👩‍❤️‍👩', 'Delta'] + ], + {stringLength: stringWidth} +) +``` + +Yields: + +```markdown +| Alpha | Bravo | +| ----- | ------- | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type `Options`. + +## Compatibility + +This package is at least compatible with all maintained versions of Node.js. +As of now, that is Node.js 14.14+ and 16.0+. +It also works in Deno and modern browsers. + +## Security + +This package is safe. + +## Inspiration + +The original idea and basic implementation was inspired by James Halliday’s +[`text-table`][text-table] library. + +## Contribute + +Yes please! +See [How to Contribute to Open Source][contribute]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/wooorm/markdown-table/workflows/main/badge.svg + +[build]: https://github.com/wooorm/markdown-table/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-table.svg + +[coverage]: https://codecov.io/github/wooorm/markdown-table + +[downloads-badge]: https://img.shields.io/npm/dm/markdown-table.svg + +[downloads]: https://www.npmjs.com/package/markdown-table + +[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-table.svg + +[size]: https://bundlephobia.com/result?p=markdown-table + +[npm]: https://docs.npmjs.com/cli/install + +[esmsh]: https://esm.sh + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[typescript]: https://www.typescriptlang.org + +[contribute]: https://opensource.guide/how-to-contribute/ + +[gfm]: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables + +[text-table]: https://github.com/substack/text-table + +[string-width]: https://github.com/sindresorhus/string-width + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm diff --git a/tools/ui/node_modules/marked/LICENSE.md b/tools/ui/node_modules/marked/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..4bd2d4a084987ab634893a29f72ff6d1a67bf658 --- /dev/null +++ b/tools/ui/node_modules/marked/LICENSE.md @@ -0,0 +1,44 @@ +# License information + +## Contribution License Agreement + +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` + +## Marked + +Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/) +Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +## Markdown + +Copyright © 2004, John Gruber +http://daringfireball.net/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. diff --git a/tools/ui/node_modules/marked/README.md b/tools/ui/node_modules/marked/README.md new file mode 100644 index 0000000000000000000000000000000000000000..60f0b28bc095c0d2956b3d8209f05511df780938 --- /dev/null +++ b/tools/ui/node_modules/marked/README.md @@ -0,0 +1,107 @@ + + + + +# Marked + +[![npm](https://badgen.net/npm/v/marked)](https://www.npmjs.com/package/marked) +[![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked) +[![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked) +[![github actions](https://github.com/markedjs/marked/workflows/Tests/badge.svg)](https://github.com/markedjs/marked/actions) +[![snyk](https://snyk.io/test/npm/marked/badge.svg)](https://snyk.io/test/npm/marked) + +- ⚡ built for speed +- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time +- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications +- 🌐 works in a browser, on a server, or from a command line interface (CLI) + +## Demo + +Check out the [demo page](https://marked.js.org/demo/) to see Marked in action ⛹️ + +## Docs + +Our [documentation pages](https://marked.js.org) are also rendered using marked 💯 + +Also read about: + +* [Options](https://marked.js.org/using_advanced) +* [Extensibility](https://marked.js.org/using_pro) + +## Compatibility + +**Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time. + +**Browser:** [Baseline Widely Available](https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility) + +## Installation + +**CLI:** + +```sh +npm install -g marked +``` + +**In-browser:** + +```sh +npm install marked +``` + +## Usage + +### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨 + +``` +DOMPurify.sanitize(marked.parse(``)); +``` + +**CLI** + +``` bash +# Example with stdin input +$ marked -o hello.html +hello world +^D +$ cat hello.html +

hello world

+``` + +```bash +# Print all options +$ marked --help +``` + +**Browser** + +```html + + + + + Marked in the browser + + +
+ + + + +``` +or import esm module + +```html + +``` + +## License + +Copyright (c) 2018+, MarkedJS. (MIT License) +Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) diff --git a/tools/ui/node_modules/marked/bin/main.js b/tools/ui/node_modules/marked/bin/main.js new file mode 100644 index 0000000000000000000000000000000000000000..14059affdef3fc146872541dd47c2560fcdb592c --- /dev/null +++ b/tools/ui/node_modules/marked/bin/main.js @@ -0,0 +1,283 @@ +#!/usr/bin/env node + +/** + * Marked CLI + * Copyright (c) 2018+, MarkedJS. (MIT License) + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + */ + +import { promises } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { homedir } from 'node:os'; +import { createRequire } from 'node:module'; +import { marked } from '../lib/marked.esm.js'; + +const { access, readFile, writeFile } = promises; +const require = createRequire(import.meta.url); + +/** + * @param {Process} nodeProcess inject process so it can be mocked in tests. + */ +export async function main(nodeProcess) { + /** + * Man Page + */ + async function help() { + const { spawn } = await import('child_process'); + const { fileURLToPath } = await import('url'); + + const options = { + cwd: nodeProcess.cwd(), + env: nodeProcess.env, + stdio: 'inherit', + }; + + const __dirname = dirname(fileURLToPath(import.meta.url)); + const helpText = await readFile(resolve(__dirname, '../man/marked.1.md'), 'utf8'); + + await new Promise(res => { + const manProcess = spawn('man', [resolve(__dirname, '../man/marked.1')], options); + nodeProcess.on('SIGINT', () => { + manProcess.kill('SIGINT'); + }); + + manProcess.on('error', () => { + console.log(helpText); + }) + .on('close', res); + }); + } + + async function version() { + const pkg = require('../package.json'); + console.log(pkg.version); + } + + /** + * Main + */ + async function start(argv) { + const files = []; + const options = {}; + let input; + let output; + let string; + let arg; + let tokens; + let config; + let opt; + let noclobber; + + function getArg() { + let arg = argv.shift(); + + if (arg.indexOf('--') === 0) { + // e.g. --opt + arg = arg.split('='); + if (arg.length > 1) { + // e.g. --opt=val + argv.unshift(arg.slice(1).join('=')); + } + arg = arg[0]; + } else if (arg[0] === '-') { + if (arg.length > 2) { + // e.g. -abc + argv = arg.substring(1).split('').map(function(ch) { + return '-' + ch; + }).concat(argv); + arg = argv.shift(); + } else { + // e.g. -a + } + } else { + // e.g. foo + } + + return arg; + } + + while (argv.length) { + arg = getArg(); + switch (arg) { + case '-o': + case '--output': + output = argv.shift(); + break; + case '-i': + case '--input': + input = argv.shift(); + break; + case '-s': + case '--string': + string = argv.shift(); + break; + case '-t': + case '--tokens': + tokens = true; + break; + case '-c': + case '--config': + config = argv.shift(); + break; + case '-n': + case '--no-clobber': + noclobber = true; + break; + case '-h': + case '--help': + return await help(); + case '-v': + case '--version': + return await version(); + default: + if (arg.indexOf('--') === 0) { + opt = camelize(arg.replace(/^--(no-)?/, '')); + if (!(opt in marked.defaults)) { + continue; + } + if (arg.indexOf('--no-') === 0) { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? null + : false; + } else { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? argv.shift() + : true; + } + } else { + files.push(arg); + } + break; + } + } + + async function getData() { + if (!input) { + if (files.length <= 2) { + if (string) { + return string; + } + return await getStdin(); + } + input = files.pop(); + } + return await readFile(input, 'utf8'); + } + + function resolveFile(file) { + return resolve(file.replace(/^~/, homedir)); + } + + function fileExists(file) { + return access(resolveFile(file)).then(() => true, () => false); + } + + async function runConfig(file) { + const configFile = resolveFile(file); + let markedConfig; + try { + // try require for json + markedConfig = require(configFile); + } catch(err) { + if (err.code !== 'ERR_REQUIRE_ESM') { + throw err; + } + // must import esm + markedConfig = await import('file:///' + configFile); + } + + if (markedConfig.default) { + markedConfig = markedConfig.default; + } + + if (typeof markedConfig === 'function') { + markedConfig(marked); + } else { + marked.use(markedConfig); + } + } + + const data = await getData(); + + if (config) { + if (!await fileExists(config)) { + throw Error(`Cannot load config file '${config}'`); + } + + await runConfig(config); + } else { + const defaultConfig = [ + '~/.marked.json', + '~/.marked.js', + '~/.marked/index.js', + ]; + + for (const configFile of defaultConfig) { + if (await fileExists(configFile)) { + await runConfig(configFile); + break; + } + } + } + + const html = tokens + ? JSON.stringify(marked.lexer(data, options), null, 2) + : await marked.parse(data, options); + + if (output) { + if (noclobber && await fileExists(output)) { + throw Error('marked: output file \'' + output + '\' already exists, disable the \'-n\' / \'--no-clobber\' flag to overwrite\n'); + } + return await writeFile(output, html); + } + + nodeProcess.stdout.write(html + '\n'); + } + + /** + * Helpers + */ + function getStdin() { + return new Promise((resolve, reject) => { + const stdin = nodeProcess.stdin; + let buff = ''; + + stdin.setEncoding('utf8'); + + stdin.on('data', function(data) { + buff += data; + }); + + stdin.on('error', function(err) { + reject(err); + }); + + stdin.on('end', function() { + resolve(buff); + }); + + stdin.resume(); + }); + } + + /** + * @param {string} text + */ + function camelize(text) { + return text.replace(/(\w)-(\w)/g, function(_, a, b) { + return a + b.toUpperCase(); + }); + } + + try { + await start(nodeProcess.argv.slice()); + nodeProcess.exit(0); + } catch(err) { + if (err.code === 'ENOENT') { + nodeProcess.stderr.write('marked: ' + err.path + ': No such file or directory'); + } else { + nodeProcess.stderr.write(err.message); + } + return nodeProcess.exit(1); + } +} diff --git a/tools/ui/node_modules/marked/bin/marked.js b/tools/ui/node_modules/marked/bin/marked.js new file mode 100644 index 0000000000000000000000000000000000000000..65ff0aaa4c0140a3c66f9d55b8f0f3be4b593116 --- /dev/null +++ b/tools/ui/node_modules/marked/bin/marked.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +/** + * Marked CLI + * Copyright (c) 2018+, MarkedJS. (MIT License) + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + */ + +import { main } from './main.js'; + +/** + * Expose / Entry Point + */ + +process.title = 'marked'; +main(process); diff --git a/tools/ui/node_modules/marked/lib/marked.d.ts b/tools/ui/node_modules/marked/lib/marked.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11d4901a0b5871008c8229c875fccc26e9564907 --- /dev/null +++ b/tools/ui/node_modules/marked/lib/marked.d.ts @@ -0,0 +1,749 @@ +// Generated by dts-bundle-generator v9.5.1 + +export type MarkedToken = (Tokens.Blockquote | Tokens.Br | Tokens.Code | Tokens.Codespan | Tokens.Def | Tokens.Del | Tokens.Em | Tokens.Escape | Tokens.Heading | Tokens.Hr | Tokens.HTML | Tokens.Image | Tokens.Link | Tokens.List | Tokens.ListItem | Tokens.Paragraph | Tokens.Space | Tokens.Strong | Tokens.Table | Tokens.Tag | Tokens.Text); +export type Token = (MarkedToken | Tokens.Generic); +export declare namespace Tokens { + interface Blockquote { + type: "blockquote"; + raw: string; + text: string; + tokens: Token[]; + } + interface Br { + type: "br"; + raw: string; + } + interface Checkbox { + checked: boolean; + } + interface Code { + type: "code"; + raw: string; + codeBlockStyle?: "indented"; + lang?: string; + text: string; + escaped?: boolean; + } + interface Codespan { + type: "codespan"; + raw: string; + text: string; + } + interface Def { + type: "def"; + raw: string; + tag: string; + href: string; + title: string; + } + interface Del { + type: "del"; + raw: string; + text: string; + tokens: Token[]; + } + interface Em { + type: "em"; + raw: string; + text: string; + tokens: Token[]; + } + interface Escape { + type: "escape"; + raw: string; + text: string; + } + interface Generic { + [index: string]: any; + type: string; + raw: string; + tokens?: Token[]; + } + interface Heading { + type: "heading"; + raw: string; + depth: number; + text: string; + tokens: Token[]; + } + interface Hr { + type: "hr"; + raw: string; + } + interface HTML { + type: "html"; + raw: string; + pre: boolean; + text: string; + block: boolean; + } + interface Image { + type: "image"; + raw: string; + href: string; + title: string | null; + text: string; + tokens: Token[]; + } + interface Link { + type: "link"; + raw: string; + href: string; + title?: string | null; + text: string; + tokens: Token[]; + } + interface List { + type: "list"; + raw: string; + ordered: boolean; + start: number | ""; + loose: boolean; + items: ListItem[]; + } + interface ListItem { + type: "list_item"; + raw: string; + task: boolean; + checked?: boolean; + loose: boolean; + text: string; + tokens: Token[]; + } + interface Paragraph { + type: "paragraph"; + raw: string; + pre?: boolean; + text: string; + tokens: Token[]; + } + interface Space { + type: "space"; + raw: string; + } + interface Strong { + type: "strong"; + raw: string; + text: string; + tokens: Token[]; + } + interface Table { + type: "table"; + raw: string; + align: Array<"center" | "left" | "right" | null>; + header: TableCell[]; + rows: TableCell[][]; + } + interface TableCell { + text: string; + tokens: Token[]; + header: boolean; + align: "center" | "left" | "right" | null; + } + interface TableRow

{ + text: P; + } + interface Tag { + type: "html"; + raw: string; + inLink: boolean; + inRawBlock: boolean; + text: string; + block: boolean; + } + interface Text { + type: "text"; + raw: string; + text: string; + tokens?: Token[]; + escaped?: boolean; + } +} +export type Links = Record>; +export type TokensList = Token[] & { + links: Links; +}; +/** + * Renderer + */ +declare class _Renderer { + options: MarkedOptions; + parser: _Parser; + constructor(options?: MarkedOptions); + space(token: Tokens.Space): RendererOutput; + code({ text, lang, escaped }: Tokens.Code): RendererOutput; + blockquote({ tokens }: Tokens.Blockquote): RendererOutput; + html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput; + def(token: Tokens.Def): RendererOutput; + heading({ tokens, depth }: Tokens.Heading): RendererOutput; + hr(token: Tokens.Hr): RendererOutput; + list(token: Tokens.List): RendererOutput; + listitem(item: Tokens.ListItem): RendererOutput; + checkbox({ checked }: Tokens.Checkbox): RendererOutput; + paragraph({ tokens }: Tokens.Paragraph): RendererOutput; + table(token: Tokens.Table): RendererOutput; + tablerow({ text }: Tokens.TableRow): RendererOutput; + tablecell(token: Tokens.TableCell): RendererOutput; + /** + * span level renderer + */ + strong({ tokens }: Tokens.Strong): RendererOutput; + em({ tokens }: Tokens.Em): RendererOutput; + codespan({ text }: Tokens.Codespan): RendererOutput; + br(token: Tokens.Br): RendererOutput; + del({ tokens }: Tokens.Del): RendererOutput; + link({ href, title, tokens }: Tokens.Link): RendererOutput; + image({ href, title, text, tokens }: Tokens.Image): RendererOutput; + text(token: Tokens.Text | Tokens.Escape): RendererOutput; +} +/** + * TextRenderer + * returns only the textual part of the token + */ +declare class _TextRenderer { + strong({ text }: Tokens.Strong): RendererOutput; + em({ text }: Tokens.Em): RendererOutput; + codespan({ text }: Tokens.Codespan): RendererOutput; + del({ text }: Tokens.Del): RendererOutput; + html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput; + text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput; + link({ text }: Tokens.Link): RendererOutput; + image({ text }: Tokens.Image): RendererOutput; + br(): RendererOutput; +} +/** + * Parsing & Compiling + */ +declare class _Parser { + options: MarkedOptions; + renderer: _Renderer; + textRenderer: _TextRenderer; + constructor(options?: MarkedOptions); + /** + * Static Parse Method + */ + static parse(tokens: Token[], options?: MarkedOptions): ParserOutput; + /** + * Static Parse Inline Method + */ + static parseInline(tokens: Token[], options?: MarkedOptions): ParserOutput; + /** + * Parse Loop + */ + parse(tokens: Token[], top?: boolean): ParserOutput; + /** + * Parse Inline Tokens + */ + parseInline(tokens: Token[], renderer?: _Renderer | _TextRenderer): ParserOutput; +} +declare const other: { + codeRemoveIndent: RegExp; + outputLinkReplace: RegExp; + indentCodeCompensation: RegExp; + beginningSpace: RegExp; + endingHash: RegExp; + startingSpaceChar: RegExp; + endingSpaceChar: RegExp; + nonSpaceChar: RegExp; + newLineCharGlobal: RegExp; + tabCharGlobal: RegExp; + multipleSpaceGlobal: RegExp; + blankLine: RegExp; + doubleBlankLine: RegExp; + blockquoteStart: RegExp; + blockquoteSetextReplace: RegExp; + blockquoteSetextReplace2: RegExp; + listReplaceTabs: RegExp; + listReplaceNesting: RegExp; + listIsTask: RegExp; + listReplaceTask: RegExp; + anyLine: RegExp; + hrefBrackets: RegExp; + tableDelimiter: RegExp; + tableAlignChars: RegExp; + tableRowBlankLine: RegExp; + tableAlignRight: RegExp; + tableAlignCenter: RegExp; + tableAlignLeft: RegExp; + startATag: RegExp; + endATag: RegExp; + startPreScriptTag: RegExp; + endPreScriptTag: RegExp; + startAngleBracket: RegExp; + endAngleBracket: RegExp; + pedanticHrefTitle: RegExp; + unicodeAlphaNumeric: RegExp; + escapeTest: RegExp; + escapeReplace: RegExp; + escapeTestNoEncode: RegExp; + escapeReplaceNoEncode: RegExp; + unescapeTest: RegExp; + caret: RegExp; + percentDecode: RegExp; + findPipe: RegExp; + splitPipe: RegExp; + slashPipe: RegExp; + carriageReturn: RegExp; + spaceLine: RegExp; + notSpaceStart: RegExp; + endingNewline: RegExp; + listItemRegex: (bull: string) => RegExp; + nextBulletRegex: (indent: number) => RegExp; + hrRegex: (indent: number) => RegExp; + fencesBeginRegex: (indent: number) => RegExp; + headingBeginRegex: (indent: number) => RegExp; + htmlBeginRegex: (indent: number) => RegExp; +}; +declare const blockNormal: { + blockquote: RegExp; + code: RegExp; + def: RegExp; + fences: RegExp; + heading: RegExp; + hr: RegExp; + html: RegExp; + lheading: RegExp; + list: RegExp; + newline: RegExp; + paragraph: RegExp; + table: RegExp; + text: RegExp; +}; +export type BlockKeys = keyof typeof blockNormal; +declare const inlineNormal: { + _backpedal: RegExp; + anyPunctuation: RegExp; + autolink: RegExp; + blockSkip: RegExp; + br: RegExp; + code: RegExp; + del: RegExp; + emStrongLDelim: RegExp; + emStrongRDelimAst: RegExp; + emStrongRDelimUnd: RegExp; + escape: RegExp; + link: RegExp; + nolink: RegExp; + punctuation: RegExp; + reflink: RegExp; + reflinkSearch: RegExp; + tag: RegExp; + text: RegExp; + url: RegExp; +}; +export type InlineKeys = keyof typeof inlineNormal; +export interface Rules { + other: typeof other; + block: Record; + inline: Record; +} +/** + * Tokenizer + */ +declare class _Tokenizer { + options: MarkedOptions; + rules: Rules; + lexer: _Lexer; + constructor(options?: MarkedOptions); + space(src: string): Tokens.Space | undefined; + code(src: string): Tokens.Code | undefined; + fences(src: string): Tokens.Code | undefined; + heading(src: string): Tokens.Heading | undefined; + hr(src: string): Tokens.Hr | undefined; + blockquote(src: string): Tokens.Blockquote | undefined; + list(src: string): Tokens.List | undefined; + html(src: string): Tokens.HTML | undefined; + def(src: string): Tokens.Def | undefined; + table(src: string): Tokens.Table | undefined; + lheading(src: string): Tokens.Heading | undefined; + paragraph(src: string): Tokens.Paragraph | undefined; + text(src: string): Tokens.Text | undefined; + escape(src: string): Tokens.Escape | undefined; + tag(src: string): Tokens.Tag | undefined; + link(src: string): Tokens.Link | Tokens.Image | undefined; + reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined; + emStrong(src: string, maskedSrc: string, prevChar?: string): Tokens.Em | Tokens.Strong | undefined; + codespan(src: string): Tokens.Codespan | undefined; + br(src: string): Tokens.Br | undefined; + del(src: string): Tokens.Del | undefined; + autolink(src: string): Tokens.Link | undefined; + url(src: string): Tokens.Link | undefined; + inlineText(src: string): Tokens.Text | undefined; +} +declare class _Hooks { + options: MarkedOptions; + block?: boolean; + constructor(options?: MarkedOptions); + static passThroughHooks: Set; + static passThroughHooksRespectAsync: Set; + /** + * Process markdown before marked + */ + preprocess(markdown: string): string; + /** + * Process HTML after marked is finished + */ + postprocess(html: ParserOutput): ParserOutput; + /** + * Process all tokens before walk tokens + */ + processAllTokens(tokens: Token[] | TokensList): Token[] | TokensList; + /** + * Mask contents that should not be interpreted as em/strong delimiters + */ + emStrongMask(src: string): string; + /** + * Provide function to tokenize markdown + */ + provideLexer(): typeof _Lexer.lexInline; + /** + * Provide function to parse tokens + */ + provideParser(): (tokens: Token[], options?: MarkedOptions | undefined) => ParserOutput; +} +export interface TokenizerThis { + lexer: _Lexer; +} +export type TokenizerExtensionFunction = (this: TokenizerThis, src: string, tokens: Token[] | TokensList) => Tokens.Generic | undefined; +export type TokenizerStartFunction = (this: TokenizerThis, src: string) => number | void; +export interface TokenizerExtension { + name: string; + level: "block" | "inline"; + start?: TokenizerStartFunction; + tokenizer: TokenizerExtensionFunction; + childTokens?: string[]; +} +export interface RendererThis { + parser: _Parser; +} +export type RendererExtensionFunction = (this: RendererThis, token: Tokens.Generic) => RendererOutput | false | undefined; +export interface RendererExtension { + name: string; + renderer: RendererExtensionFunction; +} +export type TokenizerAndRendererExtension = TokenizerExtension | RendererExtension | (TokenizerExtension & RendererExtension); +export type HooksApi = Omit<_Hooks, "constructor" | "options" | "block">; +export type HooksObject = { + [K in keyof HooksApi]?: (this: _Hooks, ...args: Parameters[K]>) => ReturnType[K]> | Promise[K]>>; +}; +export type RendererApi = Omit<_Renderer, "constructor" | "options" | "parser">; +export type RendererObject = { + [K in keyof RendererApi]?: (this: _Renderer, ...args: Parameters[K]>) => ReturnType[K]> | false; +}; +export type TokenizerApi = Omit<_Tokenizer, "constructor" | "options" | "rules" | "lexer">; +export type TokenizerObject = { + [K in keyof TokenizerApi]?: (this: _Tokenizer, ...args: Parameters[K]>) => ReturnType[K]> | false; +}; +export interface MarkedExtension { + /** + * True will tell marked to await any walkTokens functions before parsing the tokens and returning an HTML string. + */ + async?: boolean; + /** + * Enable GFM line breaks. This option requires the gfm option to be true. + */ + breaks?: boolean; + /** + * Add tokenizers and renderers to marked + */ + extensions?: TokenizerAndRendererExtension[] | null; + /** + * Enable GitHub flavored markdown. + */ + gfm?: boolean; + /** + * Hooks are methods that hook into some part of marked. + * preprocess is called to process markdown before sending it to marked. + * processAllTokens is called with the TokensList before walkTokens. + * postprocess is called to process html after marked has finished parsing. + * emStrongMask is called to mask contents that should not be interpreted as em/strong delimiters. + * provideLexer is called to provide a function to tokenize markdown. + * provideParser is called to provide a function to parse tokens. + */ + hooks?: HooksObject | null; + /** + * Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior. + */ + pedantic?: boolean; + /** + * Type: object Default: new Renderer() + * + * An object containing functions to render tokens to HTML. + */ + renderer?: RendererObject | null; + /** + * Shows an HTML error message when rendering fails. + */ + silent?: boolean; + /** + * The tokenizer defines how to turn markdown text into tokens. + */ + tokenizer?: TokenizerObject | null; + /** + * The walkTokens function gets called with every token. + * Child tokens are called before moving on to sibling tokens. + * Each token is passed by reference so updates are persisted when passed to the parser. + * The return value of the function is ignored. + */ + walkTokens?: ((token: Token) => void | Promise) | null; +} +export interface MarkedOptions extends Omit, "hooks" | "renderer" | "tokenizer" | "extensions" | "walkTokens"> { + /** + * Hooks are methods that hook into some part of marked. + */ + hooks?: _Hooks | null; + /** + * Type: object Default: new Renderer() + * + * An object containing functions to render tokens to HTML. + */ + renderer?: _Renderer | null; + /** + * The tokenizer defines how to turn markdown text into tokens. + */ + tokenizer?: _Tokenizer | null; + /** + * Custom extensions + */ + extensions?: null | { + renderers: { + [name: string]: RendererExtensionFunction; + }; + childTokens: { + [name: string]: string[]; + }; + inline?: TokenizerExtensionFunction[]; + block?: TokenizerExtensionFunction[]; + startInline?: TokenizerStartFunction[]; + startBlock?: TokenizerStartFunction[]; + }; + /** + * walkTokens function returns array of values for Promise.all + */ + walkTokens?: null | ((token: Token) => void | Promise | (void | Promise)[]); +} +/** + * Block Lexer + */ +declare class _Lexer { + tokens: TokensList; + options: MarkedOptions; + state: { + inLink: boolean; + inRawBlock: boolean; + top: boolean; + }; + private tokenizer; + private inlineQueue; + constructor(options?: MarkedOptions); + /** + * Expose Rules + */ + static get rules(): { + block: { + normal: { + blockquote: RegExp; + code: RegExp; + def: RegExp; + fences: RegExp; + heading: RegExp; + hr: RegExp; + html: RegExp; + lheading: RegExp; + list: RegExp; + newline: RegExp; + paragraph: RegExp; + table: RegExp; + text: RegExp; + }; + gfm: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>; + pedantic: Record<"code" | "blockquote" | "hr" | "html" | "table" | "text" | "def" | "heading" | "list" | "paragraph" | "fences" | "lheading" | "newline", RegExp>; + }; + inline: { + normal: { + _backpedal: RegExp; + anyPunctuation: RegExp; + autolink: RegExp; + blockSkip: RegExp; + br: RegExp; + code: RegExp; + del: RegExp; + emStrongLDelim: RegExp; + emStrongRDelimAst: RegExp; + emStrongRDelimUnd: RegExp; + escape: RegExp; + link: RegExp; + nolink: RegExp; + punctuation: RegExp; + reflink: RegExp; + reflinkSearch: RegExp; + tag: RegExp; + text: RegExp; + url: RegExp; + }; + gfm: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>; + breaks: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>; + pedantic: Record<"link" | "code" | "url" | "br" | "del" | "text" | "escape" | "tag" | "reflink" | "nolink" | "_backpedal" | "anyPunctuation" | "autolink" | "blockSkip" | "emStrongLDelim" | "emStrongRDelimAst" | "emStrongRDelimUnd" | "punctuation" | "reflinkSearch", RegExp>; + }; + }; + /** + * Static Lex Method + */ + static lex(src: string, options?: MarkedOptions): TokensList; + /** + * Static Lex Inline Method + */ + static lexInline(src: string, options?: MarkedOptions): Token[]; + /** + * Preprocessing + */ + lex(src: string): TokensList; + /** + * Lexing + */ + blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[]; + blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList; + inline(src: string, tokens?: Token[]): Token[]; + /** + * Lexing/Compiling + */ + inlineTokens(src: string, tokens?: Token[]): Token[]; +} +/** + * Gets the original marked default options. + */ +declare function _getDefaults(): MarkedOptions; +declare let _defaults: MarkedOptions; +export type MaybePromise = void | Promise; +export declare class Marked { + defaults: MarkedOptions; + options: (opt: MarkedOptions) => this; + parse: { + (src: string, options: MarkedOptions & { + async: true; + }): Promise; + (src: string, options: MarkedOptions & { + async: false; + }): ParserOutput; + (src: string, options?: MarkedOptions | null): ParserOutput | Promise; + }; + parseInline: { + (src: string, options: MarkedOptions & { + async: true; + }): Promise; + (src: string, options: MarkedOptions & { + async: false; + }): ParserOutput; + (src: string, options?: MarkedOptions | null): ParserOutput | Promise; + }; + Parser: { + new (options?: MarkedOptions | undefined): _Parser; + parse(tokens: Token[], options?: MarkedOptions): ParserOutput_1; + parseInline(tokens: Token[], options?: MarkedOptions): ParserOutput_1; + }; + Renderer: { + new (options?: MarkedOptions | undefined): _Renderer; + }; + TextRenderer: { + new (): _TextRenderer; + }; + Lexer: typeof _Lexer; + Tokenizer: { + new (options?: MarkedOptions | undefined): _Tokenizer; + }; + Hooks: { + new (options?: MarkedOptions | undefined): _Hooks; + passThroughHooks: Set; + passThroughHooksRespectAsync: Set; + }; + constructor(...args: MarkedExtension[]); + /** + * Run callback for every token + */ + walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]): MaybePromise[]; + use(...args: MarkedExtension[]): this; + setOptions(opt: MarkedOptions): this; + lexer(src: string, options?: MarkedOptions): TokensList; + parser(tokens: Token[], options?: MarkedOptions): ParserOutput; + private parseMarkdown; + private onError; +} +/** + * Compiles markdown to HTML asynchronously. + * + * @param src String of markdown source to be compiled + * @param options Hash of options, having async: true + * @return Promise of string of compiled HTML + */ +export declare function marked(src: string, options: MarkedOptions & { + async: true; +}): Promise; +/** + * Compiles markdown to HTML. + * + * @param src String of markdown source to be compiled + * @param options Optional hash of options + * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions. + */ +export declare function marked(src: string, options: MarkedOptions & { + async: false; +}): string; +export declare function marked(src: string, options: MarkedOptions & { + async: true; +}): Promise; +export declare function marked(src: string, options?: MarkedOptions | null): string | Promise; +export declare namespace marked { + var options: (options: MarkedOptions) => typeof marked; + var setOptions: (options: MarkedOptions) => typeof marked; + var getDefaults: typeof _getDefaults; + var defaults: MarkedOptions; + var use: (...args: MarkedExtension[]) => typeof marked; + var walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[]; + var parseInline: { + (src: string, options: MarkedOptions & { + async: true; + }): Promise; + (src: string, options: MarkedOptions & { + async: false; + }): string; + (src: string, options?: MarkedOptions | null | undefined): string | Promise; + }; + var Parser: typeof _Parser; + var parser: typeof _Parser.parse; + var Renderer: typeof _Renderer; + var TextRenderer: typeof _TextRenderer; + var Lexer: typeof _Lexer; + var lexer: typeof _Lexer.lex; + var Tokenizer: typeof _Tokenizer; + var Hooks: typeof _Hooks; + var parse: typeof marked; +} +export declare const options: (options: MarkedOptions) => typeof marked; +export declare const setOptions: (options: MarkedOptions) => typeof marked; +export declare const use: (...args: MarkedExtension[]) => typeof marked; +export declare const walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[]; +export declare const parseInline: { + (src: string, options: MarkedOptions & { + async: true; + }): Promise; + (src: string, options: MarkedOptions & { + async: false; + }): string; + (src: string, options?: MarkedOptions | null | undefined): string | Promise; +}; +export declare const parse: typeof marked; +export declare const parser: typeof _Parser.parse; +export declare const lexer: typeof _Lexer.lex; + +export { + _Hooks as Hooks, + _Lexer as Lexer, + _Parser as Parser, + _Renderer as Renderer, + _TextRenderer as TextRenderer, + _Tokenizer as Tokenizer, + _defaults as defaults, + _getDefaults as getDefaults, +}; + +export {}; diff --git a/tools/ui/node_modules/marked/lib/marked.esm.js b/tools/ui/node_modules/marked/lib/marked.esm.js new file mode 100644 index 0000000000000000000000000000000000000000..8e4e786596ce4358c6fa3c809ea862764f7ab94a --- /dev/null +++ b/tools/ui/node_modules/marked/lib/marked.esm.js @@ -0,0 +1,73 @@ +/** + * marked v16.4.2 - a markdown parser + * Copyright (c) 2018-2025, MarkedJS. (MIT License) + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + * https://github.com/markedjs/marked + */ + +/** + * DO NOT EDIT THIS FILE + * The code in this file is generated from files in ./src/ + */ + +function L(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=L();function G(l){T=l}var E={exec:()=>null};function d(l,e=""){let t=typeof l=="string"?l:l.source,n={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(m.caret,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var be=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i")},Re=/^(?:[ \t]*(?:\n|$))+/,Te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Oe=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,we=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=d(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ye=d(ie).replace(/bull/g,F).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pe=/^[^\n]+/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Se=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$e=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/|$))/,_e=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",U).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=d(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Le=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),K={blockquote:Le,code:Te,def:Se,fences:Oe,heading:we,hr:I,html:_e,lheading:oe,list:$e,newline:Re,paragraph:ae,table:E,text:Pe},re=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Me={...K,lheading:ye,table:re,paragraph:d(j).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},ze={...K,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(j).replace("hr",I).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",oe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ae=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ee=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,le=/^( {2,}|\\)\n(?!\s*$)/,Ie=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",be?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ce=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,De=d(ce,"u").replace(/punct/g,D).getRegex(),He=d(ce,"u").replace(/punct/g,pe).getRegex(),he="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ze=d(he,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Ge=d(he,"gu").replace(/notPunctSpace/g,qe).replace(/punctSpace/g,Be).replace(/punct/g,pe).getRegex(),Ne=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Fe=d(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),je=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qe=d(U).replace("(?:-->|$)","-->").getRegex(),Ue=d("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Qe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ke=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),de=d(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",Q).getRegex(),ke=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),We=d("reflink|nolink(?!\\()","g").replace("reflink",de).replace("nolink",ke).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:E,anyPunctuation:Fe,autolink:je,blockSkip:ve,br:le,code:Ee,del:E,emStrongLDelim:De,emStrongRDelimAst:Ze,emStrongRDelimUnd:Ne,escape:Ae,link:Ke,nolink:ke,punctuation:Ce,reflink:de,reflinkSearch:We,tag:Ue,text:Ie,url:E},Xe={...X,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...X,emStrongRDelimAst:Ge,emStrongLDelim:He,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},ge=l=>Ve[l];function w(l,e){if(e){if(m.escapeTest.test(l))return l.replace(m.escapeReplace,ge)}else if(m.escapeTestNoEncode.test(l))return l.replace(m.escapeReplaceNoEncode,ge);return l}function J(l){try{l=encodeURI(l).replace(m.percentDecode,"%")}catch{return null}return l}function V(l,e){let t=l.replace(m.findPipe,(i,s,a)=>{let o=!1,p=s;for(;--p>=0&&a[p]==="\\";)o=!o;return o?"|":" |"}),n=t.split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function me(l,e,t,n,r){let i=e.href,s=e.title||null,a=l[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:l[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}function Ye(l,e,t){let n=l.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(` +`).map(i=>{let s=i.match(t.other.beginningSpace);if(s===null)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join(` +`)}var y=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:z(n,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Ye(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=z(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:z(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=z(t[0],` +`).split(` +`),r="",i="",s=[];for(;n.length>0;){let a=!1,o=[],p;for(p=0;p1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let p=!1,u="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let g=t[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,H=>" ".repeat(3*H.length)),h=e.split(` +`,1)[0],R=!g.trim(),f=0;if(this.options.pedantic?(f=2,c=g.trimStart()):R?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=g.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(u+=h+` +`,e=e.substring(h.length+1),p=!0),!p){let H=this.rules.other.nextBulletRegex(f),ee=this.rules.other.hrRegex(f),te=this.rules.other.fencesBeginRegex(f),ne=this.rules.other.headingBeginRegex(f),xe=this.rules.other.htmlBeginRegex(f);for(;e;){let Z=e.split(` +`,1)[0],A;if(h=Z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),te.test(h)||ne.test(h)||xe.test(h)||H.test(h)||ee.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+=` +`+A.slice(f);else{if(R||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||te.test(g)||ne.test(g)||ee.test(g))break;c+=` +`+h}!R&&!h.trim()&&(R=!0),u+=Z+` +`,e=e.substring(Z.length+1),g=A.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let O=null,Y;this.options.gfm&&(O=this.rules.other.listIsTask.exec(c),O&&(Y=O[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!O,checked:Y,loose:!1,text:c,tokens:[]}),i.raw+=u}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let p=0;pg.type==="space"),c=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=c}if(i.loose)for(let p=0;p({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[p]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=fe(t[2],"()");if(s===-2)return;if(s>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),me(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return me(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,p=s,u=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){p+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(p-=o,p>0)continue;o=Math.min(o,o+p+u);let g=[...r[0]][0].length,h=e.slice(0,s+r.index+g+o);if(Math.min(s,o)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:"strong",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}};var x=class l{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:C.normal,inline:M.normal};this.options.pedantic?(t.block=C.pedantic,t.inline=M.pedantic):this.options.gfm&&(t.block=C.gfm,this.options.breaks?t.inline=M.breaks:t.inline=M.gfm),this.tokenizer.rules=t}static get rules(){return{block:C,inline:M}}static lex(e,t){return new l(t).lex(e)}static lexInline(e,t){return new l(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let t=0;t(r=s.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);r.raw.length===1&&s!==void 0?s.raw+=` +`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(p=>{o=p.call({lexer:this},a),typeof o=="number"&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=t.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let p=e;if(this.options.extensions?.startInline){let u=1/0,c=e.slice(1),g;this.options.extensions.startInline.forEach(h=>{g=h.call({lexer:this},c),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(p)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}};var P=class{options;parser;constructor(e){this.options=e||T}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,"")+` +`;return r?'

'+(n?i:w(i,!0))+`
+`:"
"+(n?i:w(i,!0))+`
+`}blockquote({tokens:e}){return`
+${this.parser.parse(e)}
+`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} +`}hr(e){return`
+`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a +`+r+" +`}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+w(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • +`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let t="",n="";for(let i=0;i${r}`),` + +`+t+` +`+r+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${w(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='
    ",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return w(n);e=i;let s=`${n}{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new P(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],p=i[a];i[a]=(...u)=>{let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new y(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],p=i[a];i[a]=(...u)=>{let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new S;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],p=i[a];S.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async&&S.passThroughHooksRespectAsync.has(s))return(async()=>{let g=await o.call(i,u);return p.call(i,g)})();let c=o.call(i,u);return p.call(i,c)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(i,u);return g===!1&&(g=await p.apply(i,u)),g})();let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,u=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let p=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(p=s.hooks.processAllTokens(p)),s.walkTokens&&this.walkTokens(p,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(p,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let r="

    An error occurred:

    "+w(n.message+"",!0)+"
    ";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var _=new B;function k(l,e){return _.parse(l,e)}k.options=k.setOptions=function(l){return _.setOptions(l),k.defaults=_.defaults,G(k.defaults),k};k.getDefaults=L;k.defaults=T;k.use=function(...l){return _.use(...l),k.defaults=_.defaults,G(k.defaults),k};k.walkTokens=function(l,e){return _.walkTokens(l,e)};k.parseInline=_.parseInline;k.Parser=b;k.parser=b.parse;k.Renderer=P;k.TextRenderer=$;k.Lexer=x;k.lexer=x.lex;k.Tokenizer=y;k.Hooks=S;k.parse=k;var Zt=k.options,Gt=k.setOptions,Nt=k.use,Ft=k.walkTokens,jt=k.parseInline,Qt=k,Ut=b.parse,Kt=x.lex;export{S as Hooks,x as Lexer,B as Marked,b as Parser,P as Renderer,$ as TextRenderer,y as Tokenizer,T as defaults,L as getDefaults,Kt as lexer,k as marked,Zt as options,Qt as parse,jt as parseInline,Ut as parser,Gt as setOptions,Nt as use,Ft as walkTokens}; +//# sourceMappingURL=marked.esm.js.map diff --git a/tools/ui/node_modules/marked/lib/marked.esm.js.map b/tools/ui/node_modules/marked/lib/marked.esm.js.map new file mode 100644 index 0000000000000000000000000000000000000000..97f11cfaec613a0657d1ea5043ec6f78e6fa7632 --- /dev/null +++ b/tools/ui/node_modules/marked/lib/marked.esm.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/defaults.ts", "../src/rules.ts", "../src/helpers.ts", "../src/Tokenizer.ts", "../src/Lexer.ts", "../src/Renderer.ts", "../src/TextRenderer.ts", "../src/Parser.ts", "../src/Hooks.ts", "../src/Instance.ts", "../src/marked.ts"], + "sourcesContent": ["import type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Gets the original marked default options.\n */\nexport function _getDefaults(): MarkedOptions {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null,\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let _defaults: MarkedOptions = _getDefaults();\n\nexport function changeDefaults(newDefaults: MarkedOptions) {\n _defaults = newDefaults;\n}\n", "const noopTest = { exec: () => null } as unknown as RegExp;\n\nfunction edit(regex: string | RegExp, opt = '') {\n let source = typeof regex === 'string' ? regex : regex.source;\n const obj = {\n replace: (name: string | RegExp, val: string | RegExp) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(other.caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n },\n };\n return obj;\n}\n\nconst supportsLookbehind = (() => {\ntry {\n // eslint-disable-next-line prefer-regex-literals\n return !!new RegExp('(?<=1)(?/,\n blockquoteSetextReplace: /\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g,\n blockquoteSetextReplace2: /^ {0,3}>[ \\t]?/gm,\n listReplaceTabs: /^\\t+/,\n listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,\n listIsTask: /^\\[[ xX]\\] /,\n listReplaceTask: /^\\[[ xX]\\] +/,\n anyLine: /\\n.*\\n/,\n hrefBrackets: /^<(.*)>$/,\n tableDelimiter: /[:|]/,\n tableAlignChars: /^\\||\\| *$/g,\n tableRowBlankLine: /\\n[ \\t]*$/,\n tableAlignRight: /^ *-+: *$/,\n tableAlignCenter: /^ *:-+: *$/,\n tableAlignLeft: /^ *:-+ *$/,\n startATag: /^
    /i,\n startPreScriptTag: /^<(pre|code|kbd|script)(\\s|>)/i,\n endPreScriptTag: /^<\\/(pre|code|kbd|script)(\\s|>)/i,\n startAngleBracket: /^$/,\n pedanticHrefTitle: /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,\n unicodeAlphaNumeric: /[\\p{L}\\p{N}]/u,\n escapeTest: /[&<>\"']/,\n escapeReplace: /[&<>\"']/g,\n escapeTestNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,\n escapeReplaceNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,\n unescapeTest: /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig,\n caret: /(^|[^\\[])\\^/g,\n percentDecode: /%25/g,\n findPipe: /\\|/g,\n splitPipe: / \\|/,\n slashPipe: /\\\\\\|/g,\n carriageReturn: /\\r\\n|\\r/g,\n spaceLine: /^ +$/gm,\n notSpaceStart: /^\\S*/,\n endingNewline: /\\n$/,\n listItemRegex: (bull: string) => new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`),\n nextBulletRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`),\n hrRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`),\n fencesBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`),\n headingBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),\n htmlBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i'),\n};\n\n/**\n * Block-Level Grammar\n */\n\nconst newline = /^(?:[ \\t]*(?:\\n|$))+/;\nconst blockCode = /^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/;\nconst lheading = edit(lheadingCore)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .replace(/\\|table/g, '') // table not in commonmark\n .getRegex();\nconst lheadingGfm = edit(lheadingCore)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .replace(/table/g, / {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/) // table can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\n\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\n\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /|$))/;\nconst html = edit(\n '^ {0,3}(?:' // optional indentation\n+ '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n+ '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n+ '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n+ '|\\\\n*|$)' // (4)\n+ '|\\\\n*|$)' // (5)\n+ '|)[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (6)\n+ '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) open tag\n+ '|(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) closing tag\n+ ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText,\n};\n\ntype BlockKeys = keyof typeof blockNormal;\n\n/**\n * GFM Block Grammar\n */\n\nconst gfmTable = edit(\n '^ *([^\\\\n ].*)\\\\n' // Header\n+ ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n+ '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', '(?: {4}| {0,3}\\t)[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nconst blockGfm: Record = {\n ...blockNormal,\n lheading: lheadingGfm,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex(),\n};\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nconst blockPedantic: Record = {\n ...blockNormal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex(),\n};\n\n/**\n * Inline-Level Grammar\n */\n\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\\nconst blockSkip = edit(/link|precode-code|html/, 'g')\n .replace('link', /\\[(?:[^\\[\\]`]|(?`+)[^`]+\\k(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/)\n .replace('precode-', supportsLookbehind ? '(?`+)[^`]+\\k(?!`)/)\n .replace('html', /<(?! )[^<>]*?>/)\n .getRegex();\n\nconst emStrongLDelimCore = /^(?:\\*+(?:((?!\\*)punct)|[^\\s*]))|^_+(?:((?!_)punct)|([^\\s_]))/;\n\nconst emStrongLDelim = edit(emStrongLDelimCore, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')\n .replace(/punct/g, _punctuationGfmStrongEm)\n .getRegex();\n\nconst emStrongRDelimAstCore =\n '^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n+ '|[^*]+(?=[^*])' // Consume to delim\n+ '|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter\n+ '|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)' // (3) #***a, ***a can only be Left Delimiter\n+ '|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)' // (4) ***# can only be Left Delimiter\n+ '|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?=notPunctSpace)'; // (6) a***a can be either Left or Right Delimiter\n\nconst emStrongRDelimAst = edit(emStrongRDelimAstCore, 'gu')\n .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n .replace(/punctSpace/g, _punctuationOrSpace)\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, 'gu')\n .replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm)\n .replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm)\n .replace(/punct/g, _punctuationGfmStrongEm)\n .getRegex();\n\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit(\n '^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n+ '|[^_]+(?=[^_])' // Consume to delim\n+ '|(?!_)punct(_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter\n+ '|(?!_)punctSpace(_+)(?=notPunctSpace)' // (3) #___a, ___a can only be Left Delimiter\n+ '|[\\\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter\n+ '|(?!_)punct(_+)(?!_)(?=punct)', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n .replace(/punctSpace/g, _punctuationOrSpace)\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst anyPunctuation = edit(/\\\\(punct)/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\n\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit(\n '^comment'\n + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nconst _inlineLabel = /(?:\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+[^`]*?`+(?!`)|[^\\[\\]\\\\`])*?/;\n\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:(?:[ \\t]*(?:\\n[ \\t]*)?)(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\n\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\n\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\n\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n\nconst _caseInsensitiveProtocol = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;\n\n/**\n * Normal Inline Grammar\n */\n\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest,\n};\n\ntype InlineKeys = keyof typeof inlineNormal;\n\n/**\n * Pedantic Inline Grammar\n */\n\nconst inlinePedantic: Record = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex(),\n};\n\n/**\n * GFM Inline Grammar\n */\n\nconst inlineGfm: Record = {\n ...inlineNormal,\n emStrongRDelimAst: emStrongRDelimAstGfm,\n emStrongLDelim: emStrongLDelimGfm,\n url: edit(/^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/)\n .replace('protocol', _caseInsensitiveProtocol)\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,\n text: edit(/^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\ = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex(),\n};\n\n/**\n * exports\n */\n\nexport const block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic,\n};\n\nexport const inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic,\n};\n\nexport interface Rules {\n other: typeof other\n block: Record\n inline: Record\n}\n", "import { other } from './rules.ts';\n\n/**\n * Helpers\n */\nconst escapeReplacements: { [index: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n};\nconst getEscapeReplacement = (ch: string) => escapeReplacements[ch];\n\nexport function escape(html: string, encode?: boolean) {\n if (encode) {\n if (other.escapeTest.test(html)) {\n return html.replace(other.escapeReplace, getEscapeReplacement);\n }\n } else {\n if (other.escapeTestNoEncode.test(html)) {\n return html.replace(other.escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nexport function unescape(html: string) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(other.unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nexport function cleanUrl(href: string) {\n try {\n href = encodeURI(href).replace(other.percentDecode, '%');\n } catch {\n return null;\n }\n return href;\n}\n\nexport function splitCells(tableRow: string, count?: number) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(other.findPipe, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(other.splitPipe);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells.at(-1)?.trim()) {\n cells.pop();\n }\n\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(other.slashPipe, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nexport function rtrim(str: string, c: string, invert?: boolean) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nexport function findClosingBracket(str: string, b: string) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n if (level > 0) {\n return -2;\n }\n\n return -1;\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n rtrim,\n splitCells,\n findClosingBracket,\n} from './helpers.ts';\nimport type { Rules } from './rules.ts';\nimport type { _Lexer } from './Lexer.ts';\nimport type { Links, Tokens, Token } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\nfunction outputLink(cap: string[], link: Pick, raw: string, lexer: _Lexer, rules: Rules): Tokens.Link | Tokens.Image {\n const href = link.href;\n const title = link.title || null;\n const text = cap[1].replace(rules.other.outputLinkReplace, '$1');\n\n lexer.state.inLink = true;\n const token: Tokens.Link | Tokens.Image = {\n type: cap[0].charAt(0) === '!' ? 'image' : 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text),\n };\n lexer.state.inLink = false;\n return token;\n}\n\nfunction indentCodeCompensation(raw: string, text: string, rules: Rules) {\n const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(rules.other.beginningSpace);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nexport class _Tokenizer {\n options: MarkedOptions;\n rules!: Rules; // set by the lexer\n lexer!: _Lexer; // set by the lexer\n\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n space(src: string): Tokens.Space | undefined {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0],\n };\n }\n }\n\n code(src: string): Tokens.Code | undefined {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(this.rules.other.codeRemoveIndent, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text,\n };\n }\n }\n\n fences(src: string): Tokens.Code | undefined {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '', this.rules);\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text,\n };\n }\n }\n\n heading(src: string): Tokens.Heading | undefined {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (this.rules.other.endingHash.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text),\n };\n }\n }\n\n hr(src: string): Tokens.Hr | undefined {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: rtrim(cap[0], '\\n'),\n };\n }\n }\n\n blockquote(src: string): Tokens.Blockquote | undefined {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n let lines = rtrim(cap[0], '\\n').split('\\n');\n let raw = '';\n let text = '';\n const tokens: Token[] = [];\n\n while (lines.length > 0) {\n let inBlockquote = false;\n const currentLines = [];\n\n let i;\n for (i = 0; i < lines.length; i++) {\n // get lines up to a continuation\n if (this.rules.other.blockquoteStart.test(lines[i])) {\n currentLines.push(lines[i]);\n inBlockquote = true;\n } else if (!inBlockquote) {\n currentLines.push(lines[i]);\n } else {\n break;\n }\n }\n lines = lines.slice(i);\n\n const currentRaw = currentLines.join('\\n');\n const currentText = currentRaw\n // precede setext continuation with 4 spaces so it isn't a setext\n .replace(this.rules.other.blockquoteSetextReplace, '\\n $1')\n .replace(this.rules.other.blockquoteSetextReplace2, '');\n raw = raw ? `${raw}\\n${currentRaw}` : currentRaw;\n text = text ? `${text}\\n${currentText}` : currentText;\n\n // parse blockquote lines as top level tokens\n // merge paragraphs if this is a continuation\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n this.lexer.blockTokens(currentText, tokens, true);\n this.lexer.state.top = top;\n\n // if there is no continuation then we are done\n if (lines.length === 0) {\n break;\n }\n\n const lastToken = tokens.at(-1);\n\n if (lastToken?.type === 'code') {\n // blockquote continuation cannot be preceded by a code block\n break;\n } else if (lastToken?.type === 'blockquote') {\n // include continuation in nested blockquote\n const oldToken = lastToken as Tokens.Blockquote;\n const newText = oldToken.raw + '\\n' + lines.join('\\n');\n const newToken = this.blockquote(newText)!;\n tokens[tokens.length - 1] = newToken;\n\n raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;\n text = text.substring(0, text.length - oldToken.text.length) + newToken.text;\n break;\n } else if (lastToken?.type === 'list') {\n // include continuation in nested list\n const oldToken = lastToken as Tokens.List;\n const newText = oldToken.raw + '\\n' + lines.join('\\n');\n const newToken = this.list(newText)!;\n tokens[tokens.length - 1] = newToken;\n\n raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;\n text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;\n lines = newText.substring(tokens.at(-1)!.raw.length).split('\\n');\n continue;\n }\n }\n\n return {\n type: 'blockquote',\n raw,\n tokens,\n text,\n };\n }\n }\n\n list(src: string): Tokens.List | undefined {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list: Tokens.List = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: [],\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = this.rules.other.listItemRegex(bull);\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n let raw = '';\n let itemContents = '';\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n let line = cap[2].split('\\n', 1)[0].replace(this.rules.other.listReplaceTabs, (t: string) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let blankLine = !line.trim();\n\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n } else if (blankLine) {\n indent = cap[1].length + 1;\n } else {\n indent = cap[2].search(this.rules.other.nonSpaceChar); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n if (blankLine && this.rules.other.blankLine.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = this.rules.other.nextBulletRegex(indent);\n const hrRegex = this.rules.other.hrRegex(indent);\n const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);\n const headingBeginRegex = this.rules.other.headingBeginRegex(indent);\n const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);\n\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n let nextLineWithoutTabs;\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(this.rules.other.listReplaceNesting, ' ');\n nextLineWithoutTabs = nextLine;\n } else {\n nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of html block\n if (htmlBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(nextLine)) {\n break;\n }\n\n if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLineWithoutTabs.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.replace(this.rules.other.tabCharGlobal, ' ').search(this.rules.other.nonSpaceChar) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLineWithoutTabs.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (this.rules.other.doubleBlankLine.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n let istask: RegExpExecArray | null = null;\n let ischecked: boolean | undefined;\n // Check for task list items\n if (this.options.gfm) {\n istask = this.rules.other.listIsTask.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(this.rules.other.listReplaceTask, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: [],\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n const lastItem = list.items.at(-1);\n if (lastItem) {\n lastItem.raw = lastItem.raw.trimEnd();\n lastItem.text = lastItem.text.trimEnd();\n } else {\n // not a list since there were no items\n return;\n }\n list.raw = list.raw.trimEnd();\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => this.rules.other.anyLine.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src: string): Tokens.HTML | undefined {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token: Tokens.HTML = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0],\n };\n return token;\n }\n }\n\n def(src: string): Tokens.Def | undefined {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, ' ');\n const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title,\n };\n }\n }\n\n table(src: string): Tokens.Table | undefined {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n\n if (!this.rules.other.tableDelimiter.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(this.rules.other.tableAlignChars, '').split('|');\n const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, '').split('\\n') : [];\n\n const item: Tokens.Table = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: [],\n };\n\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n\n for (const align of aligns) {\n if (this.rules.other.tableAlignRight.test(align)) {\n item.align.push('right');\n } else if (this.rules.other.tableAlignCenter.test(align)) {\n item.align.push('center');\n } else if (this.rules.other.tableAlignLeft.test(align)) {\n item.align.push('left');\n } else {\n item.align.push(null);\n }\n }\n\n for (let i = 0; i < headers.length; i++) {\n item.header.push({\n text: headers[i],\n tokens: this.lexer.inline(headers[i]),\n header: true,\n align: item.align[i],\n });\n }\n\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map((cell, i) => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell),\n header: false,\n align: item.align[i],\n };\n }));\n }\n\n return item;\n }\n\n lheading(src: string): Tokens.Heading | undefined {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1]),\n };\n }\n }\n\n paragraph(src: string): Tokens.Paragraph | undefined {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text),\n };\n }\n }\n\n text(src: string): Tokens.Text | undefined {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0]),\n };\n }\n }\n\n escape(src: string): Tokens.Escape | undefined {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: cap[1],\n };\n }\n }\n\n tag(src: string): Tokens.Tag | undefined {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0],\n };\n }\n }\n\n link(src: string): Tokens.Link | Tokens.Image | undefined {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex === -2) {\n // more open parens than closed\n return;\n }\n\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = this.rules.other.pedanticHrefTitle.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (this.rules.other.startAngleBracket.test(href)) {\n if (this.options.pedantic && !(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title,\n }, cap[0], this.lexer, this.rules);\n }\n }\n\n reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text,\n };\n }\n return outputLink(cap, link, cap[0], this.lexer, this.rules);\n }\n }\n\n emStrong(src: string, maskedSrc: string, prevChar = ''): Tokens.Em | Tokens.Strong | undefined {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = [...rDelim].length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text),\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text),\n };\n }\n }\n }\n\n codespan(src: string): Tokens.Codespan | undefined {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(this.rules.other.newLineCharGlobal, ' ');\n const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);\n const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n return {\n type: 'codespan',\n raw: cap[0],\n text,\n };\n }\n }\n\n br(src: string): Tokens.Br | undefined {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0],\n };\n }\n }\n\n del(src: string): Tokens.Del | undefined {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2]),\n };\n }\n }\n\n autolink(src: string): Tokens.Link | undefined {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = cap[1];\n href = 'mailto:' + text;\n } else {\n text = cap[1];\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text,\n },\n ],\n };\n }\n }\n\n url(src: string): Tokens.Link | undefined {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = cap[0];\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = cap[0];\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text,\n },\n ],\n };\n }\n }\n\n inlineText(src: string): Tokens.Text | undefined {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n const escaped = this.lexer.state.inRawBlock;\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n escaped,\n };\n }\n }\n}\n", "import { _Tokenizer } from './Tokenizer.ts';\nimport { _defaults } from './defaults.ts';\nimport { other, block, inline } from './rules.ts';\nimport type { Token, TokensList, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Block Lexer\n */\nexport class _Lexer {\n tokens: TokensList;\n options: MarkedOptions;\n state: {\n inLink: boolean;\n inRawBlock: boolean;\n top: boolean;\n };\n\n private tokenizer: _Tokenizer;\n private inlineQueue: { src: string, tokens: Token[] }[];\n\n constructor(options?: MarkedOptions) {\n // TokenList cannot be created in one go\n this.tokens = [] as unknown as TokensList;\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true,\n };\n\n const rules = {\n other,\n block: block.normal,\n inline: inline.normal,\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline,\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src: string, options?: MarkedOptions) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src: string, options?: MarkedOptions) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src: string) {\n src = src.replace(other.carriageReturn, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];\n blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;\n blockTokens(src: string, tokens: Token[] = [], lastParagraphClipped = false) {\n if (this.options.pedantic) {\n src = src.replace(other.tabCharGlobal, ' ').replace(other.spaceLine, '');\n }\n\n while (src) {\n let token: Tokens.Generic | undefined;\n\n if (this.options.extensions?.block?.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (token.raw.length === 1 && lastToken !== undefined) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n lastToken.raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n // An indented code block cannot interrupt a paragraph.\n if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title,\n };\n tokens.push(token);\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n let cutSrc = src;\n if (this.options.extensions?.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n const lastToken = tokens.at(-1);\n if (lastParagraphClipped && lastToken?.type === 'paragraph') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = cutSrc.length !== src.length;\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src: string, tokens: Token[] = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src: string, tokens: Token[] = []): Token[] {\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match: RegExpExecArray | null = null;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index)\n + '[' + 'a'.repeat(match[0].length - 2) + ']'\n + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n\n // Mask out other blocks\n let offset;\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n offset = match[2] ? match[2].length : 0;\n maskedSrc = maskedSrc.slice(0, match.index + offset) + '[' + 'a'.repeat(match[0].length - offset - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out blocks from extensions\n maskedSrc = this.options.hooks?.emStrongMask?.call({ lexer: this }, maskedSrc) ?? maskedSrc;\n\n let keepPrevChar = false;\n let prevChar = '';\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n let token: Tokens.Generic | undefined;\n\n // extensions\n if (this.options.extensions?.inline?.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (token.type === 'text' && lastToken?.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n let cutSrc = src;\n if (this.options.extensions?.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n cleanUrl,\n escape,\n} from './helpers.ts';\nimport { other } from './rules.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Tokens } from './Tokens.ts';\nimport type { _Parser } from './Parser.ts';\n\n/**\n * Renderer\n */\nexport class _Renderer {\n options: MarkedOptions;\n parser!: _Parser; // set by the parser\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n space(token: Tokens.Space): RendererOutput {\n return '' as RendererOutput;\n }\n\n code({ text, lang, escaped }: Tokens.Code): RendererOutput {\n const langString = (lang || '').match(other.notSpaceStart)?.[0];\n\n const code = text.replace(other.endingNewline, '') + '\\n';\n\n if (!langString) {\n return '
    '\n        + (escaped ? code : escape(code, true))\n        + '
    \\n' as RendererOutput;\n }\n\n return '
    '\n      + (escaped ? code : escape(code, true))\n      + '
    \\n' as RendererOutput;\n }\n\n blockquote({ tokens }: Tokens.Blockquote): RendererOutput {\n const body = this.parser.parse(tokens);\n return `
    \\n${body}
    \\n` as RendererOutput;\n }\n\n html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n def(token: Tokens.Def): RendererOutput {\n return '' as RendererOutput;\n }\n\n heading({ tokens, depth }: Tokens.Heading): RendererOutput {\n return `${this.parser.parseInline(tokens)}\\n` as RendererOutput;\n }\n\n hr(token: Tokens.Hr): RendererOutput {\n return '
    \\n' as RendererOutput;\n }\n\n list(token: Tokens.List): RendererOutput {\n const ordered = token.ordered;\n const start = token.start;\n\n let body = '';\n for (let j = 0; j < token.items.length; j++) {\n const item = token.items[j];\n body += this.listitem(item);\n }\n\n const type = ordered ? 'ol' : 'ul';\n const startAttr = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startAttr + '>\\n' + body + '\\n' as RendererOutput;\n }\n\n listitem(item: Tokens.ListItem): RendererOutput {\n let itemBody = '';\n if (item.task) {\n const checkbox = this.checkbox({ checked: !!item.checked });\n if (item.loose) {\n if (item.tokens[0]?.type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + escape(item.tokens[0].tokens[0].text);\n item.tokens[0].tokens[0].escaped = true;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n raw: checkbox + ' ',\n text: checkbox + ' ',\n escaped: true,\n });\n }\n } else {\n itemBody += checkbox + ' ';\n }\n }\n\n itemBody += this.parser.parse(item.tokens, !!item.loose);\n\n return `
  • ${itemBody}
  • \\n` as RendererOutput;\n }\n\n checkbox({ checked }: Tokens.Checkbox): RendererOutput {\n return '' as RendererOutput;\n }\n\n paragraph({ tokens }: Tokens.Paragraph): RendererOutput {\n return `

    ${this.parser.parseInline(tokens)}

    \\n` as RendererOutput;\n }\n\n table(token: Tokens.Table): RendererOutput {\n let header = '';\n\n // header\n let cell = '';\n for (let j = 0; j < token.header.length; j++) {\n cell += this.tablecell(token.header[j]);\n }\n header += this.tablerow({ text: cell as ParserOutput });\n\n let body = '';\n for (let j = 0; j < token.rows.length; j++) {\n const row = token.rows[j];\n\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.tablecell(row[k]);\n }\n\n body += this.tablerow({ text: cell as ParserOutput });\n }\n if (body) body = `${body}`;\n\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
    \\n' as RendererOutput;\n }\n\n tablerow({ text }: Tokens.TableRow): RendererOutput {\n return `\\n${text}\\n` as RendererOutput;\n }\n\n tablecell(token: Tokens.TableCell): RendererOutput {\n const content = this.parser.parseInline(token.tokens);\n const type = token.header ? 'th' : 'td';\n const tag = token.align\n ? `<${type} align=\"${token.align}\">`\n : `<${type}>`;\n return tag + content + `\\n` as RendererOutput;\n }\n\n /**\n * span level renderer\n */\n strong({ tokens }: Tokens.Strong): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n em({ tokens }: Tokens.Em): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n codespan({ text }: Tokens.Codespan): RendererOutput {\n return `${escape(text, true)}` as RendererOutput;\n }\n\n br(token: Tokens.Br): RendererOutput {\n return '
    ' as RendererOutput;\n }\n\n del({ tokens }: Tokens.Del): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n link({ href, title, tokens }: Tokens.Link): RendererOutput {\n const text = this.parser.parseInline(tokens) as string;\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text as RendererOutput;\n }\n href = cleanHref;\n let out = '
    ';\n return out as RendererOutput;\n }\n\n image({ href, title, text, tokens }: Tokens.Image): RendererOutput {\n if (tokens) {\n text = this.parser.parseInline(tokens, this.parser.textRenderer) as string;\n }\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return escape(text) as RendererOutput;\n }\n href = cleanHref;\n\n let out = `\"${text}\"`;\n {\n // no need for block level renderers\n strong({ text }: Tokens.Strong): RendererOutput {\n return text as RendererOutput;\n }\n\n em({ text }: Tokens.Em): RendererOutput {\n return text as RendererOutput;\n }\n\n codespan({ text }: Tokens.Codespan): RendererOutput {\n return text as RendererOutput;\n }\n\n del({ text }: Tokens.Del): RendererOutput {\n return text as RendererOutput;\n }\n\n html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n link({ text }: Tokens.Link): RendererOutput {\n return '' + text as RendererOutput;\n }\n\n image({ text }: Tokens.Image): RendererOutput {\n return '' + text as RendererOutput;\n }\n\n br(): RendererOutput {\n return '' as RendererOutput;\n }\n}\n", "import { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _defaults } from './defaults.ts';\nimport type { MarkedToken, Token, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Parsing & Compiling\n */\nexport class _Parser {\n options: MarkedOptions;\n renderer: _Renderer;\n textRenderer: _TextRenderer;\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.renderer.parser = this;\n this.textRenderer = new _TextRenderer();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens: Token[], options?: MarkedOptions) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens: Token[], options?: MarkedOptions) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens: Token[], top = true): ParserOutput {\n let out = '';\n\n for (let i = 0; i < tokens.length; i++) {\n const anyToken = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions?.renderers?.[anyToken.type]) {\n const genericToken = anyToken as Tokens.Generic;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'def', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n\n const token = anyToken as MarkedToken;\n\n switch (token.type) {\n case 'space': {\n out += this.renderer.space(token);\n continue;\n }\n case 'hr': {\n out += this.renderer.hr(token);\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(token);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token);\n continue;\n }\n case 'table': {\n out += this.renderer.table(token);\n continue;\n }\n case 'blockquote': {\n out += this.renderer.blockquote(token);\n continue;\n }\n case 'list': {\n out += this.renderer.list(token);\n continue;\n }\n case 'html': {\n out += this.renderer.html(token);\n continue;\n }\n case 'def': {\n out += this.renderer.def(token);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(token);\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = this.renderer.text(textToken) as string;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i] as Tokens.Text;\n body += ('\\n' + this.renderer.text(textToken));\n }\n if (top) {\n out += this.renderer.paragraph({\n type: 'paragraph',\n raw: body,\n text: body,\n tokens: [{ type: 'text', raw: body, text: body, escaped: true }],\n });\n } else {\n out += body;\n }\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '' as ParserOutput;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out as ParserOutput;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens: Token[], renderer: _Renderer | _TextRenderer = this.renderer): ParserOutput {\n let out = '';\n\n for (let i = 0; i < tokens.length; i++) {\n const anyToken = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions?.renderers?.[anyToken.type]) {\n const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(anyToken.type)) {\n out += ret || '';\n continue;\n }\n }\n\n const token = anyToken as MarkedToken;\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token);\n break;\n }\n case 'html': {\n out += renderer.html(token);\n break;\n }\n case 'link': {\n out += renderer.link(token);\n break;\n }\n case 'image': {\n out += renderer.image(token);\n break;\n }\n case 'strong': {\n out += renderer.strong(token);\n break;\n }\n case 'em': {\n out += renderer.em(token);\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token);\n break;\n }\n case 'br': {\n out += renderer.br(token);\n break;\n }\n case 'del': {\n out += renderer.del(token);\n break;\n }\n case 'text': {\n out += renderer.text(token);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '' as ParserOutput;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out as ParserOutput;\n }\n}\n", "import { _defaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\n\nexport class _Hooks {\n options: MarkedOptions;\n block?: boolean;\n\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens',\n 'emStrongMask',\n ]);\n\n static passThroughHooksRespectAsync = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens',\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown: string) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html: ParserOutput) {\n return html;\n }\n\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens: Token[] | TokensList) {\n return tokens;\n }\n\n /**\n * Mask contents that should not be interpreted as em/strong delimiters\n */\n emStrongMask(src: string) {\n return src;\n }\n\n /**\n * Provide function to tokenize markdown\n */\n provideLexer() {\n return this.block ? _Lexer.lex : _Lexer.lexInline;\n }\n\n /**\n * Provide function to parse tokens\n */\n provideParser() {\n return this.block ? _Parser.parse : _Parser.parseInline;\n }\n}\n", "import { _getDefaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { escape } from './helpers.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, Tokens, TokensList } from './Tokens.ts';\n\nexport type MaybePromise = void | Promise;\n\ntype UnknownFunction = (...args: unknown[]) => unknown;\ntype GenericRendererFunction = (...args: unknown[]) => string | false;\n\nexport class Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n\n parse = this.parseMarkdown(true);\n parseInline = this.parseMarkdown(false);\n\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n\n constructor(...args: MarkedExtension[]) {\n this.use(...args);\n }\n\n /**\n * Run callback for every token\n */\n walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n let values: MaybePromise[] = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token as Tokens.Table;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token as Tokens.List;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token as Tokens.Generic;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity) as Token[] | TokensList;\n values = values.concat(this.walkTokens(tokens, callback));\n });\n } else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n\n use(...args: MarkedExtension[]) {\n const extensions: MarkedOptions['extensions'] = this.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack } as MarkedOptions;\n\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (['options', 'parser'].includes(prop)) {\n // ignore options property\n continue;\n }\n const rendererProp = prop as Exclude, 'options' | 'parser'>;\n const rendererFunc = pack.renderer[rendererProp] as GenericRendererFunction;\n const prevRenderer = renderer[rendererProp] as GenericRendererFunction;\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args: unknown[]) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return (ret || '') as RendererOutput;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop as Exclude, 'options' | 'rules' | 'lexer'>;\n const tokenizerFunc = pack.tokenizer[tokenizerProp] as UnknownFunction;\n const prevTokenizer = tokenizer[tokenizerProp] as UnknownFunction;\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args: unknown[]) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (['options', 'block'].includes(prop)) {\n // ignore options and block properties\n continue;\n }\n const hooksProp = prop as Exclude, 'options' | 'block'>;\n const hooksFunc = pack.hooks[hooksProp] as UnknownFunction;\n const prevHook = hooks[hooksProp] as UnknownFunction;\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg: unknown) => {\n if (this.defaults.async && _Hooks.passThroughHooksRespectAsync.has(prop)) {\n return (async() => {\n const ret = await hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n })();\n }\n\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args: unknown[]) => {\n if (this.defaults.async) {\n return (async() => {\n let ret = await hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = await prevHook.apply(hooks, args);\n }\n return ret;\n })();\n }\n\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function(token) {\n let values: MaybePromise[] = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n this.defaults = { ...this.defaults, ...opts };\n });\n\n return this;\n }\n\n setOptions(opt: MarkedOptions) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n\n lexer(src: string, options?: MarkedOptions) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n\n parser(tokens: Token[], options?: MarkedOptions) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n\n private parseMarkdown(blockType: boolean) {\n type overloadedParse = {\n (src: string, options: MarkedOptions & { async: true }): Promise;\n (src: string, options: MarkedOptions & { async: false }): ParserOutput;\n (src: string, options?: MarkedOptions | null): ParserOutput | Promise;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const parse: overloadedParse = (src: string, options?: MarkedOptions | null): any => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n\n const throwError = this.onError(!!opt.silent, !!opt.async);\n\n // throw error if an extension set async to true but parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.'));\n }\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n opt.hooks.block = blockType;\n }\n\n if (opt.async) {\n return (async() => {\n const processedSrc = opt.hooks ? await opt.hooks.preprocess(src) : src;\n const lexer = opt.hooks ? await opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n const tokens = await lexer(processedSrc, opt);\n const processedTokens = opt.hooks ? await opt.hooks.processAllTokens(tokens) : tokens;\n if (opt.walkTokens) {\n await Promise.all(this.walkTokens(processedTokens, opt.walkTokens));\n }\n const parser = opt.hooks ? await opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n const html = await parser(processedTokens, opt);\n return opt.hooks ? await opt.hooks.postprocess(html) : html;\n })().catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src) as string;\n }\n const lexer = opt.hooks ? opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n const parser = opt.hooks ? opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch(e) {\n return throwError(e as Error);\n }\n };\n\n return parse;\n }\n\n private onError(silent: boolean, async: boolean) {\n return (e: Error): string | Promise => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '

    An error occurred:

    '\n          + escape(e.message + '', true)\n          + '
    ';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n", "import { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { Marked } from './Instance.ts';\nimport {\n _getDefaults,\n changeDefaults,\n _defaults,\n} from './defaults.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\nimport type { MaybePromise } from './Instance.ts';\n\nconst markedInstance = new Marked();\n\n/**\n * Compiles markdown to HTML asynchronously.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options, having async: true\n * @return Promise of string of compiled HTML\n */\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise;\n\n/**\n * Compiles markdown to HTML.\n *\n * @param src String of markdown source to be compiled\n * @param options Optional hash of options\n * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.\n */\nexport function marked(src: string, options: MarkedOptions & { async: false }): string;\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise;\nexport function marked(src: string, options?: MarkedOptions | null): string | Promise;\nexport function marked(src: string, opt?: MarkedOptions | null): string | Promise {\n return markedInstance.parse(src, opt);\n}\n\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\nmarked.setOptions = function(options: MarkedOptions) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\n\nmarked.defaults = _defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args: MarkedExtension[]) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n return markedInstance.walkTokens(tokens, callback);\n};\n\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\n\nexport const options = marked.options;\nexport const setOptions = marked.setOptions;\nexport const use = marked.use;\nexport const walkTokens = marked.walkTokens;\nexport const parseInline = marked.parseInline;\nexport const parse = marked;\nexport const parser = _Parser.parse;\nexport const lexer = _Lexer.lex;\nexport { _defaults as defaults, _getDefaults as getDefaults } from './defaults.ts';\nexport { _Lexer as Lexer } from './Lexer.ts';\nexport { _Parser as Parser } from './Parser.ts';\nexport { _Tokenizer as Tokenizer } from './Tokenizer.ts';\nexport { _Renderer as Renderer } from './Renderer.ts';\nexport { _TextRenderer as TextRenderer } from './TextRenderer.ts';\nexport { _Hooks as Hooks } from './Hooks.ts';\nexport { Marked } from './Instance.ts';\nexport type * from './MarkedOptions.ts';\nexport type * from './Tokens.ts';\n"], + "mappings": ";;;;;;;;;;;;AAKO,SAASA,GAA4G,CAC1H,MAAO,CACL,MAAO,GACP,OAAQ,GACR,WAAY,KACZ,IAAK,GACL,MAAO,KACP,SAAU,GACV,SAAU,KACV,OAAQ,GACR,UAAW,KACX,WAAY,IACd,CACF,CAEO,IAAIC,EAAqCD,EAAa,EAEtD,SAASE,EAA+DC,EAA0D,CACvIF,EAAYE,CACd,CCxBA,IAAMC,EAAW,CAAE,KAAM,IAAM,IAAK,EAEpC,SAASC,EAAKC,EAAwBC,EAAM,GAAI,CAC9C,IAAIC,EAAS,OAAOF,GAAU,SAAWA,EAAQA,EAAM,OACjDG,EAAM,CACV,QAAS,CAACC,EAAuBC,IAAyB,CACxD,IAAIC,EAAY,OAAOD,GAAQ,SAAWA,EAAMA,EAAI,OACpD,OAAAC,EAAYA,EAAU,QAAQC,EAAM,MAAO,IAAI,EAC/CL,EAASA,EAAO,QAAQE,EAAME,CAAS,EAChCH,CACT,EACA,SAAU,IACD,IAAI,OAAOD,EAAQD,CAAG,CAEjC,EACA,OAAOE,CACT,CAEA,IAAMK,IAAsB,IAAM,CAClC,GAAI,CAEF,MAAO,CAAC,CAAC,IAAI,OAAO,cAAc,CACpC,MAAQ,CAGN,MAAO,EACT,CACA,GAAG,EAEUD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aults", "newDefaults", "noopTest", "edit", "regex", "opt", "source", "obj", "name", "val", "valSource", "other", "supportsLookbehind", "bull", "indent", "newline", "blockCode", "fences", "hr", "heading", "bullet", "lheadingCore", "lheading", "lheadingGfm", "_paragraph", "blockText", "_blockLabel", "def", "list", "_tag", "_comment", "html", "paragraph", "blockquote", "blockNormal", "gfmTable", "blockGfm", "blockPedantic", "escape", "inlineCode", "br", "inlineText", "_punctuation", "_punctuationOrSpace", "_notPunctuationOrSpace", "punctuation", "_punctuationGfmStrongEm", "_punctuationOrSpaceGfmStrongEm", "_notPunctuationOrSpaceGfmStrongEm", "blockSkip", "emStrongLDelimCore", "emStrongLDelim", "emStrongLDelimGfm", "emStrongRDelimAstCore", "emStrongRDelimAst", "emStrongRDelimAstGfm", "emStrongRDelimUnd", "anyPunctuation", "autolink", "_inlineComment", "tag", "_inlineLabel", "link", "reflink", "nolink", "reflinkSearch", "_caseInsensitiveProtocol", "inlineNormal", "inlinePedantic", "inlineGfm", "inlineBreaks", "block", "inline", "escapeReplacements", "getEscapeReplacement", "ch", "escape", "html", "encode", "other", "cleanUrl", "href", "other", "splitCells", "tableRow", "count", "row", "match", "offset", "str", "escaped", "curr", "cells", "i", "rtrim", "c", "invert", "l", "suffLen", "currChar", "findClosingBracket", "b", "level", "outputLink", "cap", "link", "raw", "lexer", "rules", "href", "title", "text", "token", "indentCodeCompensation", "matchIndentToCode", "indentToCode", "node", "matchIndentInNode", "indentInNode", "_Tokenizer", "options", "_defaults", "src", "rtrim", "trimmed", "lines", "tokens", "inBlockquote", "currentLines", "i", "currentRaw", "currentText", "top", "lastToken", "oldToken", "newText", "newToken", "bull", "isordered", "list", "itemRegex", "endsWithBlankLine", "endEarly", "itemContents", "line", "t", "nextLine", "blankLine", "indent", "nextBulletRegex", "hrRegex", "fencesBeginRegex", "headingBeginRegex", "htmlBeginRegex", "rawLine", "nextLineWithoutTabs", "istask", "ischecked", "lastItem", "spacers", "hasMultipleLineBreaks", "tag", "headers", "splitCells", "aligns", "rows", "item", "align", "row", "cell", "trimmedUrl", "rtrimSlash", "lastParenIndex", "findClosingBracket", "linkLen", "links", "linkString", "maskedSrc", "prevChar", "match", "lLength", "rDelim", "rLength", "delimTotal", "midDelimTotal", "endReg", "lastCharLength", "hasNonSpaceChars", "hasSpaceCharsOnBothEnds", "prevCapZero", "escaped", "_Lexer", "__Lexer", "options", "_defaults", "_Tokenizer", "rules", "other", "block", "inline", "src", "i", "next", "tokens", "lastParagraphClipped", "token", "extTokenizer", "lastToken", "cutSrc", "startIndex", "tempSrc", "tempStart", "getStartIndex", "errMsg", "maskedSrc", "match", "links", "offset", "keepPrevChar", "prevChar", "_Renderer", "options", "_defaults", "token", "text", "lang", "escaped", "langString", "other", "code", "escape", "tokens", "depth", "ordered", "start", "body", "j", "item", "type", "startAttr", "itemBody", "checkbox", "checked", "header", "cell", "row", "k", "content", "href", "title", "cleanHref", "cleanUrl", "out", "_TextRenderer", "text", "_Parser", "__Parser", "options", "_defaults", "_Renderer", "_TextRenderer", "tokens", "top", "out", "i", "anyToken", "genericToken", "ret", "token", "textToken", "body", "errMsg", "renderer", "_Hooks", "options", "_defaults", "markdown", "html", "tokens", "src", "_Lexer", "_Parser", "Marked", "_getDefaults", "_Parser", "_Renderer", "_TextRenderer", "_Lexer", "_Tokenizer", "_Hooks", "args", "tokens", "callback", "values", "token", "tableToken", "cell", "row", "listToken", "genericToken", "childTokens", "extensions", "pack", "opts", "ext", "prevRenderer", "ret", "extLevel", "renderer", "prop", "rendererProp", "rendererFunc", "tokenizer", "tokenizerProp", "tokenizerFunc", "prevTokenizer", "hooks", "hooksProp", "hooksFunc", "prevHook", "arg", "walkTokens", "packWalktokens", "opt", "src", "options", "blockType", "origOpt", "throwError", "processedSrc", "processedTokens", "html", "e", "silent", "async", "msg", "escape", "markedInstance", "Marked", "marked", "src", "opt", "options", "changeDefaults", "_getDefaults", "_defaults", "args", "tokens", "callback", "_Parser", "_Renderer", "_TextRenderer", "_Lexer", "_Tokenizer", "_Hooks", "setOptions", "use", "walkTokens", "parseInline", "parse", "parser", "lexer"] +} diff --git a/tools/ui/node_modules/marked/lib/marked.umd.js b/tools/ui/node_modules/marked/lib/marked.umd.js new file mode 100644 index 0000000000000000000000000000000000000000..34b107400d411d344406358ad5ef86aa9316e9ee --- /dev/null +++ b/tools/ui/node_modules/marked/lib/marked.umd.js @@ -0,0 +1,75 @@ +/** + * marked v16.4.2 - a markdown parser + * Copyright (c) 2018-2025, MarkedJS. (MIT License) + * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + * https://github.com/markedjs/marked + */ + +/** + * DO NOT EDIT THIS FILE + * The code in this file is generated from files in ./src/ + */ +(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f()}else if("function"==typeof define && define.amd){define("marked",f)}else {g["marked"]=f()}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(){var exports={};var __exports=exports;var module={exports}; +"use strict";var G=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var we=(l,e)=>{for(var t in e)G(l,t,{get:e[t],enumerable:!0})},ye=(l,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Te(e))!Oe.call(l,r)&&r!==t&&G(l,r,{get:()=>e[r],enumerable:!(n=Re(e,r))||n.enumerable});return l};var Pe=l=>ye(G({},"__esModule",{value:!0}),l);var gt={};we(gt,{Hooks:()=>S,Lexer:()=>x,Marked:()=>A,Parser:()=>b,Renderer:()=>P,TextRenderer:()=>$,Tokenizer:()=>y,defaults:()=>T,getDefaults:()=>_,lexer:()=>kt,marked:()=>k,options:()=>at,parse:()=>ht,parseInline:()=>ct,parser:()=>dt,setOptions:()=>lt,use:()=>ut,walkTokens:()=>pt});module.exports=Pe(gt);function _(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=_();function N(l){T=l}var I={exec:()=>null};function d(l,e=""){let t=typeof l=="string"?l:l.source,n={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(m.caret,"$1"),t=t.replace(r,s),n},getRegex:()=>new RegExp(t,e)};return n}var Se=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^
    /i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}#`),htmlBeginRegex:l=>new RegExp(`^ {0,${Math.min(3,l-1)}}<(?:[a-z].*>|!--)`,"i")},$e=/^(?:[ \t]*(?:\n|$))+/,_e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Le=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Me=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,j=/(?:[*+-]|\d{1,9}[.)])/,oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ae=d(oe).replace(/bull/g,j).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ze=d(oe).replace(/bull/g,j).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Q=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ae=/^[^\n]+/,U=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ee=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",U).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ie=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,j).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",K=/|$))/,Ce=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",K).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le=d(Q).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),Be=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",le).getRegex(),W={blockquote:Be,code:_e,def:Ee,fences:Le,heading:Me,hr:C,html:Ce,lheading:ae,list:Ie,newline:$e,paragraph:le,table:I,text:Ae},se=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),qe={...W,lheading:ze,table:se,paragraph:d(Q).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",se).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},ve={...W,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",K).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:I,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(Q).replace("hr",C).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ae).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},De=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,He=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ue=/^( {2,}|\\)\n(?!\s*$)/,Ze=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Se?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),he=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qe=d(he,"u").replace(/punct/g,D).getRegex(),Ue=d(he,"u").replace(/punct/g,ce).getRegex(),de="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ke=d(de,"gu").replace(/notPunctSpace/g,pe).replace(/punctSpace/g,X).replace(/punct/g,D).getRegex(),We=d(de,"gu").replace(/notPunctSpace/g,Fe).replace(/punctSpace/g,Ne).replace(/punct/g,ce).getRegex(),Xe=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,pe).replace(/punctSpace/g,X).replace(/punct/g,D).getRegex(),Je=d(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Ve=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ye=d(K).replace("(?:-->|$)","-->").getRegex(),et=d("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ye).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,tt=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ke=d(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",U).getRegex(),ge=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",U).getRegex(),nt=d("reflink|nolink(?!\\()","g").replace("reflink",ke).replace("nolink",ge).getRegex(),ie=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,J={_backpedal:I,anyPunctuation:Je,autolink:Ve,blockSkip:je,br:ue,code:He,del:I,emStrongLDelim:Qe,emStrongRDelimAst:Ke,emStrongRDelimUnd:Xe,escape:De,link:tt,nolink:ge,punctuation:Ge,reflink:ke,reflinkSearch:nt,tag:et,text:Ze,url:I},rt={...J,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},F={...J,emStrongRDelimAst:We,emStrongLDelim:Ue,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ie).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},fe=l=>it[l];function w(l,e){if(e){if(m.escapeTest.test(l))return l.replace(m.escapeReplace,fe)}else if(m.escapeTestNoEncode.test(l))return l.replace(m.escapeReplaceNoEncode,fe);return l}function V(l){try{l=encodeURI(l).replace(m.percentDecode,"%")}catch{return null}return l}function Y(l,e){let t=l.replace(m.findPipe,(i,s,a)=>{let o=!1,p=s;for(;--p>=0&&a[p]==="\\";)o=!o;return o?"|":" |"}),n=t.split(m.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function xe(l,e,t,n,r){let i=e.href,s=e.title||null,a=l[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:l[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:s,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,o}function ot(l,e,t){let n=l.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(` +`).map(i=>{let s=i.match(t.other.beginningSpace);if(s===null)return i;let[a]=s;return a.length>=r.length?i.slice(r.length):i}).join(` +`)}var y=class{options;rules;lexer;constructor(e){this.options=e||T}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:z(n,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=ot(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=z(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:z(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=z(t[0],` +`).split(` +`),r="",i="",s=[];for(;n.length>0;){let a=!1,o=[],p;for(p=0;p1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let p=!1,u="",c="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let g=t[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,H=>" ".repeat(3*H.length)),h=e.split(` +`,1)[0],R=!g.trim(),f=0;if(this.options.pedantic?(f=2,c=g.trimStart()):R?f=t[1].length+1:(f=t[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=g.slice(f),f+=t[1].length),R&&this.rules.other.blankLine.test(h)&&(u+=h+` +`,e=e.substring(h.length+1),p=!0),!p){let H=this.rules.other.nextBulletRegex(f),te=this.rules.other.hrRegex(f),ne=this.rules.other.fencesBeginRegex(f),re=this.rules.other.headingBeginRegex(f),be=this.rules.other.htmlBeginRegex(f);for(;e;){let Z=e.split(` +`,1)[0],E;if(h=Z,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),E=h):E=h.replace(this.rules.other.tabCharGlobal," "),ne.test(h)||re.test(h)||be.test(h)||H.test(h)||te.test(h))break;if(E.search(this.rules.other.nonSpaceChar)>=f||!h.trim())c+=` +`+E.slice(f);else{if(R||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ne.test(g)||re.test(g)||te.test(g))break;c+=` +`+h}!R&&!h.trim()&&(R=!0),u+=Z+` +`,e=e.substring(Z.length+1),g=E.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let O=null,ee;this.options.gfm&&(O=this.rules.other.listIsTask.exec(c),O&&(ee=O[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!O,checked:ee,loose:!1,text:c,tokens:[]}),i.raw+=u}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let p=0;pg.type==="space"),c=u.length>0&&u.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=c}if(i.loose)for(let p=0;p({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[p]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=me(t[2],"()");if(s===-2)return;if(s>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),xe(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return xe(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,a,o,p=s,u=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){p+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){u+=o;continue}if(p-=o,p>0)continue;o=Math.min(o,o+p+u);let g=[...r[0]][0].length,h=e.slice(0,s+r.index+g+o);if(Math.min(s,o)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let R=h.slice(2,-2);return{type:"strong",raw:h,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}};var x=class l{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new y,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:m,block:B.normal,inline:M.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=M.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=M.breaks:t.inline=M.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:M}}static lex(e,t){return new l(t).lex(e)}static lexInline(e,t){return new l(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,` +`),this.blockTokens(e,this.tokens);for(let t=0;t(r=s.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let s=t.at(-1);r.raw.length===1&&s!==void 0?s.raw+=` +`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let s=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(p=>{o=p.call({lexer:this},a),typeof o=="number"&&o>=0&&(s=Math.min(s,o))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let s=t.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(` +`)?"":` +`)+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r);continue}if(e){let s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=t.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,a)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let p=e;if(this.options.extensions?.startInline){let u=1/0,c=e.slice(1),g;this.options.extensions.startInline.forEach(h=>{g=h.call({lexer:this},c),typeof g=="number"&&g>=0&&(u=Math.min(u,g))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(p)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}};var P=class{options;parser;constructor(e){this.options=e||T}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,"")+` +`;return r?'
    '+(n?i:w(i,!0))+`
    +`:"
    "+(n?i:w(i,!0))+`
    +`}blockquote({tokens:e}){return`
    +${this.parser.parse(e)}
    +`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} +`}hr(e){return`
    +`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a +`+r+" +`}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+w(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • +`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let t="",n="";for(let i=0;i${r}`),` + +`+t+` +`+r+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${w(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=V(e);if(i===null)return r;e=i;let s='
    ",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=V(e);if(i===null)return w(n);e=i;let s=`${n}{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new P(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],p=i[a];i[a]=(...u)=>{let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new y(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],p=i[a];i[a]=(...u)=>{let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new S;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],p=i[a];S.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async&&S.passThroughHooksRespectAsync.has(s))return(async()=>{let g=await o.call(i,u);return p.call(i,g)})();let c=o.call(i,u);return p.call(i,c)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(i,u);return g===!1&&(g=await p.apply(i,u)),g})();let c=o.apply(i,u);return c===!1&&(c=p.apply(i,u)),c}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,u=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(u):u;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let p=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(p=s.hooks.processAllTokens(p)),s.walkTokens&&this.walkTokens(p,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(p,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let r="

    An error occurred:

    "+w(n.message+"",!0)+"
    ";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new A;function k(l,e){return L.parse(l,e)}k.options=k.setOptions=function(l){return L.setOptions(l),k.defaults=L.defaults,N(k.defaults),k};k.getDefaults=_;k.defaults=T;k.use=function(...l){return L.use(...l),k.defaults=L.defaults,N(k.defaults),k};k.walkTokens=function(l,e){return L.walkTokens(l,e)};k.parseInline=L.parseInline;k.Parser=b;k.parser=b.parse;k.Renderer=P;k.TextRenderer=$;k.Lexer=x;k.lexer=x.lex;k.Tokenizer=y;k.Hooks=S;k.parse=k;var at=k.options,lt=k.setOptions,ut=k.use,pt=k.walkTokens,ct=k.parseInline,ht=k,dt=b.parse,kt=x.lex; + +if(__exports != exports)module.exports = exports;return module.exports})); +//# sourceMappingURL=marked.umd.js.map diff --git a/tools/ui/node_modules/marked/lib/marked.umd.js.map b/tools/ui/node_modules/marked/lib/marked.umd.js.map new file mode 100644 index 0000000000000000000000000000000000000000..1caac9988f8485bc05e6b3aa49ffcb1ecab3c2d8 --- /dev/null +++ b/tools/ui/node_modules/marked/lib/marked.umd.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/marked.ts", "../src/defaults.ts", "../src/rules.ts", "../src/helpers.ts", "../src/Tokenizer.ts", "../src/Lexer.ts", "../src/Renderer.ts", "../src/TextRenderer.ts", "../src/Parser.ts", "../src/Hooks.ts", "../src/Instance.ts"], + "sourcesContent": ["import { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { Marked } from './Instance.ts';\nimport {\n _getDefaults,\n changeDefaults,\n _defaults,\n} from './defaults.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\nimport type { MaybePromise } from './Instance.ts';\n\nconst markedInstance = new Marked();\n\n/**\n * Compiles markdown to HTML asynchronously.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options, having async: true\n * @return Promise of string of compiled HTML\n */\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise;\n\n/**\n * Compiles markdown to HTML.\n *\n * @param src String of markdown source to be compiled\n * @param options Optional hash of options\n * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.\n */\nexport function marked(src: string, options: MarkedOptions & { async: false }): string;\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise;\nexport function marked(src: string, options?: MarkedOptions | null): string | Promise;\nexport function marked(src: string, opt?: MarkedOptions | null): string | Promise {\n return markedInstance.parse(src, opt);\n}\n\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\nmarked.setOptions = function(options: MarkedOptions) {\n markedInstance.setOptions(options);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\n\nmarked.defaults = _defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args: MarkedExtension[]) {\n markedInstance.use(...args);\n marked.defaults = markedInstance.defaults;\n changeDefaults(marked.defaults);\n return marked;\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n return markedInstance.walkTokens(tokens, callback);\n};\n\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\n\nexport const options = marked.options;\nexport const setOptions = marked.setOptions;\nexport const use = marked.use;\nexport const walkTokens = marked.walkTokens;\nexport const parseInline = marked.parseInline;\nexport const parse = marked;\nexport const parser = _Parser.parse;\nexport const lexer = _Lexer.lex;\nexport { _defaults as defaults, _getDefaults as getDefaults } from './defaults.ts';\nexport { _Lexer as Lexer } from './Lexer.ts';\nexport { _Parser as Parser } from './Parser.ts';\nexport { _Tokenizer as Tokenizer } from './Tokenizer.ts';\nexport { _Renderer as Renderer } from './Renderer.ts';\nexport { _TextRenderer as TextRenderer } from './TextRenderer.ts';\nexport { _Hooks as Hooks } from './Hooks.ts';\nexport { Marked } from './Instance.ts';\nexport type * from './MarkedOptions.ts';\nexport type * from './Tokens.ts';\n", "import type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Gets the original marked default options.\n */\nexport function _getDefaults(): MarkedOptions {\n return {\n async: false,\n breaks: false,\n extensions: null,\n gfm: true,\n hooks: null,\n pedantic: false,\n renderer: null,\n silent: false,\n tokenizer: null,\n walkTokens: null,\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let _defaults: MarkedOptions = _getDefaults();\n\nexport function changeDefaults(newDefaults: MarkedOptions) {\n _defaults = newDefaults;\n}\n", "const noopTest = { exec: () => null } as unknown as RegExp;\n\nfunction edit(regex: string | RegExp, opt = '') {\n let source = typeof regex === 'string' ? regex : regex.source;\n const obj = {\n replace: (name: string | RegExp, val: string | RegExp) => {\n let valSource = typeof val === 'string' ? val : val.source;\n valSource = valSource.replace(other.caret, '$1');\n source = source.replace(name, valSource);\n return obj;\n },\n getRegex: () => {\n return new RegExp(source, opt);\n },\n };\n return obj;\n}\n\nconst supportsLookbehind = (() => {\ntry {\n // eslint-disable-next-line prefer-regex-literals\n return !!new RegExp('(?<=1)(?/,\n blockquoteSetextReplace: /\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g,\n blockquoteSetextReplace2: /^ {0,3}>[ \\t]?/gm,\n listReplaceTabs: /^\\t+/,\n listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,\n listIsTask: /^\\[[ xX]\\] /,\n listReplaceTask: /^\\[[ xX]\\] +/,\n anyLine: /\\n.*\\n/,\n hrefBrackets: /^<(.*)>$/,\n tableDelimiter: /[:|]/,\n tableAlignChars: /^\\||\\| *$/g,\n tableRowBlankLine: /\\n[ \\t]*$/,\n tableAlignRight: /^ *-+: *$/,\n tableAlignCenter: /^ *:-+: *$/,\n tableAlignLeft: /^ *:-+ *$/,\n startATag: /^
    /i,\n startPreScriptTag: /^<(pre|code|kbd|script)(\\s|>)/i,\n endPreScriptTag: /^<\\/(pre|code|kbd|script)(\\s|>)/i,\n startAngleBracket: /^$/,\n pedanticHrefTitle: /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,\n unicodeAlphaNumeric: /[\\p{L}\\p{N}]/u,\n escapeTest: /[&<>\"']/,\n escapeReplace: /[&<>\"']/g,\n escapeTestNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,\n escapeReplaceNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,\n unescapeTest: /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig,\n caret: /(^|[^\\[])\\^/g,\n percentDecode: /%25/g,\n findPipe: /\\|/g,\n splitPipe: / \\|/,\n slashPipe: /\\\\\\|/g,\n carriageReturn: /\\r\\n|\\r/g,\n spaceLine: /^ +$/gm,\n notSpaceStart: /^\\S*/,\n endingNewline: /\\n$/,\n listItemRegex: (bull: string) => new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`),\n nextBulletRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`),\n hrRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`),\n fencesBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`),\n headingBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),\n htmlBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i'),\n};\n\n/**\n * Block-Level Grammar\n */\n\nconst newline = /^(?:[ \\t]*(?:\\n|$))+/;\nconst blockCode = /^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/;\nconst lheading = edit(lheadingCore)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .replace(/\\|table/g, '') // table not in commonmark\n .getRegex();\nconst lheadingGfm = edit(lheadingCore)\n .replace(/bull/g, bullet) // lists can interrupt\n .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n .replace(/table/g, / {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/) // table can interrupt\n .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/)\n .replace('label', _blockLabel)\n .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n .getRegex();\n\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n .replace(/bull/g, bullet)\n .getRegex();\n\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n + '|tr|track|ul';\nconst _comment = /|$))/;\nconst html = edit(\n '^ {0,3}(?:' // optional indentation\n+ '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:[^\\\\n]*\\\\n+|$)' // (1)\n+ '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n+ '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n+ '|\\\\n*|$)' // (4)\n+ '|\\\\n*|$)' // (5)\n+ '|)[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (6)\n+ '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) open tag\n+ '|(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) closing tag\n+ ')', 'i')\n .replace('comment', _comment)\n .replace('tag', _tag)\n .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nconst paragraph = edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex();\n\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n .replace('paragraph', paragraph)\n .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nconst blockNormal = {\n blockquote,\n code: blockCode,\n def,\n fences,\n heading,\n hr,\n html,\n lheading,\n list,\n newline,\n paragraph,\n table: noopTest,\n text: blockText,\n};\n\ntype BlockKeys = keyof typeof blockNormal;\n\n/**\n * GFM Block Grammar\n */\n\nconst gfmTable = edit(\n '^ *([^\\\\n ].*)\\\\n' // Header\n+ ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n+ '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('blockquote', ' {0,3}>')\n .replace('code', '(?: {4}| {0,3}\\t)[^\\\\n]')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n .getRegex();\n\nconst blockGfm: Record = {\n ...blockNormal,\n lheading: lheadingGfm,\n table: gfmTable,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n .replace('table', gfmTable) // interrupt paragraphs with table\n .replace('blockquote', ' {0,3}>')\n .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n .replace('html', ')|<(?:script|pre|style|textarea|!--)')\n .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n .getRegex(),\n};\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nconst blockPedantic: Record = {\n ...blockNormal,\n html: edit(\n '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n + '|<(tag)[\\\\s\\\\S]+? *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n + '|\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n .replace('comment', _comment)\n .replace(/tag/g, '(?!(?:'\n + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n .getRegex(),\n def: /^ *\\[([^\\]]+)\\]: *]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n fences: noopTest, // fences not supported\n lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n paragraph: edit(_paragraph)\n .replace('hr', hr)\n .replace('heading', ' *#{1,6} *[^\\n]')\n .replace('lheading', lheading)\n .replace('|table', '')\n .replace('blockquote', ' {0,3}>')\n .replace('|fences', '')\n .replace('|list', '')\n .replace('|html', '')\n .replace('|tag', '')\n .getRegex(),\n};\n\n/**\n * Inline-Level Grammar\n */\n\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\\nconst blockSkip = edit(/link|precode-code|html/, 'g')\n .replace('link', /\\[(?:[^\\[\\]`]|(?`+)[^`]+\\k(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/)\n .replace('precode-', supportsLookbehind ? '(?`+)[^`]+\\k(?!`)/)\n .replace('html', /<(?! )[^<>]*?>/)\n .getRegex();\n\nconst emStrongLDelimCore = /^(?:\\*+(?:((?!\\*)punct)|[^\\s*]))|^_+(?:((?!_)punct)|([^\\s_]))/;\n\nconst emStrongLDelim = edit(emStrongLDelimCore, 'u')\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')\n .replace(/punct/g, _punctuationGfmStrongEm)\n .getRegex();\n\nconst emStrongRDelimAstCore =\n '^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n+ '|[^*]+(?=[^*])' // Consume to delim\n+ '|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter\n+ '|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)' // (3) #***a, ***a can only be Left Delimiter\n+ '|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)' // (4) ***# can only be Left Delimiter\n+ '|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?=notPunctSpace)'; // (6) a***a can be either Left or Right Delimiter\n\nconst emStrongRDelimAst = edit(emStrongRDelimAstCore, 'gu')\n .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n .replace(/punctSpace/g, _punctuationOrSpace)\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, 'gu')\n .replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm)\n .replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm)\n .replace(/punct/g, _punctuationGfmStrongEm)\n .getRegex();\n\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit(\n '^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n+ '|[^_]+(?=[^_])' // Consume to delim\n+ '|(?!_)punct(_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter\n+ '|(?!_)punctSpace(_+)(?=notPunctSpace)' // (3) #___a, ___a can only be Left Delimiter\n+ '|[\\\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter\n+ '|(?!_)punct(_+)(?!_)(?=punct)', 'gu') // (5) #___# can be either Left or Right Delimiter\n .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n .replace(/punctSpace/g, _punctuationOrSpace)\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst anyPunctuation = edit(/\\\\(punct)/, 'gu')\n .replace(/punct/g, _punctuation)\n .getRegex();\n\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n .getRegex();\n\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit(\n '^comment'\n + '|^' // self-closing tag\n + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. \n + '|^' // declaration, e.g. \n + '|^') // CDATA section\n .replace('comment', _inlineComment)\n .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n .getRegex();\n\nconst _inlineLabel = /(?:\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+[^`]*?`+(?!`)|[^\\[\\]\\\\`])*?/;\n\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:(?:[ \\t]*(?:\\n[ \\t]*)?)(title))?\\s*\\)/)\n .replace('label', _inlineLabel)\n .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]*/)\n .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n .getRegex();\n\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n .replace('label', _inlineLabel)\n .replace('ref', _blockLabel)\n .getRegex();\n\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n .replace('ref', _blockLabel)\n .getRegex();\n\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n .replace('reflink', reflink)\n .replace('nolink', nolink)\n .getRegex();\n\nconst _caseInsensitiveProtocol = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;\n\n/**\n * Normal Inline Grammar\n */\n\nconst inlineNormal = {\n _backpedal: noopTest, // only used for GFM url\n anyPunctuation,\n autolink,\n blockSkip,\n br,\n code: inlineCode,\n del: noopTest,\n emStrongLDelim,\n emStrongRDelimAst,\n emStrongRDelimUnd,\n escape,\n link,\n nolink,\n punctuation,\n reflink,\n reflinkSearch,\n tag,\n text: inlineText,\n url: noopTest,\n};\n\ntype InlineKeys = keyof typeof inlineNormal;\n\n/**\n * Pedantic Inline Grammar\n */\n\nconst inlinePedantic: Record = {\n ...inlineNormal,\n link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n .replace('label', _inlineLabel)\n .getRegex(),\n reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n .replace('label', _inlineLabel)\n .getRegex(),\n};\n\n/**\n * GFM Inline Grammar\n */\n\nconst inlineGfm: Record = {\n ...inlineNormal,\n emStrongRDelimAst: emStrongRDelimAstGfm,\n emStrongLDelim: emStrongLDelimGfm,\n url: edit(/^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/)\n .replace('protocol', _caseInsensitiveProtocol)\n .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n .getRegex(),\n _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n del: /^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,\n text: edit(/^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\ = {\n ...inlineGfm,\n br: edit(br).replace('{2,}', '*').getRegex(),\n text: edit(inlineGfm.text)\n .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n .replace(/\\{2,\\}/g, '*')\n .getRegex(),\n};\n\n/**\n * exports\n */\n\nexport const block = {\n normal: blockNormal,\n gfm: blockGfm,\n pedantic: blockPedantic,\n};\n\nexport const inline = {\n normal: inlineNormal,\n gfm: inlineGfm,\n breaks: inlineBreaks,\n pedantic: inlinePedantic,\n};\n\nexport interface Rules {\n other: typeof other\n block: Record\n inline: Record\n}\n", "import { other } from './rules.ts';\n\n/**\n * Helpers\n */\nconst escapeReplacements: { [index: string]: string } = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n};\nconst getEscapeReplacement = (ch: string) => escapeReplacements[ch];\n\nexport function escape(html: string, encode?: boolean) {\n if (encode) {\n if (other.escapeTest.test(html)) {\n return html.replace(other.escapeReplace, getEscapeReplacement);\n }\n } else {\n if (other.escapeTestNoEncode.test(html)) {\n return html.replace(other.escapeReplaceNoEncode, getEscapeReplacement);\n }\n }\n\n return html;\n}\n\nexport function unescape(html: string) {\n // explicitly match decimal, hex, and named HTML entities\n return html.replace(other.unescapeTest, (_, n) => {\n n = n.toLowerCase();\n if (n === 'colon') return ':';\n if (n.charAt(0) === '#') {\n return n.charAt(1) === 'x'\n ? String.fromCharCode(parseInt(n.substring(2), 16))\n : String.fromCharCode(+n.substring(1));\n }\n return '';\n });\n}\n\nexport function cleanUrl(href: string) {\n try {\n href = encodeURI(href).replace(other.percentDecode, '%');\n } catch {\n return null;\n }\n return href;\n}\n\nexport function splitCells(tableRow: string, count?: number) {\n // ensure that every cell-delimiting pipe has a space\n // before it to distinguish it from an escaped pipe\n const row = tableRow.replace(other.findPipe, (match, offset, str) => {\n let escaped = false;\n let curr = offset;\n while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n if (escaped) {\n // odd number of slashes means | is escaped\n // so we leave it alone\n return '|';\n } else {\n // add space before unescaped |\n return ' |';\n }\n }),\n cells = row.split(other.splitPipe);\n let i = 0;\n\n // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n if (!cells[0].trim()) {\n cells.shift();\n }\n if (cells.length > 0 && !cells.at(-1)?.trim()) {\n cells.pop();\n }\n\n if (count) {\n if (cells.length > count) {\n cells.splice(count);\n } else {\n while (cells.length < count) cells.push('');\n }\n }\n\n for (; i < cells.length; i++) {\n // leading or trailing whitespace is ignored per the gfm spec\n cells[i] = cells[i].trim().replace(other.slashPipe, '|');\n }\n return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nexport function rtrim(str: string, c: string, invert?: boolean) {\n const l = str.length;\n if (l === 0) {\n return '';\n }\n\n // Length of suffix matching the invert condition.\n let suffLen = 0;\n\n // Step left until we fail to match the invert condition.\n while (suffLen < l) {\n const currChar = str.charAt(l - suffLen - 1);\n if (currChar === c && !invert) {\n suffLen++;\n } else if (currChar !== c && invert) {\n suffLen++;\n } else {\n break;\n }\n }\n\n return str.slice(0, l - suffLen);\n}\n\nexport function findClosingBracket(str: string, b: string) {\n if (str.indexOf(b[1]) === -1) {\n return -1;\n }\n\n let level = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] === '\\\\') {\n i++;\n } else if (str[i] === b[0]) {\n level++;\n } else if (str[i] === b[1]) {\n level--;\n if (level < 0) {\n return i;\n }\n }\n }\n if (level > 0) {\n return -2;\n }\n\n return -1;\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n rtrim,\n splitCells,\n findClosingBracket,\n} from './helpers.ts';\nimport type { Rules } from './rules.ts';\nimport type { _Lexer } from './Lexer.ts';\nimport type { Links, Tokens, Token } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\nfunction outputLink(cap: string[], link: Pick, raw: string, lexer: _Lexer, rules: Rules): Tokens.Link | Tokens.Image {\n const href = link.href;\n const title = link.title || null;\n const text = cap[1].replace(rules.other.outputLinkReplace, '$1');\n\n lexer.state.inLink = true;\n const token: Tokens.Link | Tokens.Image = {\n type: cap[0].charAt(0) === '!' ? 'image' : 'link',\n raw,\n href,\n title,\n text,\n tokens: lexer.inlineTokens(text),\n };\n lexer.state.inLink = false;\n return token;\n}\n\nfunction indentCodeCompensation(raw: string, text: string, rules: Rules) {\n const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);\n\n if (matchIndentToCode === null) {\n return text;\n }\n\n const indentToCode = matchIndentToCode[1];\n\n return text\n .split('\\n')\n .map(node => {\n const matchIndentInNode = node.match(rules.other.beginningSpace);\n if (matchIndentInNode === null) {\n return node;\n }\n\n const [indentInNode] = matchIndentInNode;\n\n if (indentInNode.length >= indentToCode.length) {\n return node.slice(indentToCode.length);\n }\n\n return node;\n })\n .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nexport class _Tokenizer {\n options: MarkedOptions;\n rules!: Rules; // set by the lexer\n lexer!: _Lexer; // set by the lexer\n\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n space(src: string): Tokens.Space | undefined {\n const cap = this.rules.block.newline.exec(src);\n if (cap && cap[0].length > 0) {\n return {\n type: 'space',\n raw: cap[0],\n };\n }\n }\n\n code(src: string): Tokens.Code | undefined {\n const cap = this.rules.block.code.exec(src);\n if (cap) {\n const text = cap[0].replace(this.rules.other.codeRemoveIndent, '');\n return {\n type: 'code',\n raw: cap[0],\n codeBlockStyle: 'indented',\n text: !this.options.pedantic\n ? rtrim(text, '\\n')\n : text,\n };\n }\n }\n\n fences(src: string): Tokens.Code | undefined {\n const cap = this.rules.block.fences.exec(src);\n if (cap) {\n const raw = cap[0];\n const text = indentCodeCompensation(raw, cap[3] || '', this.rules);\n\n return {\n type: 'code',\n raw,\n lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n text,\n };\n }\n }\n\n heading(src: string): Tokens.Heading | undefined {\n const cap = this.rules.block.heading.exec(src);\n if (cap) {\n let text = cap[2].trim();\n\n // remove trailing #s\n if (this.rules.other.endingHash.test(text)) {\n const trimmed = rtrim(text, '#');\n if (this.options.pedantic) {\n text = trimmed.trim();\n } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {\n // CommonMark requires space before trailing #s\n text = trimmed.trim();\n }\n }\n\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[1].length,\n text,\n tokens: this.lexer.inline(text),\n };\n }\n }\n\n hr(src: string): Tokens.Hr | undefined {\n const cap = this.rules.block.hr.exec(src);\n if (cap) {\n return {\n type: 'hr',\n raw: rtrim(cap[0], '\\n'),\n };\n }\n }\n\n blockquote(src: string): Tokens.Blockquote | undefined {\n const cap = this.rules.block.blockquote.exec(src);\n if (cap) {\n let lines = rtrim(cap[0], '\\n').split('\\n');\n let raw = '';\n let text = '';\n const tokens: Token[] = [];\n\n while (lines.length > 0) {\n let inBlockquote = false;\n const currentLines = [];\n\n let i;\n for (i = 0; i < lines.length; i++) {\n // get lines up to a continuation\n if (this.rules.other.blockquoteStart.test(lines[i])) {\n currentLines.push(lines[i]);\n inBlockquote = true;\n } else if (!inBlockquote) {\n currentLines.push(lines[i]);\n } else {\n break;\n }\n }\n lines = lines.slice(i);\n\n const currentRaw = currentLines.join('\\n');\n const currentText = currentRaw\n // precede setext continuation with 4 spaces so it isn't a setext\n .replace(this.rules.other.blockquoteSetextReplace, '\\n $1')\n .replace(this.rules.other.blockquoteSetextReplace2, '');\n raw = raw ? `${raw}\\n${currentRaw}` : currentRaw;\n text = text ? `${text}\\n${currentText}` : currentText;\n\n // parse blockquote lines as top level tokens\n // merge paragraphs if this is a continuation\n const top = this.lexer.state.top;\n this.lexer.state.top = true;\n this.lexer.blockTokens(currentText, tokens, true);\n this.lexer.state.top = top;\n\n // if there is no continuation then we are done\n if (lines.length === 0) {\n break;\n }\n\n const lastToken = tokens.at(-1);\n\n if (lastToken?.type === 'code') {\n // blockquote continuation cannot be preceded by a code block\n break;\n } else if (lastToken?.type === 'blockquote') {\n // include continuation in nested blockquote\n const oldToken = lastToken as Tokens.Blockquote;\n const newText = oldToken.raw + '\\n' + lines.join('\\n');\n const newToken = this.blockquote(newText)!;\n tokens[tokens.length - 1] = newToken;\n\n raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;\n text = text.substring(0, text.length - oldToken.text.length) + newToken.text;\n break;\n } else if (lastToken?.type === 'list') {\n // include continuation in nested list\n const oldToken = lastToken as Tokens.List;\n const newText = oldToken.raw + '\\n' + lines.join('\\n');\n const newToken = this.list(newText)!;\n tokens[tokens.length - 1] = newToken;\n\n raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;\n text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;\n lines = newText.substring(tokens.at(-1)!.raw.length).split('\\n');\n continue;\n }\n }\n\n return {\n type: 'blockquote',\n raw,\n tokens,\n text,\n };\n }\n }\n\n list(src: string): Tokens.List | undefined {\n let cap = this.rules.block.list.exec(src);\n if (cap) {\n let bull = cap[1].trim();\n const isordered = bull.length > 1;\n\n const list: Tokens.List = {\n type: 'list',\n raw: '',\n ordered: isordered,\n start: isordered ? +bull.slice(0, -1) : '',\n loose: false,\n items: [],\n };\n\n bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n if (this.options.pedantic) {\n bull = isordered ? bull : '[*+-]';\n }\n\n // Get next list item\n const itemRegex = this.rules.other.listItemRegex(bull);\n let endsWithBlankLine = false;\n // Check if current bullet point can start a new List Item\n while (src) {\n let endEarly = false;\n let raw = '';\n let itemContents = '';\n if (!(cap = itemRegex.exec(src))) {\n break;\n }\n\n if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n break;\n }\n\n raw = cap[0];\n src = src.substring(raw.length);\n\n let line = cap[2].split('\\n', 1)[0].replace(this.rules.other.listReplaceTabs, (t: string) => ' '.repeat(3 * t.length));\n let nextLine = src.split('\\n', 1)[0];\n let blankLine = !line.trim();\n\n let indent = 0;\n if (this.options.pedantic) {\n indent = 2;\n itemContents = line.trimStart();\n } else if (blankLine) {\n indent = cap[1].length + 1;\n } else {\n indent = cap[2].search(this.rules.other.nonSpaceChar); // Find first non-space char\n indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n itemContents = line.slice(indent);\n indent += cap[1].length;\n }\n\n if (blankLine && this.rules.other.blankLine.test(nextLine)) { // Items begin with at most one blank line\n raw += nextLine + '\\n';\n src = src.substring(nextLine.length + 1);\n endEarly = true;\n }\n\n if (!endEarly) {\n const nextBulletRegex = this.rules.other.nextBulletRegex(indent);\n const hrRegex = this.rules.other.hrRegex(indent);\n const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);\n const headingBeginRegex = this.rules.other.headingBeginRegex(indent);\n const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);\n\n // Check if following lines should be included in List Item\n while (src) {\n const rawLine = src.split('\\n', 1)[0];\n let nextLineWithoutTabs;\n nextLine = rawLine;\n\n // Re-align to follow commonmark nesting rules\n if (this.options.pedantic) {\n nextLine = nextLine.replace(this.rules.other.listReplaceNesting, ' ');\n nextLineWithoutTabs = nextLine;\n } else {\n nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, ' ');\n }\n\n // End list item if found code fences\n if (fencesBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new heading\n if (headingBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of html block\n if (htmlBeginRegex.test(nextLine)) {\n break;\n }\n\n // End list item if found start of new bullet\n if (nextBulletRegex.test(nextLine)) {\n break;\n }\n\n // Horizontal rule found\n if (hrRegex.test(nextLine)) {\n break;\n }\n\n if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) { // Dedent if possible\n itemContents += '\\n' + nextLineWithoutTabs.slice(indent);\n } else {\n // not enough indentation\n if (blankLine) {\n break;\n }\n\n // paragraph continuation unless last line was a different block level element\n if (line.replace(this.rules.other.tabCharGlobal, ' ').search(this.rules.other.nonSpaceChar) >= 4) { // indented code block\n break;\n }\n if (fencesBeginRegex.test(line)) {\n break;\n }\n if (headingBeginRegex.test(line)) {\n break;\n }\n if (hrRegex.test(line)) {\n break;\n }\n\n itemContents += '\\n' + nextLine;\n }\n\n if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n blankLine = true;\n }\n\n raw += rawLine + '\\n';\n src = src.substring(rawLine.length + 1);\n line = nextLineWithoutTabs.slice(indent);\n }\n }\n\n if (!list.loose) {\n // If the previous item ended with a blank line, the list is loose\n if (endsWithBlankLine) {\n list.loose = true;\n } else if (this.rules.other.doubleBlankLine.test(raw)) {\n endsWithBlankLine = true;\n }\n }\n\n let istask: RegExpExecArray | null = null;\n let ischecked: boolean | undefined;\n // Check for task list items\n if (this.options.gfm) {\n istask = this.rules.other.listIsTask.exec(itemContents);\n if (istask) {\n ischecked = istask[0] !== '[ ] ';\n itemContents = itemContents.replace(this.rules.other.listReplaceTask, '');\n }\n }\n\n list.items.push({\n type: 'list_item',\n raw,\n task: !!istask,\n checked: ischecked,\n loose: false,\n text: itemContents,\n tokens: [],\n });\n\n list.raw += raw;\n }\n\n // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n const lastItem = list.items.at(-1);\n if (lastItem) {\n lastItem.raw = lastItem.raw.trimEnd();\n lastItem.text = lastItem.text.trimEnd();\n } else {\n // not a list since there were no items\n return;\n }\n list.raw = list.raw.trimEnd();\n\n // Item child tokens handled here at end because we needed to have the final item to trim it first\n for (let i = 0; i < list.items.length; i++) {\n this.lexer.state.top = false;\n list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n if (!list.loose) {\n // Check if list should be loose\n const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => this.rules.other.anyLine.test(t.raw));\n\n list.loose = hasMultipleLineBreaks;\n }\n }\n\n // Set all items to loose if list is loose\n if (list.loose) {\n for (let i = 0; i < list.items.length; i++) {\n list.items[i].loose = true;\n }\n }\n\n return list;\n }\n }\n\n html(src: string): Tokens.HTML | undefined {\n const cap = this.rules.block.html.exec(src);\n if (cap) {\n const token: Tokens.HTML = {\n type: 'html',\n block: true,\n raw: cap[0],\n pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n text: cap[0],\n };\n return token;\n }\n }\n\n def(src: string): Tokens.Def | undefined {\n const cap = this.rules.block.def.exec(src);\n if (cap) {\n const tag = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, ' ');\n const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n return {\n type: 'def',\n tag,\n raw: cap[0],\n href,\n title,\n };\n }\n }\n\n table(src: string): Tokens.Table | undefined {\n const cap = this.rules.block.table.exec(src);\n if (!cap) {\n return;\n }\n\n if (!this.rules.other.tableDelimiter.test(cap[2])) {\n // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n return;\n }\n\n const headers = splitCells(cap[1]);\n const aligns = cap[2].replace(this.rules.other.tableAlignChars, '').split('|');\n const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, '').split('\\n') : [];\n\n const item: Tokens.Table = {\n type: 'table',\n raw: cap[0],\n header: [],\n align: [],\n rows: [],\n };\n\n if (headers.length !== aligns.length) {\n // header and align columns must be equal, rows can be different.\n return;\n }\n\n for (const align of aligns) {\n if (this.rules.other.tableAlignRight.test(align)) {\n item.align.push('right');\n } else if (this.rules.other.tableAlignCenter.test(align)) {\n item.align.push('center');\n } else if (this.rules.other.tableAlignLeft.test(align)) {\n item.align.push('left');\n } else {\n item.align.push(null);\n }\n }\n\n for (let i = 0; i < headers.length; i++) {\n item.header.push({\n text: headers[i],\n tokens: this.lexer.inline(headers[i]),\n header: true,\n align: item.align[i],\n });\n }\n\n for (const row of rows) {\n item.rows.push(splitCells(row, item.header.length).map((cell, i) => {\n return {\n text: cell,\n tokens: this.lexer.inline(cell),\n header: false,\n align: item.align[i],\n };\n }));\n }\n\n return item;\n }\n\n lheading(src: string): Tokens.Heading | undefined {\n const cap = this.rules.block.lheading.exec(src);\n if (cap) {\n return {\n type: 'heading',\n raw: cap[0],\n depth: cap[2].charAt(0) === '=' ? 1 : 2,\n text: cap[1],\n tokens: this.lexer.inline(cap[1]),\n };\n }\n }\n\n paragraph(src: string): Tokens.Paragraph | undefined {\n const cap = this.rules.block.paragraph.exec(src);\n if (cap) {\n const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n ? cap[1].slice(0, -1)\n : cap[1];\n return {\n type: 'paragraph',\n raw: cap[0],\n text,\n tokens: this.lexer.inline(text),\n };\n }\n }\n\n text(src: string): Tokens.Text | undefined {\n const cap = this.rules.block.text.exec(src);\n if (cap) {\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n tokens: this.lexer.inline(cap[0]),\n };\n }\n }\n\n escape(src: string): Tokens.Escape | undefined {\n const cap = this.rules.inline.escape.exec(src);\n if (cap) {\n return {\n type: 'escape',\n raw: cap[0],\n text: cap[1],\n };\n }\n }\n\n tag(src: string): Tokens.Tag | undefined {\n const cap = this.rules.inline.tag.exec(src);\n if (cap) {\n if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {\n this.lexer.state.inLink = true;\n } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {\n this.lexer.state.inLink = false;\n }\n if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {\n this.lexer.state.inRawBlock = true;\n } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {\n this.lexer.state.inRawBlock = false;\n }\n\n return {\n type: 'html',\n raw: cap[0],\n inLink: this.lexer.state.inLink,\n inRawBlock: this.lexer.state.inRawBlock,\n block: false,\n text: cap[0],\n };\n }\n }\n\n link(src: string): Tokens.Link | Tokens.Image | undefined {\n const cap = this.rules.inline.link.exec(src);\n if (cap) {\n const trimmedUrl = cap[2].trim();\n if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {\n // commonmark requires matching angle brackets\n if (!(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n return;\n }\n\n // ending angle bracket cannot be escaped\n const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n return;\n }\n } else {\n // find closing parenthesis\n const lastParenIndex = findClosingBracket(cap[2], '()');\n if (lastParenIndex === -2) {\n // more open parens than closed\n return;\n }\n\n if (lastParenIndex > -1) {\n const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n const linkLen = start + cap[1].length + lastParenIndex;\n cap[2] = cap[2].substring(0, lastParenIndex);\n cap[0] = cap[0].substring(0, linkLen).trim();\n cap[3] = '';\n }\n }\n let href = cap[2];\n let title = '';\n if (this.options.pedantic) {\n // split pedantic href and title\n const link = this.rules.other.pedanticHrefTitle.exec(href);\n\n if (link) {\n href = link[1];\n title = link[3];\n }\n } else {\n title = cap[3] ? cap[3].slice(1, -1) : '';\n }\n\n href = href.trim();\n if (this.rules.other.startAngleBracket.test(href)) {\n if (this.options.pedantic && !(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n // pedantic allows starting angle bracket without ending angle bracket\n href = href.slice(1);\n } else {\n href = href.slice(1, -1);\n }\n }\n return outputLink(cap, {\n href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title,\n }, cap[0], this.lexer, this.rules);\n }\n }\n\n reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined {\n let cap;\n if ((cap = this.rules.inline.reflink.exec(src))\n || (cap = this.rules.inline.nolink.exec(src))) {\n const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, ' ');\n const link = links[linkString.toLowerCase()];\n if (!link) {\n const text = cap[0].charAt(0);\n return {\n type: 'text',\n raw: text,\n text,\n };\n }\n return outputLink(cap, link, cap[0], this.lexer, this.rules);\n }\n }\n\n emStrong(src: string, maskedSrc: string, prevChar = ''): Tokens.Em | Tokens.Strong | undefined {\n let match = this.rules.inline.emStrongLDelim.exec(src);\n if (!match) return;\n\n // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;\n\n const nextChar = match[1] || match[2] || '';\n\n if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n const lLength = [...match[0]].length - 1;\n let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n endReg.lastIndex = 0;\n\n // Clip maskedSrc to same section of string as src (move to lexer?)\n maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n while ((match = endReg.exec(maskedSrc)) != null) {\n rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n if (!rDelim) continue; // skip single * in __abc*abc__\n\n rLength = [...rDelim].length;\n\n if (match[3] || match[4]) { // found another Left Delim\n delimTotal += rLength;\n continue;\n } else if (match[5] || match[6]) { // either Left or Right Delim\n if (lLength % 3 && !((lLength + rLength) % 3)) {\n midDelimTotal += rLength;\n continue; // CommonMark Emphasis Rules 9-10\n }\n }\n\n delimTotal -= rLength;\n\n if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n // Remove extra characters. *a*** -> *a*\n rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n // char length can be >1 for unicode characters;\n const lastCharLength = [...match[0]][0].length;\n const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n\n // Create `em` if smallest delimiter has odd char count. *a***\n if (Math.min(lLength, rLength) % 2) {\n const text = raw.slice(1, -1);\n return {\n type: 'em',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text),\n };\n }\n\n // Create 'strong' if smallest delimiter has even char count. **a***\n const text = raw.slice(2, -2);\n return {\n type: 'strong',\n raw,\n text,\n tokens: this.lexer.inlineTokens(text),\n };\n }\n }\n }\n\n codespan(src: string): Tokens.Codespan | undefined {\n const cap = this.rules.inline.code.exec(src);\n if (cap) {\n let text = cap[2].replace(this.rules.other.newLineCharGlobal, ' ');\n const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);\n const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);\n if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n text = text.substring(1, text.length - 1);\n }\n return {\n type: 'codespan',\n raw: cap[0],\n text,\n };\n }\n }\n\n br(src: string): Tokens.Br | undefined {\n const cap = this.rules.inline.br.exec(src);\n if (cap) {\n return {\n type: 'br',\n raw: cap[0],\n };\n }\n }\n\n del(src: string): Tokens.Del | undefined {\n const cap = this.rules.inline.del.exec(src);\n if (cap) {\n return {\n type: 'del',\n raw: cap[0],\n text: cap[2],\n tokens: this.lexer.inlineTokens(cap[2]),\n };\n }\n }\n\n autolink(src: string): Tokens.Link | undefined {\n const cap = this.rules.inline.autolink.exec(src);\n if (cap) {\n let text, href;\n if (cap[2] === '@') {\n text = cap[1];\n href = 'mailto:' + text;\n } else {\n text = cap[1];\n href = text;\n }\n\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text,\n },\n ],\n };\n }\n }\n\n url(src: string): Tokens.Link | undefined {\n let cap;\n if (cap = this.rules.inline.url.exec(src)) {\n let text, href;\n if (cap[2] === '@') {\n text = cap[0];\n href = 'mailto:' + text;\n } else {\n // do extended autolink path validation\n let prevCapZero;\n do {\n prevCapZero = cap[0];\n cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n } while (prevCapZero !== cap[0]);\n text = cap[0];\n if (cap[1] === 'www.') {\n href = 'http://' + cap[0];\n } else {\n href = cap[0];\n }\n }\n return {\n type: 'link',\n raw: cap[0],\n text,\n href,\n tokens: [\n {\n type: 'text',\n raw: text,\n text,\n },\n ],\n };\n }\n }\n\n inlineText(src: string): Tokens.Text | undefined {\n const cap = this.rules.inline.text.exec(src);\n if (cap) {\n const escaped = this.lexer.state.inRawBlock;\n return {\n type: 'text',\n raw: cap[0],\n text: cap[0],\n escaped,\n };\n }\n }\n}\n", "import { _Tokenizer } from './Tokenizer.ts';\nimport { _defaults } from './defaults.ts';\nimport { other, block, inline } from './rules.ts';\nimport type { Token, TokensList, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Block Lexer\n */\nexport class _Lexer {\n tokens: TokensList;\n options: MarkedOptions;\n state: {\n inLink: boolean;\n inRawBlock: boolean;\n top: boolean;\n };\n\n private tokenizer: _Tokenizer;\n private inlineQueue: { src: string, tokens: Token[] }[];\n\n constructor(options?: MarkedOptions) {\n // TokenList cannot be created in one go\n this.tokens = [] as unknown as TokensList;\n this.tokens.links = Object.create(null);\n this.options = options || _defaults;\n this.options.tokenizer = this.options.tokenizer || new _Tokenizer();\n this.tokenizer = this.options.tokenizer;\n this.tokenizer.options = this.options;\n this.tokenizer.lexer = this;\n this.inlineQueue = [];\n this.state = {\n inLink: false,\n inRawBlock: false,\n top: true,\n };\n\n const rules = {\n other,\n block: block.normal,\n inline: inline.normal,\n };\n\n if (this.options.pedantic) {\n rules.block = block.pedantic;\n rules.inline = inline.pedantic;\n } else if (this.options.gfm) {\n rules.block = block.gfm;\n if (this.options.breaks) {\n rules.inline = inline.breaks;\n } else {\n rules.inline = inline.gfm;\n }\n }\n this.tokenizer.rules = rules;\n }\n\n /**\n * Expose Rules\n */\n static get rules() {\n return {\n block,\n inline,\n };\n }\n\n /**\n * Static Lex Method\n */\n static lex(src: string, options?: MarkedOptions) {\n const lexer = new _Lexer(options);\n return lexer.lex(src);\n }\n\n /**\n * Static Lex Inline Method\n */\n static lexInline(src: string, options?: MarkedOptions) {\n const lexer = new _Lexer(options);\n return lexer.inlineTokens(src);\n }\n\n /**\n * Preprocessing\n */\n lex(src: string) {\n src = src.replace(other.carriageReturn, '\\n');\n\n this.blockTokens(src, this.tokens);\n\n for (let i = 0; i < this.inlineQueue.length; i++) {\n const next = this.inlineQueue[i];\n this.inlineTokens(next.src, next.tokens);\n }\n this.inlineQueue = [];\n\n return this.tokens;\n }\n\n /**\n * Lexing\n */\n blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];\n blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;\n blockTokens(src: string, tokens: Token[] = [], lastParagraphClipped = false) {\n if (this.options.pedantic) {\n src = src.replace(other.tabCharGlobal, ' ').replace(other.spaceLine, '');\n }\n\n while (src) {\n let token: Tokens.Generic | undefined;\n\n if (this.options.extensions?.block?.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // newline\n if (token = this.tokenizer.space(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (token.raw.length === 1 && lastToken !== undefined) {\n // if there's a single \\n as a spacer, it's terminating the last line,\n // so move it there so that we don't get unnecessary paragraph tags\n lastToken.raw += '\\n';\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // code\n if (token = this.tokenizer.code(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n // An indented code block cannot interrupt a paragraph.\n if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // fences\n if (token = this.tokenizer.fences(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // heading\n if (token = this.tokenizer.heading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // hr\n if (token = this.tokenizer.hr(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // blockquote\n if (token = this.tokenizer.blockquote(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // list\n if (token = this.tokenizer.list(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // html\n if (token = this.tokenizer.html(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // def\n if (token = this.tokenizer.def(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.raw;\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else if (!this.tokens.links[token.tag]) {\n this.tokens.links[token.tag] = {\n href: token.href,\n title: token.title,\n };\n tokens.push(token);\n }\n continue;\n }\n\n // table (gfm)\n if (token = this.tokenizer.table(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // lheading\n if (token = this.tokenizer.lheading(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // top-level paragraph\n // prevent paragraph consuming extensions by clipping 'src' to extension start\n let cutSrc = src;\n if (this.options.extensions?.startBlock) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startBlock.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n const lastToken = tokens.at(-1);\n if (lastParagraphClipped && lastToken?.type === 'paragraph') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n lastParagraphClipped = cutSrc.length !== src.length;\n src = src.substring(token.raw.length);\n continue;\n }\n\n // text\n if (token = this.tokenizer.text(src)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'text') {\n lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n lastToken.text += '\\n' + token.text;\n this.inlineQueue.pop();\n this.inlineQueue.at(-1)!.src = lastToken.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n this.state.top = true;\n return tokens;\n }\n\n inline(src: string, tokens: Token[] = []) {\n this.inlineQueue.push({ src, tokens });\n return tokens;\n }\n\n /**\n * Lexing/Compiling\n */\n inlineTokens(src: string, tokens: Token[] = []): Token[] {\n // String with links masked to avoid interference with em and strong\n let maskedSrc = src;\n let match: RegExpExecArray | null = null;\n\n // Mask out reflinks\n if (this.tokens.links) {\n const links = Object.keys(this.tokens.links);\n if (links.length > 0) {\n while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n maskedSrc = maskedSrc.slice(0, match.index)\n + '[' + 'a'.repeat(match[0].length - 2) + ']'\n + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n }\n }\n }\n }\n\n // Mask out escaped characters\n while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n }\n\n // Mask out other blocks\n let offset;\n while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n offset = match[2] ? match[2].length : 0;\n maskedSrc = maskedSrc.slice(0, match.index + offset) + '[' + 'a'.repeat(match[0].length - offset - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n }\n\n // Mask out blocks from extensions\n maskedSrc = this.options.hooks?.emStrongMask?.call({ lexer: this }, maskedSrc) ?? maskedSrc;\n\n let keepPrevChar = false;\n let prevChar = '';\n while (src) {\n if (!keepPrevChar) {\n prevChar = '';\n }\n keepPrevChar = false;\n\n let token: Tokens.Generic | undefined;\n\n // extensions\n if (this.options.extensions?.inline?.some((extTokenizer) => {\n if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n return true;\n }\n return false;\n })) {\n continue;\n }\n\n // escape\n if (token = this.tokenizer.escape(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // tag\n if (token = this.tokenizer.tag(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // link\n if (token = this.tokenizer.link(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // reflink, nolink\n if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n src = src.substring(token.raw.length);\n const lastToken = tokens.at(-1);\n if (token.type === 'text' && lastToken?.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n // em & strong\n if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // code\n if (token = this.tokenizer.codespan(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // br\n if (token = this.tokenizer.br(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // del (gfm)\n if (token = this.tokenizer.del(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // autolink\n if (token = this.tokenizer.autolink(src)) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // url (gfm)\n if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n src = src.substring(token.raw.length);\n tokens.push(token);\n continue;\n }\n\n // text\n // prevent inlineText consuming extensions by clipping 'src' to extension start\n let cutSrc = src;\n if (this.options.extensions?.startInline) {\n let startIndex = Infinity;\n const tempSrc = src.slice(1);\n let tempStart;\n this.options.extensions.startInline.forEach((getStartIndex) => {\n tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n if (typeof tempStart === 'number' && tempStart >= 0) {\n startIndex = Math.min(startIndex, tempStart);\n }\n });\n if (startIndex < Infinity && startIndex >= 0) {\n cutSrc = src.substring(0, startIndex + 1);\n }\n }\n if (token = this.tokenizer.inlineText(cutSrc)) {\n src = src.substring(token.raw.length);\n if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n prevChar = token.raw.slice(-1);\n }\n keepPrevChar = true;\n const lastToken = tokens.at(-1);\n if (lastToken?.type === 'text') {\n lastToken.raw += token.raw;\n lastToken.text += token.text;\n } else {\n tokens.push(token);\n }\n continue;\n }\n\n if (src) {\n const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n if (this.options.silent) {\n console.error(errMsg);\n break;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n\n return tokens;\n }\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n cleanUrl,\n escape,\n} from './helpers.ts';\nimport { other } from './rules.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Tokens } from './Tokens.ts';\nimport type { _Parser } from './Parser.ts';\n\n/**\n * Renderer\n */\nexport class _Renderer {\n options: MarkedOptions;\n parser!: _Parser; // set by the parser\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n space(token: Tokens.Space): RendererOutput {\n return '' as RendererOutput;\n }\n\n code({ text, lang, escaped }: Tokens.Code): RendererOutput {\n const langString = (lang || '').match(other.notSpaceStart)?.[0];\n\n const code = text.replace(other.endingNewline, '') + '\\n';\n\n if (!langString) {\n return '
    '\n        + (escaped ? code : escape(code, true))\n        + '
    \\n' as RendererOutput;\n }\n\n return '
    '\n      + (escaped ? code : escape(code, true))\n      + '
    \\n' as RendererOutput;\n }\n\n blockquote({ tokens }: Tokens.Blockquote): RendererOutput {\n const body = this.parser.parse(tokens);\n return `
    \\n${body}
    \\n` as RendererOutput;\n }\n\n html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n def(token: Tokens.Def): RendererOutput {\n return '' as RendererOutput;\n }\n\n heading({ tokens, depth }: Tokens.Heading): RendererOutput {\n return `${this.parser.parseInline(tokens)}\\n` as RendererOutput;\n }\n\n hr(token: Tokens.Hr): RendererOutput {\n return '
    \\n' as RendererOutput;\n }\n\n list(token: Tokens.List): RendererOutput {\n const ordered = token.ordered;\n const start = token.start;\n\n let body = '';\n for (let j = 0; j < token.items.length; j++) {\n const item = token.items[j];\n body += this.listitem(item);\n }\n\n const type = ordered ? 'ol' : 'ul';\n const startAttr = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n return '<' + type + startAttr + '>\\n' + body + '\\n' as RendererOutput;\n }\n\n listitem(item: Tokens.ListItem): RendererOutput {\n let itemBody = '';\n if (item.task) {\n const checkbox = this.checkbox({ checked: !!item.checked });\n if (item.loose) {\n if (item.tokens[0]?.type === 'paragraph') {\n item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n item.tokens[0].tokens[0].text = checkbox + ' ' + escape(item.tokens[0].tokens[0].text);\n item.tokens[0].tokens[0].escaped = true;\n }\n } else {\n item.tokens.unshift({\n type: 'text',\n raw: checkbox + ' ',\n text: checkbox + ' ',\n escaped: true,\n });\n }\n } else {\n itemBody += checkbox + ' ';\n }\n }\n\n itemBody += this.parser.parse(item.tokens, !!item.loose);\n\n return `
  • ${itemBody}
  • \\n` as RendererOutput;\n }\n\n checkbox({ checked }: Tokens.Checkbox): RendererOutput {\n return '' as RendererOutput;\n }\n\n paragraph({ tokens }: Tokens.Paragraph): RendererOutput {\n return `

    ${this.parser.parseInline(tokens)}

    \\n` as RendererOutput;\n }\n\n table(token: Tokens.Table): RendererOutput {\n let header = '';\n\n // header\n let cell = '';\n for (let j = 0; j < token.header.length; j++) {\n cell += this.tablecell(token.header[j]);\n }\n header += this.tablerow({ text: cell as ParserOutput });\n\n let body = '';\n for (let j = 0; j < token.rows.length; j++) {\n const row = token.rows[j];\n\n cell = '';\n for (let k = 0; k < row.length; k++) {\n cell += this.tablecell(row[k]);\n }\n\n body += this.tablerow({ text: cell as ParserOutput });\n }\n if (body) body = `${body}`;\n\n return '\\n'\n + '\\n'\n + header\n + '\\n'\n + body\n + '
    \\n' as RendererOutput;\n }\n\n tablerow({ text }: Tokens.TableRow): RendererOutput {\n return `\\n${text}\\n` as RendererOutput;\n }\n\n tablecell(token: Tokens.TableCell): RendererOutput {\n const content = this.parser.parseInline(token.tokens);\n const type = token.header ? 'th' : 'td';\n const tag = token.align\n ? `<${type} align=\"${token.align}\">`\n : `<${type}>`;\n return tag + content + `\\n` as RendererOutput;\n }\n\n /**\n * span level renderer\n */\n strong({ tokens }: Tokens.Strong): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n em({ tokens }: Tokens.Em): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n codespan({ text }: Tokens.Codespan): RendererOutput {\n return `${escape(text, true)}` as RendererOutput;\n }\n\n br(token: Tokens.Br): RendererOutput {\n return '
    ' as RendererOutput;\n }\n\n del({ tokens }: Tokens.Del): RendererOutput {\n return `${this.parser.parseInline(tokens)}` as RendererOutput;\n }\n\n link({ href, title, tokens }: Tokens.Link): RendererOutput {\n const text = this.parser.parseInline(tokens) as string;\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return text as RendererOutput;\n }\n href = cleanHref;\n let out = '
    ';\n return out as RendererOutput;\n }\n\n image({ href, title, text, tokens }: Tokens.Image): RendererOutput {\n if (tokens) {\n text = this.parser.parseInline(tokens, this.parser.textRenderer) as string;\n }\n const cleanHref = cleanUrl(href);\n if (cleanHref === null) {\n return escape(text) as RendererOutput;\n }\n href = cleanHref;\n\n let out = `\"${text}\"`;\n {\n // no need for block level renderers\n strong({ text }: Tokens.Strong): RendererOutput {\n return text as RendererOutput;\n }\n\n em({ text }: Tokens.Em): RendererOutput {\n return text as RendererOutput;\n }\n\n codespan({ text }: Tokens.Codespan): RendererOutput {\n return text as RendererOutput;\n }\n\n del({ text }: Tokens.Del): RendererOutput {\n return text as RendererOutput;\n }\n\n html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput {\n return text as RendererOutput;\n }\n\n link({ text }: Tokens.Link): RendererOutput {\n return '' + text as RendererOutput;\n }\n\n image({ text }: Tokens.Image): RendererOutput {\n return '' + text as RendererOutput;\n }\n\n br(): RendererOutput {\n return '' as RendererOutput;\n }\n}\n", "import { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _defaults } from './defaults.ts';\nimport type { MarkedToken, Token, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Parsing & Compiling\n */\nexport class _Parser {\n options: MarkedOptions;\n renderer: _Renderer;\n textRenderer: _TextRenderer;\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n this.options.renderer = this.options.renderer || new _Renderer();\n this.renderer = this.options.renderer;\n this.renderer.options = this.options;\n this.renderer.parser = this;\n this.textRenderer = new _TextRenderer();\n }\n\n /**\n * Static Parse Method\n */\n static parse(tokens: Token[], options?: MarkedOptions) {\n const parser = new _Parser(options);\n return parser.parse(tokens);\n }\n\n /**\n * Static Parse Inline Method\n */\n static parseInline(tokens: Token[], options?: MarkedOptions) {\n const parser = new _Parser(options);\n return parser.parseInline(tokens);\n }\n\n /**\n * Parse Loop\n */\n parse(tokens: Token[], top = true): ParserOutput {\n let out = '';\n\n for (let i = 0; i < tokens.length; i++) {\n const anyToken = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions?.renderers?.[anyToken.type]) {\n const genericToken = anyToken as Tokens.Generic;\n const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'def', 'paragraph', 'text'].includes(genericToken.type)) {\n out += ret || '';\n continue;\n }\n }\n\n const token = anyToken as MarkedToken;\n\n switch (token.type) {\n case 'space': {\n out += this.renderer.space(token);\n continue;\n }\n case 'hr': {\n out += this.renderer.hr(token);\n continue;\n }\n case 'heading': {\n out += this.renderer.heading(token);\n continue;\n }\n case 'code': {\n out += this.renderer.code(token);\n continue;\n }\n case 'table': {\n out += this.renderer.table(token);\n continue;\n }\n case 'blockquote': {\n out += this.renderer.blockquote(token);\n continue;\n }\n case 'list': {\n out += this.renderer.list(token);\n continue;\n }\n case 'html': {\n out += this.renderer.html(token);\n continue;\n }\n case 'def': {\n out += this.renderer.def(token);\n continue;\n }\n case 'paragraph': {\n out += this.renderer.paragraph(token);\n continue;\n }\n case 'text': {\n let textToken = token;\n let body = this.renderer.text(textToken) as string;\n while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n textToken = tokens[++i] as Tokens.Text;\n body += ('\\n' + this.renderer.text(textToken));\n }\n if (top) {\n out += this.renderer.paragraph({\n type: 'paragraph',\n raw: body,\n text: body,\n tokens: [{ type: 'text', raw: body, text: body, escaped: true }],\n });\n } else {\n out += body;\n }\n continue;\n }\n\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '' as ParserOutput;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n\n return out as ParserOutput;\n }\n\n /**\n * Parse Inline Tokens\n */\n parseInline(tokens: Token[], renderer: _Renderer | _TextRenderer = this.renderer): ParserOutput {\n let out = '';\n\n for (let i = 0; i < tokens.length; i++) {\n const anyToken = tokens[i];\n\n // Run any renderer extensions\n if (this.options.extensions?.renderers?.[anyToken.type]) {\n const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);\n if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(anyToken.type)) {\n out += ret || '';\n continue;\n }\n }\n\n const token = anyToken as MarkedToken;\n\n switch (token.type) {\n case 'escape': {\n out += renderer.text(token);\n break;\n }\n case 'html': {\n out += renderer.html(token);\n break;\n }\n case 'link': {\n out += renderer.link(token);\n break;\n }\n case 'image': {\n out += renderer.image(token);\n break;\n }\n case 'strong': {\n out += renderer.strong(token);\n break;\n }\n case 'em': {\n out += renderer.em(token);\n break;\n }\n case 'codespan': {\n out += renderer.codespan(token);\n break;\n }\n case 'br': {\n out += renderer.br(token);\n break;\n }\n case 'del': {\n out += renderer.del(token);\n break;\n }\n case 'text': {\n out += renderer.text(token);\n break;\n }\n default: {\n const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n if (this.options.silent) {\n console.error(errMsg);\n return '' as ParserOutput;\n } else {\n throw new Error(errMsg);\n }\n }\n }\n }\n return out as ParserOutput;\n }\n}\n", "import { _defaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\n\nexport class _Hooks {\n options: MarkedOptions;\n block?: boolean;\n\n constructor(options?: MarkedOptions) {\n this.options = options || _defaults;\n }\n\n static passThroughHooks = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens',\n 'emStrongMask',\n ]);\n\n static passThroughHooksRespectAsync = new Set([\n 'preprocess',\n 'postprocess',\n 'processAllTokens',\n ]);\n\n /**\n * Process markdown before marked\n */\n preprocess(markdown: string) {\n return markdown;\n }\n\n /**\n * Process HTML after marked is finished\n */\n postprocess(html: ParserOutput) {\n return html;\n }\n\n /**\n * Process all tokens before walk tokens\n */\n processAllTokens(tokens: Token[] | TokensList) {\n return tokens;\n }\n\n /**\n * Mask contents that should not be interpreted as em/strong delimiters\n */\n emStrongMask(src: string) {\n return src;\n }\n\n /**\n * Provide function to tokenize markdown\n */\n provideLexer() {\n return this.block ? _Lexer.lex : _Lexer.lexInline;\n }\n\n /**\n * Provide function to parse tokens\n */\n provideParser() {\n return this.block ? _Parser.parse : _Parser.parseInline;\n }\n}\n", "import { _getDefaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { escape } from './helpers.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, Tokens, TokensList } from './Tokens.ts';\n\nexport type MaybePromise = void | Promise;\n\ntype UnknownFunction = (...args: unknown[]) => unknown;\ntype GenericRendererFunction = (...args: unknown[]) => string | false;\n\nexport class Marked {\n defaults = _getDefaults();\n options = this.setOptions;\n\n parse = this.parseMarkdown(true);\n parseInline = this.parseMarkdown(false);\n\n Parser = _Parser;\n Renderer = _Renderer;\n TextRenderer = _TextRenderer;\n Lexer = _Lexer;\n Tokenizer = _Tokenizer;\n Hooks = _Hooks;\n\n constructor(...args: MarkedExtension[]) {\n this.use(...args);\n }\n\n /**\n * Run callback for every token\n */\n walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n let values: MaybePromise[] = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case 'table': {\n const tableToken = token as Tokens.Table;\n for (const cell of tableToken.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of tableToken.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case 'list': {\n const listToken = token as Tokens.List;\n values = values.concat(this.walkTokens(listToken.items, callback));\n break;\n }\n default: {\n const genericToken = token as Tokens.Generic;\n if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n const tokens = genericToken[childTokens].flat(Infinity) as Token[] | TokensList;\n values = values.concat(this.walkTokens(tokens, callback));\n });\n } else if (genericToken.tokens) {\n values = values.concat(this.walkTokens(genericToken.tokens, callback));\n }\n }\n }\n }\n return values;\n }\n\n use(...args: MarkedExtension[]) {\n const extensions: MarkedOptions['extensions'] = this.defaults.extensions || { renderers: {}, childTokens: {} };\n\n args.forEach((pack) => {\n // copy options to new object\n const opts = { ...pack } as MarkedOptions;\n\n // set async to true if it was set to true before\n opts.async = this.defaults.async || opts.async || false;\n\n // ==-- Parse \"addon\" extensions --== //\n if (pack.extensions) {\n pack.extensions.forEach((ext) => {\n if (!ext.name) {\n throw new Error('extension name required');\n }\n if ('renderer' in ext) { // Renderer extensions\n const prevRenderer = extensions.renderers[ext.name];\n if (prevRenderer) {\n // Replace extension with func to run new extension but fall back if false\n extensions.renderers[ext.name] = function(...args) {\n let ret = ext.renderer.apply(this, args);\n if (ret === false) {\n ret = prevRenderer.apply(this, args);\n }\n return ret;\n };\n } else {\n extensions.renderers[ext.name] = ext.renderer;\n }\n }\n if ('tokenizer' in ext) { // Tokenizer Extensions\n if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n throw new Error(\"extension level must be 'block' or 'inline'\");\n }\n const extLevel = extensions[ext.level];\n if (extLevel) {\n extLevel.unshift(ext.tokenizer);\n } else {\n extensions[ext.level] = [ext.tokenizer];\n }\n if (ext.start) { // Function to check for start of token\n if (ext.level === 'block') {\n if (extensions.startBlock) {\n extensions.startBlock.push(ext.start);\n } else {\n extensions.startBlock = [ext.start];\n }\n } else if (ext.level === 'inline') {\n if (extensions.startInline) {\n extensions.startInline.push(ext.start);\n } else {\n extensions.startInline = [ext.start];\n }\n }\n }\n }\n if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n extensions.childTokens[ext.name] = ext.childTokens;\n }\n });\n opts.extensions = extensions;\n }\n\n // ==-- Parse \"overwrite\" extensions --== //\n if (pack.renderer) {\n const renderer = this.defaults.renderer || new _Renderer(this.defaults);\n for (const prop in pack.renderer) {\n if (!(prop in renderer)) {\n throw new Error(`renderer '${prop}' does not exist`);\n }\n if (['options', 'parser'].includes(prop)) {\n // ignore options property\n continue;\n }\n const rendererProp = prop as Exclude, 'options' | 'parser'>;\n const rendererFunc = pack.renderer[rendererProp] as GenericRendererFunction;\n const prevRenderer = renderer[rendererProp] as GenericRendererFunction;\n // Replace renderer with func to run extension, but fall back if false\n renderer[rendererProp] = (...args: unknown[]) => {\n let ret = rendererFunc.apply(renderer, args);\n if (ret === false) {\n ret = prevRenderer.apply(renderer, args);\n }\n return (ret || '') as RendererOutput;\n };\n }\n opts.renderer = renderer;\n }\n if (pack.tokenizer) {\n const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);\n for (const prop in pack.tokenizer) {\n if (!(prop in tokenizer)) {\n throw new Error(`tokenizer '${prop}' does not exist`);\n }\n if (['options', 'rules', 'lexer'].includes(prop)) {\n // ignore options, rules, and lexer properties\n continue;\n }\n const tokenizerProp = prop as Exclude, 'options' | 'rules' | 'lexer'>;\n const tokenizerFunc = pack.tokenizer[tokenizerProp] as UnknownFunction;\n const prevTokenizer = tokenizer[tokenizerProp] as UnknownFunction;\n // Replace tokenizer with func to run extension, but fall back if false\n // @ts-expect-error cannot type tokenizer function dynamically\n tokenizer[tokenizerProp] = (...args: unknown[]) => {\n let ret = tokenizerFunc.apply(tokenizer, args);\n if (ret === false) {\n ret = prevTokenizer.apply(tokenizer, args);\n }\n return ret;\n };\n }\n opts.tokenizer = tokenizer;\n }\n\n // ==-- Parse Hooks extensions --== //\n if (pack.hooks) {\n const hooks = this.defaults.hooks || new _Hooks();\n for (const prop in pack.hooks) {\n if (!(prop in hooks)) {\n throw new Error(`hook '${prop}' does not exist`);\n }\n if (['options', 'block'].includes(prop)) {\n // ignore options and block properties\n continue;\n }\n const hooksProp = prop as Exclude, 'options' | 'block'>;\n const hooksFunc = pack.hooks[hooksProp] as UnknownFunction;\n const prevHook = hooks[hooksProp] as UnknownFunction;\n if (_Hooks.passThroughHooks.has(prop)) {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (arg: unknown) => {\n if (this.defaults.async && _Hooks.passThroughHooksRespectAsync.has(prop)) {\n return (async() => {\n const ret = await hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n })();\n }\n\n const ret = hooksFunc.call(hooks, arg);\n return prevHook.call(hooks, ret);\n };\n } else {\n // @ts-expect-error cannot type hook function dynamically\n hooks[hooksProp] = (...args: unknown[]) => {\n if (this.defaults.async) {\n return (async() => {\n let ret = await hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = await prevHook.apply(hooks, args);\n }\n return ret;\n })();\n }\n\n let ret = hooksFunc.apply(hooks, args);\n if (ret === false) {\n ret = prevHook.apply(hooks, args);\n }\n return ret;\n };\n }\n }\n opts.hooks = hooks;\n }\n\n // ==-- Parse WalkTokens extensions --== //\n if (pack.walkTokens) {\n const walkTokens = this.defaults.walkTokens;\n const packWalktokens = pack.walkTokens;\n opts.walkTokens = function(token) {\n let values: MaybePromise[] = [];\n values.push(packWalktokens.call(this, token));\n if (walkTokens) {\n values = values.concat(walkTokens.call(this, token));\n }\n return values;\n };\n }\n\n this.defaults = { ...this.defaults, ...opts };\n });\n\n return this;\n }\n\n setOptions(opt: MarkedOptions) {\n this.defaults = { ...this.defaults, ...opt };\n return this;\n }\n\n lexer(src: string, options?: MarkedOptions) {\n return _Lexer.lex(src, options ?? this.defaults);\n }\n\n parser(tokens: Token[], options?: MarkedOptions) {\n return _Parser.parse(tokens, options ?? this.defaults);\n }\n\n private parseMarkdown(blockType: boolean) {\n type overloadedParse = {\n (src: string, options: MarkedOptions & { async: true }): Promise;\n (src: string, options: MarkedOptions & { async: false }): ParserOutput;\n (src: string, options?: MarkedOptions | null): ParserOutput | Promise;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const parse: overloadedParse = (src: string, options?: MarkedOptions | null): any => {\n const origOpt = { ...options };\n const opt = { ...this.defaults, ...origOpt };\n\n const throwError = this.onError(!!opt.silent, !!opt.async);\n\n // throw error if an extension set async to true but parse was called with async: false\n if (this.defaults.async === true && origOpt.async === false) {\n return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.'));\n }\n\n // throw error in case of non string input\n if (typeof src === 'undefined' || src === null) {\n return throwError(new Error('marked(): input parameter is undefined or null'));\n }\n if (typeof src !== 'string') {\n return throwError(new Error('marked(): input parameter is of type '\n + Object.prototype.toString.call(src) + ', string expected'));\n }\n\n if (opt.hooks) {\n opt.hooks.options = opt;\n opt.hooks.block = blockType;\n }\n\n if (opt.async) {\n return (async() => {\n const processedSrc = opt.hooks ? await opt.hooks.preprocess(src) : src;\n const lexer = opt.hooks ? await opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n const tokens = await lexer(processedSrc, opt);\n const processedTokens = opt.hooks ? await opt.hooks.processAllTokens(tokens) : tokens;\n if (opt.walkTokens) {\n await Promise.all(this.walkTokens(processedTokens, opt.walkTokens));\n }\n const parser = opt.hooks ? await opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n const html = await parser(processedTokens, opt);\n return opt.hooks ? await opt.hooks.postprocess(html) : html;\n })().catch(throwError);\n }\n\n try {\n if (opt.hooks) {\n src = opt.hooks.preprocess(src) as string;\n }\n const lexer = opt.hooks ? opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n let tokens = lexer(src, opt);\n if (opt.hooks) {\n tokens = opt.hooks.processAllTokens(tokens);\n }\n if (opt.walkTokens) {\n this.walkTokens(tokens, opt.walkTokens);\n }\n const parser = opt.hooks ? opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n let html = parser(tokens, opt);\n if (opt.hooks) {\n html = opt.hooks.postprocess(html);\n }\n return html;\n } catch(e) {\n return throwError(e as Error);\n }\n };\n\n return parse;\n }\n\n private onError(silent: boolean, async: boolean) {\n return (e: Error): string | Promise => {\n e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n if (silent) {\n const msg = '

    An error occurred:

    '\n          + escape(e.message + '', true)\n          + '
    ';\n if (async) {\n return Promise.resolve(msg);\n }\n return msg;\n }\n\n if (async) {\n return Promise.reject(e);\n }\n throw e;\n };\n }\n}\n"], + "mappings": ";;;;;;;;;;;;mbAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,WAAAE,EAAA,UAAAC,EAAA,WAAAC,EAAA,WAAAC,EAAA,aAAAC,EAAA,iBAAAC,EAAA,cAAAC,EAAA,aAAAC,EAAA,gBAAAC,EAAA,UAAAC,GAAA,WAAAC,EAAA,YAAAC,GAAA,UAAAC,GAAA,gBAAAC,GAAA,WAAAC,GAAA,eAAAC,GAAA,QAAAC,GAAA,eAAAC,KAAA,eAAAC,GAAApB,ICKO,SAASqB,GAA4G,CAC1H,MAAO,CACL,MAAO,GACP,OAAQ,GACR,WAAY,KACZ,IAAK,GACL,MAAO,KACP,SAAU,GACV,SAAU,KACV,OAAQ,GACR,UAAW,KACX,WAAY,IACd,CACF,CAEO,IAAIC,EAAqCD,EAAa,EAEtD,SAASE,EAA+DC,EAA0D,CACvIF,EAAYE,CACd,CCxBA,IAAMC,EAAW,CAAE,KAAM,IAAM,IAAK,EAEpC,SAASC,EAAKC,EAAwBC,EAAM,GAAI,CAC9C,IAAIC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EAAQC,CAAQ,CACnD,EASAT,EAAO,YAAcF,EAAe,YAKpCE,EAAO,OAASU,EAChBV,EAAO,OAASU,EAAQ,MACxBV,EAAO,SAAWW,EAClBX,EAAO,aAAeY,EACtBZ,EAAO,MAAQa,EACfb,EAAO,MAAQa,EAAO,IACtBb,EAAO,UAAYc,EACnBd,EAAO,MAAQe,EACff,EAAO,MAAQA,EAER,IAAMG,GAAUH,EAAO,QACjBgB,GAAahB,EAAO,WACpBiB,GAAMjB,EAAO,IACbkB,GAAalB,EAAO,WACpBmB,GAAcnB,EAAO,YACrBoB,GAAQpB,EACRqB,GAASX,EAAQ,MACjBY,GAAQT,EAAO", + "names": ["marked_exports", "__export", "_Hooks", "_Lexer", "Marked", "_Parser", "_Renderer", "_TextRenderer", "_Tokenizer", "_defaults", "_getDefaults", "lexer", "marked", "options", "parse", "parseInline", "parser", "setOptions", "use", "walkTokens", "__toCommonJS", "_getDefaults", "_defaults", "changeDefaults", "newDefaults", "noopTest", "edit", "regex", "opt", "source", "obj", "name", "val", "valSource", "other", "supportsLookbehind", "bull", "indent", "newline", "blockCode", "fences", "hr", "heading", "bullet", "lheadingCore", "lheading", "lheadingGfm", "_paragraph", "blockText", "_blockLabel", "def", "list", "_tag", "_comment", "html", "paragraph", "blockquote", "blockNormal", "gfmTable", "blockGfm", "blockPedantic", "escape", "inlineCode", "br", "inlineText", "_punctuation", "_punctuationOrSpace", "_notPunctuationOrSpace", "punctuation", "_punctuationGfmStrongEm", "_punctuationOrSpaceGfmStrongEm", "_notPunctuationOrSpaceGfmStrongEm", "blockSkip", "emStrongLDelimCore", "emStrongLDelim", "emStrongLDelimGfm", "emStrongRDelimAstCore", "emStrongRDelimAst", "emStrongRDelimAstGfm", "emStrongRDelimUnd", "anyPunctuation", "autolink", "_inlineComment", "tag", "_inlineLabel", "link", "reflink", "nolink", "reflinkSearch", "_caseInsensitiveProtocol", "inlineNormal", "inlinePedantic", "inlineGfm", "inlineBreaks", "block", "inline", "escapeReplacements", "getEscapeReplacement", "ch", "escape", "html", "encode", "other", "cleanUrl", "href", "other", "splitCells", "tableRow", "count", "row", "match", "offset", "str", "escaped", "curr", "cells", "i", "rtrim", "c", "invert", "l", "suffLen", "currChar", "findClosingBracket", "b", "level", "outputLink", "cap", "link", "raw", "lexer", "rules", "href", "title", "text", "token", "indentCodeCompensation", "matchIndentToCode", "indentToCode", "node", "matchIndentInNode", "indentInNode", "_Tokenizer", "options", "_defaults", "src", "rtrim", "trimmed", "lines", "tokens", "inBlockquote", "currentLines", "i", "currentRaw", "currentText", "top", "lastToken", "oldToken", "newText", "newToken", "bull", "isordered", "list", "itemRegex", "endsWithBlankLine", "endEarly", "itemContents", "line", "t", "nextLine", "blankLine", "indent", "nextBulletRegex", "hrRegex", "fencesBeginRegex", "headingBeginRegex", "htmlBeginRegex", "rawLine", "nextLineWithoutTabs", "istask", "ischecked", "lastItem", "spacers", "hasMultipleLineBreaks", "tag", "headers", "splitCells", "aligns", "rows", "item", "align", "row", "cell", "trimmedUrl", "rtrimSlash", "lastParenIndex", "findClosingBracket", "linkLen", "links", "linkString", "maskedSrc", "prevChar", "match", "lLength", "rDelim", "rLength", "delimTotal", "midDelimTotal", "endReg", "lastCharLength", "hasNonSpaceChars", "hasSpaceCharsOnBothEnds", "prevCapZero", "escaped", "_Lexer", "__Lexer", "options", "_defaults", "_Tokenizer", "rules", "other", "block", "inline", "src", "i", "next", "tokens", "lastParagraphClipped", "token", "extTokenizer", "lastToken", "cutSrc", "startIndex", "tempSrc", "tempStart", "getStartIndex", "errMsg", "maskedSrc", "match", "links", "offset", "keepPrevChar", "prevChar", "_Renderer", "options", "_defaults", "token", "text", "lang", "escaped", "langString", "other", "code", "escape", "tokens", "depth", "ordered", "start", "body", "j", "item", "type", "startAttr", "itemBody", "checkbox", "checked", "header", "cell", "row", "k", "content", "href", "title", "cleanHref", "cleanUrl", "out", "_TextRenderer", "text", "_Parser", "__Parser", "options", "_defaults", "_Renderer", "_TextRenderer", "tokens", "top", "out", "i", "anyToken", "genericToken", "ret", "token", "textToken", "body", "errMsg", "renderer", "_Hooks", "options", "_defaults", "markdown", "html", "tokens", "src", "_Lexer", "_Parser", "Marked", "_getDefaults", "_Parser", "_Renderer", "_TextRenderer", "_Lexer", "_Tokenizer", "_Hooks", "args", "tokens", "callback", "values", "token", "tableToken", "cell", "row", "listToken", "genericToken", "childTokens", "extensions", "pack", "opts", "ext", "prevRenderer", "ret", "extLevel", "renderer", "prop", "rendererProp", "rendererFunc", "tokenizer", "tokenizerProp", "tokenizerFunc", "prevTokenizer", "hooks", "hooksProp", "hooksFunc", "prevHook", "arg", "walkTokens", "packWalktokens", "opt", "src", "options", "blockType", "origOpt", "throwError", "processedSrc", "processedTokens", "html", "e", "silent", "async", "msg", "escape", "markedInstance", "Marked", "marked", "src", "opt", "options", "changeDefaults", "_getDefaults", "_defaults", "args", "tokens", "callback", "_Parser", "_Renderer", "_TextRenderer", "_Lexer", "_Tokenizer", "_Hooks", "setOptions", "use", "walkTokens", "parseInline", "parse", "parser", "lexer"] +} diff --git a/tools/ui/node_modules/marked/man/marked.1 b/tools/ui/node_modules/marked/man/marked.1 new file mode 100644 index 0000000000000000000000000000000000000000..10b3a2911bff4ab53d1654f854ce249317b0039e --- /dev/null +++ b/tools/ui/node_modules/marked/man/marked.1 @@ -0,0 +1,113 @@ +.TH "MARKED" "1" "November 2025" "16.4.1" +.SH "NAME" +\fBmarked\fR \- a javascript markdown parser +.SH SYNOPSIS +.P +\fBmarked\fP [\fB\-o\fP ] [\fB\-i\fP ] [\fB\-s\fP ] [\fB\-c\fP ] [\fB\-\-help\fP] [\fB\-\-version\fP] [\fB\-\-tokens\fP] [\fB\-\-no\-clobber\fP] [\fB\-\-pedantic\fP] [\fB\-\-gfm\fP] [\fB\-\-breaks\fP] [\fB\-\-no\-etc\.\.\.\fP] [\fB\-\-silent\fP] [filename] +.SH DESCRIPTION +.P +marked is a full\-featured javascript markdown parser, built for speed\. +.br +It also includes multiple GFM features\. +.SH EXAMPLES +.RS 2 +.nf +cat in\.md | marked > out\.html +.fi +.RE +.RS 2 +.nf +echo "hello *world*" | marked +.fi +.RE +.RS 2 +.nf +marked \-o out\.html \-i in\.md \-\-gfm +.fi +.RE +.RS 2 +.nf +marked \-\-output="hello world\.html" \-i in\.md \-\-no\-breaks +.fi +.RE +.SH OPTIONS + +.RS 1 +.IP \(bu 2 +\-o, \-\-output [output file] +.br +Specify file output\. If none is specified, write to stdout\. +.IP \(bu 2 +\-i, \-\-input [input file] +.br +Specify file input, otherwise use last argument as input file\. +.br +If no input file is specified, read from stdin\. +.IP \(bu 2 +\-s, \-\-string [markdown string] +.br +Specify string input instead of a file\. +.IP \(bu 2 +\-c, \-\-config [config file] +.br +Specify config file to use instead of the default \fB~/\.marked\.json\fP or \fB~/\.marked\.js\fP or \fB~/\.marked/index\.js\fP\|\. +.IP \(bu 2 +\-t, \-\-tokens +.br +Output a token list instead of html\. +.IP \(bu 2 +\-n, \-\-no\-clobber +.br +Do not overwrite \fBoutput\fP if it exists\. +.IP \(bu 2 +\-\-pedantic +.br +Conform to obscure parts of markdown\.pl as much as possible\. +.br +Don't fix original markdown bugs\. +.IP \(bu 2 +\-\-gfm +.br +Enable github flavored markdown\. +.IP \(bu 2 +\-\-breaks +.br +Enable GFM line breaks\. Only works with the gfm option\. +.IP \(bu 2 +\-\-no\-breaks, \-no\-etc\.\.\. +.br +The inverse of any of the marked options above\. +.IP \(bu 2 +\-\-silent +.br +Silence error output\. +.IP \(bu 2 +\-h, \-\-help +.br +Display help information\. + +.RE +.SH CONFIGURATION +.P +For configuring and running programmatically\. +.P +Example +.RS 2 +.nf +import { Marked } from 'marked'; +const marked = new Marked({ gfm: true }); +marked\.parse('*foo*'); +.fi +.RE +.SH BUGS +.P +Please report any bugs to https://github.com/markedjs/marked +.SH LICENSE +.P +Copyright (c) 2018+, MarkedJS\. (MIT License) +.br +Copyright (c) 2011\-2018, Christopher Jeffrey\. (MIT License) +.SH SEE ALSO +.P +markdown(1), nodejs(1) + diff --git a/tools/ui/node_modules/marked/man/marked.1.md b/tools/ui/node_modules/marked/man/marked.1.md new file mode 100644 index 0000000000000000000000000000000000000000..0275511228bc7570be18921cf923cbc1ac633d5b --- /dev/null +++ b/tools/ui/node_modules/marked/man/marked.1.md @@ -0,0 +1,93 @@ +# marked(1) -- a javascript markdown parser + +## SYNOPSIS + +`marked` [`-o` ] [`-i` ] [`-s` ] [`-c` ] [`--help`] [`--version`] [`--tokens`] [`--no-clobber`] [`--pedantic`] [`--gfm`] [`--breaks`] [`--no-etc...`] [`--silent`] [filename] + +## DESCRIPTION + +marked is a full-featured javascript markdown parser, built for speed. +It also includes multiple GFM features. + +## EXAMPLES + +```sh +cat in.md | marked > out.html +``` + +```sh +echo "hello *world*" | marked +``` + +```sh +marked -o out.html -i in.md --gfm +``` + +```sh +marked --output="hello world.html" -i in.md --no-breaks +``` + +## OPTIONS + +* -o, --output [output file] +Specify file output. If none is specified, write to stdout. + +* -i, --input [input file] +Specify file input, otherwise use last argument as input file. +If no input file is specified, read from stdin. + +* -s, --string [markdown string] +Specify string input instead of a file. + +* -c, --config [config file] +Specify config file to use instead of the default `~/.marked.json` or `~/.marked.js` or `~/.marked/index.js`. + +* -t, --tokens +Output a token list instead of html. + +* -n, --no-clobber +Do not overwrite `output` if it exists. + +* --pedantic +Conform to obscure parts of markdown.pl as much as possible. +Don't fix original markdown bugs. + +* --gfm +Enable github flavored markdown. + +* --breaks +Enable GFM line breaks. Only works with the gfm option. + +* --no-breaks, -no-etc... +The inverse of any of the marked options above. + +* --silent +Silence error output. + +* -h, --help +Display help information. + +## CONFIGURATION + +For configuring and running programmatically. + +Example + +```js +import { Marked } from 'marked'; +const marked = new Marked({ gfm: true }); +marked.parse('*foo*'); +``` + +## BUGS + +Please report any bugs to . + +## LICENSE + +Copyright (c) 2018+, MarkedJS. (MIT License) +Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + +## SEE ALSO + +markdown(1), nodejs(1) diff --git a/tools/ui/node_modules/marked/package.json b/tools/ui/node_modules/marked/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9c3ba4619331db9496dd070fe71e28c048cfec63 --- /dev/null +++ b/tools/ui/node_modules/marked/package.json @@ -0,0 +1,103 @@ +{ + "name": "marked", + "description": "A markdown parser built for speed", + "author": "Christopher Jeffrey", + "version": "16.4.2", + "type": "module", + "main": "./lib/marked.esm.js", + "module": "./lib/marked.esm.js", + "browser": "./lib/marked.umd.js", + "types": "./lib/marked.d.ts", + "bin": { + "marked": "bin/marked.js" + }, + "man": "./man/marked.1", + "files": [ + "bin/", + "lib/", + "man/" + ], + "exports": { + ".": { + "types": "./lib/marked.d.ts", + "default": "./lib/marked.esm.js" + }, + "./bin/marked": "./bin/marked.js", + "./package.json": "./package.json" + }, + "publishConfig": { + "provenance": true + }, + "repository": { + "type": "git", + "url": "git://github.com/markedjs/marked.git" + }, + "homepage": "https://marked.js.org", + "bugs": { + "url": "http://github.com/markedjs/marked/issues" + }, + "license": "MIT", + "keywords": [ + "markdown", + "markup", + "html" + ], + "tags": [ + "markdown", + "markup", + "html" + ], + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@markedjs/eslint-config": "^1.0.12", + "@markedjs/testutils": "15.0.11-0", + "@semantic-release/commit-analyzer": "^13.0.1", + "@semantic-release/git": "^10.0.1", + "@semantic-release/github": "^12.0.1", + "@semantic-release/npm": "^13.1.1", + "@semantic-release/release-notes-generator": "^14.1.0", + "cheerio": "1.1.2", + "commonmark": "0.31.2", + "cross-env": "^10.1.0", + "dts-bundle-generator": "^9.5.1", + "esbuild": "^0.25.12", + "esbuild-plugin-umd-wrapper": "^3.0.0", + "eslint": "^9.39.0", + "highlight.js": "^11.11.1", + "markdown-it": "14.1.0", + "marked-highlight": "^2.2.2", + "marked-man": "^2.1.0", + "recheck": "^4.5.0", + "rimraf": "^6.1.0", + "semantic-release": "^25.0.1", + "titleize": "^4.0.0", + "tslib": "^2.8.1", + "typescript": "5.9.3" + }, + "scripts": { + "bench": "npm run build && node test/bench.js", + "build": "npm run build:esbuild && npm run build:types && npm run build:man", + "build:docs": "npm run build && node docs/build.js", + "build:esbuild": "node esbuild.config.js", + "build:man": "marked-man man/marked.1.md > man/marked.1", + "build:reset": "rimraf ./lib ./public", + "build:types": "tsc && dts-bundle-generator --export-referenced-types --project tsconfig.json -o lib/marked.d.ts src/marked.ts", + "lint": "eslint --fix", + "rules": "node test/rules.js", + "test": "npm run build:reset && npm run build:docs && npm run test:specs && npm run test:unit && npm run test:umd && npm run test:cjs && npm run test:types && npm run test:lint", + "test:cjs": "node test/cjs-test.cjs", + "test:lint": "eslint", + "test:only": "npm run build && npm run test:specs:only && npm run test:unit:only", + "test:redos": "node test/recheck.js > vuln.js", + "test:specs:only": "node --test --test-only --test-reporter=spec test/run-spec-tests.js", + "test:specs": "node --test --test-reporter=spec test/run-spec-tests.js", + "test:types": "tsc --project tsconfig-type-test.json && attw -P --entrypoints . --profile esm-only", + "test:umd": "node test/umd-test.js", + "test:unit:only": "node --test --test-only --test-reporter=spec test/unit/*.test.js", + "test:unit": "node --test --test-reporter=spec test/unit/*.test.js", + "test:update": "node test/update-specs.js" + }, + "engines": { + "node": ">= 20" + } +} diff --git a/tools/ui/node_modules/math-intrinsics/.eslintrc b/tools/ui/node_modules/math-intrinsics/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..d90a1bc657a8c3b85c939c7b20e4ed4e4aba4ab0 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/tools/ui/node_modules/math-intrinsics/.github/FUNDING.yml b/tools/ui/node_modules/math-intrinsics/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..868f4ff4876eb4b02fd44c608e135cf6462895e2 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/math-intrinsics +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/tools/ui/node_modules/math-intrinsics/CHANGELOG.md b/tools/ui/node_modules/math-intrinsics/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..9cf48f5a1421c943f38a21bbf05efc249fb53a41 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/es-shims/math-intrinsics/compare/v1.0.0...v1.1.0) - 2024-12-18 + +### Commits + +- [New] add `round` [`7cfb044`](https://github.com/es-shims/math-intrinsics/commit/7cfb04460c0fbdf1ca101eecbac3f59d11994130) +- [Tests] add attw [`e96be8f`](https://github.com/es-shims/math-intrinsics/commit/e96be8fbf58449eafe976446a0470e6ea561ad8d) +- [Dev Deps] update `@types/tape` [`30d0023`](https://github.com/es-shims/math-intrinsics/commit/30d00234ce8a3fa0094a61cd55d6686eb91e36ec) + +## v1.0.0 - 2024-12-11 + +### Commits + +- Initial implementation, tests, readme, types [`b898caa`](https://github.com/es-shims/math-intrinsics/commit/b898caae94e9994a94a42b8740f7bbcfd0a868fe) +- Initial commit [`02745b0`](https://github.com/es-shims/math-intrinsics/commit/02745b03a62255af8a332771987b55d127538d9c) +- [New] add `constants/maxArrayLength`, `mod` [`b978178`](https://github.com/es-shims/math-intrinsics/commit/b978178a57685bd23ed1c7efe2137f3784f5fcc5) +- npm init [`a39fc57`](https://github.com/es-shims/math-intrinsics/commit/a39fc57e5639a645d0bd52a0dc56202480223be2) +- Only apps should have lockfiles [`9451580`](https://github.com/es-shims/math-intrinsics/commit/94515800fb34db4f3cc7e99290042d45609ac7bd) diff --git a/tools/ui/node_modules/math-intrinsics/LICENSE b/tools/ui/node_modules/math-intrinsics/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..34995e79d1528aaceca7d38f323df52514ba7d0f --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/math-intrinsics/README.md b/tools/ui/node_modules/math-intrinsics/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4a66dcf24e0b17dce66d4742994e726e5c45439a --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/README.md @@ -0,0 +1,50 @@ +# math-intrinsics [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Math-related intrinsics and helpers, robustly cached. + + - `abs` + - `floor` + - `isFinite` + - `isInteger` + - `isNaN` + - `isNegativeZero` + - `max` + - `min` + - `mod` + - `pow` + - `round` + - `sign` + - `constants/maxArrayLength` + - `constants/maxSafeInteger` + - `constants/maxValue` + + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/math-intrinsics +[npm-version-svg]: https://versionbadg.es/es-shims/math-intrinsics.svg +[deps-svg]: https://david-dm.org/es-shims/math-intrinsics.svg +[deps-url]: https://david-dm.org/es-shims/math-intrinsics +[dev-deps-svg]: https://david-dm.org/es-shims/math-intrinsics/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/math-intrinsics#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/math-intrinsics.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/math-intrinsics.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=math-intrinsics +[codecov-image]: https://codecov.io/gh/es-shims/math-intrinsics/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/math-intrinsics/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/math-intrinsics +[actions-url]: https://github.com/es-shims/math-intrinsics/actions diff --git a/tools/ui/node_modules/math-intrinsics/abs.d.ts b/tools/ui/node_modules/math-intrinsics/abs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..14ad9c699397bcc9818453c0b1b07996c1f6ee41 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/abs.d.ts @@ -0,0 +1 @@ +export = Math.abs; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/abs.js b/tools/ui/node_modules/math-intrinsics/abs.js new file mode 100644 index 0000000000000000000000000000000000000000..a751424cdcdd37aab366b9ed966e1ed9651308f5 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/abs.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./abs')} */ +module.exports = Math.abs; diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.d.ts b/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b92d46be2cd3dc21c004f16a9196d2bccbba16cc --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.d.ts @@ -0,0 +1,3 @@ +declare const MAX_ARRAY_LENGTH: 4294967295; + +export = MAX_ARRAY_LENGTH; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.js b/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.js new file mode 100644 index 0000000000000000000000000000000000000000..cfc6affd0ab67ba717dfd79219fdf32716d07d0e --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxArrayLength.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./maxArrayLength')} */ +module.exports = 4294967295; // Math.pow(2, 32) - 1; diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts b/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fee3f621ed517b821371decc956f3fa83bd3a45c --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts @@ -0,0 +1,3 @@ +declare const MAX_SAFE_INTEGER: 9007199254740991; + +export = MAX_SAFE_INTEGER; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.js b/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..b568ad393bd22da735d31af78462946a86d720f8 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxSafeInteger.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxSafeInteger')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxSafeInteger')} */ (Number.MAX_SAFE_INTEGER) || 9007199254740991; // Math.pow(2, 53) - 1; diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxValue.d.ts b/tools/ui/node_modules/math-intrinsics/constants/maxValue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..292cb827153b6dd5483406bf937d78db8130fa0b --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxValue.d.ts @@ -0,0 +1,3 @@ +declare const MAX_VALUE: 1.7976931348623157e+308; + +export = MAX_VALUE; diff --git a/tools/ui/node_modules/math-intrinsics/constants/maxValue.js b/tools/ui/node_modules/math-intrinsics/constants/maxValue.js new file mode 100644 index 0000000000000000000000000000000000000000..a2202dc39767adad11f1df67b2ffabba8aaf9cbd --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/constants/maxValue.js @@ -0,0 +1,5 @@ +'use strict'; + +/** @type {import('./maxValue')} */ +// eslint-disable-next-line no-extra-parens +module.exports = /** @type {import('./maxValue')} */ (Number.MAX_VALUE) || 1.7976931348623157e+308; diff --git a/tools/ui/node_modules/math-intrinsics/floor.d.ts b/tools/ui/node_modules/math-intrinsics/floor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9265236f288b7da2345b73a3bc290a6385d2b356 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/floor.d.ts @@ -0,0 +1 @@ +export = Math.floor; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/floor.js b/tools/ui/node_modules/math-intrinsics/floor.js new file mode 100644 index 0000000000000000000000000000000000000000..ab0e5d7dcd43056d5d5288de0d08ca4177efb2db --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/floor.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./floor')} */ +module.exports = Math.floor; diff --git a/tools/ui/node_modules/math-intrinsics/isFinite.d.ts b/tools/ui/node_modules/math-intrinsics/isFinite.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6daae331f18e427d1057c96c8ca75d6c6c3fd211 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isFinite.d.ts @@ -0,0 +1,3 @@ +declare function isFinite(x: unknown): x is number | bigint; + +export = isFinite; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/isFinite.js b/tools/ui/node_modules/math-intrinsics/isFinite.js new file mode 100644 index 0000000000000000000000000000000000000000..b201a5a523ed18bde69edd3b3deff3b63c463120 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isFinite.js @@ -0,0 +1,12 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./isFinite')} */ +module.exports = function isFinite(x) { + return (typeof x === 'number' || typeof x === 'bigint') + && !$isNaN(x) + && x !== Infinity + && x !== -Infinity; +}; + diff --git a/tools/ui/node_modules/math-intrinsics/isInteger.d.ts b/tools/ui/node_modules/math-intrinsics/isInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..13935a8ccf78a105bc508e4c8f88b9888f57f1b1 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isInteger.d.ts @@ -0,0 +1,3 @@ +declare function isInteger(argument: unknown): argument is number; + +export = isInteger; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/isInteger.js b/tools/ui/node_modules/math-intrinsics/isInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..4b1b9a56d1bba183cc75a616ece707489901d4a8 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isInteger.js @@ -0,0 +1,16 @@ +'use strict'; + +var $abs = require('./abs'); +var $floor = require('./floor'); + +var $isNaN = require('./isNaN'); +var $isFinite = require('./isFinite'); + +/** @type {import('./isInteger')} */ +module.exports = function isInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var absValue = $abs(argument); + return $floor(absValue) === absValue; +}; diff --git a/tools/ui/node_modules/math-intrinsics/isNaN.d.ts b/tools/ui/node_modules/math-intrinsics/isNaN.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1d4c552456bde706a914f901e9ccd523ac44e7d --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isNaN.d.ts @@ -0,0 +1 @@ +export = Number.isNaN; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/isNaN.js b/tools/ui/node_modules/math-intrinsics/isNaN.js new file mode 100644 index 0000000000000000000000000000000000000000..e36475cf878ca6beda4dfd1cd3881759b72270c6 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isNaN.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNaN')} */ +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; diff --git a/tools/ui/node_modules/math-intrinsics/isNegativeZero.d.ts b/tools/ui/node_modules/math-intrinsics/isNegativeZero.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ad88193e1f3599ebce7e63ed97854895fe87f33 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isNegativeZero.d.ts @@ -0,0 +1,3 @@ +declare function isNegativeZero(x: unknown): boolean; + +export = isNegativeZero; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/isNegativeZero.js b/tools/ui/node_modules/math-intrinsics/isNegativeZero.js new file mode 100644 index 0000000000000000000000000000000000000000..b69adcc5a7f190f38c6907584432368e77d097d0 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/isNegativeZero.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isNegativeZero')} */ +module.exports = function isNegativeZero(x) { + return x === 0 && 1 / x === 1 / -0; +}; diff --git a/tools/ui/node_modules/math-intrinsics/max.d.ts b/tools/ui/node_modules/math-intrinsics/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad6f43e35f4a342bcac73ec92226b342f282097e --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/max.d.ts @@ -0,0 +1 @@ +export = Math.max; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/max.js b/tools/ui/node_modules/math-intrinsics/max.js new file mode 100644 index 0000000000000000000000000000000000000000..edb55dfbca86a881da139244122c4f734d6a5844 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/max.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./max')} */ +module.exports = Math.max; diff --git a/tools/ui/node_modules/math-intrinsics/min.d.ts b/tools/ui/node_modules/math-intrinsics/min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd90f2d504422b14fbe14393fabdc0fc0a8db6a0 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/min.d.ts @@ -0,0 +1 @@ +export = Math.min; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/min.js b/tools/ui/node_modules/math-intrinsics/min.js new file mode 100644 index 0000000000000000000000000000000000000000..5a4a7c7149a79f113c536e08888acc70213674e8 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/min.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./min')} */ +module.exports = Math.min; diff --git a/tools/ui/node_modules/math-intrinsics/mod.d.ts b/tools/ui/node_modules/math-intrinsics/mod.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..549dbd46e5a4c1df5f6d75e11e690d6dc8758421 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/mod.d.ts @@ -0,0 +1,3 @@ +declare function mod(number: number, modulo: number): number; + +export = mod; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/mod.js b/tools/ui/node_modules/math-intrinsics/mod.js new file mode 100644 index 0000000000000000000000000000000000000000..4a98362baf165d9190ab6bc7b627daeaad6fac8c --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/mod.js @@ -0,0 +1,9 @@ +'use strict'; + +var $floor = require('./floor'); + +/** @type {import('./mod')} */ +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return $floor(remain >= 0 ? remain : remain + modulo); +}; diff --git a/tools/ui/node_modules/math-intrinsics/package.json b/tools/ui/node_modules/math-intrinsics/package.json new file mode 100644 index 0000000000000000000000000000000000000000..067627354b768e180e286f8c2efdb0c35a188e52 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/package.json @@ -0,0 +1,86 @@ +{ + "name": "math-intrinsics", + "version": "1.1.0", + "description": "ES Math-related intrinsics and helpers, robustly cached.", + "main": false, + "exports": { + "./abs": "./abs.js", + "./floor": "./floor.js", + "./isFinite": "./isFinite.js", + "./isInteger": "./isInteger.js", + "./isNaN": "./isNaN.js", + "./isNegativeZero": "./isNegativeZero.js", + "./max": "./max.js", + "./min": "./min.js", + "./mod": "./mod.js", + "./pow": "./pow.js", + "./sign": "./sign.js", + "./round": "./round.js", + "./constants/maxArrayLength": "./constants/maxArrayLength.js", + "./constants/maxSafeInteger": "./constants/maxSafeInteger.js", + "./constants/maxValue": "./constants/maxValue.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>= 10.2' audit --production", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/math-intrinsics.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/math-intrinsics/issues" + }, + "homepage": "https://github.com/es-shims/math-intrinsics#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.5.0", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/tools/ui/node_modules/math-intrinsics/pow.d.ts b/tools/ui/node_modules/math-intrinsics/pow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5873c441e62a88335b478b30de3c2a319b945520 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/pow.d.ts @@ -0,0 +1 @@ +export = Math.pow; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/pow.js b/tools/ui/node_modules/math-intrinsics/pow.js new file mode 100644 index 0000000000000000000000000000000000000000..c0a4103811f69cdfefb43e1fd0a5a866da3c0cd9 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/pow.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./pow')} */ +module.exports = Math.pow; diff --git a/tools/ui/node_modules/math-intrinsics/round.d.ts b/tools/ui/node_modules/math-intrinsics/round.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da1fde3f638b9a9a3db026668427ae9cde5bbcb7 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/round.d.ts @@ -0,0 +1 @@ +export = Math.round; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/round.js b/tools/ui/node_modules/math-intrinsics/round.js new file mode 100644 index 0000000000000000000000000000000000000000..b79215663a657631fd01aef3d95dbffac635b707 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/round.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./round')} */ +module.exports = Math.round; diff --git a/tools/ui/node_modules/math-intrinsics/sign.d.ts b/tools/ui/node_modules/math-intrinsics/sign.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c49cecaa240c415345f455f2e4fbed99015c1713 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/sign.d.ts @@ -0,0 +1,3 @@ +declare function sign(x: number): number; + +export = sign; \ No newline at end of file diff --git a/tools/ui/node_modules/math-intrinsics/sign.js b/tools/ui/node_modules/math-intrinsics/sign.js new file mode 100644 index 0000000000000000000000000000000000000000..9e5173c80da67de620a9b3a769936d77bf68ba73 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/sign.js @@ -0,0 +1,11 @@ +'use strict'; + +var $isNaN = require('./isNaN'); + +/** @type {import('./sign')} */ +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; diff --git a/tools/ui/node_modules/math-intrinsics/test/index.js b/tools/ui/node_modules/math-intrinsics/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0f90a5dc0f5f107d65a4b8d3f79711b8b1d5a6f7 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/test/index.js @@ -0,0 +1,192 @@ +'use strict'; + +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); +var inspect = require('object-inspect'); + +var abs = require('../abs'); +var floor = require('../floor'); +var isFinite = require('../isFinite'); +var isInteger = require('../isInteger'); +var isNaN = require('../isNaN'); +var isNegativeZero = require('../isNegativeZero'); +var max = require('../max'); +var min = require('../min'); +var mod = require('../mod'); +var pow = require('../pow'); +var round = require('../round'); +var sign = require('../sign'); + +var maxArrayLength = require('../constants/maxArrayLength'); +var maxSafeInteger = require('../constants/maxSafeInteger'); +var maxValue = require('../constants/maxValue'); + +test('abs', function (t) { + t.equal(abs(-1), 1, 'abs(-1) === 1'); + t.equal(abs(+1), 1, 'abs(+1) === 1'); + t.equal(abs(+0), +0, 'abs(+0) === +0'); + t.equal(abs(-0), +0, 'abs(-0) === +0'); + + t.end(); +}); + +test('floor', function (t) { + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(+1.1), 1, 'floor(+1.1) === 1'); + t.equal(floor(+0), +0, 'floor(+0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(-Infinity), -Infinity, 'floor(-Infinity) === -Infinity'); + t.equal(floor(Number(Infinity)), Number(Infinity), 'floor(+Infinity) === +Infinity'); + t.equal(floor(NaN), NaN, 'floor(NaN) === NaN'); + t.equal(floor(0), +0, 'floor(0) === +0'); + t.equal(floor(-0), -0, 'floor(-0) === -0'); + t.equal(floor(1), 1, 'floor(1) === 1'); + t.equal(floor(-1), -1, 'floor(-1) === -1'); + t.equal(floor(1.1), 1, 'floor(1.1) === 1'); + t.equal(floor(-1.1), -2, 'floor(-1.1) === -2'); + t.equal(floor(maxValue), maxValue, 'floor(maxValue) === maxValue'); + t.equal(floor(maxSafeInteger), maxSafeInteger, 'floor(maxSafeInteger) === maxSafeInteger'); + + t.end(); +}); + +test('isFinite', function (t) { + t.equal(isFinite(0), true, 'isFinite(+0) === true'); + t.equal(isFinite(-0), true, 'isFinite(-0) === true'); + t.equal(isFinite(1), true, 'isFinite(1) === true'); + t.equal(isFinite(Infinity), false, 'isFinite(Infinity) === false'); + t.equal(isFinite(-Infinity), false, 'isFinite(-Infinity) === false'); + t.equal(isFinite(NaN), false, 'isFinite(NaN) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isFinite(nonNumber), false, 'isFinite(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('isInteger', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.nonIntegerNumbers + ), function (nonInteger) { + t.equal(isInteger(nonInteger), false, 'isInteger(' + inspect(nonInteger) + ') === false'); + }); + + t.end(); +}); + +test('isNaN', function (t) { + forEach([].concat( + // @ts-expect-error TS sucks with concat + v.nonNumbers, + v.infinities, + v.zeroes, + v.integerNumbers + ), function (nonNaN) { + t.equal(isNaN(nonNaN), false, 'isNaN(' + inspect(nonNaN) + ') === false'); + }); + + t.equal(isNaN(NaN), true, 'isNaN(NaN) === true'); + + t.end(); +}); + +test('isNegativeZero', function (t) { + t.equal(isNegativeZero(-0), true, 'isNegativeZero(-0) === true'); + t.equal(isNegativeZero(+0), false, 'isNegativeZero(+0) === false'); + t.equal(isNegativeZero(1), false, 'isNegativeZero(1) === false'); + t.equal(isNegativeZero(-1), false, 'isNegativeZero(-1) === false'); + t.equal(isNegativeZero(NaN), false, 'isNegativeZero(NaN) === false'); + t.equal(isNegativeZero(Infinity), false, 'isNegativeZero(Infinity) === false'); + t.equal(isNegativeZero(-Infinity), false, 'isNegativeZero(-Infinity) === false'); + + forEach(v.nonNumbers, function (nonNumber) { + t.equal(isNegativeZero(nonNumber), false, 'isNegativeZero(' + inspect(nonNumber) + ') === false'); + }); + + t.end(); +}); + +test('max', function (t) { + t.equal(max(1, 2), 2, 'max(1, 2) === 2'); + t.equal(max(1, 2, 3), 3, 'max(1, 2, 3) === 3'); + t.equal(max(1, 2, 3, 4), 4, 'max(1, 2, 3, 4) === 4'); + t.equal(max(1, 2, 3, 4, 5), 5, 'max(1, 2, 3, 4, 5) === 5'); + t.equal(max(1, 2, 3, 4, 5, 6), 6, 'max(1, 2, 3, 4, 5, 6) === 6'); + t.equal(max(1, 2, 3, 4, 5, 6, 7), 7, 'max(1, 2, 3, 4, 5, 6, 7) === 7'); + + t.end(); +}); + +test('min', function (t) { + t.equal(min(1, 2), 1, 'min(1, 2) === 1'); + t.equal(min(1, 2, 3), 1, 'min(1, 2, 3) === 1'); + t.equal(min(1, 2, 3, 4), 1, 'min(1, 2, 3, 4) === 1'); + t.equal(min(1, 2, 3, 4, 5), 1, 'min(1, 2, 3, 4, 5) === 1'); + t.equal(min(1, 2, 3, 4, 5, 6), 1, 'min(1, 2, 3, 4, 5, 6) === 1'); + + t.end(); +}); + +test('mod', function (t) { + t.equal(mod(1, 2), 1, 'mod(1, 2) === 1'); + t.equal(mod(2, 2), 0, 'mod(2, 2) === 0'); + t.equal(mod(3, 2), 1, 'mod(3, 2) === 1'); + t.equal(mod(4, 2), 0, 'mod(4, 2) === 0'); + t.equal(mod(5, 2), 1, 'mod(5, 2) === 1'); + t.equal(mod(6, 2), 0, 'mod(6, 2) === 0'); + t.equal(mod(7, 2), 1, 'mod(7, 2) === 1'); + t.equal(mod(8, 2), 0, 'mod(8, 2) === 0'); + t.equal(mod(9, 2), 1, 'mod(9, 2) === 1'); + t.equal(mod(10, 2), 0, 'mod(10, 2) === 0'); + t.equal(mod(11, 2), 1, 'mod(11, 2) === 1'); + + t.end(); +}); + +test('pow', function (t) { + t.equal(pow(2, 2), 4, 'pow(2, 2) === 4'); + t.equal(pow(2, 3), 8, 'pow(2, 3) === 8'); + t.equal(pow(2, 4), 16, 'pow(2, 4) === 16'); + t.equal(pow(2, 5), 32, 'pow(2, 5) === 32'); + t.equal(pow(2, 6), 64, 'pow(2, 6) === 64'); + t.equal(pow(2, 7), 128, 'pow(2, 7) === 128'); + t.equal(pow(2, 8), 256, 'pow(2, 8) === 256'); + t.equal(pow(2, 9), 512, 'pow(2, 9) === 512'); + t.equal(pow(2, 10), 1024, 'pow(2, 10) === 1024'); + + t.end(); +}); + +test('round', function (t) { + t.equal(round(1.1), 1, 'round(1.1) === 1'); + t.equal(round(1.5), 2, 'round(1.5) === 2'); + t.equal(round(1.9), 2, 'round(1.9) === 2'); + + t.end(); +}); + +test('sign', function (t) { + t.equal(sign(-1), -1, 'sign(-1) === -1'); + t.equal(sign(+1), +1, 'sign(+1) === +1'); + t.equal(sign(+0), +0, 'sign(+0) === +0'); + t.equal(sign(-0), -0, 'sign(-0) === -0'); + t.equal(sign(NaN), NaN, 'sign(NaN) === NaN'); + t.equal(sign(Infinity), +1, 'sign(Infinity) === +1'); + t.equal(sign(-Infinity), -1, 'sign(-Infinity) === -1'); + t.equal(sign(maxValue), +1, 'sign(maxValue) === +1'); + t.equal(sign(maxSafeInteger), +1, 'sign(maxSafeInteger) === +1'); + + t.end(); +}); + +test('constants', function (t) { + t.equal(typeof maxArrayLength, 'number', 'typeof maxArrayLength === "number"'); + t.equal(typeof maxSafeInteger, 'number', 'typeof maxSafeInteger === "number"'); + t.equal(typeof maxValue, 'number', 'typeof maxValue === "number"'); + + t.end(); +}); diff --git a/tools/ui/node_modules/math-intrinsics/tsconfig.json b/tools/ui/node_modules/math-intrinsics/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..b131000796f0cb804c38b121021940cd962cc1a7 --- /dev/null +++ b/tools/ui/node_modules/math-intrinsics/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "@ljharb/tsconfig", +} diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts b/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc25ad44c315a932728b1c434ca6c78254d1c83d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts @@ -0,0 +1,9 @@ +export { findAndReplace } from "./lib/index.js"; +export type FindAndReplaceList = import("./lib/index.js").FindAndReplaceList; +export type FindAndReplaceTuple = import("./lib/index.js").FindAndReplaceTuple; +export type Find = import("./lib/index.js").Find; +export type Options = import("./lib/index.js").Options; +export type RegExpMatchObject = import("./lib/index.js").RegExpMatchObject; +export type ReplaceFunction = import("./lib/index.js").ReplaceFunction; +export type Replace = import("./lib/index.js").Replace; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts.map b/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ca6bcb73404aaa15b9df391b9ee6cd25577ecba1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";iCACa,OAAO,gBAAgB,EAAE,kBAAkB;kCAC3C,OAAO,gBAAgB,EAAE,mBAAmB;mBAC5C,OAAO,gBAAgB,EAAE,IAAI;sBAC7B,OAAO,gBAAgB,EAAE,OAAO;gCAChC,OAAO,gBAAgB,EAAE,iBAAiB;8BAC1C,OAAO,gBAAgB,EAAE,eAAe;sBACxC,OAAO,gBAAgB,EAAE,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/index.js b/tools/ui/node_modules/mdast-util-find-and-replace/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6273f921adb46114bc5b5b8f8323fc97afad3397 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/index.js @@ -0,0 +1,11 @@ +/** + * @typedef {import('./lib/index.js').FindAndReplaceList} FindAndReplaceList + * @typedef {import('./lib/index.js').FindAndReplaceTuple} FindAndReplaceTuple + * @typedef {import('./lib/index.js').Find} Find + * @typedef {import('./lib/index.js').Options} Options + * @typedef {import('./lib/index.js').RegExpMatchObject} RegExpMatchObject + * @typedef {import('./lib/index.js').ReplaceFunction} ReplaceFunction + * @typedef {import('./lib/index.js').Replace} Replace + */ + +export {findAndReplace} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ad560c2fabd9fe8189073c7d3bf4bb214b52947 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts @@ -0,0 +1,79 @@ +/** + * Find patterns in a tree and replace them. + * + * The algorithm searches the tree in *preorder* for complete values in `Text` + * nodes. + * Partial matches are not supported. + * + * @param {Nodes} tree + * Tree to change. + * @param {FindAndReplaceList | FindAndReplaceTuple} list + * Patterns to find. + * @param {Options | null | undefined} [options] + * Configuration (when `find` is not `Find`). + * @returns {undefined} + * Nothing. + */ +export function findAndReplace(tree: Nodes, list: FindAndReplaceList | FindAndReplaceTuple, options?: Options | null | undefined): undefined; +/** + * Info on the match. + */ +export type RegExpMatchObject = { + /** + * The index of the search at which the result was found. + */ + index: number; + /** + * A copy of the search string in the text node. + */ + input: string; + /** + * All ancestors of the text node, where the last node is the text itself. + */ + stack: [...Array, Text]; +}; +/** + * Pattern to find. + * + * Strings are escaped and then turned into global expressions. + */ +export type Find = RegExp | string; +/** + * Several find and replaces, in array form. + */ +export type FindAndReplaceList = Array; +/** + * Find and replace in tuple form. + */ +export type FindAndReplaceTuple = [Find, Replace?]; +/** + * Thing to replace with. + */ +export type Replace = ReplaceFunction | string | null | undefined; +/** + * Callback called when a search matches. + */ +export type ReplaceFunction = (...parameters: any[]) => Array | PhrasingContent | string | false | null | undefined; +/** + * Normalized find and replace. + */ +export type Pair = [RegExp, ReplaceFunction]; +/** + * All find and replaced. + */ +export type Pairs = Array; +/** + * Configuration. + */ +export type Options = { + /** + * Test for which nodes to ignore (optional). + */ + ignore?: Test | null | undefined; +}; +import type { Nodes } from 'mdast'; +import type { Parents } from 'mdast'; +import type { Text } from 'mdast'; +import type { PhrasingContent } from 'mdast'; +import type { Test } from 'unist-util-visit-parents'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7112cb3f49a25a676dd8f5088a2f2bb96e7047cf --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;GAeG;AACH,qCATW,KAAK,QAEL,kBAAkB,GAAG,mBAAmB,YAExC,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,SAAS,CA6HrB;;;;;;;;WA/La,MAAM;;;;WAEN,MAAM;;;;WAEN,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;;;;;;;mBAG1B,MAAM,GAAG,MAAM;;;;iCAKf,KAAK,CAAC,mBAAmB,CAAC;;;;kCAG1B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;;;sBAGhB,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;8CAK1C,GAAG,EAAA,KAMJ,KAAK,CAAC,eAAe,CAAC,GAAG,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS;;;;mBAQ5E,CAAC,MAAM,EAAE,eAAe,CAAC;;;;oBAGzB,KAAK,CAAC,IAAI,CAAC;;;;;;;;aAKV,IAAI,GAAG,IAAI,GAAG,SAAS;;2BApDyB,OAAO;6BAAP,OAAO;0BAAP,OAAO;qCAAP,OAAO;0BACjB,0BAA0B"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.js b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..af84ba60dd09bee196f7271555bd5ea70e870cf6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/lib/index.js @@ -0,0 +1,261 @@ +/** + * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast' + * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents' + */ + +/** + * @typedef RegExpMatchObject + * Info on the match. + * @property {number} index + * The index of the search at which the result was found. + * @property {string} input + * A copy of the search string in the text node. + * @property {[...Array, Text]} stack + * All ancestors of the text node, where the last node is the text itself. + * + * @typedef {RegExp | string} Find + * Pattern to find. + * + * Strings are escaped and then turned into global expressions. + * + * @typedef {Array} FindAndReplaceList + * Several find and replaces, in array form. + * + * @typedef {[Find, Replace?]} FindAndReplaceTuple + * Find and replace in tuple form. + * + * @typedef {ReplaceFunction | string | null | undefined} Replace + * Thing to replace with. + * + * @callback ReplaceFunction + * Callback called when a search matches. + * @param {...any} parameters + * The parameters are the result of corresponding search expression: + * + * * `value` (`string`) — whole match + * * `...capture` (`Array`) — matches from regex capture groups + * * `match` (`RegExpMatchObject`) — info on the match + * @returns {Array | PhrasingContent | string | false | null | undefined} + * Thing to replace with. + * + * * when `null`, `undefined`, `''`, remove the match + * * …or when `false`, do not replace at all + * * …or when `string`, replace with a text node of that value + * * …or when `Node` or `Array`, replace with those nodes + * + * @typedef {[RegExp, ReplaceFunction]} Pair + * Normalized find and replace. + * + * @typedef {Array} Pairs + * All find and replaced. + * + * @typedef Options + * Configuration. + * @property {Test | null | undefined} [ignore] + * Test for which nodes to ignore (optional). + */ + +import escape from 'escape-string-regexp' +import {visitParents} from 'unist-util-visit-parents' +import {convert} from 'unist-util-is' + +/** + * Find patterns in a tree and replace them. + * + * The algorithm searches the tree in *preorder* for complete values in `Text` + * nodes. + * Partial matches are not supported. + * + * @param {Nodes} tree + * Tree to change. + * @param {FindAndReplaceList | FindAndReplaceTuple} list + * Patterns to find. + * @param {Options | null | undefined} [options] + * Configuration (when `find` is not `Find`). + * @returns {undefined} + * Nothing. + */ +export function findAndReplace(tree, list, options) { + const settings = options || {} + const ignored = convert(settings.ignore || []) + const pairs = toPairs(list) + let pairIndex = -1 + + while (++pairIndex < pairs.length) { + visitParents(tree, 'text', visitor) + } + + /** @type {BuildVisitor} */ + function visitor(node, parents) { + let index = -1 + /** @type {Parents | undefined} */ + let grandparent + + while (++index < parents.length) { + const parent = parents[index] + /** @type {Array | undefined} */ + const siblings = grandparent ? grandparent.children : undefined + + if ( + ignored( + parent, + siblings ? siblings.indexOf(parent) : undefined, + grandparent + ) + ) { + return + } + + grandparent = parent + } + + if (grandparent) { + return handler(node, parents) + } + } + + /** + * Handle a text node which is not in an ignored parent. + * + * @param {Text} node + * Text node. + * @param {Array} parents + * Parents. + * @returns {VisitorResult} + * Result. + */ + function handler(node, parents) { + const parent = parents[parents.length - 1] + const find = pairs[pairIndex][0] + const replace = pairs[pairIndex][1] + let start = 0 + /** @type {Array} */ + const siblings = parent.children + const index = siblings.indexOf(node) + let change = false + /** @type {Array} */ + let nodes = [] + + find.lastIndex = 0 + + let match = find.exec(node.value) + + while (match) { + const position = match.index + /** @type {RegExpMatchObject} */ + const matchObject = { + index: match.index, + input: match.input, + stack: [...parents, node] + } + let value = replace(...match, matchObject) + + if (typeof value === 'string') { + value = value.length > 0 ? {type: 'text', value} : undefined + } + + // It wasn’t a match after all. + if (value === false) { + // False acts as if there was no match. + // So we need to reset `lastIndex`, which currently being at the end of + // the current match, to the beginning. + find.lastIndex = position + 1 + } else { + if (start !== position) { + nodes.push({ + type: 'text', + value: node.value.slice(start, position) + }) + } + + if (Array.isArray(value)) { + nodes.push(...value) + } else if (value) { + nodes.push(value) + } + + start = position + match[0].length + change = true + } + + if (!find.global) { + break + } + + match = find.exec(node.value) + } + + if (change) { + if (start < node.value.length) { + nodes.push({type: 'text', value: node.value.slice(start)}) + } + + parent.children.splice(index, 1, ...nodes) + } else { + nodes = [node] + } + + return index + nodes.length + } +} + +/** + * Turn a tuple or a list of tuples into pairs. + * + * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList + * Schema. + * @returns {Pairs} + * Clean pairs. + */ +function toPairs(tupleOrList) { + /** @type {Pairs} */ + const result = [] + + if (!Array.isArray(tupleOrList)) { + throw new TypeError('Expected find and replace tuple or list of tuples') + } + + /** @type {FindAndReplaceList} */ + // @ts-expect-error: correct. + const list = + !tupleOrList[0] || Array.isArray(tupleOrList[0]) + ? tupleOrList + : [tupleOrList] + + let index = -1 + + while (++index < list.length) { + const tuple = list[index] + result.push([toExpression(tuple[0]), toFunction(tuple[1])]) + } + + return result +} + +/** + * Turn a find into an expression. + * + * @param {Find} find + * Find. + * @returns {RegExp} + * Expression. + */ +function toExpression(find) { + return typeof find === 'string' ? new RegExp(escape(find), 'g') : find +} + +/** + * Turn a replace into a function. + * + * @param {Replace} replace + * Replace. + * @returns {ReplaceFunction} + * Function. + */ +function toFunction(replace) { + return typeof replace === 'function' + ? replace + : function () { + return replace + } +} diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/license b/tools/ui/node_modules/mdast-util-find-and-replace/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.d.ts b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8f928814c9b7f3c8036e1494aff58126bbe22a5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.d.ts @@ -0,0 +1,16 @@ +/** +Escape RegExp special characters. + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +@example +``` +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` +*/ +export default function escapeStringRegexp(string: string): string; diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9ce9323ff246d2cafb0a1c3768f49ca9b7efee13 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +export default function escapeStringRegexp(string) { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +} diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/license b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/license new file mode 100644 index 0000000000000000000000000000000000000000..fa7ceba3eb4a9657a9db7f3ffca4e4e97a9019de --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/package.json b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9390a6bd22f04aa58ca46e7bca09a7e47f49f179 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/package.json @@ -0,0 +1,40 @@ +{ + "name": "escape-string-regexp", + "version": "5.0.0", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "regular", + "expression", + "string", + "special", + "characters" + ], + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/readme.md b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..839df6e51c2a0dd867654db637a7147b18cbd2e7 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,34 @@ +# escape-string-regexp + +> Escape RegExp special characters + +## Install + +``` +$ npm install escape-string-regexp +``` + +## Usage + +```js +import escapeStringRegexp from 'escape-string-regexp'; + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +--- + +
    + + Get professional support for this package with a Tidelift subscription + +
    + + Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies. +
    +
    diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/package.json b/tools/ui/node_modules/mdast-util-find-and-replace/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0950ae27d15df72657a72e1098e63f075a28aeeb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/package.json @@ -0,0 +1,85 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/syntax-tree/mdast-util-find-and-replace/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "description": "mdast utility to find and replace text in a tree", + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-builder": "^4.0.0", + "xo": "^0.60.0" + }, + "exports": "./index.js", + "files": [ + "index.d.ts.map", + "index.d.ts", + "index.js", + "lib/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "find", + "markdown", + "mdast-util", + "mdast", + "unist", + "utility", + "util", + "replace" + ], + "license": "MIT", + "name": "mdast-util-find-and-replace", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "syntax-tree/mdast-util-find-and-replace", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov -- npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "ignoreFiles": [ + "lib/index.d.ts" + ], + "strict": true + }, + "type": "module", + "version": "3.0.2", + "xo": { + "prettier": true, + "rules": { + "unicorn/prefer-at": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-find-and-replace/readme.md b/tools/ui/node_modules/mdast-util-find-and-replace/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..810110d04559cb47ea29362e89c01784a1484196 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-find-and-replace/readme.md @@ -0,0 +1,368 @@ +# mdast-util-find-and-replace + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] utility to find and replace things. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`findAndReplace(tree, list[, options])`](#findandreplacetree-list-options) + * [`Find`](#find) + * [`FindAndReplaceList`](#findandreplacelist) + * [`FindAndReplaceTuple`](#findandreplacetuple) + * [`Options`](#options) + * [`RegExpMatchObject`](#regexpmatchobject) + * [`Replace`](#replace) + * [`ReplaceFunction`](#replacefunction) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that lets you find patterns (`string`, `RegExp`) in +text and replace them with nodes. + +## When should I use this? + +This utility is typically useful when you have regexes and want to modify mdast. +One example is when you have some form of “mentions” (such as +`/@([a-z][_a-z0-9])\b/gi`) and want to create links to persons from them. + +A similar package, [`hast-util-find-and-replace`][hast-util-find-and-replace] +does the same but on [hast][]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-find-and-replace +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {findAndReplace} from 'https://esm.sh/mdast-util-find-and-replace@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {findAndReplace} from 'mdast-util-find-and-replace' +import {u} from 'unist-builder' +import {inspect} from 'unist-util-inspect' + +const tree = u('paragraph', [ + u('text', 'Some '), + u('emphasis', [u('text', 'emphasis')]), + u('text', ' and '), + u('strong', [u('text', 'importance')]), + u('text', '.') +]) + +findAndReplace(tree, [ + [/and/gi, 'or'], + [/emphasis/gi, 'em'], + [/importance/gi, 'strong'], + [ + /Some/g, + function ($0) { + return u('link', {url: '//example.com#' + $0}, [u('text', $0)]) + } + ] +]) + +console.log(inspect(tree)) +``` + +Yields: + +```txt +paragraph[8] +├─0 link[1] +│ │ url: "//example.com#Some" +│ └─0 text "Some" +├─1 text " " +├─2 emphasis[1] +│ └─0 text "em" +├─3 text " " +├─4 text "or" +├─5 text " " +├─6 strong[1] +│ └─0 text "strong" +└─7 text "." +``` + +## API + +This package exports the identifier [`findAndReplace`][api-find-and-replace]. +There is no default export. + +### `findAndReplace(tree, list[, options])` + +Find patterns in a tree and replace them. + +The algorithm searches the tree in *[preorder][]* for complete values in +[`Text`][text] nodes. +Partial matches are not supported. + +###### Parameters + +* `tree` ([`Node`][node]) + — tree to change +* `list` ([`FindAndReplaceList`][api-find-and-replace-list] or + [`FindAndReplaceTuple`][api-find-and-replace-tuple]) + — one or more find-and-replace pairs +* `options` ([`Options`][api-options]) + — configuration + +###### Returns + +Nothing (`undefined`). + +### `Find` + +Pattern to find (TypeScript type). + +Strings are escaped and then turned into global expressions. + +###### Type + +```ts +type Find = RegExp | string +``` + +### `FindAndReplaceList` + +Several find and replaces, in array form (TypeScript type). + +###### Type + +```ts +type FindAndReplaceList = Array +``` + +See [`FindAndReplaceTuple`][api-find-and-replace-tuple]. + +### `FindAndReplaceTuple` + +Find and replace in tuple form (TypeScript type). + +###### Type + +```ts +type FindAndReplaceTuple = [Find, Replace?] +``` + +See [`Find`][api-find] and [`Replace`][api-replace]. + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `ignore` ([`Test`][test], optional) + — test for which elements to ignore + +### `RegExpMatchObject` + +Info on the match (TypeScript type). + +###### Fields + +* `index` (`number`) + — the index of the search at which the result was found +* `input` (`string`) + — a copy of the search string in the text node +* `stack` ([`Array`][node]) + — all ancestors of the text node, where the last node is the text itself + +### `Replace` + +Thing to replace with (TypeScript type). + +###### Type + +```ts +type Replace = ReplaceFunction | string +``` + +See [`ReplaceFunction`][api-replace-function]. + +### `ReplaceFunction` + +Callback called when a search matches (TypeScript type). + +###### Parameters + +The parameters are the result of corresponding search expression: + +* `value` (`string`) + — whole match +* `...capture` (`Array`) + — matches from regex capture groups +* `match` ([`RegExpMatchObject`][api-regexp-match-object]) + — info on the match + +###### Returns + +Thing to replace with: + +* when `null`, `undefined`, `''`, remove the match +* …or when `false`, do not replace at all +* …or when `string`, replace with a text node of that value +* …or when `Node` or `Array`, replace with those nodes + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types [`Find`][api-find], +[`FindAndReplaceList`][api-find-and-replace-list], +[`FindAndReplaceTuple`][api-find-and-replace-tuple], +[`Options`][api-options], +[`RegExpMatchObject`][api-regexp-match-object], +[`Replace`][api-replace], and +[`ReplaceFunction`][api-replace-function]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-find-and-replace@^3`, compatible with Node.js 16. + +## Security + +Use of `mdast-util-find-and-replace` does not involve [hast][] or user content +so there are no openings for [cross-site scripting (XSS)][xss] attacks. + +## Related + +* [`hast-util-find-and-replace`](https://github.com/syntax-tree/hast-util-find-and-replace) + — find and replace in hast +* [`hast-util-select`](https://github.com/syntax-tree/hast-util-select) + — `querySelector`, `querySelectorAll`, and `matches` +* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select) + — select unist nodes with CSS-like selectors + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organisation, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-find-and-replace/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-find-and-replace/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-find-and-replace.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-find-and-replace + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-find-and-replace.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-find-and-replace + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-find-and-replace + +[size]: https://bundlejs.com/?q=mdast-util-find-and-replace + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[hast]: https://github.com/syntax-tree/hast + +[mdast]: https://github.com/syntax-tree/mdast + +[node]: https://github.com/syntax-tree/mdast#nodes + +[preorder]: https://github.com/syntax-tree/unist#preorder + +[text]: https://github.com/syntax-tree/mdast#text + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[test]: https://github.com/syntax-tree/unist-util-is#api + +[hast-util-find-and-replace]: https://github.com/syntax-tree/hast-util-find-and-replace + +[api-find-and-replace]: #findandreplacetree-list-options + +[api-options]: #options + +[api-find]: #find + +[api-replace]: #replace + +[api-replace-function]: #replacefunction + +[api-find-and-replace-list]: #findandreplacelist + +[api-find-and-replace-tuple]: #findandreplacetuple + +[api-regexp-match-object]: #regexpmatchobject diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/index.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/dev/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a7eb0b72a19aadc7e682e5d599cb0b34716c2ba --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/index.d.ts @@ -0,0 +1,23 @@ +export type {Encoding, Token, Value} from 'micromark-util-types' +export type { + CompileContext, + CompileData, + Extension, + Handles, + Handle, + OnEnterError, + OnExitError, + Options, + Transform +} from './lib/types.js' +export {fromMarkdown} from './lib/index.js' + +declare module 'micromark-util-types' { + interface TokenTypeMap { + listItem: 'listItem' + } + + interface Token { + _spread?: boolean + } +} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/index.js b/tools/ui/node_modules/mdast-util-from-markdown/dev/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d8bcf034a961c84955f243715786195be3b05015 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/index.js @@ -0,0 +1,2 @@ +// Note: types exported from `index.d.ts`. +export {fromMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8c908e205ad02dc303fd350c56c0ca4955c8636 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts @@ -0,0 +1,53 @@ +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value: Value, encoding?: Encoding | null | undefined, options?: Options | null | undefined): Root; +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value: Value, options?: Options | null | undefined): Root; +import type { Value } from 'micromark-util-types'; +import type { Encoding } from 'micromark-util-types'; +import type { Options } from './types.js'; +import type { Root } from 'mdast'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..191aab33c2a216ca23b16023babd8154ba537c0e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwDG,oCACQ,KAAK,aACL,QAAQ,GAAG,IAAI,GAAG,SAAS,YAC3B,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCACQ,KAAK,YACL,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;2BAvCO,sBAAsB;8BAAtB,sBAAsB;6BAUtB,YAAY;0BAhBZ,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.js b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..51b7144c862faaa6997d9a87c6fb9717ed09f59c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/index.js @@ -0,0 +1,1348 @@ +/** + * @import { + * Break, + * Blockquote, + * Code, + * Definition, + * Emphasis, + * Heading, + * Html, + * Image, + * InlineCode, + * Link, + * ListItem, + * List, + * Nodes, + * Paragraph, + * PhrasingContent, + * ReferenceType, + * Root, + * Strong, + * Text, + * ThematicBreak + * } from 'mdast' + * @import { + * Encoding, + * Event, + * Token, + * Value + * } from 'micromark-util-types' + * @import {Point} from 'unist' + * @import { + * CompileContext, + * CompileData, + * Config, + * Extension, + * Handle, + * OnEnterError, + * Options + * } from './types.js' + */ + +import {ok as assert} from 'devlop' +import {toString} from 'mdast-util-to-string' +import {parse, postprocess, preprocess} from 'micromark' +import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference' +import {decodeString} from 'micromark-util-decode-string' +import {normalizeIdentifier} from 'micromark-util-normalize-identifier' +import {codes, constants, types} from 'micromark-util-symbol' +import {decodeNamedCharacterReference} from 'decode-named-character-reference' +import {stringifyPosition} from 'unist-util-stringify-position' + +const own = {}.hasOwnProperty + +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value, encoding, options) { + if (encoding && typeof encoding === 'object') { + options = encoding + encoding = undefined + } + + return compiler(options)( + postprocess( + parse(options) + .document() + .write(preprocess()(value, encoding, true)) + ) + ) +} + +/** + * Note this compiler only understand complete buffering, not streaming. + * + * @param {Options | null | undefined} [options] + */ +function compiler(options) { + /** @type {Config} */ + const config = { + transforms: [], + canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'], + enter: { + autolink: opener(link), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading), + blockQuote: opener(blockQuote), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: opener(codeFlow, buffer), + codeText: opener(codeText, buffer), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition), + definitionDestinationString: buffer, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: opener(emphasis), + hardBreakEscape: opener(hardBreak), + hardBreakTrailing: opener(hardBreak), + htmlFlow: opener(html, buffer), + htmlFlowData: onenterdata, + htmlText: opener(html, buffer), + htmlTextData: onenterdata, + image: opener(image), + label: buffer, + link: opener(link), + listItem: opener(listItem), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list, onenterlistordered), + listUnordered: opener(list), + paragraph: opener(paragraph), + reference: onenterreference, + referenceString: buffer, + resourceDestinationString: buffer, + resourceTitleString: buffer, + setextHeading: opener(heading), + strong: opener(strong), + thematicBreak: opener(thematicBreak) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + characterReference: onexitcharacterreference, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + } + + configure(config, (options || {}).mdastExtensions || []) + + /** @type {CompileData} */ + const data = {} + + return compile + + /** + * Turn micromark events into an mdast tree. + * + * @param {Array} events + * Events. + * @returns {Root} + * mdast tree. + */ + function compile(events) { + /** @type {Root} */ + let tree = {type: 'root', children: []} + /** @type {Omit} */ + const context = { + stack: [tree], + tokenStack: [], + config, + enter, + exit, + buffer, + resume, + data + } + /** @type {Array} */ + const listStack = [] + let index = -1 + + while (++index < events.length) { + // We preprocess lists to add `listItem` tokens, and to infer whether + // items the list itself are spread out. + if ( + events[index][1].type === types.listOrdered || + events[index][1].type === types.listUnordered + ) { + if (events[index][0] === 'enter') { + listStack.push(index) + } else { + const tail = listStack.pop() + assert(typeof tail === 'number', 'expected list to be open') + index = prepareList(events, tail, index) + } + } + } + + index = -1 + + while (++index < events.length) { + const handler = config[events[index][0]] + + if (own.call(handler, events[index][1].type)) { + handler[events[index][1].type].call( + Object.assign( + {sliceSerialize: events[index][2].sliceSerialize}, + context + ), + events[index][1] + ) + } + } + + // Handle tokens still being open. + if (context.tokenStack.length > 0) { + const tail = context.tokenStack[context.tokenStack.length - 1] + const handler = tail[1] || defaultOnError + handler.call(context, undefined, tail[0]) + } + + // Figure out `root` position. + tree.position = { + start: point( + events.length > 0 ? events[0][1].start : {line: 1, column: 1, offset: 0} + ), + end: point( + events.length > 0 + ? events[events.length - 2][1].end + : {line: 1, column: 1, offset: 0} + ) + } + + // Call transforms. + index = -1 + while (++index < config.transforms.length) { + tree = config.transforms[index](tree) || tree + } + + return tree + } + + /** + * @param {Array} events + * @param {number} start + * @param {number} length + * @returns {number} + */ + function prepareList(events, start, length) { + let index = start - 1 + let containerBalance = -1 + let listSpread = false + /** @type {Token | undefined} */ + let listItem + /** @type {number | undefined} */ + let lineIndex + /** @type {number | undefined} */ + let firstBlankLineIndex + /** @type {boolean | undefined} */ + let atMarker + + while (++index <= length) { + const event = events[index] + + switch (event[1].type) { + case types.listUnordered: + case types.listOrdered: + case types.blockQuote: { + if (event[0] === 'enter') { + containerBalance++ + } else { + containerBalance-- + } + + atMarker = undefined + + break + } + + case types.lineEndingBlank: { + if (event[0] === 'enter') { + if ( + listItem && + !atMarker && + !containerBalance && + !firstBlankLineIndex + ) { + firstBlankLineIndex = index + } + + atMarker = undefined + } + + break + } + + case types.linePrefix: + case types.listItemValue: + case types.listItemMarker: + case types.listItemPrefix: + case types.listItemPrefixWhitespace: { + // Empty. + + break + } + + default: { + atMarker = undefined + } + } + + if ( + (!containerBalance && + event[0] === 'enter' && + event[1].type === types.listItemPrefix) || + (containerBalance === -1 && + event[0] === 'exit' && + (event[1].type === types.listUnordered || + event[1].type === types.listOrdered)) + ) { + if (listItem) { + let tailIndex = index + lineIndex = undefined + + while (tailIndex--) { + const tailEvent = events[tailIndex] + + if ( + tailEvent[1].type === types.lineEnding || + tailEvent[1].type === types.lineEndingBlank + ) { + if (tailEvent[0] === 'exit') continue + + if (lineIndex) { + events[lineIndex][1].type = types.lineEndingBlank + listSpread = true + } + + tailEvent[1].type = types.lineEnding + lineIndex = tailIndex + } else if ( + tailEvent[1].type === types.linePrefix || + tailEvent[1].type === types.blockQuotePrefix || + tailEvent[1].type === types.blockQuotePrefixWhitespace || + tailEvent[1].type === types.blockQuoteMarker || + tailEvent[1].type === types.listItemIndent + ) { + // Empty + } else { + break + } + } + + if ( + firstBlankLineIndex && + (!lineIndex || firstBlankLineIndex < lineIndex) + ) { + listItem._spread = true + } + + // Fix position. + listItem.end = Object.assign( + {}, + lineIndex ? events[lineIndex][1].start : event[1].end + ) + + events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]) + index++ + length++ + } + + // Create a new list item. + if (event[1].type === types.listItemPrefix) { + /** @type {Token} */ + const item = { + type: 'listItem', + _spread: false, + start: Object.assign({}, event[1].start), + // @ts-expect-error: we’ll add `end` in a second. + end: undefined + } + listItem = item + events.splice(index, 0, ['enter', item, event[2]]) + index++ + length++ + firstBlankLineIndex = undefined + atMarker = true + } + } + } + + events[start][1]._spread = listSpread + return length + } + + /** + * Create an opener handle. + * + * @param {(token: Token) => Nodes} create + * Create a node. + * @param {Handle | undefined} [and] + * Optional function to also run. + * @returns {Handle} + * Handle. + */ + function opener(create, and) { + return open + + /** + * @this {CompileContext} + * @param {Token} token + * @returns {undefined} + */ + function open(token) { + enter.call(this, create(token), token) + if (and) and.call(this, token) + } + } + + /** + * @type {CompileContext['buffer']} + */ + function buffer() { + this.stack.push({type: 'fragment', children: []}) + } + + /** + * @type {CompileContext['enter']} + */ + function enter(node, token, errorHandler) { + const parent = this.stack[this.stack.length - 1] + assert(parent, 'expected `parent`') + assert('children' in parent, 'expected `parent`') + /** @type {Array} */ + const siblings = parent.children + siblings.push(node) + this.stack.push(node) + this.tokenStack.push([token, errorHandler || undefined]) + node.position = { + start: point(token.start), + // @ts-expect-error: `end` will be patched later. + end: undefined + } + } + + /** + * Create a closer handle. + * + * @param {Handle | undefined} [and] + * Optional function to also run. + * @returns {Handle} + * Handle. + */ + function closer(and) { + return close + + /** + * @this {CompileContext} + * @param {Token} token + * @returns {undefined} + */ + function close(token) { + if (and) and.call(this, token) + exit.call(this, token) + } + } + + /** + * @type {CompileContext['exit']} + */ + function exit(token, onExitError) { + const node = this.stack.pop() + assert(node, 'expected `node`') + const open = this.tokenStack.pop() + + if (!open) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({start: token.start, end: token.end}) + + '): it’s not open' + ) + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]) + } else { + const handler = open[1] || defaultOnError + handler.call(this, token, open[0]) + } + } + + assert(node.type !== 'fragment', 'unexpected fragment `exit`ed') + assert(node.position, 'expected `position` to be defined') + node.position.end = point(token.end) + } + + /** + * @type {CompileContext['resume']} + */ + function resume() { + return toString(this.stack.pop()) + } + + // + // Handlers. + // + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onenterlistordered() { + this.data.expectingFirstListItemValue = true + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onenterlistitemvalue(token) { + if (this.data.expectingFirstListItemValue) { + const ancestor = this.stack[this.stack.length - 2] + assert(ancestor, 'expected nodes on stack') + assert(ancestor.type === 'list', 'expected list on stack') + ancestor.start = Number.parseInt( + this.sliceSerialize(token), + constants.numericBaseDecimal + ) + this.data.expectingFirstListItemValue = undefined + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfenceinfo() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'code', 'expected code on stack') + node.lang = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfencemeta() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'code', 'expected code on stack') + node.meta = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfence() { + // Exit if this is the closing fence. + if (this.data.flowCodeInside) return + this.buffer() + this.data.flowCodeInside = true + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefenced() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'code', 'expected code on stack') + + node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '') + this.data.flowCodeInside = undefined + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodeindented() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'code', 'expected code on stack') + + node.value = data.replace(/(\r?\n|\r)$/g, '') + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitionlabelstring(token) { + const label = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'definition', 'expected definition on stack') + + node.label = label + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitiontitlestring() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'definition', 'expected definition on stack') + + node.title = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitiondestinationstring() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'definition', 'expected definition on stack') + + node.url = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitatxheadingsequence(token) { + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'heading', 'expected heading on stack') + + if (!node.depth) { + const depth = this.sliceSerialize(token).length + + assert( + depth === 1 || + depth === 2 || + depth === 3 || + depth === 4 || + depth === 5 || + depth === 6, + 'expected `depth` between `1` and `6`' + ) + + node.depth = depth + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheadingtext() { + this.data.setextHeadingSlurpLineEnding = true + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheadinglinesequence(token) { + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'heading', 'expected heading on stack') + + node.depth = + this.sliceSerialize(token).codePointAt(0) === codes.equalsTo ? 1 : 2 + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheading() { + this.data.setextHeadingSlurpLineEnding = undefined + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onenterdata(token) { + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert('children' in node, 'expected parent on stack') + /** @type {Array} */ + const siblings = node.children + + let tail = siblings[siblings.length - 1] + + if (!tail || tail.type !== 'text') { + // Add a new text node. + tail = text() + tail.position = { + start: point(token.start), + // @ts-expect-error: we’ll add `end` later. + end: undefined + } + siblings.push(tail) + } + + this.stack.push(tail) + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitdata(token) { + const tail = this.stack.pop() + assert(tail, 'expected a `node` to be on the stack') + assert('value' in tail, 'expected a `literal` to be on the stack') + assert(tail.position, 'expected `node` to have an open position') + tail.value += this.sliceSerialize(token) + tail.position.end = point(token.end) + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1] + assert(context, 'expected `node`') + + // If we’re at a hard break, include the line ending in there. + if (this.data.atHardBreak) { + assert('children' in context, 'expected `parent`') + const tail = context.children[context.children.length - 1] + assert(tail.position, 'expected tail to have a starting position') + tail.position.end = point(token.end) + this.data.atHardBreak = undefined + return + } + + if ( + !this.data.setextHeadingSlurpLineEnding && + config.canContainEols.includes(context.type) + ) { + onenterdata.call(this, token) + onexitdata.call(this, token) + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithardbreak() { + this.data.atHardBreak = true + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithtmlflow() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'html', 'expected html on stack') + + node.value = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithtmltext() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'html', 'expected html on stack') + + node.value = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitcodetext() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'inlineCode', 'expected inline code on stack') + + node.value = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlink() { + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'link', 'expected link on stack') + + // Note: there are also `identifier` and `label` fields on this link node! + // These are used / cleaned here. + + // To do: clean. + if (this.data.inReference) { + /** @type {ReferenceType} */ + const referenceType = this.data.referenceType || 'shortcut' + + node.type += 'Reference' + // @ts-expect-error: mutate. + node.referenceType = referenceType + // @ts-expect-error: mutate. + delete node.url + delete node.title + } else { + // @ts-expect-error: mutate. + delete node.identifier + // @ts-expect-error: mutate. + delete node.label + } + + this.data.referenceType = undefined + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitimage() { + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'image', 'expected image on stack') + + // Note: there are also `identifier` and `label` fields on this link node! + // These are used / cleaned here. + + // To do: clean. + if (this.data.inReference) { + /** @type {ReferenceType} */ + const referenceType = this.data.referenceType || 'shortcut' + + node.type += 'Reference' + // @ts-expect-error: mutate. + node.referenceType = referenceType + // @ts-expect-error: mutate. + delete node.url + delete node.title + } else { + // @ts-expect-error: mutate. + delete node.identifier + // @ts-expect-error: mutate. + delete node.label + } + + this.data.referenceType = undefined + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlabeltext(token) { + const string = this.sliceSerialize(token) + const ancestor = this.stack[this.stack.length - 2] + assert(ancestor, 'expected ancestor on stack') + assert( + ancestor.type === 'image' || ancestor.type === 'link', + 'expected image or link on stack' + ) + + // @ts-expect-error: stash this on the node, as it might become a reference + // later. + ancestor.label = decodeString(string) + // @ts-expect-error: same as above. + ancestor.identifier = normalizeIdentifier(string).toLowerCase() + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1] + assert(fragment, 'expected node on stack') + assert(fragment.type === 'fragment', 'expected fragment on stack') + const value = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert( + node.type === 'image' || node.type === 'link', + 'expected image or link on stack' + ) + + // Assume a reference. + this.data.inReference = true + + if (node.type === 'link') { + /** @type {Array} */ + const children = fragment.children + + node.children = children + } else { + node.alt = value + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresourcedestinationstring() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert( + node.type === 'image' || node.type === 'link', + 'expected image or link on stack' + ) + node.url = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresourcetitlestring() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert( + node.type === 'image' || node.type === 'link', + 'expected image or link on stack' + ) + node.title = data + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresource() { + this.data.inReference = undefined + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onenterreference() { + this.data.referenceType = 'collapsed' + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitreferencestring(token) { + const label = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert( + node.type === 'image' || node.type === 'link', + 'expected image reference or link reference on stack' + ) + + // @ts-expect-error: stash this on the node, as it might become a reference + // later. + node.label = label + // @ts-expect-error: same as above. + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + this.data.referenceType = 'full' + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitcharacterreferencemarker(token) { + assert( + token.type === 'characterReferenceMarkerNumeric' || + token.type === 'characterReferenceMarkerHexadecimal' + ) + this.data.characterReferenceType = token.type + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcharacterreferencevalue(token) { + const data = this.sliceSerialize(token) + const type = this.data.characterReferenceType + /** @type {string} */ + let value + + if (type) { + value = decodeNumericCharacterReference( + data, + type === types.characterReferenceMarkerNumeric + ? constants.numericBaseDecimal + : constants.numericBaseHexadecimal + ) + this.data.characterReferenceType = undefined + } else { + const result = decodeNamedCharacterReference(data) + assert(result !== false, 'expected reference to decode') + value = result + } + + const tail = this.stack[this.stack.length - 1] + assert(tail, 'expected `node`') + assert('value' in tail, 'expected `node.value`') + tail.value += value + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcharacterreference(token) { + const tail = this.stack.pop() + assert(tail, 'expected `node`') + assert(tail.position, 'expected `node.position`') + tail.position.end = point(token.end) + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitautolinkprotocol(token) { + onexitdata.call(this, token) + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'link', 'expected link on stack') + + node.url = this.sliceSerialize(token) + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitautolinkemail(token) { + onexitdata.call(this, token) + const node = this.stack[this.stack.length - 1] + assert(node, 'expected node on stack') + assert(node.type === 'link', 'expected link on stack') + + node.url = 'mailto:' + this.sliceSerialize(token) + } + + // + // Creaters. + // + + /** @returns {Blockquote} */ + function blockQuote() { + return {type: 'blockquote', children: []} + } + + /** @returns {Code} */ + function codeFlow() { + return {type: 'code', lang: null, meta: null, value: ''} + } + + /** @returns {InlineCode} */ + function codeText() { + return {type: 'inlineCode', value: ''} + } + + /** @returns {Definition} */ + function definition() { + return { + type: 'definition', + identifier: '', + label: null, + title: null, + url: '' + } + } + + /** @returns {Emphasis} */ + function emphasis() { + return {type: 'emphasis', children: []} + } + + /** @returns {Heading} */ + function heading() { + return { + type: 'heading', + // @ts-expect-error `depth` will be set later. + depth: 0, + children: [] + } + } + + /** @returns {Break} */ + function hardBreak() { + return {type: 'break'} + } + + /** @returns {Html} */ + function html() { + return {type: 'html', value: ''} + } + + /** @returns {Image} */ + function image() { + return {type: 'image', title: null, url: '', alt: null} + } + + /** @returns {Link} */ + function link() { + return {type: 'link', title: null, url: '', children: []} + } + + /** + * @param {Token} token + * @returns {List} + */ + function list(token) { + return { + type: 'list', + ordered: token.type === 'listOrdered', + start: null, + spread: token._spread, + children: [] + } + } + + /** + * @param {Token} token + * @returns {ListItem} + */ + function listItem(token) { + return { + type: 'listItem', + spread: token._spread, + checked: null, + children: [] + } + } + + /** @returns {Paragraph} */ + function paragraph() { + return {type: 'paragraph', children: []} + } + + /** @returns {Strong} */ + function strong() { + return {type: 'strong', children: []} + } + + /** @returns {Text} */ + function text() { + return {type: 'text', value: ''} + } + + /** @returns {ThematicBreak} */ + function thematicBreak() { + return {type: 'thematicBreak'} + } +} + +/** + * Copy a point-like value. + * + * @param {Point} d + * Point-like value. + * @returns {Point} + * unist point. + */ +function point(d) { + return {line: d.line, column: d.column, offset: d.offset} +} + +/** + * @param {Config} combined + * @param {Array | Extension>} extensions + * @returns {undefined} + */ +function configure(combined, extensions) { + let index = -1 + + while (++index < extensions.length) { + const value = extensions[index] + + if (Array.isArray(value)) { + configure(combined, value) + } else { + extension(combined, value) + } + } +} + +/** + * @param {Config} combined + * @param {Extension} extension + * @returns {undefined} + */ +function extension(combined, extension) { + /** @type {keyof Extension} */ + let key + + for (key in extension) { + if (own.call(extension, key)) { + switch (key) { + case 'canContainEols': { + const right = extension[key] + if (right) { + combined[key].push(...right) + } + + break + } + + case 'transforms': { + const right = extension[key] + if (right) { + combined[key].push(...right) + } + + break + } + + case 'enter': + case 'exit': { + const right = extension[key] + if (right) { + Object.assign(combined[key], right) + } + + break + } + // No default + } + } + } +} + +/** @type {OnEnterError} */ +function defaultOnError(left, right) { + if (left) { + throw new Error( + 'Cannot close `' + + left.type + + '` (' + + stringifyPosition({start: left.start, end: left.end}) + + '): a different token (`' + + right.type + + '`, ' + + stringifyPosition({start: right.start, end: right.end}) + + ') is open' + ) + } else { + throw new Error( + 'Cannot close document, a token (`' + + right.type + + '`, ' + + stringifyPosition({start: right.start, end: right.end}) + + ') is still open' + ) + } +} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..710de761b176901337cab011c8936732f01fb750 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts @@ -0,0 +1,295 @@ +import type {Nodes, Parent, PhrasingContent, Root} from 'mdast' +import type {ParseOptions, Token} from 'micromark-util-types' + +/** + * Compiler context. + */ +export interface CompileContext { + /** + * Configuration. + */ + config: Config + /** + * Info passed around; + * key/value store. + */ + data: CompileData + /** + * Stack of nodes. + */ + stack: Array + /** + * Stack of tokens. + */ + tokenStack: Array + + /** + * Capture some of the output data. + * + * @param this + * Context. + * @returns + * Nothing. + */ + buffer(this: CompileContext): undefined + + /** + * Enter a node. + * + * @param this + * Context. + * @param node + * Node. + * @param token + * Token. + * @param onError + * Error handler. + * @returns + * Nothing. + */ + enter( + this: CompileContext, + node: Nodes, + token: Token, + onError?: OnEnterError | null | undefined + ): undefined + + /** + * Exit a node. + * + * @param this + * Context. + * @param token + * Token. + * @param onError + * Error handler. + * @returns + * Nothing. + */ + exit( + this: CompileContext, + token: Token, + onError?: OnExitError | null | undefined + ): undefined + + /** + * Stop capturing and access the output data. + * + * @param this + * Context. + * @returns + * Nothing. + */ + resume(this: CompileContext): string + + /** + * Get the source text that spans a token (or location). + * + * @param token + * Start/end in stream. + * @param expandTabs + * Whether to expand tabs. + * @returns + * Serialized chunks. + */ + sliceSerialize( + token: Pick, + expandTabs?: boolean | undefined + ): string +} + +/** + * Interface of tracked data. + * + * When working on extensions that use more data, extend the corresponding + * interface to register their types: + * + * ```ts + * declare module 'mdast-util-from-markdown' { + * interface CompileData { + * // Register a new field. + * mathFlowInside?: boolean | undefined + * } + * } + * ``` + */ +export interface CompileData { + /** + * Whether we’re inside a hard break. + */ + atHardBreak?: boolean | undefined + + /** + * Current character reference type. + */ + characterReferenceType?: + | 'characterReferenceMarkerHexadecimal' + | 'characterReferenceMarkerNumeric' + | undefined + + /** + * Whether a first list item value (`1` in `1. a`) is expected. + */ + expectingFirstListItemValue?: boolean | undefined + + /** + * Whether we’re in flow code. + */ + flowCodeInside?: boolean | undefined + + /** + * Whether we’re in a reference. + */ + inReference?: boolean | undefined + + /** + * Whether we’re expecting a line ending from a setext heading, which can be slurped. + */ + setextHeadingSlurpLineEnding?: boolean | undefined + + /** + * Current reference. + */ + referenceType?: 'collapsed' | 'full' | undefined +} + +/** + * Configuration. + * + * We have our defaults, but extensions will add more. + */ +export interface Config { + /** + * Token types where line endings are used. + */ + canContainEols: Array + /** + * Opening handles. + */ + enter: Handles + /** + * Closing handles. + */ + exit: Handles + /** + * Tree transforms. + */ + transforms: Array +} + +/** + * Change how markdown tokens from micromark are turned into mdast. + */ +export interface Extension { + /** + * Token types where line endings are used. + */ + canContainEols?: Array | null | undefined + /** + * Opening handles. + */ + enter?: Handles | null | undefined + /** + * Closing handles. + */ + exit?: Handles | null | undefined + /** + * Tree transforms. + */ + transforms?: Array | null | undefined +} + +/** + * Internal fragment. + */ +export interface Fragment extends Parent { + /** + * Node type. + */ + type: 'fragment' + /** + * Children. + */ + children: Array +} + +/** + * Token types mapping to handles + */ +export type Handles = Record + +/** + * Handle a token. + * + * @param this + * Context. + * @param token + * Current token. + * @returns + * Nothing. + */ +export type Handle = (this: CompileContext, token: Token) => undefined | void + +/** + * Handle the case where the `right` token is open, but it is closed (by the + * `left` token) or because we reached the end of the document. + * + * @param this + * Context. + * @param left + * Left token. + * @param right + * Right token. + * @returns + * Nothing. + */ +export type OnEnterError = ( + this: Omit, + left: Token | undefined, + right: Token +) => undefined + +/** + * Handle the case where the `right` token is open but it is closed by + * exiting the `left` token. + * + * @param this + * Context. + * @param left + * Left token. + * @param right + * Right token. + * @returns + * Nothing. + */ +export type OnExitError = ( + this: Omit, + left: Token, + right: Token +) => undefined + +/** + * Configuration. + */ +export interface Options extends ParseOptions { + /** + * Extensions for this utility to change how tokens are turned into a tree. + */ + mdastExtensions?: Array> | null | undefined +} + +/** + * Open token on the stack, + * with an optional error handler for when that token isn’t closed properly. + */ +export type TokenTuple = [token: Token, onError: OnEnterError | undefined] + +/** + * Extra transform, to change the AST afterwards. + * + * @param tree + * Tree to transform. + * @returns + * New tree or nothing (in which case the current tree is used). + */ +export type Transform = (tree: Root) => Root | null | undefined | void diff --git a/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.js b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c172e67f95bf21d4668a3f572002ea2e5aeb9466 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/dev/lib/types.js @@ -0,0 +1,2 @@ +// Note: types exposed from `types.d.ts`. +export {} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/index.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a7eb0b72a19aadc7e682e5d599cb0b34716c2ba --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/index.d.ts @@ -0,0 +1,23 @@ +export type {Encoding, Token, Value} from 'micromark-util-types' +export type { + CompileContext, + CompileData, + Extension, + Handles, + Handle, + OnEnterError, + OnExitError, + Options, + Transform +} from './lib/types.js' +export {fromMarkdown} from './lib/index.js' + +declare module 'micromark-util-types' { + interface TokenTypeMap { + listItem: 'listItem' + } + + interface Token { + _spread?: boolean + } +} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/index.js b/tools/ui/node_modules/mdast-util-from-markdown/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6ceffc9ab85bd2ca47070cea3de8ab2369674217 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/index.js @@ -0,0 +1,2 @@ +// Note: types exported from `index.d.ts`. +export { fromMarkdown } from './lib/index.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8c908e205ad02dc303fd350c56c0ca4955c8636 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts @@ -0,0 +1,53 @@ +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value: Value, encoding?: Encoding | null | undefined, options?: Options | null | undefined): Root; +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value: Value, options?: Options | null | undefined): Root; +import type { Value } from 'micromark-util-types'; +import type { Encoding } from 'micromark-util-types'; +import type { Options } from './types.js'; +import type { Root } from 'mdast'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..191aab33c2a216ca23b16023babd8154ba537c0e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwDG,oCACQ,KAAK,aACL,QAAQ,GAAG,IAAI,GAAG,SAAS,YAC3B,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCACQ,KAAK,YACL,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;2BAvCO,sBAAsB;8BAAtB,sBAAsB;6BAUtB,YAAY;0BAhBZ,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/lib/index.js b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..90e17befb5712e97284e97cd6689bc14ac42c1ba --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/lib/index.js @@ -0,0 +1,1177 @@ +/** + * @import { + * Break, + * Blockquote, + * Code, + * Definition, + * Emphasis, + * Heading, + * Html, + * Image, + * InlineCode, + * Link, + * ListItem, + * List, + * Nodes, + * Paragraph, + * PhrasingContent, + * ReferenceType, + * Root, + * Strong, + * Text, + * ThematicBreak + * } from 'mdast' + * @import { + * Encoding, + * Event, + * Token, + * Value + * } from 'micromark-util-types' + * @import {Point} from 'unist' + * @import { + * CompileContext, + * CompileData, + * Config, + * Extension, + * Handle, + * OnEnterError, + * Options + * } from './types.js' + */ + +import { toString } from 'mdast-util-to-string'; +import { parse, postprocess, preprocess } from 'micromark'; +import { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference'; +import { decodeString } from 'micromark-util-decode-string'; +import { normalizeIdentifier } from 'micromark-util-normalize-identifier'; +import { decodeNamedCharacterReference } from 'decode-named-character-reference'; +import { stringifyPosition } from 'unist-util-stringify-position'; +const own = {}.hasOwnProperty; + +/** + * Turn markdown into a syntax tree. + * + * @overload + * @param {Value} value + * @param {Encoding | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @overload + * @param {Value} value + * @param {Options | null | undefined} [options] + * @returns {Root} + * + * @param {Value} value + * Markdown to parse. + * @param {Encoding | Options | null | undefined} [encoding] + * Character encoding for when `value` is `Buffer`. + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {Root} + * mdast tree. + */ +export function fromMarkdown(value, encoding, options) { + if (encoding && typeof encoding === 'object') { + options = encoding; + encoding = undefined; + } + return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true)))); +} + +/** + * Note this compiler only understand complete buffering, not streaming. + * + * @param {Options | null | undefined} [options] + */ +function compiler(options) { + /** @type {Config} */ + const config = { + transforms: [], + canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'], + enter: { + autolink: opener(link), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading), + blockQuote: opener(blockQuote), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer, + codeFencedFenceMeta: buffer, + codeIndented: opener(codeFlow, buffer), + codeText: opener(codeText, buffer), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition), + definitionDestinationString: buffer, + definitionLabelString: buffer, + definitionTitleString: buffer, + emphasis: opener(emphasis), + hardBreakEscape: opener(hardBreak), + hardBreakTrailing: opener(hardBreak), + htmlFlow: opener(html, buffer), + htmlFlowData: onenterdata, + htmlText: opener(html, buffer), + htmlTextData: onenterdata, + image: opener(image), + label: buffer, + link: opener(link), + listItem: opener(listItem), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list, onenterlistordered), + listUnordered: opener(list), + paragraph: opener(paragraph), + reference: onenterreference, + referenceString: buffer, + resourceDestinationString: buffer, + resourceTitleString: buffer, + setextHeading: opener(heading), + strong: opener(strong), + thematicBreak: opener(thematicBreak) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + characterReference: onexitcharacterreference, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }; + configure(config, (options || {}).mdastExtensions || []); + + /** @type {CompileData} */ + const data = {}; + return compile; + + /** + * Turn micromark events into an mdast tree. + * + * @param {Array} events + * Events. + * @returns {Root} + * mdast tree. + */ + function compile(events) { + /** @type {Root} */ + let tree = { + type: 'root', + children: [] + }; + /** @type {Omit} */ + const context = { + stack: [tree], + tokenStack: [], + config, + enter, + exit, + buffer, + resume, + data + }; + /** @type {Array} */ + const listStack = []; + let index = -1; + while (++index < events.length) { + // We preprocess lists to add `listItem` tokens, and to infer whether + // items the list itself are spread out. + if (events[index][1].type === "listOrdered" || events[index][1].type === "listUnordered") { + if (events[index][0] === 'enter') { + listStack.push(index); + } else { + const tail = listStack.pop(); + index = prepareList(events, tail, index); + } + } + } + index = -1; + while (++index < events.length) { + const handler = config[events[index][0]]; + if (own.call(handler, events[index][1].type)) { + handler[events[index][1].type].call(Object.assign({ + sliceSerialize: events[index][2].sliceSerialize + }, context), events[index][1]); + } + } + + // Handle tokens still being open. + if (context.tokenStack.length > 0) { + const tail = context.tokenStack[context.tokenStack.length - 1]; + const handler = tail[1] || defaultOnError; + handler.call(context, undefined, tail[0]); + } + + // Figure out `root` position. + tree.position = { + start: point(events.length > 0 ? events[0][1].start : { + line: 1, + column: 1, + offset: 0 + }), + end: point(events.length > 0 ? events[events.length - 2][1].end : { + line: 1, + column: 1, + offset: 0 + }) + }; + + // Call transforms. + index = -1; + while (++index < config.transforms.length) { + tree = config.transforms[index](tree) || tree; + } + return tree; + } + + /** + * @param {Array} events + * @param {number} start + * @param {number} length + * @returns {number} + */ + function prepareList(events, start, length) { + let index = start - 1; + let containerBalance = -1; + let listSpread = false; + /** @type {Token | undefined} */ + let listItem; + /** @type {number | undefined} */ + let lineIndex; + /** @type {number | undefined} */ + let firstBlankLineIndex; + /** @type {boolean | undefined} */ + let atMarker; + while (++index <= length) { + const event = events[index]; + switch (event[1].type) { + case "listUnordered": + case "listOrdered": + case "blockQuote": + { + if (event[0] === 'enter') { + containerBalance++; + } else { + containerBalance--; + } + atMarker = undefined; + break; + } + case "lineEndingBlank": + { + if (event[0] === 'enter') { + if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) { + firstBlankLineIndex = index; + } + atMarker = undefined; + } + break; + } + case "linePrefix": + case "listItemValue": + case "listItemMarker": + case "listItemPrefix": + case "listItemPrefixWhitespace": + { + // Empty. + + break; + } + default: + { + atMarker = undefined; + } + } + if (!containerBalance && event[0] === 'enter' && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { + if (listItem) { + let tailIndex = index; + lineIndex = undefined; + while (tailIndex--) { + const tailEvent = events[tailIndex]; + if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { + if (tailEvent[0] === 'exit') continue; + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + listSpread = true; + } + tailEvent[1].type = "lineEnding"; + lineIndex = tailIndex; + } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") { + // Empty + } else { + break; + } + } + if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) { + listItem._spread = true; + } + + // Fix position. + listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end); + events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]); + index++; + length++; + } + + // Create a new list item. + if (event[1].type === "listItemPrefix") { + /** @type {Token} */ + const item = { + type: 'listItem', + _spread: false, + start: Object.assign({}, event[1].start), + // @ts-expect-error: we’ll add `end` in a second. + end: undefined + }; + listItem = item; + events.splice(index, 0, ['enter', item, event[2]]); + index++; + length++; + firstBlankLineIndex = undefined; + atMarker = true; + } + } + } + events[start][1]._spread = listSpread; + return length; + } + + /** + * Create an opener handle. + * + * @param {(token: Token) => Nodes} create + * Create a node. + * @param {Handle | undefined} [and] + * Optional function to also run. + * @returns {Handle} + * Handle. + */ + function opener(create, and) { + return open; + + /** + * @this {CompileContext} + * @param {Token} token + * @returns {undefined} + */ + function open(token) { + enter.call(this, create(token), token); + if (and) and.call(this, token); + } + } + + /** + * @type {CompileContext['buffer']} + */ + function buffer() { + this.stack.push({ + type: 'fragment', + children: [] + }); + } + + /** + * @type {CompileContext['enter']} + */ + function enter(node, token, errorHandler) { + const parent = this.stack[this.stack.length - 1]; + /** @type {Array} */ + const siblings = parent.children; + siblings.push(node); + this.stack.push(node); + this.tokenStack.push([token, errorHandler || undefined]); + node.position = { + start: point(token.start), + // @ts-expect-error: `end` will be patched later. + end: undefined + }; + } + + /** + * Create a closer handle. + * + * @param {Handle | undefined} [and] + * Optional function to also run. + * @returns {Handle} + * Handle. + */ + function closer(and) { + return close; + + /** + * @this {CompileContext} + * @param {Token} token + * @returns {undefined} + */ + function close(token) { + if (and) and.call(this, token); + exit.call(this, token); + } + } + + /** + * @type {CompileContext['exit']} + */ + function exit(token, onExitError) { + const node = this.stack.pop(); + const open = this.tokenStack.pop(); + if (!open) { + throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({ + start: token.start, + end: token.end + }) + '): it’s not open'); + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]); + } else { + const handler = open[1] || defaultOnError; + handler.call(this, token, open[0]); + } + } + node.position.end = point(token.end); + } + + /** + * @type {CompileContext['resume']} + */ + function resume() { + return toString(this.stack.pop()); + } + + // + // Handlers. + // + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onenterlistordered() { + this.data.expectingFirstListItemValue = true; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onenterlistitemvalue(token) { + if (this.data.expectingFirstListItemValue) { + const ancestor = this.stack[this.stack.length - 2]; + ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); + this.data.expectingFirstListItemValue = undefined; + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfenceinfo() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.lang = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfencemeta() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.meta = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefencedfence() { + // Exit if this is the closing fence. + if (this.data.flowCodeInside) return; + this.buffer(); + this.data.flowCodeInside = true; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodefenced() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ''); + this.data.flowCodeInside = undefined; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcodeindented() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data.replace(/(\r?\n|\r)$/g, ''); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitionlabelstring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitiontitlestring() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitdefinitiondestinationstring() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitatxheadingsequence(token) { + const node = this.stack[this.stack.length - 1]; + if (!node.depth) { + const depth = this.sliceSerialize(token).length; + node.depth = depth; + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheadingtext() { + this.data.setextHeadingSlurpLineEnding = true; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheadinglinesequence(token) { + const node = this.stack[this.stack.length - 1]; + node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitsetextheading() { + this.data.setextHeadingSlurpLineEnding = undefined; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onenterdata(token) { + const node = this.stack[this.stack.length - 1]; + /** @type {Array} */ + const siblings = node.children; + let tail = siblings[siblings.length - 1]; + if (!tail || tail.type !== 'text') { + // Add a new text node. + tail = text(); + tail.position = { + start: point(token.start), + // @ts-expect-error: we’ll add `end` later. + end: undefined + }; + siblings.push(tail); + } + this.stack.push(tail); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitdata(token) { + const tail = this.stack.pop(); + tail.value += this.sliceSerialize(token); + tail.position.end = point(token.end); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1]; + // If we’re at a hard break, include the line ending in there. + if (this.data.atHardBreak) { + const tail = context.children[context.children.length - 1]; + tail.position.end = point(token.end); + this.data.atHardBreak = undefined; + return; + } + if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) { + onenterdata.call(this, token); + onexitdata.call(this, token); + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithardbreak() { + this.data.atHardBreak = true; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithtmlflow() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexithtmltext() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitcodetext() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlink() { + const node = this.stack[this.stack.length - 1]; + // Note: there are also `identifier` and `label` fields on this link node! + // These are used / cleaned here. + + // To do: clean. + if (this.data.inReference) { + /** @type {ReferenceType} */ + const referenceType = this.data.referenceType || 'shortcut'; + node.type += 'Reference'; + // @ts-expect-error: mutate. + node.referenceType = referenceType; + // @ts-expect-error: mutate. + delete node.url; + delete node.title; + } else { + // @ts-expect-error: mutate. + delete node.identifier; + // @ts-expect-error: mutate. + delete node.label; + } + this.data.referenceType = undefined; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitimage() { + const node = this.stack[this.stack.length - 1]; + // Note: there are also `identifier` and `label` fields on this link node! + // These are used / cleaned here. + + // To do: clean. + if (this.data.inReference) { + /** @type {ReferenceType} */ + const referenceType = this.data.referenceType || 'shortcut'; + node.type += 'Reference'; + // @ts-expect-error: mutate. + node.referenceType = referenceType; + // @ts-expect-error: mutate. + delete node.url; + delete node.title; + } else { + // @ts-expect-error: mutate. + delete node.identifier; + // @ts-expect-error: mutate. + delete node.label; + } + this.data.referenceType = undefined; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlabeltext(token) { + const string = this.sliceSerialize(token); + const ancestor = this.stack[this.stack.length - 2]; + // @ts-expect-error: stash this on the node, as it might become a reference + // later. + ancestor.label = decodeString(string); + // @ts-expect-error: same as above. + ancestor.identifier = normalizeIdentifier(string).toLowerCase(); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1]; + const value = this.resume(); + const node = this.stack[this.stack.length - 1]; + // Assume a reference. + this.data.inReference = true; + if (node.type === 'link') { + /** @type {Array} */ + const children = fragment.children; + node.children = children; + } else { + node.alt = value; + } + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresourcedestinationstring() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresourcetitlestring() { + const data = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitresource() { + this.data.inReference = undefined; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onenterreference() { + this.data.referenceType = 'collapsed'; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitreferencestring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + // @ts-expect-error: stash this on the node, as it might become a reference + // later. + node.label = label; + // @ts-expect-error: same as above. + node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(); + this.data.referenceType = 'full'; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + + function onexitcharacterreferencemarker(token) { + this.data.characterReferenceType = token.type; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcharacterreferencevalue(token) { + const data = this.sliceSerialize(token); + const type = this.data.characterReferenceType; + /** @type {string} */ + let value; + if (type) { + value = decodeNumericCharacterReference(data, type === "characterReferenceMarkerNumeric" ? 10 : 16); + this.data.characterReferenceType = undefined; + } else { + const result = decodeNamedCharacterReference(data); + value = result; + } + const tail = this.stack[this.stack.length - 1]; + tail.value += value; + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitcharacterreference(token) { + const tail = this.stack.pop(); + tail.position.end = point(token.end); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitautolinkprotocol(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = this.sliceSerialize(token); + } + + /** + * @this {CompileContext} + * @type {Handle} + */ + function onexitautolinkemail(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = 'mailto:' + this.sliceSerialize(token); + } + + // + // Creaters. + // + + /** @returns {Blockquote} */ + function blockQuote() { + return { + type: 'blockquote', + children: [] + }; + } + + /** @returns {Code} */ + function codeFlow() { + return { + type: 'code', + lang: null, + meta: null, + value: '' + }; + } + + /** @returns {InlineCode} */ + function codeText() { + return { + type: 'inlineCode', + value: '' + }; + } + + /** @returns {Definition} */ + function definition() { + return { + type: 'definition', + identifier: '', + label: null, + title: null, + url: '' + }; + } + + /** @returns {Emphasis} */ + function emphasis() { + return { + type: 'emphasis', + children: [] + }; + } + + /** @returns {Heading} */ + function heading() { + return { + type: 'heading', + // @ts-expect-error `depth` will be set later. + depth: 0, + children: [] + }; + } + + /** @returns {Break} */ + function hardBreak() { + return { + type: 'break' + }; + } + + /** @returns {Html} */ + function html() { + return { + type: 'html', + value: '' + }; + } + + /** @returns {Image} */ + function image() { + return { + type: 'image', + title: null, + url: '', + alt: null + }; + } + + /** @returns {Link} */ + function link() { + return { + type: 'link', + title: null, + url: '', + children: [] + }; + } + + /** + * @param {Token} token + * @returns {List} + */ + function list(token) { + return { + type: 'list', + ordered: token.type === 'listOrdered', + start: null, + spread: token._spread, + children: [] + }; + } + + /** + * @param {Token} token + * @returns {ListItem} + */ + function listItem(token) { + return { + type: 'listItem', + spread: token._spread, + checked: null, + children: [] + }; + } + + /** @returns {Paragraph} */ + function paragraph() { + return { + type: 'paragraph', + children: [] + }; + } + + /** @returns {Strong} */ + function strong() { + return { + type: 'strong', + children: [] + }; + } + + /** @returns {Text} */ + function text() { + return { + type: 'text', + value: '' + }; + } + + /** @returns {ThematicBreak} */ + function thematicBreak() { + return { + type: 'thematicBreak' + }; + } +} + +/** + * Copy a point-like value. + * + * @param {Point} d + * Point-like value. + * @returns {Point} + * unist point. + */ +function point(d) { + return { + line: d.line, + column: d.column, + offset: d.offset + }; +} + +/** + * @param {Config} combined + * @param {Array | Extension>} extensions + * @returns {undefined} + */ +function configure(combined, extensions) { + let index = -1; + while (++index < extensions.length) { + const value = extensions[index]; + if (Array.isArray(value)) { + configure(combined, value); + } else { + extension(combined, value); + } + } +} + +/** + * @param {Config} combined + * @param {Extension} extension + * @returns {undefined} + */ +function extension(combined, extension) { + /** @type {keyof Extension} */ + let key; + for (key in extension) { + if (own.call(extension, key)) { + switch (key) { + case 'canContainEols': + { + const right = extension[key]; + if (right) { + combined[key].push(...right); + } + break; + } + case 'transforms': + { + const right = extension[key]; + if (right) { + combined[key].push(...right); + } + break; + } + case 'enter': + case 'exit': + { + const right = extension[key]; + if (right) { + Object.assign(combined[key], right); + } + break; + } + // No default + } + } + } +} + +/** @type {OnEnterError} */ +function defaultOnError(left, right) { + if (left) { + throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({ + start: left.start, + end: left.end + }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({ + start: right.start, + end: right.end + }) + ') is open'); + } else { + throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({ + start: right.start, + end: right.end + }) + ') is still open'); + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/lib/types.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/lib/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..710de761b176901337cab011c8936732f01fb750 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/lib/types.d.ts @@ -0,0 +1,295 @@ +import type {Nodes, Parent, PhrasingContent, Root} from 'mdast' +import type {ParseOptions, Token} from 'micromark-util-types' + +/** + * Compiler context. + */ +export interface CompileContext { + /** + * Configuration. + */ + config: Config + /** + * Info passed around; + * key/value store. + */ + data: CompileData + /** + * Stack of nodes. + */ + stack: Array + /** + * Stack of tokens. + */ + tokenStack: Array + + /** + * Capture some of the output data. + * + * @param this + * Context. + * @returns + * Nothing. + */ + buffer(this: CompileContext): undefined + + /** + * Enter a node. + * + * @param this + * Context. + * @param node + * Node. + * @param token + * Token. + * @param onError + * Error handler. + * @returns + * Nothing. + */ + enter( + this: CompileContext, + node: Nodes, + token: Token, + onError?: OnEnterError | null | undefined + ): undefined + + /** + * Exit a node. + * + * @param this + * Context. + * @param token + * Token. + * @param onError + * Error handler. + * @returns + * Nothing. + */ + exit( + this: CompileContext, + token: Token, + onError?: OnExitError | null | undefined + ): undefined + + /** + * Stop capturing and access the output data. + * + * @param this + * Context. + * @returns + * Nothing. + */ + resume(this: CompileContext): string + + /** + * Get the source text that spans a token (or location). + * + * @param token + * Start/end in stream. + * @param expandTabs + * Whether to expand tabs. + * @returns + * Serialized chunks. + */ + sliceSerialize( + token: Pick, + expandTabs?: boolean | undefined + ): string +} + +/** + * Interface of tracked data. + * + * When working on extensions that use more data, extend the corresponding + * interface to register their types: + * + * ```ts + * declare module 'mdast-util-from-markdown' { + * interface CompileData { + * // Register a new field. + * mathFlowInside?: boolean | undefined + * } + * } + * ``` + */ +export interface CompileData { + /** + * Whether we’re inside a hard break. + */ + atHardBreak?: boolean | undefined + + /** + * Current character reference type. + */ + characterReferenceType?: + | 'characterReferenceMarkerHexadecimal' + | 'characterReferenceMarkerNumeric' + | undefined + + /** + * Whether a first list item value (`1` in `1. a`) is expected. + */ + expectingFirstListItemValue?: boolean | undefined + + /** + * Whether we’re in flow code. + */ + flowCodeInside?: boolean | undefined + + /** + * Whether we’re in a reference. + */ + inReference?: boolean | undefined + + /** + * Whether we’re expecting a line ending from a setext heading, which can be slurped. + */ + setextHeadingSlurpLineEnding?: boolean | undefined + + /** + * Current reference. + */ + referenceType?: 'collapsed' | 'full' | undefined +} + +/** + * Configuration. + * + * We have our defaults, but extensions will add more. + */ +export interface Config { + /** + * Token types where line endings are used. + */ + canContainEols: Array + /** + * Opening handles. + */ + enter: Handles + /** + * Closing handles. + */ + exit: Handles + /** + * Tree transforms. + */ + transforms: Array +} + +/** + * Change how markdown tokens from micromark are turned into mdast. + */ +export interface Extension { + /** + * Token types where line endings are used. + */ + canContainEols?: Array | null | undefined + /** + * Opening handles. + */ + enter?: Handles | null | undefined + /** + * Closing handles. + */ + exit?: Handles | null | undefined + /** + * Tree transforms. + */ + transforms?: Array | null | undefined +} + +/** + * Internal fragment. + */ +export interface Fragment extends Parent { + /** + * Node type. + */ + type: 'fragment' + /** + * Children. + */ + children: Array +} + +/** + * Token types mapping to handles + */ +export type Handles = Record + +/** + * Handle a token. + * + * @param this + * Context. + * @param token + * Current token. + * @returns + * Nothing. + */ +export type Handle = (this: CompileContext, token: Token) => undefined | void + +/** + * Handle the case where the `right` token is open, but it is closed (by the + * `left` token) or because we reached the end of the document. + * + * @param this + * Context. + * @param left + * Left token. + * @param right + * Right token. + * @returns + * Nothing. + */ +export type OnEnterError = ( + this: Omit, + left: Token | undefined, + right: Token +) => undefined + +/** + * Handle the case where the `right` token is open but it is closed by + * exiting the `left` token. + * + * @param this + * Context. + * @param left + * Left token. + * @param right + * Right token. + * @returns + * Nothing. + */ +export type OnExitError = ( + this: Omit, + left: Token, + right: Token +) => undefined + +/** + * Configuration. + */ +export interface Options extends ParseOptions { + /** + * Extensions for this utility to change how tokens are turned into a tree. + */ + mdastExtensions?: Array> | null | undefined +} + +/** + * Open token on the stack, + * with an optional error handler for when that token isn’t closed properly. + */ +export type TokenTuple = [token: Token, onError: OnEnterError | undefined] + +/** + * Extra transform, to change the AST afterwards. + * + * @param tree + * Tree to transform. + * @returns + * New tree or nothing (in which case the current tree is used). + */ +export type Transform = (tree: Root) => Root | null | undefined | void diff --git a/tools/ui/node_modules/mdast-util-from-markdown/lib/types.js b/tools/ui/node_modules/mdast-util-from-markdown/lib/types.js new file mode 100644 index 0000000000000000000000000000000000000000..ca675127ea334eb9ba12098a41f386e9a772f724 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/lib/types.js @@ -0,0 +1,2 @@ +// Note: types exposed from `types.d.ts`. +export {}; \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/license b/tools/ui/node_modules/mdast-util-from-markdown/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/README.md b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/package.json b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-from-markdown/package.json b/tools/ui/node_modules/mdast-util-from-markdown/package.json new file mode 100644 index 0000000000000000000000000000000000000000..98291885f91ba36a7d457b75a12ab04f4ee1f5db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/package.json @@ -0,0 +1,99 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/syntax-tree/mdast-util-from-markdown/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "description": "mdast utility to parse markdown", + "devDependencies": { + "@types/node": "^25.0.0", + "c8": "^10.0.0", + "commonmark.json": "^0.31.0", + "esbuild": "^0.27.0", + "gzip-size-cli": "^5.0.0", + "hast-util-from-html": "^2.0.0", + "hast-util-to-html": "^9.0.0", + "mdast-util-to-hast": "^13.0.0", + "micromark-build": "^2.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "terser": "^5.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^1.0.0" + }, + "exports": { + "development": "./dev/index.js", + "default": "./index.js" + }, + "files": [ + "dev/", + "lib/", + "index.d.ts", + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "ast", + "markdown", + "markup", + "mdast-util", + "mdast", + "parse", + "syntax", + "tree", + "unist", + "utility", + "util" + ], + "license": "MIT", + "name": "mdast-util-from-markdown", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "syntax-tree/mdast-util-from-markdown", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage && micromark-build && esbuild . --bundle --minify | terser | gzip-size --raw", + "format": "remark --frail --quiet --output -- . && prettier --log-level warn --write -- . && xo --fix", + "test-api-dev": "node --conditions development test/index.js", + "test-api-prod": "node --conditions production test/index.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov -- npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "strict": true + }, + "type": "module", + "version": "2.0.3" +} diff --git a/tools/ui/node_modules/mdast-util-from-markdown/readme.md b/tools/ui/node_modules/mdast-util-from-markdown/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..48ad08d02330112e4d3e0986396cc44cb45da013 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-from-markdown/readme.md @@ -0,0 +1,535 @@ +# mdast-util-from-markdown + +[![Build][badge-build-image]][badge-build-url] +[![Coverage][badge-coverage-image]][badge-coverage-url] +[![Downloads][badge-downloads-image]][badge-downloads-url] +[![Size][badge-size-image]][badge-size-url] + +**[mdast][github-mdast]** utility that turns markdown into a syntax tree. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`fromMarkdown(value[, encoding][, options])`](#frommarkdownvalue-encoding-options) + * [`CompileContext`](#compilecontext) + * [`CompileData`](#compiledata) + * [`Encoding`](#encoding) + * [`Extension`](#extension) + * [`Handle`](#handle) + * [`OnEnterError`](#onentererror) + * [`OnExitError`](#onexiterror) + * [`Options`](#options) + * [`Token`](#token) + * [`Transform`](#transform) + * [`Value`](#value) +* [List of extensions](#list-of-extensions) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that takes markdown input and turns it into an +[mdast][github-mdast] syntax tree. + +This utility uses [`micromark`][github-micromark], +which turns markdown into tokens, +and then turns those tokens into nodes. +This package is used inside [`remark-parse`][github-remark-parse], +which focusses on +making it easier to transform content by abstracting these internals away. + +## When should I use this? + +If you want to handle syntax trees manually, use this. +When you *just* want to turn markdown into HTML, +use [`micromark`][github-micromark] instead. +For an easier time processing content, +use the **[remark][github-remark]** ecosystem instead. + +You can combine this package with other packages to add syntax extensions to +markdown. +Notable examples that deeply integrate with this package are +[`mdast-util-mdx`][github-mdast-util-mdx], +[`mdast-util-gfm`][github-mdast-util-gfm], +[`mdast-util-frontmatter`][github-mdast-util-frontmatter], +[`mdast-util-math`][github-mdast-util-math], and +[`mdast-util-directive`][github-mdast-util-directive]. + +## Install + +This package is [ESM only][github-gist-esm]. +In Node.js (version 16+), install with [npm][npmjs-install]: + +```sh +npm install mdast-util-from-markdown +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say we have the following markdown file `example.md`: + +```markdown +## Hello, *World*! +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {fromMarkdown} from 'mdast-util-from-markdown' + +const doc = await fs.readFile('example.md') +const tree = fromMarkdown(doc) + +console.log(tree) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'heading', + depth: 2, + children: [ + {type: 'text', value: 'Hello, '}, + {type: 'emphasis', children: [{type: 'text', value: 'World'}]}, + {type: 'text', value: '!'} + ] + } + ] +} +``` + +## API + +This package exports the identifier [`fromMarkdown`][api-from-markdown]. +There is no default export. + +The export map supports the [`development` condition][node-packages-conditions]. +Run `node --conditions development example.js` to get instrumented dev code. +Without this condition, production code is loaded. + +### `fromMarkdown(value[, encoding][, options])` + +Turn markdown into a syntax tree. + +###### Overloads + +* `(value: Value, encoding: Encoding, options?: Options) => Root` +* `(value: Value, options?: Options) => Root` + +###### Parameters + +* `value` ([`Value`][api-value]) + — markdown to parse +* `encoding` ([`Encoding`][api-encoding], default: `'utf8'`) + — [character encoding][node-util-encoding] for when `value` is + [`Uint8Array`][mozilla-uint8-array] +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +mdast tree ([`Root`][github-mdast-root]). + +### `CompileContext` + +mdast compiler context (TypeScript type). + +###### Fields + +* `stack` ([`Array`][github-mdast-nodes]) + — stack of nodes +* `tokenStack` (`Array<[Token, OnEnterError | undefined]>`) + — stack of tokens +* `data` ([`CompileData`][api-compile-data]) + — info passed around; key/value store +* `buffer` (`() => undefined`) + — capture some of the output data +* `resume` (`() => string`) + — stop capturing and access the output data +* `enter` (`(node: Node, token: Token, onError?: OnEnterError) => undefined`) + — enter a node +* `exit` (`(token: Token, onError?: OnExitError) => undefined`) + — exit a node +* `sliceSerialize` (`(token: Token, expandTabs?: boolean) => string`) + — get the string value of a token +* `config` (`Required`) + — configuration + +### `CompileData` + +Interface of tracked data (TypeScript type). + +###### Type + +```ts +interface CompileData { /* see code */ } +``` + +When working on extensions that use more data, extend the corresponding +interface to register their types: + +```ts +declare module 'mdast-util-from-markdown' { + interface CompileData { + // Register a new field. + mathFlowInside?: boolean | undefined + } +} +``` + +### `Encoding` + +Encodings supported by the [`Uint8Array`][mozilla-uint8-array] class +(TypeScript type). + +See [`micromark`][github-micromark-api] for more info. + +###### Type + +```ts +type Encoding = 'utf8' | /* … */ +``` + +### `Extension` + +Change how markdown tokens from micromark are turned into mdast (TypeScript +type). + +###### Properties + +* `canContainEols` (`Array`, optional) + — token types where line endings are used +* `enter` ([`Record`][api-handle], optional) + — opening handles +* `exit` ([`Record`][api-handle], optional) + — closing handles +* `transforms` ([`Array`][api-transform], optional) + — tree transforms + +### `Handle` + +Handle a token (TypeScript type). + +###### Parameters + +* `this` ([`CompileContext`][api-compile-context]) + — context +* `token` ([`Token`][api-token]) + — current token + +###### Returns + +Nothing (`undefined`). + +### `OnEnterError` + +Handle the case where the `right` token is open, but it is closed (by the +`left` token) or because we reached the end of the document (TypeScript type). + +###### Parameters + +* `this` ([`CompileContext`][api-compile-context]) + — context +* `left` ([`Token`][api-token] or `undefined`) + — left token +* `right` ([`Token`][api-token]) + — right token + +###### Returns + +Nothing (`undefined`). + +### `OnExitError` + +Handle the case where the `right` token is open but it is closed by +exiting the `left` token (TypeScript type). + +###### Parameters + +* `this` ([`CompileContext`][api-compile-context]) + — context +* `left` ([`Token`][api-token]) + — left token +* `right` ([`Token`][api-token]) + — right token + +###### Returns + +Nothing (`undefined`). + +### `Options` + +Configuration (TypeScript type). + +###### Properties + +* `extensions` + ([`Array`][github-micromark-extension], optional) + — micromark extensions to change how markdown is parsed +* `mdastExtensions` + ([`Array>`][api-extension], + optional) + — extensions for this utility to change how tokens are turned into a tree + +### `Token` + +Token from micromark (TypeScript type). + +###### Type + +```ts +type Token = { /* … */ } +``` + +### `Transform` + +Extra transform, to change the AST afterwards (TypeScript type). + +###### Parameters + +* `tree` ([`Root`][github-mdast-root]) + — tree to transform + +###### Returns + +New tree ([`Root`][github-mdast-root]) or nothing +(in which case the current tree is used). + +### `Value` + +Contents of the file (TypeScript type). + +See [`micromark`][github-micromark-api] for more info. + +###### Type + +```ts +type Value = Uint8Array | string +``` + +## List of extensions + +* [`syntax-tree/mdast-util-directive`][github-mdast-util-directive] + — directives +* [`syntax-tree/mdast-util-frontmatter`][github-mdast-util-frontmatter] + — frontmatter (YAML, TOML, more) +* [`syntax-tree/mdast-util-gfm`][github-mdast-util-gfm] + — GFM +* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal) + — GFM autolink literals +* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote) + — GFM footnotes +* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough) + — GFM strikethrough +* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table) + — GFM tables +* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) + — GFM task list items +* [`syntax-tree/mdast-util-math`][github-mdast-util-math] + — math +* [`syntax-tree/mdast-util-mdx`][github-mdast-util-mdx] + — MDX +* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression) + — MDX expressions +* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx) + — MDX JSX +* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm) + — MDX ESM + +## Syntax + +Markdown is parsed according to CommonMark. +Extensions can add support for other syntax. +If you’re interested in extending markdown, +[more information is available in micromark’s +readme][github-micromark-extension]. + +## Syntax tree + +The syntax tree is [mdast][github-mdast]. + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types +[`CompileContext`][api-compile-context], +[`CompileData`][api-compile-data], +[`Encoding`][api-encoding], +[`Extension`][api-extension], +[`Handle`][api-handle], +[`OnEnterError`][api-on-enter-error], +[`OnExitError`][api-on-exit-error], +[`Options`][api-options], +[`Token`][api-token], +[`Transform`][api-transform], and +[`Value`][api-value]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-from-markdown@^2`, compatible with Node.js 16. + +## Security + +As markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][wikipedia-xss] attack, use of `mdast-util-from-markdown` +can also be unsafe. +When going to HTML, use this utility in combination with +[`hast-util-sanitize`][github-hast-util-sanitize] to make the tree safe. + +## Related + +* [`syntax-tree/mdast-util-to-markdown`](https://github.com/syntax-tree/mdast-util-to-markdown) + — serialize mdast as markdown +* [`micromark/micromark`][github-micromark] + — parse markdown +* [`remarkjs/remark`][github-remark] + — process markdown + +## Contribute + +See [`contributing.md`][health-contributing] +in +[`syntax-tree/.github`][health] +for ways to get started. +See [`support.md`][health-support] for ways to get help. + +This project has a [code of conduct][health-coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][file-license] © [Titus Wormer][wooorm] + + + +[api-compile-context]: #compilecontext + +[api-compile-data]: #compiledata + +[api-encoding]: #encoding + +[api-extension]: #extension + +[api-from-markdown]: #frommarkdownvalue-encoding-options + +[api-handle]: #handle + +[api-on-enter-error]: #onentererror + +[api-on-exit-error]: #onexiterror + +[api-options]: #options + +[api-token]: #token + +[api-transform]: #transform + +[api-value]: #value + +[badge-build-image]: https://github.com/syntax-tree/mdast-util-from-markdown/workflows/main/badge.svg + +[badge-build-url]: https://github.com/syntax-tree/mdast-util-from-markdown/actions + +[badge-coverage-image]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-from-markdown.svg + +[badge-coverage-url]: https://codecov.io/github/syntax-tree/mdast-util-from-markdown + +[badge-downloads-image]: https://img.shields.io/npm/dm/mdast-util-from-markdown.svg + +[badge-downloads-url]: https://www.npmjs.com/package/mdast-util-from-markdown + +[badge-size-image]: https://img.shields.io/bundlejs/size/mdast-util-from-markdown + +[badge-size-url]: https://bundlejs.com/?q=mdast-util-from-markdown + +[esmsh]: https://esm.sh + +[file-license]: license + +[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[github-hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize + +[github-mdast]: https://github.com/syntax-tree/mdast + +[github-mdast-nodes]: https://github.com/syntax-tree/mdast#nodes + +[github-mdast-root]: https://github.com/syntax-tree/mdast#root + +[github-mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive + +[github-mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter + +[github-mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[github-mdast-util-math]: https://github.com/syntax-tree/mdast-util-math + +[github-mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx + +[github-micromark]: https://github.com/micromark/micromark + +[github-micromark-api]: https://github.com/micromark/micromark/tree/main/packages/micromark#micromarkvalue-encoding-options + +[github-micromark-extension]: https://github.com/micromark/micromark#extensions + +[github-remark]: https://github.com/remarkjs/remark + +[github-remark-parse]: https://github.com/remarkjs/remark/tree/main/packages/remark-parse + +[health]: https://github.com/syntax-tree/.github + +[health-coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[health-contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[health-support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[mozilla-uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array + +[node-packages-conditions]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions + +[node-util-encoding]: https://nodejs.org/api/util.html#whatwg-supported-encodings + +[npmjs-install]: https://docs.npmjs.com/cli/install + +[typescript]: https://www.typescriptlang.org + +[wikipedia-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[wooorm]: https://wooorm.com diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa02be6f86bcdbc1d586013becb8d1738bc922b9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.d.ts @@ -0,0 +1 @@ +export { gfmAutolinkLiteralFromMarkdown, gfmAutolinkLiteralToMarkdown } from "./lib/index.js"; diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.js b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.js new file mode 100644 index 0000000000000000000000000000000000000000..029dcffb0070863a1b7d2458818b153db36647f7 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/index.js @@ -0,0 +1,4 @@ +export { + gfmAutolinkLiteralFromMarkdown, + gfmAutolinkLiteralToMarkdown +} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccd2bd554c3ce3f9543e276677bb594b79a12e2d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.d.ts @@ -0,0 +1,18 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM autolink + * literals in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM autolink literals. + */ +export function gfmAutolinkLiteralFromMarkdown(): FromMarkdownExtension; +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM autolink + * literals in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM autolink literals. + */ +export function gfmAutolinkLiteralToMarkdown(): ToMarkdownExtension; +import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown'; +import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown'; diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.js b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c5ca771c24dd914e342f791716a822431ee32b3a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/lib/index.js @@ -0,0 +1,280 @@ +/** + * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace' + * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown' + * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown' + * @import {Link, PhrasingContent} from 'mdast' + */ + +import {ccount} from 'ccount' +import {ok as assert} from 'devlop' +import {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character' +import {findAndReplace} from 'mdast-util-find-and-replace' + +/** @type {ConstructName} */ +const inConstruct = 'phrasing' +/** @type {Array} */ +const notInConstruct = ['autolink', 'link', 'image', 'label'] + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM autolink + * literals in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM autolink literals. + */ +export function gfmAutolinkLiteralFromMarkdown() { + return { + transforms: [transformGfmAutolinkLiterals], + enter: { + literalAutolink: enterLiteralAutolink, + literalAutolinkEmail: enterLiteralAutolinkValue, + literalAutolinkHttp: enterLiteralAutolinkValue, + literalAutolinkWww: enterLiteralAutolinkValue + }, + exit: { + literalAutolink: exitLiteralAutolink, + literalAutolinkEmail: exitLiteralAutolinkEmail, + literalAutolinkHttp: exitLiteralAutolinkHttp, + literalAutolinkWww: exitLiteralAutolinkWww + } + } +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM autolink + * literals in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM autolink literals. + */ +export function gfmAutolinkLiteralToMarkdown() { + return { + unsafe: [ + { + character: '@', + before: '[+\\-.\\w]', + after: '[\\-.\\w]', + inConstruct, + notInConstruct + }, + { + character: '.', + before: '[Ww]', + after: '[\\-.\\w]', + inConstruct, + notInConstruct + }, + { + character: ':', + before: '[ps]', + after: '\\/', + inConstruct, + notInConstruct + } + ] + } +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterLiteralAutolink(token) { + this.enter({type: 'link', title: null, url: '', children: []}, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterLiteralAutolinkValue(token) { + this.config.enter.autolinkProtocol.call(this, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitLiteralAutolinkHttp(token) { + this.config.exit.autolinkProtocol.call(this, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitLiteralAutolinkWww(token) { + this.config.exit.data.call(this, token) + const node = this.stack[this.stack.length - 1] + assert(node.type === 'link') + node.url = 'http://' + this.sliceSerialize(token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitLiteralAutolinkEmail(token) { + this.config.exit.autolinkEmail.call(this, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitLiteralAutolink(token) { + this.exit(token) +} + +/** @type {FromMarkdownTransform} */ +function transformGfmAutolinkLiterals(tree) { + findAndReplace( + tree, + [ + [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl], + [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail] + ], + {ignore: ['link', 'linkReference']} + ) +} + +/** + * @type {ReplaceFunction} + * @param {string} _ + * @param {string} protocol + * @param {string} domain + * @param {string} path + * @param {RegExpMatchObject} match + * @returns {Array | Link | false} + */ +// eslint-disable-next-line max-params +function findUrl(_, protocol, domain, path, match) { + let prefix = '' + + // Not an expected previous character. + if (!previous(match)) { + return false + } + + // Treat `www` as part of the domain. + if (/^w/i.test(protocol)) { + domain = protocol + domain + protocol = '' + prefix = 'http://' + } + + if (!isCorrectDomain(domain)) { + return false + } + + const parts = splitUrl(domain + path) + + if (!parts[0]) return false + + /** @type {Link} */ + const result = { + type: 'link', + title: null, + url: prefix + protocol + parts[0], + children: [{type: 'text', value: protocol + parts[0]}] + } + + if (parts[1]) { + return [result, {type: 'text', value: parts[1]}] + } + + return result +} + +/** + * @type {ReplaceFunction} + * @param {string} _ + * @param {string} atext + * @param {string} label + * @param {RegExpMatchObject} match + * @returns {Link | false} + */ +function findEmail(_, atext, label, match) { + if ( + // Not an expected previous character. + !previous(match, true) || + // Label ends in not allowed character. + /[-\d_]$/.test(label) + ) { + return false + } + + return { + type: 'link', + title: null, + url: 'mailto:' + atext + '@' + label, + children: [{type: 'text', value: atext + '@' + label}] + } +} + +/** + * @param {string} domain + * @returns {boolean} + */ +function isCorrectDomain(domain) { + const parts = domain.split('.') + + if ( + parts.length < 2 || + (parts[parts.length - 1] && + (/_/.test(parts[parts.length - 1]) || + !/[a-zA-Z\d]/.test(parts[parts.length - 1]))) || + (parts[parts.length - 2] && + (/_/.test(parts[parts.length - 2]) || + !/[a-zA-Z\d]/.test(parts[parts.length - 2]))) + ) { + return false + } + + return true +} + +/** + * @param {string} url + * @returns {[string, string | undefined]} + */ +function splitUrl(url) { + const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url) + + if (!trailExec) { + return [url, undefined] + } + + url = url.slice(0, trailExec.index) + + let trail = trailExec[0] + let closingParenIndex = trail.indexOf(')') + const openingParens = ccount(url, '(') + let closingParens = ccount(url, ')') + + while (closingParenIndex !== -1 && openingParens > closingParens) { + url += trail.slice(0, closingParenIndex + 1) + trail = trail.slice(closingParenIndex + 1) + closingParenIndex = trail.indexOf(')') + closingParens++ + } + + return [url, trail] +} + +/** + * @param {RegExpMatchObject} match + * @param {boolean | null | undefined} [email=false] + * @returns {boolean} + */ +function previous(match, email) { + const code = match.input.charCodeAt(match.index - 1) + + return ( + (match.index === 0 || + unicodeWhitespace(code) || + unicodePunctuation(code)) && + // If it’s an email, the previous character should not be a slash. + (!email || code !== 47) + ) +} diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/license b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/license new file mode 100644 index 0000000000000000000000000000000000000000..39372356c47d0f6e070ff62d84c69f4f5e8c16eb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/package.json b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b0fea137d57a27c515a5e9c91ef5b093437905c8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/package.json @@ -0,0 +1,106 @@ +{ + "name": "mdast-util-gfm-autolink-literal", + "version": "2.0.1", + "description": "mdast extension to parse and serialize GFM autolink literals", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "autolink", + "auto", + "link", + "literal", + "url", + "raw", + "gfm" + ], + "repository": "syntax-tree/mdast-util-gfm-autolink-literal", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm-autolink-literal/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "hast-util-to-html": "^9.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-hast": "^13.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.59.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api-prod": "node --conditions production test/index.js", + "test-api-dev": "node --conditions development test/index.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": "test/**/*.js", + "rules": { + "no-await-in-loop": "off" + } + } + ], + "prettier": true, + "rules": { + "unicorn/prefer-at": "off", + "unicorn/prefer-code-point": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-autolink-literal/readme.md b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..309466e2b0c8e1002fb2b075e04f7658ae094440 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-autolink-literal/readme.md @@ -0,0 +1,334 @@ +# mdast-util-gfm-autolink-literal + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] autolink literals. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmAutolinkLiteralFromMarkdown()`](#gfmautolinkliteralfrommarkdown) + * [`gfmAutolinkLiteralToMarkdown()`](#gfmautolinkliteraltomarkdown) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM autolink literals +syntax in markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +GFM autolinks in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +GFM autolinks in syntax trees to markdown). + +GitHub employs different algorithms to autolink: one at parse time and one at +transform time (similar to how `@mentions` are done at transform time). +This difference can be observed because character references and escapes are +handled differently. +But also because issues/PRs/comments omit (perhaps by accident?) the second +algorithm for `www.`, `http://`, and `https://` links (but not for email links). + +As the corresponding micromark extension +[`micromark-extension-gfm-autolink-literal`][extension] is a syntax extension, +it can only perform the first algorithm. +The tree extension `gfmAutolinkLiteralFromMarkdown` from this package can +perform the second algorithm, and as they are combined, both are done. + +## When to use this + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with +[`micromark-extension-gfm-autolink-literal`][extension]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with `micromark-extension-gfm-autolink-literal`. + +When you are working with syntax trees and want all of GFM, use +[`mdast-util-gfm`][mdast-util-gfm] instead. + +All these packages are used [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm-autolink-literal +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmAutolinkLiteralFromMarkdown, gfmAutolinkLiteralToMarkdown} from 'https://esm.sh/mdast-util-gfm-autolink-literal@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +www.example.com, https://example.com, and contact@example.com. +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {gfmAutolinkLiteral} from 'micromark-extension-gfm-autolink-literal' +import {fromMarkdown} from 'mdast-util-from-markdown' +import { + gfmAutolinkLiteralFromMarkdown, + gfmAutolinkLiteralToMarkdown +} from 'mdast-util-gfm-autolink-literal' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') + +const tree = fromMarkdown(doc, { + extensions: [gfmAutolinkLiteral()], + mdastExtensions: [gfmAutolinkLiteralFromMarkdown()] +}) + +console.log(tree) + +const out = toMarkdown(tree, {extensions: [gfmAutolinkLiteralToMarkdown()]}) + +console.log(out) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'link', + title: null, + url: 'http://www.example.com', + children: [{type: 'text', value: 'www.example.com'}] + }, + {type: 'text', value: ', '}, + { + type: 'link', + title: null, + url: 'https://example.com', + children: [{type: 'text', value: 'https://example.com'}] + }, + {type: 'text', value: ', and '}, + { + type: 'link', + title: null, + url: 'mailto:contact@example.com', + children: [{type: 'text', value: 'contact@example.com'}] + }, + {type: 'text', value: '.'} + ] + } + ] +} +``` + +```markdown +[www.example.com](http://www.example.com), , and . +``` + +## API + +This package exports the identifiers +[`gfmAutolinkLiteralFromMarkdown`][api-gfm-autolink-literal-from-markdown] and +[`gfmAutolinkLiteralToMarkdown`][api-gfm-autolink-literal-to-markdown]. +There is no default export. + +### `gfmAutolinkLiteralFromMarkdown()` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM autolink literals in markdown. + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM autolink literals +([`FromMarkdownExtension`][from-markdown-extension]). + +### `gfmAutolinkLiteralToMarkdown()` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to +enable GFM autolink literals in markdown. + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM autolink literals +([`ToMarkdownExtension`][to-markdown-extension]). + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Syntax + +See [Syntax in `micromark-extension-gfm-autolink-literal`][syntax]. + +## Syntax tree + +There are no interfaces added to **[mdast][]** by this utility, as it reuses +the existing **[Link][dfn-link]** interface. + +## Types + +This package is fully typed with [TypeScript][]. +It does not export additional types. + +The `Link` type of the mdast nodes is exposed from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-gfm-autolink-literal@^2`, compatible with Node.js 16. + +This utility works with `mdast-util-from-markdown` version 2+ and +`mdast-util-to-markdown` version 2+. + +## Related + +* [`remarkjs/remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm] + — same but all of GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`micromark/micromark-extension-gfm-autolink-literal`][extension] + — micromark extension to parse GFM autolink literals + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-autolink-literal/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm-autolink-literal/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-autolink-literal.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-autolink-literal + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-autolink-literal.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm-autolink-literal + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-autolink-literal + +[size]: https://bundlejs.com/?q=mdast-util-gfm-autolink-literal + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[micromark]: https://github.com/micromark/micromark + +[extension]: https://github.com/micromark/micromark-extension-gfm-autolink-literal + +[syntax]: https://github.com/micromark/micromark-extension-gfm-autolink-literal#syntax + +[gfm]: https://github.github.com/gfm/ + +[dfn-link]: https://github.com/syntax-tree/mdast#link + +[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[api-gfm-autolink-literal-from-markdown]: #gfmautolinkliteralfrommarkdown + +[api-gfm-autolink-literal-to-markdown]: #gfmautolinkliteraltomarkdown diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-footnote/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ff949a35b2cfc43477d5414d990fc0a4c3b4b99 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/index.d.ts @@ -0,0 +1,34 @@ +export {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from './lib/index.js' + +export interface ToMarkdownOptions { + // To do: next major: change default. + /** + * Use a blank line for the first line of footnote definitions + * (`boolean`, default: `false`). + */ + firstLineBlank?: boolean | null | undefined +} + +declare module 'mdast-util-to-markdown' { + interface ConstructNameMap { + /** + * Footnote definition. + * + * ```markdown + * > | [^a]: B. + * ^^^^^^^^ + * ``` + */ + footnoteDefinition: 'footnoteDefinition' + + /** + * Footnote reference. + * + * ```markdown + * > | A[^b]. + * ^^^^ + * ``` + */ + footnoteReference: 'footnoteReference' + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/index.js b/tools/ui/node_modules/mdast-util-gfm-footnote/index.js new file mode 100644 index 0000000000000000000000000000000000000000..be45f3aecf2b3c6b0eccbc9bec658b6177a77157 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/index.js @@ -0,0 +1,2 @@ +// Note: extra types exported from `index.d.ts`. +export {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..07a032debfa78a483a9f32b5fbf1fa5a1f63880e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts @@ -0,0 +1,22 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes + * in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown`. + */ +export function gfmFootnoteFromMarkdown(): FromMarkdownExtension; +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes + * in markdown. + * + * @param {ToMarkdownOptions | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown`. + */ +export function gfmFootnoteToMarkdown(options?: ToMarkdownOptions | null | undefined): ToMarkdownExtension; +import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown'; +import type { ToMarkdownOptions } from 'mdast-util-gfm-footnote'; +import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2f429c43e76a8c3cc62a9b97b69ea9ee3c333b60 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA0HA;;;;;;GAMG;AACH,2CAHa,qBAAqB,CAkBjC;AAED;;;;;;;;GAQG;AACH,gDALW,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAElC,mBAAmB,CAiD/B;wDApMS,0BAA0B;uCACA,yBAAyB;oDAKnD,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.js b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1930f5723719c23a321e9e0aaab890d1cf3d660d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/lib/index.js @@ -0,0 +1,212 @@ +/** + * @import { + * CompileContext, + * Extension as FromMarkdownExtension, + * Handle as FromMarkdownHandle + * } from 'mdast-util-from-markdown' + * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote' + * @import { + * Handle as ToMarkdownHandle, + * Map, + * Options as ToMarkdownExtension + * } from 'mdast-util-to-markdown' + * @import {FootnoteDefinition, FootnoteReference} from 'mdast' + */ + +import {ok as assert} from 'devlop' +import {normalizeIdentifier} from 'micromark-util-normalize-identifier' + +footnoteReference.peek = footnoteReferencePeek + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterFootnoteCallString() { + this.buffer() +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterFootnoteCall(token) { + this.enter({type: 'footnoteReference', identifier: '', label: ''}, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterFootnoteDefinitionLabelString() { + this.buffer() +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterFootnoteDefinition(token) { + this.enter( + {type: 'footnoteDefinition', identifier: '', label: '', children: []}, + token + ) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitFootnoteCallString(token) { + const label = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node.type === 'footnoteReference') + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + node.label = label +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitFootnoteCall(token) { + this.exit(token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitFootnoteDefinitionLabelString(token) { + const label = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node.type === 'footnoteDefinition') + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase() + node.label = label +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitFootnoteDefinition(token) { + this.exit(token) +} + +/** @type {ToMarkdownHandle} */ +function footnoteReferencePeek() { + return '[' +} + +/** + * @type {ToMarkdownHandle} + * @param {FootnoteReference} node + */ +function footnoteReference(node, _, state, info) { + const tracker = state.createTracker(info) + let value = tracker.move('[^') + const exit = state.enter('footnoteReference') + const subexit = state.enter('reference') + value += tracker.move( + state.safe(state.associationId(node), {after: ']', before: value}) + ) + subexit() + exit() + value += tracker.move(']') + return value +} + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes + * in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown`. + */ +export function gfmFootnoteFromMarkdown() { + return { + enter: { + gfmFootnoteCallString: enterFootnoteCallString, + gfmFootnoteCall: enterFootnoteCall, + gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString, + gfmFootnoteDefinition: enterFootnoteDefinition + }, + exit: { + gfmFootnoteCallString: exitFootnoteCallString, + gfmFootnoteCall: exitFootnoteCall, + gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString, + gfmFootnoteDefinition: exitFootnoteDefinition + } + } +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes + * in markdown. + * + * @param {ToMarkdownOptions | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown`. + */ +export function gfmFootnoteToMarkdown(options) { + // To do: next major: change default. + let firstLineBlank = false + + if (options && options.firstLineBlank) { + firstLineBlank = true + } + + return { + handlers: {footnoteDefinition, footnoteReference}, + // This is on by default already. + unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}] + } + + /** + * @type {ToMarkdownHandle} + * @param {FootnoteDefinition} node + */ + function footnoteDefinition(node, _, state, info) { + const tracker = state.createTracker(info) + let value = tracker.move('[^') + const exit = state.enter('footnoteDefinition') + const subexit = state.enter('label') + value += tracker.move( + state.safe(state.associationId(node), {before: value, after: ']'}) + ) + subexit() + + value += tracker.move(']:') + + if (node.children && node.children.length > 0) { + tracker.shift(4) + + value += tracker.move( + (firstLineBlank ? '\n' : ' ') + + state.indentLines( + state.containerFlow(node, tracker.current()), + firstLineBlank ? mapAll : mapExceptFirst + ) + ) + } + + exit() + + return value + } +} + +/** @type {Map} */ +function mapExceptFirst(line, index, blank) { + return index === 0 ? line : mapAll(line, index, blank) +} + +/** @type {Map} */ +function mapAll(line, index, blank) { + return (blank ? '' : ' ') + line +} diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/license b/tools/ui/node_modules/mdast-util-gfm-footnote/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/package.json b/tools/ui/node_modules/mdast-util-gfm-footnote/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9cc9972550dc9fee5ef4263afcccb453f7677e8b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/package.json @@ -0,0 +1,111 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm-footnote/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "description": "mdast extension to parse and serialize GFM footnotes", + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.60.0" + }, + "exports": "./index.js", + "files": [ + "index.d.ts", + "index.js", + "lib/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "footnote", + "gfm", + "markdown", + "markup", + "mdast-util", + "mdast", + "note", + "unist", + "utility", + "util" + ], + "license": "MIT", + "name": "mdast-util-gfm-footnote", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "syntax-tree/mdast-util-gfm-footnote", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", + "test-api-dev": "node --conditions development test.js", + "test-api-prod": "node --conditions production test.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "strict": true + }, + "type": "module", + "version": "2.1.0", + "xo": { + "overrides": [ + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] + } + } + ], + "prettier": true, + "rules": { + "unicorn/prefer-at": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-footnote/readme.md b/tools/ui/node_modules/mdast-util-gfm-footnote/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..b3fda5790c961cc5b9d180d8862e58e650b19726 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-footnote/readme.md @@ -0,0 +1,494 @@ +# mdast-util-gfm-footnote + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] footnotes. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmFootnoteFromMarkdown()`](#gfmfootnotefrommarkdown) + * [`gfmFootnoteToMarkdown(options?)`](#gfmfootnotetomarkdownoptions) + * [`ToMarkdownOptions`](#tomarkdownoptions) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) + * [Content model](#content-model) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM footnote syntax +in markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +footnotes in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +footnotes in syntax trees to markdown). + +GFM footnotes were [announced September 30, 2021][post] but are not specified. +Their implementation on github.com is currently buggy. +The bugs have been reported on [`cmark-gfm`][cmark-gfm]. + +## When to use this + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with `micromark-extension-gfm-footnote`. + +When you are working with syntax trees and want all of GFM, use +[`mdast-util-gfm`][mdast-util-gfm] instead. + +All these packages are used [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. +If your content is not in English, you should configure that utility. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm-footnote +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from 'https://esm.sh/mdast-util-gfm-footnote@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts. + +[^mercury]: + **Mercury** is the first planet from the Sun and the smallest + in the Solar System. + +[^venus]: + **Venus** is the second planet from + the Sun. +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {fromMarkdown} from 'mdast-util-from-markdown' +import { + gfmFootnoteFromMarkdown, + gfmFootnoteToMarkdown +} from 'mdast-util-gfm-footnote' +import {toMarkdown} from 'mdast-util-to-markdown' +import {gfmFootnote} from 'micromark-extension-gfm-footnote' + +const value = await fs.readFile('example.md', 'utf8') + +const tree = fromMarkdown(value, { + extensions: [gfmFootnote()], + mdastExtensions: [gfmFootnoteFromMarkdown()] +}) + +console.log(tree) + +const result = toMarkdown(tree, { + extensions: [gfmFootnoteToMarkdown({firstLineBlank: true})] +}) + +console.log(result) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + {type: 'text', value: 'In the Solar System, Mercury'}, + {type: 'footnoteReference', identifier: 'mercury', label: 'mercury'}, + {type: 'text', value: ' and Venus'}, + {type: 'footnoteReference', identifier: 'venus', label: 'venus'}, + {type: 'text', value: ' have very small tilts.'} + ] + }, + { + type: 'footnoteDefinition', + identifier: 'mercury', + label: 'mercury', + children: [ + { + type: 'paragraph', + children: [ + {type: 'strong', children: [{type: 'text', value: 'Mercury'}]}, + { + type: 'text', + value: + ' is the first planet from the Sun and the smallest\n' + + 'in the Solar System.' + } + ] + } + ] + }, + { + type: 'footnoteDefinition', + identifier: 'venus', + label: 'venus', + children: [ + { + type: 'paragraph', + children: [ + {type: 'strong', children: [{type: 'text', value: 'Venus'}]}, + {type: 'text', value: ' is the second planet from\nthe Sun.'} + ] + } + ] + } + ] +} +``` + +```markdown +In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts. + +[^mercury]: + **Mercury** is the first planet from the Sun and the smallest + in the Solar System. + +[^venus]: + **Venus** is the second planet from + the Sun. +``` + +## API + +This package exports the identifiers +[`gfmFootnoteFromMarkdown`][api-gfmfootnotefrommarkdown] and +[`gfmFootnoteToMarkdown`][api-gfmfootnotetomarkdown]. +There is no default export. +It exports the type [`ToMarkdownOptions`][api-to-markdown-options]. + +### `gfmFootnoteFromMarkdown()` + +Create an extension for +[`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM footnotes in markdown. + +###### Returns + +Extension for `mdast-util-from-markdown` +([`FromMarkdownExtension`][frommarkdownextension]). + +### `gfmFootnoteToMarkdown(options?)` + +Create an extension for +[`mdast-util-to-markdown`][mdast-util-to-markdown] +to enable GFM footnotes in markdown. + +###### Parameters + +* `options` ([`ToMarkdownOptions`][api-to-markdown-options], optional) + — configuration + +###### Returns + +Extension for `mdast-util-to-markdown` +([`ToMarkdownExtension`][tomarkdownextension]). + +### `ToMarkdownOptions` + +Configuration (TypeScript type). + +###### Fields + +* `firstLineBlank` (`boolean`, default: `false`) + — use a blank line for the first line of footnote definitions + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. +If your content is not in English, you should configure that utility. + +## Syntax + +See [Syntax in `micromark-extension-gfm-footnote`][syntax]. + +## Syntax tree + +The following interfaces are added to **[mdast][]** by this utility. + +### Nodes + +#### `FootnoteDefinition` + +```idl +interface FootnoteDefinition <: Parent { + type: 'footnoteDefinition' + children: [FlowContent] +} + +FootnoteDefinition includes Association +``` + +**FootnoteDefinition** (**[Parent][dfn-parent]**) represents content relating +to the document that is outside its flow. + +**FootnoteDefinition** can be used where **[flow][dfn-flow-content]** content +is expected. +Its content model is also **[flow][dfn-flow-content]** content. + +**FootnoteDefinition** includes the mixin +**[Association][dfn-mxn-association]**. + +**FootnoteDefinition** should be associated with +**[FootnoteReferences][dfn-footnote-reference]**. + +For example, the following markdown: + +```markdown +[^alpha]: bravo and charlie. +``` + +Yields: + +```js +{ + type: 'footnoteDefinition', + identifier: 'alpha', + label: 'alpha', + children: [{ + type: 'paragraph', + children: [{type: 'text', value: 'bravo and charlie.'}] + }] +} +``` + +#### `FootnoteReference` + +```idl +interface FootnoteReference <: Node { + type: 'footnoteReference' +} + +FootnoteReference includes Association +``` + +**FootnoteReference** (**[Node][dfn-node]**) represents a marker through +association. + +**FootnoteReference** can be used where +**[phrasing][dfn-phrasing-content]** content is expected. +It has no content model. + +**FootnoteReference** includes the mixin **[Association][dfn-mxn-association]**. + +**FootnoteReference** should be associated with a +**[FootnoteDefinition][dfn-footnote-definition]**. + +For example, the following markdown: + +```markdown +[^alpha] +``` + +Yields: + +```js +{ + type: 'footnoteReference', + identifier: 'alpha', + label: 'alpha' +} +``` + +### Content model + +#### `FlowContent` (GFM footnotes) + +```idl +type FlowContentGfm = FootnoteDefinition | FlowContent +``` + +#### `PhrasingContent` (GFM footnotes) + +```idl +type PhrasingContentGfm = FootnoteReference | PhrasingContent +``` + +## Types + +This package is fully typed with [TypeScript][]. +It does not export additional types. + +The `FootnoteDefinition` and `FootnoteReference` types of the mdast nodes are +exposed from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-gfm-footnote@^2`, compatible with Node.js 16. + +## Related + +* [`remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`mdast-util-gfm`][mdast-util-gfm] + — same but all of GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote] + — micromark extension to parse GFM footnotes + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[api-gfmfootnotefrommarkdown]: #gfmfootnotefrommarkdown + +[api-gfmfootnotetomarkdown]: #gfmfootnotetomarkdownoptions + +[api-to-markdown-options]: #tomarkdownoptions + +[author]: https://wooorm.com + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm-footnote/actions + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-footnote/workflows/main/badge.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[cmark-gfm]: https://github.com/github/cmark-gfm + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[collective]: https://opencollective.com/unified + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-footnote + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-footnote.svg + +[dfn-flow-content]: #flowcontent-gfm-footnotes + +[dfn-footnote-definition]: #footnotedefinition + +[dfn-footnote-reference]: #footnotereference + +[dfn-mxn-association]: https://github.com/syntax-tree/mdast#association + +[dfn-node]: https://github.com/syntax-tree/unist#node + +[dfn-parent]: https://github.com/syntax-tree/mdast#parent + +[dfn-phrasing-content]: #phrasingcontent-gfm-footnotes + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm-footnote + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-footnote.svg + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[gfm]: https://github.github.com/gfm/ + +[health]: https://github.com/syntax-tree/.github + +[license]: license + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[micromark]: https://github.com/micromark/micromark + +[micromark-extension-gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote + +[npm]: https://docs.npmjs.com/cli/install + +[post]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/ + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[size]: https://bundlejs.com/?q=mdast-util-gfm-footnote + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-footnote + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[syntax]: https://github.com/micromark/micromark-extension-gfm-footnote#syntax + +[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[typescript]: https://www.typescriptlang.org diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3b616a17953193070f3831df960eb0e6feab998 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.d.ts @@ -0,0 +1,19 @@ +export { + gfmStrikethroughFromMarkdown, + gfmStrikethroughToMarkdown +} from './lib/index.js' + +// Add custom data tracked to turn a syntax tree into markdown. +declare module 'mdast-util-to-markdown' { + interface ConstructNameMap { + /** + * Whole strikethrough. + * + * ```markdown + * > | ~~a~~ + * ^^^^^ + * ``` + */ + strikethrough: 'strikethrough' + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.js b/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.js new file mode 100644 index 0000000000000000000000000000000000000000..97c87f60cc6f23873bb892f540d57e6499d3c4dd --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/index.js @@ -0,0 +1,5 @@ +// Note: extra types in `index.d.ts`. +export { + gfmStrikethroughFromMarkdown, + gfmStrikethroughToMarkdown +} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a6fec2dd0b62c3d8cd7b60dc5cc6445a13698f8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.d.ts @@ -0,0 +1,23 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM + * strikethrough in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM strikethrough. + */ +export function gfmStrikethroughFromMarkdown(): FromMarkdownExtension +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM + * strikethrough in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM strikethrough. + */ +export function gfmStrikethroughToMarkdown(): ToMarkdownExtension +export type Delete = import('mdast').Delete +export type CompileContext = import('mdast-util-from-markdown').CompileContext +export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension +export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle +export type ConstructName = import('mdast-util-to-markdown').ConstructName +export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle +export type ToMarkdownExtension = import('mdast-util-to-markdown').Options diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.js b/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1a1463967110645620d922832c95e0f85e727b71 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/lib/index.js @@ -0,0 +1,106 @@ +/** + * @typedef {import('mdast').Delete} Delete + * + * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext + * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension + * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle + * + * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName + * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle + * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension + */ + +/** + * List of constructs that occur in phrasing (paragraphs, headings), but cannot + * contain strikethrough. + * So they sort of cancel each other out. + * Note: could use a better name. + * + * Note: keep in sync with: + * + * @type {Array} + */ +const constructsWithoutStrikethrough = [ + 'autolink', + 'destinationLiteral', + 'destinationRaw', + 'reference', + 'titleQuote', + 'titleApostrophe' +] + +handleDelete.peek = peekDelete + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM + * strikethrough in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM strikethrough. + */ +export function gfmStrikethroughFromMarkdown() { + return { + canContainEols: ['delete'], + enter: {strikethrough: enterStrikethrough}, + exit: {strikethrough: exitStrikethrough} + } +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM + * strikethrough in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM strikethrough. + */ +export function gfmStrikethroughToMarkdown() { + return { + unsafe: [ + { + character: '~', + inConstruct: 'phrasing', + notInConstruct: constructsWithoutStrikethrough + } + ], + handlers: {delete: handleDelete} + } +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterStrikethrough(token) { + this.enter({type: 'delete', children: []}, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitStrikethrough(token) { + this.exit(token) +} + +/** + * @type {ToMarkdownHandle} + * @param {Delete} node + */ +function handleDelete(node, _, state, info) { + const tracker = state.createTracker(info) + const exit = state.enter('strikethrough') + let value = tracker.move('~~') + value += state.containerPhrasing(node, { + ...tracker.current(), + before: value, + after: '~' + }) + value += tracker.move('~~') + exit() + return value +} + +/** @type {ToMarkdownHandle} */ +function peekDelete() { + return '~' +} diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/license b/tools/ui/node_modules/mdast-util-gfm-strikethrough/license new file mode 100644 index 0000000000000000000000000000000000000000..39372356c47d0f6e070ff62d84c69f4f5e8c16eb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/package.json b/tools/ui/node_modules/mdast-util-gfm-strikethrough/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d24d63fc36f42e8ea8443ad6b1a70eb5a11ca926 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/package.json @@ -0,0 +1,99 @@ +{ + "name": "mdast-util-gfm-strikethrough", + "version": "2.0.0", + "description": "mdast extension to parse and serialize GFM strikethrough", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "strikethrough", + "strike", + "through", + "del", + "delete", + "deletion", + "gfm" + ], + "repository": "syntax-tree/mdast-util-gfm-strikethrough", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm-strikethrough/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-util-remove-position": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api-prod": "node --conditions production test.js", + "test-api-dev": "node --conditions development test.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/consistent-type-definitions": "off" + } + } + ], + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-strikethrough/readme.md b/tools/ui/node_modules/mdast-util-gfm-strikethrough/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d192cea620865c334f1cc7bbbf32ccd9777c7489 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-strikethrough/readme.md @@ -0,0 +1,350 @@ +# mdast-util-gfm-strikethrough + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] strikethrough. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmStrikethroughFromMarkdown()`](#gfmstrikethroughfrommarkdown) + * [`gfmStrikethroughToMarkdown()`](#gfmstrikethroughtomarkdown) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) + * [Content model](#content-model) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM strikethrough +syntax in markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +strikethrough in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +strikethrough in syntax trees to markdown). + +## When to use this + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with [`micromark-extension-gfm-strikethrough`][extension]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with `micromark-extension-gfm-strikethrough`. + +When you are working with syntax trees and want all of GFM, use +[`mdast-util-gfm`][mdast-util-gfm] instead. + +All these packages are used [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. +If you want a different element, you should configure that utility. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm-strikethrough +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'https://esm.sh/mdast-util-gfm-strikethrough@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +*Emphasis*, **importance**, and ~~strikethrough~~. +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'mdast-util-gfm-strikethrough' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') + +const tree = fromMarkdown(doc, { + extensions: [gfmStrikethrough()], + mdastExtensions: [gfmStrikethroughFromMarkdown()] +}) + +console.log(tree) + +const out = toMarkdown(tree, {extensions: [gfmStrikethroughToMarkdown()]}) + +console.log(out) +``` + +Now, running `node example` yields: + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + {type: 'emphasis', children: [{type: 'text', value: 'Emphasis'}]}, + {type: 'text', value: ', '}, + {type: 'strong', children: [{type: 'text', value: 'importance'}]}, + {type: 'text', value: ', and '}, + {type: 'delete', children: [{type: 'text', value: 'strikethrough'}]}, + {type: 'text', value: '.'} + ] + } + ] +} +``` + +```markdown +*Emphasis*, **importance**, and ~~strikethrough~~. +``` + +## API + +This package exports the identifiers +[`gfmStrikethroughFromMarkdown`][api-gfm-strikethrough-from-markdown] and +[`gfmStrikethroughToMarkdown`][api-gfm-strikethrough-to-markdown]. +There is no default export. + +### `gfmStrikethroughFromMarkdown()` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM strikethrough in markdown. + +###### Returns + +Extension for `mdast-util-from-markdown` to enable GFM strikethrough +([`FromMarkdownExtension`][from-markdown-extension]). + +### `gfmStrikethroughToMarkdown()` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to +enable GFM strikethrough in markdown. + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM strikethrough +([`ToMarkdownExtension`][to-markdown-extension]). + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. +If you want a different element, you should configure that utility. + +## Syntax + +See [Syntax in `micromark-extension-gfm-strikethrough`][syntax]. + +## Syntax tree + +The following interfaces are added to **[mdast][]** by this utility. + +### Nodes + +#### `Delete` + +```idl +interface Delete <: Parent { + type: 'delete' + children: [TransparentContent] +} +``` + +**Delete** (**[Parent][dfn-parent]**) represents contents that are no longer +accurate or no longer relevant. + +**Delete** can be used where **[phrasing][dfn-phrasing-content]** +content is expected. +Its content model is **[transparent][dfn-transparent-content]** content. + +For example, the following markdown: + +```markdown +~~alpha~~ +``` + +Yields: + +```js +{ + type: 'delete', + children: [{type: 'text', value: 'alpha'}] +} +``` + +### Content model + +#### `PhrasingContent` (GFM strikethrough) + +```idl +type PhrasingContentGfm = Delete | PhrasingContent +``` + +## Types + +This package is fully typed with [TypeScript][]. +It does not export additional types. + +The `Delete` type of the mdast node is exposed from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-gfm-strikethrough@^2`, compatible with Node.js 16. + +This utility works with `mdast-util-from-markdown` version 2+ and +`mdast-util-to-markdown` version 2+. + +## Related + +* [`remarkjs/remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm] + — same but all of GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`micromark/micromark-extension-gfm-strikethrough`][extension] + — micromark extension to parse GFM strikethrough + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-strikethrough.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-strikethrough + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-strikethrough.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm-strikethrough + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-strikethrough + +[size]: https://bundlejs.com/?q=mdast-util-gfm-strikethrough + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[gfm]: https://github.github.com/gfm/ + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[mdast]: https://github.com/syntax-tree/mdast + +[dfn-transparent-content]: https://github.com/syntax-tree/mdast#transparentcontent + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[micromark]: https://github.com/micromark/micromark + +[extension]: https://github.com/micromark/micromark-extension-gfm-strikethrough + +[syntax]: https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax + +[dfn-parent]: https://github.com/syntax-tree/mdast#parent + +[dfn-phrasing-content]: #phrasingcontent-gfm-strikethrough + +[api-gfm-strikethrough-from-markdown]: #gfmstrikethroughfrommarkdown + +[api-gfm-strikethrough-to-markdown]: #gfmstrikethroughtomarkdown diff --git a/tools/ui/node_modules/mdast-util-gfm-table/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-table/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f616ca16b1ccb5d536d104648e2938785f6dfffa --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/index.d.ts @@ -0,0 +1,54 @@ +export type {Options} from './lib/index.js' + +export {gfmTableFromMarkdown, gfmTableToMarkdown} from './lib/index.js' + +// Add custom data tracked to turn markdown into a tree. +declare module 'mdast-util-from-markdown' { + interface CompileData { + /** + * Whether we’re currently in a table. + */ + inTable?: boolean | undefined + } +} + +// Add custom data tracked to turn a syntax tree into markdown. +declare module 'mdast-util-to-markdown' { + interface ConstructNameMap { + /** + * Whole table. + * + * ```markdown + * > | | a | + * ^^^^^ + * > | | - | + * ^^^^^ + * ``` + */ + table: 'table' + + /** + * Table cell. + * + * ```markdown + * > | | a | + * ^^^^^ + * | | - | + * ``` + */ + tableCell: 'tableCell' + + /** + * Table row. + * + * ```markdown + * > | | a | + * ^^^^^ + * | | - | + * ``` + */ + tableRow: 'tableRow' + } +} + +// Note: `Table` is exposed from `@types/mdast`. diff --git a/tools/ui/node_modules/mdast-util-gfm-table/index.js b/tools/ui/node_modules/mdast-util-gfm-table/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3f2bab47277b78ba82614cfdb8454676479a2b59 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/index.js @@ -0,0 +1,2 @@ +// Note: types exposed from `index.d.ts`. +export {gfmTableFromMarkdown, gfmTableToMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-table/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-table/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a395fc752e4c3e707ef620be347303e0625f262f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/lib/index.d.ts @@ -0,0 +1,51 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM tables in + * markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM tables. + */ +export function gfmTableFromMarkdown(): FromMarkdownExtension +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM tables in + * markdown. + * + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM tables. + */ +export function gfmTableToMarkdown( + options?: Options | null | undefined +): ToMarkdownExtension +export type InlineCode = import('mdast').InlineCode +export type Table = import('mdast').Table +export type TableCell = import('mdast').TableCell +export type TableRow = import('mdast').TableRow +export type MarkdownTableOptions = import('markdown-table').Options +export type CompileContext = import('mdast-util-from-markdown').CompileContext +export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension +export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle +export type ToMarkdownExtension = import('mdast-util-to-markdown').Options +export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle +export type State = import('mdast-util-to-markdown').State +export type Info = import('mdast-util-to-markdown').Info +/** + * Configuration. + */ +export type Options = { + /** + * Whether to add a space of padding between delimiters and cells (default: + * `true`). + */ + tableCellPadding?: boolean | null | undefined + /** + * Whether to align the delimiters (default: `true`). + */ + tablePipeAlign?: boolean | null | undefined + /** + * Function to detect the length of table cell content, used when aligning + * the delimiters between cells (optional). + */ + stringLength?: MarkdownTableOptions['stringLength'] | null | undefined +} diff --git a/tools/ui/node_modules/mdast-util-gfm-table/lib/index.js b/tools/ui/node_modules/mdast-util-gfm-table/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..11e51158c5cece45ab736893d257fa98aef6cede --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/lib/index.js @@ -0,0 +1,300 @@ +/** + * @typedef {import('mdast').InlineCode} InlineCode + * @typedef {import('mdast').Table} Table + * @typedef {import('mdast').TableCell} TableCell + * @typedef {import('mdast').TableRow} TableRow + * + * @typedef {import('markdown-table').Options} MarkdownTableOptions + * + * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext + * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension + * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle + * + * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension + * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle + * @typedef {import('mdast-util-to-markdown').State} State + * @typedef {import('mdast-util-to-markdown').Info} Info + */ + +/** + * @typedef Options + * Configuration. + * @property {boolean | null | undefined} [tableCellPadding=true] + * Whether to add a space of padding between delimiters and cells (default: + * `true`). + * @property {boolean | null | undefined} [tablePipeAlign=true] + * Whether to align the delimiters (default: `true`). + * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength] + * Function to detect the length of table cell content, used when aligning + * the delimiters between cells (optional). + */ + +import {ok as assert} from 'devlop' +import {markdownTable} from 'markdown-table' +import {defaultHandlers} from 'mdast-util-to-markdown' + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM tables in + * markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM tables. + */ +export function gfmTableFromMarkdown() { + return { + enter: { + table: enterTable, + tableData: enterCell, + tableHeader: enterCell, + tableRow: enterRow + }, + exit: { + codeText: exitCodeText, + table: exitTable, + tableData: exit, + tableHeader: exit, + tableRow: exit + } + } +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterTable(token) { + const align = token._align + assert(align, 'expected `_align` on table') + this.enter( + { + type: 'table', + align: align.map(function (d) { + return d === 'none' ? null : d + }), + children: [] + }, + token + ) + this.data.inTable = true +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitTable(token) { + this.exit(token) + this.data.inTable = undefined +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterRow(token) { + this.enter({type: 'tableRow', children: []}, token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exit(token) { + this.exit(token) +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function enterCell(token) { + this.enter({type: 'tableCell', children: []}, token) +} + +// Overwrite the default code text data handler to unescape escaped pipes when +// they are in tables. +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitCodeText(token) { + let value = this.resume() + + if (this.data.inTable) { + value = value.replace(/\\([\\|])/g, replace) + } + + const node = this.stack[this.stack.length - 1] + assert(node.type === 'inlineCode') + node.value = value + this.exit(token) +} + +/** + * @param {string} $0 + * @param {string} $1 + * @returns {string} + */ +function replace($0, $1) { + // Pipes work, backslashes don’t (but can’t escape pipes). + return $1 === '|' ? $1 : $0 +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM tables in + * markdown. + * + * @param {Options | null | undefined} [options] + * Configuration. + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM tables. + */ +export function gfmTableToMarkdown(options) { + const settings = options || {} + const padding = settings.tableCellPadding + const alignDelimiters = settings.tablePipeAlign + const stringLength = settings.stringLength + const around = padding ? ' ' : '|' + + return { + unsafe: [ + {character: '\r', inConstruct: 'tableCell'}, + {character: '\n', inConstruct: 'tableCell'}, + // A pipe, when followed by a tab or space (padding), or a dash or colon + // (unpadded delimiter row), could result in a table. + {atBreak: true, character: '|', after: '[\t :-]'}, + // A pipe in a cell must be encoded. + {character: '|', inConstruct: 'tableCell'}, + // A colon must be followed by a dash, in which case it could start a + // delimiter row. + {atBreak: true, character: ':', after: '-'}, + // A delimiter row can also start with a dash, when followed by more + // dashes, a colon, or a pipe. + // This is a stricter version than the built in check for lists, thematic + // breaks, and setex heading underlines though: + // + {atBreak: true, character: '-', after: '[:|-]'} + ], + handlers: { + inlineCode: inlineCodeWithTable, + table: handleTable, + tableCell: handleTableCell, + tableRow: handleTableRow + } + } + + /** + * @type {ToMarkdownHandle} + * @param {Table} node + */ + function handleTable(node, _, state, info) { + return serializeData(handleTableAsData(node, state, info), node.align) + } + + /** + * This function isn’t really used normally, because we handle rows at the + * table level. + * But, if someone passes in a table row, this ensures we make somewhat sense. + * + * @type {ToMarkdownHandle} + * @param {TableRow} node + */ + function handleTableRow(node, _, state, info) { + const row = handleTableRowAsData(node, state, info) + const value = serializeData([row]) + // `markdown-table` will always add an align row + return value.slice(0, value.indexOf('\n')) + } + + /** + * @type {ToMarkdownHandle} + * @param {TableCell} node + */ + function handleTableCell(node, _, state, info) { + const exit = state.enter('tableCell') + const subexit = state.enter('phrasing') + const value = state.containerPhrasing(node, { + ...info, + before: around, + after: around + }) + subexit() + exit() + return value + } + + /** + * @param {Array>} matrix + * @param {Array | null | undefined} [align] + */ + function serializeData(matrix, align) { + return markdownTable(matrix, { + align, + // @ts-expect-error: `markdown-table` types should support `null`. + alignDelimiters, + // @ts-expect-error: `markdown-table` types should support `null`. + padding, + // @ts-expect-error: `markdown-table` types should support `null`. + stringLength + }) + } + + /** + * @param {Table} node + * @param {State} state + * @param {Info} info + */ + function handleTableAsData(node, state, info) { + const children = node.children + let index = -1 + /** @type {Array>} */ + const result = [] + const subexit = state.enter('table') + + while (++index < children.length) { + result[index] = handleTableRowAsData(children[index], state, info) + } + + subexit() + + return result + } + + /** + * @param {TableRow} node + * @param {State} state + * @param {Info} info + */ + function handleTableRowAsData(node, state, info) { + const children = node.children + let index = -1 + /** @type {Array} */ + const result = [] + const subexit = state.enter('tableRow') + + while (++index < children.length) { + // Note: the positional info as used here is incorrect. + // Making it correct would be impossible due to aligning cells? + // And it would need copy/pasting `markdown-table` into this project. + result[index] = handleTableCell(children[index], node, state, info) + } + + subexit() + + return result + } + + /** + * @type {ToMarkdownHandle} + * @param {InlineCode} node + */ + function inlineCodeWithTable(node, parent, state) { + let value = defaultHandlers.inlineCode(node, parent, state) + + if (state.stack.includes('tableCell')) { + value = value.replace(/\|/g, '\\$&') + } + + return value + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-table/license b/tools/ui/node_modules/mdast-util-gfm-table/license new file mode 100644 index 0000000000000000000000000000000000000000..39372356c47d0f6e070ff62d84c69f4f5e8c16eb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm-table/package.json b/tools/ui/node_modules/mdast-util-gfm-table/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2ca97be9c218ea42040d54b8b8a65938a859b184 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/package.json @@ -0,0 +1,101 @@ +{ + "name": "mdast-util-gfm-table", + "version": "2.0.0", + "description": "mdast extension to parse and serialize GFM tables", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "table", + "row", + "column", + "cell", + "tabular", + "gfm" + ], + "repository": "syntax-tree/mdast-util-gfm-table", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm-table/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "string-width": "^6.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-util-remove-position": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api-prod": "node --conditions production test.js", + "test-api-dev": "node --conditions development test.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/consistent-type-definitions": "off" + } + } + ], + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-table/readme.md b/tools/ui/node_modules/mdast-util-gfm-table/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..24068931cd733fa6922c8369e626edcfe1699216 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-table/readme.md @@ -0,0 +1,605 @@ +# mdast-util-gfm-table + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] tables. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmTableFromMarkdown`](#gfmtablefrommarkdown) + * [`gfmTableToMarkdown(options?)`](#gfmtabletomarkdownoptions) + * [`Options`](#options) +* [Examples](#examples) + * [Example: `stringLength`](#example-stringlength) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) + * [Enumeration](#enumeration) + * [Content model](#content-model) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM table syntax in +markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +tables in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +tables in syntax trees to markdown). + +## When to use this + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with [`micromark-extension-gfm-table`][extension]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with `micromark-extension-gfm-table`. + +When you are working with syntax trees and want all of GFM, use +[`mdast-util-gfm`][mdast-util-gfm] instead. + +All these packages are used [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm-table +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'https://esm.sh/mdast-util-gfm-table@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +| a | b | c | d | +| - | :- | -: | :-: | +| e | f | +| g | h | i | j | k | +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {gfmTable} from 'micromark-extension-gfm-table' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') + +const tree = fromMarkdown(doc, { + extensions: [gfmTable()], + mdastExtensions: [gfmTableFromMarkdown()] +}) + +console.log(tree) + +const out = toMarkdown(tree, {extensions: [gfmTableToMarkdown()]}) + +console.log(out) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'table', + align: [null, 'left', 'right', 'center'], + children: [ + { + type: 'tableRow', + children: [ + {type: 'tableCell', children: [{type: 'text', value: 'a'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'b'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'c'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'd'}]} + ] + }, + { + type: 'tableRow', + children: [ + {type: 'tableCell', children: [{type: 'text', value: 'e'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'f'}]} + ] + }, + { + type: 'tableRow', + children: [ + {type: 'tableCell', children: [{type: 'text', value: 'g'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'h'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'i'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'j'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'k'}]} + ] + } + ] + } + ] +} +``` + +```markdown +| a | b | c | d | | +| - | :- | -: | :-: | - | +| e | f | | | | +| g | h | i | j | k | +``` + +## API + +This package exports the identifiers +[`gfmTableFromMarkdown`][api-gfm-table-from-markdown] and +[`gfmTableToMarkdown`][api-gfm-table-to-markdown]. +There is no default export. + +### `gfmTableFromMarkdown` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM tables in markdown. + +###### Returns + +Extension for `mdast-util-from-markdown` to enable GFM tables +([`FromMarkdownExtension`][from-markdown-extension]). + +### `gfmTableToMarkdown(options?)` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to +enable GFM tables in markdown. + +###### Parameters + +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM tables +([`ToMarkdownExtension`][to-markdown-extension]). + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `tableCellPadding` (`boolean`, default: `true`) + — whether to add a space of padding between delimiters and cells +* `tablePipeAlign` (`boolean`, default: `true`) + — whether to align the delimiters +* `stringLength` (`((value: string) => number)`, default: `s => s.length`) + — function to detect the length of table cell content, used when aligning + the delimiters between cells + +## Examples + +### Example: `stringLength` + +It’s possible to align tables based on the visual width of cells. +First, let’s show the problem: + +```js +import {gfmTable} from 'micromark-extension-gfm-table' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = `| Alpha | Bravo | +| - | - | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta |` + +const tree = fromMarkdown(doc, { + extensions: [gfmTable], + mdastExtensions: [gfmTableFromMarkdown] +}) + +console.log(toMarkdown(tree, {extensions: [gfmTableToMarkdown()]})) +``` + +The above code shows how these utilities can be used to format markdown. +The output is as follows: + +```markdown +| Alpha | Bravo | +| -------- | ------- | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +To improve the alignment of these full-width characters and emoji, pass a +`stringLength` function that calculates the visual width of cells. +One such algorithm is [`string-width`][string-width]. +It can be used like so: + +```diff +@@ -2,6 +2,7 @@ import {gfmTable} from 'micromark-extension-gfm-table' + import {fromMarkdown} from 'mdast-util-from-markdown' + import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table' + import {toMarkdown} from 'mdast-util-to-markdown' ++import stringWidth from 'string-width' + + const doc = `| Alpha | Bravo | + | - | - | +@@ -13,4 +14,8 @@ const tree = fromMarkdown(doc, { + mdastExtensions: [gfmTableFromMarkdown()] + }) + +-console.log(toMarkdown(tree, {extensions: [gfmTableToMarkdown()]})) ++console.log( ++ toMarkdown(tree, { ++ extensions: [gfmTableToMarkdown({stringLength: stringWidth})] ++ }) ++) +``` + +The output of our code with these changes is as follows: + +```markdown +| Alpha | Bravo | +| ----- | ------- | +| 中文 | Charlie | +| 👩‍❤️‍👩 | Delta | +``` + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Syntax + +See [Syntax in `micromark-extension-gfm-table`][syntax]. + +## Syntax tree + +The following interfaces are added to **[mdast][]** by this utility. + +### Nodes + +#### `Table` + +```idl +interface Table <: Parent { + type: 'table' + align: [alignType]? + children: [TableContent] +} +``` + +**Table** (**[Parent][dfn-parent]**) represents two-dimensional data. + +**Table** can be used where **[flow][dfn-flow-content]** content is expected. +Its content model is **[table][dfn-table-content]** content. + +The *[head][term-head]* of the node represents the labels of the columns. + +An `align` field can be present. +If present, it must be a list of **[alignTypes][dfn-enum-align-type]**. +It represents how cells in columns are aligned. + +For example, the following markdown: + +```markdown +| foo | bar | +| :-- | :-: | +| baz | qux | +``` + +Yields: + +```js +{ + type: 'table', + align: ['left', 'center'], + children: [ + { + type: 'tableRow', + children: [ + { + type: 'tableCell', + children: [{type: 'text', value: 'foo'}] + }, + { + type: 'tableCell', + children: [{type: 'text', value: 'bar'}] + } + ] + }, + { + type: 'tableRow', + children: [ + { + type: 'tableCell', + children: [{type: 'text', value: 'baz'}] + }, + { + type: 'tableCell', + children: [{type: 'text', value: 'qux'}] + } + ] + } + ] +} +``` + +#### `TableRow` + +```idl +interface TableRow <: Parent { + type: "tableRow" + children: [RowContent] +} +``` + +**TableRow** (**[Parent][dfn-parent]**) represents a row of cells in a table. + +**TableRow** can be used where **[table][dfn-table-content]** content is +expected. +Its content model is **[row][dfn-row-content]** content. + +If the node is a *[head][term-head]*, it represents the labels of the columns +for its parent **[Table][dfn-table]**. + +For an example, see **[Table][dfn-table]**. + +#### `TableCell` + +```idl +interface TableCell <: Parent { + type: "tableCell" + children: [PhrasingContent] +} +``` + +**TableCell** (**[Parent][dfn-parent]**) represents a header cell in a +**[Table][dfn-table]**, if its parent is a *[head][term-head]*, or a data +cell otherwise. + +**TableCell** can be used where **[row][dfn-row-content]** content is expected. +Its content model is **[phrasing][dfn-phrasing-content]** content excluding +**[Break][dfn-break]** nodes. + +For an example, see **[Table][dfn-table]**. + +### Enumeration + +#### `alignType` + +```idl +enum alignType { + 'center' | 'left' | 'right' | null +} +``` + +**alignType** represents how phrasing content is aligned +([\[CSSTEXT\]][css-text]). + +* **`'left'`**: See the [`left`][css-left] value of the `text-align` CSS + property +* **`'right'`**: See the [`right`][css-right] value of the `text-align` + CSS property +* **`'center'`**: See the [`center`][css-center] value of the `text-align` + CSS property +* **`null`**: phrasing content is aligned as defined by the host environment + +### Content model + +#### `FlowContent` (GFM table) + +```idl +type FlowContentGfm = Table | FlowContent +``` + +#### `TableContent` + +```idl +type TableContent = TableRow +``` + +**Table** content represent the rows in a table. + +#### `RowContent` + +```idl +type RowContent = TableCell +``` + +**Row** content represent the cells in a row. + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`Options`][api-options]. + +The `Table`, `TableRow`, and `TableCell` types of the mdast nodes are exposed +from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-gfm-table@^2`, +compatible with Node.js 16. + +This utility works with `mdast-util-from-markdown` version 2+ and +`mdast-util-to-markdown` version 2+. + +## Related + +* [`remarkjs/remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm] + — same but all of GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`micromark/micromark-extension-gfm-table`][extension] + — micromark extension to parse GFM tables + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-table/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm-table/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-table.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-table + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-table.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm-table + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-table + +[size]: https://bundlejs.com/?q=mdast-util-gfm-table + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[micromark]: https://github.com/micromark/micromark + +[extension]: https://github.com/micromark/micromark-extension-gfm-table + +[syntax]: https://github.com/micromark/micromark-extension-gfm-table#syntax + +[gfm]: https://github.github.com/gfm/ + +[string-width]: https://github.com/sindresorhus/string-width + +[css-text]: https://drafts.csswg.org/css-text/ + +[css-left]: https://drafts.csswg.org/css-text/#valdef-text-align-left + +[css-right]: https://drafts.csswg.org/css-text/#valdef-text-align-right + +[css-center]: https://drafts.csswg.org/css-text/#valdef-text-align-center + +[term-head]: https://github.com/syntax-tree/unist#head + +[dfn-parent]: https://github.com/syntax-tree/mdast#parent + +[dfn-phrasing-content]: https://github.com/syntax-tree/mdast#phrasingcontent + +[dfn-break]: https://github.com/syntax-tree/mdast#break + +[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[api-gfm-table-from-markdown]: #gfmtablefrommarkdown + +[api-gfm-table-to-markdown]: #gfmtabletomarkdownoptions + +[api-options]: #options + +[dfn-flow-content]: #flowcontent-gfm-table + +[dfn-table-content]: #tablecontent + +[dfn-enum-align-type]: #aligntype + +[dfn-row-content]: #rowcontent + +[dfn-table]: #table diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c0c593ee9ed7fdde9846cf6c19494ec672f5df8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.d.ts @@ -0,0 +1,4 @@ +export { + gfmTaskListItemFromMarkdown, + gfmTaskListItemToMarkdown +} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.js b/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9c0c593ee9ed7fdde9846cf6c19494ec672f5df8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/index.js @@ -0,0 +1,4 @@ +export { + gfmTaskListItemFromMarkdown, + gfmTaskListItemToMarkdown +} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1db5627d05f18657faff5a24d3e18166a76fa5b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.d.ts @@ -0,0 +1,23 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM task + * list items in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM task list items. + */ +export function gfmTaskListItemFromMarkdown(): FromMarkdownExtension +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM task list + * items in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM task list items. + */ +export function gfmTaskListItemToMarkdown(): ToMarkdownExtension +export type ListItem = import('mdast').ListItem +export type Paragraph = import('mdast').Paragraph +export type CompileContext = import('mdast-util-from-markdown').CompileContext +export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension +export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle +export type ToMarkdownExtension = import('mdast-util-to-markdown').Options +export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.js b/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..80a713c56a91675a3a1fd71b275a65af2ab67d3f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/lib/index.js @@ -0,0 +1,141 @@ +/** + * @typedef {import('mdast').ListItem} ListItem + * @typedef {import('mdast').Paragraph} Paragraph + * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext + * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension + * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle + * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension + * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle + */ + +import {ok as assert} from 'devlop' +import {defaultHandlers} from 'mdast-util-to-markdown' + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM task + * list items in markdown. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown` to enable GFM task list items. + */ +export function gfmTaskListItemFromMarkdown() { + return { + exit: { + taskListCheckValueChecked: exitCheck, + taskListCheckValueUnchecked: exitCheck, + paragraph: exitParagraphWithTaskListItem + } + } +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM task list + * items in markdown. + * + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM task list items. + */ +export function gfmTaskListItemToMarkdown() { + return { + unsafe: [{atBreak: true, character: '-', after: '[:|-]'}], + handlers: {listItem: listItemWithTaskListItem} + } +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitCheck(token) { + // We’re always in a paragraph, in a list item. + const node = this.stack[this.stack.length - 2] + assert(node.type === 'listItem') + node.checked = token.type === 'taskListCheckValueChecked' +} + +/** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ +function exitParagraphWithTaskListItem(token) { + const parent = this.stack[this.stack.length - 2] + + if ( + parent && + parent.type === 'listItem' && + typeof parent.checked === 'boolean' + ) { + const node = this.stack[this.stack.length - 1] + assert(node.type === 'paragraph') + const head = node.children[0] + + if (head && head.type === 'text') { + const siblings = parent.children + let index = -1 + /** @type {Paragraph | undefined} */ + let firstParaghraph + + while (++index < siblings.length) { + const sibling = siblings[index] + if (sibling.type === 'paragraph') { + firstParaghraph = sibling + break + } + } + + if (firstParaghraph === node) { + // Must start with a space or a tab. + head.value = head.value.slice(1) + + if (head.value.length === 0) { + node.children.shift() + } else if ( + node.position && + head.position && + typeof head.position.start.offset === 'number' + ) { + head.position.start.column++ + head.position.start.offset++ + node.position.start = Object.assign({}, head.position.start) + } + } + } + } + + this.exit(token) +} + +/** + * @type {ToMarkdownHandle} + * @param {ListItem} node + */ +function listItemWithTaskListItem(node, parent, state, info) { + const head = node.children[0] + const checkable = + typeof node.checked === 'boolean' && head && head.type === 'paragraph' + const checkbox = '[' + (node.checked ? 'x' : ' ') + '] ' + const tracker = state.createTracker(info) + + if (checkable) { + tracker.move(checkbox) + } + + let value = defaultHandlers.listItem(node, parent, state, { + ...info, + ...tracker.current() + }) + + if (checkable) { + value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check) + } + + return value + + /** + * @param {string} $0 + * @returns {string} + */ + function check($0) { + return $0 + checkbox + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/license b/tools/ui/node_modules/mdast-util-gfm-task-list-item/license new file mode 100644 index 0000000000000000000000000000000000000000..39372356c47d0f6e070ff62d84c69f4f5e8c16eb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/package.json b/tools/ui/node_modules/mdast-util-gfm-task-list-item/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f0a5c21b8015776fde7a68411f403713741b44e9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/package.json @@ -0,0 +1,90 @@ +{ + "name": "mdast-util-gfm-task-list-item", + "version": "2.0.0", + "description": "mdast extension to parse and serialize GFM task list items", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "task", + "list", + "item", + "check", + "checkbox", + "todo", + "gfm" + ], + "repository": "syntax-tree/mdast-util-gfm-task-list-item", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm-task-list-item/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-util-remove-position": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api-prod": "node --conditions production test.js", + "test-api-dev": "node --conditions development test.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm-task-list-item/readme.md b/tools/ui/node_modules/mdast-util-gfm-task-list-item/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e7959c85a21ad6f45e0558e151755cb2a5b9aca8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm-task-list-item/readme.md @@ -0,0 +1,366 @@ +# mdast-util-gfm-task-list-item + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] task list items. + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmTaskListItemFromMarkdown()`](#gfmtasklistitemfrommarkdown) + * [`gfmTaskListItemToMarkdown()`](#gfmtasklistitemtomarkdown) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) + * [Content model](#content-model) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM task list item +syntax in markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +task lists in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +task lists in syntax trees to markdown). + +## When to use this + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with +[`micromark-extension-gfm-task-list-item`][extension]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with `micromark-extension-gfm-task-list-item`. + +When you are working with syntax trees and want all of GFM, use +[`mdast-util-gfm`][mdast-util-gfm] instead. + +All these packages are used [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm-task-list-item +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmTaskListItemFromMarkdown, gfmTaskListItemToMarkdown} from 'https://esm.sh/mdast-util-gfm-task-list-item@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +* [ ] To do +* [x] Done + +1. Mixed… +2. [x] …messages +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmTaskListItemFromMarkdown, gfmTaskListItemToMarkdown} from 'mdast-util-gfm-task-list-item' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') + +const tree = fromMarkdown(doc, { + extensions: [gfmTaskListItem], + mdastExtensions: [gfmTaskListItemFromMarkdown] +}) + +console.log(tree) + +const out = toMarkdown(tree, {extensions: [gfmTaskListItemToMarkdown]}) + +console.log(out) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'list', + ordered: false, + start: null, + spread: false, + children: [ + { + type: 'listItem', + spread: false, + checked: false, + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'To do'}]} + ] + }, + { + type: 'listItem', + spread: false, + checked: true, + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'Done'}]} + ] + } + ] + }, + { + type: 'list', + ordered: true, + start: 1, + spread: false, + children: [ + { + type: 'listItem', + spread: false, + checked: null, + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'Mixed…'}]} + ] + }, + { + type: 'listItem', + spread: false, + checked: true, + children: [ + {type: 'paragraph', children: [{type: 'text', value: '…messages'}]} + ] + } + ] + } + ] +} +``` + +```markdown +* [ ] To do +* [x] Done + +1. Mixed… +2. [x] …messages +``` + +## API + +This package exports the identifiers +[`gfmTaskListItemFromMarkdown`][api-gfm-task-list-item-from-markdown] and +[`gfmTaskListItemToMarkdown`][api-gfm-task-list-item-to-markdown]. +There is no default export. + +### `gfmTaskListItemFromMarkdown()` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM task list items in markdown. + +###### Returns + +Extension for `mdast-util-from-markdown` to enable GFM task list items +([`FromMarkdownExtension`][frommarkdownextension]). + +### `gfmTaskListItemToMarkdown()` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to +enable GFM task list items in markdown. + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM task list items +([`ToMarkdownExtension`][tomarkdownextension]). + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Syntax + +See [Syntax in `micromark-extension-gfm-task-list-item`][syntax]. + +## Syntax tree + +The following interfaces are added to **[mdast][]** by this utility. + +### Nodes + +#### `ListItem` (GFM) + +```idl +interface ListItemGfm <: ListItem { + checked: boolean? +} +``` + +In GFM, a `checked` field can be present. +It represents whether the item is done (when `true`), not done (when `false`), +or indeterminate or not applicable (when `null` or not present). + +### Content model + +#### `ListContent` (GFM) + +```idl +type ListContentGfm = ListItemGfm +``` + +## Types + +This package is fully typed with [TypeScript][]. +It does not export additional types. + +The `ListItem` type of the mdast nodes are exposed from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-gfm-task-list-item@^2`, compatible with Node.js 16. + +## Related + +* [`remarkjs/remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm] + — same but all of GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`micromark/micromark-extension-gfm-task-list-item`][extension] + — micromark extension to parse GFM task list items + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-task-list-item.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-task-list-item + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-task-list-item.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm-task-list-item + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-task-list-item + +[size]: https://bundlejs.com/?q=mdast-util-gfm-task-list-item + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[micromark]: https://github.com/micromark/micromark + +[extension]: https://github.com/micromark/micromark-extension-gfm-task-list-item + +[syntax]: https://github.com/micromark/micromark-extension-gfm-task-list-item#syntax + +[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[gfm]: https://github.github.com/gfm/ + +[api-gfm-task-list-item-from-markdown]: #gfmtasklistitemfrommarkdown + +[api-gfm-task-list-item-to-markdown]: #gfmtasklistitemtomarkdown diff --git a/tools/ui/node_modules/mdast-util-gfm/index.d.ts b/tools/ui/node_modules/mdast-util-gfm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f53affedb5fe39ac695632fcc74e37d27f26e7aa --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/index.d.ts @@ -0,0 +1,12 @@ +import type {ToMarkdownOptions as FootnoteOptions} from 'mdast-util-gfm-footnote' +import type {Options as TableOptions} from 'mdast-util-gfm-table' + +/** + * Configuration for `gfmToMarkdown` from `mdast-util-gfm`. + * + * Currently supports options for `mdast-util-gfm-footnote` and + * `mdast-util-gfm-table`. + */ +export interface Options extends FootnoteOptions, TableOptions {} + +export {gfmFromMarkdown, gfmToMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm/index.js b/tools/ui/node_modules/mdast-util-gfm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..24a40dee11c2c6bb0b5c01bb5a8f21e7025cf61e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/index.js @@ -0,0 +1,2 @@ +// Note: types exposed from `index.d.ts`. +export {gfmFromMarkdown, gfmToMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts b/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a4389deced2e26771c0e62db27922ba9d7966ba1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts @@ -0,0 +1,24 @@ +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink + * literals, footnotes, strikethrough, tables, tasklists). + * + * @returns {Array} + * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals, + * footnotes, strikethrough, tables, tasklists). + */ +export function gfmFromMarkdown(): Array; +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink + * literals, footnotes, strikethrough, tables, tasklists). + * + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals, + * footnotes, strikethrough, tables, tasklists). + */ +export function gfmToMarkdown(options?: Options | null | undefined): ToMarkdownExtension; +import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown'; +import type { Options } from 'mdast-util-gfm'; +import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a54498681f72f764a8280c561add1ffd0e984faf --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AACH,mCAJa,KAAK,CAAC,qBAAqB,CAAC,CAYxC;AAED;;;;;;;;;GASG;AACH,wCANW,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,mBAAmB,CAc/B;wDA7DoD,0BAA0B;6BACrD,gBAAgB;oDACO,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-gfm/lib/index.js b/tools/ui/node_modules/mdast-util-gfm/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f06b43259b96f0a70933325379ead09354081b5c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/lib/index.js @@ -0,0 +1,63 @@ +/** + * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown' + * @import {Options} from 'mdast-util-gfm' + * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown' + */ + +import { + gfmAutolinkLiteralFromMarkdown, + gfmAutolinkLiteralToMarkdown +} from 'mdast-util-gfm-autolink-literal' +import { + gfmFootnoteFromMarkdown, + gfmFootnoteToMarkdown +} from 'mdast-util-gfm-footnote' +import { + gfmStrikethroughFromMarkdown, + gfmStrikethroughToMarkdown +} from 'mdast-util-gfm-strikethrough' +import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table' +import { + gfmTaskListItemFromMarkdown, + gfmTaskListItemToMarkdown +} from 'mdast-util-gfm-task-list-item' + +/** + * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink + * literals, footnotes, strikethrough, tables, tasklists). + * + * @returns {Array} + * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals, + * footnotes, strikethrough, tables, tasklists). + */ +export function gfmFromMarkdown() { + return [ + gfmAutolinkLiteralFromMarkdown(), + gfmFootnoteFromMarkdown(), + gfmStrikethroughFromMarkdown(), + gfmTableFromMarkdown(), + gfmTaskListItemFromMarkdown() + ] +} + +/** + * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink + * literals, footnotes, strikethrough, tables, tasklists). + * + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals, + * footnotes, strikethrough, tables, tasklists). + */ +export function gfmToMarkdown(options) { + return { + extensions: [ + gfmAutolinkLiteralToMarkdown(), + gfmFootnoteToMarkdown(options), + gfmStrikethroughToMarkdown(), + gfmTableToMarkdown(options), + gfmTaskListItemToMarkdown() + ] + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm/license b/tools/ui/node_modules/mdast-util-gfm/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-gfm/package.json b/tools/ui/node_modules/mdast-util-gfm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..296c0d7ec397ff251f7add82066e1001a8d2ba24 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/package.json @@ -0,0 +1,125 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/syntax-tree/mdast-util-gfm/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "description": "mdast extension to parse and serialize GFM (GitHub Flavored Markdown)", + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "github-slugger": "^2.0.0", + "hast-util-to-html": "^9.0.0", + "mdast-util-to-hast": "^13.0.0", + "micromark-extension-gfm": "^3.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "undici": "^7.0.0", + "xo": "^0.60.0" + }, + "exports": "./index.js", + "files": [ + "index.d.ts", + "index.js", + "lib/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "autolink", + "gfm", + "github", + "markdown", + "markup", + "mdast-util", + "mdast", + "strikethrough", + "table", + "tagfilter", + "tasklist", + "unist", + "utility", + "util" + ], + "license": "MIT", + "name": "mdast-util-gfm", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "syntax-tree/mdast-util-gfm", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "crawl": "node --conditions development script/crawl-tests.js", + "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", + "test-api-prod": "node --conditions production test/index.js", + "test-api-dev": "node --conditions development test/index.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov -- npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "strict": true + }, + "type": "module", + "version": "3.1.0", + "xo": { + "overrides": [ + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] + } + }, + { + "files": "test/**/*.js", + "rules": { + "no-await-in-loop": "off" + } + } + ], + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-gfm/readme.md b/tools/ui/node_modules/mdast-util-gfm/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4fd7f0c8257c9e388c6a7283a76b56b47fb32900 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-gfm/readme.md @@ -0,0 +1,497 @@ +# mdast-util-gfm + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize [GFM][] (autolink literals, +footnotes, strikethrough, tables, tasklists). + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`gfmFromMarkdown()`](#gfmfrommarkdown) + * [`gfmToMarkdown(options?)`](#gfmtomarkdownoptions) + * [`Options`](#options) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for GFM syntax in +markdown to [mdast][]: autolink literals (`www.x.com`), footnotes (`[^1]`), +strikethrough (`~~stuff~~`), tables (`| cell |…`), and tasklists (`* [x]`). +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +GFM in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +GFM in syntax trees to markdown). + +## When to use this + +This project is useful when you want to support the same features that GitHub +does in files in a repo, Gists, and several other places. +Users frequently believe that some of these extensions, specifically autolink +literals and tables, are part of normal markdown, so using `mdast-util-gfm` will +help match your implementation to their understanding of markdown. +There are several edge cases where GitHub’s implementation works in unexpected +ways or even different than described in their spec, so *writing* in GFM is not +always the best choice. + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with [`micromark-extension-gfm`][extension]. + +Instead of this package, you can also use the extensions separately: + +* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal) + — support GFM autolink literals +* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote) + — support GFM footnotes +* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough) + — support GFM strikethrough +* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table) + — support GFM tables +* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) + — support GFM tasklists + +A different utility, [`mdast-util-frontmatter`][mdast-util-frontmatter], adds +support for frontmatter. +GitHub supports YAML frontmatter for files in repos and Gists but they don’t +treat it as part of GFM. + +All these packages are used in [`remark-gfm`][remark-gfm], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. +If your content is not in English, you should configure that utility. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-gfm +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {gfmFromMarkdown, gfmToMarkdown} from 'https://esm.sh/mdast-util-gfm@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +# GFM + +## Autolink literals + +www.example.com, https://example.com, and contact@example.com. + +## Footnote + +A note[^1] + +[^1]: Big note. + +## Strikethrough + +~one~ or ~~two~~ tildes. + +## Table + +| a | b | c | d | +| - | :- | -: | :-: | + +## Tasklist + +* [ ] to do +* [x] done +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm' +import {toMarkdown} from 'mdast-util-to-markdown' +import {gfm} from 'micromark-extension-gfm' + +const value = await fs.readFile('example.md', 'utf8') + +const tree = fromMarkdown(value, { + extensions: [gfm()], + mdastExtensions: [gfmFromMarkdown()] +}) + +console.log(tree) + +const result = toMarkdown(tree, {extensions: [gfmToMarkdown()]}) + +console.log(result) +``` + +…now running `node example.js` yields (positional info removed for brevity): + +```js +{ + type: 'root', + children: [ + {type: 'heading', depth: 1, children: [{type: 'text', value: 'GFM'}]}, + { + type: 'heading', + depth: 2, + children: [{type: 'text', value: 'Autolink literals'}] + }, + { + type: 'paragraph', + children: [ + { + type: 'link', + title: null, + url: 'http://www.example.com', + children: [{type: 'text', value: 'www.example.com'}] + }, + {type: 'text', value: ', '}, + { + type: 'link', + title: null, + url: 'https://example.com', + children: [{type: 'text', value: 'https://example.com'}] + }, + {type: 'text', value: ', and '}, + { + type: 'link', + title: null, + url: 'mailto:contact@example.com', + children: [{type: 'text', value: 'contact@example.com'}] + }, + {type: 'text', value: '.'} + ] + }, + {type: 'heading', depth: 2, children: [{type: 'text', value: 'Footnote'}]}, + { + type: 'paragraph', + children: [ + {type: 'text', value: 'A note'}, + {type: 'footnoteReference', identifier: '1', label: '1'} + ] + }, + { + type: 'footnoteDefinition', + identifier: '1', + label: '1', + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'Big note.'}]} + ] + }, + { + type: 'heading', + depth: 2, + children: [{type: 'text', value: 'Strikethrough'}] + }, + { + type: 'paragraph', + children: [ + { + type: 'delete', + children: [{type: 'text', value: 'one'}] + }, + {type: 'text', value: ' or '}, + { + type: 'delete', + children: [{type: 'text', value: 'two'}] + }, + {type: 'text', value: ' tildes.'} + ] + }, + {type: 'heading', depth: 2, children: [{type: 'text', value: 'Table'}]}, + { + type: 'table', + align: [null, 'left', 'right', 'center'], + children: [ + { + type: 'tableRow', + children: [ + {type: 'tableCell', children: [{type: 'text', value: 'a'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'b'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'c'}]}, + {type: 'tableCell', children: [{type: 'text', value: 'd'}]} + ] + } + ] + }, + {type: 'heading', depth: 2, children: [{type: 'text', value: 'Tasklist'}]}, + { + type: 'list', + ordered: false, + start: null, + spread: false, + children: [ + { + type: 'listItem', + spread: false, + checked: false, + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'to do'}]} + ] + }, + { + type: 'listItem', + spread: false, + checked: true, + children: [ + {type: 'paragraph', children: [{type: 'text', value: 'done'}]} + ] + } + ] + } + ] +} +``` + +```markdown +# GFM + +## Autolink literals + +[www.example.com](http://www.example.com), , and . + +## Footnote + +A note[^1] + +[^1]: Big note. + +## Strikethrough + +~~one~~ or ~~two~~ tildes. + +## Table + +| a | b | c | d | +| - | :- | -: | :-: | + +## Tasklist + +* [ ] to do +* [x] done +``` + +## API + +This package exports the identifiers [`gfmFromMarkdown`][api-gfm-from-markdown] +and [`gfmToMarkdown`][api-gfm-to-markdown]. +There is no default export. + +### `gfmFromMarkdown()` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown] +to enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists). + +###### Returns + +Extension for `mdast-util-from-markdown` to enable GFM +([`Array`][from-markdown-extension]). + +### `gfmToMarkdown(options?)` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] +to enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists). + +###### Parameters + +* `options` ([`Options`][api-options]) + — configuration + +###### Returns + +Extension for `mdast-util-to-markdown` to enable GFM +([`Array`][to-markdown-extension]). + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `firstLineBlank` (`boolean`, default: `false`) + — use a blank line for the first line of footnote definitions +* `stringLength` (`((value: string) => number)`, default: `s => s.length`) + — function to detect the length of table cell content, used when aligning + the delimiters between cells +* `tableCellPadding` (`boolean`, default: `true`) + — whether to add a space of padding between delimiters and cells +* `tablePipeAlign` (`boolean`, default: `true`) + — whether to align the delimiters + +## HTML + +This utility does not handle how markdown is turned to HTML. +That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]. + +## Syntax + +See [Syntax in `micromark-extension-gfm`][syntax]. + +## Syntax tree + +This utility combines several mdast utilities. +See their readmes for the node types supported in the tree: + +* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal#syntax-tree) + — GFM autolink literals +* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote#syntax-tree) + — GFM footnotes +* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough#syntax-tree) + — GFM strikethrough +* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table#syntax-tree) + — GFM tables +* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item#syntax-tree) + — GFM tasklists + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`Options`][api-options]. + +The `Delete`, `FootnoteDefinition`, `FootnoteReference`, `Table`, `TableRow`, +and `TableCell` types of the mdast nodes are exposed from `@types/mdast`. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-gfm@^3`, +compatible with Node.js 16. + +## Related + +* [`remark-gfm`][remark-gfm] + — remark plugin to support GFM +* [`micromark-extension-gfm`][extension] + — micromark extension to parse GFM + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[api-gfm-from-markdown]: #gfmfrommarkdown + +[api-gfm-to-markdown]: #gfmtomarkdownoptions + +[api-options]: #options + +[author]: https://wooorm.com + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-gfm/actions + +[build-badge]: https://github.com/syntax-tree/mdast-util-gfm/workflows/main/badge.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[collective]: https://opencollective.com/unified + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-gfm + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm.svg + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[extension]: https://github.com/micromark/micromark-extension-gfm + +[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[gfm]: https://github.github.com/gfm/ + +[health]: https://github.com/syntax-tree/.github + +[license]: license + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[npm]: https://docs.npmjs.com/cli/install + +[remark-gfm]: https://github.com/remarkjs/remark-gfm + +[size]: https://bundlejs.com/?q=mdast-util-gfm + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[syntax]: https://github.com/micromark/micromark-extension-gfm#syntax + +[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[typescript]: https://www.typescriptlang.org diff --git a/tools/ui/node_modules/mdast-util-math/index.d.ts b/tools/ui/node_modules/mdast-util-math/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1868f549785337afdc1ad76e45c242a0e4cdddee --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/index.d.ts @@ -0,0 +1,107 @@ +import type {Data, Literal} from 'mdast' + +export {mathFromMarkdown, mathToMarkdown} from './lib/index.js' + +export type {ToOptions} from './lib/index.js' + +/** + * Math (flow). + */ +export interface Math extends Literal { + /** + * Node type of math (flow). + */ + type: 'math' + + /** + * Custom information relating to the node. + */ + meta?: string | null | undefined + + /** + * Data associated with the mdast math (flow). + */ + data?: MathData | undefined +} + +/** + * Info associated with mdast math (flow) nodes by the ecosystem. + */ +export interface MathData extends Data {} + +/** + * Math (text). + */ +export interface InlineMath extends Literal { + /** + * Node type of math (text). + */ + type: 'inlineMath' + + /** + * Data associated with the mdast math (text). + */ + data?: InlineMathData | undefined +} + +/** + * Info associated with mdast math (text) nodes by the ecosystem. + */ +export interface InlineMathData extends Data {} + +// Add custom data tracked to turn markdown into a tree. +declare module 'mdast-util-from-markdown' { + interface CompileData { + /** + * Whether we’re in math (flow). + */ + mathFlowInside?: boolean | undefined + } +} + +// Add custom data tracked to turn a tree into markdown. +declare module 'mdast-util-to-markdown' { + interface ConstructNameMap { + /** + * Math (flow). + * + * ```markdown + * > | $$ + * ^^ + * > | a + * ^ + * > | $$ + * ^^ + * ``` + */ + mathFlow: 'mathFlow' + + /** + * Math (flow) meta flag. + * + * ```markdown + * > | $$a + * ^ + * | b + * | $$ + * ``` + */ + mathFlowMeta: 'mathFlowMeta' + } +} + +// Add nodes to tree. +declare module 'mdast' { + interface BlockContentMap { + math: Math + } + + interface PhrasingContentMap { + inlineMath: InlineMath + } + + interface RootContentMap { + inlineMath: InlineMath + math: Math + } +} diff --git a/tools/ui/node_modules/mdast-util-math/index.js b/tools/ui/node_modules/mdast-util-math/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bdd6dbdc7efa77dd4bff502e7da23ea07e56537a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/index.js @@ -0,0 +1,2 @@ +// Note: Types exported from `index.d.ts`. +export {mathFromMarkdown, mathToMarkdown} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-math/lib/index.d.ts b/tools/ui/node_modules/mdast-util-math/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16dd20531b16e523de4c8bb4bbd94e30a55adf03 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/lib/index.d.ts @@ -0,0 +1,38 @@ +/** + * Create an extension for `mdast-util-from-markdown`. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown`. + */ +export function mathFromMarkdown(): FromMarkdownExtension; +/** + * Create an extension for `mdast-util-to-markdown`. + * + * @param {ToOptions | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown`. + */ +export function mathToMarkdown(options?: ToOptions | null | undefined): ToMarkdownExtension; +export type HastElement = import('hast').Element; +export type HastElementContent = import('hast').ElementContent; +export type CompileContext = import('mdast-util-from-markdown').CompileContext; +export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension; +export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle; +export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle; +export type ToMarkdownExtension = import('mdast-util-to-markdown').Options; +export type InlineMath = import('../index.js').InlineMath; +export type Math = import('../index.js').Math; +/** + * Configuration. + */ +export type ToOptions = { + /** + * Whether to support math (text) with a single dollar (default: `true`). + * + * Single dollars work in Pandoc and many other places, but often interfere + * with “normal” dollars in text. + * If you turn this off, you can still use two or more dollars for text math. + */ + singleDollarTextMath?: boolean | null | undefined; +}; diff --git a/tools/ui/node_modules/mdast-util-math/lib/index.js b/tools/ui/node_modules/mdast-util-math/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8f1963a4d61a1fec532edbb53199515994af47d1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/lib/index.js @@ -0,0 +1,317 @@ +/** + * @typedef {import('hast').Element} HastElement + * @typedef {import('hast').ElementContent} HastElementContent + * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext + * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension + * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle + * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle + * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension + * @typedef {import('../index.js').InlineMath} InlineMath + * @typedef {import('../index.js').Math} Math + * + * @typedef ToOptions + * Configuration. + * @property {boolean | null | undefined} [singleDollarTextMath=true] + * Whether to support math (text) with a single dollar (default: `true`). + * + * Single dollars work in Pandoc and many other places, but often interfere + * with “normal” dollars in text. + * If you turn this off, you can still use two or more dollars for text math. + */ + +import {ok as assert} from 'devlop' +import {longestStreak} from 'longest-streak' + +/** + * Create an extension for `mdast-util-from-markdown`. + * + * @returns {FromMarkdownExtension} + * Extension for `mdast-util-from-markdown`. + */ +export function mathFromMarkdown() { + return { + enter: { + mathFlow: enterMathFlow, + mathFlowFenceMeta: enterMathFlowMeta, + mathText: enterMathText + }, + exit: { + mathFlow: exitMathFlow, + mathFlowFence: exitMathFlowFence, + mathFlowFenceMeta: exitMathFlowMeta, + mathFlowValue: exitMathData, + mathText: exitMathText, + mathTextData: exitMathData + } + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function enterMathFlow(token) { + /** @type {HastElement} */ + const code = { + type: 'element', + tagName: 'code', + properties: {className: ['language-math', 'math-display']}, + children: [] + } + this.enter( + { + type: 'math', + meta: null, + value: '', + data: {hName: 'pre', hChildren: [code]} + }, + token + ) + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function enterMathFlowMeta() { + this.buffer() + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function exitMathFlowMeta() { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node.type === 'math') + node.meta = data + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function exitMathFlowFence() { + // Exit if this is the closing fence. + if (this.data.mathFlowInside) return + this.buffer() + this.data.mathFlowInside = true + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function exitMathFlow(token) { + const data = this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '') + const node = this.stack[this.stack.length - 1] + assert(node.type === 'math') + this.exit(token) + node.value = data + // @ts-expect-error: we defined it in `enterMathFlow`. + const code = /** @type {HastElement} */ (node.data.hChildren[0]) + assert(code.type === 'element') + assert(code.tagName === 'code') + code.children.push({type: 'text', value: data}) + this.data.mathFlowInside = undefined + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function enterMathText(token) { + this.enter( + { + type: 'inlineMath', + value: '', + data: { + hName: 'code', + hProperties: {className: ['language-math', 'math-inline']}, + hChildren: [] + } + }, + token + ) + this.buffer() + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function exitMathText(token) { + const data = this.resume() + const node = this.stack[this.stack.length - 1] + assert(node.type === 'inlineMath') + this.exit(token) + node.value = data + const children = /** @type {Array} */ ( + // @ts-expect-error: we defined it in `enterMathFlow`. + node.data.hChildren + ) + children.push({type: 'text', value: data}) + } + + /** + * @this {CompileContext} + * @type {FromMarkdownHandle} + */ + function exitMathData(token) { + this.config.enter.data.call(this, token) + this.config.exit.data.call(this, token) + } +} + +/** + * Create an extension for `mdast-util-to-markdown`. + * + * @param {ToOptions | null | undefined} [options] + * Configuration (optional). + * @returns {ToMarkdownExtension} + * Extension for `mdast-util-to-markdown`. + */ +export function mathToMarkdown(options) { + let single = (options || {}).singleDollarTextMath + + if (single === null || single === undefined) { + single = true + } + + inlineMath.peek = inlineMathPeek + + return { + unsafe: [ + {character: '\r', inConstruct: 'mathFlowMeta'}, + {character: '\n', inConstruct: 'mathFlowMeta'}, + { + character: '$', + after: single ? undefined : '\\$', + inConstruct: 'phrasing' + }, + {character: '$', inConstruct: 'mathFlowMeta'}, + {atBreak: true, character: '$', after: '\\$'} + ], + handlers: {math, inlineMath} + } + + /** + * @type {ToMarkdownHandle} + * @param {Math} node + */ + // Note: fixing this code? Please also fix the similar code for code: + // + function math(node, _, state, info) { + const raw = node.value || '' + const tracker = state.createTracker(info) + const sequence = '$'.repeat(Math.max(longestStreak(raw, '$') + 1, 2)) + const exit = state.enter('mathFlow') + let value = tracker.move(sequence) + + if (node.meta) { + const subexit = state.enter('mathFlowMeta') + value += tracker.move( + state.safe(node.meta, { + after: '\n', + before: value, + encode: ['$'], + ...tracker.current() + }) + ) + subexit() + } + + value += tracker.move('\n') + + if (raw) { + value += tracker.move(raw + '\n') + } + + value += tracker.move(sequence) + exit() + return value + } + + /** + * @type {ToMarkdownHandle} + * @param {InlineMath} node + */ + // Note: fixing this code? Please also fix the similar code for inline code: + // + function inlineMath(node, _, state) { + let value = node.value || '' + let size = 1 + + if (!single) size++ + + // If there is a single dollar sign on its own in the math, use a fence of + // two. + // If there are two in a row, use one. + while ( + new RegExp('(^|[^$])' + '\\$'.repeat(size) + '([^$]|$)').test(value) + ) { + size++ + } + + const sequence = '$'.repeat(size) + + // If this is not just spaces or eols (tabs don’t count), and either the + // first and last character are a space or eol, or the first or last + // character are dollar signs, then pad with spaces. + if ( + // Contains non-space. + /[^ \r\n]/.test(value) && + // Starts with space and ends with space. + ((/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value)) || + // Starts or ends with dollar. + /^\$|\$$/.test(value)) + ) { + value = ' ' + value + ' ' + } + + let index = -1 + + // We have a potential problem: certain characters after eols could result in + // blocks being seen. + // For example, if someone injected the string `'\n# b'`, then that would + // result in an ATX heading. + // We can’t escape characters in `inlineMath`, but because eols are + // transformed to spaces when going from markdown to HTML anyway, we can swap + // them out. + while (++index < state.unsafe.length) { + const pattern = state.unsafe[index] + + // Only look for `atBreak`s. + // Btw: note that `atBreak` patterns will always start the regex at LF or + // CR. + if (!pattern.atBreak) continue + + const expression = state.compilePattern(pattern) + /** @type {RegExpExecArray | null} */ + let match + + while ((match = expression.exec(value))) { + let position = match.index + + // Support CRLF (patterns only look for one of the characters). + if ( + value.codePointAt(position) === 10 /* `\n` */ && + value.codePointAt(position - 1) === 13 /* `\r` */ + ) { + position-- + } + + value = value.slice(0, position) + ' ' + value.slice(match.index + 1) + } + } + + return sequence + value + sequence + } + + /** + * @returns {string} + */ + function inlineMathPeek() { + return '$' + } +} diff --git a/tools/ui/node_modules/mdast-util-math/license b/tools/ui/node_modules/mdast-util-math/license new file mode 100644 index 0000000000000000000000000000000000000000..39372356c47d0f6e070ff62d84c69f4f5e8c16eb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2020 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-math/package.json b/tools/ui/node_modules/mdast-util-math/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9dee8d3c7d18ef1ef2d92b50347226c4b48c0200 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/package.json @@ -0,0 +1,104 @@ +{ + "name": "mdast-util-math", + "version": "3.0.0", + "description": "mdast extension to parse and serialize math", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "markup", + "math", + "katex", + "latex", + "tex" + ], + "repository": "syntax-tree/mdast-util-math", + "bugs": "https://github.com/syntax-tree/mdast-util-math/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "longest-streak": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.1.0", + "unist-util-remove-position": "^5.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "micromark-extension-math": "^3.0.0", + "prettier": "^3.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.55.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api-dev": "node --conditions development test.js", + "test-api-prod": "node --conditions production test.js", + "test-api": "npm run test-api-dev && npm run test-api-prod", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": "off" + } + } + ], + "prettier": true, + "rules": { + "unicorn/prefer-at": "off", + "unicorn/prefer-string-replace-all": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-math/readme.md b/tools/ui/node_modules/mdast-util-math/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..7a95f0b3ce9b3d6cee916fd41569a7adf069ff4f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-math/readme.md @@ -0,0 +1,489 @@ +# mdast-util-math + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] extensions to parse and serialize math (`$C_L$`). + +## Contents + +* [What is this?](#what-is-this) +* [When to use this](#when-to-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`mathFromMarkdown()`](#mathfrommarkdown) + * [`mathToMarkdown(options?)`](#mathtomarkdownoptions) + * [`InlineMath`](#inlinemath) + * [`Math`](#math) + * [`ToOptions`](#tooptions) +* [HTML](#html) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) + * [Content model](#content-model) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package contains two extensions that add support for math syntax in +markdown to [mdast][]. +These extensions plug into +[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing +math in markdown into a syntax tree) and +[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing +math in syntax trees to markdown). + +## When to use this + +This project is useful when you want to support math in markdown. +Extending markdown with a syntax extension makes the markdown less portable. +LaTeX equations are also quite hard. +But this mechanism works well when you want authors, that have some LaTeX +experience, to be able to embed rich diagrams of math in scientific text. + +You can use these extensions when you are working with +`mdast-util-from-markdown` and `mdast-util-to-markdown` already. + +When working with `mdast-util-from-markdown`, you must combine this package +with [`micromark-extension-math`][micromark-extension-math]. + +When you don’t need a syntax tree, you can use [`micromark`][micromark] +directly with +[`micromark-extension-math`][micromark-extension-math]. + +All these packages are used [`remark-math`][remark-math], which +focusses on making it easier to transform content by abstracting these +internals away. + +This utility adds [fields on nodes][fields] so that the utility responsible for +turning mdast (markdown) nodes into hast (HTML) nodes, +[`mdast-util-to-hast`][mdast-util-to-hast], turns text (inline) math nodes into +`…` and flow (block) math nodes +into `
    …
    `. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-math +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {mathFromMarkdown, mathToMarkdown} from 'https://esm.sh/mdast-util-math@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our document `example.md` contains: + +```markdown +Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following +equation. + +$$ +L = \frac{1}{2} \rho v^2 S C_L +$$ +``` + +…and our module `example.js` looks as follows: + +```js +import fs from 'node:fs/promises' +import {math} from 'micromark-extension-math' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {mathFromMarkdown, mathToMarkdown} from 'mdast-util-math' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') + +const tree = fromMarkdown(doc, { + extensions: [math()], + mdastExtensions: [mathFromMarkdown()] +}) + +console.log(tree) + +const out = toMarkdown(tree, {extensions: [mathToMarkdown()]}) + +console.log(out) +``` + +…now running `node example.js` yields (positional info and data removed for +brevity): + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + {type: 'text', value: 'Lift('}, + {type: 'inlineMath', value: 'L', data: {/* … */}}, + {type: 'text', value: ') can be determined by Lift Coefficient ('}, + {type: 'inlineMath', value: 'C_L', data: {/* … */}}, + {type: 'text', value: ') like the following\nequation.'} + ] + }, + {type: 'math', meta: null, value: 'L = \\frac{1}{2} \\rho v^2 S C_L', data: {/* … */}} + ] +} +``` + +```markdown +Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following +equation. + +$$ +L = \frac{1}{2} \rho v^2 S C_L +$$ +``` + +## API + +This package exports the identifiers +[`mathFromMarkdown`][api-math-from-markdown] +and [`mathToMarkdown`][api-math-to-markdown]. +There is no default export. + +### `mathFromMarkdown()` + +Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]. + +###### Returns + +Extension for `mdast-util-from-markdown` +([`FromMarkdownExtension`][from-markdown-extension]). + +### `mathToMarkdown(options?)` + +Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown]. + +###### Parameters + +* `options` ([`ToOptions`][api-to-options], optional) + — configuration + +###### Returns + +Extension for `mdast-util-to-markdown` +([`ToMarkdownExtension`][to-markdown-extension]). + +### `InlineMath` + +Math (text) (TypeScript type). + +###### Type + +```ts +import type {Data, Literal} from 'mdast' + +interface InlineMath extends Literal { + type: 'inlineMath' + data?: InlineMathData | undefined +} + +export interface InlineMathData extends Data {} +``` + +### `Math` + +Math (flow) (TypeScript type). + +###### Type + +```ts +import type {Data, Literal} from 'mdast' + +interface Math extends Literal { + type: 'math' + meta?: string | null | undefined + data?: MathData | undefined +} + +export interface MathData extends Data {} +``` + +### `ToOptions` + +Configuration (TypeScript type). + +###### Fields + +* `singleDollarTextMath` (`boolean`, default: `true`) + — whether to support math (text) with a single dollar. + Single dollars work in Pandoc and many other places, but often interfere + with “normal” dollars in text. + If you turn this off, you can still use two or more dollars for text math + +## HTML + +This plugin integrates with [`mdast-util-to-hast`][mdast-util-to-hast]. +When mdast is turned into hast the math nodes are turned into +`…` and +`
    …
    ` elements. + +## Syntax + +See [Syntax in `micromark-extension-frontmatter`][syntax]. + +## Syntax tree + +The following interfaces are added to **[mdast][]** by this utility. + +### Nodes + +#### `Math` + +```idl +interface Math <: Literal { + type: 'code' + meta: string? +} +``` + +**Math** (**[Literal][dfn-literal]**) represents a block of math, +such as LaTeX mathematical expressions. + +**Math** can be used where **[flow][dfn-flow-content]** content is expected. +Its content is represented by its `value` field. + +This node relates to the **[phrasing][dfn-phrasing-content]** content concept +**[InlineMath][dfn-inline-math]**. + +A `meta` field can be present. +It represents custom information relating to the node. + +For example, the following markdown: + +```markdown +$$ +L = \frac{1}{2} \rho v^2 S C_L +$$ +``` + +Yields: + +```js +{ + type: 'math', + meta: null, + value: 'L = \\frac{1}{2} \\rho v^2 S C_L', + data: {/* … */} +} +``` + +#### `InlineMath` + +```idl +interface InlineMath <: Literal { + type: 'inlineMath' +} +``` + +**InlineMath** (**[Literal][dfn-literal]**) represents a fragment of computer +code, such as a file name, computer program, or anything a computer could parse. + +**InlineMath** can be used where **[phrasing][dfn-phrasing-content]** content +is expected. +Its content is represented by its `value` field. + +This node relates to the **[flow][dfn-flow-content]** content concept +**[Math][dfn-math]**. + +For example, the following markdown: + +```markdown +$L$ +``` + +Yields: + +```js +{type: 'inlineMath', value: 'L', data: {/* … */}} +``` + +### Content model + +#### `FlowContent` (math) + +```idl +type FlowContentMath = Math | FlowContent +``` + +#### `PhrasingContent` (math) + +```idl +type PhrasingContentMath = InlineMath | PhrasingContent +``` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types [`InlineMath`][api-inline-math], +[`Math`][api-math], and [`ToOptions`][api-to-options]. + +It also registers the node types with `@types/mdast`. +If you’re working with the syntax tree, make sure to import this utility +somewhere in your types, as that registers the new node types in the tree. + +```js +/** + * @typedef {import('mdast-util-math')} + */ + +import {visit} from 'unist-util-visit' + +/** @type {import('mdast').Root} */ +const tree = getMdastNodeSomeHow() + +visit(tree, function (node) { + // `node` can now be one of the nodes for math. +}) +``` + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-math@^3`, +compatible with Node.js 16. + +This plugin works with `mdast-util-from-markdown` version 2+ and +`mdast-util-to-markdown` version 2+. + +## Related + +* [`remark-math`][remark-math] + — remark plugin to support math +* [`micromark-extension-math`][micromark-extension-math] + — micromark extension to parse math + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-math/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-math/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-math.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-math + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-math.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-math + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-math + +[size]: https://bundlejs.com/?q=mdast-util-math + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[remark-math]: https://github.com/remarkjs/remark-math + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast + +[micromark]: https://github.com/micromark/micromark + +[micromark-extension-math]: https://github.com/micromark/micromark-extension-math + +[syntax]: https://github.com/micromark/micromark-extension-math#syntax + +[fields]: https://github.com/syntax-tree/mdast-util-to-hast#fields-on-nodes + +[dfn-literal]: https://github.com/syntax-tree/mdast#literal + +[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension + +[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options + +[api-math-from-markdown]: #mathfrommarkdown + +[api-math-to-markdown]: #mathtomarkdownoptions + +[api-math]: #math + +[api-inline-math]: #inlinemath + +[api-to-options]: #tooptions + +[dfn-flow-content]: #flowcontent-math + +[dfn-phrasing-content]: #phrasingcontent-math + +[dfn-inline-math]: #inlinemath-1 + +[dfn-math]: #math-1 diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/index.d.ts b/tools/ui/node_modules/mdast-util-newline-to-break/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dca2b035ff0329b60a68bf4bf9a955669eb2e1b8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/index.d.ts @@ -0,0 +1 @@ +export {newlineToBreak} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/index.js b/tools/ui/node_modules/mdast-util-newline-to-break/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dca2b035ff0329b60a68bf4bf9a955669eb2e1b8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/index.js @@ -0,0 +1 @@ +export {newlineToBreak} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.d.ts b/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dcc9ce14d181d395e574255d4b5cf8bfacc7acf5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.d.ts @@ -0,0 +1,12 @@ +/** + * Turn normal line endings into hard breaks. + * + * @param {Nodes} tree + * Tree to change. + * @returns {undefined} + * Nothing. + */ +export function newlineToBreak(tree: Nodes): undefined +export type Nodes = import('mdast').Nodes +export type ReplaceFunction = + import('mdast-util-find-and-replace').ReplaceFunction diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.js b/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..07e54ac32c34727b290a0c3826cd05dd1722849d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/lib/index.js @@ -0,0 +1,27 @@ +/** + * @typedef {import('mdast').Nodes} Nodes + * @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction + */ + +import {findAndReplace} from 'mdast-util-find-and-replace' + +/** + * Turn normal line endings into hard breaks. + * + * @param {Nodes} tree + * Tree to change. + * @returns {undefined} + * Nothing. + */ +export function newlineToBreak(tree) { + findAndReplace(tree, [/\r?\n|\r/g, replace]) +} + +/** + * Replace line endings. + * + * @type {ReplaceFunction} + */ +function replace() { + return {type: 'break'} +} diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/license b/tools/ui/node_modules/mdast-util-newline-to-break/license new file mode 100644 index 0000000000000000000000000000000000000000..045ffe0e075da471f1b04e204acce031b22d1c13 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/package.json b/tools/ui/node_modules/mdast-util-newline-to-break/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3c13c464ac4d320c8af7079b1b672597d501b9a0 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/package.json @@ -0,0 +1,77 @@ +{ + "name": "mdast-util-newline-to-break", + "version": "2.0.0", + "description": "mdast utility to support hard breaks without needing spaces or escapes", + "license": "MIT", + "keywords": [ + "mdast", + "markdown", + "break", + "newline", + "linefeed" + ], + "repository": "syntax-tree/mdast-util-newline-to-break", + "bugs": "https://github.com/syntax-tree/mdast-util-newline-to-break/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Remco Haszig ", + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-find-and-replace": "^3.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "mdast-util-from-markdown": "^1.0.0", + "mdast-util-to-markdown": "^1.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-newline-to-break/readme.md b/tools/ui/node_modules/mdast-util-newline-to-break/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..179ddb683fcb6f972233ddcf0aaf48a7b70b4626 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-newline-to-break/readme.md @@ -0,0 +1,248 @@ +# mdast-util-newline-to-break + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**[mdast][]** utility to support hard breaks without needing spaces or +escapes (turns enters into `
    `s). + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`newlineToBreak(tree)`](#newlinetobreaktree) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that takes an [mdast][] tree and turns soft line +endings (enters) into hard breaks (`
    `s) + +This package is used inside [remark-breaks][], which focusses on making it +easier to transform content by abstracting these internals away. + +## When should I use this? + +This plugin is useful if you want to display user content closer to how it was +authored, because when a user includes a line ending, it’ll show as such. +GitHub does this in a few places (comments, issues, PRs, and releases), but it’s +not semantic according to HTML and not compliant to markdown. +Markdown already has two ways to include hard breaks, namely trailing spaces and +escapes (note that `␠` represents a normal space): + +```markdown +lorem␠␠ +ipsum + +lorem\ +ipsum +``` + +Both will turn into `
    `s. +If you control who authors content or can document how markdown works, it’s +recommended to use escapes instead. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-newline-to-break +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {newlineToBreak} from 'https://esm.sh/mdast-util-newline-to-break@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say we have the following file, `example.md` (note: there are no spaces after +`a`): + +```markdown +This is a +paragraph. +``` + +And our module, `example.js`, looks as follows: + +```js +import fs from 'node:fs/promises' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {newlineToBreak} from 'mdast-util-newline-to-break' +import {toMarkdown} from 'mdast-util-to-markdown' + +const doc = await fs.readFile('example.md') +const tree = fromMarkdown(doc) + +newlineToBreak(tree) + +console.log(toMarkdown(tree)) +``` + +Now, running `node example.js` yields: + +```md +This is a\ +paragraph. +``` + +## API + +This package exports the identifier [`newlineToBreak`][api-newline-to-break]. +There is no default export. + +### `newlineToBreak(tree)` + +Turn normal line endings into hard breaks. + +#### Parameters + +* `tree` ([`Node`][node]) + — tree to modify + +## Syntax + +This utility looks for markdown line endings (`\r`, `\n`, and `\r\n`). + +## Syntax tree + +This utility adds mdast [`Break`][break] nodes to the syntax tree. +These are the same nodes that represent breaks with spaces or escapes. + +## Types + +This package is fully typed with [TypeScript][]. +There are no extra exported types. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`mdast-util-newline-to-break@^2`, compatible with Node.js 16. + +## Security + +Use of `mdast-util-newline-to-break` does not involve **[hast][]** or user +content so there are no openings for [cross-site scripting (XSS)][xss] attacks. + +## Related + +* [`remark-breaks`](https://github.com/remarkjs/remark-breaks) + — provide this utility as a [unified][] [remark][] plugin. +* [`remark-gfm`](https://github.com/remarkjs/remark-gfm) + — support GFM (autolink literals, footnotes, strikethrough, tables, + tasklists) +* [`remark-github`](https://github.com/remarkjs/remark-github) + — link references to commits, issues, and users, in the same way that + GitHub does + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-newline-to-break/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-newline-to-break/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-newline-to-break.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-newline-to-break + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-newline-to-break.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-newline-to-break + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-newline-to-break + +[size]: https://bundlejs.com/?q=mdast-util-newline-to-break + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/orgs/syntax-tree/discussions + +[mdast]: https://github.com/syntax-tree/mdast + +[npm]: https://docs.npmjs.com/cli/install + +[esmsh]: https://esm.sh + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[remark-breaks]: https://github.com/remarkjs/remark-breaks + +[node]: https://github.com/syntax-tree/mdast#nodes + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[typescript]: https://www.typescriptlang.org + +[hast]: https://github.com/syntax-tree/hast + +[break]: https://github.com/syntax-tree/mdast#break + +[remark]: https://github.com/remarkjs/remark + +[api-newline-to-break]: #newlinetobreaktree + +[unified]: https://github.com/unifiedjs/unified diff --git a/tools/ui/node_modules/mdast-util-phrasing/index.d.ts b/tools/ui/node_modules/mdast-util-phrasing/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b90dfa7c5e1acef508c614aa02b5a2805e2a1059 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/index.d.ts @@ -0,0 +1 @@ +export { phrasing } from "./lib/index.js"; diff --git a/tools/ui/node_modules/mdast-util-phrasing/index.js b/tools/ui/node_modules/mdast-util-phrasing/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2627f17a6e336455bb2d9f2d74bdee360b582680 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/index.js @@ -0,0 +1 @@ +export {phrasing} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-phrasing/lib/index.d.ts b/tools/ui/node_modules/mdast-util-phrasing/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59c698009264acc57589b84af50dab10cdb4ceb9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/lib/index.d.ts @@ -0,0 +1,3 @@ +export function phrasing(node?: unknown): node is import("mdast").Break | import("mdast").Delete | import("mdast").Emphasis | import("mdast").FootnoteReference | import("mdast").Image | import("mdast").ImageReference | import("mdast").InlineCode | import("mdast").Link | import("mdast").LinkReference | import("mdast").Strong | import("mdast").Text; +export type Html = import('mdast').Html; +export type PhrasingContent = import('mdast').PhrasingContent; diff --git a/tools/ui/node_modules/mdast-util-phrasing/lib/index.js b/tools/ui/node_modules/mdast-util-phrasing/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..64f076999a3f9a05406d57d6c18ae9169d40aa8c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/lib/index.js @@ -0,0 +1,45 @@ +/** + * @typedef {import('mdast').Html} Html + * @typedef {import('mdast').PhrasingContent} PhrasingContent + */ + +import {convert} from 'unist-util-is' + +/** + * Check if the given value is *phrasing content*. + * + * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow. + * + * @param node + * Thing to check, typically `Node`. + * @returns + * Whether `value` is phrasing content. + */ + +export const phrasing = + /** @type {(node?: unknown) => node is Exclude} */ + ( + convert([ + 'break', + 'delete', + 'emphasis', + // To do: next major: removed since footnotes were added to GFM. + 'footnote', + 'footnoteReference', + 'image', + 'imageReference', + 'inlineCode', + // Enabled by `mdast-util-math`: + 'inlineMath', + 'link', + 'linkReference', + // Enabled by `mdast-util-mdx`: + 'mdxJsxTextElement', + // Enabled by `mdast-util-mdx`: + 'mdxTextExpression', + 'strong', + 'text', + // Enabled by `mdast-util-directive`: + 'textDirective' + ]) + ) diff --git a/tools/ui/node_modules/mdast-util-phrasing/license b/tools/ui/node_modules/mdast-util-phrasing/license new file mode 100644 index 0000000000000000000000000000000000000000..6883cb5177f12e0b1bc11a5b410c547103731a79 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/license @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2017 Titus Wormer +Copyright (c) 2017 Victor Felder + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-phrasing/package.json b/tools/ui/node_modules/mdast-util-phrasing/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2af70323562d031fc4cb33a314051ffdfaab87a5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/package.json @@ -0,0 +1,78 @@ +{ + "name": "mdast-util-phrasing", + "version": "4.1.0", + "description": "mdast utility to check if a node is phrasing content", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast=util", + "util", + "utility", + "markdown", + "phrasing" + ], + "repository": "syntax-tree/mdast-util-phrasing", + "bugs": "https://github.com/syntax-tree/mdast-util-phrasing/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Victor Felder (https://draft.li)", + "contributors": [ + "Victor Felder (https://draft.li)", + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^9.0.0", + "prettier": "^3.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.56.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-phrasing/readme.md b/tools/ui/node_modules/mdast-util-phrasing/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..a797fef20a99e858e9808d3a125e3515c3610c90 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-phrasing/readme.md @@ -0,0 +1,200 @@ +# mdast-util-phrasing + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] utility to check if a node is phrasing content. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`phrasing(value)`](#phrasingvalue) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a tiny utility to check that a given [node][] is [phrasing +content][phrasing]. + +## When should I use this? + +This utility is typically useful if you’re making other utilities. +It uses [`unist-util-is`][unist-util-is], which you can use for your own checks. + +A different utility, [`hast-util-phrasing`][hast-util-phrasing], does the same +but on [hast][]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-phrasing +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {phrasing} from 'https://esm.sh/mdast-util-phrasing@4' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {phrasing} from 'mdast-util-phrasing' + +phrasing({type: 'paragraph', children: [{type: 'text', value: 'Alpha'}]}) +// => false + +phrasing({type: 'strong', children: [{type: 'text', value: 'Delta'}]}) +// => true +``` + +## API + +This package exports the identifier [`phrasing`][api-phrasing]. +There is no default export. + +### `phrasing(value)` + +Check if the given value is *[phrasing content][phrasing]*. + +> 👉 **Note**: Excludes `html`, which can be both phrasing or flow. + +###### Parameters + +* `value` (`unknown`) + — thing to check, typically [`Node`][node] + +###### Returns + +Whether `value` is phrasing content (`boolean`). + +## Types + +This package is fully typed with [TypeScript][]. +It does not export extra types. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-phrasing@^4`, +compatible with Node.js 16. + +## Security + +Use of `mdast-util-phrasing` does not involve **[hast][]**, user content, or +change the tree, so there are no openings for [cross-site scripting (XSS)][xss] +attacks. + +## Related + +* [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing) + — check if a hast node is phrasing content +* [`unist-util-is`](https://github.com/syntax-tree/unist-util-is) + — check if a node passes a test + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Victor Felder][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-phrasing/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-phrasing/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-phrasing.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-phrasing + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-phrasing.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-phrasing + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-phrasing + +[size]: https://bundlejs.com/?q=mdast-util-phrasing + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://draft.li + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[hast]: https://github.com/syntax-tree/hast + +[mdast]: https://github.com/syntax-tree/mdast + +[node]: https://github.com/syntax-tree/mdast#nodes + +[phrasing]: https://github.com/syntax-tree/mdast#phrasingcontent + +[unist-util-is]: https://github.com/syntax-tree/unist-util-is + +[hast-util-phrasing]: https://github.com/syntax-tree/hast-util-phrasing + +[api-phrasing]: #phrasingvalue diff --git a/tools/ui/node_modules/mdast-util-to-hast/index.d.ts b/tools/ui/node_modules/mdast-util-to-hast/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c5c912847f35e5b4530776a5621e24f1215b1a1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/index.d.ts @@ -0,0 +1,94 @@ +import type {Data, ElementContent, Literal, Properties} from 'hast' + +// Expose types. +export type { + FootnoteBackContentTemplate, + FootnoteBackLabelTemplate +} from './lib/footer.js' +export type {Handler, Handlers, Options, State} from './lib/state.js' + +// Expose JS API. +export {handlers as defaultHandlers} from './lib/handlers/index.js' +export { + defaultFootnoteBackContent, + defaultFootnoteBackLabel +} from './lib/footer.js' +export {toHast} from './lib/index.js' + +/** + * Raw string of HTML embedded into HTML AST. + */ +export interface Raw extends Literal { + /** + * Node type of raw. + */ + type: 'raw' + + /** + * Data associated with the hast raw. + */ + data?: RawData | undefined +} + +/** + * Info associated with hast raw nodes by the ecosystem. + */ +export interface RawData extends Data {} + +// Register nodes in content. +declare module 'hast' { + interface ElementData { + /** + * Custom info relating to the node, if `` in `
    `.
    +     *
    +     * Defined by `mdast-util-to-hast` (`remark-rehype`).
    +     */
    +    meta?: string | null | undefined
    +  }
    +
    +  interface ElementContentMap {
    +    /**
    +     * Raw string of HTML embedded into HTML AST.
    +     */
    +    raw: Raw
    +  }
    +
    +  interface RootContentMap {
    +    /**
    +     * Raw string of HTML embedded into HTML AST.
    +     */
    +    raw: Raw
    +  }
    +}
    +
    +// Register data on mdast.
    +declare module 'mdast' {
    +  interface Data {
    +    /**
    +     * Field supported by `mdast-util-to-hast` to signal that a node should
    +     * result in something with these children.
    +     *
    +     * When this is defined, when a parent is created, these children will
    +     * be used.
    +     */
    +    hChildren?: ElementContent[] | undefined
    +
    +    /**
    +     * Field supported by `mdast-util-to-hast` to signal that a node should
    +     * result in a particular element, instead of its default behavior.
    +     *
    +     * When this is defined, an element with the given tag name is created.
    +     * For example, when setting `hName` to `'b'`, a `` element is created.
    +     */
    +    hName?: string | undefined
    +
    +    /**
    +     * Field supported by `mdast-util-to-hast` to signal that a node should
    +     * result in an element with these properties.
    +     *
    +     * When this is defined, when an element is created, these properties will
    +     * be used.
    +     */
    +    hProperties?: Properties | undefined
    +  }
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/index.js b/tools/ui/node_modules/mdast-util-to-hast/index.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..5e88898b80d043f2f96d9dd1a0db639ae0d92d38
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/index.js
    @@ -0,0 +1,7 @@
    +// Note: types exposed from `index.d.ts`.
    +export {handlers as defaultHandlers} from './lib/handlers/index.js'
    +export {toHast} from './lib/index.js'
    +export {
    +  defaultFootnoteBackContent,
    +  defaultFootnoteBackLabel
    +} from './lib/footer.js'
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..e0a08815c16104a33b1c520f3cef95503e826be8
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts
    @@ -0,0 +1,81 @@
    +/**
    + * Generate the default content that GitHub uses on backreferences.
    + *
    + * @param {number} _
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {Array}
    + *   Content.
    + */
    +export function defaultFootnoteBackContent(_: number, rereferenceIndex: number): Array;
    +/**
    + * Generate the default label that GitHub uses on backreferences.
    + *
    + * @param {number} referenceIndex
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {string}
    + *   Label.
    + */
    +export function defaultFootnoteBackLabel(referenceIndex: number, rereferenceIndex: number): string;
    +/**
    + * Generate a hast footer for called footnote definitions.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @returns {Element | undefined}
    + *   `section` element or `undefined`.
    + */
    +export function footer(state: State): Element | undefined;
    +/**
    + * Generate content for the backreference dynamically.
    + *
    + * For the following markdown:
    + *
    + * ```markdown
    + * Alpha[^micromark], bravo[^micromark], and charlie[^remark].
    + *
    + * [^remark]: things about remark
    + * [^micromark]: things about micromark
    + * ```
    + *
    + * This function will be called with:
    + *
    + * *  `0` and `0` for the backreference from `things about micromark` to
    + *  `alpha`, as it is the first used definition, and the first call to it
    + * *  `0` and `1` for the backreference from `things about micromark` to
    + *  `bravo`, as it is the first used definition, and the second call to it
    + * *  `1` and `0` for the backreference from `things about remark` to
    + *  `charlie`, as it is the second used definition
    + */
    +export type FootnoteBackContentTemplate = (referenceIndex: number, rereferenceIndex: number) => Array | ElementContent | string;
    +/**
    + * Generate a back label dynamically.
    + *
    + * For the following markdown:
    + *
    + * ```markdown
    + * Alpha[^micromark], bravo[^micromark], and charlie[^remark].
    + *
    + * [^remark]: things about remark
    + * [^micromark]: things about micromark
    + * ```
    + *
    + * This function will be called with:
    + *
    + * *  `0` and `0` for the backreference from `things about micromark` to
    + *  `alpha`, as it is the first used definition, and the first call to it
    + * *  `0` and `1` for the backreference from `things about micromark` to
    + *  `bravo`, as it is the first used definition, and the second call to it
    + * *  `1` and `0` for the backreference from `things about remark` to
    + *  `charlie`, as it is the second used definition
    + */
    +export type FootnoteBackLabelTemplate = (referenceIndex: number, rereferenceIndex: number) => string;
    +import type { ElementContent } from 'hast';
    +import type { State } from './state.js';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=footer.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..c3fce40c6584702a65ba95ff6a38d2f766d6ab88
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["footer.js"],"names":[],"mappings":"AAmEA;;;;;;;;;;GAUG;AACH,8CARW,MAAM,oBAGN,MAAM,GAEJ,KAAK,CAAC,cAAc,CAAC,CAiBjC;AAED;;;;;;;;;;GAUG;AACH,yDARW,MAAM,oBAGN,MAAM,GAEJ,MAAM,CASlB;AAED;;;;;;;GAOG;AAEH,8BANW,KAAK,GAEH,OAAO,GAAG,SAAS,CAmI/B;;;;;;;;;;;;;;;;;;;;;;2DA/NU,MAAM,oBAGN,MAAM,KAEJ,KAAK,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;yDAwBjD,MAAM,oBAGN,MAAM,KAEJ,MAAM;oCA3DuB,MAAM;2BACxB,YAAY;6BADM,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/footer.js b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..d26807c87ee5c6ed9aad068522a4b85866e1380b
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/footer.js
    @@ -0,0 +1,250 @@
    +/**
    + * @import {ElementContent, Element} from 'hast'
    + * @import {State} from './state.js'
    + */
    +
    +/**
    + * @callback FootnoteBackContentTemplate
    + *   Generate content for the backreference dynamically.
    + *
    + *   For the following markdown:
    + *
    + *   ```markdown
    + *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].
    + *
    + *   [^remark]: things about remark
    + *   [^micromark]: things about micromark
    + *   ```
    + *
    + *   This function will be called with:
    + *
    + *   *  `0` and `0` for the backreference from `things about micromark` to
    + *      `alpha`, as it is the first used definition, and the first call to it
    + *   *  `0` and `1` for the backreference from `things about micromark` to
    + *      `bravo`, as it is the first used definition, and the second call to it
    + *   *  `1` and `0` for the backreference from `things about remark` to
    + *      `charlie`, as it is the second used definition
    + * @param {number} referenceIndex
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {Array | ElementContent | string}
    + *   Content for the backreference when linking back from definitions to their
    + *   reference.
    + *
    + * @callback FootnoteBackLabelTemplate
    + *   Generate a back label dynamically.
    + *
    + *   For the following markdown:
    + *
    + *   ```markdown
    + *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].
    + *
    + *   [^remark]: things about remark
    + *   [^micromark]: things about micromark
    + *   ```
    + *
    + *   This function will be called with:
    + *
    + *   *  `0` and `0` for the backreference from `things about micromark` to
    + *      `alpha`, as it is the first used definition, and the first call to it
    + *   *  `0` and `1` for the backreference from `things about micromark` to
    + *      `bravo`, as it is the first used definition, and the second call to it
    + *   *  `1` and `0` for the backreference from `things about remark` to
    + *      `charlie`, as it is the second used definition
    + * @param {number} referenceIndex
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {string}
    + *   Back label to use when linking back from definitions to their reference.
    + */
    +
    +import structuredClone from '@ungap/structured-clone'
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +
    +/**
    + * Generate the default content that GitHub uses on backreferences.
    + *
    + * @param {number} _
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {Array}
    + *   Content.
    + */
    +export function defaultFootnoteBackContent(_, rereferenceIndex) {
    +  /** @type {Array} */
    +  const result = [{type: 'text', value: '↩'}]
    +
    +  if (rereferenceIndex > 1) {
    +    result.push({
    +      type: 'element',
    +      tagName: 'sup',
    +      properties: {},
    +      children: [{type: 'text', value: String(rereferenceIndex)}]
    +    })
    +  }
    +
    +  return result
    +}
    +
    +/**
    + * Generate the default label that GitHub uses on backreferences.
    + *
    + * @param {number} referenceIndex
    + *   Index of the definition in the order that they are first referenced,
    + *   0-indexed.
    + * @param {number} rereferenceIndex
    + *   Index of calls to the same definition, 0-indexed.
    + * @returns {string}
    + *   Label.
    + */
    +export function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {
    +  return (
    +    'Back to reference ' +
    +    (referenceIndex + 1) +
    +    (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')
    +  )
    +}
    +
    +/**
    + * Generate a hast footer for called footnote definitions.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @returns {Element | undefined}
    + *   `section` element or `undefined`.
    + */
    +// eslint-disable-next-line complexity
    +export function footer(state) {
    +  const clobberPrefix =
    +    typeof state.options.clobberPrefix === 'string'
    +      ? state.options.clobberPrefix
    +      : 'user-content-'
    +  const footnoteBackContent =
    +    state.options.footnoteBackContent || defaultFootnoteBackContent
    +  const footnoteBackLabel =
    +    state.options.footnoteBackLabel || defaultFootnoteBackLabel
    +  const footnoteLabel = state.options.footnoteLabel || 'Footnotes'
    +  const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'
    +  const footnoteLabelProperties = state.options.footnoteLabelProperties || {
    +    className: ['sr-only']
    +  }
    +  /** @type {Array} */
    +  const listItems = []
    +  let referenceIndex = -1
    +
    +  while (++referenceIndex < state.footnoteOrder.length) {
    +    const definition = state.footnoteById.get(
    +      state.footnoteOrder[referenceIndex]
    +    )
    +
    +    if (!definition) {
    +      continue
    +    }
    +
    +    const content = state.all(definition)
    +    const id = String(definition.identifier).toUpperCase()
    +    const safeId = normalizeUri(id.toLowerCase())
    +    let rereferenceIndex = 0
    +    /** @type {Array} */
    +    const backReferences = []
    +    const counts = state.footnoteCounts.get(id)
    +
    +    // eslint-disable-next-line no-unmodified-loop-condition
    +    while (counts !== undefined && ++rereferenceIndex <= counts) {
    +      if (backReferences.length > 0) {
    +        backReferences.push({type: 'text', value: ' '})
    +      }
    +
    +      let children =
    +        typeof footnoteBackContent === 'string'
    +          ? footnoteBackContent
    +          : footnoteBackContent(referenceIndex, rereferenceIndex)
    +
    +      if (typeof children === 'string') {
    +        children = {type: 'text', value: children}
    +      }
    +
    +      backReferences.push({
    +        type: 'element',
    +        tagName: 'a',
    +        properties: {
    +          href:
    +            '#' +
    +            clobberPrefix +
    +            'fnref-' +
    +            safeId +
    +            (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),
    +          dataFootnoteBackref: '',
    +          ariaLabel:
    +            typeof footnoteBackLabel === 'string'
    +              ? footnoteBackLabel
    +              : footnoteBackLabel(referenceIndex, rereferenceIndex),
    +          className: ['data-footnote-backref']
    +        },
    +        children: Array.isArray(children) ? children : [children]
    +      })
    +    }
    +
    +    const tail = content[content.length - 1]
    +
    +    if (tail && tail.type === 'element' && tail.tagName === 'p') {
    +      const tailTail = tail.children[tail.children.length - 1]
    +      if (tailTail && tailTail.type === 'text') {
    +        tailTail.value += ' '
    +      } else {
    +        tail.children.push({type: 'text', value: ' '})
    +      }
    +
    +      tail.children.push(...backReferences)
    +    } else {
    +      content.push(...backReferences)
    +    }
    +
    +    /** @type {Element} */
    +    const listItem = {
    +      type: 'element',
    +      tagName: 'li',
    +      properties: {id: clobberPrefix + 'fn-' + safeId},
    +      children: state.wrap(content, true)
    +    }
    +
    +    state.patch(definition, listItem)
    +
    +    listItems.push(listItem)
    +  }
    +
    +  if (listItems.length === 0) {
    +    return
    +  }
    +
    +  return {
    +    type: 'element',
    +    tagName: 'section',
    +    properties: {dataFootnotes: true, className: ['footnotes']},
    +    children: [
    +      {
    +        type: 'element',
    +        tagName: footnoteLabelTagName,
    +        properties: {
    +          ...structuredClone(footnoteLabelProperties),
    +          id: 'footnote-label'
    +        },
    +        children: [{type: 'text', value: footnoteLabel}]
    +      },
    +      {type: 'text', value: '\n'},
    +      {
    +        type: 'element',
    +        tagName: 'ol',
    +        properties: {},
    +        children: state.wrap(listItems, true)
    +      },
    +      {type: 'text', value: '\n'}
    +    ]
    +  }
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..336ab4649a1bb1bbcd68db2de7121be600bf2804
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Blockquote} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `blockquote` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Blockquote} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function blockquote(state: State, node: Blockquote): Element;
    +import type { State } from '../state.js';
    +import type { Blockquote } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=blockquote.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..ef0885b8d2dc8fd92d3502e24d7b3c2b9a79cf75
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,kCAPW,KAAK,QAEL,UAAU,GAER,OAAO,CAanB;2BAvBuB,aAAa;gCADR,OAAO;6BADV,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..c278be1aa07f56f850f2412121c2c3bb3c80b397
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Blockquote} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `blockquote` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Blockquote} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function blockquote(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'blockquote',
    +    properties: {},
    +    children: state.wrap(state.all(node), true)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..5289478969dae7737bc5c3d8b27ee9e6fa6b5b33
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts
    @@ -0,0 +1,21 @@
    +/**
    + * @import {Element, Text} from 'hast'
    + * @import {Break} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `break` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Break} node
    + *   mdast node.
    + * @returns {Array}
    + *   hast element content.
    + */
    +export function hardBreak(state: State, node: Break): Array;
    +import type { State } from '../state.js';
    +import type { Break } from 'mdast';
    +import type { Element } from 'hast';
    +import type { Text } from 'hast';
    +//# sourceMappingURL=break.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..824d0de0d1b47c0de81ff20abbfe23cce1b45a54
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,iCAPW,KAAK,QAEL,KAAK,GAEH,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAQjC;2BAlBuB,aAAa;2BADb,OAAO;6BADC,MAAM;0BAAN,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..cb4868bf075d1cd2f6abcdd302fd7b1a95448a82
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/break.js
    @@ -0,0 +1,22 @@
    +/**
    + * @import {Element, Text} from 'hast'
    + * @import {Break} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `break` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Break} node
    + *   mdast node.
    + * @returns {Array}
    + *   hast element content.
    + */
    +export function hardBreak(state, node) {
    +  /** @type {Element} */
    +  const result = {type: 'element', tagName: 'br', properties: {}, children: []}
    +  state.patch(node, result)
    +  return [state.applyData(node, result), {type: 'text', value: '\n'}]
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..a709b701c9e6a27ac55abbf8c111cd73d087701d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {Code} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `code` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Code} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function code(state: State, node: Code): Element;
    +import type { State } from '../state.js';
    +import type { Code } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=code.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..b09744b861e0f4de04c734bc38824bc77fb2ebd2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["code.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,4BAPW,KAAK,QAEL,IAAI,GAEF,OAAO,CAmCnB;2BA7CuB,aAAa;0BADd,OAAO;6BADQ,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..4df449a90040e080e6d9f42f9f125f20248d1125
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/code.js
    @@ -0,0 +1,49 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {Code} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `code` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Code} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function code(state, node) {
    +  const value = node.value ? node.value + '\n' : ''
    +  /** @type {Properties} */
    +  const properties = {}
    +  // Someone can write `js python	ruby`.
    +  const language = node.lang ? node.lang.split(/\s+/) : []
    +
    +  // GH/CM still drop the non-first languages.
    +  if (language.length > 0) {
    +    properties.className = ['language-' + language[0]]
    +  }
    +
    +  // Create ``.
    +  /** @type {Element} */
    +  let result = {
    +    type: 'element',
    +    tagName: 'code',
    +    properties,
    +    children: [{type: 'text', value}]
    +  }
    +
    +  if (node.meta) {
    +    result.data = {meta: node.meta}
    +  }
    +
    +  state.patch(node, result)
    +  result = state.applyData(node, result)
    +
    +  // Create `
    `.
    +  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}
    +  state.patch(node, result)
    +  return result
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..f64b17832fca2231efe70d218adb326ae920b24b
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Delete} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `delete` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Delete} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function strikethrough(state: State, node: Delete): Element;
    +import type { State } from '../state.js';
    +import type { Delete } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=delete.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..ce83f8a60d33751c6507d794b3992cdf194554f4
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["delete.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,qCAPW,KAAK,QAEL,MAAM,GAEJ,OAAO,CAanB;2BAvBuB,aAAa;4BADZ,OAAO;6BADN,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..5c0492996013e81ba14f6a53823633b218b2862d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/delete.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Delete} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `delete` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Delete} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function strikethrough(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'del',
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..44acbb4c4fd3880a4726aac1fe3d307e05ef0d45
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Emphasis} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `emphasis` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Emphasis} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function emphasis(state: State, node: Emphasis): Element;
    +import type { State } from '../state.js';
    +import type { Emphasis } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=emphasis.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..4181c91071a584087a342faafea9f997edaaa35d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,gCAPW,KAAK,QAEL,QAAQ,GAEN,OAAO,CAanB;2BAvBuB,aAAa;8BADV,OAAO;6BADR,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..d9fa9fe6ed6e6d99a681630eb6d55e8f544a47ad
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Emphasis} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `emphasis` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Emphasis} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function emphasis(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'em',
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..600ac1d2f533f7796875382cf73e4ee0c88fe974
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `footnoteReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {FootnoteReference} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function footnoteReference(state: State, node: FootnoteReference): Element;
    +import type { State } from '../state.js';
    +import type { FootnoteReference } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=footnote-reference.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..8a8dd3db27b7cf7ca4a5693abc833dd311d5ccf2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"footnote-reference.d.ts","sourceRoot":"","sources":["footnote-reference.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,yCAPW,KAAK,QAEL,iBAAiB,GAEf,OAAO,CAsDnB;2BAlEuB,aAAa;uCADD,OAAO;6BADjB,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..8f39e79ede3391ccd22988bff7fb4f3799522d97
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js
    @@ -0,0 +1,70 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {FootnoteReference} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +
    +/**
    + * Turn an mdast `footnoteReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {FootnoteReference} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function footnoteReference(state, node) {
    +  const clobberPrefix =
    +    typeof state.options.clobberPrefix === 'string'
    +      ? state.options.clobberPrefix
    +      : 'user-content-'
    +  const id = String(node.identifier).toUpperCase()
    +  const safeId = normalizeUri(id.toLowerCase())
    +  const index = state.footnoteOrder.indexOf(id)
    +  /** @type {number} */
    +  let counter
    +
    +  let reuseCounter = state.footnoteCounts.get(id)
    +
    +  if (reuseCounter === undefined) {
    +    reuseCounter = 0
    +    state.footnoteOrder.push(id)
    +    counter = state.footnoteOrder.length
    +  } else {
    +    counter = index + 1
    +  }
    +
    +  reuseCounter += 1
    +  state.footnoteCounts.set(id, reuseCounter)
    +
    +  /** @type {Element} */
    +  const link = {
    +    type: 'element',
    +    tagName: 'a',
    +    properties: {
    +      href: '#' + clobberPrefix + 'fn-' + safeId,
    +      id:
    +        clobberPrefix +
    +        'fnref-' +
    +        safeId +
    +        (reuseCounter > 1 ? '-' + reuseCounter : ''),
    +      dataFootnoteRef: true,
    +      ariaDescribedBy: ['footnote-label']
    +    },
    +    children: [{type: 'text', value: String(counter)}]
    +  }
    +  state.patch(node, link)
    +
    +  /** @type {Element} */
    +  const sup = {
    +    type: 'element',
    +    tagName: 'sup',
    +    properties: {},
    +    children: [link]
    +  }
    +  state.patch(node, sup)
    +  return state.applyData(node, sup)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..173e4d2c0dda03e1ab3e1d347fefbaecdbf787d2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Heading} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `heading` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Heading} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function heading(state: State, node: Heading): Element;
    +import type { State } from '../state.js';
    +import type { Heading } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=heading.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..e9936a3b982c3fc15971af5517cdd8c20bf03835
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,+BAPW,KAAK,QAEL,OAAO,GAEL,OAAO,CAanB;2BAvBuB,aAAa;6BADX,OAAO;6BADP,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..6e041f9e44d39326ef75a747c97be9229f2a6fed
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/heading.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Heading} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `heading` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Heading} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function heading(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'h' + node.depth,
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..b07246050472837c7c29003745e3675f5bb14fa2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts
    @@ -0,0 +1,23 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Html} from 'mdast'
    + * @import {State} from '../state.js'
    + * @import {Raw} from '../../index.js'
    + */
    +/**
    + * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise
    + * nothing).
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Html} node
    + *   mdast node.
    + * @returns {Element | Raw | undefined}
    + *   hast node.
    + */
    +export function html(state: State, node: Html): Element | Raw | undefined;
    +import type { State } from '../state.js';
    +import type { Html } from 'mdast';
    +import type { Element } from 'hast';
    +import type { Raw } from '../../index.js';
    +//# sourceMappingURL=html.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..d7ad01b8e805528c06cb84fd4421f5f2411685d2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,4BAPW,KAAK,QAEL,IAAI,GAEF,OAAO,GAAG,GAAG,GAAG,SAAS,CAYrC;2BAxBuB,aAAa;0BADd,OAAO;6BADJ,MAAM;yBAGV,gBAAgB"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..1617665588c0c8c22a4480c4218663ff577b69f3
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/html.js
    @@ -0,0 +1,28 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Html} from 'mdast'
    + * @import {State} from '../state.js'
    + * @import {Raw} from '../../index.js'
    + */
    +
    +/**
    + * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise
    + * nothing).
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Html} node
    + *   mdast node.
    + * @returns {Element | Raw | undefined}
    + *   hast node.
    + */
    +export function html(state, node) {
    +  if (state.options.allowDangerousHtml) {
    +    /** @type {Raw} */
    +    const result = {type: 'raw', value: node.value}
    +    state.patch(node, result)
    +    return state.applyData(node, result)
    +  }
    +
    +  return undefined
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..454a4bf3f9e066acde4b21f4567be1fd9e2f02a1
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `imageReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ImageReference} node
    + *   mdast node.
    + * @returns {Array | ElementContent}
    + *   hast node.
    + */
    +export function imageReference(state: State, node: ImageReference): Array | ElementContent;
    +import type { State } from '../state.js';
    +import type { ImageReference } from 'mdast';
    +import type { ElementContent } from 'hast';
    +//# sourceMappingURL=image-reference.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..e2a906c052e43ea1032b68bc4b8ddafb623d5ab9
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,sCAPW,KAAK,QAEL,cAAc,GAEZ,KAAK,CAAC,cAAc,CAAC,GAAG,cAAc,CAsBlD;2BAnCuB,aAAa;oCADJ,OAAO;oCADc,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..b758406904a972367eeabd030108f8ae8a6641c6
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js
    @@ -0,0 +1,39 @@
    +/**
    + * @import {ElementContent, Element, Properties} from 'hast'
    + * @import {ImageReference} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +import {revert} from '../revert.js'
    +
    +/**
    + * Turn an mdast `imageReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ImageReference} node
    + *   mdast node.
    + * @returns {Array | ElementContent}
    + *   hast node.
    + */
    +export function imageReference(state, node) {
    +  const id = String(node.identifier).toUpperCase()
    +  const definition = state.definitionById.get(id)
    +
    +  if (!definition) {
    +    return revert(state, node)
    +  }
    +
    +  /** @type {Properties} */
    +  const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}
    +
    +  if (definition.title !== null && definition.title !== undefined) {
    +    properties.title = definition.title
    +  }
    +
    +  /** @type {Element} */
    +  const result = {type: 'element', tagName: 'img', properties, children: []}
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..9dd2bf94cf46e436698c0d71ad75943fa9621903
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `image` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Image} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function image(state: State, node: Image): Element;
    +import type { State } from '../state.js';
    +import type { Image } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=image.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..6e6e205290cc85c034535c62ac218b6a18b9f1f3
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,6BAPW,KAAK,QAEL,KAAK,GAEH,OAAO,CAmBnB;2BA/BuB,aAAa;2BADb,OAAO;6BADO,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..aa183932fea27c00f22bc2bcb4f38532d265bf85
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/image.js
    @@ -0,0 +1,35 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {Image} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +
    +/**
    + * Turn an mdast `image` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Image} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function image(state, node) {
    +  /** @type {Properties} */
    +  const properties = {src: normalizeUri(node.url)}
    +
    +  if (node.alt !== null && node.alt !== undefined) {
    +    properties.alt = node.alt
    +  }
    +
    +  if (node.title !== null && node.title !== undefined) {
    +    properties.title = node.title
    +  }
    +
    +  /** @type {Element} */
    +  const result = {type: 'element', tagName: 'img', properties, children: []}
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..fb72486c5505e6bbd736185a9c63a7d13b7e87d5
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts
    @@ -0,0 +1,55 @@
    +export namespace handlers {
    +    export { blockquote };
    +    export { hardBreak as break };
    +    export { code };
    +    export { strikethrough as delete };
    +    export { emphasis };
    +    export { footnoteReference };
    +    export { heading };
    +    export { html };
    +    export { imageReference };
    +    export { image };
    +    export { inlineCode };
    +    export { linkReference };
    +    export { link };
    +    export { listItem };
    +    export { list };
    +    export { paragraph };
    +    export { root };
    +    export { strong };
    +    export { table };
    +    export { tableCell };
    +    export { tableRow };
    +    export { text };
    +    export { thematicBreak };
    +    export { ignore as toml };
    +    export { ignore as yaml };
    +    export { ignore as definition };
    +    export { ignore as footnoteDefinition };
    +}
    +import { blockquote } from './blockquote.js';
    +import { hardBreak } from './break.js';
    +import { code } from './code.js';
    +import { strikethrough } from './delete.js';
    +import { emphasis } from './emphasis.js';
    +import { footnoteReference } from './footnote-reference.js';
    +import { heading } from './heading.js';
    +import { html } from './html.js';
    +import { imageReference } from './image-reference.js';
    +import { image } from './image.js';
    +import { inlineCode } from './inline-code.js';
    +import { linkReference } from './link-reference.js';
    +import { link } from './link.js';
    +import { listItem } from './list-item.js';
    +import { list } from './list.js';
    +import { paragraph } from './paragraph.js';
    +import { root } from './root.js';
    +import { strong } from './strong.js';
    +import { table } from './table.js';
    +import { tableCell } from './table-cell.js';
    +import { tableRow } from './table-row.js';
    +import { text } from './text.js';
    +import { thematicBreak } from './thematic-break.js';
    +declare function ignore(): undefined;
    +export {};
    +//# sourceMappingURL=index.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..15185eab6e8ae3809f8c30b4c38c2095af249659
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAIyB,iBAAiB;0BAClB,YAAY;qBACjB,WAAW;8BACF,aAAa;yBAClB,eAAe;kCACN,yBAAyB;wBACnC,cAAc;qBACjB,WAAW;+BACD,sBAAsB;sBAC/B,YAAY;2BACP,kBAAkB;8BACf,qBAAqB;qBAC9B,WAAW;yBACP,gBAAgB;qBACpB,WAAW;0BACN,gBAAgB;qBACrB,WAAW;uBACT,aAAa;sBACd,YAAY;0BAER,iBAAiB;yBADlB,gBAAgB;qBAEpB,WAAW;8BACF,qBAAqB;AAuCjD,qCAEC"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..7ff77da09c7ee4722eca2ad054403f0ced6623fd
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/index.js
    @@ -0,0 +1,68 @@
    +/**
    + * @import {Handlers} from '../state.js'
    + */
    +
    +import {blockquote} from './blockquote.js'
    +import {hardBreak} from './break.js'
    +import {code} from './code.js'
    +import {strikethrough} from './delete.js'
    +import {emphasis} from './emphasis.js'
    +import {footnoteReference} from './footnote-reference.js'
    +import {heading} from './heading.js'
    +import {html} from './html.js'
    +import {imageReference} from './image-reference.js'
    +import {image} from './image.js'
    +import {inlineCode} from './inline-code.js'
    +import {linkReference} from './link-reference.js'
    +import {link} from './link.js'
    +import {listItem} from './list-item.js'
    +import {list} from './list.js'
    +import {paragraph} from './paragraph.js'
    +import {root} from './root.js'
    +import {strong} from './strong.js'
    +import {table} from './table.js'
    +import {tableRow} from './table-row.js'
    +import {tableCell} from './table-cell.js'
    +import {text} from './text.js'
    +import {thematicBreak} from './thematic-break.js'
    +
    +/**
    + * Default handlers for nodes.
    + *
    + * @satisfies {Handlers}
    + */
    +export const handlers = {
    +  blockquote,
    +  break: hardBreak,
    +  code,
    +  delete: strikethrough,
    +  emphasis,
    +  footnoteReference,
    +  heading,
    +  html,
    +  imageReference,
    +  image,
    +  inlineCode,
    +  linkReference,
    +  link,
    +  listItem,
    +  list,
    +  paragraph,
    +  // @ts-expect-error: root is different, but hard to type.
    +  root,
    +  strong,
    +  table,
    +  tableCell,
    +  tableRow,
    +  text,
    +  thematicBreak,
    +  toml: ignore,
    +  yaml: ignore,
    +  definition: ignore,
    +  footnoteDefinition: ignore
    +}
    +
    +// Return nothing for nodes that are ignored.
    +function ignore() {
    +  return undefined
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..c0b9f1b0476b433b4a2562b8ff9fc95f40d61c2d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element, Text} from 'hast'
    + * @import {InlineCode} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `inlineCode` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {InlineCode} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function inlineCode(state: State, node: InlineCode): Element;
    +import type { State } from '../state.js';
    +import type { InlineCode } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=inline-code.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..d4eb397bfb12999da8cbea7b5dcbf7bd843a0d46
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["inline-code.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,kCAPW,KAAK,QAEL,UAAU,GAER,OAAO,CAiBnB;2BA3BuB,aAAa;gCADR,OAAO;6BADJ,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..7edf48db604e58fb546ae12af9cc4cd8e55d02a6
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js
    @@ -0,0 +1,31 @@
    +/**
    + * @import {Element, Text} from 'hast'
    + * @import {InlineCode} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `inlineCode` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {InlineCode} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function inlineCode(state, node) {
    +  /** @type {Text} */
    +  const text = {type: 'text', value: node.value.replace(/\r?\n|\r/g, ' ')}
    +  state.patch(node, text)
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'code',
    +    properties: {},
    +    children: [text]
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..39186538f5400e10a1518f80e07bc85b3e527d45
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `linkReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {LinkReference} node
    + *   mdast node.
    + * @returns {Array | ElementContent}
    + *   hast node.
    + */
    +export function linkReference(state: State, node: LinkReference): Array | ElementContent;
    +import type { State } from '../state.js';
    +import type { LinkReference } from 'mdast';
    +import type { ElementContent } from 'hast';
    +//# sourceMappingURL=link-reference.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..040a6d8b0f42efed9493356045426fb283af1c95
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"link-reference.d.ts","sourceRoot":"","sources":["link-reference.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,qCAPW,KAAK,QAEL,aAAa,GAEX,KAAK,CAAC,cAAc,CAAC,GAAG,cAAc,CA2BlD;2BAxCuB,aAAa;mCADL,OAAO;oCADe,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..a98c14d7165954c34838cf432bb8340d32e2da83
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js
    @@ -0,0 +1,44 @@
    +/**
    + * @import {ElementContent, Element, Properties} from 'hast'
    + * @import {LinkReference} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +import {revert} from '../revert.js'
    +
    +/**
    + * Turn an mdast `linkReference` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {LinkReference} node
    + *   mdast node.
    + * @returns {Array | ElementContent}
    + *   hast node.
    + */
    +export function linkReference(state, node) {
    +  const id = String(node.identifier).toUpperCase()
    +  const definition = state.definitionById.get(id)
    +
    +  if (!definition) {
    +    return revert(state, node)
    +  }
    +
    +  /** @type {Properties} */
    +  const properties = {href: normalizeUri(definition.url || '')}
    +
    +  if (definition.title !== null && definition.title !== undefined) {
    +    properties.title = definition.title
    +  }
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'a',
    +    properties,
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..e02a88acaf966cf6d3570d0f5c870af32181cb9e
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `link` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Link} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function link(state: State, node: Link): Element;
    +import type { State } from '../state.js';
    +import type { Link } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=link.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..efeb9839e972189cfb800e87ae8a167b70540ed9
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["link.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,4BAPW,KAAK,QAEL,IAAI,GAEF,OAAO,CAoBnB;2BAhCuB,aAAa;0BADd,OAAO;6BADQ,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..00f970a907f56f91ea07004491c5b5287cce1722
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/link.js
    @@ -0,0 +1,36 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {Link} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {normalizeUri} from 'micromark-util-sanitize-uri'
    +
    +/**
    + * Turn an mdast `link` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Link} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function link(state, node) {
    +  /** @type {Properties} */
    +  const properties = {href: normalizeUri(node.url)}
    +
    +  if (node.title !== null && node.title !== undefined) {
    +    properties.title = node.title
    +  }
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'a',
    +    properties,
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..b904138496edb92a6c4fad2db9bee76479bd179d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts
    @@ -0,0 +1,23 @@
    +/**
    + * @import {ElementContent, Element, Properties} from 'hast'
    + * @import {ListItem, Parents} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `listItem` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ListItem} node
    + *   mdast node.
    + * @param {Parents | undefined} parent
    + *   Parent of `node`.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function listItem(state: State, node: ListItem, parent: Parents | undefined): Element;
    +import type { State } from '../state.js';
    +import type { ListItem } from 'mdast';
    +import type { Parents } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=list-item.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..66b66068195678fb9ea25c0bb93b12bed63eab0e
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["list-item.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AACH,gCATW,KAAK,QAEL,QAAQ,UAER,OAAO,GAAG,SAAS,GAEjB,OAAO,CAwEnB;2BApFuB,aAAa;8BADD,OAAO;6BAAP,OAAO;6BADW,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..eca0db3ce774dd87a388efecb428731bffc1ac9e
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list-item.js
    @@ -0,0 +1,119 @@
    +/**
    + * @import {ElementContent, Element, Properties} from 'hast'
    + * @import {ListItem, Parents} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `listItem` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ListItem} node
    + *   mdast node.
    + * @param {Parents | undefined} parent
    + *   Parent of `node`.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function listItem(state, node, parent) {
    +  const results = state.all(node)
    +  const loose = parent ? listLoose(parent) : listItemLoose(node)
    +  /** @type {Properties} */
    +  const properties = {}
    +  /** @type {Array} */
    +  const children = []
    +
    +  if (typeof node.checked === 'boolean') {
    +    const head = results[0]
    +    /** @type {Element} */
    +    let paragraph
    +
    +    if (head && head.type === 'element' && head.tagName === 'p') {
    +      paragraph = head
    +    } else {
    +      paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}
    +      results.unshift(paragraph)
    +    }
    +
    +    if (paragraph.children.length > 0) {
    +      paragraph.children.unshift({type: 'text', value: ' '})
    +    }
    +
    +    paragraph.children.unshift({
    +      type: 'element',
    +      tagName: 'input',
    +      properties: {type: 'checkbox', checked: node.checked, disabled: true},
    +      children: []
    +    })
    +
    +    // According to github-markdown-css, this class hides bullet.
    +    // See: .
    +    properties.className = ['task-list-item']
    +  }
    +
    +  let index = -1
    +
    +  while (++index < results.length) {
    +    const child = results[index]
    +
    +    // Add eols before nodes, except if this is a loose, first paragraph.
    +    if (
    +      loose ||
    +      index !== 0 ||
    +      child.type !== 'element' ||
    +      child.tagName !== 'p'
    +    ) {
    +      children.push({type: 'text', value: '\n'})
    +    }
    +
    +    if (child.type === 'element' && child.tagName === 'p' && !loose) {
    +      children.push(...child.children)
    +    } else {
    +      children.push(child)
    +    }
    +  }
    +
    +  const tail = results[results.length - 1]
    +
    +  // Add a final eol.
    +  if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {
    +    children.push({type: 'text', value: '\n'})
    +  }
    +
    +  /** @type {Element} */
    +  const result = {type: 'element', tagName: 'li', properties, children}
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    +
    +/**
    + * @param {Parents} node
    + * @return {Boolean}
    + */
    +function listLoose(node) {
    +  let loose = false
    +  if (node.type === 'list') {
    +    loose = node.spread || false
    +    const children = node.children
    +    let index = -1
    +
    +    while (!loose && ++index < children.length) {
    +      loose = listItemLoose(children[index])
    +    }
    +  }
    +
    +  return loose
    +}
    +
    +/**
    + * @param {ListItem} node
    + * @return {Boolean}
    + */
    +function listItemLoose(node) {
    +  const spread = node.spread
    +
    +  return spread === null || spread === undefined
    +    ? node.children.length > 1
    +    : spread
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..425d30b8b00330957e5bcb4eb81773658b8680e4
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {List} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `list` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {List} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function list(state: State, node: List): Element;
    +import type { State } from '../state.js';
    +import type { List } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=list.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..724240b53c4962bcb475ee1145d1e46f95420d70
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["list.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,4BAPW,KAAK,QAEL,IAAI,GAEF,OAAO,CAsCnB;2BAhDuB,aAAa;0BADd,OAAO;6BADQ,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..85bb3eb6c40dc05af1874aedcc7ab5ac530b7f59
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/list.js
    @@ -0,0 +1,52 @@
    +/**
    + * @import {Element, Properties} from 'hast'
    + * @import {List} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `list` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {List} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function list(state, node) {
    +  /** @type {Properties} */
    +  const properties = {}
    +  const results = state.all(node)
    +  let index = -1
    +
    +  if (typeof node.start === 'number' && node.start !== 1) {
    +    properties.start = node.start
    +  }
    +
    +  // Like GitHub, add a class for custom styling.
    +  while (++index < results.length) {
    +    const child = results[index]
    +
    +    if (
    +      child.type === 'element' &&
    +      child.tagName === 'li' &&
    +      child.properties &&
    +      Array.isArray(child.properties.className) &&
    +      child.properties.className.includes('task-list-item')
    +    ) {
    +      properties.className = ['contains-task-list']
    +      break
    +    }
    +  }
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: node.ordered ? 'ol' : 'ul',
    +    properties,
    +    children: state.wrap(results, true)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..5de8deb735c865182b009147f25d1b066a885f68
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Paragraph} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `paragraph` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Paragraph} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function paragraph(state: State, node: Paragraph): Element;
    +import type { State } from '../state.js';
    +import type { Paragraph } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=paragraph.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..86386109e364862bd820c5aa2404ca965ca4e715
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["paragraph.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,iCAPW,KAAK,QAEL,SAAS,GAEP,OAAO,CAanB;2BAvBuB,aAAa;+BADT,OAAO;6BADT,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..04d0870de73312281af72e7d1284989625f2ac69
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Paragraph} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `paragraph` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Paragraph} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function paragraph(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'p',
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..fe15d197e4eb08a9d908ab1fe8adb1a3d779769d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Parents as HastParents, Root as HastRoot} from 'hast'
    + * @import {Root as MdastRoot} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `root` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {MdastRoot} node
    + *   mdast node.
    + * @returns {HastParents}
    + *   hast node.
    + */
    +export function root(state: State, node: MdastRoot): HastParents;
    +import type { State } from '../state.js';
    +import type { Root as MdastRoot } from 'mdast';
    +import type { Parents as HastParents } from 'hast';
    +//# sourceMappingURL=root.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..8634371e7c0db7fcc5a453d31f42ae4f91db5ee0
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["root.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,4BAPW,KAAK,QAEL,SAAS,GAEP,WAAW,CAQvB;2BAlBuB,aAAa;uCADD,OAAO;4CADgB,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..001a5869ae0d4b8cf824a5aadee6e2f8dd1552ea
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/root.js
    @@ -0,0 +1,22 @@
    +/**
    + * @import {Parents as HastParents, Root as HastRoot} from 'hast'
    + * @import {Root as MdastRoot} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `root` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {MdastRoot} node
    + *   mdast node.
    + * @returns {HastParents}
    + *   hast node.
    + */
    +export function root(state, node) {
    +  /** @type {HastRoot} */
    +  const result = {type: 'root', children: state.wrap(state.all(node))}
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..aec2d5401548ffa99b4fdb17ec156d993e3e70df
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Strong} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `strong` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Strong} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function strong(state: State, node: Strong): Element;
    +import type { State } from '../state.js';
    +import type { Strong } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=strong.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..f53a0a73cf0519f3e5897036a25afa278982c733
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"strong.d.ts","sourceRoot":"","sources":["strong.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,8BAPW,KAAK,QAEL,MAAM,GAEJ,OAAO,CAanB;2BAvBuB,aAAa;4BADZ,OAAO;6BADN,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..297346e5f830aad37a31b0a6c9aee525389a95da
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/strong.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {Strong} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `strong` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Strong} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function strong(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'strong',
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..449ba27f493d26651393994deec878b01d9e7999
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {TableCell} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `tableCell` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {TableCell} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function tableCell(state: State, node: TableCell): Element;
    +import type { State } from '../state.js';
    +import type { TableCell } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=table-cell.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..5e865e00670afb997bf7516b6b913018453c1026
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"table-cell.d.ts","sourceRoot":"","sources":["table-cell.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,iCAPW,KAAK,QAEL,SAAS,GAEP,OAAO,CAenB;2BAzBuB,aAAa;+BADT,OAAO;6BADT,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..ecbcd221268c3499d2f42718bace58046e717946
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js
    @@ -0,0 +1,29 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {TableCell} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `tableCell` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {TableCell} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function tableCell(state, node) {
    +  // Note: this function is normally not called: see `table-row` for how rows
    +  // and their cells are compiled.
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'td', // Assume body cell.
    +    properties: {},
    +    children: state.all(node)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..b6b8d703048ab7a8e60ff17360fe4e2951f49794
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts
    @@ -0,0 +1,23 @@
    +/**
    + * @import {Element, ElementContent, Properties} from 'hast'
    + * @import {Parents, TableRow} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `tableRow` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {TableRow} node
    + *   mdast node.
    + * @param {Parents | undefined} parent
    + *   Parent of `node`.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function tableRow(state: State, node: TableRow, parent: Parents | undefined): Element;
    +import type { State } from '../state.js';
    +import type { TableRow } from 'mdast';
    +import type { Parents } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=table-row.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..4d9c4eb7b72d61a4de7da913b5af86c00920d5a2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"table-row.d.ts","sourceRoot":"","sources":["table-row.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;GAWG;AACH,gCATW,KAAK,QAEL,QAAQ,UAER,OAAO,GAAG,SAAS,GAEjB,OAAO,CA+CnB;2BA3DuB,aAAa;8BADD,OAAO;6BAAP,OAAO;6BADW,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..718561a5fa85408a95ec92e0a5d64733dd83f6dd
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table-row.js
    @@ -0,0 +1,63 @@
    +/**
    + * @import {Element, ElementContent, Properties} from 'hast'
    + * @import {Parents, TableRow} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `tableRow` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {TableRow} node
    + *   mdast node.
    + * @param {Parents | undefined} parent
    + *   Parent of `node`.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function tableRow(state, node, parent) {
    +  const siblings = parent ? parent.children : undefined
    +  // Generate a body row when without parent.
    +  const rowIndex = siblings ? siblings.indexOf(node) : 1
    +  const tagName = rowIndex === 0 ? 'th' : 'td'
    +  // To do: option to use `style`?
    +  const align = parent && parent.type === 'table' ? parent.align : undefined
    +  const length = align ? align.length : node.children.length
    +  let cellIndex = -1
    +  /** @type {Array} */
    +  const cells = []
    +
    +  while (++cellIndex < length) {
    +    // Note: can also be undefined.
    +    const cell = node.children[cellIndex]
    +    /** @type {Properties} */
    +    const properties = {}
    +    const alignValue = align ? align[cellIndex] : undefined
    +
    +    if (alignValue) {
    +      properties.align = alignValue
    +    }
    +
    +    /** @type {Element} */
    +    let result = {type: 'element', tagName, properties, children: []}
    +
    +    if (cell) {
    +      result.children = state.all(cell)
    +      state.patch(cell, result)
    +      result = state.applyData(cell, result)
    +    }
    +
    +    cells.push(result)
    +  }
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'tr',
    +    properties: {},
    +    children: state.wrap(cells, true)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..a64956bd6c18a5bdaf7ea46b8dccca6abe1a3d06
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts
    @@ -0,0 +1,15 @@
    +/**
    + * Turn an mdast `table` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Table} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function table(state: State, node: Table): Element;
    +import type { State } from '../state.js';
    +import type { Table } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=table.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..3684f4e83e79a1758683aee02dc266d9f9fb128d
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,6BAPW,KAAK,QAEL,KAAK,GAEH,OAAO,CA6CnB;2BAzDuB,aAAa;2BAFb,OAAO;6BACL,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..58b67703701630bd59ae638cae3ef623557fb48f
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/table.js
    @@ -0,0 +1,61 @@
    +/**
    + * @import {Table} from 'mdast'
    + * @import {Element} from 'hast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {pointEnd, pointStart} from 'unist-util-position'
    +
    +/**
    + * Turn an mdast `table` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {Table} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function table(state, node) {
    +  const rows = state.all(node)
    +  const firstRow = rows.shift()
    +  /** @type {Array} */
    +  const tableContent = []
    +
    +  if (firstRow) {
    +    /** @type {Element} */
    +    const head = {
    +      type: 'element',
    +      tagName: 'thead',
    +      properties: {},
    +      children: state.wrap([firstRow], true)
    +    }
    +    state.patch(node.children[0], head)
    +    tableContent.push(head)
    +  }
    +
    +  if (rows.length > 0) {
    +    /** @type {Element} */
    +    const body = {
    +      type: 'element',
    +      tagName: 'tbody',
    +      properties: {},
    +      children: state.wrap(rows, true)
    +    }
    +
    +    const start = pointStart(node.children[1])
    +    const end = pointEnd(node.children[node.children.length - 1])
    +    if (start && end) body.position = {start, end}
    +    tableContent.push(body)
    +  }
    +
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'table',
    +    properties: {},
    +    children: state.wrap(tableContent, true)
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..d252a81a6e5600b86966b7527459f066469fd5ae
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts
    @@ -0,0 +1,16 @@
    +/**
    + * Turn an mdast `text` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {MdastText} node
    + *   mdast node.
    + * @returns {HastElement | HastText}
    + *   hast node.
    + */
    +export function text(state: State, node: MdastText): HastElement | HastText;
    +import type { State } from '../state.js';
    +import type { Text as MdastText } from 'mdast';
    +import type { Element as HastElement } from 'hast';
    +import type { Text as HastText } from 'hast';
    +//# sourceMappingURL=text.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..ef563c60d3a356bb86a984c1f2e3ce0ced1f2aee
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,4BAPW,KAAK,QAEL,SAAS,GAEP,WAAW,GAAG,QAAQ,CAQlC;2BApBuB,aAAa;uCADD,OAAO;4CADgB,MAAM;sCAAN,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..e107e38025da0ad8772f905d03b6f18385fbc959
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/text.js
    @@ -0,0 +1,24 @@
    +/**
    + * @import {Element as HastElement, Text as HastText} from 'hast'
    + * @import {Text as MdastText} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +import {trimLines} from 'trim-lines'
    +
    +/**
    + * Turn an mdast `text` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {MdastText} node
    + *   mdast node.
    + * @returns {HastElement | HastText}
    + *   hast node.
    + */
    +export function text(state, node) {
    +  /** @type {HastText} */
    +  const result = {type: 'text', value: trimLines(String(node.value))}
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..7b6eb0009c052690c3266dcb5da61e0e8d5ef1c0
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts
    @@ -0,0 +1,20 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {ThematicBreak} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +/**
    + * Turn an mdast `thematicBreak` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ThematicBreak} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function thematicBreak(state: State, node: ThematicBreak): Element;
    +import type { State } from '../state.js';
    +import type { ThematicBreak } from 'mdast';
    +import type { Element } from 'hast';
    +//# sourceMappingURL=thematic-break.d.ts.map
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts.map
    new file mode 100644
    index 0000000000000000000000000000000000000000..75ddf8fc4610fb19d8fad38f2f9b78ceafae2404
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.d.ts.map
    @@ -0,0 +1 @@
    +{"version":3,"file":"thematic-break.d.ts","sourceRoot":"","sources":["thematic-break.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,qCAPW,KAAK,QAEL,aAAa,GAEX,OAAO,CAanB;2BAvBuB,aAAa;mCADL,OAAO;6BADb,MAAM"}
    \ No newline at end of file
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
    new file mode 100644
    index 0000000000000000000000000000000000000000..8b878006d8e9ac68bdb28e113bcf61805e7ea6c2
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js
    @@ -0,0 +1,27 @@
    +/**
    + * @import {Element} from 'hast'
    + * @import {ThematicBreak} from 'mdast'
    + * @import {State} from '../state.js'
    + */
    +
    +/**
    + * Turn an mdast `thematicBreak` node into hast.
    + *
    + * @param {State} state
    + *   Info passed around.
    + * @param {ThematicBreak} node
    + *   mdast node.
    + * @returns {Element}
    + *   hast node.
    + */
    +export function thematicBreak(state, node) {
    +  /** @type {Element} */
    +  const result = {
    +    type: 'element',
    +    tagName: 'hr',
    +    properties: {},
    +    children: []
    +  }
    +  state.patch(node, result)
    +  return state.applyData(node, result)
    +}
    diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts
    new file mode 100644
    index 0000000000000000000000000000000000000000..37223112f9de14c56cacd6b98158a799d25ae63c
    --- /dev/null
    +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts
    @@ -0,0 +1,82 @@
    +/**
    + * Transform mdast to hast.
    + *
    + * ##### Notes
    + *
    + * ###### HTML
    + *
    + * Raw HTML is available in mdast as `html` nodes and can be embedded in hast
    + * as semistandard `raw` nodes.
    + * Most utilities ignore `raw` nodes but two notable ones don’t:
    + *
    + * *   `hast-util-to-html` also has an option `allowDangerousHtml` which will
    + *     output the raw HTML.
    + *     This is typically discouraged as noted by the option name but is useful
    + *     if you completely trust authors
    + * *   `hast-util-raw` can handle the raw embedded HTML strings by parsing them
    + *     into standard hast nodes (`element`, `text`, etc).
    + *     This is a heavy task as it needs a full HTML parser, but it is the only
    + *     way to support untrusted content
    + *
    + * ###### Footnotes
    + *
    + * Many options supported here relate to footnotes.
    + * Footnotes are not specified by CommonMark, which we follow by default.
    + * They are supported by GitHub, so footnotes can be enabled in markdown with
    + * `mdast-util-gfm`.
    + *
    + * The options `footnoteBackLabel` and `footnoteLabel` define natural language
    + * that explains footnotes, which is hidden for sighted users but shown to
    + * assistive technology.
    + * When your page is not in English, you must define translated values.
    + *
    + * Back references use ARIA attributes, but the section label itself uses a
    + * heading that is hidden with an `sr-only` class.
    + * To show it to sighted users, define different attributes in
    + * `footnoteLabelProperties`.
    + *
    + * ###### Clobbering
    + *
    + * Footnotes introduces a problem, as it links footnote calls to footnote
    + * definitions on the page through `id` attributes generated from user content,
    + * which results in DOM clobbering.
    + *
    + * DOM clobbering is this:
    + *
    + * ```html
    + * 

    + * + * ``` + * + * Elements by their ID are made available by browsers on the `window` object, + * which is a security risk. + * Using a prefix solves this problem. + * + * More information on how to handle clobbering and the prefix is explained in + * Example: headings (DOM clobbering) in `rehype-sanitize`. + * + * ###### Unknown nodes + * + * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`. + * The default behavior for unknown nodes is: + * + * * when the node has a `value` (and doesn’t have `data.hName`, + * `data.hProperties`, or `data.hChildren`, see later), create a hast `text` + * node + * * otherwise, create a `
    ` element (which could be changed with + * `data.hName`), with its children mapped from mdast to hast as well + * + * This behavior can be changed by passing an `unknownHandler`. + * + * @param {MdastNodes} tree + * mdast tree. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {HastNodes} + * hast tree. + */ +export function toHast(tree: MdastNodes, options?: Options | null | undefined): HastNodes; +import type { Nodes as MdastNodes } from 'mdast'; +import type { Options } from './state.js'; +import type { Nodes as HastNodes } from 'hast'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e265feedf61242d15231df1a11f19acd800e2177 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,6BAPW,UAAU,YAEV,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,SAAS,CAqBrB;yCAvGqC,OAAO;6BACnB,YAAY;wCAFD,MAAM"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/index.js b/tools/ui/node_modules/mdast-util-to-hast/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..15b3361723b1fea643ad3dacac6ef41951ce8326 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/index.js @@ -0,0 +1,106 @@ +/** + * @import {Nodes as HastNodes} from 'hast' + * @import {Nodes as MdastNodes} from 'mdast' + * @import {Options} from './state.js' + */ + +import {ok as assert} from 'devlop' +import {footer} from './footer.js' +import {createState} from './state.js' + +/** + * Transform mdast to hast. + * + * ##### Notes + * + * ###### HTML + * + * Raw HTML is available in mdast as `html` nodes and can be embedded in hast + * as semistandard `raw` nodes. + * Most utilities ignore `raw` nodes but two notable ones don’t: + * + * * `hast-util-to-html` also has an option `allowDangerousHtml` which will + * output the raw HTML. + * This is typically discouraged as noted by the option name but is useful + * if you completely trust authors + * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them + * into standard hast nodes (`element`, `text`, etc). + * This is a heavy task as it needs a full HTML parser, but it is the only + * way to support untrusted content + * + * ###### Footnotes + * + * Many options supported here relate to footnotes. + * Footnotes are not specified by CommonMark, which we follow by default. + * They are supported by GitHub, so footnotes can be enabled in markdown with + * `mdast-util-gfm`. + * + * The options `footnoteBackLabel` and `footnoteLabel` define natural language + * that explains footnotes, which is hidden for sighted users but shown to + * assistive technology. + * When your page is not in English, you must define translated values. + * + * Back references use ARIA attributes, but the section label itself uses a + * heading that is hidden with an `sr-only` class. + * To show it to sighted users, define different attributes in + * `footnoteLabelProperties`. + * + * ###### Clobbering + * + * Footnotes introduces a problem, as it links footnote calls to footnote + * definitions on the page through `id` attributes generated from user content, + * which results in DOM clobbering. + * + * DOM clobbering is this: + * + * ```html + *

    + * + * ``` + * + * Elements by their ID are made available by browsers on the `window` object, + * which is a security risk. + * Using a prefix solves this problem. + * + * More information on how to handle clobbering and the prefix is explained in + * Example: headings (DOM clobbering) in `rehype-sanitize`. + * + * ###### Unknown nodes + * + * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`. + * The default behavior for unknown nodes is: + * + * * when the node has a `value` (and doesn’t have `data.hName`, + * `data.hProperties`, or `data.hChildren`, see later), create a hast `text` + * node + * * otherwise, create a `
    ` element (which could be changed with + * `data.hName`), with its children mapped from mdast to hast as well + * + * This behavior can be changed by passing an `unknownHandler`. + * + * @param {MdastNodes} tree + * mdast tree. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {HastNodes} + * hast tree. + */ +export function toHast(tree, options) { + const state = createState(tree, options) + const node = state.one(tree, undefined) + const foot = footer(state) + /** @type {HastNodes} */ + const result = Array.isArray(node) + ? {type: 'root', children: node} + : node || {type: 'root', children: []} + + if (foot) { + // If there’s a footer, there were definitions, meaning block + // content. + // So `result` is a parent node. + assert('children' in result) + result.children.push({type: 'text', value: '\n'}, foot) + } + + return result +} diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1a9ea01c8a5be7568e1c1ab941fbcadfe95a6b9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts @@ -0,0 +1,21 @@ +/** + * @import {ElementContent} from 'hast' + * @import {Reference, Nodes} from 'mdast' + * @import {State} from './state.js' + */ +/** + * Return the content of a reference without definition as plain text. + * + * @param {State} state + * Info passed around. + * @param {Extract} node + * Reference node (image, link). + * @returns {Array} + * hast content. + */ +export function revert(state: State, node: Extract): Array; +import type { State } from './state.js'; +import type { Nodes } from 'mdast'; +import type { Reference } from 'mdast'; +import type { ElementContent } from 'hast'; +//# sourceMappingURL=revert.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b743a8c9e918e63b9e45aa5b8d43fb7f3d1d585d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"revert.d.ts","sourceRoot":"","sources":["revert.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,8BAPW,KAAK,QAEL,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,GAEvB,KAAK,CAAC,cAAc,CAAC,CAmCjC;2BA7CuB,YAAY;2BADD,OAAO;+BAAP,OAAO;oCADT,MAAM"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/revert.js b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.js new file mode 100644 index 0000000000000000000000000000000000000000..942382f9e211c9008bf33694dfbab28edfe397bc --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/revert.js @@ -0,0 +1,49 @@ +/** + * @import {ElementContent} from 'hast' + * @import {Reference, Nodes} from 'mdast' + * @import {State} from './state.js' + */ + +/** + * Return the content of a reference without definition as plain text. + * + * @param {State} state + * Info passed around. + * @param {Extract} node + * Reference node (image, link). + * @returns {Array} + * hast content. + */ +export function revert(state, node) { + const subtype = node.referenceType + let suffix = ']' + + if (subtype === 'collapsed') { + suffix += '[]' + } else if (subtype === 'full') { + suffix += '[' + (node.label || node.identifier) + ']' + } + + if (node.type === 'imageReference') { + return [{type: 'text', value: '![' + node.alt + suffix}] + } + + const contents = state.all(node) + const head = contents[0] + + if (head && head.type === 'text') { + head.value = '[' + head.value + } else { + contents.unshift({type: 'text', value: '['}) + } + + const tail = contents[contents.length - 1] + + if (tail && tail.type === 'text') { + tail.value += suffix + } else { + contents.push({type: 'text', value: suffix}) + } + + return contents +} diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts b/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6e270617a6cbb2ba7284e8a15a596b40e478a27 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts @@ -0,0 +1,233 @@ +/** + * Create `state` from an mdast tree. + * + * @param {MdastNodes} tree + * mdast node to transform. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {State} + * `state` function. + */ +export function createState(tree: MdastNodes, options?: Options | null | undefined): State; +/** + * Wrap `nodes` with line endings between each node. + * + * @template {HastRootContent} Type + * Node type. + * @param {Array} nodes + * List of nodes to wrap. + * @param {boolean | undefined} [loose=false] + * Whether to add line endings at start and end (default: `false`). + * @returns {Array} + * Wrapped nodes. + */ +export function wrap(nodes: Array, loose?: boolean | undefined): Array; +/** + * Handle a node. + */ +export type Handler = (state: State, node: any, parent: MdastParents | undefined) => Array | HastElementContent | undefined; +/** + * Handle nodes. + */ +export type Handlers = Partial>; +/** + * Configuration (optional). + */ +export type Options = { + /** + * Whether to persist raw HTML in markdown in the hast tree (default: + * `false`). + */ + allowDangerousHtml?: boolean | null | undefined; + /** + * Prefix to use before the `id` property on footnotes to prevent them from + * *clobbering* (default: `'user-content-'`). + * + * Pass `''` for trusted markdown and when you are careful with + * polyfilling. + * You could pass a different prefix. + * + * DOM clobbering is this: + * + * ```html + *

    + * + * ``` + * + * The above example shows that elements are made available by browsers, by + * their ID, on the `window` object. + * This is a security risk because you might be expecting some other variable + * at that place. + * It can also break polyfills. + * Using a prefix solves these problems. + */ + clobberPrefix?: string | null | undefined; + /** + * Corresponding virtual file representing the input document (optional). + */ + file?: VFile | null | undefined; + /** + * Content of the backreference back to references (default: `defaultFootnoteBackContent`). + * + * The default value is: + * + * ```js + * function defaultFootnoteBackContent(_, rereferenceIndex) { + * const result = [{type: 'text', value: '↩'}] + * + * if (rereferenceIndex > 1) { + * result.push({ + * type: 'element', + * tagName: 'sup', + * properties: {}, + * children: [{type: 'text', value: String(rereferenceIndex)}] + * }) + * } + * + * return result + * } + * ``` + * + * This content is used in the `a` element of each backreference (the `↩` + * links). + */ + footnoteBackContent?: FootnoteBackContentTemplate | string | null | undefined; + /** + * Label to describe the backreference back to references (default: + * `defaultFootnoteBackLabel`). + * + * The default value is: + * + * ```js + * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) { + * return ( + * 'Back to reference ' + + * (referenceIndex + 1) + + * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '') + * ) + * } + * ``` + * + * Change it when the markdown is not in English. + * + * This label is used in the `ariaLabel` property on each backreference + * (the `↩` links). + * It affects users of assistive technology. + */ + footnoteBackLabel?: FootnoteBackLabelTemplate | string | null | undefined; + /** + * Textual label to use for the footnotes section (default: `'Footnotes'`). + * + * Change it when the markdown is not in English. + * + * This label is typically hidden visually (assuming a `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass different properties with the `footnoteLabelProperties` option. + */ + footnoteLabel?: string | null | undefined; + /** + * Properties to use on the footnote label (default: `{className: + * ['sr-only']}`). + * + * Change it to show the label and add other properties. + * + * This label is typically hidden visually (assuming an `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass an empty string. + * You can also add different properties. + * + * > **Note**: `id: 'footnote-label'` is always added, because footnote + * > calls use it with `aria-describedby` to provide an accessible label. + */ + footnoteLabelProperties?: HastProperties | null | undefined; + /** + * HTML tag name to use for the footnote label element (default: `'h2'`). + * + * Change it to match your document structure. + * + * This label is typically hidden visually (assuming a `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass different properties with the `footnoteLabelProperties` option. + */ + footnoteLabelTagName?: string | null | undefined; + /** + * Extra handlers for nodes (optional). + */ + handlers?: Handlers | null | undefined; + /** + * List of custom mdast node types to pass through (keep) in hast (note that + * the node itself is passed, but eventual children are transformed) + * (optional). + */ + passThrough?: Array | null | undefined; + /** + * Handler for all unknown nodes (optional). + */ + unknownHandler?: Handler | null | undefined; +}; +/** + * Info passed around. + */ +export type State = { + /** + * Transform the children of an mdast parent to hast. + */ + all: (node: MdastNodes) => Array; + /** + * Honor the `data` of `from`, and generate an element instead of `node`. + */ + applyData: (from: MdastNodes, to: Type) => HastElement | Type; + /** + * Definitions by their identifier. + */ + definitionById: Map; + /** + * Footnote definitions by their identifier. + */ + footnoteById: Map; + /** + * Counts for how often the same footnote was called. + */ + footnoteCounts: Map; + /** + * Identifiers of order when footnote calls first appear in tree order. + */ + footnoteOrder: Array; + /** + * Applied handlers. + */ + handlers: Handlers; + /** + * Transform an mdast node to hast. + */ + one: (node: MdastNodes, parent: MdastParents | undefined) => Array | HastElementContent | undefined; + /** + * Configuration. + */ + options: Options; + /** + * Copy a node’s positional info. + */ + patch: (from: MdastNodes, node: HastNodes) => undefined; + /** + * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`. + */ + wrap: (nodes: Array, loose?: boolean | undefined) => Array; +}; +import type { Nodes as MdastNodes } from 'mdast'; +import type { RootContent as HastRootContent } from 'hast'; +import type { Text as HastText } from 'hast'; +import type { Parents as MdastParents } from 'mdast'; +import type { ElementContent as HastElementContent } from 'hast'; +import type { VFile } from 'vfile'; +import type { FootnoteBackContentTemplate } from './footer.js'; +import type { FootnoteBackLabelTemplate } from './footer.js'; +import type { Properties as HastProperties } from 'hast'; +import type { Nodes as HastNodes } from 'hast'; +import type { Element as HastElement } from 'hast'; +import type { Definition as MdastDefinition } from 'mdast'; +import type { FootnoteDefinition as MdastFootnoteDefinition } from 'mdast'; +//# sourceMappingURL=state.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts.map b/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8d27127e8b80d47b449d7407fcd496c37056dba8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/state.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["state.js"],"names":[],"mappings":"AA2LA;;;;;;;;;GASG;AACH,kCAPW,UAAU,YAEV,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,KAAK,CAiIjB;AAqGD;;;;;;;;;;;GAWG;AACH,qBAT+B,IAAI,SAAtB,eAAiB,SAEnB,KAAK,CAAC,IAAI,CAAC,UAEX,OAAO,GAAG,SAAS,GAEjB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAsBlC;;;;8BA9aU,KAAK,QAEL,GAAG,UAEH,YAAY,GAAG,SAAS,KAEtB,KAAK,CAAC,kBAAkB,CAAC,GAAG,kB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AkB,GAAG,SAAS;;;;aAElH,OAAO;;;;WAEP,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,KAAK,SAAS;;;;UAEhD,CAAC,IAAI,SAAS,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;;yCA/J7G,OAAO;oDANP,MAAM;sCAAN,MAAM;6CAMN,OAAO;0DANP,MAAM;2BAOQ,OAAO;iDAIrB,aAAa;+CAAb,aAAa;kDAXb,MAAM;wCAAN,MAAM;4CAAN,MAAM;mDAMN,OAAO;mEAAP,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-hast/lib/state.js b/tools/ui/node_modules/mdast-util-to-hast/lib/state.js new file mode 100644 index 0000000000000000000000000000000000000000..0d9c9dff22022c7199b26551fdd831422f761e98 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/lib/state.js @@ -0,0 +1,476 @@ +/** + * @import { + * ElementContent as HastElementContent, + * Element as HastElement, + * Nodes as HastNodes, + * Properties as HastProperties, + * RootContent as HastRootContent, + * Text as HastText + * } from 'hast' + * @import { + * Definition as MdastDefinition, + * FootnoteDefinition as MdastFootnoteDefinition, + * Nodes as MdastNodes, + * Parents as MdastParents + * } from 'mdast' + * @import {VFile} from 'vfile' + * @import { + * FootnoteBackContentTemplate, + * FootnoteBackLabelTemplate + * } from './footer.js' + */ + +/** + * @callback Handler + * Handle a node. + * @param {State} state + * Info passed around. + * @param {any} node + * mdast node to handle. + * @param {MdastParents | undefined} parent + * Parent of `node`. + * @returns {Array | HastElementContent | undefined} + * hast node. + * + * @typedef {Partial>} Handlers + * Handle nodes. + * + * @typedef Options + * Configuration (optional). + * @property {boolean | null | undefined} [allowDangerousHtml=false] + * Whether to persist raw HTML in markdown in the hast tree (default: + * `false`). + * @property {string | null | undefined} [clobberPrefix='user-content-'] + * Prefix to use before the `id` property on footnotes to prevent them from + * *clobbering* (default: `'user-content-'`). + * + * Pass `''` for trusted markdown and when you are careful with + * polyfilling. + * You could pass a different prefix. + * + * DOM clobbering is this: + * + * ```html + *

    + * + * ``` + * + * The above example shows that elements are made available by browsers, by + * their ID, on the `window` object. + * This is a security risk because you might be expecting some other variable + * at that place. + * It can also break polyfills. + * Using a prefix solves these problems. + * @property {VFile | null | undefined} [file] + * Corresponding virtual file representing the input document (optional). + * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent] + * Content of the backreference back to references (default: `defaultFootnoteBackContent`). + * + * The default value is: + * + * ```js + * function defaultFootnoteBackContent(_, rereferenceIndex) { + * const result = [{type: 'text', value: '↩'}] + * + * if (rereferenceIndex > 1) { + * result.push({ + * type: 'element', + * tagName: 'sup', + * properties: {}, + * children: [{type: 'text', value: String(rereferenceIndex)}] + * }) + * } + * + * return result + * } + * ``` + * + * This content is used in the `a` element of each backreference (the `↩` + * links). + * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel] + * Label to describe the backreference back to references (default: + * `defaultFootnoteBackLabel`). + * + * The default value is: + * + * ```js + * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) { + * return ( + * 'Back to reference ' + + * (referenceIndex + 1) + + * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '') + * ) + * } + * ``` + * + * Change it when the markdown is not in English. + * + * This label is used in the `ariaLabel` property on each backreference + * (the `↩` links). + * It affects users of assistive technology. + * @property {string | null | undefined} [footnoteLabel='Footnotes'] + * Textual label to use for the footnotes section (default: `'Footnotes'`). + * + * Change it when the markdown is not in English. + * + * This label is typically hidden visually (assuming a `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass different properties with the `footnoteLabelProperties` option. + * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}] + * Properties to use on the footnote label (default: `{className: + * ['sr-only']}`). + * + * Change it to show the label and add other properties. + * + * This label is typically hidden visually (assuming an `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass an empty string. + * You can also add different properties. + * + * > **Note**: `id: 'footnote-label'` is always added, because footnote + * > calls use it with `aria-describedby` to provide an accessible label. + * @property {string | null | undefined} [footnoteLabelTagName='h2'] + * HTML tag name to use for the footnote label element (default: `'h2'`). + * + * Change it to match your document structure. + * + * This label is typically hidden visually (assuming a `sr-only` CSS class + * is defined that does that) and so affects screen readers only. + * If you do have such a class, but want to show this section to everyone, + * pass different properties with the `footnoteLabelProperties` option. + * @property {Handlers | null | undefined} [handlers] + * Extra handlers for nodes (optional). + * @property {Array | null | undefined} [passThrough] + * List of custom mdast node types to pass through (keep) in hast (note that + * the node itself is passed, but eventual children are transformed) + * (optional). + * @property {Handler | null | undefined} [unknownHandler] + * Handler for all unknown nodes (optional). + * + * @typedef State + * Info passed around. + * @property {(node: MdastNodes) => Array} all + * Transform the children of an mdast parent to hast. + * @property {(from: MdastNodes, to: Type) => HastElement | Type} applyData + * Honor the `data` of `from`, and generate an element instead of `node`. + * @property {Map} definitionById + * Definitions by their identifier. + * @property {Map} footnoteById + * Footnote definitions by their identifier. + * @property {Map} footnoteCounts + * Counts for how often the same footnote was called. + * @property {Array} footnoteOrder + * Identifiers of order when footnote calls first appear in tree order. + * @property {Handlers} handlers + * Applied handlers. + * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array | HastElementContent | undefined} one + * Transform an mdast node to hast. + * @property {Options} options + * Configuration. + * @property {(from: MdastNodes, node: HastNodes) => undefined} patch + * Copy a node’s positional info. + * @property {(nodes: Array, loose?: boolean | undefined) => Array} wrap + * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`. + */ + +import structuredClone from '@ungap/structured-clone' +import {visit} from 'unist-util-visit' +import {position} from 'unist-util-position' +import {handlers as defaultHandlers} from './handlers/index.js' + +const own = {}.hasOwnProperty + +/** @type {Options} */ +const emptyOptions = {} + +/** + * Create `state` from an mdast tree. + * + * @param {MdastNodes} tree + * mdast node to transform. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {State} + * `state` function. + */ +export function createState(tree, options) { + const settings = options || emptyOptions + /** @type {Map} */ + const definitionById = new Map() + /** @type {Map} */ + const footnoteById = new Map() + /** @type {Map} */ + const footnoteCounts = new Map() + /** @type {Handlers} */ + // @ts-expect-error: the root handler returns a root. + // Hard to type. + const handlers = {...defaultHandlers, ...settings.handlers} + + /** @type {State} */ + const state = { + all, + applyData, + definitionById, + footnoteById, + footnoteCounts, + footnoteOrder: [], + handlers, + one, + options: settings, + patch, + wrap + } + + visit(tree, function (node) { + if (node.type === 'definition' || node.type === 'footnoteDefinition') { + const map = node.type === 'definition' ? definitionById : footnoteById + const id = String(node.identifier).toUpperCase() + + // Mimick CM behavior of link definitions. + // See: . + if (!map.has(id)) { + // @ts-expect-error: node type matches map. + map.set(id, node) + } + } + }) + + return state + + /** + * Transform an mdast node into a hast node. + * + * @param {MdastNodes} node + * mdast node. + * @param {MdastParents | undefined} [parent] + * Parent of `node`. + * @returns {Array | HastElementContent | undefined} + * Resulting hast node. + */ + function one(node, parent) { + const type = node.type + const handle = state.handlers[type] + + if (own.call(state.handlers, type) && handle) { + return handle(state, node, parent) + } + + if (state.options.passThrough && state.options.passThrough.includes(type)) { + if ('children' in node) { + const {children, ...shallow} = node + const result = structuredClone(shallow) + // @ts-expect-error: TS doesn’t understand… + result.children = state.all(node) + // @ts-expect-error: TS doesn’t understand… + return result + } + + // @ts-expect-error: it’s custom. + return structuredClone(node) + } + + const unknown = state.options.unknownHandler || defaultUnknownHandler + + return unknown(state, node, parent) + } + + /** + * Transform the children of an mdast node into hast nodes. + * + * @param {MdastNodes} parent + * mdast node to compile + * @returns {Array} + * Resulting hast nodes. + */ + function all(parent) { + /** @type {Array} */ + const values = [] + + if ('children' in parent) { + const nodes = parent.children + let index = -1 + while (++index < nodes.length) { + const result = state.one(nodes[index], parent) + + // To do: see if we van clean this? Can we merge texts? + if (result) { + if (index && nodes[index - 1].type === 'break') { + if (!Array.isArray(result) && result.type === 'text') { + result.value = trimMarkdownSpaceStart(result.value) + } + + if (!Array.isArray(result) && result.type === 'element') { + const head = result.children[0] + + if (head && head.type === 'text') { + head.value = trimMarkdownSpaceStart(head.value) + } + } + } + + if (Array.isArray(result)) { + values.push(...result) + } else { + values.push(result) + } + } + } + } + + return values + } +} + +/** + * Copy a node’s positional info. + * + * @param {MdastNodes} from + * mdast node to copy from. + * @param {HastNodes} to + * hast node to copy into. + * @returns {undefined} + * Nothing. + */ +function patch(from, to) { + if (from.position) to.position = position(from) +} + +/** + * Honor the `data` of `from` and maybe generate an element instead of `to`. + * + * @template {HastNodes} Type + * Node type. + * @param {MdastNodes} from + * mdast node to use data from. + * @param {Type} to + * hast node to change. + * @returns {HastElement | Type} + * Nothing. + */ +function applyData(from, to) { + /** @type {HastElement | Type} */ + let result = to + + // Handle `data.hName`, `data.hProperties, `data.hChildren`. + if (from && from.data) { + const hName = from.data.hName + const hChildren = from.data.hChildren + const hProperties = from.data.hProperties + + if (typeof hName === 'string') { + // Transforming the node resulted in an element with a different name + // than wanted: + if (result.type === 'element') { + result.tagName = hName + } + // Transforming the node resulted in a non-element, which happens for + // raw, text, and root nodes (unless custom handlers are passed). + // The intent of `hName` is to create an element, but likely also to keep + // the content around (otherwise: pass `hChildren`). + else { + /** @type {Array} */ + // @ts-expect-error: assume no doctypes in `root`. + const children = 'children' in result ? result.children : [result] + result = {type: 'element', tagName: hName, properties: {}, children} + } + } + + if (result.type === 'element' && hProperties) { + Object.assign(result.properties, structuredClone(hProperties)) + } + + if ( + 'children' in result && + result.children && + hChildren !== null && + hChildren !== undefined + ) { + result.children = hChildren + } + } + + return result +} + +/** + * Transform an unknown node. + * + * @param {State} state + * Info passed around. + * @param {MdastNodes} node + * Unknown mdast node. + * @returns {HastElement | HastText} + * Resulting hast node. + */ +function defaultUnknownHandler(state, node) { + const data = node.data || {} + /** @type {HastElement | HastText} */ + const result = + 'value' in node && + !(own.call(data, 'hProperties') || own.call(data, 'hChildren')) + ? {type: 'text', value: node.value} + : { + type: 'element', + tagName: 'div', + properties: {}, + children: state.all(node) + } + + state.patch(node, result) + return state.applyData(node, result) +} + +/** + * Wrap `nodes` with line endings between each node. + * + * @template {HastRootContent} Type + * Node type. + * @param {Array} nodes + * List of nodes to wrap. + * @param {boolean | undefined} [loose=false] + * Whether to add line endings at start and end (default: `false`). + * @returns {Array} + * Wrapped nodes. + */ +export function wrap(nodes, loose) { + /** @type {Array} */ + const result = [] + let index = -1 + + if (loose) { + result.push({type: 'text', value: '\n'}) + } + + while (++index < nodes.length) { + if (index) result.push({type: 'text', value: '\n'}) + result.push(nodes[index]) + } + + if (loose && nodes.length > 0) { + result.push({type: 'text', value: '\n'}) + } + + return result +} + +/** + * Trim spaces and tabs at the start of `value`. + * + * @param {string} value + * Value to trim. + * @returns {string} + * Result. + */ +function trimMarkdownSpaceStart(value) { + let index = 0 + let code = value.charCodeAt(index) + + while (code === 9 || code === 32) { + index++ + code = value.charCodeAt(index) + } + + return value.slice(index) +} diff --git a/tools/ui/node_modules/mdast-util-to-hast/license b/tools/ui/node_modules/mdast-util-to-hast/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-to-hast/package.json b/tools/ui/node_modules/mdast-util-to-hast/package.json new file mode 100644 index 0000000000000000000000000000000000000000..99166bc4733db0a741cd0a71fa87ac9a298475c3 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/package.json @@ -0,0 +1,119 @@ +{ + "name": "mdast-util-to-hast", + "version": "13.2.1", + "description": "mdast utility to transform to hast", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "hast", + "hast-util", + "util", + "utility", + "markdown", + "html" + ], + "repository": "syntax-tree/mdast-util-to-hast", + "bugs": "https://github.com/syntax-tree/mdast-util-to-hast/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts.map", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "@types/ungap__structured-clone": "^1.0.0", + "c8": "^9.0.0", + "hast-util-to-html": "^9.0.0", + "hastscript": "^9.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.5.1-rc", + "xo": "^0.58.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test/index.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm", + [ + "remark-lint-no-html", + false + ] + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "#": "needed `any`s", + "ignoreFiles": [ + "lib/state.d.ts" + ], + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": "off" + } + } + ], + "prettier": true, + "rules": { + "import/no-cycle": "error", + "max-depth": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-code-point": "off", + "unicorn/prefer-string-replace-all": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-to-hast/readme.md b/tools/ui/node_modules/mdast-util-to-hast/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..6e40d91b86a4f8b9171d0b66b5eddc0b4005e7fe --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-hast/readme.md @@ -0,0 +1,1725 @@ +# mdast-util-to-hast + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] utility to transform to [hast][]. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`defaultFootnoteBackContent(referenceIndex, rereferenceIndex)`](#defaultfootnotebackcontentreferenceindex-rereferenceindex) + * [`defaultFootnoteBackLabel(referenceIndex, rereferenceIndex)`](#defaultfootnotebacklabelreferenceindex-rereferenceindex) + * [`defaultHandlers`](#defaulthandlers) + * [`toHast(tree[, options])`](#tohasttree-options) + * [`FootnoteBackContentTemplate`](#footnotebackcontenttemplate) + * [`FootnoteBackLabelTemplate`](#footnotebacklabeltemplate) + * [`Handler`](#handler) + * [`Handlers`](#handlers) + * [`Options`](#options) + * [`Raw`](#raw) + * [`State`](#state) +* [Examples](#examples) + * [Example: supporting HTML in markdown naïvely](#example-supporting-html-in-markdown-naïvely) + * [Example: supporting HTML in markdown properly](#example-supporting-html-in-markdown-properly) + * [Example: footnotes in languages other than English](#example-footnotes-in-languages-other-than-english) + * [Example: supporting custom nodes](#example-supporting-custom-nodes) +* [Algorithm](#algorithm) + * [Default handling](#default-handling) + * [Fields on nodes](#fields-on-nodes) +* [CSS](#css) +* [Syntax tree](#syntax-tree) + * [Nodes](#nodes) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that takes an [mdast][] (markdown) syntax tree as +input and turns it into a [hast][] (HTML) syntax tree. + +## When should I use this? + +This project is useful when you want to deal with ASTs and turn markdown to +HTML. + +The hast utility [`hast-util-to-mdast`][hast-util-to-mdast] does the inverse of +this utility. +It turns HTML into markdown. + +The remark plugin [`remark-rehype`][remark-rehype] wraps this utility to also +turn markdown to HTML at a higher-level (easier) abstraction. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-to-hast +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {toHast} from 'https://esm.sh/mdast-util-to-hast@13' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say we have the following `example.md`: + +```markdown +## Hello **World**! +``` + +…and next to it a module `example.js`: + +```js +import {fs} from 'node:fs/promises' +import {toHtml} from 'hast-util-to-html' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {toHast} from 'mdast-util-to-hast' + +const markdown = String(await fs.readFile('example.md')) +const mdast = fromMarkdown(markdown) +const hast = toHast(mdast) +const html = toHtml(hast) + +console.log(html) +``` + +…now running `node example.js` yields: + +```html +

    Hello World!

    +``` + +## API + +This package exports the identifiers +[`defaultFootnoteBackContent`][api-default-footnote-back-content], +[`defaultFootnoteBackLabel`][api-default-footnote-back-label], +[`defaultHandlers`][api-default-handlers], and +[`toHast`][api-to-hast]. +There is no default export. + +### `defaultFootnoteBackContent(referenceIndex, rereferenceIndex)` + +Generate the default content that GitHub uses on backreferences. + +###### Parameters + +* `referenceIndex` (`number`) + — index of the definition in the order that they are first referenced, + 0-indexed +* `rereferenceIndex` (`number`) + — index of calls to the same definition, 0-indexed + +###### Returns + +Content (`Array`). + +### `defaultFootnoteBackLabel(referenceIndex, rereferenceIndex)` + +Generate the default label that GitHub uses on backreferences. + +###### Parameters + +* `referenceIndex` (`number`) + — index of the definition in the order that they are first referenced, + 0-indexed +* `rereferenceIndex` (`number`) + — index of calls to the same definition, 0-indexed + +###### Returns + +Label (`string`). + +### `defaultHandlers` + +Default handlers for nodes ([`Handlers`][api-handlers]). + +### `toHast(tree[, options])` + +Transform mdast to hast. + +###### Parameters + +* `tree` ([`MdastNode`][mdast-node]) + — mdast tree +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +hast tree ([`HastNode`][hast-node]). + +##### Notes + +###### HTML + +Raw HTML is available in mdast as [`html`][mdast-html] nodes and can be embedded +in hast as semistandard `raw` nodes. +Most utilities ignore `raw` nodes but two notable ones don’t: + +* [`hast-util-to-html`][hast-util-to-html] also has an option + `allowDangerousHtml` which will output the raw HTML. + This is typically discouraged as noted by the option name but is useful if + you completely trust authors +* [`hast-util-raw`][hast-util-raw] can handle the raw embedded HTML strings by + parsing them into standard hast nodes (`element`, `text`, etc). + This is a heavy task as it needs a full HTML parser, but it is the only way + to support untrusted content + +###### Footnotes + +Many options supported here relate to footnotes. +Footnotes are not specified by CommonMark, which we follow by default. +They are supported by GitHub, so footnotes can be enabled in markdown with +[`mdast-util-gfm`][mdast-util-gfm]. + +The options `footnoteBackLabel` and `footnoteLabel` define natural language +that explains footnotes, which is hidden for sighted users but shown to +assistive technology. +When your page is not in English, you must define translated values. + +Back references use ARIA attributes, but the section label itself uses a +heading that is hidden with an `sr-only` class. +To show it to sighted users, define different attributes in +`footnoteLabelProperties`. + +###### Clobbering + +Footnotes introduces a problem, as it links footnote calls to footnote +definitions on the page through `id` attributes generated from user content, +which results in DOM clobbering. + +DOM clobbering is this: + +```html +

    + +``` + +Elements by their ID are made available by browsers on the `window` object, +which is a security risk. +Using a prefix solves this problem. + +More information on how to handle clobbering and the prefix is explained in +[Example: headings (DOM clobbering) in `rehype-sanitize`][clobber-example]. + +###### Unknown nodes + +Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`. +The default behavior for unknown nodes is: + +* when the node has a `value` (and doesn’t have `data.hName`, + `data.hProperties`, or `data.hChildren`, see later), create a hast `text` + node +* otherwise, create a `
    ` element (which could be changed with + `data.hName`), with its children mapped from mdast to hast as well + +This behavior can be changed by passing an `unknownHandler`. + +### `FootnoteBackContentTemplate` + +Generate content for the backreference dynamically. + +For the following markdown: + +```markdown +Alpha[^micromark], bravo[^micromark], and charlie[^remark]. + +[^remark]: things about remark +[^micromark]: things about micromark +``` + +This function will be called with: + +* `0` and `0` for the backreference from `things about micromark` to + `alpha`, as it is the first used definition, and the first call to it +* `0` and `1` for the backreference from `things about micromark` to + `bravo`, as it is the first used definition, and the second call to it +* `1` and `0` for the backreference from `things about remark` to + `charlie`, as it is the second used definition + +###### Parameters + +* `referenceIndex` (`number`) + — index of the definition in the order that they are first referenced, + 0-indexed +* `rereferenceIndex` (`number`) + — index of calls to the same definition, 0-indexed + +###### Returns + +Content for the backreference when linking back from definitions to their +reference (`Array`, `ElementContent`, or `string`). + +### `FootnoteBackLabelTemplate` + +Generate a back label dynamically. + +For the following markdown: + +```markdown +Alpha[^micromark], bravo[^micromark], and charlie[^remark]. + +[^remark]: things about remark +[^micromark]: things about micromark +``` + +This function will be called with: + +* `0` and `0` for the backreference from `things about micromark` to + `alpha`, as it is the first used definition, and the first call to it +* `0` and `1` for the backreference from `things about micromark` to + `bravo`, as it is the first used definition, and the second call to it +* `1` and `0` for the backreference from `things about remark` to + `charlie`, as it is the second used definition + +###### Parameters + +* `referenceIndex` (`number`) + — index of the definition in the order that they are first referenced, + 0-indexed +* `rereferenceIndex` (`number`) + — index of calls to the same definition, 0-indexed + +###### Returns + +Back label to use when linking back from definitions to their reference +(`string`). + +### `Handler` + +Handle a node (TypeScript type). + +###### Parameters + +* `state` ([`State`][api-state]) + — info passed around +* `node` ([`MdastNode`][mdast-node]) + — node to handle +* `parent` ([`MdastNode | undefined`][mdast-node]) + — parent of `node` + +###### Returns + +Result ([`Array | HastNode | undefined`][hast-node]). + +### `Handlers` + +Handle nodes (TypeScript type). + +###### Type + +```ts +type Handlers = Partial> +``` + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `allowDangerousHtml` (`boolean`, default: `false`) + — whether to persist raw HTML in markdown in the hast tree +* `clobberPrefix` (`string`, default: `'user-content-'`) + — prefix to use before the `id` property on footnotes to prevent them from + *clobbering* +* `file` ([`VFile`][vfile], optional) + — corresponding virtual file representing the input document +* `footnoteBackContent` + ([`FootnoteBackContentTemplate`][api-footnote-back-content-template] + or `string`, default: + [`defaultFootnoteBackContent`][api-default-footnote-back-content]) + — content of the backreference back to references +* `footnoteBackLabel` + ([`FootnoteBackLabelTemplate`][api-footnote-back-label-template] + or `string`, default: + [`defaultFootnoteBackLabel`][api-default-footnote-back-label]) + — label to describe the backreference back to references +* `footnoteLabel` (`string`, default: `'Footnotes'`) + — label to use for the footnotes section (affects screen readers) +* `footnoteLabelProperties` + ([`Properties`][properties], default: `{className: ['sr-only']}`) + — properties to use on the footnote label + (note that `id: 'footnote-label'` is always added as footnote calls use it + with `aria-describedby` to provide an accessible label) +* `footnoteLabelTagName` (`string`, default: `h2`) + — tag name to use for the footnote label +* `handlers` ([`Handlers`][api-handlers], optional) + — extra handlers for nodes +* `passThrough` (`Array`, optional) + — list of custom mdast node types to pass through (keep) in hast (note that + the node itself is passed, but eventual children are transformed) +* `unknownHandler` ([`Handler`][api-handler], optional) + — handle all unknown nodes + +### `Raw` + +Raw string of HTML embedded into HTML AST (TypeScript type). + +###### Type + +```ts +import type {Data, Literal} from 'hast' + +interface Raw extends Literal { + type: 'raw' + data?: RawData | undefined +} + +interface RawData extends Data {} +``` + +### `State` + +Info passed around about the current state (TypeScript type). + +###### Fields + +* `all` (`(node: MdastNode) => Array`) + — transform the children of an mdast parent to hast +* `applyData` (`(from: MdastNode, to: Type) => Type | HastElement`) + — honor the `data` of `from` and maybe generate an element instead of `to` +* `definitionById` (`Map`) + — definitions by their uppercased identifier +* `footnoteById` (`Map`) + — footnote definitions by their uppercased identifier +* `footnoteCounts` (`Map`) + — counts for how often the same footnote was called +* `footnoteOrder` (`Array`) + — identifiers of order when footnote calls first appear in tree order +* `handlers` ([`Handlers`][api-handlers]) + — applied node handlers +* `one` (`(node: MdastNode, parent: MdastNode | undefined) => HastNode | Array | undefined`) + — transform an mdast node to hast +* `options` ([`Options`][api-options]) + — configuration +* `patch` (`(from: MdastNode, to: HastNode) => undefined`) +* `wrap` (`(nodes: Array, loose?: boolean) => Array`) + — wrap `nodes` with line endings between each node, adds initial/final line + endings when `loose` + +## Examples + +### Example: supporting HTML in markdown naïvely + +If you completely trust authors (or plugins) and want to allow them to HTML *in* +markdown, and the last utility has an `allowDangerousHtml` option as well (such +as `hast-util-to-html`) you can pass `allowDangerousHtml` to this utility +(`mdast-util-to-hast`): + +```js +import {fromMarkdown} from 'mdast-util-from-markdown' +import {toHast} from 'mdast-util-to-hast' +import {toHtml} from 'hast-util-to-html' + +const markdown = 'It works! ' +const mdast = fromMarkdown(markdown) +const hast = toHast(mdast, {allowDangerousHtml: true}) +const html = toHtml(hast, {allowDangerousHtml: true}) + +console.log(html) +``` + +…now running `node example.js` yields: + +```html +

    It works!

    +``` + +> ⚠️ **Danger**: observe that the XSS attack through the `onerror` attribute +> is still present. + +### Example: supporting HTML in markdown properly + +If you do not trust the authors of the input markdown, or if you want to make +sure that further utilities can see HTML embedded in markdown, use +[`hast-util-raw`][hast-util-raw]. +The following example passes `allowDangerousHtml` to this utility +(`mdast-util-to-hast`), then turns the raw embedded HTML into proper HTML nodes +(`hast-util-raw`), and finally sanitizes the HTML by only allowing safe things +(`hast-util-sanitize`): + +```js +import {raw} from 'hast-util-raw' +import {sanitize} from 'hast-util-sanitize' +import {toHtml} from 'hast-util-to-html' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {toHast} from 'mdast-util-to-hast' + +const markdown = 'It works! ' +const mdast = fromMarkdown(markdown) +const hast = raw(toHast(mdast, {allowDangerousHtml: true})) +const safeHast = sanitize(hast) +const html = toHtml(safeHast) + +console.log(html) +``` + +…now running `node example.js` yields: + +```html +

    It works!

    +``` + +> 👉 **Note**: observe that the XSS attack through the `onerror` attribute +> is no longer present. + +### Example: footnotes in languages other than English + +If you know that the markdown is authored in a language other than English, +and you’re using `micromark-extension-gfm` and `mdast-util-gfm` to match how +GitHub renders markdown, and you know that footnotes are (or can?) be used, you +should translate the labels associated with them. + +Let’s first set the stage: + +```js +import {toHtml} from 'hast-util-to-html' +import {gfm} from 'micromark-extension-gfm' +import {fromMarkdown} from 'mdast-util-from-markdown' +import {gfmFromMarkdown} from 'mdast-util-gfm' +import {toHast} from 'mdast-util-to-hast' + +const markdown = 'Bonjour[^1]\n\n[^1]: Monde!' +const mdast = fromMarkdown(markdown, { + extensions: [gfm()], + mdastExtensions: [gfmFromMarkdown()] +}) +const hast = toHast(mdast) +const html = toHtml(hast) + +console.log(html) +``` + +…now running `node example.js` yields: + +```html +

    Bonjour1

    +

    Footnotes

    +
      +
    1. +

      Monde! ↩

      +
    2. +
    +
    +``` + +This is a mix of English and French that screen readers can’t handle nicely. +Let’s say our program does know that the markdown is in French. +In that case, it’s important to translate and define the labels relating to +footnotes so that screen reader users can properly pronounce the page: + +```diff +@@ -9,7 +9,16 @@ const mdast = fromMarkdown(markdown, { + extensions: [gfm()], + mdastExtensions: [gfmFromMarkdown()] + }) +-const hast = toHast(mdast) ++const hast = toHast(mdast, { ++ footnoteLabel: 'Notes de bas de page', ++ footnoteBackLabel(referenceIndex, rereferenceIndex) { ++ return ( ++ 'Retour à la référence ' + ++ (referenceIndex + 1) + ++ (rereferenceIndex > 1 ? '-' + rereferenceIndex : '') ++ ) ++ } ++}) + const html = toHtml(hast) + + console.log(html) +``` + +…now running `node example.js` with the above patch applied yields: + +```diff +@@ -1,8 +1,8 @@ +

    Bonjour1

    +-

    Footnotes

    ++

    Notes de bas de page

    +
      +
    1. +-

      Monde! ↩

      ++

      Monde! ↩

      +
    2. +
    +
    +``` + +### Example: supporting custom nodes + +This project supports CommonMark and the GFM constructs (footnotes, +strikethrough, tables) and the frontmatter constructs YAML and TOML. +Support can be extended to other constructs in two ways: a) with handlers, b) +through fields on nodes. + +For example, when we represent a mark element in markdown and want to turn it +into a `` element in HTML, we can use a handler: + +```js +import {toHtml} from 'hast-util-to-html' +import {toHast} from 'mdast-util-to-hast' + +const mdast = { + type: 'paragraph', + children: [{type: 'mark', children: [{type: 'text', value: 'x'}]}] +} + +const hast = toHast(mdast, { + handlers: { + mark(state, node) { + return { + type: 'element', + tagName: 'mark', + properties: {}, + children: state.all(node) + } + } + } +}) + +console.log(toHtml(hast)) +``` + +We can do the same through certain fields on nodes: + +```js +import {toHtml} from 'hast-util-to-html' +import {toHast} from 'mdast-util-to-hast' + +const mdast = { + type: 'paragraph', + children: [ + { + type: 'mark', + children: [{type: 'text', value: 'x'}], + data: {hName: 'mark'} + } + ] +} + +console.log(toHtml(toHast(mdast))) +``` + +## Algorithm + +This project by default handles CommonMark, GFM (footnotes, strikethrough, +tables) and common frontmatter (YAML, TOML). + +Existing handlers can be overwritten and handlers for more nodes can be added. +It’s also possible to define how mdast is turned into hast through fields on +nodes. + +### Default handling + +The following table gives insight into what input turns into what output: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    mdast nodemarkdown examplehast nodehtml example
    + +[`blockquote`](https://github.com/syntax-tree/mdast#blockquote) + + + +```markdown +> A greater than… +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`blockquote`) + + + +```html +
    +

    A greater than…

    +
    +``` + +
    + +[`break`](https://github.com/syntax-tree/mdast#break) + + + +```markdown +A backslash\ +before a line break… +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`br`) + + + +```html +

    A backslash
    +before a line break…

    +``` + +
    + +[`code`](https://github.com/syntax-tree/mdast#code) + + + +````markdown +```js +backtick.fences('for blocks') +``` +```` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`pre` and `code`) + + + +```html +
    backtick.fences('for blocks')
    +
    +``` + +
    + +[`delete`](https://github.com/syntax-tree/mdast#delete) (GFM) + + + +```markdown +Two ~~tildes~~ for delete. +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`del`) + + + +```html +

    Two tildes for delete.

    +``` + +
    + +[`emphasis`](https://github.com/syntax-tree/mdast#emphasis) + + + +```markdown +Some *asterisks* for emphasis. +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`em`) + + + +```html +

    Some asterisks for emphasis.

    +``` + +
    + +[`footnoteReference`](https://github.com/syntax-tree/mdast#footnotereference), +[`footnoteDefinition`](https://github.com/syntax-tree/mdast#footnotedefinition) +(GFM) + + + +```markdown +With a [^caret]. + +[^caret]: Stuff +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`section`, `sup`, `a`) + + + +```html +

    With a 1.

    … +``` + +
    + +[`heading`](https://github.com/syntax-tree/mdast#heading) + + + +```markdown +# One number sign… +###### Six number signs… +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`h1`…`h6`) + + + +```html +

    One number sign…

    +
    Six number signs…
    +``` + +
    + +[`html`](https://github.com/syntax-tree/mdast#html) + + + +```html +CMD+S +``` + + + +Nothing (default), `raw` (when `allowDangerousHtml: true`) + + + +n/a + +
    + +[`image`](https://github.com/syntax-tree/mdast#image) + + + +```markdown +![Alt text](/logo.png "title") +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`img`) + + + +```html +

    Alt text

    +``` + +
    + +[`imageReference`](https://github.com/syntax-tree/mdast#imagereference), +[`definition`](https://github.com/syntax-tree/mdast#definition) + + + +```markdown +![Alt text][logo] + +[logo]: /logo.png "title" +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`img`) + + + +```html +

    Alt text

    +``` + +
    + +[`inlineCode`](https://github.com/syntax-tree/mdast#inlinecode) + + + +```markdown +Some `backticks` for inline code. +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`code`) + + + +```html +

    Some backticks for inline code.

    +``` + +
    + +[`link`](https://github.com/syntax-tree/mdast#link) + + + +```markdown +[Example](https://example.com "title") +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`a`) + + + +```html +

    Example

    +``` + +
    + +[`linkReference`](https://github.com/syntax-tree/mdast#linkreference), +[`definition`](https://github.com/syntax-tree/mdast#definition) + + + +```markdown +[Example][] + +[example]: https://example.com "title" +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`a`) + + + +```html +

    Example

    +``` + +
    + +[`list`](https://github.com/syntax-tree/mdast#list), +[`listItem`](https://github.com/syntax-tree/mdast#listitem) + + + +```markdown +* asterisks for unordered items + +1. decimals and a dot for ordered items +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`li` and `ol` or `ul`) + + + +```html +
      +
    • asterisks for unordered items
    • +
    +
      +
    1. decimals and a dot for ordered items
    2. +
    +``` + +
    + +[`paragraph`](https://github.com/syntax-tree/mdast#paragraph) + + + +```markdown +Just some text… +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`p`) + + + +```html +

    Just some text…

    +``` + +
    + +[`root`](https://github.com/syntax-tree/mdast#root) + + + +```markdown +Anything! +``` + + + +[`root`](https://github.com/syntax-tree/hast#root) + + + +```html +

    Anything!

    +``` + +
    + +[`strong`](https://github.com/syntax-tree/mdast#strong) + + + +```markdown +Two **asterisks** for strong. +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`strong`) + + + +```html +

    Two asterisks for strong.

    +``` + +
    + +[`text`](https://github.com/syntax-tree/mdast#text) + + + +```markdown +Anything! +``` + + + +[`text`](https://github.com/syntax-tree/hast#text) + + + +```html +

    Anything!

    +``` + +
    + +[`table`](https://github.com/syntax-tree/mdast#table), +[`tableRow`](https://github.com/syntax-tree/mdast#tablerow), +[`tableCell`](https://github.com/syntax-tree/mdast#tablecell) + + + +```markdown +| Pipes | +| ----- | +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`table`, `thead`, +`tbody`, `tr`, `td`, `th`) + + + +```html + + + + + + +
    Pipes
    +``` + +
    + +[`thematicBreak`](https://github.com/syntax-tree/mdast#thematicbreak) + + + +```markdown +Three asterisks for a thematic break: + +*** +``` + + + +[`element`](https://github.com/syntax-tree/hast#element) (`hr`) + + + +```html +

    Three asterisks for a thematic break:

    +
    +``` + +
    + +`toml` (frontmatter) + + + +```markdown ++++ +fenced = true ++++ +``` + + + +Nothing + + + +n/a + +
    + +[`yaml`](https://github.com/syntax-tree/mdast#yaml) (frontmatter) + + + +```markdown +--- +fenced: yes +--- +``` + + + +Nothing + + + +n/a + +
    + +> 👉 **Note**: GFM prescribes that the obsolete `align` attribute on `td` and +> `th` elements is used. +> To use `style` attributes instead of obsolete features, combine this utility +> with [`@mapbox/hast-util-table-cell-style`][hast-util-table-cell-style]. + +> 🧑‍🏫 **Info**: this project is concerned with turning one syntax tree into +> another. +> It does not deal with markdown syntax or HTML syntax. +> The preceding examples are illustrative rather than authoritative or +> exhaustive. + +### Fields on nodes + +A frequent problem arises when having to turn one syntax tree into another. +As the original tree (in this case, mdast for markdown) is in some cases +limited compared to the destination (in this case, hast for HTML) tree, +is it possible to provide more info in the original to define what the +result will be in the destination? +This is possible by defining data on mdast nodes, which this utility will read +as instructions on what hast nodes to create. + +An example is math, which is a nonstandard markdown extension, that this utility +doesn’t understand. +To solve this, `mdast-util-math` defines instructions on mdast nodes that this +plugin does understand because they define a certain hast structure. + +The following fields can be used: + +* `node.data.hName` — define the element’s tag name +* `node.data.hProperties` — define extra properties to use +* `node.data.hChildren` — define hast children to use + +###### `hName` + +`node.data.hName` sets the tag name of an element. +The following [mdast][]: + +```js +{ + type: 'strong', + data: {hName: 'b'}, + children: [{type: 'text', value: 'Alpha'}] +} +``` + +…yields ([hast][]): + +```js +{ + type: 'element', + tagName: 'b', + properties: {}, + children: [{type: 'text', value: 'Alpha'}] +} +``` + +###### `hProperties` + +`node.data.hProperties` sets the properties of an element. +The following [mdast][]: + +```js +{ + type: 'image', + src: 'circle.svg', + alt: 'Big red circle on a black background', + data: {hProperties: {className: ['responsive']}} +} +``` + +…yields ([hast][]): + +```js +{ + type: 'element', + tagName: 'img', + properties: { + src: 'circle.svg', + alt: 'Big red circle on a black background', + className: ['responsive'] + }, + children: [] +} +``` + +###### `hChildren` + +`node.data.hChildren` sets the children of an element. +The following [mdast][]: + +```js +{ + type: 'code', + lang: 'js', + data: { + hChildren: [ + { + type: 'element', + tagName: 'span', + properties: {className: ['hljs-meta']}, + children: [{type: 'text', value: '"use strict"'}] + }, + {type: 'text', value: ';'} + ] + }, + value: '"use strict";' +} +``` + +…yields ([hast][]): + +```js +{ + type: 'element', + tagName: 'pre', + properties: {}, + children: [{ + type: 'element', + tagName: 'code', + properties: {className: ['language-js']}, + children: [ + { + type: 'element', + tagName: 'span', + properties: {className: ['hljs-meta']}, + children: [{type: 'text', value: '"use strict"'}] + }, + {type: 'text', value: ';'} + ] + }] +} +``` + +> 👉 **Note**: the `pre` and `language-js` class are normal `mdast-util-to-hast` +> functionality. + +## CSS + +Assuming you know how to use (semantic) HTML and CSS, then it should generally +be straightforward to style the HTML produced by this plugin. +With CSS, you can get creative and style the results as you please. + +Some semistandard features, notably GFMs tasklists and footnotes, generate HTML +that be unintuitive, as it matches exactly what GitHub produces for their +website. +There is a project, [`sindresorhus/github-markdown-css`][github-markdown-css], +that exposes the stylesheet that GitHub uses for rendered markdown, which might +either be inspirational for more complex features, or can be used as-is to +exactly match how GitHub styles rendered markdown. + +The following CSS is needed to make footnotes look a bit like GitHub: + +```css +/* Style the footnotes section. */ +.footnotes { + font-size: smaller; + color: #8b949e; + border-top: 1px solid #30363d; +} + +/* Hide the section label for visual users. */ +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + word-wrap: normal; + border: 0; +} + +/* Place `[` and `]` around footnote calls. */ +[data-footnote-ref]::before { + content: '['; +} + +[data-footnote-ref]::after { + content: ']'; +} +``` + +## Syntax tree + +The following interfaces are added to **[hast][]** by this utility. + +### Nodes + +#### `Raw` + +```idl +interface Raw <: Literal { + type: 'raw' +} +``` + +**Raw** (**[Literal][dfn-literal]**) represents a string if raw HTML inside +hast. +Raw nodes are typically ignored but are handled by +[`hast-util-to-html`][hast-util-to-html] and [`hast-util-raw`][hast-util-raw]. + +## Types + +This package is fully typed with [TypeScript][]. +It exports the +[`FootnoteBackContentTemplate`][api-footnote-back-content-template], +[`FootnoteBackLabelTemplate`][api-footnote-back-label-template], +[`Handler`][api-handler], +[`Handlers`][api-handlers], +[`Options`][api-options], +[`Raw`][api-raw], and +[`State`][api-state] types. + +It also registers the `Raw` node type with `@types/hast`. +If you’re working with the syntax tree (and you pass +`allowDangerousHtml: true`), make sure to import this utility somewhere in your +types, as that registers the new node type in the tree. + +```js +/** + * @import {Root} from 'hast' + * @import {} from 'mdast-util-to-hast' + */ + +import {visit} from 'unist-util-visit' + +/** @type {Root} */ +const tree = { /* … */ } + +visit(tree, function (node) { + // `node` can now be `raw`. +}) +``` + +Finally, it also registers the `hChildren`, `hName`, and `hProperties` fields +on `Data` of `@types/mdast`. +If you’re working with the syntax tree, make sure to import this utility +somewhere in your types, as that registers the data fields in the tree. + +```js +/** + * @import {Root} from 'hast' + * @import {} from 'mdast-util-to-hast' + */ + +import {visit} from 'unist-util-visit' + +/** @type {Root} */ +const tree = { /* … */ } + +console.log(tree.data?.hName) // Types as `string | undefined`. +``` + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-to-hast@^13`, +compatible with Node.js 16. + +## Security + +Use of `mdast-util-to-hast` can open you up to a +[cross-site scripting (XSS)][xss] attack. +Embedded hast properties (`hName`, `hProperties`, `hChildren`), custom handlers, +and the `allowDangerousHtml` option all provide openings. + +The following example shows how a script is injected where a benign code block +is expected with embedded hast properties: + +```js +const code = {type: 'code', value: 'alert(1)'} + +code.data = {hName: 'script'} +``` + +Yields: + +```html + +``` + +The following example shows how an image is changed to fail loading and +therefore run code in a browser. + +```js +const image = {type: 'image', url: 'existing.png'} + +image.data = {hProperties: {src: 'missing', onError: 'alert(2)'}} +``` + +Yields: + +```html + +``` + +The following example shows the default handling of embedded HTML: + +```markdown +# Hello + + +``` + +Yields: + +```html +

    Hello

    +``` + +Passing `allowDangerousHtml: true` to `mdast-util-to-hast` is typically still +not enough to run unsafe code: + +```html +

    Hello

    +<script>alert(3)</script> +``` + +If `allowDangerousHtml: true` is also given to `hast-util-to-html` (or +`rehype-stringify`), the unsafe code runs: + +```html +

    Hello

    + +``` + +Use [`hast-util-sanitize`][hast-util-sanitize] to make the hast tree safe. + +## Related + +* [`hast-util-to-mdast`](https://github.com/syntax-tree/hast-util-to-mdast) + — transform hast to mdast +* [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast) + — transform hast to xast +* [`hast-util-sanitize`](https://github.com/syntax-tree/hast-util-sanitize) + — sanitize hast nodes + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-to-hast/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-to-hast/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-hast.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-hast + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-hast.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-to-hast + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-hast + +[size]: https://bundlejs.com/?q=mdast-util-to-hast + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-node]: https://github.com/syntax-tree/mdast#nodes + +[mdast-html]: https://github.com/syntax-tree/mdast#html + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[hast]: https://github.com/syntax-tree/hast + +[hast-node]: https://github.com/syntax-tree/hast#nodes + +[properties]: https://github.com/syntax-tree/hast#properties + +[hast-util-table-cell-style]: https://github.com/mapbox/hast-util-table-cell-style + +[hast-util-to-mdast]: https://github.com/syntax-tree/hast-util-to-mdast + +[hast-util-to-html]: https://github.com/syntax-tree/hast-util-to-html + +[hast-util-raw]: https://github.com/syntax-tree/hast-util-raw + +[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize + +[remark-rehype]: https://github.com/remarkjs/remark-rehype + +[vfile]: https://github.com/vfile/vfile + +[clobber-example]: https://github.com/rehypejs/rehype-sanitize#example-headings-dom-clobbering + +[github-markdown-css]: https://github.com/sindresorhus/github-markdown-css + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[dfn-literal]: https://github.com/syntax-tree/hast#literal + +[api-default-footnote-back-content]: #defaultfootnotebackcontentreferenceindex-rereferenceindex + +[api-default-footnote-back-label]: #defaultfootnotebacklabelreferenceindex-rereferenceindex + +[api-default-handlers]: #defaulthandlers + +[api-footnote-back-content-template]: #footnotebackcontenttemplate + +[api-footnote-back-label-template]: #footnotebacklabeltemplate + +[api-handler]: #handler + +[api-handlers]: #handlers + +[api-options]: #options + +[api-raw]: #raw + +[api-state]: #state + +[api-to-hast]: #tohasttree-options diff --git a/tools/ui/node_modules/mdast-util-to-markdown/index.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a07a51779e45752303c6e40c3c8c3b2f49da40b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/index.d.ts @@ -0,0 +1,16 @@ +export type { + ConstructNameMap, + ConstructName, + Handle, + Handlers, + Info, + Join, + Map, + Options, + SafeConfig, + State, + Tracker, + Unsafe +} from './lib/types.js' +export {toMarkdown} from './lib/index.js' +export {handle as defaultHandlers} from './lib/handle/index.js' diff --git a/tools/ui/node_modules/mdast-util-to-markdown/index.js b/tools/ui/node_modules/mdast-util-to-markdown/index.js new file mode 100644 index 0000000000000000000000000000000000000000..24a6ef3c24a6cca2baa4acdfaddea91093c49d54 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/index.js @@ -0,0 +1,3 @@ +// Note: extra types exposed from `index.d.ts`. +export {toMarkdown} from './lib/index.js' +export {handle as defaultHandlers} from './lib/handle/index.js' diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa7253e38d42ba203e4c3c2d75ad5abaa6396551 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts @@ -0,0 +1,9 @@ +/** + * @param {State} base + * @param {Options} extension + * @returns {State} + */ +export function configure(base: State, extension: Options): State; +import type { State } from './types.js'; +import type { Options } from './types.js'; +//# sourceMappingURL=configure.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..0fabd9f27011bf73b948cc563eaa094f066c3818 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["configure.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,gCAJW,KAAK,aACL,OAAO,GACL,KAAK,CA+CjB;2BAvDgC,YAAY;6BAAZ,YAAY"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.js new file mode 100644 index 0000000000000000000000000000000000000000..0442e99c55038a04e031757e040015f4ea4fb9db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/configure.js @@ -0,0 +1,79 @@ +/** + * @import {Options, State} from './types.js' + */ + +const own = {}.hasOwnProperty + +/** + * @param {State} base + * @param {Options} extension + * @returns {State} + */ +export function configure(base, extension) { + let index = -1 + /** @type {keyof Options} */ + let key + + // First do subextensions. + if (extension.extensions) { + while (++index < extension.extensions.length) { + configure(base, extension.extensions[index]) + } + } + + for (key in extension) { + if (own.call(extension, key)) { + switch (key) { + case 'extensions': { + // Empty. + break + } + + /* c8 ignore next 4 */ + case 'unsafe': { + list(base[key], extension[key]) + break + } + + case 'join': { + list(base[key], extension[key]) + break + } + + case 'handlers': { + map(base[key], extension[key]) + break + } + + default: { + // @ts-expect-error: matches. + base.options[key] = extension[key] + } + } + } + } + + return base +} + +/** + * @template T + * @param {Array} left + * @param {Array | null | undefined} right + */ +function list(left, right) { + if (right) { + left.push(...right) + } +} + +/** + * @template T + * @param {Record} left + * @param {Record | null | undefined} right + */ +function map(left, right) { + if (right) { + Object.assign(left, right) + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a933651eb6920c31d0da26afd759c52c5488e79 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts @@ -0,0 +1,17 @@ +/** + * @import {Blockquote, Parents} from 'mdast' + * @import {Info, Map, State} from 'mdast-util-to-markdown' + */ +/** + * @param {Blockquote} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function blockquote(node: Blockquote, _: Parents | undefined, state: State, info: Info): string; +import type { Blockquote } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=blockquote.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3a2337d8263f10a2f260f245681adabf6048fb69 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,iCANW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAalB;gCAtBqC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js new file mode 100644 index 0000000000000000000000000000000000000000..6d9bfe17428ef668cf8c1679519498a3d707a465 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js @@ -0,0 +1,29 @@ +/** + * @import {Blockquote, Parents} from 'mdast' + * @import {Info, Map, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {Blockquote} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function blockquote(node, _, state, info) { + const exit = state.enter('blockquote') + const tracker = state.createTracker(info) + tracker.move('> ') + tracker.shift(2) + const value = state.indentLines( + state.containerFlow(node, tracker.current()), + map + ) + exit() + return value +} + +/** @type {Map} */ +function map(line, _, blank) { + return '>' + (blank ? '' : ' ') + line +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c15d013d23d11d800dd592093cf05ad409c38e6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts @@ -0,0 +1,13 @@ +/** + * @param {Break} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function hardBreak(_: Break, _1: Parents | undefined, state: State, info: Info): string; +import type { Break } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=break.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1ab4fa9393241b081acce3d0cadd460f33a78544 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,6BANW,KAAK,MACL,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAiBlB;2BA5BgC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.js new file mode 100644 index 0000000000000000000000000000000000000000..f8be4f87b7a7bbd17c7e809734e2b172e1601cb6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/break.js @@ -0,0 +1,30 @@ +/** + * @import {Break, Parents} from 'mdast' + * @import {Info, State} from 'mdast-util-to-markdown' + */ + +import {patternInScope} from '../util/pattern-in-scope.js' + +/** + * @param {Break} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function hardBreak(_, _1, state, info) { + let index = -1 + + while (++index < state.unsafe.length) { + // If we can’t put eols in this construct (setext headings, tables), use a + // space instead. + if ( + state.unsafe[index].character === '\n' && + patternInScope(state.stack, state.unsafe[index]) + ) { + return /[ \t]/.test(info.before) ? '' : ' ' + } + } + + return '\\\n' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2610b7ea8dd47c9161fd92626549781c30a7559c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts @@ -0,0 +1,13 @@ +/** + * @param {Code} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function code(node: Code, _: Parents | undefined, state: State, info: Info): string; +import type { Code } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=code.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b7a1d89696b2497b4dba3b809eef696a67beb903 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["code.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAuDlB;0BAnE+B,OAAO;6BAAP,OAAO;2BADJ,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.js new file mode 100644 index 0000000000000000000000000000000000000000..6807cb1bc34e742e993e3a27364408a7ca1ee5a5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/code.js @@ -0,0 +1,75 @@ +/** + * @import {Info, Map, State} from 'mdast-util-to-markdown' + * @import {Code, Parents} from 'mdast' + */ + +import {longestStreak} from 'longest-streak' +import {formatCodeAsIndented} from '../util/format-code-as-indented.js' +import {checkFence} from '../util/check-fence.js' + +/** + * @param {Code} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function code(node, _, state, info) { + const marker = checkFence(state) + const raw = node.value || '' + const suffix = marker === '`' ? 'GraveAccent' : 'Tilde' + + if (formatCodeAsIndented(node, state)) { + const exit = state.enter('codeIndented') + const value = state.indentLines(raw, map) + exit() + return value + } + + const tracker = state.createTracker(info) + const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3)) + const exit = state.enter('codeFenced') + let value = tracker.move(sequence) + + if (node.lang) { + const subexit = state.enter(`codeFencedLang${suffix}`) + value += tracker.move( + state.safe(node.lang, { + before: value, + after: ' ', + encode: ['`'], + ...tracker.current() + }) + ) + subexit() + } + + if (node.lang && node.meta) { + const subexit = state.enter(`codeFencedMeta${suffix}`) + value += tracker.move(' ') + value += tracker.move( + state.safe(node.meta, { + before: value, + after: '\n', + encode: ['`'], + ...tracker.current() + }) + ) + subexit() + } + + value += tracker.move('\n') + + if (raw) { + value += tracker.move(raw + '\n') + } + + value += tracker.move(sequence) + exit() + return value +} + +/** @type {Map} */ +function map(line, _, blank) { + return (blank ? '' : ' ') + line +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8fd8d84b55590366d3d1821592579abbcb65da1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts @@ -0,0 +1,13 @@ +/** + * @param {Definition} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function definition(node: Definition, _: Parents | undefined, state: State, info: Info): string; +import type { Definition } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=definition.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a2b867de209fc46d0efaf82019d5307f8d050db5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["definition.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,iCANW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA+DlB;gCAzEqC,OAAO;6BAAP,OAAO;2BADf,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.js new file mode 100644 index 0000000000000000000000000000000000000000..17518ad3f9f86f9767be63e6860c7390a6c39d20 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/definition.js @@ -0,0 +1,76 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Definition, Parents} from 'mdast' + */ + +import {checkQuote} from '../util/check-quote.js' + +/** + * @param {Definition} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function definition(node, _, state, info) { + const quote = checkQuote(state) + const suffix = quote === '"' ? 'Quote' : 'Apostrophe' + const exit = state.enter('definition') + let subexit = state.enter('label') + const tracker = state.createTracker(info) + let value = tracker.move('[') + value += tracker.move( + state.safe(state.associationId(node), { + before: value, + after: ']', + ...tracker.current() + }) + ) + value += tracker.move(']: ') + + subexit() + + if ( + // If there’s no url, or… + !node.url || + // If there are control characters or whitespace. + /[\0- \u007F]/.test(node.url) + ) { + subexit = state.enter('destinationLiteral') + value += tracker.move('<') + value += tracker.move( + state.safe(node.url, {before: value, after: '>', ...tracker.current()}) + ) + value += tracker.move('>') + } else { + // No whitespace, raw is prettier. + subexit = state.enter('destinationRaw') + value += tracker.move( + state.safe(node.url, { + before: value, + after: node.title ? ' ' : '\n', + ...tracker.current() + }) + ) + } + + subexit() + + if (node.title) { + subexit = state.enter(`title${suffix}`) + value += tracker.move(' ' + quote) + value += tracker.move( + state.safe(node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ) + value += tracker.move(quote) + subexit() + } + + exit() + + return value +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fb034ea447e27dcfdf1116419035fe86f5f3336 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts @@ -0,0 +1,24 @@ +/** + * @param {Emphasis} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function emphasis(node: Emphasis, _: Parents | undefined, state: State, info: Info): string; +export namespace emphasis { + export { emphasisPeek as peek }; +} +import type { Emphasis } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @param {Emphasis} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +declare function emphasisPeek(_: Emphasis, _1: Parents | undefined, state: State): string; +export {}; +//# sourceMappingURL=emphasis.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..9af598c351e78b62e05c884d7538578457ac4f15 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,+BANW,QAAQ,KACR,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA0ClB;;;;8BAxDmC,OAAO;6BAAP,OAAO;2BADb,wBAAwB;0BAAxB,wBAAwB;AA2DtD;;;;;GAKG;AACH,iCALW,QAAQ,MACR,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js new file mode 100644 index 0000000000000000000000000000000000000000..92be547459a62ae18f813651b713d31fbc4efbe0 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js @@ -0,0 +1,69 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Emphasis, Parents} from 'mdast' + */ + +import {checkEmphasis} from '../util/check-emphasis.js' +import {encodeCharacterReference} from '../util/encode-character-reference.js' +import {encodeInfo} from '../util/encode-info.js' + +emphasis.peek = emphasisPeek + +/** + * @param {Emphasis} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function emphasis(node, _, state, info) { + const marker = checkEmphasis(state) + const exit = state.enter('emphasis') + const tracker = state.createTracker(info) + const before = tracker.move(marker) + + let between = tracker.move( + state.containerPhrasing(node, { + after: marker, + before, + ...tracker.current() + }) + ) + const betweenHead = between.charCodeAt(0) + const open = encodeInfo( + info.before.charCodeAt(info.before.length - 1), + betweenHead, + marker + ) + + if (open.inside) { + between = encodeCharacterReference(betweenHead) + between.slice(1) + } + + const betweenTail = between.charCodeAt(between.length - 1) + const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker) + + if (close.inside) { + between = between.slice(0, -1) + encodeCharacterReference(betweenTail) + } + + const after = tracker.move(marker) + + exit() + + state.attentionEncodeSurroundingInfo = { + after: close.outside, + before: open.outside + } + return before + between + after +} + +/** + * @param {Emphasis} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +function emphasisPeek(_, _1, state) { + return state.options.emphasis || '*' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d862a309a54ccfc169fe73b5e1dff2267ff7c365 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts @@ -0,0 +1,13 @@ +/** + * @param {Heading} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function heading(node: Heading, _: Parents | undefined, state: State, info: Info): string; +import type { Heading } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=heading.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..646efee9a79a235342cc491c864639e8d655acd1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.js"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,8BANW,OAAO,KACP,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA6DlB;6BAxEkC,OAAO;6BAAP,OAAO;2BADZ,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.js new file mode 100644 index 0000000000000000000000000000000000000000..e421379f9239f0a5ae5aa93e5438c2b5baefbfad --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/heading.js @@ -0,0 +1,75 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Heading, Parents} from 'mdast' + */ + +import {encodeCharacterReference} from '../util/encode-character-reference.js' +import {formatHeadingAsSetext} from '../util/format-heading-as-setext.js' + +/** + * @param {Heading} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function heading(node, _, state, info) { + const rank = Math.max(Math.min(6, node.depth || 1), 1) + const tracker = state.createTracker(info) + + if (formatHeadingAsSetext(node, state)) { + const exit = state.enter('headingSetext') + const subexit = state.enter('phrasing') + const value = state.containerPhrasing(node, { + ...tracker.current(), + before: '\n', + after: '\n' + }) + subexit() + exit() + + return ( + value + + '\n' + + (rank === 1 ? '=' : '-').repeat( + // The whole size… + value.length - + // Minus the position of the character after the last EOL (or + // 0 if there is none)… + (Math.max(value.lastIndexOf('\r'), value.lastIndexOf('\n')) + 1) + ) + ) + } + + const sequence = '#'.repeat(rank) + const exit = state.enter('headingAtx') + const subexit = state.enter('phrasing') + + // Note: for proper tracking, we should reset the output positions when there + // is no content returned, because then the space is not output. + // Practically, in that case, there is no content, so it doesn’t matter that + // we’ve tracked one too many characters. + tracker.move(sequence + ' ') + + let value = state.containerPhrasing(node, { + before: '# ', + after: '\n', + ...tracker.current() + }) + + if (/^[\t ]/.test(value)) { + // To do: what effect has the character reference on tracking? + value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1) + } + + value = value ? sequence + ' ' + value : sequence + + if (state.options.closeAtx) { + value += ' ' + sequence + } + + subexit() + exit() + + return value +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c46edd692e21d014e13edd1ae28518f91ad625f8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts @@ -0,0 +1,15 @@ +/** + * @param {Html} node + * @returns {string} + */ +export function html(node: Html): string; +export namespace html { + export { htmlPeek as peek }; +} +import type { Html } from 'mdast'; +/** + * @returns {string} + */ +declare function htmlPeek(): string; +export {}; +//# sourceMappingURL=html.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..774fc77fd49b6c5ae62bbeb2512db1d5004dbac4 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,2BAHW,IAAI,GACF,MAAM,CAIlB;;;;0BAXsB,OAAO;AAa9B;;GAEG;AACH,6BAFa,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.js new file mode 100644 index 0000000000000000000000000000000000000000..d749e6f61e06b0372da63e284349f7fd0a841e35 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/html.js @@ -0,0 +1,20 @@ +/** + * @import {Html} from 'mdast' + */ + +html.peek = htmlPeek + +/** + * @param {Html} node + * @returns {string} + */ +export function html(node) { + return node.value || '' +} + +/** + * @returns {string} + */ +function htmlPeek() { + return '<' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc1b4ea45346a597677b63d16ac82d03a81e1860 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts @@ -0,0 +1,21 @@ +/** + * @param {ImageReference} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function imageReference(node: ImageReference, _: Parents | undefined, state: State, info: Info): string; +export namespace imageReference { + export { imageReferencePeek as peek }; +} +import type { ImageReference } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @returns {string} + */ +declare function imageReferencePeek(): string; +export {}; +//# sourceMappingURL=image-reference.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e44888af5bc9433b5e7a02da135aa09b5afd043b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,qCANW,cAAc,KACd,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA2ClB;;;;oCArDyC,OAAO;6BAAP,OAAO;2BADnB,wBAAwB;0BAAxB,wBAAwB;AAwDtD;;GAEG;AACH,uCAFa,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js new file mode 100644 index 0000000000000000000000000000000000000000..c21b215a13dceec48de3aab89e7070c1534ae86a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js @@ -0,0 +1,63 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {ImageReference, Parents} from 'mdast' + */ + +imageReference.peek = imageReferencePeek + +/** + * @param {ImageReference} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function imageReference(node, _, state, info) { + const type = node.referenceType + const exit = state.enter('imageReference') + let subexit = state.enter('label') + const tracker = state.createTracker(info) + let value = tracker.move('![') + const alt = state.safe(node.alt, { + before: value, + after: ']', + ...tracker.current() + }) + value += tracker.move(alt + '][') + + subexit() + // Hide the fact that we’re in phrasing, because escapes don’t work. + const stack = state.stack + state.stack = [] + subexit = state.enter('reference') + // Note: for proper tracking, we should reset the output positions when we end + // up making a `shortcut` reference, because then there is no brace output. + // Practically, in that case, there is no content, so it doesn’t matter that + // we’ve tracked one too many characters. + const reference = state.safe(state.associationId(node), { + before: value, + after: ']', + ...tracker.current() + }) + subexit() + state.stack = stack + exit() + + if (type === 'full' || !alt || alt !== reference) { + value += tracker.move(reference + ']') + } else if (type === 'shortcut') { + // Remove the unwanted `[`. + value = value.slice(0, -1) + } else { + value += tracker.move(']') + } + + return value +} + +/** + * @returns {string} + */ +function imageReferencePeek() { + return '!' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1b1056caa315322dc444dfd720fa52b9c856962 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts @@ -0,0 +1,21 @@ +/** + * @param {Image} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function image(node: Image, _: Parents | undefined, state: State, info: Info): string; +export namespace image { + export { imagePeek as peek }; +} +import type { Image } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @returns {string} + */ +declare function imagePeek(): string; +export {}; +//# sourceMappingURL=image.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cbac4a3b2b7a4e0f01a1ffa5425b0946476422ec --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,4BANW,KAAK,KACL,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA4DlB;;;;2BAxEgC,OAAO;6BAAP,OAAO;2BADV,wBAAwB;0BAAxB,wBAAwB;AA2EtD;;GAEG;AACH,8BAFa,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.js new file mode 100644 index 0000000000000000000000000000000000000000..ba5c5c9291fbe99e1ff8a0088b63a9b3718bca3d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/image.js @@ -0,0 +1,82 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Image, Parents} from 'mdast' + */ + +import {checkQuote} from '../util/check-quote.js' + +image.peek = imagePeek + +/** + * @param {Image} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function image(node, _, state, info) { + const quote = checkQuote(state) + const suffix = quote === '"' ? 'Quote' : 'Apostrophe' + const exit = state.enter('image') + let subexit = state.enter('label') + const tracker = state.createTracker(info) + let value = tracker.move('![') + value += tracker.move( + state.safe(node.alt, {before: value, after: ']', ...tracker.current()}) + ) + value += tracker.move('](') + + subexit() + + if ( + // If there’s no url but there is a title… + (!node.url && node.title) || + // If there are control characters or whitespace. + /[\0- \u007F]/.test(node.url) + ) { + subexit = state.enter('destinationLiteral') + value += tracker.move('<') + value += tracker.move( + state.safe(node.url, {before: value, after: '>', ...tracker.current()}) + ) + value += tracker.move('>') + } else { + // No whitespace, raw is prettier. + subexit = state.enter('destinationRaw') + value += tracker.move( + state.safe(node.url, { + before: value, + after: node.title ? ' ' : ')', + ...tracker.current() + }) + ) + } + + subexit() + + if (node.title) { + subexit = state.enter(`title${suffix}`) + value += tracker.move(' ' + quote) + value += tracker.move( + state.safe(node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ) + value += tracker.move(quote) + subexit() + } + + value += tracker.move(')') + exit() + + return value +} + +/** + * @returns {string} + */ +function imagePeek() { + return '!' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ceeeb2358b7f12df5f529ed90d85670d1682c04 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts @@ -0,0 +1,42 @@ +export namespace handle { + export { blockquote }; + export { hardBreak as break }; + export { code }; + export { definition }; + export { emphasis }; + export { hardBreak }; + export { heading }; + export { html }; + export { image }; + export { imageReference }; + export { inlineCode }; + export { link }; + export { linkReference }; + export { list }; + export { listItem }; + export { paragraph }; + export { root }; + export { strong }; + export { text }; + export { thematicBreak }; +} +import { blockquote } from './blockquote.js'; +import { hardBreak } from './break.js'; +import { code } from './code.js'; +import { definition } from './definition.js'; +import { emphasis } from './emphasis.js'; +import { heading } from './heading.js'; +import { html } from './html.js'; +import { image } from './image.js'; +import { imageReference } from './image-reference.js'; +import { inlineCode } from './inline-code.js'; +import { link } from './link.js'; +import { linkReference } from './link-reference.js'; +import { list } from './list.js'; +import { listItem } from './list-item.js'; +import { paragraph } from './paragraph.js'; +import { root } from './root.js'; +import { strong } from './strong.js'; +import { text } from './text.js'; +import { thematicBreak } from './thematic-break.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ef61a4f421fe6a856d0d503903c11669b3baf364 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;2BAAyB,iBAAiB;0BAClB,YAAY;qBACjB,WAAW;2BACL,iBAAiB;yBACnB,eAAe;wBAChB,cAAc;qBACjB,WAAW;sBACV,YAAY;+BACH,sBAAsB;2BAC1B,kBAAkB;qBACxB,WAAW;8BACF,qBAAqB;qBAC9B,WAAW;yBACP,gBAAgB;0BACf,gBAAgB;qBACrB,WAAW;uBACT,aAAa;qBACf,WAAW;8BACF,qBAAqB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f03686a3d5d22cd9ce666cef2eb05a4700f30337 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/index.js @@ -0,0 +1,45 @@ +import {blockquote} from './blockquote.js' +import {hardBreak} from './break.js' +import {code} from './code.js' +import {definition} from './definition.js' +import {emphasis} from './emphasis.js' +import {heading} from './heading.js' +import {html} from './html.js' +import {image} from './image.js' +import {imageReference} from './image-reference.js' +import {inlineCode} from './inline-code.js' +import {link} from './link.js' +import {linkReference} from './link-reference.js' +import {list} from './list.js' +import {listItem} from './list-item.js' +import {paragraph} from './paragraph.js' +import {root} from './root.js' +import {strong} from './strong.js' +import {text} from './text.js' +import {thematicBreak} from './thematic-break.js' + +/** + * Default (CommonMark) handlers. + */ +export const handle = { + blockquote, + break: hardBreak, + code, + definition, + emphasis, + hardBreak, + heading, + html, + image, + imageReference, + inlineCode, + link, + linkReference, + list, + listItem, + paragraph, + root, + strong, + text, + thematicBreak +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a4862db809f3c4b30982fb99bf8b3d00c20f597 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts @@ -0,0 +1,19 @@ +/** + * @param {InlineCode} node + * @param {Parents | undefined} _ + * @param {State} state + * @returns {string} + */ +export function inlineCode(node: InlineCode, _: Parents | undefined, state: State): string; +export namespace inlineCode { + export { inlineCodePeek as peek }; +} +import type { InlineCode } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +/** + * @returns {string} + */ +declare function inlineCodePeek(): string; +export {}; +//# sourceMappingURL=inline-code.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..894b8008203ec20f14f1421eca93c88f5ad4623b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["inline-code.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,iCALW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAyDlB;;;;gCAlEqC,OAAO;6BAAP,OAAO;2BADrB,wBAAwB;AAqEhD;;GAEG;AACH,mCAFa,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js new file mode 100644 index 0000000000000000000000000000000000000000..f2e99d5106908e80831febb6493327942ca416cd --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js @@ -0,0 +1,76 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {InlineCode, Parents} from 'mdast' + */ + +inlineCode.peek = inlineCodePeek + +/** + * @param {InlineCode} node + * @param {Parents | undefined} _ + * @param {State} state + * @returns {string} + */ +export function inlineCode(node, _, state) { + let value = node.value || '' + let sequence = '`' + let index = -1 + + // If there is a single grave accent on its own in the code, use a fence of + // two. + // If there are two in a row, use one. + while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) { + sequence += '`' + } + + // If this is not just spaces or eols (tabs don’t count), and either the + // first or last character are a space, eol, or tick, then pad with spaces. + if ( + /[^ \r\n]/.test(value) && + ((/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value)) || /^`|`$/.test(value)) + ) { + value = ' ' + value + ' ' + } + + // We have a potential problem: certain characters after eols could result in + // blocks being seen. + // For example, if someone injected the string `'\n# b'`, then that would + // result in an ATX heading. + // We can’t escape characters in `inlineCode`, but because eols are + // transformed to spaces when going from markdown to HTML anyway, we can swap + // them out. + while (++index < state.unsafe.length) { + const pattern = state.unsafe[index] + const expression = state.compilePattern(pattern) + /** @type {RegExpExecArray | null} */ + let match + + // Only look for `atBreak`s. + // Btw: note that `atBreak` patterns will always start the regex at LF or + // CR. + if (!pattern.atBreak) continue + + while ((match = expression.exec(value))) { + let position = match.index + + // Support CRLF (patterns only look for one of the characters). + if ( + value.charCodeAt(position) === 10 /* `\n` */ && + value.charCodeAt(position - 1) === 13 /* `\r` */ + ) { + position-- + } + + value = value.slice(0, position) + ' ' + value.slice(match.index + 1) + } + } + + return sequence + value + sequence +} + +/** + * @returns {string} + */ +function inlineCodePeek() { + return '`' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e3994cf87eefb8a822f8222499e52408a991aad --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts @@ -0,0 +1,21 @@ +/** + * @param {LinkReference} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function linkReference(node: LinkReference, _: Parents | undefined, state: State, info: Info): string; +export namespace linkReference { + export { linkReferencePeek as peek }; +} +import type { LinkReference } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @returns {string} + */ +declare function linkReferencePeek(): string; +export {}; +//# sourceMappingURL=link-reference.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..79b2f880ee7d83e3a501097ab6595ef98cc32fa3 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"link-reference.d.ts","sourceRoot":"","sources":["link-reference.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,oCANW,aAAa,KACb,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA2ClB;;;;mCArDwC,OAAO;6BAAP,OAAO;2BADlB,wBAAwB;0BAAxB,wBAAwB;AAwDtD;;GAEG;AACH,sCAFa,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js new file mode 100644 index 0000000000000000000000000000000000000000..234d4797dd3e70bdcf9c08af11f741d6d1e27803 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js @@ -0,0 +1,63 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {LinkReference, Parents} from 'mdast' + */ + +linkReference.peek = linkReferencePeek + +/** + * @param {LinkReference} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function linkReference(node, _, state, info) { + const type = node.referenceType + const exit = state.enter('linkReference') + let subexit = state.enter('label') + const tracker = state.createTracker(info) + let value = tracker.move('[') + const text = state.containerPhrasing(node, { + before: value, + after: ']', + ...tracker.current() + }) + value += tracker.move(text + '][') + + subexit() + // Hide the fact that we’re in phrasing, because escapes don’t work. + const stack = state.stack + state.stack = [] + subexit = state.enter('reference') + // Note: for proper tracking, we should reset the output positions when we end + // up making a `shortcut` reference, because then there is no brace output. + // Practically, in that case, there is no content, so it doesn’t matter that + // we’ve tracked one too many characters. + const reference = state.safe(state.associationId(node), { + before: value, + after: ']', + ...tracker.current() + }) + subexit() + state.stack = stack + exit() + + if (type === 'full' || !text || text !== reference) { + value += tracker.move(reference + ']') + } else if (type === 'shortcut') { + // Remove the unwanted `[`. + value = value.slice(0, -1) + } else { + value += tracker.move(']') + } + + return value +} + +/** + * @returns {string} + */ +function linkReferencePeek() { + return '[' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5a1c6b1559ea7e42cc2db43312cf4990d759aab --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts @@ -0,0 +1,24 @@ +/** + * @param {Link} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function link(node: Link, _: Parents | undefined, state: State, info: Info): string; +export namespace link { + export { linkPeek as peek }; +} +import type { Link } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @param {Link} node + * @param {Parents | undefined} _ + * @param {State} state + * @returns {string} + */ +declare function linkPeek(node: Link, _: Parents | undefined, state: State): string; +export {}; +//# sourceMappingURL=link.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..68a4fcfb5f195b71b4325953fdf8540155aea85a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["link.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAuFlB;;;;0BArG+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB;AAwGtD;;;;;GAKG;AACH,gCALW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.js new file mode 100644 index 0000000000000000000000000000000000000000..69bd69e8c839b58924a7fa2bc9a3922299687c9a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/link.js @@ -0,0 +1,114 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Link, Parents} from 'mdast' + * @import {Exit} from '../types.js' + */ + +import {checkQuote} from '../util/check-quote.js' +import {formatLinkAsAutolink} from '../util/format-link-as-autolink.js' + +link.peek = linkPeek + +/** + * @param {Link} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function link(node, _, state, info) { + const quote = checkQuote(state) + const suffix = quote === '"' ? 'Quote' : 'Apostrophe' + const tracker = state.createTracker(info) + /** @type {Exit} */ + let exit + /** @type {Exit} */ + let subexit + + if (formatLinkAsAutolink(node, state)) { + // Hide the fact that we’re in phrasing, because escapes don’t work. + const stack = state.stack + state.stack = [] + exit = state.enter('autolink') + let value = tracker.move('<') + value += tracker.move( + state.containerPhrasing(node, { + before: value, + after: '>', + ...tracker.current() + }) + ) + value += tracker.move('>') + exit() + state.stack = stack + return value + } + + exit = state.enter('link') + subexit = state.enter('label') + let value = tracker.move('[') + value += tracker.move( + state.containerPhrasing(node, { + before: value, + after: '](', + ...tracker.current() + }) + ) + value += tracker.move('](') + subexit() + + if ( + // If there’s no url but there is a title… + (!node.url && node.title) || + // If there are control characters or whitespace. + /[\0- \u007F]/.test(node.url) + ) { + subexit = state.enter('destinationLiteral') + value += tracker.move('<') + value += tracker.move( + state.safe(node.url, {before: value, after: '>', ...tracker.current()}) + ) + value += tracker.move('>') + } else { + // No whitespace, raw is prettier. + subexit = state.enter('destinationRaw') + value += tracker.move( + state.safe(node.url, { + before: value, + after: node.title ? ' ' : ')', + ...tracker.current() + }) + ) + } + + subexit() + + if (node.title) { + subexit = state.enter(`title${suffix}`) + value += tracker.move(' ' + quote) + value += tracker.move( + state.safe(node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ) + value += tracker.move(quote) + subexit() + } + + value += tracker.move(')') + + exit() + return value +} + +/** + * @param {Link} node + * @param {Parents | undefined} _ + * @param {State} state + * @returns {string} + */ +function linkPeek(node, _, state) { + return formatLinkAsAutolink(node, state) ? '<' : '[' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9412afe9f20ff1c664017c04a0a7b482d7e67d1c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts @@ -0,0 +1,13 @@ +/** + * @param {ListItem} node + * @param {Parents | undefined} parent + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function listItem(node: ListItem, parent: Parents | undefined, state: State, info: Info): string; +import type { ListItem } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=list-item.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..094523215f86652b4d0e2e5998516d093fd22b6b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["list-item.js"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,+BANW,QAAQ,UACR,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAgDlB;8BA3DmC,OAAO;6BAAP,OAAO;2BADR,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.js new file mode 100644 index 0000000000000000000000000000000000000000..c830bbe2fa991b2db592d779c12a00bfcd11a56a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list-item.js @@ -0,0 +1,62 @@ +/** + * @import {Info, Map, State} from 'mdast-util-to-markdown' + * @import {ListItem, Parents} from 'mdast' + */ + +import {checkBullet} from '../util/check-bullet.js' +import {checkListItemIndent} from '../util/check-list-item-indent.js' + +/** + * @param {ListItem} node + * @param {Parents | undefined} parent + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function listItem(node, parent, state, info) { + const listItemIndent = checkListItemIndent(state) + let bullet = state.bulletCurrent || checkBullet(state) + + // Add the marker value for ordered lists. + if (parent && parent.type === 'list' && parent.ordered) { + bullet = + (typeof parent.start === 'number' && parent.start > -1 + ? parent.start + : 1) + + (state.options.incrementListMarker === false + ? 0 + : parent.children.indexOf(node)) + + bullet + } + + let size = bullet.length + 1 + + if ( + listItemIndent === 'tab' || + (listItemIndent === 'mixed' && + ((parent && parent.type === 'list' && parent.spread) || node.spread)) + ) { + size = Math.ceil(size / 4) * 4 + } + + const tracker = state.createTracker(info) + tracker.move(bullet + ' '.repeat(size - bullet.length)) + tracker.shift(size) + const exit = state.enter('listItem') + const value = state.indentLines( + state.containerFlow(node, tracker.current()), + map + ) + exit() + + return value + + /** @type {Map} */ + function map(line, index, blank) { + if (index) { + return (blank ? '' : ' '.repeat(size)) + line + } + + return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce02272b56f753014bd5e4c738db777a3f7c70c9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts @@ -0,0 +1,13 @@ +/** + * @param {List} node + * @param {Parents | undefined} parent + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function list(node: List, parent: Parents | undefined, state: State, info: Info): string; +import type { List } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=list.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b41524649fa285c717372442ce4ba00b7d9b39ac --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["list.js"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,2BANW,IAAI,UACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAoFlB;0BAjG+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.js new file mode 100644 index 0000000000000000000000000000000000000000..dac924cd20e5cac137248aacb54ac07d2426d792 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/list.js @@ -0,0 +1,100 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {List, Parents} from 'mdast' + */ + +import {checkBullet} from '../util/check-bullet.js' +import {checkBulletOther} from '../util/check-bullet-other.js' +import {checkBulletOrdered} from '../util/check-bullet-ordered.js' +import {checkRule} from '../util/check-rule.js' + +/** + * @param {List} node + * @param {Parents | undefined} parent + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function list(node, parent, state, info) { + const exit = state.enter('list') + const bulletCurrent = state.bulletCurrent + /** @type {string} */ + let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state) + /** @type {string} */ + const bulletOther = node.ordered + ? bullet === '.' + ? ')' + : '.' + : checkBulletOther(state) + let useDifferentMarker = + parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false + + if (!node.ordered) { + const firstListItem = node.children ? node.children[0] : undefined + + // If there’s an empty first list item directly in two list items, + // we have to use a different bullet: + // + // ```markdown + // * - * + // ``` + // + // …because otherwise it would become one big thematic break. + if ( + // Bullet could be used as a thematic break marker: + (bullet === '*' || bullet === '-') && + // Empty first list item: + firstListItem && + (!firstListItem.children || !firstListItem.children[0]) && + // Directly in two other list items: + state.stack[state.stack.length - 1] === 'list' && + state.stack[state.stack.length - 2] === 'listItem' && + state.stack[state.stack.length - 3] === 'list' && + state.stack[state.stack.length - 4] === 'listItem' && + // That are each the first child. + state.indexStack[state.indexStack.length - 1] === 0 && + state.indexStack[state.indexStack.length - 2] === 0 && + state.indexStack[state.indexStack.length - 3] === 0 + ) { + useDifferentMarker = true + } + + // If there’s a thematic break at the start of the first list item, + // we have to use a different bullet: + // + // ```markdown + // * --- + // ``` + // + // …because otherwise it would become one big thematic break. + if (checkRule(state) === bullet && firstListItem) { + let index = -1 + + while (++index < node.children.length) { + const item = node.children[index] + + if ( + item && + item.type === 'listItem' && + item.children && + item.children[0] && + item.children[0].type === 'thematicBreak' + ) { + useDifferentMarker = true + break + } + } + } + } + + if (useDifferentMarker) { + bullet = bulletOther + } + + state.bulletCurrent = bullet + const value = state.containerFlow(node, info) + state.bulletLastUsed = bullet + state.bulletCurrent = bulletCurrent + exit() + return value +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1491bb954d5b91f969ba64b4040f1d5395e64ac --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts @@ -0,0 +1,17 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Paragraph, Parents} from 'mdast' + */ +/** + * @param {Paragraph} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function paragraph(node: Paragraph, _: Parents | undefined, state: State, info: Info): string; +import type { Paragraph } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=paragraph.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ed2ab1c89330a045eb486074f84a8114ab44186e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["paragraph.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,gCANW,SAAS,KACT,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CASlB;+BAjBoC,OAAO;6BAAP,OAAO;2BADd,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js new file mode 100644 index 0000000000000000000000000000000000000000..18cf6303076bf60827021378dfee7be516562f53 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js @@ -0,0 +1,20 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Paragraph, Parents} from 'mdast' + */ + +/** + * @param {Paragraph} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function paragraph(node, _, state, info) { + const exit = state.enter('paragraph') + const subexit = state.enter('phrasing') + const value = state.containerPhrasing(node, info) + subexit() + exit() + return value +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f9c4b5539fda6ad85f091a306d826861ea4660b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts @@ -0,0 +1,13 @@ +/** + * @param {Root} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function root(node: Root, _: Parents | undefined, state: State, info: Info): string; +import type { Root } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=root.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f66a6a13c35a55cf73f9a7f876b3b213c6c45cce --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["root.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAUlB;0BApB+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.js new file mode 100644 index 0000000000000000000000000000000000000000..8bbc78a70f446588cd19d86843dd68c8501a18b3 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/root.js @@ -0,0 +1,23 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Parents, Root} from 'mdast' + */ + +import {phrasing} from 'mdast-util-phrasing' + +/** + * @param {Root} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function root(node, _, state, info) { + // Note: `html` nodes are ambiguous. + const hasPhrasing = node.children.some(function (d) { + return phrasing(d) + }) + + const container = hasPhrasing ? state.containerPhrasing : state.containerFlow + return container.call(state, node, info) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..312617d98c2aadab76bcf937e8509953a8ae065d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts @@ -0,0 +1,24 @@ +/** + * @param {Strong} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function strong(node: Strong, _: Parents | undefined, state: State, info: Info): string; +export namespace strong { + export { strongPeek as peek }; +} +import type { Strong } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +/** + * @param {Strong} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +declare function strongPeek(_: Strong, _1: Parents | undefined, state: State): string; +export {}; +//# sourceMappingURL=strong.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4843bda372b658d9a469286cbf68e91b9a2a203e --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"strong.d.ts","sourceRoot":"","sources":["strong.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,6BANW,MAAM,KACN,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA0ClB;;;;4BAxDiC,OAAO;6BAAP,OAAO;2BADX,wBAAwB;0BAAxB,wBAAwB;AA2DtD;;;;;GAKG;AACH,+BALW,MAAM,MACN,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.js new file mode 100644 index 0000000000000000000000000000000000000000..475d5f78b9373ce400c36bdbb0fe8a9374249ef1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/strong.js @@ -0,0 +1,69 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Parents, Strong} from 'mdast' + */ + +import {checkStrong} from '../util/check-strong.js' +import {encodeCharacterReference} from '../util/encode-character-reference.js' +import {encodeInfo} from '../util/encode-info.js' + +strong.peek = strongPeek + +/** + * @param {Strong} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function strong(node, _, state, info) { + const marker = checkStrong(state) + const exit = state.enter('strong') + const tracker = state.createTracker(info) + const before = tracker.move(marker + marker) + + let between = tracker.move( + state.containerPhrasing(node, { + after: marker, + before, + ...tracker.current() + }) + ) + const betweenHead = between.charCodeAt(0) + const open = encodeInfo( + info.before.charCodeAt(info.before.length - 1), + betweenHead, + marker + ) + + if (open.inside) { + between = encodeCharacterReference(betweenHead) + between.slice(1) + } + + const betweenTail = between.charCodeAt(between.length - 1) + const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker) + + if (close.inside) { + between = between.slice(0, -1) + encodeCharacterReference(betweenTail) + } + + const after = tracker.move(marker + marker) + + exit() + + state.attentionEncodeSurroundingInfo = { + after: close.outside, + before: open.outside + } + return before + between + after +} + +/** + * @param {Strong} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +function strongPeek(_, _1, state) { + return state.options.strong || '*' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9436fdedeb7a4644e7e7349adfc2de425bdd423c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts @@ -0,0 +1,17 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Parents, Text} from 'mdast' + */ +/** + * @param {Text} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function text(node: Text, _: Parents | undefined, state: State, info: Info): string; +import type { Text } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=text.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..03d0737c8a634999feeeb56c7cc6f453d12d1732 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAIlB;0BAZ+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.js new file mode 100644 index 0000000000000000000000000000000000000000..8f463e0720741a986eab5baa22d89d993cb7ec46 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/text.js @@ -0,0 +1,15 @@ +/** + * @import {Info, State} from 'mdast-util-to-markdown' + * @import {Parents, Text} from 'mdast' + */ + +/** + * @param {Text} node + * @param {Parents | undefined} _ + * @param {State} state + * @param {Info} info + * @returns {string} + */ +export function text(node, _, state, info) { + return state.safe(node.value, info) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4aecfd151d37f4ca6a5951eec5c5ce3c0c61b9b2 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts @@ -0,0 +1,11 @@ +/** + * @param {ThematicBreak} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +export function thematicBreak(_: ThematicBreak, _1: Parents | undefined, state: State): string; +import type { ThematicBreak } from 'mdast'; +import type { Parents } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +//# sourceMappingURL=thematic-break.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8bd69c99f3e2e48ff07e14430fbd55fb1b8d00e8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"thematic-break.d.ts","sourceRoot":"","sources":["thematic-break.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,iCALW,aAAa,MACb,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAQlB;mCAlBwC,OAAO;6BAAP,OAAO;2BADxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js new file mode 100644 index 0000000000000000000000000000000000000000..9707b5fab2a7712ad9f272a9e409546b16b556be --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js @@ -0,0 +1,21 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {Parents, ThematicBreak} from 'mdast' + */ + +import {checkRuleRepetition} from '../util/check-rule-repetition.js' +import {checkRule} from '../util/check-rule.js' + +/** + * @param {ThematicBreak} _ + * @param {Parents | undefined} _1 + * @param {State} state + * @returns {string} + */ +export function thematicBreak(_, _1, state) { + const value = ( + checkRule(state) + (state.options.ruleSpaces ? ' ' : '') + ).repeat(checkRuleRepetition(state)) + + return state.options.ruleSpaces ? value.slice(0, -1) : value +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..612aad88c0c4209e0301d64a65e1e90e2664714a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts @@ -0,0 +1,14 @@ +/** + * Turn an mdast syntax tree into markdown. + * + * @param {Nodes} tree + * Tree to serialize. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Serialized markdown representing `tree`. + */ +export function toMarkdown(tree: Nodes, options?: Options | null | undefined): string; +import type { Nodes } from 'mdast'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8c1bbee4252cd578fc89c51134c44c21a43616c9 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,iCAPW,KAAK,YAEL,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,MAAM,CAoElB;2BA5FuB,OAAO;6BAD0B,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/index.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3154b31be4cd40dee5a2e8e5e0c11d51d9c65c31 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/index.js @@ -0,0 +1,187 @@ +/** + * @import {Info, Join, Options, SafeConfig, State} from 'mdast-util-to-markdown' + * @import {Nodes} from 'mdast' + * @import {Enter, FlowParents, PhrasingParents, TrackFields} from './types.js' + */ + +import {zwitch} from 'zwitch' +import {configure} from './configure.js' +import {handle as handlers} from './handle/index.js' +import {join} from './join.js' +import {unsafe} from './unsafe.js' +import {association} from './util/association.js' +import {compilePattern} from './util/compile-pattern.js' +import {containerPhrasing} from './util/container-phrasing.js' +import {containerFlow} from './util/container-flow.js' +import {indentLines} from './util/indent-lines.js' +import {safe} from './util/safe.js' +import {track} from './util/track.js' + +/** + * Turn an mdast syntax tree into markdown. + * + * @param {Nodes} tree + * Tree to serialize. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Serialized markdown representing `tree`. + */ +export function toMarkdown(tree, options) { + const settings = options || {} + /** @type {State} */ + const state = { + associationId: association, + containerPhrasing: containerPhrasingBound, + containerFlow: containerFlowBound, + createTracker: track, + compilePattern, + enter, + // @ts-expect-error: GFM / frontmatter are typed in `mdast` but not defined + // here. + handlers: {...handlers}, + // @ts-expect-error: add `handle` in a second. + handle: undefined, + indentLines, + indexStack: [], + join: [...join], + options: {}, + safe: safeBound, + stack: [], + unsafe: [...unsafe] + } + + configure(state, settings) + + if (state.options.tightDefinitions) { + state.join.push(joinDefinition) + } + + state.handle = zwitch('type', { + invalid, + unknown, + handlers: state.handlers + }) + + let result = state.handle(tree, undefined, state, { + before: '\n', + after: '\n', + now: {line: 1, column: 1}, + lineShift: 0 + }) + + if ( + result && + result.charCodeAt(result.length - 1) !== 10 && + result.charCodeAt(result.length - 1) !== 13 + ) { + result += '\n' + } + + return result + + /** @type {Enter} */ + function enter(name) { + state.stack.push(name) + return exit + + /** + * @returns {undefined} + */ + function exit() { + state.stack.pop() + } + } +} + +/** + * @param {unknown} value + * @returns {never} + */ +function invalid(value) { + throw new Error('Cannot handle value `' + value + '`, expected node') +} + +/** + * @param {unknown} value + * @returns {never} + */ +function unknown(value) { + // Always a node. + const node = /** @type {Nodes} */ (value) + throw new Error('Cannot handle unknown node `' + node.type + '`') +} + +/** @type {Join} */ +function joinDefinition(left, right) { + // No blank line between adjacent definitions. + if (left.type === 'definition' && left.type === right.type) { + return 0 + } +} + +/** + * Serialize the children of a parent that contains phrasing children. + * + * These children will be joined flush together. + * + * @this {State} + * Info passed around about the current state. + * @param {PhrasingParents} parent + * Parent of flow nodes. + * @param {Info} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined together. + */ +function containerPhrasingBound(parent, info) { + return containerPhrasing(parent, this, info) +} + +/** + * Serialize the children of a parent that contains flow children. + * + * These children will typically be joined by blank lines. + * What they are joined by exactly is defined by `Join` functions. + * + * @this {State} + * Info passed around about the current state. + * @param {FlowParents} parent + * Parent of flow nodes. + * @param {TrackFields} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined by (blank) lines. + */ +function containerFlowBound(parent, info) { + return containerFlow(parent, this, info) +} + +/** + * Make a string safe for embedding in markdown constructs. + * + * In markdown, almost all punctuation characters can, in certain cases, + * result in something. + * Whether they do is highly subjective to where they happen and in what + * they happen. + * + * To solve this, `mdast-util-to-markdown` tracks: + * + * * Characters before and after something; + * * What “constructs” we are in. + * + * This information is then used by this function to escape or encode + * special characters. + * + * @this {State} + * Info passed around about the current state. + * @param {string | null | undefined} value + * Raw value to make safe. + * @param {SafeConfig} config + * Configuration. + * @returns {string} + * Serialized markdown safe for embedding. + */ +function safeBound(value, config) { + return safe(this, value, config) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26785771b692e02aee5d3a1a9944d9c650504960 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts @@ -0,0 +1,4 @@ +/** @type {Array} */ +export const join: Array; +import type { Join } from 'mdast-util-to-markdown'; +//# sourceMappingURL=join.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..cd8028b8167b4a9992f4f578bcbcad391cc3c4e1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["join.js"],"names":[],"mappings":"AAOA,0BAA0B;AAC1B,mBADW,KAAK,CAAC,IAAI,CAAC,CACY;0BAPX,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/join.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.js new file mode 100644 index 0000000000000000000000000000000000000000..371addb1859dc292cfb840b7daf17f90e5f60fc6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/join.js @@ -0,0 +1,39 @@ +/** + * @import {Join} from 'mdast-util-to-markdown' + */ + +import {formatCodeAsIndented} from './util/format-code-as-indented.js' +import {formatHeadingAsSetext} from './util/format-heading-as-setext.js' + +/** @type {Array} */ +export const join = [joinDefaults] + +/** @type {Join} */ +function joinDefaults(left, right, parent, state) { + // Indented code after list or another indented code. + if ( + right.type === 'code' && + formatCodeAsIndented(right, state) && + (left.type === 'list' || + (left.type === right.type && formatCodeAsIndented(left, state))) + ) { + return false + } + + // Join children of a list or an item. + // In which case, `parent` has a `spread` field. + if ('spread' in parent && typeof parent.spread === 'boolean') { + if ( + left.type === 'paragraph' && + // Two paragraphs. + (left.type === right.type || + right.type === 'definition' || + // Paragraph followed by a setext heading. + (right.type === 'heading' && formatHeadingAsSetext(right, state))) + ) { + return + } + + return parent.spread ? 1 : 0 + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/types.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4cf0157a1884ecde170ffdb652c48f13b61b8506 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/types.d.ts @@ -0,0 +1,965 @@ +import type { + Parents, + PhrasingContent, + TableCell, + TableRow, + Association, + Nodes +} from 'mdast' +import type {Point} from 'unist' + +/** + * Get an identifier from an association to match it to others. + * + * Associations are nodes that match to something else through an ID: + * . + * + * The `label` of an association is the string value: character escapes and + * references work, and casing is intact. + * The `identifier` is used to match one association to another: + * controversially, character escapes and references don’t work in this + * matching: `©` does not match `©`, and `\+` does not match `+`. + * + * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb` + * matches `a b`. + * So, we do prefer the label when figuring out how we’re going to serialize: + * it has whitespace, casing, and we can ignore most useless character + * escapes and all character references. + * + * @param node + * Node that includes an association. + * @returns + * ID. + */ +export type AssociationId = (node: Association) => string + +/** + * Compile an unsafe pattern to a regex. + * + * @param info + * Pattern. + * @returns + * Regex. + */ +export type CompilePattern = (info: Unsafe) => RegExp + +/** + * Interface of registered constructs. + * + * When working on extensions that use new constructs, extend the corresponding + * interface to register its name: + * + * ```ts + * declare module 'mdast-util-to-markdown' { + * interface ConstructNameMap { + * // Register a new construct name (value is used, key should match it). + * gfmStrikethrough: 'gfmStrikethrough' + * } + * } + * ``` + */ +export interface ConstructNameMap { + /** + * Whole autolink. + * + * ```markdown + * > | and + * ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ + * ``` + */ + autolink: 'autolink' + /** + * Whole block quote. + * + * ```markdown + * > | > a + * ^^^ + * > | b + * ^ + * ``` + */ + blockquote: 'blockquote' + /** + * Whole code (indented). + * + * ```markdown + * ␠␠␠␠console.log(1) + * ^^^^^^^^^^^^^^^^^^ + * ``` + */ + codeIndented: 'codeIndented' + /** + * Whole code (fenced). + * + * ````markdown + * > | ```js + * ^^^^^ + * > | console.log(1) + * ^^^^^^^^^^^^^^ + * > | ``` + * ^^^ + * ```` + */ + codeFenced: 'codeFenced' + /** + * Code (fenced) language, when fenced with grave accents. + * + * ````markdown + * > | ```js + * ^^ + * | console.log(1) + * | ``` + * ```` + */ + codeFencedLangGraveAccent: 'codeFencedLangGraveAccent' + /** + * Code (fenced) language, when fenced with tildes. + * + * ````markdown + * > | ~~~js + * ^^ + * | console.log(1) + * | ~~~ + * ```` + */ + codeFencedLangTilde: 'codeFencedLangTilde' + /** + * Code (fenced) meta string, when fenced with grave accents. + * + * ````markdown + * > | ```js eval + * ^^^^ + * | console.log(1) + * | ``` + * ```` + */ + codeFencedMetaGraveAccent: 'codeFencedMetaGraveAccent' + /** + * Code (fenced) meta string, when fenced with tildes. + * + * ````markdown + * > | ~~~js eval + * ^^^^ + * | console.log(1) + * | ~~~ + * ```` + */ + codeFencedMetaTilde: 'codeFencedMetaTilde' + /** + * Whole definition. + * + * ```markdown + * > | [a]: b "c" + * ^^^^^^^^^^ + * ``` + */ + definition: 'definition' + /** + * Destination (literal) (occurs in definition, image, link). + * + * ```markdown + * > | [a]: "c" + * ^^^ + * > | a ![b]( "d") e + * ^^^ + * ``` + */ + destinationLiteral: 'destinationLiteral' + /** + * Destination (raw) (occurs in definition, image, link). + * + * ```markdown + * > | [a]: b "c" + * ^ + * > | a ![b](c "d") e + * ^ + * ``` + */ + destinationRaw: 'destinationRaw' + /** + * Emphasis. + * + * ```markdown + * > | *a* + * ^^^ + * ``` + */ + emphasis: 'emphasis' + /** + * Whole heading (atx). + * + * ```markdown + * > | # alpha + * ^^^^^^^ + * ``` + */ + headingAtx: 'headingAtx' + /** + * Whole heading (setext). + * + * ```markdown + * > | alpha + * ^^^^^ + * > | ===== + * ^^^^^ + * ``` + */ + headingSetext: 'headingSetext' + /** + * Whole image. + * + * ```markdown + * > | ![a](b) + * ^^^^^^^ + * > | ![c] + * ^^^^ + * ``` + */ + image: 'image' + /** + * Whole image reference. + * + * ```markdown + * > | ![a] + * ^^^^ + * ``` + */ + imageReference: 'imageReference' + /** + * Label (occurs in definitions, image reference, image, link reference, + * link). + * + * ```markdown + * > | [a]: b "c" + * ^^^ + * > | a [b] c + * ^^^ + * > | a ![b][c] d + * ^^^^ + * > | a [b](c) d + * ^^^ + * ``` + */ + label: 'label' + /** + * Whole link. + * + * ```markdown + * > | [a](b) + * ^^^^^^ + * > | [c] + * ^^^ + * ``` + */ + link: 'link' + /** + * Whole link reference. + * + * ```markdown + * > | [a] + * ^^^ + * ``` + */ + linkReference: 'linkReference' + /** + * List. + * + * ```markdown + * > | * a + * ^^^ + * > | 1. b + * ^^^^ + * ``` + */ + list: 'list' + /** + * List item. + * + * ```markdown + * > | * a + * ^^^ + * > | 1. b + * ^^^^ + * ``` + */ + listItem: 'listItem' + /** + * Paragraph. + * + * ```markdown + * > | a b + * ^^^ + * > | c. + * ^^ + * ``` + */ + paragraph: 'paragraph' + /** + * Phrasing (occurs in headings, paragraphs, etc). + * + * ```markdown + * > | a + * ^ + * ``` + */ + phrasing: 'phrasing' + /** + * Reference (occurs in image, link). + * + * ```markdown + * > | [a][] + * ^^ + * ``` + */ + reference: 'reference' + /** + * Strong. + * + * ```markdown + * > | **a** + * ^^^^^ + * ``` + */ + strong: 'strong' + /** + * Title using single quotes (occurs in definition, image, link). + * + * ```markdown + * > | [a](b 'c') + * ^^^ + * ``` + */ + titleApostrophe: 'titleApostrophe' + /** + * Title using double quotes (occurs in definition, image, link). + * + * ```markdown + * > | [a](b "c") + * ^^^ + * ``` + */ + titleQuote: 'titleQuote' +} + +/** + * Construct names for things generated by `mdast-util-to-markdown`. + * + * This is an enum of strings, each being a semantic label, useful to know when + * serializing whether we’re for example in a double (`"`) or single (`'`) + * quoted title. + */ +export type ConstructName = ConstructNameMap[keyof ConstructNameMap] + +/** + * Serialize the children of a parent that contains flow children. + * + * These children will typically be joined by blank lines. + * What they are joined by exactly is defined by `Join` functions. + * + * @param parent + * Parent of flow nodes. + * @param info + * Info on where we are in the document we are generating. + * @returns + * Serialized children, joined by (blank) lines. + */ +export type ContainerFlow = (parent: FlowParents, info: TrackFields) => string + +/** + * Serialize the children of a parent that contains phrasing children. + * + * These children will be joined flush together. + * + * @param parent + * Parent of phrasing nodes. + * @param info + * Info on where we are in the document we are generating. + * @returns + * Serialized children, joined together. + */ +export type ContainerPhrasing = (parent: PhrasingParents, info: Info) => string + +/** + * Track positional info in the output. + * + * This info isn’t used yet but such functionality will allow line wrapping, + * source maps, etc. + * + * @param info + * Info on where we are in the document we are generating. + * @returns + * Tracker. + */ +export type CreateTracker = (info: TrackFields) => Tracker + +/** + * Whether to encode things — with fields representing the surrounding of a + * whole. + */ +export interface EncodeSurrounding { + /** + * Whether to encode after. + */ + after: boolean + + /** + * Whether to encode before. + */ + before: boolean +} + +/** + * Whether to encode things — with fields representing the relationship to a + * whole. + */ +export interface EncodeSides { + /** + * Whether to encode inside. + */ + inside: boolean + + /** + * Whether to encode before. + */ + outside: boolean +} + +/** + * Enter something. + * + * @param name + * Label, more similar to a micromark event than an mdast node type. + * @returns + * Revert. + */ +export type Enter = (name: ConstructName) => Exit + +/** + * Exit something. + * + * @returns + * Nothing. + */ +export type Exit = () => undefined + +/** + * Children of flow nodes. + */ +export type FlowChildren = FlowParents extends { + children: Array +} + ? T + : never + +/** + * Parents that are not phrasing, + * or similar. + */ +export type FlowParents = Exclude< + Parents, + PhrasingContent | TableCell | TableRow +> + +/** + * Handle particular nodes. + * + * Each key is a node type, each value its corresponding handler. + */ +export type Handlers = Record + +/** + * Handle a particular node. + * + * @param node + * Expected mdast node. + * @param parent + * Parent of `node`. + * @param state + * Info passed around about the current state. + * @param Info + * Info on the surrounding of the node that is serialized. + * @returns + * Serialized markdown representing `node`. + */ +export type Handle = ( + node: any, + parent: Parents | undefined, + state: State, + Info: Info +) => string + +/** + * Pad serialized markdown. + * + * @param value + * Whole fragment of serialized markdown. + * @param map + * Map function. + * @returns + * Padded value. + */ +export type IndentLines = (value: string, map: Map) => string + +/** + * Info on the surrounding of the node that is serialized. + */ +export interface Info extends SafeFields, TrackFields {} + +/** + * How to join two blocks. + * + * “Blocks” are typically joined by one blank line. + * Sometimes it’s nicer to have them flush next to each other, yet other + * times they cannot occur together at all. + * + * Join functions receive two adjacent siblings and their parent and what + * they return defines how many blank lines to use between them. + * + * @param left + * First of two adjacent siblings. + * @param right + * Second of two adjacent siblings. + * @param parent + * Parent of the two siblings. + * @param state + * Info passed around about the current state. + * @returns + * How many blank lines to use between the siblings. + * + * Where `true` is as passing `1` and `false` means the nodes cannot be + * joined by a blank line, such as two adjacent block quotes or indented code + * after a list, in which case a comment will be injected to break them up: + * + * ```markdown + * > Quote 1 + * + * + * + * > Quote 2 + * ``` + * + * > 👉 **Note**: abusing this feature will break markdown. + * > One such example is when returning `0` for two paragraphs, which will + * > result in the text running together, and in the future to be seen as + * > one paragraph. + */ +export type Join = ( + left: FlowChildren, + right: FlowChildren, + parent: FlowParents, + state: State +) => boolean | number | null | undefined | void + +/** + * Map function to pad a single line. + * + * @param value + * A single line of serialized markdown. + * @param line + * Line number relative to the fragment. + * @param blank + * Whether the line is considered blank in markdown. + * @returns + * Padded line. + */ +export type Map = (value: string, line: number, blank: boolean) => string + +/** + * Configuration (optional). + */ +export interface Options { + /** + * Marker to use in certain cases where the primary bullet doesn’t work + * (default: `'-'` when `bullet` is `'*'`, `'*'` otherwise). + * + * Cannot be equal to `bullet`. + */ + bulletOther?: '*' | '+' | '-' | null | undefined + /** + * Marker to use for bullets of items in ordered lists (default: `'.'`). + * + * There is one case where the primary bullet for ordered items cannot be + * used: + * + * * when two ordered lists appear next to each other: `1. a\n2) b`; to + * solve + * that, `'.'` will be used when `bulletOrdered` is `')'`, and `'.'` + * otherwise + */ + bulletOrdered?: '.' | ')' | null | undefined + /** + * Marker to use for bullets of items in unordered lists (default: `'*'`). + * + * There are three cases where the primary bullet cannot be used: + * + * * when three or more list items are on their own, the last one is empty, + * and `bullet` is also a valid `rule`: `* - +`; this would turn into a + * thematic break if serialized with three primary bullets; `bulletOther` + * is used for the last item + * * when a thematic break is the first child of a list item and `bullet` is + * the same character as `rule`: `- ***`; this would turn into a single + * thematic break if serialized with primary bullets; `bulletOther` is used + * for the item + * * when two unordered lists appear next to each other: `* a\n- b`; + * `bulletOther` is used for such lists + */ + bullet?: '*' | '+' | '-' | null | undefined + /** + * Whether to add the same number of number signs (`#`) at the end of an ATX + * heading as the opening sequence (default: `false`). + */ + closeAtx?: boolean | null | undefined + /** + * Marker to use for emphasis (default: `'*'`). + */ + emphasis?: '*' | '_' | null | undefined + /** + * List of extensions to include (optional). + * + * Each `ToMarkdownExtension` is an object with the same interface as + * `Options` here. + */ + extensions?: Array | null | undefined + /** + * Whether to use fenced code always (default: `true`). + * + * The default is to use fenced code if there is a language defined, if the + * code is empty, or if it starts or ends in blank lines. + */ + fences?: boolean | null | undefined + /** + * Marker to use for fenced code (default: ``'`'``). + */ + fence?: '`' | '~' | null | undefined + /** + * Handle particular nodes (optional). + * + * Each key is a node type, each value its corresponding handler. + */ + handlers?: Partial | null | undefined + /** + * Whether to increment the counter of ordered lists items (default: `true`). + */ + incrementListMarker?: boolean | null | undefined + /** + * How to join blocks (optional). + */ + join?: Array | null | undefined + /** + * How to indent the content of list items (default: `'one'`). + * + * Either with the size of the bullet plus one space (when `'one'`), a tab + * stop (`'tab'`), or depending on the item and its parent list (`'mixed'`, + * uses `'one'` if the item and list are tight and `'tab'` otherwise). + */ + listItemIndent?: 'mixed' | 'one' | 'tab' | null | undefined + /** + * Marker to use for titles (default: `'"'`). + */ + quote?: '"' | "'" | null | undefined + /** + * Whether to always use resource links (default: `false`). + * + * The default is to use autolinks (``) when possible + * and resource links (`[text](url)`) otherwise. + */ + resourceLink?: boolean | null | undefined + /** + * Number of markers to use for thematic breaks (default: `3`). + */ + ruleRepetition?: number | null | undefined + /** + * Whether to add spaces between markers in thematic breaks (default: + * `false`). + */ + ruleSpaces?: boolean | null | undefined + /** + * Marker to use for thematic breaks (default: `'*'`). + */ + rule?: '*' | '-' | '_' | null | undefined + /** + * Whether to use setext headings when possible (default: `false`). + * + * The default is to always use ATX headings (`# heading`) instead of setext + * headings (`heading\n=======`). + * Setext headings cannot be used for empty headings or headings with a rank + * of three or more. + */ + setext?: boolean | null | undefined + /** + * Marker to use for strong (default: `'*'`). + */ + strong?: '*' | '_' | null | undefined + /** + * Whether to join definitions without a blank line (default: `false`). + * + * The default is to add blank lines between any flow (“block”) construct. + * Turning this option on is a shortcut for a join function like so: + * + * ```js + * function joinTightDefinitions(left, right) { + * if (left.type === 'definition' && right.type === 'definition') { + * return 0 + * } + * } + * ``` + */ + tightDefinitions?: boolean | null | undefined + /** + * Schemas that define when characters cannot occur (optional). + */ + unsafe?: Array | null | undefined +} + +/** + * Parent of phrasing nodes. + */ +export type PhrasingParents = Parents extends { + children: Array +} + ? PhrasingContent extends T + ? Parents + : never + : never + +/** + * Configuration for `safe` + */ +export interface SafeConfig extends SafeFields { + /** + * Extra characters that *must* be encoded (as character references) instead + * of escaped (character escapes) (optional). + * + * Only ASCII punctuation will use character escapes, so you never need to + * pass non-ASCII-punctuation here. + */ + encode?: Array | null | undefined +} + +/** + * Info on the characters that are around the current thing we are generating. + */ +export interface SafeFields { + /** + * Characters after this (guaranteed to be one, can be more). + */ + after: string + /** + * Characters before this (guaranteed to be one, can be more). + */ + before: string +} + +/** + * Make a string safe for embedding in markdown constructs. + * + * In markdown, almost all punctuation characters can, in certain cases, + * result in something. + * Whether they do is highly subjective to where they happen and in what + * they happen. + * + * To solve this, `mdast-util-to-markdown` tracks: + * + * * Characters before and after something; + * * What “constructs” we are in. + * + * This information is then used by this function to escape or encode + * special characters. + * + * @param input + * Raw value to make safe. + * @param config + * Configuration. + * @returns + * Serialized markdown safe for embedding. + */ +export type Safe = ( + input: string | null | undefined, + config: SafeConfig +) => string + +/** + * Info passed around about the current state. + */ +export interface State { + /** + * Get an identifier from an association to match it to others. + */ + associationId: AssociationId + /** + * Info on whether to encode the surrounding of *attention*. + * + * Whether attention (emphasis, strong, strikethrough) forms + * depends on the characters inside and outside them. + * The characters inside can be handled by *attention* itself. + * However the outside characters are already handled. + * Or handled afterwards. + * This field can be used to signal from *attention* that some parent + * function (practically `containerPhrasing`) has to handle the surrounding. + */ + attentionEncodeSurroundingInfo: EncodeSurrounding | undefined + /** + * List marker currently in use. + */ + bulletCurrent: string | undefined + /** + * List marker previously in use. + */ + bulletLastUsed: string | undefined + /** + * Compile an unsafe pattern to a regex. + */ + compilePattern: CompilePattern + /** + * Serialize the children of a parent that contains phrasing children. + */ + containerPhrasing: ContainerPhrasing + /** + * Serialize the children of a parent that contains flow children. + */ + containerFlow: ContainerFlow + /** + * Track positional info in the output. + */ + createTracker: CreateTracker + /** + * Enter a construct (returns a corresponding exit function). + */ + enter: Enter + /** + * Applied handlers. + */ + handlers: Handlers + /** + * Call the configured handler for the given node. + */ + handle: Handle + /** + * Pad serialized markdown. + */ + indentLines: IndentLines + /** + * Positions of child nodes in their parents. + */ + indexStack: Array + /** + * Applied join handlers. + */ + join: Array + /** + * Applied user configuration. + */ + options: Options + /** + * Serialize the children of a parent that contains flow children. + */ + safe: Safe + /** + * Stack of constructs we’re in. + */ + stack: Array + /** + * Applied unsafe patterns. + */ + unsafe: Array +} + +/** + * Get current tracked info. + * + * @returns + * Current tracked info. + */ +export type TrackCurrent = () => TrackFields + +/** + * Info on where we are in the document we are generating. + */ +export interface TrackFields { + /** + * Number of columns each line will be shifted by wrapping nodes. + */ + lineShift: number + /** + * Current point. + */ + now: Point +} + +/** + * Move past some generated markdown. + * + * @param value + * Generated markdown. + * @returns + * Given markdown. + */ +export type TrackMove = (value: string | null | undefined) => string + +/** + * Define a relative increased line shift (the typical indent for lines). + * + * @param value + * Relative increment in how much each line will be padded. + * @returns + * Nothing. + */ +export type TrackShift = (value: number) => undefined + +/** + * Track positional info in the output. + * + * This info isn’t used yet but such functionality will allow line wrapping, + * source maps, etc. + */ +export interface Tracker { + /** + * Get the current tracked info. + */ + current: TrackCurrent + /** + * Move past some generated markdown. + */ + move: TrackMove + /** + * Define an increased line shift (the typical indent for lines). + */ + shift: TrackShift +} + +/** + * Schema that defines when a character cannot occur. + */ +export interface Unsafe { + /** + * The unsafe pattern (this whole object) compiled as a regex (do not use). + * + * This is internal and must not be defined. + */ + _compiled?: RegExp | null | undefined + /** + * `character` is bad when this is after it (optional). + */ + after?: string | null | undefined + /** + * `character` is bad at a break (cannot be used together with `before`) (optional). + */ + atBreak?: boolean | null | undefined + /** + * `character` is bad when this is before it (cannot be used together with + * `atBreak`) (optional). + */ + before?: string | null | undefined + /** + * Single unsafe character. + */ + character: string + /** + * Constructs where this is bad (optional). + */ + inConstruct?: Array | ConstructName | null | undefined + /** + * Constructs where this is fine again (optional). + */ + notInConstruct?: Array | ConstructName | null | undefined +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/types.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c172e67f95bf21d4668a3f572002ea2e5aeb9466 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/types.js @@ -0,0 +1,2 @@ +// Note: types exposed from `types.d.ts`. +export {} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ddd270c85d40ec7b1ca76afc8e55294efd900d0b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts @@ -0,0 +1,4 @@ +/** @type {Array} */ +export const unsafe: Array; +import type { Unsafe } from 'mdast-util-to-markdown'; +//# sourceMappingURL=unsafe.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f39869b2a62e71a4cc05ba1fc0c48e9ae603fa20 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"unsafe.d.ts","sourceRoot":"","sources":["unsafe.js"],"names":[],"mappings":"AAqBA,4BAA4B;AAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CA4HvB;4BAhJuC,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.js new file mode 100644 index 0000000000000000000000000000000000000000..c5c5d4a12ad91e8e15c5fcb0dedf1d376bebfeb6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/unsafe.js @@ -0,0 +1,146 @@ +/** + * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown' + */ + +/** + * List of constructs that occur in phrasing (paragraphs, headings), but cannot + * contain things like attention (emphasis, strong), images, or links. + * So they sort of cancel each other out. + * Note: could use a better name. + * + * @type {Array} + */ +const fullPhrasingSpans = [ + 'autolink', + 'destinationLiteral', + 'destinationRaw', + 'reference', + 'titleQuote', + 'titleApostrophe' +] + +/** @type {Array} */ +export const unsafe = [ + {character: '\t', after: '[\\r\\n]', inConstruct: 'phrasing'}, + {character: '\t', before: '[\\r\\n]', inConstruct: 'phrasing'}, + { + character: '\t', + inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde'] + }, + { + character: '\r', + inConstruct: [ + 'codeFencedLangGraveAccent', + 'codeFencedLangTilde', + 'codeFencedMetaGraveAccent', + 'codeFencedMetaTilde', + 'destinationLiteral', + 'headingAtx' + ] + }, + { + character: '\n', + inConstruct: [ + 'codeFencedLangGraveAccent', + 'codeFencedLangTilde', + 'codeFencedMetaGraveAccent', + 'codeFencedMetaTilde', + 'destinationLiteral', + 'headingAtx' + ] + }, + {character: ' ', after: '[\\r\\n]', inConstruct: 'phrasing'}, + {character: ' ', before: '[\\r\\n]', inConstruct: 'phrasing'}, + { + character: ' ', + inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde'] + }, + // An exclamation mark can start an image, if it is followed by a link or + // a link reference. + { + character: '!', + after: '\\[', + inConstruct: 'phrasing', + notInConstruct: fullPhrasingSpans + }, + // A quote can break out of a title. + {character: '"', inConstruct: 'titleQuote'}, + // A number sign could start an ATX heading if it starts a line. + {atBreak: true, character: '#'}, + {character: '#', inConstruct: 'headingAtx', after: '(?:[\r\n]|$)'}, + // Dollar sign and percentage are not used in markdown. + // An ampersand could start a character reference. + {character: '&', after: '[#A-Za-z]', inConstruct: 'phrasing'}, + // An apostrophe can break out of a title. + {character: "'", inConstruct: 'titleApostrophe'}, + // A left paren could break out of a destination raw. + {character: '(', inConstruct: 'destinationRaw'}, + // A left paren followed by `]` could make something into a link or image. + { + before: '\\]', + character: '(', + inConstruct: 'phrasing', + notInConstruct: fullPhrasingSpans + }, + // A right paren could start a list item or break out of a destination + // raw. + {atBreak: true, before: '\\d+', character: ')'}, + {character: ')', inConstruct: 'destinationRaw'}, + // An asterisk can start thematic breaks, list items, emphasis, strong. + {atBreak: true, character: '*', after: '(?:[ \t\r\n*])'}, + {character: '*', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans}, + // A plus sign could start a list item. + {atBreak: true, character: '+', after: '(?:[ \t\r\n])'}, + // A dash can start thematic breaks, list items, and setext heading + // underlines. + {atBreak: true, character: '-', after: '(?:[ \t\r\n-])'}, + // A dot could start a list item. + {atBreak: true, before: '\\d+', character: '.', after: '(?:[ \t\r\n]|$)'}, + // Slash, colon, and semicolon are not used in markdown for constructs. + // A less than can start html (flow or text) or an autolink. + // HTML could start with an exclamation mark (declaration, cdata, comment), + // slash (closing tag), question mark (instruction), or a letter (tag). + // An autolink also starts with a letter. + // Finally, it could break out of a destination literal. + {atBreak: true, character: '<', after: '[!/?A-Za-z]'}, + { + character: '<', + after: '[!/?A-Za-z]', + inConstruct: 'phrasing', + notInConstruct: fullPhrasingSpans + }, + {character: '<', inConstruct: 'destinationLiteral'}, + // An equals to can start setext heading underlines. + {atBreak: true, character: '='}, + // A greater than can start block quotes and it can break out of a + // destination literal. + {atBreak: true, character: '>'}, + {character: '>', inConstruct: 'destinationLiteral'}, + // Question mark and at sign are not used in markdown for constructs. + // A left bracket can start definitions, references, labels, + {atBreak: true, character: '['}, + {character: '[', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans}, + {character: '[', inConstruct: ['label', 'reference']}, + // A backslash can start an escape (when followed by punctuation) or a + // hard break (when followed by an eol). + // Note: typical escapes are handled in `safe`! + {character: '\\', after: '[\\r\\n]', inConstruct: 'phrasing'}, + // A right bracket can exit labels. + {character: ']', inConstruct: ['label', 'reference']}, + // Caret is not used in markdown for constructs. + // An underscore can start emphasis, strong, or a thematic break. + {atBreak: true, character: '_'}, + {character: '_', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans}, + // A grave accent can start code (fenced or text), or it can break out of + // a grave accent code fence. + {atBreak: true, character: '`'}, + { + character: '`', + inConstruct: ['codeFencedLangGraveAccent', 'codeFencedMetaGraveAccent'] + }, + {character: '`', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans}, + // Left brace, vertical bar, right brace are not used in markdown for + // constructs. + // A tilde can start code (fenced). + {atBreak: true, character: '~'} +] diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1169f5490ca168cc0a0ba207a0007d702fd48077 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts @@ -0,0 +1,2 @@ +export function association(node: import("mdast").Association): string; +//# sourceMappingURL=association.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ab4d0f6cc8d3767e1137a5e9f8d285927f89bdc2 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"association.d.ts","sourceRoot":"","sources":["association.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.js new file mode 100644 index 0000000000000000000000000000000000000000..cee08f4f4d3b59e593a38b0deff96eba51a6fbcf --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/association.js @@ -0,0 +1,33 @@ +/** + * @import {AssociationId} from '../types.js' + */ + +import {decodeString} from 'micromark-util-decode-string' + +/** + * Get an identifier from an association to match it to others. + * + * Associations are nodes that match to something else through an ID: + * . + * + * The `label` of an association is the string value: character escapes and + * references work, and casing is intact. + * The `identifier` is used to match one association to another: + * controversially, character escapes and references don’t work in this + * matching: `©` does not match `©`, and `\+` does not match `+`. + * + * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb` + * matches `a b`. + * So, we do prefer the label when figuring out how we’re going to serialize: + * it has whitespace, casing, and we can ignore most useless character + * escapes and all character references. + * + * @type {AssociationId} + */ +export function association(node) { + if (node.label || !node.identifier) { + return node.label || '' + } + + return decodeString(node.identifier) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e71a0a29bb72f6bb71f2a4b69505cf0a2b2c70d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBulletOrdered(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-bullet-ordered.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6fec81e03f8ae3d68ea11b41ec1a04362c966d2b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-bullet-ordered.d.ts","sourceRoot":"","sources":["check-bullet-ordered.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,0CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAc/D;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js new file mode 100644 index 0000000000000000000000000000000000000000..cdacbd85691e1e3bd092cca36349769e67fe38ed --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBulletOrdered(state) { + const marker = state.options.bulletOrdered || '.' + + if (marker !== '.' && marker !== ')') { + throw new Error( + 'Cannot serialize items with `' + + marker + + '` for `options.bulletOrdered`, expected `.` or `)`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..365374b3db66395773e34f96516693aa443232c1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts @@ -0,0 +1,8 @@ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBulletOther(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-bullet-other.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..09fabd3393eb7a807398d93e3de870f0c2429329 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-bullet-other.d.ts","sourceRoot":"","sources":["check-bullet-other.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CA6BxD;2BApCgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js new file mode 100644 index 0000000000000000000000000000000000000000..2e15fc8fee4d07e5d767eb4d5b397d933a1b59f8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js @@ -0,0 +1,38 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +import {checkBullet} from './check-bullet.js' + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBulletOther(state) { + const bullet = checkBullet(state) + const bulletOther = state.options.bulletOther + + if (!bulletOther) { + return bullet === '*' ? '-' : '*' + } + + if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') { + throw new Error( + 'Cannot serialize items with `' + + bulletOther + + '` for `options.bulletOther`, expected `*`, `+`, or `-`' + ) + } + + if (bulletOther === bullet) { + throw new Error( + 'Expected `bullet` (`' + + bullet + + '`) and `bulletOther` (`' + + bulletOther + + '`) to be different' + ) + } + + return bulletOther +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..63e27c4a087a1609e40b12da3231bc6216269e12 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBullet(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-bullet.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6c0526f59452292dce6bb3997b52493bcf58ed12 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-bullet.d.ts","sourceRoot":"","sources":["check-bullet.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,mCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcxD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js new file mode 100644 index 0000000000000000000000000000000000000000..f0e5b919710ba28224984485e32509597cecd750 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkBullet(state) { + const marker = state.options.bullet || '*' + + if (marker !== '*' && marker !== '+' && marker !== '-') { + throw new Error( + 'Cannot serialize items with `' + + marker + + '` for `options.bullet`, expected `*`, `+`, or `-`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0963030bf4d7100dcad20edf6c7c395a021fef52 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkEmphasis(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-emphasis.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5421035d321e99e3754ad8c0d5f7588912d2420b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-emphasis.d.ts","sourceRoot":"","sources":["check-emphasis.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,qCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAc1D;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js new file mode 100644 index 0000000000000000000000000000000000000000..33f0c7383ae529fbacde99b3493fe35cd8ff5377 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkEmphasis(state) { + const marker = state.options.emphasis || '*' + + if (marker !== '*' && marker !== '_') { + throw new Error( + 'Cannot serialize emphasis with `' + + marker + + '` for `options.emphasis`, expected `*`, or `_`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..33a33a144c9aed3a9e7c5d1904ae0a8cafa75956 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkFence(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-fence.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e33ae20c16b0e6046e016c7ed170371923fce125 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-fence.d.ts","sourceRoot":"","sources":["check-fence.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,kCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcvD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.js new file mode 100644 index 0000000000000000000000000000000000000000..ffabf99c98d55d1f1752f49accaf3fc267c5d711 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-fence.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkFence(state) { + const marker = state.options.fence || '`' + + if (marker !== '`' && marker !== '~') { + throw new Error( + 'Cannot serialize code with `' + + marker + + '` for `options.fence`, expected `` ` `` or `~`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..143f866db15bf46ea13829c8b5f8a249987f51e6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkListItemIndent(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-list-item-indent.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..b657e5a626548c3837d3bf8471eb7c627c06b0c1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-list-item-indent.d.ts","sourceRoot":"","sources":["check-list-item-indent.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,2CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAchE;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js new file mode 100644 index 0000000000000000000000000000000000000000..7a2a105efc27855b386950deb3ad56ebbde5b958 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkListItemIndent(state) { + const style = state.options.listItemIndent || 'one' + + if (style !== 'tab' && style !== 'one' && style !== 'mixed') { + throw new Error( + 'Cannot serialize items with `' + + style + + '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`' + ) + } + + return style +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48b6d82efeb88fdd5bf5fc91dfd8406d69abe342 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkQuote(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-quote.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..dcb455f0003fc4607c81f4957ba31c2c1e1e9f7d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-quote.d.ts","sourceRoot":"","sources":["check-quote.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,kCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcvD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.js new file mode 100644 index 0000000000000000000000000000000000000000..0d6a5ff0c3e64f0f83b4cc1ffcb724b84f1e4945 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-quote.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkQuote(state) { + const marker = state.options.quote || '"' + + if (marker !== '"' && marker !== "'") { + throw new Error( + 'Cannot serialize title with `' + + marker + + '` for `options.quote`, expected `"`, or `\'`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aaa32388b2bd48bb61781b5dfb81062abf00df7a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkRuleRepetition(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-rule-repetition.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e2d063e3fb82acdf114b92c1c82254813dd98627 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-rule-repetition.d.ts","sourceRoot":"","sources":["check-rule-repetition.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,2CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAchE;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js new file mode 100644 index 0000000000000000000000000000000000000000..accc91c70c44530638214dc2c50168044ec4b414 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkRuleRepetition(state) { + const repetition = state.options.ruleRepetition || 3 + + if (repetition < 3) { + throw new Error( + 'Cannot serialize rules with repetition `' + + repetition + + '` for `options.ruleRepetition`, expected `3` or more' + ) + } + + return repetition +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..21514d9ef789be75c75f0b7d17c70db417666d39 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkRule(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-rule.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..4fc76643f432f78ee125b0cdc1b61bce74b05338 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-rule.d.ts","sourceRoot":"","sources":["check-rule.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,iCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CActD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.js new file mode 100644 index 0000000000000000000000000000000000000000..281928aba88adff3d65945f233410af820cf6ba6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-rule.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkRule(state) { + const marker = state.options.rule || '*' + + if (marker !== '*' && marker !== '-' && marker !== '_') { + throw new Error( + 'Cannot serialize rules with `' + + marker + + '` for `options.rule`, expected `*`, `-`, or `_`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6649c4ca6c175c682b3926a57be1615802007dd8 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts @@ -0,0 +1,11 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkStrong(state: State): Exclude; +import type { State } from 'mdast-util-to-markdown'; +import type { Options } from 'mdast-util-to-markdown'; +//# sourceMappingURL=check-strong.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d5ffa6d446acc20312fd6e9c592988280b1e601d --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"check-strong.d.ts","sourceRoot":"","sources":["check-strong.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,mCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcxD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.js new file mode 100644 index 0000000000000000000000000000000000000000..3ad8c8904deabd404a78b5c9052c11e5251d5115 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/check-strong.js @@ -0,0 +1,21 @@ +/** + * @import {Options, State} from 'mdast-util-to-markdown' + */ + +/** + * @param {State} state + * @returns {Exclude} + */ +export function checkStrong(state) { + const marker = state.options.strong || '*' + + if (marker !== '*' && marker !== '_') { + throw new Error( + 'Cannot serialize strong with `' + + marker + + '` for `options.strong`, expected `*`, or `_`' + ) + } + + return marker +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac9cc041a1eab33def2309896ac437bd41e6a099 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts @@ -0,0 +1,2 @@ +export function compilePattern(info: import("../types.js").Unsafe): RegExp; +//# sourceMappingURL=compile-pattern.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ad496828cacefcd3ff5e22c8bbc0558af8e75b2f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compile-pattern.d.ts","sourceRoot":"","sources":["compile-pattern.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..877c059c0cf84fe6a10ab2b1b4bc2e4f2f746a60 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js @@ -0,0 +1,24 @@ +/** + * @import {CompilePattern} from '../types.js' + */ + +/** + * @type {CompilePattern} + */ +export function compilePattern(pattern) { + if (!pattern._compiled) { + const before = + (pattern.atBreak ? '[\\r\\n][\\t ]*' : '') + + (pattern.before ? '(?:' + pattern.before + ')' : '') + + pattern._compiled = new RegExp( + (before ? '(' + before + ')' : '') + + (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') + + pattern.character + + (pattern.after ? '(?:' + pattern.after + ')' : ''), + 'g' + ) + } + + return pattern._compiled +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e4338ffea3b33b6e134768a6e9ad8060ad6aead --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts @@ -0,0 +1,19 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {FlowChildren, FlowParents, TrackFields} from '../types.js' + */ +/** + * @param {FlowParents} parent + * Parent of flow nodes. + * @param {State} state + * Info passed around about the current state. + * @param {TrackFields} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined by (blank) lines. + */ +export function containerFlow(parent: FlowParents, state: State, info: TrackFields): string; +import type { FlowParents } from '../types.js'; +import type { State } from 'mdast-util-to-markdown'; +import type { TrackFields } from '../types.js'; +//# sourceMappingURL=container-flow.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..a8151c8454b9ffc4d1a8f61608b769fc7b588f6c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"container-flow.d.ts","sourceRoot":"","sources":["container-flow.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,sCATW,WAAW,SAEX,KAAK,QAEL,WAAW,GAET,MAAM,CA0ClB;iCApDwD,aAAa;2BAD9C,wBAAwB;iCACS,aAAa"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.js new file mode 100644 index 0000000000000000000000000000000000000000..e2b118324e4392c713ca6bd18f1be79a6ee72aeb --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-flow.js @@ -0,0 +1,84 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {FlowChildren, FlowParents, TrackFields} from '../types.js' + */ + +/** + * @param {FlowParents} parent + * Parent of flow nodes. + * @param {State} state + * Info passed around about the current state. + * @param {TrackFields} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined by (blank) lines. + */ +export function containerFlow(parent, state, info) { + const indexStack = state.indexStack + const children = parent.children || [] + const tracker = state.createTracker(info) + /** @type {Array} */ + const results = [] + let index = -1 + + indexStack.push(-1) + + while (++index < children.length) { + const child = children[index] + + indexStack[indexStack.length - 1] = index + + results.push( + tracker.move( + state.handle(child, parent, state, { + before: '\n', + after: '\n', + ...tracker.current() + }) + ) + ) + + if (child.type !== 'list') { + state.bulletLastUsed = undefined + } + + if (index < children.length - 1) { + results.push( + tracker.move(between(child, children[index + 1], parent, state)) + ) + } + } + + indexStack.pop() + + return results.join('') +} + +/** + * @param {FlowChildren} left + * @param {FlowChildren} right + * @param {FlowParents} parent + * @param {State} state + * @returns {string} + */ +function between(left, right, parent, state) { + let index = state.join.length + + while (index--) { + const result = state.join[index](left, right, parent, state) + + if (result === true || result === 1) { + break + } + + if (typeof result === 'number') { + return '\n'.repeat(1 + result) + } + + if (result === false) { + return '\n\n\n\n' + } + } + + return '\n\n' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1624d8535a6ea03e96c76040b9706b42dc23d106 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts @@ -0,0 +1,19 @@ +/** + * Serialize the children of a parent that contains phrasing children. + * + * These children will be joined flush together. + * + * @param {PhrasingParents} parent + * Parent of flow nodes. + * @param {State} state + * Info passed around about the current state. + * @param {Info} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined together. + */ +export function containerPhrasing(parent: PhrasingParents, state: State, info: Info): string; +import type { PhrasingParents } from '../types.js'; +import type { State } from 'mdast-util-to-markdown'; +import type { Info } from 'mdast-util-to-markdown'; +//# sourceMappingURL=container-phrasing.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..0626b7a47cd78505c1b7d902dcb03af823aef10a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"container-phrasing.d.ts","sourceRoot":"","sources":["container-phrasing.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,0CATW,eAAe,SAEf,KAAK,QAEL,IAAI,GAEF,MAAM,CA0GlB;qCA1HiC,aAAa;2BADT,wBAAwB;0BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js new file mode 100644 index 0000000000000000000000000000000000000000..3b4dc46bcab677d1a86c0ca3cc0d11e876e7e81b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js @@ -0,0 +1,125 @@ +/** + * @import {Handle, Info, State} from 'mdast-util-to-markdown' + * @import {PhrasingParents} from '../types.js' + */ + +import {encodeCharacterReference} from './encode-character-reference.js' + +/** + * Serialize the children of a parent that contains phrasing children. + * + * These children will be joined flush together. + * + * @param {PhrasingParents} parent + * Parent of flow nodes. + * @param {State} state + * Info passed around about the current state. + * @param {Info} info + * Info on where we are in the document we are generating. + * @returns {string} + * Serialized children, joined together. + */ +export function containerPhrasing(parent, state, info) { + const indexStack = state.indexStack + const children = parent.children || [] + /** @type {Array} */ + const results = [] + let index = -1 + let before = info.before + /** @type {string | undefined} */ + let encodeAfter + + indexStack.push(-1) + let tracker = state.createTracker(info) + + while (++index < children.length) { + const child = children[index] + /** @type {string} */ + let after + + indexStack[indexStack.length - 1] = index + + if (index + 1 < children.length) { + /** @type {Handle} */ + // @ts-expect-error: hush, it’s actually a `zwitch`. + let handle = state.handle.handlers[children[index + 1].type] + /** @type {Handle} */ + // @ts-expect-error: hush, it’s actually a `zwitch`. + if (handle && handle.peek) handle = handle.peek + after = handle + ? handle(children[index + 1], parent, state, { + before: '', + after: '', + ...tracker.current() + }).charAt(0) + : '' + } else { + after = info.after + } + + // In some cases, html (text) can be found in phrasing right after an eol. + // When we’d serialize that, in most cases that would be seen as html + // (flow). + // As we can’t escape or so to prevent it from happening, we take a somewhat + // reasonable approach: replace that eol with a space. + // See: + if ( + results.length > 0 && + (before === '\r' || before === '\n') && + child.type === 'html' + ) { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + ' ' + ) + before = ' ' + + // To do: does this work to reset tracker? + tracker = state.createTracker(info) + tracker.move(results.join('')) + } + + let value = state.handle(child, parent, state, { + ...tracker.current(), + after, + before + }) + + // If we had to encode the first character after the previous node and it’s + // still the same character, + // encode it. + if (encodeAfter && encodeAfter === value.slice(0, 1)) { + value = + encodeCharacterReference(encodeAfter.charCodeAt(0)) + value.slice(1) + } + + const encodingInfo = state.attentionEncodeSurroundingInfo + state.attentionEncodeSurroundingInfo = undefined + encodeAfter = undefined + + // If we have to encode the first character before the current node and + // it’s still the same character, + // encode it. + if (encodingInfo) { + if ( + results.length > 0 && + encodingInfo.before && + before === results[results.length - 1].slice(-1) + ) { + results[results.length - 1] = + results[results.length - 1].slice(0, -1) + + encodeCharacterReference(before.charCodeAt(0)) + } + + if (encodingInfo.after) encodeAfter = after + } + + tracker.move(value) + results.push(value) + before = value.slice(-1) + } + + indexStack.pop() + + return results.join('') +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..953077166e579029689e7a75b48a7b3bce2f2f3a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts @@ -0,0 +1,7 @@ +/** + * @this {State} + * @returns {'*' | '_'} + */ +export function emphasisStrongMarker(this: State): "*" | "_"; +import type { State } from '../types.js'; +//# sourceMappingURL=emphasis-strong-marker.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2839bc959b04de4edf11c8f50afd849fc2a1ac21 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/emphasis-strong-marker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"emphasis-strong-marker.d.ts","sourceRoot":"","sources":["emphasis-strong-marker.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,mDAFa,GAAG,GAAG,GAAG,CAqBrB;2BA7BuB,aAAa"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f4c9aa982ff1f210d844770affcfaa9dd337fd6 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts @@ -0,0 +1,10 @@ +/** + * Encode a code point as a character reference. + * + * @param {number} code + * Code point to encode. + * @returns {string} + * Encoded character reference. + */ +export function encodeCharacterReference(code: number): string; +//# sourceMappingURL=encode-character-reference.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5ac76ce8efcde9d348c53ea4eaa0c1ab335a11ce --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-character-reference.d.ts","sourceRoot":"","sources":["encode-character-reference.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,+CALW,MAAM,GAEJ,MAAM,CAKlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js new file mode 100644 index 0000000000000000000000000000000000000000..149d26a3e3156518f98e5a071e4ec26eece73acc --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js @@ -0,0 +1,11 @@ +/** + * Encode a code point as a character reference. + * + * @param {number} code + * Code point to encode. + * @returns {string} + * Encoded character reference. + */ +export function encodeCharacterReference(code) { + return '&#x' + code.toString(16).toUpperCase() + ';' +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9004124689471fe88891d346525f4d5a487e5a30 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts @@ -0,0 +1,33 @@ +/** + * Check whether to encode (as a character reference) the characters + * surrounding an attention run. + * + * Which characters are around an attention run influence whether it works or + * not. + * + * See for more info. + * See this markdown in a particular renderer to see what works: + * + * ```markdown + * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) | + * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ | + * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z | + * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. | + * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z | + * | 4 (nothing outside) | *x* | *.* | * * | ** | + * ``` + * + * @param {number} outside + * Code point on the outer side of the run. + * @param {number} inside + * Code point on the inner side of the run. + * @param {'*' | '_'} marker + * Marker of the run. + * Underscores are handled more strictly (they form less often) than + * asterisks. + * @returns {EncodeSides} + * Whether to encode characters. + */ +export function encodeInfo(outside: number, inside: number, marker: "*" | "_"): EncodeSides; +import type { EncodeSides } from '../types.js'; +//# sourceMappingURL=encode-info.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d0a3056578b59b76664140134a91090cf9e2ab49 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encode-info.d.ts","sourceRoot":"","sources":["encode-info.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,oCAfW,MAAM,UAEN,MAAM,UAEN,GAAG,GAAG,GAAG,GAIP,WAAW,CAgDvB;iCAhF6B,aAAa"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.js new file mode 100644 index 0000000000000000000000000000000000000000..8895a7953535c49280f31724772ac11eea1d1c66 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/encode-info.js @@ -0,0 +1,82 @@ +/** + * @import {EncodeSides} from '../types.js' + */ + +import {classifyCharacter} from 'micromark-util-classify-character' + +/** + * Check whether to encode (as a character reference) the characters + * surrounding an attention run. + * + * Which characters are around an attention run influence whether it works or + * not. + * + * See for more info. + * See this markdown in a particular renderer to see what works: + * + * ```markdown + * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) | + * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ | + * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z | + * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. | + * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z | + * | 4 (nothing outside) | *x* | *.* | * * | ** | + * ``` + * + * @param {number} outside + * Code point on the outer side of the run. + * @param {number} inside + * Code point on the inner side of the run. + * @param {'*' | '_'} marker + * Marker of the run. + * Underscores are handled more strictly (they form less often) than + * asterisks. + * @returns {EncodeSides} + * Whether to encode characters. + */ +// Important: punctuation must never be encoded. +// Punctuation is solely used by markdown constructs. +// And by encoding itself. +// Encoding them will break constructs or double encode things. +export function encodeInfo(outside, inside, marker) { + const outsideKind = classifyCharacter(outside) + const insideKind = classifyCharacter(inside) + + // Letter outside: + if (outsideKind === undefined) { + return insideKind === undefined + ? // Letter inside: + // we have to encode *both* letters for `_` as it is looser. + // it already forms for `*` (and GFMs `~`). + marker === '_' + ? {inside: true, outside: true} + : {inside: false, outside: false} + : insideKind === 1 + ? // Whitespace inside: encode both (letter, whitespace). + {inside: true, outside: true} + : // Punctuation inside: encode outer (letter) + {inside: false, outside: true} + } + + // Whitespace outside: + if (outsideKind === 1) { + return insideKind === undefined + ? // Letter inside: already forms. + {inside: false, outside: false} + : insideKind === 1 + ? // Whitespace inside: encode both (whitespace). + {inside: true, outside: true} + : // Punctuation inside: already forms. + {inside: false, outside: false} + } + + // Punctuation outside: + return insideKind === undefined + ? // Letter inside: already forms. + {inside: false, outside: false} + : insideKind === 1 + ? // Whitespace inside: encode inner (whitespace). + {inside: true, outside: false} + : // Punctuation inside: already forms. + {inside: false, outside: false} +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..88487873e82a43f475d4f72d58e79deb408fe708 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts @@ -0,0 +1,13 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {Code} from 'mdast' + */ +/** + * @param {Code} node + * @param {State} state + * @returns {boolean} + */ +export function formatCodeAsIndented(node: Code, state: State): boolean; +import type { Code } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +//# sourceMappingURL=format-code-as-indented.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7c906e4c5ce4438c1af74408331d149f442c6091 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format-code-as-indented.d.ts","sourceRoot":"","sources":["format-code-as-indented.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,2CAJW,IAAI,SACJ,KAAK,GACH,OAAO,CAanB;0BAnBsB,OAAO;2BADN,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js new file mode 100644 index 0000000000000000000000000000000000000000..0bcfeb5d6dd9437f817913571c2308b984cb175f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js @@ -0,0 +1,22 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {Code} from 'mdast' + */ + +/** + * @param {Code} node + * @param {State} state + * @returns {boolean} + */ +export function formatCodeAsIndented(node, state) { + return Boolean( + state.options.fences === false && + node.value && + // If there’s no info… + !node.lang && + // And there’s a non-whitespace character… + /[^ \r\n]/.test(node.value) && + // And the value doesn’t start or end in a blank… + !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value) + ) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fbe72ebff03034a6e9e52b64479a2b3361f2fce5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts @@ -0,0 +1,9 @@ +/** + * @param {Heading} node + * @param {State} state + * @returns {boolean} + */ +export function formatHeadingAsSetext(node: Heading, state: State): boolean; +import type { Heading } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +//# sourceMappingURL=format-heading-as-setext.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3d9e1f3916550c396d743863bc047cfbfa53d7ea --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format-heading-as-setext.d.ts","sourceRoot":"","sources":["format-heading-as-setext.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,4CAJW,OAAO,SACP,KAAK,GACH,OAAO,CAsBnB;6BA/ByB,OAAO;2BADT,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js new file mode 100644 index 0000000000000000000000000000000000000000..60759a4e1a93b84f81c231e8aeeabdb1d5c94ffa --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js @@ -0,0 +1,34 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {Heading} from 'mdast' + */ + +import {EXIT, visit} from 'unist-util-visit' +import {toString} from 'mdast-util-to-string' + +/** + * @param {Heading} node + * @param {State} state + * @returns {boolean} + */ +export function formatHeadingAsSetext(node, state) { + let literalWithBreak = false + + // Look for literals with a line break. + // Note that this also + visit(node, function (node) { + if ( + ('value' in node && /\r?\n|\r/.test(node.value)) || + node.type === 'break' + ) { + literalWithBreak = true + return EXIT + } + }) + + return Boolean( + (!node.depth || node.depth < 3) && + toString(node) && + (state.options.setext || literalWithBreak) + ) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a39a6363e3af59c20468cb517f60b2c75ff7af86 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts @@ -0,0 +1,9 @@ +/** + * @param {Link} node + * @param {State} state + * @returns {boolean} + */ +export function formatLinkAsAutolink(node: Link, state: State): boolean; +import type { Link } from 'mdast'; +import type { State } from 'mdast-util-to-markdown'; +//# sourceMappingURL=format-link-as-autolink.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6c2e37023cbb9157491b831da35f2682c33b1bf5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format-link-as-autolink.d.ts","sourceRoot":"","sources":["format-link-as-autolink.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,2CAJW,IAAI,SACJ,KAAK,GACH,OAAO,CAuBnB;0BA/BsB,OAAO;2BADN,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js new file mode 100644 index 0000000000000000000000000000000000000000..ee1ba959d7697e49563c65bafb764c26577d5701 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js @@ -0,0 +1,34 @@ +/** + * @import {State} from 'mdast-util-to-markdown' + * @import {Link} from 'mdast' + */ + +import {toString} from 'mdast-util-to-string' + +/** + * @param {Link} node + * @param {State} state + * @returns {boolean} + */ +export function formatLinkAsAutolink(node, state) { + const raw = toString(node) + + return Boolean( + !state.options.resourceLink && + // If there’s a url… + node.url && + // And there’s a no title… + !node.title && + // And the content of `node` is a single text node… + node.children && + node.children.length === 1 && + node.children[0].type === 'text' && + // And if the url is the same as the content… + (raw === node.url || 'mailto:' + raw === node.url) && + // And that starts w/ a protocol… + /^[a-z][a-z+.-]+:/i.test(node.url) && + // And that doesn’t contain ASCII control codes (character escapes and + // references don’t work), space, or angle brackets… + !/[\0- <>\u007F]/.test(node.url) + ) +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85e440b1a0bf64bf166fc038f20b7f55220696b2 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts @@ -0,0 +1,2 @@ +export function indentLines(value: string, map: import("../types.js").Map): string; +//# sourceMappingURL=indent-lines.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1aaf7e1fb03a903fc20f269a07ad388292a75fdc --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"indent-lines.d.ts","sourceRoot":"","sources":["indent-lines.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js new file mode 100644 index 0000000000000000000000000000000000000000..6b15331e515757bd19448a1d1c62e203de1bedcd --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/indent-lines.js @@ -0,0 +1,35 @@ +/** + * @import {IndentLines} from '../types.js' + */ + +const eol = /\r?\n|\r/g + +/** + * @type {IndentLines} + */ +export function indentLines(value, map) { + /** @type {Array} */ + const result = [] + let start = 0 + let line = 0 + /** @type {RegExpExecArray | null} */ + let match + + while ((match = eol.exec(value))) { + one(value.slice(start, match.index)) + result.push(match[0]) + start = match.index + match[0].length + line++ + } + + one(value.slice(start)) + + return result.join('') + + /** + * @param {string} value + */ + function one(value) { + result.push(map(value, line, !value)) + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b20731ff7c093ec1b1af97f28ab94a173153b3bf --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts @@ -0,0 +1,12 @@ +/** + * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown' + */ +/** + * @param {Array} stack + * @param {Unsafe} pattern + * @returns {boolean} + */ +export function patternInScope(stack: Array, pattern: Unsafe): boolean; +import type { ConstructName } from 'mdast-util-to-markdown'; +import type { Unsafe } from 'mdast-util-to-markdown'; +//# sourceMappingURL=pattern-in-scope.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1536fd1562bb67bedd45c3d6f02cebb644a2c254 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pattern-in-scope.d.ts","sourceRoot":"","sources":["pattern-in-scope.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,sCAJW,KAAK,CAAC,aAAa,CAAC,WACpB,MAAM,GACJ,OAAO,CAOnB;mCAbuC,wBAAwB;4BAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js new file mode 100644 index 0000000000000000000000000000000000000000..0fcb02caadcef1d062a964e6a20a6c2482026afe --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js @@ -0,0 +1,41 @@ +/** + * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown' + */ + +/** + * @param {Array} stack + * @param {Unsafe} pattern + * @returns {boolean} + */ +export function patternInScope(stack, pattern) { + return ( + listInScope(stack, pattern.inConstruct, true) && + !listInScope(stack, pattern.notInConstruct, false) + ) +} + +/** + * @param {Array} stack + * @param {Unsafe['inConstruct']} list + * @param {boolean} none + * @returns {boolean} + */ +function listInScope(stack, list, none) { + if (typeof list === 'string') { + list = [list] + } + + if (!list || list.length === 0) { + return none + } + + let index = -1 + + while (++index < list.length) { + if (stack.includes(list[index])) { + return true + } + } + + return false +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f709db969009ad8bb8afef5b8c7c47cab5b8ce24 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts @@ -0,0 +1,29 @@ +/** + * Make a string safe for embedding in markdown constructs. + * + * In markdown, almost all punctuation characters can, in certain cases, + * result in something. + * Whether they do is highly subjective to where they happen and in what + * they happen. + * + * To solve this, `mdast-util-to-markdown` tracks: + * + * * Characters before and after something; + * * What “constructs” we are in. + * + * This information is then used by this function to escape or encode + * special characters. + * + * @param {State} state + * Info passed around about the current state. + * @param {string | null | undefined} input + * Raw value to make safe. + * @param {SafeConfig} config + * Configuration. + * @returns {string} + * Serialized markdown safe for embedding. + */ +export function safe(state: State, input: string | null | undefined, config: SafeConfig): string; +import type { State } from 'mdast-util-to-markdown'; +import type { SafeConfig } from 'mdast-util-to-markdown'; +//# sourceMappingURL=safe.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d257dae330badd80d35dc2420712347af00368d0 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["safe.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,4BATW,KAAK,SAEL,MAAM,GAAG,IAAI,GAAG,SAAS,UAEzB,UAAU,GAER,MAAM,CAoGlB;2BAhImC,wBAAwB;gCAAxB,wBAAwB"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.js new file mode 100644 index 0000000000000000000000000000000000000000..456fe215ae3d032ffaea4590f0d097bcb9195619 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/safe.js @@ -0,0 +1,174 @@ +/** + * @import {SafeConfig, State} from 'mdast-util-to-markdown' + */ + +import {encodeCharacterReference} from './encode-character-reference.js' +import {patternInScope} from './pattern-in-scope.js' + +/** + * Make a string safe for embedding in markdown constructs. + * + * In markdown, almost all punctuation characters can, in certain cases, + * result in something. + * Whether they do is highly subjective to where they happen and in what + * they happen. + * + * To solve this, `mdast-util-to-markdown` tracks: + * + * * Characters before and after something; + * * What “constructs” we are in. + * + * This information is then used by this function to escape or encode + * special characters. + * + * @param {State} state + * Info passed around about the current state. + * @param {string | null | undefined} input + * Raw value to make safe. + * @param {SafeConfig} config + * Configuration. + * @returns {string} + * Serialized markdown safe for embedding. + */ +export function safe(state, input, config) { + const value = (config.before || '') + (input || '') + (config.after || '') + /** @type {Array} */ + const positions = [] + /** @type {Array} */ + const result = [] + /** @type {Record} */ + const infos = {} + let index = -1 + + while (++index < state.unsafe.length) { + const pattern = state.unsafe[index] + + if (!patternInScope(state.stack, pattern)) { + continue + } + + const expression = state.compilePattern(pattern) + /** @type {RegExpExecArray | null} */ + let match + + while ((match = expression.exec(value))) { + const before = 'before' in pattern || Boolean(pattern.atBreak) + const after = 'after' in pattern + const position = match.index + (before ? match[1].length : 0) + + if (positions.includes(position)) { + if (infos[position].before && !before) { + infos[position].before = false + } + + if (infos[position].after && !after) { + infos[position].after = false + } + } else { + positions.push(position) + infos[position] = {before, after} + } + } + } + + positions.sort(numerical) + + let start = config.before ? config.before.length : 0 + const end = value.length - (config.after ? config.after.length : 0) + index = -1 + + while (++index < positions.length) { + const position = positions[index] + + // Character before or after matched: + if (position < start || position >= end) { + continue + } + + // If this character is supposed to be escaped because it has a condition on + // the next character, and the next character is definitly being escaped, + // then skip this escape. + if ( + (position + 1 < end && + positions[index + 1] === position + 1 && + infos[position].after && + !infos[position + 1].before && + !infos[position + 1].after) || + (positions[index - 1] === position - 1 && + infos[position].before && + !infos[position - 1].before && + !infos[position - 1].after) + ) { + continue + } + + if (start !== position) { + // If we have to use a character reference, an ampersand would be more + // correct, but as backslashes only care about punctuation, either will + // do the trick + result.push(escapeBackslashes(value.slice(start, position), '\\')) + } + + start = position + + if ( + /[!-/:-@[-`{-~]/.test(value.charAt(position)) && + (!config.encode || !config.encode.includes(value.charAt(position))) + ) { + // Character escape. + result.push('\\') + } else { + // Character reference. + result.push(encodeCharacterReference(value.charCodeAt(position))) + start++ + } + } + + result.push(escapeBackslashes(value.slice(start, end), config.after)) + + return result.join('') +} + +/** + * @param {number} a + * @param {number} b + * @returns {number} + */ +function numerical(a, b) { + return a - b +} + +/** + * @param {string} value + * @param {string} after + * @returns {string} + */ +function escapeBackslashes(value, after) { + const expression = /\\(?=[!-/:-@[-`{-~])/g + /** @type {Array} */ + const positions = [] + /** @type {Array} */ + const results = [] + const whole = value + after + let index = -1 + let start = 0 + /** @type {RegExpExecArray | null} */ + let match + + while ((match = expression.exec(whole))) { + positions.push(match.index) + } + + while (++index < positions.length) { + if (start !== positions[index]) { + results.push(value.slice(start, positions[index])) + } + + results.push('\\') + start = positions[index] + } + + results.push(value.slice(start)) + + return results.join('') +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..200d47c6fc1cf9dc409aa8763e40a37bae925141 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts @@ -0,0 +1,2 @@ +export function track(info: import("../types.js").TrackFields): import("../types.js").Tracker; +//# sourceMappingURL=track.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..f52694e0a8d3c47c93e41e11441208583bd27b3a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["track.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.js b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.js new file mode 100644 index 0000000000000000000000000000000000000000..178d2e8e062c3772a7d30c16e6e614c7dfb7814c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/lib/util/track.js @@ -0,0 +1,55 @@ +/** + * @import {CreateTracker, TrackCurrent, TrackMove, TrackShift} from '../types.js' + */ + +/** + * Track positional info in the output. + * + * @type {CreateTracker} + */ +export function track(config) { + // Defaults are used to prevent crashes when older utilities somehow activate + // this code. + /* c8 ignore next 5 */ + const options = config || {} + const now = options.now || {} + let lineShift = options.lineShift || 0 + let line = now.line || 1 + let column = now.column || 1 + + return {move, current, shift} + + /** + * Get the current tracked info. + * + * @type {TrackCurrent} + */ + function current() { + return {now: {line, column}, lineShift} + } + + /** + * Define an increased line shift (the typical indent for lines). + * + * @type {TrackShift} + */ + function shift(value) { + lineShift += value + } + + /** + * Move past some generated markdown. + * + * @type {TrackMove} + */ + function move(input) { + // eslint-disable-next-line unicorn/prefer-default-parameters + const value = input || '' + const chunks = value.split(/\r?\n|\r/g) + const tail = chunks[chunks.length - 1] + line += chunks.length - 1 + column = + chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift + return value + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/license b/tools/ui/node_modules/mdast-util-to-markdown/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/README.md b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/package.json b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/mdast-util-to-markdown/package.json b/tools/ui/node_modules/mdast-util-to-markdown/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e6036c90373807540c008b5df69a0b24422a61c1 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/package.json @@ -0,0 +1,132 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/syntax-tree/mdast-util-to-markdown/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "description": "mdast utility to serialize markdown", + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "mdast-util-from-markdown": "^2.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-util-remove-position": "^5.0.0", + "xo": "^0.59.0" + }, + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "ast", + "compile", + "markdown", + "markup", + "mdast-util", + "mdast", + "serialize", + "stringify", + "syntax", + "tree", + "unist", + "utility", + "util" + ], + "license": "MIT", + "name": "mdast-util-to-markdown", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "syntax-tree/mdast-util-to-markdown", + "version": "2.1.2", + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test/index.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "ignoreFiles": [ + "lib/types.d.ts" + ], + "strict": true + }, + "type": "module", + "xo": { + "overrides": [ + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] + } + }, + { + "files": [ + "test/**/*.js" + ], + "rules": { + "max-depth": "off", + "no-await-in-loop": "off" + } + } + ], + "prettier": true, + "rules": { + "complexity": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-code-point": "off" + } + } +} diff --git a/tools/ui/node_modules/mdast-util-to-markdown/readme.md b/tools/ui/node_modules/mdast-util-to-markdown/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..822dcbf50dc59054d82a6c51c34ef92652eb87b2 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-markdown/readme.md @@ -0,0 +1,750 @@ +# mdast-util-to-markdown + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**[mdast][]** utility that turns a syntax tree into markdown. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`toMarkdown(tree[, options])`](#tomarkdowntree-options) + * [`defaultHandlers`](#defaulthandlers) + * [`ConstructName`](#constructname) + * [`ConstructNameMap`](#constructnamemap) + * [`Handle`](#handle) + * [`Handlers`](#handlers) + * [`Info`](#info) + * [`Join`](#join) + * [`Map`](#map) + * [`Options`](#options) + * [`SafeConfig`](#safeconfig) + * [`State`](#state) + * [`Tracker`](#tracker) + * [`Unsafe`](#unsafe) +* [List of extensions](#list-of-extensions) +* [Syntax](#syntax) +* [Syntax tree](#syntax-tree) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that takes an [mdast][] syntax tree as input and turns +it into serialized markdown. + +This utility is a low level project. +It’s used in [`remark-stringify`][remark-stringify], which focusses on making it +easier to transform content by abstracting these internals away. + +## When should I use this? + +If you want to handle syntax trees manually, use this. +For an easier time processing content, use the **[remark][]** ecosystem instead. + +You can combine this utility with other utilities to add syntax extensions. +Notable examples that deeply integrate with it are +[`mdast-util-gfm`][mdast-util-gfm], +[`mdast-util-mdx`][mdast-util-mdx], +[`mdast-util-frontmatter`][mdast-util-frontmatter], +[`mdast-util-math`][mdast-util-math], and +[`mdast-util-directive`][mdast-util-directive]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-to-markdown +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {toMarkdown} from 'https://esm.sh/mdast-util-to-markdown@2' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +Say our module `example.js` looks as follows: + +```js +/** + * @import {Root} from 'mdast' + */ + +import {toMarkdown} from 'mdast-util-to-markdown' + +/** @type {Root} */ +const tree = { + type: 'root', + children: [ + { + type: 'blockquote', + children: [ + {type: 'thematicBreak'}, + { + type: 'paragraph', + children: [ + {type: 'text', value: '- a\nb !'}, + { + type: 'link', + url: 'example.com', + children: [{type: 'text', value: 'd'}] + } + ] + } + ] + } + ] +} + +console.log(toMarkdown(tree)) +``` + +…now running `node example.js` yields: + +```markdown +> *** +> +> \- a +> b \![d](example.com) +``` + +> 👉 **Note**: observe the properly escaped characters which would otherwise +> turn into a list and image respectively. + +## API + +This package exports the identifiers [`defaultHandlers`][api-default-handlers] +and [`toMarkdown`][api-to-markdown]. +There is no default export. + +### `toMarkdown(tree[, options])` + +Turn an **[mdast][]** syntax tree into markdown. + +###### Parameters + +* `tree` ([`Node`][node]) + — tree to serialize +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +Serialized markdown representing `tree` (`string`). + +### `defaultHandlers` + +Default (CommonMark) handlers ([`Handlers`][api-handlers]). + +### `ConstructName` + +Construct names for things generated by `mdast-util-to-markdown` (TypeScript +type). + +This is an enum of strings, each being a semantic label, useful to know when +serializing whether we’re for example in a double (`"`) or single (`'`) quoted +title. + +###### Type + +```ts +type ConstructName = ConstructNameMap[keyof ConstructNameMap] +``` + +### `ConstructNameMap` + +Interface of registered constructs (TypeScript type). + +###### Type + +```ts +interface ConstructNameMap { /* see code */ } +``` + +When working on extensions that use new constructs, extend the corresponding +interface to register its name: + +```ts +declare module 'mdast-util-to-markdown' { + interface ConstructNameMap { + // Register a new construct name (value is used, key should match it). + gfmStrikethrough: 'gfmStrikethrough' + } +} +``` + +### `Handle` + +Handle a particular node (TypeScript type). + +###### Parameters + +* `node` (`any`) + — expected mdast node +* `parent` ([`Node`][node], optional) + — parent of `node` +* `state` ([`State`][api-state]) + — info passed around about the current state +* `info` ([`Info`][api-info]) + — info on the surrounding of the node that is serialized + +###### Returns + +Serialized markdown representing `node` (`string`). + +### `Handlers` + +Handle particular nodes (TypeScript type). + +Each key is a node type (`Node['type']`), each value its corresponding handler +([`Handle`][api-handle]). + +###### Type + +```ts +type Handlers = Record +``` + +### `Info` + +Info on the surrounding of the node that is serialized (TypeScript type). + +###### Fields + +* `now` ([`Point`][point]) + — current point +* `lineShift` (`number`) + — number of columns each line will be shifted by wrapping nodes +* `before` (`string`) + — characters before this (guaranteed to be one, can be more) +* `after` (`string`) + — characters after this (guaranteed to be one, can be more) + +### `Join` + +How to join two blocks (TypeScript type). + +“Blocks” are typically joined by one blank line. +Sometimes it’s nicer to have them flush next to each other, yet other times +they cannot occur together at all. + +Join functions receive two adjacent siblings and their parent and what they +return defines how many blank lines to use between them. + +###### Parameters + +* `left` ([`Node`][node]) + — first of two adjacent siblings +* `right` ([`Node`][node]) + — second of two adjacent siblings +* `parent` ([`Node`][node]) + — parent of the two siblings +* `state` ([`State`][api-state]) + — info passed around about the current state + +###### Returns + +How many blank lines to use between the siblings (`boolean`, `number`, +optional). + +Where `true` is as passing `1` and `false` means the nodes cannot be +joined by a blank line, such as two adjacent block quotes or indented code +after a list, in which case a comment will be injected to break them up: + +```markdown +> Quote 1 + + + +> Quote 2 +``` + +> 👉 **Note**: abusing this feature will break markdown. +> One such example is when returning `0` for two paragraphs, which will result +> in the text running together, and in the future to be seen as one paragraph. + +### `Map` + +Map function to pad a single line (TypeScript type). + +###### Parameters + +* `value` (`string`) + — a single line of serialized markdown +* `line` (`number`) + — line number relative to the fragment +* `blank` (`boolean`) + — whether the line is considered blank in markdown + +###### Returns + +Padded line (`string`). + +### `Options` + +Configuration (TypeScript type). + +##### Fields + +The following fields influence how markdown is serialized. + +###### `options.bullet` + +Marker to use for bullets of items in unordered lists (`'*'`, `'+'`, or `'-'`, +default: `'*'`). + +There are three cases where the primary bullet cannot be used: + +* when three or more list items are on their own, the last one is empty, and + `bullet` is also a valid `rule`: `* - +`; this would turn into a thematic + break if serialized with three primary bullets; `bulletOther` is used for + the last item +* when a thematic break is the first child of a list item and `bullet` is the + same character as `rule`: `- ***`; this would turn into a single thematic + break if serialized with primary bullets; `bulletOther` is used for the + item +* when two unordered lists appear next to each other: `* a\n- b`; + `bulletOther` is used for such lists + +###### `options.bulletOther` + +Marker to use in certain cases where the primary bullet doesn’t work (`'*'`, +`'+'`, or `'-'`, default: `'-'` when `bullet` is `'*'`, `'*'` otherwise). + +Cannot be equal to `bullet`. + +###### `options.bulletOrdered` + +Marker to use for bullets of items in ordered lists (`'.'` or `')'`, default: +`'.'`). + +There is one case where the primary bullet for ordered items cannot be used: + +* when two ordered lists appear next to each other: `1. a\n2) b`; to solve + that, `'.'` will be used when `bulletOrdered` is `')'`, and `'.'` otherwise + +###### `options.closeAtx` + +Whether to add the same number of number signs (`#`) at the end of an ATX +heading as the opening sequence (`boolean`, default: `false`). + +###### `options.emphasis` + +Marker to use for emphasis (`'*'` or `'_'`, default: `'*'`). + +###### `options.fence` + +Marker to use for fenced code (``'`'`` or `'~'`, default: ``'`'``). + +###### `options.fences` + +Whether to use fenced code always (`boolean`, default: `true`). +The default is to use fenced code if there is a language defined, if the code is +empty, or if it starts or ends in blank lines. + +###### `options.incrementListMarker` + +Whether to increment the counter of ordered lists items (`boolean`, default: +`true`). + +###### `options.listItemIndent` + +How to indent the content of list items (`'mixed'`, `'one'`, or `'tab'`, +default: `'one'`). +Either with the size of the bullet plus one space (when `'one'`), a tab stop +(`'tab'`), or depending on the item and its parent list (`'mixed'`, uses `'one'` +if the item and list are tight and `'tab'` otherwise). + +###### `options.quote` + +Marker to use for titles (`'"'` or `"'"`, default: `'"'`). + +###### `options.resourceLink` + +Whether to always use resource links (`boolean`, default: `false`). +The default is to use autolinks (``) when possible +and resource links (`[text](url)`) otherwise. + +###### `options.rule` + +Marker to use for thematic breaks (`'*'`, `'-'`, or `'_'`, default: `'*'`). + +###### `options.ruleRepetition` + +Number of markers to use for thematic breaks (`number`, default: `3`, min: `3`). + +###### `options.ruleSpaces` + +Whether to add spaces between markers in thematic breaks (`boolean`, default: +`false`). + +###### `options.setext` + +Whether to use setext headings when possible (`boolean`, default: `false`). +The default is to always use ATX headings (`# heading`) instead of setext +headings (`heading\n=======`). +Setext headings cannot be used for empty headings or headings with a rank of +three or more. + +###### `options.strong` + +Marker to use for strong (`'*'` or `'_'`, default: `'*'`). + +###### `options.tightDefinitions` + +Whether to join definitions without a blank line (`boolean`, default: `false`). + +The default is to add blank lines between any flow (“block”) construct. +Turning this option on is a shortcut for a [`Join`][api-join] function like so: + +```js +function joinTightDefinitions(left, right) { + if (left.type === 'definition' && right.type === 'definition') { + return 0 + } +} +``` + +###### `options.handlers` + +Handle particular nodes ([`Handlers`][api-handlers], optional). + +###### `options.join` + +How to join blocks ([`Array`][api-join], optional). + +###### `options.unsafe` + +Schemas that define when characters cannot occur +([`Array`][api-unsafe], optional). + +###### `options.extensions` + +List of extensions (`Array`, default: `[]`). +Each extension is an object with the same interface as `Options` itself. + +### `SafeConfig` + +Configuration passed to `state.safe` (TypeScript type). + +###### Fields + +* `before` (`string`) + — characters before this (guaranteed to be one, can be more) +* `after` (`string`) + — characters after this (guaranteed to be one, can be more) +* `encode` (`Array`, optional) + — extra characters that *must* be encoded (as character references) instead + of escaped (character escapes). + Only ASCII punctuation will use character escapes, so you never need to + pass non-ASCII-punctuation here + +### `State` + +Info passed around about the current state (TypeScript type). + +###### Fields + +* `stack` ([`Array`][api-construct-name]) + — stack of constructs we’re in +* `indexStack` (`Array`) + — positions of child nodes in their parents +* `associationId` (`(node: Association) => string`) + — get an identifier from an association to match it to others (see + [`Association`][association]) +* `enter` (`(construct: ConstructName) => () => undefined`) + — enter a construct (returns a corresponding exit function) + (see [`ConstructName`][api-construct-name]) +* `indentLines` (`(value: string, map: Map) => string`) + — pad serialized markdown (see [`Map`][api-map]) +* `compilePattern` (`(pattern: Unsafe) => RegExp`) + — compile an unsafe pattern to a regex (see [`Unsafe`][api-unsafe]) +* `containerFlow` (`(parent: Node, info: Info) => string`) + — serialize flow children (see [`Info`][api-info]) +* `containerPhrasing` (`(parent: Node, info: Info) => string`) + — serialize phrasing children (see [`Info`][api-info]) +* `createTracker` (`(info: Info) => Tracker`) + — track positional info in the output (see [`Info`][api-info], + [`Tracker`][api-tracker]) +* `safe` (`(value: string, config: SafeConfig) => string`) + — make a string safe for embedding (see [`SafeConfig`][api-safe-config]) +* `options` ([`Options`][api-options]) + — applied user configuration +* `unsafe` ([`Array`][api-unsafe]) + — applied unsafe patterns +* `join` ([`Array`][api-join]) + — applied join handlers +* `handle` ([`Handle`][api-handle]) + — call the configured handler for the given node +* `handlers` ([`Handlers`][api-handlers]) + — applied handlers +* `bulletCurrent` (`string` or `undefined`) + — list marker currently in use +* `bulletLastUsed` (`string` or `undefined`) + — list marker previously in use + +### `Tracker` + +Track positional info in the output (TypeScript type). + +This info isn’t used yet but such functionality will allow line wrapping, +source maps, etc. + +###### Fields + +* `current` (`() => Info`) + — get current tracked info +* `shift` (`(value: number) => undefined`) + — define a relative increased line shift (the typical indent for lines) +* `move` (`(value: string) => string`) + — move past some generated markdown + +### `Unsafe` + +Schema that defines when a character cannot occur (TypeScript type). + +###### Fields + +* `character` (`string`) + — single unsafe character +* `inConstruct` ([`Array`][api-construct-name], + `ConstructName`, optional) + — constructs where this is bad +* `notInConstruct` ([`Array`][api-construct-name], + `ConstructName`, optional) + — constructs where this is fine again +* `before` (`string`, optional) + — `character` is bad when this is before it (cannot be used together with + `atBreak`) +* `after` (`string`, optional) + — `character` is bad when this is after it +* `atBreak` (`boolean`, optional) + — `character` is bad at a break (cannot be used together with `before`) + +## List of extensions + +* [`syntax-tree/mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive) + — directives +* [`syntax-tree/mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter) + — frontmatter (YAML, TOML, more) +* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm) + — GFM +* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal) + — GFM autolink literals +* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote) + — GFM footnotes +* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough) + — GFM strikethrough +* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table) + — GFM tables +* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item) + — GFM task list items +* [`syntax-tree/mdast-util-math`](https://github.com/syntax-tree/mdast-util-math) + — math +* [`syntax-tree/mdast-util-mdx`](https://github.com/syntax-tree/mdast-util-mdx) + — MDX +* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression) + — MDX expressions +* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx) + — MDX JSX +* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm) + — MDX ESM + +## Syntax + +Markdown is serialized according to CommonMark but care is taken to format in +such a way that the resulting markdown should work with most markdown parsers. +Extensions can add support for custom syntax. + +## Syntax tree + +The syntax tree is [mdast][]. + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types +[`ConstructName`][api-construct-name], +[`ConstructNameMap`][api-construct-name-map], +[`Handle`][api-handle], +[`Handlers`][api-handlers], +[`Info`][api-info], +[`Join`][api-join], +[`Map`][api-map], +[`Options`][api-options], +[`SafeConfig`][api-safe-config], +[`State`][api-State], and +[`Unsafe`][api-Unsafe]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-to-markdown@^2`, +compatible with Node.js 16. + +## Security + +`mdast-util-to-markdown` will do its best to serialize markdown to match the +syntax tree, but there are several cases where that is impossible. +It’ll do its best, but complete roundtripping is impossible given that any value +could be injected into the tree. + +As markdown is sometimes used for HTML, and improper use of HTML can open you up +to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-to-markdown` +and parsing it again later could potentially be unsafe. +When parsing markdown afterwards and then going to HTML, use something like +[`hast-util-sanitize`][hast-util-sanitize] to make the tree safe. + +## Related + +* [`syntax-tree/mdast-util-from-markdown`](https://github.com/syntax-tree/mdast-util-from-markdown) + — parse markdown to mdast +* [`micromark/micromark`](https://github.com/micromark/micromark) + — parse markdown +* [`remarkjs/remark`](https://github.com/remarkjs/remark) + — process markdown + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-to-markdown/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-to-markdown/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-markdown.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-markdown + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-markdown.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-to-markdown + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-markdown + +[size]: https://bundlejs.com/?q=mdast-util-to-markdown + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esmsh]: https://esm.sh + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[typescript]: https://www.typescriptlang.org + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize + +[point]: https://github.com/syntax-tree/unist#point + +[mdast]: https://github.com/syntax-tree/mdast + +[node]: https://github.com/syntax-tree/mdast#nodes + +[association]: https://github.com/syntax-tree/mdast#association + +[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm + +[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx + +[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter + +[mdast-util-math]: https://github.com/syntax-tree/mdast-util-math + +[mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive + +[remark]: https://github.com/remarkjs/remark + +[remark-stringify]: https://github.com/remarkjs/remark/tree/main/packages/remark-stringify + +[api-construct-name]: #constructname + +[api-construct-name-map]: #constructnamemap + +[api-default-handlers]: #defaulthandlers + +[api-handle]: #handle + +[api-handlers]: #handlers + +[api-info]: #info + +[api-join]: #join + +[api-map]: #map + +[api-options]: #options + +[api-safe-config]: #safeconfig + +[api-state]: #state + +[api-to-markdown]: #tomarkdowntree-options + +[api-tracker]: #tracker + +[api-unsafe]: #unsafe diff --git a/tools/ui/node_modules/mdast-util-to-string/index.d.ts b/tools/ui/node_modules/mdast-util-to-string/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4a39692a7b501c7c926c70e87f79349d03c7b3a --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/index.d.ts @@ -0,0 +1,2 @@ +export {toString} from './lib/index.js' +export type Options = import('./lib/index.js').Options diff --git a/tools/ui/node_modules/mdast-util-to-string/index.js b/tools/ui/node_modules/mdast-util-to-string/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8674f309820fa07b789df535f42b90f161e228fe --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/index.js @@ -0,0 +1,5 @@ +/** + * @typedef {import('./lib/index.js').Options} Options + */ + +export {toString} from './lib/index.js' diff --git a/tools/ui/node_modules/mdast-util-to-string/lib/index.d.ts b/tools/ui/node_modules/mdast-util-to-string/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f9d483a63456a078e12fedffcf0cec480e254c95 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/lib/index.d.ts @@ -0,0 +1,31 @@ +/** + * Get the text content of a node or list of nodes. + * + * Prefers the node’s plain-text fields, otherwise serializes its children, + * and if the given value is an array, serialize the nodes in it. + * + * @param {unknown} [value] + * Thing to serialize, typically `Node`. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Serialized `value`. + */ +export function toString( + value?: unknown, + options?: Options | null | undefined +): string +export type Nodes = import('mdast').Nodes +/** + * Configuration (optional). + */ +export type Options = { + /** + * Whether to use `alt` for `image`s (default: `true`). + */ + includeImageAlt?: boolean | null | undefined + /** + * Whether to use `value` of HTML (default: `true`). + */ + includeHtml?: boolean | null | undefined +} diff --git a/tools/ui/node_modules/mdast-util-to-string/lib/index.js b/tools/ui/node_modules/mdast-util-to-string/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..30a4ca664a3b2c2d579acb5e025c622429ce9b27 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/lib/index.js @@ -0,0 +1,108 @@ +/** + * @typedef {import('mdast').Nodes} Nodes + * + * @typedef Options + * Configuration (optional). + * @property {boolean | null | undefined} [includeImageAlt=true] + * Whether to use `alt` for `image`s (default: `true`). + * @property {boolean | null | undefined} [includeHtml=true] + * Whether to use `value` of HTML (default: `true`). + */ + +/** @type {Options} */ +const emptyOptions = {} + +/** + * Get the text content of a node or list of nodes. + * + * Prefers the node’s plain-text fields, otherwise serializes its children, + * and if the given value is an array, serialize the nodes in it. + * + * @param {unknown} [value] + * Thing to serialize, typically `Node`. + * @param {Options | null | undefined} [options] + * Configuration (optional). + * @returns {string} + * Serialized `value`. + */ +export function toString(value, options) { + const settings = options || emptyOptions + const includeImageAlt = + typeof settings.includeImageAlt === 'boolean' + ? settings.includeImageAlt + : true + const includeHtml = + typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true + + return one(value, includeImageAlt, includeHtml) +} + +/** + * One node or several nodes. + * + * @param {unknown} value + * Thing to serialize. + * @param {boolean} includeImageAlt + * Include image `alt`s. + * @param {boolean} includeHtml + * Include HTML. + * @returns {string} + * Serialized node. + */ +function one(value, includeImageAlt, includeHtml) { + if (node(value)) { + if ('value' in value) { + return value.type === 'html' && !includeHtml ? '' : value.value + } + + if (includeImageAlt && 'alt' in value && value.alt) { + return value.alt + } + + if ('children' in value) { + return all(value.children, includeImageAlt, includeHtml) + } + } + + if (Array.isArray(value)) { + return all(value, includeImageAlt, includeHtml) + } + + return '' +} + +/** + * Serialize a list of nodes. + * + * @param {Array} values + * Thing to serialize. + * @param {boolean} includeImageAlt + * Include image `alt`s. + * @param {boolean} includeHtml + * Include HTML. + * @returns {string} + * Serialized nodes. + */ +function all(values, includeImageAlt, includeHtml) { + /** @type {Array} */ + const result = [] + let index = -1 + + while (++index < values.length) { + result[index] = one(values[index], includeImageAlt, includeHtml) + } + + return result.join('') +} + +/** + * Check if `value` looks like a node. + * + * @param {unknown} value + * Thing. + * @returns {value is Nodes} + * Whether `value` is a node. + */ +function node(value) { + return Boolean(value && typeof value === 'object') +} diff --git a/tools/ui/node_modules/mdast-util-to-string/license b/tools/ui/node_modules/mdast-util-to-string/license new file mode 100644 index 0000000000000000000000000000000000000000..32e7a3d93ca5a2b8cce57405841a44e78f3fbb55 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/ui/node_modules/mdast-util-to-string/package.json b/tools/ui/node_modules/mdast-util-to-string/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a2a88d48e352f026af618e5038bde4a351709a84 --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/package.json @@ -0,0 +1,78 @@ +{ + "name": "mdast-util-to-string", + "version": "4.0.0", + "description": "mdast utility to get the plain text content of a node", + "license": "MIT", + "keywords": [ + "unist", + "mdast", + "mdast-util", + "util", + "utility", + "markdown", + "node", + "string", + "serialize" + ], + "repository": "syntax-tree/mdast-util-to-string", + "bugs": "https://github.com/syntax-tree/mdast-util-to-string/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/mdast-util-to-string/readme.md b/tools/ui/node_modules/mdast-util-to-string/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4d901234ad005acf4b43ecbf07320c9e7b67e48c --- /dev/null +++ b/tools/ui/node_modules/mdast-util-to-string/readme.md @@ -0,0 +1,218 @@ +# mdast-util-to-string + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[mdast][] utility to get the text content of a node. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`toString(value[, options])`](#tostringvalue-options) + * [`Options`](#options) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a tiny utility that gets the textual content of a node. + +## When should I use this? + +This utility is useful when you have a node, say a heading, and want to get the +text inside it. + +This package does not serialize markdown, that’s what +[`mdast-util-to-markdown`][mdast-util-to-markdown] does. + +Similar packages, [`hast-util-to-string`][hast-util-to-string] and +[`hast-util-to-text`][hast-util-to-text], do the same but on [hast][]. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install mdast-util-to-string +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {toString} from 'https://esm.sh/mdast-util-to-string@4' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {fromMarkdown} from 'mdast-util-from-markdown' +import {toString} from 'mdast-util-to-string' + +const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.') + +console.log(toString(tree)) // => 'Some emphasis, importance, and code.' +``` + +## API + +This package exports the identifier [`toString`][api-to-string]. +There is no default export. + +### `toString(value[, options])` + +Get the text content of a node or list of nodes. + +Prefers the node’s plain-text fields, otherwise serializes its children, +and if the given value is an array, serialize the nodes in it. + +###### Parameters + +* `value` (`unknown`) + — thing to serialize, typically [`Node`][node] +* `options` ([`Options`][api-options], optional) + — configuration + +###### Returns + +Serialized `value` (`string`). + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `includeImageAlt` (`boolean`, default: `true`) + — whether to use `alt` for `image`s +* `includeHtml` (`boolean`, default: `true`) + — whether to use `value` of HTML + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`Options`][api-options]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `mdast-util-to-string@^4`, +compatible with Node.js 16. + +## Security + +Use of `mdast-util-to-string` does not involve **[hast][]**, user content, or +change the tree, so there are no openings for [cross-site scripting (XSS)][xss] +attacks. + +## Related + +* [`hast-util-to-string`](https://github.com/wooorm/rehype-minify/tree/main/packages/hast-util-to-string) + — get text content in hast +* [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text) + — get text content in hast according to the `innerText` algorithm + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/mdast-util-to-string/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/mdast-util-to-string/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-string.svg + +[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-string + +[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-string.svg + +[downloads]: https://www.npmjs.com/package/mdast-util-to-string + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-string + +[size]: https://bundlejs.com/?q=mdast-util-to-string + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[mdast]: https://github.com/syntax-tree/mdast + +[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown + +[hast]: https://github.com/syntax-tree/hast + +[hast-util-to-string]: https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-to-string + +[hast-util-to-text]: https://github.com/syntax-tree/hast-util-to-text + +[node]: https://github.com/syntax-tree/mdast#nodes + +[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting + +[api-to-string]: #tostringvalue-options + +[api-options]: #options diff --git a/tools/ui/node_modules/mdast/logo.svg b/tools/ui/node_modules/mdast/logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..2a8296aa2ddee21119e4559ac1eea13f8424d784 --- /dev/null +++ b/tools/ui/node_modules/mdast/logo.svg @@ -0,0 +1,5 @@ + + + MDAST + + diff --git a/tools/ui/node_modules/mdast/package.json b/tools/ui/node_modules/mdast/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d5e753c194d4b9b2444fc5a11ed6a2e835e71da5 --- /dev/null +++ b/tools/ui/node_modules/mdast/package.json @@ -0,0 +1,12 @@ +{ + "name": "mdast", + "version": "3.0.0", + "description": "Markdown Abstract Syntax Tree format", + "license": "MIT", + "keywords": [], + "repository": { + "type": "git", + "url": "https://github.com/wooorm/mdast.git" + }, + "author": "Titus Wormer " +} diff --git a/tools/ui/node_modules/mdast/readme.md b/tools/ui/node_modules/mdast/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..b4e15007b55f846b98347245e8b6a1759673b064 --- /dev/null +++ b/tools/ui/node_modules/mdast/readme.md @@ -0,0 +1,438 @@ +# ![MDAST](https://cdn.rawgit.com/wooorm/mdast/master/logo.svg) + +> :warning: +> +> **mdast**, the pluggable markdown parser, was recently +> separated from this project and given a new name: +> **remark**. See its documentation to read more about +> [what changed and how to migrate »](https://github.com/wooorm/remark/releases/tag/3.0.0) + +**M**ark**d**own **A**bstract **S**yntax **T**ree format. + +*** + +**MDAST** discloses markdown as an abstract syntax tree. _Abstract_ +means not all information is stored in this tree and an exact replica +of the original document cannot be re-created. _Syntax Tree_ means syntax +**is** present in the tree, thus an exact syntactic document can be +re-created. + +## AST + +### Node + +Node represents any unit in MDAST hierarchy. + +```idl +interface Node { + type: string; + data: Data | null; + position: Location?; +} +``` + +### Location + +**Node** can have a reference to its original location, if applicable. +Start determines the line and column at which the original location starts; +end, respectively; and indent the column at which further lines start. + +```idl +interface Location { + start: Position; + end: Position; + indent: [uint32 >= 1] +} +``` + +### Position + +A position contains a column and a line. Both start at `1`. + +```idl +interface Position { + line: uint32 >= 1; + column: uint32 >= 1; +} +``` + +### Data + +Data represents data associated with any node. Data is a scope for plug-ins +to store any information. Its only limitation being that each property should +by `stringify`able: not throw when passed to `JSON.stringify()`. + +```idl +interface Data { } +``` + +### Parent + +Most nodes inherit the **Parent** ([**Node**](#node)) interface: nodes which +accept other nodes as children. + +```idl +interface Parent <: Node { + children: [Node]; +} +``` + +### Text + +Most others inherit **Text** ([**Node**](#node)): nodes which accept a value. + +```idl +interface Text <: Node { + value: string; +} +``` + +### Root + +**Root** ([**Parent**](#parent)) houses all nodes. + +```idl +interface Root <: Parent { + type: "root"; +} +``` + +### Paragraph + +**Paragraph** ([**Parent**](#parent)) represents a unit of discourse dealing +with a particular point or idea. + +```idl +interface Paragraph <: Parent { + type: "paragraph"; +} +``` + +### Blockquote + +**Blockquote** ([**Parent**](#parent)) represents a quote. + +```idl +interface Blockquote <: Parent { + type: "blockquote"; +} +``` + +### Heading + +**Heading** ([**Parent**](#parent)), just like with HTML, with a level greater +than or equal to 1, lower than or equal to 6. + +```idl +interface Heading <: Parent { + type: "heading"; + depth: 1 <= uint32 <= 6; +} +``` + +### Code + +**Code** ([**Text**](#text)) occurs at block level (see **InlineCode** for +code spans). **Code** sports a language tag (when using GitHub Flavoured +Markdown fences with a flag, `null` otherwise). + +```idl +interface Code <: Text { + type: "code"; + lang: string | null; +} +``` + +### InlineCode + +**InlineCode** ([**Text**](#text)) occurs inline (see **Code** for blocks). +Inline code does not sport a `lang` attribute. + +```idl +interface InlineCode <: Text { + type: "inlineCode"; +} +``` + +### YAML + +**YAML** ([**Text**](#text)) can occur at the start of a document, and +contains embedded YAML data. + +```idl +interface YAML <: Text { + type: "yaml"; +} +``` + +### HTML + +**HTML** ([**Text**](#text)) contains embedded HTML. + +```idl +interface HTML <: Text { + type: "html"; +} +``` + +### List + +**List** ([**Parent**](#parent)) contains **ListItem**’s. + +The `start` property contains the starting number of the list when +`ordered: true`; `null` otherwise. + +When all list items have `loose: false`, the list’s `loose` property is also +`false`. Otherwise, `loose: true`. + +```idl +interface List <: Parent { + type: "list"; + loose: true | false; + start: uint32 | null; + ordered: true | false; +} +``` + +### ListItem + +**ListItem** ([**Parent**](#parent)) is a child of a **List**. + +Loose **ListItem**’s often contain more than one block-level elements. + +When in `gfm: true` mode, a checked property exists on **ListItem**’s, +either set to `true` (when checked), `false` (when unchecked), or `null` +(when not containing a checkbox). See +[Task Lists on GitHub](https://help.github.com/articles/writing-on-github/#task-lists) +for information. + +```idl +interface ListItem <: Parent { + type: "listItem"; + loose: true | false; + checked: true | false | null | undefined; +} +``` + +### Table + +**Table** ([**Parent**](#parent)) represents tabular data, with alignment. +Its children are either **TableHeader** (the first child), or **TableRow** +(all other children). + +`table.align` represents the alignment of columns. + +```idl +interface Table <: Parent { + type: "table"; + align: [alignType]; +} +``` + +```idl +enum alignType { + "left" | "right" | "center" | null; +} +``` + +### TableHeader + +**TableHeader** ([**Parent**](#parent)). Its children are always **TableCell**. + +```idl +interface TableHeader <: Parent { + type: "tableHeader"; +} +``` + +### TableRow + +**TableRow** ([**Parent**](#parent)). Its children are always **TableCell**. + +```idl +interface TableRow <: Parent { + type: "tableRow"; +} +``` + +### TableCell + +**TableCell** ([**Parent**](#parent)). Contains a single tabular field. + +```idl +interface TableCell <: Parent { + type: "tableCell"; +} +``` + +### HorizontalRule + +Just a **HorizontalRule** ([**Node**](#node)). + +```idl +interface HorizontalRule <: Node { + type: "horizontalRule"; +} +``` + +### Break + +**Break** ([**Node**](#node)) represents an explicit line break. + +```idl +interface Break <: Node { + type: "break"; +} +``` + +### Emphasis + +**Emphasis** ([**Parent**](#parent)) represents slightly important text. + +```idl +interface Emphasis <: Parent { + type: "emphasis"; +} +``` + +### Strong + +**Strong** ([**Parent**](#parent)) represents super important text. + +```idl +interface Strong <: Parent { + type: "strong"; +} +``` + +### Delete + +**Delete** ([**Parent**](#parent)) represents text ready for removal. + +```idl +interface Delete <: Parent { + type: "delete"; +} +``` + +### Link + +**Link** ([**Parent**](#parent)) represents the humble hyperlink. + +```idl +interface Link <: Parent { + type: "link"; + title: string | null; + href: string; +} +``` + +### Image + +**Image** ([**Node**](#node)) represents the figurative figure. + +```idl +interface Image <: Node { + type: "image"; + title: string | null; + alt: string | null; + src: string; +} +``` + +### Footnote + +**Footnote** ([**Parent**](#parent)) represents an inline marker, whose +content relates to the document but is outside its flow. + +```idl +interface Footnote <: Parent { + type: "footnote"; +} +``` + +### LinkReference + +**Link** ([**Parent**](#parent)) represents a humble hyperlink, its `href` +and `title` defined somewhere else in the document by a **Definition**. + +```idl +interface LinkReference <: Parent { + type: "linkReference"; + identifier: string; +} +``` + +### ImageReference + +**Link** ([**Node**](#node)) represents a figurative figure, its `src` and +`title` defined somewhere else in the document by a **Definition**. + +```idl +interface ImageReference <: Node { + type: "imageReference"; + alt: string | null; + identifier: string; +} +``` + +### FootnoteReference + +**FootnoteReference** ([**Node**](#node)) is like **Footnote**, but its +content is already outside the documents flow: placed in a +**FootnoteDefinition**. + +```idl +interface FootnoteReference <: Node { + type: "footnoteReference"; + identifier: string; +} +``` + +### Definition + +**Definition** ([**Node**](#node)) represents the definition (i.e., location +and title) of a **LinkReference** or an **ImageReference**. + +```idl +interface Definition <: Node { + type: "definition"; + identifier: string; + title: string | null; + link: string; +} +``` + +### FootnoteDefinition + +**FootnoteDefinition** ([**Parent**](#parent)) represents the definition +(i.e., content) of a **FootnoteReference**. + +```idl +interface FootnoteDefinition <: Parent { + type: "footnoteDefinition"; + identifier: string; +} +``` + +### TextNode + +**TextNode** ([**Text**](#text)) represents everything that is just text. +Note that its `type` property is `text`, but it is different from **Text**. + +```idl +interface TextNode <: Text { + type: "text"; +} +``` + +## Related + +* [remark](https://github.com/wooorm/remark) +* [unist](https://github.com/wooorm/unist) +* [nlcst](https://github.com/wooorm/nlcst) +* [vfile](https://github.com/wooorm/vfile) + +### License + +MIT © [Titus Wormer](http://wooorm.com) diff --git a/tools/ui/node_modules/mdsvex/LICENSE b/tools/ui/node_modules/mdsvex/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ac332b478cfd91d190aede85dd26fc00a7439fd9 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 pngwn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/tools/ui/node_modules/mdsvex/README.md b/tools/ui/node_modules/mdsvex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5c6e6b55bf670ce8b68213df15e9ea63440af3f3 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/README.md @@ -0,0 +1,25 @@ +# MDsveX + +_do ya think I'm svexy?_ + +A markdown preprocessor for Svelte components. Basically [MDX](https://github.com/mdx-js/mdx) for Svelte. + +This preprocessor allows you use Svelte components in your markdown, or markdown in your svelte components. + +[Try it](https://mdsvex.com/) + +You can do this: + +```jsx + + +# Here’s a chart + +The chart is rendered inside our MDsveX document. + + +``` + +https://mdsvex.com/ diff --git a/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js b/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js new file mode 100644 index 0000000000000000000000000000000000000000..90a125b6329b254b45f4bb8f9839357877ea2c17 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js @@ -0,0 +1,34 @@ +import { g as getDefaultExportFromCjs } from './main-DLA3kuAq.js'; + +function _mergeNamespaces(n, m) { + m.forEach(function (e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + if (k !== 'default' && !(k in n)) { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + }); + return Object.freeze(n); +} + +var components$2 = {exports: {}}; + +(function (module) { + var components = {"core":{"meta":{"path":"components/prism-core.js","option":"mandatory"},"core":"Core"},"themes":{"meta":{"path":"themes/{id}.css","link":"index.html?theme={id}","exclusive":true},"prism":{"title":"Default","option":"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{"title":"Okaidia","owner":"ocodia"},"prism-twilight":{"title":"Twilight","owner":"remybach"},"prism-coy":{"title":"Coy","owner":"tshedor"},"prism-solarizedlight":{"title":"Solarized Light","owner":"hectormatos2011 "},"prism-tomorrow":{"title":"Tomorrow Night","owner":"Rosey"}},"languages":{"meta":{"path":"components/prism-{id}","noCSS":true,"examplesPath":"examples/prism-{id}","addCheckAll":true},"markup":{"title":"Markup","alias":["html","xml","svg","mathml","ssml","atom","rss"],"aliasTitles":{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","ssml":"SSML","atom":"Atom","rss":"RSS"},"option":"default"},"css":{"title":"CSS","option":"default","modify":"markup"},"clike":{"title":"C-like","option":"default"},"javascript":{"title":"JavaScript","require":"clike","modify":"markup","alias":"js","option":"default"},"abap":{"title":"ABAP","owner":"dellagustin"},"abnf":{"title":"ABNF","owner":"RunDevelopment"},"actionscript":{"title":"ActionScript","require":"javascript","modify":"markup","owner":"Golmote"},"ada":{"title":"Ada","owner":"Lucretia"},"agda":{"title":"Agda","owner":"xy-ren"},"al":{"title":"AL","owner":"RunDevelopment"},"antlr4":{"title":"ANTLR4","alias":"g4","owner":"RunDevelopment"},"apacheconf":{"title":"Apache Configuration","owner":"GuiTeK"},"apl":{"title":"APL","owner":"ngn"},"applescript":{"title":"AppleScript","owner":"Golmote"},"aql":{"title":"AQL","owner":"RunDevelopment"},"arduino":{"title":"Arduino","require":"cpp","owner":"eisbehr-"},"arff":{"title":"ARFF","owner":"Golmote"},"asciidoc":{"alias":"adoc","title":"AsciiDoc","owner":"Golmote"},"aspnet":{"title":"ASP.NET (C#)","require":["markup","csharp"],"owner":"nauzilus"},"asm6502":{"title":"6502 Assembly","owner":"kzurawel"},"autohotkey":{"title":"AutoHotkey","owner":"aviaryan"},"autoit":{"title":"AutoIt","owner":"Golmote"},"bash":{"title":"Bash","alias":"shell","aliasTitles":{"shell":"Shell"},"owner":"zeitgeist87"},"basic":{"title":"BASIC","owner":"Golmote"},"batch":{"title":"Batch","owner":"Golmote"},"bbcode":{"title":"BBcode","alias":"shortcode","aliasTitles":{"shortcode":"Shortcode"},"owner":"RunDevelopment"},"bison":{"title":"Bison","require":"c","owner":"Golmote"},"bnf":{"title":"BNF","alias":"rbnf","aliasTitles":{"rbnf":"RBNF"},"owner":"RunDevelopment"},"brainfuck":{"title":"Brainfuck","owner":"Golmote"},"brightscript":{"title":"BrightScript","owner":"RunDevelopment"},"bro":{"title":"Bro","owner":"wayward710"},"c":{"title":"C","require":"clike","owner":"zeitgeist87"},"csharp":{"title":"C#","require":"clike","alias":["cs","dotnet"],"owner":"mvalipour"},"cpp":{"title":"C++","require":"c","owner":"zeitgeist87"},"cil":{"title":"CIL","owner":"sbrl"},"clojure":{"title":"Clojure","owner":"troglotit"},"cmake":{"title":"CMake","owner":"mjrogozinski"},"coffeescript":{"title":"CoffeeScript","require":"javascript","alias":"coffee","owner":"R-osey"},"concurnas":{"title":"Concurnas","alias":"conc","owner":"jasontatton"},"csp":{"title":"Content-Security-Policy","owner":"ScottHelme"},"crystal":{"title":"Crystal","require":"ruby","owner":"MakeNowJust"},"css-extras":{"title":"CSS Extras","require":"css","modify":"css","owner":"milesj"},"cypher":{"title":"Cypher","owner":"RunDevelopment"},"d":{"title":"D","require":"clike","owner":"Golmote"},"dart":{"title":"Dart","require":"clike","owner":"Golmote"},"dax":{"title":"DAX","owner":"peterbud"},"dhall":{"title":"Dhall","owner":"RunDevelopment"},"diff":{"title":"Diff","owner":"uranusjr"},"django":{"title":"Django/Jinja2","require":"markup-templating","alias":"jinja2","owner":"romanvm"},"dns-zone-file":{"title":"DNS zone file","owner":"RunDevelopment","alias":"dns-zone"},"docker":{"title":"Docker","alias":"dockerfile","owner":"JustinBeckwith"},"ebnf":{"title":"EBNF","owner":"RunDevelopment"},"editorconfig":{"title":"EditorConfig","owner":"osipxd"},"eiffel":{"title":"Eiffel","owner":"Conaclos"},"ejs":{"title":"EJS","require":["javascript","markup-templating"],"owner":"RunDevelopment","alias":"eta","aliasTitles":{"eta":"Eta"}},"elixir":{"title":"Elixir","owner":"Golmote"},"elm":{"title":"Elm","owner":"zwilias"},"etlua":{"title":"Embedded Lua templating","require":["lua","markup-templating"],"owner":"RunDevelopment"},"erb":{"title":"ERB","require":["ruby","markup-templating"],"owner":"Golmote"},"erlang":{"title":"Erlang","owner":"Golmote"},"excel-formula":{"title":"Excel Formula","alias":["xlsx","xls"],"owner":"RunDevelopment"},"fsharp":{"title":"F#","require":"clike","owner":"simonreynolds7"},"factor":{"title":"Factor","owner":"catb0t"},"firestore-security-rules":{"title":"Firestore security rules","require":"clike","owner":"RunDevelopment"},"flow":{"title":"Flow","require":"javascript","owner":"Golmote"},"fortran":{"title":"Fortran","owner":"Golmote"},"ftl":{"title":"FreeMarker Template Language","require":"markup-templating","owner":"RunDevelopment"},"gml":{"title":"GameMaker Language","alias":"gamemakerlanguage","require":"clike","owner":"LiarOnce"},"gcode":{"title":"G-code","owner":"RunDevelopment"},"gdscript":{"title":"GDScript","owner":"RunDevelopment"},"gedcom":{"title":"GEDCOM","owner":"Golmote"},"gherkin":{"title":"Gherkin","owner":"hason"},"git":{"title":"Git","owner":"lgiraudel"},"glsl":{"title":"GLSL","require":"c","owner":"Golmote"},"go":{"title":"Go","require":"clike","owner":"arnehormann"},"graphql":{"title":"GraphQL","optional":["markdown"],"owner":"Golmote"},"groovy":{"title":"Groovy","require":"clike","owner":"robfletcher"},"haml":{"title":"Haml","require":"ruby","optional":["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],"owner":"Golmote"},"handlebars":{"title":"Handlebars","require":"markup-templating","owner":"Golmote"},"haskell":{"title":"Haskell","alias":"hs","owner":"bholst"},"haxe":{"title":"Haxe","require":"clike","owner":"Golmote"},"hcl":{"title":"HCL","owner":"outsideris"},"hlsl":{"title":"HLSL","require":"c","owner":"RunDevelopment"},"http":{"title":"HTTP","optional":["css","javascript","json","markup"],"owner":"danielgtaylor"},"hpkp":{"title":"HTTP Public-Key-Pins","owner":"ScottHelme"},"hsts":{"title":"HTTP Strict-Transport-Security","owner":"ScottHelme"},"ichigojam":{"title":"IchigoJam","owner":"BlueCocoa"},"icon":{"title":"Icon","owner":"Golmote"},"ignore":{"title":".ignore","owner":"osipxd","alias":["gitignore","hgignore","npmignore"],"aliasTitles":{"gitignore":".gitignore","hgignore":".hgignore","npmignore":".npmignore"}},"inform7":{"title":"Inform 7","owner":"Golmote"},"ini":{"title":"Ini","owner":"aviaryan"},"io":{"title":"Io","owner":"AlesTsurko"},"j":{"title":"J","owner":"Golmote"},"java":{"title":"Java","require":"clike","owner":"sherblot"},"javadoc":{"title":"JavaDoc","require":["markup","java","javadoclike"],"modify":"java","optional":"scala","owner":"RunDevelopment"},"javadoclike":{"title":"JavaDoc-like","modify":["java","javascript","php"],"owner":"RunDevelopment"},"javastacktrace":{"title":"Java stack trace","owner":"RunDevelopment"},"jolie":{"title":"Jolie","require":"clike","owner":"thesave"},"jq":{"title":"JQ","owner":"RunDevelopment"},"jsdoc":{"title":"JSDoc","require":["javascript","javadoclike","typescript"],"modify":"javascript","optional":["actionscript","coffeescript"],"owner":"RunDevelopment"},"js-extras":{"title":"JS Extras","require":"javascript","modify":"javascript","optional":["actionscript","coffeescript","flow","n4js","typescript"],"owner":"RunDevelopment"},"json":{"title":"JSON","alias":"webmanifest","aliasTitles":{"webmanifest":"Web App Manifest"},"owner":"CupOfTea696"},"json5":{"title":"JSON5","require":"json","owner":"RunDevelopment"},"jsonp":{"title":"JSONP","require":"json","owner":"RunDevelopment"},"jsstacktrace":{"title":"JS stack trace","owner":"sbrl"},"js-templates":{"title":"JS Templates","require":"javascript","modify":"javascript","optional":["css","css-extras","graphql","markdown","markup"],"owner":"RunDevelopment"},"julia":{"title":"Julia","owner":"cdagnino"},"keyman":{"title":"Keyman","owner":"mcdurdin"},"kotlin":{"title":"Kotlin","alias":["kt","kts"],"aliasTitles":{"kts":"Kotlin Script"},"require":"clike","owner":"Golmote"},"latex":{"title":"LaTeX","alias":["tex","context"],"aliasTitles":{"tex":"TeX","context":"ConTeXt"},"owner":"japborst"},"latte":{"title":"Latte","require":["clike","markup-templating","php"],"owner":"nette"},"less":{"title":"Less","require":"css","optional":"css-extras","owner":"Golmote"},"lilypond":{"title":"LilyPond","require":"scheme","alias":"ly","owner":"RunDevelopment"},"liquid":{"title":"Liquid","owner":"cinhtau"},"lisp":{"title":"Lisp","alias":["emacs","elisp","emacs-lisp"],"owner":"JuanCaicedo"},"livescript":{"title":"LiveScript","owner":"Golmote"},"llvm":{"title":"LLVM IR","owner":"porglezomp"},"lolcode":{"title":"LOLCODE","owner":"Golmote"},"lua":{"title":"Lua","owner":"Golmote"},"makefile":{"title":"Makefile","owner":"Golmote"},"markdown":{"title":"Markdown","require":"markup","alias":"md","owner":"Golmote"},"markup-templating":{"title":"Markup templating","require":"markup","owner":"Golmote"},"matlab":{"title":"MATLAB","owner":"Golmote"},"mel":{"title":"MEL","owner":"Golmote"},"mizar":{"title":"Mizar","owner":"Golmote"},"monkey":{"title":"Monkey","owner":"Golmote"},"moonscript":{"title":"MoonScript","alias":"moon","owner":"RunDevelopment"},"n1ql":{"title":"N1QL","owner":"TMWilds"},"n4js":{"title":"N4JS","require":"javascript","optional":"jsdoc","alias":"n4jsd","owner":"bsmith-n4"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","owner":"stephanmax"},"nasm":{"title":"NASM","owner":"rbmj"},"neon":{"title":"NEON","owner":"nette"},"nginx":{"title":"nginx","owner":"westonganger","require":"clike"},"nim":{"title":"Nim","owner":"Golmote"},"nix":{"title":"Nix","owner":"Golmote"},"nsis":{"title":"NSIS","owner":"idleberg"},"objectivec":{"title":"Objective-C","require":"c","alias":"objc","owner":"uranusjr"},"ocaml":{"title":"OCaml","owner":"Golmote"},"opencl":{"title":"OpenCL","require":"c","modify":["c","cpp"],"owner":"Milania1"},"oz":{"title":"Oz","owner":"Golmote"},"parigp":{"title":"PARI/GP","owner":"Golmote"},"parser":{"title":"Parser","require":"markup","owner":"Golmote"},"pascal":{"title":"Pascal","alias":"objectpascal","aliasTitles":{"objectpascal":"Object Pascal"},"owner":"Golmote"},"pascaligo":{"title":"Pascaligo","owner":"DefinitelyNotAGoat"},"pcaxis":{"title":"PC-Axis","alias":"px","owner":"RunDevelopment"},"peoplecode":{"title":"PeopleCode","alias":"pcode","owner":"RunDevelopment"},"perl":{"title":"Perl","owner":"Golmote"},"php":{"title":"PHP","require":["clike","markup-templating"],"owner":"milesj"},"phpdoc":{"title":"PHPDoc","require":["php","javadoclike"],"modify":"php","owner":"RunDevelopment"},"php-extras":{"title":"PHP Extras","require":"php","modify":"php","owner":"milesj"},"plsql":{"title":"PL/SQL","require":"sql","owner":"Golmote"},"powerquery":{"title":"PowerQuery","alias":["pq","mscript"],"owner":"peterbud"},"powershell":{"title":"PowerShell","owner":"nauzilus"},"processing":{"title":"Processing","require":"clike","owner":"Golmote"},"prolog":{"title":"Prolog","owner":"Golmote"},"properties":{"title":".properties","owner":"Golmote"},"protobuf":{"title":"Protocol Buffers","require":"clike","owner":"just-boris"},"pug":{"title":"Pug","require":["markup","javascript"],"optional":["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],"owner":"Golmote"},"puppet":{"title":"Puppet","owner":"Golmote"},"pure":{"title":"Pure","optional":["c","cpp","fortran"],"owner":"Golmote"},"purebasic":{"title":"PureBasic","require":"clike","alias":"pbfasm","owner":"HeX0R101"},"python":{"title":"Python","alias":"py","owner":"multipetros"},"q":{"title":"Q (kdb+ database)","owner":"Golmote"},"qml":{"title":"QML","require":"javascript","owner":"RunDevelopment"},"qore":{"title":"Qore","require":"clike","owner":"temnroegg"},"r":{"title":"R","owner":"Golmote"},"racket":{"title":"Racket","require":"scheme","alias":"rkt","owner":"RunDevelopment"},"jsx":{"title":"React JSX","require":["markup","javascript"],"optional":["jsdoc","js-extras","js-templates"],"owner":"vkbansal"},"tsx":{"title":"React TSX","require":["jsx","typescript"]},"reason":{"title":"Reason","require":"clike","owner":"Golmote"},"regex":{"title":"Regex","modify":["actionscript","coffeescript","flow","javascript","typescript","vala"],"owner":"RunDevelopment"},"renpy":{"title":"Ren'py","alias":"rpy","owner":"HyuchiaDiego"},"rest":{"title":"reST (reStructuredText)","owner":"Golmote"},"rip":{"title":"Rip","owner":"ravinggenius"},"roboconf":{"title":"Roboconf","owner":"Golmote"},"robotframework":{"title":"Robot Framework","alias":"robot","owner":"RunDevelopment"},"ruby":{"title":"Ruby","require":"clike","alias":"rb","owner":"samflores"},"rust":{"title":"Rust","owner":"Golmote"},"sas":{"title":"SAS","optional":["groovy","lua","sql"],"owner":"Golmote"},"sass":{"title":"Sass (Sass)","require":"css","owner":"Golmote"},"scss":{"title":"Sass (Scss)","require":"css","optional":"css-extras","owner":"MoOx"},"scala":{"title":"Scala","require":"java","owner":"jozic"},"scheme":{"title":"Scheme","owner":"bacchus123"},"shell-session":{"title":"Shell session","require":"bash","owner":"RunDevelopment"},"smali":{"title":"Smali","owner":"RunDevelopment"},"smalltalk":{"title":"Smalltalk","owner":"Golmote"},"smarty":{"title":"Smarty","require":"markup-templating","owner":"Golmote"},"solidity":{"title":"Solidity (Ethereum)","alias":"sol","require":"clike","owner":"glachaud"},"solution-file":{"title":"Solution file","alias":"sln","owner":"RunDevelopment"},"soy":{"title":"Soy (Closure Template)","require":"markup-templating","owner":"Golmote"},"sparql":{"title":"SPARQL","require":"turtle","owner":"Triply-Dev","alias":"rq"},"splunk-spl":{"title":"Splunk SPL","owner":"RunDevelopment"},"sqf":{"title":"SQF: Status Quo Function (Arma 3)","require":"clike","owner":"RunDevelopment"},"sql":{"title":"SQL","owner":"multipetros"},"iecst":{"title":"Structured Text (IEC 61131-3)","owner":"serhioromano"},"stylus":{"title":"Stylus","owner":"vkbansal"},"swift":{"title":"Swift","require":"clike","owner":"chrischares"},"t4-templating":{"title":"T4 templating","owner":"RunDevelopment"},"t4-cs":{"title":"T4 Text Templates (C#)","require":["t4-templating","csharp"],"alias":"t4","owner":"RunDevelopment"},"t4-vb":{"title":"T4 Text Templates (VB)","require":["t4-templating","vbnet"],"owner":"RunDevelopment"},"tap":{"title":"TAP","owner":"isaacs","require":"yaml"},"tcl":{"title":"Tcl","owner":"PeterChaplin"},"tt2":{"title":"Template Toolkit 2","require":["clike","markup-templating"],"owner":"gflohr"},"textile":{"title":"Textile","require":"markup","optional":"css","owner":"Golmote"},"toml":{"title":"TOML","owner":"RunDevelopment"},"turtle":{"title":"Turtle","alias":"trig","aliasTitles":{"trig":"TriG"},"owner":"jakubklimek"},"twig":{"title":"Twig","require":"markup","owner":"brandonkelly"},"typescript":{"title":"TypeScript","require":"javascript","optional":"js-templates","alias":"ts","owner":"vkbansal"},"unrealscript":{"title":"UnrealScript","alias":["uscript","uc"],"owner":"RunDevelopment"},"vala":{"title":"Vala","require":"clike","owner":"TemplarVolk"},"vbnet":{"title":"VB.Net","require":"basic","owner":"Bigsby"},"velocity":{"title":"Velocity","require":"markup","owner":"Golmote"},"verilog":{"title":"Verilog","owner":"a-rey"},"vhdl":{"title":"VHDL","owner":"a-rey"},"vim":{"title":"vim","owner":"westonganger"},"visual-basic":{"title":"Visual Basic","alias":["vb","vba"],"aliasTitles":{"vba":"VBA"},"owner":"Golmote"},"warpscript":{"title":"WarpScript","owner":"RunDevelopment"},"wasm":{"title":"WebAssembly","owner":"Golmote"},"wiki":{"title":"Wiki markup","require":"markup","owner":"Golmote"},"xeora":{"title":"Xeora","require":"markup","alias":"xeoracube","aliasTitles":{"xeoracube":"XeoraCube"},"owner":"freakmaxi"},"xml-doc":{"title":"XML doc (.net)","require":"markup","modify":["csharp","fsharp","vbnet"],"owner":"RunDevelopment"},"xojo":{"title":"Xojo (REALbasic)","owner":"Golmote"},"xquery":{"title":"XQuery","require":"markup","owner":"Golmote"},"yaml":{"title":"YAML","alias":"yml","owner":"hason"},"yang":{"title":"YANG","owner":"RunDevelopment"},"zig":{"title":"Zig","owner":"RunDevelopment"}},"plugins":{"meta":{"path":"plugins/{id}/prism-{id}","link":"plugins/{id}/"},"line-highlight":{"title":"Line Highlight","description":"Highlights specific lines and/or line ranges."},"line-numbers":{"title":"Line Numbers","description":"Line number at the beginning of code lines.","owner":"kuba-kubula"},"show-invisibles":{"title":"Show Invisibles","description":"Show hidden characters such as tabs and line breaks.","optional":["autolinker","data-uri-highlight"]},"autolinker":{"title":"Autolinker","description":"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},"wpd":{"title":"WebPlatform Docs","description":"Makes tokens link to WebPlatform.org documentation. The links open in a new tab."},"custom-class":{"title":"Custom Class","description":"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.","owner":"dvkndn","noCSS":true},"file-highlight":{"title":"File Highlight","description":"Fetch external files and highlight them with Prism. Used on the Prism website itself.","noCSS":true},"show-language":{"title":"Show Language","description":"Display the highlighted language in code blocks (inline code does not show the label).","owner":"nauzilus","noCSS":true,"require":"toolbar"},"jsonp-highlight":{"title":"JSONP Highlight","description":"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).","noCSS":true,"owner":"nauzilus"},"highlight-keywords":{"title":"Highlight Keywords","description":"Adds special CSS classes for each keyword matched in the code. For example, the keyword if will have the class keyword-if as well. You can have fine grained control over the appearance of each keyword by providing your own CSS rules.","owner":"vkbansal","noCSS":true},"remove-initial-line-feed":{"title":"Remove initial line feed","description":"Removes the initial line feed in code blocks.","owner":"Golmote","noCSS":true},"inline-color":{"title":"Inline color","description":"Adds a small inline preview for colors in style sheets.","require":"css-extras","owner":"RunDevelopment"},"previewers":{"title":"Previewers","description":"Previewers for angles, colors, gradients, easing and time.","require":"css-extras","owner":"Golmote"},"autoloader":{"title":"Autoloader","description":"Automatically loads the needed languages to highlight the code blocks.","owner":"Golmote","noCSS":true},"keep-markup":{"title":"Keep Markup","description":"Prevents custom markup from being dropped out during highlighting.","owner":"Golmote","optional":"normalize-whitespace","noCSS":true},"command-line":{"title":"Command Line","description":"Display a command line with a prompt and, optionally, the output/response from the commands.","owner":"chriswells0"},"unescaped-markup":{"title":"Unescaped Markup","description":"Write markup without having to escape anything."},"normalize-whitespace":{"title":"Normalize Whitespace","description":"Supports multiple operations to normalize whitespace in code blocks.","owner":"zeitgeist87","optional":"unescaped-markup","noCSS":true},"data-uri-highlight":{"title":"Data-URI Highlight","description":"Highlights data-URI contents.","owner":"Golmote","noCSS":true},"toolbar":{"title":"Toolbar","description":"Attach a toolbar for plugins to easily register buttons on the top of a code block.","owner":"mAAdhaTTah"},"copy-to-clipboard":{"title":"Copy to Clipboard Button","description":"Add a button that copies the code block to the clipboard when clicked.","owner":"mAAdhaTTah","require":"toolbar","noCSS":true},"download-button":{"title":"Download Button","description":"A button in the toolbar of a code block adding a convenient way to download a code file.","owner":"Golmote","require":"toolbar","noCSS":true},"match-braces":{"title":"Match braces","description":"Highlights matching braces.","owner":"RunDevelopment"},"diff-highlight":{"title":"Diff Highlight","description":"Highlights the code inside diff blocks.","owner":"RunDevelopment","require":"diff"},"filter-highlight-all":{"title":"Filter highlightAll","description":"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.","owner":"RunDevelopment","noCSS":true},"treeview":{"title":"Treeview","description":"A language with special styles to highlight file system tree structures.","owner":"Golmote"}}}; + if (module.exports) { module.exports = components; } +} (components$2)); + +var componentsExports = components$2.exports; +var components = /*@__PURE__*/getDefaultExportFromCjs(componentsExports); + +var components$1 = /*#__PURE__*/_mergeNamespaces({ + __proto__: null, + default: components +}, [componentsExports]); + +export { components$1 as c }; +//# sourceMappingURL=components-B2tMXTPO.js.map diff --git a/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js.map b/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js.map new file mode 100644 index 0000000000000000000000000000000000000000..55148f1e5f5f6d5478ca5f465d384aee319571b2 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/components-B2tMXTPO.js.map @@ -0,0 +1 @@ +{"version":3,"file":"components-B2tMXTPO.js","sources":["../../../node_modules/.pnpm/prismjs@1.21.0/node_modules/prismjs/components.js"],"sourcesContent":["var components = {\"core\":{\"meta\":{\"path\":\"components/prism-core.js\",\"option\":\"mandatory\"},\"core\":\"Core\"},\"themes\":{\"meta\":{\"path\":\"themes/{id}.css\",\"link\":\"index.html?theme={id}\",\"exclusive\":true},\"prism\":{\"title\":\"Default\",\"option\":\"default\"},\"prism-dark\":\"Dark\",\"prism-funky\":\"Funky\",\"prism-okaidia\":{\"title\":\"Okaidia\",\"owner\":\"ocodia\"},\"prism-twilight\":{\"title\":\"Twilight\",\"owner\":\"remybach\"},\"prism-coy\":{\"title\":\"Coy\",\"owner\":\"tshedor\"},\"prism-solarizedlight\":{\"title\":\"Solarized Light\",\"owner\":\"hectormatos2011 \"},\"prism-tomorrow\":{\"title\":\"Tomorrow Night\",\"owner\":\"Rosey\"}},\"languages\":{\"meta\":{\"path\":\"components/prism-{id}\",\"noCSS\":true,\"examplesPath\":\"examples/prism-{id}\",\"addCheckAll\":true},\"markup\":{\"title\":\"Markup\",\"alias\":[\"html\",\"xml\",\"svg\",\"mathml\",\"ssml\",\"atom\",\"rss\"],\"aliasTitles\":{\"html\":\"HTML\",\"xml\":\"XML\",\"svg\":\"SVG\",\"mathml\":\"MathML\",\"ssml\":\"SSML\",\"atom\":\"Atom\",\"rss\":\"RSS\"},\"option\":\"default\"},\"css\":{\"title\":\"CSS\",\"option\":\"default\",\"modify\":\"markup\"},\"clike\":{\"title\":\"C-like\",\"option\":\"default\"},\"javascript\":{\"title\":\"JavaScript\",\"require\":\"clike\",\"modify\":\"markup\",\"alias\":\"js\",\"option\":\"default\"},\"abap\":{\"title\":\"ABAP\",\"owner\":\"dellagustin\"},\"abnf\":{\"title\":\"ABNF\",\"owner\":\"RunDevelopment\"},\"actionscript\":{\"title\":\"ActionScript\",\"require\":\"javascript\",\"modify\":\"markup\",\"owner\":\"Golmote\"},\"ada\":{\"title\":\"Ada\",\"owner\":\"Lucretia\"},\"agda\":{\"title\":\"Agda\",\"owner\":\"xy-ren\"},\"al\":{\"title\":\"AL\",\"owner\":\"RunDevelopment\"},\"antlr4\":{\"title\":\"ANTLR4\",\"alias\":\"g4\",\"owner\":\"RunDevelopment\"},\"apacheconf\":{\"title\":\"Apache Configuration\",\"owner\":\"GuiTeK\"},\"apl\":{\"title\":\"APL\",\"owner\":\"ngn\"},\"applescript\":{\"title\":\"AppleScript\",\"owner\":\"Golmote\"},\"aql\":{\"title\":\"AQL\",\"owner\":\"RunDevelopment\"},\"arduino\":{\"title\":\"Arduino\",\"require\":\"cpp\",\"owner\":\"eisbehr-\"},\"arff\":{\"title\":\"ARFF\",\"owner\":\"Golmote\"},\"asciidoc\":{\"alias\":\"adoc\",\"title\":\"AsciiDoc\",\"owner\":\"Golmote\"},\"aspnet\":{\"title\":\"ASP.NET (C#)\",\"require\":[\"markup\",\"csharp\"],\"owner\":\"nauzilus\"},\"asm6502\":{\"title\":\"6502 Assembly\",\"owner\":\"kzurawel\"},\"autohotkey\":{\"title\":\"AutoHotkey\",\"owner\":\"aviaryan\"},\"autoit\":{\"title\":\"AutoIt\",\"owner\":\"Golmote\"},\"bash\":{\"title\":\"Bash\",\"alias\":\"shell\",\"aliasTitles\":{\"shell\":\"Shell\"},\"owner\":\"zeitgeist87\"},\"basic\":{\"title\":\"BASIC\",\"owner\":\"Golmote\"},\"batch\":{\"title\":\"Batch\",\"owner\":\"Golmote\"},\"bbcode\":{\"title\":\"BBcode\",\"alias\":\"shortcode\",\"aliasTitles\":{\"shortcode\":\"Shortcode\"},\"owner\":\"RunDevelopment\"},\"bison\":{\"title\":\"Bison\",\"require\":\"c\",\"owner\":\"Golmote\"},\"bnf\":{\"title\":\"BNF\",\"alias\":\"rbnf\",\"aliasTitles\":{\"rbnf\":\"RBNF\"},\"owner\":\"RunDevelopment\"},\"brainfuck\":{\"title\":\"Brainfuck\",\"owner\":\"Golmote\"},\"brightscript\":{\"title\":\"BrightScript\",\"owner\":\"RunDevelopment\"},\"bro\":{\"title\":\"Bro\",\"owner\":\"wayward710\"},\"c\":{\"title\":\"C\",\"require\":\"clike\",\"owner\":\"zeitgeist87\"},\"csharp\":{\"title\":\"C#\",\"require\":\"clike\",\"alias\":[\"cs\",\"dotnet\"],\"owner\":\"mvalipour\"},\"cpp\":{\"title\":\"C++\",\"require\":\"c\",\"owner\":\"zeitgeist87\"},\"cil\":{\"title\":\"CIL\",\"owner\":\"sbrl\"},\"clojure\":{\"title\":\"Clojure\",\"owner\":\"troglotit\"},\"cmake\":{\"title\":\"CMake\",\"owner\":\"mjrogozinski\"},\"coffeescript\":{\"title\":\"CoffeeScript\",\"require\":\"javascript\",\"alias\":\"coffee\",\"owner\":\"R-osey\"},\"concurnas\":{\"title\":\"Concurnas\",\"alias\":\"conc\",\"owner\":\"jasontatton\"},\"csp\":{\"title\":\"Content-Security-Policy\",\"owner\":\"ScottHelme\"},\"crystal\":{\"title\":\"Crystal\",\"require\":\"ruby\",\"owner\":\"MakeNowJust\"},\"css-extras\":{\"title\":\"CSS Extras\",\"require\":\"css\",\"modify\":\"css\",\"owner\":\"milesj\"},\"cypher\":{\"title\":\"Cypher\",\"owner\":\"RunDevelopment\"},\"d\":{\"title\":\"D\",\"require\":\"clike\",\"owner\":\"Golmote\"},\"dart\":{\"title\":\"Dart\",\"require\":\"clike\",\"owner\":\"Golmote\"},\"dax\":{\"title\":\"DAX\",\"owner\":\"peterbud\"},\"dhall\":{\"title\":\"Dhall\",\"owner\":\"RunDevelopment\"},\"diff\":{\"title\":\"Diff\",\"owner\":\"uranusjr\"},\"django\":{\"title\":\"Django/Jinja2\",\"require\":\"markup-templating\",\"alias\":\"jinja2\",\"owner\":\"romanvm\"},\"dns-zone-file\":{\"title\":\"DNS zone file\",\"owner\":\"RunDevelopment\",\"alias\":\"dns-zone\"},\"docker\":{\"title\":\"Docker\",\"alias\":\"dockerfile\",\"owner\":\"JustinBeckwith\"},\"ebnf\":{\"title\":\"EBNF\",\"owner\":\"RunDevelopment\"},\"editorconfig\":{\"title\":\"EditorConfig\",\"owner\":\"osipxd\"},\"eiffel\":{\"title\":\"Eiffel\",\"owner\":\"Conaclos\"},\"ejs\":{\"title\":\"EJS\",\"require\":[\"javascript\",\"markup-templating\"],\"owner\":\"RunDevelopment\",\"alias\":\"eta\",\"aliasTitles\":{\"eta\":\"Eta\"}},\"elixir\":{\"title\":\"Elixir\",\"owner\":\"Golmote\"},\"elm\":{\"title\":\"Elm\",\"owner\":\"zwilias\"},\"etlua\":{\"title\":\"Embedded Lua templating\",\"require\":[\"lua\",\"markup-templating\"],\"owner\":\"RunDevelopment\"},\"erb\":{\"title\":\"ERB\",\"require\":[\"ruby\",\"markup-templating\"],\"owner\":\"Golmote\"},\"erlang\":{\"title\":\"Erlang\",\"owner\":\"Golmote\"},\"excel-formula\":{\"title\":\"Excel Formula\",\"alias\":[\"xlsx\",\"xls\"],\"owner\":\"RunDevelopment\"},\"fsharp\":{\"title\":\"F#\",\"require\":\"clike\",\"owner\":\"simonreynolds7\"},\"factor\":{\"title\":\"Factor\",\"owner\":\"catb0t\"},\"firestore-security-rules\":{\"title\":\"Firestore security rules\",\"require\":\"clike\",\"owner\":\"RunDevelopment\"},\"flow\":{\"title\":\"Flow\",\"require\":\"javascript\",\"owner\":\"Golmote\"},\"fortran\":{\"title\":\"Fortran\",\"owner\":\"Golmote\"},\"ftl\":{\"title\":\"FreeMarker Template Language\",\"require\":\"markup-templating\",\"owner\":\"RunDevelopment\"},\"gml\":{\"title\":\"GameMaker Language\",\"alias\":\"gamemakerlanguage\",\"require\":\"clike\",\"owner\":\"LiarOnce\"},\"gcode\":{\"title\":\"G-code\",\"owner\":\"RunDevelopment\"},\"gdscript\":{\"title\":\"GDScript\",\"owner\":\"RunDevelopment\"},\"gedcom\":{\"title\":\"GEDCOM\",\"owner\":\"Golmote\"},\"gherkin\":{\"title\":\"Gherkin\",\"owner\":\"hason\"},\"git\":{\"title\":\"Git\",\"owner\":\"lgiraudel\"},\"glsl\":{\"title\":\"GLSL\",\"require\":\"c\",\"owner\":\"Golmote\"},\"go\":{\"title\":\"Go\",\"require\":\"clike\",\"owner\":\"arnehormann\"},\"graphql\":{\"title\":\"GraphQL\",\"optional\":[\"markdown\"],\"owner\":\"Golmote\"},\"groovy\":{\"title\":\"Groovy\",\"require\":\"clike\",\"owner\":\"robfletcher\"},\"haml\":{\"title\":\"Haml\",\"require\":\"ruby\",\"optional\":[\"css\",\"css-extras\",\"coffeescript\",\"erb\",\"javascript\",\"less\",\"markdown\",\"scss\",\"textile\"],\"owner\":\"Golmote\"},\"handlebars\":{\"title\":\"Handlebars\",\"require\":\"markup-templating\",\"owner\":\"Golmote\"},\"haskell\":{\"title\":\"Haskell\",\"alias\":\"hs\",\"owner\":\"bholst\"},\"haxe\":{\"title\":\"Haxe\",\"require\":\"clike\",\"owner\":\"Golmote\"},\"hcl\":{\"title\":\"HCL\",\"owner\":\"outsideris\"},\"hlsl\":{\"title\":\"HLSL\",\"require\":\"c\",\"owner\":\"RunDevelopment\"},\"http\":{\"title\":\"HTTP\",\"optional\":[\"css\",\"javascript\",\"json\",\"markup\"],\"owner\":\"danielgtaylor\"},\"hpkp\":{\"title\":\"HTTP Public-Key-Pins\",\"owner\":\"ScottHelme\"},\"hsts\":{\"title\":\"HTTP Strict-Transport-Security\",\"owner\":\"ScottHelme\"},\"ichigojam\":{\"title\":\"IchigoJam\",\"owner\":\"BlueCocoa\"},\"icon\":{\"title\":\"Icon\",\"owner\":\"Golmote\"},\"ignore\":{\"title\":\".ignore\",\"owner\":\"osipxd\",\"alias\":[\"gitignore\",\"hgignore\",\"npmignore\"],\"aliasTitles\":{\"gitignore\":\".gitignore\",\"hgignore\":\".hgignore\",\"npmignore\":\".npmignore\"}},\"inform7\":{\"title\":\"Inform 7\",\"owner\":\"Golmote\"},\"ini\":{\"title\":\"Ini\",\"owner\":\"aviaryan\"},\"io\":{\"title\":\"Io\",\"owner\":\"AlesTsurko\"},\"j\":{\"title\":\"J\",\"owner\":\"Golmote\"},\"java\":{\"title\":\"Java\",\"require\":\"clike\",\"owner\":\"sherblot\"},\"javadoc\":{\"title\":\"JavaDoc\",\"require\":[\"markup\",\"java\",\"javadoclike\"],\"modify\":\"java\",\"optional\":\"scala\",\"owner\":\"RunDevelopment\"},\"javadoclike\":{\"title\":\"JavaDoc-like\",\"modify\":[\"java\",\"javascript\",\"php\"],\"owner\":\"RunDevelopment\"},\"javastacktrace\":{\"title\":\"Java stack trace\",\"owner\":\"RunDevelopment\"},\"jolie\":{\"title\":\"Jolie\",\"require\":\"clike\",\"owner\":\"thesave\"},\"jq\":{\"title\":\"JQ\",\"owner\":\"RunDevelopment\"},\"jsdoc\":{\"title\":\"JSDoc\",\"require\":[\"javascript\",\"javadoclike\",\"typescript\"],\"modify\":\"javascript\",\"optional\":[\"actionscript\",\"coffeescript\"],\"owner\":\"RunDevelopment\"},\"js-extras\":{\"title\":\"JS Extras\",\"require\":\"javascript\",\"modify\":\"javascript\",\"optional\":[\"actionscript\",\"coffeescript\",\"flow\",\"n4js\",\"typescript\"],\"owner\":\"RunDevelopment\"},\"json\":{\"title\":\"JSON\",\"alias\":\"webmanifest\",\"aliasTitles\":{\"webmanifest\":\"Web App Manifest\"},\"owner\":\"CupOfTea696\"},\"json5\":{\"title\":\"JSON5\",\"require\":\"json\",\"owner\":\"RunDevelopment\"},\"jsonp\":{\"title\":\"JSONP\",\"require\":\"json\",\"owner\":\"RunDevelopment\"},\"jsstacktrace\":{\"title\":\"JS stack trace\",\"owner\":\"sbrl\"},\"js-templates\":{\"title\":\"JS Templates\",\"require\":\"javascript\",\"modify\":\"javascript\",\"optional\":[\"css\",\"css-extras\",\"graphql\",\"markdown\",\"markup\"],\"owner\":\"RunDevelopment\"},\"julia\":{\"title\":\"Julia\",\"owner\":\"cdagnino\"},\"keyman\":{\"title\":\"Keyman\",\"owner\":\"mcdurdin\"},\"kotlin\":{\"title\":\"Kotlin\",\"alias\":[\"kt\",\"kts\"],\"aliasTitles\":{\"kts\":\"Kotlin Script\"},\"require\":\"clike\",\"owner\":\"Golmote\"},\"latex\":{\"title\":\"LaTeX\",\"alias\":[\"tex\",\"context\"],\"aliasTitles\":{\"tex\":\"TeX\",\"context\":\"ConTeXt\"},\"owner\":\"japborst\"},\"latte\":{\"title\":\"Latte\",\"require\":[\"clike\",\"markup-templating\",\"php\"],\"owner\":\"nette\"},\"less\":{\"title\":\"Less\",\"require\":\"css\",\"optional\":\"css-extras\",\"owner\":\"Golmote\"},\"lilypond\":{\"title\":\"LilyPond\",\"require\":\"scheme\",\"alias\":\"ly\",\"owner\":\"RunDevelopment\"},\"liquid\":{\"title\":\"Liquid\",\"owner\":\"cinhtau\"},\"lisp\":{\"title\":\"Lisp\",\"alias\":[\"emacs\",\"elisp\",\"emacs-lisp\"],\"owner\":\"JuanCaicedo\"},\"livescript\":{\"title\":\"LiveScript\",\"owner\":\"Golmote\"},\"llvm\":{\"title\":\"LLVM IR\",\"owner\":\"porglezomp\"},\"lolcode\":{\"title\":\"LOLCODE\",\"owner\":\"Golmote\"},\"lua\":{\"title\":\"Lua\",\"owner\":\"Golmote\"},\"makefile\":{\"title\":\"Makefile\",\"owner\":\"Golmote\"},\"markdown\":{\"title\":\"Markdown\",\"require\":\"markup\",\"alias\":\"md\",\"owner\":\"Golmote\"},\"markup-templating\":{\"title\":\"Markup templating\",\"require\":\"markup\",\"owner\":\"Golmote\"},\"matlab\":{\"title\":\"MATLAB\",\"owner\":\"Golmote\"},\"mel\":{\"title\":\"MEL\",\"owner\":\"Golmote\"},\"mizar\":{\"title\":\"Mizar\",\"owner\":\"Golmote\"},\"monkey\":{\"title\":\"Monkey\",\"owner\":\"Golmote\"},\"moonscript\":{\"title\":\"MoonScript\",\"alias\":\"moon\",\"owner\":\"RunDevelopment\"},\"n1ql\":{\"title\":\"N1QL\",\"owner\":\"TMWilds\"},\"n4js\":{\"title\":\"N4JS\",\"require\":\"javascript\",\"optional\":\"jsdoc\",\"alias\":\"n4jsd\",\"owner\":\"bsmith-n4\"},\"nand2tetris-hdl\":{\"title\":\"Nand To Tetris HDL\",\"owner\":\"stephanmax\"},\"nasm\":{\"title\":\"NASM\",\"owner\":\"rbmj\"},\"neon\":{\"title\":\"NEON\",\"owner\":\"nette\"},\"nginx\":{\"title\":\"nginx\",\"owner\":\"westonganger\",\"require\":\"clike\"},\"nim\":{\"title\":\"Nim\",\"owner\":\"Golmote\"},\"nix\":{\"title\":\"Nix\",\"owner\":\"Golmote\"},\"nsis\":{\"title\":\"NSIS\",\"owner\":\"idleberg\"},\"objectivec\":{\"title\":\"Objective-C\",\"require\":\"c\",\"alias\":\"objc\",\"owner\":\"uranusjr\"},\"ocaml\":{\"title\":\"OCaml\",\"owner\":\"Golmote\"},\"opencl\":{\"title\":\"OpenCL\",\"require\":\"c\",\"modify\":[\"c\",\"cpp\"],\"owner\":\"Milania1\"},\"oz\":{\"title\":\"Oz\",\"owner\":\"Golmote\"},\"parigp\":{\"title\":\"PARI/GP\",\"owner\":\"Golmote\"},\"parser\":{\"title\":\"Parser\",\"require\":\"markup\",\"owner\":\"Golmote\"},\"pascal\":{\"title\":\"Pascal\",\"alias\":\"objectpascal\",\"aliasTitles\":{\"objectpascal\":\"Object Pascal\"},\"owner\":\"Golmote\"},\"pascaligo\":{\"title\":\"Pascaligo\",\"owner\":\"DefinitelyNotAGoat\"},\"pcaxis\":{\"title\":\"PC-Axis\",\"alias\":\"px\",\"owner\":\"RunDevelopment\"},\"peoplecode\":{\"title\":\"PeopleCode\",\"alias\":\"pcode\",\"owner\":\"RunDevelopment\"},\"perl\":{\"title\":\"Perl\",\"owner\":\"Golmote\"},\"php\":{\"title\":\"PHP\",\"require\":[\"clike\",\"markup-templating\"],\"owner\":\"milesj\"},\"phpdoc\":{\"title\":\"PHPDoc\",\"require\":[\"php\",\"javadoclike\"],\"modify\":\"php\",\"owner\":\"RunDevelopment\"},\"php-extras\":{\"title\":\"PHP Extras\",\"require\":\"php\",\"modify\":\"php\",\"owner\":\"milesj\"},\"plsql\":{\"title\":\"PL/SQL\",\"require\":\"sql\",\"owner\":\"Golmote\"},\"powerquery\":{\"title\":\"PowerQuery\",\"alias\":[\"pq\",\"mscript\"],\"owner\":\"peterbud\"},\"powershell\":{\"title\":\"PowerShell\",\"owner\":\"nauzilus\"},\"processing\":{\"title\":\"Processing\",\"require\":\"clike\",\"owner\":\"Golmote\"},\"prolog\":{\"title\":\"Prolog\",\"owner\":\"Golmote\"},\"properties\":{\"title\":\".properties\",\"owner\":\"Golmote\"},\"protobuf\":{\"title\":\"Protocol Buffers\",\"require\":\"clike\",\"owner\":\"just-boris\"},\"pug\":{\"title\":\"Pug\",\"require\":[\"markup\",\"javascript\"],\"optional\":[\"coffeescript\",\"ejs\",\"handlebars\",\"less\",\"livescript\",\"markdown\",\"scss\",\"stylus\",\"twig\"],\"owner\":\"Golmote\"},\"puppet\":{\"title\":\"Puppet\",\"owner\":\"Golmote\"},\"pure\":{\"title\":\"Pure\",\"optional\":[\"c\",\"cpp\",\"fortran\"],\"owner\":\"Golmote\"},\"purebasic\":{\"title\":\"PureBasic\",\"require\":\"clike\",\"alias\":\"pbfasm\",\"owner\":\"HeX0R101\"},\"python\":{\"title\":\"Python\",\"alias\":\"py\",\"owner\":\"multipetros\"},\"q\":{\"title\":\"Q (kdb+ database)\",\"owner\":\"Golmote\"},\"qml\":{\"title\":\"QML\",\"require\":\"javascript\",\"owner\":\"RunDevelopment\"},\"qore\":{\"title\":\"Qore\",\"require\":\"clike\",\"owner\":\"temnroegg\"},\"r\":{\"title\":\"R\",\"owner\":\"Golmote\"},\"racket\":{\"title\":\"Racket\",\"require\":\"scheme\",\"alias\":\"rkt\",\"owner\":\"RunDevelopment\"},\"jsx\":{\"title\":\"React JSX\",\"require\":[\"markup\",\"javascript\"],\"optional\":[\"jsdoc\",\"js-extras\",\"js-templates\"],\"owner\":\"vkbansal\"},\"tsx\":{\"title\":\"React TSX\",\"require\":[\"jsx\",\"typescript\"]},\"reason\":{\"title\":\"Reason\",\"require\":\"clike\",\"owner\":\"Golmote\"},\"regex\":{\"title\":\"Regex\",\"modify\":[\"actionscript\",\"coffeescript\",\"flow\",\"javascript\",\"typescript\",\"vala\"],\"owner\":\"RunDevelopment\"},\"renpy\":{\"title\":\"Ren'py\",\"alias\":\"rpy\",\"owner\":\"HyuchiaDiego\"},\"rest\":{\"title\":\"reST (reStructuredText)\",\"owner\":\"Golmote\"},\"rip\":{\"title\":\"Rip\",\"owner\":\"ravinggenius\"},\"roboconf\":{\"title\":\"Roboconf\",\"owner\":\"Golmote\"},\"robotframework\":{\"title\":\"Robot Framework\",\"alias\":\"robot\",\"owner\":\"RunDevelopment\"},\"ruby\":{\"title\":\"Ruby\",\"require\":\"clike\",\"alias\":\"rb\",\"owner\":\"samflores\"},\"rust\":{\"title\":\"Rust\",\"owner\":\"Golmote\"},\"sas\":{\"title\":\"SAS\",\"optional\":[\"groovy\",\"lua\",\"sql\"],\"owner\":\"Golmote\"},\"sass\":{\"title\":\"Sass (Sass)\",\"require\":\"css\",\"owner\":\"Golmote\"},\"scss\":{\"title\":\"Sass (Scss)\",\"require\":\"css\",\"optional\":\"css-extras\",\"owner\":\"MoOx\"},\"scala\":{\"title\":\"Scala\",\"require\":\"java\",\"owner\":\"jozic\"},\"scheme\":{\"title\":\"Scheme\",\"owner\":\"bacchus123\"},\"shell-session\":{\"title\":\"Shell session\",\"require\":\"bash\",\"owner\":\"RunDevelopment\"},\"smali\":{\"title\":\"Smali\",\"owner\":\"RunDevelopment\"},\"smalltalk\":{\"title\":\"Smalltalk\",\"owner\":\"Golmote\"},\"smarty\":{\"title\":\"Smarty\",\"require\":\"markup-templating\",\"owner\":\"Golmote\"},\"solidity\":{\"title\":\"Solidity (Ethereum)\",\"alias\":\"sol\",\"require\":\"clike\",\"owner\":\"glachaud\"},\"solution-file\":{\"title\":\"Solution file\",\"alias\":\"sln\",\"owner\":\"RunDevelopment\"},\"soy\":{\"title\":\"Soy (Closure Template)\",\"require\":\"markup-templating\",\"owner\":\"Golmote\"},\"sparql\":{\"title\":\"SPARQL\",\"require\":\"turtle\",\"owner\":\"Triply-Dev\",\"alias\":\"rq\"},\"splunk-spl\":{\"title\":\"Splunk SPL\",\"owner\":\"RunDevelopment\"},\"sqf\":{\"title\":\"SQF: Status Quo Function (Arma 3)\",\"require\":\"clike\",\"owner\":\"RunDevelopment\"},\"sql\":{\"title\":\"SQL\",\"owner\":\"multipetros\"},\"iecst\":{\"title\":\"Structured Text (IEC 61131-3)\",\"owner\":\"serhioromano\"},\"stylus\":{\"title\":\"Stylus\",\"owner\":\"vkbansal\"},\"swift\":{\"title\":\"Swift\",\"require\":\"clike\",\"owner\":\"chrischares\"},\"t4-templating\":{\"title\":\"T4 templating\",\"owner\":\"RunDevelopment\"},\"t4-cs\":{\"title\":\"T4 Text Templates (C#)\",\"require\":[\"t4-templating\",\"csharp\"],\"alias\":\"t4\",\"owner\":\"RunDevelopment\"},\"t4-vb\":{\"title\":\"T4 Text Templates (VB)\",\"require\":[\"t4-templating\",\"vbnet\"],\"owner\":\"RunDevelopment\"},\"tap\":{\"title\":\"TAP\",\"owner\":\"isaacs\",\"require\":\"yaml\"},\"tcl\":{\"title\":\"Tcl\",\"owner\":\"PeterChaplin\"},\"tt2\":{\"title\":\"Template Toolkit 2\",\"require\":[\"clike\",\"markup-templating\"],\"owner\":\"gflohr\"},\"textile\":{\"title\":\"Textile\",\"require\":\"markup\",\"optional\":\"css\",\"owner\":\"Golmote\"},\"toml\":{\"title\":\"TOML\",\"owner\":\"RunDevelopment\"},\"turtle\":{\"title\":\"Turtle\",\"alias\":\"trig\",\"aliasTitles\":{\"trig\":\"TriG\"},\"owner\":\"jakubklimek\"},\"twig\":{\"title\":\"Twig\",\"require\":\"markup\",\"owner\":\"brandonkelly\"},\"typescript\":{\"title\":\"TypeScript\",\"require\":\"javascript\",\"optional\":\"js-templates\",\"alias\":\"ts\",\"owner\":\"vkbansal\"},\"unrealscript\":{\"title\":\"UnrealScript\",\"alias\":[\"uscript\",\"uc\"],\"owner\":\"RunDevelopment\"},\"vala\":{\"title\":\"Vala\",\"require\":\"clike\",\"owner\":\"TemplarVolk\"},\"vbnet\":{\"title\":\"VB.Net\",\"require\":\"basic\",\"owner\":\"Bigsby\"},\"velocity\":{\"title\":\"Velocity\",\"require\":\"markup\",\"owner\":\"Golmote\"},\"verilog\":{\"title\":\"Verilog\",\"owner\":\"a-rey\"},\"vhdl\":{\"title\":\"VHDL\",\"owner\":\"a-rey\"},\"vim\":{\"title\":\"vim\",\"owner\":\"westonganger\"},\"visual-basic\":{\"title\":\"Visual Basic\",\"alias\":[\"vb\",\"vba\"],\"aliasTitles\":{\"vba\":\"VBA\"},\"owner\":\"Golmote\"},\"warpscript\":{\"title\":\"WarpScript\",\"owner\":\"RunDevelopment\"},\"wasm\":{\"title\":\"WebAssembly\",\"owner\":\"Golmote\"},\"wiki\":{\"title\":\"Wiki markup\",\"require\":\"markup\",\"owner\":\"Golmote\"},\"xeora\":{\"title\":\"Xeora\",\"require\":\"markup\",\"alias\":\"xeoracube\",\"aliasTitles\":{\"xeoracube\":\"XeoraCube\"},\"owner\":\"freakmaxi\"},\"xml-doc\":{\"title\":\"XML doc (.net)\",\"require\":\"markup\",\"modify\":[\"csharp\",\"fsharp\",\"vbnet\"],\"owner\":\"RunDevelopment\"},\"xojo\":{\"title\":\"Xojo (REALbasic)\",\"owner\":\"Golmote\"},\"xquery\":{\"title\":\"XQuery\",\"require\":\"markup\",\"owner\":\"Golmote\"},\"yaml\":{\"title\":\"YAML\",\"alias\":\"yml\",\"owner\":\"hason\"},\"yang\":{\"title\":\"YANG\",\"owner\":\"RunDevelopment\"},\"zig\":{\"title\":\"Zig\",\"owner\":\"RunDevelopment\"}},\"plugins\":{\"meta\":{\"path\":\"plugins/{id}/prism-{id}\",\"link\":\"plugins/{id}/\"},\"line-highlight\":{\"title\":\"Line Highlight\",\"description\":\"Highlights specific lines and/or line ranges.\"},\"line-numbers\":{\"title\":\"Line Numbers\",\"description\":\"Line number at the beginning of code lines.\",\"owner\":\"kuba-kubula\"},\"show-invisibles\":{\"title\":\"Show Invisibles\",\"description\":\"Show hidden characters such as tabs and line breaks.\",\"optional\":[\"autolinker\",\"data-uri-highlight\"]},\"autolinker\":{\"title\":\"Autolinker\",\"description\":\"Converts URLs and emails in code to clickable links. Parses Markdown links in comments.\"},\"wpd\":{\"title\":\"WebPlatform Docs\",\"description\":\"Makes tokens link to WebPlatform.org documentation. The links open in a new tab.\"},\"custom-class\":{\"title\":\"Custom Class\",\"description\":\"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.\",\"owner\":\"dvkndn\",\"noCSS\":true},\"file-highlight\":{\"title\":\"File Highlight\",\"description\":\"Fetch external files and highlight them with Prism. Used on the Prism website itself.\",\"noCSS\":true},\"show-language\":{\"title\":\"Show Language\",\"description\":\"Display the highlighted language in code blocks (inline code does not show the label).\",\"owner\":\"nauzilus\",\"noCSS\":true,\"require\":\"toolbar\"},\"jsonp-highlight\":{\"title\":\"JSONP Highlight\",\"description\":\"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).\",\"noCSS\":true,\"owner\":\"nauzilus\"},\"highlight-keywords\":{\"title\":\"Highlight Keywords\",\"description\":\"Adds special CSS classes for each keyword matched in the code. For example, the keyword if will have the class keyword-if as well. You can have fine grained control over the appearance of each keyword by providing your own CSS rules.\",\"owner\":\"vkbansal\",\"noCSS\":true},\"remove-initial-line-feed\":{\"title\":\"Remove initial line feed\",\"description\":\"Removes the initial line feed in code blocks.\",\"owner\":\"Golmote\",\"noCSS\":true},\"inline-color\":{\"title\":\"Inline color\",\"description\":\"Adds a small inline preview for colors in style sheets.\",\"require\":\"css-extras\",\"owner\":\"RunDevelopment\"},\"previewers\":{\"title\":\"Previewers\",\"description\":\"Previewers for angles, colors, gradients, easing and time.\",\"require\":\"css-extras\",\"owner\":\"Golmote\"},\"autoloader\":{\"title\":\"Autoloader\",\"description\":\"Automatically loads the needed languages to highlight the code blocks.\",\"owner\":\"Golmote\",\"noCSS\":true},\"keep-markup\":{\"title\":\"Keep Markup\",\"description\":\"Prevents custom markup from being dropped out during highlighting.\",\"owner\":\"Golmote\",\"optional\":\"normalize-whitespace\",\"noCSS\":true},\"command-line\":{\"title\":\"Command Line\",\"description\":\"Display a command line with a prompt and, optionally, the output/response from the commands.\",\"owner\":\"chriswells0\"},\"unescaped-markup\":{\"title\":\"Unescaped Markup\",\"description\":\"Write markup without having to escape anything.\"},\"normalize-whitespace\":{\"title\":\"Normalize Whitespace\",\"description\":\"Supports multiple operations to normalize whitespace in code blocks.\",\"owner\":\"zeitgeist87\",\"optional\":\"unescaped-markup\",\"noCSS\":true},\"data-uri-highlight\":{\"title\":\"Data-URI Highlight\",\"description\":\"Highlights data-URI contents.\",\"owner\":\"Golmote\",\"noCSS\":true},\"toolbar\":{\"title\":\"Toolbar\",\"description\":\"Attach a toolbar for plugins to easily register buttons on the top of a code block.\",\"owner\":\"mAAdhaTTah\"},\"copy-to-clipboard\":{\"title\":\"Copy to Clipboard Button\",\"description\":\"Add a button that copies the code block to the clipboard when clicked.\",\"owner\":\"mAAdhaTTah\",\"require\":\"toolbar\",\"noCSS\":true},\"download-button\":{\"title\":\"Download Button\",\"description\":\"A button in the toolbar of a code block adding a convenient way to download a code file.\",\"owner\":\"Golmote\",\"require\":\"toolbar\",\"noCSS\":true},\"match-braces\":{\"title\":\"Match braces\",\"description\":\"Highlights matching braces.\",\"owner\":\"RunDevelopment\"},\"diff-highlight\":{\"title\":\"Diff Highlight\",\"description\":\"Highlights the code inside diff blocks.\",\"owner\":\"RunDevelopment\",\"require\":\"diff\"},\"filter-highlight-all\":{\"title\":\"Filter highlightAll\",\"description\":\"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.\",\"owner\":\"RunDevelopment\",\"noCSS\":true},\"treeview\":{\"title\":\"Treeview\",\"description\":\"A language with special styles to highlight file system tree structures.\",\"owner\":\"Golmote\"}}};\nif (typeof module !== 'undefined' && module.exports) { module.exports = components; }"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,CAAA,IAAI,UAAA,GAAa,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC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Aa,CAAC,6BAA6B,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,yCAAyC,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,mHAAmH,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,0EAA0E,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;CAC1mpB,IAAqC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAiB,CAAA,OAAA,GAAA,UAAU,CAAC,EAAA;;;;;;;;;;;;;","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js b/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js new file mode 100644 index 0000000000000000000000000000000000000000..3950d6324c65bc0087b36af0640b2a1928784284 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js @@ -0,0 +1,24624 @@ +import { parse as parse$7 } from 'svelte/compiler'; +import require$$0$2 from 'path'; + +const defineConfig = (config) => config; + +function make_process() { + const process = { + title: 'browser', + argv: [], + version: '', // empty string to avoid regexp issues + versions: { + http_parser: '', + node: '', + v8: '', + ares: '', + uv: '', + zlib: '', + brotli: '', + modules: '', + nghttp2: '', + napi: '', + llhttp: '', + openssl: '', + icu: '', + tz: '', + unicode: '', + }, + env: { + NODE_ENV: 'production', + }, + stdout: { + isTTY: false, + }, + binding() { + return; + }, + cwd() { + return '/'; + }, + chdir() { + return; + }, + umask() { + return 0; + }, + on: noop, + addListener: noop, + once: noop, + off: noop, + removeListener: noop, + removeAllListeners: noop, + emit: noop, + }; + + function noop() {} + + return process; +} + +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +var bail_1 = bail$2; + +function bail$2(err) { + if (err) { + throw err + } +} + +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var isBuffer = function isBuffer (obj) { + return obj != null && obj.constructor != null && + typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +}; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; +var defineProperty = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target +var setProperty = function setProperty(target, options) { + if (defineProperty && options.name === '__proto__') { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } +}; + +// Return undefined instead of __proto__ if '__proto__' is not an own property +var getProperty = function getProperty(obj, name) { + if (name === '__proto__') { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + // In early versions of node, obj['__proto__'] is buggy when obj has + // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. + return gOPD(obj, name).value; + } + } + + return obj[name]; +}; + +var extend$5 = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + setProperty(target, { name: name, newValue: copy }); + } + } + } + } + } + + // Return the modified object + return target; +}; + +var isPlainObj = value => { + if (Object.prototype.toString.call(value) !== '[object Object]') { + return false; + } + + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.prototype; +}; + +var slice$3 = [].slice; + +var wrap_1$1 = wrap$8; + +// Wrap `fn`. +// Can be sync or async; return a promise, receive a completion handler, return +// new values and errors. +function wrap$8(fn, callback) { + var invoked; + + return wrapped + + function wrapped() { + var params = slice$3.call(arguments, 0); + var callback = fn.length > params.length; + var result; + + if (callback) { + params.push(done); + } + + try { + result = fn.apply(null, params); + } catch (error) { + // Well, this is quite the pickle. + // `fn` received a callback and invoked it (thus continuing the pipeline), + // but later also threw an error. + // We’re not about to restart the pipeline again, so the only thing left + // to do is to throw the thing instead. + if (callback && invoked) { + throw error + } + + return done(error) + } + + if (!callback) { + if (result && typeof result.then === 'function') { + result.then(then, done); + } else if (result instanceof Error) { + done(result); + } else { + then(result); + } + } + } + + // Invoke `next`, only once. + function done() { + if (!invoked) { + invoked = true; + + callback.apply(null, arguments); + } + } + + // Invoke `done` with one value. + // Tracks if an error is passed, too. + function then(value) { + done(null, value); + } +} + +var wrap$7 = wrap_1$1; + +var trough_1 = trough$2; + +trough$2.wrap = wrap$7; + +var slice$2 = [].slice; + +// Create new middleware. +function trough$2() { + var fns = []; + var middleware = {}; + + middleware.run = run; + middleware.use = use; + + return middleware + + // Run `fns`. Last argument must be a completion handler. + function run() { + var index = -1; + var input = slice$2.call(arguments, 0, -1); + var done = arguments[arguments.length - 1]; + + if (typeof done !== 'function') { + throw new Error('Expected function as last argument, not ' + done) + } + + next.apply(null, [null].concat(input)); + + // Run the next `fn`, if any. + function next(err) { + var fn = fns[++index]; + var params = slice$2.call(arguments, 0); + var values = params.slice(1); + var length = input.length; + var pos = -1; + + if (err) { + done(err); + return + } + + // Copy non-nully input into values. + while (++pos < length) { + if (values[pos] === null || values[pos] === undefined) { + values[pos] = input[pos]; + } + } + + input = values; + + // Next or done. + if (fn) { + wrap$7(fn, next).apply(null, input); + } else { + done.apply(null, [null].concat(input)); + } + } + } + + // Add `fn` to the list. + function use(fn) { + if (typeof fn !== 'function') { + throw new Error('Expected `fn` to be a function, not ' + fn) + } + + fns.push(fn); + + return middleware + } +} + +var own$c = {}.hasOwnProperty; + +var unistUtilStringifyPosition = stringify$6; + +function stringify$6(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } + + // Node. + if (own$c.call(value, 'position') || own$c.call(value, 'type')) { + return position$3(value.position) + } + + // Position. + if (own$c.call(value, 'start') || own$c.call(value, 'end')) { + return position$3(value) + } + + // Point. + if (own$c.call(value, 'line') || own$c.call(value, 'column')) { + return point(value) + } + + // ? + return '' +} + +function point(point) { + if (!point || typeof point !== 'object') { + point = {}; + } + + return index(point.line) + ':' + index(point.column) +} + +function position$3(pos) { + if (!pos || typeof pos !== 'object') { + pos = {}; + } + + return point(pos.start) + '-' + point(pos.end) +} + +function index(value) { + return value && typeof value === 'number' ? value : 1 +} + +var stringify$5 = unistUtilStringifyPosition; + +var vfileMessage = VMessage$1; + +// Inherit from `Error#`. +function VMessagePrototype() {} +VMessagePrototype.prototype = Error.prototype; +VMessage$1.prototype = new VMessagePrototype(); + +// Message properties. +var proto$6 = VMessage$1.prototype; + +proto$6.file = ''; +proto$6.name = ''; +proto$6.reason = ''; +proto$6.message = ''; +proto$6.stack = ''; +proto$6.fatal = null; +proto$6.column = null; +proto$6.line = null; + +// Construct a new VMessage. +// +// Note: We cannot invoke `Error` on the created context, as that adds readonly +// `line` and `column` attributes on Safari 9, thus throwing and failing the +// data. +function VMessage$1(reason, position, origin) { + var parts; + var range; + var location; + + if (typeof position === 'string') { + origin = position; + position = null; + } + + parts = parseOrigin(origin); + range = stringify$5(position) || '1:1'; + + location = { + start: {line: null, column: null}, + end: {line: null, column: null} + }; + + // Node. + if (position && position.position) { + position = position.position; + } + + if (position) { + // Position. + if (position.start) { + location = position; + position = position.start; + } else { + // Point. + location.start = position; + } + } + + if (reason.stack) { + this.stack = reason.stack; + reason = reason.message; + } + + this.message = reason; + this.name = range; + this.reason = reason; + this.line = position ? position.line : null; + this.column = position ? position.column : null; + this.location = location; + this.source = parts[0]; + this.ruleId = parts[1]; +} + +function parseOrigin(origin) { + var result = [null, null]; + var index; + + if (typeof origin === 'string') { + index = origin.indexOf(':'); + + if (index === -1) { + result[1] = origin; + } else { + result[0] = origin.slice(0, index); + result[1] = origin.slice(index + 1); + } + } + + return result +} + +var Message = /*@__PURE__*/getDefaultExportFromCjs(vfileMessage); + +var path$2 = require$$0$2; + +function replaceExt(npath, ext) { + if (typeof npath !== 'string') { + return npath; + } + + if (npath.length === 0) { + return npath; + } + + var nFileName = path$2.basename(npath, path$2.extname(npath)) + ext; + return path$2.join(path$2.dirname(npath), nFileName); +} + +var replaceExt_1 = replaceExt; + +var path$1 = require$$0$2; +var replace = replaceExt_1; +var buffer$1 = isBuffer; + +var core$1 = VFile$1; + +var own$b = {}.hasOwnProperty; +var proto$5 = VFile$1.prototype; + +// Order of setting (least specific to most), we need this because otherwise +// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a +// stem can be set. +var order$1 = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']; + +proto$5.toString = toString$3; + +// Access full path (`~/index.min.js`). +Object.defineProperty(proto$5, 'path', {get: getPath, set: setPath}); + +// Access parent path (`~`). +Object.defineProperty(proto$5, 'dirname', {get: getDirname, set: setDirname}); + +// Access basename (`index.min.js`). +Object.defineProperty(proto$5, 'basename', {get: getBasename, set: setBasename}); + +// Access extname (`.js`). +Object.defineProperty(proto$5, 'extname', {get: getExtname, set: setExtname}); + +// Access stem (`index.min`). +Object.defineProperty(proto$5, 'stem', {get: getStem, set: setStem}); + +// Construct a new file. +function VFile$1(options) { + var prop; + var index; + var length; + + if (!options) { + options = {}; + } else if (typeof options === 'string' || buffer$1(options)) { + options = {contents: options}; + } else if ('message' in options && 'messages' in options) { + return options + } + + if (!(this instanceof VFile$1)) { + return new VFile$1(options) + } + + this.data = {}; + this.messages = []; + this.history = []; + this.cwd = process.cwd(); + + // Set path related properties in the correct order. + index = -1; + length = order$1.length; + + while (++index < length) { + prop = order$1[index]; + + if (own$b.call(options, prop)) { + this[prop] = options[prop]; + } + } + + // Set non-path related properties. + for (prop in options) { + if (order$1.indexOf(prop) === -1) { + this[prop] = options[prop]; + } + } +} + +function getPath() { + return this.history[this.history.length - 1] +} + +function setPath(path) { + assertNonEmpty(path, 'path'); + + if (path !== this.path) { + this.history.push(path); + } +} + +function getDirname() { + return typeof this.path === 'string' ? path$1.dirname(this.path) : undefined +} + +function setDirname(dirname) { + assertPath(this.path, 'dirname'); + this.path = path$1.join(dirname || '', this.basename); +} + +function getBasename() { + return typeof this.path === 'string' ? path$1.basename(this.path) : undefined +} + +function setBasename(basename) { + assertNonEmpty(basename, 'basename'); + assertPart(basename, 'basename'); + this.path = path$1.join(this.dirname || '', basename); +} + +function getExtname() { + return typeof this.path === 'string' ? path$1.extname(this.path) : undefined +} + +function setExtname(extname) { + var ext = extname || ''; + + assertPart(ext, 'extname'); + assertPath(this.path, 'extname'); + + if (ext) { + if (ext.charAt(0) !== '.') { + throw new Error('`extname` must start with `.`') + } + + if (ext.indexOf('.', 1) !== -1) { + throw new Error('`extname` cannot contain multiple dots') + } + } + + this.path = replace(this.path, ext); +} + +function getStem() { + return typeof this.path === 'string' + ? path$1.basename(this.path, this.extname) + : undefined +} + +function setStem(stem) { + assertNonEmpty(stem, 'stem'); + assertPart(stem, 'stem'); + this.path = path$1.join(this.dirname || '', stem + (this.extname || '')); +} + +// Get the value of the file. +function toString$3(encoding) { + var value = this.contents || ''; + return buffer$1(value) ? value.toString(encoding) : String(value) +} + +// Assert that `part` is not a path (i.e., does not contain `path.sep`). +function assertPart(part, name) { + if (part.indexOf(path$1.sep) !== -1) { + throw new Error( + '`' + name + '` cannot be a path: did not expect `' + path$1.sep + '`' + ) + } +} + +// Assert that `part` is not empty. +function assertNonEmpty(part, name) { + if (!part) { + throw new Error('`' + name + '` cannot be empty') + } +} + +// Assert `path` exists. +function assertPath(path, name) { + if (!path) { + throw new Error('Setting `' + name + '` requires `path` to be set too') + } +} + +var VMessage = vfileMessage; +var VFile = core$1; + +var vfile$2 = VFile; + +var proto$4 = VFile.prototype; + +proto$4.message = message; +proto$4.info = info$1; +proto$4.fail = fail; + +// Create a message with `reason` at `position`. +// When an error is passed in as `reason`, copies the stack. +function message(reason, position, origin) { + var filePath = this.path; + var message = new VMessage(reason, position, origin); + + if (filePath) { + message.name = filePath + ':' + message.name; + message.file = filePath; + } + + message.fatal = false; + + this.messages.push(message); + + return message +} + +// Fail: creates a vmessage, associates it with the file, and throws it. +function fail() { + var message = this.message.apply(this, arguments); + + message.fatal = true; + + throw message +} + +// Info: creates a vmessage, associates it with the file, and marks the fatality +// as null. +function info$1() { + var message = this.message.apply(this, arguments); + + message.fatal = null; + + return message +} + +var bail$1 = bail_1; +var buffer = isBuffer; +var extend$4 = extend$5; +var plain$1 = isPlainObj; +var trough$1 = trough_1; +var vfile$1 = vfile$2; + +// Expose a frozen processor. +var unified_1$1 = unified$2().freeze(); + +var slice$1 = [].slice; +var own$a = {}.hasOwnProperty; + +// Process pipeline. +var pipeline$1 = trough$1() + .use(pipelineParse$1) + .use(pipelineRun$1) + .use(pipelineStringify$1); + +function pipelineParse$1(p, ctx) { + ctx.tree = p.parse(ctx.file); +} + +function pipelineRun$1(p, ctx, next) { + p.run(ctx.tree, ctx.file, done); + + function done(err, tree, file) { + if (err) { + next(err); + } else { + ctx.tree = tree; + ctx.file = file; + next(); + } + } +} + +function pipelineStringify$1(p, ctx) { + var result = p.stringify(ctx.tree, ctx.file); + var file = ctx.file; + + if (result === undefined || result === null) ; else if (typeof result === 'string' || buffer(result)) { + file.contents = result; + } else { + file.result = result; + } +} + +// Function to create the first processor. +function unified$2() { + var attachers = []; + var transformers = trough$1(); + var namespace = {}; + var frozen = false; + var freezeIndex = -1; + + // Data management. + processor.data = data; + + // Lock. + processor.freeze = freeze; + + // Plugins. + processor.attachers = attachers; + processor.use = use; + + // API. + processor.parse = parse; + processor.stringify = stringify; + processor.run = run; + processor.runSync = runSync; + processor.process = process; + processor.processSync = processSync; + + // Expose. + return processor + + // Create a new processor based on the processor in the current scope. + function processor() { + var destination = unified$2(); + var length = attachers.length; + var index = -1; + + while (++index < length) { + destination.use.apply(null, attachers[index]); + } + + destination.data(extend$4(true, {}, namespace)); + + return destination + } + + // Freeze: used to signal a processor that has finished configuration. + // + // For example, take unified itself: it’s frozen. + // Plugins should not be added to it. + // Rather, it should be extended, by invoking it, before modifying it. + // + // In essence, always invoke this when exporting a processor. + function freeze() { + var values; + var plugin; + var options; + var transformer; + + if (frozen) { + return processor + } + + while (++freezeIndex < attachers.length) { + values = attachers[freezeIndex]; + plugin = values[0]; + options = values[1]; + transformer = null; + + if (options === false) { + continue + } + + if (options === true) { + values[1] = undefined; + } + + transformer = plugin.apply(processor, values.slice(1)); + + if (typeof transformer === 'function') { + transformers.use(transformer); + } + } + + frozen = true; + freezeIndex = Infinity; + + return processor + } + + // Data management. + // Getter / setter for processor-specific informtion. + function data(key, value) { + if (typeof key === 'string') { + // Set `key`. + if (arguments.length === 2) { + assertUnfrozen$1('data', frozen); + + namespace[key] = value; + + return processor + } + + // Get `key`. + return (own$a.call(namespace, key) && namespace[key]) || null + } + + // Set space. + if (key) { + assertUnfrozen$1('data', frozen); + namespace = key; + return processor + } + + // Get space. + return namespace + } + + // Plugin management. + // + // Pass it: + // * an attacher and options, + // * a preset, + // * a list of presets, attachers, and arguments (list of attachers and + // options). + function use(value) { + var settings; + + assertUnfrozen$1('use', frozen); + + if (value === null || value === undefined) ; else if (typeof value === 'function') { + addPlugin.apply(null, arguments); + } else if (typeof value === 'object') { + if ('length' in value) { + addList(value); + } else { + addPreset(value); + } + } else { + throw new Error('Expected usable value, not `' + value + '`') + } + + if (settings) { + namespace.settings = extend$4(namespace.settings || {}, settings); + } + + return processor + + function addPreset(result) { + addList(result.plugins); + + if (result.settings) { + settings = extend$4(settings || {}, result.settings); + } + } + + function add(value) { + if (typeof value === 'function') { + addPlugin(value); + } else if (typeof value === 'object') { + if ('length' in value) { + addPlugin.apply(null, value); + } else { + addPreset(value); + } + } else { + throw new Error('Expected usable value, not `' + value + '`') + } + } + + function addList(plugins) { + var length; + var index; + + if (plugins === null || plugins === undefined) ; else if (typeof plugins === 'object' && 'length' in plugins) { + length = plugins.length; + index = -1; + + while (++index < length) { + add(plugins[index]); + } + } else { + throw new Error('Expected a list of plugins, not `' + plugins + '`') + } + } + + function addPlugin(plugin, value) { + var entry = find(plugin); + + if (entry) { + if (plain$1(entry[1]) && plain$1(value)) { + value = extend$4(entry[1], value); + } + + entry[1] = value; + } else { + attachers.push(slice$1.call(arguments)); + } + } + } + + function find(plugin) { + var length = attachers.length; + var index = -1; + var entry; + + while (++index < length) { + entry = attachers[index]; + + if (entry[0] === plugin) { + return entry + } + } + } + + // Parse a file (in string or vfile representation) into a unist node using + // the `Parser` on the processor. + function parse(doc) { + var file = vfile$1(doc); + var Parser; + + freeze(); + Parser = processor.Parser; + assertParser$1('parse', Parser); + + if (newable$1(Parser, 'parse')) { + return new Parser(String(file), file).parse() + } + + return Parser(String(file), file) // eslint-disable-line new-cap + } + + // Run transforms on a unist node representation of a file (in string or + // vfile representation), async. + function run(node, file, cb) { + assertNode$1(node); + freeze(); + + if (!cb && typeof file === 'function') { + cb = file; + file = null; + } + + if (!cb) { + return new Promise(executor) + } + + executor(null, cb); + + function executor(resolve, reject) { + transformers.run(node, vfile$1(file), done); + + function done(err, tree, file) { + tree = tree || node; + if (err) { + reject(err); + } else if (resolve) { + resolve(tree); + } else { + cb(null, tree, file); + } + } + } + } + + // Run transforms on a unist node representation of a file (in string or + // vfile representation), sync. + function runSync(node, file) { + var complete = false; + var result; + + run(node, file, done); + + assertDone$1('runSync', 'run', complete); + + return result + + function done(err, tree) { + complete = true; + bail$1(err); + result = tree; + } + } + + // Stringify a unist node representation of a file (in string or vfile + // representation) into a string using the `Compiler` on the processor. + function stringify(node, doc) { + var file = vfile$1(doc); + var Compiler; + + freeze(); + Compiler = processor.Compiler; + assertCompiler$1('stringify', Compiler); + assertNode$1(node); + + if (newable$1(Compiler, 'compile')) { + return new Compiler(node, file).compile() + } + + return Compiler(node, file) // eslint-disable-line new-cap + } + + // Parse a file (in string or vfile representation) into a unist node using + // the `Parser` on the processor, then run transforms on that node, and + // compile the resulting node using the `Compiler` on the processor, and + // store that result on the vfile. + function process(doc, cb) { + freeze(); + assertParser$1('process', processor.Parser); + assertCompiler$1('process', processor.Compiler); + + if (!cb) { + return new Promise(executor) + } + + executor(null, cb); + + function executor(resolve, reject) { + var file = vfile$1(doc); + + pipeline$1.run(processor, {file: file}, done); + + function done(err) { + if (err) { + reject(err); + } else if (resolve) { + resolve(file); + } else { + cb(null, file); + } + } + } + } + + // Process the given document (in string or vfile representation), sync. + function processSync(doc) { + var complete = false; + var file; + + freeze(); + assertParser$1('processSync', processor.Parser); + assertCompiler$1('processSync', processor.Compiler); + file = vfile$1(doc); + + process(file, done); + + assertDone$1('processSync', 'process', complete); + + return file + + function done(err) { + complete = true; + bail$1(err); + } + } +} + +// Check if `value` is a constructor. +function newable$1(value, name) { + return ( + typeof value === 'function' && + value.prototype && + // A function with keys in its prototype is probably a constructor. + // Classes’ prototype methods are not enumerable, so we check if some value + // exists in the prototype. + (keys$2(value.prototype) || name in value.prototype) + ) +} + +// Check if `value` is an object with keys. +function keys$2(value) { + var key; + for (key in value) { + return true + } + + return false +} + +// Assert a parser is available. +function assertParser$1(name, Parser) { + if (typeof Parser !== 'function') { + throw new Error('Cannot `' + name + '` without `Parser`') + } +} + +// Assert a compiler is available. +function assertCompiler$1(name, Compiler) { + if (typeof Compiler !== 'function') { + throw new Error('Cannot `' + name + '` without `Compiler`') + } +} + +// Assert the processor is not frozen. +function assertUnfrozen$1(name, frozen) { + if (frozen) { + throw new Error( + 'Cannot invoke `' + + name + + '` on a frozen processor.\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.' + ) + } +} + +// Assert `node` is a unist node. +function assertNode$1(node) { + if (!node || typeof node.type !== 'string') { + throw new Error('Expected node, got `' + node + '`') + } +} + +// Assert that `complete` is `true`. +function assertDone$1(name, asyncName, complete) { + if (!complete) { + throw new Error( + '`' + name + '` finished async. Use `' + asyncName + '` instead' + ) + } +} + +var unified$3 = /*@__PURE__*/getDefaultExportFromCjs(unified_1$1); + +var immutable = extend$3; + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend$3() { + var target = {}; + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target +} + +var inherits$1 = {exports: {}}; + +var inherits_browser = {exports: {}}; + +var hasRequiredInherits_browser; + +function requireInherits_browser () { + if (hasRequiredInherits_browser) return inherits_browser.exports; + hasRequiredInherits_browser = 1; + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + // old school shim for old browsers + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return inherits_browser.exports; +} + +try { + var util = require('util'); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + inherits$1.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + inherits$1.exports = requireInherits_browser(); +} + +var inheritsExports = inherits$1.exports; + +var xtend$4 = immutable; +var inherits = inheritsExports; + +var unherit_1 = unherit$2; + +// Create a custom constructor which can be modified without affecting the +// original class. +function unherit$2(Super) { + var result; + var key; + var value; + + inherits(Of, Super); + inherits(From, Of); + + // Clone values. + result = Of.prototype; + + for (key in result) { + value = result[key]; + + if (value && typeof value === 'object') { + result[key] = 'concat' in value ? value.concat() : xtend$4(value); + } + } + + return Of + + // Constructor accepting a single argument, which itself is an `arguments` + // object. + function From(parameters) { + return Super.apply(this, parameters) + } + + // Constructor accepting variadic arguments. + function Of() { + if (!(this instanceof Of)) { + return new From(arguments) + } + + return Super.apply(this, arguments) + } +} + +var stateToggle = factory$6; + +// Construct a state `toggler`: a function which inverses `property` in context +// based on its current value. +// The by `toggler` returned function restores that value. +function factory$6(key, state, ctx) { + return enter + + function enter() { + var context = ctx || this; + var current = context[key]; + + context[key] = !state; + + return exit + + function exit() { + context[key] = current; + } + } +} + +var vfileLocation$1 = factory$5; + +function factory$5(file) { + var contents = indices(String(file)); + + return { + toPosition: offsetToPositionFactory(contents), + toOffset: positionToOffsetFactory(contents) + } +} + +// Factory to get the line and column-based `position` for `offset` in the bound +// indices. +function offsetToPositionFactory(indices) { + return offsetToPosition + + // Get the line and column-based `position` for `offset` in the bound indices. + function offsetToPosition(offset) { + var index = -1; + var length = indices.length; + + if (offset < 0) { + return {} + } + + while (++index < length) { + if (indices[index] > offset) { + return { + line: index + 1, + column: offset - (indices[index - 1] || 0) + 1, + offset: offset + } + } + } + + return {} + } +} + +// Factory to get the `offset` for a line and column-based `position` in the +// bound indices. +function positionToOffsetFactory(indices) { + return positionToOffset + + // Get the `offset` for a line and column-based `position` in the bound + // indices. + function positionToOffset(position) { + var line = position && position.line; + var column = position && position.column; + + if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { + return (indices[line - 2] || 0) + column - 1 || 0 + } + + return -1 + } +} + +// Get indices of line-breaks in `value`. +function indices(value) { + var result = []; + var index = value.indexOf('\n'); + + while (index !== -1) { + result.push(index + 1); + index = value.indexOf('\n', index + 1); + } + + result.push(value.length + 1); + + return result +} + +var _unescape = factory$4; + +var backslash = '\\'; + +// Factory to de-escape a value, based on a list at `key` in `ctx`. +function factory$4(ctx, key) { + return unescape + + // De-escape a string using the expression at `key` in `ctx`. + function unescape(value) { + var previous = 0; + var index = value.indexOf(backslash); + var escape = ctx[key]; + var queue = []; + var character; + + while (index !== -1) { + queue.push(value.slice(previous, index)); + previous = index + 1; + character = value.charAt(previous); + + // If the following character is not a valid escape, add the slash. + if (!character || escape.indexOf(character) === -1) { + queue.push(backslash); + } + + index = value.indexOf(backslash, previous + 1); + } + + queue.push(value.slice(previous)); + + return queue.join('') + } +} + +var AElig$2 = "Æ"; +var AMP$2 = "&"; +var Aacute$2 = "Á"; +var Acirc$2 = "Â"; +var Agrave$2 = "À"; +var Aring$2 = "Å"; +var Atilde$2 = "Ã"; +var Auml$2 = "Ä"; +var COPY$1 = "©"; +var Ccedil$2 = "Ç"; +var ETH$2 = "Ð"; +var Eacute$2 = "É"; +var Ecirc$2 = "Ê"; +var Egrave$2 = "È"; +var Euml$2 = "Ë"; +var GT$2 = ">"; +var Iacute$2 = "Í"; +var Icirc$2 = "Î"; +var Igrave$2 = "Ì"; +var Iuml$2 = "Ï"; +var LT$2 = "<"; +var Ntilde$2 = "Ñ"; +var Oacute$2 = "Ó"; +var Ocirc$2 = "Ô"; +var Ograve$2 = "Ò"; +var Oslash$2 = "Ø"; +var Otilde$2 = "Õ"; +var Ouml$2 = "Ö"; +var QUOT$1 = "\""; +var REG$1 = "®"; +var THORN$2 = "Þ"; +var Uacute$2 = "Ú"; +var Ucirc$2 = "Û"; +var Ugrave$2 = "Ù"; +var Uuml$2 = "Ü"; +var Yacute$2 = "Ý"; +var aacute$2 = "á"; +var acirc$2 = "â"; +var acute$2 = "´"; +var aelig$2 = "æ"; +var agrave$2 = "à"; +var amp$2 = "&"; +var aring$2 = "å"; +var atilde$2 = "ã"; +var auml$2 = "ä"; +var brvbar$2 = "¦"; +var ccedil$2 = "ç"; +var cedil$2 = "¸"; +var cent$2 = "¢"; +var copy$2 = "©"; +var curren$2 = "¤"; +var deg$2 = "°"; +var divide$2 = "÷"; +var eacute$2 = "é"; +var ecirc$2 = "ê"; +var egrave$2 = "è"; +var eth$2 = "ð"; +var euml$2 = "ë"; +var frac12$2 = "½"; +var frac14$2 = "¼"; +var frac34$2 = "¾"; +var gt$2 = ">"; +var iacute$2 = "í"; +var icirc$2 = "î"; +var iexcl$2 = "¡"; +var igrave$2 = "ì"; +var iquest$2 = "¿"; +var iuml$2 = "ï"; +var laquo$2 = "«"; +var lt$2 = "<"; +var macr$2 = "¯"; +var micro$2 = "µ"; +var middot$2 = "·"; +var nbsp$2 = " "; +var not$2 = "¬"; +var ntilde$2 = "ñ"; +var oacute$2 = "ó"; +var ocirc$2 = "ô"; +var ograve$2 = "ò"; +var ordf$2 = "ª"; +var ordm$2 = "º"; +var oslash$2 = "ø"; +var otilde$2 = "õ"; +var ouml$2 = "ö"; +var para$2 = "¶"; +var plusmn$2 = "±"; +var pound$2 = "£"; +var quot$2 = "\""; +var raquo$2 = "»"; +var reg$2 = "®"; +var sect$2 = "§"; +var shy$2 = "­"; +var sup1$2 = "¹"; +var sup2$2 = "²"; +var sup3$2 = "³"; +var szlig$2 = "ß"; +var thorn$2 = "þ"; +var times$2 = "×"; +var uacute$2 = "ú"; +var ucirc$2 = "û"; +var ugrave$2 = "ù"; +var uml$2 = "¨"; +var uuml$2 = "ü"; +var yacute$2 = "ý"; +var yen$2 = "¥"; +var yuml$2 = "ÿ"; +var require$$1$2 = { + AElig: AElig$2, + AMP: AMP$2, + Aacute: Aacute$2, + Acirc: Acirc$2, + Agrave: Agrave$2, + Aring: Aring$2, + Atilde: Atilde$2, + Auml: Auml$2, + COPY: COPY$1, + Ccedil: Ccedil$2, + ETH: ETH$2, + Eacute: Eacute$2, + Ecirc: Ecirc$2, + Egrave: Egrave$2, + Euml: Euml$2, + GT: GT$2, + Iacute: Iacute$2, + Icirc: Icirc$2, + Igrave: Igrave$2, + Iuml: Iuml$2, + LT: LT$2, + Ntilde: Ntilde$2, + Oacute: Oacute$2, + Ocirc: Ocirc$2, + Ograve: Ograve$2, + Oslash: Oslash$2, + Otilde: Otilde$2, + Ouml: Ouml$2, + QUOT: QUOT$1, + REG: REG$1, + THORN: THORN$2, + Uacute: Uacute$2, + Ucirc: Ucirc$2, + Ugrave: Ugrave$2, + Uuml: Uuml$2, + Yacute: Yacute$2, + aacute: aacute$2, + acirc: acirc$2, + acute: acute$2, + aelig: aelig$2, + agrave: agrave$2, + amp: amp$2, + aring: aring$2, + atilde: atilde$2, + auml: auml$2, + brvbar: brvbar$2, + ccedil: ccedil$2, + cedil: cedil$2, + cent: cent$2, + copy: copy$2, + curren: curren$2, + deg: deg$2, + divide: divide$2, + eacute: eacute$2, + ecirc: ecirc$2, + egrave: egrave$2, + eth: eth$2, + euml: euml$2, + frac12: frac12$2, + frac14: frac14$2, + frac34: frac34$2, + gt: gt$2, + iacute: iacute$2, + icirc: icirc$2, + iexcl: iexcl$2, + igrave: igrave$2, + iquest: iquest$2, + iuml: iuml$2, + laquo: laquo$2, + lt: lt$2, + macr: macr$2, + micro: micro$2, + middot: middot$2, + nbsp: nbsp$2, + not: not$2, + ntilde: ntilde$2, + oacute: oacute$2, + ocirc: ocirc$2, + ograve: ograve$2, + ordf: ordf$2, + ordm: ordm$2, + oslash: oslash$2, + otilde: otilde$2, + ouml: ouml$2, + para: para$2, + plusmn: plusmn$2, + pound: pound$2, + quot: quot$2, + raquo: raquo$2, + reg: reg$2, + sect: sect$2, + shy: shy$2, + sup1: sup1$2, + sup2: sup2$2, + sup3: sup3$2, + szlig: szlig$2, + thorn: thorn$2, + times: times$2, + uacute: uacute$2, + ucirc: ucirc$2, + ugrave: ugrave$2, + uml: uml$2, + uuml: uuml$2, + yacute: yacute$2, + yen: yen$2, + yuml: yuml$2 +}; + +var require$$1$1 = { + "0": "�", + "128": "€", + "130": "‚", + "131": "ƒ", + "132": "„", + "133": "…", + "134": "†", + "135": "‡", + "136": "ˆ", + "137": "‰", + "138": "Š", + "139": "‹", + "140": "Œ", + "142": "Ž", + "145": "‘", + "146": "’", + "147": "“", + "148": "”", + "149": "•", + "150": "–", + "151": "—", + "152": "˜", + "153": "™", + "154": "š", + "155": "›", + "156": "œ", + "158": "ž", + "159": "Ÿ" +}; + +var isDecimal; +var hasRequiredIsDecimal; + +function requireIsDecimal () { + if (hasRequiredIsDecimal) return isDecimal; + hasRequiredIsDecimal = 1; + + isDecimal = decimal; + + // Check if the given character code, or the character code at the first + // character, is decimal. + function decimal(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character; + + return code >= 48 && code <= 57 /* 0-9 */ + } + return isDecimal; +} + +var isHexadecimal = hexadecimal$2; + +// Check if the given character code, or the character code at the first +// character, is hexadecimal. +function hexadecimal$2(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character; + + return ( + (code >= 97 /* a */ && code <= 102) /* z */ || + (code >= 65 /* A */ && code <= 70) /* Z */ || + (code >= 48 /* A */ && code <= 57) /* Z */ + ) +} + +var isAlphabetical; +var hasRequiredIsAlphabetical; + +function requireIsAlphabetical () { + if (hasRequiredIsAlphabetical) return isAlphabetical; + hasRequiredIsAlphabetical = 1; + + isAlphabetical = alphabetical; + + // Check if the given character code, or the character code at the first + // character, is alphabetical. + function alphabetical(character) { + var code = typeof character === 'string' ? character.charCodeAt(0) : character; + + return ( + (code >= 97 && code <= 122) /* a-z */ || + (code >= 65 && code <= 90) /* A-Z */ + ) + } + return isAlphabetical; +} + +var alphabetical = requireIsAlphabetical(); +var decimal$2 = requireIsDecimal(); + +var isAlphanumerical = alphanumerical$2; + +// Check if the given character code, or the character code at the first +// character, is alphanumerical. +function alphanumerical$2(character) { + return alphabetical(character) || decimal$2(character) +} + +var AEli = "Æ"; +var AElig$1 = "Æ"; +var AM = "&"; +var AMP$1 = "&"; +var Aacut = "Á"; +var Aacute$1 = "Á"; +var Abreve = "Ă"; +var Acir = "Â"; +var Acirc$1 = "Â"; +var Acy = "А"; +var Afr = "𝔄"; +var Agrav = "À"; +var Agrave$1 = "À"; +var Alpha$1 = "Α"; +var Amacr = "Ā"; +var And = "⩓"; +var Aogon = "Ą"; +var Aopf = "𝔸"; +var ApplyFunction = "⁡"; +var Arin = "Å"; +var Aring$1 = "Å"; +var Ascr = "𝒜"; +var Assign = "≔"; +var Atild = "Ã"; +var Atilde$1 = "Ã"; +var Aum = "Ä"; +var Auml$1 = "Ä"; +var Backslash = "∖"; +var Barv = "⫧"; +var Barwed = "⌆"; +var Bcy = "Б"; +var Because = "∵"; +var Bernoullis = "ℬ"; +var Beta$1 = "Β"; +var Bfr = "𝔅"; +var Bopf = "𝔹"; +var Breve = "˘"; +var Bscr = "ℬ"; +var Bumpeq = "≎"; +var CHcy = "Ч"; +var COP = "©"; +var COPY = "©"; +var Cacute = "Ć"; +var Cap = "⋒"; +var CapitalDifferentialD = "ⅅ"; +var Cayleys = "ℭ"; +var Ccaron = "Č"; +var Ccedi = "Ç"; +var Ccedil$1 = "Ç"; +var Ccirc = "Ĉ"; +var Cconint = "∰"; +var Cdot = "Ċ"; +var Cedilla = "¸"; +var CenterDot = "·"; +var Cfr = "ℭ"; +var Chi$1 = "Χ"; +var CircleDot = "⊙"; +var CircleMinus = "⊖"; +var CirclePlus = "⊕"; +var CircleTimes = "⊗"; +var ClockwiseContourIntegral = "∲"; +var CloseCurlyDoubleQuote = "”"; +var CloseCurlyQuote = "’"; +var Colon = "∷"; +var Colone = "⩴"; +var Congruent = "≡"; +var Conint = "∯"; +var ContourIntegral = "∮"; +var Copf = "ℂ"; +var Coproduct = "∐"; +var CounterClockwiseContourIntegral = "∳"; +var Cross = "⨯"; +var Cscr = "𝒞"; +var Cup = "⋓"; +var CupCap = "≍"; +var DD = "ⅅ"; +var DDotrahd = "⤑"; +var DJcy = "Ђ"; +var DScy = "Ѕ"; +var DZcy = "Џ"; +var Dagger$1 = "‡"; +var Darr = "↡"; +var Dashv = "⫤"; +var Dcaron = "Ď"; +var Dcy = "Д"; +var Del = "∇"; +var Delta$1 = "Δ"; +var Dfr = "𝔇"; +var DiacriticalAcute = "´"; +var DiacriticalDot = "˙"; +var DiacriticalDoubleAcute = "˝"; +var DiacriticalGrave = "`"; +var DiacriticalTilde = "˜"; +var Diamond = "⋄"; +var DifferentialD = "ⅆ"; +var Dopf = "𝔻"; +var Dot = "¨"; +var DotDot = "⃜"; +var DotEqual = "≐"; +var DoubleContourIntegral = "∯"; +var DoubleDot = "¨"; +var DoubleDownArrow = "⇓"; +var DoubleLeftArrow = "⇐"; +var DoubleLeftRightArrow = "⇔"; +var DoubleLeftTee = "⫤"; +var DoubleLongLeftArrow = "⟸"; +var DoubleLongLeftRightArrow = "⟺"; +var DoubleLongRightArrow = "⟹"; +var DoubleRightArrow = "⇒"; +var DoubleRightTee = "⊨"; +var DoubleUpArrow = "⇑"; +var DoubleUpDownArrow = "⇕"; +var DoubleVerticalBar = "∥"; +var DownArrow = "↓"; +var DownArrowBar = "⤓"; +var DownArrowUpArrow = "⇵"; +var DownBreve = "̑"; +var DownLeftRightVector = "⥐"; +var DownLeftTeeVector = "⥞"; +var DownLeftVector = "↽"; +var DownLeftVectorBar = "⥖"; +var DownRightTeeVector = "⥟"; +var DownRightVector = "⇁"; +var DownRightVectorBar = "⥗"; +var DownTee = "⊤"; +var DownTeeArrow = "↧"; +var Downarrow = "⇓"; +var Dscr = "𝒟"; +var Dstrok = "Đ"; +var ENG = "Ŋ"; +var ET = "Ð"; +var ETH$1 = "Ð"; +var Eacut = "É"; +var Eacute$1 = "É"; +var Ecaron = "Ě"; +var Ecir = "Ê"; +var Ecirc$1 = "Ê"; +var Ecy = "Э"; +var Edot = "Ė"; +var Efr = "𝔈"; +var Egrav = "È"; +var Egrave$1 = "È"; +var Element = "∈"; +var Emacr = "Ē"; +var EmptySmallSquare = "◻"; +var EmptyVerySmallSquare = "▫"; +var Eogon = "Ę"; +var Eopf = "𝔼"; +var Epsilon$1 = "Ε"; +var Equal = "⩵"; +var EqualTilde = "≂"; +var Equilibrium = "⇌"; +var Escr = "ℰ"; +var Esim = "⩳"; +var Eta$1 = "Η"; +var Eum = "Ë"; +var Euml$1 = "Ë"; +var Exists = "∃"; +var ExponentialE = "ⅇ"; +var Fcy = "Ф"; +var Ffr = "𝔉"; +var FilledSmallSquare = "◼"; +var FilledVerySmallSquare = "▪"; +var Fopf = "𝔽"; +var ForAll = "∀"; +var Fouriertrf = "ℱ"; +var Fscr = "ℱ"; +var GJcy = "Ѓ"; +var G = ">"; +var GT$1 = ">"; +var Gamma$1 = "Γ"; +var Gammad = "Ϝ"; +var Gbreve = "Ğ"; +var Gcedil = "Ģ"; +var Gcirc = "Ĝ"; +var Gcy = "Г"; +var Gdot = "Ġ"; +var Gfr = "𝔊"; +var Gg = "⋙"; +var Gopf = "𝔾"; +var GreaterEqual = "≥"; +var GreaterEqualLess = "⋛"; +var GreaterFullEqual = "≧"; +var GreaterGreater = "⪢"; +var GreaterLess = "≷"; +var GreaterSlantEqual = "⩾"; +var GreaterTilde = "≳"; +var Gscr = "𝒢"; +var Gt = "≫"; +var HARDcy = "Ъ"; +var Hacek = "ˇ"; +var Hat = "^"; +var Hcirc = "Ĥ"; +var Hfr = "ℌ"; +var HilbertSpace = "ℋ"; +var Hopf = "ℍ"; +var HorizontalLine = "─"; +var Hscr = "ℋ"; +var Hstrok = "Ħ"; +var HumpDownHump = "≎"; +var HumpEqual = "≏"; +var IEcy = "Е"; +var IJlig = "IJ"; +var IOcy = "Ё"; +var Iacut = "Í"; +var Iacute$1 = "Í"; +var Icir = "Î"; +var Icirc$1 = "Î"; +var Icy = "И"; +var Idot = "İ"; +var Ifr = "ℑ"; +var Igrav = "Ì"; +var Igrave$1 = "Ì"; +var Im = "ℑ"; +var Imacr = "Ī"; +var ImaginaryI = "ⅈ"; +var Implies = "⇒"; +var Int = "∬"; +var Integral = "∫"; +var Intersection = "⋂"; +var InvisibleComma = "⁣"; +var InvisibleTimes = "⁢"; +var Iogon = "Į"; +var Iopf = "𝕀"; +var Iota$1 = "Ι"; +var Iscr = "ℐ"; +var Itilde = "Ĩ"; +var Iukcy = "І"; +var Ium = "Ï"; +var Iuml$1 = "Ï"; +var Jcirc = "Ĵ"; +var Jcy = "Й"; +var Jfr = "𝔍"; +var Jopf = "𝕁"; +var Jscr = "𝒥"; +var Jsercy = "Ј"; +var Jukcy = "Є"; +var KHcy = "Х"; +var KJcy = "Ќ"; +var Kappa$1 = "Κ"; +var Kcedil = "Ķ"; +var Kcy = "К"; +var Kfr = "𝔎"; +var Kopf = "𝕂"; +var Kscr = "𝒦"; +var LJcy = "Љ"; +var L = "<"; +var LT$1 = "<"; +var Lacute = "Ĺ"; +var Lambda$1 = "Λ"; +var Lang = "⟪"; +var Laplacetrf = "ℒ"; +var Larr = "↞"; +var Lcaron = "Ľ"; +var Lcedil = "Ļ"; +var Lcy = "Л"; +var LeftAngleBracket = "⟨"; +var LeftArrow = "←"; +var LeftArrowBar = "⇤"; +var LeftArrowRightArrow = "⇆"; +var LeftCeiling = "⌈"; +var LeftDoubleBracket = "⟦"; +var LeftDownTeeVector = "⥡"; +var LeftDownVector = "⇃"; +var LeftDownVectorBar = "⥙"; +var LeftFloor = "⌊"; +var LeftRightArrow = "↔"; +var LeftRightVector = "⥎"; +var LeftTee = "⊣"; +var LeftTeeArrow = "↤"; +var LeftTeeVector = "⥚"; +var LeftTriangle = "⊲"; +var LeftTriangleBar = "⧏"; +var LeftTriangleEqual = "⊴"; +var LeftUpDownVector = "⥑"; +var LeftUpTeeVector = "⥠"; +var LeftUpVector = "↿"; +var LeftUpVectorBar = "⥘"; +var LeftVector = "↼"; +var LeftVectorBar = "⥒"; +var Leftarrow = "⇐"; +var Leftrightarrow = "⇔"; +var LessEqualGreater = "⋚"; +var LessFullEqual = "≦"; +var LessGreater = "≶"; +var LessLess = "⪡"; +var LessSlantEqual = "⩽"; +var LessTilde = "≲"; +var Lfr = "𝔏"; +var Ll = "⋘"; +var Lleftarrow = "⇚"; +var Lmidot = "Ŀ"; +var LongLeftArrow = "⟵"; +var LongLeftRightArrow = "⟷"; +var LongRightArrow = "⟶"; +var Longleftarrow = "⟸"; +var Longleftrightarrow = "⟺"; +var Longrightarrow = "⟹"; +var Lopf = "𝕃"; +var LowerLeftArrow = "↙"; +var LowerRightArrow = "↘"; +var Lscr = "ℒ"; +var Lsh = "↰"; +var Lstrok = "Ł"; +var Lt = "≪"; +var Mcy = "М"; +var MediumSpace = " "; +var Mellintrf = "ℳ"; +var Mfr = "𝔐"; +var MinusPlus = "∓"; +var Mopf = "𝕄"; +var Mscr = "ℳ"; +var Mu$1 = "Μ"; +var NJcy = "Њ"; +var Nacute = "Ń"; +var Ncaron = "Ň"; +var Ncedil = "Ņ"; +var Ncy = "Н"; +var NegativeMediumSpace = "​"; +var NegativeThickSpace = "​"; +var NegativeThinSpace = "​"; +var NegativeVeryThinSpace = "​"; +var NestedGreaterGreater = "≫"; +var NestedLessLess = "≪"; +var NewLine = "\n"; +var Nfr = "𝔑"; +var NoBreak = "⁠"; +var NonBreakingSpace = " "; +var Nopf = "ℕ"; +var Not = "⫬"; +var NotCongruent = "≢"; +var NotCupCap = "≭"; +var NotDoubleVerticalBar = "∦"; +var NotElement = "∉"; +var NotEqual = "≠"; +var NotEqualTilde = "≂̸"; +var NotExists = "∄"; +var NotGreater = "≯"; +var NotGreaterEqual = "≱"; +var NotGreaterFullEqual = "≧̸"; +var NotGreaterGreater = "≫̸"; +var NotGreaterLess = "≹"; +var NotGreaterSlantEqual = "⩾̸"; +var NotGreaterTilde = "≵"; +var NotHumpDownHump = "≎̸"; +var NotHumpEqual = "≏̸"; +var NotLeftTriangle = "⋪"; +var NotLeftTriangleBar = "⧏̸"; +var NotLeftTriangleEqual = "⋬"; +var NotLess = "≮"; +var NotLessEqual = "≰"; +var NotLessGreater = "≸"; +var NotLessLess = "≪̸"; +var NotLessSlantEqual = "⩽̸"; +var NotLessTilde = "≴"; +var NotNestedGreaterGreater = "⪢̸"; +var NotNestedLessLess = "⪡̸"; +var NotPrecedes = "⊀"; +var NotPrecedesEqual = "⪯̸"; +var NotPrecedesSlantEqual = "⋠"; +var NotReverseElement = "∌"; +var NotRightTriangle = "⋫"; +var NotRightTriangleBar = "⧐̸"; +var NotRightTriangleEqual = "⋭"; +var NotSquareSubset = "⊏̸"; +var NotSquareSubsetEqual = "⋢"; +var NotSquareSuperset = "⊐̸"; +var NotSquareSupersetEqual = "⋣"; +var NotSubset = "⊂⃒"; +var NotSubsetEqual = "⊈"; +var NotSucceeds = "⊁"; +var NotSucceedsEqual = "⪰̸"; +var NotSucceedsSlantEqual = "⋡"; +var NotSucceedsTilde = "≿̸"; +var NotSuperset = "⊃⃒"; +var NotSupersetEqual = "⊉"; +var NotTilde = "≁"; +var NotTildeEqual = "≄"; +var NotTildeFullEqual = "≇"; +var NotTildeTilde = "≉"; +var NotVerticalBar = "∤"; +var Nscr = "𝒩"; +var Ntild = "Ñ"; +var Ntilde$1 = "Ñ"; +var Nu$1 = "Ν"; +var OElig$1 = "Œ"; +var Oacut = "Ó"; +var Oacute$1 = "Ó"; +var Ocir = "Ô"; +var Ocirc$1 = "Ô"; +var Ocy = "О"; +var Odblac = "Ő"; +var Ofr = "𝔒"; +var Ograv = "Ò"; +var Ograve$1 = "Ò"; +var Omacr = "Ō"; +var Omega$1 = "Ω"; +var Omicron$1 = "Ο"; +var Oopf = "𝕆"; +var OpenCurlyDoubleQuote = "“"; +var OpenCurlyQuote = "‘"; +var Or = "⩔"; +var Oscr = "𝒪"; +var Oslas = "Ø"; +var Oslash$1 = "Ø"; +var Otild = "Õ"; +var Otilde$1 = "Õ"; +var Otimes = "⨷"; +var Oum = "Ö"; +var Ouml$1 = "Ö"; +var OverBar = "‾"; +var OverBrace = "⏞"; +var OverBracket = "⎴"; +var OverParenthesis = "⏜"; +var PartialD = "∂"; +var Pcy = "П"; +var Pfr = "𝔓"; +var Phi$1 = "Φ"; +var Pi$1 = "Π"; +var PlusMinus = "±"; +var Poincareplane = "ℌ"; +var Popf = "ℙ"; +var Pr = "⪻"; +var Precedes = "≺"; +var PrecedesEqual = "⪯"; +var PrecedesSlantEqual = "≼"; +var PrecedesTilde = "≾"; +var Prime$1 = "″"; +var Product = "∏"; +var Proportion = "∷"; +var Proportional = "∝"; +var Pscr = "𝒫"; +var Psi$1 = "Ψ"; +var QUO = "\""; +var QUOT = "\""; +var Qfr = "𝔔"; +var Qopf = "ℚ"; +var Qscr = "𝒬"; +var RBarr = "⤐"; +var RE = "®"; +var REG = "®"; +var Racute = "Ŕ"; +var Rang = "⟫"; +var Rarr = "↠"; +var Rarrtl = "⤖"; +var Rcaron = "Ř"; +var Rcedil = "Ŗ"; +var Rcy = "Р"; +var Re = "ℜ"; +var ReverseElement = "∋"; +var ReverseEquilibrium = "⇋"; +var ReverseUpEquilibrium = "⥯"; +var Rfr = "ℜ"; +var Rho$1 = "Ρ"; +var RightAngleBracket = "⟩"; +var RightArrow = "→"; +var RightArrowBar = "⇥"; +var RightArrowLeftArrow = "⇄"; +var RightCeiling = "⌉"; +var RightDoubleBracket = "⟧"; +var RightDownTeeVector = "⥝"; +var RightDownVector = "⇂"; +var RightDownVectorBar = "⥕"; +var RightFloor = "⌋"; +var RightTee = "⊢"; +var RightTeeArrow = "↦"; +var RightTeeVector = "⥛"; +var RightTriangle = "⊳"; +var RightTriangleBar = "⧐"; +var RightTriangleEqual = "⊵"; +var RightUpDownVector = "⥏"; +var RightUpTeeVector = "⥜"; +var RightUpVector = "↾"; +var RightUpVectorBar = "⥔"; +var RightVector = "⇀"; +var RightVectorBar = "⥓"; +var Rightarrow = "⇒"; +var Ropf = "ℝ"; +var RoundImplies = "⥰"; +var Rrightarrow = "⇛"; +var Rscr = "ℛ"; +var Rsh = "↱"; +var RuleDelayed = "⧴"; +var SHCHcy = "Щ"; +var SHcy = "Ш"; +var SOFTcy = "Ь"; +var Sacute = "Ś"; +var Sc = "⪼"; +var Scaron$1 = "Š"; +var Scedil = "Ş"; +var Scirc = "Ŝ"; +var Scy = "С"; +var Sfr = "𝔖"; +var ShortDownArrow = "↓"; +var ShortLeftArrow = "←"; +var ShortRightArrow = "→"; +var ShortUpArrow = "↑"; +var Sigma$1 = "Σ"; +var SmallCircle = "∘"; +var Sopf = "𝕊"; +var Sqrt = "√"; +var Square = "□"; +var SquareIntersection = "⊓"; +var SquareSubset = "⊏"; +var SquareSubsetEqual = "⊑"; +var SquareSuperset = "⊐"; +var SquareSupersetEqual = "⊒"; +var SquareUnion = "⊔"; +var Sscr = "𝒮"; +var Star = "⋆"; +var Sub = "⋐"; +var Subset = "⋐"; +var SubsetEqual = "⊆"; +var Succeeds = "≻"; +var SucceedsEqual = "⪰"; +var SucceedsSlantEqual = "≽"; +var SucceedsTilde = "≿"; +var SuchThat = "∋"; +var Sum = "∑"; +var Sup = "⋑"; +var Superset = "⊃"; +var SupersetEqual = "⊇"; +var Supset = "⋑"; +var THOR = "Þ"; +var THORN$1 = "Þ"; +var TRADE = "™"; +var TSHcy = "Ћ"; +var TScy = "Ц"; +var Tab = "\t"; +var Tau$1 = "Τ"; +var Tcaron = "Ť"; +var Tcedil = "Ţ"; +var Tcy = "Т"; +var Tfr = "𝔗"; +var Therefore = "∴"; +var Theta$1 = "Θ"; +var ThickSpace = "  "; +var ThinSpace = " "; +var Tilde = "∼"; +var TildeEqual = "≃"; +var TildeFullEqual = "≅"; +var TildeTilde = "≈"; +var Topf = "𝕋"; +var TripleDot = "⃛"; +var Tscr = "𝒯"; +var Tstrok = "Ŧ"; +var Uacut = "Ú"; +var Uacute$1 = "Ú"; +var Uarr = "↟"; +var Uarrocir = "⥉"; +var Ubrcy = "Ў"; +var Ubreve = "Ŭ"; +var Ucir = "Û"; +var Ucirc$1 = "Û"; +var Ucy = "У"; +var Udblac = "Ű"; +var Ufr = "𝔘"; +var Ugrav = "Ù"; +var Ugrave$1 = "Ù"; +var Umacr = "Ū"; +var UnderBar = "_"; +var UnderBrace = "⏟"; +var UnderBracket = "⎵"; +var UnderParenthesis = "⏝"; +var Union = "⋃"; +var UnionPlus = "⊎"; +var Uogon = "Ų"; +var Uopf = "𝕌"; +var UpArrow = "↑"; +var UpArrowBar = "⤒"; +var UpArrowDownArrow = "⇅"; +var UpDownArrow = "↕"; +var UpEquilibrium = "⥮"; +var UpTee = "⊥"; +var UpTeeArrow = "↥"; +var Uparrow = "⇑"; +var Updownarrow = "⇕"; +var UpperLeftArrow = "↖"; +var UpperRightArrow = "↗"; +var Upsi = "ϒ"; +var Upsilon$1 = "Υ"; +var Uring = "Ů"; +var Uscr = "𝒰"; +var Utilde = "Ũ"; +var Uum = "Ü"; +var Uuml$1 = "Ü"; +var VDash = "⊫"; +var Vbar = "⫫"; +var Vcy = "В"; +var Vdash = "⊩"; +var Vdashl = "⫦"; +var Vee = "⋁"; +var Verbar = "‖"; +var Vert = "‖"; +var VerticalBar = "∣"; +var VerticalLine = "|"; +var VerticalSeparator = "❘"; +var VerticalTilde = "≀"; +var VeryThinSpace = " "; +var Vfr = "𝔙"; +var Vopf = "𝕍"; +var Vscr = "𝒱"; +var Vvdash = "⊪"; +var Wcirc = "Ŵ"; +var Wedge = "⋀"; +var Wfr = "𝔚"; +var Wopf = "𝕎"; +var Wscr = "𝒲"; +var Xfr = "𝔛"; +var Xi$1 = "Ξ"; +var Xopf = "𝕏"; +var Xscr = "𝒳"; +var YAcy = "Я"; +var YIcy = "Ї"; +var YUcy = "Ю"; +var Yacut = "Ý"; +var Yacute$1 = "Ý"; +var Ycirc = "Ŷ"; +var Ycy = "Ы"; +var Yfr = "𝔜"; +var Yopf = "𝕐"; +var Yscr = "𝒴"; +var Yuml$1 = "Ÿ"; +var ZHcy = "Ж"; +var Zacute = "Ź"; +var Zcaron = "Ž"; +var Zcy = "З"; +var Zdot = "Ż"; +var ZeroWidthSpace = "​"; +var Zeta$1 = "Ζ"; +var Zfr = "ℨ"; +var Zopf = "ℤ"; +var Zscr = "𝒵"; +var aacut = "á"; +var aacute$1 = "á"; +var abreve = "ă"; +var ac = "∾"; +var acE = "∾̳"; +var acd = "∿"; +var acir = "â"; +var acirc$1 = "â"; +var acut = "´"; +var acute$1 = "´"; +var acy = "а"; +var aeli = "æ"; +var aelig$1 = "æ"; +var af = "⁡"; +var afr = "𝔞"; +var agrav = "à"; +var agrave$1 = "à"; +var alefsym$1 = "ℵ"; +var aleph = "ℵ"; +var alpha$1 = "α"; +var amacr = "ā"; +var amalg = "⨿"; +var am = "&"; +var amp$1 = "&"; +var and$1 = "∧"; +var andand = "⩕"; +var andd = "⩜"; +var andslope = "⩘"; +var andv = "⩚"; +var ang$1 = "∠"; +var ange = "⦤"; +var angle = "∠"; +var angmsd = "∡"; +var angmsdaa = "⦨"; +var angmsdab = "⦩"; +var angmsdac = "⦪"; +var angmsdad = "⦫"; +var angmsdae = "⦬"; +var angmsdaf = "⦭"; +var angmsdag = "⦮"; +var angmsdah = "⦯"; +var angrt = "∟"; +var angrtvb = "⊾"; +var angrtvbd = "⦝"; +var angsph = "∢"; +var angst = "Å"; +var angzarr = "⍼"; +var aogon = "ą"; +var aopf = "𝕒"; +var ap = "≈"; +var apE = "⩰"; +var apacir = "⩯"; +var ape = "≊"; +var apid = "≋"; +var apos = "'"; +var approx = "≈"; +var approxeq = "≊"; +var arin = "å"; +var aring$1 = "å"; +var ascr = "𝒶"; +var ast = "*"; +var asymp$1 = "≈"; +var asympeq = "≍"; +var atild = "ã"; +var atilde$1 = "ã"; +var aum = "ä"; +var auml$1 = "ä"; +var awconint = "∳"; +var awint = "⨑"; +var bNot = "⫭"; +var backcong = "≌"; +var backepsilon = "϶"; +var backprime = "‵"; +var backsim = "∽"; +var backsimeq = "⋍"; +var barvee = "⊽"; +var barwed = "⌅"; +var barwedge = "⌅"; +var bbrk = "⎵"; +var bbrktbrk = "⎶"; +var bcong = "≌"; +var bcy = "б"; +var bdquo$1 = "„"; +var becaus = "∵"; +var because = "∵"; +var bemptyv = "⦰"; +var bepsi = "϶"; +var bernou = "ℬ"; +var beta$1 = "β"; +var beth = "ℶ"; +var between = "≬"; +var bfr = "𝔟"; +var bigcap = "⋂"; +var bigcirc = "◯"; +var bigcup = "⋃"; +var bigodot = "⨀"; +var bigoplus = "⨁"; +var bigotimes = "⨂"; +var bigsqcup = "⨆"; +var bigstar = "★"; +var bigtriangledown = "▽"; +var bigtriangleup = "△"; +var biguplus = "⨄"; +var bigvee = "⋁"; +var bigwedge = "⋀"; +var bkarow = "⤍"; +var blacklozenge = "⧫"; +var blacksquare = "▪"; +var blacktriangle = "▴"; +var blacktriangledown = "▾"; +var blacktriangleleft = "◂"; +var blacktriangleright = "▸"; +var blank = "␣"; +var blk12 = "▒"; +var blk14 = "░"; +var blk34 = "▓"; +var block = "█"; +var bne = "=⃥"; +var bnequiv = "≡⃥"; +var bnot = "⌐"; +var bopf = "𝕓"; +var bot = "⊥"; +var bottom = "⊥"; +var bowtie = "⋈"; +var boxDL = "╗"; +var boxDR = "╔"; +var boxDl = "╖"; +var boxDr = "╓"; +var boxH = "═"; +var boxHD = "╦"; +var boxHU = "╩"; +var boxHd = "╤"; +var boxHu = "╧"; +var boxUL = "╝"; +var boxUR = "╚"; +var boxUl = "╜"; +var boxUr = "╙"; +var boxV = "║"; +var boxVH = "╬"; +var boxVL = "╣"; +var boxVR = "╠"; +var boxVh = "╫"; +var boxVl = "╢"; +var boxVr = "╟"; +var boxbox = "⧉"; +var boxdL = "╕"; +var boxdR = "╒"; +var boxdl = "┐"; +var boxdr = "┌"; +var boxh = "─"; +var boxhD = "╥"; +var boxhU = "╨"; +var boxhd = "┬"; +var boxhu = "┴"; +var boxminus = "⊟"; +var boxplus = "⊞"; +var boxtimes = "⊠"; +var boxuL = "╛"; +var boxuR = "╘"; +var boxul = "┘"; +var boxur = "└"; +var boxv = "│"; +var boxvH = "╪"; +var boxvL = "╡"; +var boxvR = "╞"; +var boxvh = "┼"; +var boxvl = "┤"; +var boxvr = "├"; +var bprime = "‵"; +var breve = "˘"; +var brvba = "¦"; +var brvbar$1 = "¦"; +var bscr = "𝒷"; +var bsemi = "⁏"; +var bsim = "∽"; +var bsime = "⋍"; +var bsol = "\\"; +var bsolb = "⧅"; +var bsolhsub = "⟈"; +var bull$1 = "•"; +var bullet = "•"; +var bump = "≎"; +var bumpE = "⪮"; +var bumpe = "≏"; +var bumpeq = "≏"; +var cacute = "ć"; +var cap$2 = "∩"; +var capand = "⩄"; +var capbrcup = "⩉"; +var capcap = "⩋"; +var capcup = "⩇"; +var capdot = "⩀"; +var caps = "∩︀"; +var caret = "⁁"; +var caron = "ˇ"; +var ccaps = "⩍"; +var ccaron = "č"; +var ccedi = "ç"; +var ccedil$1 = "ç"; +var ccirc = "ĉ"; +var ccups = "⩌"; +var ccupssm = "⩐"; +var cdot = "ċ"; +var cedi = "¸"; +var cedil$1 = "¸"; +var cemptyv = "⦲"; +var cen = "¢"; +var cent$1 = "¢"; +var centerdot = "·"; +var cfr = "𝔠"; +var chcy = "ч"; +var check = "✓"; +var checkmark = "✓"; +var chi$1 = "χ"; +var cir = "○"; +var cirE = "⧃"; +var circ$1 = "ˆ"; +var circeq = "≗"; +var circlearrowleft = "↺"; +var circlearrowright = "↻"; +var circledR = "®"; +var circledS = "Ⓢ"; +var circledast = "⊛"; +var circledcirc = "⊚"; +var circleddash = "⊝"; +var cire = "≗"; +var cirfnint = "⨐"; +var cirmid = "⫯"; +var cirscir = "⧂"; +var clubs$1 = "♣"; +var clubsuit = "♣"; +var colon = ":"; +var colone = "≔"; +var coloneq = "≔"; +var comma$1 = ","; +var commat = "@"; +var comp = "∁"; +var compfn = "∘"; +var complement = "∁"; +var complexes = "ℂ"; +var cong$1 = "≅"; +var congdot = "⩭"; +var conint = "∮"; +var copf = "𝕔"; +var coprod = "∐"; +var cop = "©"; +var copy$1 = "©"; +var copysr = "℗"; +var crarr$1 = "↵"; +var cross = "✗"; +var cscr = "𝒸"; +var csub = "⫏"; +var csube = "⫑"; +var csup = "⫐"; +var csupe = "⫒"; +var ctdot = "⋯"; +var cudarrl = "⤸"; +var cudarrr = "⤵"; +var cuepr = "⋞"; +var cuesc = "⋟"; +var cularr = "↶"; +var cularrp = "⤽"; +var cup$1 = "∪"; +var cupbrcap = "⩈"; +var cupcap = "⩆"; +var cupcup = "⩊"; +var cupdot = "⊍"; +var cupor = "⩅"; +var cups = "∪︀"; +var curarr = "↷"; +var curarrm = "⤼"; +var curlyeqprec = "⋞"; +var curlyeqsucc = "⋟"; +var curlyvee = "⋎"; +var curlywedge = "⋏"; +var curre = "¤"; +var curren$1 = "¤"; +var curvearrowleft = "↶"; +var curvearrowright = "↷"; +var cuvee = "⋎"; +var cuwed = "⋏"; +var cwconint = "∲"; +var cwint = "∱"; +var cylcty = "⌭"; +var dArr$1 = "⇓"; +var dHar = "⥥"; +var dagger$1 = "†"; +var daleth = "ℸ"; +var darr$1 = "↓"; +var dash$1 = "‐"; +var dashv = "⊣"; +var dbkarow = "⤏"; +var dblac = "˝"; +var dcaron = "ď"; +var dcy = "д"; +var dd$1 = "ⅆ"; +var ddagger = "‡"; +var ddarr = "⇊"; +var ddotseq = "⩷"; +var de = "°"; +var deg$1 = "°"; +var delta$1 = "δ"; +var demptyv = "⦱"; +var dfisht = "⥿"; +var dfr = "𝔡"; +var dharl = "⇃"; +var dharr = "⇂"; +var diam = "⋄"; +var diamond = "⋄"; +var diamondsuit = "♦"; +var diams$1 = "♦"; +var die = "¨"; +var digamma = "ϝ"; +var disin = "⋲"; +var div = "÷"; +var divid = "÷"; +var divide$1 = "÷"; +var divideontimes = "⋇"; +var divonx = "⋇"; +var djcy = "ђ"; +var dlcorn = "⌞"; +var dlcrop = "⌍"; +var dollar = "$"; +var dopf = "𝕕"; +var dot = "˙"; +var doteq = "≐"; +var doteqdot = "≑"; +var dotminus = "∸"; +var dotplus = "∔"; +var dotsquare = "⊡"; +var doublebarwedge = "⌆"; +var downarrow = "↓"; +var downdownarrows = "⇊"; +var downharpoonleft = "⇃"; +var downharpoonright = "⇂"; +var drbkarow = "⤐"; +var drcorn = "⌟"; +var drcrop = "⌌"; +var dscr = "𝒹"; +var dscy = "ѕ"; +var dsol = "⧶"; +var dstrok = "đ"; +var dtdot = "⋱"; +var dtri = "▿"; +var dtrif = "▾"; +var duarr = "⇵"; +var duhar = "⥯"; +var dwangle = "⦦"; +var dzcy = "џ"; +var dzigrarr = "⟿"; +var eDDot = "⩷"; +var eDot = "≑"; +var eacut = "é"; +var eacute$1 = "é"; +var easter = "⩮"; +var ecaron = "ě"; +var ecir = "ê"; +var ecirc$1 = "ê"; +var ecolon = "≕"; +var ecy = "э"; +var edot = "ė"; +var ee = "ⅇ"; +var efDot = "≒"; +var efr = "𝔢"; +var eg = "⪚"; +var egrav = "è"; +var egrave$1 = "è"; +var egs = "⪖"; +var egsdot = "⪘"; +var el = "⪙"; +var elinters = "⏧"; +var ell = "ℓ"; +var els = "⪕"; +var elsdot = "⪗"; +var emacr = "ē"; +var empty$3 = "∅"; +var emptyset = "∅"; +var emptyv = "∅"; +var emsp13 = " "; +var emsp14 = " "; +var emsp$1 = " "; +var eng = "ŋ"; +var ensp$1 = " "; +var eogon = "ę"; +var eopf = "𝕖"; +var epar = "⋕"; +var eparsl = "⧣"; +var eplus = "⩱"; +var epsi = "ε"; +var epsilon$1 = "ε"; +var epsiv = "ϵ"; +var eqcirc = "≖"; +var eqcolon = "≕"; +var eqsim = "≂"; +var eqslantgtr = "⪖"; +var eqslantless = "⪕"; +var equals = "="; +var equest = "≟"; +var equiv$1 = "≡"; +var equivDD = "⩸"; +var eqvparsl = "⧥"; +var erDot = "≓"; +var erarr = "⥱"; +var escr = "ℯ"; +var esdot = "≐"; +var esim = "≂"; +var eta$1 = "η"; +var et = "ð"; +var eth$1 = "ð"; +var eum = "ë"; +var euml$1 = "ë"; +var euro$1 = "€"; +var excl = "!"; +var exist$1 = "∃"; +var expectation = "ℰ"; +var exponentiale = "ⅇ"; +var fallingdotseq = "≒"; +var fcy = "ф"; +var female = "♀"; +var ffilig = "ffi"; +var fflig = "ff"; +var ffllig = "ffl"; +var ffr = "𝔣"; +var filig = "fi"; +var fjlig = "fj"; +var flat = "♭"; +var fllig = "fl"; +var fltns = "▱"; +var fnof$1 = "ƒ"; +var fopf = "𝕗"; +var forall$1 = "∀"; +var fork = "⋔"; +var forkv = "⫙"; +var fpartint = "⨍"; +var frac1 = "¼"; +var frac12$1 = "½"; +var frac13 = "⅓"; +var frac14$1 = "¼"; +var frac15 = "⅕"; +var frac16 = "⅙"; +var frac18 = "⅛"; +var frac23 = "⅔"; +var frac25 = "⅖"; +var frac3 = "¾"; +var frac34$1 = "¾"; +var frac35 = "⅗"; +var frac38 = "⅜"; +var frac45 = "⅘"; +var frac56 = "⅚"; +var frac58 = "⅝"; +var frac78 = "⅞"; +var frasl$1 = "⁄"; +var frown = "⌢"; +var fscr = "𝒻"; +var gE = "≧"; +var gEl = "⪌"; +var gacute = "ǵ"; +var gamma$1 = "γ"; +var gammad = "ϝ"; +var gap = "⪆"; +var gbreve = "ğ"; +var gcirc = "ĝ"; +var gcy = "г"; +var gdot = "ġ"; +var ge$1 = "≥"; +var gel = "⋛"; +var geq = "≥"; +var geqq = "≧"; +var geqslant = "⩾"; +var ges = "⩾"; +var gescc = "⪩"; +var gesdot = "⪀"; +var gesdoto = "⪂"; +var gesdotol = "⪄"; +var gesl = "⋛︀"; +var gesles = "⪔"; +var gfr = "𝔤"; +var gg = "≫"; +var ggg = "⋙"; +var gimel = "ℷ"; +var gjcy = "ѓ"; +var gl = "≷"; +var glE = "⪒"; +var gla = "⪥"; +var glj = "⪤"; +var gnE = "≩"; +var gnap = "⪊"; +var gnapprox = "⪊"; +var gne = "⪈"; +var gneq = "⪈"; +var gneqq = "≩"; +var gnsim = "⋧"; +var gopf = "𝕘"; +var grave = "`"; +var gscr = "ℊ"; +var gsim = "≳"; +var gsime = "⪎"; +var gsiml = "⪐"; +var g = ">"; +var gt$1 = ">"; +var gtcc = "⪧"; +var gtcir = "⩺"; +var gtdot = "⋗"; +var gtlPar = "⦕"; +var gtquest = "⩼"; +var gtrapprox = "⪆"; +var gtrarr = "⥸"; +var gtrdot = "⋗"; +var gtreqless = "⋛"; +var gtreqqless = "⪌"; +var gtrless = "≷"; +var gtrsim = "≳"; +var gvertneqq = "≩︀"; +var gvnE = "≩︀"; +var hArr$1 = "⇔"; +var hairsp = " "; +var half = "½"; +var hamilt = "ℋ"; +var hardcy = "ъ"; +var harr$1 = "↔"; +var harrcir = "⥈"; +var harrw = "↭"; +var hbar = "ℏ"; +var hcirc = "ĥ"; +var hearts$1 = "♥"; +var heartsuit = "♥"; +var hellip$1 = "…"; +var hercon = "⊹"; +var hfr = "𝔥"; +var hksearow = "⤥"; +var hkswarow = "⤦"; +var hoarr = "⇿"; +var homtht = "∻"; +var hookleftarrow = "↩"; +var hookrightarrow = "↪"; +var hopf = "𝕙"; +var horbar = "―"; +var hscr = "𝒽"; +var hslash = "ℏ"; +var hstrok = "ħ"; +var hybull = "⁃"; +var hyphen = "‐"; +var iacut = "í"; +var iacute$1 = "í"; +var ic = "⁣"; +var icir = "î"; +var icirc$1 = "î"; +var icy = "и"; +var iecy = "е"; +var iexc = "¡"; +var iexcl$1 = "¡"; +var iff = "⇔"; +var ifr = "𝔦"; +var igrav = "ì"; +var igrave$1 = "ì"; +var ii = "ⅈ"; +var iiiint = "⨌"; +var iiint = "∭"; +var iinfin = "⧜"; +var iiota = "℩"; +var ijlig = "ij"; +var imacr = "ī"; +var image$2 = "ℑ"; +var imagline = "ℐ"; +var imagpart = "ℑ"; +var imath = "ı"; +var imof = "⊷"; +var imped = "Ƶ"; +var incare = "℅"; +var infin$1 = "∞"; +var infintie = "⧝"; +var inodot = "ı"; +var int$2 = "∫"; +var intcal = "⊺"; +var integers = "ℤ"; +var intercal = "⊺"; +var intlarhk = "⨗"; +var intprod = "⨼"; +var iocy = "ё"; +var iogon = "į"; +var iopf = "𝕚"; +var iota$1 = "ι"; +var iprod = "⨼"; +var iques = "¿"; +var iquest$1 = "¿"; +var iscr = "𝒾"; +var isin$1 = "∈"; +var isinE = "⋹"; +var isindot = "⋵"; +var isins = "⋴"; +var isinsv = "⋳"; +var isinv = "∈"; +var it = "⁢"; +var itilde = "ĩ"; +var iukcy = "і"; +var ium = "ï"; +var iuml$1 = "ï"; +var jcirc = "ĵ"; +var jcy = "й"; +var jfr = "𝔧"; +var jmath = "ȷ"; +var jopf = "𝕛"; +var jscr = "𝒿"; +var jsercy = "ј"; +var jukcy = "є"; +var kappa$1 = "κ"; +var kappav = "ϰ"; +var kcedil = "ķ"; +var kcy = "к"; +var kfr = "𝔨"; +var kgreen = "ĸ"; +var khcy = "х"; +var kjcy = "ќ"; +var kopf = "𝕜"; +var kscr = "𝓀"; +var lAarr = "⇚"; +var lArr$1 = "⇐"; +var lAtail = "⤛"; +var lBarr = "⤎"; +var lE = "≦"; +var lEg = "⪋"; +var lHar = "⥢"; +var lacute = "ĺ"; +var laemptyv = "⦴"; +var lagran = "ℒ"; +var lambda$1 = "λ"; +var lang$1 = "⟨"; +var langd = "⦑"; +var langle = "⟨"; +var lap = "⪅"; +var laqu = "«"; +var laquo$1 = "«"; +var larr$1 = "←"; +var larrb = "⇤"; +var larrbfs = "⤟"; +var larrfs = "⤝"; +var larrhk = "↩"; +var larrlp = "↫"; +var larrpl = "⤹"; +var larrsim = "⥳"; +var larrtl = "↢"; +var lat = "⪫"; +var latail = "⤙"; +var late = "⪭"; +var lates = "⪭︀"; +var lbarr = "⤌"; +var lbbrk = "❲"; +var lbrace = "{"; +var lbrack = "["; +var lbrke = "⦋"; +var lbrksld = "⦏"; +var lbrkslu = "⦍"; +var lcaron = "ľ"; +var lcedil = "ļ"; +var lceil$1 = "⌈"; +var lcub = "{"; +var lcy = "л"; +var ldca = "⤶"; +var ldquo$1 = "“"; +var ldquor = "„"; +var ldrdhar = "⥧"; +var ldrushar = "⥋"; +var ldsh = "↲"; +var le$1 = "≤"; +var leftarrow = "←"; +var leftarrowtail = "↢"; +var leftharpoondown = "↽"; +var leftharpoonup = "↼"; +var leftleftarrows = "⇇"; +var leftrightarrow = "↔"; +var leftrightarrows = "⇆"; +var leftrightharpoons = "⇋"; +var leftrightsquigarrow = "↭"; +var leftthreetimes = "⋋"; +var leg = "⋚"; +var leq = "≤"; +var leqq = "≦"; +var leqslant = "⩽"; +var les = "⩽"; +var lescc = "⪨"; +var lesdot = "⩿"; +var lesdoto = "⪁"; +var lesdotor = "⪃"; +var lesg = "⋚︀"; +var lesges = "⪓"; +var lessapprox = "⪅"; +var lessdot = "⋖"; +var lesseqgtr = "⋚"; +var lesseqqgtr = "⪋"; +var lessgtr = "≶"; +var lesssim = "≲"; +var lfisht = "⥼"; +var lfloor$1 = "⌊"; +var lfr = "𝔩"; +var lg = "≶"; +var lgE = "⪑"; +var lhard = "↽"; +var lharu = "↼"; +var lharul = "⥪"; +var lhblk = "▄"; +var ljcy = "љ"; +var ll = "≪"; +var llarr = "⇇"; +var llcorner = "⌞"; +var llhard = "⥫"; +var lltri = "◺"; +var lmidot = "ŀ"; +var lmoust = "⎰"; +var lmoustache = "⎰"; +var lnE = "≨"; +var lnap = "⪉"; +var lnapprox = "⪉"; +var lne = "⪇"; +var lneq = "⪇"; +var lneqq = "≨"; +var lnsim = "⋦"; +var loang = "⟬"; +var loarr = "⇽"; +var lobrk = "⟦"; +var longleftarrow = "⟵"; +var longleftrightarrow = "⟷"; +var longmapsto = "⟼"; +var longrightarrow = "⟶"; +var looparrowleft = "↫"; +var looparrowright = "↬"; +var lopar = "⦅"; +var lopf = "𝕝"; +var loplus = "⨭"; +var lotimes = "⨴"; +var lowast$1 = "∗"; +var lowbar = "_"; +var loz$1 = "◊"; +var lozenge = "◊"; +var lozf = "⧫"; +var lpar = "("; +var lparlt = "⦓"; +var lrarr = "⇆"; +var lrcorner = "⌟"; +var lrhar = "⇋"; +var lrhard = "⥭"; +var lrm$1 = "‎"; +var lrtri = "⊿"; +var lsaquo$1 = "‹"; +var lscr = "𝓁"; +var lsh = "↰"; +var lsim = "≲"; +var lsime = "⪍"; +var lsimg = "⪏"; +var lsqb = "["; +var lsquo$1 = "‘"; +var lsquor = "‚"; +var lstrok = "ł"; +var l = "<"; +var lt$1 = "<"; +var ltcc = "⪦"; +var ltcir = "⩹"; +var ltdot = "⋖"; +var lthree = "⋋"; +var ltimes = "⋉"; +var ltlarr = "⥶"; +var ltquest = "⩻"; +var ltrPar = "⦖"; +var ltri = "◃"; +var ltrie = "⊴"; +var ltrif = "◂"; +var lurdshar = "⥊"; +var luruhar = "⥦"; +var lvertneqq = "≨︀"; +var lvnE = "≨︀"; +var mDDot = "∺"; +var mac = "¯"; +var macr$1 = "¯"; +var male = "♂"; +var malt = "✠"; +var maltese = "✠"; +var map$1 = "↦"; +var mapsto = "↦"; +var mapstodown = "↧"; +var mapstoleft = "↤"; +var mapstoup = "↥"; +var marker = "▮"; +var mcomma = "⨩"; +var mcy = "м"; +var mdash$1 = "—"; +var measuredangle = "∡"; +var mfr = "𝔪"; +var mho = "℧"; +var micr = "µ"; +var micro$1 = "µ"; +var mid = "∣"; +var midast = "*"; +var midcir = "⫰"; +var middo = "·"; +var middot$1 = "·"; +var minus$1 = "−"; +var minusb = "⊟"; +var minusd = "∸"; +var minusdu = "⨪"; +var mlcp = "⫛"; +var mldr = "…"; +var mnplus = "∓"; +var models = "⊧"; +var mopf = "𝕞"; +var mp = "∓"; +var mscr = "𝓂"; +var mstpos = "∾"; +var mu$1 = "μ"; +var multimap = "⊸"; +var mumap = "⊸"; +var nGg = "⋙̸"; +var nGt = "≫⃒"; +var nGtv = "≫̸"; +var nLeftarrow = "⇍"; +var nLeftrightarrow = "⇎"; +var nLl = "⋘̸"; +var nLt = "≪⃒"; +var nLtv = "≪̸"; +var nRightarrow = "⇏"; +var nVDash = "⊯"; +var nVdash = "⊮"; +var nabla$1 = "∇"; +var nacute = "ń"; +var nang = "∠⃒"; +var nap = "≉"; +var napE = "⩰̸"; +var napid = "≋̸"; +var napos = "ʼn"; +var napprox = "≉"; +var natur = "♮"; +var natural = "♮"; +var naturals = "ℕ"; +var nbs = " "; +var nbsp$1 = " "; +var nbump = "≎̸"; +var nbumpe = "≏̸"; +var ncap = "⩃"; +var ncaron = "ň"; +var ncedil = "ņ"; +var ncong = "≇"; +var ncongdot = "⩭̸"; +var ncup = "⩂"; +var ncy = "н"; +var ndash$1 = "–"; +var ne$1 = "≠"; +var neArr = "⇗"; +var nearhk = "⤤"; +var nearr = "↗"; +var nearrow = "↗"; +var nedot = "≐̸"; +var nequiv = "≢"; +var nesear = "⤨"; +var nesim = "≂̸"; +var nexist = "∄"; +var nexists = "∄"; +var nfr = "𝔫"; +var ngE = "≧̸"; +var nge = "≱"; +var ngeq = "≱"; +var ngeqq = "≧̸"; +var ngeqslant = "⩾̸"; +var nges = "⩾̸"; +var ngsim = "≵"; +var ngt = "≯"; +var ngtr = "≯"; +var nhArr = "⇎"; +var nharr = "↮"; +var nhpar = "⫲"; +var ni$1 = "∋"; +var nis = "⋼"; +var nisd = "⋺"; +var niv = "∋"; +var njcy = "њ"; +var nlArr = "⇍"; +var nlE = "≦̸"; +var nlarr = "↚"; +var nldr = "‥"; +var nle = "≰"; +var nleftarrow = "↚"; +var nleftrightarrow = "↮"; +var nleq = "≰"; +var nleqq = "≦̸"; +var nleqslant = "⩽̸"; +var nles = "⩽̸"; +var nless = "≮"; +var nlsim = "≴"; +var nlt = "≮"; +var nltri = "⋪"; +var nltrie = "⋬"; +var nmid = "∤"; +var nopf = "𝕟"; +var no = "¬"; +var not$1 = "¬"; +var notin$1 = "∉"; +var notinE = "⋹̸"; +var notindot = "⋵̸"; +var notinva = "∉"; +var notinvb = "⋷"; +var notinvc = "⋶"; +var notni = "∌"; +var notniva = "∌"; +var notnivb = "⋾"; +var notnivc = "⋽"; +var npar = "∦"; +var nparallel = "∦"; +var nparsl = "⫽⃥"; +var npart = "∂̸"; +var npolint = "⨔"; +var npr = "⊀"; +var nprcue = "⋠"; +var npre = "⪯̸"; +var nprec = "⊀"; +var npreceq = "⪯̸"; +var nrArr = "⇏"; +var nrarr = "↛"; +var nrarrc = "⤳̸"; +var nrarrw = "↝̸"; +var nrightarrow = "↛"; +var nrtri = "⋫"; +var nrtrie = "⋭"; +var nsc = "⊁"; +var nsccue = "⋡"; +var nsce = "⪰̸"; +var nscr = "𝓃"; +var nshortmid = "∤"; +var nshortparallel = "∦"; +var nsim = "≁"; +var nsime = "≄"; +var nsimeq = "≄"; +var nsmid = "∤"; +var nspar = "∦"; +var nsqsube = "⋢"; +var nsqsupe = "⋣"; +var nsub$1 = "⊄"; +var nsubE = "⫅̸"; +var nsube = "⊈"; +var nsubset = "⊂⃒"; +var nsubseteq = "⊈"; +var nsubseteqq = "⫅̸"; +var nsucc = "⊁"; +var nsucceq = "⪰̸"; +var nsup = "⊅"; +var nsupE = "⫆̸"; +var nsupe = "⊉"; +var nsupset = "⊃⃒"; +var nsupseteq = "⊉"; +var nsupseteqq = "⫆̸"; +var ntgl = "≹"; +var ntild = "ñ"; +var ntilde$1 = "ñ"; +var ntlg = "≸"; +var ntriangleleft = "⋪"; +var ntrianglelefteq = "⋬"; +var ntriangleright = "⋫"; +var ntrianglerighteq = "⋭"; +var nu$1 = "ν"; +var num = "#"; +var numero = "№"; +var numsp = " "; +var nvDash = "⊭"; +var nvHarr = "⤄"; +var nvap = "≍⃒"; +var nvdash = "⊬"; +var nvge = "≥⃒"; +var nvgt = ">⃒"; +var nvinfin = "⧞"; +var nvlArr = "⤂"; +var nvle = "≤⃒"; +var nvlt = "<⃒"; +var nvltrie = "⊴⃒"; +var nvrArr = "⤃"; +var nvrtrie = "⊵⃒"; +var nvsim = "∼⃒"; +var nwArr = "⇖"; +var nwarhk = "⤣"; +var nwarr = "↖"; +var nwarrow = "↖"; +var nwnear = "⤧"; +var oS = "Ⓢ"; +var oacut = "ó"; +var oacute$1 = "ó"; +var oast = "⊛"; +var ocir = "ô"; +var ocirc$1 = "ô"; +var ocy = "о"; +var odash = "⊝"; +var odblac = "ő"; +var odiv = "⨸"; +var odot = "⊙"; +var odsold = "⦼"; +var oelig$1 = "œ"; +var ofcir = "⦿"; +var ofr = "𝔬"; +var ogon = "˛"; +var ograv = "ò"; +var ograve$1 = "ò"; +var ogt = "⧁"; +var ohbar = "⦵"; +var ohm = "Ω"; +var oint = "∮"; +var olarr = "↺"; +var olcir = "⦾"; +var olcross = "⦻"; +var oline$1 = "‾"; +var olt = "⧀"; +var omacr = "ō"; +var omega$1 = "ω"; +var omicron$1 = "ο"; +var omid = "⦶"; +var ominus = "⊖"; +var oopf = "𝕠"; +var opar = "⦷"; +var operp = "⦹"; +var oplus$1 = "⊕"; +var or$1 = "∨"; +var orarr = "↻"; +var ord = "º"; +var order = "ℴ"; +var orderof = "ℴ"; +var ordf$1 = "ª"; +var ordm$1 = "º"; +var origof = "⊶"; +var oror = "⩖"; +var orslope = "⩗"; +var orv = "⩛"; +var oscr = "ℴ"; +var oslas = "ø"; +var oslash$1 = "ø"; +var osol = "⊘"; +var otild = "õ"; +var otilde$1 = "õ"; +var otimes$1 = "⊗"; +var otimesas = "⨶"; +var oum = "ö"; +var ouml$1 = "ö"; +var ovbar = "⌽"; +var par = "¶"; +var para$1 = "¶"; +var parallel = "∥"; +var parsim = "⫳"; +var parsl = "⫽"; +var part$1 = "∂"; +var pcy = "п"; +var percnt = "%"; +var period = "."; +var permil$1 = "‰"; +var perp$1 = "⊥"; +var pertenk = "‱"; +var pfr = "𝔭"; +var phi$1 = "φ"; +var phiv = "ϕ"; +var phmmat = "ℳ"; +var phone = "☎"; +var pi$1 = "π"; +var pitchfork = "⋔"; +var piv$1 = "ϖ"; +var planck = "ℏ"; +var planckh = "ℎ"; +var plankv = "ℏ"; +var plus = "+"; +var plusacir = "⨣"; +var plusb = "⊞"; +var pluscir = "⨢"; +var plusdo = "∔"; +var plusdu = "⨥"; +var pluse = "⩲"; +var plusm = "±"; +var plusmn$1 = "±"; +var plussim = "⨦"; +var plustwo = "⨧"; +var pm = "±"; +var pointint = "⨕"; +var popf = "𝕡"; +var poun = "£"; +var pound$1 = "£"; +var pr = "≺"; +var prE = "⪳"; +var prap = "⪷"; +var prcue = "≼"; +var pre = "⪯"; +var prec = "≺"; +var precapprox = "⪷"; +var preccurlyeq = "≼"; +var preceq = "⪯"; +var precnapprox = "⪹"; +var precneqq = "⪵"; +var precnsim = "⋨"; +var precsim = "≾"; +var prime$1 = "′"; +var primes = "ℙ"; +var prnE = "⪵"; +var prnap = "⪹"; +var prnsim = "⋨"; +var prod$1 = "∏"; +var profalar = "⌮"; +var profline = "⌒"; +var profsurf = "⌓"; +var prop$1 = "∝"; +var propto = "∝"; +var prsim = "≾"; +var prurel = "⊰"; +var pscr = "𝓅"; +var psi$1 = "ψ"; +var puncsp = " "; +var qfr = "𝔮"; +var qint = "⨌"; +var qopf = "𝕢"; +var qprime = "⁗"; +var qscr = "𝓆"; +var quaternions = "ℍ"; +var quatint = "⨖"; +var quest = "?"; +var questeq = "≟"; +var quo = "\""; +var quot$1 = "\""; +var rAarr = "⇛"; +var rArr$1 = "⇒"; +var rAtail = "⤜"; +var rBarr = "⤏"; +var rHar = "⥤"; +var race = "∽̱"; +var racute = "ŕ"; +var radic$1 = "√"; +var raemptyv = "⦳"; +var rang$1 = "⟩"; +var rangd = "⦒"; +var range = "⦥"; +var rangle = "⟩"; +var raqu = "»"; +var raquo$1 = "»"; +var rarr$1 = "→"; +var rarrap = "⥵"; +var rarrb = "⇥"; +var rarrbfs = "⤠"; +var rarrc = "⤳"; +var rarrfs = "⤞"; +var rarrhk = "↪"; +var rarrlp = "↬"; +var rarrpl = "⥅"; +var rarrsim = "⥴"; +var rarrtl = "↣"; +var rarrw = "↝"; +var ratail = "⤚"; +var ratio = "∶"; +var rationals = "ℚ"; +var rbarr = "⤍"; +var rbbrk = "❳"; +var rbrace = "}"; +var rbrack = "]"; +var rbrke = "⦌"; +var rbrksld = "⦎"; +var rbrkslu = "⦐"; +var rcaron = "ř"; +var rcedil = "ŗ"; +var rceil$1 = "⌉"; +var rcub = "}"; +var rcy = "р"; +var rdca = "⤷"; +var rdldhar = "⥩"; +var rdquo$1 = "”"; +var rdquor = "”"; +var rdsh = "↳"; +var real$1 = "ℜ"; +var realine = "ℛ"; +var realpart = "ℜ"; +var reals = "ℝ"; +var rect = "▭"; +var re$1 = "®"; +var reg$1 = "®"; +var rfisht = "⥽"; +var rfloor$1 = "⌋"; +var rfr = "𝔯"; +var rhard = "⇁"; +var rharu = "⇀"; +var rharul = "⥬"; +var rho$1 = "ρ"; +var rhov = "ϱ"; +var rightarrow = "→"; +var rightarrowtail = "↣"; +var rightharpoondown = "⇁"; +var rightharpoonup = "⇀"; +var rightleftarrows = "⇄"; +var rightleftharpoons = "⇌"; +var rightrightarrows = "⇉"; +var rightsquigarrow = "↝"; +var rightthreetimes = "⋌"; +var ring = "˚"; +var risingdotseq = "≓"; +var rlarr = "⇄"; +var rlhar = "⇌"; +var rlm$1 = "‏"; +var rmoust = "⎱"; +var rmoustache = "⎱"; +var rnmid = "⫮"; +var roang = "⟭"; +var roarr = "⇾"; +var robrk = "⟧"; +var ropar = "⦆"; +var ropf = "𝕣"; +var roplus = "⨮"; +var rotimes = "⨵"; +var rpar = ")"; +var rpargt = "⦔"; +var rppolint = "⨒"; +var rrarr = "⇉"; +var rsaquo$1 = "›"; +var rscr = "𝓇"; +var rsh = "↱"; +var rsqb = "]"; +var rsquo$1 = "’"; +var rsquor = "’"; +var rthree = "⋌"; +var rtimes = "⋊"; +var rtri = "▹"; +var rtrie = "⊵"; +var rtrif = "▸"; +var rtriltri = "⧎"; +var ruluhar = "⥨"; +var rx = "℞"; +var sacute = "ś"; +var sbquo$1 = "‚"; +var sc = "≻"; +var scE = "⪴"; +var scap = "⪸"; +var scaron$1 = "š"; +var sccue = "≽"; +var sce = "⪰"; +var scedil = "ş"; +var scirc = "ŝ"; +var scnE = "⪶"; +var scnap = "⪺"; +var scnsim = "⋩"; +var scpolint = "⨓"; +var scsim = "≿"; +var scy = "с"; +var sdot$1 = "⋅"; +var sdotb = "⊡"; +var sdote = "⩦"; +var seArr = "⇘"; +var searhk = "⤥"; +var searr = "↘"; +var searrow = "↘"; +var sec = "§"; +var sect$1 = "§"; +var semi = ";"; +var seswar = "⤩"; +var setminus = "∖"; +var setmn = "∖"; +var sext = "✶"; +var sfr = "𝔰"; +var sfrown = "⌢"; +var sharp = "♯"; +var shchcy = "щ"; +var shcy = "ш"; +var shortmid = "∣"; +var shortparallel = "∥"; +var sh = "­"; +var shy$1 = "­"; +var sigma$1 = "σ"; +var sigmaf$1 = "ς"; +var sigmav = "ς"; +var sim$1 = "∼"; +var simdot = "⩪"; +var sime = "≃"; +var simeq = "≃"; +var simg = "⪞"; +var simgE = "⪠"; +var siml = "⪝"; +var simlE = "⪟"; +var simne = "≆"; +var simplus = "⨤"; +var simrarr = "⥲"; +var slarr = "←"; +var smallsetminus = "∖"; +var smashp = "⨳"; +var smeparsl = "⧤"; +var smid = "∣"; +var smile = "⌣"; +var smt = "⪪"; +var smte = "⪬"; +var smtes = "⪬︀"; +var softcy = "ь"; +var sol = "/"; +var solb = "⧄"; +var solbar = "⌿"; +var sopf = "𝕤"; +var spades$1 = "♠"; +var spadesuit = "♠"; +var spar = "∥"; +var sqcap = "⊓"; +var sqcaps = "⊓︀"; +var sqcup = "⊔"; +var sqcups = "⊔︀"; +var sqsub = "⊏"; +var sqsube = "⊑"; +var sqsubset = "⊏"; +var sqsubseteq = "⊑"; +var sqsup = "⊐"; +var sqsupe = "⊒"; +var sqsupset = "⊐"; +var sqsupseteq = "⊒"; +var squ = "□"; +var square = "□"; +var squarf = "▪"; +var squf = "▪"; +var srarr = "→"; +var sscr = "𝓈"; +var ssetmn = "∖"; +var ssmile = "⌣"; +var sstarf = "⋆"; +var star = "☆"; +var starf = "★"; +var straightepsilon = "ϵ"; +var straightphi = "ϕ"; +var strns = "¯"; +var sub$1 = "⊂"; +var subE = "⫅"; +var subdot = "⪽"; +var sube$1 = "⊆"; +var subedot = "⫃"; +var submult = "⫁"; +var subnE = "⫋"; +var subne = "⊊"; +var subplus = "⪿"; +var subrarr = "⥹"; +var subset = "⊂"; +var subseteq = "⊆"; +var subseteqq = "⫅"; +var subsetneq = "⊊"; +var subsetneqq = "⫋"; +var subsim = "⫇"; +var subsub = "⫕"; +var subsup = "⫓"; +var succ = "≻"; +var succapprox = "⪸"; +var succcurlyeq = "≽"; +var succeq = "⪰"; +var succnapprox = "⪺"; +var succneqq = "⪶"; +var succnsim = "⋩"; +var succsim = "≿"; +var sum$1 = "∑"; +var sung = "♪"; +var sup$1 = "⊃"; +var sup1$1 = "¹"; +var sup2$1 = "²"; +var sup3$1 = "³"; +var supE = "⫆"; +var supdot = "⪾"; +var supdsub = "⫘"; +var supe$1 = "⊇"; +var supedot = "⫄"; +var suphsol = "⟉"; +var suphsub = "⫗"; +var suplarr = "⥻"; +var supmult = "⫂"; +var supnE = "⫌"; +var supne = "⊋"; +var supplus = "⫀"; +var supset = "⊃"; +var supseteq = "⊇"; +var supseteqq = "⫆"; +var supsetneq = "⊋"; +var supsetneqq = "⫌"; +var supsim = "⫈"; +var supsub = "⫔"; +var supsup = "⫖"; +var swArr = "⇙"; +var swarhk = "⤦"; +var swarr = "↙"; +var swarrow = "↙"; +var swnwar = "⤪"; +var szli = "ß"; +var szlig$1 = "ß"; +var target = "⌖"; +var tau$1 = "τ"; +var tbrk = "⎴"; +var tcaron = "ť"; +var tcedil = "ţ"; +var tcy = "т"; +var tdot = "⃛"; +var telrec = "⌕"; +var tfr = "𝔱"; +var there4$1 = "∴"; +var therefore = "∴"; +var theta$1 = "θ"; +var thetasym$1 = "ϑ"; +var thetav = "ϑ"; +var thickapprox = "≈"; +var thicksim = "∼"; +var thinsp$1 = " "; +var thkap = "≈"; +var thksim = "∼"; +var thor = "þ"; +var thorn$1 = "þ"; +var tilde$1 = "˜"; +var time = "×"; +var times$1 = "×"; +var timesb = "⊠"; +var timesbar = "⨱"; +var timesd = "⨰"; +var tint = "∭"; +var toea = "⤨"; +var top = "⊤"; +var topbot = "⌶"; +var topcir = "⫱"; +var topf = "𝕥"; +var topfork = "⫚"; +var tosa = "⤩"; +var tprime = "‴"; +var trade$1 = "™"; +var triangle = "▵"; +var triangledown = "▿"; +var triangleleft = "◃"; +var trianglelefteq = "⊴"; +var triangleq = "≜"; +var triangleright = "▹"; +var trianglerighteq = "⊵"; +var tridot = "◬"; +var trie = "≜"; +var triminus = "⨺"; +var triplus = "⨹"; +var trisb = "⧍"; +var tritime = "⨻"; +var trpezium = "⏢"; +var tscr = "𝓉"; +var tscy = "ц"; +var tshcy = "ћ"; +var tstrok = "ŧ"; +var twixt = "≬"; +var twoheadleftarrow = "↞"; +var twoheadrightarrow = "↠"; +var uArr$1 = "⇑"; +var uHar = "⥣"; +var uacut = "ú"; +var uacute$1 = "ú"; +var uarr$1 = "↑"; +var ubrcy = "ў"; +var ubreve = "ŭ"; +var ucir = "û"; +var ucirc$1 = "û"; +var ucy = "у"; +var udarr = "⇅"; +var udblac = "ű"; +var udhar = "⥮"; +var ufisht = "⥾"; +var ufr = "𝔲"; +var ugrav = "ù"; +var ugrave$1 = "ù"; +var uharl = "↿"; +var uharr = "↾"; +var uhblk = "▀"; +var ulcorn = "⌜"; +var ulcorner = "⌜"; +var ulcrop = "⌏"; +var ultri = "◸"; +var umacr = "ū"; +var um = "¨"; +var uml$1 = "¨"; +var uogon = "ų"; +var uopf = "𝕦"; +var uparrow = "↑"; +var updownarrow = "↕"; +var upharpoonleft = "↿"; +var upharpoonright = "↾"; +var uplus = "⊎"; +var upsi = "υ"; +var upsih$1 = "ϒ"; +var upsilon$1 = "υ"; +var upuparrows = "⇈"; +var urcorn = "⌝"; +var urcorner = "⌝"; +var urcrop = "⌎"; +var uring = "ů"; +var urtri = "◹"; +var uscr = "𝓊"; +var utdot = "⋰"; +var utilde = "ũ"; +var utri = "▵"; +var utrif = "▴"; +var uuarr = "⇈"; +var uum = "ü"; +var uuml$1 = "ü"; +var uwangle = "⦧"; +var vArr = "⇕"; +var vBar = "⫨"; +var vBarv = "⫩"; +var vDash = "⊨"; +var vangrt = "⦜"; +var varepsilon = "ϵ"; +var varkappa = "ϰ"; +var varnothing = "∅"; +var varphi = "ϕ"; +var varpi = "ϖ"; +var varpropto = "∝"; +var varr = "↕"; +var varrho = "ϱ"; +var varsigma = "ς"; +var varsubsetneq = "⊊︀"; +var varsubsetneqq = "⫋︀"; +var varsupsetneq = "⊋︀"; +var varsupsetneqq = "⫌︀"; +var vartheta = "ϑ"; +var vartriangleleft = "⊲"; +var vartriangleright = "⊳"; +var vcy = "в"; +var vdash = "⊢"; +var vee = "∨"; +var veebar = "⊻"; +var veeeq = "≚"; +var vellip = "⋮"; +var verbar = "|"; +var vert = "|"; +var vfr = "𝔳"; +var vltri = "⊲"; +var vnsub = "⊂⃒"; +var vnsup = "⊃⃒"; +var vopf = "𝕧"; +var vprop = "∝"; +var vrtri = "⊳"; +var vscr = "𝓋"; +var vsubnE = "⫋︀"; +var vsubne = "⊊︀"; +var vsupnE = "⫌︀"; +var vsupne = "⊋︀"; +var vzigzag = "⦚"; +var wcirc = "ŵ"; +var wedbar = "⩟"; +var wedge = "∧"; +var wedgeq = "≙"; +var weierp$1 = "℘"; +var wfr = "𝔴"; +var wopf = "𝕨"; +var wp = "℘"; +var wr = "≀"; +var wreath = "≀"; +var wscr = "𝓌"; +var xcap = "⋂"; +var xcirc = "◯"; +var xcup = "⋃"; +var xdtri = "▽"; +var xfr = "𝔵"; +var xhArr = "⟺"; +var xharr = "⟷"; +var xi$1 = "ξ"; +var xlArr = "⟸"; +var xlarr = "⟵"; +var xmap = "⟼"; +var xnis = "⋻"; +var xodot = "⨀"; +var xopf = "𝕩"; +var xoplus = "⨁"; +var xotime = "⨂"; +var xrArr = "⟹"; +var xrarr = "⟶"; +var xscr = "𝓍"; +var xsqcup = "⨆"; +var xuplus = "⨄"; +var xutri = "△"; +var xvee = "⋁"; +var xwedge = "⋀"; +var yacut = "ý"; +var yacute$1 = "ý"; +var yacy = "я"; +var ycirc = "ŷ"; +var ycy = "ы"; +var ye = "¥"; +var yen$1 = "¥"; +var yfr = "𝔶"; +var yicy = "ї"; +var yopf = "𝕪"; +var yscr = "𝓎"; +var yucy = "ю"; +var yum = "ÿ"; +var yuml$1 = "ÿ"; +var zacute = "ź"; +var zcaron = "ž"; +var zcy = "з"; +var zdot = "ż"; +var zeetrf = "ℨ"; +var zeta$1 = "ζ"; +var zfr = "𝔷"; +var zhcy = "ж"; +var zigrarr = "⇝"; +var zopf = "𝕫"; +var zscr = "𝓏"; +var zwj$1 = "‍"; +var zwnj$1 = "‌"; +var require$$0$1 = { + AEli: AEli, + AElig: AElig$1, + AM: AM, + AMP: AMP$1, + Aacut: Aacut, + Aacute: Aacute$1, + Abreve: Abreve, + Acir: Acir, + Acirc: Acirc$1, + Acy: Acy, + Afr: Afr, + Agrav: Agrav, + Agrave: Agrave$1, + Alpha: Alpha$1, + Amacr: Amacr, + And: And, + Aogon: Aogon, + Aopf: Aopf, + ApplyFunction: ApplyFunction, + Arin: Arin, + Aring: Aring$1, + Ascr: Ascr, + Assign: Assign, + Atild: Atild, + Atilde: Atilde$1, + Aum: Aum, + Auml: Auml$1, + Backslash: Backslash, + Barv: Barv, + Barwed: Barwed, + Bcy: Bcy, + Because: Because, + Bernoullis: Bernoullis, + Beta: Beta$1, + Bfr: Bfr, + Bopf: Bopf, + Breve: Breve, + Bscr: Bscr, + Bumpeq: Bumpeq, + CHcy: CHcy, + COP: COP, + COPY: COPY, + Cacute: Cacute, + Cap: Cap, + CapitalDifferentialD: CapitalDifferentialD, + Cayleys: Cayleys, + Ccaron: Ccaron, + Ccedi: Ccedi, + Ccedil: Ccedil$1, + Ccirc: Ccirc, + Cconint: Cconint, + Cdot: Cdot, + Cedilla: Cedilla, + CenterDot: CenterDot, + Cfr: Cfr, + Chi: Chi$1, + CircleDot: CircleDot, + CircleMinus: CircleMinus, + CirclePlus: CirclePlus, + CircleTimes: CircleTimes, + ClockwiseContourIntegral: ClockwiseContourIntegral, + CloseCurlyDoubleQuote: CloseCurlyDoubleQuote, + CloseCurlyQuote: CloseCurlyQuote, + Colon: Colon, + Colone: Colone, + Congruent: Congruent, + Conint: Conint, + ContourIntegral: ContourIntegral, + Copf: Copf, + Coproduct: Coproduct, + CounterClockwiseContourIntegral: CounterClockwiseContourIntegral, + Cross: Cross, + Cscr: Cscr, + Cup: Cup, + CupCap: CupCap, + DD: DD, + DDotrahd: DDotrahd, + DJcy: DJcy, + DScy: DScy, + DZcy: DZcy, + Dagger: Dagger$1, + Darr: Darr, + Dashv: Dashv, + Dcaron: Dcaron, + Dcy: Dcy, + Del: Del, + Delta: Delta$1, + Dfr: Dfr, + DiacriticalAcute: DiacriticalAcute, + DiacriticalDot: DiacriticalDot, + DiacriticalDoubleAcute: DiacriticalDoubleAcute, + DiacriticalGrave: DiacriticalGrave, + DiacriticalTilde: DiacriticalTilde, + Diamond: Diamond, + DifferentialD: DifferentialD, + Dopf: Dopf, + Dot: Dot, + DotDot: DotDot, + DotEqual: DotEqual, + DoubleContourIntegral: DoubleContourIntegral, + DoubleDot: DoubleDot, + DoubleDownArrow: DoubleDownArrow, + DoubleLeftArrow: DoubleLeftArrow, + DoubleLeftRightArrow: DoubleLeftRightArrow, + DoubleLeftTee: DoubleLeftTee, + DoubleLongLeftArrow: DoubleLongLeftArrow, + DoubleLongLeftRightArrow: DoubleLongLeftRightArrow, + DoubleLongRightArrow: DoubleLongRightArrow, + DoubleRightArrow: DoubleRightArrow, + DoubleRightTee: DoubleRightTee, + DoubleUpArrow: DoubleUpArrow, + DoubleUpDownArrow: DoubleUpDownArrow, + DoubleVerticalBar: DoubleVerticalBar, + DownArrow: DownArrow, + DownArrowBar: DownArrowBar, + DownArrowUpArrow: DownArrowUpArrow, + DownBreve: DownBreve, + DownLeftRightVector: DownLeftRightVector, + DownLeftTeeVector: DownLeftTeeVector, + DownLeftVector: DownLeftVector, + DownLeftVectorBar: DownLeftVectorBar, + DownRightTeeVector: DownRightTeeVector, + DownRightVector: DownRightVector, + DownRightVectorBar: DownRightVectorBar, + DownTee: DownTee, + DownTeeArrow: DownTeeArrow, + Downarrow: Downarrow, + Dscr: Dscr, + Dstrok: Dstrok, + ENG: ENG, + ET: ET, + ETH: ETH$1, + Eacut: Eacut, + Eacute: Eacute$1, + Ecaron: Ecaron, + Ecir: Ecir, + Ecirc: Ecirc$1, + Ecy: Ecy, + Edot: Edot, + Efr: Efr, + Egrav: Egrav, + Egrave: Egrave$1, + Element: Element, + Emacr: Emacr, + EmptySmallSquare: EmptySmallSquare, + EmptyVerySmallSquare: EmptyVerySmallSquare, + Eogon: Eogon, + Eopf: Eopf, + Epsilon: Epsilon$1, + Equal: Equal, + EqualTilde: EqualTilde, + Equilibrium: Equilibrium, + Escr: Escr, + Esim: Esim, + Eta: Eta$1, + Eum: Eum, + Euml: Euml$1, + Exists: Exists, + ExponentialE: ExponentialE, + Fcy: Fcy, + Ffr: Ffr, + FilledSmallSquare: FilledSmallSquare, + FilledVerySmallSquare: FilledVerySmallSquare, + Fopf: Fopf, + ForAll: ForAll, + Fouriertrf: Fouriertrf, + Fscr: Fscr, + GJcy: GJcy, + G: G, + GT: GT$1, + Gamma: Gamma$1, + Gammad: Gammad, + Gbreve: Gbreve, + Gcedil: Gcedil, + Gcirc: Gcirc, + Gcy: Gcy, + Gdot: Gdot, + Gfr: Gfr, + Gg: Gg, + Gopf: Gopf, + GreaterEqual: GreaterEqual, + GreaterEqualLess: GreaterEqualLess, + GreaterFullEqual: GreaterFullEqual, + GreaterGreater: GreaterGreater, + GreaterLess: GreaterLess, + GreaterSlantEqual: GreaterSlantEqual, + GreaterTilde: GreaterTilde, + Gscr: Gscr, + Gt: Gt, + HARDcy: HARDcy, + Hacek: Hacek, + Hat: Hat, + Hcirc: Hcirc, + Hfr: Hfr, + HilbertSpace: HilbertSpace, + Hopf: Hopf, + HorizontalLine: HorizontalLine, + Hscr: Hscr, + Hstrok: Hstrok, + HumpDownHump: HumpDownHump, + HumpEqual: HumpEqual, + IEcy: IEcy, + IJlig: IJlig, + IOcy: IOcy, + Iacut: Iacut, + Iacute: Iacute$1, + Icir: Icir, + Icirc: Icirc$1, + Icy: Icy, + Idot: Idot, + Ifr: Ifr, + Igrav: Igrav, + Igrave: Igrave$1, + Im: Im, + Imacr: Imacr, + ImaginaryI: ImaginaryI, + Implies: Implies, + Int: Int, + Integral: Integral, + Intersection: Intersection, + InvisibleComma: InvisibleComma, + InvisibleTimes: InvisibleTimes, + Iogon: Iogon, + Iopf: Iopf, + Iota: Iota$1, + Iscr: Iscr, + Itilde: Itilde, + Iukcy: Iukcy, + Ium: Ium, + Iuml: Iuml$1, + Jcirc: Jcirc, + Jcy: Jcy, + Jfr: Jfr, + Jopf: Jopf, + Jscr: Jscr, + Jsercy: Jsercy, + Jukcy: Jukcy, + KHcy: KHcy, + KJcy: KJcy, + Kappa: Kappa$1, + Kcedil: Kcedil, + Kcy: Kcy, + Kfr: Kfr, + Kopf: Kopf, + Kscr: Kscr, + LJcy: LJcy, + L: L, + LT: LT$1, + Lacute: Lacute, + Lambda: Lambda$1, + Lang: Lang, + Laplacetrf: Laplacetrf, + Larr: Larr, + Lcaron: Lcaron, + Lcedil: Lcedil, + Lcy: Lcy, + LeftAngleBracket: LeftAngleBracket, + LeftArrow: LeftArrow, + LeftArrowBar: LeftArrowBar, + LeftArrowRightArrow: LeftArrowRightArrow, + LeftCeiling: LeftCeiling, + LeftDoubleBracket: LeftDoubleBracket, + LeftDownTeeVector: LeftDownTeeVector, + LeftDownVector: LeftDownVector, + LeftDownVectorBar: LeftDownVectorBar, + LeftFloor: LeftFloor, + LeftRightArrow: LeftRightArrow, + LeftRightVector: LeftRightVector, + LeftTee: LeftTee, + LeftTeeArrow: LeftTeeArrow, + LeftTeeVector: LeftTeeVector, + LeftTriangle: LeftTriangle, + LeftTriangleBar: LeftTriangleBar, + LeftTriangleEqual: LeftTriangleEqual, + LeftUpDownVector: LeftUpDownVector, + LeftUpTeeVector: LeftUpTeeVector, + LeftUpVector: LeftUpVector, + LeftUpVectorBar: LeftUpVectorBar, + LeftVector: LeftVector, + LeftVectorBar: LeftVectorBar, + Leftarrow: Leftarrow, + Leftrightarrow: Leftrightarrow, + LessEqualGreater: LessEqualGreater, + LessFullEqual: LessFullEqual, + LessGreater: LessGreater, + LessLess: LessLess, + LessSlantEqual: LessSlantEqual, + LessTilde: LessTilde, + Lfr: Lfr, + Ll: Ll, + Lleftarrow: Lleftarrow, + Lmidot: Lmidot, + LongLeftArrow: LongLeftArrow, + LongLeftRightArrow: LongLeftRightArrow, + LongRightArrow: LongRightArrow, + Longleftarrow: Longleftarrow, + Longleftrightarrow: Longleftrightarrow, + Longrightarrow: Longrightarrow, + Lopf: Lopf, + LowerLeftArrow: LowerLeftArrow, + LowerRightArrow: LowerRightArrow, + Lscr: Lscr, + Lsh: Lsh, + Lstrok: Lstrok, + Lt: Lt, + "Map": "⤅", + Mcy: Mcy, + MediumSpace: MediumSpace, + Mellintrf: Mellintrf, + Mfr: Mfr, + MinusPlus: MinusPlus, + Mopf: Mopf, + Mscr: Mscr, + Mu: Mu$1, + NJcy: NJcy, + Nacute: Nacute, + Ncaron: Ncaron, + Ncedil: Ncedil, + Ncy: Ncy, + NegativeMediumSpace: NegativeMediumSpace, + NegativeThickSpace: NegativeThickSpace, + NegativeThinSpace: NegativeThinSpace, + NegativeVeryThinSpace: NegativeVeryThinSpace, + NestedGreaterGreater: NestedGreaterGreater, + NestedLessLess: NestedLessLess, + NewLine: NewLine, + Nfr: Nfr, + NoBreak: NoBreak, + NonBreakingSpace: NonBreakingSpace, + Nopf: Nopf, + Not: Not, + NotCongruent: NotCongruent, + NotCupCap: NotCupCap, + NotDoubleVerticalBar: NotDoubleVerticalBar, + NotElement: NotElement, + NotEqual: NotEqual, + NotEqualTilde: NotEqualTilde, + NotExists: NotExists, + NotGreater: NotGreater, + NotGreaterEqual: NotGreaterEqual, + NotGreaterFullEqual: NotGreaterFullEqual, + NotGreaterGreater: NotGreaterGreater, + NotGreaterLess: NotGreaterLess, + NotGreaterSlantEqual: NotGreaterSlantEqual, + NotGreaterTilde: NotGreaterTilde, + NotHumpDownHump: NotHumpDownHump, + NotHumpEqual: NotHumpEqual, + NotLeftTriangle: NotLeftTriangle, + NotLeftTriangleBar: NotLeftTriangleBar, + NotLeftTriangleEqual: NotLeftTriangleEqual, + NotLess: NotLess, + NotLessEqual: NotLessEqual, + NotLessGreater: NotLessGreater, + NotLessLess: NotLessLess, + NotLessSlantEqual: NotLessSlantEqual, + NotLessTilde: NotLessTilde, + NotNestedGreaterGreater: NotNestedGreaterGreater, + NotNestedLessLess: NotNestedLessLess, + NotPrecedes: NotPrecedes, + NotPrecedesEqual: NotPrecedesEqual, + NotPrecedesSlantEqual: NotPrecedesSlantEqual, + NotReverseElement: NotReverseElement, + NotRightTriangle: NotRightTriangle, + NotRightTriangleBar: NotRightTriangleBar, + NotRightTriangleEqual: NotRightTriangleEqual, + NotSquareSubset: NotSquareSubset, + NotSquareSubsetEqual: NotSquareSubsetEqual, + NotSquareSuperset: NotSquareSuperset, + NotSquareSupersetEqual: NotSquareSupersetEqual, + NotSubset: NotSubset, + NotSubsetEqual: NotSubsetEqual, + NotSucceeds: NotSucceeds, + NotSucceedsEqual: NotSucceedsEqual, + NotSucceedsSlantEqual: NotSucceedsSlantEqual, + NotSucceedsTilde: NotSucceedsTilde, + NotSuperset: NotSuperset, + NotSupersetEqual: NotSupersetEqual, + NotTilde: NotTilde, + NotTildeEqual: NotTildeEqual, + NotTildeFullEqual: NotTildeFullEqual, + NotTildeTilde: NotTildeTilde, + NotVerticalBar: NotVerticalBar, + Nscr: Nscr, + Ntild: Ntild, + Ntilde: Ntilde$1, + Nu: Nu$1, + OElig: OElig$1, + Oacut: Oacut, + Oacute: Oacute$1, + Ocir: Ocir, + Ocirc: Ocirc$1, + Ocy: Ocy, + Odblac: Odblac, + Ofr: Ofr, + Ograv: Ograv, + Ograve: Ograve$1, + Omacr: Omacr, + Omega: Omega$1, + Omicron: Omicron$1, + Oopf: Oopf, + OpenCurlyDoubleQuote: OpenCurlyDoubleQuote, + OpenCurlyQuote: OpenCurlyQuote, + Or: Or, + Oscr: Oscr, + Oslas: Oslas, + Oslash: Oslash$1, + Otild: Otild, + Otilde: Otilde$1, + Otimes: Otimes, + Oum: Oum, + Ouml: Ouml$1, + OverBar: OverBar, + OverBrace: OverBrace, + OverBracket: OverBracket, + OverParenthesis: OverParenthesis, + PartialD: PartialD, + Pcy: Pcy, + Pfr: Pfr, + Phi: Phi$1, + Pi: Pi$1, + PlusMinus: PlusMinus, + Poincareplane: Poincareplane, + Popf: Popf, + Pr: Pr, + Precedes: Precedes, + PrecedesEqual: PrecedesEqual, + PrecedesSlantEqual: PrecedesSlantEqual, + PrecedesTilde: PrecedesTilde, + Prime: Prime$1, + Product: Product, + Proportion: Proportion, + Proportional: Proportional, + Pscr: Pscr, + Psi: Psi$1, + QUO: QUO, + QUOT: QUOT, + Qfr: Qfr, + Qopf: Qopf, + Qscr: Qscr, + RBarr: RBarr, + RE: RE, + REG: REG, + Racute: Racute, + Rang: Rang, + Rarr: Rarr, + Rarrtl: Rarrtl, + Rcaron: Rcaron, + Rcedil: Rcedil, + Rcy: Rcy, + Re: Re, + ReverseElement: ReverseElement, + ReverseEquilibrium: ReverseEquilibrium, + ReverseUpEquilibrium: ReverseUpEquilibrium, + Rfr: Rfr, + Rho: Rho$1, + RightAngleBracket: RightAngleBracket, + RightArrow: RightArrow, + RightArrowBar: RightArrowBar, + RightArrowLeftArrow: RightArrowLeftArrow, + RightCeiling: RightCeiling, + RightDoubleBracket: RightDoubleBracket, + RightDownTeeVector: RightDownTeeVector, + RightDownVector: RightDownVector, + RightDownVectorBar: RightDownVectorBar, + RightFloor: RightFloor, + RightTee: RightTee, + RightTeeArrow: RightTeeArrow, + RightTeeVector: RightTeeVector, + RightTriangle: RightTriangle, + RightTriangleBar: RightTriangleBar, + RightTriangleEqual: RightTriangleEqual, + RightUpDownVector: RightUpDownVector, + RightUpTeeVector: RightUpTeeVector, + RightUpVector: RightUpVector, + RightUpVectorBar: RightUpVectorBar, + RightVector: RightVector, + RightVectorBar: RightVectorBar, + Rightarrow: Rightarrow, + Ropf: Ropf, + RoundImplies: RoundImplies, + Rrightarrow: Rrightarrow, + Rscr: Rscr, + Rsh: Rsh, + RuleDelayed: RuleDelayed, + SHCHcy: SHCHcy, + SHcy: SHcy, + SOFTcy: SOFTcy, + Sacute: Sacute, + Sc: Sc, + Scaron: Scaron$1, + Scedil: Scedil, + Scirc: Scirc, + Scy: Scy, + Sfr: Sfr, + ShortDownArrow: ShortDownArrow, + ShortLeftArrow: ShortLeftArrow, + ShortRightArrow: ShortRightArrow, + ShortUpArrow: ShortUpArrow, + Sigma: Sigma$1, + SmallCircle: SmallCircle, + Sopf: Sopf, + Sqrt: Sqrt, + Square: Square, + SquareIntersection: SquareIntersection, + SquareSubset: SquareSubset, + SquareSubsetEqual: SquareSubsetEqual, + SquareSuperset: SquareSuperset, + SquareSupersetEqual: SquareSupersetEqual, + SquareUnion: SquareUnion, + Sscr: Sscr, + Star: Star, + Sub: Sub, + Subset: Subset, + SubsetEqual: SubsetEqual, + Succeeds: Succeeds, + SucceedsEqual: SucceedsEqual, + SucceedsSlantEqual: SucceedsSlantEqual, + SucceedsTilde: SucceedsTilde, + SuchThat: SuchThat, + Sum: Sum, + Sup: Sup, + Superset: Superset, + SupersetEqual: SupersetEqual, + Supset: Supset, + THOR: THOR, + THORN: THORN$1, + TRADE: TRADE, + TSHcy: TSHcy, + TScy: TScy, + Tab: Tab, + Tau: Tau$1, + Tcaron: Tcaron, + Tcedil: Tcedil, + Tcy: Tcy, + Tfr: Tfr, + Therefore: Therefore, + Theta: Theta$1, + ThickSpace: ThickSpace, + ThinSpace: ThinSpace, + Tilde: Tilde, + TildeEqual: TildeEqual, + TildeFullEqual: TildeFullEqual, + TildeTilde: TildeTilde, + Topf: Topf, + TripleDot: TripleDot, + Tscr: Tscr, + Tstrok: Tstrok, + Uacut: Uacut, + Uacute: Uacute$1, + Uarr: Uarr, + Uarrocir: Uarrocir, + Ubrcy: Ubrcy, + Ubreve: Ubreve, + Ucir: Ucir, + Ucirc: Ucirc$1, + Ucy: Ucy, + Udblac: Udblac, + Ufr: Ufr, + Ugrav: Ugrav, + Ugrave: Ugrave$1, + Umacr: Umacr, + UnderBar: UnderBar, + UnderBrace: UnderBrace, + UnderBracket: UnderBracket, + UnderParenthesis: UnderParenthesis, + Union: Union, + UnionPlus: UnionPlus, + Uogon: Uogon, + Uopf: Uopf, + UpArrow: UpArrow, + UpArrowBar: UpArrowBar, + UpArrowDownArrow: UpArrowDownArrow, + UpDownArrow: UpDownArrow, + UpEquilibrium: UpEquilibrium, + UpTee: UpTee, + UpTeeArrow: UpTeeArrow, + Uparrow: Uparrow, + Updownarrow: Updownarrow, + UpperLeftArrow: UpperLeftArrow, + UpperRightArrow: UpperRightArrow, + Upsi: Upsi, + Upsilon: Upsilon$1, + Uring: Uring, + Uscr: Uscr, + Utilde: Utilde, + Uum: Uum, + Uuml: Uuml$1, + VDash: VDash, + Vbar: Vbar, + Vcy: Vcy, + Vdash: Vdash, + Vdashl: Vdashl, + Vee: Vee, + Verbar: Verbar, + Vert: Vert, + VerticalBar: VerticalBar, + VerticalLine: VerticalLine, + VerticalSeparator: VerticalSeparator, + VerticalTilde: VerticalTilde, + VeryThinSpace: VeryThinSpace, + Vfr: Vfr, + Vopf: Vopf, + Vscr: Vscr, + Vvdash: Vvdash, + Wcirc: Wcirc, + Wedge: Wedge, + Wfr: Wfr, + Wopf: Wopf, + Wscr: Wscr, + Xfr: Xfr, + Xi: Xi$1, + Xopf: Xopf, + Xscr: Xscr, + YAcy: YAcy, + YIcy: YIcy, + YUcy: YUcy, + Yacut: Yacut, + Yacute: Yacute$1, + Ycirc: Ycirc, + Ycy: Ycy, + Yfr: Yfr, + Yopf: Yopf, + Yscr: Yscr, + Yuml: Yuml$1, + ZHcy: ZHcy, + Zacute: Zacute, + Zcaron: Zcaron, + Zcy: Zcy, + Zdot: Zdot, + ZeroWidthSpace: ZeroWidthSpace, + Zeta: Zeta$1, + Zfr: Zfr, + Zopf: Zopf, + Zscr: Zscr, + aacut: aacut, + aacute: aacute$1, + abreve: abreve, + ac: ac, + acE: acE, + acd: acd, + acir: acir, + acirc: acirc$1, + acut: acut, + acute: acute$1, + acy: acy, + aeli: aeli, + aelig: aelig$1, + af: af, + afr: afr, + agrav: agrav, + agrave: agrave$1, + alefsym: alefsym$1, + aleph: aleph, + alpha: alpha$1, + amacr: amacr, + amalg: amalg, + am: am, + amp: amp$1, + and: and$1, + andand: andand, + andd: andd, + andslope: andslope, + andv: andv, + ang: ang$1, + ange: ange, + angle: angle, + angmsd: angmsd, + angmsdaa: angmsdaa, + angmsdab: angmsdab, + angmsdac: angmsdac, + angmsdad: angmsdad, + angmsdae: angmsdae, + angmsdaf: angmsdaf, + angmsdag: angmsdag, + angmsdah: angmsdah, + angrt: angrt, + angrtvb: angrtvb, + angrtvbd: angrtvbd, + angsph: angsph, + angst: angst, + angzarr: angzarr, + aogon: aogon, + aopf: aopf, + ap: ap, + apE: apE, + apacir: apacir, + ape: ape, + apid: apid, + apos: apos, + approx: approx, + approxeq: approxeq, + arin: arin, + aring: aring$1, + ascr: ascr, + ast: ast, + asymp: asymp$1, + asympeq: asympeq, + atild: atild, + atilde: atilde$1, + aum: aum, + auml: auml$1, + awconint: awconint, + awint: awint, + bNot: bNot, + backcong: backcong, + backepsilon: backepsilon, + backprime: backprime, + backsim: backsim, + backsimeq: backsimeq, + barvee: barvee, + barwed: barwed, + barwedge: barwedge, + bbrk: bbrk, + bbrktbrk: bbrktbrk, + bcong: bcong, + bcy: bcy, + bdquo: bdquo$1, + becaus: becaus, + because: because, + bemptyv: bemptyv, + bepsi: bepsi, + bernou: bernou, + beta: beta$1, + beth: beth, + between: between, + bfr: bfr, + bigcap: bigcap, + bigcirc: bigcirc, + bigcup: bigcup, + bigodot: bigodot, + bigoplus: bigoplus, + bigotimes: bigotimes, + bigsqcup: bigsqcup, + bigstar: bigstar, + bigtriangledown: bigtriangledown, + bigtriangleup: bigtriangleup, + biguplus: biguplus, + bigvee: bigvee, + bigwedge: bigwedge, + bkarow: bkarow, + blacklozenge: blacklozenge, + blacksquare: blacksquare, + blacktriangle: blacktriangle, + blacktriangledown: blacktriangledown, + blacktriangleleft: blacktriangleleft, + blacktriangleright: blacktriangleright, + blank: blank, + blk12: blk12, + blk14: blk14, + blk34: blk34, + block: block, + bne: bne, + bnequiv: bnequiv, + bnot: bnot, + bopf: bopf, + bot: bot, + bottom: bottom, + bowtie: bowtie, + boxDL: boxDL, + boxDR: boxDR, + boxDl: boxDl, + boxDr: boxDr, + boxH: boxH, + boxHD: boxHD, + boxHU: boxHU, + boxHd: boxHd, + boxHu: boxHu, + boxUL: boxUL, + boxUR: boxUR, + boxUl: boxUl, + boxUr: boxUr, + boxV: boxV, + boxVH: boxVH, + boxVL: boxVL, + boxVR: boxVR, + boxVh: boxVh, + boxVl: boxVl, + boxVr: boxVr, + boxbox: boxbox, + boxdL: boxdL, + boxdR: boxdR, + boxdl: boxdl, + boxdr: boxdr, + boxh: boxh, + boxhD: boxhD, + boxhU: boxhU, + boxhd: boxhd, + boxhu: boxhu, + boxminus: boxminus, + boxplus: boxplus, + boxtimes: boxtimes, + boxuL: boxuL, + boxuR: boxuR, + boxul: boxul, + boxur: boxur, + boxv: boxv, + boxvH: boxvH, + boxvL: boxvL, + boxvR: boxvR, + boxvh: boxvh, + boxvl: boxvl, + boxvr: boxvr, + bprime: bprime, + breve: breve, + brvba: brvba, + brvbar: brvbar$1, + bscr: bscr, + bsemi: bsemi, + bsim: bsim, + bsime: bsime, + bsol: bsol, + bsolb: bsolb, + bsolhsub: bsolhsub, + bull: bull$1, + bullet: bullet, + bump: bump, + bumpE: bumpE, + bumpe: bumpe, + bumpeq: bumpeq, + cacute: cacute, + cap: cap$2, + capand: capand, + capbrcup: capbrcup, + capcap: capcap, + capcup: capcup, + capdot: capdot, + caps: caps, + caret: caret, + caron: caron, + ccaps: ccaps, + ccaron: ccaron, + ccedi: ccedi, + ccedil: ccedil$1, + ccirc: ccirc, + ccups: ccups, + ccupssm: ccupssm, + cdot: cdot, + cedi: cedi, + cedil: cedil$1, + cemptyv: cemptyv, + cen: cen, + cent: cent$1, + centerdot: centerdot, + cfr: cfr, + chcy: chcy, + check: check, + checkmark: checkmark, + chi: chi$1, + cir: cir, + cirE: cirE, + circ: circ$1, + circeq: circeq, + circlearrowleft: circlearrowleft, + circlearrowright: circlearrowright, + circledR: circledR, + circledS: circledS, + circledast: circledast, + circledcirc: circledcirc, + circleddash: circleddash, + cire: cire, + cirfnint: cirfnint, + cirmid: cirmid, + cirscir: cirscir, + clubs: clubs$1, + clubsuit: clubsuit, + colon: colon, + colone: colone, + coloneq: coloneq, + comma: comma$1, + commat: commat, + comp: comp, + compfn: compfn, + complement: complement, + complexes: complexes, + cong: cong$1, + congdot: congdot, + conint: conint, + copf: copf, + coprod: coprod, + cop: cop, + copy: copy$1, + copysr: copysr, + crarr: crarr$1, + cross: cross, + cscr: cscr, + csub: csub, + csube: csube, + csup: csup, + csupe: csupe, + ctdot: ctdot, + cudarrl: cudarrl, + cudarrr: cudarrr, + cuepr: cuepr, + cuesc: cuesc, + cularr: cularr, + cularrp: cularrp, + cup: cup$1, + cupbrcap: cupbrcap, + cupcap: cupcap, + cupcup: cupcup, + cupdot: cupdot, + cupor: cupor, + cups: cups, + curarr: curarr, + curarrm: curarrm, + curlyeqprec: curlyeqprec, + curlyeqsucc: curlyeqsucc, + curlyvee: curlyvee, + curlywedge: curlywedge, + curre: curre, + curren: curren$1, + curvearrowleft: curvearrowleft, + curvearrowright: curvearrowright, + cuvee: cuvee, + cuwed: cuwed, + cwconint: cwconint, + cwint: cwint, + cylcty: cylcty, + dArr: dArr$1, + dHar: dHar, + dagger: dagger$1, + daleth: daleth, + darr: darr$1, + dash: dash$1, + dashv: dashv, + dbkarow: dbkarow, + dblac: dblac, + dcaron: dcaron, + dcy: dcy, + dd: dd$1, + ddagger: ddagger, + ddarr: ddarr, + ddotseq: ddotseq, + de: de, + deg: deg$1, + delta: delta$1, + demptyv: demptyv, + dfisht: dfisht, + dfr: dfr, + dharl: dharl, + dharr: dharr, + diam: diam, + diamond: diamond, + diamondsuit: diamondsuit, + diams: diams$1, + die: die, + digamma: digamma, + disin: disin, + div: div, + divid: divid, + divide: divide$1, + divideontimes: divideontimes, + divonx: divonx, + djcy: djcy, + dlcorn: dlcorn, + dlcrop: dlcrop, + dollar: dollar, + dopf: dopf, + dot: dot, + doteq: doteq, + doteqdot: doteqdot, + dotminus: dotminus, + dotplus: dotplus, + dotsquare: dotsquare, + doublebarwedge: doublebarwedge, + downarrow: downarrow, + downdownarrows: downdownarrows, + downharpoonleft: downharpoonleft, + downharpoonright: downharpoonright, + drbkarow: drbkarow, + drcorn: drcorn, + drcrop: drcrop, + dscr: dscr, + dscy: dscy, + dsol: dsol, + dstrok: dstrok, + dtdot: dtdot, + dtri: dtri, + dtrif: dtrif, + duarr: duarr, + duhar: duhar, + dwangle: dwangle, + dzcy: dzcy, + dzigrarr: dzigrarr, + eDDot: eDDot, + eDot: eDot, + eacut: eacut, + eacute: eacute$1, + easter: easter, + ecaron: ecaron, + ecir: ecir, + ecirc: ecirc$1, + ecolon: ecolon, + ecy: ecy, + edot: edot, + ee: ee, + efDot: efDot, + efr: efr, + eg: eg, + egrav: egrav, + egrave: egrave$1, + egs: egs, + egsdot: egsdot, + el: el, + elinters: elinters, + ell: ell, + els: els, + elsdot: elsdot, + emacr: emacr, + empty: empty$3, + emptyset: emptyset, + emptyv: emptyv, + emsp13: emsp13, + emsp14: emsp14, + emsp: emsp$1, + eng: eng, + ensp: ensp$1, + eogon: eogon, + eopf: eopf, + epar: epar, + eparsl: eparsl, + eplus: eplus, + epsi: epsi, + epsilon: epsilon$1, + epsiv: epsiv, + eqcirc: eqcirc, + eqcolon: eqcolon, + eqsim: eqsim, + eqslantgtr: eqslantgtr, + eqslantless: eqslantless, + equals: equals, + equest: equest, + equiv: equiv$1, + equivDD: equivDD, + eqvparsl: eqvparsl, + erDot: erDot, + erarr: erarr, + escr: escr, + esdot: esdot, + esim: esim, + eta: eta$1, + et: et, + eth: eth$1, + eum: eum, + euml: euml$1, + euro: euro$1, + excl: excl, + exist: exist$1, + expectation: expectation, + exponentiale: exponentiale, + fallingdotseq: fallingdotseq, + fcy: fcy, + female: female, + ffilig: ffilig, + fflig: fflig, + ffllig: ffllig, + ffr: ffr, + filig: filig, + fjlig: fjlig, + flat: flat, + fllig: fllig, + fltns: fltns, + fnof: fnof$1, + fopf: fopf, + forall: forall$1, + fork: fork, + forkv: forkv, + fpartint: fpartint, + frac1: frac1, + frac12: frac12$1, + frac13: frac13, + frac14: frac14$1, + frac15: frac15, + frac16: frac16, + frac18: frac18, + frac23: frac23, + frac25: frac25, + frac3: frac3, + frac34: frac34$1, + frac35: frac35, + frac38: frac38, + frac45: frac45, + frac56: frac56, + frac58: frac58, + frac78: frac78, + frasl: frasl$1, + frown: frown, + fscr: fscr, + gE: gE, + gEl: gEl, + gacute: gacute, + gamma: gamma$1, + gammad: gammad, + gap: gap, + gbreve: gbreve, + gcirc: gcirc, + gcy: gcy, + gdot: gdot, + ge: ge$1, + gel: gel, + geq: geq, + geqq: geqq, + geqslant: geqslant, + ges: ges, + gescc: gescc, + gesdot: gesdot, + gesdoto: gesdoto, + gesdotol: gesdotol, + gesl: gesl, + gesles: gesles, + gfr: gfr, + gg: gg, + ggg: ggg, + gimel: gimel, + gjcy: gjcy, + gl: gl, + glE: glE, + gla: gla, + glj: glj, + gnE: gnE, + gnap: gnap, + gnapprox: gnapprox, + gne: gne, + gneq: gneq, + gneqq: gneqq, + gnsim: gnsim, + gopf: gopf, + grave: grave, + gscr: gscr, + gsim: gsim, + gsime: gsime, + gsiml: gsiml, + g: g, + gt: gt$1, + gtcc: gtcc, + gtcir: gtcir, + gtdot: gtdot, + gtlPar: gtlPar, + gtquest: gtquest, + gtrapprox: gtrapprox, + gtrarr: gtrarr, + gtrdot: gtrdot, + gtreqless: gtreqless, + gtreqqless: gtreqqless, + gtrless: gtrless, + gtrsim: gtrsim, + gvertneqq: gvertneqq, + gvnE: gvnE, + hArr: hArr$1, + hairsp: hairsp, + half: half, + hamilt: hamilt, + hardcy: hardcy, + harr: harr$1, + harrcir: harrcir, + harrw: harrw, + hbar: hbar, + hcirc: hcirc, + hearts: hearts$1, + heartsuit: heartsuit, + hellip: hellip$1, + hercon: hercon, + hfr: hfr, + hksearow: hksearow, + hkswarow: hkswarow, + hoarr: hoarr, + homtht: homtht, + hookleftarrow: hookleftarrow, + hookrightarrow: hookrightarrow, + hopf: hopf, + horbar: horbar, + hscr: hscr, + hslash: hslash, + hstrok: hstrok, + hybull: hybull, + hyphen: hyphen, + iacut: iacut, + iacute: iacute$1, + ic: ic, + icir: icir, + icirc: icirc$1, + icy: icy, + iecy: iecy, + iexc: iexc, + iexcl: iexcl$1, + iff: iff, + ifr: ifr, + igrav: igrav, + igrave: igrave$1, + ii: ii, + iiiint: iiiint, + iiint: iiint, + iinfin: iinfin, + iiota: iiota, + ijlig: ijlig, + imacr: imacr, + image: image$2, + imagline: imagline, + imagpart: imagpart, + imath: imath, + imof: imof, + imped: imped, + "in": "∈", + incare: incare, + infin: infin$1, + infintie: infintie, + inodot: inodot, + int: int$2, + intcal: intcal, + integers: integers, + intercal: intercal, + intlarhk: intlarhk, + intprod: intprod, + iocy: iocy, + iogon: iogon, + iopf: iopf, + iota: iota$1, + iprod: iprod, + iques: iques, + iquest: iquest$1, + iscr: iscr, + isin: isin$1, + isinE: isinE, + isindot: isindot, + isins: isins, + isinsv: isinsv, + isinv: isinv, + it: it, + itilde: itilde, + iukcy: iukcy, + ium: ium, + iuml: iuml$1, + jcirc: jcirc, + jcy: jcy, + jfr: jfr, + jmath: jmath, + jopf: jopf, + jscr: jscr, + jsercy: jsercy, + jukcy: jukcy, + kappa: kappa$1, + kappav: kappav, + kcedil: kcedil, + kcy: kcy, + kfr: kfr, + kgreen: kgreen, + khcy: khcy, + kjcy: kjcy, + kopf: kopf, + kscr: kscr, + lAarr: lAarr, + lArr: lArr$1, + lAtail: lAtail, + lBarr: lBarr, + lE: lE, + lEg: lEg, + lHar: lHar, + lacute: lacute, + laemptyv: laemptyv, + lagran: lagran, + lambda: lambda$1, + lang: lang$1, + langd: langd, + langle: langle, + lap: lap, + laqu: laqu, + laquo: laquo$1, + larr: larr$1, + larrb: larrb, + larrbfs: larrbfs, + larrfs: larrfs, + larrhk: larrhk, + larrlp: larrlp, + larrpl: larrpl, + larrsim: larrsim, + larrtl: larrtl, + lat: lat, + latail: latail, + late: late, + lates: lates, + lbarr: lbarr, + lbbrk: lbbrk, + lbrace: lbrace, + lbrack: lbrack, + lbrke: lbrke, + lbrksld: lbrksld, + lbrkslu: lbrkslu, + lcaron: lcaron, + lcedil: lcedil, + lceil: lceil$1, + lcub: lcub, + lcy: lcy, + ldca: ldca, + ldquo: ldquo$1, + ldquor: ldquor, + ldrdhar: ldrdhar, + ldrushar: ldrushar, + ldsh: ldsh, + le: le$1, + leftarrow: leftarrow, + leftarrowtail: leftarrowtail, + leftharpoondown: leftharpoondown, + leftharpoonup: leftharpoonup, + leftleftarrows: leftleftarrows, + leftrightarrow: leftrightarrow, + leftrightarrows: leftrightarrows, + leftrightharpoons: leftrightharpoons, + leftrightsquigarrow: leftrightsquigarrow, + leftthreetimes: leftthreetimes, + leg: leg, + leq: leq, + leqq: leqq, + leqslant: leqslant, + les: les, + lescc: lescc, + lesdot: lesdot, + lesdoto: lesdoto, + lesdotor: lesdotor, + lesg: lesg, + lesges: lesges, + lessapprox: lessapprox, + lessdot: lessdot, + lesseqgtr: lesseqgtr, + lesseqqgtr: lesseqqgtr, + lessgtr: lessgtr, + lesssim: lesssim, + lfisht: lfisht, + lfloor: lfloor$1, + lfr: lfr, + lg: lg, + lgE: lgE, + lhard: lhard, + lharu: lharu, + lharul: lharul, + lhblk: lhblk, + ljcy: ljcy, + ll: ll, + llarr: llarr, + llcorner: llcorner, + llhard: llhard, + lltri: lltri, + lmidot: lmidot, + lmoust: lmoust, + lmoustache: lmoustache, + lnE: lnE, + lnap: lnap, + lnapprox: lnapprox, + lne: lne, + lneq: lneq, + lneqq: lneqq, + lnsim: lnsim, + loang: loang, + loarr: loarr, + lobrk: lobrk, + longleftarrow: longleftarrow, + longleftrightarrow: longleftrightarrow, + longmapsto: longmapsto, + longrightarrow: longrightarrow, + looparrowleft: looparrowleft, + looparrowright: looparrowright, + lopar: lopar, + lopf: lopf, + loplus: loplus, + lotimes: lotimes, + lowast: lowast$1, + lowbar: lowbar, + loz: loz$1, + lozenge: lozenge, + lozf: lozf, + lpar: lpar, + lparlt: lparlt, + lrarr: lrarr, + lrcorner: lrcorner, + lrhar: lrhar, + lrhard: lrhard, + lrm: lrm$1, + lrtri: lrtri, + lsaquo: lsaquo$1, + lscr: lscr, + lsh: lsh, + lsim: lsim, + lsime: lsime, + lsimg: lsimg, + lsqb: lsqb, + lsquo: lsquo$1, + lsquor: lsquor, + lstrok: lstrok, + l: l, + lt: lt$1, + ltcc: ltcc, + ltcir: ltcir, + ltdot: ltdot, + lthree: lthree, + ltimes: ltimes, + ltlarr: ltlarr, + ltquest: ltquest, + ltrPar: ltrPar, + ltri: ltri, + ltrie: ltrie, + ltrif: ltrif, + lurdshar: lurdshar, + luruhar: luruhar, + lvertneqq: lvertneqq, + lvnE: lvnE, + mDDot: mDDot, + mac: mac, + macr: macr$1, + male: male, + malt: malt, + maltese: maltese, + map: map$1, + mapsto: mapsto, + mapstodown: mapstodown, + mapstoleft: mapstoleft, + mapstoup: mapstoup, + marker: marker, + mcomma: mcomma, + mcy: mcy, + mdash: mdash$1, + measuredangle: measuredangle, + mfr: mfr, + mho: mho, + micr: micr, + micro: micro$1, + mid: mid, + midast: midast, + midcir: midcir, + middo: middo, + middot: middot$1, + minus: minus$1, + minusb: minusb, + minusd: minusd, + minusdu: minusdu, + mlcp: mlcp, + mldr: mldr, + mnplus: mnplus, + models: models, + mopf: mopf, + mp: mp, + mscr: mscr, + mstpos: mstpos, + mu: mu$1, + multimap: multimap, + mumap: mumap, + nGg: nGg, + nGt: nGt, + nGtv: nGtv, + nLeftarrow: nLeftarrow, + nLeftrightarrow: nLeftrightarrow, + nLl: nLl, + nLt: nLt, + nLtv: nLtv, + nRightarrow: nRightarrow, + nVDash: nVDash, + nVdash: nVdash, + nabla: nabla$1, + nacute: nacute, + nang: nang, + nap: nap, + napE: napE, + napid: napid, + napos: napos, + napprox: napprox, + natur: natur, + natural: natural, + naturals: naturals, + nbs: nbs, + nbsp: nbsp$1, + nbump: nbump, + nbumpe: nbumpe, + ncap: ncap, + ncaron: ncaron, + ncedil: ncedil, + ncong: ncong, + ncongdot: ncongdot, + ncup: ncup, + ncy: ncy, + ndash: ndash$1, + ne: ne$1, + neArr: neArr, + nearhk: nearhk, + nearr: nearr, + nearrow: nearrow, + nedot: nedot, + nequiv: nequiv, + nesear: nesear, + nesim: nesim, + nexist: nexist, + nexists: nexists, + nfr: nfr, + ngE: ngE, + nge: nge, + ngeq: ngeq, + ngeqq: ngeqq, + ngeqslant: ngeqslant, + nges: nges, + ngsim: ngsim, + ngt: ngt, + ngtr: ngtr, + nhArr: nhArr, + nharr: nharr, + nhpar: nhpar, + ni: ni$1, + nis: nis, + nisd: nisd, + niv: niv, + njcy: njcy, + nlArr: nlArr, + nlE: nlE, + nlarr: nlarr, + nldr: nldr, + nle: nle, + nleftarrow: nleftarrow, + nleftrightarrow: nleftrightarrow, + nleq: nleq, + nleqq: nleqq, + nleqslant: nleqslant, + nles: nles, + nless: nless, + nlsim: nlsim, + nlt: nlt, + nltri: nltri, + nltrie: nltrie, + nmid: nmid, + nopf: nopf, + no: no, + not: not$1, + notin: notin$1, + notinE: notinE, + notindot: notindot, + notinva: notinva, + notinvb: notinvb, + notinvc: notinvc, + notni: notni, + notniva: notniva, + notnivb: notnivb, + notnivc: notnivc, + npar: npar, + nparallel: nparallel, + nparsl: nparsl, + npart: npart, + npolint: npolint, + npr: npr, + nprcue: nprcue, + npre: npre, + nprec: nprec, + npreceq: npreceq, + nrArr: nrArr, + nrarr: nrarr, + nrarrc: nrarrc, + nrarrw: nrarrw, + nrightarrow: nrightarrow, + nrtri: nrtri, + nrtrie: nrtrie, + nsc: nsc, + nsccue: nsccue, + nsce: nsce, + nscr: nscr, + nshortmid: nshortmid, + nshortparallel: nshortparallel, + nsim: nsim, + nsime: nsime, + nsimeq: nsimeq, + nsmid: nsmid, + nspar: nspar, + nsqsube: nsqsube, + nsqsupe: nsqsupe, + nsub: nsub$1, + nsubE: nsubE, + nsube: nsube, + nsubset: nsubset, + nsubseteq: nsubseteq, + nsubseteqq: nsubseteqq, + nsucc: nsucc, + nsucceq: nsucceq, + nsup: nsup, + nsupE: nsupE, + nsupe: nsupe, + nsupset: nsupset, + nsupseteq: nsupseteq, + nsupseteqq: nsupseteqq, + ntgl: ntgl, + ntild: ntild, + ntilde: ntilde$1, + ntlg: ntlg, + ntriangleleft: ntriangleleft, + ntrianglelefteq: ntrianglelefteq, + ntriangleright: ntriangleright, + ntrianglerighteq: ntrianglerighteq, + nu: nu$1, + num: num, + numero: numero, + numsp: numsp, + nvDash: nvDash, + nvHarr: nvHarr, + nvap: nvap, + nvdash: nvdash, + nvge: nvge, + nvgt: nvgt, + nvinfin: nvinfin, + nvlArr: nvlArr, + nvle: nvle, + nvlt: nvlt, + nvltrie: nvltrie, + nvrArr: nvrArr, + nvrtrie: nvrtrie, + nvsim: nvsim, + nwArr: nwArr, + nwarhk: nwarhk, + nwarr: nwarr, + nwarrow: nwarrow, + nwnear: nwnear, + oS: oS, + oacut: oacut, + oacute: oacute$1, + oast: oast, + ocir: ocir, + ocirc: ocirc$1, + ocy: ocy, + odash: odash, + odblac: odblac, + odiv: odiv, + odot: odot, + odsold: odsold, + oelig: oelig$1, + ofcir: ofcir, + ofr: ofr, + ogon: ogon, + ograv: ograv, + ograve: ograve$1, + ogt: ogt, + ohbar: ohbar, + ohm: ohm, + oint: oint, + olarr: olarr, + olcir: olcir, + olcross: olcross, + oline: oline$1, + olt: olt, + omacr: omacr, + omega: omega$1, + omicron: omicron$1, + omid: omid, + ominus: ominus, + oopf: oopf, + opar: opar, + operp: operp, + oplus: oplus$1, + or: or$1, + orarr: orarr, + ord: ord, + order: order, + orderof: orderof, + ordf: ordf$1, + ordm: ordm$1, + origof: origof, + oror: oror, + orslope: orslope, + orv: orv, + oscr: oscr, + oslas: oslas, + oslash: oslash$1, + osol: osol, + otild: otild, + otilde: otilde$1, + otimes: otimes$1, + otimesas: otimesas, + oum: oum, + ouml: ouml$1, + ovbar: ovbar, + par: par, + para: para$1, + parallel: parallel, + parsim: parsim, + parsl: parsl, + part: part$1, + pcy: pcy, + percnt: percnt, + period: period, + permil: permil$1, + perp: perp$1, + pertenk: pertenk, + pfr: pfr, + phi: phi$1, + phiv: phiv, + phmmat: phmmat, + phone: phone, + pi: pi$1, + pitchfork: pitchfork, + piv: piv$1, + planck: planck, + planckh: planckh, + plankv: plankv, + plus: plus, + plusacir: plusacir, + plusb: plusb, + pluscir: pluscir, + plusdo: plusdo, + plusdu: plusdu, + pluse: pluse, + plusm: plusm, + plusmn: plusmn$1, + plussim: plussim, + plustwo: plustwo, + pm: pm, + pointint: pointint, + popf: popf, + poun: poun, + pound: pound$1, + pr: pr, + prE: prE, + prap: prap, + prcue: prcue, + pre: pre, + prec: prec, + precapprox: precapprox, + preccurlyeq: preccurlyeq, + preceq: preceq, + precnapprox: precnapprox, + precneqq: precneqq, + precnsim: precnsim, + precsim: precsim, + prime: prime$1, + primes: primes, + prnE: prnE, + prnap: prnap, + prnsim: prnsim, + prod: prod$1, + profalar: profalar, + profline: profline, + profsurf: profsurf, + prop: prop$1, + propto: propto, + prsim: prsim, + prurel: prurel, + pscr: pscr, + psi: psi$1, + puncsp: puncsp, + qfr: qfr, + qint: qint, + qopf: qopf, + qprime: qprime, + qscr: qscr, + quaternions: quaternions, + quatint: quatint, + quest: quest, + questeq: questeq, + quo: quo, + quot: quot$1, + rAarr: rAarr, + rArr: rArr$1, + rAtail: rAtail, + rBarr: rBarr, + rHar: rHar, + race: race, + racute: racute, + radic: radic$1, + raemptyv: raemptyv, + rang: rang$1, + rangd: rangd, + range: range, + rangle: rangle, + raqu: raqu, + raquo: raquo$1, + rarr: rarr$1, + rarrap: rarrap, + rarrb: rarrb, + rarrbfs: rarrbfs, + rarrc: rarrc, + rarrfs: rarrfs, + rarrhk: rarrhk, + rarrlp: rarrlp, + rarrpl: rarrpl, + rarrsim: rarrsim, + rarrtl: rarrtl, + rarrw: rarrw, + ratail: ratail, + ratio: ratio, + rationals: rationals, + rbarr: rbarr, + rbbrk: rbbrk, + rbrace: rbrace, + rbrack: rbrack, + rbrke: rbrke, + rbrksld: rbrksld, + rbrkslu: rbrkslu, + rcaron: rcaron, + rcedil: rcedil, + rceil: rceil$1, + rcub: rcub, + rcy: rcy, + rdca: rdca, + rdldhar: rdldhar, + rdquo: rdquo$1, + rdquor: rdquor, + rdsh: rdsh, + real: real$1, + realine: realine, + realpart: realpart, + reals: reals, + rect: rect, + re: re$1, + reg: reg$1, + rfisht: rfisht, + rfloor: rfloor$1, + rfr: rfr, + rhard: rhard, + rharu: rharu, + rharul: rharul, + rho: rho$1, + rhov: rhov, + rightarrow: rightarrow, + rightarrowtail: rightarrowtail, + rightharpoondown: rightharpoondown, + rightharpoonup: rightharpoonup, + rightleftarrows: rightleftarrows, + rightleftharpoons: rightleftharpoons, + rightrightarrows: rightrightarrows, + rightsquigarrow: rightsquigarrow, + rightthreetimes: rightthreetimes, + ring: ring, + risingdotseq: risingdotseq, + rlarr: rlarr, + rlhar: rlhar, + rlm: rlm$1, + rmoust: rmoust, + rmoustache: rmoustache, + rnmid: rnmid, + roang: roang, + roarr: roarr, + robrk: robrk, + ropar: ropar, + ropf: ropf, + roplus: roplus, + rotimes: rotimes, + rpar: rpar, + rpargt: rpargt, + rppolint: rppolint, + rrarr: rrarr, + rsaquo: rsaquo$1, + rscr: rscr, + rsh: rsh, + rsqb: rsqb, + rsquo: rsquo$1, + rsquor: rsquor, + rthree: rthree, + rtimes: rtimes, + rtri: rtri, + rtrie: rtrie, + rtrif: rtrif, + rtriltri: rtriltri, + ruluhar: ruluhar, + rx: rx, + sacute: sacute, + sbquo: sbquo$1, + sc: sc, + scE: scE, + scap: scap, + scaron: scaron$1, + sccue: sccue, + sce: sce, + scedil: scedil, + scirc: scirc, + scnE: scnE, + scnap: scnap, + scnsim: scnsim, + scpolint: scpolint, + scsim: scsim, + scy: scy, + sdot: sdot$1, + sdotb: sdotb, + sdote: sdote, + seArr: seArr, + searhk: searhk, + searr: searr, + searrow: searrow, + sec: sec, + sect: sect$1, + semi: semi, + seswar: seswar, + setminus: setminus, + setmn: setmn, + sext: sext, + sfr: sfr, + sfrown: sfrown, + sharp: sharp, + shchcy: shchcy, + shcy: shcy, + shortmid: shortmid, + shortparallel: shortparallel, + sh: sh, + shy: shy$1, + sigma: sigma$1, + sigmaf: sigmaf$1, + sigmav: sigmav, + sim: sim$1, + simdot: simdot, + sime: sime, + simeq: simeq, + simg: simg, + simgE: simgE, + siml: siml, + simlE: simlE, + simne: simne, + simplus: simplus, + simrarr: simrarr, + slarr: slarr, + smallsetminus: smallsetminus, + smashp: smashp, + smeparsl: smeparsl, + smid: smid, + smile: smile, + smt: smt, + smte: smte, + smtes: smtes, + softcy: softcy, + sol: sol, + solb: solb, + solbar: solbar, + sopf: sopf, + spades: spades$1, + spadesuit: spadesuit, + spar: spar, + sqcap: sqcap, + sqcaps: sqcaps, + sqcup: sqcup, + sqcups: sqcups, + sqsub: sqsub, + sqsube: sqsube, + sqsubset: sqsubset, + sqsubseteq: sqsubseteq, + sqsup: sqsup, + sqsupe: sqsupe, + sqsupset: sqsupset, + sqsupseteq: sqsupseteq, + squ: squ, + square: square, + squarf: squarf, + squf: squf, + srarr: srarr, + sscr: sscr, + ssetmn: ssetmn, + ssmile: ssmile, + sstarf: sstarf, + star: star, + starf: starf, + straightepsilon: straightepsilon, + straightphi: straightphi, + strns: strns, + sub: sub$1, + subE: subE, + subdot: subdot, + sube: sube$1, + subedot: subedot, + submult: submult, + subnE: subnE, + subne: subne, + subplus: subplus, + subrarr: subrarr, + subset: subset, + subseteq: subseteq, + subseteqq: subseteqq, + subsetneq: subsetneq, + subsetneqq: subsetneqq, + subsim: subsim, + subsub: subsub, + subsup: subsup, + succ: succ, + succapprox: succapprox, + succcurlyeq: succcurlyeq, + succeq: succeq, + succnapprox: succnapprox, + succneqq: succneqq, + succnsim: succnsim, + succsim: succsim, + sum: sum$1, + sung: sung, + sup: sup$1, + sup1: sup1$1, + sup2: sup2$1, + sup3: sup3$1, + supE: supE, + supdot: supdot, + supdsub: supdsub, + supe: supe$1, + supedot: supedot, + suphsol: suphsol, + suphsub: suphsub, + suplarr: suplarr, + supmult: supmult, + supnE: supnE, + supne: supne, + supplus: supplus, + supset: supset, + supseteq: supseteq, + supseteqq: supseteqq, + supsetneq: supsetneq, + supsetneqq: supsetneqq, + supsim: supsim, + supsub: supsub, + supsup: supsup, + swArr: swArr, + swarhk: swarhk, + swarr: swarr, + swarrow: swarrow, + swnwar: swnwar, + szli: szli, + szlig: szlig$1, + target: target, + tau: tau$1, + tbrk: tbrk, + tcaron: tcaron, + tcedil: tcedil, + tcy: tcy, + tdot: tdot, + telrec: telrec, + tfr: tfr, + there4: there4$1, + therefore: therefore, + theta: theta$1, + thetasym: thetasym$1, + thetav: thetav, + thickapprox: thickapprox, + thicksim: thicksim, + thinsp: thinsp$1, + thkap: thkap, + thksim: thksim, + thor: thor, + thorn: thorn$1, + tilde: tilde$1, + time: time, + times: times$1, + timesb: timesb, + timesbar: timesbar, + timesd: timesd, + tint: tint, + toea: toea, + top: top, + topbot: topbot, + topcir: topcir, + topf: topf, + topfork: topfork, + tosa: tosa, + tprime: tprime, + trade: trade$1, + triangle: triangle, + triangledown: triangledown, + triangleleft: triangleleft, + trianglelefteq: trianglelefteq, + triangleq: triangleq, + triangleright: triangleright, + trianglerighteq: trianglerighteq, + tridot: tridot, + trie: trie, + triminus: triminus, + triplus: triplus, + trisb: trisb, + tritime: tritime, + trpezium: trpezium, + tscr: tscr, + tscy: tscy, + tshcy: tshcy, + tstrok: tstrok, + twixt: twixt, + twoheadleftarrow: twoheadleftarrow, + twoheadrightarrow: twoheadrightarrow, + uArr: uArr$1, + uHar: uHar, + uacut: uacut, + uacute: uacute$1, + uarr: uarr$1, + ubrcy: ubrcy, + ubreve: ubreve, + ucir: ucir, + ucirc: ucirc$1, + ucy: ucy, + udarr: udarr, + udblac: udblac, + udhar: udhar, + ufisht: ufisht, + ufr: ufr, + ugrav: ugrav, + ugrave: ugrave$1, + uharl: uharl, + uharr: uharr, + uhblk: uhblk, + ulcorn: ulcorn, + ulcorner: ulcorner, + ulcrop: ulcrop, + ultri: ultri, + umacr: umacr, + um: um, + uml: uml$1, + uogon: uogon, + uopf: uopf, + uparrow: uparrow, + updownarrow: updownarrow, + upharpoonleft: upharpoonleft, + upharpoonright: upharpoonright, + uplus: uplus, + upsi: upsi, + upsih: upsih$1, + upsilon: upsilon$1, + upuparrows: upuparrows, + urcorn: urcorn, + urcorner: urcorner, + urcrop: urcrop, + uring: uring, + urtri: urtri, + uscr: uscr, + utdot: utdot, + utilde: utilde, + utri: utri, + utrif: utrif, + uuarr: uuarr, + uum: uum, + uuml: uuml$1, + uwangle: uwangle, + vArr: vArr, + vBar: vBar, + vBarv: vBarv, + vDash: vDash, + vangrt: vangrt, + varepsilon: varepsilon, + varkappa: varkappa, + varnothing: varnothing, + varphi: varphi, + varpi: varpi, + varpropto: varpropto, + varr: varr, + varrho: varrho, + varsigma: varsigma, + varsubsetneq: varsubsetneq, + varsubsetneqq: varsubsetneqq, + varsupsetneq: varsupsetneq, + varsupsetneqq: varsupsetneqq, + vartheta: vartheta, + vartriangleleft: vartriangleleft, + vartriangleright: vartriangleright, + vcy: vcy, + vdash: vdash, + vee: vee, + veebar: veebar, + veeeq: veeeq, + vellip: vellip, + verbar: verbar, + vert: vert, + vfr: vfr, + vltri: vltri, + vnsub: vnsub, + vnsup: vnsup, + vopf: vopf, + vprop: vprop, + vrtri: vrtri, + vscr: vscr, + vsubnE: vsubnE, + vsubne: vsubne, + vsupnE: vsupnE, + vsupne: vsupne, + vzigzag: vzigzag, + wcirc: wcirc, + wedbar: wedbar, + wedge: wedge, + wedgeq: wedgeq, + weierp: weierp$1, + wfr: wfr, + wopf: wopf, + wp: wp, + wr: wr, + wreath: wreath, + wscr: wscr, + xcap: xcap, + xcirc: xcirc, + xcup: xcup, + xdtri: xdtri, + xfr: xfr, + xhArr: xhArr, + xharr: xharr, + xi: xi$1, + xlArr: xlArr, + xlarr: xlarr, + xmap: xmap, + xnis: xnis, + xodot: xodot, + xopf: xopf, + xoplus: xoplus, + xotime: xotime, + xrArr: xrArr, + xrarr: xrarr, + xscr: xscr, + xsqcup: xsqcup, + xuplus: xuplus, + xutri: xutri, + xvee: xvee, + xwedge: xwedge, + yacut: yacut, + yacute: yacute$1, + yacy: yacy, + ycirc: ycirc, + ycy: ycy, + ye: ye, + yen: yen$1, + yfr: yfr, + yicy: yicy, + yopf: yopf, + yscr: yscr, + yucy: yucy, + yum: yum, + yuml: yuml$1, + zacute: zacute, + zcaron: zcaron, + zcy: zcy, + zdot: zdot, + zeetrf: zeetrf, + zeta: zeta$1, + zfr: zfr, + zhcy: zhcy, + zigrarr: zigrarr, + zopf: zopf, + zscr: zscr, + zwj: zwj$1, + zwnj: zwnj$1 +}; + +var characterEntities = require$$0$1; + +var decodeEntity_1 = decodeEntity$1; + +var own$9 = {}.hasOwnProperty; + +function decodeEntity$1(characters) { + return own$9.call(characterEntities, characters) + ? characterEntities[characters] + : false +} + +var legacy$1 = require$$1$2; +var invalid = require$$1$1; +var decimal$1 = requireIsDecimal(); +var hexadecimal$1 = isHexadecimal; +var alphanumerical$1 = isAlphanumerical; +var decodeEntity = decodeEntity_1; + +var parseEntities_1 = parseEntities; + +var own$8 = {}.hasOwnProperty; +var fromCharCode = String.fromCharCode; +var noop = Function.prototype; + +// Default settings. +var defaults$2 = { + warning: null, + reference: null, + text: null, + warningContext: null, + referenceContext: null, + textContext: null, + position: {}, + additional: null, + attribute: false, + nonTerminated: true +}; + +// Characters. +var tab$1 = 9; // '\t' +var lineFeed$1 = 10; // '\n' +var formFeed = 12; // '\f' +var space$3 = 32; // ' ' +var ampersand = 38; // '&' +var semicolon = 59; // ';' +var lessThan$1 = 60; // '<' +var equalsTo = 61; // '=' +var numberSign = 35; // '#' +var uppercaseX = 88; // 'X' +var lowercaseX = 120; // 'x' +var replacementCharacter = 65533; // '�' + +// Reference types. +var name$1 = 'named'; +var hexa = 'hexadecimal'; +var deci = 'decimal'; + +// Map of bases. +var bases = {}; + +bases[hexa] = 16; +bases[deci] = 10; + +// Map of types to tests. +// Each type of character reference accepts different characters. +// This test is used to detect whether a reference has ended (as the semicolon +// is not strictly needed). +var tests = {}; + +tests[name$1] = alphanumerical$1; +tests[deci] = decimal$1; +tests[hexa] = hexadecimal$1; + +// Warning types. +var namedNotTerminated = 1; +var numericNotTerminated = 2; +var namedEmpty = 3; +var numericEmpty = 4; +var namedUnknown = 5; +var numericDisallowed = 6; +var numericProhibited = 7; + +// Warning messages. +var messages = {}; + +messages[namedNotTerminated] = + 'Named character references must be terminated by a semicolon'; +messages[numericNotTerminated] = + 'Numeric character references must be terminated by a semicolon'; +messages[namedEmpty] = 'Named character references cannot be empty'; +messages[numericEmpty] = 'Numeric character references cannot be empty'; +messages[namedUnknown] = 'Named character references must be known'; +messages[numericDisallowed] = + 'Numeric character references cannot be disallowed'; +messages[numericProhibited] = + 'Numeric character references cannot be outside the permissible Unicode range'; + +// Wrap to ensure clean parameters are given to `parse`. +function parseEntities(value, options) { + var settings = {}; + var option; + var key; + + if (!options) { + options = {}; + } + + for (key in defaults$2) { + option = options[key]; + settings[key] = + option === null || option === undefined ? defaults$2[key] : option; + } + + if (settings.position.indent || settings.position.start) { + settings.indent = settings.position.indent || []; + settings.position = settings.position.start; + } + + return parse$6(value, settings) +} + +// Parse entities. +// eslint-disable-next-line complexity +function parse$6(value, settings) { + var additional = settings.additional; + var nonTerminated = settings.nonTerminated; + var handleText = settings.text; + var handleReference = settings.reference; + var handleWarning = settings.warning; + var textContext = settings.textContext; + var referenceContext = settings.referenceContext; + var warningContext = settings.warningContext; + var pos = settings.position; + var indent = settings.indent || []; + var length = value.length; + var index = 0; + var lines = -1; + var column = pos.column || 1; + var line = pos.line || 1; + var queue = ''; + var result = []; + var entityCharacters; + var namedEntity; + var terminated; + var characters; + var character; + var reference; + var following; + var warning; + var reason; + var output; + var entity; + var begin; + var start; + var type; + var test; + var prev; + var next; + var diff; + var end; + + if (typeof additional === 'string') { + additional = additional.charCodeAt(0); + } + + // Cache the current point. + prev = now(); + + // Wrap `handleWarning`. + warning = handleWarning ? parseError : noop; + + // Ensure the algorithm walks over the first character and the end + // (inclusive). + index--; + length++; + + while (++index < length) { + // If the previous character was a newline. + if (character === lineFeed$1) { + column = indent[lines] || 1; + } + + character = value.charCodeAt(index); + + if (character === ampersand) { + following = value.charCodeAt(index + 1); + + // The behaviour depends on the identity of the next character. + if ( + following === tab$1 || + following === lineFeed$1 || + following === formFeed || + following === space$3 || + following === ampersand || + following === lessThan$1 || + following !== following || + (additional && following === additional) + ) { + // Not a character reference. + // No characters are consumed, and nothing is returned. + // This is not an error, either. + queue += fromCharCode(character); + column++; + + continue + } + + start = index + 1; + begin = start; + end = start; + + if (following === numberSign) { + // Numerical entity. + end = ++begin; + + // The behaviour further depends on the next character. + following = value.charCodeAt(end); + + if (following === uppercaseX || following === lowercaseX) { + // ASCII hex digits. + type = hexa; + end = ++begin; + } else { + // ASCII digits. + type = deci; + } + } else { + // Named entity. + type = name$1; + } + + entityCharacters = ''; + entity = ''; + characters = ''; + test = tests[type]; + end--; + + while (++end < length) { + following = value.charCodeAt(end); + + if (!test(following)) { + break + } + + characters += fromCharCode(following); + + // Check if we can match a legacy named reference. + // If so, we cache that as the last viable named reference. + // This ensures we do not need to walk backwards later. + if (type === name$1 && own$8.call(legacy$1, characters)) { + entityCharacters = characters; + entity = legacy$1[characters]; + } + } + + terminated = value.charCodeAt(end) === semicolon; + + if (terminated) { + end++; + + namedEntity = type === name$1 ? decodeEntity(characters) : false; + + if (namedEntity) { + entityCharacters = characters; + entity = namedEntity; + } + } + + diff = 1 + end - start; + + if (!terminated && !nonTerminated) ; else if (!characters) { + // An empty (possible) entity is valid, unless it’s numeric (thus an + // ampersand followed by an octothorp). + if (type !== name$1) { + warning(numericEmpty, diff); + } + } else if (type === name$1) { + // An ampersand followed by anything unknown, and not terminated, is + // invalid. + if (terminated && !entity) { + warning(namedUnknown, 1); + } else { + // If theres something after an entity name which is not known, cap + // the reference. + if (entityCharacters !== characters) { + end = begin + entityCharacters.length; + diff = 1 + end - begin; + terminated = false; + } + + // If the reference is not terminated, warn. + if (!terminated) { + reason = entityCharacters ? namedNotTerminated : namedEmpty; + + if (settings.attribute) { + following = value.charCodeAt(end); + + if (following === equalsTo) { + warning(reason, diff); + entity = null; + } else if (alphanumerical$1(following)) { + entity = null; + } else { + warning(reason, diff); + } + } else { + warning(reason, diff); + } + } + } + + reference = entity; + } else { + if (!terminated) { + // All non-terminated numeric entities are not rendered, and trigger a + // warning. + warning(numericNotTerminated, diff); + } + + // When terminated and number, parse as either hexadecimal or decimal. + reference = parseInt(characters, bases[type]); + + // Trigger a warning when the parsed number is prohibited, and replace + // with replacement character. + if (prohibited(reference)) { + warning(numericProhibited, diff); + reference = fromCharCode(replacementCharacter); + } else if (reference in invalid) { + // Trigger a warning when the parsed number is disallowed, and replace + // by an alternative. + warning(numericDisallowed, diff); + reference = invalid[reference]; + } else { + // Parse the number. + output = ''; + + // Trigger a warning when the parsed number should not be used. + if (disallowed(reference)) { + warning(numericDisallowed, diff); + } + + // Stringify the number. + if (reference > 0xffff) { + reference -= 0x10000; + output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800); + reference = 0xdc00 | (reference & 0x3ff); + } + + reference = output + fromCharCode(reference); + } + } + + // Found it! + // First eat the queued characters as normal text, then eat an entity. + if (reference) { + flush(); + + prev = now(); + index = end - 1; + column += end - start + 1; + result.push(reference); + next = now(); + next.offset++; + + if (handleReference) { + handleReference.call( + referenceContext, + reference, + {start: prev, end: next}, + value.slice(start - 1, end) + ); + } + + prev = next; + } else { + // If we could not find a reference, queue the checked characters (as + // normal characters), and move the pointer to their end. + // This is possible because we can be certain neither newlines nor + // ampersands are included. + characters = value.slice(start - 1, end); + queue += characters; + column += characters.length; + index = end - 1; + } + } else { + // Handle anything other than an ampersand, including newlines and EOF. + if ( + character === 10 // Line feed + ) { + line++; + lines++; + column = 0; + } + + if (character === character) { + queue += fromCharCode(character); + column++; + } else { + flush(); + } + } + } + + // Return the reduced nodes. + return result.join('') + + // Get current position. + function now() { + return { + line: line, + column: column, + offset: index + (pos.offset || 0) + } + } + + // “Throw” a parse-error: a warning. + function parseError(code, offset) { + var position = now(); + + position.column += offset; + position.offset += offset; + + handleWarning.call(warningContext, messages[code], position, code); + } + + // Flush `queue` (normal text). + // Macro invoked before each entity and at the end of `value`. + // Does nothing when `queue` is empty. + function flush() { + if (queue) { + result.push(queue); + + if (handleText) { + handleText.call(textContext, queue, {start: prev, end: now()}); + } + + queue = ''; + } + } +} + +// Check if `character` is outside the permissible unicode range. +function prohibited(code) { + return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff +} + +// Check if `character` is disallowed. +function disallowed(code) { + return ( + (code >= 0x0001 && code <= 0x0008) || + code === 0x000b || + (code >= 0x000d && code <= 0x001f) || + (code >= 0x007f && code <= 0x009f) || + (code >= 0xfdd0 && code <= 0xfdef) || + (code & 0xffff) === 0xffff || + (code & 0xffff) === 0xfffe + ) +} + +var xtend$3 = immutable; +var entities$1 = parseEntities_1; + +var decode$1 = factory$3; + +// Factory to create an entity decoder. +function factory$3(ctx) { + decoder.raw = decodeRaw; + + return decoder + + // Normalize `position` to add an `indent`. + function normalize(position) { + var offsets = ctx.offset; + var line = position.line; + var result = []; + + while (++line) { + if (!(line in offsets)) { + break + } + + result.push((offsets[line] || 0) + 1); + } + + return {start: position, indent: result} + } + + // Decode `value` (at `position`) into text-nodes. + function decoder(value, position, handler) { + entities$1(value, { + position: normalize(position), + warning: handleWarning, + text: handler, + reference: handler, + textContext: ctx, + referenceContext: ctx + }); + } + + // Decode `value` (at `position`) into a string. + function decodeRaw(value, position, options) { + return entities$1( + value, + xtend$3(options, {position: normalize(position), warning: handleWarning}) + ) + } + + // Handle a warning. + // See for the warnings. + function handleWarning(reason, position, code) { + if (code !== 3) { + ctx.file.message(reason, position); + } + } +} + +var tokenizer$3 = factory$2; + +// Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`. +function factory$2(type) { + return tokenize + + // Tokenizer for a bound `type`. + function tokenize(value, location) { + var self = this; + var offset = self.offset; + var tokens = []; + var methods = self[type + 'Methods']; + var tokenizers = self[type + 'Tokenizers']; + var line = location.line; + var column = location.column; + var index; + var length; + var method; + var name; + var matched; + var valueLength; + + // Trim white space only lines. + if (!value) { + return tokens + } + + // Expose on `eat`. + eat.now = now; + eat.file = self.file; + + // Sync initial offset. + updatePosition(''); + + // Iterate over `value`, and iterate over all tokenizers. When one eats + // something, re-iterate with the remaining value. If no tokenizer eats, + // something failed (should not happen) and an exception is thrown. + while (value) { + index = -1; + length = methods.length; + matched = false; + + while (++index < length) { + name = methods[index]; + method = tokenizers[name]; + + // Previously, we had constructs such as footnotes and YAML that used + // these properties. + // Those are now external (plus there are userland extensions), that may + // still use them. + if ( + method && + /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && + /* istanbul ignore next */ (!method.notInList || !self.inList) && + /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) && + (!method.notInLink || !self.inLink) + ) { + valueLength = value.length; + + method.apply(self, [eat, value]); + + matched = valueLength !== value.length; + + if (matched) { + break + } + } + } + + /* istanbul ignore if */ + if (!matched) { + self.file.fail(new Error('Infinite loop'), eat.now()); + } + } + + self.eof = now(); + + return tokens + + // Update line, column, and offset based on `value`. + function updatePosition(subvalue) { + var lastIndex = -1; + var index = subvalue.indexOf('\n'); + + while (index !== -1) { + line++; + lastIndex = index; + index = subvalue.indexOf('\n', index + 1); + } + + if (lastIndex === -1) { + column += subvalue.length; + } else { + column = subvalue.length - lastIndex; + } + + if (line in offset) { + if (lastIndex !== -1) { + column += offset[line]; + } else if (column <= offset[line]) { + column = offset[line] + 1; + } + } + } + + // Get offset. Called before the first character is eaten to retrieve the + // range’s offsets. + function getOffset() { + var indentation = []; + var pos = line + 1; + + // Done. Called when the last character is eaten to retrieve the range’s + // offsets. + return function () { + var last = line + 1; + + while (pos < last) { + indentation.push((offset[pos] || 0) + 1); + + pos++; + } + + return indentation + } + } + + // Get the current position. + function now() { + var pos = {line: line, column: column}; + + pos.offset = self.toOffset(pos); + + return pos + } + + // Store position information for a node. + function Position(start) { + this.start = start; + this.end = now(); + } + + // Throw when a value is incorrectly eaten. This shouldn’t happen but will + // throw on new, incorrect rules. + function validateEat(subvalue) { + /* istanbul ignore if */ + if (value.slice(0, subvalue.length) !== subvalue) { + // Capture stack-trace. + self.file.fail( + new Error( + 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft' + ), + now() + ); + } + } + + // Mark position and patch `node.position`. + function position() { + var before = now(); + + return update + + // Add the position to a node. + function update(node, indent) { + var previous = node.position; + var start = previous ? previous.start : before; + var combined = []; + var n = previous && previous.end.line; + var l = before.line; + + node.position = new Position(start); + + // If there was already a `position`, this node was merged. Fixing + // `start` wasn’t hard, but the indent is different. Especially + // because some information, the indent between `n` and `l` wasn’t + // tracked. Luckily, that space is (should be?) empty, so we can + // safely check for it now. + if (previous && indent && previous.indent) { + combined = previous.indent; + + if (n < l) { + while (++n < l) { + combined.push((offset[n] || 0) + 1); + } + + combined.push(before.column); + } + + indent = combined.concat(indent); + } + + node.position.indent = indent || []; + + return node + } + } + + // Add `node` to `parent`s children or to `tokens`. Performs merges where + // possible. + function add(node, parent) { + var children = parent ? parent.children : tokens; + var previous = children[children.length - 1]; + var fn; + + if ( + previous && + node.type === previous.type && + (node.type === 'text' || node.type === 'blockquote') && + mergeable(previous) && + mergeable(node) + ) { + fn = node.type === 'text' ? mergeText : mergeBlockquote; + node = fn.call(self, previous, node); + } + + if (node !== previous) { + children.push(node); + } + + if (self.atStart && tokens.length !== 0) { + self.exitStart(); + } + + return node + } + + // Remove `subvalue` from `value`. `subvalue` must be at the start of + // `value`. + function eat(subvalue) { + var indent = getOffset(); + var pos = position(); + var current = now(); + + validateEat(subvalue); + + apply.reset = reset; + reset.test = test; + apply.test = test; + + value = value.slice(subvalue.length); + + updatePosition(subvalue); + + indent = indent(); + + return apply + + // Add the given arguments, add `position` to the returned node, and + // return the node. + function apply(node, parent) { + return pos(add(pos(node), parent), indent) + } + + // Functions just like apply, but resets the content: the line and + // column are reversed, and the eaten value is re-added. This is + // useful for nodes with a single type of content, such as lists and + // tables. See `apply` above for what parameters are expected. + function reset() { + var node = apply.apply(null, arguments); + + line = current.line; + column = current.column; + value = subvalue + value; + + return node + } + + // Test the position, after eating, and reverse to a not-eaten state. + function test() { + var result = pos({}); + + line = current.line; + column = current.column; + value = subvalue + value; + + return result.position + } + } + } +} + +// Check whether a node is mergeable with adjacent nodes. +function mergeable(node) { + var start; + var end; + + if (node.type !== 'text' || !node.position) { + return true + } + + start = node.position.start; + end = node.position.end; + + // Only merge nodes which occupy the same size as their `value`. + return ( + start.line !== end.line || end.column - start.column === node.value.length + ) +} + +// Merge two text nodes: `node` into `prev`. +function mergeText(previous, node) { + previous.value += node.value; + + return previous +} + +// Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes. +function mergeBlockquote(previous, node) { + if (this.options.commonmark || this.options.gfm) { + return node + } + + previous.children = previous.children.concat(node.children); + + return previous +} + +var markdownEscapes; +var hasRequiredMarkdownEscapes; + +function requireMarkdownEscapes () { + if (hasRequiredMarkdownEscapes) return markdownEscapes; + hasRequiredMarkdownEscapes = 1; + + markdownEscapes = escapes; + + var defaults = [ + '\\', + '`', + '*', + '{', + '}', + '[', + ']', + '(', + ')', + '#', + '+', + '-', + '.', + '!', + '_', + '>' + ]; + + var gfm = defaults.concat(['~', '|']); + + var commonmark = gfm.concat([ + '\n', + '"', + '$', + '%', + '&', + "'", + ',', + '/', + ':', + ';', + '<', + '=', + '?', + '@', + '^' + ]); + + escapes.default = defaults; + escapes.gfm = gfm; + escapes.commonmark = commonmark; + + // Get markdown escapes. + function escapes(options) { + var settings = options || {}; + + if (settings.commonmark) { + return commonmark + } + + return settings.gfm ? gfm : defaults + } + return markdownEscapes; +} + +var blockElements; +var hasRequiredBlockElements; + +function requireBlockElements () { + if (hasRequiredBlockElements) return blockElements; + hasRequiredBlockElements = 1; + + blockElements = [ + 'address', + 'article', + 'aside', + 'base', + 'basefont', + 'blockquote', + 'body', + 'caption', + 'center', + 'col', + 'colgroup', + 'dd', + 'details', + 'dialog', + 'dir', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'header', + 'hgroup', + 'hr', + 'html', + 'iframe', + 'legend', + 'li', + 'link', + 'main', + 'menu', + 'menuitem', + 'meta', + 'nav', + 'noframes', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'pre', + 'section', + 'source', + 'title', + 'summary', + 'table', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'title', + 'tr', + 'track', + 'ul' + ]; + return blockElements; +} + +var defaults$1; +var hasRequiredDefaults; + +function requireDefaults () { + if (hasRequiredDefaults) return defaults$1; + hasRequiredDefaults = 1; + + defaults$1 = { + position: true, + gfm: true, + commonmark: false, + pedantic: false, + blocks: requireBlockElements() + }; + return defaults$1; +} + +var setOptions_1; +var hasRequiredSetOptions; + +function requireSetOptions () { + if (hasRequiredSetOptions) return setOptions_1; + hasRequiredSetOptions = 1; + + var xtend = immutable; + var escapes = requireMarkdownEscapes(); + var defaults = requireDefaults(); + + setOptions_1 = setOptions; + + function setOptions(options) { + var self = this; + var current = self.options; + var key; + var value; + + if (options == null) { + options = {}; + } else if (typeof options === 'object') { + options = xtend(options); + } else { + throw new Error('Invalid value `' + options + '` for setting `options`') + } + + for (key in defaults) { + value = options[key]; + + if (value == null) { + value = current[key]; + } + + if ( + (key !== 'blocks' && typeof value !== 'boolean') || + (key === 'blocks' && typeof value !== 'object') + ) { + throw new Error( + 'Invalid value `' + value + '` for setting `options.' + key + '`' + ) + } + + options[key] = value; + } + + self.options = options; + self.escape = escapes(options); + + return self + } + return setOptions_1; +} + +var convert_1 = convert$2; + +function convert$2(test) { + if (test == null) { + return ok$1 + } + + if (typeof test === 'string') { + return typeFactory$1(test) + } + + if (typeof test === 'object') { + return 'length' in test ? anyFactory$1(test) : allFactory(test) + } + + if (typeof test === 'function') { + return test + } + + throw new Error('Expected function, string, or object as test') +} + +// Utility assert each property in `test` is represented in `node`, and each +// values are strictly equal. +function allFactory(test) { + return all + + function all(node) { + var key; + + for (key in test) { + if (node[key] !== test[key]) return false + } + + return true + } +} + +function anyFactory$1(tests) { + var checks = []; + var index = -1; + + while (++index < tests.length) { + checks[index] = convert$2(tests[index]); + } + + return any + + function any() { + var index = -1; + + while (++index < checks.length) { + if (checks[index].apply(this, arguments)) { + return true + } + } + + return false + } +} + +// Utility to convert a string into a function which checks a given node’s type +// for said string. +function typeFactory$1(test) { + return type + + function type(node) { + return Boolean(node && node.type === test) + } +} + +// Utility to return true. +function ok$1() { + return true +} + +var color_1 = color$1; +function color$1(d) { + return '\u001B[33m' + d + '\u001B[39m' +} + +var unistUtilVisitParents = visitParents$1; + +var convert$1 = convert_1; +var color = color_1; + +var CONTINUE$1 = true; +var SKIP$1 = 'skip'; +var EXIT$1 = false; + +visitParents$1.CONTINUE = CONTINUE$1; +visitParents$1.SKIP = SKIP$1; +visitParents$1.EXIT = EXIT$1; + +function visitParents$1(tree, test, visitor, reverse) { + var step; + var is; + + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + + is = convert$1(test); + step = reverse ? -1 : 1; + + factory(tree, null, [])(); + + function factory(node, index, parents) { + var value = typeof node === 'object' && node !== null ? node : {}; + var name; + + if (typeof value.type === 'string') { + name = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : undefined; + + visit.displayName = + 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'; + } + + return visit + + function visit() { + var grandparents = parents.concat(node); + var result = []; + var subresult; + var offset; + + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); + + if (result[0] === EXIT$1) { + return result + } + } + + if (node.children && result[0] !== SKIP$1) { + offset = (reverse ? node.children.length : -1) + step; + + while (offset > -1 && offset < node.children.length) { + subresult = factory(node.children[offset], offset, grandparents)(); + + if (subresult[0] === EXIT$1) { + return subresult + } + + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step; + } + } + + return result + } + } +} + +function toResult(value) { + if (value !== null && typeof value === 'object' && 'length' in value) { + return value + } + + if (typeof value === 'number') { + return [CONTINUE$1, value] + } + + return [value] +} + +var unistUtilVisit = visit$5; + +var visitParents = unistUtilVisitParents; + +var CONTINUE = visitParents.CONTINUE; +var SKIP = visitParents.SKIP; +var EXIT = visitParents.EXIT; + +visit$5.CONTINUE = CONTINUE; +visit$5.SKIP = SKIP; +visit$5.EXIT = EXIT; + +function visit$5(tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + + visitParents(tree, test, overload, reverse); + + function overload(node, parents) { + var parent = parents[parents.length - 1]; + var index = parent ? parent.children.indexOf(node) : null; + return visitor(node, index, parent) + } +} + +var visit$6 = /*@__PURE__*/getDefaultExportFromCjs(unistUtilVisit); + +var unistUtilRemovePosition; +var hasRequiredUnistUtilRemovePosition; + +function requireUnistUtilRemovePosition () { + if (hasRequiredUnistUtilRemovePosition) return unistUtilRemovePosition; + hasRequiredUnistUtilRemovePosition = 1; + + var visit = unistUtilVisit; + + unistUtilRemovePosition = removePosition; + + function removePosition(node, force) { + visit(node, force ? hard : soft); + return node + } + + function hard(node) { + delete node.position; + } + + function soft(node) { + node.position = undefined; + } + return unistUtilRemovePosition; +} + +var parse_1; +var hasRequiredParse; + +function requireParse () { + if (hasRequiredParse) return parse_1; + hasRequiredParse = 1; + + var xtend = immutable; + var removePosition = requireUnistUtilRemovePosition(); + + parse_1 = parse; + + var lineFeed = '\n'; + var lineBreaksExpression = /\r\n|\r/g; + + // Parse the bound file. + function parse() { + var self = this; + var value = String(self.file); + var start = {line: 1, column: 1, offset: 0}; + var content = xtend(start); + var node; + + // Clean non-unix newlines: `\r\n` and `\r` are all changed to `\n`. + // This should not affect positional information. + value = value.replace(lineBreaksExpression, lineFeed); + + // BOM. + if (value.charCodeAt(0) === 0xfeff) { + value = value.slice(1); + + content.column++; + content.offset++; + } + + node = { + type: 'root', + children: self.tokenizeBlock(value, content), + position: {start: start, end: self.eof || xtend(start)} + }; + + if (!self.options.position) { + removePosition(node, true); + } + + return node + } + return parse_1; +} + +var blankLine_1; +var hasRequiredBlankLine; + +function requireBlankLine () { + if (hasRequiredBlankLine) return blankLine_1; + hasRequiredBlankLine = 1; + + // A line containing no characters, or a line containing only spaces (U+0020) or + // tabs (U+0009), is called a blank line. + // See . + var reBlankLine = /^[ \t]*(\n|$)/; + + // Note that though blank lines play a special role in lists to determine + // whether the list is tight or loose + // (), it’s done by the list + // tokenizer and this blank line tokenizer does not have to be responsible for + // that. + // Therefore, configs such as `blankLine.notInList` do not have to be set here. + blankLine_1 = blankLine; + + function blankLine(eat, value, silent) { + var match; + var subvalue = ''; + var index = 0; + var length = value.length; + + while (index < length) { + match = reBlankLine.exec(value.slice(index)); + + if (match == null) { + break + } + + index += match[0].length; + subvalue += match[0]; + } + + if (subvalue === '') { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + eat(subvalue); + } + return blankLine_1; +} + +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +/** + * Results cache + */ + +var res = ''; +var cache; + +/** + * Expose `repeat` + */ + +var repeatString = repeat$2; + +/** + * Repeat the given `string` the specified `number` + * of times. + * + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public + */ + +function repeat$2(str, num) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + // cover common, quick use cases + if (num === 1) return str; + if (num === 2) return str + str; + + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } else if (res.length >= max) { + return res.substr(0, max); + } + + while (max > res.length && num > 1) { + if (num & 1) { + res += str; + } + + num >>= 1; + str += str; + } + + res += str; + res = res.substr(0, max); + return res; +} + +var trimTrailingLines_1; +var hasRequiredTrimTrailingLines; + +function requireTrimTrailingLines () { + if (hasRequiredTrimTrailingLines) return trimTrailingLines_1; + hasRequiredTrimTrailingLines = 1; + + trimTrailingLines_1 = trimTrailingLines; + + var line = '\n'; + + // Remove final newline characters from `value`. + function trimTrailingLines(value) { + var val = String(value); + var index = val.length; + + while (val.charAt(--index) === line) { + // Empty + } + + return val.slice(0, index + 1) + } + return trimTrailingLines_1; +} + +var codeIndented; +var hasRequiredCodeIndented; + +function requireCodeIndented () { + if (hasRequiredCodeIndented) return codeIndented; + hasRequiredCodeIndented = 1; + + var repeat = repeatString; + var trim = requireTrimTrailingLines(); + + codeIndented = indentedCode; + + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + + var tabSize = 4; + var codeIndent = repeat(space, tabSize); + + function indentedCode(eat, value, silent) { + var index = -1; + var length = value.length; + var subvalue = ''; + var content = ''; + var subvalueQueue = ''; + var contentQueue = ''; + var character; + var blankQueue; + var indent; + + while (++index < length) { + character = value.charAt(index); + + if (indent) { + indent = false; + + subvalue += subvalueQueue; + content += contentQueue; + subvalueQueue = ''; + contentQueue = ''; + + if (character === lineFeed) { + subvalueQueue = character; + contentQueue = character; + } else { + subvalue += character; + content += character; + + while (++index < length) { + character = value.charAt(index); + + if (!character || character === lineFeed) { + contentQueue = character; + subvalueQueue = character; + break + } + + subvalue += character; + content += character; + } + } + } else if ( + character === space && + value.charAt(index + 1) === character && + value.charAt(index + 2) === character && + value.charAt(index + 3) === character + ) { + subvalueQueue += codeIndent; + index += 3; + indent = true; + } else if (character === tab) { + subvalueQueue += character; + indent = true; + } else { + blankQueue = ''; + + while (character === tab || character === space) { + blankQueue += character; + character = value.charAt(++index); + } + + if (character !== lineFeed) { + break + } + + subvalueQueue += blankQueue + character; + contentQueue += character; + } + } + + if (content) { + if (silent) { + return true + } + + return eat(subvalue)({ + type: 'code', + lang: null, + meta: null, + value: trim(content) + }) + } + } + return codeIndented; +} + +var codeFenced; +var hasRequiredCodeFenced; + +function requireCodeFenced () { + if (hasRequiredCodeFenced) return codeFenced; + hasRequiredCodeFenced = 1; + + codeFenced = fencedCode; + + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + var tilde = '~'; + var graveAccent = '`'; + + var minFenceCount = 3; + var tabSize = 4; + + function fencedCode(eat, value, silent) { + var self = this; + var gfm = self.options.gfm; + var length = value.length + 1; + var index = 0; + var subvalue = ''; + var fenceCount; + var marker; + var character; + var flag; + var lang; + var meta; + var queue; + var content; + var exdentedContent; + var closing; + var exdentedClosing; + var indent; + var now; + + if (!gfm) { + return + } + + // Eat initial spacing. + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + subvalue += character; + index++; + } + + indent = index; + + // Eat the fence. + character = value.charAt(index); + + if (character !== tilde && character !== graveAccent) { + return + } + + index++; + marker = character; + fenceCount = 1; + subvalue += character; + + while (index < length) { + character = value.charAt(index); + + if (character !== marker) { + break + } + + subvalue += character; + fenceCount++; + index++; + } + + if (fenceCount < minFenceCount) { + return + } + + // Eat spacing before flag. + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + subvalue += character; + index++; + } + + // Eat flag. + flag = ''; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if ( + character === lineFeed || + (marker === graveAccent && character === marker) + ) { + break + } + + if (character === space || character === tab) { + queue += character; + } else { + flag += queue + character; + queue = ''; + } + + index++; + } + + character = value.charAt(index); + + if (character && character !== lineFeed) { + return + } + + if (silent) { + return true + } + + now = eat.now(); + now.column += subvalue.length; + now.offset += subvalue.length; + + subvalue += flag; + flag = self.decode.raw(self.unescape(flag), now); + + if (queue) { + subvalue += queue; + } + + queue = ''; + closing = ''; + exdentedClosing = ''; + content = ''; + exdentedContent = ''; + var skip = true; + + // Eat content. + while (index < length) { + character = value.charAt(index); + content += closing; + exdentedContent += exdentedClosing; + closing = ''; + exdentedClosing = ''; + + if (character !== lineFeed) { + content += character; + exdentedClosing += character; + index++; + continue + } + + // The first line feed is ignored. Others aren’t. + if (skip) { + subvalue += character; + skip = false; + } else { + closing += character; + exdentedClosing += character; + } + + queue = ''; + index++; + + while (index < length) { + character = value.charAt(index); + + if (character !== space) { + break + } + + queue += character; + index++; + } + + closing += queue; + exdentedClosing += queue.slice(indent); + + if (queue.length >= tabSize) { + continue + } + + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character !== marker) { + break + } + + queue += character; + index++; + } + + closing += queue; + exdentedClosing += queue; + + if (queue.length < fenceCount) { + continue + } + + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + closing += character; + exdentedClosing += character; + index++; + } + + if (!character || character === lineFeed) { + break + } + } + + subvalue += content + closing; + + // Get lang and meta from the flag. + index = -1; + length = flag.length; + + while (++index < length) { + character = flag.charAt(index); + + if (character === space || character === tab) { + if (!lang) { + lang = flag.slice(0, index); + } + } else if (lang) { + meta = flag.slice(index); + break + } + } + + return eat(subvalue)({ + type: 'code', + lang: lang || flag || null, + meta: meta || null, + value: exdentedContent + }) + } + return codeFenced; +} + +var trim = {exports: {}}; + +var hasRequiredTrim; + +function requireTrim () { + if (hasRequiredTrim) return trim.exports; + hasRequiredTrim = 1; + (function (module, exports) { + exports = module.exports = trim; + + function trim(str){ + return str.replace(/^\s*|\s*$/g, ''); + } + + exports.left = function(str){ + return str.replace(/^\s*/, ''); + }; + + exports.right = function(str){ + return str.replace(/\s*$/, ''); + }; + } (trim, trim.exports)); + return trim.exports; +} + +var interrupt_1; +var hasRequiredInterrupt; + +function requireInterrupt () { + if (hasRequiredInterrupt) return interrupt_1; + hasRequiredInterrupt = 1; + + interrupt_1 = interrupt; + + function interrupt(interruptors, tokenizers, ctx, parameters) { + var length = interruptors.length; + var index = -1; + var interruptor; + var config; + + while (++index < length) { + interruptor = interruptors[index]; + config = interruptor[1] || {}; + + if ( + config.pedantic !== undefined && + config.pedantic !== ctx.options.pedantic + ) { + continue + } + + if ( + config.commonmark !== undefined && + config.commonmark !== ctx.options.commonmark + ) { + continue + } + + if (tokenizers[interruptor[0]].apply(ctx, parameters)) { + return true + } + } + + return false + } + return interrupt_1; +} + +var blockquote_1$1; +var hasRequiredBlockquote; + +function requireBlockquote () { + if (hasRequiredBlockquote) return blockquote_1$1; + hasRequiredBlockquote = 1; + + var trim = requireTrim(); + var interrupt = requireInterrupt(); + + blockquote_1$1 = blockquote; + + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + var greaterThan = '>'; + + function blockquote(eat, value, silent) { + var self = this; + var offsets = self.offset; + var tokenizers = self.blockTokenizers; + var interruptors = self.interruptBlockquote; + var now = eat.now(); + var currentLine = now.line; + var length = value.length; + var values = []; + var contents = []; + var indents = []; + var add; + var index = 0; + var character; + var rest; + var nextIndex; + var content; + var line; + var startIndex; + var prefixed; + var exit; + + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + index++; + } + + if (value.charAt(index) !== greaterThan) { + return + } + + if (silent) { + return true + } + + index = 0; + + while (index < length) { + nextIndex = value.indexOf(lineFeed, index); + startIndex = index; + prefixed = false; + + if (nextIndex === -1) { + nextIndex = length; + } + + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + index++; + } + + if (value.charAt(index) === greaterThan) { + index++; + prefixed = true; + + if (value.charAt(index) === space) { + index++; + } + } else { + index = startIndex; + } + + content = value.slice(index, nextIndex); + + if (!prefixed && !trim(content)) { + index = startIndex; + break + } + + if (!prefixed) { + rest = value.slice(index); + + // Check if the following code contains a possible block. + if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) { + break + } + } + + line = startIndex === index ? content : value.slice(startIndex, nextIndex); + + indents.push(index - startIndex); + values.push(line); + contents.push(content); + + index = nextIndex + 1; + } + + index = -1; + length = indents.length; + add = eat(values.join(lineFeed)); + + while (++index < length) { + offsets[currentLine] = (offsets[currentLine] || 0) + indents[index]; + currentLine++; + } + + exit = self.enterBlock(); + contents = self.tokenizeBlock(contents.join(lineFeed), now); + exit(); + + return add({type: 'blockquote', children: contents}) + } + return blockquote_1$1; +} + +var headingAtx; +var hasRequiredHeadingAtx; + +function requireHeadingAtx () { + if (hasRequiredHeadingAtx) return headingAtx; + hasRequiredHeadingAtx = 1; + + headingAtx = atxHeading; + + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + var numberSign = '#'; + + var maxFenceCount = 6; + + function atxHeading(eat, value, silent) { + var self = this; + var pedantic = self.options.pedantic; + var length = value.length + 1; + var index = -1; + var now = eat.now(); + var subvalue = ''; + var content = ''; + var character; + var queue; + var depth; + + // Eat initial spacing. + while (++index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + index--; + break + } + + subvalue += character; + } + + // Eat hashes. + depth = 0; + + while (++index <= length) { + character = value.charAt(index); + + if (character !== numberSign) { + index--; + break + } + + subvalue += character; + depth++; + } + + if (depth > maxFenceCount) { + return + } + + if (!depth || (!pedantic && value.charAt(index + 1) === numberSign)) { + return + } + + length = value.length + 1; + + // Eat intermediate white-space. + queue = ''; + + while (++index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + index--; + break + } + + queue += character; + } + + // Exit when not in pedantic mode without spacing. + if (!pedantic && queue.length === 0 && character && character !== lineFeed) { + return + } + + if (silent) { + return true + } + + // Eat content. + subvalue += queue; + queue = ''; + content = ''; + + while (++index < length) { + character = value.charAt(index); + + if (!character || character === lineFeed) { + break + } + + if (character !== space && character !== tab && character !== numberSign) { + content += queue + character; + queue = ''; + continue + } + + while (character === space || character === tab) { + queue += character; + character = value.charAt(++index); + } + + // `#` without a queue is part of the content. + if (!pedantic && content && !queue && character === numberSign) { + content += character; + continue + } + + while (character === numberSign) { + queue += character; + character = value.charAt(++index); + } + + while (character === space || character === tab) { + queue += character; + character = value.charAt(++index); + } + + index--; + } + + now.column += subvalue.length; + now.offset += subvalue.length; + subvalue += content + queue; + + return eat(subvalue)({ + type: 'heading', + depth: depth, + children: self.tokenizeInline(content, now) + }) + } + return headingAtx; +} + +var thematicBreak_1$1; +var hasRequiredThematicBreak; + +function requireThematicBreak () { + if (hasRequiredThematicBreak) return thematicBreak_1$1; + hasRequiredThematicBreak = 1; + + thematicBreak_1$1 = thematicBreak; + + var tab = '\t'; + var lineFeed = '\n'; + var space = ' '; + var asterisk = '*'; + var dash = '-'; + var underscore = '_'; + + var maxCount = 3; + + function thematicBreak(eat, value, silent) { + var index = -1; + var length = value.length + 1; + var subvalue = ''; + var character; + var marker; + var markerCount; + var queue; + + while (++index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space) { + break + } + + subvalue += character; + } + + if ( + character !== asterisk && + character !== dash && + character !== underscore + ) { + return + } + + marker = character; + subvalue += character; + markerCount = 1; + queue = ''; + + while (++index < length) { + character = value.charAt(index); + + if (character === marker) { + markerCount++; + subvalue += queue + marker; + queue = ''; + } else if (character === space) { + queue += character; + } else if ( + markerCount >= maxCount && + (!character || character === lineFeed) + ) { + subvalue += queue; + + if (silent) { + return true + } + + return eat(subvalue)({type: 'thematicBreak'}) + } else { + return + } + } + } + return thematicBreak_1$1; +} + +var getIndentation; +var hasRequiredGetIndentation; + +function requireGetIndentation () { + if (hasRequiredGetIndentation) return getIndentation; + hasRequiredGetIndentation = 1; + + getIndentation = indentation; + + var tab = '\t'; + var space = ' '; + + var spaceSize = 1; + var tabSize = 4; + + // Gets indentation information for a line. + function indentation(value) { + var index = 0; + var indent = 0; + var character = value.charAt(index); + var stops = {}; + var size; + var lastIndent = 0; + + while (character === tab || character === space) { + size = character === tab ? tabSize : spaceSize; + + indent += size; + + if (size > 1) { + indent = Math.floor(indent / size) * size; + } + + while (lastIndent < indent) { + stops[++lastIndent] = index; + } + + character = value.charAt(++index); + } + + return {indent: indent, stops: stops} + } + return getIndentation; +} + +var removeIndentation; +var hasRequiredRemoveIndentation; + +function requireRemoveIndentation () { + if (hasRequiredRemoveIndentation) return removeIndentation; + hasRequiredRemoveIndentation = 1; + + var trim = requireTrim(); + var repeat = repeatString; + var getIndent = requireGetIndentation(); + + removeIndentation = indentation; + + var lineFeed = '\n'; + var space = ' '; + var exclamationMark = '!'; + + // Remove the minimum indent from every line in `value`. Supports both tab, + // spaced, and mixed indentation (as well as possible). + function indentation(value, maximum) { + var values = value.split(lineFeed); + var position = values.length + 1; + var minIndent = Infinity; + var matrix = []; + var index; + var indentation; + var stops; + + values.unshift(repeat(space, maximum) + exclamationMark); + + while (position--) { + indentation = getIndent(values[position]); + + matrix[position] = indentation.stops; + + if (trim(values[position]).length === 0) { + continue + } + + if (indentation.indent) { + if (indentation.indent > 0 && indentation.indent < minIndent) { + minIndent = indentation.indent; + } + } else { + minIndent = Infinity; + + break + } + } + + if (minIndent !== Infinity) { + position = values.length; + + while (position--) { + stops = matrix[position]; + index = minIndent; + + while (index && !(index in stops)) { + index--; + } + + values[position] = values[position].slice(stops[index] + 1); + } + } + + values.shift(); + + return values.join(lineFeed) + } + return removeIndentation; +} + +var list_1$1; +var hasRequiredList; + +function requireList () { + if (hasRequiredList) return list_1$1; + hasRequiredList = 1; + + var trim = requireTrim(); + var repeat = repeatString; + var decimal = requireIsDecimal(); + var getIndent = requireGetIndentation(); + var removeIndent = requireRemoveIndentation(); + var interrupt = requireInterrupt(); + + list_1$1 = list; + + var asterisk = '*'; + var underscore = '_'; + var plusSign = '+'; + var dash = '-'; + var dot = '.'; + var space = ' '; + var lineFeed = '\n'; + var tab = '\t'; + var rightParenthesis = ')'; + var lowercaseX = 'x'; + + var tabSize = 4; + var looseListItemExpression = /\n\n(?!\s*$)/; + var taskItemExpression = /^\[([ X\tx])][ \t]/; + var bulletExpression = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/; + var pedanticBulletExpression = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/; + var initialIndentExpression = /^( {1,4}|\t)?/gm; + + function list(eat, value, silent) { + var self = this; + var commonmark = self.options.commonmark; + var pedantic = self.options.pedantic; + var tokenizers = self.blockTokenizers; + var interuptors = self.interruptList; + var index = 0; + var length = value.length; + var start = null; + var size; + var queue; + var ordered; + var character; + var marker; + var nextIndex; + var startIndex; + var prefixed; + var currentMarker; + var content; + var line; + var previousEmpty; + var empty; + var items; + var allLines; + var emptyLines; + var item; + var enterTop; + var exitBlockquote; + var spread = false; + var node; + var now; + var end; + var indented; + + while (index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space) { + break + } + + index++; + } + + character = value.charAt(index); + + if (character === asterisk || character === plusSign || character === dash) { + marker = character; + ordered = false; + } else { + ordered = true; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (!decimal(character)) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + + if ( + !queue || + !(character === dot || (commonmark && character === rightParenthesis)) + ) { + return + } + + /* Slightly abusing `silent` mode, whose goal is to make interrupting + * paragraphs work. + * Well, that’s exactly what we want to do here: don’t interrupt: + * 2. here, because the “list” doesn’t start with `1`. */ + if (silent && queue !== '1') { + return + } + + start = parseInt(queue, 10); + marker = character; + } + + character = value.charAt(++index); + + if ( + character !== space && + character !== tab && + (pedantic || (character !== lineFeed && character !== '')) + ) { + return + } + + if (silent) { + return true + } + + index = 0; + items = []; + allLines = []; + emptyLines = []; + + while (index < length) { + nextIndex = value.indexOf(lineFeed, index); + startIndex = index; + prefixed = false; + indented = false; + + if (nextIndex === -1) { + nextIndex = length; + } + + size = 0; + + while (index < length) { + character = value.charAt(index); + + if (character === tab) { + size += tabSize - (size % tabSize); + } else if (character === space) { + size++; + } else { + break + } + + index++; + } + + if (item && size >= item.indent) { + indented = true; + } + + character = value.charAt(index); + currentMarker = null; + + if (!indented) { + if ( + character === asterisk || + character === plusSign || + character === dash + ) { + currentMarker = character; + index++; + size++; + } else { + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (!decimal(character)) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + index++; + + if ( + queue && + (character === dot || (commonmark && character === rightParenthesis)) + ) { + currentMarker = character; + size += queue.length + 1; + } + } + + if (currentMarker) { + character = value.charAt(index); + + if (character === tab) { + size += tabSize - (size % tabSize); + index++; + } else if (character === space) { + end = index + tabSize; + + while (index < end) { + if (value.charAt(index) !== space) { + break + } + + index++; + size++; + } + + if (index === end && value.charAt(index) === space) { + index -= tabSize - 1; + size -= tabSize - 1; + } + } else if (character !== lineFeed && character !== '') { + currentMarker = null; + } + } + } + + if (currentMarker) { + if (!pedantic && marker !== currentMarker) { + break + } + + prefixed = true; + } else { + if (!commonmark && !indented && value.charAt(startIndex) === space) { + indented = true; + } else if (commonmark && item) { + indented = size >= item.indent || size > tabSize; + } + + prefixed = false; + index = startIndex; + } + + line = value.slice(startIndex, nextIndex); + content = startIndex === index ? line : value.slice(index, nextIndex); + + if ( + currentMarker === asterisk || + currentMarker === underscore || + currentMarker === dash + ) { + if (tokenizers.thematicBreak.call(self, eat, line, true)) { + break + } + } + + previousEmpty = empty; + empty = !prefixed && !trim(content).length; + + if (indented && item) { + item.value = item.value.concat(emptyLines, line); + allLines = allLines.concat(emptyLines, line); + emptyLines = []; + } else if (prefixed) { + if (emptyLines.length !== 0) { + spread = true; + item.value.push(''); + item.trail = emptyLines.concat(); + } + + item = { + value: [line], + indent: size, + trail: [] + }; + + items.push(item); + allLines = allLines.concat(emptyLines, line); + emptyLines = []; + } else if (empty) { + if (previousEmpty && !commonmark) { + break + } + + emptyLines.push(line); + } else { + if (previousEmpty) { + break + } + + if (interrupt(interuptors, tokenizers, self, [eat, line, true])) { + break + } + + item.value = item.value.concat(emptyLines, line); + allLines = allLines.concat(emptyLines, line); + emptyLines = []; + } + + index = nextIndex + 1; + } + + node = eat(allLines.join(lineFeed)).reset({ + type: 'list', + ordered: ordered, + start: start, + spread: spread, + children: [] + }); + + enterTop = self.enterList(); + exitBlockquote = self.enterBlock(); + index = -1; + length = items.length; + + while (++index < length) { + item = items[index].value.join(lineFeed); + now = eat.now(); + + eat(item)(listItem(self, item, now), node); + + item = items[index].trail.join(lineFeed); + + if (index !== length - 1) { + item += lineFeed; + } + + eat(item); + } + + enterTop(); + exitBlockquote(); + + return node + } + + function listItem(ctx, value, position) { + var offsets = ctx.offset; + var fn = ctx.options.pedantic ? pedanticListItem : normalListItem; + var checked = null; + var task; + var indent; + + value = fn.apply(null, arguments); + + if (ctx.options.gfm) { + task = value.match(taskItemExpression); + + if (task) { + indent = task[0].length; + checked = task[1].toLowerCase() === lowercaseX; + offsets[position.line] += indent; + value = value.slice(indent); + } + } + + return { + type: 'listItem', + spread: looseListItemExpression.test(value), + checked: checked, + children: ctx.tokenizeBlock(value, position) + } + } + + // Create a list-item using overly simple mechanics. + function pedanticListItem(ctx, value, position) { + var offsets = ctx.offset; + var line = position.line; + + // Remove the list-item’s bullet. + value = value.replace(pedanticBulletExpression, replacer); + + // The initial line was also matched by the below, so we reset the `line`. + line = position.line; + + return value.replace(initialIndentExpression, replacer) + + // A simple replacer which removed all matches, and adds their length to + // `offset`. + function replacer($0) { + offsets[line] = (offsets[line] || 0) + $0.length; + line++; + + return '' + } + } + + // Create a list-item using sane mechanics. + function normalListItem(ctx, value, position) { + var offsets = ctx.offset; + var line = position.line; + var max; + var bullet; + var rest; + var lines; + var trimmedLines; + var index; + var length; + + // Remove the list-item’s bullet. + value = value.replace(bulletExpression, replacer); + + lines = value.split(lineFeed); + + trimmedLines = removeIndent(value, getIndent(max).indent).split(lineFeed); + + // We replaced the initial bullet with something else above, which was used + // to trick `removeIndentation` into removing some more characters when + // possible. However, that could result in the initial line to be stripped + // more than it should be. + trimmedLines[0] = rest; + + offsets[line] = (offsets[line] || 0) + bullet.length; + line++; + + index = 0; + length = lines.length; + + while (++index < length) { + offsets[line] = + (offsets[line] || 0) + lines[index].length - trimmedLines[index].length; + line++; + } + + return trimmedLines.join(lineFeed) + + /* eslint-disable-next-line max-params */ + function replacer($0, $1, $2, $3, $4) { + bullet = $1 + $2 + $3; + rest = $4; + + // Make sure that the first nine numbered list items can indent with an + // extra space. That is, when the bullet did not receive an extra final + // space. + if (Number($2) < 10 && bullet.length % 2 === 1) { + $2 = space + $2; + } + + max = $1 + repeat(space, $2.length) + $3; + + return max + rest + } + } + return list_1$1; +} + +var headingSetext; +var hasRequiredHeadingSetext; + +function requireHeadingSetext () { + if (hasRequiredHeadingSetext) return headingSetext; + hasRequiredHeadingSetext = 1; + + headingSetext = setextHeading; + + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + var equalsTo = '='; + var dash = '-'; + + var maxIndent = 3; + + var equalsToDepth = 1; + var dashDepth = 2; + + function setextHeading(eat, value, silent) { + var self = this; + var now = eat.now(); + var length = value.length; + var index = -1; + var subvalue = ''; + var content; + var queue; + var character; + var marker; + var depth; + + // Eat initial indentation. + while (++index < length) { + character = value.charAt(index); + + if (character !== space || index >= maxIndent) { + index--; + break + } + + subvalue += character; + } + + // Eat content. + content = ''; + queue = ''; + + while (++index < length) { + character = value.charAt(index); + + if (character === lineFeed) { + index--; + break + } + + if (character === space || character === tab) { + queue += character; + } else { + content += queue + character; + queue = ''; + } + } + + now.column += subvalue.length; + now.offset += subvalue.length; + subvalue += content + queue; + + // Ensure the content is followed by a newline and a valid marker. + character = value.charAt(++index); + marker = value.charAt(++index); + + if (character !== lineFeed || (marker !== equalsTo && marker !== dash)) { + return + } + + subvalue += character; + + // Eat Setext-line. + queue = marker; + depth = marker === equalsTo ? equalsToDepth : dashDepth; + + while (++index < length) { + character = value.charAt(index); + + if (character !== marker) { + if (character !== lineFeed) { + return + } + + index--; + break + } + + queue += character; + } + + if (silent) { + return true + } + + return eat(subvalue + queue)({ + type: 'heading', + depth: depth, + children: self.tokenizeInline(content, now) + }) + } + return headingSetext; +} + +var html$6 = {}; + +var hasRequiredHtml; + +function requireHtml () { + if (hasRequiredHtml) return html$6; + hasRequiredHtml = 1; + + var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; + var unquoted = '[^"\'=<>`\\u0000-\\u0020]+'; + var singleQuoted = "'[^']*'"; + var doubleQuoted = '"[^"]*"'; + var attributeValue = + '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')'; + var attribute = + '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)'; + var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; + var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; + var comment = '|'; + var processing = '<[?].*?[?]>'; + var declaration = ']*>'; + var cdata = ''; + + html$6.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')'); + + html$6.tag = new RegExp( + '^(?:' + + openTag + + '|' + + closeTag + + '|' + + comment + + '|' + + processing + + '|' + + declaration + + '|' + + cdata + + ')' + ); + return html$6; +} + +var htmlBlock; +var hasRequiredHtmlBlock; + +function requireHtmlBlock () { + if (hasRequiredHtmlBlock) return htmlBlock; + hasRequiredHtmlBlock = 1; + + var openCloseTag = requireHtml().openCloseTag; + + htmlBlock = blockHtml; + + var tab = '\t'; + var space = ' '; + var lineFeed = '\n'; + var lessThan = '<'; + + var rawOpenExpression = /^<(script|pre|style)(?=(\s|>|$))/i; + var rawCloseExpression = /<\/(script|pre|style)>/i; + var commentOpenExpression = /^/; + var instructionOpenExpression = /^<\?/; + var instructionCloseExpression = /\?>/; + var directiveOpenExpression = /^/; + var cdataOpenExpression = /^/; + var elementCloseExpression = /^$/; + var otherElementOpenExpression = new RegExp(openCloseTag.source + '\\s*$'); + + function blockHtml(eat, value, silent) { + var self = this; + var blocks = self.options.blocks.join('|'); + var elementOpenExpression = new RegExp( + '^|$))', + 'i' + ); + var length = value.length; + var index = 0; + var next; + var line; + var offset; + var character; + var count; + var sequence; + var subvalue; + + var sequences = [ + [rawOpenExpression, rawCloseExpression, true], + [commentOpenExpression, commentCloseExpression, true], + [instructionOpenExpression, instructionCloseExpression, true], + [directiveOpenExpression, directiveCloseExpression, true], + [cdataOpenExpression, cdataCloseExpression, true], + [elementOpenExpression, elementCloseExpression, true], + [otherElementOpenExpression, elementCloseExpression, false] + ]; + + // Eat initial spacing. + while (index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space) { + break + } + + index++; + } + + if (value.charAt(index) !== lessThan) { + return + } + + next = value.indexOf(lineFeed, index + 1); + next = next === -1 ? length : next; + line = value.slice(index, next); + offset = -1; + count = sequences.length; + + while (++offset < count) { + if (sequences[offset][0].test(line)) { + sequence = sequences[offset]; + break + } + } + + if (!sequence) { + return + } + + if (silent) { + return sequence[2] + } + + index = next; + + if (!sequence[1].test(line)) { + while (index < length) { + next = value.indexOf(lineFeed, index + 1); + next = next === -1 ? length : next; + line = value.slice(index + 1, next); + + if (sequence[1].test(line)) { + if (line) { + index = next; + } + + break + } + + index = next; + } + } + + subvalue = value.slice(0, index); + + return eat(subvalue)({type: 'html', value: subvalue}) + } + return htmlBlock; +} + +var isWhitespaceCharacter; +var hasRequiredIsWhitespaceCharacter; + +function requireIsWhitespaceCharacter () { + if (hasRequiredIsWhitespaceCharacter) return isWhitespaceCharacter; + hasRequiredIsWhitespaceCharacter = 1; + + isWhitespaceCharacter = whitespace; + + var fromCode = String.fromCharCode; + var re = /\s/; + + // Check if the given character code, or the character code at the first + // character, is a whitespace character. + function whitespace(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ) + } + return isWhitespaceCharacter; +} + +var collapseWhiteSpace; +var hasRequiredCollapseWhiteSpace; + +function requireCollapseWhiteSpace () { + if (hasRequiredCollapseWhiteSpace) return collapseWhiteSpace; + hasRequiredCollapseWhiteSpace = 1; + + collapseWhiteSpace = collapse; + + // `collapse(' \t\nbar \nbaz\t') // ' bar baz '` + function collapse(value) { + return String(value).replace(/\s+/g, ' ') + } + return collapseWhiteSpace; +} + +var normalize_1$1; +var hasRequiredNormalize; + +function requireNormalize () { + if (hasRequiredNormalize) return normalize_1$1; + hasRequiredNormalize = 1; + + var collapseWhiteSpace = requireCollapseWhiteSpace(); + + normalize_1$1 = normalize; + + // Normalize an identifier. Collapses multiple white space characters into a + // single space, and removes casing. + function normalize(value) { + return collapseWhiteSpace(value).toLowerCase() + } + return normalize_1$1; +} + +var definition_1; +var hasRequiredDefinition; + +function requireDefinition () { + if (hasRequiredDefinition) return definition_1; + hasRequiredDefinition = 1; + + var whitespace = requireIsWhitespaceCharacter(); + var normalize = requireNormalize(); + + definition_1 = definition; + + var quotationMark = '"'; + var apostrophe = "'"; + var backslash = '\\'; + var lineFeed = '\n'; + var tab = '\t'; + var space = ' '; + var leftSquareBracket = '['; + var rightSquareBracket = ']'; + var leftParenthesis = '('; + var rightParenthesis = ')'; + var colon = ':'; + var lessThan = '<'; + var greaterThan = '>'; + + function definition(eat, value, silent) { + var self = this; + var commonmark = self.options.commonmark; + var index = 0; + var length = value.length; + var subvalue = ''; + var beforeURL; + var beforeTitle; + var queue; + var character; + var test; + var identifier; + var url; + var title; + + while (index < length) { + character = value.charAt(index); + + if (character !== space && character !== tab) { + break + } + + subvalue += character; + index++; + } + + character = value.charAt(index); + + if (character !== leftSquareBracket) { + return + } + + index++; + subvalue += character; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character === rightSquareBracket) { + break + } else if (character === backslash) { + queue += character; + index++; + character = value.charAt(index); + } + + queue += character; + index++; + } + + if ( + !queue || + value.charAt(index) !== rightSquareBracket || + value.charAt(index + 1) !== colon + ) { + return + } + + identifier = queue; + subvalue += queue + rightSquareBracket + colon; + index = subvalue.length; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space && character !== lineFeed) { + break + } + + subvalue += character; + index++; + } + + character = value.charAt(index); + queue = ''; + beforeURL = subvalue; + + if (character === lessThan) { + index++; + + while (index < length) { + character = value.charAt(index); + + if (!isEnclosedURLCharacter(character)) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + + if (character === isEnclosedURLCharacter.delimiter) { + subvalue += lessThan + queue + character; + index++; + } else { + if (commonmark) { + return + } + + index -= queue.length + 1; + queue = ''; + } + } + + if (!queue) { + while (index < length) { + character = value.charAt(index); + + if (!isUnclosedURLCharacter(character)) { + break + } + + queue += character; + index++; + } + + subvalue += queue; + } + + if (!queue) { + return + } + + url = queue; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space && character !== lineFeed) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + test = null; + + if (character === quotationMark) { + test = quotationMark; + } else if (character === apostrophe) { + test = apostrophe; + } else if (character === leftParenthesis) { + test = rightParenthesis; + } + + if (!test) { + queue = ''; + index = subvalue.length; + } else if (queue) { + subvalue += queue + character; + index = subvalue.length; + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character === test) { + break + } + + if (character === lineFeed) { + index++; + character = value.charAt(index); + + if (character === lineFeed || character === test) { + return + } + + queue += lineFeed; + } + + queue += character; + index++; + } + + character = value.charAt(index); + + if (character !== test) { + return + } + + beforeTitle = subvalue; + subvalue += queue + character; + index++; + title = queue; + queue = ''; + } else { + return + } + + while (index < length) { + character = value.charAt(index); + + if (character !== tab && character !== space) { + break + } + + subvalue += character; + index++; + } + + character = value.charAt(index); + + if (!character || character === lineFeed) { + if (silent) { + return true + } + + beforeURL = eat(beforeURL).test().end; + url = self.decode.raw(self.unescape(url), beforeURL, {nonTerminated: false}); + + if (title) { + beforeTitle = eat(beforeTitle).test().end; + title = self.decode.raw(self.unescape(title), beforeTitle); + } + + return eat(subvalue)({ + type: 'definition', + identifier: normalize(identifier), + label: identifier, + title: title || null, + url: url + }) + } + } + + // Check if `character` can be inside an enclosed URI. + function isEnclosedURLCharacter(character) { + return ( + character !== greaterThan && + character !== leftSquareBracket && + character !== rightSquareBracket + ) + } + + isEnclosedURLCharacter.delimiter = greaterThan; + + // Check if `character` can be inside an unclosed URI. + function isUnclosedURLCharacter(character) { + return ( + character !== leftSquareBracket && + character !== rightSquareBracket && + !whitespace(character) + ) + } + return definition_1; +} + +var table_1$1; +var hasRequiredTable; + +function requireTable () { + if (hasRequiredTable) return table_1$1; + hasRequiredTable = 1; + + var whitespace = requireIsWhitespaceCharacter(); + + table_1$1 = table; + + var tab = '\t'; + var lineFeed = '\n'; + var space = ' '; + var dash = '-'; + var colon = ':'; + var backslash = '\\'; + var verticalBar = '|'; + + var minColumns = 1; + var minRows = 2; + + var left = 'left'; + var center = 'center'; + var right = 'right'; + + function table(eat, value, silent) { + var self = this; + var index; + var alignments; + var alignment; + var subvalue; + var row; + var length; + var lines; + var queue; + var character; + var hasDash; + var align; + var cell; + var preamble; + var now; + var position; + var lineCount; + var line; + var rows; + var table; + var lineIndex; + var pipeIndex; + var first; + + // Exit when not in gfm-mode. + if (!self.options.gfm) { + return + } + + // Get the rows. + // Detecting tables soon is hard, so there are some checks for performance + // here, such as the minimum number of rows, and allowed characters in the + // alignment row. + index = 0; + lineCount = 0; + length = value.length + 1; + lines = []; + + while (index < length) { + lineIndex = value.indexOf(lineFeed, index); + pipeIndex = value.indexOf(verticalBar, index + 1); + + if (lineIndex === -1) { + lineIndex = value.length; + } + + if (pipeIndex === -1 || pipeIndex > lineIndex) { + if (lineCount < minRows) { + return + } + + break + } + + lines.push(value.slice(index, lineIndex)); + lineCount++; + index = lineIndex + 1; + } + + // Parse the alignment row. + subvalue = lines.join(lineFeed); + alignments = lines.splice(1, 1)[0] || []; + index = 0; + length = alignments.length; + lineCount--; + alignment = false; + align = []; + + while (index < length) { + character = alignments.charAt(index); + + if (character === verticalBar) { + hasDash = null; + + if (alignment === false) { + if (first === false) { + return + } + } else { + align.push(alignment); + alignment = false; + } + + first = false; + } else if (character === dash) { + hasDash = true; + alignment = alignment || null; + } else if (character === colon) { + if (alignment === left) { + alignment = center; + } else if (hasDash && alignment === null) { + alignment = right; + } else { + alignment = left; + } + } else if (!whitespace(character)) { + return + } + + index++; + } + + if (alignment !== false) { + align.push(alignment); + } + + // Exit when without enough columns. + if (align.length < minColumns) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + // Parse the rows. + position = -1; + rows = []; + + table = eat(subvalue).reset({type: 'table', align: align, children: rows}); + + while (++position < lineCount) { + line = lines[position]; + row = {type: 'tableRow', children: []}; + + // Eat a newline character when this is not the first row. + if (position) { + eat(lineFeed); + } + + // Eat the row. + eat(line).reset(row, table); + + length = line.length + 1; + index = 0; + queue = ''; + cell = ''; + preamble = true; + + while (index < length) { + character = line.charAt(index); + + if (character === tab || character === space) { + if (cell) { + queue += character; + } else { + eat(character); + } + + index++; + continue + } + + if (character === '' || character === verticalBar) { + if (preamble) { + eat(character); + } else { + if ((cell || character) && !preamble) { + subvalue = cell; + + if (queue.length > 1) { + if (character) { + subvalue += queue.slice(0, -1); + queue = queue.charAt(queue.length - 1); + } else { + subvalue += queue; + queue = ''; + } + } + + now = eat.now(); + + eat(subvalue)( + {type: 'tableCell', children: self.tokenizeInline(cell, now)}, + row + ); + } + + eat(queue + character); + + queue = ''; + cell = ''; + } + } else { + if (queue) { + cell += queue; + queue = ''; + } + + cell += character; + + if (character === backslash && index !== length - 2) { + cell += line.charAt(index + 1); + index++; + } + } + + preamble = false; + index++; + } + + // Eat the alignment row. + if (!position) { + eat(lineFeed + alignments); + } + } + + return table + } + return table_1$1; +} + +var paragraph_1$1; +var hasRequiredParagraph; + +function requireParagraph () { + if (hasRequiredParagraph) return paragraph_1$1; + hasRequiredParagraph = 1; + + var trim = requireTrim(); + var trimTrailingLines = requireTrimTrailingLines(); + var interrupt = requireInterrupt(); + + paragraph_1$1 = paragraph; + + var tab = '\t'; + var lineFeed = '\n'; + var space = ' '; + + var tabSize = 4; + + // Tokenise paragraph. + function paragraph(eat, value, silent) { + var self = this; + var settings = self.options; + var commonmark = settings.commonmark; + var tokenizers = self.blockTokenizers; + var interruptors = self.interruptParagraph; + var index = value.indexOf(lineFeed); + var length = value.length; + var position; + var subvalue; + var character; + var size; + var now; + + while (index < length) { + // Eat everything if there’s no following newline. + if (index === -1) { + index = length; + break + } + + // Stop if the next character is NEWLINE. + if (value.charAt(index + 1) === lineFeed) { + break + } + + // In commonmark-mode, following indented lines are part of the paragraph. + if (commonmark) { + size = 0; + position = index + 1; + + while (position < length) { + character = value.charAt(position); + + if (character === tab) { + size = tabSize; + break + } else if (character === space) { + size++; + } else { + break + } + + position++; + } + + if (size >= tabSize && character !== lineFeed) { + index = value.indexOf(lineFeed, index + 1); + continue + } + } + + subvalue = value.slice(index + 1); + + // Check if the following code contains a possible block. + if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) { + break + } + + position = index; + index = value.indexOf(lineFeed, index + 1); + + if (index !== -1 && trim(value.slice(position, index)) === '') { + index = position; + break + } + } + + subvalue = value.slice(0, index); + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now(); + subvalue = trimTrailingLines(subvalue); + + return eat(subvalue)({ + type: 'paragraph', + children: self.tokenizeInline(subvalue, now) + }) + } + return paragraph_1$1; +} + +var _escape$1; +var hasRequired_escape$1; + +function require_escape$1 () { + if (hasRequired_escape$1) return _escape$1; + hasRequired_escape$1 = 1; + + _escape$1 = locate; + + function locate(value, fromIndex) { + return value.indexOf('\\', fromIndex) + } + return _escape$1; +} + +var _escape; +var hasRequired_escape; + +function require_escape () { + if (hasRequired_escape) return _escape; + hasRequired_escape = 1; + + var locate = require_escape$1(); + + _escape = escape; + escape.locator = locate; + + var lineFeed = '\n'; + var backslash = '\\'; + + function escape(eat, value, silent) { + var self = this; + var character; + var node; + + if (value.charAt(0) === backslash) { + character = value.charAt(1); + + if (self.escape.indexOf(character) !== -1) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + if (character === lineFeed) { + node = {type: 'break'}; + } else { + node = {type: 'text', value: character}; + } + + return eat(backslash + character)(node) + } + } + } + return _escape; +} + +var tag; +var hasRequiredTag; + +function requireTag () { + if (hasRequiredTag) return tag; + hasRequiredTag = 1; + + tag = locate; + + function locate(value, fromIndex) { + return value.indexOf('<', fromIndex) + } + return tag; +} + +var autoLink_1; +var hasRequiredAutoLink; + +function requireAutoLink () { + if (hasRequiredAutoLink) return autoLink_1; + hasRequiredAutoLink = 1; + + var whitespace = requireIsWhitespaceCharacter(); + var decode = parseEntities_1; + var locate = requireTag(); + + autoLink_1 = autoLink; + autoLink.locator = locate; + autoLink.notInLink = true; + + var lessThan = '<'; + var greaterThan = '>'; + var atSign = '@'; + var slash = '/'; + var mailto = 'mailto:'; + var mailtoLength = mailto.length; + + function autoLink(eat, value, silent) { + var self = this; + var subvalue = ''; + var length = value.length; + var index = 0; + var queue = ''; + var hasAtCharacter = false; + var link = ''; + var character; + var now; + var content; + var tokenizers; + var exit; + + if (value.charAt(0) !== lessThan) { + return + } + + index++; + subvalue = lessThan; + + while (index < length) { + character = value.charAt(index); + + if ( + whitespace(character) || + character === greaterThan || + character === atSign || + (character === ':' && value.charAt(index + 1) === slash) + ) { + break + } + + queue += character; + index++; + } + + if (!queue) { + return + } + + link += queue; + queue = ''; + + character = value.charAt(index); + link += character; + index++; + + if (character === atSign) { + hasAtCharacter = true; + } else { + if (character !== ':' || value.charAt(index + 1) !== slash) { + return + } + + link += slash; + index++; + } + + while (index < length) { + character = value.charAt(index); + + if (whitespace(character) || character === greaterThan) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + + if (!queue || character !== greaterThan) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + link += queue; + content = link; + subvalue += link + character; + now = eat.now(); + now.column++; + now.offset++; + + if (hasAtCharacter) { + if (link.slice(0, mailtoLength).toLowerCase() === mailto) { + content = content.slice(mailtoLength); + now.column += mailtoLength; + now.offset += mailtoLength; + } else { + link = mailto + link; + } + } + + // Temporarily remove all tokenizers except text in autolinks. + tokenizers = self.inlineTokenizers; + self.inlineTokenizers = {text: tokenizers.text}; + + exit = self.enterLink(); + + content = self.tokenizeInline(content, now); + + self.inlineTokenizers = tokenizers; + exit(); + + return eat(subvalue)({ + type: 'link', + title: null, + url: decode(link, {nonTerminated: false}), + children: content + }) + } + return autoLink_1; +} + +var ccount_1; +var hasRequiredCcount; + +function requireCcount () { + if (hasRequiredCcount) return ccount_1; + hasRequiredCcount = 1; + + ccount_1 = ccount; + + function ccount(value, character) { + var val = String(value); + var count = 0; + var index; + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character') + } + + index = val.indexOf(character); + + while (index !== -1) { + count++; + index = val.indexOf(character, index + 1); + } + + return count + } + return ccount_1; +} + +var url; +var hasRequiredUrl$1; + +function requireUrl$1 () { + if (hasRequiredUrl$1) return url; + hasRequiredUrl$1 = 1; + + url = locate; + + var values = ['www.', 'http://', 'https://']; + + function locate(value, fromIndex) { + var min = -1; + var index; + var length; + var position; + + if (!this.options.gfm) { + return min + } + + length = values.length; + index = -1; + + while (++index < length) { + position = value.indexOf(values[index], fromIndex); + + if (position !== -1 && (min === -1 || position < min)) { + min = position; + } + } + + return min + } + return url; +} + +var url_1; +var hasRequiredUrl; + +function requireUrl () { + if (hasRequiredUrl) return url_1; + hasRequiredUrl = 1; + + var ccount = requireCcount(); + var decode = parseEntities_1; + var decimal = requireIsDecimal(); + var alphabetical = requireIsAlphabetical(); + var whitespace = requireIsWhitespaceCharacter(); + var locate = requireUrl$1(); + + url_1 = url; + url.locator = locate; + url.notInLink = true; + + var exclamationMark = 33; // '!' + var ampersand = 38; // '&' + var rightParenthesis = 41; // ')' + var asterisk = 42; // '*' + var comma = 44; // ',' + var dash = 45; // '-' + var dot = 46; // '.' + var colon = 58; // ':' + var semicolon = 59; // ';' + var questionMark = 63; // '?' + var lessThan = 60; // '<' + var underscore = 95; // '_' + var tilde = 126; // '~' + + var leftParenthesisCharacter = '('; + var rightParenthesisCharacter = ')'; + + function url(eat, value, silent) { + var self = this; + var gfm = self.options.gfm; + var tokenizers = self.inlineTokenizers; + var length = value.length; + var previousDot = -1; + var protocolless = false; + var dots; + var lastTwoPartsStart; + var start; + var index; + var pathStart; + var path; + var code; + var end; + var leftCount; + var rightCount; + var content; + var children; + var url; + var exit; + + if (!gfm) { + return + } + + // `WWW.` doesn’t work. + if (value.slice(0, 4) === 'www.') { + protocolless = true; + index = 4; + } else if (value.slice(0, 7).toLowerCase() === 'http://') { + index = 7; + } else if (value.slice(0, 8).toLowerCase() === 'https://') { + index = 8; + } else { + return + } + + // Act as if the starting boundary is a dot. + previousDot = index - 1; + + // Parse a valid domain. + start = index; + dots = []; + + while (index < length) { + code = value.charCodeAt(index); + + if (code === dot) { + // Dots may not appear after each other. + if (previousDot === index - 1) { + break + } + + dots.push(index); + previousDot = index; + index++; + continue + } + + if ( + decimal(code) || + alphabetical(code) || + code === dash || + code === underscore + ) { + index++; + continue + } + + break + } + + // Ignore a final dot: + if (code === dot) { + dots.pop(); + index--; + } + + // If there are not dots, exit. + if (dots[0] === undefined) { + return + } + + // If there is an underscore in the last two domain parts, exit: + // `www.example.c_m` and `www.ex_ample.com` are not OK, but + // `www.sub_domain.example.com` is. + lastTwoPartsStart = dots.length < 2 ? start : dots[dots.length - 2] + 1; + + if (value.slice(lastTwoPartsStart, index).indexOf('_') !== -1) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + end = index; + pathStart = index; + + // Parse a path. + while (index < length) { + code = value.charCodeAt(index); + + if (whitespace(code) || code === lessThan) { + break + } + + index++; + + if ( + code === exclamationMark || + code === asterisk || + code === comma || + code === dot || + code === colon || + code === questionMark || + code === underscore || + code === tilde + ) ; else { + end = index; + } + } + + index = end; + + // If the path ends in a closing paren, and the count of closing parens is + // higher than the opening count, then remove the supefluous closing parens. + if (value.charCodeAt(index - 1) === rightParenthesis) { + path = value.slice(pathStart, index); + leftCount = ccount(path, leftParenthesisCharacter); + rightCount = ccount(path, rightParenthesisCharacter); + + while (rightCount > leftCount) { + index = pathStart + path.lastIndexOf(rightParenthesisCharacter); + path = value.slice(pathStart, index); + rightCount--; + } + } + + if (value.charCodeAt(index - 1) === semicolon) { + // GitHub doesn’t document this, but final semicolons aren’t paret of the + // URL either. + index--; + + // // If the path ends in what looks like an entity, it’s not part of the path. + if (alphabetical(value.charCodeAt(index - 1))) { + end = index - 2; + + while (alphabetical(value.charCodeAt(end))) { + end--; + } + + if (value.charCodeAt(end) === ampersand) { + index = end; + } + } + } + + content = value.slice(0, index); + url = decode(content, {nonTerminated: false}); + + if (protocolless) { + url = 'http://' + url; + } + + exit = self.enterLink(); + + // Temporarily remove all tokenizers except text in url. + self.inlineTokenizers = {text: tokenizers.text}; + children = self.tokenizeInline(content, eat.now()); + self.inlineTokenizers = tokenizers; + + exit(); + + return eat(content)({type: 'link', title: null, url: url, children: children}) + } + return url_1; +} + +var email; +var hasRequiredEmail$1; + +function requireEmail$1 () { + if (hasRequiredEmail$1) return email; + hasRequiredEmail$1 = 1; + + var decimal = requireIsDecimal(); + var alphabetical = requireIsAlphabetical(); + + var plusSign = 43; // '+' + var dash = 45; // '-' + var dot = 46; // '.' + var underscore = 95; // '_' + + email = locate; + + // See: + function locate(value, fromIndex) { + var self = this; + var at; + var position; + + if (!this.options.gfm) { + return -1 + } + + at = value.indexOf('@', fromIndex); + + if (at === -1) { + return -1 + } + + position = at; + + if (position === fromIndex || !isGfmAtext(value.charCodeAt(position - 1))) { + return locate.call(self, value, at + 1) + } + + while (position > fromIndex && isGfmAtext(value.charCodeAt(position - 1))) { + position--; + } + + return position + } + + function isGfmAtext(code) { + return ( + decimal(code) || + alphabetical(code) || + code === plusSign || + code === dash || + code === dot || + code === underscore + ) + } + return email; +} + +var email_1; +var hasRequiredEmail; + +function requireEmail () { + if (hasRequiredEmail) return email_1; + hasRequiredEmail = 1; + + var decode = parseEntities_1; + var decimal = requireIsDecimal(); + var alphabetical = requireIsAlphabetical(); + var locate = requireEmail$1(); + + email_1 = email; + email.locator = locate; + email.notInLink = true; + + var plusSign = 43; // '+' + var dash = 45; // '-' + var dot = 46; // '.' + var atSign = 64; // '@' + var underscore = 95; // '_' + + function email(eat, value, silent) { + var self = this; + var gfm = self.options.gfm; + var tokenizers = self.inlineTokenizers; + var index = 0; + var length = value.length; + var firstDot = -1; + var code; + var content; + var children; + var exit; + + if (!gfm) { + return + } + + code = value.charCodeAt(index); + + while ( + decimal(code) || + alphabetical(code) || + code === plusSign || + code === dash || + code === dot || + code === underscore + ) { + code = value.charCodeAt(++index); + } + + if (index === 0) { + return + } + + if (code !== atSign) { + return + } + + index++; + + while (index < length) { + code = value.charCodeAt(index); + + if ( + decimal(code) || + alphabetical(code) || + code === dash || + code === dot || + code === underscore + ) { + index++; + + if (firstDot === -1 && code === dot) { + firstDot = index; + } + + continue + } + + break + } + + if ( + firstDot === -1 || + firstDot === index || + code === dash || + code === underscore + ) { + return + } + + if (code === dot) { + index--; + } + + content = value.slice(0, index); + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + exit = self.enterLink(); + + // Temporarily remove all tokenizers except text in url. + self.inlineTokenizers = {text: tokenizers.text}; + children = self.tokenizeInline(content, eat.now()); + self.inlineTokenizers = tokenizers; + + exit(); + + return eat(content)({ + type: 'link', + title: null, + url: 'mailto:' + decode(content, {nonTerminated: false}), + children: children + }) + } + return email_1; +} + +var htmlInline; +var hasRequiredHtmlInline; + +function requireHtmlInline () { + if (hasRequiredHtmlInline) return htmlInline; + hasRequiredHtmlInline = 1; + + var alphabetical = requireIsAlphabetical(); + var locate = requireTag(); + var tag = requireHtml().tag; + + htmlInline = inlineHTML; + inlineHTML.locator = locate; + + var lessThan = '<'; + var questionMark = '?'; + var exclamationMark = '!'; + var slash = '/'; + + var htmlLinkOpenExpression = /^/i; + + function inlineHTML(eat, value, silent) { + var self = this; + var length = value.length; + var character; + var subvalue; + + if (value.charAt(0) !== lessThan || length < 3) { + return + } + + character = value.charAt(1); + + if ( + !alphabetical(character) && + character !== questionMark && + character !== exclamationMark && + character !== slash + ) { + return + } + + subvalue = value.match(tag); + + if (!subvalue) { + return + } + + /* istanbul ignore if - not used yet. */ + if (silent) { + return true + } + + subvalue = subvalue[0]; + + if (!self.inLink && htmlLinkOpenExpression.test(subvalue)) { + self.inLink = true; + } else if (self.inLink && htmlLinkCloseExpression.test(subvalue)) { + self.inLink = false; + } + + return eat(subvalue)({type: 'html', value: subvalue}) + } + return htmlInline; +} + +var link$1; +var hasRequiredLink$1; + +function requireLink$1 () { + if (hasRequiredLink$1) return link$1; + hasRequiredLink$1 = 1; + + link$1 = locate; + + function locate(value, fromIndex) { + var link = value.indexOf('[', fromIndex); + var image = value.indexOf('![', fromIndex); + + if (image === -1) { + return link + } + + // Link can never be `-1` if an image is found, so we don’t need to check + // for that :) + return link < image ? link : image + } + return link$1; +} + +var link_1$1; +var hasRequiredLink; + +function requireLink () { + if (hasRequiredLink) return link_1$1; + hasRequiredLink = 1; + + var whitespace = requireIsWhitespaceCharacter(); + var locate = requireLink$1(); + + link_1$1 = link; + link.locator = locate; + + var lineFeed = '\n'; + var exclamationMark = '!'; + var quotationMark = '"'; + var apostrophe = "'"; + var leftParenthesis = '('; + var rightParenthesis = ')'; + var lessThan = '<'; + var greaterThan = '>'; + var leftSquareBracket = '['; + var backslash = '\\'; + var rightSquareBracket = ']'; + var graveAccent = '`'; + + function link(eat, value, silent) { + var self = this; + var subvalue = ''; + var index = 0; + var character = value.charAt(0); + var pedantic = self.options.pedantic; + var commonmark = self.options.commonmark; + var gfm = self.options.gfm; + var closed; + var count; + var opening; + var beforeURL; + var beforeTitle; + var subqueue; + var hasMarker; + var isImage; + var content; + var marker; + var length; + var title; + var depth; + var queue; + var url; + var now; + var exit; + var node; + + // Detect whether this is an image. + if (character === exclamationMark) { + isImage = true; + subvalue = character; + character = value.charAt(++index); + } + + // Eat the opening. + if (character !== leftSquareBracket) { + return + } + + // Exit when this is a link and we’re already inside a link. + if (!isImage && self.inLink) { + return + } + + subvalue += character; + queue = ''; + index++; + + // Eat the content. + length = value.length; + now = eat.now(); + depth = 0; + + now.column += index; + now.offset += index; + + while (index < length) { + character = value.charAt(index); + subqueue = character; + + if (character === graveAccent) { + // Inline-code in link content. + count = 1; + + while (value.charAt(index + 1) === graveAccent) { + subqueue += character; + index++; + count++; + } + + if (!opening) { + opening = count; + } else if (count >= opening) { + opening = 0; + } + } else if (character === backslash) { + // Allow brackets to be escaped. + index++; + subqueue += value.charAt(index); + } else if ((!opening || gfm) && character === leftSquareBracket) { + // In GFM mode, brackets in code still count. In all other modes, + // they don’t. + depth++; + } else if ((!opening || gfm) && character === rightSquareBracket) { + if (depth) { + depth--; + } else { + if (value.charAt(index + 1) !== leftParenthesis) { + return + } + + subqueue += leftParenthesis; + closed = true; + index++; + + break + } + } + + queue += subqueue; + subqueue = ''; + index++; + } + + // Eat the content closing. + if (!closed) { + return + } + + content = queue; + subvalue += queue + subqueue; + index++; + + // Eat white-space. + while (index < length) { + character = value.charAt(index); + + if (!whitespace(character)) { + break + } + + subvalue += character; + index++; + } + + // Eat the URL. + character = value.charAt(index); + queue = ''; + beforeURL = subvalue; + + if (character === lessThan) { + index++; + beforeURL += lessThan; + + while (index < length) { + character = value.charAt(index); + + if (character === greaterThan) { + break + } + + if (commonmark && character === lineFeed) { + return + } + + queue += character; + index++; + } + + if (value.charAt(index) !== greaterThan) { + return + } + + subvalue += lessThan + queue + greaterThan; + url = queue; + index++; + } else { + character = null; + subqueue = ''; + + while (index < length) { + character = value.charAt(index); + + if ( + subqueue && + (character === quotationMark || + character === apostrophe || + (commonmark && character === leftParenthesis)) + ) { + break + } + + if (whitespace(character)) { + if (!pedantic) { + break + } + + subqueue += character; + } else { + if (character === leftParenthesis) { + depth++; + } else if (character === rightParenthesis) { + if (depth === 0) { + break + } + + depth--; + } + + queue += subqueue; + subqueue = ''; + + if (character === backslash) { + queue += backslash; + character = value.charAt(++index); + } + + queue += character; + } + + index++; + } + + subvalue += queue; + url = queue; + index = subvalue.length; + } + + // Eat white-space. + queue = ''; + + while (index < length) { + character = value.charAt(index); + + if (!whitespace(character)) { + break + } + + queue += character; + index++; + } + + character = value.charAt(index); + subvalue += queue; + + // Eat the title. + if ( + queue && + (character === quotationMark || + character === apostrophe || + (commonmark && character === leftParenthesis)) + ) { + index++; + subvalue += character; + queue = ''; + marker = character === leftParenthesis ? rightParenthesis : character; + beforeTitle = subvalue; + + // In commonmark-mode, things are pretty easy: the marker cannot occur + // inside the title. Non-commonmark does, however, support nested + // delimiters. + if (commonmark) { + while (index < length) { + character = value.charAt(index); + + if (character === marker) { + break + } + + if (character === backslash) { + queue += backslash; + character = value.charAt(++index); + } + + index++; + queue += character; + } + + character = value.charAt(index); + + if (character !== marker) { + return + } + + title = queue; + subvalue += queue + character; + index++; + + while (index < length) { + character = value.charAt(index); + + if (!whitespace(character)) { + break + } + + subvalue += character; + index++; + } + } else { + subqueue = ''; + + while (index < length) { + character = value.charAt(index); + + if (character === marker) { + if (hasMarker) { + queue += marker + subqueue; + subqueue = ''; + } + + hasMarker = true; + } else if (!hasMarker) { + queue += character; + } else if (character === rightParenthesis) { + subvalue += queue + marker + subqueue; + title = queue; + break + } else if (whitespace(character)) { + subqueue += character; + } else { + queue += marker + subqueue + character; + subqueue = ''; + hasMarker = false; + } + + index++; + } + } + } + + if (value.charAt(index) !== rightParenthesis) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + subvalue += rightParenthesis; + + url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end, { + nonTerminated: false + }); + + if (title) { + beforeTitle = eat(beforeTitle).test().end; + title = self.decode.raw(self.unescape(title), beforeTitle); + } + + node = { + type: isImage ? 'image' : 'link', + title: title || null, + url: url + }; + + if (isImage) { + node.alt = self.decode.raw(self.unescape(content), now) || null; + } else { + exit = self.enterLink(); + node.children = self.tokenizeInline(content, now); + exit(); + } + + return eat(subvalue)(node) + } + return link_1$1; +} + +var reference_1; +var hasRequiredReference; + +function requireReference () { + if (hasRequiredReference) return reference_1; + hasRequiredReference = 1; + + var whitespace = requireIsWhitespaceCharacter(); + var locate = requireLink$1(); + var normalize = requireNormalize(); + + reference_1 = reference; + reference.locator = locate; + + var link = 'link'; + var image = 'image'; + var shortcut = 'shortcut'; + var collapsed = 'collapsed'; + var full = 'full'; + var exclamationMark = '!'; + var leftSquareBracket = '['; + var backslash = '\\'; + var rightSquareBracket = ']'; + + function reference(eat, value, silent) { + var self = this; + var commonmark = self.options.commonmark; + var character = value.charAt(0); + var index = 0; + var length = value.length; + var subvalue = ''; + var intro = ''; + var type = link; + var referenceType = shortcut; + var content; + var identifier; + var now; + var node; + var exit; + var queue; + var bracketed; + var depth; + + // Check whether we’re eating an image. + if (character === exclamationMark) { + type = image; + intro = character; + character = value.charAt(++index); + } + + if (character !== leftSquareBracket) { + return + } + + index++; + intro += character; + queue = ''; + + // Eat the text. + depth = 0; + + while (index < length) { + character = value.charAt(index); + + if (character === leftSquareBracket) { + bracketed = true; + depth++; + } else if (character === rightSquareBracket) { + if (!depth) { + break + } + + depth--; + } + + if (character === backslash) { + queue += backslash; + character = value.charAt(++index); + } + + queue += character; + index++; + } + + subvalue = queue; + content = queue; + character = value.charAt(index); + + if (character !== rightSquareBracket) { + return + } + + index++; + subvalue += character; + queue = ''; + + if (!commonmark) { + // The original markdown syntax definition explicitly allows for whitespace + // between the link text and link label; commonmark departs from this, in + // part to improve support for shortcut reference links + while (index < length) { + character = value.charAt(index); + + if (!whitespace(character)) { + break + } + + queue += character; + index++; + } + } + + character = value.charAt(index); + + if (character === leftSquareBracket) { + identifier = ''; + queue += character; + index++; + + while (index < length) { + character = value.charAt(index); + + if (character === leftSquareBracket || character === rightSquareBracket) { + break + } + + if (character === backslash) { + identifier += backslash; + character = value.charAt(++index); + } + + identifier += character; + index++; + } + + character = value.charAt(index); + + if (character === rightSquareBracket) { + referenceType = identifier ? full : collapsed; + queue += identifier + character; + index++; + } else { + identifier = ''; + } + + subvalue += queue; + queue = ''; + } else { + if (!content) { + return + } + + identifier = content; + } + + // Brackets cannot be inside the identifier. + if (referenceType !== full && bracketed) { + return + } + + subvalue = intro + subvalue; + + if (type === link && self.inLink) { + return null + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now(); + now.column += intro.length; + now.offset += intro.length; + identifier = referenceType === full ? identifier : content; + + node = { + type: type + 'Reference', + identifier: normalize(identifier), + label: identifier, + referenceType: referenceType + }; + + if (type === link) { + exit = self.enterLink(); + node.children = self.tokenizeInline(content, now); + exit(); + } else { + node.alt = self.decode.raw(self.unescape(content), now) || null; + } + + return eat(subvalue)(node) + } + return reference_1; +} + +var strong$1; +var hasRequiredStrong$1; + +function requireStrong$1 () { + if (hasRequiredStrong$1) return strong$1; + hasRequiredStrong$1 = 1; + + strong$1 = locate; + + function locate(value, fromIndex) { + var asterisk = value.indexOf('**', fromIndex); + var underscore = value.indexOf('__', fromIndex); + + if (underscore === -1) { + return asterisk + } + + if (asterisk === -1) { + return underscore + } + + return underscore < asterisk ? underscore : asterisk + } + return strong$1; +} + +var strong_1$1; +var hasRequiredStrong; + +function requireStrong () { + if (hasRequiredStrong) return strong_1$1; + hasRequiredStrong = 1; + + var trim = requireTrim(); + var whitespace = requireIsWhitespaceCharacter(); + var locate = requireStrong$1(); + + strong_1$1 = strong; + strong.locator = locate; + + var backslash = '\\'; + var asterisk = '*'; + var underscore = '_'; + + function strong(eat, value, silent) { + var self = this; + var index = 0; + var character = value.charAt(index); + var now; + var pedantic; + var marker; + var queue; + var subvalue; + var length; + var previous; + + if ( + (character !== asterisk && character !== underscore) || + value.charAt(++index) !== character + ) { + return + } + + pedantic = self.options.pedantic; + marker = character; + subvalue = marker + marker; + length = value.length; + index++; + queue = ''; + character = ''; + + if (pedantic && whitespace(value.charAt(index))) { + return + } + + while (index < length) { + previous = character; + character = value.charAt(index); + + if ( + character === marker && + value.charAt(index + 1) === marker && + (!pedantic || !whitespace(previous)) + ) { + character = value.charAt(index + 2); + + if (character !== marker) { + if (!trim(queue)) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now(); + now.column += 2; + now.offset += 2; + + return eat(subvalue + queue + subvalue)({ + type: 'strong', + children: self.tokenizeInline(queue, now) + }) + } + } + + if (!pedantic && character === backslash) { + queue += character; + character = value.charAt(++index); + } + + queue += character; + index++; + } + } + return strong_1$1; +} + +var isWordCharacter; +var hasRequiredIsWordCharacter; + +function requireIsWordCharacter () { + if (hasRequiredIsWordCharacter) return isWordCharacter; + hasRequiredIsWordCharacter = 1; + + isWordCharacter = wordCharacter; + + var fromCode = String.fromCharCode; + var re = /\w/; + + // Check if the given character code, or the character code at the first + // character, is a word character. + function wordCharacter(character) { + return re.test( + typeof character === 'number' ? fromCode(character) : character.charAt(0) + ) + } + return isWordCharacter; +} + +var emphasis$1; +var hasRequiredEmphasis$1; + +function requireEmphasis$1 () { + if (hasRequiredEmphasis$1) return emphasis$1; + hasRequiredEmphasis$1 = 1; + + emphasis$1 = locate; + + function locate(value, fromIndex) { + var asterisk = value.indexOf('*', fromIndex); + var underscore = value.indexOf('_', fromIndex); + + if (underscore === -1) { + return asterisk + } + + if (asterisk === -1) { + return underscore + } + + return underscore < asterisk ? underscore : asterisk + } + return emphasis$1; +} + +var emphasis_1$1; +var hasRequiredEmphasis; + +function requireEmphasis () { + if (hasRequiredEmphasis) return emphasis_1$1; + hasRequiredEmphasis = 1; + + var trim = requireTrim(); + var word = requireIsWordCharacter(); + var whitespace = requireIsWhitespaceCharacter(); + var locate = requireEmphasis$1(); + + emphasis_1$1 = emphasis; + emphasis.locator = locate; + + var asterisk = '*'; + var underscore = '_'; + var backslash = '\\'; + + function emphasis(eat, value, silent) { + var self = this; + var index = 0; + var character = value.charAt(index); + var now; + var pedantic; + var marker; + var queue; + var subvalue; + var length; + var previous; + + if (character !== asterisk && character !== underscore) { + return + } + + pedantic = self.options.pedantic; + subvalue = character; + marker = character; + length = value.length; + index++; + queue = ''; + character = ''; + + if (pedantic && whitespace(value.charAt(index))) { + return + } + + while (index < length) { + previous = character; + character = value.charAt(index); + + if (character === marker && (!pedantic || !whitespace(previous))) { + character = value.charAt(++index); + + if (character !== marker) { + if (!trim(queue) || previous === marker) { + return + } + + if (!pedantic && marker === underscore && word(character)) { + queue += marker; + continue + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + now = eat.now(); + now.column++; + now.offset++; + + return eat(subvalue + queue + marker)({ + type: 'emphasis', + children: self.tokenizeInline(queue, now) + }) + } + + queue += marker; + } + + if (!pedantic && character === backslash) { + queue += character; + character = value.charAt(++index); + } + + queue += character; + index++; + } + } + return emphasis_1$1; +} + +var _delete$2; +var hasRequired_delete$1; + +function require_delete$1 () { + if (hasRequired_delete$1) return _delete$2; + hasRequired_delete$1 = 1; + + _delete$2 = locate; + + function locate(value, fromIndex) { + return value.indexOf('~~', fromIndex) + } + return _delete$2; +} + +var _delete$1; +var hasRequired_delete; + +function require_delete () { + if (hasRequired_delete) return _delete$1; + hasRequired_delete = 1; + + var whitespace = requireIsWhitespaceCharacter(); + var locate = require_delete$1(); + + _delete$1 = strikethrough; + strikethrough.locator = locate; + + var tilde = '~'; + var fence = '~~'; + + function strikethrough(eat, value, silent) { + var self = this; + var character = ''; + var previous = ''; + var preceding = ''; + var subvalue = ''; + var index; + var length; + var now; + + if ( + !self.options.gfm || + value.charAt(0) !== tilde || + value.charAt(1) !== tilde || + whitespace(value.charAt(2)) + ) { + return + } + + index = 1; + length = value.length; + now = eat.now(); + now.column += 2; + now.offset += 2; + + while (++index < length) { + character = value.charAt(index); + + if ( + character === tilde && + previous === tilde && + (!preceding || !whitespace(preceding)) + ) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + return eat(fence + subvalue + fence)({ + type: 'delete', + children: self.tokenizeInline(subvalue, now) + }) + } + + subvalue += previous; + preceding = previous; + previous = character; + } + } + return _delete$1; +} + +var codeInline$1; +var hasRequiredCodeInline$1; + +function requireCodeInline$1 () { + if (hasRequiredCodeInline$1) return codeInline$1; + hasRequiredCodeInline$1 = 1; + + codeInline$1 = locate; + + function locate(value, fromIndex) { + return value.indexOf('`', fromIndex) + } + return codeInline$1; +} + +var codeInline; +var hasRequiredCodeInline; + +function requireCodeInline () { + if (hasRequiredCodeInline) return codeInline; + hasRequiredCodeInline = 1; + + var locate = requireCodeInline$1(); + + codeInline = inlineCode; + inlineCode.locator = locate; + + var lineFeed = 10; // '\n' + var space = 32; // ' ' + var graveAccent = 96; // '`' + + function inlineCode(eat, value, silent) { + var length = value.length; + var index = 0; + var openingFenceEnd; + var closingFenceStart; + var closingFenceEnd; + var code; + var next; + var found; + + while (index < length) { + if (value.charCodeAt(index) !== graveAccent) { + break + } + + index++; + } + + if (index === 0 || index === length) { + return + } + + openingFenceEnd = index; + next = value.charCodeAt(index); + + while (index < length) { + code = next; + next = value.charCodeAt(index + 1); + + if (code === graveAccent) { + if (closingFenceStart === undefined) { + closingFenceStart = index; + } + + closingFenceEnd = index + 1; + + if ( + next !== graveAccent && + closingFenceEnd - closingFenceStart === openingFenceEnd + ) { + found = true; + break + } + } else if (closingFenceStart !== undefined) { + closingFenceStart = undefined; + closingFenceEnd = undefined; + } + + index++; + } + + if (!found) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + // Remove the initial and final space (or line feed), iff they exist and there + // are non-space characters in the content. + index = openingFenceEnd; + length = closingFenceStart; + code = value.charCodeAt(index); + next = value.charCodeAt(length - 1); + found = false; + + if ( + length - index > 2 && + (code === space || code === lineFeed) && + (next === space || next === lineFeed) + ) { + index++; + length--; + + while (index < length) { + code = value.charCodeAt(index); + + if (code !== space && code !== lineFeed) { + found = true; + break + } + + index++; + } + + if (found === true) { + openingFenceEnd++; + closingFenceStart--; + } + } + + return eat(value.slice(0, closingFenceEnd))({ + type: 'inlineCode', + value: value.slice(openingFenceEnd, closingFenceStart) + }) + } + return codeInline; +} + +var _break$2; +var hasRequired_break$1; + +function require_break$1 () { + if (hasRequired_break$1) return _break$2; + hasRequired_break$1 = 1; + + _break$2 = locate; + + function locate(value, fromIndex) { + var index = value.indexOf('\n', fromIndex); + + while (index > fromIndex) { + if (value.charAt(index - 1) !== ' ') { + break + } + + index--; + } + + return index + } + return _break$2; +} + +var _break$1; +var hasRequired_break; + +function require_break () { + if (hasRequired_break) return _break$1; + hasRequired_break = 1; + + var locate = require_break$1(); + + _break$1 = hardBreak; + hardBreak.locator = locate; + + var space = ' '; + var lineFeed = '\n'; + var minBreakLength = 2; + + function hardBreak(eat, value, silent) { + var length = value.length; + var index = -1; + var queue = ''; + var character; + + while (++index < length) { + character = value.charAt(index); + + if (character === lineFeed) { + if (index < minBreakLength) { + return + } + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + queue += character; + + return eat(queue)({type: 'break'}) + } + + if (character !== space) { + return + } + + queue += character; + } + } + return _break$1; +} + +var text_1$2; +var hasRequiredText; + +function requireText () { + if (hasRequiredText) return text_1$2; + hasRequiredText = 1; + + text_1$2 = text; + + function text(eat, value, silent) { + var self = this; + var methods; + var tokenizers; + var index; + var length; + var subvalue; + var position; + var tokenizer; + var name; + var min; + var now; + + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + methods = self.inlineMethods; + length = methods.length; + tokenizers = self.inlineTokenizers; + index = -1; + min = value.length; + + while (++index < length) { + name = methods[index]; + + if (name === 'text' || !tokenizers[name]) { + continue + } + + tokenizer = tokenizers[name].locator; + + if (!tokenizer) { + eat.file.fail('Missing locator: `' + name + '`'); + } + + position = tokenizer.call(self, value, 1); + + if (position !== -1 && position < min) { + min = position; + } + } + + subvalue = value.slice(0, min); + now = eat.now(); + + self.decode(subvalue, now, handler); + + function handler(content, position, source) { + eat(source || content)({type: 'text', value: content}); + } + } + return text_1$2; +} + +var xtend$2 = immutable; +var toggle = stateToggle; +var vfileLocation = vfileLocation$1; +var unescape = _unescape; +var decode = decode$1; +var tokenizer$2 = tokenizer$3; + +var parser$1 = Parser$1; + +function Parser$1(doc, file) { + this.file = file; + this.offset = {}; + this.options = xtend$2(this.options); + this.setOptions({}); + + this.inList = false; + this.inBlock = false; + this.inLink = false; + this.atStart = true; + + this.toOffset = vfileLocation(file).toOffset; + this.unescape = unescape(this, 'escape'); + this.decode = decode(this); +} + +var proto$3 = Parser$1.prototype; + +// Expose core. +proto$3.setOptions = requireSetOptions(); +proto$3.parse = requireParse(); + +// Expose `defaults`. +proto$3.options = requireDefaults(); + +// Enter and exit helpers. +proto$3.exitStart = toggle('atStart', true); +proto$3.enterList = toggle('inList', false); +proto$3.enterLink = toggle('inLink', false); +proto$3.enterBlock = toggle('inBlock', false); + +// Nodes that can interupt a paragraph: +// +// ```markdown +// A paragraph, followed by a thematic break. +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the paragraph. +proto$3.interruptParagraph = [ + ['thematicBreak'], + ['list'], + ['atxHeading'], + ['fencedCode'], + ['blockquote'], + ['html'], + ['setextHeading', {commonmark: false}], + ['definition', {commonmark: false}] +]; + +// Nodes that can interupt a list: +// +// ```markdown +// - One +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the list. +proto$3.interruptList = [ + ['atxHeading', {pedantic: false}], + ['fencedCode', {pedantic: false}], + ['thematicBreak', {pedantic: false}], + ['definition', {commonmark: false}] +]; + +// Nodes that can interupt a blockquote: +// +// ```markdown +// > A paragraph. +// ___ +// ``` +// +// In the above example, the thematic break “interupts” the blockquote. +proto$3.interruptBlockquote = [ + ['indentedCode', {commonmark: true}], + ['fencedCode', {commonmark: true}], + ['atxHeading', {commonmark: true}], + ['setextHeading', {commonmark: true}], + ['thematicBreak', {commonmark: true}], + ['html', {commonmark: true}], + ['list', {commonmark: true}], + ['definition', {commonmark: false}] +]; + +// Handlers. +proto$3.blockTokenizers = { + blankLine: requireBlankLine(), + indentedCode: requireCodeIndented(), + fencedCode: requireCodeFenced(), + blockquote: requireBlockquote(), + atxHeading: requireHeadingAtx(), + thematicBreak: requireThematicBreak(), + list: requireList(), + setextHeading: requireHeadingSetext(), + html: requireHtmlBlock(), + definition: requireDefinition(), + table: requireTable(), + paragraph: requireParagraph() +}; + +proto$3.inlineTokenizers = { + escape: require_escape(), + autoLink: requireAutoLink(), + url: requireUrl(), + email: requireEmail(), + html: requireHtmlInline(), + link: requireLink(), + reference: requireReference(), + strong: requireStrong(), + emphasis: requireEmphasis(), + deletion: require_delete(), + code: requireCodeInline(), + break: require_break(), + text: requireText() +}; + +// Expose precedence. +proto$3.blockMethods = keys$1(proto$3.blockTokenizers); +proto$3.inlineMethods = keys$1(proto$3.inlineTokenizers); + +// Tokenizers. +proto$3.tokenizeBlock = tokenizer$2('block'); +proto$3.tokenizeInline = tokenizer$2('inline'); +proto$3.tokenizeFactory = tokenizer$2; + +// Get all keys in `value`. +function keys$1(value) { + var result = []; + var key; + + for (key in value) { + result.push(key); + } + + return result +} + +var unherit$1 = unherit_1; +var xtend$1 = immutable; +var Parser = parser$1; + +var remarkParse = parse$5; +parse$5.Parser = Parser; + +function parse$5(options) { + var settings = this.data('settings'); + var Local = unherit$1(Parser); + + Local.prototype.options = xtend$1(Local.prototype.options, settings, options); + + this.Parser = Local; +} + +var markdown = /*@__PURE__*/getDefaultExportFromCjs(remarkParse); + +var visit$4 = unistUtilVisit; + +var mdastUtilDefinitions$1 = getDefinitionFactory$1; + +var own$7 = {}.hasOwnProperty; + +// Get a definition in `node` by `identifier`. +function getDefinitionFactory$1(node, options) { + return getterFactory$1(gather$1(node, options)) +} + +// Gather all definitions in `node` +function gather$1(node, options) { + var cache = {}; + + if (!node || !node.type) { + throw new Error('mdast-util-definitions expected node') + } + + visit$4(node, 'definition', options && options.commonmark ? commonmark : normal); + + return cache + + function commonmark(definition) { + var id = normalise$1(definition.identifier); + if (!own$7.call(cache, id)) { + cache[id] = definition; + } + } + + function normal(definition) { + cache[normalise$1(definition.identifier)] = definition; + } +} + +// Factory to get a node from the given definition-cache. +function getterFactory$1(cache) { + return getter + + // Get a node from the bound definition-cache. + function getter(identifier) { + var id = identifier && normalise$1(identifier); + return id && own$7.call(cache, id) ? cache[id] : null + } +} + +function normalise$1(identifier) { + return identifier.toUpperCase() +} + +var spaceSeparatedTokens = {}; + +spaceSeparatedTokens.parse = parse$4; +spaceSeparatedTokens.stringify = stringify$4; + +var empty$2 = ''; +var space$2 = ' '; +var whiteSpace$3 = /[ \t\n\r\f]+/g; + +function parse$4(value) { + var input = String(value || empty$2).trim(); + return input === empty$2 ? [] : input.split(whiteSpace$3) +} + +function stringify$4(values) { + return values.join(space$2).trim() +} + +var isAbsoluteUrl = url => { + if (typeof url !== 'string') { + throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``); + } + + // Don't match Windows paths `c:\` + if (/^[a-zA-Z]:\\/.test(url)) { + return false; + } + + // Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + // Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(url); +}; + +var visit$3 = unistUtilVisit; +var definitions$1 = mdastUtilDefinitions$1; +var spaceSeparated$3 = spaceSeparatedTokens.parse; +var absolute = isAbsoluteUrl; +var extend$2 = extend$5; + +var remarkExternalLinks = externalLinks; + +var defaultTarget = '_blank'; +var defaultRel = ['nofollow', 'noopener', 'noreferrer']; +var defaultProtocols = ['http', 'https']; + +function externalLinks(options) { + var settings = options || {}; + var target = settings.target; + var rel = settings.rel; + var protocols = settings.protocols || defaultProtocols; + var content = settings.content; + var contentProperties = settings.contentProperties || {}; + + if (typeof rel === 'string') { + rel = spaceSeparated$3(rel); + } + + if (content && typeof content === 'object' && !('length' in content)) { + content = [content]; + } + + return transform + + function transform(tree) { + var definition = definitions$1(tree); + + visit$3(tree, ['link', 'linkReference'], visitor); + + function visitor(node) { + var ctx = node.type === 'link' ? node : definition(node.identifier); + var protocol; + var data; + var props; + + if (!ctx) return + + protocol = ctx.url.slice(0, ctx.url.indexOf(':')); + + if (absolute(ctx.url) && protocols.indexOf(protocol) !== -1) { + data = node.data || (node.data = {}); + props = data.hProperties || (data.hProperties = {}); + + if (target !== false) { + props.target = target || defaultTarget; + } + + if (rel !== false) { + props.rel = (rel || defaultRel).concat(); + } + + if (content) { + // `fragment` is not a known mdast node, but unknown nodes with + // children are handled as elements by `mdast-util-to-hast`: + // See: . + node.children.push({ + type: 'fragment', + children: [], + data: { + hName: 'span', + hProperties: extend$2(true, contentProperties), + hChildren: extend$2(true, content) + } + }); + } + } + } + } +} + +var external = /*@__PURE__*/getDefaultExportFromCjs(remarkExternalLinks); + +var format = {exports: {}}; + +(function (module) { +(function() { + + //// Export the API + var namespace; + + // CommonJS / Node module + { + namespace = module.exports = format; + } + + namespace.format = format; + namespace.vsprintf = vsprintf; + + if (typeof console !== 'undefined' && typeof console.log === 'function') { + namespace.printf = printf; + } + + function printf(/* ... */) { + console.log(format.apply(null, arguments)); + } + + function vsprintf(fmt, replacements) { + return format.apply(null, [fmt].concat(replacements)); + } + + function format(fmt) { + var argIndex = 1 // skip initial format argument + , args = [].slice.call(arguments) + , i = 0 + , n = fmt.length + , result = '' + , c + , escaped = false + , arg + , tmp + , leadingZero = false + , precision + , nextArg = function() { return args[argIndex++]; } + , slurpNumber = function() { + var digits = ''; + while (/\d/.test(fmt[i])) { + digits += fmt[i++]; + c = fmt[i]; + } + return digits.length > 0 ? parseInt(digits) : null; + } + ; + for (; i < n; ++i) { + c = fmt[i]; + if (escaped) { + escaped = false; + if (c == '.') { + leadingZero = false; + c = fmt[++i]; + } + else if (c == '0' && fmt[i + 1] == '.') { + leadingZero = true; + i += 2; + c = fmt[i]; + } + else { + leadingZero = true; + } + precision = slurpNumber(); + switch (c) { + case 'b': // number in binary + result += parseInt(nextArg(), 10).toString(2); + break; + case 'c': // character + arg = nextArg(); + if (typeof arg === 'string' || arg instanceof String) + result += arg; + else + result += String.fromCharCode(parseInt(arg, 10)); + break; + case 'd': // number in decimal + result += parseInt(nextArg(), 10); + break; + case 'f': // floating point number + tmp = String(parseFloat(nextArg()).toFixed(precision || 6)); + result += leadingZero ? tmp : tmp.replace(/^0/, ''); + break; + case 'j': // JSON + result += JSON.stringify(nextArg()); + break; + case 'o': // number in octal + result += '0' + parseInt(nextArg(), 10).toString(8); + break; + case 's': // string + result += nextArg(); + break; + case 'x': // lowercase hexadecimal + result += '0x' + parseInt(nextArg(), 10).toString(16); + break; + case 'X': // uppercase hexadecimal + result += '0x' + parseInt(nextArg(), 10).toString(16).toUpperCase(); + break; + default: + result += c; + break; + } + } else if (c === '%') { + escaped = true; + } else { + result += c; + } + } + return result; + } + + }()); +} (format)); + +var formatExports = format.exports; + +var formatter = formatExports; + +var fault$1 = create$9(Error); + +var fault_1 = fault$1; + +fault$1.eval = create$9(EvalError); +fault$1.range = create$9(RangeError); +fault$1.reference = create$9(ReferenceError); +fault$1.syntax = create$9(SyntaxError); +fault$1.type = create$9(TypeError); +fault$1.uri = create$9(URIError); + +fault$1.create = create$9; + +// Create a new `EConstructor`, with the formatted `format` as a first argument. +function create$9(EConstructor) { + FormattedError.displayName = EConstructor.displayName || EConstructor.name; + + return FormattedError + + function FormattedError(format) { + if (format) { + format = formatter.apply(null, arguments); + } + + return new EConstructor(format) + } +} + +var fault = fault_1; + +var matters_1 = matters$1; + +var own$6 = {}.hasOwnProperty; + +var markers = { + yaml: '-', + toml: '+' +}; + +function matters$1(options) { + var results = []; + var index = -1; + var length; + + // One preset or matter. + if (typeof options === 'string' || !('length' in options)) { + options = [options]; + } + + length = options.length; + + while (++index < length) { + results[index] = matter(options[index]); + } + + return results +} + +function matter(option) { + var result = option; + + if (typeof result === 'string') { + if (!own$6.call(markers, result)) { + throw fault('Missing matter definition for `%s`', result) + } + + result = {type: result, marker: markers[result]}; + } else if (typeof result !== 'object') { + throw fault('Expected matter to be an object, not `%j`', result) + } + + if (!own$6.call(result, 'type')) { + throw fault('Missing `type` in matter `%j`', result) + } + + if (!own$6.call(result, 'fence') && !own$6.call(result, 'marker')) { + throw fault('Missing `marker` or `fence` in matter `%j`', result) + } + + return result +} + +var fence_1 = fence$2; + +function fence$2(matter, prop) { + var marker; + + if (matter.marker) { + marker = pick(matter.marker, prop); + return marker + marker + marker + } + + return pick(matter.fence, prop) +} + +function pick(schema, prop) { + return typeof schema === 'string' ? schema : schema[prop] +} + +var fence$1 = fence_1; + +var parse$3 = create$8; + +function create$8(matter) { + var name = matter.type + 'FrontMatter'; + var open = fence$1(matter, 'open'); + var close = fence$1(matter, 'close'); + var newline = '\n'; + var anywhere = matter.anywhere; + + frontmatter.displayName = name; + frontmatter.onlyAtStart = typeof anywhere === 'boolean' ? !anywhere : true; + + return [name, frontmatter] + + function frontmatter(eat, value, silent) { + var index = open.length; + var offset; + + if (value.slice(0, index) !== open || value.charAt(index) !== newline) { + return + } + + offset = value.indexOf(close, index); + + while (offset !== -1 && value.charAt(offset - 1) !== newline) { + index = offset + close.length; + offset = value.indexOf(close, index); + } + + if (offset !== -1) { + /* istanbul ignore if - never used (yet) */ + if (silent) { + return true + } + + return eat(value.slice(0, offset + close.length))({ + type: matter.type, + value: value.slice(open.length + 1, offset - 1) + }) + } + } +} + +var fence = fence_1; + +var compile$1 = create$7; + +function create$7(matter) { + var type = matter.type; + var open = fence(matter, 'open'); + var close = fence(matter, 'close'); + + frontmatter.displayName = type + 'FrontMatter'; + + return [type, frontmatter] + + function frontmatter(node) { + return open + (node.value ? '\n' + node.value : '') + '\n' + close + } +} + +var matters = matters_1; +var parse$2 = parse$3; +var compile = compile$1; + +var remarkFrontmatter = frontmatter; + +function frontmatter(options) { + var parser = this.Parser; + var compiler = this.Compiler; + var config = matters(options || ['yaml']); + + if (isRemarkParser(parser)) { + attachParser(parser, config); + } + + if (isRemarkCompiler(compiler)) { + attachCompiler(compiler, config); + } +} + +function attachParser(parser, matters) { + var proto = parser.prototype; + var tokenizers = wrap$6(parse$2, matters); + var names = []; + var key; + + for (key in tokenizers) { + names.push(key); + } + + proto.blockMethods = names.concat(proto.blockMethods); + proto.blockTokenizers = Object.assign({}, tokenizers, proto.blockTokenizers); +} + +function attachCompiler(compiler, matters) { + var proto = compiler.prototype; + proto.visitors = Object.assign({}, wrap$6(compile, matters), proto.visitors); +} + +function wrap$6(func, matters) { + var result = {}; + var length = matters.length; + var index = -1; + var tuple; + + while (++index < length) { + tuple = func(matters[index]); + result[tuple[0]] = tuple[1]; + } + + return result +} + +function isRemarkParser(parser) { + return Boolean(parser && parser.prototype && parser.prototype.blockTokenizers) +} + +function isRemarkCompiler(compiler) { + return Boolean(compiler && compiler.prototype && compiler.prototype.visitors) +} + +var extract_frontmatter = /*@__PURE__*/getDefaultExportFromCjs(remarkFrontmatter); + +var unistBuilder = u$b; + +function u$b(type, props, value) { + var node; + + if ( + (value === null || value === undefined) && + (typeof props !== 'object' || Array.isArray(props)) + ) { + value = props; + props = {}; + } + + node = Object.assign({type: String(type)}, props); + + if (Array.isArray(value)) { + node.children = value; + } else if (value !== null && value !== undefined) { + node.value = String(value); + } + + return node +} + +var start = factory$1('start'); +var end = factory$1('end'); + +var unistUtilPosition = position$2; + +position$2.start = start; +position$2.end = end; + +function position$2(node) { + return {start: start(node), end: end(node)} +} + +function factory$1(type) { + point.displayName = type; + + return point + + function point(node) { + var point = (node && node.position && node.position[type]) || {}; + + return { + line: point.line || null, + column: point.column || null, + offset: isNaN(point.offset) ? null : point.offset + } + } +} + +var unistUtilGenerated = generated$1; + +function generated$1(node) { + return ( + !node || + !node.position || + !node.position.start || + !node.position.start.line || + !node.position.start.column || + !node.position.end || + !node.position.end.line || + !node.position.end.column + ) +} + +var visit$2 = unistUtilVisit; + +var mdastUtilDefinitions = getDefinitionFactory; + +var own$5 = {}.hasOwnProperty; + +// Get a definition in `node` by `identifier`. +function getDefinitionFactory(node, options) { + return getterFactory(gather(node, options)) +} + +// Gather all definitions in `node` +function gather(node, options) { + var cache = {}; + + if (!node || !node.type) { + throw new Error('mdast-util-definitions expected node') + } + + visit$2(node, 'definition', options && options.commonmark ? commonmark : normal); + + return cache + + function commonmark(definition) { + var id = normalise(definition.identifier); + if (!own$5.call(cache, id)) { + cache[id] = definition; + } + } + + function normal(definition) { + cache[normalise(definition.identifier)] = definition; + } +} + +// Factory to get a node from the given definition-cache. +function getterFactory(cache) { + return getter + + // Get a node from the bound definition-cache. + function getter(identifier) { + var id = identifier && normalise(identifier); + return id && own$5.call(cache, id) ? cache[id] : null + } +} + +function normalise(identifier) { + return identifier.toUpperCase() +} + +var all_1$1; +var hasRequiredAll$1; + +function requireAll$1 () { + if (hasRequiredAll$1) return all_1$1; + hasRequiredAll$1 = 1; + + all_1$1 = all; + + var one = requireOne$1(); + + function all(h, parent) { + var nodes = parent.children || []; + var length = nodes.length; + var values = []; + var index = -1; + var result; + var head; + + while (++index < length) { + result = one(h, nodes[index], parent); + + if (result) { + if (index && nodes[index - 1].type === 'break') { + if (result.value) { + result.value = result.value.replace(/^\s+/, ''); + } + + head = result.children && result.children[0]; + + if (head && head.value) { + head.value = head.value.replace(/^\s+/, ''); + } + } + + values = values.concat(result); + } + } + + return values + } + return all_1$1; +} + +var one_1$1; +var hasRequiredOne$1; + +function requireOne$1 () { + if (hasRequiredOne$1) return one_1$1; + hasRequiredOne$1 = 1; + + one_1$1 = one; + + var u = unistBuilder; + var all = requireAll$1(); + + var own = {}.hasOwnProperty; + + // Transform an unknown node. + function unknown(h, node) { + if (text(node)) { + return h.augment(node, u('text', node.value)) + } + + return h(node, 'div', all(h, node)) + } + + // Visit a node. + function one(h, node, parent) { + var type = node && node.type; + var fn = own.call(h.handlers, type) ? h.handlers[type] : h.unknownHandler; + + // Fail on non-nodes. + if (!type) { + throw new Error('Expected node, got `' + node + '`') + } + + return (typeof fn === 'function' ? fn : unknown)(h, node, parent) + } + + // Check if the node should be renderered as a text node. + function text(node) { + var data = node.data || {}; + + if ( + own.call(data, 'hName') || + own.call(data, 'hProperties') || + own.call(data, 'hChildren') + ) { + return false + } + + return 'value' in node + } + return one_1$1; +} + +var thematicBreak_1 = thematicBreak$1; + +function thematicBreak$1(h, node) { + return h(node, 'hr') +} + +var wrap_1 = wrap$5; + +var u$a = unistBuilder; + +// Wrap `nodes` with line feeds between each entry. +// Optionally adds line feeds at the start and end. +function wrap$5(nodes, loose) { + var result = []; + var index = -1; + var length = nodes.length; + + if (loose) { + result.push(u$a('text', '\n')); + } + + while (++index < length) { + if (index) { + result.push(u$a('text', '\n')); + } + + result.push(nodes[index]); + } + + if (loose && nodes.length !== 0) { + result.push(u$a('text', '\n')); + } + + return result +} + +var list_1 = list$1; + +var wrap$4 = wrap_1; +var all$d = requireAll$1(); + +function list$1(h, node) { + var props = {}; + var name = node.ordered ? 'ol' : 'ul'; + var items; + var index = -1; + var length; + + if (typeof node.start === 'number' && node.start !== 1) { + props.start = node.start; + } + + items = all$d(h, node); + length = items.length; + + // Like GitHub, add a class for custom styling. + while (++index < length) { + if ( + items[index].properties.className && + items[index].properties.className.indexOf('task-list-item') !== -1 + ) { + props.className = ['contains-task-list']; + break + } + } + + return h(node, name, props, wrap$4(items, true)) +} + +var footer$1 = generateFootnotes; + +var thematicBreak = thematicBreak_1; +var list = list_1; +var wrap$3 = wrap_1; + +function generateFootnotes(h) { + var footnoteById = h.footnoteById; + var footnoteOrder = h.footnoteOrder; + var length = footnoteOrder.length; + var index = -1; + var listItems = []; + var def; + var backReference; + var content; + var tail; + + while (++index < length) { + def = footnoteById[footnoteOrder[index].toUpperCase()]; + + if (!def) { + continue + } + + content = def.children.concat(); + tail = content[content.length - 1]; + backReference = { + type: 'link', + url: '#fnref-' + def.identifier, + data: {hProperties: {className: ['footnote-backref']}}, + children: [{type: 'text', value: '↩'}] + }; + + if (!tail || tail.type !== 'paragraph') { + tail = {type: 'paragraph', children: []}; + content.push(tail); + } + + tail.children.push(backReference); + + listItems.push({ + type: 'listItem', + data: {hProperties: {id: 'fn-' + def.identifier}}, + children: content, + position: def.position + }); + } + + if (listItems.length === 0) { + return null + } + + return h( + null, + 'div', + {className: ['footnotes']}, + wrap$3( + [ + thematicBreak(h), + list(h, {type: 'list', ordered: true, children: listItems}) + ], + true + ) + ) +} + +var blockquote_1 = blockquote; + +var wrap$2 = wrap_1; +var all$c = requireAll$1(); + +function blockquote(h, node) { + return h(node, 'blockquote', wrap$2(all$c(h, node), true)) +} + +var _break = hardBreak; + +var u$9 = unistBuilder; + +function hardBreak(h, node) { + return [h(node, 'br'), u$9('text', '\n')] +} + +var code_1 = code; + +var u$8 = unistBuilder; + +function code(h, node) { + var value = node.value ? node.value + '\n' : ''; + var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); + var props = {}; + + if (lang) { + props.className = ['language-' + lang]; + } + + return h(node.position, 'pre', [h(node, 'code', props, [u$8('text', value)])]) +} + +var _delete = strikethrough; + +var all$b = requireAll$1(); + +function strikethrough(h, node) { + return h(node, 'del', all$b(h, node)) +} + +var emphasis_1 = emphasis; + +var all$a = requireAll$1(); + +function emphasis(h, node) { + return h(node, 'em', all$a(h, node)) +} + +var footnoteReference_1 = footnoteReference$1; + +var u$7 = unistBuilder; + +function footnoteReference$1(h, node) { + var footnoteOrder = h.footnoteOrder; + var identifier = String(node.identifier); + + if (footnoteOrder.indexOf(identifier) === -1) { + footnoteOrder.push(identifier); + } + + return h(node.position, 'sup', {id: 'fnref-' + identifier}, [ + h(node, 'a', {href: '#fn-' + identifier, className: ['footnote-ref']}, [ + u$7('text', node.label || identifier) + ]) + ]) +} + +var footnote_1 = footnote; + +var footnoteReference = footnoteReference_1; + +function footnote(h, node) { + var footnoteById = h.footnoteById; + var footnoteOrder = h.footnoteOrder; + var identifier = 1; + + while (identifier in footnoteById) { + identifier++; + } + + identifier = String(identifier); + + // No need to check if `identifier` exists in `footnoteOrder`, it’s guaranteed + // to not exist because we just generated it. + footnoteOrder.push(identifier); + + footnoteById[identifier] = { + type: 'footnoteDefinition', + identifier: identifier, + children: [{type: 'paragraph', children: node.children}], + position: node.position + }; + + return footnoteReference(h, { + type: 'footnoteReference', + identifier: identifier, + position: node.position + }) +} + +var heading_1 = heading; + +var all$9 = requireAll$1(); + +function heading(h, node) { + return h(node, 'h' + node.depth, all$9(h, node)) +} + +var html_1$1 = html$5; + +var u$6 = unistBuilder; + +// Return either a `raw` node in dangerous mode, otherwise nothing. +function html$5(h, node) { + return h.dangerous ? h.augment(node, u$6('raw', node.value)) : null +} + +var encodeCache = {}; + + +// Create a lookup array where anything but characters in `chars` string +// and alphanumeric chars is percent-encoded. +// +function getEncodeCache(exclude) { + var i, ch, cache = encodeCache[exclude]; + if (cache) { return cache; } + + cache = encodeCache[exclude] = []; + + for (i = 0; i < 128; i++) { + ch = String.fromCharCode(i); + + if (/^[0-9a-z]$/i.test(ch)) { + // always allow unencoded alphanumeric characters + cache.push(ch); + } else { + cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); + } + } + + for (i = 0; i < exclude.length; i++) { + cache[exclude.charCodeAt(i)] = exclude[i]; + } + + return cache; +} + + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +// +// - string - string to encode +// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) +// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) +// +function encode$1(string, exclude, keepEscaped) { + var i, l, code, nextCode, cache, + result = ''; + + if (typeof exclude !== 'string') { + // encode(string, keepEscaped) + keepEscaped = exclude; + exclude = encode$1.defaultChars; + } + + if (typeof keepEscaped === 'undefined') { + keepEscaped = true; + } + + cache = getEncodeCache(exclude); + + for (i = 0, l = string.length; i < l; i++) { + code = string.charCodeAt(i); + + if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { + if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { + result += string.slice(i, i + 3); + i += 2; + continue; + } + } + + if (code < 128) { + result += cache[code]; + continue; + } + + if (code >= 0xD800 && code <= 0xDFFF) { + if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { + nextCode = string.charCodeAt(i + 1); + if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { + result += encodeURIComponent(string[i] + string[i + 1]); + i++; + continue; + } + } + result += '%EF%BF%BD'; + continue; + } + + result += encodeURIComponent(string[i]); + } + + return result; +} + +encode$1.defaultChars = ";/?:@&=+$,-_.!~*'()#"; +encode$1.componentChars = "-_.!~*'()"; + + +var encode_1 = encode$1; + +var revert_1 = revert$2; + +var u$5 = unistBuilder; +var all$8 = requireAll$1(); + +// Return the content of a reference without definition as Markdown. +function revert$2(h, node) { + var subtype = node.referenceType; + var suffix = ']'; + var contents; + var head; + var tail; + + if (subtype === 'collapsed') { + suffix += '[]'; + } else if (subtype === 'full') { + suffix += '[' + (node.label || node.identifier) + ']'; + } + + if (node.type === 'imageReference') { + return u$5('text', '![' + node.alt + suffix) + } + + contents = all$8(h, node); + head = contents[0]; + + if (head && head.type === 'text') { + head.value = '[' + head.value; + } else { + contents.unshift(u$5('text', '[')); + } + + tail = contents[contents.length - 1]; + + if (tail && tail.type === 'text') { + tail.value += suffix; + } else { + contents.push(u$5('text', suffix)); + } + + return contents +} + +var imageReference_1 = imageReference; + +var normalize$6 = encode_1; +var revert$1 = revert_1; + +function imageReference(h, node) { + var def = h.definition(node.identifier); + var props; + + if (!def) { + return revert$1(h, node) + } + + props = {src: normalize$6(def.url || ''), alt: node.alt}; + + if (def.title !== null && def.title !== undefined) { + props.title = def.title; + } + + return h(node, 'img', props) +} + +var normalize$5 = encode_1; + +var image_1 = image$1; + +function image$1(h, node) { + var props = {src: normalize$5(node.url), alt: node.alt}; + + if (node.title !== null && node.title !== undefined) { + props.title = node.title; + } + + return h(node, 'img', props) +} + +var inlineCode_1 = inlineCode; + +var u$4 = unistBuilder; + +function inlineCode(h, node) { + var value = node.value.replace(/\r?\n|\r/g, ' '); + return h(node, 'code', [u$4('text', value)]) +} + +var linkReference_1 = linkReference; + +var normalize$4 = encode_1; +var revert = revert_1; +var all$7 = requireAll$1(); + +function linkReference(h, node) { + var def = h.definition(node.identifier); + var props; + + if (!def) { + return revert(h, node) + } + + props = {href: normalize$4(def.url || '')}; + + if (def.title !== null && def.title !== undefined) { + props.title = def.title; + } + + return h(node, 'a', props, all$7(h, node)) +} + +var normalize$3 = encode_1; +var all$6 = requireAll$1(); + +var link_1 = link; + +function link(h, node) { + var props = {href: normalize$3(node.url)}; + + if (node.title !== null && node.title !== undefined) { + props.title = node.title; + } + + return h(node, 'a', props, all$6(h, node)) +} + +var listItem_1 = listItem$1; + +var u$3 = unistBuilder; +var all$5 = requireAll$1(); + +function listItem$1(h, node, parent) { + var result = all$5(h, node); + var head = result[0]; + var loose = parent ? listLoose(parent) : listItemLoose(node); + var props = {}; + var wrapped = []; + var length; + var index; + var child; + + if (typeof node.checked === 'boolean') { + if (!head || head.tagName !== 'p') { + head = h(null, 'p', []); + result.unshift(head); + } + + if (head.children.length !== 0) { + head.children.unshift(u$3('text', ' ')); + } + + head.children.unshift( + h(null, 'input', { + type: 'checkbox', + checked: node.checked, + disabled: true + }) + ); + + // According to github-markdown-css, this class hides bullet. + // See: . + props.className = ['task-list-item']; + } + + length = result.length; + index = -1; + + while (++index < length) { + child = result[index]; + + // Add eols before nodes, except if this is a loose, first paragraph. + if (loose || index !== 0 || child.tagName !== 'p') { + wrapped.push(u$3('text', '\n')); + } + + if (child.tagName === 'p' && !loose) { + wrapped = wrapped.concat(child.children); + } else { + wrapped.push(child); + } + } + + // Add a final eol. + if (length && (loose || child.tagName !== 'p')) { + wrapped.push(u$3('text', '\n')); + } + + return h(node, 'li', props, wrapped) +} + +function listLoose(node) { + var loose = node.spread; + var children = node.children; + var length = children.length; + var index = -1; + + while (!loose && ++index < length) { + loose = listItemLoose(children[index]); + } + + return loose +} + +function listItemLoose(node) { + var spread = node.spread; + + return spread === undefined || spread === null + ? node.children.length > 1 + : spread +} + +var paragraph_1 = paragraph; + +var all$4 = requireAll$1(); + +function paragraph(h, node) { + return h(node, 'p', all$4(h, node)) +} + +var root_1 = root; + +var u$2 = unistBuilder; +var wrap$1 = wrap_1; +var all$3 = requireAll$1(); + +function root(h, node) { + return h.augment(node, u$2('root', wrap$1(all$3(h, node)))) +} + +var strong_1 = strong; + +var all$2 = requireAll$1(); + +function strong(h, node) { + return h(node, 'strong', all$2(h, node)) +} + +var table_1 = table; + +var position$1 = unistUtilPosition; +var wrap = wrap_1; +var all$1 = requireAll$1(); + +function table(h, node) { + var rows = node.children; + var index = rows.length; + var align = node.align || []; + var alignLength = align.length; + var result = []; + var pos; + var row; + var out; + var name; + var cell; + + while (index--) { + row = rows[index].children; + name = index === 0 ? 'th' : 'td'; + pos = alignLength || row.length; + out = []; + + while (pos--) { + cell = row[pos]; + out[pos] = h(cell, name, {align: align[pos]}, cell ? all$1(h, cell) : []); + } + + result[index] = h(rows[index], 'tr', wrap(out, true)); + } + + return h( + node, + 'table', + wrap( + [h(result[0].position, 'thead', wrap([result[0]], true))].concat( + result[1] + ? h( + { + start: position$1.start(result[1]), + end: position$1.end(result[result.length - 1]) + }, + 'tbody', + wrap(result.slice(1), true) + ) + : [] + ), + true + ) + ) +} + +var text_1$1 = text$1; + +var u$1 = unistBuilder; + +function text$1(h, node) { + return h.augment( + node, + u$1('text', String(node.value).replace(/[ \t]*(\r?\n|\r)[ \t]*/g, '$1')) + ) +} + +var handlers$1 = { + blockquote: blockquote_1, + break: _break, + code: code_1, + delete: _delete, + emphasis: emphasis_1, + footnoteReference: footnoteReference_1, + footnote: footnote_1, + heading: heading_1, + html: html_1$1, + imageReference: imageReference_1, + image: image_1, + inlineCode: inlineCode_1, + linkReference: linkReference_1, + link: link_1, + listItem: listItem_1, + list: list_1, + paragraph: paragraph_1, + root: root_1, + strong: strong_1, + table: table_1, + text: text_1$1, + thematicBreak: thematicBreak_1, + toml: ignore, + yaml: ignore, + definition: ignore, + footnoteDefinition: ignore +}; + +// Return nothing for nodes that are ignored. +function ignore() { + return null +} + +var lib$2 = toHast; + +var u = unistBuilder; +var visit$1 = unistUtilVisit; +var position = unistUtilPosition; +var generated = unistUtilGenerated; +var definitions = mdastUtilDefinitions; +var one$2 = requireOne$1(); +var footer = footer$1; +var handlers = handlers$1; + +var own$4 = {}.hasOwnProperty; + +var deprecationWarningIssued = false; + +// Factory to transform. +function factory(tree, options) { + var settings = options || {}; + + // Issue a warning if the deprecated tag 'allowDangerousHTML' is used + if (settings.allowDangerousHTML !== undefined && !deprecationWarningIssued) { + deprecationWarningIssued = true; + console.warn( + 'mdast-util-to-hast: deprecation: `allowDangerousHTML` is nonstandard, use `allowDangerousHtml` instead' + ); + } + + var dangerous = settings.allowDangerousHtml || settings.allowDangerousHTML; + var footnoteById = {}; + + h.dangerous = dangerous; + h.definition = definitions(tree, settings); + h.footnoteById = footnoteById; + h.footnoteOrder = []; + h.augment = augment; + h.handlers = Object.assign({}, handlers, settings.handlers); + h.unknownHandler = settings.unknownHandler; + + visit$1(tree, 'footnoteDefinition', onfootnotedefinition); + + return h + + // Finalise the created `right`, a hast node, from `left`, an mdast node. + function augment(left, right) { + var data; + var ctx; + + // Handle `data.hName`, `data.hProperties, `data.hChildren`. + if (left && 'data' in left) { + data = left.data; + + if (right.type === 'element' && data.hName) { + right.tagName = data.hName; + } + + if (right.type === 'element' && data.hProperties) { + right.properties = Object.assign({}, right.properties, data.hProperties); + } + + if (right.children && data.hChildren) { + right.children = data.hChildren; + } + } + + ctx = left && left.position ? left : {position: left}; + + if (!generated(ctx)) { + right.position = { + start: position.start(ctx), + end: position.end(ctx) + }; + } + + return right + } + + // Create an element for `node`. + function h(node, tagName, props, children) { + if ( + (children === undefined || children === null) && + typeof props === 'object' && + 'length' in props + ) { + children = props; + props = {}; + } + + return augment(node, { + type: 'element', + tagName: tagName, + properties: props || {}, + children: children || [] + }) + } + + function onfootnotedefinition(definition) { + var id = String(definition.identifier).toUpperCase(); + + // Mimick CM behavior of link definitions. + // See: . + if (!own$4.call(footnoteById, id)) { + footnoteById[id] = definition; + } + } +} + +// Transform `tree`, which is an mdast node, to a hast node. +function toHast(tree, options) { + var h = factory(tree, options); + var node = one$2(h, tree); + var foot = footer(h); + + if (foot) { + node.children = node.children.concat(u('text', '\n'), foot); + } + + return node +} + +var mdastUtilToHast = lib$2; + +var mdast2hast = mdastUtilToHast; + +var remarkRehype = remark2rehype; + +// Attacher. +// If a destination is given, runs the destination with the new hast tree +// (bridge mode). +// Without destination, returns the tree: further plugins run on that tree +// (mutate mode). +function remark2rehype(destination, options) { + if (destination && !destination.process) { + options = destination; + destination = null; + } + + return destination ? bridge(destination, options) : mutate(options) +} + +// Bridge mode. +// Runs the destination with the new hast tree. +function bridge(destination, options) { + return transformer + + function transformer(node, file, next) { + destination.run(mdast2hast(node, options), file, done); + + function done(err) { + next(err); + } + } +} + +// Mutate-mode. +// Further transformers run on the hast tree. +function mutate(options) { + return transformer + + function transformer(node) { + return mdast2hast(node, options) + } +} + +var remark2rehype$1 = /*@__PURE__*/getDefaultExportFromCjs(remarkRehype); + +var schema$1 = Schema$8; + +var proto$2 = Schema$8.prototype; + +proto$2.space = null; +proto$2.normal = {}; +proto$2.property = {}; + +function Schema$8(property, normal, space) { + this.property = property; + this.normal = normal; + + if (space) { + this.space = space; + } +} + +var xtend = immutable; +var Schema$7 = schema$1; + +var merge_1 = merge$3; + +function merge$3(definitions) { + var length = definitions.length; + var property = []; + var normal = []; + var index = -1; + var info; + var space; + + while (++index < length) { + info = definitions[index]; + property.push(info.property); + normal.push(info.normal); + space = info.space; + } + + return new Schema$7( + xtend.apply(null, property), + xtend.apply(null, normal), + space + ) +} + +var normalize_1 = normalize$2; + +function normalize$2(value) { + return value.toLowerCase() +} + +var info = Info$2; + +var proto$1 = Info$2.prototype; + +proto$1.space = null; +proto$1.attribute = null; +proto$1.property = null; +proto$1.boolean = false; +proto$1.booleanish = false; +proto$1.overloadedBoolean = false; +proto$1.number = false; +proto$1.commaSeparated = false; +proto$1.spaceSeparated = false; +proto$1.commaOrSpaceSeparated = false; +proto$1.mustUseProperty = false; +proto$1.defined = false; + +function Info$2(property, attribute) { + this.property = property; + this.attribute = attribute; +} + +var types$4 = {}; + +var powers = 0; + +types$4.boolean = increment(); +types$4.booleanish = increment(); +types$4.overloadedBoolean = increment(); +types$4.number = increment(); +types$4.spaceSeparated = increment(); +types$4.commaSeparated = increment(); +types$4.commaOrSpaceSeparated = increment(); + +function increment() { + return Math.pow(2, ++powers) +} + +var Info$1 = info; +var types$3 = types$4; + +var definedInfo = DefinedInfo$2; + +DefinedInfo$2.prototype = new Info$1(); +DefinedInfo$2.prototype.defined = true; + +var checks = [ + 'boolean', + 'booleanish', + 'overloadedBoolean', + 'number', + 'commaSeparated', + 'spaceSeparated', + 'commaOrSpaceSeparated' +]; +var checksLength = checks.length; + +function DefinedInfo$2(property, attribute, mask, space) { + var index = -1; + var check; + + mark$1(this, 'space', space); + + Info$1.call(this, property, attribute); + + while (++index < checksLength) { + check = checks[index]; + mark$1(this, check, (mask & types$3[check]) === types$3[check]); + } +} + +function mark$1(values, key, value) { + if (value) { + values[key] = value; + } +} + +var normalize$1 = normalize_1; +var Schema$6 = schema$1; +var DefinedInfo$1 = definedInfo; + +var create_1 = create$6; + +function create$6(definition) { + var space = definition.space; + var mustUseProperty = definition.mustUseProperty || []; + var attributes = definition.attributes || {}; + var props = definition.properties; + var transform = definition.transform; + var property = {}; + var normal = {}; + var prop; + var info; + + for (prop in props) { + info = new DefinedInfo$1( + prop, + transform(attributes, prop), + props[prop], + space + ); + + if (mustUseProperty.indexOf(prop) !== -1) { + info.mustUseProperty = true; + } + + property[prop] = info; + + normal[normalize$1(prop)] = prop; + normal[normalize$1(info.attribute)] = prop; + } + + return new Schema$6(property, normal, space) +} + +var create$5 = create_1; + +var xlink$2 = create$5({ + space: 'xlink', + transform: xlinkTransform, + properties: { + xLinkActuate: null, + xLinkArcRole: null, + xLinkHref: null, + xLinkRole: null, + xLinkShow: null, + xLinkTitle: null, + xLinkType: null + } +}); + +function xlinkTransform(_, prop) { + return 'xlink:' + prop.slice(5).toLowerCase() +} + +var create$4 = create_1; + +var xml$2 = create$4({ + space: 'xml', + transform: xmlTransform, + properties: { + xmlLang: null, + xmlBase: null, + xmlSpace: null + } +}); + +function xmlTransform(_, prop) { + return 'xml:' + prop.slice(3).toLowerCase() +} + +var caseSensitiveTransform_1 = caseSensitiveTransform$2; + +function caseSensitiveTransform$2(attributes, attribute) { + return attribute in attributes ? attributes[attribute] : attribute +} + +var caseSensitiveTransform$1 = caseSensitiveTransform_1; + +var caseInsensitiveTransform_1 = caseInsensitiveTransform$2; + +function caseInsensitiveTransform$2(attributes, property) { + return caseSensitiveTransform$1(attributes, property.toLowerCase()) +} + +var create$3 = create_1; +var caseInsensitiveTransform$1 = caseInsensitiveTransform_1; + +var xmlns$2 = create$3({ + space: 'xmlns', + attributes: { + xmlnsxlink: 'xmlns:xlink' + }, + transform: caseInsensitiveTransform$1, + properties: { + xmlns: null, + xmlnsXLink: null + } +}); + +var types$2 = types$4; +var create$2 = create_1; + +var booleanish$1 = types$2.booleanish; +var number$2 = types$2.number; +var spaceSeparated$2 = types$2.spaceSeparated; + +var aria$2 = create$2({ + transform: ariaTransform, + properties: { + ariaActiveDescendant: null, + ariaAtomic: booleanish$1, + ariaAutoComplete: null, + ariaBusy: booleanish$1, + ariaChecked: booleanish$1, + ariaColCount: number$2, + ariaColIndex: number$2, + ariaColSpan: number$2, + ariaControls: spaceSeparated$2, + ariaCurrent: null, + ariaDescribedBy: spaceSeparated$2, + ariaDetails: null, + ariaDisabled: booleanish$1, + ariaDropEffect: spaceSeparated$2, + ariaErrorMessage: null, + ariaExpanded: booleanish$1, + ariaFlowTo: spaceSeparated$2, + ariaGrabbed: booleanish$1, + ariaHasPopup: null, + ariaHidden: booleanish$1, + ariaInvalid: null, + ariaKeyShortcuts: null, + ariaLabel: null, + ariaLabelledBy: spaceSeparated$2, + ariaLevel: number$2, + ariaLive: null, + ariaModal: booleanish$1, + ariaMultiLine: booleanish$1, + ariaMultiSelectable: booleanish$1, + ariaOrientation: null, + ariaOwns: spaceSeparated$2, + ariaPlaceholder: null, + ariaPosInSet: number$2, + ariaPressed: booleanish$1, + ariaReadOnly: booleanish$1, + ariaRelevant: null, + ariaRequired: booleanish$1, + ariaRoleDescription: spaceSeparated$2, + ariaRowCount: number$2, + ariaRowIndex: number$2, + ariaRowSpan: number$2, + ariaSelected: booleanish$1, + ariaSetSize: number$2, + ariaSort: null, + ariaValueMax: number$2, + ariaValueMin: number$2, + ariaValueNow: number$2, + ariaValueText: null, + role: null + } +}); + +function ariaTransform(_, prop) { + return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase() +} + +var types$1 = types$4; +var create$1 = create_1; +var caseInsensitiveTransform = caseInsensitiveTransform_1; + +var boolean$1 = types$1.boolean; +var overloadedBoolean = types$1.overloadedBoolean; +var booleanish = types$1.booleanish; +var number$1 = types$1.number; +var spaceSeparated$1 = types$1.spaceSeparated; +var commaSeparated$1 = types$1.commaSeparated; + +var html$4 = create$1({ + space: 'html', + attributes: { + acceptcharset: 'accept-charset', + classname: 'class', + htmlfor: 'for', + httpequiv: 'http-equiv' + }, + transform: caseInsensitiveTransform, + mustUseProperty: ['checked', 'multiple', 'muted', 'selected'], + properties: { + // Standard Properties. + abbr: null, + accept: commaSeparated$1, + acceptCharset: spaceSeparated$1, + accessKey: spaceSeparated$1, + action: null, + allow: null, + allowFullScreen: boolean$1, + allowPaymentRequest: boolean$1, + allowUserMedia: boolean$1, + alt: null, + as: null, + async: boolean$1, + autoCapitalize: null, + autoComplete: spaceSeparated$1, + autoFocus: boolean$1, + autoPlay: boolean$1, + capture: boolean$1, + charSet: null, + checked: boolean$1, + cite: null, + className: spaceSeparated$1, + cols: number$1, + colSpan: null, + content: null, + contentEditable: booleanish, + controls: boolean$1, + controlsList: spaceSeparated$1, + coords: number$1 | commaSeparated$1, + crossOrigin: null, + data: null, + dateTime: null, + decoding: null, + default: boolean$1, + defer: boolean$1, + dir: null, + dirName: null, + disabled: boolean$1, + download: overloadedBoolean, + draggable: booleanish, + encType: null, + enterKeyHint: null, + form: null, + formAction: null, + formEncType: null, + formMethod: null, + formNoValidate: boolean$1, + formTarget: null, + headers: spaceSeparated$1, + height: number$1, + hidden: boolean$1, + high: number$1, + href: null, + hrefLang: null, + htmlFor: spaceSeparated$1, + httpEquiv: spaceSeparated$1, + id: null, + imageSizes: null, + imageSrcSet: commaSeparated$1, + inputMode: null, + integrity: null, + is: null, + isMap: boolean$1, + itemId: null, + itemProp: spaceSeparated$1, + itemRef: spaceSeparated$1, + itemScope: boolean$1, + itemType: spaceSeparated$1, + kind: null, + label: null, + lang: null, + language: null, + list: null, + loop: boolean$1, + low: number$1, + manifest: null, + max: null, + maxLength: number$1, + media: null, + method: null, + min: null, + minLength: number$1, + multiple: boolean$1, + muted: boolean$1, + name: null, + nonce: null, + noModule: boolean$1, + noValidate: boolean$1, + onAbort: null, + onAfterPrint: null, + onAuxClick: null, + onBeforePrint: null, + onBeforeUnload: null, + onBlur: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onContextMenu: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnded: null, + onError: null, + onFocus: null, + onFormData: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLanguageChange: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadEnd: null, + onLoadStart: null, + onMessage: null, + onMessageError: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRejectionHandled: null, + onReset: null, + onResize: null, + onScroll: null, + onSecurityPolicyViolation: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onSlotChange: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnhandledRejection: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onWheel: null, + open: boolean$1, + optimum: number$1, + pattern: null, + ping: spaceSeparated$1, + placeholder: null, + playsInline: boolean$1, + poster: null, + preload: null, + readOnly: boolean$1, + referrerPolicy: null, + rel: spaceSeparated$1, + required: boolean$1, + reversed: boolean$1, + rows: number$1, + rowSpan: number$1, + sandbox: spaceSeparated$1, + scope: null, + scoped: boolean$1, + seamless: boolean$1, + selected: boolean$1, + shape: null, + size: number$1, + sizes: null, + slot: null, + span: number$1, + spellCheck: booleanish, + src: null, + srcDoc: null, + srcLang: null, + srcSet: commaSeparated$1, + start: number$1, + step: null, + style: null, + tabIndex: number$1, + target: null, + title: null, + translate: null, + type: null, + typeMustMatch: boolean$1, + useMap: null, + value: booleanish, + width: number$1, + wrap: null, + + // Legacy. + // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis + align: null, // Several. Use CSS `text-align` instead, + aLink: null, // ``. Use CSS `a:active {color}` instead + archive: spaceSeparated$1, // ``. List of URIs to archives + axis: null, // `` and ``. Use `scope` on `` + background: null, // ``. Use CSS `background-image` instead + bgColor: null, // `` and table elements. Use CSS `background-color` instead + border: number$1, // ``. Use CSS `border-width` instead, + borderColor: null, // `
    `. Use CSS `border-color` instead, + bottomMargin: number$1, // `` + cellPadding: null, // `
    ` + cellSpacing: null, // `
    ` + char: null, // Several table elements. When `align=char`, sets the character to align on + charOff: null, // Several table elements. When `char`, offsets the alignment + classId: null, // `` + clear: null, // `
    `. Use CSS `clear` instead + code: null, // `` + codeBase: null, // `` + codeType: null, // `` + color: null, // `` and `
    `. Use CSS instead + compact: boolean$1, // Lists. Use CSS to reduce space between items instead + declare: boolean$1, // `` + event: null, // `${newline}`, + }); + } else if (import_script) { + instance[0].value = (instance[0].value ).replace( + RE_SCRIPT, + `$1${newline}\t${import_script}` + ); + } + + // inject the frontmatter into the module script if there is any, reusing the existing module script if one exists + if (!_module[0] && fm) { + _module.push({ + type: 'raw', + value: ``, + }); + } else if (fm) { + // @ts-ignore + _module[0].value = _module[0].value.replace( + RE_MODULE_SCRIPT, + (match) => `${match}${newline}\t${fm}` + ); + } + + // smoosh it all together in an order that makes sense, + // if using a layout we only wrap the html and nothing else + //@ts-ignore + node.children = [ + //@ts-ignore + ..._module, + //@ts-ignore + { type: 'raw', value: _module[0] ? newline : '' }, + //@ts-ignore + ...instance, + //@ts-ignore + { type: 'raw', value: instance[0] ? newline : '' }, + //@ts-ignore + ...css, + //@ts-ignore + { type: 'raw', value: css[0] ? newline : '' }, + //@ts-ignore + ...special, + //@ts-ignore + { type: 'raw', value: special[0] ? newline : '' }, + + { + //@ts-ignore + type: 'raw', + value: import_script + ? `` + : '', + }, + //@ts-ignore + { type: 'raw', value: newline }, + //@ts-ignore + ...html, + //@ts-ignore + { type: 'raw', value: newline }, + //@ts-ignore + { type: 'raw', value: import_script ? '' : '' }, + ]; + }); + }; +} + +// highlighting stuff + +// { [lang]: { path, deps: pointer to key } } +const langs = {}; +let Prism; + +const make_path = (base_path, id) => + base_path.replace('{id}', id); + +// we need to get all language metadata +// also track if they depend on other languages so we can autoload without breaking +// i don't actually know what the require key means but it sounds important + +function get_lang_info( + name, + lang_meta, + base_path +) { + const _lang_meta = { + name, + path: `prismjs/${make_path(base_path, name)}`, + deps: new Set(), + }; + + const aliases = new Set(); + + // TODO: DRY this up, it is literally identical + + if (lang_meta.require) { + if (Array.isArray(lang_meta.require)) { + lang_meta.require.forEach((id) => _lang_meta.deps.add(id)); + } else { + _lang_meta.deps.add(lang_meta.require); + } + } + + if (lang_meta.peerDependencies) { + if (Array.isArray(lang_meta.peerDependencies)) { + lang_meta.peerDependencies.forEach((id) => _lang_meta.deps.add(id)); + } else { + _lang_meta.deps.add(lang_meta.peerDependencies); + } + } + + if (lang_meta.alias) { + if (Array.isArray(lang_meta.alias)) { + lang_meta.alias.forEach((id) => aliases.add(id)); + } else { + aliases.add(lang_meta.alias); + } + } + + return [{ ..._lang_meta, aliases }, aliases]; +} + +// workaround for ts weirdness - intersection types work better with interfaces vs object literals + + + + +async function load_language_metadata() { + const mod = await import( + //@ts-ignore + './components-B2tMXTPO.js' + ).then(function (n) { return n.c; }); + + // @ts-ignore + const languages = mod.languages || mod.default.languages; + // @ts-ignore + const meta = languages.meta; + + for (const lang in languages) { + const [lang_info, aliases] = get_lang_info( + lang, + // @ts-ignore + languages[lang], + meta.path + ); + + langs[lang] = lang_info; + aliases.forEach((_n) => { + langs[_n] = langs[lang]; + }); + } + + const svelte_meta = { + name: 'svelte', + aliases: new Set(['sv']), + path: 'prism-svelte', + deps: new Set(['javscript', 'css']), + }; + + langs.svelte = svelte_meta; + langs.sv = svelte_meta; +} + +async function load_language(lang) { + if (!langs[lang]) return; + + await Promise.all( + Array.from(langs[lang].deps).map(async (name) => await load_language(name)) + ); + try { + await import(/* @vite-ignore */ langs[lang].path); + } catch (e) { + try { + await import(/* @vite-ignore */ langs[lang].path + '.js'); + } catch (e) { + console.log('failed to load language', lang); + } + } +} + +function highlight_blocks({ + highlighter: highlight_fn, + alias, + optimise = true, +} + + + + = {}) { + let pending_langs; + let processed_langs = false; + if (highlight_fn) { + pending_langs = load_language_metadata(); + } + + return async function (tree, vFile) { + if (highlight_fn) { + if (!processed_langs) { + await pending_langs; + if (alias) { + for (const lang in alias) { + langs[lang] = langs[alias[lang]]; + } + } + processed_langs = true; + } + const nodes = []; + visit$6(tree, 'code', (node) => { + nodes.push(node); + }); + + await Promise.all( + nodes.map(async (node) => { + (node ).type = 'html'; + node.value = await highlight_fn( + node.value, + (node ).lang, + (node ).meta, + //@ts-ignore + vFile.filename, + optimise + ); + }) + ); + } + }; +} +// escape curlies, backtick, \t, \r, \n to avoid breaking output of {@html `here`} in .svelte +const escape_svelty = (str) => + str + .replace( + /[{}`]/g, + //@ts-ignore + (c) => ({ '{': '{', '}': '}', '`': '`' }[c]) + ) + .replace(/\\([trn])/g, '\$1'); + +const code_highlight = async ( + code, + lang, + _meta, + _filename, + optimise +) => { + const normalised_lang = _optionalChain([lang, 'optionalAccess', _ => _.toLowerCase, 'call', _2 => _2()]); + let _lang = !!normalised_lang && langs[normalised_lang]; + //@ts-ignore + if (!Prism) Prism = await import('./prism-Cz3w-km1.js').then(function (n) { return n.p; }); + + let status = 'loading'; + if (_lang && !Prism.languages[_lang.name]) { + try { + await load_language(_lang.name); + status = 'loaded'; + } catch (e) { + status = 'failed'; + } + } + + if ( + !_lang && + normalised_lang && + Prism.languages[normalised_lang] && + status === 'loaded' + ) { + langs[normalised_lang] = { name: lang } ; + _lang = langs[normalised_lang]; + } + const highlighted = escape_svelty( + _lang && Prism.languages[_lang.name] + ? Prism.highlight(code, Prism.languages[_lang.name], _lang.name) + : escape(code) + ); + return optimise + ? `
    {@html \`${highlighted}\`}
    ` + : `
    ${highlighted}
    `; +}; + +const is_browser = typeof window !== 'undefined'; + +function stringify( options = {}) { + this.Compiler = compiler; + + function compiler(tree) { + return hast_to_html(tree, options); + } +} + +const apply_plugins = (plugins, parser) => { + (plugins ).forEach((plugin) => { + if (Array.isArray(plugin)) { + if (plugin[1] && plugin[1]) parser.use(plugin[0], plugin[1]); + else parser.use(plugin[0]); + } else { + parser.use(plugin); + } + }); + + return parser; +}; + +function transform( + { + remarkPlugins = [], + rehypePlugins = [], + frontmatter, + smartypants, + highlight, + } = {} +) + + { + const fm_opts = frontmatter + ? frontmatter + : { parse: default_frontmatter, type: 'yaml', marker: '-' }; + const toMDAST = unified$3() + .use(markdown) + .use(mdsvex_parser) + .use(external, { target: false, rel: ['nofollow'] }) + .use(escape_brackets) + .use(escape_code, { blocks: !!highlight }) + .use(extract_frontmatter, [{ type: fm_opts.type, marker: fm_opts.marker }]) + .use(parse_frontmatter, { parse: fm_opts.parse, type: fm_opts.type }); + + if (smartypants) { + toMDAST.use( + smartypants_transformer, + typeof smartypants === 'boolean' ? {} : smartypants + ); + } + + apply_plugins(remarkPlugins, toMDAST).use(highlight_blocks, highlight || {}); + + const toHAST = toMDAST.use(remark2rehype$1, { + // @ts-ignore + allowDangerousHtml: true, + allowDangerousCharacters: true, + }); + + apply_plugins(rehypePlugins, toHAST); + + const processor = toHAST.use(stringify, { + allowDangerousHtml: true, + allowDangerousCharacters: true, + }) + +; + + processor.add_layouts = (layout, layout_mode) => { + processor.use(transform_hast, { layout: layout, layout_mode }); + }; + + return processor; +} + +const defaults = { + remarkPlugins: [], + rehypePlugins: [], + smartypants: true, + extension: '.svx', + highlight: { highlighter: code_highlight, optimise: true }, +}; + +function to_posix(_path) { + const isExtendedLengthPath = /^\\\\\?\\/.test(_path); + const hasNonAscii = /[^\u0000-\u0080]+/.test(_path); + + if (isExtendedLengthPath || hasNonAscii) { + return _path; + } + + return _path.replace(/\\/g, '/'); +} + +// let _require: any; + +async function resolve_layout(layout_path) { + if (is_browser) { + // In browser environments, we can't resolve file paths + // Return the path as-is or handle differently based on your needs + return to_posix(layout_path); + } + + try { + return to_posix(layout_path); + } catch (e) { + const path = await import('path'); + + try { + const _path = path.join(process.cwd(), layout_path); + return to_posix(_path); + } catch (e) { + throw new Error( + `The layout path you provided couldn't be found at either ${layout_path} or ${path.join( + process.cwd(), + layout_path + )}. Please double-check it and try again.` + ); + } + } +} + +// handle custom components + +async function process_layouts(layouts) { + if (is_browser) { + // In browser environments, we can't read the file system + // Return layouts as-is without processing + return layouts; + } + + const _layouts = layouts; + + for (const key in _layouts) { + const fs = await import('fs'); + const layout = fs.readFileSync(_layouts[key].path, { encoding: 'utf8' }); + let ast; + try { + ast = parse$7(layout); + } catch (e) { + throw new Error((e ).toString() + `\n at ${_layouts[key].path}`); + } + + if (ast.module) { + const component_exports = ast.module.content.body.filter( + (node) => node.type === 'ExportNamedDeclaration' + ) ; + + if (component_exports.length) { + _layouts[key].components = []; + + for (let i = 0; i < component_exports.length; i++) { + if ( + component_exports[i].specifiers && + component_exports[i].specifiers.length + ) { + for (let j = 0; j < component_exports[i].specifiers.length; j++) { + _layouts[key].components.push( + component_exports[i].specifiers[j].exported.name + ); + } + //@ts-ignore + } else if (component_exports[i].declaration.declarations) { + //@ts-ignore + const declarations = component_exports[i].declaration.declarations; + + for (let j = 0; j < declarations.length; j++) { + _layouts[key].components.push(declarations[j].id.name); + } + } else if (component_exports[i].declaration) { + _layouts[key].components.push( + //@ts-ignore + component_exports[i].declaration.id.name + ); + } + } + } + } + } + return _layouts; +} + +/** + * The svelte preprocessor for use with svelte.preprocess + * + * **options** - An options object with the following properties, all are optional. + * + * - `extension` - The extension to use for mdsvex files + * - `extensions` - The extensions to use for mdsvex files + * - `layout` - Layouts to apply to mdsvex documents + * - `frontmatter` - frontmatter options for documents + * - `highlight` - syntax highlighting options + * - `smartypants` - smart typography options + * - `remarkPlugins` - remark plugins to apply to the markdown + * - `rehypePlugins` - rehype plugins to apply to the rendered html + * + */ + +const mdsvex = (options = defaults) => { + let { + remarkPlugins = [], + rehypePlugins = [], + smartypants = true, + extension = '.svx', + extensions, + layout = false, + highlight = { highlighter: code_highlight, optimise: true }, + frontmatter, + } = options; + + if (highlight === undefined) { + highlight = { highlighter: code_highlight, optimise: true }; + } else if (highlight) { + highlight = { + highlighter: code_highlight, + optimise: true, + ...highlight, + }; + } + + //@ts-ignore + if (options.layouts) { + throw new Error( + `mdsvex: "layouts" is not a valid option. Did you mean "layout"?` + ); + } + + const unknown_opts = []; + const known_opts = [ + 'filename', + 'remarkPlugins', + 'rehypePlugins', + 'smartypants', + 'extension', + 'extensions', + 'layout', + 'highlight', + 'frontmatter', + ]; + + for (const opt in options) { + if (!known_opts.includes(opt)) unknown_opts.push(opt); + } + + if (unknown_opts.length) { + console.warn( + `mdsvex: Received unknown options: ${unknown_opts.join( + ', ' + )}. Valid options are: ${known_opts.join(', ')}.` + ); + } + + let layouts_processed = undefined; + + const parser = transform({ + remarkPlugins, + rehypePlugins, + smartypants, + highlight, + frontmatter, + }); + + return { + name: 'mdsvex', + markup: async ({ content, filename }) => { + let _layout = {}; + let layout_mode = 'single'; + + // if `layout_processed` is undefined, we need to process the layouts + if (!layouts_processed && !is_browser) { + let resolve; + // set `layout_processed` before the first await to prevent race conditions + layouts_processed = new Promise((r) => (resolve = r)); + await handle_path(); + if (typeof layout === 'string') { + _layout.__mdsvex_default = { + path: await resolve_layout(layout), + components: [], + }; + } else if (typeof layout === 'object') { + layout_mode = 'named'; + for (const name in layout) { + _layout[name] = { + path: await resolve_layout(layout[name]), + components: [], + }; + } + } + _layout = await process_layouts(_layout); + parser.add_layouts(_layout, layout_mode); + // resolve the `layout_processed` promise to unlock the rest of the file + // that are waiting before calling parser.process + resolve(); + } + + if (highlight && highlight.highlighter === undefined) { + highlight.highlighter = code_highlight; + } + + const extensionsParts = (extensions || [extension]).map((ext) => + ext.startsWith('.') ? ext : '.' + ext + ); + if (!extensionsParts.some((ext) => filename && filename.endsWith(ext))) return; + + // before calling parser.process, we need to wait for the layouts to be processed + // or else the parser will be frozen + await layouts_processed; + const parsed = await parser.process({ contents: content, filename }); + return { + code: parsed.contents , + data: parsed.data , + map: '', + }; + }, + }; +}; + +/** + * The standalone compile function. + * + * - **source** - the source code to convert. + * - **options** - An options object with the following properties, all are optional. + * + * - `filename` - The filename of the generated file + * - `extension` - The extension to use for mdsvex files + * - `extensions` - The extensions to use for mdsvex files + * - `layout` - Layouts to apply to mdsvex documents + * - `frontmatter` - frontmatter options for documents + * - `highlight` - syntax highlighting options + * - `smartypants` - smart typography options + * - `remarkPlugins` - remark plugins to apply to the markdown + * - `rehypePlugins` - rehype plugins to apply to the rendered html + */ + +const _compile = async ( + source, + opts +) => { + if (is_browser) { + // @ts-ignore + globalThis.process = make_process(); + } + + const preprocessor = mdsvex(opts); + return preprocessor.markup({ + content: source, + filename: + (opts && opts.filename) || + `file${ + (opts && ((opts.extensions && opts.extensions[0]) || opts.extension)) || + '.svx' + }`, + }); +}; + +// @ts-ignore +globalThis.global = globalThis; + +if (typeof window !== 'undefined') { + // @ts-ignore + window.global = globalThis; +} + +export { _compile as _, code_highlight as a, commonjsGlobal as c, defineConfig as d, escape_svelty as e, getDefaultExportFromCjs as g, mdsvex as m }; +//# sourceMappingURL=main-DLA3kuAq.js.map diff --git a/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js.map b/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js.map new file mode 100644 index 0000000000000000000000000000000000000000..80cfc8258ee44c0155aee18602f9dd8065a1cae3 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main-DLA3kuAq.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main-DLA3kuAq.js","sources":["../src/define-config.ts","../src/utils.ts","../../../node_modules/.pnpm/bail@1.0.5/node_modules/bail/index.js","../../../node_modules/.pnpm/is-buffer@2.0.4/node_modules/is-buffer/index.js","../../../node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js","../../../node_modules/.pnpm/is-plain-obj@2.1.0/node_modules/is-plain-obj/index.js","../../../node_modules/.pnpm/trough@1.0.5/node_modules/trough/wrap.js","../../../node_modules/.pnpm/trough@1.0.5/node_modules/trough/index.js","../../../node_modules/.pnpm/unist-util-stringify-position@2.0.3/node_modules/unist-util-stringify-position/index.js","../../../node_modules/.pnpm/vfile-message@2.0.4/node_modules/vfile-message/index.js","../../../node_modules/.pnpm/replace-ext@1.0.0/node_modules/replace-ext/index.js","../../../node_modules/.pnpm/vfile@4.2.0/node_modules/vfile/core.js","../../../node_modules/.pnpm/vfile@4.2.0/node_modules/vfile/index.js","../../../node_modules/.pnpm/unified@9.1.0/node_modules/unified/index.js","../../../node_modules/.pnpm/xtend@4.0.2/node_modules/xtend/immutable.js","../../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js","../../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js","../../../node_modules/.pnpm/unherit@1.1.3/node_modules/unherit/index.js","../../../node_modules/.pnpm/state-toggle@1.0.3/node_modules/state-toggle/index.js","../../../node_modules/.pnpm/vfile-location@3.0.1/node_modules/vfile-location/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/unescape.js","../../../node_modules/.pnpm/is-decimal@1.0.4/node_modules/is-decimal/index.js","../../../node_modules/.pnpm/is-hexadecimal@1.0.4/node_modules/is-hexadecimal/index.js","../../../node_modules/.pnpm/is-alphabetical@1.0.4/node_modules/is-alphabetical/index.js","../../../node_modules/.pnpm/is-alphanumerical@1.0.4/node_modules/is-alphanumerical/index.js","../../../node_modules/.pnpm/parse-entities@2.0.0/node_modules/parse-entities/decode-entity.js","../../../node_modules/.pnpm/parse-entities@2.0.0/node_modules/parse-entities/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/decode.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenizer.js","../../../node_modules/.pnpm/markdown-escapes@1.0.4/node_modules/markdown-escapes/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/block-elements.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/defaults.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/set-options.js","../../../node_modules/.pnpm/unist-util-is@4.1.0/node_modules/unist-util-is/convert.js","../../../node_modules/.pnpm/unist-util-visit-parents@3.1.1/node_modules/unist-util-visit-parents/color.js","../../../node_modules/.pnpm/unist-util-visit-parents@3.1.1/node_modules/unist-util-visit-parents/index.js","../../../node_modules/.pnpm/unist-util-visit@2.0.3/node_modules/unist-util-visit/index.js","../../../node_modules/.pnpm/unist-util-remove-position@2.0.1/node_modules/unist-util-remove-position/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/parse.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/blank-line.js","../../../node_modules/.pnpm/repeat-string@1.6.1/node_modules/repeat-string/index.js","../../../node_modules/.pnpm/trim-trailing-lines@1.1.3/node_modules/trim-trailing-lines/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/code-indented.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/code-fenced.js","../../../node_modules/.pnpm/trim@0.0.1/node_modules/trim/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/util/interrupt.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/blockquote.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/heading-atx.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/thematic-break.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/util/get-indentation.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/util/remove-indentation.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/list.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/heading-setext.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/util/html.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/html-block.js","../../../node_modules/.pnpm/is-whitespace-character@1.0.4/node_modules/is-whitespace-character/index.js","../../../node_modules/.pnpm/collapse-white-space@1.0.6/node_modules/collapse-white-space/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/util/normalize.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/definition.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/table.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/paragraph.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/escape.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/escape.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/tag.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/auto-link.js","../../../node_modules/.pnpm/ccount@1.0.5/node_modules/ccount/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/url.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/url.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/email.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/email.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/html-inline.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/link.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/link.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/reference.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/strong.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/strong.js","../../../node_modules/.pnpm/is-word-character@1.0.4/node_modules/is-word-character/index.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/emphasis.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/emphasis.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/delete.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/delete.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/code-inline.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/code-inline.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/locate/break.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/break.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/tokenize/text.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/lib/parser.js","../../../node_modules/.pnpm/remark-parse@8.0.3/node_modules/remark-parse/index.js","../../../node_modules/.pnpm/mdast-util-definitions@2.0.1/node_modules/mdast-util-definitions/index.js","../../../node_modules/.pnpm/space-separated-tokens@1.1.5/node_modules/space-separated-tokens/index.js","../../../node_modules/.pnpm/is-absolute-url@3.0.3/node_modules/is-absolute-url/index.js","../../../node_modules/.pnpm/remark-external-links@6.1.0/node_modules/remark-external-links/index.js","../../../node_modules/.pnpm/format@0.2.2/node_modules/format/format.js","../../../node_modules/.pnpm/fault@1.0.4/node_modules/fault/index.js","../../../node_modules/.pnpm/remark-frontmatter@2.0.0/node_modules/remark-frontmatter/lib/matters.js","../../../node_modules/.pnpm/remark-frontmatter@2.0.0/node_modules/remark-frontmatter/lib/fence.js","../../../node_modules/.pnpm/remark-frontmatter@2.0.0/node_modules/remark-frontmatter/lib/parse.js","../../../node_modules/.pnpm/remark-frontmatter@2.0.0/node_modules/remark-frontmatter/lib/compile.js","../../../node_modules/.pnpm/remark-frontmatter@2.0.0/node_modules/remark-frontmatter/index.js","../../../node_modules/.pnpm/unist-builder@2.0.3/node_modules/unist-builder/index.js","../../../node_modules/.pnpm/unist-util-position@3.1.0/node_modules/unist-util-position/index.js","../../../node_modules/.pnpm/unist-util-generated@1.1.6/node_modules/unist-util-generated/index.js","../../../node_modules/.pnpm/mdast-util-definitions@3.0.1/node_modules/mdast-util-definitions/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/all.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/one.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/wrap.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/list.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/footer.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/break.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/code.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/footnote.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/html.js","../../../node_modules/.pnpm/mdurl@1.0.1/node_modules/mdurl/encode.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/revert.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/image.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/link.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/root.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/table.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/text.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/handlers/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/lib/index.js","../../../node_modules/.pnpm/mdast-util-to-hast@9.1.2/node_modules/mdast-util-to-hast/index.js","../../../node_modules/.pnpm/remark-rehype@7.0.0/node_modules/remark-rehype/index.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/schema.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/merge.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/normalize.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/info.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/types.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/defined-info.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/create.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/xlink.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/xml.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/case-sensitive-transform.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/util/case-insensitive-transform.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/xmlns.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/aria.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/html.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/html.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/lib/svg.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/svg.js","../../../node_modules/.pnpm/unist-util-is@2.1.3/node_modules/unist-util-is/index.js","../../../node_modules/.pnpm/hast-util-is-element@1.0.4/node_modules/hast-util-is-element/index.js","../../../node_modules/.pnpm/hast-util-whitespace@1.0.4/node_modules/hast-util-whitespace/index.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/util/siblings.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/util/first.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/util/place.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/util/white-space-left.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/omission.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/closing.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/opening.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/omission/index.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/all.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/text.js","../../../node_modules/.pnpm/property-information@5.5.0/node_modules/property-information/find.js","../../../node_modules/.pnpm/comma-separated-tokens@1.0.8/node_modules/comma-separated-tokens/index.js","../../../node_modules/.pnpm/stringify-entities@2.0.0/node_modules/stringify-entities/index.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/constants.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/element.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/doctype.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/comment.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/raw.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/one.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/lib/index.js","../../../node_modules/.pnpm/@starptech+prettyhtml-hast-to-html@0.10.0/node_modules/@starptech/prettyhtml-hast-to-html/index.js","../src/parsers/svelte.ts","../src/parsers/re_tag.ts","../src/parsers/html_block.ts","../src/parsers/index.ts","../../../node_modules/.pnpm/unified@8.4.2/node_modules/unified/index.js","../../../node_modules/.pnpm/nlcst-to-string@2.0.4/node_modules/nlcst-to-string/index.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/tokenizer.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/parser.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/expressions.js","../../../node_modules/.pnpm/array-iterate@1.1.4/node_modules/array-iterate/index.js","../../../node_modules/.pnpm/unist-util-modify-children@1.1.6/node_modules/unist-util-modify-children/index.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-initial-word-symbol.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-final-word-symbol.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-inner-word-symbol.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-inner-word-slash.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-initialisms.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-words.js","../../../node_modules/.pnpm/unist-util-visit-children@1.1.4/node_modules/unist-util-visit-children/index.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/patch-position.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-non-word-sentences.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-affix-symbol.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-initial-lower-case-letter-sentences.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-initial-digit-sentences.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-prefix-exceptions.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-affix-exceptions.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/merge-remaining-full-stops.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/make-initial-white-space-siblings.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/make-final-white-space-siblings.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/break-implicit-sentences.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/plugin/remove-empty-nodes.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/lib/index.js","../../../node_modules/.pnpm/parse-latin@4.2.1/node_modules/parse-latin/index.js","../../../node_modules/.pnpm/retext-latin@2.0.4/node_modules/retext-latin/index.js","../../../node_modules/.pnpm/retext-stringify@2.0.4/node_modules/retext-stringify/index.js","../../../node_modules/.pnpm/retext@7.0.1/node_modules/retext/index.js","../../../node_modules/.pnpm/retext-smartypants@4.0.0/node_modules/retext-smartypants/index.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/common.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/exception.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/mark.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/str.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/seq.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/map.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/null.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/bool.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/int.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/float.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema/json.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema/core.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/timestamp.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/merge.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/binary.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/omap.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/pairs.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/set.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/type/js/function.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/schema/default_full.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/loader.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml/dumper.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/lib/js-yaml.js","../../../node_modules/.pnpm/js-yaml@3.14.0/node_modules/js-yaml/index.js","../../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js","../src/transformers/index.ts","../src/index.ts","../src/main.ts"],"sourcesContent":["import { MdsvexOptions } from './types';\n\nexport const defineConfig = (config: MdsvexOptions) => config;\n","export function to_posix(_path: string): string {\n\tconst isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(_path);\n\tconst hasNonAscii = /[^\\u0000-\\u0080]+/.test(_path);\n\n\tif (isExtendedLengthPath || hasNonAscii) {\n\t\treturn _path;\n\t}\n\n\treturn _path.replace(/\\\\/g, '/');\n}\n\nexport function make_process() {\n\tconst process = {\n\t\ttitle: 'browser',\n\t\targv: [],\n\t\tversion: '', // empty string to avoid regexp issues\n\t\tversions: {\n\t\t\thttp_parser: '',\n\t\t\tnode: '',\n\t\t\tv8: '',\n\t\t\tares: '',\n\t\t\tuv: '',\n\t\t\tzlib: '',\n\t\t\tbrotli: '',\n\t\t\tmodules: '',\n\t\t\tnghttp2: '',\n\t\t\tnapi: '',\n\t\t\tllhttp: '',\n\t\t\topenssl: '',\n\t\t\ticu: '',\n\t\t\ttz: '',\n\t\t\tunicode: '',\n\t\t},\n\t\tenv: {\n\t\t\tNODE_ENV: 'production',\n\t\t},\n\t\tstdout: {\n\t\t\tisTTY: false,\n\t\t},\n\t\tbinding() {\n\t\t\treturn;\n\t\t},\n\t\tcwd() {\n\t\t\treturn '/';\n\t\t},\n\t\tchdir() {\n\t\t\treturn;\n\t\t},\n\t\tumask() {\n\t\t\treturn 0;\n\t\t},\n\t\ton: noop,\n\t\taddListener: noop,\n\t\tonce: noop,\n\t\toff: noop,\n\t\tremoveListener: noop,\n\t\tremoveAllListeners: noop,\n\t\temit: noop,\n\t};\n\n\tfunction noop() {}\n\n\treturn process;\n}\n","'use strict'\n\nmodule.exports = bail\n\nfunction bail(err) {\n if (err) {\n throw err\n }\n}\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict'\n\nvar slice = [].slice\n\nmodule.exports = wrap\n\n// Wrap `fn`.\n// Can be sync or async; return a promise, receive a completion handler, return\n// new values and errors.\nfunction wrap(fn, callback) {\n var invoked\n\n return wrapped\n\n function wrapped() {\n var params = slice.call(arguments, 0)\n var callback = fn.length > params.length\n var result\n\n if (callback) {\n params.push(done)\n }\n\n try {\n result = fn.apply(null, params)\n } catch (error) {\n // Well, this is quite the pickle.\n // `fn` received a callback and invoked it (thus continuing the pipeline),\n // but later also threw an error.\n // We’re not about to restart the pipeline again, so the only thing left\n // to do is to throw the thing instead.\n if (callback && invoked) {\n throw error\n }\n\n return done(error)\n }\n\n if (!callback) {\n if (result && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n // Invoke `next`, only once.\n function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }\n\n // Invoke `done` with one value.\n // Tracks if an error is passed, too.\n function then(value) {\n done(null, value)\n }\n}\n","'use strict'\n\nvar wrap = require('./wrap.js')\n\nmodule.exports = trough\n\ntrough.wrap = wrap\n\nvar slice = [].slice\n\n// Create new middleware.\nfunction trough() {\n var fns = []\n var middleware = {}\n\n middleware.run = run\n middleware.use = use\n\n return middleware\n\n // Run `fns`. Last argument must be a completion handler.\n function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }\n\n // Add `fn` to the list.\n function use(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Expected `fn` to be a function, not ' + fn)\n }\n\n fns.push(fn)\n\n return middleware\n }\n}\n","'use strict'\n\nvar own = {}.hasOwnProperty\n\nmodule.exports = stringify\n\nfunction stringify(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if (own.call(value, 'position') || own.call(value, 'type')) {\n return position(value.position)\n }\n\n // Position.\n if (own.call(value, 'start') || own.call(value, 'end')) {\n return position(value)\n }\n\n // Point.\n if (own.call(value, 'line') || own.call(value, 'column')) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\nfunction point(point) {\n if (!point || typeof point !== 'object') {\n point = {}\n }\n\n return index(point.line) + ':' + index(point.column)\n}\n\nfunction position(pos) {\n if (!pos || typeof pos !== 'object') {\n pos = {}\n }\n\n return point(pos.start) + '-' + point(pos.end)\n}\n\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","'use strict'\n\nvar stringify = require('unist-util-stringify-position')\n\nmodule.exports = VMessage\n\n// Inherit from `Error#`.\nfunction VMessagePrototype() {}\nVMessagePrototype.prototype = Error.prototype\nVMessage.prototype = new VMessagePrototype()\n\n// Message properties.\nvar proto = VMessage.prototype\n\nproto.file = ''\nproto.name = ''\nproto.reason = ''\nproto.message = ''\nproto.stack = ''\nproto.fatal = null\nproto.column = null\nproto.line = null\n\n// Construct a new VMessage.\n//\n// Note: We cannot invoke `Error` on the created context, as that adds readonly\n// `line` and `column` attributes on Safari 9, thus throwing and failing the\n// data.\nfunction VMessage(reason, position, origin) {\n var parts\n var range\n var location\n\n if (typeof position === 'string') {\n origin = position\n position = null\n }\n\n parts = parseOrigin(origin)\n range = stringify(position) || '1:1'\n\n location = {\n start: {line: null, column: null},\n end: {line: null, column: null}\n }\n\n // Node.\n if (position && position.position) {\n position = position.position\n }\n\n if (position) {\n // Position.\n if (position.start) {\n location = position\n position = position.start\n } else {\n // Point.\n location.start = position\n }\n }\n\n if (reason.stack) {\n this.stack = reason.stack\n reason = reason.message\n }\n\n this.message = reason\n this.name = range\n this.reason = reason\n this.line = position ? position.line : null\n this.column = position ? position.column : null\n this.location = location\n this.source = parts[0]\n this.ruleId = parts[1]\n}\n\nfunction parseOrigin(origin) {\n var result = [null, null]\n var index\n\n if (typeof origin === 'string') {\n index = origin.indexOf(':')\n\n if (index === -1) {\n result[1] = origin\n } else {\n result[0] = origin.slice(0, index)\n result[1] = origin.slice(index + 1)\n }\n }\n\n return result\n}\n","'use strict';\n\nvar path = require('path');\n\nfunction replaceExt(npath, ext) {\n if (typeof npath !== 'string') {\n return npath;\n }\n\n if (npath.length === 0) {\n return npath;\n }\n\n var nFileName = path.basename(npath, path.extname(npath)) + ext;\n return path.join(path.dirname(npath), nFileName);\n}\n\nmodule.exports = replaceExt;\n","'use strict'\n\nvar path = require('path')\nvar replace = require('replace-ext')\nvar buffer = require('is-buffer')\n\nmodule.exports = VFile\n\nvar own = {}.hasOwnProperty\nvar proto = VFile.prototype\n\n// Order of setting (least specific to most), we need this because otherwise\n// `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n// stem can be set.\nvar order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']\n\nproto.toString = toString\n\n// Access full path (`~/index.min.js`).\nObject.defineProperty(proto, 'path', {get: getPath, set: setPath})\n\n// Access parent path (`~`).\nObject.defineProperty(proto, 'dirname', {get: getDirname, set: setDirname})\n\n// Access basename (`index.min.js`).\nObject.defineProperty(proto, 'basename', {get: getBasename, set: setBasename})\n\n// Access extname (`.js`).\nObject.defineProperty(proto, 'extname', {get: getExtname, set: setExtname})\n\n// Access stem (`index.min`).\nObject.defineProperty(proto, 'stem', {get: getStem, set: setStem})\n\n// Construct a new file.\nfunction VFile(options) {\n var prop\n var index\n var length\n\n if (!options) {\n options = {}\n } else if (typeof options === 'string' || buffer(options)) {\n options = {contents: options}\n } else if ('message' in options && 'messages' in options) {\n return options\n }\n\n if (!(this instanceof VFile)) {\n return new VFile(options)\n }\n\n this.data = {}\n this.messages = []\n this.history = []\n this.cwd = process.cwd()\n\n // Set path related properties in the correct order.\n index = -1\n length = order.length\n\n while (++index < length) {\n prop = order[index]\n\n if (own.call(options, prop)) {\n this[prop] = options[prop]\n }\n }\n\n // Set non-path related properties.\n for (prop in options) {\n if (order.indexOf(prop) === -1) {\n this[prop] = options[prop]\n }\n }\n}\n\nfunction getPath() {\n return this.history[this.history.length - 1]\n}\n\nfunction setPath(path) {\n assertNonEmpty(path, 'path')\n\n if (path !== this.path) {\n this.history.push(path)\n }\n}\n\nfunction getDirname() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined\n}\n\nfunction setDirname(dirname) {\n assertPath(this.path, 'dirname')\n this.path = path.join(dirname || '', this.basename)\n}\n\nfunction getBasename() {\n return typeof this.path === 'string' ? path.basename(this.path) : undefined\n}\n\nfunction setBasename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = path.join(this.dirname || '', basename)\n}\n\nfunction getExtname() {\n return typeof this.path === 'string' ? path.extname(this.path) : undefined\n}\n\nfunction setExtname(extname) {\n var ext = extname || ''\n\n assertPart(ext, 'extname')\n assertPath(this.path, 'extname')\n\n if (ext) {\n if (ext.charAt(0) !== '.') {\n throw new Error('`extname` must start with `.`')\n }\n\n if (ext.indexOf('.', 1) !== -1) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = replace(this.path, ext)\n}\n\nfunction getStem() {\n return typeof this.path === 'string'\n ? path.basename(this.path, this.extname)\n : undefined\n}\n\nfunction setStem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = path.join(this.dirname || '', stem + (this.extname || ''))\n}\n\n// Get the value of the file.\nfunction toString(encoding) {\n var value = this.contents || ''\n return buffer(value) ? value.toString(encoding) : String(value)\n}\n\n// Assert that `part` is not a path (i.e., does not contain `path.sep`).\nfunction assertPart(part, name) {\n if (part.indexOf(path.sep) !== -1) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + path.sep + '`'\n )\n }\n}\n\n// Assert that `part` is not empty.\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n// Assert `path` exists.\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n","'use strict'\n\nvar VMessage = require('vfile-message')\nvar VFile = require('./core.js')\n\nmodule.exports = VFile\n\nvar proto = VFile.prototype\n\nproto.message = message\nproto.info = info\nproto.fail = fail\n\n// Create a message with `reason` at `position`.\n// When an error is passed in as `reason`, copies the stack.\nfunction message(reason, position, origin) {\n var filePath = this.path\n var message = new VMessage(reason, position, origin)\n\n if (filePath) {\n message.name = filePath + ':' + message.name\n message.file = filePath\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n}\n\n// Fail: creates a vmessage, associates it with the file, and throws it.\nfunction fail() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = true\n\n throw message\n}\n\n// Info: creates a vmessage, associates it with the file, and marks the fatality\n// as null.\nfunction info() {\n var message = this.message.apply(this, arguments)\n\n message.fatal = null\n\n return message\n}\n","'use strict'\n\nvar bail = require('bail')\nvar buffer = require('is-buffer')\nvar extend = require('extend')\nvar plain = require('is-plain-obj')\nvar trough = require('trough')\nvar vfile = require('vfile')\n\n// Expose a frozen processor.\nmodule.exports = unified().freeze()\n\nvar slice = [].slice\nvar own = {}.hasOwnProperty\n\n// Process pipeline.\nvar pipeline = trough()\n .use(pipelineParse)\n .use(pipelineRun)\n .use(pipelineStringify)\n\nfunction pipelineParse(p, ctx) {\n ctx.tree = p.parse(ctx.file)\n}\n\nfunction pipelineRun(p, ctx, next) {\n p.run(ctx.tree, ctx.file, done)\n\n function done(err, tree, file) {\n if (err) {\n next(err)\n } else {\n ctx.tree = tree\n ctx.file = file\n next()\n }\n }\n}\n\nfunction pipelineStringify(p, ctx) {\n var result = p.stringify(ctx.tree, ctx.file)\n var file = ctx.file\n\n if (result === undefined || result === null) {\n // Empty.\n } else if (typeof result === 'string' || buffer(result)) {\n file.contents = result\n } else {\n file.result = result\n }\n}\n\n// Function to create the first processor.\nfunction unified() {\n var attachers = []\n var transformers = trough()\n var namespace = {}\n var frozen = false\n var freezeIndex = -1\n\n // Data management.\n processor.data = data\n\n // Lock.\n processor.freeze = freeze\n\n // Plugins.\n processor.attachers = attachers\n processor.use = use\n\n // API.\n processor.parse = parse\n processor.stringify = stringify\n processor.run = run\n processor.runSync = runSync\n processor.process = process\n processor.processSync = processSync\n\n // Expose.\n return processor\n\n // Create a new processor based on the processor in the current scope.\n function processor() {\n var destination = unified()\n var length = attachers.length\n var index = -1\n\n while (++index < length) {\n destination.use.apply(null, attachers[index])\n }\n\n destination.data(extend(true, {}, namespace))\n\n return destination\n }\n\n // Freeze: used to signal a processor that has finished configuration.\n //\n // For example, take unified itself: it’s frozen.\n // Plugins should not be added to it.\n // Rather, it should be extended, by invoking it, before modifying it.\n //\n // In essence, always invoke this when exporting a processor.\n function freeze() {\n var values\n var plugin\n var options\n var transformer\n\n if (frozen) {\n return processor\n }\n\n while (++freezeIndex < attachers.length) {\n values = attachers[freezeIndex]\n plugin = values[0]\n options = values[1]\n transformer = null\n\n if (options === false) {\n continue\n }\n\n if (options === true) {\n values[1] = undefined\n }\n\n transformer = plugin.apply(processor, values.slice(1))\n\n if (typeof transformer === 'function') {\n transformers.use(transformer)\n }\n }\n\n frozen = true\n freezeIndex = Infinity\n\n return processor\n }\n\n // Data management.\n // Getter / setter for processor-specific informtion.\n function data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', frozen)\n\n namespace[key] = value\n\n return processor\n }\n\n // Get `key`.\n return (own.call(namespace, key) && namespace[key]) || null\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', frozen)\n namespace = key\n return processor\n }\n\n // Get space.\n return namespace\n }\n\n // Plugin management.\n //\n // Pass it:\n // * an attacher and options,\n // * a preset,\n // * a list of presets, attachers, and arguments (list of attachers and\n // options).\n function use(value) {\n var settings\n\n assertUnfrozen('use', frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin.apply(null, arguments)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n\n if (settings) {\n namespace.settings = extend(namespace.settings || {}, settings)\n }\n\n return processor\n\n function addPreset(result) {\n addList(result.plugins)\n\n if (result.settings) {\n settings = extend(settings || {}, result.settings)\n }\n }\n\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value)\n } else if (typeof value === 'object') {\n if ('length' in value) {\n addPlugin.apply(null, value)\n } else {\n addPreset(value)\n }\n } else {\n throw new Error('Expected usable value, not `' + value + '`')\n }\n }\n\n function addList(plugins) {\n var length\n var index\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (typeof plugins === 'object' && 'length' in plugins) {\n length = plugins.length\n index = -1\n\n while (++index < length) {\n add(plugins[index])\n }\n } else {\n throw new Error('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n function addPlugin(plugin, value) {\n var entry = find(plugin)\n\n if (entry) {\n if (plain(entry[1]) && plain(value)) {\n value = extend(entry[1], value)\n }\n\n entry[1] = value\n } else {\n attachers.push(slice.call(arguments))\n }\n }\n }\n\n function find(plugin) {\n var length = attachers.length\n var index = -1\n var entry\n\n while (++index < length) {\n entry = attachers[index]\n\n if (entry[0] === plugin) {\n return entry\n }\n }\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor.\n function parse(doc) {\n var file = vfile(doc)\n var Parser\n\n freeze()\n Parser = processor.Parser\n assertParser('parse', Parser)\n\n if (newable(Parser, 'parse')) {\n return new Parser(String(file), file).parse()\n }\n\n return Parser(String(file), file) // eslint-disable-line new-cap\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), async.\n function run(node, file, cb) {\n assertNode(node)\n freeze()\n\n if (!cb && typeof file === 'function') {\n cb = file\n file = null\n }\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n transformers.run(node, vfile(file), done)\n\n function done(err, tree, file) {\n tree = tree || node\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(tree)\n } else {\n cb(null, tree, file)\n }\n }\n }\n }\n\n // Run transforms on a unist node representation of a file (in string or\n // vfile representation), sync.\n function runSync(node, file) {\n var complete = false\n var result\n\n run(node, file, done)\n\n assertDone('runSync', 'run', complete)\n\n return result\n\n function done(err, tree) {\n complete = true\n bail(err)\n result = tree\n }\n }\n\n // Stringify a unist node representation of a file (in string or vfile\n // representation) into a string using the `Compiler` on the processor.\n function stringify(node, doc) {\n var file = vfile(doc)\n var Compiler\n\n freeze()\n Compiler = processor.Compiler\n assertCompiler('stringify', Compiler)\n assertNode(node)\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile()\n }\n\n return Compiler(node, file) // eslint-disable-line new-cap\n }\n\n // Parse a file (in string or vfile representation) into a unist node using\n // the `Parser` on the processor, then run transforms on that node, and\n // compile the resulting node using the `Compiler` on the processor, and\n // store that result on the vfile.\n function process(doc, cb) {\n freeze()\n assertParser('process', processor.Parser)\n assertCompiler('process', processor.Compiler)\n\n if (!cb) {\n return new Promise(executor)\n }\n\n executor(null, cb)\n\n function executor(resolve, reject) {\n var file = vfile(doc)\n\n pipeline.run(processor, {file: file}, done)\n\n function done(err) {\n if (err) {\n reject(err)\n } else if (resolve) {\n resolve(file)\n } else {\n cb(null, file)\n }\n }\n }\n }\n\n // Process the given document (in string or vfile representation), sync.\n function processSync(doc) {\n var complete = false\n var file\n\n freeze()\n assertParser('processSync', processor.Parser)\n assertCompiler('processSync', processor.Compiler)\n file = vfile(doc)\n\n process(file, done)\n\n assertDone('processSync', 'process', complete)\n\n return file\n\n function done(err) {\n complete = true\n bail(err)\n }\n }\n}\n\n// Check if `value` is a constructor.\nfunction newable(value, name) {\n return (\n typeof value === 'function' &&\n value.prototype &&\n // A function with keys in its prototype is probably a constructor.\n // Classes’ prototype methods are not enumerable, so we check if some value\n // exists in the prototype.\n (keys(value.prototype) || name in value.prototype)\n )\n}\n\n// Check if `value` is an object with keys.\nfunction keys(value) {\n var key\n for (key in value) {\n return true\n }\n\n return false\n}\n\n// Assert a parser is available.\nfunction assertParser(name, Parser) {\n if (typeof Parser !== 'function') {\n throw new Error('Cannot `' + name + '` without `Parser`')\n }\n}\n\n// Assert a compiler is available.\nfunction assertCompiler(name, Compiler) {\n if (typeof Compiler !== 'function') {\n throw new Error('Cannot `' + name + '` without `Compiler`')\n }\n}\n\n// Assert the processor is not frozen.\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot invoke `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by invoking it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n// Assert `node` is a unist node.\nfunction assertNode(node) {\n if (!node || typeof node.type !== 'string') {\n throw new Error('Expected node, got `' + node + '`')\n }\n}\n\n// Assert that `complete` is `true`.\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar inherits = require('inherits')\n\nmodule.exports = unherit\n\n// Create a custom constructor which can be modified without affecting the\n// original class.\nfunction unherit(Super) {\n var result\n var key\n var value\n\n inherits(Of, Super)\n inherits(From, Of)\n\n // Clone values.\n result = Of.prototype\n\n for (key in result) {\n value = result[key]\n\n if (value && typeof value === 'object') {\n result[key] = 'concat' in value ? value.concat() : xtend(value)\n }\n }\n\n return Of\n\n // Constructor accepting a single argument, which itself is an `arguments`\n // object.\n function From(parameters) {\n return Super.apply(this, parameters)\n }\n\n // Constructor accepting variadic arguments.\n function Of() {\n if (!(this instanceof Of)) {\n return new From(arguments)\n }\n\n return Super.apply(this, arguments)\n }\n}\n","'use strict'\n\nmodule.exports = factory\n\n// Construct a state `toggler`: a function which inverses `property` in context\n// based on its current value.\n// The by `toggler` returned function restores that value.\nfunction factory(key, state, ctx) {\n return enter\n\n function enter() {\n var context = ctx || this\n var current = context[key]\n\n context[key] = !state\n\n return exit\n\n function exit() {\n context[key] = current\n }\n }\n}\n","'use strict'\n\nmodule.exports = factory\n\nfunction factory(file) {\n var contents = indices(String(file))\n\n return {\n toPosition: offsetToPositionFactory(contents),\n toOffset: positionToOffsetFactory(contents)\n }\n}\n\n// Factory to get the line and column-based `position` for `offset` in the bound\n// indices.\nfunction offsetToPositionFactory(indices) {\n return offsetToPosition\n\n // Get the line and column-based `position` for `offset` in the bound indices.\n function offsetToPosition(offset) {\n var index = -1\n var length = indices.length\n\n if (offset < 0) {\n return {}\n }\n\n while (++index < length) {\n if (indices[index] > offset) {\n return {\n line: index + 1,\n column: offset - (indices[index - 1] || 0) + 1,\n offset: offset\n }\n }\n }\n\n return {}\n }\n}\n\n// Factory to get the `offset` for a line and column-based `position` in the\n// bound indices.\nfunction positionToOffsetFactory(indices) {\n return positionToOffset\n\n // Get the `offset` for a line and column-based `position` in the bound\n // indices.\n function positionToOffset(position) {\n var line = position && position.line\n var column = position && position.column\n\n if (!isNaN(line) && !isNaN(column) && line - 1 in indices) {\n return (indices[line - 2] || 0) + column - 1 || 0\n }\n\n return -1\n }\n}\n\n// Get indices of line-breaks in `value`.\nfunction indices(value) {\n var result = []\n var index = value.indexOf('\\n')\n\n while (index !== -1) {\n result.push(index + 1)\n index = value.indexOf('\\n', index + 1)\n }\n\n result.push(value.length + 1)\n\n return result\n}\n","'use strict'\n\nmodule.exports = factory\n\nvar backslash = '\\\\'\n\n// Factory to de-escape a value, based on a list at `key` in `ctx`.\nfunction factory(ctx, key) {\n return unescape\n\n // De-escape a string using the expression at `key` in `ctx`.\n function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }\n}\n","'use strict'\n\nmodule.exports = decimal\n\n// Check if the given character code, or the character code at the first\n// character, is decimal.\nfunction decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}\n","'use strict'\n\nmodule.exports = hexadecimal\n\n// Check if the given character code, or the character code at the first\n// character, is hexadecimal.\nfunction hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}\n","'use strict'\n\nmodule.exports = alphabetical\n\n// Check if the given character code, or the character code at the first\n// character, is alphabetical.\nfunction alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}\n","'use strict'\n\nvar alphabetical = require('is-alphabetical')\nvar decimal = require('is-decimal')\n\nmodule.exports = alphanumerical\n\n// Check if the given character code, or the character code at the first\n// character, is alphanumerical.\nfunction alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}\n","'use strict'\n\nvar characterEntities = require('character-entities')\n\nmodule.exports = decodeEntity\n\nvar own = {}.hasOwnProperty\n\nfunction decodeEntity(characters) {\n return own.call(characterEntities, characters)\n ? characterEntities[characters]\n : false\n}\n","'use strict'\n\nvar legacy = require('character-entities-legacy')\nvar invalid = require('character-reference-invalid')\nvar decimal = require('is-decimal')\nvar hexadecimal = require('is-hexadecimal')\nvar alphanumerical = require('is-alphanumerical')\nvar decodeEntity = require('./decode-entity')\n\nmodule.exports = parseEntities\n\nvar own = {}.hasOwnProperty\nvar fromCharCode = String.fromCharCode\nvar noop = Function.prototype\n\n// Default settings.\nvar defaults = {\n warning: null,\n reference: null,\n text: null,\n warningContext: null,\n referenceContext: null,\n textContext: null,\n position: {},\n additional: null,\n attribute: false,\n nonTerminated: true\n}\n\n// Characters.\nvar tab = 9 // '\\t'\nvar lineFeed = 10 // '\\n'\nvar formFeed = 12 // '\\f'\nvar space = 32 // ' '\nvar ampersand = 38 // '&'\nvar semicolon = 59 // ';'\nvar lessThan = 60 // '<'\nvar equalsTo = 61 // '='\nvar numberSign = 35 // '#'\nvar uppercaseX = 88 // 'X'\nvar lowercaseX = 120 // 'x'\nvar replacementCharacter = 65533 // '�'\n\n// Reference types.\nvar name = 'named'\nvar hexa = 'hexadecimal'\nvar deci = 'decimal'\n\n// Map of bases.\nvar bases = {}\n\nbases[hexa] = 16\nbases[deci] = 10\n\n// Map of types to tests.\n// Each type of character reference accepts different characters.\n// This test is used to detect whether a reference has ended (as the semicolon\n// is not strictly needed).\nvar tests = {}\n\ntests[name] = alphanumerical\ntests[deci] = decimal\ntests[hexa] = hexadecimal\n\n// Warning types.\nvar namedNotTerminated = 1\nvar numericNotTerminated = 2\nvar namedEmpty = 3\nvar numericEmpty = 4\nvar namedUnknown = 5\nvar numericDisallowed = 6\nvar numericProhibited = 7\n\n// Warning messages.\nvar messages = {}\n\nmessages[namedNotTerminated] =\n 'Named character references must be terminated by a semicolon'\nmessages[numericNotTerminated] =\n 'Numeric character references must be terminated by a semicolon'\nmessages[namedEmpty] = 'Named character references cannot be empty'\nmessages[numericEmpty] = 'Numeric character references cannot be empty'\nmessages[namedUnknown] = 'Named character references must be known'\nmessages[numericDisallowed] =\n 'Numeric character references cannot be disallowed'\nmessages[numericProhibited] =\n 'Numeric character references cannot be outside the permissible Unicode range'\n\n// Wrap to ensure clean parameters are given to `parse`.\nfunction parseEntities(value, options) {\n var settings = {}\n var option\n var key\n\n if (!options) {\n options = {}\n }\n\n for (key in defaults) {\n option = options[key]\n settings[key] =\n option === null || option === undefined ? defaults[key] : option\n }\n\n if (settings.position.indent || settings.position.start) {\n settings.indent = settings.position.indent || []\n settings.position = settings.position.start\n }\n\n return parse(value, settings)\n}\n\n// Parse entities.\n// eslint-disable-next-line complexity\nfunction parse(value, settings) {\n var additional = settings.additional\n var nonTerminated = settings.nonTerminated\n var handleText = settings.text\n var handleReference = settings.reference\n var handleWarning = settings.warning\n var textContext = settings.textContext\n var referenceContext = settings.referenceContext\n var warningContext = settings.warningContext\n var pos = settings.position\n var indent = settings.indent || []\n var length = value.length\n var index = 0\n var lines = -1\n var column = pos.column || 1\n var line = pos.line || 1\n var queue = ''\n var result = []\n var entityCharacters\n var namedEntity\n var terminated\n var characters\n var character\n var reference\n var following\n var warning\n var reason\n var output\n var entity\n var begin\n var start\n var type\n var test\n var prev\n var next\n var diff\n var end\n\n if (typeof additional === 'string') {\n additional = additional.charCodeAt(0)\n }\n\n // Cache the current point.\n prev = now()\n\n // Wrap `handleWarning`.\n warning = handleWarning ? parseError : noop\n\n // Ensure the algorithm walks over the first character and the end\n // (inclusive).\n index--\n length++\n\n while (++index < length) {\n // If the previous character was a newline.\n if (character === lineFeed) {\n column = indent[lines] || 1\n }\n\n character = value.charCodeAt(index)\n\n if (character === ampersand) {\n following = value.charCodeAt(index + 1)\n\n // The behaviour depends on the identity of the next character.\n if (\n following === tab ||\n following === lineFeed ||\n following === formFeed ||\n following === space ||\n following === ampersand ||\n following === lessThan ||\n following !== following ||\n (additional && following === additional)\n ) {\n // Not a character reference.\n // No characters are consumed, and nothing is returned.\n // This is not an error, either.\n queue += fromCharCode(character)\n column++\n\n continue\n }\n\n start = index + 1\n begin = start\n end = start\n\n if (following === numberSign) {\n // Numerical entity.\n end = ++begin\n\n // The behaviour further depends on the next character.\n following = value.charCodeAt(end)\n\n if (following === uppercaseX || following === lowercaseX) {\n // ASCII hex digits.\n type = hexa\n end = ++begin\n } else {\n // ASCII digits.\n type = deci\n }\n } else {\n // Named entity.\n type = name\n }\n\n entityCharacters = ''\n entity = ''\n characters = ''\n test = tests[type]\n end--\n\n while (++end < length) {\n following = value.charCodeAt(end)\n\n if (!test(following)) {\n break\n }\n\n characters += fromCharCode(following)\n\n // Check if we can match a legacy named reference.\n // If so, we cache that as the last viable named reference.\n // This ensures we do not need to walk backwards later.\n if (type === name && own.call(legacy, characters)) {\n entityCharacters = characters\n entity = legacy[characters]\n }\n }\n\n terminated = value.charCodeAt(end) === semicolon\n\n if (terminated) {\n end++\n\n namedEntity = type === name ? decodeEntity(characters) : false\n\n if (namedEntity) {\n entityCharacters = characters\n entity = namedEntity\n }\n }\n\n diff = 1 + end - start\n\n if (!terminated && !nonTerminated) {\n // Empty.\n } else if (!characters) {\n // An empty (possible) entity is valid, unless it’s numeric (thus an\n // ampersand followed by an octothorp).\n if (type !== name) {\n warning(numericEmpty, diff)\n }\n } else if (type === name) {\n // An ampersand followed by anything unknown, and not terminated, is\n // invalid.\n if (terminated && !entity) {\n warning(namedUnknown, 1)\n } else {\n // If theres something after an entity name which is not known, cap\n // the reference.\n if (entityCharacters !== characters) {\n end = begin + entityCharacters.length\n diff = 1 + end - begin\n terminated = false\n }\n\n // If the reference is not terminated, warn.\n if (!terminated) {\n reason = entityCharacters ? namedNotTerminated : namedEmpty\n\n if (settings.attribute) {\n following = value.charCodeAt(end)\n\n if (following === equalsTo) {\n warning(reason, diff)\n entity = null\n } else if (alphanumerical(following)) {\n entity = null\n } else {\n warning(reason, diff)\n }\n } else {\n warning(reason, diff)\n }\n }\n }\n\n reference = entity\n } else {\n if (!terminated) {\n // All non-terminated numeric entities are not rendered, and trigger a\n // warning.\n warning(numericNotTerminated, diff)\n }\n\n // When terminated and number, parse as either hexadecimal or decimal.\n reference = parseInt(characters, bases[type])\n\n // Trigger a warning when the parsed number is prohibited, and replace\n // with replacement character.\n if (prohibited(reference)) {\n warning(numericProhibited, diff)\n reference = fromCharCode(replacementCharacter)\n } else if (reference in invalid) {\n // Trigger a warning when the parsed number is disallowed, and replace\n // by an alternative.\n warning(numericDisallowed, diff)\n reference = invalid[reference]\n } else {\n // Parse the number.\n output = ''\n\n // Trigger a warning when the parsed number should not be used.\n if (disallowed(reference)) {\n warning(numericDisallowed, diff)\n }\n\n // Stringify the number.\n if (reference > 0xffff) {\n reference -= 0x10000\n output += fromCharCode((reference >>> (10 & 0x3ff)) | 0xd800)\n reference = 0xdc00 | (reference & 0x3ff)\n }\n\n reference = output + fromCharCode(reference)\n }\n }\n\n // Found it!\n // First eat the queued characters as normal text, then eat an entity.\n if (reference) {\n flush()\n\n prev = now()\n index = end - 1\n column += end - start + 1\n result.push(reference)\n next = now()\n next.offset++\n\n if (handleReference) {\n handleReference.call(\n referenceContext,\n reference,\n {start: prev, end: next},\n value.slice(start - 1, end)\n )\n }\n\n prev = next\n } else {\n // If we could not find a reference, queue the checked characters (as\n // normal characters), and move the pointer to their end.\n // This is possible because we can be certain neither newlines nor\n // ampersands are included.\n characters = value.slice(start - 1, end)\n queue += characters\n column += characters.length\n index = end - 1\n }\n } else {\n // Handle anything other than an ampersand, including newlines and EOF.\n if (\n character === 10 // Line feed\n ) {\n line++\n lines++\n column = 0\n }\n\n if (character === character) {\n queue += fromCharCode(character)\n column++\n } else {\n flush()\n }\n }\n }\n\n // Return the reduced nodes.\n return result.join('')\n\n // Get current position.\n function now() {\n return {\n line: line,\n column: column,\n offset: index + (pos.offset || 0)\n }\n }\n\n // “Throw” a parse-error: a warning.\n function parseError(code, offset) {\n var position = now()\n\n position.column += offset\n position.offset += offset\n\n handleWarning.call(warningContext, messages[code], position, code)\n }\n\n // Flush `queue` (normal text).\n // Macro invoked before each entity and at the end of `value`.\n // Does nothing when `queue` is empty.\n function flush() {\n if (queue) {\n result.push(queue)\n\n if (handleText) {\n handleText.call(textContext, queue, {start: prev, end: now()})\n }\n\n queue = ''\n }\n }\n}\n\n// Check if `character` is outside the permissible unicode range.\nfunction prohibited(code) {\n return (code >= 0xd800 && code <= 0xdfff) || code > 0x10ffff\n}\n\n// Check if `character` is disallowed.\nfunction disallowed(code) {\n return (\n (code >= 0x0001 && code <= 0x0008) ||\n code === 0x000b ||\n (code >= 0x000d && code <= 0x001f) ||\n (code >= 0x007f && code <= 0x009f) ||\n (code >= 0xfdd0 && code <= 0xfdef) ||\n (code & 0xffff) === 0xffff ||\n (code & 0xffff) === 0xfffe\n )\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar entities = require('parse-entities')\n\nmodule.exports = factory\n\n// Factory to create an entity decoder.\nfunction factory(ctx) {\n decoder.raw = decodeRaw\n\n return decoder\n\n // Normalize `position` to add an `indent`.\n function normalize(position) {\n var offsets = ctx.offset\n var line = position.line\n var result = []\n\n while (++line) {\n if (!(line in offsets)) {\n break\n }\n\n result.push((offsets[line] || 0) + 1)\n }\n\n return {start: position, indent: result}\n }\n\n // Decode `value` (at `position`) into text-nodes.\n function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }\n\n // Decode `value` (at `position`) into a string.\n function decodeRaw(value, position, options) {\n return entities(\n value,\n xtend(options, {position: normalize(position), warning: handleWarning})\n )\n }\n\n // Handle a warning.\n // See for the warnings.\n function handleWarning(reason, position, code) {\n if (code !== 3) {\n ctx.file.message(reason, position)\n }\n }\n}\n","'use strict'\n\nmodule.exports = factory\n\n// Construct a tokenizer. This creates both `tokenizeInline` and `tokenizeBlock`.\nfunction factory(type) {\n return tokenize\n\n // Tokenizer for a bound `type`.\n function tokenize(value, location) {\n var self = this\n var offset = self.offset\n var tokens = []\n var methods = self[type + 'Methods']\n var tokenizers = self[type + 'Tokenizers']\n var line = location.line\n var column = location.column\n var index\n var length\n var method\n var name\n var matched\n var valueLength\n\n // Trim white space only lines.\n if (!value) {\n return tokens\n }\n\n // Expose on `eat`.\n eat.now = now\n eat.file = self.file\n\n // Sync initial offset.\n updatePosition('')\n\n // Iterate over `value`, and iterate over all tokenizers. When one eats\n // something, re-iterate with the remaining value. If no tokenizer eats,\n // something failed (should not happen) and an exception is thrown.\n while (value) {\n index = -1\n length = methods.length\n matched = false\n\n while (++index < length) {\n name = methods[index]\n method = tokenizers[name]\n\n // Previously, we had constructs such as footnotes and YAML that used\n // these properties.\n // Those are now external (plus there are userland extensions), that may\n // still use them.\n if (\n method &&\n /* istanbul ignore next */ (!method.onlyAtStart || self.atStart) &&\n /* istanbul ignore next */ (!method.notInList || !self.inList) &&\n /* istanbul ignore next */ (!method.notInBlock || !self.inBlock) &&\n (!method.notInLink || !self.inLink)\n ) {\n valueLength = value.length\n\n method.apply(self, [eat, value])\n\n matched = valueLength !== value.length\n\n if (matched) {\n break\n }\n }\n }\n\n /* istanbul ignore if */\n if (!matched) {\n self.file.fail(new Error('Infinite loop'), eat.now())\n }\n }\n\n self.eof = now()\n\n return tokens\n\n // Update line, column, and offset based on `value`.\n function updatePosition(subvalue) {\n var lastIndex = -1\n var index = subvalue.indexOf('\\n')\n\n while (index !== -1) {\n line++\n lastIndex = index\n index = subvalue.indexOf('\\n', index + 1)\n }\n\n if (lastIndex === -1) {\n column += subvalue.length\n } else {\n column = subvalue.length - lastIndex\n }\n\n if (line in offset) {\n if (lastIndex !== -1) {\n column += offset[line]\n } else if (column <= offset[line]) {\n column = offset[line] + 1\n }\n }\n }\n\n // Get offset. Called before the first character is eaten to retrieve the\n // range’s offsets.\n function getOffset() {\n var indentation = []\n var pos = line + 1\n\n // Done. Called when the last character is eaten to retrieve the range’s\n // offsets.\n return function () {\n var last = line + 1\n\n while (pos < last) {\n indentation.push((offset[pos] || 0) + 1)\n\n pos++\n }\n\n return indentation\n }\n }\n\n // Get the current position.\n function now() {\n var pos = {line: line, column: column}\n\n pos.offset = self.toOffset(pos)\n\n return pos\n }\n\n // Store position information for a node.\n function Position(start) {\n this.start = start\n this.end = now()\n }\n\n // Throw when a value is incorrectly eaten. This shouldn’t happen but will\n // throw on new, incorrect rules.\n function validateEat(subvalue) {\n /* istanbul ignore if */\n if (value.slice(0, subvalue.length) !== subvalue) {\n // Capture stack-trace.\n self.file.fail(\n new Error(\n 'Incorrectly eaten value: please report this warning on https://git.io/vg5Ft'\n ),\n now()\n )\n }\n }\n\n // Mark position and patch `node.position`.\n function position() {\n var before = now()\n\n return update\n\n // Add the position to a node.\n function update(node, indent) {\n var previous = node.position\n var start = previous ? previous.start : before\n var combined = []\n var n = previous && previous.end.line\n var l = before.line\n\n node.position = new Position(start)\n\n // If there was already a `position`, this node was merged. Fixing\n // `start` wasn’t hard, but the indent is different. Especially\n // because some information, the indent between `n` and `l` wasn’t\n // tracked. Luckily, that space is (should be?) empty, so we can\n // safely check for it now.\n if (previous && indent && previous.indent) {\n combined = previous.indent\n\n if (n < l) {\n while (++n < l) {\n combined.push((offset[n] || 0) + 1)\n }\n\n combined.push(before.column)\n }\n\n indent = combined.concat(indent)\n }\n\n node.position.indent = indent || []\n\n return node\n }\n }\n\n // Add `node` to `parent`s children or to `tokens`. Performs merges where\n // possible.\n function add(node, parent) {\n var children = parent ? parent.children : tokens\n var previous = children[children.length - 1]\n var fn\n\n if (\n previous &&\n node.type === previous.type &&\n (node.type === 'text' || node.type === 'blockquote') &&\n mergeable(previous) &&\n mergeable(node)\n ) {\n fn = node.type === 'text' ? mergeText : mergeBlockquote\n node = fn.call(self, previous, node)\n }\n\n if (node !== previous) {\n children.push(node)\n }\n\n if (self.atStart && tokens.length !== 0) {\n self.exitStart()\n }\n\n return node\n }\n\n // Remove `subvalue` from `value`. `subvalue` must be at the start of\n // `value`.\n function eat(subvalue) {\n var indent = getOffset()\n var pos = position()\n var current = now()\n\n validateEat(subvalue)\n\n apply.reset = reset\n reset.test = test\n apply.test = test\n\n value = value.slice(subvalue.length)\n\n updatePosition(subvalue)\n\n indent = indent()\n\n return apply\n\n // Add the given arguments, add `position` to the returned node, and\n // return the node.\n function apply(node, parent) {\n return pos(add(pos(node), parent), indent)\n }\n\n // Functions just like apply, but resets the content: the line and\n // column are reversed, and the eaten value is re-added. This is\n // useful for nodes with a single type of content, such as lists and\n // tables. See `apply` above for what parameters are expected.\n function reset() {\n var node = apply.apply(null, arguments)\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return node\n }\n\n // Test the position, after eating, and reverse to a not-eaten state.\n function test() {\n var result = pos({})\n\n line = current.line\n column = current.column\n value = subvalue + value\n\n return result.position\n }\n }\n }\n}\n\n// Check whether a node is mergeable with adjacent nodes.\nfunction mergeable(node) {\n var start\n var end\n\n if (node.type !== 'text' || !node.position) {\n return true\n }\n\n start = node.position.start\n end = node.position.end\n\n // Only merge nodes which occupy the same size as their `value`.\n return (\n start.line !== end.line || end.column - start.column === node.value.length\n )\n}\n\n// Merge two text nodes: `node` into `prev`.\nfunction mergeText(previous, node) {\n previous.value += node.value\n\n return previous\n}\n\n// Merge two blockquotes: `node` into `prev`, unless in CommonMark or gfm modes.\nfunction mergeBlockquote(previous, node) {\n if (this.options.commonmark || this.options.gfm) {\n return node\n }\n\n previous.children = previous.children.concat(node.children)\n\n return previous\n}\n","'use strict'\n\nmodule.exports = escapes\n\nvar defaults = [\n '\\\\',\n '`',\n '*',\n '{',\n '}',\n '[',\n ']',\n '(',\n ')',\n '#',\n '+',\n '-',\n '.',\n '!',\n '_',\n '>'\n]\n\nvar gfm = defaults.concat(['~', '|'])\n\nvar commonmark = gfm.concat([\n '\\n',\n '\"',\n '$',\n '%',\n '&',\n \"'\",\n ',',\n '/',\n ':',\n ';',\n '<',\n '=',\n '?',\n '@',\n '^'\n])\n\nescapes.default = defaults\nescapes.gfm = gfm\nescapes.commonmark = commonmark\n\n// Get markdown escapes.\nfunction escapes(options) {\n var settings = options || {}\n\n if (settings.commonmark) {\n return commonmark\n }\n\n return settings.gfm ? gfm : defaults\n}\n","'use strict'\n\nmodule.exports = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'meta',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'pre',\n 'section',\n 'source',\n 'title',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n","'use strict'\n\nmodule.exports = {\n position: true,\n gfm: true,\n commonmark: false,\n pedantic: false,\n blocks: require('./block-elements')\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar escapes = require('markdown-escapes')\nvar defaults = require('./defaults')\n\nmodule.exports = setOptions\n\nfunction setOptions(options) {\n var self = this\n var current = self.options\n var key\n var value\n\n if (options == null) {\n options = {}\n } else if (typeof options === 'object') {\n options = xtend(options)\n } else {\n throw new Error('Invalid value `' + options + '` for setting `options`')\n }\n\n for (key in defaults) {\n value = options[key]\n\n if (value == null) {\n value = current[key]\n }\n\n if (\n (key !== 'blocks' && typeof value !== 'boolean') ||\n (key === 'blocks' && typeof value !== 'object')\n ) {\n throw new Error(\n 'Invalid value `' + value + '` for setting `options.' + key + '`'\n )\n }\n\n options[key] = value\n }\n\n self.options = options\n self.escape = escapes(options)\n\n return self\n}\n","'use strict'\n\nmodule.exports = convert\n\nfunction convert(test) {\n if (test == null) {\n return ok\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n if (typeof test === 'object') {\n return 'length' in test ? anyFactory(test) : allFactory(test)\n }\n\n if (typeof test === 'function') {\n return test\n }\n\n throw new Error('Expected function, string, or object as test')\n}\n\n// Utility assert each property in `test` is represented in `node`, and each\n// values are strictly equal.\nfunction allFactory(test) {\n return all\n\n function all(node) {\n var key\n\n for (key in test) {\n if (node[key] !== test[key]) return false\n }\n\n return true\n }\n}\n\nfunction anyFactory(tests) {\n var checks = []\n var index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return any\n\n function any() {\n var index = -1\n\n while (++index < checks.length) {\n if (checks[index].apply(this, arguments)) {\n return true\n }\n }\n\n return false\n }\n}\n\n// Utility to convert a string into a function which checks a given node’s type\n// for said string.\nfunction typeFactory(test) {\n return type\n\n function type(node) {\n return Boolean(node && node.type === test)\n }\n}\n\n// Utility to return true.\nfunction ok() {\n return true\n}\n","module.exports = color\nfunction color(d) {\n return '\\u001B[33m' + d + '\\u001B[39m'\n}\n","'use strict'\n\nmodule.exports = visitParents\n\nvar convert = require('unist-util-is/convert')\nvar color = require('./color')\n\nvar CONTINUE = true\nvar SKIP = 'skip'\nvar EXIT = false\n\nvisitParents.CONTINUE = CONTINUE\nvisitParents.SKIP = SKIP\nvisitParents.EXIT = EXIT\n\nfunction visitParents(tree, test, visitor, reverse) {\n var step\n var is\n\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n is = convert(test)\n step = reverse ? -1 : 1\n\n factory(tree, null, [])()\n\n function factory(node, index, parents) {\n var value = typeof node === 'object' && node !== null ? node : {}\n var name\n\n if (typeof value.type === 'string') {\n name =\n typeof value.tagName === 'string'\n ? value.tagName\n : typeof value.name === 'string'\n ? value.name\n : undefined\n\n visit.displayName =\n 'node (' + color(value.type + (name ? '<' + name + '>' : '')) + ')'\n }\n\n return visit\n\n function visit() {\n var grandparents = parents.concat(node)\n var result = []\n var subresult\n var offset\n\n if (!test || is(node, index, parents[parents.length - 1] || null)) {\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if (node.children && result[0] !== SKIP) {\n offset = (reverse ? node.children.length : -1) + step\n\n while (offset > -1 && offset < node.children.length) {\n subresult = factory(node.children[offset], offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n\n return result\n }\n }\n}\n\nfunction toResult(value) {\n if (value !== null && typeof value === 'object' && 'length' in value) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return [value]\n}\n","'use strict'\n\nmodule.exports = visit\n\nvar visitParents = require('unist-util-visit-parents')\n\nvar CONTINUE = visitParents.CONTINUE\nvar SKIP = visitParents.SKIP\nvar EXIT = visitParents.EXIT\n\nvisit.CONTINUE = CONTINUE\nvisit.SKIP = SKIP\nvisit.EXIT = EXIT\n\nfunction visit(tree, test, visitor, reverse) {\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n visitor = test\n test = null\n }\n\n visitParents(tree, test, overload, reverse)\n\n function overload(node, parents) {\n var parent = parents[parents.length - 1]\n var index = parent ? parent.children.indexOf(node) : null\n return visitor(node, index, parent)\n }\n}\n","'use strict'\n\nvar visit = require('unist-util-visit')\n\nmodule.exports = removePosition\n\nfunction removePosition(node, force) {\n visit(node, force ? hard : soft)\n return node\n}\n\nfunction hard(node) {\n delete node.position\n}\n\nfunction soft(node) {\n node.position = undefined\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar removePosition = require('unist-util-remove-position')\n\nmodule.exports = parse\n\nvar lineFeed = '\\n'\nvar lineBreaksExpression = /\\r\\n|\\r/g\n\n// Parse the bound file.\nfunction parse() {\n var self = this\n var value = String(self.file)\n var start = {line: 1, column: 1, offset: 0}\n var content = xtend(start)\n var node\n\n // Clean non-unix newlines: `\\r\\n` and `\\r` are all changed to `\\n`.\n // This should not affect positional information.\n value = value.replace(lineBreaksExpression, lineFeed)\n\n // BOM.\n if (value.charCodeAt(0) === 0xfeff) {\n value = value.slice(1)\n\n content.column++\n content.offset++\n }\n\n node = {\n type: 'root',\n children: self.tokenizeBlock(value, content),\n position: {start: start, end: self.eof || xtend(start)}\n }\n\n if (!self.options.position) {\n removePosition(node, true)\n }\n\n return node\n}\n","'use strict'\n\n// A line containing no characters, or a line containing only spaces (U+0020) or\n// tabs (U+0009), is called a blank line.\n// See .\nvar reBlankLine = /^[ \\t]*(\\n|$)/\n\n// Note that though blank lines play a special role in lists to determine\n// whether the list is tight or loose\n// (), it’s done by the list\n// tokenizer and this blank line tokenizer does not have to be responsible for\n// that.\n// Therefore, configs such as `blankLine.notInList` do not have to be set here.\nmodule.exports = blankLine\n\nfunction blankLine(eat, value, silent) {\n var match\n var subvalue = ''\n var index = 0\n var length = value.length\n\n while (index < length) {\n match = reBlankLine.exec(value.slice(index))\n\n if (match == null) {\n break\n }\n\n index += match[0].length\n subvalue += match[0]\n }\n\n if (subvalue === '') {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n eat(subvalue)\n}\n","/*!\n * repeat-string \n *\n * Copyright (c) 2014-2015, Jon Schlinkert.\n * Licensed under the MIT License.\n */\n\n'use strict';\n\n/**\n * Results cache\n */\n\nvar res = '';\nvar cache;\n\n/**\n * Expose `repeat`\n */\n\nmodule.exports = repeat;\n\n/**\n * Repeat the given `string` the specified `number`\n * of times.\n *\n * **Example:**\n *\n * ```js\n * var repeat = require('repeat-string');\n * repeat('A', 5);\n * //=> AAAAA\n * ```\n *\n * @param {String} `string` The string to repeat\n * @param {Number} `number` The number of times to repeat the string\n * @return {String} Repeated string\n * @api public\n */\n\nfunction repeat(str, num) {\n if (typeof str !== 'string') {\n throw new TypeError('expected a string');\n }\n\n // cover common, quick use cases\n if (num === 1) return str;\n if (num === 2) return str + str;\n\n var max = str.length * num;\n if (cache !== str || typeof cache === 'undefined') {\n cache = str;\n res = '';\n } else if (res.length >= max) {\n return res.substr(0, max);\n }\n\n while (max > res.length && num > 1) {\n if (num & 1) {\n res += str;\n }\n\n num >>= 1;\n str += str;\n }\n\n res += str;\n res = res.substr(0, max);\n return res;\n}\n","'use strict'\n\nmodule.exports = trimTrailingLines\n\nvar line = '\\n'\n\n// Remove final newline characters from `value`.\nfunction trimTrailingLines(value) {\n var val = String(value)\n var index = val.length\n\n while (val.charAt(--index) === line) {\n // Empty\n }\n\n return val.slice(0, index + 1)\n}\n","'use strict'\n\nvar repeat = require('repeat-string')\nvar trim = require('trim-trailing-lines')\n\nmodule.exports = indentedCode\n\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\n\nvar tabSize = 4\nvar codeIndent = repeat(space, tabSize)\n\nfunction indentedCode(eat, value, silent) {\n var index = -1\n var length = value.length\n var subvalue = ''\n var content = ''\n var subvalueQueue = ''\n var contentQueue = ''\n var character\n var blankQueue\n var indent\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (indent) {\n indent = false\n\n subvalue += subvalueQueue\n content += contentQueue\n subvalueQueue = ''\n contentQueue = ''\n\n if (character === lineFeed) {\n subvalueQueue = character\n contentQueue = character\n } else {\n subvalue += character\n content += character\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (!character || character === lineFeed) {\n contentQueue = character\n subvalueQueue = character\n break\n }\n\n subvalue += character\n content += character\n }\n }\n } else if (\n character === space &&\n value.charAt(index + 1) === character &&\n value.charAt(index + 2) === character &&\n value.charAt(index + 3) === character\n ) {\n subvalueQueue += codeIndent\n index += 3\n indent = true\n } else if (character === tab) {\n subvalueQueue += character\n indent = true\n } else {\n blankQueue = ''\n\n while (character === tab || character === space) {\n blankQueue += character\n character = value.charAt(++index)\n }\n\n if (character !== lineFeed) {\n break\n }\n\n subvalueQueue += blankQueue + character\n contentQueue += character\n }\n }\n\n if (content) {\n if (silent) {\n return true\n }\n\n return eat(subvalue)({\n type: 'code',\n lang: null,\n meta: null,\n value: trim(content)\n })\n }\n}\n","'use strict'\n\nmodule.exports = fencedCode\n\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\nvar tilde = '~'\nvar graveAccent = '`'\n\nvar minFenceCount = 3\nvar tabSize = 4\n\nfunction fencedCode(eat, value, silent) {\n var self = this\n var gfm = self.options.gfm\n var length = value.length + 1\n var index = 0\n var subvalue = ''\n var fenceCount\n var marker\n var character\n var flag\n var lang\n var meta\n var queue\n var content\n var exdentedContent\n var closing\n var exdentedClosing\n var indent\n var now\n\n if (!gfm) {\n return\n }\n\n // Eat initial spacing.\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n subvalue += character\n index++\n }\n\n indent = index\n\n // Eat the fence.\n character = value.charAt(index)\n\n if (character !== tilde && character !== graveAccent) {\n return\n }\n\n index++\n marker = character\n fenceCount = 1\n subvalue += character\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== marker) {\n break\n }\n\n subvalue += character\n fenceCount++\n index++\n }\n\n if (fenceCount < minFenceCount) {\n return\n }\n\n // Eat spacing before flag.\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n subvalue += character\n index++\n }\n\n // Eat flag.\n flag = ''\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (\n character === lineFeed ||\n (marker === graveAccent && character === marker)\n ) {\n break\n }\n\n if (character === space || character === tab) {\n queue += character\n } else {\n flag += queue + character\n queue = ''\n }\n\n index++\n }\n\n character = value.charAt(index)\n\n if (character && character !== lineFeed) {\n return\n }\n\n if (silent) {\n return true\n }\n\n now = eat.now()\n now.column += subvalue.length\n now.offset += subvalue.length\n\n subvalue += flag\n flag = self.decode.raw(self.unescape(flag), now)\n\n if (queue) {\n subvalue += queue\n }\n\n queue = ''\n closing = ''\n exdentedClosing = ''\n content = ''\n exdentedContent = ''\n var skip = true\n\n // Eat content.\n while (index < length) {\n character = value.charAt(index)\n content += closing\n exdentedContent += exdentedClosing\n closing = ''\n exdentedClosing = ''\n\n if (character !== lineFeed) {\n content += character\n exdentedClosing += character\n index++\n continue\n }\n\n // The first line feed is ignored. Others aren’t.\n if (skip) {\n subvalue += character\n skip = false\n } else {\n closing += character\n exdentedClosing += character\n }\n\n queue = ''\n index++\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space) {\n break\n }\n\n queue += character\n index++\n }\n\n closing += queue\n exdentedClosing += queue.slice(indent)\n\n if (queue.length >= tabSize) {\n continue\n }\n\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== marker) {\n break\n }\n\n queue += character\n index++\n }\n\n closing += queue\n exdentedClosing += queue\n\n if (queue.length < fenceCount) {\n continue\n }\n\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n closing += character\n exdentedClosing += character\n index++\n }\n\n if (!character || character === lineFeed) {\n break\n }\n }\n\n subvalue += content + closing\n\n // Get lang and meta from the flag.\n index = -1\n length = flag.length\n\n while (++index < length) {\n character = flag.charAt(index)\n\n if (character === space || character === tab) {\n if (!lang) {\n lang = flag.slice(0, index)\n }\n } else if (lang) {\n meta = flag.slice(index)\n break\n }\n }\n\n return eat(subvalue)({\n type: 'code',\n lang: lang || flag || null,\n meta: meta || null,\n value: exdentedContent\n })\n}\n","\nexports = module.exports = trim;\n\nfunction trim(str){\n return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n return str.replace(/\\s*$/, '');\n};\n","'use strict'\n\nmodule.exports = interrupt\n\nfunction interrupt(interruptors, tokenizers, ctx, parameters) {\n var length = interruptors.length\n var index = -1\n var interruptor\n var config\n\n while (++index < length) {\n interruptor = interruptors[index]\n config = interruptor[1] || {}\n\n if (\n config.pedantic !== undefined &&\n config.pedantic !== ctx.options.pedantic\n ) {\n continue\n }\n\n if (\n config.commonmark !== undefined &&\n config.commonmark !== ctx.options.commonmark\n ) {\n continue\n }\n\n if (tokenizers[interruptor[0]].apply(ctx, parameters)) {\n return true\n }\n }\n\n return false\n}\n","'use strict'\n\nvar trim = require('trim')\nvar interrupt = require('../util/interrupt')\n\nmodule.exports = blockquote\n\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\nvar greaterThan = '>'\n\nfunction blockquote(eat, value, silent) {\n var self = this\n var offsets = self.offset\n var tokenizers = self.blockTokenizers\n var interruptors = self.interruptBlockquote\n var now = eat.now()\n var currentLine = now.line\n var length = value.length\n var values = []\n var contents = []\n var indents = []\n var add\n var index = 0\n var character\n var rest\n var nextIndex\n var content\n var line\n var startIndex\n var prefixed\n var exit\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n index++\n }\n\n if (value.charAt(index) !== greaterThan) {\n return\n }\n\n if (silent) {\n return true\n }\n\n index = 0\n\n while (index < length) {\n nextIndex = value.indexOf(lineFeed, index)\n startIndex = index\n prefixed = false\n\n if (nextIndex === -1) {\n nextIndex = length\n }\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n index++\n }\n\n if (value.charAt(index) === greaterThan) {\n index++\n prefixed = true\n\n if (value.charAt(index) === space) {\n index++\n }\n } else {\n index = startIndex\n }\n\n content = value.slice(index, nextIndex)\n\n if (!prefixed && !trim(content)) {\n index = startIndex\n break\n }\n\n if (!prefixed) {\n rest = value.slice(index)\n\n // Check if the following code contains a possible block.\n if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {\n break\n }\n }\n\n line = startIndex === index ? content : value.slice(startIndex, nextIndex)\n\n indents.push(index - startIndex)\n values.push(line)\n contents.push(content)\n\n index = nextIndex + 1\n }\n\n index = -1\n length = indents.length\n add = eat(values.join(lineFeed))\n\n while (++index < length) {\n offsets[currentLine] = (offsets[currentLine] || 0) + indents[index]\n currentLine++\n }\n\n exit = self.enterBlock()\n contents = self.tokenizeBlock(contents.join(lineFeed), now)\n exit()\n\n return add({type: 'blockquote', children: contents})\n}\n","'use strict'\n\nmodule.exports = atxHeading\n\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\nvar numberSign = '#'\n\nvar maxFenceCount = 6\n\nfunction atxHeading(eat, value, silent) {\n var self = this\n var pedantic = self.options.pedantic\n var length = value.length + 1\n var index = -1\n var now = eat.now()\n var subvalue = ''\n var content = ''\n var character\n var queue\n var depth\n\n // Eat initial spacing.\n while (++index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n index--\n break\n }\n\n subvalue += character\n }\n\n // Eat hashes.\n depth = 0\n\n while (++index <= length) {\n character = value.charAt(index)\n\n if (character !== numberSign) {\n index--\n break\n }\n\n subvalue += character\n depth++\n }\n\n if (depth > maxFenceCount) {\n return\n }\n\n if (!depth || (!pedantic && value.charAt(index + 1) === numberSign)) {\n return\n }\n\n length = value.length + 1\n\n // Eat intermediate white-space.\n queue = ''\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n index--\n break\n }\n\n queue += character\n }\n\n // Exit when not in pedantic mode without spacing.\n if (!pedantic && queue.length === 0 && character && character !== lineFeed) {\n return\n }\n\n if (silent) {\n return true\n }\n\n // Eat content.\n subvalue += queue\n queue = ''\n content = ''\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (!character || character === lineFeed) {\n break\n }\n\n if (character !== space && character !== tab && character !== numberSign) {\n content += queue + character\n queue = ''\n continue\n }\n\n while (character === space || character === tab) {\n queue += character\n character = value.charAt(++index)\n }\n\n // `#` without a queue is part of the content.\n if (!pedantic && content && !queue && character === numberSign) {\n content += character\n continue\n }\n\n while (character === numberSign) {\n queue += character\n character = value.charAt(++index)\n }\n\n while (character === space || character === tab) {\n queue += character\n character = value.charAt(++index)\n }\n\n index--\n }\n\n now.column += subvalue.length\n now.offset += subvalue.length\n subvalue += content + queue\n\n return eat(subvalue)({\n type: 'heading',\n depth: depth,\n children: self.tokenizeInline(content, now)\n })\n}\n","'use strict'\n\nmodule.exports = thematicBreak\n\nvar tab = '\\t'\nvar lineFeed = '\\n'\nvar space = ' '\nvar asterisk = '*'\nvar dash = '-'\nvar underscore = '_'\n\nvar maxCount = 3\n\nfunction thematicBreak(eat, value, silent) {\n var index = -1\n var length = value.length + 1\n var subvalue = ''\n var character\n var marker\n var markerCount\n var queue\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space) {\n break\n }\n\n subvalue += character\n }\n\n if (\n character !== asterisk &&\n character !== dash &&\n character !== underscore\n ) {\n return\n }\n\n marker = character\n subvalue += character\n markerCount = 1\n queue = ''\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character === marker) {\n markerCount++\n subvalue += queue + marker\n queue = ''\n } else if (character === space) {\n queue += character\n } else if (\n markerCount >= maxCount &&\n (!character || character === lineFeed)\n ) {\n subvalue += queue\n\n if (silent) {\n return true\n }\n\n return eat(subvalue)({type: 'thematicBreak'})\n } else {\n return\n }\n }\n}\n","'use strict'\n\nmodule.exports = indentation\n\nvar tab = '\\t'\nvar space = ' '\n\nvar spaceSize = 1\nvar tabSize = 4\n\n// Gets indentation information for a line.\nfunction indentation(value) {\n var index = 0\n var indent = 0\n var character = value.charAt(index)\n var stops = {}\n var size\n var lastIndent = 0\n\n while (character === tab || character === space) {\n size = character === tab ? tabSize : spaceSize\n\n indent += size\n\n if (size > 1) {\n indent = Math.floor(indent / size) * size\n }\n\n while (lastIndent < indent) {\n stops[++lastIndent] = index\n }\n\n character = value.charAt(++index)\n }\n\n return {indent: indent, stops: stops}\n}\n","'use strict'\n\nvar trim = require('trim')\nvar repeat = require('repeat-string')\nvar getIndent = require('./get-indentation')\n\nmodule.exports = indentation\n\nvar lineFeed = '\\n'\nvar space = ' '\nvar exclamationMark = '!'\n\n// Remove the minimum indent from every line in `value`. Supports both tab,\n// spaced, and mixed indentation (as well as possible).\nfunction indentation(value, maximum) {\n var values = value.split(lineFeed)\n var position = values.length + 1\n var minIndent = Infinity\n var matrix = []\n var index\n var indentation\n var stops\n\n values.unshift(repeat(space, maximum) + exclamationMark)\n\n while (position--) {\n indentation = getIndent(values[position])\n\n matrix[position] = indentation.stops\n\n if (trim(values[position]).length === 0) {\n continue\n }\n\n if (indentation.indent) {\n if (indentation.indent > 0 && indentation.indent < minIndent) {\n minIndent = indentation.indent\n }\n } else {\n minIndent = Infinity\n\n break\n }\n }\n\n if (minIndent !== Infinity) {\n position = values.length\n\n while (position--) {\n stops = matrix[position]\n index = minIndent\n\n while (index && !(index in stops)) {\n index--\n }\n\n values[position] = values[position].slice(stops[index] + 1)\n }\n }\n\n values.shift()\n\n return values.join(lineFeed)\n}\n","'use strict'\n\nvar trim = require('trim')\nvar repeat = require('repeat-string')\nvar decimal = require('is-decimal')\nvar getIndent = require('../util/get-indentation')\nvar removeIndent = require('../util/remove-indentation')\nvar interrupt = require('../util/interrupt')\n\nmodule.exports = list\n\nvar asterisk = '*'\nvar underscore = '_'\nvar plusSign = '+'\nvar dash = '-'\nvar dot = '.'\nvar space = ' '\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar rightParenthesis = ')'\nvar lowercaseX = 'x'\n\nvar tabSize = 4\nvar looseListItemExpression = /\\n\\n(?!\\s*$)/\nvar taskItemExpression = /^\\[([ X\\tx])][ \\t]/\nvar bulletExpression = /^([ \\t]*)([*+-]|\\d+[.)])( {1,4}(?! )| |\\t|$|(?=\\n))([^\\n]*)/\nvar pedanticBulletExpression = /^([ \\t]*)([*+-]|\\d+[.)])([ \\t]+)/\nvar initialIndentExpression = /^( {1,4}|\\t)?/gm\n\nfunction list(eat, value, silent) {\n var self = this\n var commonmark = self.options.commonmark\n var pedantic = self.options.pedantic\n var tokenizers = self.blockTokenizers\n var interuptors = self.interruptList\n var index = 0\n var length = value.length\n var start = null\n var size\n var queue\n var ordered\n var character\n var marker\n var nextIndex\n var startIndex\n var prefixed\n var currentMarker\n var content\n var line\n var previousEmpty\n var empty\n var items\n var allLines\n var emptyLines\n var item\n var enterTop\n var exitBlockquote\n var spread = false\n var node\n var now\n var end\n var indented\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space) {\n break\n }\n\n index++\n }\n\n character = value.charAt(index)\n\n if (character === asterisk || character === plusSign || character === dash) {\n marker = character\n ordered = false\n } else {\n ordered = true\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (!decimal(character)) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (\n !queue ||\n !(character === dot || (commonmark && character === rightParenthesis))\n ) {\n return\n }\n\n /* Slightly abusing `silent` mode, whose goal is to make interrupting\n * paragraphs work.\n * Well, that’s exactly what we want to do here: don’t interrupt:\n * 2. here, because the “list” doesn’t start with `1`. */\n if (silent && queue !== '1') {\n return\n }\n\n start = parseInt(queue, 10)\n marker = character\n }\n\n character = value.charAt(++index)\n\n if (\n character !== space &&\n character !== tab &&\n (pedantic || (character !== lineFeed && character !== ''))\n ) {\n return\n }\n\n if (silent) {\n return true\n }\n\n index = 0\n items = []\n allLines = []\n emptyLines = []\n\n while (index < length) {\n nextIndex = value.indexOf(lineFeed, index)\n startIndex = index\n prefixed = false\n indented = false\n\n if (nextIndex === -1) {\n nextIndex = length\n }\n\n size = 0\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === tab) {\n size += tabSize - (size % tabSize)\n } else if (character === space) {\n size++\n } else {\n break\n }\n\n index++\n }\n\n if (item && size >= item.indent) {\n indented = true\n }\n\n character = value.charAt(index)\n currentMarker = null\n\n if (!indented) {\n if (\n character === asterisk ||\n character === plusSign ||\n character === dash\n ) {\n currentMarker = character\n index++\n size++\n } else {\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (!decimal(character)) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n index++\n\n if (\n queue &&\n (character === dot || (commonmark && character === rightParenthesis))\n ) {\n currentMarker = character\n size += queue.length + 1\n }\n }\n\n if (currentMarker) {\n character = value.charAt(index)\n\n if (character === tab) {\n size += tabSize - (size % tabSize)\n index++\n } else if (character === space) {\n end = index + tabSize\n\n while (index < end) {\n if (value.charAt(index) !== space) {\n break\n }\n\n index++\n size++\n }\n\n if (index === end && value.charAt(index) === space) {\n index -= tabSize - 1\n size -= tabSize - 1\n }\n } else if (character !== lineFeed && character !== '') {\n currentMarker = null\n }\n }\n }\n\n if (currentMarker) {\n if (!pedantic && marker !== currentMarker) {\n break\n }\n\n prefixed = true\n } else {\n if (!commonmark && !indented && value.charAt(startIndex) === space) {\n indented = true\n } else if (commonmark && item) {\n indented = size >= item.indent || size > tabSize\n }\n\n prefixed = false\n index = startIndex\n }\n\n line = value.slice(startIndex, nextIndex)\n content = startIndex === index ? line : value.slice(index, nextIndex)\n\n if (\n currentMarker === asterisk ||\n currentMarker === underscore ||\n currentMarker === dash\n ) {\n if (tokenizers.thematicBreak.call(self, eat, line, true)) {\n break\n }\n }\n\n previousEmpty = empty\n empty = !prefixed && !trim(content).length\n\n if (indented && item) {\n item.value = item.value.concat(emptyLines, line)\n allLines = allLines.concat(emptyLines, line)\n emptyLines = []\n } else if (prefixed) {\n if (emptyLines.length !== 0) {\n spread = true\n item.value.push('')\n item.trail = emptyLines.concat()\n }\n\n item = {\n value: [line],\n indent: size,\n trail: []\n }\n\n items.push(item)\n allLines = allLines.concat(emptyLines, line)\n emptyLines = []\n } else if (empty) {\n if (previousEmpty && !commonmark) {\n break\n }\n\n emptyLines.push(line)\n } else {\n if (previousEmpty) {\n break\n }\n\n if (interrupt(interuptors, tokenizers, self, [eat, line, true])) {\n break\n }\n\n item.value = item.value.concat(emptyLines, line)\n allLines = allLines.concat(emptyLines, line)\n emptyLines = []\n }\n\n index = nextIndex + 1\n }\n\n node = eat(allLines.join(lineFeed)).reset({\n type: 'list',\n ordered: ordered,\n start: start,\n spread: spread,\n children: []\n })\n\n enterTop = self.enterList()\n exitBlockquote = self.enterBlock()\n index = -1\n length = items.length\n\n while (++index < length) {\n item = items[index].value.join(lineFeed)\n now = eat.now()\n\n eat(item)(listItem(self, item, now), node)\n\n item = items[index].trail.join(lineFeed)\n\n if (index !== length - 1) {\n item += lineFeed\n }\n\n eat(item)\n }\n\n enterTop()\n exitBlockquote()\n\n return node\n}\n\nfunction listItem(ctx, value, position) {\n var offsets = ctx.offset\n var fn = ctx.options.pedantic ? pedanticListItem : normalListItem\n var checked = null\n var task\n var indent\n\n value = fn.apply(null, arguments)\n\n if (ctx.options.gfm) {\n task = value.match(taskItemExpression)\n\n if (task) {\n indent = task[0].length\n checked = task[1].toLowerCase() === lowercaseX\n offsets[position.line] += indent\n value = value.slice(indent)\n }\n }\n\n return {\n type: 'listItem',\n spread: looseListItemExpression.test(value),\n checked: checked,\n children: ctx.tokenizeBlock(value, position)\n }\n}\n\n// Create a list-item using overly simple mechanics.\nfunction pedanticListItem(ctx, value, position) {\n var offsets = ctx.offset\n var line = position.line\n\n // Remove the list-item’s bullet.\n value = value.replace(pedanticBulletExpression, replacer)\n\n // The initial line was also matched by the below, so we reset the `line`.\n line = position.line\n\n return value.replace(initialIndentExpression, replacer)\n\n // A simple replacer which removed all matches, and adds their length to\n // `offset`.\n function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length\n line++\n\n return ''\n }\n}\n\n// Create a list-item using sane mechanics.\nfunction normalListItem(ctx, value, position) {\n var offsets = ctx.offset\n var line = position.line\n var max\n var bullet\n var rest\n var lines\n var trimmedLines\n var index\n var length\n\n // Remove the list-item’s bullet.\n value = value.replace(bulletExpression, replacer)\n\n lines = value.split(lineFeed)\n\n trimmedLines = removeIndent(value, getIndent(max).indent).split(lineFeed)\n\n // We replaced the initial bullet with something else above, which was used\n // to trick `removeIndentation` into removing some more characters when\n // possible. However, that could result in the initial line to be stripped\n // more than it should be.\n trimmedLines[0] = rest\n\n offsets[line] = (offsets[line] || 0) + bullet.length\n line++\n\n index = 0\n length = lines.length\n\n while (++index < length) {\n offsets[line] =\n (offsets[line] || 0) + lines[index].length - trimmedLines[index].length\n line++\n }\n\n return trimmedLines.join(lineFeed)\n\n /* eslint-disable-next-line max-params */\n function replacer($0, $1, $2, $3, $4) {\n bullet = $1 + $2 + $3\n rest = $4\n\n // Make sure that the first nine numbered list items can indent with an\n // extra space. That is, when the bullet did not receive an extra final\n // space.\n if (Number($2) < 10 && bullet.length % 2 === 1) {\n $2 = space + $2\n }\n\n max = $1 + repeat(space, $2.length) + $3\n\n return max + rest\n }\n}\n","'use strict'\n\nmodule.exports = setextHeading\n\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\nvar equalsTo = '='\nvar dash = '-'\n\nvar maxIndent = 3\n\nvar equalsToDepth = 1\nvar dashDepth = 2\n\nfunction setextHeading(eat, value, silent) {\n var self = this\n var now = eat.now()\n var length = value.length\n var index = -1\n var subvalue = ''\n var content\n var queue\n var character\n var marker\n var depth\n\n // Eat initial indentation.\n while (++index < length) {\n character = value.charAt(index)\n\n if (character !== space || index >= maxIndent) {\n index--\n break\n }\n\n subvalue += character\n }\n\n // Eat content.\n content = ''\n queue = ''\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character === lineFeed) {\n index--\n break\n }\n\n if (character === space || character === tab) {\n queue += character\n } else {\n content += queue + character\n queue = ''\n }\n }\n\n now.column += subvalue.length\n now.offset += subvalue.length\n subvalue += content + queue\n\n // Ensure the content is followed by a newline and a valid marker.\n character = value.charAt(++index)\n marker = value.charAt(++index)\n\n if (character !== lineFeed || (marker !== equalsTo && marker !== dash)) {\n return\n }\n\n subvalue += character\n\n // Eat Setext-line.\n queue = marker\n depth = marker === equalsTo ? equalsToDepth : dashDepth\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character !== marker) {\n if (character !== lineFeed) {\n return\n }\n\n index--\n break\n }\n\n queue += character\n }\n\n if (silent) {\n return true\n }\n\n return eat(subvalue + queue)({\n type: 'heading',\n depth: depth,\n children: self.tokenizeInline(content, now)\n })\n}\n","'use strict'\n\nvar attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*'\nvar unquoted = '[^\"\\'=<>`\\\\u0000-\\\\u0020]+'\nvar singleQuoted = \"'[^']*'\"\nvar doubleQuoted = '\"[^\"]*\"'\nvar attributeValue =\n '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')'\nvar attribute =\n '(?:\\\\s+' + attributeName + '(?:\\\\s*=\\\\s*' + attributeValue + ')?)'\nvar openTag = '<[A-Za-z][A-Za-z0-9\\\\-]*' + attribute + '*\\\\s*\\\\/?>'\nvar closeTag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>'\nvar comment = '|'\nvar processing = '<[?].*?[?]>'\nvar declaration = ']*>'\nvar cdata = ''\n\nexports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')')\n\nexports.tag = new RegExp(\n '^(?:' +\n openTag +\n '|' +\n closeTag +\n '|' +\n comment +\n '|' +\n processing +\n '|' +\n declaration +\n '|' +\n cdata +\n ')'\n)\n","'use strict'\n\nvar openCloseTag = require('../util/html').openCloseTag\n\nmodule.exports = blockHtml\n\nvar tab = '\\t'\nvar space = ' '\nvar lineFeed = '\\n'\nvar lessThan = '<'\n\nvar rawOpenExpression = /^<(script|pre|style)(?=(\\s|>|$))/i\nvar rawCloseExpression = /<\\/(script|pre|style)>/i\nvar commentOpenExpression = /^/\nvar instructionOpenExpression = /^<\\?/\nvar instructionCloseExpression = /\\?>/\nvar directiveOpenExpression = /^/\nvar cdataOpenExpression = /^/\nvar elementCloseExpression = /^$/\nvar otherElementOpenExpression = new RegExp(openCloseTag.source + '\\\\s*$')\n\nfunction blockHtml(eat, value, silent) {\n var self = this\n var blocks = self.options.blocks.join('|')\n var elementOpenExpression = new RegExp(\n '^|$))',\n 'i'\n )\n var length = value.length\n var index = 0\n var next\n var line\n var offset\n var character\n var count\n var sequence\n var subvalue\n\n var sequences = [\n [rawOpenExpression, rawCloseExpression, true],\n [commentOpenExpression, commentCloseExpression, true],\n [instructionOpenExpression, instructionCloseExpression, true],\n [directiveOpenExpression, directiveCloseExpression, true],\n [cdataOpenExpression, cdataCloseExpression, true],\n [elementOpenExpression, elementCloseExpression, true],\n [otherElementOpenExpression, elementCloseExpression, false]\n ]\n\n // Eat initial spacing.\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space) {\n break\n }\n\n index++\n }\n\n if (value.charAt(index) !== lessThan) {\n return\n }\n\n next = value.indexOf(lineFeed, index + 1)\n next = next === -1 ? length : next\n line = value.slice(index, next)\n offset = -1\n count = sequences.length\n\n while (++offset < count) {\n if (sequences[offset][0].test(line)) {\n sequence = sequences[offset]\n break\n }\n }\n\n if (!sequence) {\n return\n }\n\n if (silent) {\n return sequence[2]\n }\n\n index = next\n\n if (!sequence[1].test(line)) {\n while (index < length) {\n next = value.indexOf(lineFeed, index + 1)\n next = next === -1 ? length : next\n line = value.slice(index + 1, next)\n\n if (sequence[1].test(line)) {\n if (line) {\n index = next\n }\n\n break\n }\n\n index = next\n }\n }\n\n subvalue = value.slice(0, index)\n\n return eat(subvalue)({type: 'html', value: subvalue})\n}\n","'use strict'\n\nmodule.exports = whitespace\n\nvar fromCode = String.fromCharCode\nvar re = /\\s/\n\n// Check if the given character code, or the character code at the first\n// character, is a whitespace character.\nfunction whitespace(character) {\n return re.test(\n typeof character === 'number' ? fromCode(character) : character.charAt(0)\n )\n}\n","'use strict'\n\nmodule.exports = collapse\n\n// `collapse(' \\t\\nbar \\nbaz\\t') // ' bar baz '`\nfunction collapse(value) {\n return String(value).replace(/\\s+/g, ' ')\n}\n","'use strict'\n\nvar collapseWhiteSpace = require('collapse-white-space')\n\nmodule.exports = normalize\n\n// Normalize an identifier. Collapses multiple white space characters into a\n// single space, and removes casing.\nfunction normalize(value) {\n return collapseWhiteSpace(value).toLowerCase()\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\nvar normalize = require('../util/normalize')\n\nmodule.exports = definition\n\nvar quotationMark = '\"'\nvar apostrophe = \"'\"\nvar backslash = '\\\\'\nvar lineFeed = '\\n'\nvar tab = '\\t'\nvar space = ' '\nvar leftSquareBracket = '['\nvar rightSquareBracket = ']'\nvar leftParenthesis = '('\nvar rightParenthesis = ')'\nvar colon = ':'\nvar lessThan = '<'\nvar greaterThan = '>'\n\nfunction definition(eat, value, silent) {\n var self = this\n var commonmark = self.options.commonmark\n var index = 0\n var length = value.length\n var subvalue = ''\n var beforeURL\n var beforeTitle\n var queue\n var character\n var test\n var identifier\n var url\n var title\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== space && character !== tab) {\n break\n }\n\n subvalue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (character !== leftSquareBracket) {\n return\n }\n\n index++\n subvalue += character\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === rightSquareBracket) {\n break\n } else if (character === backslash) {\n queue += character\n index++\n character = value.charAt(index)\n }\n\n queue += character\n index++\n }\n\n if (\n !queue ||\n value.charAt(index) !== rightSquareBracket ||\n value.charAt(index + 1) !== colon\n ) {\n return\n }\n\n identifier = queue\n subvalue += queue + rightSquareBracket + colon\n index = subvalue.length\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space && character !== lineFeed) {\n break\n }\n\n subvalue += character\n index++\n }\n\n character = value.charAt(index)\n queue = ''\n beforeURL = subvalue\n\n if (character === lessThan) {\n index++\n\n while (index < length) {\n character = value.charAt(index)\n\n if (!isEnclosedURLCharacter(character)) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (character === isEnclosedURLCharacter.delimiter) {\n subvalue += lessThan + queue + character\n index++\n } else {\n if (commonmark) {\n return\n }\n\n index -= queue.length + 1\n queue = ''\n }\n }\n\n if (!queue) {\n while (index < length) {\n character = value.charAt(index)\n\n if (!isUnclosedURLCharacter(character)) {\n break\n }\n\n queue += character\n index++\n }\n\n subvalue += queue\n }\n\n if (!queue) {\n return\n }\n\n url = queue\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space && character !== lineFeed) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n test = null\n\n if (character === quotationMark) {\n test = quotationMark\n } else if (character === apostrophe) {\n test = apostrophe\n } else if (character === leftParenthesis) {\n test = rightParenthesis\n }\n\n if (!test) {\n queue = ''\n index = subvalue.length\n } else if (queue) {\n subvalue += queue + character\n index = subvalue.length\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === test) {\n break\n }\n\n if (character === lineFeed) {\n index++\n character = value.charAt(index)\n\n if (character === lineFeed || character === test) {\n return\n }\n\n queue += lineFeed\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (character !== test) {\n return\n }\n\n beforeTitle = subvalue\n subvalue += queue + character\n index++\n title = queue\n queue = ''\n } else {\n return\n }\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character !== tab && character !== space) {\n break\n }\n\n subvalue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (!character || character === lineFeed) {\n if (silent) {\n return true\n }\n\n beforeURL = eat(beforeURL).test().end\n url = self.decode.raw(self.unescape(url), beforeURL, {nonTerminated: false})\n\n if (title) {\n beforeTitle = eat(beforeTitle).test().end\n title = self.decode.raw(self.unescape(title), beforeTitle)\n }\n\n return eat(subvalue)({\n type: 'definition',\n identifier: normalize(identifier),\n label: identifier,\n title: title || null,\n url: url\n })\n }\n}\n\n// Check if `character` can be inside an enclosed URI.\nfunction isEnclosedURLCharacter(character) {\n return (\n character !== greaterThan &&\n character !== leftSquareBracket &&\n character !== rightSquareBracket\n )\n}\n\nisEnclosedURLCharacter.delimiter = greaterThan\n\n// Check if `character` can be inside an unclosed URI.\nfunction isUnclosedURLCharacter(character) {\n return (\n character !== leftSquareBracket &&\n character !== rightSquareBracket &&\n !whitespace(character)\n )\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\n\nmodule.exports = table\n\nvar tab = '\\t'\nvar lineFeed = '\\n'\nvar space = ' '\nvar dash = '-'\nvar colon = ':'\nvar backslash = '\\\\'\nvar verticalBar = '|'\n\nvar minColumns = 1\nvar minRows = 2\n\nvar left = 'left'\nvar center = 'center'\nvar right = 'right'\n\nfunction table(eat, value, silent) {\n var self = this\n var index\n var alignments\n var alignment\n var subvalue\n var row\n var length\n var lines\n var queue\n var character\n var hasDash\n var align\n var cell\n var preamble\n var now\n var position\n var lineCount\n var line\n var rows\n var table\n var lineIndex\n var pipeIndex\n var first\n\n // Exit when not in gfm-mode.\n if (!self.options.gfm) {\n return\n }\n\n // Get the rows.\n // Detecting tables soon is hard, so there are some checks for performance\n // here, such as the minimum number of rows, and allowed characters in the\n // alignment row.\n index = 0\n lineCount = 0\n length = value.length + 1\n lines = []\n\n while (index < length) {\n lineIndex = value.indexOf(lineFeed, index)\n pipeIndex = value.indexOf(verticalBar, index + 1)\n\n if (lineIndex === -1) {\n lineIndex = value.length\n }\n\n if (pipeIndex === -1 || pipeIndex > lineIndex) {\n if (lineCount < minRows) {\n return\n }\n\n break\n }\n\n lines.push(value.slice(index, lineIndex))\n lineCount++\n index = lineIndex + 1\n }\n\n // Parse the alignment row.\n subvalue = lines.join(lineFeed)\n alignments = lines.splice(1, 1)[0] || []\n index = 0\n length = alignments.length\n lineCount--\n alignment = false\n align = []\n\n while (index < length) {\n character = alignments.charAt(index)\n\n if (character === verticalBar) {\n hasDash = null\n\n if (alignment === false) {\n if (first === false) {\n return\n }\n } else {\n align.push(alignment)\n alignment = false\n }\n\n first = false\n } else if (character === dash) {\n hasDash = true\n alignment = alignment || null\n } else if (character === colon) {\n if (alignment === left) {\n alignment = center\n } else if (hasDash && alignment === null) {\n alignment = right\n } else {\n alignment = left\n }\n } else if (!whitespace(character)) {\n return\n }\n\n index++\n }\n\n if (alignment !== false) {\n align.push(alignment)\n }\n\n // Exit when without enough columns.\n if (align.length < minColumns) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n // Parse the rows.\n position = -1\n rows = []\n\n table = eat(subvalue).reset({type: 'table', align: align, children: rows})\n\n while (++position < lineCount) {\n line = lines[position]\n row = {type: 'tableRow', children: []}\n\n // Eat a newline character when this is not the first row.\n if (position) {\n eat(lineFeed)\n }\n\n // Eat the row.\n eat(line).reset(row, table)\n\n length = line.length + 1\n index = 0\n queue = ''\n cell = ''\n preamble = true\n\n while (index < length) {\n character = line.charAt(index)\n\n if (character === tab || character === space) {\n if (cell) {\n queue += character\n } else {\n eat(character)\n }\n\n index++\n continue\n }\n\n if (character === '' || character === verticalBar) {\n if (preamble) {\n eat(character)\n } else {\n if ((cell || character) && !preamble) {\n subvalue = cell\n\n if (queue.length > 1) {\n if (character) {\n subvalue += queue.slice(0, -1)\n queue = queue.charAt(queue.length - 1)\n } else {\n subvalue += queue\n queue = ''\n }\n }\n\n now = eat.now()\n\n eat(subvalue)(\n {type: 'tableCell', children: self.tokenizeInline(cell, now)},\n row\n )\n }\n\n eat(queue + character)\n\n queue = ''\n cell = ''\n }\n } else {\n if (queue) {\n cell += queue\n queue = ''\n }\n\n cell += character\n\n if (character === backslash && index !== length - 2) {\n cell += line.charAt(index + 1)\n index++\n }\n }\n\n preamble = false\n index++\n }\n\n // Eat the alignment row.\n if (!position) {\n eat(lineFeed + alignments)\n }\n }\n\n return table\n}\n","'use strict'\n\nvar trim = require('trim')\nvar trimTrailingLines = require('trim-trailing-lines')\nvar interrupt = require('../util/interrupt')\n\nmodule.exports = paragraph\n\nvar tab = '\\t'\nvar lineFeed = '\\n'\nvar space = ' '\n\nvar tabSize = 4\n\n// Tokenise paragraph.\nfunction paragraph(eat, value, silent) {\n var self = this\n var settings = self.options\n var commonmark = settings.commonmark\n var tokenizers = self.blockTokenizers\n var interruptors = self.interruptParagraph\n var index = value.indexOf(lineFeed)\n var length = value.length\n var position\n var subvalue\n var character\n var size\n var now\n\n while (index < length) {\n // Eat everything if there’s no following newline.\n if (index === -1) {\n index = length\n break\n }\n\n // Stop if the next character is NEWLINE.\n if (value.charAt(index + 1) === lineFeed) {\n break\n }\n\n // In commonmark-mode, following indented lines are part of the paragraph.\n if (commonmark) {\n size = 0\n position = index + 1\n\n while (position < length) {\n character = value.charAt(position)\n\n if (character === tab) {\n size = tabSize\n break\n } else if (character === space) {\n size++\n } else {\n break\n }\n\n position++\n }\n\n if (size >= tabSize && character !== lineFeed) {\n index = value.indexOf(lineFeed, index + 1)\n continue\n }\n }\n\n subvalue = value.slice(index + 1)\n\n // Check if the following code contains a possible block.\n if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) {\n break\n }\n\n position = index\n index = value.indexOf(lineFeed, index + 1)\n\n if (index !== -1 && trim(value.slice(position, index)) === '') {\n index = position\n break\n }\n }\n\n subvalue = value.slice(0, index)\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n now = eat.now()\n subvalue = trimTrailingLines(subvalue)\n\n return eat(subvalue)({\n type: 'paragraph',\n children: self.tokenizeInline(subvalue, now)\n })\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n return value.indexOf('\\\\', fromIndex)\n}\n","'use strict'\n\nvar locate = require('../locate/escape')\n\nmodule.exports = escape\nescape.locator = locate\n\nvar lineFeed = '\\n'\nvar backslash = '\\\\'\n\nfunction escape(eat, value, silent) {\n var self = this\n var character\n var node\n\n if (value.charAt(0) === backslash) {\n character = value.charAt(1)\n\n if (self.escape.indexOf(character) !== -1) {\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n if (character === lineFeed) {\n node = {type: 'break'}\n } else {\n node = {type: 'text', value: character}\n }\n\n return eat(backslash + character)(node)\n }\n }\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n return value.indexOf('<', fromIndex)\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\nvar decode = require('parse-entities')\nvar locate = require('../locate/tag')\n\nmodule.exports = autoLink\nautoLink.locator = locate\nautoLink.notInLink = true\n\nvar lessThan = '<'\nvar greaterThan = '>'\nvar atSign = '@'\nvar slash = '/'\nvar mailto = 'mailto:'\nvar mailtoLength = mailto.length\n\nfunction autoLink(eat, value, silent) {\n var self = this\n var subvalue = ''\n var length = value.length\n var index = 0\n var queue = ''\n var hasAtCharacter = false\n var link = ''\n var character\n var now\n var content\n var tokenizers\n var exit\n\n if (value.charAt(0) !== lessThan) {\n return\n }\n\n index++\n subvalue = lessThan\n\n while (index < length) {\n character = value.charAt(index)\n\n if (\n whitespace(character) ||\n character === greaterThan ||\n character === atSign ||\n (character === ':' && value.charAt(index + 1) === slash)\n ) {\n break\n }\n\n queue += character\n index++\n }\n\n if (!queue) {\n return\n }\n\n link += queue\n queue = ''\n\n character = value.charAt(index)\n link += character\n index++\n\n if (character === atSign) {\n hasAtCharacter = true\n } else {\n if (character !== ':' || value.charAt(index + 1) !== slash) {\n return\n }\n\n link += slash\n index++\n }\n\n while (index < length) {\n character = value.charAt(index)\n\n if (whitespace(character) || character === greaterThan) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n\n if (!queue || character !== greaterThan) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n link += queue\n content = link\n subvalue += link + character\n now = eat.now()\n now.column++\n now.offset++\n\n if (hasAtCharacter) {\n if (link.slice(0, mailtoLength).toLowerCase() === mailto) {\n content = content.slice(mailtoLength)\n now.column += mailtoLength\n now.offset += mailtoLength\n } else {\n link = mailto + link\n }\n }\n\n // Temporarily remove all tokenizers except text in autolinks.\n tokenizers = self.inlineTokenizers\n self.inlineTokenizers = {text: tokenizers.text}\n\n exit = self.enterLink()\n\n content = self.tokenizeInline(content, now)\n\n self.inlineTokenizers = tokenizers\n exit()\n\n return eat(subvalue)({\n type: 'link',\n title: null,\n url: decode(link, {nonTerminated: false}),\n children: content\n })\n}\n","'use strict'\n\nmodule.exports = ccount\n\nfunction ccount(value, character) {\n var val = String(value)\n var count = 0\n var index\n\n if (typeof character !== 'string' || character.length !== 1) {\n throw new Error('Expected character')\n }\n\n index = val.indexOf(character)\n\n while (index !== -1) {\n count++\n index = val.indexOf(character, index + 1)\n }\n\n return count\n}\n","'use strict'\n\nmodule.exports = locate\n\nvar values = ['www.', 'http://', 'https://']\n\nfunction locate(value, fromIndex) {\n var min = -1\n var index\n var length\n var position\n\n if (!this.options.gfm) {\n return min\n }\n\n length = values.length\n index = -1\n\n while (++index < length) {\n position = value.indexOf(values[index], fromIndex)\n\n if (position !== -1 && (min === -1 || position < min)) {\n min = position\n }\n }\n\n return min\n}\n","'use strict'\n\nvar ccount = require('ccount')\nvar decode = require('parse-entities')\nvar decimal = require('is-decimal')\nvar alphabetical = require('is-alphabetical')\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/url')\n\nmodule.exports = url\nurl.locator = locate\nurl.notInLink = true\n\nvar exclamationMark = 33 // '!'\nvar ampersand = 38 // '&'\nvar rightParenthesis = 41 // ')'\nvar asterisk = 42 // '*'\nvar comma = 44 // ','\nvar dash = 45 // '-'\nvar dot = 46 // '.'\nvar colon = 58 // ':'\nvar semicolon = 59 // ';'\nvar questionMark = 63 // '?'\nvar lessThan = 60 // '<'\nvar underscore = 95 // '_'\nvar tilde = 126 // '~'\n\nvar leftParenthesisCharacter = '('\nvar rightParenthesisCharacter = ')'\n\nfunction url(eat, value, silent) {\n var self = this\n var gfm = self.options.gfm\n var tokenizers = self.inlineTokenizers\n var length = value.length\n var previousDot = -1\n var protocolless = false\n var dots\n var lastTwoPartsStart\n var start\n var index\n var pathStart\n var path\n var code\n var end\n var leftCount\n var rightCount\n var content\n var children\n var url\n var exit\n\n if (!gfm) {\n return\n }\n\n // `WWW.` doesn’t work.\n if (value.slice(0, 4) === 'www.') {\n protocolless = true\n index = 4\n } else if (value.slice(0, 7).toLowerCase() === 'http://') {\n index = 7\n } else if (value.slice(0, 8).toLowerCase() === 'https://') {\n index = 8\n } else {\n return\n }\n\n // Act as if the starting boundary is a dot.\n previousDot = index - 1\n\n // Parse a valid domain.\n start = index\n dots = []\n\n while (index < length) {\n code = value.charCodeAt(index)\n\n if (code === dot) {\n // Dots may not appear after each other.\n if (previousDot === index - 1) {\n break\n }\n\n dots.push(index)\n previousDot = index\n index++\n continue\n }\n\n if (\n decimal(code) ||\n alphabetical(code) ||\n code === dash ||\n code === underscore\n ) {\n index++\n continue\n }\n\n break\n }\n\n // Ignore a final dot:\n if (code === dot) {\n dots.pop()\n index--\n }\n\n // If there are not dots, exit.\n if (dots[0] === undefined) {\n return\n }\n\n // If there is an underscore in the last two domain parts, exit:\n // `www.example.c_m` and `www.ex_ample.com` are not OK, but\n // `www.sub_domain.example.com` is.\n lastTwoPartsStart = dots.length < 2 ? start : dots[dots.length - 2] + 1\n\n if (value.slice(lastTwoPartsStart, index).indexOf('_') !== -1) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n end = index\n pathStart = index\n\n // Parse a path.\n while (index < length) {\n code = value.charCodeAt(index)\n\n if (whitespace(code) || code === lessThan) {\n break\n }\n\n index++\n\n if (\n code === exclamationMark ||\n code === asterisk ||\n code === comma ||\n code === dot ||\n code === colon ||\n code === questionMark ||\n code === underscore ||\n code === tilde\n ) {\n // Empty\n } else {\n end = index\n }\n }\n\n index = end\n\n // If the path ends in a closing paren, and the count of closing parens is\n // higher than the opening count, then remove the supefluous closing parens.\n if (value.charCodeAt(index - 1) === rightParenthesis) {\n path = value.slice(pathStart, index)\n leftCount = ccount(path, leftParenthesisCharacter)\n rightCount = ccount(path, rightParenthesisCharacter)\n\n while (rightCount > leftCount) {\n index = pathStart + path.lastIndexOf(rightParenthesisCharacter)\n path = value.slice(pathStart, index)\n rightCount--\n }\n }\n\n if (value.charCodeAt(index - 1) === semicolon) {\n // GitHub doesn’t document this, but final semicolons aren’t paret of the\n // URL either.\n index--\n\n // // If the path ends in what looks like an entity, it’s not part of the path.\n if (alphabetical(value.charCodeAt(index - 1))) {\n end = index - 2\n\n while (alphabetical(value.charCodeAt(end))) {\n end--\n }\n\n if (value.charCodeAt(end) === ampersand) {\n index = end\n }\n }\n }\n\n content = value.slice(0, index)\n url = decode(content, {nonTerminated: false})\n\n if (protocolless) {\n url = 'http://' + url\n }\n\n exit = self.enterLink()\n\n // Temporarily remove all tokenizers except text in url.\n self.inlineTokenizers = {text: tokenizers.text}\n children = self.tokenizeInline(content, eat.now())\n self.inlineTokenizers = tokenizers\n\n exit()\n\n return eat(content)({type: 'link', title: null, url: url, children: children})\n}\n","'use strict'\n\nvar decimal = require('is-decimal')\nvar alphabetical = require('is-alphabetical')\n\nvar plusSign = 43 // '+'\nvar dash = 45 // '-'\nvar dot = 46 // '.'\nvar underscore = 95 // '_'\n\nmodule.exports = locate\n\n// See: \nfunction locate(value, fromIndex) {\n var self = this\n var at\n var position\n\n if (!this.options.gfm) {\n return -1\n }\n\n at = value.indexOf('@', fromIndex)\n\n if (at === -1) {\n return -1\n }\n\n position = at\n\n if (position === fromIndex || !isGfmAtext(value.charCodeAt(position - 1))) {\n return locate.call(self, value, at + 1)\n }\n\n while (position > fromIndex && isGfmAtext(value.charCodeAt(position - 1))) {\n position--\n }\n\n return position\n}\n\nfunction isGfmAtext(code) {\n return (\n decimal(code) ||\n alphabetical(code) ||\n code === plusSign ||\n code === dash ||\n code === dot ||\n code === underscore\n )\n}\n","'use strict'\n\nvar decode = require('parse-entities')\nvar decimal = require('is-decimal')\nvar alphabetical = require('is-alphabetical')\nvar locate = require('../locate/email')\n\nmodule.exports = email\nemail.locator = locate\nemail.notInLink = true\n\nvar plusSign = 43 // '+'\nvar dash = 45 // '-'\nvar dot = 46 // '.'\nvar atSign = 64 // '@'\nvar underscore = 95 // '_'\n\nfunction email(eat, value, silent) {\n var self = this\n var gfm = self.options.gfm\n var tokenizers = self.inlineTokenizers\n var index = 0\n var length = value.length\n var firstDot = -1\n var code\n var content\n var children\n var exit\n\n if (!gfm) {\n return\n }\n\n code = value.charCodeAt(index)\n\n while (\n decimal(code) ||\n alphabetical(code) ||\n code === plusSign ||\n code === dash ||\n code === dot ||\n code === underscore\n ) {\n code = value.charCodeAt(++index)\n }\n\n if (index === 0) {\n return\n }\n\n if (code !== atSign) {\n return\n }\n\n index++\n\n while (index < length) {\n code = value.charCodeAt(index)\n\n if (\n decimal(code) ||\n alphabetical(code) ||\n code === dash ||\n code === dot ||\n code === underscore\n ) {\n index++\n\n if (firstDot === -1 && code === dot) {\n firstDot = index\n }\n\n continue\n }\n\n break\n }\n\n if (\n firstDot === -1 ||\n firstDot === index ||\n code === dash ||\n code === underscore\n ) {\n return\n }\n\n if (code === dot) {\n index--\n }\n\n content = value.slice(0, index)\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n exit = self.enterLink()\n\n // Temporarily remove all tokenizers except text in url.\n self.inlineTokenizers = {text: tokenizers.text}\n children = self.tokenizeInline(content, eat.now())\n self.inlineTokenizers = tokenizers\n\n exit()\n\n return eat(content)({\n type: 'link',\n title: null,\n url: 'mailto:' + decode(content, {nonTerminated: false}),\n children: children\n })\n}\n","'use strict'\n\nvar alphabetical = require('is-alphabetical')\nvar locate = require('../locate/tag')\nvar tag = require('../util/html').tag\n\nmodule.exports = inlineHTML\ninlineHTML.locator = locate\n\nvar lessThan = '<'\nvar questionMark = '?'\nvar exclamationMark = '!'\nvar slash = '/'\n\nvar htmlLinkOpenExpression = /^/i\n\nfunction inlineHTML(eat, value, silent) {\n var self = this\n var length = value.length\n var character\n var subvalue\n\n if (value.charAt(0) !== lessThan || length < 3) {\n return\n }\n\n character = value.charAt(1)\n\n if (\n !alphabetical(character) &&\n character !== questionMark &&\n character !== exclamationMark &&\n character !== slash\n ) {\n return\n }\n\n subvalue = value.match(tag)\n\n if (!subvalue) {\n return\n }\n\n /* istanbul ignore if - not used yet. */\n if (silent) {\n return true\n }\n\n subvalue = subvalue[0]\n\n if (!self.inLink && htmlLinkOpenExpression.test(subvalue)) {\n self.inLink = true\n } else if (self.inLink && htmlLinkCloseExpression.test(subvalue)) {\n self.inLink = false\n }\n\n return eat(subvalue)({type: 'html', value: subvalue})\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n var link = value.indexOf('[', fromIndex)\n var image = value.indexOf('![', fromIndex)\n\n if (image === -1) {\n return link\n }\n\n // Link can never be `-1` if an image is found, so we don’t need to check\n // for that :)\n return link < image ? link : image\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/link')\n\nmodule.exports = link\nlink.locator = locate\n\nvar lineFeed = '\\n'\nvar exclamationMark = '!'\nvar quotationMark = '\"'\nvar apostrophe = \"'\"\nvar leftParenthesis = '('\nvar rightParenthesis = ')'\nvar lessThan = '<'\nvar greaterThan = '>'\nvar leftSquareBracket = '['\nvar backslash = '\\\\'\nvar rightSquareBracket = ']'\nvar graveAccent = '`'\n\nfunction link(eat, value, silent) {\n var self = this\n var subvalue = ''\n var index = 0\n var character = value.charAt(0)\n var pedantic = self.options.pedantic\n var commonmark = self.options.commonmark\n var gfm = self.options.gfm\n var closed\n var count\n var opening\n var beforeURL\n var beforeTitle\n var subqueue\n var hasMarker\n var isImage\n var content\n var marker\n var length\n var title\n var depth\n var queue\n var url\n var now\n var exit\n var node\n\n // Detect whether this is an image.\n if (character === exclamationMark) {\n isImage = true\n subvalue = character\n character = value.charAt(++index)\n }\n\n // Eat the opening.\n if (character !== leftSquareBracket) {\n return\n }\n\n // Exit when this is a link and we’re already inside a link.\n if (!isImage && self.inLink) {\n return\n }\n\n subvalue += character\n queue = ''\n index++\n\n // Eat the content.\n length = value.length\n now = eat.now()\n depth = 0\n\n now.column += index\n now.offset += index\n\n while (index < length) {\n character = value.charAt(index)\n subqueue = character\n\n if (character === graveAccent) {\n // Inline-code in link content.\n count = 1\n\n while (value.charAt(index + 1) === graveAccent) {\n subqueue += character\n index++\n count++\n }\n\n if (!opening) {\n opening = count\n } else if (count >= opening) {\n opening = 0\n }\n } else if (character === backslash) {\n // Allow brackets to be escaped.\n index++\n subqueue += value.charAt(index)\n } else if ((!opening || gfm) && character === leftSquareBracket) {\n // In GFM mode, brackets in code still count. In all other modes,\n // they don’t.\n depth++\n } else if ((!opening || gfm) && character === rightSquareBracket) {\n if (depth) {\n depth--\n } else {\n if (value.charAt(index + 1) !== leftParenthesis) {\n return\n }\n\n subqueue += leftParenthesis\n closed = true\n index++\n\n break\n }\n }\n\n queue += subqueue\n subqueue = ''\n index++\n }\n\n // Eat the content closing.\n if (!closed) {\n return\n }\n\n content = queue\n subvalue += queue + subqueue\n index++\n\n // Eat white-space.\n while (index < length) {\n character = value.charAt(index)\n\n if (!whitespace(character)) {\n break\n }\n\n subvalue += character\n index++\n }\n\n // Eat the URL.\n character = value.charAt(index)\n queue = ''\n beforeURL = subvalue\n\n if (character === lessThan) {\n index++\n beforeURL += lessThan\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === greaterThan) {\n break\n }\n\n if (commonmark && character === lineFeed) {\n return\n }\n\n queue += character\n index++\n }\n\n if (value.charAt(index) !== greaterThan) {\n return\n }\n\n subvalue += lessThan + queue + greaterThan\n url = queue\n index++\n } else {\n character = null\n subqueue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (\n subqueue &&\n (character === quotationMark ||\n character === apostrophe ||\n (commonmark && character === leftParenthesis))\n ) {\n break\n }\n\n if (whitespace(character)) {\n if (!pedantic) {\n break\n }\n\n subqueue += character\n } else {\n if (character === leftParenthesis) {\n depth++\n } else if (character === rightParenthesis) {\n if (depth === 0) {\n break\n }\n\n depth--\n }\n\n queue += subqueue\n subqueue = ''\n\n if (character === backslash) {\n queue += backslash\n character = value.charAt(++index)\n }\n\n queue += character\n }\n\n index++\n }\n\n subvalue += queue\n url = queue\n index = subvalue.length\n }\n\n // Eat white-space.\n queue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (!whitespace(character)) {\n break\n }\n\n queue += character\n index++\n }\n\n character = value.charAt(index)\n subvalue += queue\n\n // Eat the title.\n if (\n queue &&\n (character === quotationMark ||\n character === apostrophe ||\n (commonmark && character === leftParenthesis))\n ) {\n index++\n subvalue += character\n queue = ''\n marker = character === leftParenthesis ? rightParenthesis : character\n beforeTitle = subvalue\n\n // In commonmark-mode, things are pretty easy: the marker cannot occur\n // inside the title. Non-commonmark does, however, support nested\n // delimiters.\n if (commonmark) {\n while (index < length) {\n character = value.charAt(index)\n\n if (character === marker) {\n break\n }\n\n if (character === backslash) {\n queue += backslash\n character = value.charAt(++index)\n }\n\n index++\n queue += character\n }\n\n character = value.charAt(index)\n\n if (character !== marker) {\n return\n }\n\n title = queue\n subvalue += queue + character\n index++\n\n while (index < length) {\n character = value.charAt(index)\n\n if (!whitespace(character)) {\n break\n }\n\n subvalue += character\n index++\n }\n } else {\n subqueue = ''\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === marker) {\n if (hasMarker) {\n queue += marker + subqueue\n subqueue = ''\n }\n\n hasMarker = true\n } else if (!hasMarker) {\n queue += character\n } else if (character === rightParenthesis) {\n subvalue += queue + marker + subqueue\n title = queue\n break\n } else if (whitespace(character)) {\n subqueue += character\n } else {\n queue += marker + subqueue + character\n subqueue = ''\n hasMarker = false\n }\n\n index++\n }\n }\n }\n\n if (value.charAt(index) !== rightParenthesis) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n subvalue += rightParenthesis\n\n url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end, {\n nonTerminated: false\n })\n\n if (title) {\n beforeTitle = eat(beforeTitle).test().end\n title = self.decode.raw(self.unescape(title), beforeTitle)\n }\n\n node = {\n type: isImage ? 'image' : 'link',\n title: title || null,\n url: url\n }\n\n if (isImage) {\n node.alt = self.decode.raw(self.unescape(content), now) || null\n } else {\n exit = self.enterLink()\n node.children = self.tokenizeInline(content, now)\n exit()\n }\n\n return eat(subvalue)(node)\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/link')\nvar normalize = require('../util/normalize')\n\nmodule.exports = reference\nreference.locator = locate\n\nvar link = 'link'\nvar image = 'image'\nvar shortcut = 'shortcut'\nvar collapsed = 'collapsed'\nvar full = 'full'\nvar exclamationMark = '!'\nvar leftSquareBracket = '['\nvar backslash = '\\\\'\nvar rightSquareBracket = ']'\n\nfunction reference(eat, value, silent) {\n var self = this\n var commonmark = self.options.commonmark\n var character = value.charAt(0)\n var index = 0\n var length = value.length\n var subvalue = ''\n var intro = ''\n var type = link\n var referenceType = shortcut\n var content\n var identifier\n var now\n var node\n var exit\n var queue\n var bracketed\n var depth\n\n // Check whether we’re eating an image.\n if (character === exclamationMark) {\n type = image\n intro = character\n character = value.charAt(++index)\n }\n\n if (character !== leftSquareBracket) {\n return\n }\n\n index++\n intro += character\n queue = ''\n\n // Eat the text.\n depth = 0\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === leftSquareBracket) {\n bracketed = true\n depth++\n } else if (character === rightSquareBracket) {\n if (!depth) {\n break\n }\n\n depth--\n }\n\n if (character === backslash) {\n queue += backslash\n character = value.charAt(++index)\n }\n\n queue += character\n index++\n }\n\n subvalue = queue\n content = queue\n character = value.charAt(index)\n\n if (character !== rightSquareBracket) {\n return\n }\n\n index++\n subvalue += character\n queue = ''\n\n if (!commonmark) {\n // The original markdown syntax definition explicitly allows for whitespace\n // between the link text and link label; commonmark departs from this, in\n // part to improve support for shortcut reference links\n while (index < length) {\n character = value.charAt(index)\n\n if (!whitespace(character)) {\n break\n }\n\n queue += character\n index++\n }\n }\n\n character = value.charAt(index)\n\n if (character === leftSquareBracket) {\n identifier = ''\n queue += character\n index++\n\n while (index < length) {\n character = value.charAt(index)\n\n if (character === leftSquareBracket || character === rightSquareBracket) {\n break\n }\n\n if (character === backslash) {\n identifier += backslash\n character = value.charAt(++index)\n }\n\n identifier += character\n index++\n }\n\n character = value.charAt(index)\n\n if (character === rightSquareBracket) {\n referenceType = identifier ? full : collapsed\n queue += identifier + character\n index++\n } else {\n identifier = ''\n }\n\n subvalue += queue\n queue = ''\n } else {\n if (!content) {\n return\n }\n\n identifier = content\n }\n\n // Brackets cannot be inside the identifier.\n if (referenceType !== full && bracketed) {\n return\n }\n\n subvalue = intro + subvalue\n\n if (type === link && self.inLink) {\n return null\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n now = eat.now()\n now.column += intro.length\n now.offset += intro.length\n identifier = referenceType === full ? identifier : content\n\n node = {\n type: type + 'Reference',\n identifier: normalize(identifier),\n label: identifier,\n referenceType: referenceType\n }\n\n if (type === link) {\n exit = self.enterLink()\n node.children = self.tokenizeInline(content, now)\n exit()\n } else {\n node.alt = self.decode.raw(self.unescape(content), now) || null\n }\n\n return eat(subvalue)(node)\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n var asterisk = value.indexOf('**', fromIndex)\n var underscore = value.indexOf('__', fromIndex)\n\n if (underscore === -1) {\n return asterisk\n }\n\n if (asterisk === -1) {\n return underscore\n }\n\n return underscore < asterisk ? underscore : asterisk\n}\n","'use strict'\n\nvar trim = require('trim')\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/strong')\n\nmodule.exports = strong\nstrong.locator = locate\n\nvar backslash = '\\\\'\nvar asterisk = '*'\nvar underscore = '_'\n\nfunction strong(eat, value, silent) {\n var self = this\n var index = 0\n var character = value.charAt(index)\n var now\n var pedantic\n var marker\n var queue\n var subvalue\n var length\n var previous\n\n if (\n (character !== asterisk && character !== underscore) ||\n value.charAt(++index) !== character\n ) {\n return\n }\n\n pedantic = self.options.pedantic\n marker = character\n subvalue = marker + marker\n length = value.length\n index++\n queue = ''\n character = ''\n\n if (pedantic && whitespace(value.charAt(index))) {\n return\n }\n\n while (index < length) {\n previous = character\n character = value.charAt(index)\n\n if (\n character === marker &&\n value.charAt(index + 1) === marker &&\n (!pedantic || !whitespace(previous))\n ) {\n character = value.charAt(index + 2)\n\n if (character !== marker) {\n if (!trim(queue)) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n now = eat.now()\n now.column += 2\n now.offset += 2\n\n return eat(subvalue + queue + subvalue)({\n type: 'strong',\n children: self.tokenizeInline(queue, now)\n })\n }\n }\n\n if (!pedantic && character === backslash) {\n queue += character\n character = value.charAt(++index)\n }\n\n queue += character\n index++\n }\n}\n","'use strict'\n\nmodule.exports = wordCharacter\n\nvar fromCode = String.fromCharCode\nvar re = /\\w/\n\n// Check if the given character code, or the character code at the first\n// character, is a word character.\nfunction wordCharacter(character) {\n return re.test(\n typeof character === 'number' ? fromCode(character) : character.charAt(0)\n )\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n var asterisk = value.indexOf('*', fromIndex)\n var underscore = value.indexOf('_', fromIndex)\n\n if (underscore === -1) {\n return asterisk\n }\n\n if (asterisk === -1) {\n return underscore\n }\n\n return underscore < asterisk ? underscore : asterisk\n}\n","'use strict'\n\nvar trim = require('trim')\nvar word = require('is-word-character')\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/emphasis')\n\nmodule.exports = emphasis\nemphasis.locator = locate\n\nvar asterisk = '*'\nvar underscore = '_'\nvar backslash = '\\\\'\n\nfunction emphasis(eat, value, silent) {\n var self = this\n var index = 0\n var character = value.charAt(index)\n var now\n var pedantic\n var marker\n var queue\n var subvalue\n var length\n var previous\n\n if (character !== asterisk && character !== underscore) {\n return\n }\n\n pedantic = self.options.pedantic\n subvalue = character\n marker = character\n length = value.length\n index++\n queue = ''\n character = ''\n\n if (pedantic && whitespace(value.charAt(index))) {\n return\n }\n\n while (index < length) {\n previous = character\n character = value.charAt(index)\n\n if (character === marker && (!pedantic || !whitespace(previous))) {\n character = value.charAt(++index)\n\n if (character !== marker) {\n if (!trim(queue) || previous === marker) {\n return\n }\n\n if (!pedantic && marker === underscore && word(character)) {\n queue += marker\n continue\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n now = eat.now()\n now.column++\n now.offset++\n\n return eat(subvalue + queue + marker)({\n type: 'emphasis',\n children: self.tokenizeInline(queue, now)\n })\n }\n\n queue += marker\n }\n\n if (!pedantic && character === backslash) {\n queue += character\n character = value.charAt(++index)\n }\n\n queue += character\n index++\n }\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n return value.indexOf('~~', fromIndex)\n}\n","'use strict'\n\nvar whitespace = require('is-whitespace-character')\nvar locate = require('../locate/delete')\n\nmodule.exports = strikethrough\nstrikethrough.locator = locate\n\nvar tilde = '~'\nvar fence = '~~'\n\nfunction strikethrough(eat, value, silent) {\n var self = this\n var character = ''\n var previous = ''\n var preceding = ''\n var subvalue = ''\n var index\n var length\n var now\n\n if (\n !self.options.gfm ||\n value.charAt(0) !== tilde ||\n value.charAt(1) !== tilde ||\n whitespace(value.charAt(2))\n ) {\n return\n }\n\n index = 1\n length = value.length\n now = eat.now()\n now.column += 2\n now.offset += 2\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (\n character === tilde &&\n previous === tilde &&\n (!preceding || !whitespace(preceding))\n ) {\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n return eat(fence + subvalue + fence)({\n type: 'delete',\n children: self.tokenizeInline(subvalue, now)\n })\n }\n\n subvalue += previous\n preceding = previous\n previous = character\n }\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n return value.indexOf('`', fromIndex)\n}\n","'use strict'\n\nvar locate = require('../locate/code-inline')\n\nmodule.exports = inlineCode\ninlineCode.locator = locate\n\nvar lineFeed = 10 // '\\n'\nvar space = 32 // ' '\nvar graveAccent = 96 // '`'\n\nfunction inlineCode(eat, value, silent) {\n var length = value.length\n var index = 0\n var openingFenceEnd\n var closingFenceStart\n var closingFenceEnd\n var code\n var next\n var found\n\n while (index < length) {\n if (value.charCodeAt(index) !== graveAccent) {\n break\n }\n\n index++\n }\n\n if (index === 0 || index === length) {\n return\n }\n\n openingFenceEnd = index\n next = value.charCodeAt(index)\n\n while (index < length) {\n code = next\n next = value.charCodeAt(index + 1)\n\n if (code === graveAccent) {\n if (closingFenceStart === undefined) {\n closingFenceStart = index\n }\n\n closingFenceEnd = index + 1\n\n if (\n next !== graveAccent &&\n closingFenceEnd - closingFenceStart === openingFenceEnd\n ) {\n found = true\n break\n }\n } else if (closingFenceStart !== undefined) {\n closingFenceStart = undefined\n closingFenceEnd = undefined\n }\n\n index++\n }\n\n if (!found) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n // Remove the initial and final space (or line feed), iff they exist and there\n // are non-space characters in the content.\n index = openingFenceEnd\n length = closingFenceStart\n code = value.charCodeAt(index)\n next = value.charCodeAt(length - 1)\n found = false\n\n if (\n length - index > 2 &&\n (code === space || code === lineFeed) &&\n (next === space || next === lineFeed)\n ) {\n index++\n length--\n\n while (index < length) {\n code = value.charCodeAt(index)\n\n if (code !== space && code !== lineFeed) {\n found = true\n break\n }\n\n index++\n }\n\n if (found === true) {\n openingFenceEnd++\n closingFenceStart--\n }\n }\n\n return eat(value.slice(0, closingFenceEnd))({\n type: 'inlineCode',\n value: value.slice(openingFenceEnd, closingFenceStart)\n })\n}\n","'use strict'\n\nmodule.exports = locate\n\nfunction locate(value, fromIndex) {\n var index = value.indexOf('\\n', fromIndex)\n\n while (index > fromIndex) {\n if (value.charAt(index - 1) !== ' ') {\n break\n }\n\n index--\n }\n\n return index\n}\n","'use strict'\n\nvar locate = require('../locate/break')\n\nmodule.exports = hardBreak\nhardBreak.locator = locate\n\nvar space = ' '\nvar lineFeed = '\\n'\nvar minBreakLength = 2\n\nfunction hardBreak(eat, value, silent) {\n var length = value.length\n var index = -1\n var queue = ''\n var character\n\n while (++index < length) {\n character = value.charAt(index)\n\n if (character === lineFeed) {\n if (index < minBreakLength) {\n return\n }\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n queue += character\n\n return eat(queue)({type: 'break'})\n }\n\n if (character !== space) {\n return\n }\n\n queue += character\n }\n}\n","'use strict'\n\nmodule.exports = text\n\nfunction text(eat, value, silent) {\n var self = this\n var methods\n var tokenizers\n var index\n var length\n var subvalue\n var position\n var tokenizer\n var name\n var min\n var now\n\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n methods = self.inlineMethods\n length = methods.length\n tokenizers = self.inlineTokenizers\n index = -1\n min = value.length\n\n while (++index < length) {\n name = methods[index]\n\n if (name === 'text' || !tokenizers[name]) {\n continue\n }\n\n tokenizer = tokenizers[name].locator\n\n if (!tokenizer) {\n eat.file.fail('Missing locator: `' + name + '`')\n }\n\n position = tokenizer.call(self, value, 1)\n\n if (position !== -1 && position < min) {\n min = position\n }\n }\n\n subvalue = value.slice(0, min)\n now = eat.now()\n\n self.decode(subvalue, now, handler)\n\n function handler(content, position, source) {\n eat(source || content)({type: 'text', value: content})\n }\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar toggle = require('state-toggle')\nvar vfileLocation = require('vfile-location')\nvar unescape = require('./unescape')\nvar decode = require('./decode')\nvar tokenizer = require('./tokenizer')\n\nmodule.exports = Parser\n\nfunction Parser(doc, file) {\n this.file = file\n this.offset = {}\n this.options = xtend(this.options)\n this.setOptions({})\n\n this.inList = false\n this.inBlock = false\n this.inLink = false\n this.atStart = true\n\n this.toOffset = vfileLocation(file).toOffset\n this.unescape = unescape(this, 'escape')\n this.decode = decode(this)\n}\n\nvar proto = Parser.prototype\n\n// Expose core.\nproto.setOptions = require('./set-options')\nproto.parse = require('./parse')\n\n// Expose `defaults`.\nproto.options = require('./defaults')\n\n// Enter and exit helpers.\nproto.exitStart = toggle('atStart', true)\nproto.enterList = toggle('inList', false)\nproto.enterLink = toggle('inLink', false)\nproto.enterBlock = toggle('inBlock', false)\n\n// Nodes that can interupt a paragraph:\n//\n// ```markdown\n// A paragraph, followed by a thematic break.\n// ___\n// ```\n//\n// In the above example, the thematic break “interupts” the paragraph.\nproto.interruptParagraph = [\n ['thematicBreak'],\n ['list'],\n ['atxHeading'],\n ['fencedCode'],\n ['blockquote'],\n ['html'],\n ['setextHeading', {commonmark: false}],\n ['definition', {commonmark: false}]\n]\n\n// Nodes that can interupt a list:\n//\n// ```markdown\n// - One\n// ___\n// ```\n//\n// In the above example, the thematic break “interupts” the list.\nproto.interruptList = [\n ['atxHeading', {pedantic: false}],\n ['fencedCode', {pedantic: false}],\n ['thematicBreak', {pedantic: false}],\n ['definition', {commonmark: false}]\n]\n\n// Nodes that can interupt a blockquote:\n//\n// ```markdown\n// > A paragraph.\n// ___\n// ```\n//\n// In the above example, the thematic break “interupts” the blockquote.\nproto.interruptBlockquote = [\n ['indentedCode', {commonmark: true}],\n ['fencedCode', {commonmark: true}],\n ['atxHeading', {commonmark: true}],\n ['setextHeading', {commonmark: true}],\n ['thematicBreak', {commonmark: true}],\n ['html', {commonmark: true}],\n ['list', {commonmark: true}],\n ['definition', {commonmark: false}]\n]\n\n// Handlers.\nproto.blockTokenizers = {\n blankLine: require('./tokenize/blank-line'),\n indentedCode: require('./tokenize/code-indented'),\n fencedCode: require('./tokenize/code-fenced'),\n blockquote: require('./tokenize/blockquote'),\n atxHeading: require('./tokenize/heading-atx'),\n thematicBreak: require('./tokenize/thematic-break'),\n list: require('./tokenize/list'),\n setextHeading: require('./tokenize/heading-setext'),\n html: require('./tokenize/html-block'),\n definition: require('./tokenize/definition'),\n table: require('./tokenize/table'),\n paragraph: require('./tokenize/paragraph')\n}\n\nproto.inlineTokenizers = {\n escape: require('./tokenize/escape'),\n autoLink: require('./tokenize/auto-link'),\n url: require('./tokenize/url'),\n email: require('./tokenize/email'),\n html: require('./tokenize/html-inline'),\n link: require('./tokenize/link'),\n reference: require('./tokenize/reference'),\n strong: require('./tokenize/strong'),\n emphasis: require('./tokenize/emphasis'),\n deletion: require('./tokenize/delete'),\n code: require('./tokenize/code-inline'),\n break: require('./tokenize/break'),\n text: require('./tokenize/text')\n}\n\n// Expose precedence.\nproto.blockMethods = keys(proto.blockTokenizers)\nproto.inlineMethods = keys(proto.inlineTokenizers)\n\n// Tokenizers.\nproto.tokenizeBlock = tokenizer('block')\nproto.tokenizeInline = tokenizer('inline')\nproto.tokenizeFactory = tokenizer\n\n// Get all keys in `value`.\nfunction keys(value) {\n var result = []\n var key\n\n for (key in value) {\n result.push(key)\n }\n\n return result\n}\n","'use strict'\n\nvar unherit = require('unherit')\nvar xtend = require('xtend')\nvar Parser = require('./lib/parser.js')\n\nmodule.exports = parse\nparse.Parser = Parser\n\nfunction parse(options) {\n var settings = this.data('settings')\n var Local = unherit(Parser)\n\n Local.prototype.options = xtend(Local.prototype.options, settings, options)\n\n this.Parser = Local\n}\n","'use strict'\n\nvar visit = require('unist-util-visit')\n\nmodule.exports = getDefinitionFactory\n\nvar own = {}.hasOwnProperty\n\n// Get a definition in `node` by `identifier`.\nfunction getDefinitionFactory(node, options) {\n return getterFactory(gather(node, options))\n}\n\n// Gather all definitions in `node`\nfunction gather(node, options) {\n var cache = {}\n\n if (!node || !node.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(node, 'definition', options && options.commonmark ? commonmark : normal)\n\n return cache\n\n function commonmark(definition) {\n var id = normalise(definition.identifier)\n if (!own.call(cache, id)) {\n cache[id] = definition\n }\n }\n\n function normal(definition) {\n cache[normalise(definition.identifier)] = definition\n }\n}\n\n// Factory to get a node from the given definition-cache.\nfunction getterFactory(cache) {\n return getter\n\n // Get a node from the bound definition-cache.\n function getter(identifier) {\n var id = identifier && normalise(identifier)\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\nfunction normalise(identifier) {\n return identifier.toUpperCase()\n}\n","'use strict'\n\nexports.parse = parse\nexports.stringify = stringify\n\nvar empty = ''\nvar space = ' '\nvar whiteSpace = /[ \\t\\n\\r\\f]+/g\n\nfunction parse(value) {\n var input = String(value || empty).trim()\n return input === empty ? [] : input.split(whiteSpace)\n}\n\nfunction stringify(values) {\n return values.join(space).trim()\n}\n","'use strict';\n\nmodule.exports = url => {\n\tif (typeof url !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof url}\\``);\n\t}\n\n\t// Don't match Windows paths `c:\\`\n\tif (/^[a-zA-Z]:\\\\/.test(url)) {\n\t\treturn false;\n\t}\n\n\t// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n\t// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n\treturn /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n};\n","var visit = require('unist-util-visit')\nvar definitions = require('mdast-util-definitions')\nvar spaceSeparated = require('space-separated-tokens').parse\nvar absolute = require('is-absolute-url')\nvar extend = require('extend')\n\nmodule.exports = externalLinks\n\nvar defaultTarget = '_blank'\nvar defaultRel = ['nofollow', 'noopener', 'noreferrer']\nvar defaultProtocols = ['http', 'https']\n\nfunction externalLinks(options) {\n var settings = options || {}\n var target = settings.target\n var rel = settings.rel\n var protocols = settings.protocols || defaultProtocols\n var content = settings.content\n var contentProperties = settings.contentProperties || {}\n\n if (typeof rel === 'string') {\n rel = spaceSeparated(rel)\n }\n\n if (content && typeof content === 'object' && !('length' in content)) {\n content = [content]\n }\n\n return transform\n\n function transform(tree) {\n var definition = definitions(tree)\n\n visit(tree, ['link', 'linkReference'], visitor)\n\n function visitor(node) {\n var ctx = node.type === 'link' ? node : definition(node.identifier)\n var protocol\n var data\n var props\n\n if (!ctx) return\n\n protocol = ctx.url.slice(0, ctx.url.indexOf(':'))\n\n if (absolute(ctx.url) && protocols.indexOf(protocol) !== -1) {\n data = node.data || (node.data = {})\n props = data.hProperties || (data.hProperties = {})\n\n if (target !== false) {\n props.target = target || defaultTarget\n }\n\n if (rel !== false) {\n props.rel = (rel || defaultRel).concat()\n }\n\n if (content) {\n // `fragment` is not a known mdast node, but unknown nodes with\n // children are handled as elements by `mdast-util-to-hast`:\n // See: .\n node.children.push({\n type: 'fragment',\n children: [],\n data: {\n hName: 'span',\n hProperties: extend(true, contentProperties),\n hChildren: extend(true, content)\n }\n })\n }\n }\n }\n }\n}\n","//\n// format - printf-like string formatting for JavaScript\n// github.com/samsonjs/format\n// @_sjs\n//\n// Copyright 2010 - 2013 Sami Samhuri \n//\n// MIT License\n// http://sjs.mit-license.org\n//\n\n;(function() {\n\n //// Export the API\n var namespace;\n\n // CommonJS / Node module\n if (typeof module !== 'undefined') {\n namespace = module.exports = format;\n }\n\n // Browsers and other environments\n else {\n // Get the global object. Works in ES3, ES5, and ES5 strict mode.\n namespace = (function(){ return this || (1,eval)('this') }());\n }\n\n namespace.format = format;\n namespace.vsprintf = vsprintf;\n\n if (typeof console !== 'undefined' && typeof console.log === 'function') {\n namespace.printf = printf;\n }\n\n function printf(/* ... */) {\n console.log(format.apply(null, arguments));\n }\n\n function vsprintf(fmt, replacements) {\n return format.apply(null, [fmt].concat(replacements));\n }\n\n function format(fmt) {\n var argIndex = 1 // skip initial format argument\n , args = [].slice.call(arguments)\n , i = 0\n , n = fmt.length\n , result = ''\n , c\n , escaped = false\n , arg\n , tmp\n , leadingZero = false\n , precision\n , nextArg = function() { return args[argIndex++]; }\n , slurpNumber = function() {\n var digits = '';\n while (/\\d/.test(fmt[i])) {\n digits += fmt[i++];\n c = fmt[i];\n }\n return digits.length > 0 ? parseInt(digits) : null;\n }\n ;\n for (; i < n; ++i) {\n c = fmt[i];\n if (escaped) {\n escaped = false;\n if (c == '.') {\n leadingZero = false;\n c = fmt[++i];\n }\n else if (c == '0' && fmt[i + 1] == '.') {\n leadingZero = true;\n i += 2;\n c = fmt[i];\n }\n else {\n leadingZero = true;\n }\n precision = slurpNumber();\n switch (c) {\n case 'b': // number in binary\n result += parseInt(nextArg(), 10).toString(2);\n break;\n case 'c': // character\n arg = nextArg();\n if (typeof arg === 'string' || arg instanceof String)\n result += arg;\n else\n result += String.fromCharCode(parseInt(arg, 10));\n break;\n case 'd': // number in decimal\n result += parseInt(nextArg(), 10);\n break;\n case 'f': // floating point number\n tmp = String(parseFloat(nextArg()).toFixed(precision || 6));\n result += leadingZero ? tmp : tmp.replace(/^0/, '');\n break;\n case 'j': // JSON\n result += JSON.stringify(nextArg());\n break;\n case 'o': // number in octal\n result += '0' + parseInt(nextArg(), 10).toString(8);\n break;\n case 's': // string\n result += nextArg();\n break;\n case 'x': // lowercase hexadecimal\n result += '0x' + parseInt(nextArg(), 10).toString(16);\n break;\n case 'X': // uppercase hexadecimal\n result += '0x' + parseInt(nextArg(), 10).toString(16).toUpperCase();\n break;\n default:\n result += c;\n break;\n }\n } else if (c === '%') {\n escaped = true;\n } else {\n result += c;\n }\n }\n return result;\n }\n\n}());\n","'use strict'\n\nvar formatter = require('format')\n\nvar fault = create(Error)\n\nmodule.exports = fault\n\nfault.eval = create(EvalError)\nfault.range = create(RangeError)\nfault.reference = create(ReferenceError)\nfault.syntax = create(SyntaxError)\nfault.type = create(TypeError)\nfault.uri = create(URIError)\n\nfault.create = create\n\n// Create a new `EConstructor`, with the formatted `format` as a first argument.\nfunction create(EConstructor) {\n FormattedError.displayName = EConstructor.displayName || EConstructor.name\n\n return FormattedError\n\n function FormattedError(format) {\n if (format) {\n format = formatter.apply(null, arguments)\n }\n\n return new EConstructor(format)\n }\n}\n","'use strict'\n\nvar fault = require('fault')\n\nmodule.exports = matters\n\nvar own = {}.hasOwnProperty\n\nvar markers = {\n yaml: '-',\n toml: '+'\n}\n\nfunction matters(options) {\n var results = []\n var index = -1\n var length\n\n // One preset or matter.\n if (typeof options === 'string' || !('length' in options)) {\n options = [options]\n }\n\n length = options.length\n\n while (++index < length) {\n results[index] = matter(options[index])\n }\n\n return results\n}\n\nfunction matter(option) {\n var result = option\n\n if (typeof result === 'string') {\n if (!own.call(markers, result)) {\n throw fault('Missing matter definition for `%s`', result)\n }\n\n result = {type: result, marker: markers[result]}\n } else if (typeof result !== 'object') {\n throw fault('Expected matter to be an object, not `%j`', result)\n }\n\n if (!own.call(result, 'type')) {\n throw fault('Missing `type` in matter `%j`', result)\n }\n\n if (!own.call(result, 'fence') && !own.call(result, 'marker')) {\n throw fault('Missing `marker` or `fence` in matter `%j`', result)\n }\n\n return result\n}\n","'use strict'\n\nmodule.exports = fence\n\nfunction fence(matter, prop) {\n var marker\n\n if (matter.marker) {\n marker = pick(matter.marker, prop)\n return marker + marker + marker\n }\n\n return pick(matter.fence, prop)\n}\n\nfunction pick(schema, prop) {\n return typeof schema === 'string' ? schema : schema[prop]\n}\n","'use strict'\n\nvar fence = require('./fence')\n\nmodule.exports = create\n\nfunction create(matter) {\n var name = matter.type + 'FrontMatter'\n var open = fence(matter, 'open')\n var close = fence(matter, 'close')\n var newline = '\\n'\n var anywhere = matter.anywhere\n\n frontmatter.displayName = name\n frontmatter.onlyAtStart = typeof anywhere === 'boolean' ? !anywhere : true\n\n return [name, frontmatter]\n\n function frontmatter(eat, value, silent) {\n var index = open.length\n var offset\n\n if (value.slice(0, index) !== open || value.charAt(index) !== newline) {\n return\n }\n\n offset = value.indexOf(close, index)\n\n while (offset !== -1 && value.charAt(offset - 1) !== newline) {\n index = offset + close.length\n offset = value.indexOf(close, index)\n }\n\n if (offset !== -1) {\n /* istanbul ignore if - never used (yet) */\n if (silent) {\n return true\n }\n\n return eat(value.slice(0, offset + close.length))({\n type: matter.type,\n value: value.slice(open.length + 1, offset - 1)\n })\n }\n }\n}\n","'use strict'\n\nvar fence = require('./fence')\n\nmodule.exports = create\n\nfunction create(matter) {\n var type = matter.type\n var open = fence(matter, 'open')\n var close = fence(matter, 'close')\n\n frontmatter.displayName = type + 'FrontMatter'\n\n return [type, frontmatter]\n\n function frontmatter(node) {\n return open + (node.value ? '\\n' + node.value : '') + '\\n' + close\n }\n}\n","'use strict'\n\nvar matters = require('./lib/matters')\nvar parse = require('./lib/parse')\nvar compile = require('./lib/compile')\n\nmodule.exports = frontmatter\n\nfunction frontmatter(options) {\n var parser = this.Parser\n var compiler = this.Compiler\n var config = matters(options || ['yaml'])\n\n if (isRemarkParser(parser)) {\n attachParser(parser, config)\n }\n\n if (isRemarkCompiler(compiler)) {\n attachCompiler(compiler, config)\n }\n}\n\nfunction attachParser(parser, matters) {\n var proto = parser.prototype\n var tokenizers = wrap(parse, matters)\n var names = []\n var key\n\n for (key in tokenizers) {\n names.push(key)\n }\n\n proto.blockMethods = names.concat(proto.blockMethods)\n proto.blockTokenizers = Object.assign({}, tokenizers, proto.blockTokenizers)\n}\n\nfunction attachCompiler(compiler, matters) {\n var proto = compiler.prototype\n proto.visitors = Object.assign({}, wrap(compile, matters), proto.visitors)\n}\n\nfunction wrap(func, matters) {\n var result = {}\n var length = matters.length\n var index = -1\n var tuple\n\n while (++index < length) {\n tuple = func(matters[index])\n result[tuple[0]] = tuple[1]\n }\n\n return result\n}\n\nfunction isRemarkParser(parser) {\n return Boolean(parser && parser.prototype && parser.prototype.blockTokenizers)\n}\n\nfunction isRemarkCompiler(compiler) {\n return Boolean(compiler && compiler.prototype && compiler.prototype.visitors)\n}\n","'use strict'\n\nmodule.exports = u\n\nfunction u(type, props, value) {\n var node\n\n if (\n (value === null || value === undefined) &&\n (typeof props !== 'object' || Array.isArray(props))\n ) {\n value = props\n props = {}\n }\n\n node = Object.assign({type: String(type)}, props)\n\n if (Array.isArray(value)) {\n node.children = value\n } else if (value !== null && value !== undefined) {\n node.value = String(value)\n }\n\n return node\n}\n","'use strict'\n\nvar start = factory('start')\nvar end = factory('end')\n\nmodule.exports = position\n\nposition.start = start\nposition.end = end\n\nfunction position(node) {\n return {start: start(node), end: end(node)}\n}\n\nfunction factory(type) {\n point.displayName = type\n\n return point\n\n function point(node) {\n var point = (node && node.position && node.position[type]) || {}\n\n return {\n line: point.line || null,\n column: point.column || null,\n offset: isNaN(point.offset) ? null : point.offset\n }\n }\n}\n","'use strict'\n\nmodule.exports = generated\n\nfunction generated(node) {\n return (\n !node ||\n !node.position ||\n !node.position.start ||\n !node.position.start.line ||\n !node.position.start.column ||\n !node.position.end ||\n !node.position.end.line ||\n !node.position.end.column\n )\n}\n","'use strict'\n\nvar visit = require('unist-util-visit')\n\nmodule.exports = getDefinitionFactory\n\nvar own = {}.hasOwnProperty\n\n// Get a definition in `node` by `identifier`.\nfunction getDefinitionFactory(node, options) {\n return getterFactory(gather(node, options))\n}\n\n// Gather all definitions in `node`\nfunction gather(node, options) {\n var cache = {}\n\n if (!node || !node.type) {\n throw new Error('mdast-util-definitions expected node')\n }\n\n visit(node, 'definition', options && options.commonmark ? commonmark : normal)\n\n return cache\n\n function commonmark(definition) {\n var id = normalise(definition.identifier)\n if (!own.call(cache, id)) {\n cache[id] = definition\n }\n }\n\n function normal(definition) {\n cache[normalise(definition.identifier)] = definition\n }\n}\n\n// Factory to get a node from the given definition-cache.\nfunction getterFactory(cache) {\n return getter\n\n // Get a node from the bound definition-cache.\n function getter(identifier) {\n var id = identifier && normalise(identifier)\n return id && own.call(cache, id) ? cache[id] : null\n }\n}\n\nfunction normalise(identifier) {\n return identifier.toUpperCase()\n}\n","'use strict'\n\nmodule.exports = all\n\nvar one = require('./one')\n\nfunction all(h, parent) {\n var nodes = parent.children || []\n var length = nodes.length\n var values = []\n var index = -1\n var result\n var head\n\n while (++index < length) {\n result = one(h, nodes[index], parent)\n\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (result.value) {\n result.value = result.value.replace(/^\\s+/, '')\n }\n\n head = result.children && result.children[0]\n\n if (head && head.value) {\n head.value = head.value.replace(/^\\s+/, '')\n }\n }\n\n values = values.concat(result)\n }\n }\n\n return values\n}\n","'use strict'\n\nmodule.exports = one\n\nvar u = require('unist-builder')\nvar all = require('./all')\n\nvar own = {}.hasOwnProperty\n\n// Transform an unknown node.\nfunction unknown(h, node) {\n if (text(node)) {\n return h.augment(node, u('text', node.value))\n }\n\n return h(node, 'div', all(h, node))\n}\n\n// Visit a node.\nfunction one(h, node, parent) {\n var type = node && node.type\n var fn = own.call(h.handlers, type) ? h.handlers[type] : h.unknownHandler\n\n // Fail on non-nodes.\n if (!type) {\n throw new Error('Expected node, got `' + node + '`')\n }\n\n return (typeof fn === 'function' ? fn : unknown)(h, node, parent)\n}\n\n// Check if the node should be renderered as a text node.\nfunction text(node) {\n var data = node.data || {}\n\n if (\n own.call(data, 'hName') ||\n own.call(data, 'hProperties') ||\n own.call(data, 'hChildren')\n ) {\n return false\n }\n\n return 'value' in node\n}\n","'use strict'\n\nmodule.exports = thematicBreak\n\nfunction thematicBreak(h, node) {\n return h(node, 'hr')\n}\n","'use strict'\n\nmodule.exports = wrap\n\nvar u = require('unist-builder')\n\n// Wrap `nodes` with line feeds between each entry.\n// Optionally adds line feeds at the start and end.\nfunction wrap(nodes, loose) {\n var result = []\n var index = -1\n var length = nodes.length\n\n if (loose) {\n result.push(u('text', '\\n'))\n }\n\n while (++index < length) {\n if (index) {\n result.push(u('text', '\\n'))\n }\n\n result.push(nodes[index])\n }\n\n if (loose && nodes.length !== 0) {\n result.push(u('text', '\\n'))\n }\n\n return result\n}\n","'use strict'\n\nmodule.exports = list\n\nvar wrap = require('../wrap')\nvar all = require('../all')\n\nfunction list(h, node) {\n var props = {}\n var name = node.ordered ? 'ol' : 'ul'\n var items\n var index = -1\n var length\n\n if (typeof node.start === 'number' && node.start !== 1) {\n props.start = node.start\n }\n\n items = all(h, node)\n length = items.length\n\n // Like GitHub, add a class for custom styling.\n while (++index < length) {\n if (\n items[index].properties.className &&\n items[index].properties.className.indexOf('task-list-item') !== -1\n ) {\n props.className = ['contains-task-list']\n break\n }\n }\n\n return h(node, name, props, wrap(items, true))\n}\n","'use strict'\n\nmodule.exports = generateFootnotes\n\nvar thematicBreak = require('./handlers/thematic-break')\nvar list = require('./handlers/list')\nvar wrap = require('./wrap')\n\nfunction generateFootnotes(h) {\n var footnoteById = h.footnoteById\n var footnoteOrder = h.footnoteOrder\n var length = footnoteOrder.length\n var index = -1\n var listItems = []\n var def\n var backReference\n var content\n var tail\n\n while (++index < length) {\n def = footnoteById[footnoteOrder[index].toUpperCase()]\n\n if (!def) {\n continue\n }\n\n content = def.children.concat()\n tail = content[content.length - 1]\n backReference = {\n type: 'link',\n url: '#fnref-' + def.identifier,\n data: {hProperties: {className: ['footnote-backref']}},\n children: [{type: 'text', value: '↩'}]\n }\n\n if (!tail || tail.type !== 'paragraph') {\n tail = {type: 'paragraph', children: []}\n content.push(tail)\n }\n\n tail.children.push(backReference)\n\n listItems.push({\n type: 'listItem',\n data: {hProperties: {id: 'fn-' + def.identifier}},\n children: content,\n position: def.position\n })\n }\n\n if (listItems.length === 0) {\n return null\n }\n\n return h(\n null,\n 'div',\n {className: ['footnotes']},\n wrap(\n [\n thematicBreak(h),\n list(h, {type: 'list', ordered: true, children: listItems})\n ],\n true\n )\n )\n}\n","'use strict'\n\nmodule.exports = blockquote\n\nvar wrap = require('../wrap')\nvar all = require('../all')\n\nfunction blockquote(h, node) {\n return h(node, 'blockquote', wrap(all(h, node), true))\n}\n","'use strict'\n\nmodule.exports = hardBreak\n\nvar u = require('unist-builder')\n\nfunction hardBreak(h, node) {\n return [h(node, 'br'), u('text', '\\n')]\n}\n","'use strict'\n\nmodule.exports = code\n\nvar u = require('unist-builder')\n\nfunction code(h, node) {\n var value = node.value ? node.value + '\\n' : ''\n var lang = node.lang && node.lang.match(/^[^ \\t]+(?=[ \\t]|$)/)\n var props = {}\n\n if (lang) {\n props.className = ['language-' + lang]\n }\n\n return h(node.position, 'pre', [h(node, 'code', props, [u('text', value)])])\n}\n","'use strict'\n\nmodule.exports = strikethrough\n\nvar all = require('../all')\n\nfunction strikethrough(h, node) {\n return h(node, 'del', all(h, node))\n}\n","'use strict'\n\nmodule.exports = emphasis\n\nvar all = require('../all')\n\nfunction emphasis(h, node) {\n return h(node, 'em', all(h, node))\n}\n","'use strict'\n\nmodule.exports = footnoteReference\n\nvar u = require('unist-builder')\n\nfunction footnoteReference(h, node) {\n var footnoteOrder = h.footnoteOrder\n var identifier = String(node.identifier)\n\n if (footnoteOrder.indexOf(identifier) === -1) {\n footnoteOrder.push(identifier)\n }\n\n return h(node.position, 'sup', {id: 'fnref-' + identifier}, [\n h(node, 'a', {href: '#fn-' + identifier, className: ['footnote-ref']}, [\n u('text', node.label || identifier)\n ])\n ])\n}\n","'use strict'\n\nmodule.exports = footnote\n\nvar footnoteReference = require('./footnote-reference')\n\nfunction footnote(h, node) {\n var footnoteById = h.footnoteById\n var footnoteOrder = h.footnoteOrder\n var identifier = 1\n\n while (identifier in footnoteById) {\n identifier++\n }\n\n identifier = String(identifier)\n\n // No need to check if `identifier` exists in `footnoteOrder`, it’s guaranteed\n // to not exist because we just generated it.\n footnoteOrder.push(identifier)\n\n footnoteById[identifier] = {\n type: 'footnoteDefinition',\n identifier: identifier,\n children: [{type: 'paragraph', children: node.children}],\n position: node.position\n }\n\n return footnoteReference(h, {\n type: 'footnoteReference',\n identifier: identifier,\n position: node.position\n })\n}\n","'use strict'\n\nmodule.exports = heading\n\nvar all = require('../all')\n\nfunction heading(h, node) {\n return h(node, 'h' + node.depth, all(h, node))\n}\n","'use strict'\n\nmodule.exports = html\n\nvar u = require('unist-builder')\n\n// Return either a `raw` node in dangerous mode, otherwise nothing.\nfunction html(h, node) {\n return h.dangerous ? h.augment(node, u('raw', node.value)) : null\n}\n","\n'use strict';\n\n\nvar encodeCache = {};\n\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache(exclude) {\n var i, ch, cache = encodeCache[exclude];\n if (cache) { return cache; }\n\n cache = encodeCache[exclude] = [];\n\n for (i = 0; i < 128; i++) {\n ch = String.fromCharCode(i);\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch);\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));\n }\n }\n\n for (i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i];\n }\n\n return cache;\n}\n\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode(string, exclude, keepEscaped) {\n var i, l, code, nextCode, cache,\n result = '';\n\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude;\n exclude = encode.defaultChars;\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true;\n }\n\n cache = getEncodeCache(exclude);\n\n for (i = 0, l = string.length; i < l; i++) {\n code = string.charCodeAt(i);\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3);\n i += 2;\n continue;\n }\n }\n\n if (code < 128) {\n result += cache[code];\n continue;\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n nextCode = string.charCodeAt(i + 1);\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1]);\n i++;\n continue;\n }\n }\n result += '%EF%BF%BD';\n continue;\n }\n\n result += encodeURIComponent(string[i]);\n }\n\n return result;\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\";\nencode.componentChars = \"-_.!~*'()\";\n\n\nmodule.exports = encode;\n","'use strict'\n\nmodule.exports = revert\n\nvar u = require('unist-builder')\nvar all = require('./all')\n\n// Return the content of a reference without definition as Markdown.\nfunction revert(h, node) {\n var subtype = node.referenceType\n var suffix = ']'\n var contents\n var head\n var tail\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return u('text', '![' + node.alt + suffix)\n }\n\n contents = all(h, node)\n head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift(u('text', '['))\n }\n\n tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push(u('text', suffix))\n }\n\n return contents\n}\n","'use strict'\n\nmodule.exports = imageReference\n\nvar normalize = require('mdurl/encode')\nvar revert = require('../revert')\n\nfunction imageReference(h, node) {\n var def = h.definition(node.identifier)\n var props\n\n if (!def) {\n return revert(h, node)\n }\n\n props = {src: normalize(def.url || ''), alt: node.alt}\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title\n }\n\n return h(node, 'img', props)\n}\n","'use strict'\n\nvar normalize = require('mdurl/encode')\n\nmodule.exports = image\n\nfunction image(h, node) {\n var props = {src: normalize(node.url), alt: node.alt}\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title\n }\n\n return h(node, 'img', props)\n}\n","'use strict'\n\nmodule.exports = inlineCode\n\nvar u = require('unist-builder')\n\nfunction inlineCode(h, node) {\n var value = node.value.replace(/\\r?\\n|\\r/g, ' ')\n return h(node, 'code', [u('text', value)])\n}\n","'use strict'\n\nmodule.exports = linkReference\n\nvar normalize = require('mdurl/encode')\nvar revert = require('../revert')\nvar all = require('../all')\n\nfunction linkReference(h, node) {\n var def = h.definition(node.identifier)\n var props\n\n if (!def) {\n return revert(h, node)\n }\n\n props = {href: normalize(def.url || '')}\n\n if (def.title !== null && def.title !== undefined) {\n props.title = def.title\n }\n\n return h(node, 'a', props, all(h, node))\n}\n","'use strict'\n\nvar normalize = require('mdurl/encode')\nvar all = require('../all')\n\nmodule.exports = link\n\nfunction link(h, node) {\n var props = {href: normalize(node.url)}\n\n if (node.title !== null && node.title !== undefined) {\n props.title = node.title\n }\n\n return h(node, 'a', props, all(h, node))\n}\n","'use strict'\n\nmodule.exports = listItem\n\nvar u = require('unist-builder')\nvar all = require('../all')\n\nfunction listItem(h, node, parent) {\n var result = all(h, node)\n var head = result[0]\n var loose = parent ? listLoose(parent) : listItemLoose(node)\n var props = {}\n var wrapped = []\n var length\n var index\n var child\n\n if (typeof node.checked === 'boolean') {\n if (!head || head.tagName !== 'p') {\n head = h(null, 'p', [])\n result.unshift(head)\n }\n\n if (head.children.length !== 0) {\n head.children.unshift(u('text', ' '))\n }\n\n head.children.unshift(\n h(null, 'input', {\n type: 'checkbox',\n checked: node.checked,\n disabled: true\n })\n )\n\n // According to github-markdown-css, this class hides bullet.\n // See: .\n props.className = ['task-list-item']\n }\n\n length = result.length\n index = -1\n\n while (++index < length) {\n child = result[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (loose || index !== 0 || child.tagName !== 'p') {\n wrapped.push(u('text', '\\n'))\n }\n\n if (child.tagName === 'p' && !loose) {\n wrapped = wrapped.concat(child.children)\n } else {\n wrapped.push(child)\n }\n }\n\n // Add a final eol.\n if (length && (loose || child.tagName !== 'p')) {\n wrapped.push(u('text', '\\n'))\n }\n\n return h(node, 'li', props, wrapped)\n}\n\nfunction listLoose(node) {\n var loose = node.spread\n var children = node.children\n var length = children.length\n var index = -1\n\n while (!loose && ++index < length) {\n loose = listItemLoose(children[index])\n }\n\n return loose\n}\n\nfunction listItemLoose(node) {\n var spread = node.spread\n\n return spread === undefined || spread === null\n ? node.children.length > 1\n : spread\n}\n","'use strict'\n\nmodule.exports = paragraph\n\nvar all = require('../all')\n\nfunction paragraph(h, node) {\n return h(node, 'p', all(h, node))\n}\n","'use strict'\n\nmodule.exports = root\n\nvar u = require('unist-builder')\nvar wrap = require('../wrap')\nvar all = require('../all')\n\nfunction root(h, node) {\n return h.augment(node, u('root', wrap(all(h, node))))\n}\n","'use strict'\n\nmodule.exports = strong\n\nvar all = require('../all')\n\nfunction strong(h, node) {\n return h(node, 'strong', all(h, node))\n}\n","'use strict'\n\nmodule.exports = table\n\nvar position = require('unist-util-position')\nvar wrap = require('../wrap')\nvar all = require('../all')\n\nfunction table(h, node) {\n var rows = node.children\n var index = rows.length\n var align = node.align || []\n var alignLength = align.length\n var result = []\n var pos\n var row\n var out\n var name\n var cell\n\n while (index--) {\n row = rows[index].children\n name = index === 0 ? 'th' : 'td'\n pos = alignLength || row.length\n out = []\n\n while (pos--) {\n cell = row[pos]\n out[pos] = h(cell, name, {align: align[pos]}, cell ? all(h, cell) : [])\n }\n\n result[index] = h(rows[index], 'tr', wrap(out, true))\n }\n\n return h(\n node,\n 'table',\n wrap(\n [h(result[0].position, 'thead', wrap([result[0]], true))].concat(\n result[1]\n ? h(\n {\n start: position.start(result[1]),\n end: position.end(result[result.length - 1])\n },\n 'tbody',\n wrap(result.slice(1), true)\n )\n : []\n ),\n true\n )\n )\n}\n","'use strict'\n\nmodule.exports = text\n\nvar u = require('unist-builder')\n\nfunction text(h, node) {\n return h.augment(\n node,\n u('text', String(node.value).replace(/[ \\t]*(\\r?\\n|\\r)[ \\t]*/g, '$1'))\n )\n}\n","'use strict'\n\nmodule.exports = {\n blockquote: require('./blockquote'),\n break: require('./break'),\n code: require('./code'),\n delete: require('./delete'),\n emphasis: require('./emphasis'),\n footnoteReference: require('./footnote-reference'),\n footnote: require('./footnote'),\n heading: require('./heading'),\n html: require('./html'),\n imageReference: require('./image-reference'),\n image: require('./image'),\n inlineCode: require('./inline-code'),\n linkReference: require('./link-reference'),\n link: require('./link'),\n listItem: require('./list-item'),\n list: require('./list'),\n paragraph: require('./paragraph'),\n root: require('./root'),\n strong: require('./strong'),\n table: require('./table'),\n text: require('./text'),\n thematicBreak: require('./thematic-break'),\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n return null\n}\n","'use strict'\n\nmodule.exports = toHast\n\nvar u = require('unist-builder')\nvar visit = require('unist-util-visit')\nvar position = require('unist-util-position')\nvar generated = require('unist-util-generated')\nvar definitions = require('mdast-util-definitions')\nvar one = require('./one')\nvar footer = require('./footer')\nvar handlers = require('./handlers')\n\nvar own = {}.hasOwnProperty\n\nvar deprecationWarningIssued = false\n\n// Factory to transform.\nfunction factory(tree, options) {\n var settings = options || {}\n\n // Issue a warning if the deprecated tag 'allowDangerousHTML' is used\n if (settings.allowDangerousHTML !== undefined && !deprecationWarningIssued) {\n deprecationWarningIssued = true\n console.warn(\n 'mdast-util-to-hast: deprecation: `allowDangerousHTML` is nonstandard, use `allowDangerousHtml` instead'\n )\n }\n\n var dangerous = settings.allowDangerousHtml || settings.allowDangerousHTML\n var footnoteById = {}\n\n h.dangerous = dangerous\n h.definition = definitions(tree, settings)\n h.footnoteById = footnoteById\n h.footnoteOrder = []\n h.augment = augment\n h.handlers = Object.assign({}, handlers, settings.handlers)\n h.unknownHandler = settings.unknownHandler\n\n visit(tree, 'footnoteDefinition', onfootnotedefinition)\n\n return h\n\n // Finalise the created `right`, a hast node, from `left`, an mdast node.\n function augment(left, right) {\n var data\n var ctx\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (left && 'data' in left) {\n data = left.data\n\n if (right.type === 'element' && data.hName) {\n right.tagName = data.hName\n }\n\n if (right.type === 'element' && data.hProperties) {\n right.properties = Object.assign({}, right.properties, data.hProperties)\n }\n\n if (right.children && data.hChildren) {\n right.children = data.hChildren\n }\n }\n\n ctx = left && left.position ? left : {position: left}\n\n if (!generated(ctx)) {\n right.position = {\n start: position.start(ctx),\n end: position.end(ctx)\n }\n }\n\n return right\n }\n\n // Create an element for `node`.\n function h(node, tagName, props, children) {\n if (\n (children === undefined || children === null) &&\n typeof props === 'object' &&\n 'length' in props\n ) {\n children = props\n props = {}\n }\n\n return augment(node, {\n type: 'element',\n tagName: tagName,\n properties: props || {},\n children: children || []\n })\n }\n\n function onfootnotedefinition(definition) {\n var id = String(definition.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!own.call(footnoteById, id)) {\n footnoteById[id] = definition\n }\n }\n}\n\n// Transform `tree`, which is an mdast node, to a hast node.\nfunction toHast(tree, options) {\n var h = factory(tree, options)\n var node = one(h, tree)\n var foot = footer(h)\n\n if (foot) {\n node.children = node.children.concat(u('text', '\\n'), foot)\n }\n\n return node\n}\n","'use strict'\nmodule.exports = require('./lib')\n","'use strict'\n\nvar mdast2hast = require('mdast-util-to-hast')\n\nmodule.exports = remark2rehype\n\n// Attacher.\n// If a destination is given, runs the destination with the new hast tree\n// (bridge mode).\n// Without destination, returns the tree: further plugins run on that tree\n// (mutate mode).\nfunction remark2rehype(destination, options) {\n if (destination && !destination.process) {\n options = destination\n destination = null\n }\n\n return destination ? bridge(destination, options) : mutate(options)\n}\n\n// Bridge mode.\n// Runs the destination with the new hast tree.\nfunction bridge(destination, options) {\n return transformer\n\n function transformer(node, file, next) {\n destination.run(mdast2hast(node, options), file, done)\n\n function done(err) {\n next(err)\n }\n }\n}\n\n// Mutate-mode.\n// Further transformers run on the hast tree.\nfunction mutate(options) {\n return transformer\n\n function transformer(node) {\n return mdast2hast(node, options)\n }\n}\n","'use strict'\n\nmodule.exports = Schema\n\nvar proto = Schema.prototype\n\nproto.space = null\nproto.normal = {}\nproto.property = {}\n\nfunction Schema(property, normal, space) {\n this.property = property\n this.normal = normal\n\n if (space) {\n this.space = space\n }\n}\n","'use strict'\n\nvar xtend = require('xtend')\nvar Schema = require('./schema')\n\nmodule.exports = merge\n\nfunction merge(definitions) {\n var length = definitions.length\n var property = []\n var normal = []\n var index = -1\n var info\n var space\n\n while (++index < length) {\n info = definitions[index]\n property.push(info.property)\n normal.push(info.normal)\n space = info.space\n }\n\n return new Schema(\n xtend.apply(null, property),\n xtend.apply(null, normal),\n space\n )\n}\n","'use strict'\n\nmodule.exports = normalize\n\nfunction normalize(value) {\n return value.toLowerCase()\n}\n","'use strict'\n\nmodule.exports = Info\n\nvar proto = Info.prototype\n\nproto.space = null\nproto.attribute = null\nproto.property = null\nproto.boolean = false\nproto.booleanish = false\nproto.overloadedBoolean = false\nproto.number = false\nproto.commaSeparated = false\nproto.spaceSeparated = false\nproto.commaOrSpaceSeparated = false\nproto.mustUseProperty = false\nproto.defined = false\n\nfunction Info(property, attribute) {\n this.property = property\n this.attribute = attribute\n}\n","'use strict'\n\nvar powers = 0\n\nexports.boolean = increment()\nexports.booleanish = increment()\nexports.overloadedBoolean = increment()\nexports.number = increment()\nexports.spaceSeparated = increment()\nexports.commaSeparated = increment()\nexports.commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return Math.pow(2, ++powers)\n}\n","'use strict'\n\nvar Info = require('./info')\nvar types = require('./types')\n\nmodule.exports = DefinedInfo\n\nDefinedInfo.prototype = new Info()\nDefinedInfo.prototype.defined = true\n\nvar checks = [\n 'boolean',\n 'booleanish',\n 'overloadedBoolean',\n 'number',\n 'commaSeparated',\n 'spaceSeparated',\n 'commaOrSpaceSeparated'\n]\nvar checksLength = checks.length\n\nfunction DefinedInfo(property, attribute, mask, space) {\n var index = -1\n var check\n\n mark(this, 'space', space)\n\n Info.call(this, property, attribute)\n\n while (++index < checksLength) {\n check = checks[index]\n mark(this, check, (mask & types[check]) === types[check])\n }\n}\n\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","'use strict'\n\nvar normalize = require('../../normalize')\nvar Schema = require('./schema')\nvar DefinedInfo = require('./defined-info')\n\nmodule.exports = create\n\nfunction create(definition) {\n var space = definition.space\n var mustUseProperty = definition.mustUseProperty || []\n var attributes = definition.attributes || {}\n var props = definition.properties\n var transform = definition.transform\n var property = {}\n var normal = {}\n var prop\n var info\n\n for (prop in props) {\n info = new DefinedInfo(\n prop,\n transform(attributes, prop),\n props[prop],\n space\n )\n\n if (mustUseProperty.indexOf(prop) !== -1) {\n info.mustUseProperty = true\n }\n\n property[prop] = info\n\n normal[normalize(prop)] = prop\n normal[normalize(info.attribute)] = prop\n }\n\n return new Schema(property, normal, space)\n}\n","'use strict'\n\nvar create = require('./util/create')\n\nmodule.exports = create({\n space: 'xlink',\n transform: xlinkTransform,\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n }\n})\n\nfunction xlinkTransform(_, prop) {\n return 'xlink:' + prop.slice(5).toLowerCase()\n}\n","'use strict'\n\nvar create = require('./util/create')\n\nmodule.exports = create({\n space: 'xml',\n transform: xmlTransform,\n properties: {\n xmlLang: null,\n xmlBase: null,\n xmlSpace: null\n }\n})\n\nfunction xmlTransform(_, prop) {\n return 'xml:' + prop.slice(3).toLowerCase()\n}\n","'use strict'\n\nmodule.exports = caseSensitiveTransform\n\nfunction caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","'use strict'\n\nvar caseSensitiveTransform = require('./case-sensitive-transform')\n\nmodule.exports = caseInsensitiveTransform\n\nfunction caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","'use strict'\n\nvar create = require('./util/create')\nvar caseInsensitiveTransform = require('./util/case-insensitive-transform')\n\nmodule.exports = create({\n space: 'xmlns',\n attributes: {\n xmlnsxlink: 'xmlns:xlink'\n },\n transform: caseInsensitiveTransform,\n properties: {\n xmlns: null,\n xmlnsXLink: null\n }\n})\n","'use strict'\n\nvar types = require('./util/types')\nvar create = require('./util/create')\n\nvar booleanish = types.booleanish\nvar number = types.number\nvar spaceSeparated = types.spaceSeparated\n\nmodule.exports = create({\n transform: ariaTransform,\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n }\n})\n\nfunction ariaTransform(_, prop) {\n return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase()\n}\n","'use strict'\n\nvar types = require('./util/types')\nvar create = require('./util/create')\nvar caseInsensitiveTransform = require('./util/case-insensitive-transform')\n\nvar boolean = types.boolean\nvar overloadedBoolean = types.overloadedBoolean\nvar booleanish = types.booleanish\nvar number = types.number\nvar spaceSeparated = types.spaceSeparated\nvar commaSeparated = types.commaSeparated\n\nmodule.exports = create({\n space: 'html',\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n transform: caseInsensitiveTransform,\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n capture: boolean,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: boolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: commaSeparated,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforePrint: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextMenu: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: commaSeparated,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // ``. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // ``. List of URIs to archives\n axis: null, // `
    ` and ``. Use `scope` on ``\n background: null, // ``. Use CSS `background-image` instead\n bgColor: null, // `` and table elements. Use CSS `background-color` instead\n border: number, // ``. Use CSS `border-width` instead,\n borderColor: null, // `
    `. Use CSS `border-color` instead,\n bottomMargin: number, // ``\n cellPadding: null, // `
    `\n cellSpacing: null, // `
    `\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // ``\n clear: null, // `
    `. Use CSS `clear` instead\n code: null, // ``\n codeBase: null, // ``\n codeType: null, // ``\n color: null, // `` and `
    `. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // ``\n event: null, // `${newline}`,\n\t\t\t\t});\n\t\t\t} else if (import_script) {\n\t\t\t\tinstance[0].value = (instance[0].value as string).replace(\n\t\t\t\t\tRE_SCRIPT,\n\t\t\t\t\t`$1${newline}\\t${import_script}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// inject the frontmatter into the module script if there is any, reusing the existing module script if one exists\n\t\t\tif (!_module[0] && fm) {\n\t\t\t\t_module.push({\n\t\t\t\t\ttype: 'raw',\n\t\t\t\t\tvalue: ``,\n\t\t\t\t});\n\t\t\t} else if (fm) {\n\t\t\t\t// @ts-ignore\n\t\t\t\t_module[0].value = _module[0].value.replace(\n\t\t\t\t\tRE_MODULE_SCRIPT,\n\t\t\t\t\t(match: string) => `${match}${newline}\\t${fm}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// smoosh it all together in an order that makes sense,\n\t\t\t// if using a layout we only wrap the html and nothing else\n\t\t\t//@ts-ignore\n\t\t\tnode.children = [\n\t\t\t\t//@ts-ignore\n\t\t\t\t..._module,\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: _module[0] ? newline : '' },\n\t\t\t\t//@ts-ignore\n\t\t\t\t...instance,\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: instance[0] ? newline : '' },\n\t\t\t\t//@ts-ignore\n\t\t\t\t...css,\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: css[0] ? newline : '' },\n\t\t\t\t//@ts-ignore\n\t\t\t\t...special,\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: special[0] ? newline : '' },\n\n\t\t\t\t{\n\t\t\t\t\t//@ts-ignore\n\t\t\t\t\ttype: 'raw',\n\t\t\t\t\tvalue: import_script\n\t\t\t\t\t\t? ``\n\t\t\t\t\t\t: '',\n\t\t\t\t},\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: newline },\n\t\t\t\t//@ts-ignore\n\t\t\t\t...html,\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: newline },\n\t\t\t\t//@ts-ignore\n\t\t\t\t{ type: 'raw', value: import_script ? '' : '' },\n\t\t\t];\n\t\t});\n\t};\n}\n\n// highlighting stuff\n\n// { [lang]: { path, deps: pointer to key } }\nconst langs: { [x: string]: MdsvexLanguage } = {};\nlet Prism: any;\n\nconst make_path = (base_path: string, id: string) =>\n\tbase_path.replace('{id}', id);\n\n// we need to get all language metadata\n// also track if they depend on other languages so we can autoload without breaking\n// i don't actually know what the require key means but it sounds important\n\nfunction get_lang_info(\n\tname: string,\n\tlang_meta: PrismLanguage,\n\tbase_path: string\n): [MdsvexLanguage, Set] {\n\tconst _lang_meta = {\n\t\tname,\n\t\tpath: `prismjs/${make_path(base_path, name)}`,\n\t\tdeps: new Set(),\n\t};\n\n\tconst aliases = new Set();\n\n\t// TODO: DRY this up, it is literally identical\n\n\tif (lang_meta.require) {\n\t\tif (Array.isArray(lang_meta.require)) {\n\t\t\tlang_meta.require.forEach((id) => _lang_meta.deps.add(id));\n\t\t} else {\n\t\t\t_lang_meta.deps.add(lang_meta.require);\n\t\t}\n\t}\n\n\tif (lang_meta.peerDependencies) {\n\t\tif (Array.isArray(lang_meta.peerDependencies)) {\n\t\t\tlang_meta.peerDependencies.forEach((id) => _lang_meta.deps.add(id));\n\t\t} else {\n\t\t\t_lang_meta.deps.add(lang_meta.peerDependencies);\n\t\t}\n\t}\n\n\tif (lang_meta.alias) {\n\t\tif (Array.isArray(lang_meta.alias)) {\n\t\t\tlang_meta.alias.forEach((id) => aliases.add(id));\n\t\t} else {\n\t\t\taliases.add(lang_meta.alias);\n\t\t}\n\t}\n\n\treturn [{ ..._lang_meta, aliases }, aliases];\n}\n\n// workaround for ts weirdness - intersection types work better with interfaces vs object literals\ninterface Meta {\n\tmeta: PrismMeta;\n}\n\nasync function load_language_metadata() {\n\tconst mod: Record & Meta = await import(\n\t\t//@ts-ignore\n\t\t'prismjs/components'\n\t);\n\n\t// @ts-ignore\n\tconst languages = mod.languages || mod.default.languages;\n\t// @ts-ignore\n\tconst meta = languages.meta;\n\n\tfor (const lang in languages) {\n\t\tconst [lang_info, aliases] = get_lang_info(\n\t\t\tlang,\n\t\t\t// @ts-ignore\n\t\t\tlanguages[lang],\n\t\t\tmeta.path\n\t\t);\n\n\t\tlangs[lang] = lang_info;\n\t\taliases.forEach((_n) => {\n\t\t\tlangs[_n] = langs[lang];\n\t\t});\n\t}\n\n\tconst svelte_meta = {\n\t\tname: 'svelte',\n\t\taliases: new Set(['sv']),\n\t\tpath: 'prism-svelte',\n\t\tdeps: new Set(['javscript', 'css']),\n\t};\n\n\tlangs.svelte = svelte_meta;\n\tlangs.sv = svelte_meta;\n}\n\nasync function load_language(lang: string) {\n\tif (!langs[lang]) return;\n\n\tawait Promise.all(\n\t\tArray.from(langs[lang].deps).map(async (name) => await load_language(name))\n\t);\n\ttry {\n\t\tawait import(/* @vite-ignore */ langs[lang].path);\n\t} catch (e) {\n\t\ttry {\n\t\t\tawait import(/* @vite-ignore */ langs[lang].path + '.js');\n\t\t} catch (e) {\n\t\t\tconsole.log('failed to load language', lang);\n\t\t}\n\t}\n}\n\nexport function highlight_blocks({\n\thighlighter: highlight_fn,\n\talias,\n\toptimise = true,\n}: {\n\thighlighter?: Highlighter;\n\talias?: { [x: string]: string };\n\toptimise?: boolean;\n} = {}): Transformer {\n\tlet pending_langs: Promise;\n\tlet processed_langs = false;\n\tif (highlight_fn) {\n\t\tpending_langs = load_language_metadata();\n\t}\n\n\treturn async function (tree, vFile) {\n\t\tif (highlight_fn) {\n\t\t\tif (!processed_langs) {\n\t\t\t\tawait pending_langs;\n\t\t\t\tif (alias) {\n\t\t\t\t\tfor (const lang in alias) {\n\t\t\t\t\t\tlangs[lang] = langs[alias[lang]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprocessed_langs = true;\n\t\t\t}\n\t\t\tconst nodes: (Code | Html)[] = [];\n\t\t\tvisit(tree, 'code', (node) => {\n\t\t\t\tnodes.push(node);\n\t\t\t});\n\n\t\t\tawait Promise.all(\n\t\t\t\tnodes.map(async (node) => {\n\t\t\t\t\t(node as Html).type = 'html';\n\t\t\t\t\tnode.value = await highlight_fn(\n\t\t\t\t\t\tnode.value,\n\t\t\t\t\t\t(node as Code).lang,\n\t\t\t\t\t\t(node as Code).meta,\n\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\tvFile.filename,\n\t\t\t\t\t\toptimise\n\t\t\t\t\t);\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t};\n}\n// escape curlies, backtick, \\t, \\r, \\n to avoid breaking output of {@html `here`} in .svelte\nexport const escape_svelty = (str: string): string =>\n\tstr\n\t\t.replace(\n\t\t\t/[{}`]/g,\n\t\t\t//@ts-ignore\n\t\t\t(c) => ({ '{': '{', '}': '}', '`': '`' }[c])\n\t\t)\n\t\t.replace(/\\\\([trn])/g, '\$1');\n\nexport const code_highlight: Highlighter = async (\n\tcode,\n\tlang,\n\t_meta,\n\t_filename,\n\toptimise\n) => {\n\tconst normalised_lang = lang?.toLowerCase();\n\tlet _lang = !!normalised_lang && langs[normalised_lang];\n\t//@ts-ignore\n\tif (!Prism) Prism = await import('prismjs');\n\n\tlet status = 'loading';\n\tif (_lang && !Prism.languages[_lang.name]) {\n\t\ttry {\n\t\t\tawait load_language(_lang.name);\n\t\t\tstatus = 'loaded';\n\t\t} catch (e) {\n\t\t\tstatus = 'failed';\n\t\t}\n\t}\n\n\tif (\n\t\t!_lang &&\n\t\tnormalised_lang &&\n\t\tPrism.languages[normalised_lang] &&\n\t\tstatus === 'loaded'\n\t) {\n\t\tlangs[normalised_lang] = { name: lang } as MdsvexLanguage;\n\t\t_lang = langs[normalised_lang];\n\t}\n\tconst highlighted = escape_svelty(\n\t\t_lang && Prism.languages[_lang.name]\n\t\t\t? Prism.highlight(code, Prism.languages[_lang.name], _lang.name)\n\t\t\t: escape(code)\n\t);\n\treturn optimise\n\t\t? `
    {@html \\`${highlighted}\\`}
    `\n\t\t: `
    ${highlighted}
    `;\n};\n","import type { ExportNamedDeclaration } from 'estree';\nimport type { Node } from 'unist';\nimport type { Processor } from 'unified';\n\nimport type {\n\tTransformOptions,\n\tMdsvexOptions,\n\tMdsvexCompileOptions,\n\tLayout,\n\tPreprocessor,\n\tPreprocessorReturn,\n\tUnifiedPlugins,\n\tLayoutMode,\n} from './types';\nexport * from './types';\n\nimport { make_process } from './utils';\n\nimport { parse } from 'svelte/compiler';\nimport unified from 'unified';\nimport markdown from 'remark-parse';\n//@ts-ignore\nimport external from 'remark-external-links';\nimport extract_frontmatter from 'remark-frontmatter';\nimport remark2rehype from 'remark-rehype';\n//@ts-ignore\nimport hast_to_html from '@starptech/prettyhtml-hast-to-html';\n\nconst is_browser = typeof window !== 'undefined';\n\nimport { mdsvex_parser } from './parsers';\nimport {\n\tdefault_frontmatter,\n\tparse_frontmatter,\n\tescape_code,\n\ttransform_hast,\n\tsmartypants_transformer,\n\thighlight_blocks,\n\tcode_highlight,\n\tescape_brackets,\n\thandle_path,\n} from './transformers';\n\nfunction stringify(this: Processor, options = {}) {\n\tthis.Compiler = compiler;\n\n\tfunction compiler(tree: Node): string {\n\t\treturn hast_to_html(tree, options);\n\t}\n}\n\nconst apply_plugins = (plugins: UnifiedPlugins, parser: Processor) => {\n\t(plugins as UnifiedPlugins).forEach((plugin) => {\n\t\tif (Array.isArray(plugin)) {\n\t\t\tif (plugin[1] && plugin[1]) parser.use(plugin[0], plugin[1]);\n\t\t\telse parser.use(plugin[0]);\n\t\t} else {\n\t\t\tparser.use(plugin);\n\t\t}\n\t});\n\n\treturn parser;\n};\n\nexport function transform(\n\t{\n\t\tremarkPlugins = [],\n\t\trehypePlugins = [],\n\t\tfrontmatter,\n\t\tsmartypants,\n\t\thighlight,\n\t} = {} as Omit\n): Processor & {\n\tadd_layouts: (layout: Layout, layout_mode: LayoutMode) => void;\n} {\n\tconst fm_opts = frontmatter\n\t\t? frontmatter\n\t\t: { parse: default_frontmatter, type: 'yaml', marker: '-' };\n\tconst toMDAST = unified()\n\t\t.use(markdown)\n\t\t.use(mdsvex_parser)\n\t\t.use(external, { target: false, rel: ['nofollow'] })\n\t\t.use(escape_brackets)\n\t\t.use(escape_code, { blocks: !!highlight })\n\t\t.use(extract_frontmatter, [{ type: fm_opts.type, marker: fm_opts.marker }])\n\t\t.use(parse_frontmatter, { parse: fm_opts.parse, type: fm_opts.type });\n\n\tif (smartypants) {\n\t\ttoMDAST.use(\n\t\t\tsmartypants_transformer,\n\t\t\ttypeof smartypants === 'boolean' ? {} : smartypants\n\t\t);\n\t}\n\n\tapply_plugins(remarkPlugins, toMDAST).use(highlight_blocks, highlight || {});\n\n\tconst toHAST = toMDAST.use(remark2rehype, {\n\t\t// @ts-ignore\n\t\tallowDangerousHtml: true,\n\t\tallowDangerousCharacters: true,\n\t});\n\n\tapply_plugins(rehypePlugins, toHAST);\n\n\tconst processor = toHAST.use(stringify, {\n\t\tallowDangerousHtml: true,\n\t\tallowDangerousCharacters: true,\n\t}) as Processor & {\n\t\tadd_layouts: (layout: Layout, layout_mode: LayoutMode) => void;\n\t};\n\n\tprocessor.add_layouts = (layout: Layout, layout_mode: LayoutMode) => {\n\t\tprocessor.use(transform_hast, { layout: layout, layout_mode });\n\t};\n\n\treturn processor;\n}\n\nconst defaults = {\n\tremarkPlugins: [],\n\trehypePlugins: [],\n\tsmartypants: true,\n\textension: '.svx',\n\thighlight: { highlighter: code_highlight, optimise: true },\n};\n\nfunction to_posix(_path: string): string {\n\tconst isExtendedLengthPath = /^\\\\\\\\\\?\\\\/.test(_path);\n\tconst hasNonAscii = /[^\\u0000-\\u0080]+/.test(_path);\n\n\tif (isExtendedLengthPath || hasNonAscii) {\n\t\treturn _path;\n\t}\n\n\treturn _path.replace(/\\\\/g, '/');\n}\n\n// let _require: any;\n\nasync function resolve_layout(layout_path: string): Promise {\n\tif (is_browser) {\n\t\t// In browser environments, we can't resolve file paths\n\t\t// Return the path as-is or handle differently based on your needs\n\t\treturn to_posix(layout_path);\n\t}\n\n\ttry {\n\t\treturn to_posix(layout_path);\n\t} catch (e) {\n\t\tconst path = await import('path');\n\n\t\ttry {\n\t\t\tconst _path = path.join(process.cwd(), layout_path);\n\t\t\treturn to_posix(_path);\n\t\t} catch (e) {\n\t\t\tthrow new Error(\n\t\t\t\t`The layout path you provided couldn't be found at either ${layout_path} or ${path.join(\n\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\tlayout_path\n\t\t\t\t)}. Please double-check it and try again.`\n\t\t\t);\n\t\t}\n\t}\n}\n\n// handle custom components\n\nasync function process_layouts(layouts: Layout) {\n\tif (is_browser) {\n\t\t// In browser environments, we can't read the file system\n\t\t// Return layouts as-is without processing\n\t\treturn layouts;\n\t}\n\n\tconst _layouts = layouts;\n\n\tfor (const key in _layouts) {\n\t\tconst fs = await import('fs');\n\t\tconst layout = fs.readFileSync(_layouts[key].path, { encoding: 'utf8' });\n\t\tlet ast;\n\t\ttry {\n\t\t\tast = parse(layout);\n\t\t} catch (e: unknown) {\n\t\t\tthrow new Error((e as Error).toString() + `\\n\tat ${_layouts[key].path}`);\n\t\t}\n\n\t\tif (ast.module) {\n\t\t\tconst component_exports = ast.module.content.body.filter(\n\t\t\t\t(node: any) => node.type === 'ExportNamedDeclaration'\n\t\t\t) as ExportNamedDeclaration[];\n\n\t\t\tif (component_exports.length) {\n\t\t\t\t_layouts[key].components = [];\n\n\t\t\t\tfor (let i = 0; i < component_exports.length; i++) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tcomponent_exports[i].specifiers &&\n\t\t\t\t\t\tcomponent_exports[i].specifiers.length\n\t\t\t\t\t) {\n\t\t\t\t\t\tfor (let j = 0; j < component_exports[i].specifiers.length; j++) {\n\t\t\t\t\t\t\t_layouts[key].components.push(\n\t\t\t\t\t\t\t\tcomponent_exports[i].specifiers[j].exported.name\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t} else if (component_exports[i].declaration.declarations) {\n\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\tconst declarations = component_exports[i].declaration.declarations;\n\n\t\t\t\t\t\tfor (let j = 0; j < declarations.length; j++) {\n\t\t\t\t\t\t\t_layouts[key].components.push(declarations[j].id.name);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (component_exports[i].declaration) {\n\t\t\t\t\t\t_layouts[key].components.push(\n\t\t\t\t\t\t\t//@ts-ignore\n\t\t\t\t\t\t\tcomponent_exports[i].declaration.id.name\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn _layouts;\n}\n\n/**\n * The svelte preprocessor for use with svelte.preprocess\n *\n * **options** - An options object with the following properties, all are optional.\n *\n * - `extension` - The extension to use for mdsvex files\n * - `extensions` - The extensions to use for mdsvex files\n * - `layout` - Layouts to apply to mdsvex documents\n * - `frontmatter` - frontmatter options for documents\n * - `highlight` - syntax highlighting options\n * - `smartypants` - smart typography options\n * - `remarkPlugins` - remark plugins to apply to the markdown\n * - `rehypePlugins` - rehype plugins to apply to the rendered html\n *\n */\n\nexport const mdsvex = (options: MdsvexOptions = defaults): Preprocessor => {\n\tlet {\n\t\tremarkPlugins = [],\n\t\trehypePlugins = [],\n\t\tsmartypants = true,\n\t\textension = '.svx',\n\t\textensions,\n\t\tlayout = false,\n\t\thighlight = { highlighter: code_highlight, optimise: true },\n\t\tfrontmatter,\n\t} = options;\n\n\tif (highlight === undefined) {\n\t\thighlight = { highlighter: code_highlight, optimise: true };\n\t} else if (highlight) {\n\t\thighlight = {\n\t\t\thighlighter: code_highlight,\n\t\t\toptimise: true,\n\t\t\t...highlight,\n\t\t};\n\t}\n\n\t//@ts-ignore\n\tif (options.layouts) {\n\t\tthrow new Error(\n\t\t\t`mdsvex: \"layouts\" is not a valid option. Did you mean \"layout\"?`\n\t\t);\n\t}\n\n\tconst unknown_opts = [];\n\tconst known_opts = [\n\t\t'filename',\n\t\t'remarkPlugins',\n\t\t'rehypePlugins',\n\t\t'smartypants',\n\t\t'extension',\n\t\t'extensions',\n\t\t'layout',\n\t\t'highlight',\n\t\t'frontmatter',\n\t];\n\n\tfor (const opt in options) {\n\t\tif (!known_opts.includes(opt)) unknown_opts.push(opt);\n\t}\n\n\tif (unknown_opts.length) {\n\t\tconsole.warn(\n\t\t\t`mdsvex: Received unknown options: ${unknown_opts.join(\n\t\t\t\t', '\n\t\t\t)}. Valid options are: ${known_opts.join(', ')}.`\n\t\t);\n\t}\n\n\tlet layouts_processed: Promise | undefined = undefined;\n\n\tconst parser = transform({\n\t\tremarkPlugins,\n\t\trehypePlugins,\n\t\tsmartypants,\n\t\thighlight,\n\t\tfrontmatter,\n\t});\n\n\treturn {\n\t\tname: 'mdsvex',\n\t\tmarkup: async ({ content, filename }) => {\n\t\t\tlet _layout: Layout = {};\n\t\t\tlet layout_mode: LayoutMode = 'single';\n\n\t\t\t// if `layout_processed` is undefined, we need to process the layouts\n\t\t\tif (!layouts_processed && !is_browser) {\n\t\t\t\tlet resolve: () => void | undefined;\n\t\t\t\t// set `layout_processed` before the first await to prevent race conditions\n\t\t\t\tlayouts_processed = new Promise((r) => (resolve = r));\n\t\t\t\tawait handle_path();\n\t\t\t\tif (typeof layout === 'string') {\n\t\t\t\t\t_layout.__mdsvex_default = {\n\t\t\t\t\t\tpath: await resolve_layout(layout),\n\t\t\t\t\t\tcomponents: [],\n\t\t\t\t\t};\n\t\t\t\t} else if (typeof layout === 'object') {\n\t\t\t\t\tlayout_mode = 'named';\n\t\t\t\t\tfor (const name in layout) {\n\t\t\t\t\t\t_layout[name] = {\n\t\t\t\t\t\t\tpath: await resolve_layout(layout[name]),\n\t\t\t\t\t\t\tcomponents: [],\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_layout = await process_layouts(_layout);\n\t\t\t\tparser.add_layouts(_layout, layout_mode);\n\t\t\t\t// resolve the `layout_processed` promise to unlock the rest of the file\n\t\t\t\t// that are waiting before calling parser.process\n\t\t\t\tresolve!();\n\t\t\t}\n\n\t\t\tif (highlight && highlight.highlighter === undefined) {\n\t\t\t\thighlight.highlighter = code_highlight;\n\t\t\t}\n\n\t\t\tconst extensionsParts = (extensions || [extension]).map((ext) =>\n\t\t\t\text.startsWith('.') ? ext : '.' + ext\n\t\t\t);\n\t\t\tif (!extensionsParts.some((ext) => filename && filename.endsWith(ext))) return;\n\n\t\t\t// before calling parser.process, we need to wait for the layouts to be processed\n\t\t\t// or else the parser will be frozen\n\t\t\tawait layouts_processed;\n\t\t\tconst parsed = await parser.process({ contents: content, filename });\n\t\t\treturn {\n\t\t\t\tcode: parsed.contents as string,\n\t\t\t\tdata: parsed.data as Record,\n\t\t\t\tmap: '',\n\t\t\t};\n\t\t},\n\t};\n};\n\n/**\n * The standalone compile function.\n *\n * - **source** - the source code to convert.\n * - **options** - An options object with the following properties, all are optional.\n *\n * - `filename` - The filename of the generated file\n * - `extension` - The extension to use for mdsvex files\n * - `extensions` - The extensions to use for mdsvex files\n * - `layout` - Layouts to apply to mdsvex documents\n * - `frontmatter` - frontmatter options for documents\n * - `highlight` - syntax highlighting options\n * - `smartypants` - smart typography options\n * - `remarkPlugins` - remark plugins to apply to the markdown\n * - `rehypePlugins` - rehype plugins to apply to the rendered html\n */\n\nconst _compile = async (\n\tsource: string,\n\topts?: MdsvexCompileOptions\n): Promise => {\n\tif (is_browser) {\n\t\t// @ts-ignore\n\t\tglobalThis.process = make_process();\n\t}\n\n\tconst preprocessor = mdsvex(opts);\n\treturn preprocessor.markup({\n\t\tcontent: source,\n\t\tfilename:\n\t\t\t(opts && opts.filename) ||\n\t\t\t`file${\n\t\t\t\t(opts && ((opts.extensions && opts.extensions[0]) || opts.extension)) ||\n\t\t\t\t'.svx'\n\t\t\t}`,\n\t});\n};\n\nexport { _compile as compile, code_highlight as code_highlighter };\n","// @ts-ignore\nglobalThis.global = globalThis;\n\nif (typeof window !== 'undefined') {\n\t// @ts-ignore\n\twindow.global = globalThis;\n}\n\nexport { defineConfig as defineMDSveXConfig } from './define-config';\nexport { compile, mdsvex, code_highlighter } from './index';\nexport { escape_svelty as escapeSvelte } from './transformers';\nexport type {\n\tMdsvexCompileOptions,\n\tMdsvexLanguage,\n\tMdsvexOptions,\n} from './types';\n"],"names":["bail","extend","slice","wrap_1","wrap","require$$0","trough","own","stringify","position","VMessage","proto","path","require$$1","buffer","require$$2","core","VFile","order","toString","vfile","info","plain","require$$3","require$$4","require$$5","unified_1","unified","pipeline","pipelineParse","pipelineRun","pipelineStringify","assertUnfrozen","assertParser","newable","assertNode","assertDone","assertCompiler","keys","inherits_browserModule","inheritsModule","xtend","unherit","factory","vfileLocation","hexadecimal","decimal","alphanumerical","decodeEntity","legacy","defaults","tab","lineFeed","space","lessThan","name","parse","entities","decode","tokenizer","convert","ok","typeFactory","anyFactory","color","visitParents","CONTINUE","SKIP","EXIT","visit","repeat","blockquote_1","thematicBreak_1","list_1","html","normalize_1","table_1","paragraph_1","_escape","link","link_1","strong","strong_1","emphasis","emphasis_1","_delete","codeInline","_break","text_1","parser","Parser","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","require$$23","require$$24","require$$25","require$$26","require$$27","require$$28","require$$29","require$$30","require$$31","require$$32","require$$33","mdastUtilDefinitions","getDefinitionFactory","getterFactory","gather","normalise","empty","whiteSpace","definitions","spaceSeparated","fault","create","matters","fence","compile","u","generated","all_1","one_1","thematicBreak","list","all","footer","footnoteReference","html_1","encode","revert","normalize","image","listItem","text","handlers","lib","one","schema","Schema","merge","Info","types","DefinedInfo","mark","xlink","xml","caseSensitiveTransform","caseInsensitiveTransform","xmlns","booleanish","number","aria","boolean","commaSeparated","svg","is","siblings_1","after","first","place","whiteSpaceLeft","omission","element","tableRow","closing","body","tbody","cap","escape","DQ","SQ","unquoted","singleQuoted","doubleQuoted","constants","expressions","common","YAMLException","Mark","Type","_require","require","_hasOwnProperty","_toString","DEFAULT_SAFE_SCHEMA","DEFAULT_FULL_SCHEMA","State","loader","dumper","jsYaml","yaml","retext","smartypants","remark2rehype"],"mappings":";;;MAEa,YAAa,GAAE,CAAC,MAAM,KAAoB;;ACShD,SAAS,YAAY,GAAG;AAC/B,CAAC,MAAM,UAAU;AACjB,EAAE,KAAK,EAAE,SAAS;AAClB,EAAE,IAAI,EAAE,EAAE;AACV,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,QAAQ,EAAE;AACZ,GAAG,WAAW,EAAE,EAAE;AAClB,GAAG,IAAI,EAAE,EAAE;AACX,GAAG,EAAE,EAAE,EAAE;AACT,GAAG,IAAI,EAAE,EAAE;AACX,GAAG,EAAE,EAAE,EAA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;AACA,UAAU,CAAC,MAAO,GAAE,UAAU,CAAA;AAC9B;AACA,IAAI,OAAO,MAAO,KAAI,WAAW,EAAE;AACnC;AACA,CAAC,MAAM,CAAC,MAAO,GAAE,UAAU,CAAA;AAC3B;;;;","x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,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,53,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,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242]} \ No newline at end of file diff --git a/tools/ui/node_modules/mdsvex/dist/main.d.ts b/tools/ui/node_modules/mdsvex/dist/main.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4d2d8766f03451fc1247e5852cf3f8101b7fcac --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main.d.ts @@ -0,0 +1,282 @@ +import { VFileMessage } from 'vfile-message'; +import { Plugin, Settings } from 'unified'; + +/** + * mdsvex representation of a language + */ +interface MdsvexLanguage { + aliases: Set; + name: string; + path: string; + deps: Set; +} +interface FrontmatterOptions { + /** + * **parse** - defines a custom parse function for frontmatter. The function receives the frontmatter string and an errors array as arguments and must return either `undefined` or an object of options containing the frontmatter data. Errors or warnings can be pushed to the messages array and will be printed to the user, they should take the shape of a {@link https://github.com/vfile/vfile-message vfile message}. The default frontmatter parser only handles `yaml`. + * + * *example:* + * ```js + * parse(frontmatter, messages) { + * try { + * return parse(frontmatter); + * } catch(e) { + * messages.push(new Message(e.message)); + * } + * } + * ``` + */ + parse: (fm: string, messages: VFileMessage[]) => undefined | Record; + /** + * **type** - a string describing the language of your frontmatter. Default: `yaml`. + * + * *example:* + * ```js + * type: "toml" + * ``` + */ + type: string; + /** + * **marker** - a character describing the fence that should be used for frontmatter. Passing `"+"` allows the use of `+++`. Default: `"-"`. + * + * *example:* + * ```js + * marker: "+" + * ``` + */ + marker: string; +} +interface SmartypantsOptions { + /** + * **quotes** - Converts straight double and single quotes to fancy curly double or single quotes. Default: `true`. + * + * *example:* + * ```js + * quotes: false // to disable + * ``` + */ + quotes?: boolean; + /** + * **ellipses** - Converts three dots (`...`) to a real ellipsis character. Default: `true`. + * + * *example:* + * ```js + * ellipses: true // to disable + * ``` + */ + ellipses?: boolean; + /** + * **backticks** - When `true`, converts double back-ticks into an opening curly double quote, and double straight single quotes into a closing curly double quote. When `"all"` it also converts single back-ticks into a single opening quote, and a single straight quote into a closing single, curly quote. Default: `true`. + * + * Note: Quotes can not be `true` when backticks is `'all'`; + * + * *example:* + * ```js + * backticks: "all" // to disable + * ``` + */ + backticks?: boolean | 'all'; + /** + * **dashes** - When `true`, converts two dashes into an em-dash character. When `'oldschool'`, converts two dashes into an en-dash, and three dashes into an em-dash. When `'inverted'`, converts two dashes into an em-dash, and three dashes into an en-dash. Default: `true`. + * + * *example:* + * ```js + * dashes: "oldschool" + * ``` + */ + dashes?: boolean | 'oldschool' | 'inverted'; +} +type Highlighter = (code: string, lang: string | null | undefined, metastring: string | null | undefined, filename?: string, optimise?: boolean) => string | Promise; +interface HighlightOptions { + /** + * **highlighter** - A custom highlight function for syntax highlighting. Two arguments are passed, both strings: the code to highlight and the language (if one is provided). It must return a string that will be injected into the document (or a promise that resolves to a string). + * + * *example:* + * ```js + * highlighter(code, lang = "") { + * return `
    ${code}
    `; + * } + * ``` + * + * Can be an async function. + */ + highlighter?: Highlighter; + /** + * **alias** - An object of aliases for standard language names. This allow you to map arbitrary names to standard names. + * + * *example:* + * ```js + * alias: { + * yavascript: 'javascript' + * } + * ``` + */ + alias?: Record; + /** + * **optimise** - Whether to optimise the code blocks by placing them in Svelte's `@html` block. Default: `true`. + * + * *example:* + * ```js + * optimise: false + * ``` + */ + optimise?: boolean; +} +/** + * The mdsvex options object + */ +interface MdsvexOptions { + /** + * **remarkPlugins** - an array with each element being either a {@link https://github.com/remarkjs/remark/blob/HEAD/doc/plugins.md#list-of-plugins remark plugin} or a tuple of `plugin` and `pluginOptions`. Default: `[ ]`. {@link https://mdsvex.com/docs#remarkplugins--rehypeplugins More details.} + * + * *examples:* + * ```js + * remarkPlugins: [ plugin1, plugin2 ] + * ``` + * ```js + * remarkPlugins: [ [ plugin, options], [ plugin2, options2 ] ] + * ``` + * ```js + * remarkPlugins: [ plugin, [ plugin2, options2 ] ] + * ``` + */ + remarkPlugins?: Array<[Plugin, Settings] | Plugin>; + /** + * **rehypePlugins** - an array with each element being either a {@link https://github.com/rehypejs/rehype/blob/HEAD/doc/plugins.md#list-of-plugins rehype plugin} or a tuple of `plugin` and `pluginOptions`. Default: `[ ]`. {@link https://mdsvex.com/docs#remarkplugins--rehypeplugins More details.} + * + * *examples:* + * ```js + * rehypePlugins: [ plugin1, plugin2 ] + * ``` + * ```js + * rehypePlugins: [ [ plugin, options], [ plugin2, options2 ] ] + * ``` + * ```js + * rehypePlugins: [ plugin, [ plugin2, options2 ] ] + * ``` + */ + rehypePlugins?: Array<[Plugin, Settings] | Plugin>; + /** + * **frontmatter** - an object of frontmatter options. {@link https://mdsvex.com/docs#frontmatter More details.} + * - `parse` - a custom frontmatter parser. + * - `type` - the name of your frontmatter language. + * - `marker` - a character describing the fence to be used for frontmatter. + */ + frontmatter?: FrontmatterOptions; + /** + * **smartypants** - smartypants transforms ASCII punctuation into fancy typography, this property configures it with an object of options. all are optional. It can be disabled by passing `false`. {@link https://mdsvex.com/docs#smartypants More details.} + * + * - `quotes` - converts stright quotes to curly quotes. + * - `ellipses` - converts three dots into an ellipsis. + * - `backticks` - converts backtick and stright quote combinations into curly quotes. + * - `dashes` - converts hyphens into en and em dashes. + */ + smartypants?: SmartypantsOptions | boolean; + /** + * **highlight** - Configures the syntax highlighting in mdsvex documents. Can be either `false` (to disable highlighting) or take an options object with following properties. {@link https://mdsvex.com/docs#highlight More details.} + * + * - `highlighter` - A custom highlight function. + * - `alias` - map language arbitrary names to standard language names + */ + highlight?: HighlightOptions | false; + /** + * **extension** - the extension to use for mdsvex files. Default: `".svx"`. {@link https://mdsvex.com/docs#extension More details.} + * + * **DEPRECATED:** use {@link MdsvexOptions.extensions } instead. + */ + extension?: string; + /** + * **extensions** - the extensions to use for mdsvex files. {@link https://mdsvex.com/docs#extensions More details.} + * + * *example:* + * ```js + * extensions: [".svexy"], + * ``` + */ + extensions?: string[]; + /** + * **layout** - A string defining a single layout to use for everything or an object of named layouts. When using names layouts, a key of `_` will define the fallback layout. Default: `undefined` (no layouts). {@link https://mdsvex.com/docs#layouts More details.} + * + * *examples:* + * ```js + * layout: "/path/to/layout.svelte" + * ``` + * ```js + * layout: { + * blog: "/path/to/layout/blog.svelte", + * _: "/path/to/layout/default.svelte" + * } + * ``` + */ + layout?: string | Record; +} +/** + * The svelte preprocessor for use with svelte.preprocess + * + * **options** - An options object with the following properties, all are optional. + * + * - `extension` - The extension to use for mdsvex files + * - `layout` - Layouts to apply to mdsvex documents + * - `frontmatter` - frontmatter options for documents + * - `highlight` - syntax highlighting options + * - `smartypants` - smart typography options + * - `remarkPlugins` - remark plugins to apply to the markdown + * - `rehypePlugins` - rehype plugins to apply to the rendered html + * + */ +interface MdsvexCompileOptions extends MdsvexOptions { + filename?: string; +} +type PreprocessorReturn = Promise<{ + code: string; + data?: Record; + map?: string; +} | undefined>; +interface Preprocessor { + name: string; + markup: (args: { + content: string; + filename?: string; + }) => PreprocessorReturn; +} + +declare const defineConfig: (config: MdsvexOptions) => MdsvexOptions; + +declare const escape_svelty: (str: string) => string; +declare const code_highlight: Highlighter; + +/** + * The svelte preprocessor for use with svelte.preprocess + * + * **options** - An options object with the following properties, all are optional. + * + * - `extension` - The extension to use for mdsvex files + * - `extensions` - The extensions to use for mdsvex files + * - `layout` - Layouts to apply to mdsvex documents + * - `frontmatter` - frontmatter options for documents + * - `highlight` - syntax highlighting options + * - `smartypants` - smart typography options + * - `remarkPlugins` - remark plugins to apply to the markdown + * - `rehypePlugins` - rehype plugins to apply to the rendered html + * + */ +declare const mdsvex: (options?: MdsvexOptions) => Preprocessor; +/** + * The standalone compile function. + * + * - **source** - the source code to convert. + * - **options** - An options object with the following properties, all are optional. + * + * - `filename` - The filename of the generated file + * - `extension` - The extension to use for mdsvex files + * - `extensions` - The extensions to use for mdsvex files + * - `layout` - Layouts to apply to mdsvex documents + * - `frontmatter` - frontmatter options for documents + * - `highlight` - syntax highlighting options + * - `smartypants` - smart typography options + * - `remarkPlugins` - remark plugins to apply to the markdown + * - `rehypePlugins` - rehype plugins to apply to the rendered html + */ +declare const _compile: (source: string, opts?: MdsvexCompileOptions) => Promise; + +export { type MdsvexCompileOptions, type MdsvexLanguage, type MdsvexOptions, code_highlight as code_highlighter, _compile as compile, defineConfig as defineMDSveXConfig, escape_svelty as escapeSvelte, mdsvex }; +//# sourceMappingURL=main.d.ts.map diff --git a/tools/ui/node_modules/mdsvex/dist/main.d.ts.map b/tools/ui/node_modules/mdsvex/dist/main.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..50228f0db9e8b315596a529b1aa74fb6431626e5 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/mdsvex/dist/main.js b/tools/ui/node_modules/mdsvex/dist/main.js new file mode 100644 index 0000000000000000000000000000000000000000..9f471fe20c918f57c88df939d381c8d927cafca5 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main.js @@ -0,0 +1,4 @@ +export { a as code_highlighter, _ as compile, d as defineMDSveXConfig, e as escapeSvelte, m as mdsvex } from './main-DLA3kuAq.js'; +import 'svelte/compiler'; +import 'path'; +//# sourceMappingURL=main.js.map diff --git a/tools/ui/node_modules/mdsvex/dist/main.js.map b/tools/ui/node_modules/mdsvex/dist/main.js.map new file mode 100644 index 0000000000000000000000000000000000000000..dfad2366ce7e1d709c5c7a7bb98756c8ec66efc4 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/tools/ui/node_modules/mdsvex/dist/prism-Cz3w-km1.js b/tools/ui/node_modules/mdsvex/dist/prism-Cz3w-km1.js new file mode 100644 index 0000000000000000000000000000000000000000..08f35e89faa8d50bfa9cdf0143f7d67c9b5c7d20 --- /dev/null +++ b/tools/ui/node_modules/mdsvex/dist/prism-Cz3w-km1.js @@ -0,0 +1,1711 @@ +import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './main-DLA3kuAq.js'; + +function _mergeNamespaces(n, m) { + m.forEach(function (e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + if (k !== 'default' && !(k in n)) { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function () { return e[k]; } + }); + } + }); + }); + return Object.freeze(n); +} + +var prism$2 = {exports: {}}; + +(function (module) { + /* ********************************************** + Begin prism-core.js + ********************************************** */ + + /// + + var _self = (typeof window !== 'undefined') + ? window // if in browser + : ( + (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) + ? self // if in worker + : {} // if in node js + ); + + /** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */ + var Prism = (function (_self){ + + // Private helper vars + var lang = /\blang(?:uage)?-([\w-]+)\b/i; + var uniqueId = 0; + + + var _ = { + /** + * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the + * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load + * additional languages or plugins yourself. + * + * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. + * + * You obviously have to change this value before the automatic highlighting started. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.manual = true; + * // add a new