@plumile/ui 0.1.150 → 0.1.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/esm/admin/organisms/admin_sidebar/adminSidebar.css.js +2 -0
  2. package/lib/esm/atomic/atoms/textarea/textarea.css.js +0 -2
  3. package/lib/esm/atomic/molecules/markdown/components/MarkdownHeading.css.js +1 -0
  4. package/lib/esm/atomic/molecules/markdown/components/MarkdownSubscript.css.js +0 -1
  5. package/lib/esm/node_modules/es-toolkit/dist/_internal/globalThis.js.map +1 -1
  6. package/lib/esm/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js.map +1 -1
  7. package/lib/esm/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js.map +1 -1
  8. package/lib/esm/node_modules/es-toolkit/dist/compat/_internal/getTag.js.map +1 -1
  9. package/lib/esm/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js.map +1 -1
  10. package/lib/esm/node_modules/es-toolkit/dist/compat/_internal/tags.js.map +1 -1
  11. package/lib/esm/node_modules/es-toolkit/dist/compat/function/memoize.js.map +1 -1
  12. package/lib/esm/node_modules/es-toolkit/dist/compat/object/clone.js +4 -4
  13. package/lib/esm/node_modules/es-toolkit/dist/compat/object/clone.js.map +1 -1
  14. package/lib/esm/node_modules/es-toolkit/dist/compat/object/cloneDeep.js.map +1 -1
  15. package/lib/esm/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js.map +1 -1
  16. package/lib/esm/node_modules/es-toolkit/dist/compat/object/merge.js.map +1 -1
  17. package/lib/esm/node_modules/es-toolkit/dist/compat/object/mergeWith.js +19 -19
  18. package/lib/esm/node_modules/es-toolkit/dist/compat/object/mergeWith.js.map +1 -1
  19. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isArguments.js.map +1 -1
  20. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isArray.js.map +1 -1
  21. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js.map +1 -1
  22. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js.map +1 -1
  23. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js +6 -6
  24. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js.map +1 -1
  25. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js.map +1 -1
  26. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js.map +1 -1
  27. package/lib/esm/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js.map +1 -1
  28. package/lib/esm/node_modules/es-toolkit/dist/function/noop.js.map +1 -1
  29. package/lib/esm/node_modules/es-toolkit/dist/object/clone.js.map +1 -1
  30. package/lib/esm/node_modules/es-toolkit/dist/object/cloneDeepWith.js +75 -75
  31. package/lib/esm/node_modules/es-toolkit/dist/object/cloneDeepWith.js.map +1 -1
  32. package/lib/esm/node_modules/es-toolkit/dist/predicate/isBuffer.js.map +1 -1
  33. package/lib/esm/node_modules/es-toolkit/dist/predicate/isLength.js.map +1 -1
  34. package/lib/esm/node_modules/es-toolkit/dist/predicate/isPrimitive.js.map +1 -1
  35. package/lib/esm/node_modules/es-toolkit/dist/predicate/isTypedArray.js.map +1 -1
  36. package/lib/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js +51 -51
  37. package/lib/esm/node_modules/hast-util-to-jsx-runtime/lib/index.js.map +1 -1
  38. package/lib/esm/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-4H26LBE5.js.map +1 -1
  39. package/lib/esm/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +14 -14
  40. package/lib/esm/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js.map +1 -1
  41. package/lib/esm/node_modules/react-shiki/dist/{component-C5lsWZSq.js → component-CYq7SnJ0.js} +8 -9
  42. package/lib/esm/node_modules/react-shiki/dist/component-CYq7SnJ0.js.map +1 -0
  43. package/lib/esm/node_modules/react-shiki/dist/index.js +1 -1
  44. package/lib/esm/node_modules/react-shiki/dist/index.js.map +1 -1
  45. package/lib/esm/style.css +1 -1
  46. package/package.json +4 -4
  47. package/lib/esm/node_modules/react-shiki/dist/component-C5lsWZSq.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["commas","spaces","name","isIdentifierName"],"sources":["../../../../../../../node_modules/hast-util-to-jsx-runtime/lib/index.js"],"sourcesContent":["/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;mCAsBM,IAAM,CAAC,EAAE,gBAGT,oBAAW,IAAI,IAAI,GAEnB,IAAM,UAaN,IAAgB,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;CAAS;AAAI,CAAC,GAElE,IAAmB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,GAEvC,IAAO;AAcb,SAAgB,EAAa,GAAM,GAAS;CAC1C,IAAI,CAAC,KAAW,EAAQ,aAAa,KAAA,GACnC,MAAU,UAAU,gCAAgC;CAGtD,IAAM,IAAW,EAAQ,YAAY,KAAA,GAEjC;CAEJ,IAAI,EAAQ,aAAa;EACvB,IAAI,OAAO,EAAQ,UAAW,YAC5B,MAAU,UACR,uDACF;EAGF,IAAS,EAAkB,GAAU,EAAQ,MAAM;CACrD,OAAO;EACL,IAAI,OAAO,EAAQ,OAAQ,YACzB,MAAU,UAAU,sCAAsC;EAG5D,IAAI,OAAO,EAAQ,QAAS,YAC1B,MAAU,UAAU,uCAAuC;EAG7D,IAAS,EAAiB,GAAU,EAAQ,KAAK,EAAQ,IAAI;CAC/D;CAGA,IAAM,IAAQ;EACZ,UAAU,EAAQ;EAClB,WAAW,CAAC;EACZ,YAA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ACT;AAQA,SAAS,EAA0B,GAAM;CACvC,IAAI,IAAK,EAAK,QAAQ,GAAK,CAAM;CAGjC,OADI,EAAG,MAAM,GAAG,CAAC,MAAM,UAAO,IAAK,MAAM,IAClC;AACT;AAUA,SAAS,EAAO,GAAI;CAClB,OAAO,MAAM,EAAG,YAAY;AAC9B"}
