` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**:\n * > It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * \n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**:\n * > It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * \n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `
` element (which could be changed with `data.hName`),\n * with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @overload\n * @param {Readonly | Processor | null | undefined} [destination]\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge | TransformMutate}\n *\n * @param {Readonly | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly | null | undefined} [options]\n * When a processor was given,\n * configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (\n toHast(tree, {file, ...options})\n )\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree, file) {\n // Cast because root in -> root out.\n // To do: in the future, disallow ` || options` fallback.\n // With `unified-engine`, `destination` can be `undefined` but\n // `options` will be the file set.\n // We should not pass that as `options`.\n return /** @type {HastRoot} */ (\n toHast(tree, {file, ...(destination || options)})\n )\n }\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n */\n\nimport {visit} from 'unist-util-visit'\n\n/**\n * Remove empty paragraphs in `tree`.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @returns {undefined}\n * Nothing.\n */\nexport function squeezeParagraphs(tree) {\n visit(tree, function (node, index, parent) {\n if (\n index !== undefined &&\n parent &&\n node.type === 'paragraph' &&\n node.children.every(function (child) {\n return child.type === 'text' && /^\\s*$/.test(child.value)\n })\n ) {\n parent.children.splice(index, 1)\n return index\n }\n })\n}\n","/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: MIT\n */\n\n/**\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n * @typedef {import('mdast').Root} Root\n */\n\nimport {squeezeParagraphs} from 'mdast-squeeze-paragraphs'\nimport {visit} from 'unist-util-visit'\n\n/**\n * Only keep links with the given protocols.\n *\n * @param {object} options Options\n * @param {string[]} options.except - Protocols to exclude. Defauls to `['http', 'https']`.\n * @returns\n * Transform.\n */\nexport default function remarkUnlinkProtocols(\n options = {except: ['http', 'https']}\n) {\n /**\n * Transform.\n *\n * @param {Root} tree\n * Tree.\n * @returns {undefined}\n * Nothing.\n */\n return function (tree) {\n /** @type {Map} */\n const definitions = new Map()\n\n // Find definitions to look up linkReferences.\n visit(tree, 'definition', function (node, index, parent) {\n definitions.set(node.identifier, node.url)\n if (parent && typeof index === 'number') {\n const url = node.url\n if (\n url &&\n url.includes(':') &&\n !options.except.some((proto) => url.startsWith(`${proto}:`))\n ) {\n parent.children.splice(index, 1)\n return index\n }\n }\n })\n\n visit(tree, function (node, index, parent) {\n if (\n parent &&\n typeof index === 'number' &&\n (node.type === 'link' || node.type === 'linkReference')\n ) {\n const url =\n node.type === 'link' ? node.url : definitions.get(node.identifier)\n if (\n url &&\n url.includes(':') &&\n !options.except.some((proto) => url.startsWith(`${proto}:`))\n ) {\n parent.children.splice(index, 1, ...node.children)\n return index\n }\n }\n })\n\n squeezeParagraphs(tree)\n }\n}\n","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\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","var E = Object.defineProperty, M = Object.defineProperties;\nvar x = Object.getOwnPropertyDescriptors;\nvar V = Object.getOwnPropertySymbols;\nvar I = Object.prototype.hasOwnProperty, N = Object.prototype.propertyIsEnumerable;\nvar C = (e, t, s) => t in e ? E(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, f = (e, t) => {\n for (var s in t || (t = {}))\n I.call(t, s) && C(e, s, t[s]);\n if (V)\n for (var s of V(t))\n N.call(t, s) && C(e, s, t[s]);\n return e;\n}, m = (e, t) => M(e, x(t));\nimport { openBlock as a, createElementBlock as h, createElementVNode as u, resolveDirective as K, normalizeClass as A, renderSlot as r, normalizeProps as d, guardReactiveProps as c, Fragment as B, renderList as L, createTextVNode as v, toDisplayString as D, createBlock as b, resolveDynamicComponent as _, createCommentVNode as O, mergeProps as k, toHandlers as j, withDirectives as w, vShow as P, createVNode as $, Transition as R, withCtx as z, withModifiers as F } from \"vue\";\nconst U = {\n props: {\n autoscroll: {\n type: Boolean,\n default: !0\n }\n },\n watch: {\n typeAheadPointer() {\n this.autoscroll && this.maybeAdjustScroll();\n },\n open(e) {\n this.autoscroll && e && this.$nextTick(() => this.maybeAdjustScroll());\n }\n },\n methods: {\n maybeAdjustScroll() {\n var t;\n const e = ((t = this.$refs.dropdownMenu) == null ? void 0 : t.children[this.typeAheadPointer]) || !1;\n if (e) {\n const s = this.getDropdownViewport(), { top: n, bottom: l, height: i } = e.getBoundingClientRect();\n if (n < s.top)\n return this.$refs.dropdownMenu.scrollTop = e.offsetTop;\n if (l > s.bottom)\n return this.$refs.dropdownMenu.scrollTop = e.offsetTop - (s.height - i);\n }\n },\n getDropdownViewport() {\n return this.$refs.dropdownMenu ? this.$refs.dropdownMenu.getBoundingClientRect() : {\n height: 0,\n top: 0,\n bottom: 0\n };\n }\n }\n}, q = {\n data() {\n return {\n typeAheadPointer: -1\n };\n },\n watch: {\n filteredOptions() {\n for (let e = 0; e < this.filteredOptions.length; e++)\n if (this.selectable(this.filteredOptions[e])) {\n this.typeAheadPointer = e;\n break;\n }\n },\n open(e) {\n e && this.typeAheadToLastSelected();\n },\n selectedValue() {\n this.open && this.typeAheadToLastSelected();\n }\n },\n methods: {\n typeAheadUp() {\n for (let e = this.typeAheadPointer - 1; e >= 0; e--)\n if (this.selectable(this.filteredOptions[e])) {\n this.typeAheadPointer = e;\n break;\n }\n },\n typeAheadDown() {\n for (let e = this.typeAheadPointer + 1; e < this.filteredOptions.length; e++)\n if (this.selectable(this.filteredOptions[e])) {\n this.typeAheadPointer = e;\n break;\n }\n },\n typeAheadSelect() {\n const e = this.filteredOptions[this.typeAheadPointer];\n e && this.selectable(e) && this.select(e);\n },\n typeAheadToLastSelected() {\n this.typeAheadPointer = this.selectedValue.length !== 0 ? this.filteredOptions.indexOf(this.selectedValue[this.selectedValue.length - 1]) : -1;\n }\n }\n}, J = {\n props: {\n loading: {\n type: Boolean,\n default: !1\n }\n },\n data() {\n return {\n mutableLoading: !1\n };\n },\n watch: {\n search() {\n this.$emit(\"search\", this.search, this.toggleLoading);\n },\n loading(e) {\n this.mutableLoading = e;\n }\n },\n methods: {\n toggleLoading(e = null) {\n return e == null ? this.mutableLoading = !this.mutableLoading : this.mutableLoading = e;\n }\n }\n}, S = (e, t) => {\n const s = e.__vccOpts || e;\n for (const [n, l] of t)\n s[n] = l;\n return s;\n}, H = {}, X = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"10\",\n height: \"10\"\n}, Y = /* @__PURE__ */ u(\"path\", { d: \"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z\" }, null, -1), Q = [\n Y\n];\nfunction G(e, t) {\n return a(), h(\"svg\", X, Q);\n}\nconst W = /* @__PURE__ */ S(H, [[\"render\", G]]), Z = {}, ee = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"14\",\n height: \"10\"\n}, te = /* @__PURE__ */ u(\"path\", { d: \"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z\" }, null, -1), se = [\n te\n];\nfunction ie(e, t) {\n return a(), h(\"svg\", ee, se);\n}\nconst oe = /* @__PURE__ */ S(Z, [[\"render\", ie]]), T = {\n Deselect: W,\n OpenIndicator: oe\n}, ne = {\n mounted(e, { instance: t }) {\n if (t.appendToBody) {\n const {\n height: s,\n top: n,\n left: l,\n width: i\n } = t.$refs.toggle.getBoundingClientRect();\n let y = window.scrollX || window.pageXOffset, o = window.scrollY || window.pageYOffset;\n e.unbindPosition = t.calculatePosition(e, t, {\n width: i + \"px\",\n left: y + l + \"px\",\n top: o + n + s + \"px\"\n }), document.body.appendChild(e);\n }\n },\n unmounted(e, { instance: t }) {\n t.appendToBody && (e.unbindPosition && typeof e.unbindPosition == \"function\" && e.unbindPosition(), e.parentNode && e.parentNode.removeChild(e));\n }\n};\nfunction le(e) {\n const t = {};\n return Object.keys(e).sort().forEach((s) => {\n t[s] = e[s];\n }), JSON.stringify(t);\n}\nlet ae = 0;\nfunction re() {\n return ++ae;\n}\nconst de = {\n components: f({}, T),\n directives: { appendToBody: ne },\n mixins: [U, q, J],\n compatConfig: {\n MODE: 3\n },\n emits: [\n \"open\",\n \"close\",\n \"update:modelValue\",\n \"search\",\n \"search:compositionstart\",\n \"search:compositionend\",\n \"search:keydown\",\n \"search:blur\",\n \"search:focus\",\n \"search:input\",\n \"option:created\",\n \"option:selecting\",\n \"option:selected\",\n \"option:deselecting\",\n \"option:deselected\"\n ],\n props: {\n modelValue: {},\n components: {\n type: Object,\n default: () => ({})\n },\n options: {\n type: Array,\n default() {\n return [];\n }\n },\n disabled: {\n type: Boolean,\n default: !1\n },\n clearable: {\n type: Boolean,\n default: !0\n },\n deselectFromDropdown: {\n type: Boolean,\n default: !1\n },\n searchable: {\n type: Boolean,\n default: !0\n },\n multiple: {\n type: Boolean,\n default: !1\n },\n placeholder: {\n type: String,\n default: \"\"\n },\n transition: {\n type: String,\n default: \"vs__fade\"\n },\n clearSearchOnSelect: {\n type: Boolean,\n default: !0\n },\n closeOnSelect: {\n type: Boolean,\n default: !0\n },\n label: {\n type: String,\n default: \"label\"\n },\n autocomplete: {\n type: String,\n default: \"off\"\n },\n reduce: {\n type: Function,\n default: (e) => e\n },\n selectable: {\n type: Function,\n default: (e) => !0\n },\n getOptionLabel: {\n type: Function,\n default(e) {\n return typeof e == \"object\" ? e.hasOwnProperty(this.label) ? e[this.label] : console.warn(`[vue-select warn]: Label key \"option.${this.label}\" does not exist in options object ${JSON.stringify(e)}.\nhttps://vue-select.org/api/props.html#getoptionlabel`) : e;\n }\n },\n getOptionKey: {\n type: Function,\n default(e) {\n if (typeof e != \"object\")\n return e;\n try {\n return e.hasOwnProperty(\"id\") ? e.id : le(e);\n } catch (t) {\n return console.warn(`[vue-select warn]: Could not stringify this option to generate unique key. Please provide'getOptionKey' prop to return a unique key for each option.\nhttps://vue-select.org/api/props.html#getoptionkey`, e, t);\n }\n }\n },\n onTab: {\n type: Function,\n default: function() {\n this.selectOnTab && !this.isComposing && this.typeAheadSelect();\n }\n },\n taggable: {\n type: Boolean,\n default: !1\n },\n tabindex: {\n type: Number,\n default: null\n },\n pushTags: {\n type: Boolean,\n default: !1\n },\n filterable: {\n type: Boolean,\n default: !0\n },\n filterBy: {\n type: Function,\n default(e, t, s) {\n return (t || \"\").toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1;\n }\n },\n filter: {\n type: Function,\n default(e, t) {\n return e.filter((s) => {\n let n = this.getOptionLabel(s);\n return typeof n == \"number\" && (n = n.toString()), this.filterBy(s, n, t);\n });\n }\n },\n createOption: {\n type: Function,\n default(e) {\n return typeof this.optionList[0] == \"object\" ? { [this.label]: e } : e;\n }\n },\n resetOnOptionsChange: {\n default: !1,\n validator: (e) => [\"function\", \"boolean\"].includes(typeof e)\n },\n clearSearchOnBlur: {\n type: Function,\n default: function({ clearSearchOnSelect: e, multiple: t }) {\n return e && !t;\n }\n },\n noDrop: {\n type: Boolean,\n default: !1\n },\n inputId: {\n type: String\n },\n dir: {\n type: String,\n default: \"auto\"\n },\n selectOnTab: {\n type: Boolean,\n default: !1\n },\n selectOnKeyCodes: {\n type: Array,\n default: () => [13]\n },\n searchInputQuerySelector: {\n type: String,\n default: \"[type=search]\"\n },\n mapKeydown: {\n type: Function,\n default: (e, t) => e\n },\n appendToBody: {\n type: Boolean,\n default: !1\n },\n calculatePosition: {\n type: Function,\n default(e, t, { width: s, top: n, left: l }) {\n e.style.top = n, e.style.left = l, e.style.width = s;\n }\n },\n dropdownShouldOpen: {\n type: Function,\n default({ noDrop: e, open: t, mutableLoading: s }) {\n return e ? !1 : t && !s;\n }\n },\n uid: {\n type: [String, Number],\n default: () => re()\n }\n },\n data() {\n return {\n search: \"\",\n open: !1,\n isComposing: !1,\n pushedTags: [],\n _value: [],\n deselectButtons: []\n };\n },\n computed: {\n isReducingValues() {\n return this.$props.reduce !== this.$options.props.reduce.default;\n },\n isTrackingValues() {\n return typeof this.modelValue == \"undefined\" || this.isReducingValues;\n },\n selectedValue() {\n let e = this.modelValue;\n return this.isTrackingValues && (e = this.$data._value), e != null && e !== \"\" ? [].concat(e) : [];\n },\n optionList() {\n return this.options.concat(this.pushTags ? this.pushedTags : []);\n },\n searchEl() {\n return this.$slots.search ? this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector) : this.$refs.search;\n },\n scope() {\n const e = {\n search: this.search,\n loading: this.loading,\n searching: this.searching,\n filteredOptions: this.filteredOptions\n };\n return {\n search: {\n attributes: f({\n disabled: this.disabled,\n placeholder: this.searchPlaceholder,\n tabindex: this.tabindex,\n readonly: !this.searchable,\n id: this.inputId,\n \"aria-autocomplete\": \"list\",\n \"aria-labelledby\": `vs${this.uid}__combobox`,\n \"aria-controls\": `vs${this.uid}__listbox`,\n ref: \"search\",\n type: \"search\",\n autocomplete: this.autocomplete,\n value: this.search\n }, this.dropdownOpen && this.filteredOptions[this.typeAheadPointer] ? {\n \"aria-activedescendant\": `vs${this.uid}__option-${this.typeAheadPointer}`\n } : {}),\n events: {\n compositionstart: () => this.isComposing = !0,\n compositionend: () => this.isComposing = !1,\n keydown: this.onSearchKeyDown,\n blur: this.onSearchBlur,\n focus: this.onSearchFocus,\n input: (t) => this.search = t.target.value\n }\n },\n spinner: {\n loading: this.mutableLoading\n },\n noOptions: {\n search: this.search,\n loading: this.mutableLoading,\n searching: this.searching\n },\n openIndicator: {\n attributes: {\n ref: \"openIndicator\",\n role: \"presentation\",\n class: \"vs__open-indicator\"\n }\n },\n listHeader: e,\n listFooter: e,\n header: m(f({}, e), { deselect: this.deselect }),\n footer: m(f({}, e), { deselect: this.deselect })\n };\n },\n childComponents() {\n return f(f({}, T), this.components);\n },\n stateClasses() {\n return {\n \"vs--open\": this.dropdownOpen,\n \"vs--single\": !this.multiple,\n \"vs--multiple\": this.multiple,\n \"vs--searching\": this.searching && !this.noDrop,\n \"vs--searchable\": this.searchable && !this.noDrop,\n \"vs--unsearchable\": !this.searchable,\n \"vs--loading\": this.mutableLoading,\n \"vs--disabled\": this.disabled\n };\n },\n searching() {\n return !!this.search;\n },\n dropdownOpen() {\n return this.dropdownShouldOpen(this);\n },\n searchPlaceholder() {\n return this.isValueEmpty && this.placeholder ? this.placeholder : void 0;\n },\n filteredOptions() {\n const e = [].concat(this.optionList);\n if (!this.filterable && !this.taggable)\n return e;\n const t = this.search.length ? this.filter(e, this.search, this) : e;\n if (this.taggable && this.search.length) {\n const s = this.createOption(this.search);\n this.optionExists(s) || t.unshift(s);\n }\n return t;\n },\n isValueEmpty() {\n return this.selectedValue.length === 0;\n },\n showClearButton() {\n return !this.multiple && this.clearable && !this.open && !this.isValueEmpty;\n }\n },\n watch: {\n options(e, t) {\n const s = () => typeof this.resetOnOptionsChange == \"function\" ? this.resetOnOptionsChange(e, t, this.selectedValue) : this.resetOnOptionsChange;\n !this.taggable && s() && this.clearSelection(), this.modelValue && this.isTrackingValues && this.setInternalValueFromOptions(this.modelValue);\n },\n modelValue: {\n immediate: !0,\n handler(e) {\n this.isTrackingValues && this.setInternalValueFromOptions(e);\n }\n },\n multiple() {\n this.clearSelection();\n },\n open(e) {\n this.$emit(e ? \"open\" : \"close\");\n }\n },\n created() {\n this.mutableLoading = this.loading;\n },\n methods: {\n setInternalValueFromOptions(e) {\n Array.isArray(e) ? this.$data._value = e.map((t) => this.findOptionFromReducedValue(t)) : this.$data._value = this.findOptionFromReducedValue(e);\n },\n select(e) {\n this.$emit(\"option:selecting\", e), this.isOptionSelected(e) ? this.deselectFromDropdown && (this.clearable || this.multiple && this.selectedValue.length > 1) && this.deselect(e) : (this.taggable && !this.optionExists(e) && (this.$emit(\"option:created\", e), this.pushTag(e)), this.multiple && (e = this.selectedValue.concat(e)), this.updateValue(e), this.$emit(\"option:selected\", e)), this.onAfterSelect(e);\n },\n deselect(e) {\n this.$emit(\"option:deselecting\", e), this.updateValue(this.selectedValue.filter((t) => !this.optionComparator(t, e))), this.$emit(\"option:deselected\", e);\n },\n clearSelection() {\n this.updateValue(this.multiple ? [] : null);\n },\n onAfterSelect(e) {\n this.closeOnSelect && (this.open = !this.open, this.searchEl.blur()), this.clearSearchOnSelect && (this.search = \"\");\n },\n updateValue(e) {\n typeof this.modelValue == \"undefined\" && (this.$data._value = e), e !== null && (Array.isArray(e) ? e = e.map((t) => this.reduce(t)) : e = this.reduce(e)), this.$emit(\"update:modelValue\", e);\n },\n toggleDropdown(e) {\n const t = e.target !== this.searchEl;\n t && e.preventDefault();\n const s = [\n ...this.deselectButtons || [],\n this.$refs.clearButton\n ];\n if (this.searchEl === void 0 || s.filter(Boolean).some((n) => n.contains(e.target) || n === e.target)) {\n e.preventDefault();\n return;\n }\n this.open && t ? this.searchEl.blur() : this.disabled || (this.open = !0, this.searchEl.focus());\n },\n isOptionSelected(e) {\n return this.selectedValue.some((t) => this.optionComparator(t, e));\n },\n isOptionDeselectable(e) {\n return this.isOptionSelected(e) && this.deselectFromDropdown;\n },\n optionComparator(e, t) {\n return this.getOptionKey(e) === this.getOptionKey(t);\n },\n findOptionFromReducedValue(e) {\n const t = (n) => JSON.stringify(this.reduce(n)) === JSON.stringify(e), s = [...this.options, ...this.pushedTags].filter(t);\n return s.length === 1 ? s[0] : s.find((n) => this.optionComparator(n, this.$data._value)) || e;\n },\n closeSearchOptions() {\n this.open = !1, this.$emit(\"search:blur\");\n },\n maybeDeleteValue() {\n if (!this.searchEl.value.length && this.selectedValue && this.selectedValue.length && this.clearable) {\n let e = null;\n this.multiple && (e = [\n ...this.selectedValue.slice(0, this.selectedValue.length - 1)\n ]), this.updateValue(e);\n }\n },\n optionExists(e) {\n return this.optionList.some((t) => this.optionComparator(t, e));\n },\n normalizeOptionForSlot(e) {\n return typeof e == \"object\" ? e : { [this.label]: e };\n },\n pushTag(e) {\n this.pushedTags.push(e);\n },\n onEscape() {\n this.search.length ? this.search = \"\" : this.searchEl.blur();\n },\n onSearchBlur() {\n if (this.mousedown && !this.searching)\n this.mousedown = !1;\n else {\n const { clearSearchOnSelect: e, multiple: t } = this;\n this.clearSearchOnBlur({ clearSearchOnSelect: e, multiple: t }) && (this.search = \"\"), this.closeSearchOptions();\n return;\n }\n if (this.search.length === 0 && this.options.length === 0) {\n this.closeSearchOptions();\n return;\n }\n },\n onSearchFocus() {\n this.open = !0, this.$emit(\"search:focus\");\n },\n onMousedown() {\n this.mousedown = !0;\n },\n onMouseUp() {\n this.mousedown = !1;\n },\n onSearchKeyDown(e) {\n const t = (l) => (l.preventDefault(), !this.isComposing && this.typeAheadSelect()), s = {\n 8: (l) => this.maybeDeleteValue(),\n 9: (l) => this.onTab(),\n 27: (l) => this.onEscape(),\n 38: (l) => (l.preventDefault(), this.typeAheadUp()),\n 40: (l) => (l.preventDefault(), this.typeAheadDown())\n };\n this.selectOnKeyCodes.forEach((l) => s[l] = t);\n const n = this.mapKeydown(s, this);\n if (typeof n[e.keyCode] == \"function\")\n return n[e.keyCode](e);\n }\n }\n}, he = [\"dir\"], ce = [\"id\", \"aria-expanded\", \"aria-owns\"], ue = {\n ref: \"selectedOptions\",\n class: \"vs__selected-options\"\n}, pe = [\"disabled\", \"title\", \"aria-label\", \"onClick\"], fe = {\n ref: \"actions\",\n class: \"vs__actions\"\n}, ge = [\"disabled\"], ye = { class: \"vs__spinner\" }, me = [\"id\"], be = [\"id\", \"aria-selected\", \"onMouseover\", \"onClick\"], _e = {\n key: 0,\n class: \"vs__no-options\"\n}, Oe = /* @__PURE__ */ v(\" Sorry, no matching options. \"), we = [\"id\"];\nfunction ve(e, t, s, n, l, i) {\n const y = K(\"append-to-body\");\n return a(), h(\"div\", {\n dir: s.dir,\n class: A([\"v-select\", i.stateClasses])\n }, [\n r(e.$slots, \"header\", d(c(i.scope.header))),\n u(\"div\", {\n id: `vs${s.uid}__combobox`,\n ref: \"toggle\",\n class: \"vs__dropdown-toggle\",\n role: \"combobox\",\n \"aria-expanded\": i.dropdownOpen.toString(),\n \"aria-owns\": `vs${s.uid}__listbox`,\n \"aria-label\": \"Search for option\",\n onMousedown: t[1] || (t[1] = (o) => i.toggleDropdown(o))\n }, [\n u(\"div\", ue, [\n (a(!0), h(B, null, L(i.selectedValue, (o, p) => r(e.$slots, \"selected-option-container\", {\n option: i.normalizeOptionForSlot(o),\n deselect: i.deselect,\n multiple: s.multiple,\n disabled: s.disabled\n }, () => [\n (a(), h(\"span\", {\n key: s.getOptionKey(o),\n class: \"vs__selected\"\n }, [\n r(e.$slots, \"selected-option\", d(c(i.normalizeOptionForSlot(o))), () => [\n v(D(s.getOptionLabel(o)), 1)\n ]),\n s.multiple ? (a(), h(\"button\", {\n key: 0,\n ref_for: !0,\n ref: (g) => l.deselectButtons[p] = g,\n disabled: s.disabled,\n type: \"button\",\n class: \"vs__deselect\",\n title: `Deselect ${s.getOptionLabel(o)}`,\n \"aria-label\": `Deselect ${s.getOptionLabel(o)}`,\n onClick: (g) => i.deselect(o)\n }, [\n (a(), b(_(i.childComponents.Deselect)))\n ], 8, pe)) : O(\"\", !0)\n ]))\n ])), 256)),\n r(e.$slots, \"search\", d(c(i.scope.search)), () => [\n u(\"input\", k({ class: \"vs__search\" }, i.scope.search.attributes, j(i.scope.search.events)), null, 16)\n ])\n ], 512),\n u(\"div\", fe, [\n w(u(\"button\", {\n ref: \"clearButton\",\n disabled: s.disabled,\n type: \"button\",\n class: \"vs__clear\",\n title: \"Clear Selected\",\n \"aria-label\": \"Clear Selected\",\n onClick: t[0] || (t[0] = (...o) => i.clearSelection && i.clearSelection(...o))\n }, [\n (a(), b(_(i.childComponents.Deselect)))\n ], 8, ge), [\n [P, i.showClearButton]\n ]),\n r(e.$slots, \"open-indicator\", d(c(i.scope.openIndicator)), () => [\n s.noDrop ? O(\"\", !0) : (a(), b(_(i.childComponents.OpenIndicator), d(k({ key: 0 }, i.scope.openIndicator.attributes)), null, 16))\n ]),\n r(e.$slots, \"spinner\", d(c(i.scope.spinner)), () => [\n w(u(\"div\", ye, \"Loading...\", 512), [\n [P, e.mutableLoading]\n ])\n ])\n ], 512)\n ], 40, ce),\n $(R, { name: s.transition }, {\n default: z(() => [\n i.dropdownOpen ? w((a(), h(\"ul\", {\n id: `vs${s.uid}__listbox`,\n ref: \"dropdownMenu\",\n key: `vs${s.uid}__listbox`,\n class: \"vs__dropdown-menu\",\n role: \"listbox\",\n tabindex: \"-1\",\n onMousedown: t[2] || (t[2] = F((...o) => i.onMousedown && i.onMousedown(...o), [\"prevent\"])),\n onMouseup: t[3] || (t[3] = (...o) => i.onMouseUp && i.onMouseUp(...o))\n }, [\n r(e.$slots, \"list-header\", d(c(i.scope.listHeader))),\n (a(!0), h(B, null, L(i.filteredOptions, (o, p) => (a(), h(\"li\", {\n id: `vs${s.uid}__option-${p}`,\n key: s.getOptionKey(o),\n role: \"option\",\n class: A([\"vs__dropdown-option\", {\n \"vs__dropdown-option--deselect\": i.isOptionDeselectable(o) && p === e.typeAheadPointer,\n \"vs__dropdown-option--selected\": i.isOptionSelected(o),\n \"vs__dropdown-option--highlight\": p === e.typeAheadPointer,\n \"vs__dropdown-option--disabled\": !s.selectable(o)\n }]),\n \"aria-selected\": p === e.typeAheadPointer ? !0 : null,\n onMouseover: (g) => s.selectable(o) ? e.typeAheadPointer = p : null,\n onClick: F((g) => s.selectable(o) ? i.select(o) : null, [\"prevent\", \"stop\"])\n }, [\n r(e.$slots, \"option\", d(c(i.normalizeOptionForSlot(o))), () => [\n v(D(s.getOptionLabel(o)), 1)\n ])\n ], 42, be))), 128)),\n i.filteredOptions.length === 0 ? (a(), h(\"li\", _e, [\n r(e.$slots, \"no-options\", d(c(i.scope.noOptions)), () => [\n Oe\n ])\n ])) : O(\"\", !0),\n r(e.$slots, \"list-footer\", d(c(i.scope.listFooter)))\n ], 40, me)), [\n [y]\n ]) : (a(), h(\"ul\", {\n key: 1,\n id: `vs${s.uid}__listbox`,\n role: \"listbox\",\n style: { display: \"none\", visibility: \"hidden\" }\n }, null, 8, we))\n ]),\n _: 3\n }, 8, [\"name\"]),\n r(e.$slots, \"footer\", d(c(i.scope.footer)))\n ], 10, he);\n}\nconst Ce = /* @__PURE__ */ S(de, [[\"render\", ve]]);\nexport {\n Ce as default\n};\n","import '../assets/NcRichText-3BHy89Ls.css';\nimport rehypeExternalLinks from \"rehype-external-links\";\nimport rehype2react from \"rehype-react\";\nimport breaks from \"remark-breaks\";\nimport remarkParse from \"remark-parse\";\nimport remark2rehype from \"remark-rehype\";\nimport remarkUnlinkProtocols from \"remark-unlink-protocols\";\nimport { unified } from \"unified\";\nimport { resolveComponent, createElementBlock, createCommentVNode, openBlock, normalizeClass, Fragment, renderList, createBlock, defineComponent, unref, withCtx, createVNode, ref, h } from \"vue\";\nimport { RouterLink } from \"vue-router\";\nimport { N as NcCheckboxRadioSwitch } from \"./NcCheckboxRadioSwitch-BMsPx74L.mjs\";\nimport { getCurrentUser } from \"@nextcloud/auth\";\nimport axios from \"@nextcloud/axios\";\nimport { generateOcsUrl } from \"@nextcloud/router\";\nimport { getSharingToken } from \"@nextcloud/sharing/public\";\nimport { f as NcReferenceWidget } from \"./referencePickerModal-D9HwChP3.mjs\";\nimport { l as logger } from \"./logger-D3RVzcfQ.mjs\";\nimport { U as URL_PATTERN, g as getRoute, p as parseUrl, r as remarkAutolink } from \"./autolink-U5pBzLgI.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nimport { N as NcButton } from \"./NcButton-C9D47Igd.mjs\";\nimport { N as NcIconSvgWrapper } from \"./NcIconSvgWrapper-BvLanNaW.mjs\";\nimport { u as useCopy } from \"./useCopy-CfYsbB0V.mjs\";\nimport { c as createElementId } from \"./createElementId-DhjFt1I9.mjs\";\nimport { u } from \"unist-builder\";\nimport { visit, EXIT as EXIT$1, SKIP as SKIP$1 } from \"unist-util-visit\";\nconst _sfc_main$2 = {\n name: \"NcReferenceList\",\n components: {\n NcReferenceWidget\n },\n /* eslint vue/require-prop-comment: warn -- TODO: Add a proper doc block about what this props do */\n props: {\n text: {\n type: String,\n default: \"\"\n },\n referenceData: {\n type: Array,\n default: null\n },\n limit: {\n type: Number,\n default: 1\n },\n displayFallback: {\n type: Boolean,\n default: false\n },\n interactive: {\n type: Boolean,\n default: true\n },\n interactiveOptIn: {\n type: Boolean,\n default: false\n }\n },\n emits: [\"loaded\"],\n data() {\n return {\n references: null,\n loading: true\n };\n },\n computed: {\n isVisible() {\n return this.loading || this.displayedReferences.length !== 0;\n },\n values() {\n if (this.referenceData) {\n return this.referenceData;\n }\n if (this.displayFallback && !this.loading && !this.references) {\n return [this.fallbackReference];\n }\n return this.references ? Object.values(this.references) : [];\n },\n firstReference() {\n return this.values[0] ?? null;\n },\n displayedReferences() {\n return this.values.filter(Boolean).slice(0, this.limit);\n },\n fallbackReference() {\n return {\n accessible: true,\n openGraphObject: {\n id: this.text,\n link: this.text,\n name: this.text\n },\n richObjectType: \"open-graph\"\n };\n }\n },\n watch: {\n text: \"fetch\"\n },\n mounted() {\n this.fetch();\n },\n methods: {\n fetch() {\n this.loading = true;\n if (this.referenceData) {\n this.references = null;\n this.loading = false;\n return;\n }\n if (!new RegExp(URL_PATTERN).exec(this.text)) {\n this.references = null;\n this.loading = false;\n return;\n }\n this.resolve().then((response) => {\n this.references = response.data.ocs.data.references;\n this.loading = false;\n this.$emit(\"loaded\");\n }).catch((error) => {\n logger.error(\"[NcReferenceList] Failed to extract references\", { error });\n this.loading = false;\n this.$emit(\"loaded\");\n });\n },\n resolve() {\n const match = new RegExp(URL_PATTERN).exec(this.text.trim());\n const isPublic = getCurrentUser() === null;\n if (this.limit === 1 && match) {\n return isPublic ? axios.get(generateOcsUrl(\"references/resolvePublic\") + `?reference=${encodeURIComponent(match[0])}&sharingToken=${getSharingToken()}`) : axios.get(generateOcsUrl(\"references/resolve\") + `?reference=${encodeURIComponent(match[0])}`);\n }\n return isPublic ? axios.post(generateOcsUrl(\"references/extractPublic\"), {\n text: this.text,\n resolve: true,\n limit: this.limit,\n sharingToken: getSharingToken()\n }) : axios.post(generateOcsUrl(\"references/extract\"), {\n text: this.text,\n resolve: true,\n limit: this.limit\n });\n }\n }\n};\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_NcReferenceWidget = resolveComponent(\"NcReferenceWidget\");\n return $options.isVisible ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass([\"widgets--list\", { \"icon-loading\": $data.loading }])\n }, [\n (openBlock(true), createElementBlock(Fragment, null, renderList($options.displayedReferences, (reference) => {\n return openBlock(), createBlock(_component_NcReferenceWidget, {\n key: reference.openGraphObject?.id,\n reference,\n interactive: $props.interactive,\n interactiveOptIn: $props.interactiveOptIn\n }, null, 8, [\"reference\", \"interactive\", \"interactiveOptIn\"]);\n }), 128))\n ], 2)) : createCommentVNode(\"\", true);\n}\nconst NcReferenceList = /* @__PURE__ */ _export_sfc(_sfc_main$2, [[\"render\", _sfc_render], [\"__scopeId\", \"data-v-9cde5a6a\"]]);\nfunction ccount(value, character) {\n const source = String(value);\n if (typeof character !== \"string\") {\n throw new TypeError(\"Expected character\");\n }\n let count = 0;\n let index = source.indexOf(character);\n while (index !== -1) {\n count++;\n index = source.indexOf(character, index + character.length);\n }\n return count;\n}\nfunction ok$1() {\n}\nconst asciiAlpha = regexCheck(/[A-Za-z]/);\nconst asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\nfunction asciiControl(code2) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code2 !== null && (code2 < 32 || code2 === 127)\n );\n}\nfunction markdownLineEnding(code2) {\n return code2 !== null && code2 < -2;\n}\nfunction markdownLineEndingOrSpace(code2) {\n return code2 !== null && (code2 < 0 || code2 === 32);\n}\nfunction markdownSpace(code2) {\n return code2 === -2 || code2 === -1 || code2 === 32;\n}\nconst unicodePunctuation = regexCheck(new RegExp(\"\\\\p{P}|\\\\p{S}\", \"u\"));\nconst unicodeWhitespace = regexCheck(/\\s/);\nfunction regexCheck(regex) {\n return check;\n function check(code2) {\n return code2 !== null && code2 > -1 && regex.test(String.fromCharCode(code2));\n }\n}\nfunction escapeStringRegexp(string) {\n if (typeof string !== \"string\") {\n throw new TypeError(\"Expected a string\");\n }\n return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\").replace(/-/g, \"\\\\x2d\");\n}\nconst convert = (\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) &\n * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((test?: Test) => Check)\n * )}\n */\n /**\n * @param {Test} [test]\n * @returns {Check}\n */\n (function(test) {\n if (test === null || test === void 0) {\n return ok;\n }\n if (typeof test === \"function\") {\n return castFactory(test);\n }\n if (typeof test === \"object\") {\n return Array.isArray(test) ? anyFactory(test) : propsFactory(test);\n }\n if (typeof test === \"string\") {\n return typeFactory(test);\n }\n throw new Error(\"Expected function, string, or object as test\");\n })\n);\nfunction anyFactory(tests) {\n const checks = [];\n let index = -1;\n while (++index < tests.length) {\n checks[index] = convert(tests[index]);\n }\n return castFactory(any);\n function any(...parameters) {\n let index2 = -1;\n while (++index2 < checks.length) {\n if (checks[index2].apply(this, parameters)) return true;\n }\n return false;\n }\n}\nfunction propsFactory(check) {\n const checkAsRecord = (\n /** @type {Record} */\n check\n );\n return castFactory(all2);\n function all2(node2) {\n const nodeAsRecord = (\n /** @type {Record} */\n /** @type {unknown} */\n node2\n );\n let key;\n for (key in check) {\n if (nodeAsRecord[key] !== checkAsRecord[key]) return false;\n }\n return true;\n }\n}\nfunction typeFactory(check) {\n return castFactory(type);\n function type(node2) {\n return node2 && node2.type === check;\n }\n}\nfunction castFactory(testFunction) {\n return check;\n function check(value, index, parent) {\n return Boolean(\n looksLikeANode(value) && testFunction.call(\n this,\n value,\n typeof index === \"number\" ? index : void 0,\n parent || void 0\n )\n );\n }\n}\nfunction ok() {\n return true;\n}\nfunction looksLikeANode(value) {\n return value !== null && typeof value === \"object\" && \"type\" in value;\n}\nfunction color(d) {\n return d;\n}\nconst empty = [];\nconst CONTINUE = true;\nconst EXIT = false;\nconst SKIP = \"skip\";\nfunction visitParents(tree, test, visitor, reverse) {\n let check;\n {\n check = test;\n }\n const is = convert(check);\n const step = 1;\n factory(tree, void 0, [])();\n function factory(node2, index, parents) {\n const value = (\n /** @type {Record} */\n node2 && typeof node2 === \"object\" ? node2 : {}\n );\n if (typeof value.type === \"string\") {\n const name = (\n // `hast`\n typeof value.tagName === \"string\" ? value.tagName : (\n // `xast`\n typeof value.name === \"string\" ? value.name : void 0\n )\n );\n Object.defineProperty(visit2, \"name\", {\n value: \"node (\" + color(node2.type + (name ? \"<\" + name + \">\" : \"\")) + \")\"\n });\n }\n return visit2;\n function visit2() {\n let result = empty;\n let subresult;\n let offset;\n let grandparents;\n if (is(node2, index, parents[parents.length - 1] || void 0)) {\n result = toResult(visitor(node2, parents));\n if (result[0] === EXIT) {\n return result;\n }\n }\n if (\"children\" in node2 && node2.children) {\n const nodeAsParent = (\n /** @type {UnistParent} */\n node2\n );\n if (nodeAsParent.children && result[0] !== SKIP) {\n offset = -1 + step;\n grandparents = parents.concat(nodeAsParent);\n while (offset > -1 && offset < nodeAsParent.children.length) {\n const child = nodeAsParent.children[offset];\n subresult = factory(child, offset, grandparents)();\n if (subresult[0] === EXIT) {\n return subresult;\n }\n offset = typeof subresult[1] === \"number\" ? subresult[1] : offset + step;\n }\n }\n }\n return result;\n }\n }\n}\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value === \"number\") {\n return [CONTINUE, value];\n }\n return value === null || value === void 0 ? empty : [value];\n}\nfunction findAndReplace(tree, list2, options) {\n const settings = options || {};\n const ignored = convert(settings.ignore || []);\n const pairs = toPairs(list2);\n let pairIndex = -1;\n while (++pairIndex < pairs.length) {\n visitParents(tree, \"text\", visitor);\n }\n function visitor(node2, parents) {\n let index = -1;\n let grandparent;\n while (++index < parents.length) {\n const parent = parents[index];\n const siblings = grandparent ? grandparent.children : void 0;\n if (ignored(\n parent,\n siblings ? siblings.indexOf(parent) : void 0,\n grandparent\n )) {\n return;\n }\n grandparent = parent;\n }\n if (grandparent) {\n return handler(node2, parents);\n }\n }\n function handler(node2, parents) {\n const parent = parents[parents.length - 1];\n const find = pairs[pairIndex][0];\n const replace2 = pairs[pairIndex][1];\n let start = 0;\n const siblings = parent.children;\n const index = siblings.indexOf(node2);\n let change = false;\n let nodes = [];\n find.lastIndex = 0;\n let match = find.exec(node2.value);\n while (match) {\n const position = match.index;\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node2]\n };\n let value = replace2(...match, matchObject);\n if (typeof value === \"string\") {\n value = value.length > 0 ? { type: \"text\", value } : void 0;\n }\n if (value === false) {\n find.lastIndex = position + 1;\n } else {\n if (start !== position) {\n nodes.push({\n type: \"text\",\n value: node2.value.slice(start, position)\n });\n }\n if (Array.isArray(value)) {\n nodes.push(...value);\n } else if (value) {\n nodes.push(value);\n }\n start = position + match[0].length;\n change = true;\n }\n if (!find.global) {\n break;\n }\n match = find.exec(node2.value);\n }\n if (change) {\n if (start < node2.value.length) {\n nodes.push({ type: \"text\", value: node2.value.slice(start) });\n }\n parent.children.splice(index, 1, ...nodes);\n } else {\n nodes = [node2];\n }\n return index + nodes.length;\n }\n}\nfunction toPairs(tupleOrList) {\n const result = [];\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError(\"Expected find and replace tuple or list of tuples\");\n }\n const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];\n let index = -1;\n while (++index < list2.length) {\n const tuple = list2[index];\n result.push([toExpression(tuple[0]), toFunction(tuple[1])]);\n }\n return result;\n}\nfunction toExpression(find) {\n return typeof find === \"string\" ? new RegExp(escapeStringRegexp(find), \"g\") : find;\n}\nfunction toFunction(replace2) {\n return typeof replace2 === \"function\" ? replace2 : function() {\n return replace2;\n };\n}\nconst inConstruct = \"phrasing\";\nconst notInConstruct = [\"autolink\", \"link\", \"image\", \"label\"];\nfunction gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n };\n}\nfunction gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: \"@\",\n before: \"[+\\\\-.\\\\w]\",\n after: \"[\\\\-.\\\\w]\",\n inConstruct,\n notInConstruct\n },\n {\n character: \".\",\n before: \"[Ww]\",\n after: \"[\\\\-.\\\\w]\",\n inConstruct,\n notInConstruct\n },\n {\n character: \":\",\n before: \"[ps]\",\n after: \"\\\\/\",\n inConstruct,\n notInConstruct\n }\n ]\n };\n}\nfunction enterLiteralAutolink(token) {\n this.enter({ type: \"link\", title: null, url: \"\", children: [] }, token);\n}\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token);\n}\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token);\n}\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token);\n const node2 = this.stack[this.stack.length - 1];\n ok$1(node2.type === \"link\");\n node2.url = \"http://\" + this.sliceSerialize(token);\n}\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token);\n}\nfunction exitLiteralAutolink(token) {\n this.exit(token);\n}\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/g, findEmail]\n ],\n { ignore: [\"link\", \"linkReference\"] }\n );\n}\nfunction findUrl(_, protocol, domain2, path2, match) {\n let prefix = \"\";\n if (!previous(match)) {\n return false;\n }\n if (/^w/i.test(protocol)) {\n domain2 = protocol + domain2;\n protocol = \"\";\n prefix = \"http://\";\n }\n if (!isCorrectDomain(domain2)) {\n return false;\n }\n const parts = splitUrl(domain2 + path2);\n if (!parts[0]) return false;\n const result = {\n type: \"link\",\n title: null,\n url: prefix + protocol + parts[0],\n children: [{ type: \"text\", value: protocol + parts[0] }]\n };\n if (parts[1]) {\n return [result, { type: \"text\", value: parts[1] }];\n }\n return result;\n}\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) || // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false;\n }\n return {\n type: \"link\",\n title: null,\n url: \"mailto:\" + atext + \"@\" + label,\n children: [{ type: \"text\", value: atext + \"@\" + label }]\n };\n}\nfunction isCorrectDomain(domain2) {\n const parts = domain2.split(\".\");\n 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]))) {\n return false;\n }\n return true;\n}\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url);\n if (!trailExec) {\n return [url, void 0];\n }\n url = url.slice(0, trailExec.index);\n let trail2 = trailExec[0];\n let closingParenIndex = trail2.indexOf(\")\");\n const openingParens = ccount(url, \"(\");\n let closingParens = ccount(url, \")\");\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail2.slice(0, closingParenIndex + 1);\n trail2 = trail2.slice(closingParenIndex + 1);\n closingParenIndex = trail2.indexOf(\")\");\n closingParens++;\n }\n return [url, trail2];\n}\nfunction previous(match, email) {\n const code2 = match.input.charCodeAt(match.index - 1);\n return (match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && (!email || code2 !== 47);\n}\nfunction normalizeIdentifier(value) {\n return value.replace(/[\\t\\n\\r ]+/g, \" \").replace(/^ | $/g, \"\").toLowerCase().toUpperCase();\n}\nfootnoteReference.peek = footnoteReferencePeek;\nfunction enterFootnoteCallString() {\n this.buffer();\n}\nfunction enterFootnoteCall(token) {\n this.enter({ type: \"footnoteReference\", identifier: \"\", label: \"\" }, token);\n}\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer();\n}\nfunction enterFootnoteDefinition(token) {\n this.enter(\n { type: \"footnoteDefinition\", identifier: \"\", label: \"\", children: [] },\n token\n );\n}\nfunction exitFootnoteCallString(token) {\n const label = this.resume();\n const node2 = this.stack[this.stack.length - 1];\n ok$1(node2.type === \"footnoteReference\");\n node2.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase();\n node2.label = label;\n}\nfunction exitFootnoteCall(token) {\n this.exit(token);\n}\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume();\n const node2 = this.stack[this.stack.length - 1];\n ok$1(node2.type === \"footnoteDefinition\");\n node2.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase();\n node2.label = label;\n}\nfunction exitFootnoteDefinition(token) {\n this.exit(token);\n}\nfunction footnoteReferencePeek() {\n return \"[\";\n}\nfunction footnoteReference(node2, _, state, info) {\n const tracker = state.createTracker(info);\n let value = tracker.move(\"[^\");\n const exit2 = state.enter(\"footnoteReference\");\n const subexit = state.enter(\"reference\");\n value += tracker.move(\n state.safe(state.associationId(node2), { after: \"]\", before: value })\n );\n subexit();\n exit2();\n value += tracker.move(\"]\");\n return value;\n}\nfunction gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n };\n}\nfunction gfmFootnoteToMarkdown(options) {\n let firstLineBlank = false;\n if (options && options.firstLineBlank) {\n firstLineBlank = true;\n }\n return {\n handlers: { footnoteDefinition, footnoteReference },\n // This is on by default already.\n unsafe: [{ character: \"[\", inConstruct: [\"label\", \"phrasing\", \"reference\"] }]\n };\n function footnoteDefinition(node2, _, state, info) {\n const tracker = state.createTracker(info);\n let value = tracker.move(\"[^\");\n const exit2 = state.enter(\"footnoteDefinition\");\n const subexit = state.enter(\"label\");\n value += tracker.move(\n state.safe(state.associationId(node2), { before: value, after: \"]\" })\n );\n subexit();\n value += tracker.move(\"]:\");\n if (node2.children && node2.children.length > 0) {\n tracker.shift(4);\n value += tracker.move(\n (firstLineBlank ? \"\\n\" : \" \") + state.indentLines(\n state.containerFlow(node2, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n );\n }\n exit2();\n return value;\n }\n}\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank);\n}\nfunction mapAll(line, index, blank) {\n return (blank ? \"\" : \" \") + line;\n}\nconst constructsWithoutStrikethrough = [\n \"autolink\",\n \"destinationLiteral\",\n \"destinationRaw\",\n \"reference\",\n \"titleQuote\",\n \"titleApostrophe\"\n];\nhandleDelete.peek = peekDelete;\nfunction gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: [\"delete\"],\n enter: { strikethrough: enterStrikethrough },\n exit: { strikethrough: exitStrikethrough }\n };\n}\nfunction gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: \"~\",\n inConstruct: \"phrasing\",\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: { delete: handleDelete }\n };\n}\nfunction enterStrikethrough(token) {\n this.enter({ type: \"delete\", children: [] }, token);\n}\nfunction exitStrikethrough(token) {\n this.exit(token);\n}\nfunction handleDelete(node2, _, state, info) {\n const tracker = state.createTracker(info);\n const exit2 = state.enter(\"strikethrough\");\n let value = tracker.move(\"~~\");\n value += state.containerPhrasing(node2, {\n ...tracker.current(),\n before: value,\n after: \"~\"\n });\n value += tracker.move(\"~~\");\n exit2();\n return value;\n}\nfunction peekDelete() {\n return \"~\";\n}\nfunction defaultStringLength(value) {\n return value.length;\n}\nfunction markdownTable(table, options) {\n const settings = options || {};\n const align = (settings.align || []).concat();\n const stringLength = settings.stringLength || defaultStringLength;\n const alignments = [];\n const cellMatrix = [];\n const sizeMatrix = [];\n const longestCellByColumn = [];\n let mostCellsPerRow = 0;\n let rowIndex = -1;\n while (++rowIndex < table.length) {\n const row2 = [];\n const sizes2 = [];\n let columnIndex2 = -1;\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length;\n }\n while (++columnIndex2 < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex2]);\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell);\n sizes2[columnIndex2] = size;\n if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {\n longestCellByColumn[columnIndex2] = size;\n }\n }\n row2.push(cell);\n }\n cellMatrix[rowIndex] = row2;\n sizeMatrix[rowIndex] = sizes2;\n }\n let columnIndex = -1;\n if (typeof align === \"object\" && \"length\" in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex]);\n }\n } else {\n const code2 = toAlignment(align);\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code2;\n }\n }\n columnIndex = -1;\n const row = [];\n const sizes = [];\n while (++columnIndex < mostCellsPerRow) {\n const code2 = alignments[columnIndex];\n let before = \"\";\n let after = \"\";\n if (code2 === 99) {\n before = \":\";\n after = \":\";\n } else if (code2 === 108) {\n before = \":\";\n } else if (code2 === 114) {\n after = \":\";\n }\n let size = settings.alignDelimiters === false ? 1 : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n );\n const cell = before + \"-\".repeat(size) + after;\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length;\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size;\n }\n sizes[columnIndex] = size;\n }\n row[columnIndex] = cell;\n }\n cellMatrix.splice(1, 0, row);\n sizeMatrix.splice(1, 0, sizes);\n rowIndex = -1;\n const lines = [];\n while (++rowIndex < cellMatrix.length) {\n const row2 = cellMatrix[rowIndex];\n const sizes2 = sizeMatrix[rowIndex];\n columnIndex = -1;\n const line = [];\n while (++columnIndex < mostCellsPerRow) {\n const cell = row2[columnIndex] || \"\";\n let before = \"\";\n let after = \"\";\n if (settings.alignDelimiters !== false) {\n const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0);\n const code2 = alignments[columnIndex];\n if (code2 === 114) {\n before = \" \".repeat(size);\n } else if (code2 === 99) {\n if (size % 2) {\n before = \" \".repeat(size / 2 + 0.5);\n after = \" \".repeat(size / 2 - 0.5);\n } else {\n before = \" \".repeat(size / 2);\n after = before;\n }\n } else {\n after = \" \".repeat(size);\n }\n }\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push(\"|\");\n }\n if (settings.padding !== false && // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === \"\") && (settings.delimiterStart !== false || columnIndex)) {\n line.push(\" \");\n }\n if (settings.alignDelimiters !== false) {\n line.push(before);\n }\n line.push(cell);\n if (settings.alignDelimiters !== false) {\n line.push(after);\n }\n if (settings.padding !== false) {\n line.push(\" \");\n }\n if (settings.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) {\n line.push(\"|\");\n }\n }\n lines.push(\n settings.delimiterEnd === false ? line.join(\"\").replace(/ +$/, \"\") : line.join(\"\")\n );\n }\n return lines.join(\"\\n\");\n}\nfunction serialize(value) {\n return value === null || value === void 0 ? \"\" : String(value);\n}\nfunction toAlignment(value) {\n const code2 = typeof value === \"string\" ? value.codePointAt(0) : 0;\n return code2 === 67 || code2 === 99 ? 99 : code2 === 76 || code2 === 108 ? 108 : code2 === 82 || code2 === 114 ? 114 : 0;\n}\nfunction blockquote(node2, _, state, info) {\n const exit2 = state.enter(\"blockquote\");\n const tracker = state.createTracker(info);\n tracker.move(\"> \");\n tracker.shift(2);\n const value = state.indentLines(\n state.containerFlow(node2, tracker.current()),\n map$1\n );\n exit2();\n return value;\n}\nfunction map$1(line, _, blank) {\n return \">\" + (blank ? \"\" : \" \") + line;\n}\nfunction patternInScope(stack, pattern) {\n return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);\n}\nfunction listInScope(stack, list2, none) {\n if (typeof list2 === \"string\") {\n list2 = [list2];\n }\n if (!list2 || list2.length === 0) {\n return none;\n }\n let index = -1;\n while (++index < list2.length) {\n if (stack.includes(list2[index])) {\n return true;\n }\n }\n return false;\n}\nfunction hardBreak(_, _1, state, info) {\n let index = -1;\n while (++index < state.unsafe.length) {\n if (state.unsafe[index].character === \"\\n\" && patternInScope(state.stack, state.unsafe[index])) {\n return /[ \\t]/.test(info.before) ? \"\" : \" \";\n }\n }\n return \"\\\\\\n\";\n}\nfunction longestStreak(value, substring) {\n const source = String(value);\n let index = source.indexOf(substring);\n let expected = index;\n let count = 0;\n let max = 0;\n if (typeof substring !== \"string\") {\n throw new TypeError(\"Expected substring\");\n }\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count;\n }\n } else {\n count = 1;\n }\n expected = index + substring.length;\n index = source.indexOf(substring, expected);\n }\n return max;\n}\nfunction formatCodeAsIndented(node2, state) {\n return Boolean(\n state.options.fences === false && node2.value && // If there’s no info…\n !node2.lang && // And there’s a non-whitespace character…\n /[^ \\r\\n]/.test(node2.value) && // And the value doesn’t start or end in a blank…\n !/^[\\t ]*(?:[\\r\\n]|$)|(?:^|[\\r\\n])[\\t ]*$/.test(node2.value)\n );\n}\nfunction checkFence(state) {\n const marker = state.options.fence || \"`\";\n if (marker !== \"`\" && marker !== \"~\") {\n throw new Error(\n \"Cannot serialize code with `\" + marker + \"` for `options.fence`, expected `` ` `` or `~`\"\n );\n }\n return marker;\n}\nfunction code$1(node2, _, state, info) {\n const marker = checkFence(state);\n const raw = node2.value || \"\";\n const suffix = marker === \"`\" ? \"GraveAccent\" : \"Tilde\";\n if (formatCodeAsIndented(node2, state)) {\n const exit3 = state.enter(\"codeIndented\");\n const value2 = state.indentLines(raw, map);\n exit3();\n return value2;\n }\n const tracker = state.createTracker(info);\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));\n const exit2 = state.enter(\"codeFenced\");\n let value = tracker.move(sequence);\n if (node2.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`);\n value += tracker.move(\n state.safe(node2.lang, {\n before: value,\n after: \" \",\n encode: [\"`\"],\n ...tracker.current()\n })\n );\n subexit();\n }\n if (node2.lang && node2.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`);\n value += tracker.move(\" \");\n value += tracker.move(\n state.safe(node2.meta, {\n before: value,\n after: \"\\n\",\n encode: [\"`\"],\n ...tracker.current()\n })\n );\n subexit();\n }\n value += tracker.move(\"\\n\");\n if (raw) {\n value += tracker.move(raw + \"\\n\");\n }\n value += tracker.move(sequence);\n exit2();\n return value;\n}\nfunction map(line, _, blank) {\n return (blank ? \"\" : \" \") + line;\n}\nfunction checkQuote(state) {\n const marker = state.options.quote || '\"';\n if (marker !== '\"' && marker !== \"'\") {\n throw new Error(\n \"Cannot serialize title with `\" + marker + \"` for `options.quote`, expected `\\\"`, or `'`\"\n );\n }\n return marker;\n}\nfunction definition(node2, _, state, info) {\n const quote = checkQuote(state);\n const suffix = quote === '\"' ? \"Quote\" : \"Apostrophe\";\n const exit2 = state.enter(\"definition\");\n let subexit = state.enter(\"label\");\n const tracker = state.createTracker(info);\n let value = tracker.move(\"[\");\n value += tracker.move(\n state.safe(state.associationId(node2), {\n before: value,\n after: \"]\",\n ...tracker.current()\n })\n );\n value += tracker.move(\"]: \");\n subexit();\n if (\n // If there’s no url, or…\n !node2.url || // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node2.url)\n ) {\n subexit = state.enter(\"destinationLiteral\");\n value += tracker.move(\"<\");\n value += tracker.move(\n state.safe(node2.url, { before: value, after: \">\", ...tracker.current() })\n );\n value += tracker.move(\">\");\n } else {\n subexit = state.enter(\"destinationRaw\");\n value += tracker.move(\n state.safe(node2.url, {\n before: value,\n after: node2.title ? \" \" : \"\\n\",\n ...tracker.current()\n })\n );\n }\n subexit();\n if (node2.title) {\n subexit = state.enter(`title${suffix}`);\n value += tracker.move(\" \" + quote);\n value += tracker.move(\n state.safe(node2.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n );\n value += tracker.move(quote);\n subexit();\n }\n exit2();\n return value;\n}\nfunction checkEmphasis(state) {\n const marker = state.options.emphasis || \"*\";\n if (marker !== \"*\" && marker !== \"_\") {\n throw new Error(\n \"Cannot serialize emphasis with `\" + marker + \"` for `options.emphasis`, expected `*`, or `_`\"\n );\n }\n return marker;\n}\nfunction encodeCharacterReference(code2) {\n return \"\" + code2.toString(16).toUpperCase() + \";\";\n}\nfunction classifyCharacter(code2) {\n if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {\n return 1;\n }\n if (unicodePunctuation(code2)) {\n return 2;\n }\n}\nfunction encodeInfo(outside, inside, marker) {\n const outsideKind = classifyCharacter(outside);\n const insideKind = classifyCharacter(inside);\n if (outsideKind === void 0) {\n return insideKind === void 0 ? (\n // Letter inside:\n // we have to encode *both* letters for `_` as it is looser.\n // it already forms for `*` (and GFMs `~`).\n marker === \"_\" ? { inside: true, outside: true } : { inside: false, outside: false }\n ) : insideKind === 1 ? (\n // Whitespace inside: encode both (letter, whitespace).\n { inside: true, outside: true }\n ) : (\n // Punctuation inside: encode outer (letter)\n { inside: false, outside: true }\n );\n }\n if (outsideKind === 1) {\n return insideKind === void 0 ? (\n // Letter inside: already forms.\n { inside: false, outside: false }\n ) : insideKind === 1 ? (\n // Whitespace inside: encode both (whitespace).\n { inside: true, outside: true }\n ) : (\n // Punctuation inside: already forms.\n { inside: false, outside: false }\n );\n }\n return insideKind === void 0 ? (\n // Letter inside: already forms.\n { inside: false, outside: false }\n ) : insideKind === 1 ? (\n // Whitespace inside: encode inner (whitespace).\n { inside: true, outside: false }\n ) : (\n // Punctuation inside: already forms.\n { inside: false, outside: false }\n );\n}\nemphasis.peek = emphasisPeek;\nfunction emphasis(node2, _, state, info) {\n const marker = checkEmphasis(state);\n const exit2 = state.enter(\"emphasis\");\n const tracker = state.createTracker(info);\n const before = tracker.move(marker);\n let between = tracker.move(\n state.containerPhrasing(node2, {\n after: marker,\n before,\n ...tracker.current()\n })\n );\n const betweenHead = between.charCodeAt(0);\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n );\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1);\n }\n const betweenTail = between.charCodeAt(between.length - 1);\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail);\n }\n const after = tracker.move(marker);\n exit2();\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n };\n return before + between + after;\n}\nfunction emphasisPeek(_, _1, state) {\n return state.options.emphasis || \"*\";\n}\nconst emptyOptions$1 = {};\nfunction toString(value, options) {\n const settings = emptyOptions$1;\n const includeImageAlt = typeof settings.includeImageAlt === \"boolean\" ? settings.includeImageAlt : true;\n const includeHtml = typeof settings.includeHtml === \"boolean\" ? settings.includeHtml : true;\n return one(value, includeImageAlt, includeHtml);\n}\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if (\"value\" in value) {\n return value.type === \"html\" && !includeHtml ? \"\" : value.value;\n }\n if (includeImageAlt && \"alt\" in value && value.alt) {\n return value.alt;\n }\n if (\"children\" in value) {\n return all(value.children, includeImageAlt, includeHtml);\n }\n }\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml);\n }\n return \"\";\n}\nfunction all(values, includeImageAlt, includeHtml) {\n const result = [];\n let index = -1;\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml);\n }\n return result.join(\"\");\n}\nfunction node(value) {\n return Boolean(value && typeof value === \"object\");\n}\nfunction formatHeadingAsSetext(node2, state) {\n let literalWithBreak = false;\n visit(node2, function(node3) {\n if (\"value\" in node3 && /\\r?\\n|\\r/.test(node3.value) || node3.type === \"break\") {\n literalWithBreak = true;\n return EXIT$1;\n }\n });\n return Boolean(\n (!node2.depth || node2.depth < 3) && toString(node2) && (state.options.setext || literalWithBreak)\n );\n}\nfunction heading(node2, _, state, info) {\n const rank = Math.max(Math.min(6, node2.depth || 1), 1);\n const tracker = state.createTracker(info);\n if (formatHeadingAsSetext(node2, state)) {\n const exit3 = state.enter(\"headingSetext\");\n const subexit2 = state.enter(\"phrasing\");\n const value2 = state.containerPhrasing(node2, {\n ...tracker.current(),\n before: \"\\n\",\n after: \"\\n\"\n });\n subexit2();\n exit3();\n return value2 + \"\\n\" + (rank === 1 ? \"=\" : \"-\").repeat(\n // The whole size…\n value2.length - // Minus the position of the character after the last EOL (or\n // 0 if there is none)…\n (Math.max(value2.lastIndexOf(\"\\r\"), value2.lastIndexOf(\"\\n\")) + 1)\n );\n }\n const sequence = \"#\".repeat(rank);\n const exit2 = state.enter(\"headingAtx\");\n const subexit = state.enter(\"phrasing\");\n tracker.move(sequence + \" \");\n let value = state.containerPhrasing(node2, {\n before: \"# \",\n after: \"\\n\",\n ...tracker.current()\n });\n if (/^[\\t ]/.test(value)) {\n value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1);\n }\n value = value ? sequence + \" \" + value : sequence;\n if (state.options.closeAtx) {\n value += \" \" + sequence;\n }\n subexit();\n exit2();\n return value;\n}\nhtml.peek = htmlPeek;\nfunction html(node2) {\n return node2.value || \"\";\n}\nfunction htmlPeek() {\n return \"<\";\n}\nimage.peek = imagePeek;\nfunction image(node2, _, state, info) {\n const quote = checkQuote(state);\n const suffix = quote === '\"' ? \"Quote\" : \"Apostrophe\";\n const exit2 = state.enter(\"image\");\n let subexit = state.enter(\"label\");\n const tracker = state.createTracker(info);\n let value = tracker.move(\"![\");\n value += tracker.move(\n state.safe(node2.alt, { before: value, after: \"]\", ...tracker.current() })\n );\n value += tracker.move(\"](\");\n subexit();\n if (\n // If there’s no url but there is a title…\n !node2.url && node2.title || // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node2.url)\n ) {\n subexit = state.enter(\"destinationLiteral\");\n value += tracker.move(\"<\");\n value += tracker.move(\n state.safe(node2.url, { before: value, after: \">\", ...tracker.current() })\n );\n value += tracker.move(\">\");\n } else {\n subexit = state.enter(\"destinationRaw\");\n value += tracker.move(\n state.safe(node2.url, {\n before: value,\n after: node2.title ? \" \" : \")\",\n ...tracker.current()\n })\n );\n }\n subexit();\n if (node2.title) {\n subexit = state.enter(`title${suffix}`);\n value += tracker.move(\" \" + quote);\n value += tracker.move(\n state.safe(node2.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n );\n value += tracker.move(quote);\n subexit();\n }\n value += tracker.move(\")\");\n exit2();\n return value;\n}\nfunction imagePeek() {\n return \"!\";\n}\nimageReference.peek = imageReferencePeek;\nfunction imageReference(node2, _, state, info) {\n const type = node2.referenceType;\n const exit2 = state.enter(\"imageReference\");\n let subexit = state.enter(\"label\");\n const tracker = state.createTracker(info);\n let value = tracker.move(\"![\");\n const alt = state.safe(node2.alt, {\n before: value,\n after: \"]\",\n ...tracker.current()\n });\n value += tracker.move(alt + \"][\");\n subexit();\n const stack = state.stack;\n state.stack = [];\n subexit = state.enter(\"reference\");\n const reference = state.safe(state.associationId(node2), {\n before: value,\n after: \"]\",\n ...tracker.current()\n });\n subexit();\n state.stack = stack;\n exit2();\n if (type === \"full\" || !alt || alt !== reference) {\n value += tracker.move(reference + \"]\");\n } else if (type === \"shortcut\") {\n value = value.slice(0, -1);\n } else {\n value += tracker.move(\"]\");\n }\n return value;\n}\nfunction imageReferencePeek() {\n return \"!\";\n}\ninlineCode.peek = inlineCodePeek;\nfunction inlineCode(node2, _, state) {\n let value = node2.value || \"\";\n let sequence = \"`\";\n let index = -1;\n while (new RegExp(\"(^|[^`])\" + sequence + \"([^`]|$)\").test(value)) {\n sequence += \"`\";\n }\n if (/[^ \\r\\n]/.test(value) && (/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value) || /^`|`$/.test(value))) {\n value = \" \" + value + \" \";\n }\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index];\n const expression = state.compilePattern(pattern);\n let match;\n if (!pattern.atBreak) continue;\n while (match = expression.exec(value)) {\n let position = match.index;\n if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) {\n position--;\n }\n value = value.slice(0, position) + \" \" + value.slice(match.index + 1);\n }\n }\n return sequence + value + sequence;\n}\nfunction inlineCodePeek() {\n return \"`\";\n}\nfunction formatLinkAsAutolink(node2, state) {\n const raw = toString(node2);\n return Boolean(\n !state.options.resourceLink && // If there’s a url…\n node2.url && // And there’s a no title…\n !node2.title && // And the content of `node` is a single text node…\n node2.children && node2.children.length === 1 && node2.children[0].type === \"text\" && // And if the url is the same as the content…\n (raw === node2.url || \"mailto:\" + raw === node2.url) && // And that starts w/ a protocol…\n /^[a-z][a-z+.-]+:/i.test(node2.url) && // And that doesn’t contain ASCII control codes (character escapes and\n // references don’t work), space, or angle brackets…\n !/[\\0- <>\\u007F]/.test(node2.url)\n );\n}\nlink.peek = linkPeek;\nfunction link(node2, _, state, info) {\n const quote = checkQuote(state);\n const suffix = quote === '\"' ? \"Quote\" : \"Apostrophe\";\n const tracker = state.createTracker(info);\n let exit2;\n let subexit;\n if (formatLinkAsAutolink(node2, state)) {\n const stack = state.stack;\n state.stack = [];\n exit2 = state.enter(\"autolink\");\n let value2 = tracker.move(\"<\");\n value2 += tracker.move(\n state.containerPhrasing(node2, {\n before: value2,\n after: \">\",\n ...tracker.current()\n })\n );\n value2 += tracker.move(\">\");\n exit2();\n state.stack = stack;\n return value2;\n }\n exit2 = state.enter(\"link\");\n subexit = state.enter(\"label\");\n let value = tracker.move(\"[\");\n value += tracker.move(\n state.containerPhrasing(node2, {\n before: value,\n after: \"](\",\n ...tracker.current()\n })\n );\n value += tracker.move(\"](\");\n subexit();\n if (\n // If there’s no url but there is a title…\n !node2.url && node2.title || // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node2.url)\n ) {\n subexit = state.enter(\"destinationLiteral\");\n value += tracker.move(\"<\");\n value += tracker.move(\n state.safe(node2.url, { before: value, after: \">\", ...tracker.current() })\n );\n value += tracker.move(\">\");\n } else {\n subexit = state.enter(\"destinationRaw\");\n value += tracker.move(\n state.safe(node2.url, {\n before: value,\n after: node2.title ? \" \" : \")\",\n ...tracker.current()\n })\n );\n }\n subexit();\n if (node2.title) {\n subexit = state.enter(`title${suffix}`);\n value += tracker.move(\" \" + quote);\n value += tracker.move(\n state.safe(node2.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n );\n value += tracker.move(quote);\n subexit();\n }\n value += tracker.move(\")\");\n exit2();\n return value;\n}\nfunction linkPeek(node2, _, state) {\n return formatLinkAsAutolink(node2, state) ? \"<\" : \"[\";\n}\nlinkReference.peek = linkReferencePeek;\nfunction linkReference(node2, _, state, info) {\n const type = node2.referenceType;\n const exit2 = state.enter(\"linkReference\");\n let subexit = state.enter(\"label\");\n const tracker = state.createTracker(info);\n let value = tracker.move(\"[\");\n const text2 = state.containerPhrasing(node2, {\n before: value,\n after: \"]\",\n ...tracker.current()\n });\n value += tracker.move(text2 + \"][\");\n subexit();\n const stack = state.stack;\n state.stack = [];\n subexit = state.enter(\"reference\");\n const reference = state.safe(state.associationId(node2), {\n before: value,\n after: \"]\",\n ...tracker.current()\n });\n subexit();\n state.stack = stack;\n exit2();\n if (type === \"full\" || !text2 || text2 !== reference) {\n value += tracker.move(reference + \"]\");\n } else if (type === \"shortcut\") {\n value = value.slice(0, -1);\n } else {\n value += tracker.move(\"]\");\n }\n return value;\n}\nfunction linkReferencePeek() {\n return \"[\";\n}\nfunction checkBullet(state) {\n const marker = state.options.bullet || \"*\";\n if (marker !== \"*\" && marker !== \"+\" && marker !== \"-\") {\n throw new Error(\n \"Cannot serialize items with `\" + marker + \"` for `options.bullet`, expected `*`, `+`, or `-`\"\n );\n }\n return marker;\n}\nfunction checkBulletOther(state) {\n const bullet = checkBullet(state);\n const bulletOther = state.options.bulletOther;\n if (!bulletOther) {\n return bullet === \"*\" ? \"-\" : \"*\";\n }\n if (bulletOther !== \"*\" && bulletOther !== \"+\" && bulletOther !== \"-\") {\n throw new Error(\n \"Cannot serialize items with `\" + bulletOther + \"` for `options.bulletOther`, expected `*`, `+`, or `-`\"\n );\n }\n if (bulletOther === bullet) {\n throw new Error(\n \"Expected `bullet` (`\" + bullet + \"`) and `bulletOther` (`\" + bulletOther + \"`) to be different\"\n );\n }\n return bulletOther;\n}\nfunction checkBulletOrdered(state) {\n const marker = state.options.bulletOrdered || \".\";\n if (marker !== \".\" && marker !== \")\") {\n throw new Error(\n \"Cannot serialize items with `\" + marker + \"` for `options.bulletOrdered`, expected `.` or `)`\"\n );\n }\n return marker;\n}\nfunction checkRule(state) {\n const marker = state.options.rule || \"*\";\n if (marker !== \"*\" && marker !== \"-\" && marker !== \"_\") {\n throw new Error(\n \"Cannot serialize rules with `\" + marker + \"` for `options.rule`, expected `*`, `-`, or `_`\"\n );\n }\n return marker;\n}\nfunction list(node2, parent, state, info) {\n const exit2 = state.enter(\"list\");\n const bulletCurrent = state.bulletCurrent;\n let bullet = node2.ordered ? checkBulletOrdered(state) : checkBullet(state);\n const bulletOther = node2.ordered ? bullet === \".\" ? \")\" : \".\" : checkBulletOther(state);\n let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;\n if (!node2.ordered) {\n const firstListItem = node2.children ? node2.children[0] : void 0;\n if (\n // Bullet could be used as a thematic break marker:\n (bullet === \"*\" || bullet === \"-\") && // Empty first list item:\n firstListItem && (!firstListItem.children || !firstListItem.children[0]) && // Directly in two other list items:\n 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.\n state.indexStack[state.indexStack.length - 1] === 0 && state.indexStack[state.indexStack.length - 2] === 0 && state.indexStack[state.indexStack.length - 3] === 0\n ) {\n useDifferentMarker = true;\n }\n if (checkRule(state) === bullet && firstListItem) {\n let index = -1;\n while (++index < node2.children.length) {\n const item = node2.children[index];\n if (item && item.type === \"listItem\" && item.children && item.children[0] && item.children[0].type === \"thematicBreak\") {\n useDifferentMarker = true;\n break;\n }\n }\n }\n }\n if (useDifferentMarker) {\n bullet = bulletOther;\n }\n state.bulletCurrent = bullet;\n const value = state.containerFlow(node2, info);\n state.bulletLastUsed = bullet;\n state.bulletCurrent = bulletCurrent;\n exit2();\n return value;\n}\nfunction checkListItemIndent(state) {\n const style = state.options.listItemIndent || \"one\";\n if (style !== \"tab\" && style !== \"one\" && style !== \"mixed\") {\n throw new Error(\n \"Cannot serialize items with `\" + style + \"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`\"\n );\n }\n return style;\n}\nfunction listItem(node2, parent, state, info) {\n const listItemIndent = checkListItemIndent(state);\n let bullet = state.bulletCurrent || checkBullet(state);\n if (parent && parent.type === \"list\" && parent.ordered) {\n bullet = (typeof parent.start === \"number\" && parent.start > -1 ? parent.start : 1) + (state.options.incrementListMarker === false ? 0 : parent.children.indexOf(node2)) + bullet;\n }\n let size = bullet.length + 1;\n if (listItemIndent === \"tab\" || listItemIndent === \"mixed\" && (parent && parent.type === \"list\" && parent.spread || node2.spread)) {\n size = Math.ceil(size / 4) * 4;\n }\n const tracker = state.createTracker(info);\n tracker.move(bullet + \" \".repeat(size - bullet.length));\n tracker.shift(size);\n const exit2 = state.enter(\"listItem\");\n const value = state.indentLines(\n state.containerFlow(node2, tracker.current()),\n map2\n );\n exit2();\n return value;\n function map2(line, index, blank) {\n if (index) {\n return (blank ? \"\" : \" \".repeat(size)) + line;\n }\n return (blank ? bullet : bullet + \" \".repeat(size - bullet.length)) + line;\n }\n}\nfunction paragraph(node2, _, state, info) {\n const exit2 = state.enter(\"paragraph\");\n const subexit = state.enter(\"phrasing\");\n const value = state.containerPhrasing(node2, info);\n subexit();\n exit2();\n return value;\n}\nconst phrasing = (\n /** @type {(node?: unknown) => node is Exclude} */\n convert([\n \"break\",\n \"delete\",\n \"emphasis\",\n // To do: next major: removed since footnotes were added to GFM.\n \"footnote\",\n \"footnoteReference\",\n \"image\",\n \"imageReference\",\n \"inlineCode\",\n // Enabled by `mdast-util-math`:\n \"inlineMath\",\n \"link\",\n \"linkReference\",\n // Enabled by `mdast-util-mdx`:\n \"mdxJsxTextElement\",\n // Enabled by `mdast-util-mdx`:\n \"mdxTextExpression\",\n \"strong\",\n \"text\",\n // Enabled by `mdast-util-directive`:\n \"textDirective\"\n ])\n);\nfunction root(node2, _, state, info) {\n const hasPhrasing = node2.children.some(function(d) {\n return phrasing(d);\n });\n const container = hasPhrasing ? state.containerPhrasing : state.containerFlow;\n return container.call(state, node2, info);\n}\nfunction checkStrong(state) {\n const marker = state.options.strong || \"*\";\n if (marker !== \"*\" && marker !== \"_\") {\n throw new Error(\n \"Cannot serialize strong with `\" + marker + \"` for `options.strong`, expected `*`, or `_`\"\n );\n }\n return marker;\n}\nstrong.peek = strongPeek;\nfunction strong(node2, _, state, info) {\n const marker = checkStrong(state);\n const exit2 = state.enter(\"strong\");\n const tracker = state.createTracker(info);\n const before = tracker.move(marker + marker);\n let between = tracker.move(\n state.containerPhrasing(node2, {\n after: marker,\n before,\n ...tracker.current()\n })\n );\n const betweenHead = between.charCodeAt(0);\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n );\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1);\n }\n const betweenTail = between.charCodeAt(between.length - 1);\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail);\n }\n const after = tracker.move(marker + marker);\n exit2();\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n };\n return before + between + after;\n}\nfunction strongPeek(_, _1, state) {\n return state.options.strong || \"*\";\n}\nfunction text$1(node2, _, state, info) {\n return state.safe(node2.value, info);\n}\nfunction checkRuleRepetition(state) {\n const repetition = state.options.ruleRepetition || 3;\n if (repetition < 3) {\n throw new Error(\n \"Cannot serialize rules with repetition `\" + repetition + \"` for `options.ruleRepetition`, expected `3` or more\"\n );\n }\n return repetition;\n}\nfunction thematicBreak(_, _1, state) {\n const value = (checkRule(state) + (state.options.ruleSpaces ? \" \" : \"\")).repeat(checkRuleRepetition(state));\n return state.options.ruleSpaces ? value.slice(0, -1) : value;\n}\nconst handle = {\n blockquote,\n break: hardBreak,\n code: code$1,\n definition,\n emphasis,\n hardBreak,\n heading,\n html,\n image,\n imageReference,\n inlineCode,\n link,\n linkReference,\n list,\n listItem,\n paragraph,\n root,\n strong,\n text: text$1,\n thematicBreak\n};\nfunction gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n };\n}\nfunction enterTable(token) {\n const align = token._align;\n this.enter(\n {\n type: \"table\",\n align: align.map(function(d) {\n return d === \"none\" ? null : d;\n }),\n children: []\n },\n token\n );\n this.data.inTable = true;\n}\nfunction exitTable(token) {\n this.exit(token);\n this.data.inTable = void 0;\n}\nfunction enterRow(token) {\n this.enter({ type: \"tableRow\", children: [] }, token);\n}\nfunction exit(token) {\n this.exit(token);\n}\nfunction enterCell(token) {\n this.enter({ type: \"tableCell\", children: [] }, token);\n}\nfunction exitCodeText(token) {\n let value = this.resume();\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace);\n }\n const node2 = this.stack[this.stack.length - 1];\n ok$1(node2.type === \"inlineCode\");\n node2.value = value;\n this.exit(token);\n}\nfunction replace($0, $1) {\n return $1 === \"|\" ? $1 : $0;\n}\nfunction gfmTableToMarkdown(options) {\n const settings = options || {};\n const padding = settings.tableCellPadding;\n const alignDelimiters = settings.tablePipeAlign;\n const stringLength = settings.stringLength;\n const around = padding ? \" \" : \"|\";\n return {\n unsafe: [\n { character: \"\\r\", inConstruct: \"tableCell\" },\n { character: \"\\n\", inConstruct: \"tableCell\" },\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n { atBreak: true, character: \"|\", after: \"[\t :-]\" },\n // A pipe in a cell must be encoded.\n { character: \"|\", inConstruct: \"tableCell\" },\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n { atBreak: true, character: \":\", after: \"-\" },\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n { atBreak: true, character: \"-\", after: \"[:|-]\" }\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n };\n function handleTable(node2, _, state, info) {\n return serializeData(handleTableAsData(node2, state, info), node2.align);\n }\n function handleTableRow(node2, _, state, info) {\n const row = handleTableRowAsData(node2, state, info);\n const value = serializeData([row]);\n return value.slice(0, value.indexOf(\"\\n\"));\n }\n function handleTableCell(node2, _, state, info) {\n const exit2 = state.enter(\"tableCell\");\n const subexit = state.enter(\"phrasing\");\n const value = state.containerPhrasing(node2, {\n ...info,\n before: around,\n after: around\n });\n subexit();\n exit2();\n return value;\n }\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n });\n }\n function handleTableAsData(node2, state, info) {\n const children = node2.children;\n let index = -1;\n const result = [];\n const subexit = state.enter(\"table\");\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info);\n }\n subexit();\n return result;\n }\n function handleTableRowAsData(node2, state, info) {\n const children = node2.children;\n let index = -1;\n const result = [];\n const subexit = state.enter(\"tableRow\");\n while (++index < children.length) {\n result[index] = handleTableCell(children[index], node2, state, info);\n }\n subexit();\n return result;\n }\n function inlineCodeWithTable(node2, parent, state) {\n let value = handle.inlineCode(node2, parent, state);\n if (state.stack.includes(\"tableCell\")) {\n value = value.replace(/\\|/g, \"\\\\$&\");\n }\n return value;\n }\n}\nfunction gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n };\n}\nfunction gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{ atBreak: true, character: \"-\", after: \"[:|-]\" }],\n handlers: { listItem: listItemWithTaskListItem }\n };\n}\nfunction exitCheck(token) {\n const node2 = this.stack[this.stack.length - 2];\n ok$1(node2.type === \"listItem\");\n node2.checked = token.type === \"taskListCheckValueChecked\";\n}\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2];\n if (parent && parent.type === \"listItem\" && typeof parent.checked === \"boolean\") {\n const node2 = this.stack[this.stack.length - 1];\n ok$1(node2.type === \"paragraph\");\n const head = node2.children[0];\n if (head && head.type === \"text\") {\n const siblings = parent.children;\n let index = -1;\n let firstParaghraph;\n while (++index < siblings.length) {\n const sibling = siblings[index];\n if (sibling.type === \"paragraph\") {\n firstParaghraph = sibling;\n break;\n }\n }\n if (firstParaghraph === node2) {\n head.value = head.value.slice(1);\n if (head.value.length === 0) {\n node2.children.shift();\n } else if (node2.position && head.position && typeof head.position.start.offset === \"number\") {\n head.position.start.column++;\n head.position.start.offset++;\n node2.position.start = Object.assign({}, head.position.start);\n }\n }\n }\n }\n this.exit(token);\n}\nfunction listItemWithTaskListItem(node2, parent, state, info) {\n const head = node2.children[0];\n const checkable = typeof node2.checked === \"boolean\" && head && head.type === \"paragraph\";\n const checkbox = \"[\" + (node2.checked ? \"x\" : \" \") + \"] \";\n const tracker = state.createTracker(info);\n if (checkable) {\n tracker.move(checkbox);\n }\n let value = handle.listItem(node2, parent, state, {\n ...info,\n ...tracker.current()\n });\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check);\n }\n return value;\n function check($0) {\n return $0 + checkbox;\n }\n}\nfunction gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ];\n}\nfunction gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n };\n}\nfunction splice(list2, start, remove, items) {\n const end = list2.length;\n let chunkStart = 0;\n let parameters;\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n if (items.length < 1e4) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n list2.splice(...parameters);\n } else {\n if (remove) list2.splice(start, remove);\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 1e4);\n parameters.unshift(start, 0);\n list2.splice(...parameters);\n chunkStart += 1e4;\n start += 1e4;\n }\n }\n}\nconst hasOwnProperty = {}.hasOwnProperty;\nfunction combineExtensions(extensions) {\n const all2 = {};\n let index = -1;\n while (++index < extensions.length) {\n syntaxExtension(all2, extensions[index]);\n }\n return all2;\n}\nfunction syntaxExtension(all2, extension) {\n let hook;\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0;\n const left = maybe || (all2[hook] = {});\n const right = extension[hook];\n let code2;\n if (right) {\n for (code2 in right) {\n if (!hasOwnProperty.call(left, code2)) left[code2] = [];\n const value = right[code2];\n constructs(\n // @ts-expect-error Looks like a list.\n left[code2],\n Array.isArray(value) ? value : value ? [value] : []\n );\n }\n }\n }\n}\nfunction constructs(existing, list2) {\n let index = -1;\n const before = [];\n while (++index < list2.length) {\n (list2[index].add === \"after\" ? existing : before).push(list2[index]);\n }\n splice(existing, 0, 0, before);\n}\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: \"wwwAutolink\",\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: \"protocolAutolink\",\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: \"emailAutolink\",\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\nconst text = {};\nfunction gfmAutolinkLiteral() {\n return {\n text\n };\n}\nlet code = 48;\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;\n else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\nfunction tokenizeEmailAutolink(effects, ok2, nok) {\n const self = this;\n let dot;\n let data;\n return start;\n function start(code2) {\n if (!gfmAtext(code2) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code2);\n }\n effects.enter(\"literalAutolink\");\n effects.enter(\"literalAutolinkEmail\");\n return atext(code2);\n }\n function atext(code2) {\n if (gfmAtext(code2)) {\n effects.consume(code2);\n return atext;\n }\n if (code2 === 64) {\n effects.consume(code2);\n return emailDomain;\n }\n return nok(code2);\n }\n function emailDomain(code2) {\n if (code2 === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code2);\n }\n if (code2 === 45 || code2 === 95 || asciiAlphanumeric(code2)) {\n data = true;\n effects.consume(code2);\n return emailDomain;\n }\n return emailDomainAfter(code2);\n }\n function emailDomainDot(code2) {\n effects.consume(code2);\n dot = true;\n return emailDomain;\n }\n function emailDomainAfter(code2) {\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit(\"literalAutolinkEmail\");\n effects.exit(\"literalAutolink\");\n return ok2(code2);\n }\n return nok(code2);\n }\n}\nfunction tokenizeWwwAutolink(effects, ok2, nok) {\n const self = this;\n return wwwStart;\n function wwwStart(code2) {\n if (code2 !== 87 && code2 !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code2);\n }\n effects.enter(\"literalAutolink\");\n effects.enter(\"literalAutolinkWww\");\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code2);\n }\n function wwwAfter(code2) {\n effects.exit(\"literalAutolinkWww\");\n effects.exit(\"literalAutolink\");\n return ok2(code2);\n }\n}\nfunction tokenizeProtocolAutolink(effects, ok2, nok) {\n const self = this;\n let buffer = \"\";\n let seen = false;\n return protocolStart;\n function protocolStart(code2) {\n if ((code2 === 72 || code2 === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter(\"literalAutolink\");\n effects.enter(\"literalAutolinkHttp\");\n buffer += String.fromCodePoint(code2);\n effects.consume(code2);\n return protocolPrefixInside;\n }\n return nok(code2);\n }\n function protocolPrefixInside(code2) {\n if (asciiAlpha(code2) && buffer.length < 5) {\n buffer += String.fromCodePoint(code2);\n effects.consume(code2);\n return protocolPrefixInside;\n }\n if (code2 === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === \"http\" || protocol === \"https\") {\n effects.consume(code2);\n return protocolSlashesInside;\n }\n }\n return nok(code2);\n }\n function protocolSlashesInside(code2) {\n if (code2 === 47) {\n effects.consume(code2);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code2);\n }\n function afterProtocol(code2) {\n return code2 === null || asciiControl(code2) || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || unicodePunctuation(code2) ? nok(code2) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code2);\n }\n function protocolAfter(code2) {\n effects.exit(\"literalAutolinkHttp\");\n effects.exit(\"literalAutolink\");\n return ok2(code2);\n }\n}\nfunction tokenizeWwwPrefix(effects, ok2, nok) {\n let size = 0;\n return wwwPrefixInside;\n function wwwPrefixInside(code2) {\n if ((code2 === 87 || code2 === 119) && size < 3) {\n size++;\n effects.consume(code2);\n return wwwPrefixInside;\n }\n if (code2 === 46 && size === 3) {\n effects.consume(code2);\n return wwwPrefixAfter;\n }\n return nok(code2);\n }\n function wwwPrefixAfter(code2) {\n return code2 === null ? nok(code2) : ok2(code2);\n }\n}\nfunction tokenizeDomain(effects, ok2, nok) {\n let underscoreInLastSegment;\n let underscoreInLastLastSegment;\n let seen;\n return domainInside;\n function domainInside(code2) {\n if (code2 === 46 || code2 === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code2);\n }\n if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || code2 !== 45 && unicodePunctuation(code2)) {\n return domainAfter(code2);\n }\n seen = true;\n effects.consume(code2);\n return domainInside;\n }\n function domainAtPunctuation(code2) {\n if (code2 === 95) {\n underscoreInLastSegment = true;\n } else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = void 0;\n }\n effects.consume(code2);\n return domainInside;\n }\n function domainAfter(code2) {\n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code2);\n }\n return ok2(code2);\n }\n}\nfunction tokenizePath(effects, ok2) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n function pathInside(code2) {\n if (code2 === 40) {\n sizeOpen++;\n effects.consume(code2);\n return pathInside;\n }\n if (code2 === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code2);\n }\n if (code2 === 33 || code2 === 34 || code2 === 38 || code2 === 39 || code2 === 41 || code2 === 42 || code2 === 44 || code2 === 46 || code2 === 58 || code2 === 59 || code2 === 60 || code2 === 63 || code2 === 93 || code2 === 95 || code2 === 126) {\n return effects.check(trail, ok2, pathAtPunctuation)(code2);\n }\n if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {\n return ok2(code2);\n }\n effects.consume(code2);\n return pathInside;\n }\n function pathAtPunctuation(code2) {\n if (code2 === 41) {\n sizeClose++;\n }\n effects.consume(code2);\n return pathInside;\n }\n}\nfunction tokenizeTrail(effects, ok2, nok) {\n return trail2;\n function trail2(code2) {\n if (code2 === 33 || code2 === 34 || code2 === 39 || code2 === 41 || code2 === 42 || code2 === 44 || code2 === 46 || code2 === 58 || code2 === 59 || code2 === 63 || code2 === 95 || code2 === 126) {\n effects.consume(code2);\n return trail2;\n }\n if (code2 === 38) {\n effects.consume(code2);\n return trailCharacterReferenceStart;\n }\n if (code2 === 93) {\n effects.consume(code2);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code2 === 60 || // So is whitespace.\n code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)\n ) {\n return ok2(code2);\n }\n return nok(code2);\n }\n function trailBracketAfter(code2) {\n if (code2 === null || code2 === 40 || code2 === 91 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {\n return ok2(code2);\n }\n return trail2(code2);\n }\n function trailCharacterReferenceStart(code2) {\n return asciiAlpha(code2) ? trailCharacterReferenceInside(code2) : nok(code2);\n }\n function trailCharacterReferenceInside(code2) {\n if (code2 === 59) {\n effects.consume(code2);\n return trail2;\n }\n if (asciiAlpha(code2)) {\n effects.consume(code2);\n return trailCharacterReferenceInside;\n }\n return nok(code2);\n }\n}\nfunction tokenizeEmailDomainDotTrail(effects, ok2, nok) {\n return start;\n function start(code2) {\n effects.consume(code2);\n return after;\n }\n function after(code2) {\n return asciiAlphanumeric(code2) ? nok(code2) : ok2(code2);\n }\n}\nfunction previousWww(code2) {\n return code2 === null || code2 === 40 || code2 === 42 || code2 === 95 || code2 === 91 || code2 === 93 || code2 === 126 || markdownLineEndingOrSpace(code2);\n}\nfunction previousProtocol(code2) {\n return !asciiAlpha(code2);\n}\nfunction previousEmail(code2) {\n return !(code2 === 47 || gfmAtext(code2));\n}\nfunction gfmAtext(code2) {\n return code2 === 43 || code2 === 45 || code2 === 46 || code2 === 95 || asciiAlphanumeric(code2);\n}\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === \"labelLink\" || token.type === \"labelImage\") && !token._balanced) {\n result = true;\n break;\n }\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}\nfunction resolveAll(constructs2, events, context) {\n const called = [];\n let index = -1;\n while (++index < constructs2.length) {\n const resolve = constructs2[index].resolveAll;\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context);\n called.push(resolve);\n }\n }\n return events;\n}\nfunction factorySpace(effects, ok2, type, max) {\n const limit = max ? max - 1 : Number.POSITIVE_INFINITY;\n let size = 0;\n return start;\n function start(code2) {\n if (markdownSpace(code2)) {\n effects.enter(type);\n return prefix(code2);\n }\n return ok2(code2);\n }\n function prefix(code2) {\n if (markdownSpace(code2) && size++ < limit) {\n effects.consume(code2);\n return prefix;\n }\n effects.exit(type);\n return ok2(code2);\n }\n}\nconst blankLine = {\n partial: true,\n tokenize: tokenizeBlankLine\n};\nfunction tokenizeBlankLine(effects, ok2, nok) {\n return start;\n function start(code2) {\n return markdownSpace(code2) ? factorySpace(effects, after, \"linePrefix\")(code2) : after(code2);\n }\n function after(code2) {\n return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2);\n }\n}\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\nfunction gfmFootnote() {\n return {\n document: {\n [91]: {\n name: \"gfmFootnoteDefinition\",\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: \"gfmFootnoteCall\",\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: \"gfmPotentialFootnoteCall\",\n add: \"after\",\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\nfunction tokenizePotentialGfmFootnoteCall(effects, ok2, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let labelStart;\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n if (token.type === \"gfmFootnoteCall\" || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n function start(code2) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code2);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code2);\n }\n effects.enter(\"gfmFootnoteCallLabelMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteCallLabelMarker\");\n return ok2(code2);\n }\n}\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === \"enter\") {\n events[index][1];\n break;\n }\n }\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = \"gfmFootnoteCallLabelMarker\";\n const call = {\n type: \"gfmFootnoteCall\",\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n const marker = {\n type: \"gfmFootnoteCallMarker\",\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n const string = {\n type: \"gfmFootnoteCallString\",\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n const chunk = {\n type: \"chunkString\",\n contentType: \"string\",\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1],\n events[index + 2],\n [\"enter\", call, context],\n // The `[`\n events[index + 3],\n events[index + 4],\n // The `^`.\n [\"enter\", marker, context],\n [\"exit\", marker, context],\n // Everything in between.\n [\"enter\", string, context],\n [\"enter\", chunk, context],\n [\"exit\", chunk, context],\n [\"exit\", string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2],\n events[events.length - 1],\n [\"exit\", call, context]\n ];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\nfunction tokenizeGfmFootnoteCall(effects, ok2, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n let data;\n return start;\n function start(code2) {\n effects.enter(\"gfmFootnoteCall\");\n effects.enter(\"gfmFootnoteCallLabelMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteCallLabelMarker\");\n return callStart;\n }\n function callStart(code2) {\n if (code2 !== 94) return nok(code2);\n effects.enter(\"gfmFootnoteCallMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteCallMarker\");\n effects.enter(\"gfmFootnoteCallString\");\n effects.enter(\"chunkString\").contentType = \"string\";\n return callData;\n }\n function callData(code2) {\n if (\n // Too long.\n size > 999 || // Closing brace with nothing.\n code2 === 93 && !data || // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code2 === null || code2 === 91 || markdownLineEndingOrSpace(code2)\n ) {\n return nok(code2);\n }\n if (code2 === 93) {\n effects.exit(\"chunkString\");\n const token = effects.exit(\"gfmFootnoteCallString\");\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code2);\n }\n effects.enter(\"gfmFootnoteCallLabelMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteCallLabelMarker\");\n effects.exit(\"gfmFootnoteCall\");\n return ok2;\n }\n if (!markdownLineEndingOrSpace(code2)) {\n data = true;\n }\n size++;\n effects.consume(code2);\n return code2 === 92 ? callEscape : callData;\n }\n function callEscape(code2) {\n if (code2 === 91 || code2 === 92 || code2 === 93) {\n effects.consume(code2);\n size++;\n return callData;\n }\n return callData(code2);\n }\n}\nfunction tokenizeDefinitionStart(effects, ok2, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let identifier;\n let size = 0;\n let data;\n return start;\n function start(code2) {\n effects.enter(\"gfmFootnoteDefinition\")._container = true;\n effects.enter(\"gfmFootnoteDefinitionLabel\");\n effects.enter(\"gfmFootnoteDefinitionLabelMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteDefinitionLabelMarker\");\n return labelAtMarker;\n }\n function labelAtMarker(code2) {\n if (code2 === 94) {\n effects.enter(\"gfmFootnoteDefinitionMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteDefinitionMarker\");\n effects.enter(\"gfmFootnoteDefinitionLabelString\");\n effects.enter(\"chunkString\").contentType = \"string\";\n return labelInside;\n }\n return nok(code2);\n }\n function labelInside(code2) {\n if (\n // Too long.\n size > 999 || // Closing brace with nothing.\n code2 === 93 && !data || // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code2 === null || code2 === 91 || markdownLineEndingOrSpace(code2)\n ) {\n return nok(code2);\n }\n if (code2 === 93) {\n effects.exit(\"chunkString\");\n const token = effects.exit(\"gfmFootnoteDefinitionLabelString\");\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter(\"gfmFootnoteDefinitionLabelMarker\");\n effects.consume(code2);\n effects.exit(\"gfmFootnoteDefinitionLabelMarker\");\n effects.exit(\"gfmFootnoteDefinitionLabel\");\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code2)) {\n data = true;\n }\n size++;\n effects.consume(code2);\n return code2 === 92 ? labelEscape : labelInside;\n }\n function labelEscape(code2) {\n if (code2 === 91 || code2 === 92 || code2 === 93) {\n effects.consume(code2);\n size++;\n return labelInside;\n }\n return labelInside(code2);\n }\n function labelAfter(code2) {\n if (code2 === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code2);\n effects.exit(\"definitionMarker\");\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n return factorySpace(effects, whitespaceAfter, \"gfmFootnoteDefinitionWhitespace\");\n }\n return nok(code2);\n }\n function whitespaceAfter(code2) {\n return ok2(code2);\n }\n}\nfunction tokenizeDefinitionContinuation(effects, ok2, nok) {\n return effects.check(blankLine, ok2, effects.attempt(indent, ok2, nok));\n}\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit(\"gfmFootnoteDefinition\");\n}\nfunction tokenizeIndent(effects, ok2, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"gfmFootnoteDefinitionIndent\", 4 + 1);\n function afterPrefix(code2) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"gfmFootnoteDefinitionIndent\" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok2(code2) : nok(code2);\n }\n}\nfunction gfmStrikethrough(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: \"strikethrough\",\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === void 0) {\n single = true;\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n };\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n while (++index < events.length) {\n if (events[index][0] === \"enter\" && events[index][1].type === \"strikethroughSequenceTemporary\" && events[index][1]._close) {\n let open = index;\n while (open--) {\n if (events[open][0] === \"exit\" && events[open][1].type === \"strikethroughSequenceTemporary\" && events[open][1]._open && // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = \"strikethroughSequence\";\n events[open][1].type = \"strikethroughSequence\";\n const strikethrough = {\n type: \"strikethrough\",\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n const text2 = {\n type: \"strikethroughText\",\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n const nextEvents = [[\"enter\", strikethrough, context], [\"enter\", events[open][1], context], [\"exit\", events[open][1], context], [\"enter\", text2, context]];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));\n }\n splice(nextEvents, nextEvents.length, 0, [[\"exit\", text2, context], [\"enter\", events[index][1], context], [\"exit\", events[index][1], context], [\"exit\", strikethrough, context]]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === \"strikethroughSequenceTemporary\") {\n events[index][1].type = \"data\";\n }\n }\n return events;\n }\n function tokenizeStrikethrough(effects, ok2, nok) {\n const previous2 = this.previous;\n const events = this.events;\n let size = 0;\n return start;\n function start(code2) {\n if (previous2 === 126 && events[events.length - 1][1].type !== \"characterEscape\") {\n return nok(code2);\n }\n effects.enter(\"strikethroughSequenceTemporary\");\n return more(code2);\n }\n function more(code2) {\n const before = classifyCharacter(previous2);\n if (code2 === 126) {\n if (size > 1) return nok(code2);\n effects.consume(code2);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code2);\n const token = effects.exit(\"strikethroughSequenceTemporary\");\n const after = classifyCharacter(code2);\n token._open = !after || after === 2 && Boolean(before);\n token._close = !before || before === 2 && Boolean(after);\n return ok2(code2);\n }\n }\n}\nclass EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n this.map = [];\n }\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImplementation(this, index, remove, add, true)\n // }\n /**\n * Done, change the events.\n *\n * @param {Array} events\n * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function(a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n let index = this.map.length;\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n this.map.length = 0;\n }\n}\nfunction addImplementation(editMap, at, remove, add) {\n let index = 0;\n if (remove === 0 && add.length === 0) {\n return;\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove;\n editMap.map[index][2].push(...add);\n return;\n }\n index += 1;\n }\n editMap.map.push([at, remove, add]);\n}\nfunction gfmTableAlign(events, index) {\n let inDelimiterRow = false;\n const align = [];\n while (index < events.length) {\n const event = events[index];\n if (inDelimiterRow) {\n if (event[0] === \"enter\") {\n if (event[1].type === \"tableContent\") {\n align.push(events[index + 1][1].type === \"tableDelimiterMarker\" ? \"left\" : \"none\");\n }\n } else if (event[1].type === \"tableContent\") {\n if (events[index - 1][1].type === \"tableDelimiterMarker\") {\n const alignIndex = align.length - 1;\n align[alignIndex] = align[alignIndex] === \"left\" ? \"center\" : \"right\";\n }\n } else if (event[1].type === \"tableDelimiterRow\") {\n break;\n }\n } else if (event[0] === \"enter\" && event[1].type === \"tableDelimiterRow\") {\n inDelimiterRow = true;\n }\n index += 1;\n }\n return align;\n}\nfunction gfmTable() {\n return {\n flow: {\n null: {\n name: \"table\",\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\nfunction tokenizeTable(effects, ok2, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n let seen;\n return start;\n function start(code2) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;\n else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === \"tableHead\" || tail === \"tableRow\" ? bodyRowStart : headRowBefore;\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code2);\n }\n return next(code2);\n }\n function headRowBefore(code2) {\n effects.enter(\"tableHead\");\n effects.enter(\"tableRow\");\n return headRowStart(code2);\n }\n function headRowStart(code2) {\n if (code2 === 124) {\n return headRowBreak(code2);\n }\n seen = true;\n sizeB += 1;\n return headRowBreak(code2);\n }\n function headRowBreak(code2) {\n if (code2 === null) {\n return nok(code2);\n }\n if (markdownLineEnding(code2)) {\n if (sizeB > 1) {\n sizeB = 0;\n self.interrupt = true;\n effects.exit(\"tableRow\");\n effects.enter(\"lineEnding\");\n effects.consume(code2);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n return nok(code2);\n }\n if (markdownSpace(code2)) {\n return factorySpace(effects, headRowBreak, \"whitespace\")(code2);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n size += 1;\n }\n if (code2 === 124) {\n effects.enter(\"tableCellDivider\");\n effects.consume(code2);\n effects.exit(\"tableCellDivider\");\n seen = true;\n return headRowBreak;\n }\n effects.enter(\"data\");\n return headRowData(code2);\n }\n function headRowData(code2) {\n if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) {\n effects.exit(\"data\");\n return headRowBreak(code2);\n }\n effects.consume(code2);\n return code2 === 92 ? headRowEscape : headRowData;\n }\n function headRowEscape(code2) {\n if (code2 === 92 || code2 === 124) {\n effects.consume(code2);\n return headRowData;\n }\n return headRowData(code2);\n }\n function headDelimiterStart(code2) {\n self.interrupt = false;\n if (self.parser.lazy[self.now().line]) {\n return nok(code2);\n }\n effects.enter(\"tableDelimiterRow\");\n seen = false;\n if (markdownSpace(code2)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes(\"codeIndented\") ? void 0 : 4)(code2);\n }\n return headDelimiterBefore(code2);\n }\n function headDelimiterBefore(code2) {\n if (code2 === 45 || code2 === 58) {\n return headDelimiterValueBefore(code2);\n }\n if (code2 === 124) {\n seen = true;\n effects.enter(\"tableCellDivider\");\n effects.consume(code2);\n effects.exit(\"tableCellDivider\");\n return headDelimiterCellBefore;\n }\n return headDelimiterNok(code2);\n }\n function headDelimiterCellBefore(code2) {\n if (markdownSpace(code2)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code2);\n }\n return headDelimiterValueBefore(code2);\n }\n function headDelimiterValueBefore(code2) {\n if (code2 === 58) {\n sizeB += 1;\n seen = true;\n effects.enter(\"tableDelimiterMarker\");\n effects.consume(code2);\n effects.exit(\"tableDelimiterMarker\");\n return headDelimiterLeftAlignmentAfter;\n }\n if (code2 === 45) {\n sizeB += 1;\n return headDelimiterLeftAlignmentAfter(code2);\n }\n if (code2 === null || markdownLineEnding(code2)) {\n return headDelimiterCellAfter(code2);\n }\n return headDelimiterNok(code2);\n }\n function headDelimiterLeftAlignmentAfter(code2) {\n if (code2 === 45) {\n effects.enter(\"tableDelimiterFiller\");\n return headDelimiterFiller(code2);\n }\n return headDelimiterNok(code2);\n }\n function headDelimiterFiller(code2) {\n if (code2 === 45) {\n effects.consume(code2);\n return headDelimiterFiller;\n }\n if (code2 === 58) {\n seen = true;\n effects.exit(\"tableDelimiterFiller\");\n effects.enter(\"tableDelimiterMarker\");\n effects.consume(code2);\n effects.exit(\"tableDelimiterMarker\");\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit(\"tableDelimiterFiller\");\n return headDelimiterRightAlignmentAfter(code2);\n }\n function headDelimiterRightAlignmentAfter(code2) {\n if (markdownSpace(code2)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code2);\n }\n return headDelimiterCellAfter(code2);\n }\n function headDelimiterCellAfter(code2) {\n if (code2 === 124) {\n return headDelimiterBefore(code2);\n }\n if (code2 === null || markdownLineEnding(code2)) {\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code2);\n }\n effects.exit(\"tableDelimiterRow\");\n effects.exit(\"tableHead\");\n return ok2(code2);\n }\n return headDelimiterNok(code2);\n }\n function headDelimiterNok(code2) {\n return nok(code2);\n }\n function bodyRowStart(code2) {\n effects.enter(\"tableRow\");\n return bodyRowBreak(code2);\n }\n function bodyRowBreak(code2) {\n if (code2 === 124) {\n effects.enter(\"tableCellDivider\");\n effects.consume(code2);\n effects.exit(\"tableCellDivider\");\n return bodyRowBreak;\n }\n if (code2 === null || markdownLineEnding(code2)) {\n effects.exit(\"tableRow\");\n return ok2(code2);\n }\n if (markdownSpace(code2)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code2);\n }\n effects.enter(\"data\");\n return bodyRowData(code2);\n }\n function bodyRowData(code2) {\n if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) {\n effects.exit(\"data\");\n return bodyRowBreak(code2);\n }\n effects.consume(code2);\n return code2 === 92 ? bodyRowEscape : bodyRowData;\n }\n function bodyRowEscape(code2) {\n if (code2 === 92 || code2 === 124) {\n effects.consume(code2);\n return bodyRowData;\n }\n return bodyRowData(code2);\n }\n}\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n let rowKind = 0;\n let lastCell = [0, 0, 0, 0];\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n let currentTable;\n let currentBody;\n let currentCell;\n const map2 = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === \"enter\") {\n if (token.type === \"tableHead\") {\n afterHeadAwaitingFirstBodyRow = false;\n if (lastTableEnd !== 0) {\n flushTableEnd(map2, context, lastTableEnd, currentTable, currentBody);\n currentBody = void 0;\n lastTableEnd = 0;\n }\n currentTable = {\n type: \"table\",\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map2.add(index, 0, [[\"enter\", currentTable, context]]);\n } else if (token.type === \"tableRow\" || token.type === \"tableDelimiterRow\") {\n inFirstCellAwaitingPipe = true;\n currentCell = void 0;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: \"tableBody\",\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map2.add(index, 0, [[\"enter\", currentBody, context]]);\n }\n rowKind = token.type === \"tableDelimiterRow\" ? 2 : currentBody ? 3 : 1;\n } else if (rowKind && (token.type === \"data\" || token.type === \"tableDelimiterMarker\" || token.type === \"tableDelimiterFiller\")) {\n inFirstCellAwaitingPipe = false;\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map2, context, lastCell, rowKind, void 0, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === \"tableCellDivider\") {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map2, context, lastCell, rowKind, void 0, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n } else if (token.type === \"tableHead\") {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === \"tableRow\" || token.type === \"tableDelimiterRow\") {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map2, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map2, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === \"tableDelimiterMarker\" || token.type === \"tableDelimiterFiller\")) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map2, context, lastTableEnd, currentTable, currentBody);\n }\n map2.consume(context.events);\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === \"enter\" && event[1].type === \"table\") {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\nfunction flushCell(map2, context, range, rowKind, rowEnd, previousCell) {\n const groupName = rowKind === 1 ? \"tableHeader\" : rowKind === 2 ? \"tableDelimiter\" : \"tableData\";\n const valueName = \"tableContent\";\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map2.add(range[0], 0, [[\"exit\", previousCell, context]]);\n }\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map2.add(range[1], 0, [[\"enter\", previousCell, context]]);\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map2.add(range[2], 0, [[\"enter\", valueToken, context]]);\n if (rowKind !== 2) {\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map2.add(a, b, []);\n }\n }\n map2.add(range[3] + 1, 0, [[\"exit\", valueToken, context]]);\n }\n if (rowEnd !== void 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map2.add(rowEnd, 0, [[\"exit\", previousCell, context]]);\n previousCell = void 0;\n }\n return previousCell;\n}\nfunction flushTableEnd(map2, context, index, table, tableBody) {\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push([\"exit\", tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push([\"exit\", table, context]);\n map2.add(index + 1, 0, exits);\n}\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === \"enter\" ? \"start\" : \"end\";\n return event[1][side];\n}\nconst tasklistCheck = {\n name: \"tasklistCheck\",\n tokenize: tokenizeTasklistCheck\n};\nfunction gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\nfunction tokenizeTasklistCheck(effects, ok2, nok) {\n const self = this;\n return open;\n function open(code2) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null || // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem\n ) {\n return nok(code2);\n }\n effects.enter(\"taskListCheck\");\n effects.enter(\"taskListCheckMarker\");\n effects.consume(code2);\n effects.exit(\"taskListCheckMarker\");\n return inside;\n }\n function inside(code2) {\n if (markdownLineEndingOrSpace(code2)) {\n effects.enter(\"taskListCheckValueUnchecked\");\n effects.consume(code2);\n effects.exit(\"taskListCheckValueUnchecked\");\n return close;\n }\n if (code2 === 88 || code2 === 120) {\n effects.enter(\"taskListCheckValueChecked\");\n effects.consume(code2);\n effects.exit(\"taskListCheckValueChecked\");\n return close;\n }\n return nok(code2);\n }\n function close(code2) {\n if (code2 === 93) {\n effects.enter(\"taskListCheckMarker\");\n effects.consume(code2);\n effects.exit(\"taskListCheckMarker\");\n effects.exit(\"taskListCheck\");\n return after;\n }\n return nok(code2);\n }\n function after(code2) {\n if (markdownLineEnding(code2)) {\n return ok2(code2);\n }\n if (markdownSpace(code2)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok2, nok)(code2);\n }\n return nok(code2);\n }\n}\nfunction spaceThenNonSpace(effects, ok2, nok) {\n return factorySpace(effects, after, \"whitespace\");\n function after(code2) {\n return code2 === null ? nok(code2) : ok2(code2);\n }\n}\nfunction gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ]);\n}\nconst emptyOptions = {};\nfunction remarkGfm(options) {\n const self = (\n /** @type {Processor} */\n this\n );\n const settings = options || emptyOptions;\n const data = self.data();\n const micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);\n const fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);\n const toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);\n micromarkExtensions.push(gfm(settings));\n fromMarkdownExtensions.push(gfmFromMarkdown());\n toMarkdownExtensions.push(gfmToMarkdown(settings));\n}\nconst _sfc_main$1 = /* @__PURE__ */ defineComponent({\n __name: \"NcRichTextCopyButton\",\n props: {\n contentId: {}\n },\n setup(__props) {\n const { copy, icon, altText } = useCopy(() => document.getElementById(__props.contentId).textContent);\n return (_ctx, _cache) => {\n return openBlock(), createBlock(NcButton, {\n variant: \"tertiary\",\n size: \"small\",\n \"aria-label\": unref(altText),\n title: unref(altText),\n onClick: unref(copy)\n }, {\n icon: withCtx(() => [\n createVNode(NcIconSvgWrapper, {\n path: unref(icon),\n inline: \"\"\n }, null, 8, [\"path\"])\n ]),\n _: 1\n }, 8, [\"aria-label\", \"title\", \"onClick\"]);\n };\n }\n});\n/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction isTextNode$1(node2) {\n return node2.type === \"text\";\n}\nconst transformPlaceholders = function(ast) {\n visit(ast, isTextNode$1, visitor);\n function visitor(node2, index, parent) {\n const placeholders = node2.value.split(/(\\{[a-z\\-_.0-9]+\\})/ig).map((entry) => {\n const matches = entry.match(/^\\{([a-z\\-_.0-9]+)\\}$/i);\n if (!matches) {\n return u(\"text\", entry);\n }\n const [, component] = matches;\n return u(\"element\", {\n tagName: `#${component}`,\n children: []\n });\n });\n parent.children.splice(index, 1, ...placeholders);\n }\n};\nconst remarkPlaceholder = () => transformPlaceholders;\n/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nfunction isTextNode(node2) {\n return [\"text\", \"code\", \"inlineCode\"].includes(node2.type);\n}\nconst remarkUnescape = function() {\n return function(tree) {\n visit(tree, isTextNode, (node2, index, parent) => {\n parent.children.splice(index, 1, {\n ...node2,\n value: node2.value.replace(/</gmi, \"<\").replace(/>/gmi, \">\")\n });\n return [SKIP$1, index + 1];\n });\n };\n};\nconst LINK_PROTOCOLS = [\"http\", \"https\", \"mailto\", \"tel\"];\nconst rehypeHighlight = ref(null);\nasync function importRehypeHighlightLibrary() {\n const module = await import(\"rehype-highlight\");\n rehypeHighlight.value = module.default;\n}\nconst _sfc_main = {\n name: \"NcRichText\",\n components: {\n NcReferenceList\n },\n /* eslint vue/require-prop-comment: warn -- TODO: Add a proper doc block about what this props do */\n props: {\n /**\n * The main text\n */\n text: {\n type: String,\n default: \"\"\n },\n arguments: {\n type: Object,\n default: () => {\n return {};\n }\n },\n referenceLimit: {\n type: Number,\n default: 0\n },\n referenceInteractive: {\n type: Boolean,\n default: true\n },\n referenceInteractiveOptIn: {\n type: Boolean,\n default: false\n },\n /** Provide data upfront to avoid extra http request */\n references: {\n type: Array,\n default: null\n },\n /** Provide basic Markdown syntax */\n useMarkdown: {\n type: Boolean,\n default: false\n },\n /** Provide GitHub Flavored Markdown syntax */\n useExtendedMarkdown: {\n type: Boolean,\n default: false\n },\n /** Provide event from rendered markdown inputs */\n interactive: {\n type: Boolean,\n default: false\n },\n /**\n * Automatically convert link-like text to markdown links\n */\n autolink: {\n type: Boolean,\n default: true\n }\n },\n emits: [\n \"interactTodo\"\n ],\n data() {\n return {\n parentId: createElementId()\n };\n },\n methods: {\n renderPlaintext() {\n const placeholders = this.text.split(/(\\{[a-z\\-_.0-9]+\\})/ig).map((entry) => {\n const matches = entry.match(/^\\{([a-z\\-_.0-9]+)\\}$/i);\n if (!matches) {\n return this.prepareTextNode(entry);\n }\n const argumentId = matches[1];\n const argument = this.arguments[argumentId];\n if (typeof argument === \"object\") {\n const { component, props } = argument;\n return h(typeof component === \"string\" ? resolveComponent(component) : component, {\n ...props,\n class: \"rich-text--component\"\n });\n }\n if (argument) {\n return h(\"span\", { class: \"rich-text--fallback\" }, argument);\n }\n return entry;\n });\n return h(\"div\", { class: \"rich-text--wrapper\" }, [\n h(\"div\", {}, placeholders.flat()),\n this.referenceLimit > 0 ? h(\"div\", { class: \"rich-text--reference-widget\" }, [\n h(NcReferenceList, {\n text: this.text,\n referenceData: this.references,\n interactive: this.referenceInteractive,\n interactiveOptIn: this.referenceInteractiveOptIn\n })\n ]) : null\n ]);\n },\n renderMarkdown() {\n const renderedMarkdown = unified().use(remarkParse).use(remarkAutolink, {\n autolink: this.autolink,\n useMarkdown: this.useMarkdown,\n useExtendedMarkdown: this.useExtendedMarkdown\n }).use(remarkUnescape).use(this.useExtendedMarkdown ? remarkGfm : void 0).use(breaks).use(remarkUnlinkProtocols, { except: LINK_PROTOCOLS }).use(remark2rehype, {\n handlers: {\n component(toHast, node2) {\n return toHast(node2, node2.component, { value: node2.value });\n }\n }\n }).use(this.useExtendedMarkdown ? rehypeHighlight.value : void 0).use(remarkPlaceholder).use(rehypeExternalLinks, {\n target: \"_blank\",\n rel: [\"noopener noreferrer\"]\n }).use(rehype2react, {\n Fragment,\n jsx: this.createElement,\n jsxs: this.createElement,\n elementAttributeNameCase: \"html\",\n prefix: false\n }).processSync(this.text.replace(/<[^>]+>/g, (match) => match.replace(/\")).result;\n return h(\"div\", { class: \"rich-text--wrapper rich-text--wrapper-markdown\" }, [\n renderedMarkdown,\n this.referenceLimit > 0 ? h(\"div\", { class: \"rich-text--reference-widget\" }, [\n h(NcReferenceList, {\n text: this.text,\n referenceData: this.references,\n interactive: this.referenceInteractive,\n interactiveOptIn: this.referenceInteractiveOptIn\n })\n ]) : null\n ]);\n },\n /**\n * Render plain text nodes\n *\n * @param {string} text - Content of the node\n */\n prepareTextNode(text2) {\n if (this.autolink) {\n text2 = parseUrl(text2);\n }\n if (Array.isArray(text2)) {\n return text2.map((entry) => {\n if (typeof entry === \"string\") {\n return entry;\n }\n const { component, props } = entry;\n const componentClass = component.name === \"NcLink\" ? void 0 : \"rich-text--component\";\n return h(component, {\n ...props,\n class: componentClass\n });\n });\n }\n return text2;\n },\n createElement(type, props, key) {\n if (key) {\n props.key = key;\n }\n const children = props.children ?? [];\n delete props.children;\n if (!String(type).startsWith(\"#\")) {\n if ([\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].includes(String(type))) {\n type = `h${Math.min(+String(type)[1] + 3, 6)}`;\n }\n let nestedNode = null;\n if (this.useExtendedMarkdown) {\n if (String(type) === \"code\" && !rehypeHighlight.value && props?.class?.includes(\"language\")) {\n importRehypeHighlightLibrary();\n }\n if (String(type) === \"pre\" && children && String(children.type) === \"code\") {\n const id = this.parentId + \"-code-block-\" + createElementId();\n return h(\"p\", { class: \"rich-text__code-block\" }, [\n h(type, { ...props, id }, children),\n h(_sfc_main$1, { class: \"rich-text__code-block-button\", contentId: id })\n ]);\n }\n if (String(type) === \"li\" && Array.isArray(children) && children.length !== 0 && children[0].type === \"input\" && children[0].props.type === \"checkbox\") {\n const [inputNode, , ...labelParts] = children;\n const nestedNodeIndex = labelParts.findIndex((child) => [\"ul\", \"ol\", \"li\", \"blockquote\", \"pre\"].includes(child.type));\n if (nestedNodeIndex !== -1) {\n nestedNode = labelParts[nestedNodeIndex];\n labelParts.splice(nestedNodeIndex);\n }\n const id = this.parentId + \"-markdown-input-\" + createElementId();\n const propsToForward = { ...inputNode.props };\n delete propsToForward.checked;\n const inputComponent = h(NcCheckboxRadioSwitch, {\n ...propsToForward,\n modelValue: inputNode.props.checked,\n id,\n disabled: !this.interactive,\n \"onUpdate:modelValue\": () => {\n this.$emit(\"interactTodo\", id);\n }\n }, { default: () => labelParts });\n return h(type, props, [inputComponent, nestedNode]);\n }\n }\n if (String(type) === \"a\") {\n const route = getRoute(this.$router, props.href);\n if (route) {\n delete props.href;\n delete props.target;\n return h(RouterLink, {\n ...props,\n to: route\n }, { default: () => children });\n }\n }\n return h(type, props, children);\n }\n const placeholder = this.arguments[type.slice(1)];\n if (!placeholder) {\n return h(\"span\", { ...props, class: \"rich-text--fallback\" }, [`{${type.slice(1)}}`]);\n }\n if (!placeholder.component) {\n return h(\"span\", { ...props }, [placeholder]);\n }\n return h(\n typeof placeholder.component === \"string\" ? resolveComponent(placeholder.component) : placeholder.component,\n {\n ...props,\n ...placeholder.props,\n class: \"rich-text--component\"\n },\n { default: () => children }\n );\n }\n },\n render() {\n return this.useMarkdown || this.useExtendedMarkdown ? this.renderMarkdown() : this.renderPlaintext();\n }\n};\nconst NcRichText = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-a47e4ba7\"]]);\nexport {\n NcRichText as N,\n NcReferenceList as a\n};\n//# sourceMappingURL=NcRichText-DJlaHs_Q.mjs.map\n"],"file":"ActivityComponent.vue_vue_type_script_setup_true_lang-jKpSGnZp.chunk.mjs"}
\ No newline at end of file
diff --git a/js/ActivityTab-CClb0nE0.chunk.mjs b/js/ActivityTab-BL6eDYHp.chunk.mjs
similarity index 82%
rename from js/ActivityTab-CClb0nE0.chunk.mjs
rename to js/ActivityTab-BL6eDYHp.chunk.mjs
index 6bd136699..211d01d37 100644
--- a/js/ActivityTab-CClb0nE0.chunk.mjs
+++ b/js/ActivityTab-BL6eDYHp.chunk.mjs
@@ -1,3 +1,3 @@
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".activity[data-v-b6867024]{display:flex;flex-direction:column;overflow:hidden;height:100%}.activity__actions[data-v-b6867024]{display:flex;flex-direction:column;width:100%}.activity__list[data-v-b6867024]{flex-grow:1;overflow:scroll}.activity__empty-content[data-v-b6867024]{height:100%}[data-v-b6867024] .empty-content__icon span{background-size:64px;width:64px;height:64px}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
-import{l as k}from"./activity-sidebar.mjs";import{m as P,b as N,h as j,j as I,g as x}from"./_plugin-vue_export-helper-D67664mc.chunk.mjs";import{d as f,r as B,x as C,B as E,y as L,a as s,b as i,L as u,l as R,m as o,e as r,i as p,h as y,F as g,E as q,M as h,n as G}from"./translation-DoG5ZELJ-DrmHMACs.chunk.mjs";import{N as O,_ as V,A as T}from"./ActivityComponent.vue_vue_type_script_setup_true_lang-jKpSGnZp.chunk.mjs";import{g as W,a as F,b as M}from"./api-mFrM-9qG.chunk.mjs";import{l as b}from"./logger-1JHA8kGV.chunk.mjs";import"./preload-helper-DxYC2qmj.chunk.mjs";import"./index-NjYp13Ld.chunk.mjs";const U=f({__name:"ActivitySidebarPlugin",props:{plugin:{},node:{}},emits:["reload-activities"],setup(t,{emit:e}){const a=t,n=e,l=B();return C(()=>a.plugin.mount(l.value,{node:a.node,context:E()?.proxy??void 0,reload:()=>n("reload-activities")})),L(()=>a.plugin.unmount()),(_,d)=>(i(),s("div",{ref_key:"attachTarget",ref:l},null,512))}}),$=f({name:"ActivityTab",components:{ActivityComponent:V,NcEmptyContent:O,NcIconSvgWrapper:N,NcLoadingIcon:P,ActivitySidebarPlugin:U},props:{node:{type:Object,required:!0},folder:{type:Object,required:!1,default:void 0},view:{type:Object,required:!1,default:void 0}},expose:["update"],data(){return{error:"",loading:!0,activities:[],lightningBoltSVG:k,sidebarPlugins:[]}},watch:{node:{immediate:!0,async handler(){await this.update()}}},async mounted(){this.node&&await this.update()},methods:{async update(){this.sidebarPlugins=[];const t=M();t.length>0&&R(()=>{this.sidebarPlugins=t}),this.resetState(),await this.getActivities()},async getActivities(){try{this.loading=!0;const t=await this.processActivities(await this.loadRealActivities()),e=await F({node:this.node});this.activities=[...t,...e].sort((a,n)=>n.timestamp-a.timestamp)}catch(t){this.error=u("activity","Unable to load the activity list"),b.error("Error loading the activity list",{error:t})}finally{this.loading=!1}},resetState(){this.loading=!0,this.error="",this.activities=[]},async loadRealActivities(){try{const{data:t}=await j.get(I("apps/activity/api/v2/activity/filter"),{params:{format:"json",object_type:"files",object_id:this.node.fileid}});return t.ocs.data}catch(t){if(t.response!==void 0&&t.response.status===304)return[];throw t}},processActivities(t){t=t.map(a=>new T(a)),b.debug(`Processed ${t.length} activity(ies)`,{activities:t,node:this.node});const e=W();return t.filter(a=>!e||e.every(n=>n(a)))},t:u}}),z={key:0,class:"activity__actions"},D={key:3,class:"activity__list"};function H(t,e,a,n,l,_){const d=o("NcIconSvgWrapper"),v=o("NcEmptyContent"),A=o("ActivitySidebarPlugin"),w=o("NcLoadingIcon"),S=o("ActivityComponent");return i(),s("div",{class:G([{"icon-loading":t.loading},"activity"])},[t.error||!t.node?(i(),r(v,{key:0,name:t.error},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s(g,{key:1},[t.sidebarPlugins.length>0?(i(),s("div",z,[(i(!0),s(g,null,h(t.sidebarPlugins,(c,m)=>(i(),r(A,{key:m,plugin:c,node:t.node,onReloadActivities:e[0]||(e[0]=J=>t.getActivities())},null,8,["plugin","node"]))),128))])):q("",!0),t.loading?(i(),r(v,{key:1,class:"activity__empty-content",name:t.t("activity","Loading activities")},{icon:p(()=>[y(w)]),_:1},8,["name"])):t.activities.length===0?(i(),r(v,{key:2,class:"activity__empty-content",name:t.t("activity","No activity yet")},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s("ul",D,[(i(!0),s(g,null,h(t.activities,c=>(i(),r(S,{key:c.id,activity:c,"show-previews":!1,onReload:e[1]||(e[1]=m=>t.getActivities())},null,8,["activity"]))),128))]))],64))],2)}const at=x($,[["render",H],["__scopeId","data-v-b6867024"]]);export{at as default};
-//# sourceMappingURL=ActivityTab-CClb0nE0.chunk.mjs.map
+import{l as k}from"./activity-sidebar.mjs";import{m as P,b as N,h as j,j as I,g as x}from"./_plugin-vue_export-helper-DhLn1aAU.chunk.mjs";import{d as b,x as B,g as C,B as E,y as L,c as s,a as i,M as u,l as R,m as o,b as r,h as p,f as y,F as g,E as q,L as h,n as G}from"./translation-DoG5ZELJ-B-ZIP-92.chunk.mjs";import{N as O,_ as V,A as T}from"./ActivityComponent.vue_vue_type_script_setup_true_lang-B7sb5TnJ.chunk.mjs";import{g as W,a as F,b as M}from"./api-mFrM-9qG.chunk.mjs";import{l as f}from"./logger-1JHA8kGV.chunk.mjs";import"./preload-helper-DxYC2qmj.chunk.mjs";import"./index-NjYp13Ld.chunk.mjs";const U=b({__name:"ActivitySidebarPlugin",props:{plugin:{},node:{}},emits:["reload-activities"],setup(t,{emit:e}){const a=t,n=e,l=C();return B(()=>a.plugin.mount(l.value,{node:a.node,context:E()?.proxy??void 0,reload:()=>n("reload-activities")})),L(()=>a.plugin.unmount()),(_,d)=>(i(),s("div",{ref_key:"attachTarget",ref:l},null,512))}}),$=b({name:"ActivityTab",components:{ActivityComponent:V,NcEmptyContent:O,NcIconSvgWrapper:N,NcLoadingIcon:P,ActivitySidebarPlugin:U},props:{node:{type:Object,required:!0},folder:{type:Object,required:!1,default:void 0},view:{type:Object,required:!1,default:void 0}},expose:["update"],data(){return{error:"",loading:!0,activities:[],lightningBoltSVG:k,sidebarPlugins:[]}},watch:{node:{immediate:!0,async handler(){await this.update()}}},async mounted(){this.node&&await this.update()},methods:{async update(){this.sidebarPlugins=[];const t=M();t.length>0&&R(()=>{this.sidebarPlugins=t}),this.resetState(),await this.getActivities()},async getActivities(){try{this.loading=!0;const t=await this.processActivities(await this.loadRealActivities()),e=await F({node:this.node});this.activities=[...t,...e].sort((a,n)=>n.timestamp-a.timestamp)}catch(t){this.error=u("activity","Unable to load the activity list"),f.error("Error loading the activity list",{error:t})}finally{this.loading=!1}},resetState(){this.loading=!0,this.error="",this.activities=[]},async loadRealActivities(){try{const{data:t}=await j.get(I("apps/activity/api/v2/activity/filter"),{params:{format:"json",object_type:"files",object_id:this.node.fileid}});return t.ocs.data}catch(t){if(t.response!==void 0&&t.response.status===304)return[];throw t}},processActivities(t){t=t.map(a=>new T(a)),f.debug(`Processed ${t.length} activity(ies)`,{activities:t,node:this.node});const e=W();return t.filter(a=>!e||e.every(n=>n(a)))},t:u}}),z={key:0,class:"activity__actions"},D={key:3,class:"activity__list"};function H(t,e,a,n,l,_){const d=o("NcIconSvgWrapper"),v=o("NcEmptyContent"),A=o("ActivitySidebarPlugin"),w=o("NcLoadingIcon"),S=o("ActivityComponent");return i(),s("div",{class:G([{"icon-loading":t.loading},"activity"])},[t.error||!t.node?(i(),r(v,{key:0,name:t.error},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s(g,{key:1},[t.sidebarPlugins.length>0?(i(),s("div",z,[(i(!0),s(g,null,h(t.sidebarPlugins,(c,m)=>(i(),r(A,{key:m,plugin:c,node:t.node,onReloadActivities:e[0]||(e[0]=J=>t.getActivities())},null,8,["plugin","node"]))),128))])):q("",!0),t.loading?(i(),r(v,{key:1,class:"activity__empty-content",name:t.t("activity","Loading activities")},{icon:p(()=>[y(w)]),_:1},8,["name"])):t.activities.length===0?(i(),r(v,{key:2,class:"activity__empty-content",name:t.t("activity","No activity yet")},{icon:p(()=>[y(d,{svg:t.lightningBoltSVG},null,8,["svg"])]),_:1},8,["name"])):(i(),s("ul",D,[(i(!0),s(g,null,h(t.activities,c=>(i(),r(S,{key:c.id,activity:c,"show-previews":!1,onReload:e[1]||(e[1]=m=>t.getActivities())},null,8,["activity"]))),128))]))],64))],2)}const at=x($,[["render",H],["__scopeId","data-v-b6867024"]]);export{at as default};
+//# sourceMappingURL=ActivityTab-BL6eDYHp.chunk.mjs.map
diff --git a/js/ActivityTab-CClb0nE0.chunk.mjs.license b/js/ActivityTab-BL6eDYHp.chunk.mjs.license
similarity index 100%
rename from js/ActivityTab-CClb0nE0.chunk.mjs.license
rename to js/ActivityTab-BL6eDYHp.chunk.mjs.license
diff --git a/js/ActivityTab-CClb0nE0.chunk.mjs.map b/js/ActivityTab-BL6eDYHp.chunk.mjs.map
similarity index 99%
rename from js/ActivityTab-CClb0nE0.chunk.mjs.map
rename to js/ActivityTab-BL6eDYHp.chunk.mjs.map
index c7291f63c..379bc7a50 100644
--- a/js/ActivityTab-CClb0nE0.chunk.mjs.map
+++ b/js/ActivityTab-BL6eDYHp.chunk.mjs.map
@@ -1 +1 @@
-{"version":3,"file":"ActivityTab-CClb0nE0.chunk.mjs","sources":["../src/components/ActivitySidebarPlugin.vue","../src/views/ActivityTab.vue"],"sourcesContent":["\n\n\n\t\n\n\n\n","\n\n\n\t
\n\n\n\n\n\n"],"names":["props","__props","emit","__emit","attachTarget","ref","onMounted","getCurrentInstance","onBeforeUnmount","_createElementBlock","ActivityTab","defineComponent","ActivityComponent","NcEmptyContent","NcIconSvgWrapper","NcLoadingIcon","ActivitySidebarPlugin","lightningBoltSVG","sidebarPlugins","getSidebarActions","nextTick","activities","otherEntries","getAdditionalEntries","a","b","error","t","logger","data","axios","generateOcsUrl","activity","ActivityModel","filters","getActivityFilters","filter","_normalizeClass","_ctx","_createBlock","_component_NcEmptyContent","_withCtx","_createVNode","_component_NcIconSvgWrapper","_Fragment","_openBlock","_hoisted_1","_renderList","plugin","index","_component_ActivitySidebarPlugin","_cache","_component_NcLoadingIcon","_hoisted_2","_component_ActivityComponent"],"mappings":"itBAeA,MAAMA,EAAQC,EASRC,EAAOC,EAIPC,EAAeC,EAAoB,EAEzC,OAAAC,EAAU,IAAMN,EAAM,OAAO,MAAMI,EAAa,MAAyB,CACxE,KAAMJ,EAAM,KACZ,QAASO,KAAsB,OAAS,OACxC,OAAQ,IAAML,EAAK,mBAAmB,CAAA,CACtC,CAAC,EACFM,EAAgB,IAAMR,EAAM,OAAO,QAAA,CAAS,cA7B3CS,EAA0B,MAAA,SAAjB,eAAJ,IAAIL,CAAA,gBCoEJM,EAAcC,EAAgB,CACnC,KAAM,cAEN,WAAY,CAAA,kBACXC,EACA,eAAAC,EACA,iBAAAC,EACA,cAAAC,EACAC,sBAAAA,CACD,EAEA,MAAO,CAIN,KAAM,CACL,KAAM,OACN,SAAU,EACX,EAMA,OAAQ,CACP,KAAM,OACN,SAAU,GACV,QAAS,MACV,EAMA,KAAM,CACL,KAAM,OACN,SAAU,GACV,QAAS,MAAA,CAEX,EAEA,OAAQ,CAAC,QAAQ,EAEjB,MAAO,CACC,MAAA,CACN,MAAO,GACP,QAAS,GACT,WAAY,CAAC,EACb,iBAAAC,EACA,eAAgB,CAAA,CACjB,CACD,EAEA,MAAO,CACN,KAAM,CACL,UAAW,GACX,MAAM,SAAU,CACf,MAAM,KAAK,OAAO,CAAA,CACnB,CAEF,EAEA,MAAM,SAAU,CACX,KAAK,MACR,MAAM,KAAK,OAAO,CAEpB,EAEA,QAAS,CAIR,MAAM,QAAS,CACd,KAAK,eAAiB,CAAC,EACvB,MAAMC,EAAiBC,EAAkB,EACrCD,EAAe,OAAS,GAC3BE,EAAS,IAAM,CACd,KAAK,eAAiBF,CAAA,CACtB,EAGF,KAAK,WAAW,EAChB,MAAM,KAAK,cAAc,CAC1B,EAKA,MAAM,eAAgB,CACjB,GAAA,CACH,KAAK,QAAU,GAEf,MAAMG,EAAa,MAAM,KAAK,kBAAkB,MAAM,KAAK,oBAAoB,EACzEC,EAAe,MAAMC,EAAqB,CAAE,KAAM,KAAK,KAAM,EACnE,KAAK,WAAa,CAAC,GAAGF,EAAY,GAAGC,CAAY,EAAE,KAAK,CAACE,EAAGC,IAAMA,EAAE,UAAYD,EAAE,SAAS,QACnFE,EAAO,CACV,KAAA,MAAQC,EAAE,WAAY,kCAAkC,EAC7DC,EAAO,MAAM,kCAAmC,CAAE,MAAAF,CAAA,CAAO,CAAA,QACxD,CACD,KAAK,QAAU,EAAA,CAEjB,EAKA,YAAa,CACZ,KAAK,QAAU,GACf,KAAK,MAAQ,GACb,KAAK,WAAa,CAAC,CACpB,EAKA,MAAM,oBAAqB,CACtB,GAAA,CACH,KAAM,CAAE,KAAAG,CAAA,EAAS,MAAMC,EAAM,IAC5BC,EAAe,sCAAsC,EACrD,CACC,OAAQ,CACP,OAAQ,OACR,YAAa,QACb,UAAW,KAAK,KAAK,MAAA,CACtB,CAEF,EACA,OAAOF,EAAK,IAAI,WACRH,EAAO,CAEf,GAAIA,EAAM,WAAa,QAAaA,EAAM,SAAS,SAAW,IAC7D,MAAO,CAAC,EAEH,MAAAA,CAAA,CAER,EAOA,kBAAkBL,EAA6B,CAC9CA,EAAaA,EAAW,IAAKW,GAAa,IAAIC,EAAcD,CAAQ,CAAC,EAErEJ,EAAO,MAAM,aAAaP,EAAW,MAAM,iBAAkB,CAC5D,WAAAA,EAAY,KAAM,KAAK,IAAA,CACvB,EAED,MAAMa,EAAUC,EAAmB,EACnC,OAAOd,EAAW,OAAQW,GAAa,CAACE,GAAWA,EAAQ,MAAOE,GAAWA,EAAOJ,CAAQ,CAAC,CAAC,CAC/F,EAEAL,EAAAA,CAAA,CAEF,CAAC,WApNwC,MAAM,8BA0BjC,MAAM,oLArCnBlB,EA8CM,MAAA,CA7CJ,MAAK4B,EAAA,CAAA,CAAA,eAAoBC,EAAO,OAAA,EAC3B,UAAU,CAAA,CAAA,EAAA,CAEMA,EAAK,OAAA,CAAKA,YAAhCC,EAIiBC,EAAA,CAAA,IAAA,EAJsB,KAAMF,EAAA,KAAA,EAAA,CACjC,KAAIG,EACd,IAA4C,CAA5CC,EAA4CC,EAAzB,CAAA,IAAKL,EAAgB,gBAAA,EAAA,KAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,yBAG1C7B,EAoCWmC,EAAA,CAAA,IAAA,GAAA,CAlCCN,EAAe,eAAA,OAAM,GAAhCO,EAAA,EAAApC,EAOM,MAPNqC,EAOM,EAAAD,EAAA,EAAA,EANLpC,EAKwCmC,EAAA,KAAAG,EAJbT,EAAc,eAAA,CAAhCU,EAAQC,SADjBV,EAKwCW,EAAA,CAHtC,IAAKD,EACL,OAAAD,EACA,KAAMV,EAAA,KACN,mBAAiBa,eAAEb,EAAa,cAAA,EAAA,EAAA,KAAA,EAAA,CAAA,SAAA,MAAA,CAAA,sBAK5BA,EAAA,SAAAO,IADPN,EAOiBC,EAAA,CAAA,IAAA,EALhB,MAAM,0BACL,KAAMF,EAAC,EAAA,WAAA,oBAAA,CAAA,EAAA,CACG,KAAIG,EACd,IAAiB,CAAjBC,EAAiBU,CAAA,CAAA,CAAA,oBAIPd,EAAW,WAAA,SAAM,OAD7BC,EAOiBC,EAAA,CAAA,IAAA,EALhB,MAAM,0BACL,KAAMF,EAAC,EAAA,WAAA,iBAAA,CAAA,EAAA,CACG,KAAIG,EACd,IAA4C,CAA5CC,EAA4CC,EAAzB,CAAA,IAAKL,EAAgB,gBAAA,EAAA,KAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,KAG1C,EAAA,EAAA,CAAA,MAAA,CAAA,IAAAO,EAAA,EAAApC,EAOK,KAPL4C,EAOK,EAAAR,EAAA,EAAA,EANJpC,EAK6BmC,EAAA,KAAAG,EAJTT,EAAU,WAAtBN,QADRO,EAK6Be,EAAA,CAH3B,IAAKtB,EAAS,GACd,SAAAA,EACA,gBAAe,GACf,SAAMmB,eAAEb,EAAa,cAAA,EAAA,EAAA,KAAA,EAAA,CAAA,UAAA,CAAA"}
\ No newline at end of file
+{"version":3,"file":"ActivityTab-BL6eDYHp.chunk.mjs","sources":["../src/components/ActivitySidebarPlugin.vue","../src/views/ActivityTab.vue"],"sourcesContent":["\n\n\n\t\n\n\n\n","\n\n\n\t