1
+ {"version":3,"file":"index.js","names":["commas","spaces","name","isIdentifierName"],"sources":["../../../../../../../node_modules/hast-util-to-jsx-runtime/lib/index.js"],"sourcesContent":["/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;mCAsBM,IAAM,CAAC,EAAE,gBAGT,oBAAW,IAAI,IAAI,GAEnB,IAAM,UAaN,IAAgB,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;CAAS;AAAI,CAAC,GAElE,IAAmB,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;AAgB7C,SAAgB,EAAa,GAAM,GAAS;CAC1C,IAAI,CAAC,KAAW,EAAQ,aAAa,KAAA,GACnC,MAAU,UAAU,gCAAgC;CAGtD,IAAM,IAAW,EAAQ,YAAY,KAAA,GAEjC;CAEJ,IAAI,EAAQ,aAAa;EACvB,IAAI,OAAO,EAAQ,UAAW,YAC5B,MAAU,UACR,uDACF;EAGF,IAAS,EAAkB,GAAU,EAAQ,MAAM;CACrD,OAAO;EACL,IAAI,OAAO,EAAQ,OAAQ,YACzB,MAAU,UAAU,sCAAsC;EAG5D,IAAI,OAAO,EAAQ,QAAS,YAC1B,MAAU,UAAU,uCAAuC;EAG7D,IAAS,EAAiB,GAAU,EAAQ,KAAK,EAAQ,IAAI;CAC/D;CAGA,IAAM,IAAQ;EACZ,UAAU,EAAQ;EAClB,WAAW,CAAC;EACZ,YAAY,EAAQ,cAAc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CACvC,IAAI,IAAK,EAAK,QAAQ,GAAK,CAAM;CAGjC,OADI,EAAG,MAAM,GAAG,CAAC,MAAM,UAAO,IAAK,MAAM,IAClC;AACT;AAUA,SAAS,EAAO,GAAI;CAClB,OAAO,MAAM,EAAG,YAAY;AAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"pieDiagram-4H26LBE5.js","names":["d3pie","getConfig","arc","scaleOrdinal"],"sources":["../../../../../../../../../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-4H26LBE5.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge,\n parseFontSize\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n defaultConfig_default,\n getAccDescription,\n getAccTitle,\n getConfig2 as getConfig,\n getDiagramTitle,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/pie/pieParser.ts\nimport { parse } from \"@mermaid-js/parser\";\n\n// src/diagrams/pie/pieDb.ts\nvar DEFAULT_PIE_CONFIG = defaultConfig_default.pie;\nvar DEFAULT_PIE_DB = {\n sections: /* @__PURE__ */ new Map(),\n showData: false,\n config: DEFAULT_PIE_CONFIG\n};\nvar sections = DEFAULT_PIE_DB.sections;\nvar showData = DEFAULT_PIE_DB.showData;\nvar config = structuredClone(DEFAULT_PIE_CONFIG);\nvar getConfig2 = /* @__PURE__ */ __name(() => structuredClone(config), \"getConfig\");\nvar clear2 = /* @__PURE__ */ __name(() => {\n sections = /* @__PURE__ */ new Map();\n showData = DEFAULT_PIE_DB.showData;\n clear();\n}, \"clear\");\nvar addSection = /* @__PURE__ */ __name(({ label, value }) => {\n if (value < 0) {\n throw new Error(\n `\"${label}\" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`\n );\n }\n if (!sections.has(label)) {\n sections.set(label, value);\n log.debug(`added new section: ${label}, with value: ${value}`);\n }\n}, \"addSection\");\nvar getSections = /* @__PURE__ */ __name(() => sections, \"getSections\");\nvar setShowData = /* @__PURE__ */ __name((toggle) => {\n showData = toggle;\n}, \"setShowData\");\nvar getShowData = /* @__PURE__ */ __name(() => showData, \"getShowData\");\nvar db = {\n getConfig: getConfig2,\n clear: clear2,\n setDiagramTitle,\n getDiagramTitle,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n addSection,\n getSections,\n setShowData,\n getShowData\n};\n\n// src/diagrams/pie/pieParser.ts\nvar populateDb = /* @__PURE__ */ __name((ast, db2) => {\n populateCommonDb(ast, db2);\n db2.setShowData(ast.showData);\n ast.sections.map(db2.addSection);\n}, \"populateDb\");\nvar parser = {\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"pie\", input);\n log.debug(ast);\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/pie/pieStyles.ts\nvar getStyles = /* @__PURE__ */ __name((options) => `\n .pieCircle{\n stroke: ${options.pieStrokeColor};\n stroke-width : ${options.pieStrokeWidth};\n opacity : ${options.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${options.pieOuterStrokeColor};\n stroke-width: ${options.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${options.pieTitleTextSize};\n fill: ${options.pieTitleTextColor};\n font-family: ${options.fontFamily};\n }\n .slice {\n font-family: ${options.fontFamily};\n fill: ${options.pieSectionTextColor};\n font-size:${options.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${options.pieLegendTextColor};\n font-family: ${options.fontFamily};\n font-size: ${options.pieLegendTextSize};\n }\n`, \"getStyles\");\nvar pieStyles_default = getStyles;\n\n// src/diagrams/pie/pieRenderer.ts\nimport { arc, pie as d3pie, scaleOrdinal } from \"d3\";\nvar createPieArcs = /* @__PURE__ */ __name((sections2) => {\n const sum = [...sections2.values()].reduce((acc, val) => acc + val, 0);\n const pieData = [...sections2.entries()].map(([label, value]) => ({ label, value })).filter((d) => d.value / sum * 100 >= 1);\n const pie = d3pie().value((d) => d.value).sort(null);\n return pie(pieData);\n}, \"createPieArcs\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"rendering pie chart\\n\" + text);\n const db2 = diagObj.db;\n const globalConfig = getConfig();\n const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie);\n const MARGIN = 40;\n const LEGEND_RECT_SIZE = 18;\n const LEGEND_SPACING = 4;\n const height = 450;\n const pieWidth = height;\n const svg = selectSvgElement(id);\n const group = svg.append(\"g\");\n group.attr(\"transform\", \"translate(\" + pieWidth / 2 + \",\" + height / 2 + \")\");\n const { themeVariables } = globalConfig;\n let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);\n outerStrokeWidth ??= 2;\n const textPosition = pieConfig.textPosition;\n const radius = Math.min(pieWidth, height) / 2 - MARGIN;\n const arcGenerator = arc().innerRadius(0).outerRadius(radius);\n const labelArcGenerator = arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition);\n group.append(\"circle\").attr(\"cx\", 0).attr(\"cy\", 0).attr(\"r\", radius + outerStrokeWidth / 2).attr(\"class\", \"pieOuterCircle\");\n const sections2 = db2.getSections();\n const arcs = createPieArcs(sections2);\n const myGeneratedColors = [\n themeVariables.pie1,\n themeVariables.pie2,\n themeVariables.pie3,\n themeVariables.pie4,\n themeVariables.pie5,\n themeVariables.pie6,\n themeVariables.pie7,\n themeVariables.pie8,\n themeVariables.pie9,\n themeVariables.pie10,\n themeVariables.pie11,\n themeVariables.pie12\n ];\n let sum = 0;\n sections2.forEach((section) => {\n sum += section;\n });\n const filteredArcs = arcs.filter((datum) => (datum.data.value / sum * 100).toFixed(0) !== \"0\");\n const color = scaleOrdinal(myGeneratedColors).domain([\n ...sections2.keys()\n ]);\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"path\").attr(\"d\", arcGenerator).attr(\"fill\", (datum) => {\n return color(datum.data.label);\n }).attr(\"class\", \"pieCircle\");\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"text\").text((datum) => {\n return (datum.data.value / sum * 100).toFixed(0) + \"%\";\n }).attr(\"transform\", (datum) => {\n return \"translate(\" + labelArcGenerator.centroid(datum) + \")\";\n }).style(\"text-anchor\", \"middle\").attr(\"class\", \"slice\");\n const titleText = group.append(\"text\").text(db2.getDiagramTitle()).attr(\"x\", 0).attr(\"y\", -(height - 50) / 2).attr(\"class\", \"pieTitleText\");\n const allSectionData = [...sections2.entries()].map(([label, value]) => ({\n label,\n value\n }));\n const legend = group.selectAll(\".legend\").data(allSectionData).enter().append(\"g\").attr(\"class\", \"legend\").attr(\"transform\", (_datum, index) => {\n const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING;\n const offset = height2 * allSectionData.length / 2;\n const horizontal = 12 * LEGEND_RECT_SIZE;\n const vertical = index * height2 - offset;\n return \"translate(\" + horizontal + \",\" + vertical + \")\";\n });\n legend.append(\"rect\").attr(\"width\", LEGEND_RECT_SIZE).attr(\"height\", LEGEND_RECT_SIZE).style(\"fill\", (d) => color(d.label)).style(\"stroke\", (d) => color(d.label));\n legend.append(\"text\").attr(\"x\", LEGEND_RECT_SIZE + LEGEND_SPACING).attr(\"y\", LEGEND_RECT_SIZE - LEGEND_SPACING).text((d) => {\n if (db2.getShowData()) {\n return `${d.label} [${d.value}]`;\n }\n return d.label;\n });\n const longestTextWidth = Math.max(\n ...legend.selectAll(\"text\").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)\n );\n const chartAndLegendWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n const titleWidth = titleText.node()?.getBoundingClientRect().width ?? 0;\n const titleLeft = pieWidth / 2 - titleWidth / 2;\n const titleRight = pieWidth / 2 + titleWidth / 2;\n const viewBoxX = Math.min(0, titleLeft);\n const viewBoxRight = Math.max(chartAndLegendWidth, titleRight);\n const totalWidth = viewBoxRight - viewBoxX;\n svg.attr(\"viewBox\", `${viewBoxX} 0 ${totalWidth} ${height}`);\n configureSvgSize(svg, height, totalWidth, pieConfig.useMaxWidth);\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/pie/pieDiagram.ts\nvar diagram = {\n parser,\n db,\n renderer,\n styles: pieStyles_default\n};\nexport {\n diagram\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AA+BA,IAAI,IAAqB,EAAsB,KAC3C,IAAiB;CACnB,0BAA0B,IAAI,IAAI;CAClC,UAAU;CACV,QAAQ;AACV,GACI,IAAW,EAAe,UAC1B,IAAW,EAAe,UAC1B,IAAS,gBAAgB,CAAkB,GAuB3C,IAAK;CACP,WAvB+B,wBAAa,gBAAgB,CAAM,GAAG,WAuBjD;CACpB,OAvB2B,wBAAa;EAGxC,AAFA,oBAA2B,IAAI,IAAI,GACnC,IAAW,EAAe,UAC1B,EAAM;CACR,GAAG,OAmBW;CACZ;CACA;CACA;CACA;CACA;CACA;CACA,YAzB+B,mBAAQ,EAAE,UAAO,eAAY;EAC5D,IAAI,IAAQ,GACV,MAAU,MACR,IAAI,EAAM,uBAAuB,EAAM,gFACzC;EAEF,AAAK,EAAS,IAAI,CAAK,MACrB,EAAS,IAAI,GAAO,CAAK,GACzB,EAAI,MAAM,sBAAsB,EAAM,gBAAgB,GAAO;CAEjE,GAAG,YAeQ;CACT,aAfgC,wBAAa,GAAU,aAe7C;CACV,aAfgC,mBAAQ,MAAW;EACnD,IAAW;CACb,GAAG,aAaS;CACV,aAbgC,wBAAa,GAAU,aAa7C;AACZ,GAGI,IAA6B,mBAAQ,GAAK,MAAQ;CAGpD,AAFA,EAAiB,GAAK,CAAG,GACzB,EAAI,YAAY,EAAI,QAAQ,GAC5B,EAAI,SAAS,IAAI,EAAI,UAAU;AACjC,GAAG,YAAY,GACX,IAAS,EACX,O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,"file":"pieDiagram-4H26LBE5.js","names":["d3pie","getConfig","arc","scaleOrdinal"],"sources":["../../../../../../../../../node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-4H26LBE5.mjs"],"sourcesContent":["import {\n selectSvgElement\n} from \"./chunk-WU5MYG2G.mjs\";\nimport {\n populateCommonDb\n} from \"./chunk-4BX2VUAB.mjs\";\nimport {\n cleanAndMerge,\n parseFontSize\n} from \"./chunk-5ZQYHXKU.mjs\";\nimport {\n clear,\n configureSvgSize,\n defaultConfig_default,\n getAccDescription,\n getAccTitle,\n getConfig2 as getConfig,\n getDiagramTitle,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-CSCIHK7Q.mjs\";\nimport {\n __name,\n log\n} from \"./chunk-AGHRB4JF.mjs\";\n\n// src/diagrams/pie/pieParser.ts\nimport { parse } from \"@mermaid-js/parser\";\n\n// src/diagrams/pie/pieDb.ts\nvar DEFAULT_PIE_CONFIG = defaultConfig_default.pie;\nvar DEFAULT_PIE_DB = {\n sections: /* @__PURE__ */ new Map(),\n showData: false,\n config: DEFAULT_PIE_CONFIG\n};\nvar sections = DEFAULT_PIE_DB.sections;\nvar showData = DEFAULT_PIE_DB.showData;\nvar config = structuredClone(DEFAULT_PIE_CONFIG);\nvar getConfig2 = /* @__PURE__ */ __name(() => structuredClone(config), \"getConfig\");\nvar clear2 = /* @__PURE__ */ __name(() => {\n sections = /* @__PURE__ */ new Map();\n showData = DEFAULT_PIE_DB.showData;\n clear();\n}, \"clear\");\nvar addSection = /* @__PURE__ */ __name(({ label, value }) => {\n if (value < 0) {\n throw new Error(\n `\"${label}\" has invalid value: ${value}. Negative values are not allowed in pie charts. All slice values must be >= 0.`\n );\n }\n if (!sections.has(label)) {\n sections.set(label, value);\n log.debug(`added new section: ${label}, with value: ${value}`);\n }\n}, \"addSection\");\nvar getSections = /* @__PURE__ */ __name(() => sections, \"getSections\");\nvar setShowData = /* @__PURE__ */ __name((toggle) => {\n showData = toggle;\n}, \"setShowData\");\nvar getShowData = /* @__PURE__ */ __name(() => showData, \"getShowData\");\nvar db = {\n getConfig: getConfig2,\n clear: clear2,\n setDiagramTitle,\n getDiagramTitle,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n addSection,\n getSections,\n setShowData,\n getShowData\n};\n\n// src/diagrams/pie/pieParser.ts\nvar populateDb = /* @__PURE__ */ __name((ast, db2) => {\n populateCommonDb(ast, db2);\n db2.setShowData(ast.showData);\n ast.sections.map(db2.addSection);\n}, \"populateDb\");\nvar parser = {\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"pie\", input);\n log.debug(ast);\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/pie/pieStyles.ts\nvar getStyles = /* @__PURE__ */ __name((options) => `\n .pieCircle{\n stroke: ${options.pieStrokeColor};\n stroke-width : ${options.pieStrokeWidth};\n opacity : ${options.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${options.pieOuterStrokeColor};\n stroke-width: ${options.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${options.pieTitleTextSize};\n fill: ${options.pieTitleTextColor};\n font-family: ${options.fontFamily};\n }\n .slice {\n font-family: ${options.fontFamily};\n fill: ${options.pieSectionTextColor};\n font-size:${options.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${options.pieLegendTextColor};\n font-family: ${options.fontFamily};\n font-size: ${options.pieLegendTextSize};\n }\n`, \"getStyles\");\nvar pieStyles_default = getStyles;\n\n// src/diagrams/pie/pieRenderer.ts\nimport { arc, pie as d3pie, scaleOrdinal } from \"d3\";\nvar createPieArcs = /* @__PURE__ */ __name((sections2) => {\n const sum = [...sections2.values()].reduce((acc, val) => acc + val, 0);\n const pieData = [...sections2.entries()].map(([label, value]) => ({ label, value })).filter((d) => d.value / sum * 100 >= 1);\n const pie = d3pie().value((d) => d.value).sort(null);\n return pie(pieData);\n}, \"createPieArcs\");\nvar draw = /* @__PURE__ */ __name((text, id, _version, diagObj) => {\n log.debug(\"rendering pie chart\\n\" + text);\n const db2 = diagObj.db;\n const globalConfig = getConfig();\n const pieConfig = cleanAndMerge(db2.getConfig(), globalConfig.pie);\n const MARGIN = 40;\n const LEGEND_RECT_SIZE = 18;\n const LEGEND_SPACING = 4;\n const height = 450;\n const pieWidth = height;\n const svg = selectSvgElement(id);\n const group = svg.append(\"g\");\n group.attr(\"transform\", \"translate(\" + pieWidth / 2 + \",\" + height / 2 + \")\");\n const { themeVariables } = globalConfig;\n let [outerStrokeWidth] = parseFontSize(themeVariables.pieOuterStrokeWidth);\n outerStrokeWidth ??= 2;\n const textPosition = pieConfig.textPosition;\n const radius = Math.min(pieWidth, height) / 2 - MARGIN;\n const arcGenerator = arc().innerRadius(0).outerRadius(radius);\n const labelArcGenerator = arc().innerRadius(radius * textPosition).outerRadius(radius * textPosition);\n group.append(\"circle\").attr(\"cx\", 0).attr(\"cy\", 0).attr(\"r\", radius + outerStrokeWidth / 2).attr(\"class\", \"pieOuterCircle\");\n const sections2 = db2.getSections();\n const arcs = createPieArcs(sections2);\n const myGeneratedColors = [\n themeVariables.pie1,\n themeVariables.pie2,\n themeVariables.pie3,\n themeVariables.pie4,\n themeVariables.pie5,\n themeVariables.pie6,\n themeVariables.pie7,\n themeVariables.pie8,\n themeVariables.pie9,\n themeVariables.pie10,\n themeVariables.pie11,\n themeVariables.pie12\n ];\n let sum = 0;\n sections2.forEach((section) => {\n sum += section;\n });\n const filteredArcs = arcs.filter((datum) => (datum.data.value / sum * 100).toFixed(0) !== \"0\");\n const color = scaleOrdinal(myGeneratedColors).domain([\n ...sections2.keys()\n ]);\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"path\").attr(\"d\", arcGenerator).attr(\"fill\", (datum) => {\n return color(datum.data.label);\n }).attr(\"class\", \"pieCircle\");\n group.selectAll(\"mySlices\").data(filteredArcs).enter().append(\"text\").text((datum) => {\n return (datum.data.value / sum * 100).toFixed(0) + \"%\";\n }).attr(\"transform\", (datum) => {\n return \"translate(\" + labelArcGenerator.centroid(datum) + \")\";\n }).style(\"text-anchor\", \"middle\").attr(\"class\", \"slice\");\n const titleText = group.append(\"text\").text(db2.getDiagramTitle()).attr(\"x\", 0).attr(\"y\", -(height - 50) / 2).attr(\"class\", \"pieTitleText\");\n const allSectionData = [...sections2.entries()].map(([label, value]) => ({\n label,\n value\n }));\n const legend = group.selectAll(\".legend\").data(allSectionData).enter().append(\"g\").attr(\"class\", \"legend\").attr(\"transform\", (_datum, index) => {\n const height2 = LEGEND_RECT_SIZE + LEGEND_SPACING;\n const offset = height2 * allSectionData.length / 2;\n const horizontal = 12 * LEGEND_RECT_SIZE;\n const vertical = index * height2 - offset;\n return \"translate(\" + horizontal + \",\" + vertical + \")\";\n });\n legend.append(\"rect\").attr(\"width\", LEGEND_RECT_SIZE).attr(\"height\", LEGEND_RECT_SIZE).style(\"fill\", (d) => color(d.label)).style(\"stroke\", (d) => color(d.label));\n legend.append(\"text\").attr(\"x\", LEGEND_RECT_SIZE + LEGEND_SPACING).attr(\"y\", LEGEND_RECT_SIZE - LEGEND_SPACING).text((d) => {\n if (db2.getShowData()) {\n return `${d.label} [${d.value}]`;\n }\n return d.label;\n });\n const longestTextWidth = Math.max(\n ...legend.selectAll(\"text\").nodes().map((node) => node?.getBoundingClientRect().width ?? 0)\n );\n const chartAndLegendWidth = pieWidth + MARGIN + LEGEND_RECT_SIZE + LEGEND_SPACING + longestTextWidth;\n const titleWidth = titleText.node()?.getBoundingClientRect().width ?? 0;\n const titleLeft = pieWidth / 2 - titleWidth / 2;\n const titleRight = pieWidth / 2 + titleWidth / 2;\n const viewBoxX = Math.min(0, titleLeft);\n const viewBoxRight = Math.max(chartAndLegendWidth, titleRight);\n const totalWidth = viewBoxRight - viewBoxX;\n svg.attr(\"viewBox\", `${viewBoxX} 0 ${totalWidth} ${height}`);\n configureSvgSize(svg, height, totalWidth, pieConfig.useMaxWidth);\n}, \"draw\");\nvar renderer = { draw };\n\n// src/diagrams/pie/pieDiagram.ts\nvar diagram = {\n parser,\n db,\n renderer,\n styles: pieStyles_default\n};\nexport {\n diagram\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AA+BA,IAAI,IAAqB,EAAsB,KAC3C,IAAiB;CACnB,0BAA0B,IAAI,IAAI;CAClC,UAAU;CACV,QAAQ;AACV,GACI,IAAW,EAAe,UAC1B,IAAW,EAAe,UAC1B,IAAS,gBAAgB,CAAkB,GAuB3C,IAAK;CACP,WAvB+B,wBAAa,gBAAgB,CAAM,GAAG,WAuBjD;CACpB,OAvB2B,wBAAa;EAGxC,AAFA,oBAA2B,IAAI,IAAI,GACnC,IAAW,EAAe,UAC1B,EAAM;CACR,GAAG,OAmBW;CACZ;CACA;CACA;CACA;CACA;CACA;CACA,YAzB+B,mBAAQ,EAAE,UAAO,eAAY;EAC5D,IAAI,IAAQ,GACV,MAAU,MACR,IAAI,EAAM,uBAAuB,EAAM,gFACzC;EAEF,AAAK,EAAS,IAAI,CAAK,MACrB,EAAS,IAAI,GAAO,CAAK,GACzB,EAAI,MAAM,sBAAsB,EAAM,gBAAgB,GAAO;CAEjE,GAAG,YAeQ;CACT,aAfgC,wBAAa,GAAU,aAe7C;CACV,aAfgC,mBAAQ,MAAW;EACnD,IAAW;CACb,GAAG,aAaS;CACV,aAbgC,wBAAa,GAAU,aAa7C;AACZ,GAGI,IAA6B,mBAAQ,GAAK,MAAQ;CAGpD,AAFA,EAAiB,GAAK,CAAG,GACzB,EAAI,YAAY,EAAI,QAAQ,GAC5B,EAAI,SAAS,IAAI,EAAI,UAAU;AACjC,GAAG,YAAY,GACX,IAAS,EACX,OAAuB,kBAAO,OAAO,MAAU;CAC7C,IAAM,IAAM,MAAM,EAAM,OAAO,CAAK;CAEpC,AADA,EAAI,MAAM,CAAG,GACb,EAAW,GAAK,CAAE;AACpB,GAAG,OAAO,EACZ,GAgCI,IA7B4B,mBAAQ,MAAY;;cAEtC,EAAQ,eAAe;qBACh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AS,EAAM,UAAU,SAAS,EAAE,KAAK,CAAc,EAAE,MAAM,EAAE,OAAO,GAAG,EAAE,KAAK,SAAS,QAAQ,EAAE,KAAK,cAAc,GAAQ,MAAU;GAC9I,IACM,IAAS,KAAU,EAAe,SAAS;GAGjD,OAAO,oBADU,IAAQ,KAAU,KACiB;EACtD,CAAC;EAED,AADA,EAAO,OAAO,MAAM,EAAE,KAAK,SAAS,EAAgB,EAAE,KAAK,UAAU,EAAgB,EAAE,MAAM,SAAS,MAAM,EAAM,EAAE,KAAK,CAAC,EAAE,MAAM,WAAW,MAAM,EAAM,EAAE,KAAK,CAAC,GACjK,EAAO,OAAO,MAAM,EAAE,KAAK,KAAK,EAAiC,EAAE,KAAK,KAAK,EAAiC,EAAE,MAAM,MAChH,EAAI,YAAY,IACX,GAAG,EAAE,MAAM,IAAI,EAAE,MAAM,KAEzB,EAAE,KACV;EAID,IAAM,IAAsB,MAHH,KAAK,IAC5B,GAAG,EAAO,UAAU,MAAM,EAAE,MAAM,EAAE,KAAK,MAAS,GAAM,sBAAsB,EAAE,SAAS,CAAC,CAEO,GAC7F,IAAa,EAAU,KAAK,GAAG,sBAAsB,EAAE,SAAS,GAChE,IAAY,MAAW,IAAI,IAAa,GACxC,IAAa,MAAW,IAAI,IAAa,GACzC,IAAW,KAAK,IAAI,GAAG,CAAS,GAEhC,IADe,KAAK,IAAI,GAAqB,CACrB,IAAI;EAElC,AADA,EAAI,KAAK,WAAW,GAAG,EAAS,KAAK,EAAW,KAAW,GAC3D,EAAiB,GAAK,KAAQ,GAAY,EAAU,WAAW;CACjE,GAAG,MACiB,EAMX;CACP,QAAQ;AACV"}
@@ -3595,32 +3595,32 @@ var F = P, I = {
3595
3595
  let s = p(o.text) ? await oe(i, o) : G(i, o), c = Math.round(s.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
3596
3596
  a.attr("height", c + 2 * Z.noteMargin), t.height += c + 2 * Z.noteMargin, Q.bumpVerticalPos(c + 2 * Z.noteMargin), t.stopy = t.starty + c + 2 * Z.noteMargin, t.stopx = t.startx + r.width, Q.insert(t.startx, t.starty, t.stopx, t.stopy), Q.models.addNote(t);
3597
3597
  }, "drawNote"), Ne = /* @__PURE__ */ e(function(t, n, r, i, a, o, s) {
3598
- let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = tt(n, i), g = t.append("g"), _ = 16.5, v = /* @__PURE__ */ e((e, t) => {
3599
- let n = e ? _ : -_;
3598
+ let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = tt(n, i), g = t.append("g"), _ = /* @__PURE__ */ e((e, t) => {
3599
+ let n = e ? 16.5 : -16.5;
3600
3600
  return t ? -n : n;
3601
- }, "getCircleOffset"), y = /* @__PURE__ */ e((e) => {
3601
+ }, "getCircleOffset"), v = /* @__PURE__ */ e((e) => {
3602
3602
  g.append("circle").attr("cx", e).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
3603
- }, "drawCircle"), { CENTRAL_CONNECTION: b, CENTRAL_CONNECTION_REVERSE: x, CENTRAL_CONNECTION_DUAL: S } = i.db.LINETYPE;
3603
+ }, "drawCircle"), { CENTRAL_CONNECTION: y, CENTRAL_CONNECTION_REVERSE: b, CENTRAL_CONNECTION_DUAL: x } = i.db.LINETYPE;
3604
3604
  if (d) switch (n.centralConnection) {
3605
+ case y:
3606
+ h && (p += _(m, !0));
3607
+ break;
3605
3608
  case b:
3606
- h && (p += v(m, !0));
3609
+ h || (f += _(m, !1));
3607
3610
  break;
3608
3611
  case x:
3609
- h || (f += v(m, !1));
3610
- break;
3611
- case S:
3612
- h ? p += v(m, !0) : f += v(m, !1);
3612
+ h ? p += _(m, !0) : f += _(m, !1);
3613
3613
  break;
3614
3614
  }
3615
3615
  switch (n.centralConnection) {
3616
+ case y:
3617
+ v(p);
3618
+ break;
3616
3619
  case b:
3617
- y(p);
3620
+ v(f);
3618
3621
  break;
3619
3622
  case x:
3620
- y(f);
3621
- break;
3622
- case S:
3623
- y(f), y(p);
3623
+ v(f), v(p);
3624
3624
  break;
3625
3625
  }
3626
3626
  }, "drawCentralConnection"), Pe = /* @__PURE__ */ e((e) => ({