diff --git a/.agents/skills/agent-core-dev/flags.md b/.agents/skills/agent-core-dev/flags.md index 60349fa73..e824699ca 100644 --- a/.agents/skills/agent-core-dev/flags.md +++ b/.agents/skills/agent-core-dev/flags.md @@ -24,9 +24,9 @@ Gate not-yet-public features behind `IFlagService.enabled(id)`, per the reposito Highest wins; env is read live on every call (nothing cached): -1. Per-feature `def.env` (e.g. `KIMI_CODE_EXPERIMENTAL_MY_FEATURE`) → forces on/off. -2. `[experimental]` config section per-flag override. -3. Master env `KIMI_CODE_EXPERIMENTAL_FLAG` truthy → every flag on. +1. Master env `KIMI_CODE_EXPERIMENTAL_FLAG` truthy → every flag on. +2. Per-feature `def.env` (e.g. `KIMI_CODE_EXPERIMENTAL_MY_FEATURE`) → forces on/off. +3. `[experimental]` config section per-flag override. 4. Registry `default`. `explain(id)` returns the winning `source` (`master-env` | `env` | `config` | `default`) plus the effective `configValue`. `explain(id)` returns `undefined` (and `enabled(id)` returns `false`) for an id that no domain has registered. diff --git a/.agents/skills/agent-core-dev/orient.md b/.agents/skills/agent-core-dev/orient.md index 8fe8dae31..8a50152ff 100644 --- a/.agents/skills/agent-core-dev/orient.md +++ b/.agents/skills/agent-core-dev/orient.md @@ -68,10 +68,10 @@ There is no domain-layer numbering — a domain may import any other domain, gui ## Comment convention -`packages/agent-core-v2/AGENTS.md` bans comments entirely: no file headers, no section banners, no statement-level narration, no JSDoc (not even on exported symbols) — the code is the source of truth. The only exception is a load-bearing lint-suppression directive (`oxlint-disable` / `eslint-disable`) for a deliberate pattern; other tooling directives (`@ts-expect-error`, …) are banned: fix the underlying lint/type problem instead, and put negative type-safety cases in compiler-asserted fixtures. Scope is carried by the filename: `workspace*.ts` = Workspace, `session*.ts` = Session, `agent*.ts` = Agent, no prefix = App (see service-authoring.md). +`packages/agent-core-v2/AGENTS.md` bans comments: no file headers, no section banners, no statement-level narration — the code is the source of truth. The only exception is JSDoc attached to exported symbols, which flows into the generated `.d.ts` and the consumers' IDE hover. Tooling directives (`eslint-disable`, `@ts-expect-error`, …) are banned too: fix the underlying lint/type problem instead, and put negative type-safety cases in compiler-asserted fixtures. Scope is carried by the filename: `workspace*.ts` = Workspace, `session*.ts` = Session, `agent*.ts` = Agent, no prefix = App (see service-authoring.md). ## Red lines (this stage) - Import via the `#/...` alias (mapped to `src/`); never reach into another domain's internals by relative path. - Short-lived may inject long-lived; never the reverse. -- No comments — not file headers, not beside statements, no JSDoc anywhere; `oxlint-disable` / `eslint-disable` are the only exception. +- No comments — not file headers, not beside statements; exported-symbol JSDoc is the only exception. diff --git a/.agents/skills/agent-core-dev/service-authoring.md b/.agents/skills/agent-core-dev/service-authoring.md index b562984d9..0648e17e6 100644 --- a/.agents/skills/agent-core-dev/service-authoring.md +++ b/.agents/skills/agent-core-dev/service-authoring.md @@ -296,8 +296,9 @@ Importing the package therefore fires every `register*` side effect, exactly as ## Comments -- **No comments** (orient.md): no file headers, no statement-level narration, no JSDoc — not on exported symbols either; the only exception is a load-bearing `oxlint-disable` / `eslint-disable` directive. -- **Methods and fields carry no comments.** Well-named identifiers and types say *what*; the code is the source of truth for *how*. +- **No comments** (orient.md): no file headers, no statement-level narration; the only exception is JSDoc attached to exported symbols. +- **Methods and fields carry no comments by default.** Well-named identifiers and types say *what*; the code is the source of truth for *how*. +- Write an inline comment only when the *why* is non-obvious (a hidden constraint, a subtle invariant, a workaround). One short line. - For unimplemented stubs, throw `NotImplementedError('feature')` rather than `throw new Error('TODO: …')` (errors.md). ## Complete minimal example diff --git a/.agents/skills/agent-core-dev/verify.md b/.agents/skills/agent-core-dev/verify.md index 8926b052d..41203e980 100644 --- a/.agents/skills/agent-core-dev/verify.md +++ b/.agents/skills/agent-core-dev/verify.md @@ -21,7 +21,7 @@ Walk the stages you touched and confirm: - **Design** — scope follows state identity; no `Map` at `App`; dependency arrows do not make a foundational layer know an upstream one; no cycle was routed around. - **Implement** — no `new` on `@IService`-carrying classes; `@IX` on constructor params only (service params after static params); interface + impl carry `_serviceBrand`; decorator names unique; coded errors only; flags for unreleased behavior. - **Test** — SUT resolved by interface; stubs under `test/`; scope tests re-register after `_clearScopedRegistryForTests()`; teardown through one `DisposableStore`. -- **Files** — no comments at all (no JSDoc either; only load-bearing `oxlint-disable` / `eslint-disable` survive); registration runs from the impl file's top level; the new domain is exported from `src/index.ts`. +- **Files** — no comments (exported-symbol JSDoc excepted); registration runs from the impl file's top level; the new domain is exported from `src/index.ts`. Then re-read the [global red lines](SKILL.md#global-red-lines) once — they catch most cross-stage mistakes in a single scan. diff --git a/.changeset/README.md b/.changeset/README.md index 88fa0f789..9948385c3 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -15,6 +15,7 @@ Current publishable packages: All other workspace packages are private internal packages, are not published to npm, and are excluded via `ignore` in `.changeset/config.json`: +- `@moonshot-ai/acp-adapter` - `@moonshot-ai/agent-core` - `@moonshot-ai/kaos` - `@moonshot-ai/kimi-code-oauth` diff --git a/.changeset/bash-cwd-workspace-restriction.md b/.changeset/bash-cwd-workspace-restriction.md deleted file mode 100644 index 22209b064..000000000 --- a/.changeset/bash-cwd-workspace-restriction.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Remove the workspace restriction on the Bash tool's cwd parameter. diff --git a/.changeset/config-toml-writeback-preservation.md b/.changeset/config-toml-writeback-preservation.md deleted file mode 100644 index ea323c8a4..000000000 --- a/.changeset/config-toml-writeback-preservation.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Preserve comments, key order, and formatting in config.toml when configuration values are updated. diff --git a/.changeset/config-torn-read-guard.md b/.changeset/config-torn-read-guard.md deleted file mode 100644 index 740ae0fde..000000000 --- a/.changeset/config-torn-read-guard.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Fix models and providers transiently disappearing when config.toml is saved non-atomically by an external editor while the daemon reloads it. diff --git a/.changeset/dangerous-command-ask.md b/.changeset/dangerous-command-ask.md deleted file mode 100644 index c9b6c6167..000000000 --- a/.changeset/dangerous-command-ask.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Block dangerous shell commands such as shutdown, reboot, or rm -rf in Auto mode, and always ask before running them in Manual and YOLO modes; disable the guard with `[permission] dangerous_command_guard = false` or `KIMI_CODE_DANGEROUS_COMMAND_GUARD=false`. diff --git a/.changeset/fast-session-fork.md b/.changeset/fast-session-fork.md deleted file mode 100644 index d61d1d69f..000000000 --- a/.changeset/fast-session-fork.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Make session forks much faster. diff --git a/.changeset/fix-turn-prompt-identity.md b/.changeset/fix-turn-prompt-identity.md deleted file mode 100644 index 6eaaa3bb2..000000000 --- a/.changeset/fix-turn-prompt-identity.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Fix duplicate user messages in transcript clients. diff --git a/.changeset/flag-config-over-master-env.md b/.changeset/flag-config-over-master-env.md deleted file mode 100644 index 468827476..000000000 --- a/.changeset/flag-config-over-master-env.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Honor explicit `[experimental]` config entries over the `KIMI_CODE_EXPERIMENTAL_FLAG` master switch, so a flag set to `false` in `config.toml` stays off; per-feature `KIMI_CODE_EXPERIMENTAL_` variables still override both. diff --git a/.changeset/fork-context-notice-reminder.md b/.changeset/fork-context-notice-reminder.md deleted file mode 100644 index 580f33724..000000000 --- a/.changeset/fork-context-notice-reminder.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Send the forked-subagent context notice as a system reminder. diff --git a/.changeset/git-status-quoted-paths.md b/.changeset/git-status-quoted-paths.md deleted file mode 100644 index 5b4eb5917..000000000 --- a/.changeset/git-status-quoted-paths.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Parse `git status --porcelain` with `-z` so non-ASCII paths are no longer mangled into bogus quoted directory segments. diff --git a/.changeset/olive-pandas-swim.md b/.changeset/olive-pandas-swim.md deleted file mode 100644 index 6c84e8fc9..000000000 --- a/.changeset/olive-pandas-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": minor ---- - -The `kimi acp` subcommand no longer honors `KIMI_CODE_LEGACY_FLAG`; it always runs on the default agent engine. diff --git a/.changeset/prompt-resolution-durable-events.md b/.changeset/prompt-resolution-durable-events.md deleted file mode 100644 index 6696de37d..000000000 --- a/.changeset/prompt-resolution-durable-events.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch -"kimi-code": patch ---- - -Fix prompts remaining queued forever after reopening a session. diff --git a/.changeset/remove-now-template-variable.md b/.changeset/remove-now-template-variable.md deleted file mode 100644 index 65e412467..000000000 --- a/.changeset/remove-now-template-variable.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/agent-core-v2": patch ---- - -Remove the `${now}` variable from the system prompt template variable table. diff --git a/.changeset/secondary-model-default-on.md b/.changeset/secondary-model-default-on.md deleted file mode 100644 index 4e635966e..000000000 --- a/.changeset/secondary-model-default-on.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": minor ---- - -The subagent model pool (`[secondary_model]`) is enabled by default in every launch mode and remains opt-out via `KIMI_CODE_EXPERIMENTAL_SECONDARY_MODEL=0` or `[experimental] secondary-model = false`. diff --git a/.changeset/session-list-command.md b/.changeset/session-list-command.md deleted file mode 100644 index 8c7902331..000000000 --- a/.changeset/session-list-command.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Add the `kimi session list` command to list sessions from the command line. diff --git a/.changeset/simplify-system-prompt.md b/.changeset/simplify-system-prompt.md deleted file mode 100644 index 354250b4d..000000000 --- a/.changeset/simplify-system-prompt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Simplify the built-in system prompt. diff --git a/.changeset/tower-mode-improvements.md b/.changeset/tower-mode-improvements.md deleted file mode 100644 index 5b3eeb163..000000000 --- a/.changeset/tower-mode-improvements.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Tower mode (experimental, `KIMI_CODE_EXPERIMENTAL_TOWER=1`): spawned workers now start from the base checkout's uncommitted changes instead of missing them, and TowerMerge refuses to merge while the checkout still holds those changes uncommitted. Also, a new session can now enter tower mode after the previous owning session stopped without exiting, instead of being refused while that session stays open. Tower mode now stays on after tower teardown; turn it off explicitly with /tower off. Tower mode is now mutually exclusive with plan mode and swarm mode: entering any one of them exits the others. diff --git a/.changeset/tower-mode-manual-entry.md b/.changeset/tower-mode-manual-entry.md deleted file mode 100644 index 09833da7d..000000000 --- a/.changeset/tower-mode-manual-entry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Tower mode (experimental, `KIMI_CODE_EXPERIMENTAL_TOWER=1`): the agent can no longer enter tower mode on its own — turn it on with /tower on, or with /tower (also in the web UI) to pin the local branch missions merge back into; a missing base branch is created from the current checkout (uncommitted changes committed onto it as a labeled WIP snapshot) and the workspace is initialized or rebased to it immediately, refusing with guidance while missions are open. Tower agents that die (failed, timed out, killed, or lost) are recorded in the tower protocol — TowerStatus marks them in the roster and warns about missions whose owner died, with a resume hint — and the tower's console instructions now require summarizing every worker's deliverables per mission before teardown. diff --git a/.changeset/trust-prompt-default-trust.md b/.changeset/trust-prompt-default-trust.md deleted file mode 100644 index 5931ba5f9..000000000 --- a/.changeset/trust-prompt-default-trust.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Default the workspace trust prompt selection to "Trust this folder" instead of "Don't trust". diff --git a/.changeset/tui-unicode-ellipsis.md b/.changeset/tui-unicode-ellipsis.md deleted file mode 100644 index f7507d5db..000000000 --- a/.changeset/tui-unicode-ellipsis.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch -"kimi-code": patch ---- - -Use the Unicode ellipsis "…" in user-facing TUI and VS Code webview text. diff --git a/.changeset/zstd-native-artifacts.md b/.changeset/zstd-native-artifacts.md deleted file mode 100644 index d928721f6..000000000 --- a/.changeset/zstd-native-artifacts.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@moonshot-ai/kimi-code": patch ---- - -Download compressed native update artifacts and decompress them while staging. diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml index c370cc642..45b15e1b4 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml @@ -13,7 +13,7 @@ body: Please try to include as much information as possible. - If you plan to submit a fix: check the Contribution box below and wait for a maintainer's `/approve` comment in this issue before opening a PR. + If you plan to submit a fix: link this issue in your PR. Small, reproducible bugs can go straight to a PR; for broader or uncertain fixes, wait for maintainer feedback first. - type: input id: version @@ -65,10 +65,3 @@ body: attributes: label: Additional information description: Is there anything else you think we should know? - - - type: checkboxes - id: willing-to-pr - attributes: - label: Contribution - options: - - label: I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first) diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.yml b/.github/ISSUE_TEMPLATE/2-feature-request.yml index 1f2b10713..bd1a04e44 100644 --- a/.github/ISSUE_TEMPLATE/2-feature-request.yml +++ b/.github/ISSUE_TEMPLATE/2-feature-request.yml @@ -11,7 +11,7 @@ body: Before you submit a feature: 1. Search existing issues for similar features. If you find one, 👍 it rather than opening a new one. 2. The Kimi Code team will try to balance the varying needs of the community when prioritizing or rejecting new features. Please understand that not all features will be accepted. - 3. Do not open a feature PR. External feature PRs are not accepted — features are discussed and decided in this issue; if accepted, the team will implement it or explicitly invite you to contribute. + 3. Do not open a feature PR until maintainers have had a chance to respond here. PRs without prior discussion may be closed without review. - type: textarea id: feature diff --git a/.github/ISSUE_TEMPLATE/3-bug-report-zh-cn.yml b/.github/ISSUE_TEMPLATE/3-bug-report-zh-cn.yml deleted file mode 100644 index 3dd6f4d7f..000000000 --- a/.github/ISSUE_TEMPLATE/3-bug-report-zh-cn.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Bug 报告 -description: 报告需要修复的问题 -labels: - - bug - - needs triage -body: - - type: markdown - attributes: - value: | - 感谢你提交 bug 报告!这能帮助 Kimi Code 变得更好。 - - 请确认你正在运行最新版本的 Kimi Code CLI——你遇到的问题可能已经被修复。 - - 请尽量提供完整的信息。 - - 如果你打算提交修复:勾选下方 Contribution 选项,并等待维护者在本 issue 中以 `/approve` 评论批准后再提 PR。 - - - type: input - id: version - attributes: - label: 你运行的 Kimi Code 版本是? - description: 复制 `kimi --version` 或 `/version` 的输出 - validations: - required: true - - type: input - id: plan - attributes: - label: 你使用的是哪个开放平台/订阅? - description: 运行 `/login` 时选择的那个 - validations: - required: true - - type: input - id: model - attributes: - label: 你使用的是哪个模型? - description: 底部状态栏可见,如 `kimi-k2.6`、`kimi-for-coding` 等 - - type: input - id: platform - attributes: - label: 你的电脑平台是? - description: | - macOS 和 Linux:复制 `uname -mprs` 的输出 - Windows:在 PowerShell 中运行 `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` 并复制输出 - - type: textarea - id: actual - attributes: - label: 你遇到了什么问题? - description: 请包含完整的错误信息和提示词(隐去隐私信息)。如可能,请提供文本而非截图。 - validations: - required: true - - type: textarea - id: steps - attributes: - label: 复现步骤? - description: 说明 bug 并给出可复现的代码片段。如适用,请提供 session id 和上下文用量。 - validations: - required: true - - type: textarea - id: expected - attributes: - label: 期望的行为是什么? - description: 如可能,请提供文本而非截图。 - - type: textarea - id: notes - attributes: - label: 补充信息 - description: 还有什么想让我们知道的? - - type: checkboxes - id: willing-to-pr - attributes: - label: Contribution - options: - - label: 我愿意自己提交修复此 bug 的 PR(请先等待维护者在本 issue 中批准) diff --git a/.github/ISSUE_TEMPLATE/4-feature-request-zh-cn.yml b/.github/ISSUE_TEMPLATE/4-feature-request-zh-cn.yml deleted file mode 100644 index b7892ff60..000000000 --- a/.github/ISSUE_TEMPLATE/4-feature-request-zh-cn.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: 功能建议 -description: 为 Kimi Code 提议新功能 -labels: - - enhancement -body: - - type: markdown - attributes: - value: | - Kimi Code 缺少你想要的某个功能?欢迎在这里提议。 - - 提交功能建议前: - 1. 先搜索已有 issue,如有类似功能,点 👍 而不是新开 issue。 - 2. Kimi Code 团队会在排序或拒绝新功能时尽量平衡社区的不同需求,请理解并非所有功能都会被接受。 - 3. 不要提交 feature PR。不接受外部功能 PR——功能在本 issue 中讨论和决定;如被接受,由团队实现或明确邀请你来贡献。 - - - type: textarea - id: feature - attributes: - label: 你希望看到什么功能? - validations: - required: true - - type: textarea - id: notes - attributes: - label: 补充信息 - description: 还有什么想让我们知道的? diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index eaa61a910..940000f70 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,14 +1,13 @@ ## Related Issue - + Resolve #(issue_number) @@ -23,7 +22,7 @@ Resolve #(issue_number) ## Checklist - [ ] I have read the [CONTRIBUTING](https://github.com/MoonshotAI/kimi-code/blob/main/CONTRIBUTING.md) document. -- [ ] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). +- [ ] I have linked a related issue, or explained the problem above. - [ ] I have added tests that prove my feature works. - [ ] Ran `gen-changesets` skill, or this PR needs no changeset. - [ ] Ran `gen-docs` skill, or this PR needs no doc update. diff --git a/.github/workflows/vscode-publish.yml b/.github/workflows/vscode-publish.yml deleted file mode 100644 index 23b12e12f..000000000 --- a/.github/workflows/vscode-publish.yml +++ /dev/null @@ -1,177 +0,0 @@ -name: Publish VS Code extension - -# 把 0.7.3 手动发版流程固化成 CI 流水线: -# -# pnpm install → package:platform(全 6 平台)→ package:verify -# → extension host 冒烟(xvfb)→ publish:vsix → publish:ovsx -# -# 触发语义(参照 kimi-code-app 仓 desktop release.yml 的判定方式): -# 只在"本次 push 改动了 apps/vscode/package.json 的 version"时发布, -# 即 changesets 版本 PR("ci: release packages")合入后自动触发; -# 普通 PR 合入不会改变版本号,不会发布。版本号比较以 push 事件的 -# before SHA 为基准(git show),可覆盖一次 push 含多个 commit 的情况, -# 不依赖工作区状态。workflow_dispatch 为手动兜底, -# 跳过版本号变化检查,直接走后续幂等闸门。 -# -# 幂等(两道保险,可安全重跑,失败即停不自动重试): -# 1. 发布前逐平台核验 VS Marketplace(vsce show)与 Open VSX(REST) -# 线上版本:6 个 targetPlatform(darwin/linux/win32 × x64/arm64) -# 全部在线才跳过对应发布步骤;任一平台缺失(如上次部分发布失败) -# 即放行给发布步骤补齐,重跑可补齐; -# 2. 发布脚本自身带 --skip-duplicate(vsce)/ already-exists 跳过(ovsx)。 -# -# 前置条件:仓库管理员需先配置 secrets VSCE_PAT / OVSX_PAT, -# 未配置时 publish 步骤会失败,属预期。 - -on: - push: - branches: - - main - workflow_dispatch: - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -permissions: - contents: read - -jobs: - publish: - name: Publish VSIX to marketplaces - runs-on: ubuntu-latest - if: github.repository_owner == 'MoonshotAI' - timeout-minutes: 90 - steps: - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 # 需要按 push 事件的 before SHA 取旧版本号比较 - - - name: Setup pnpm - uses: pnpm/action-setup@v6 - - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Resolve publish gate - id: gate - shell: bash - env: - EVENT_NAME: ${{ github.event_name }} - BEFORE_SHA: ${{ github.event.before }} - run: | - set -euo pipefail - pkg="apps/vscode/package.json" - version="$(node -p "require('./${pkg}').version")" - echo "version=${version}" >> "$GITHUB_OUTPUT" - echo "extension version: ${version}" - - if [ "${EVENT_NAME}" = "workflow_dispatch" ]; then - echo "manual dispatch — skipping version-change check" - else - # 以 push 事件的 before SHA 为比较基准(覆盖多 commit 的单次 push)。 - # before 为空或全 0(如新分支首推)时无法比较,prev 视为空 → - # 判定版本变化放行 —— 宁可多查一次线上闸门,不可漏发。 - prev="" - if [ -n "${BEFORE_SHA}" ] && [ -n "${BEFORE_SHA//0/}" ]; then - if git show "${BEFORE_SHA}:${pkg}" > /tmp/prev-vscode-pkg.json 2> /dev/null; then - prev="$(node -p "require('/tmp/prev-vscode-pkg.json').version")" - fi - else - echo "push event has no usable before SHA ('${BEFORE_SHA}') — treating as a version change" - fi - if [ "${prev}" = "${version}" ]; then - echo "apps/vscode version unchanged in this push (${version}) — nothing to publish" - echo "should_publish=false" >> "$GITHUB_OUTPUT" - exit 0 - fi - echo "version changed ${prev:-} -> ${version} — release push" - fi - echo "should_publish=true" >> "$GITHUB_OUTPUT" - - # 线上闸门:逐平台核验,6 个 targetPlatform 全部在线才跳过对应市场; - # 任一平台缺失即放行给 publish 步骤幂等补齐。 - # fail-closed:查询失败视为未发布 → 放行,交给 publish 步骤决定成败。 - platforms="darwin-x64 darwin-arm64 linux-x64 linux-arm64 win32-x64 win32-arm64" - - ovsx_missing="" - for target in ${platforms}; do - if ! curl -fsS -o /dev/null "https://open-vsx.org/api/moonshot-ai/kimi-code/${target}/${version}"; then - ovsx_missing="${ovsx_missing} ${target}" - fi - done - if [ -z "${ovsx_missing}" ]; then - echo "${version} is fully on Open VSX (all 6 platforms) — publish:ovsx will be skipped" - echo "ovsx_published=true" >> "$GITHUB_OUTPUT" - else - echo "Open VSX missing platform(s):${ovsx_missing} — publish:ovsx will run to backfill" - echo "ovsx_published=false" >> "$GITHUB_OUTPUT" - fi - - if pnpm --filter kimi-code exec vsce show moonshot-ai.kimi-code --json \ - | node -e "const v=process.argv[1];const want=process.argv[2].split(' ');let d='';process.stdin.on('data',c=>d+=c).on('end',()=>{const j=JSON.parse(d);const got=new Set((j.versions||[]).filter(x=>x.version===v).map(x=>x.targetPlatform||''));const missing=want.filter(p=>!got.has(p));if(missing.length){console.error('VS Marketplace missing platform(s): '+missing.join(' '));process.exit(1)}process.exit(0)})" "${version}" "${platforms}"; then - echo "${version} is fully on VS Marketplace (all 6 platforms) — publish:vsix will be skipped" - echo "vsix_published=true" >> "$GITHUB_OUTPUT" - else - echo "vsix_published=false" >> "$GITHUB_OUTPUT" - fi - - - name: Check publish secrets - if: steps.gate.outputs.should_publish == 'true' - shell: bash - env: - VSCE_PAT: ${{ secrets.VSCE_PAT }} - OVSX_PAT: ${{ secrets.OVSX_PAT }} - run: | - set -euo pipefail - missing=() - [ -z "${VSCE_PAT:-}" ] && missing+=(VSCE_PAT) - [ -z "${OVSX_PAT:-}" ] && missing+=(OVSX_PAT) - if [ "${#missing[@]}" -gt 0 ]; then - echo "::error::missing repository secrets: ${missing[*]} — a repo admin must configure them before publishing" - exit 1 - fi - - - name: Package all platform VSIX - if: steps.gate.outputs.should_publish == 'true' - run: pnpm --filter kimi-code run package:platform - - - name: Verify VSIX packages - if: steps.gate.outputs.should_publish == 'true' - run: pnpm --filter kimi-code run package:verify - - - name: Upload VSIX artifacts - if: steps.gate.outputs.should_publish == 'true' - uses: actions/upload-artifact@v7 - with: - name: kimi-code-vsix-${{ steps.gate.outputs.version }} - path: apps/vscode/artifacts/vsix/*.vsix - retention-days: 14 - - - name: Install extension-host smoke dependencies - if: steps.gate.outputs.should_publish == 'true' - run: | - sudo apt-get update - sudo apt-get install -y xvfb libgtk-3-0 libgbm1 libasound2t64 - - - name: Extension host smoke test - if: steps.gate.outputs.should_publish == 'true' - # 1.100.0 即 package.json engines.vscode 下限,与 0.7.3 手动发版的冒烟口径一致 - run: xvfb-run -a pnpm --filter kimi-code run test:extension-host -- --version 1.100.0 - - - name: Publish to VS Marketplace - if: steps.gate.outputs.should_publish == 'true' && steps.gate.outputs.vsix_published != 'true' - env: - VSCE_PAT: ${{ secrets.VSCE_PAT }} - run: pnpm --filter kimi-code run publish:vsix - - - name: Publish to Open VSX - if: steps.gate.outputs.should_publish == 'true' && steps.gate.outputs.ovsx_published != 'true' - env: - OVSX_PAT: ${{ secrets.OVSX_PAT }} - run: pnpm --filter kimi-code run publish:ovsx diff --git a/AGENTS.md b/AGENTS.md index d95144c9d..99cc7230f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,7 +48,7 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo ## General Coding Rules -- `packages/agent-core-v2`, `packages/kap-server`, and `packages/transcript` are comment-free zones: no comments of any kind — no line/block comments, no JSDoc (not even on exported symbols); the only exception is load-bearing lint-suppression directives (`oxlint-disable` / `eslint-disable`), while other tooling directives (`@ts-expect-error`, …) stay banned. Enforced by `scripts/check-no-comments.mjs` over `.ts`/`.tsx`/`.mts`/`.mjs` under `src/`/`test/`/`scripts/`, which runs as part of `pnpm lint`. +- `packages/agent-core-v2`, `packages/kap-server`, and `packages/transcript` are comment-free zones: no line/block comments; the exceptions are JSDoc attached to exported symbols and load-bearing lint-suppression directives (`oxlint-disable` / `eslint-disable`), while other tooling directives (`@ts-expect-error`, …) stay banned. Enforced by `scripts/check-no-comments.mjs`, which runs as part of `pnpm lint`. - For optional object properties, pass `undefined` directly instead of using conditional spread. - YES: `{ user }` - NO: `{ ...(user ? { user } : undefined) }` @@ -63,7 +63,7 @@ This is a TypeScript monorepo built for agent-assisted development. Keep the roo ## Experimental Features -- Gate a not-yet-public feature behind an experimental flag. Flags are env-driven and default off: `KIMI_CODE_EXPERIMENTAL_` toggles one, `KIMI_CODE_EXPERIMENTAL_FLAG` enables all. Precedence is per-flag env > `[experimental]` config > master env > the flag's `default`. Release by flipping the entry's `default` to `true`. +- Gate a not-yet-public feature behind an experimental flag. Flags are env-driven and default off: `KIMI_CODE_EXPERIMENTAL_` toggles one, `KIMI_CODE_EXPERIMENTAL_FLAG` enables all. Release by flipping the entry's `default` to `true`. - `packages/agent-core` (v1): add the flag to the central registry at `packages/agent-core/src/flags/registry.ts`, then check it with `flags.enabled('my-feature')`. - `packages/agent-core-v2` and kap-server modules: there is no central catalog — declare the flag in the owning domain via `registerFlagDefinition` at import time (see `packages/agent-core-v2/docs/flag.md`), then check it with `IFlagService.enabled(id)`. Current search-index-separation flags: `persistence_minidb_readmodel` (session read model, default on) and `search_worker` (global search worker host, default on). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff90b934b..87173d926 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,5 @@ # Contributing to kimi-code -[中文版](CONTRIBUTING.zh-CN.md) - Thanks for taking the time to contribute! This project moves quickly, and thoughtful contributions from the community are what keep it sharp. The guide below walks you through how we work so your PR has the best chance of landing smoothly. ## Before You Start @@ -12,25 +10,27 @@ We hold AI-assisted contributions to the same standard as hand-written ones. **Y We only merge PRs aligned with the roadmap. Drive-by refactors without context are unlikely to land. -**External PRs are accepted for approved bug fixes only.** Open an issue first and wait for a maintainer to approve it with an `/approve` comment, then link that issue in your PR. PRs without an approved linked issue may be closed without review; once the issue is approved, ask a maintainer to reopen your PR. +**Discuss first** — open an issue before coding. PRs without prior discussion may be closed without review: -**Discuss first** — open an issue before coding: - -- Bug fixes, including small or typo-level ones: open a bug issue and wait for a maintainer's `/approve` before opening the PR -- New features or user-visible behavior changes (regardless of size): external feature PRs are not accepted — features are discussed and decided in issues, and accepted features are implemented by the team or by explicit maintainer invitation +- New features or user-visible behavior changes (regardless of size) - Refactors or other changes larger than ~100 lines - Public API or compatibility changes +- Bug fixes where the cause or fix approach is still unclear + +**Can open a PR directly** — link an existing issue when there is one: + +- Clear, reproducible bug fixes with a focused diff +- Typos, documentation-only changes, and small CI/build fixes +- Small changes that clearly match an existing issue or maintainer request ## Project Layout This is a pnpm monorepo. The most relevant entry points are: - `apps/kimi-code` — CLI / TUI -- `apps/vscode` — VS Code extension -- `apps/vis` — session debug visualizer +- `apps/vis` — session replay & debugging visualizer - `packages/node-sdk` — public TypeScript SDK (`@moonshot-ai/kimi-code-sdk`) -- `packages/agent-core-v2` — the agent engine (v2, DI Scope architecture); `packages/agent-core` is v1 and being phased out -- `packages/klient`, `kap-server`, `protocol`, `transcript`, `kosong`, `kaos`, `oauth`, `telemetry` — internal engine packages +- `packages/agent-core`, `kosong`, `kaos`, `oauth`, `telemetry` — internal engine packages - `docs/` — VitePress bilingual docs site For the full project map, see [AGENTS.md](AGENTS.md). @@ -84,7 +84,9 @@ This repo uses [changesets](https://github.com/changesets/changesets) to manage ## Pull Requests -Every PR opens with the [PR template](.github/pull_request_template.md). PR titles must follow [Conventional Commits](#commit-convention); CI runs `pnpm lint`, `pnpm typecheck`, and `pnpm test` on every PR. Update user-facing docs in `docs/` when behavior changes — use the `gen-docs` skill when working with coding agents. +Use the [PR template](.github/pull_request_template.md) when opening a feature pull request. + +PR titles must follow [Conventional Commits](#commit-convention); CI runs `pnpm lint`, `pnpm typecheck`, and `pnpm test` on every PR. Update user-facing docs in `docs/` when behavior changes — use the `gen-docs` skill when working with coding agents. ## Code Style diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md deleted file mode 100644 index 160e6d76c..000000000 --- a/CONTRIBUTING.zh-CN.md +++ /dev/null @@ -1,102 +0,0 @@ -# 为 kimi-code 贡献代码 - -[English version](CONTRIBUTING.md) - -感谢你花时间参与贡献!这个项目迭代很快,离不开社区认真的贡献。下面的指南介绍我们的工作方式,帮助你的 PR 顺利合入。 - -## 开始之前 - -Kimi Code 对 CLI/TUI 行为、agent 工作流和公开 API 已有自己的主张。如果你的改动会改变这些方向,请先开 issue 对齐,再投入时间写 PR。 - -我们对 AI 辅助贡献与手写代码一视同仁。**你应该理解自己提交的内容**——改了什么、边界情况下表现如何、为什么适合这个代码库。如果你解释不清楚,这个 PR 就还没准备好接受评审。 - -我们只合入与路线图一致的 PR。缺乏上下文背景的顺手重构很难被接受。 - -**外部 PR 仅接受获批准的 bug 修复。** 先开 issue,等待维护者以 `/approve` 评论明确批准,然后在 PR 中链接该 issue。没有已批准关联 issue 的 PR 可能会不经评审直接关闭;issue 获批后,可联系维护者重开你的 PR。 - -**先讨论**——写代码前先开 issue: - -- bug 修复(包括小的、错别字级别的):先开 bug issue,等待维护者 `/approve` 后再提 PR -- 新功能或用户可见的行为变更(无论大小):不接受外部 feature PR——功能在 issue 中讨论和决定,被接受的功能由团队实现,或由维护者明确邀请你贡献 -- 重构或其他超过约 100 行的改动 -- 公开 API 或兼容性变更 - -## 项目结构 - -本仓库是 pnpm monorepo,最常用的入口: - -- `apps/kimi-code` — CLI / TUI -- `apps/vscode` — VS Code 插件 -- `apps/vis` — 会话调试可视化工具 -- `packages/node-sdk` — 公开 TypeScript SDK(`@moonshot-ai/kimi-code-sdk`) -- `packages/agent-core-v2` — 当前的 agent 引擎(v2,DI Scope 架构);`packages/agent-core` 为 v1,正在逐步废弃 -- `packages/klient`、`kap-server`、`protocol`、`transcript`、`kosong`、`kaos`、`oauth`、`telemetry` — 内部引擎包 -- `docs/` — VitePress 双语文档站 - -完整项目地图见 [AGENTS.md](AGENTS.md)。 - -## 开发环境 - -前置要求:Node.js >= 24.15.0、pnpm 10.33.0、Git。 - -```sh -git clone https://github.com/MoonshotAI/kimi-code.git -cd kimi-code -pnpm install -``` - -常用脚本: - -- `pnpm dev:cli` — 开发模式运行 CLI -- `pnpm test` — 运行测试(vitest) -- `pnpm typecheck` — TypeScript 检查(注意:会先构建各包) -- `pnpm lint` — oxlint -- `pnpm lint:fix` — oxlint 自动修复 -- `pnpm build` — 构建全部包 - -## 提交规范 - -所有 commit 和 PR 标题必须遵循 [Conventional Commits](https://www.conventionalcommits.org/)。 - -| 类型 | 用途 | 示例 | -|----------|------------------------------------------|----------------------------------------| -| feat | 新功能 | feat(agent-core): add tool dedup | -| fix | bug 修复 | fix(tui): correct status bar alignment | -| docs | 仅文档 | docs: clarify install instructions | -| chore | 工具 / 杂务 | chore: bump dependencies | -| refactor | 无行为变更的内部重构 | refactor(kosong): extract retry helper | -| test | 新增或改进测试 | test(agent-core): cover skill resolver | -| ci | CI / 构建流水线变更 | ci: cache pnpm store | -| build | 构建系统 / 产物变更 | build(native): add win32-arm64 target | -| perf | 性能优化 | perf(session): batch event flushes | -| style | 仅格式化(无逻辑变更) | style: apply oxlint --fix | - -PR 标题由 `pr-title-checker` 工作流强制校验——不合规的标题会阻止合并。 - -## Changesets - -本仓库使用 [changesets](https://github.com/changesets/changesets) 管理版本与发布。 - -- 每个影响发布产物(代码、行为、公开 API)的 PR **必须**包含 changeset。 -- 仅文档、仅测试或仅 CI 的 PR 可以不加。 -- 用 `pnpm changeset` 生成并按提示操作(涉及哪些包、什么 bump 级别)。 -- 包选择与 bump 级别的仓库约定见 `.changeset/README.md`。在本仓库使用编程 agent 时,使用 `gen-changesets` 技能。 - -## Pull Requests - -PR 会自动套用 [PR 模板](.github/pull_request_template.md)。PR 标题必须遵循 [Conventional Commits](#提交规范);每个 PR 的 CI 会运行 `pnpm lint`、`pnpm typecheck` 和 `pnpm test`。行为变更时请同步更新 `docs/` 下的用户文档——使用编程 agent 时使用 `gen-docs` 技能。 - -## 代码风格 - -- 全仓库 TypeScript。 -- 使用 `oxlint`(配置见 `.oxlintrc.json`)。 -- 用 `pnpm lint:fix` 自动格式化。 -- lint 规则未覆盖的风格选择,跟随周边现有写法。 - -## 报告安全问题 - -发现安全问题?请查看 [SECURITY.md](SECURITY.md),不要开公开 issue。 - -## 许可证 - -向本仓库贡献即表示你同意你的贡献按 [MIT 许可证](LICENSE) 授权。 diff --git a/GOAL.md b/GOAL.md new file mode 100644 index 000000000..2ab271225 --- /dev/null +++ b/GOAL.md @@ -0,0 +1,232 @@ +# Goal 功能拆分 + +本文把 agent-core 中 goal mode 的能力拆成三部分: + +1. 核心工作流:没有它就不能运行 goal。 +2. 统计 / token 数限制:让 goal 可度量、可限额、可审计。 +3. 用户交互相关:让用户可以安全启动、理解、控制和恢复 goal。 + +## 1. 核心工作流 + +核心工作流是 goal mode 的运行骨架。它负责创建结构化目标、维护状态机、把普通 turn 串成自治多轮执行,并让模型用机器可读状态结束或停放目标。 + +### 目标状态 + +同一个 main agent 同时最多只有一个当前 goal。goal 不是普通聊天文本,而是 runtime 持有的结构化状态,至少包含目标、可选完成标准、当前状态、停止原因和运行统计。 + +状态分为四类: + +- `active`:正在被 goal driver 推进。只有这个状态会自动运行下一轮。 +- `paused`:暂停但保留目标。通常来自用户暂停、中断、进程恢复后降级、provider 或 runtime 错误。可以恢复。 +- `blocked`:目标遇到真实阻塞但保留目标。通常来自模型判断需要外部输入、目标无法按当前表述完成、预算达到、prompt hook 阻止。可以恢复。 +- `complete`:瞬时完成状态。runtime 发出完成事件后立即清除 goal,不长期持久化。 + +没有 `cancelled` 状态。取消就是清除 goal,并提醒模型忽略之前关于该目标的 active reminder。 + +### 创建和替换 + +创建 goal 时,runtime 需要校验目标不能为空、不能过长。已有 active、paused 或 blocked goal 时,默认拒绝创建新 goal,防止静默覆盖。只有用户或调用方明确要求替换时,才先清除旧 goal,再创建新 goal。 + +新 goal 创建后进入 `active`,写入持久记录,并发出 goal 更新事件。 + +### 多轮驱动 + +goal driver 的职责是把一个 active goal 推进成连续的普通 turn: + +- turn 开始时如果 goal 已经是 `active`,进入 goal driver。 +- 普通 turn 中如果模型创建了 goal,或把 paused/blocked goal 恢复成 active,当前 turn 结束后 goal driver 接管继续执行。 +- driver 每次只运行一个普通 turn。 +- 每个 turn 结束后读取 goal 状态。 +- goal 仍是 `active` 时,runtime 自动追加 continuation prompt 并启动下一轮。 +- goal 变成 `paused`、`blocked` 或被清除时,driver 停止。 + +模型如果不调用状态更新工具,且 goal 仍是 active,runtime 会继续下一轮。模型不能只靠自然语言说“完成了”来结束 goal,必须给出结构化状态信号。 + +### Goal 注入 + +每个 goal turn 的边界,runtime 会把当前 goal 状态注入上下文。注入内容包括: + +- 当前正在 goal mode。 +- 目标和完成标准是什么。 +- 目标文本是用户提供的数据,不能覆盖 system/developer 指令、工具 schema、权限规则或 host 控制。 +- 当前状态和进度。 +- 模型应该做简短自审,然后推进一个连贯工作切片。 +- 简单、已完成、不可能、不安全、矛盾的目标,应在同一轮内直接标记 complete 或 blocked。 +- 只有全部要求完成、验证通过、没有下一步有用动作时,才能标记 complete。 +- 外部条件或用户输入阻塞时,应标记 blocked。 +- 不要只做了计划、总结、第一版或部分结果就标记 complete。 + +goal 注入只在 turn / continuation 边界做,不在每个 model step 都做,避免上下文重复膨胀,也有利于 prompt cache。 + +paused 和 blocked goal 的注入更轻: + +- paused:提醒模型目标存在但当前不应自治推进,除非用户明确要求继续。 +- blocked:提醒模型目标被阻塞且当前不自治推进,除非用户要求处理或恢复。 + +### Continuation prompt + +当 goal 仍是 active,runtime 会追加一个系统触发输入,含义相当于“继续朝当前 active goal 工作”。它不只是简单续跑,还要求模型每轮重新判断: + +- 是否已经完成。 +- 是否遇到真实阻塞。 +- 是否应该只推进一个合理切片后继续下一轮。 +- 是否应该避免发散或启动无关工作。 +- 除非真实阻塞,否则不要向用户要输入。 + +### 完成、阻塞和暂停 + +模型通过结构化状态更新控制 goal 生命周期: + +- `complete`:目标已满足,runtime 发出完成事件并清除 goal。 +- `blocked`:遇到真实阻塞,runtime 保留 goal 并停止自治推进。 +- `paused`:暂时放下 goal,runtime 保留 goal 并停止自治推进。 +- `active`:恢复 paused 或 blocked goal。 + +状态更新工具的输入应保持窄,只表达机器状态。完成总结或阻塞原因由模型随后给用户说明。 + +当模型标记 complete 后,runtime 应再给模型一次收尾机会,生成简短最终回复,说明 goal 已完成、主要做了什么、跑了什么验证。 + +当模型标记 blocked 后,runtime 应再给模型一次收尾机会,说明具体阻塞、需要什么输入或变化才能继续。 + +如果当前 turn 已经没有 step 预算,不应为了收尾总结强行再跑一步,避免把“没法写总结”变成 turn 失败。 + +### 错误停车 + +goal mode 把技术运行失败视为可恢复停车: + +- 用户中断当前 turn:goal 变 paused。 +- provider rate limit:goal 变 paused。 +- provider 连接错误、认证错误、API 错误:goal 变 paused。 +- 模型配置错误:goal 变 paused。 +- runtime 异常:goal 变 paused。 +- provider safety filter:goal 变 paused。 + +业务、规则或外部条件阻塞则变 blocked: + +- prompt hook 阻止目标。 +- 模型判断无法继续。 +- 预算达到。 +- 需要用户或外部系统提供新条件。 + +### 持久化和恢复 + +goal 的创建、更新、完成、阻塞、清除应写入可恢复记录。session 恢复时,runtime 用记录重建 goal。 + +恢复时如果发现 goal 原来是 active,不应自动继续跑,而是降级为 paused。因为旧进程中的 active turn 不可能还活着,自动继续会造成重启后偷偷消耗资源。 + +paused 和 blocked 原样保留。complete 理论上不长期存在,因为完成后会清除。 + +fork session 时不继承源 session 的 goal,并提醒模型不要继续源 session 的旧目标。 + +## 2. 统计 / token 数限制 + +这一部分让 goal 可度量、可限额、可审计。没有它,goal 仍然可以运行,但不可控。 + +### 运行统计 + +goal 统计包括: + +- continuation turn 数。 +- token 数。 +- active wall-clock 时间。 + +统计只在 goal 是 `active` 时增长。paused 和 blocked 期间不继续计数。 + +turn 统计在每个 goal turn 准备运行时增加,因此模型在某一轮里标记 complete 时,这一轮也计入最终统计。 + +token 统计在 model step 结束后累计。没有 active goal 时,不记入 goal。token 统计应以静默更新为主,不应每一步都刷 UI。 + +时间统计只计算 active pursuit 时间。进入 active 时开启计时区间,离开 active 时折算进累计时间;pause/resume 会形成新的 active 区间。 + +### 预算 + +goal 预算包括: + +- turn budget。 +- token budget。 +- wall-clock budget。 + +默认没有预算。只有用户明确给出硬限制时才设置,例如“最多 20 轮”“不超过 500k token”“30 分钟内”。模糊表达如“尽快”“别花太久”不能设置预算,模型也不能自行发明预算。 + +时间预算需要合理范围。过短或过长应拒绝。turn 和 token 预算应规范化为正整数。 + +### 预算硬停 + +预算检查应发生在 goal turn 开始前和结束后。token budget 还应在 model step 后触发停止,避免超额后继续下一步。 + +一旦达到预算,runtime 应直接把 goal 标记为 blocked,原因是配置预算已达到。这个 blocked 仍可恢复,但如果预算不变,恢复后可能立刻再次 blocked。 + +### 预算引导和最终统计 + +当预算未接近时,模型提示应鼓励稳定推进。当任一预算达到 75% 以上时,提示应转为收敛,避免启动新的可选工作。 + +complete 和 blocked 的最终回复提示应包含 worked turns、elapsed time、tokens used 等统计信息。UI 事件也应带当前 snapshot 和变化类型。 + +telemetry 可以记录 goal 创建、预算设置、continuation、状态变化、清除等事件,但不应包含目标文本、停止原因等敏感内容。 + +## 3. 用户交互相关 + +这一部分让用户可以安全启动、理解、控制和恢复 goal。没有它,runtime 仍可能运行,但交互体验和安全边界不足。 + +### 生命周期控制 + +用户可以直接控制 goal: + +- 创建。 +- 查看。 +- 暂停。 +- 恢复。 +- 取消。 + +这些操作可以不经过模型 turn。pause 把 active goal 变 paused;resume 把 paused 或 blocked goal 变 active;cancel 直接清除当前 goal。 + +resume 会清除旧停止原因,表示开始新的尝试。paused/blocked goal 不会因为用户发普通消息就自动继续。 + +### 模型发起 goal 的确认 + +模型可以代表用户创建 goal,但只有在用户明确要求启动 goal、自治工作,或宿主 goal-intake 提示要求时才应该这样做。普通请求不能被模型擅自升级成 goal。 + +模型发起 CreateGoal 时,非 auto 权限模式下应触发用户确认。确认菜单允许用户选择本次 goal 的运行权限模式。用户拒绝则 goal 不创建。 + +`GetGoal`、`SetGoalBudget`、`UpdateGoal` 只改 goal runtime 状态,默认可以更容易批准。真正写文件、跑 shell、访问敏感路径等仍走普通权限系统。 + +### 暂停、阻塞和取消后的提示 + +paused goal 的上下文提示应说明目标存在但当前不应继续做,除非用户明确要求继续。 + +blocked goal 的上下文提示应说明目标被阻塞且当前不自治推进,可以在用户要求时帮助解阻,否则正常处理当前请求。 + +cancel 后应追加提醒,让模型忽略旧 goal 的 active reminder,避免旧上下文诱导模型继续已经取消的目标。 + +### 完成和阻塞的用户回复 + +complete 后,goal 被清除,模型应给用户一条简短完成总结,说明完成了什么、做了什么验证。 + +blocked 后,goal 保留,模型应给用户一条简短阻塞说明,说明具体阻塞和继续所需输入、权限、外部条件或变更。 + +### Tool 暴露和隔离 + +goal 工具只给 main agent。subagent 不应直接创建、恢复、结束主 goal。 + +没有 goal 时,模型不应看到 `UpdateGoal` 和 `SetGoalBudget`。有 goal 时才暴露这些控制工具。 + +goal ID 不应暴露给模型,因为它只是 runtime/UI 内部标识,没有用户语义。 + +### 辅助写 goal + +`write-goal` 类能力用于帮助用户把粗糙意图整理成适合 goal mode 的完成契约。好的 goal 应明确: + +- end state:什么条件必须变成真。 +- proof:用什么可观察证据证明完成。 +- boundaries:工作范围和禁止触碰的内容。 +- loop:如何迭代推进。 +- stop rule:什么情况下停止并报告,而不是强行继续。 + +预算是 opt-in,不应默认加入,也不应把 turn cap 写进目标文本。 + +### UI 和会话语义 + +goal 创建、暂停、恢复、阻塞、完成、清除都应发出 goal updated 事件。lifecycle 变化和 completion 变化应区分。completion 是一次终局事件,然后 snapshot 变 null。blocked/paused 保留 snapshot,UI 可以继续展示可恢复 goal。 + +session 恢复时,active goal 会变 paused,避免重启后自动继续。fork session 时不继承 goal,并提醒模型不要继续源 session 的目标。 + diff --git a/apps/kimi-code/CHANGELOG.md b/apps/kimi-code/CHANGELOG.md index db07074bb..d809fe69d 100644 --- a/apps/kimi-code/CHANGELOG.md +++ b/apps/kimi-code/CHANGELOG.md @@ -1,235 +1,5 @@ # @moonshot-ai/kimi-code -## 0.39.1 - -### Patch Changes - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix the command tool row rendering noticeably taller than other tool rows. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix the first IME (or keyboard) character being silently swallowed after clicking the placeholder text in an empty composer. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix switching the permission mode in one session changing it for every session; the permission mode is now scoped per session. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix flickering and broken interactions in the image and video attachment preview popovers. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix attachments in a newly created session still showing as uploading after the upload has finished. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Render the rich composer placeholder outside the editor, fixing the first typed/IME character being swallowed. - -- [#3307](https://github.com/MoonshotAI/kimi-code/pull/3307) [`0310f22`](https://github.com/MoonshotAI/kimi-code/commit/0310f223daf9596ac403e94c7224ce2f744951c3) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Increase the request timeout for `kimi update`. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Unify right-side panel headers and give the OpenIn menu a file mode (copy absolute path, editor picker, full-path tooltip). - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix signed-in users without a usable model being wrongly asked to sign in (and getting stuck there on web); the send gate now offers picking or configuring a model instead. - -- [#3333](https://github.com/MoonshotAI/kimi-code/pull/3333) [`8f43674`](https://github.com/MoonshotAI/kimi-code/commit/8f43674b902213f876359d82fa3831f485e3e82b) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: Fix startup getting stuck on "Connecting…" for a long time when the account has many workspaces. - -- [#3328](https://github.com/MoonshotAI/kimi-code/pull/3328) [`dc6028d`](https://github.com/MoonshotAI/kimi-code/commit/dc6028dc6b5c9464039f16cfe38de6ba90a68b72) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Fixed skill instructions injected by the Skill tool showing up as ordinary user messages in the rebuilt transcript. - -- [#3292](https://github.com/MoonshotAI/kimi-code/pull/3292) [`23921e9`](https://github.com/MoonshotAI/kimi-code/commit/23921e9f2c5a50f66ad5616554fac8565772919d) Thanks [@7Sageer](https://github.com/7Sageer)! - When a session resumes, the assistant is warned that background tasks from the previous session may still be running. - -## 0.39.0 - -### Minor Changes - -- [#3034](https://github.com/MoonshotAI/kimi-code/pull/3034) [`f0a6094`](https://github.com/MoonshotAI/kimi-code/commit/f0a609487fb835371c608cde101a6ff544c3c33e) Thanks [@sailist](https://github.com/sailist)! - Add Remote Control as an experimental feature for accessing a local web session remotely. Enable it with `KIMI_CODE_EXPERIMENTAL_REMOTE_CONTROL=1`, then run `kimi rc`, `kimi web --remote-control`, or `/remote-control` to start it. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the slash-command and @-mention panels failing to open on mobile — both panels and the + menu are now grab-handle bottom sheets on small screens. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Add a flat/by-workspace tab to the mobile session list. - -- [#3296](https://github.com/MoonshotAI/kimi-code/pull/3296) [`df9e858`](https://github.com/MoonshotAI/kimi-code/commit/df9e8583882bc0fbc8ff824fc1c627c9bdbc315b) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Revamp the right sidebar as a multi-tab panel. - -- [#3007](https://github.com/MoonshotAI/kimi-code/pull/3007) [`f6736d7`](https://github.com/MoonshotAI/kimi-code/commit/f6736d7c0de609d44ed1cb761cfe9f195c4d94fb) Thanks [@7Sageer](https://github.com/7Sageer)! - Add an optional `fork` parameter to subagent and swarm tools that starts the subagent with a snapshot of the calling agent's conversation history; set `KIMI_CODE_EXPERIMENTAL_SUBAGENT_FORK=1` or `subagent_fork = true` under `[experimental]` in config.toml to enable it. - -- [#3296](https://github.com/MoonshotAI/kimi-code/pull/3296) [`df9e858`](https://github.com/MoonshotAI/kimi-code/commit/df9e8583882bc0fbc8ff824fc1c627c9bdbc315b) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Allow moving a running foreground Bash command or subagent to the background via the "Move to background" button on the running card. - -- [#3099](https://github.com/MoonshotAI/kimi-code/pull/3099) [`0f44537`](https://github.com/MoonshotAI/kimi-code/commit/0f44537c13e7c32b9189e20af7c894c34704be5b) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Add experimental tower mode for multi-agent orchestration; set `KIMI_CODE_EXPERIMENTAL_TOWER=1`, then run `/tower on` and `/tower ` to start. - -### Patch Changes - -- [#3241](https://github.com/MoonshotAI/kimi-code/pull/3241) [`1dc34b4`](https://github.com/MoonshotAI/kimi-code/commit/1dc34b46de62a6aa0e308a71d824ecb7487b1374) Thanks [@tpoisonooo](https://github.com/tpoisonooo)! - Silence the MaxListenersExceededWarning that could appear during long agent turns with many parallel tool calls. - -- [#3166](https://github.com/MoonshotAI/kimi-code/pull/3166) [`d4e0ad4`](https://github.com/MoonshotAI/kimi-code/commit/d4e0ad4b2d04d676b6d139ee320ea162289d3f4b) Thanks [@liruifengv](https://github.com/liruifengv)! - web: fix thinking blocks in the subagent detail panel being stuck expanded and not collapsible. - -- [#3139](https://github.com/MoonshotAI/kimi-code/pull/3139) [`381142a`](https://github.com/MoonshotAI/kimi-code/commit/381142aff1d165f4bf67327035afec81ab4f656b) Thanks [@sailist](https://github.com/sailist)! - Fix sessions failing to archive when their workspace folder no longer exists. - -- [#3034](https://github.com/MoonshotAI/kimi-code/pull/3034) [`f0a6094`](https://github.com/MoonshotAI/kimi-code/commit/f0a609487fb835371c608cde101a6ff544c3c33e) Thanks [@sailist](https://github.com/sailist)! - Fix messages sent from one web client not appearing on other clients connected to the same session. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix pressing Esc to cancel an IME candidate also closing the BTW side chat. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the composer not receiving focus after opening the BTW side chat via the shortcut or /btw. - -- [#3212](https://github.com/MoonshotAI/kimi-code/pull/3212) [`a664226`](https://github.com/MoonshotAI/kimi-code/commit/a664226bf2244a232fd778064e2f1edf7691d268) Thanks [@sailist](https://github.com/sailist)! - Preserve the active session and its selected model when logging out of a provider. - -- [#3136](https://github.com/MoonshotAI/kimi-code/pull/3136) [`e9a99e5`](https://github.com/MoonshotAI/kimi-code/commit/e9a99e5ec6843b590c44c63c3d604702c24b1bca) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Add the Tencent CloudBase plugin to the curated marketplace. - -- [#3296](https://github.com/MoonshotAI/kimi-code/pull/3296) [`df9e858`](https://github.com/MoonshotAI/kimi-code/commit/df9e8583882bc0fbc8ff824fc1c627c9bdbc315b) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improve code block interaction and rendering. - -- [#3296](https://github.com/MoonshotAI/kimi-code/pull/3296) [`df9e858`](https://github.com/MoonshotAI/kimi-code/commit/df9e8583882bc0fbc8ff824fc1c627c9bdbc315b) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improve composer interaction, including the presentation of file, folder, and media attachments. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix composer toolbar buttons squeezing and overlapping each other in very narrow windows. - -- [#3154](https://github.com/MoonshotAI/kimi-code/pull/3154) [`54bb49e`](https://github.com/MoonshotAI/kimi-code/commit/54bb49e138ad8a2c6e20008b4ea32a3917cc7b1a) Thanks [@Grapedge](https://github.com/Grapedge)! - Fix the latest reply disappearing from the transcript after a scheduled cron reminder fires. - -- [#3034](https://github.com/MoonshotAI/kimi-code/pull/3034) [`f0a6094`](https://github.com/MoonshotAI/kimi-code/commit/f0a609487fb835371c608cde101a6ff544c3c33e) Thanks [@sailist](https://github.com/sailist)! - Remove the `--allow-remote-terminals` flag from `kimi web`; PTY terminal routes now stay available on loopback binds only. - -- [#3183](https://github.com/MoonshotAI/kimi-code/pull/3183) [`2adc6a1`](https://github.com/MoonshotAI/kimi-code/commit/2adc6a1c6e1adeb696b0edc00a77ef90c54c8218) Thanks [@sailist](https://github.com/sailist)! - Fix ACP session regressions: Bash, Grep, and Glob failing when the editor does not support terminal command execution, session creation failing with stdio MCP servers, and reopening a closed session failing with an internal error. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix memory usage growing steadily after repeatedly switching sessions and toggling the side chat and subagent panels. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix unsent composer attachments such as images being lost after switching sessions on the new-session page. - -- [#3296](https://github.com/MoonshotAI/kimi-code/pull/3296) [`df9e858`](https://github.com/MoonshotAI/kimi-code/commit/df9e8583882bc0fbc8ff824fc1c627c9bdbc315b) Thanks [@liruifengv](https://github.com/liruifengv)! - Fix known issues. - -- [#3294](https://github.com/MoonshotAI/kimi-code/pull/3294) [`21f7ef6`](https://github.com/MoonshotAI/kimi-code/commit/21f7ef64f0851504227617f4501bf8359031d9a5) Thanks [@liruifengv](https://github.com/liruifengv)! - Fix sign-in briefly showing a device-code-expired error after a successful authorization. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix long question text in question cards being truncated with an ellipsis instead of wrapping. - -- [#3206](https://github.com/MoonshotAI/kimi-code/pull/3206) [`4d5147b`](https://github.com/MoonshotAI/kimi-code/commit/4d5147ba5da6267f52b10416469f275138fa51ce) Thanks [@sailist](https://github.com/sailist)! - Fix repeated server crashes when resuming a session that was interrupted in the middle of a turn. - -- [#3159](https://github.com/MoonshotAI/kimi-code/pull/3159) [`ea0626a`](https://github.com/MoonshotAI/kimi-code/commit/ea0626ad48ee318045a22490d52c86be7d086033) Thanks [@pvzheroes125](https://github.com/pvzheroes125)! - Prevent AskUserQuestion from starting background tasks when task controls are unavailable. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Remove the redundant parenthesized domain from the login entry card titles. - -- [#3234](https://github.com/MoonshotAI/kimi-code/pull/3234) [`74d9bd1`](https://github.com/MoonshotAI/kimi-code/commit/74d9bd132e0b056e7d40235070b94bd7d3f4d5f2) Thanks [@xpzouying](https://github.com/xpzouying)! - Send MCP structuredContent to the model only when the tool result has no usable content, avoiding duplicate tool output. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the send and stop button icons rendering too small in the mobile composer. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Present the mobile model picker as a bottom sheet consistent with the other mobile drawers. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the oversized appearance theme cards in the mobile first-run wizard. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Temporarily remove the custom-provider entry from the mobile first-run wizard. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improve mobile UI styling. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix tool-call rows alternating heights on mobile by unifying them to the compact row height. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Collapse the composer model picker to an icon when space is tight; hovering still shows the model and reasoning effort. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the composer permission mode label being hidden even when there is enough space. - -- [#3219](https://github.com/MoonshotAI/kimi-code/pull/3219) [`d1a46db`](https://github.com/MoonshotAI/kimi-code/commit/d1a46db94efe5ed74ad2b665abdb8d697723b81f) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Show the /plugins marketplace catalog as soon as it loads, with latest-version lookups running in the background. - -- [#3002](https://github.com/MoonshotAI/kimi-code/pull/3002) [`d723cc4`](https://github.com/MoonshotAI/kimi-code/commit/d723cc47ee43e5ca3c3c4ec2473f205d44acede2) Thanks [@7Sageer](https://github.com/7Sageer)! - Respect workspace trust and configuration readiness when managing MCP servers. - -- [#3191](https://github.com/MoonshotAI/kimi-code/pull/3191) [`ee53d84`](https://github.com/MoonshotAI/kimi-code/commit/ee53d84fb0d0c1aa023e219b640dfa8faf6c0d38) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix subagents bound to a configured secondary model ignoring its default thinking effort. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix mismatched left and right margins in the sidebar session list, and show the scrollbar only while hovering or scrolling. - -- [#3164](https://github.com/MoonshotAI/kimi-code/pull/3164) [`41a75ad`](https://github.com/MoonshotAI/kimi-code/commit/41a75adfc7a56c2006c93c0b6089cf4457bce20d) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Fix the context usage bar in /usage and the footer showing a stale percentage after the context size or model changes. - -- [#3198](https://github.com/MoonshotAI/kimi-code/pull/3198) [`496bb6c`](https://github.com/MoonshotAI/kimi-code/commit/496bb6ce4e555c11304074c31312c01edf4d773a) Thanks [@sailist](https://github.com/sailist)! - Add a dedicated `[swarm] timeout_ms` config option (or the `KIMI_CODE_SWARM_TIMEOUT_MS` env var) for AgentSwarm subagent timeouts, which no longer follow `[subagent] timeout_ms`. - -- [#3152](https://github.com/MoonshotAI/kimi-code/pull/3152) [`3090c1c`](https://github.com/MoonshotAI/kimi-code/commit/3090c1c4821df5e901c8d92dc9b77341fa16747a) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Restyle background task notifications as a lighter notice that shows the task summary, output files, and output preview directly. - -- [#3239](https://github.com/MoonshotAI/kimi-code/pull/3239) [`6595955`](https://github.com/MoonshotAI/kimi-code/commit/6595955b31a6d03fa5ea702141c7e2c0f00ba050) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Fix foreground subagents being reported as background tasks on the task list. - -- [#3227](https://github.com/MoonshotAI/kimi-code/pull/3227) [`4b04492`](https://github.com/MoonshotAI/kimi-code/commit/4b044926e3ca4bc98916128a9fb4ce2b2906cc4f) Thanks [@7Sageer](https://github.com/7Sageer)! - Save oversized tool output within safety limits for later inspection, report omitted MCP content, and retain partial assistant responses when streams fail. - -- [#3102](https://github.com/MoonshotAI/kimi-code/pull/3102) [`2f12469`](https://github.com/MoonshotAI/kimi-code/commit/2f124693017b100346ae2a4928e7bf67dc679ddb) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Fix the cold transcript rebuild splitting a turn at background-task completion notices; they now fold into the current turn like the live stream does. - -- [#3271](https://github.com/MoonshotAI/kimi-code/pull/3271) [`75c94c4`](https://github.com/MoonshotAI/kimi-code/commit/75c94c4a0e87be084a14096dee2118dfa420a4af) Thanks [@sailist](https://github.com/sailist)! - Fix attached images disappearing from the user message while the agent is working. - -- [#3278](https://github.com/MoonshotAI/kimi-code/pull/3278) [`b17bd61`](https://github.com/MoonshotAI/kimi-code/commit/b17bd61cefba3ea0aef5c61d5cd1085c8cfde065) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Fix the "manually stopped" state lingering after undoing the interrupted turn. - -- [#3157](https://github.com/MoonshotAI/kimi-code/pull/3157) [`491ebd0`](https://github.com/MoonshotAI/kimi-code/commit/491ebd050f421de231fc4c91cdb51f7c100db649) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the reset-time hint in the sidebar usage panel being ellipsized even when there is enough room. - -- [#2200](https://github.com/MoonshotAI/kimi-code/pull/2200) [`30e7f62`](https://github.com/MoonshotAI/kimi-code/commit/30e7f62d2c2c2fdaef785c544a47d0ade3e9788f) Thanks [@wszqkzqk](https://github.com/wszqkzqk)! - Fix file tools and shell working directories failing to resolve Git Bash paths such as /c/Users or /tmp on Windows. - -- [#3281](https://github.com/MoonshotAI/kimi-code/pull/3281) [`7de7b18`](https://github.com/MoonshotAI/kimi-code/commit/7de7b18ee95e65d6627f884194d7dc97d77114a2) Thanks [@sailist](https://github.com/sailist)! - Fix sessions failing to resume when their session journal was truncated or corrupted, for example after a full disk. - -## 0.38.0 - -### Minor Changes - -- [#2862](https://github.com/MoonshotAI/kimi-code/pull/2862) [`3d77620`](https://github.com/MoonshotAI/kimi-code/commit/3d7762003a4a35cbeb8571d471c6898a006152e6) Thanks [@liruifengv](https://github.com/liruifengv)! - Support two OAuth login methods — kimi.ai and kimi.com. - -- [#3060](https://github.com/MoonshotAI/kimi-code/pull/3060) [`8440801`](https://github.com/MoonshotAI/kimi-code/commit/8440801de47ddae29224430048e1228b80cde370) Thanks [@chengluyu](https://github.com/chengluyu)! - Add the WaitFor tool: the agent can now wait for a background task to finish within the current turn instead of ending the turn and being re-invoked. - -### Patch Changes - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Label inline subagent cards in the message stream with their foreground or background mode. - -- [#3121](https://github.com/MoonshotAI/kimi-code/pull/3121) [`3899079`](https://github.com/MoonshotAI/kimi-code/commit/3899079a2c851bd0b3f1cbf1d3d2fd9026fc6abb) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix config.toml entries being lost when the file had a syntax error or was edited outside the app. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Add copy buttons next to the server version and server address in settings. - -- [#3119](https://github.com/MoonshotAI/kimi-code/pull/3119) [`a34d02a`](https://github.com/MoonshotAI/kimi-code/commit/a34d02a64f9b1526ec84e161d8c377654b413624) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Add 13 data sources to the official Kimi Datasource plugin — Chinese government data (NDA/NBS) and standards (GB/HB/DB/TT), eight international organization datasets (WHO, FAO, UNSD, ECB, Eurostat, UNICEF, OECD, FRED), Xinhua Finance, and Caixin. Update the plugin from the Official tab in /plugins. - -- [#3096](https://github.com/MoonshotAI/kimi-code/pull/3096) [`67fbcdf`](https://github.com/MoonshotAI/kimi-code/commit/67fbcdf1ba7dceeebb58875b3b7c81b4b30cf0de) Thanks [@sailist](https://github.com/sailist)! - Edit and Write now require reading an existing file before modifying it, and reject the write when the file changed on disk since it was last read. - -- [#3101](https://github.com/MoonshotAI/kimi-code/pull/3101) [`d96b4a0`](https://github.com/MoonshotAI/kimi-code/commit/d96b4a0149f3ddf3d4910cc6eb87366dbb130ede) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - Stop retrying requests blocked by the provider content filter; the filter notice now shows immediately. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Keep empty workspace groups visible in the legacy sidebar after their last session is archived. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Hide button hover tooltips outside a menu while the menu is open. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Keep the model picker menu on the workspace home within the viewport. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the workspace group title showing untranslated text in the search dialog. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix the settings dialog dropdown list being clipped by the scroll area, and lock the content behind it while the list is open. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Keep the slash command and @ mention panels on the workspace home within the viewport. - -- [#3052](https://github.com/MoonshotAI/kimi-code/pull/3052) [`6595a69`](https://github.com/MoonshotAI/kimi-code/commit/6595a6989a68163e10a85c8edf1726b30d6d2c2b) Thanks [@RealKai42](https://github.com/RealKai42)! - Fix 422 errors from some OpenAI-compatible providers when a conversation includes tool calls. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Prevent text selection in the sidebar user menu and its plan usage submenu. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix slow session list loading when there are many workspaces. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Auto-open the browser authorization page after choosing a login region, redesign the authorization waiting page, and refresh the login state as soon as the window regains focus instead of waiting for the poll. - -- [#3083](https://github.com/MoonshotAI/kimi-code/pull/3083) [`571bcc2`](https://github.com/MoonshotAI/kimi-code/commit/571bcc2f751f02a37b0475b074a1e859c7fc4368) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix the missing OAuth authenticate tool for remote MCP servers that require login. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Upgrade the @ mention menu: file and skill candidates are merged and ranked by match quality, file search is faster, with path-fragment matching and hit highlighting. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Round menu items concentric with their menu frames. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Add a Pin action to the chat header more-menu to pin the current session to the sidebar pinned section. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Allow dragging the divider between the pinned section and the session list to resize both areas, with fade hints at the edges when the pinned section scrolls. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Improve the prompt queue interaction, with per-row steer and send. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Add kimi.com and kimi.ai OAuth login entries, and switch update and help links to the site matching the current login. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Remove sessions archived from another client from the session list immediately, without a manual refresh. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Label the timestamp at the bottom of the session menu as last active and tighten that row's padding. - -- [#3054](https://github.com/MoonshotAI/kimi-code/pull/3054) [`cfc3350`](https://github.com/MoonshotAI/kimi-code/commit/cfc335048378d3708666e11959c8d34507a1d659) Thanks [@Grapedge](https://github.com/Grapedge)! - Collapse long `!` shell command output instead of flooding the transcript. Press ctrl+o to expand or collapse it together with tool output. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Fix misaligned action buttons between the sidebar section headers and the session rows. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Remove the skill-activated card from skill activation messages. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Make skill-activation turns undoable so they can be withdrawn and resent. - -- [#3012](https://github.com/MoonshotAI/kimi-code/pull/3012) [`ca87c58`](https://github.com/MoonshotAI/kimi-code/commit/ca87c58e6205ddf0638e5d737a5f8e939e2132b9) Thanks [@sailist](https://github.com/sailist)! - Sub-agents no longer spawn their own sub-agents by default; custom agent profiles can still allow it explicitly. - -- [#3005](https://github.com/MoonshotAI/kimi-code/pull/3005) [`be8e017`](https://github.com/MoonshotAI/kimi-code/commit/be8e017597b83142282d7e6640076368bf244eae) Thanks [@wbxl2000](https://github.com/wbxl2000)! - Fix background agent rows that could not be stopped right after they appeared, and stray rows left behind when an agent failed to start. - -- [#3046](https://github.com/MoonshotAI/kimi-code/pull/3046) [`f13f379`](https://github.com/MoonshotAI/kimi-code/commit/f13f3790448f64448c76a415500041443ae754e6) Thanks [@7Sageer](https://github.com/7Sageer)! - Fix the model being directed to unavailable tools when it encounters an image or binary file. - -- [#3108](https://github.com/MoonshotAI/kimi-code/pull/3108) [`05f2ad5`](https://github.com/MoonshotAI/kimi-code/commit/05f2ad5ddad1addf10ead6f5274554ca10cde1f4) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: clearing a goal now removes it from the transcript view instead of leaving the stale goal displayed. - -- [#3108](https://github.com/MoonshotAI/kimi-code/pull/3108) [`05f2ad5`](https://github.com/MoonshotAI/kimi-code/commit/05f2ad5ddad1addf10ead6f5274554ca10cde1f4) Thanks [@kimi-agent-bot](https://github.com/kimi-agent-bot)! - web: attachments sent with a prompt now appear in the live transcript immediately instead of only after a reload. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Tighten the row height and spacing of the account menu and its submenus to match the standard menu density. - -- [#3135](https://github.com/MoonshotAI/kimi-code/pull/3135) [`2c5415f`](https://github.com/MoonshotAI/kimi-code/commit/2c5415f930db3edef3e79a4e88c4ee74af123600) Thanks [@liruifengv](https://github.com/liruifengv)! - web: Give WaitFor tool calls a dedicated quiet-line display showing completed tasks, wait timeouts, and how many tasks are still running. - -## 0.37.2 - -### Patch Changes - -- [#3061](https://github.com/MoonshotAI/kimi-code/pull/3061) [`5c661f4`](https://github.com/MoonshotAI/kimi-code/commit/5c661f4610f36481dbf2f9598aa63f49004e4980) Thanks [@wbxl2000](https://github.com/wbxl2000)! - web: the subagent detail panel now keeps the working process fully expanded and drops the end-of-turn timestamp footer. - -- [#3061](https://github.com/MoonshotAI/kimi-code/pull/3061) [`5c661f4`](https://github.com/MoonshotAI/kimi-code/commit/5c661f4610f36481dbf2f9598aa63f49004e4980) Thanks [@wbxl2000](https://github.com/wbxl2000)! - web: Settings gains a Lab tab with a multi-tab sidebar toggle (off by default); when enabled, the sidebar shows the Open / Done / Workspaces tabs. - ## 0.37.1 ### Patch Changes diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-Bv3O_GdH.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-quY55RAx.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-Bv3O_GdH.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-quY55RAx.js index 38fc8733c..6009b18bc 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-Bv3O_GdH.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-quY55RAx.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-lUkT3ZKI.js","assets/index-ClWTW3HX.js","assets/index-BeWF_T60.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-ClWTW3HX.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-lUkT3ZKI.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C10HMhsQ.js","assets/index-BdL5hCoZ.js","assets/index-CiiPSBw1.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-BdL5hCoZ.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-C10HMhsQ.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/DesignSystemView-DYlavtYR.js b/apps/kimi-code/dist-web/assets/DesignSystemView-DYlavtYR.js new file mode 100644 index 000000000..65dfc23ea --- /dev/null +++ b/apps/kimi-code/dist-web/assets/DesignSystemView-DYlavtYR.js @@ -0,0 +1,13 @@ +import{M as z,aD as q,aI as A,aL as n,u as l,v as t,G as o,H as e,F as g,aX as y,bb as k,I as c,bk as s,cx as d,cy as B,cz as x,cA as M,cB as u,cC as I,cD as E}from"./index-BdL5hCoZ.js";const D={class:"ds-page"},H={class:"layout"},V={class:"content"},L={class:"content-inner"},R={id:"tokens"},O={class:"icon-sizes"},W={class:"sz"},N={class:"p-ic",style:{width:"14px",height:"14px"},viewBox:"0 0 24 24",fill:"currentColor"},P={class:"sz"},U={class:"p-ic",style:{width:"16px",height:"16px"},viewBox:"0 0 24 24",fill:"currentColor"},F={class:"sz"},j={class:"p-ic",style:{width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"currentColor"},G={class:"icon-grid"},K={class:"icon-group-label"},J={class:"ic-name"},Y={id:"primitives"},Q={class:"stage-wrap"},Z={class:"stage p"},X={class:"p-pill",style:{color:"var(--p-warning)"}},$={class:"stage-wrap"},_={class:"stage p col"},aa={class:"demo-row"},ta={class:"p-btn primary disabled"},ea={class:"p-spinner sm",viewBox:"0 0 24 24",style:{"--p-accent":"#fff","--p-line":"rgba(255,255,255,.35)"}},ca={class:"stage-wrap"},sa={class:"stage p col"},da={class:"demo-row"},oa={class:"stage-wrap"},ia={class:"stage p col",style:{gap:"0",background:"var(--p-surface)",padding:"0","max-width":"300px","align-items":"stretch"}},na={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},la={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},ra={style:{display:"flex","align-items":"center",gap:"8px",padding:"7px 10px",margin:"1px 6px","border-radius":"8px",color:"var(--p-text)","font-size":"13px"}},va={style:{color:"var(--d-fg-faint)",flex:"none"},width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},pa={id:"chat"},ha={class:"stage-wrap"},ua={class:"stage p col"},ga={style:{"max-width":"560px",width:"100%"}},ma={class:"stage-wrap"},ba={class:"stage p col",style:{"align-items":"center",background:"#fff"}},fa={class:"p-composer",style:{width:"100%","max-width":"620px"}},wa={class:"p-composer-bar"},ya={class:"p-composer-left"},ka={class:"p-pill",style:{color:"var(--p-warning)"}},xa={class:"stage-wrap"},Ta={class:"stage p",style:{background:"var(--p-bg)"}},Sa={class:"am-mock"},Ca={class:"am-mock-row focus"},za={class:"am-mock-row"},qa={class:"am-mock-row"},Aa={class:"am-mock-row"},Ba={class:"dt"},Ma={class:"dw-spin"},Ia={class:"stage-wrap"},Ea={class:"stage p",style:{background:"var(--p-bg)"}},Da={class:"dw-bar"},Ha={class:"dw-pill"},Va={class:"dw-pill"},La={class:"dw-pill on"},Ra={class:"dw-running"},Oa={class:"dw-pill"},Wa={class:"stage-wrap"},Na={class:"stage p col",style:{background:"var(--p-bg)",gap:"var(--space-4)"}},Pa={class:"dw-panel"},Ua={class:"dw-head"},Fa={class:"dw-tab"},ja={class:"dw-chips"},Ga={class:"dw-chip on"},Ka={class:"dw-chip"},Ja={class:"dw-chip"},Ya={class:"dw-chip"},Qa={class:"dw-body col"},Za={class:"dw-row"},Xa={class:"dw-row"},$a={class:"dw-row fail"},_a={class:"dw-row cancelled"},at={class:"dw-panel"},tt={class:"dw-head"},et={class:"dw-tab"},ct={class:"dw-chips"},st={class:"dw-chip on"},dt={class:"dw-chip"},ot={class:"dw-chip"},it={class:"dw-chip"},nt={class:"dw-body grid"},lt={class:"dw-card"},rt={class:"cf"},vt={class:"cm"},pt={class:"cs"},ht={class:"sl"},ut={class:"tm"},gt={class:"dw-card"},mt={class:"cf"},bt={class:"cm"},ft={class:"cs"},wt={class:"sl"},yt={class:"tm"},kt={class:"dw-card fail"},xt={class:"cf"},Tt={class:"cm"},St={class:"cs"},Ct={class:"sl"},zt={class:"tm"},qt={class:"dw-card"},At={class:"cf"},Bt={class:"cm"},Mt={class:"cs"},It={class:"sl"},Et={class:"tm"},Dt="/repo",Ht=z({__name:"DesignSystemView",emits:["close"],setup(Vt,{emit:T}){const S=[{path:"/repo/apps/web/src/components/chat/TurnFilesSummary.vue",added:19,removed:4,hasWrite:!1,statsIncomplete:!1,diff:null},{path:"/repo/apps/web/src/composables/useFilePreview.ts",added:8,removed:1,hasWrite:!1,statsIncomplete:!1,diff:null},{path:"/repo/apps/web/src/components/chatTurnRendering.ts",added:0,removed:0,hasWrite:!0,statsIncomplete:!0,diff:null},{path:"/repo/apps/web/src/lib/toolDiff.ts",added:3,removed:2,hasWrite:!1,statsIncomplete:!1,diff:null}];function m(){}const C=T;function b(){C("close")}let h=null;function f(p){p.key==="Escape"&&b()}return q(()=>{document.addEventListener("keydown",f);const p=Array.prototype.slice.call(document.querySelectorAll('#nav a[href^="#"]')),a=new Map;p.forEach(v=>{const i=v.getAttribute("href");if(!i)return;const w=document.getElementById(i.slice(1));w&&a.set(w,v)});let r=null;h=new IntersectionObserver(v=>{v.forEach(i=>{i.isIntersecting&&(r&&r.classList.remove("active"),r=a.get(i.target)??null,r&&r.classList.add("active"))})},{rootMargin:"-20% 0px -70% 0px",threshold:0}),a.forEach((v,i)=>h.observe(i)),p.length&&p[0].classList.add("active")}),A(()=>{document.removeEventListener("keydown",f),h&&(h.disconnect(),h=null)}),(p,a)=>(n(),l("div",D,[t("div",{class:"ds-topbar"},[t("button",{class:"ds-back",type:"button",onClick:b},"← Back"),a[0]||(a[0]=t("span",{class:"ds-topbar-title"},"Design system",-1))]),t("div",H,[a[146]||(a[146]=o('',1)),t("main",V,[t("div",L,[a[144]||(a[144]=o('
● Design System · v1.0

Kimi Web Design System

This document defines the visual language and component specification for Kimi Web — design tokens, component primitives, the chat interface, theming, and style rules. All UI work is grounded in it: unified, restrained, token-driven, and themeable.

Scope apps/kimi-webComponent primitivesTheme 1 set · 4 customizable colorsLight / dark mode
i
This spec is the single reference when changing the web UI. Before adding or modifying a component, style, layout, or theme, read this document first; color, font, radius, spacing, shadow, z-index, and motion always use the §02 tokens, components reuse the §03 primitives, and the §06 style rules are followed.
01

Design Principles

Every UI decision traces back to the following principles. Kimi Web is a local Agent tool for developers: quick scanning, long stretches of staring, often in the dark — the design serves the task, and is restrained, clinical, and density-first.

  • Consistency —— The same semantics use the same component. The primary button, dialog, input, and badge should each have exactly "one" correct way to be written across the entire site.
  • Hierarchy —— Build a clear hierarchy through size, weight, color, and whitespace; emphasize through "restraint" rather than "bolder and bigger".
  • Proximity —— Group related elements, leave whitespace between unrelated ones. A card's padding, line spacing, and group spacing all come from the same spacing scale.
  • Feedback —— hover / active / focus / loading / success / error all have visible states, and the state language is unified.
  • Breathing room —— Control density with the spacing scale rather than arbitrary pixels; prefer restrained whitespace over cramming controls together.
  • Accessibility (A11y) —— Text contrast ≥ 4.5:1, visible focus rings, touch targets ≥ 32px, and states that don't rely on color alone.
  • Reduction —— The number of colors, radii, shadow levels, and type sizes all converge to a finite set of tokens; delete stray values.
Brand tone (the do-not list): calm, clinical, never exaggerated. Reject purple gradients, glassmorphism, glowing shadows, AI purple / blue glows, endlessly looping fussy micro-animations, "Boost your productivity"-style marketing copy, and using emoji as icons. These are all common tells of AI-generated interfaces (an "AI tell"), deliberately avoided.
i
Declare design intent first (Design Read): before adding a component / page, write one sentence describing its scenario, audience, and tone (for example, "a lightweight tool card embedded in a conversation, for developers, calm and restrained"), then build. If the intent isn't clear, ask one question first rather than defaulting to the nearest existing style.
',2)),t("section",R,[a[7]||(a[7]=o(`
02

Design Tokens

Collapse every visual decision into tokens. Color tokens keep the existing short names and fill out the semantics (lowering migration cost), while spacing, z-index, motion, and font-weight fill in the scales that are currently missing. Every token has: name, light value, dark value, and usage.

i
Naming convention: --<category>-<role>-<state>. For example --color-text-muted, --radius-md, --space-4. To reduce churn, the existing short names (--bg / --ink / --line / --blue …) are kept as compatibility aliases for one release cycle.

Color

Semantic-first, in three layers: background / text / border + accent + status colors. All colors are defined in light / dark pairs, with contrast ≥ 4.5:1.

i
The table below shows the semantic tokens. Each ships a light value in :root and a dark override in the data-color-scheme blocks — for example --color-bg is #ffffff in light and #121212 in dark; --color-accent is the brand blue (#1783ff light / #1a88ff dark). The semantic status colors (success / warning / danger / info) are independent palettes, one set each for light / dark.
bg
#ffffff / #121212
surface
#f5f5f5 / #1f1f1f
surface-sunken
#f5f5f5 / #121212
well
#f5f5f5 / #1f1f1f
surface-deep
#f5f5f5 / #0d0d0d
surface-overlay
#ffffff / rgba(255,255,255,.1)
selected
rgba(0,0,0,.05) / rgba(255,255,255,.1)
fg
rgba(0,0,0,.9) / rgba(255,255,255,.84)
fg-muted
rgba(0,0,0,.6) / rgba(255,255,255,.56)
line
rgba(0,0,0,.13) / rgba(255,255,255,.12)
subtle
rgba(0,0,0,.05) / rgba(255,255,255,.05)
accent (KMBlue)
#1783ff / #1a88ff
accent-soft
#e8f3ff / rgba(26,136,255,.1)
TokenLightDarkUsage
--color-bg#ffffff#121212Page background
--color-surface#f5f5f5#1f1f1fPanel / sidebar / card head
--color-surface-raised#ffffff#292929Raised card / dialog / input
--color-menu-bgrgba(255,255,255,.95)rgba(41,41,41,.95)Floating menu panel — frosted glass over --p-menu-backdrop blur
--color-surface-overlay#ffffffrgba(255,255,255,.1)Field-control fill on raised cards (selects, steppers) — top rung; light tops out at white (the level is carried by the border), dark steps one rung above raised. Floating layers stay at raised
--color-well#f5f5f5#1f1f1fContent well on the page (code blocks, tool-output panels, match/file lists, media thumbnails) — light reuses the sunken recess; dark lifts one rung ABOVE the page, because a true recess (#121212) vanishes into the page there
--color-surface-deep#f5f5f5#0d0d0dDeep chrome plane one step BELOW the page (panel headers, diff gutters) — dark drops under --color-bg so chrome framing stays darker than the content it frames
--color-textrgba(0,0,0,.9)rgba(255,255,255,.84)Body text / headings
--color-text-strong#000000#ffffffMax foreground emphasis — menu-row label & icon on hover
--color-text-mutedrgba(0,0,0,.6)rgba(255,255,255,.56)Secondary text / placeholder
--color-linergba(0,0,0,.13)rgba(255,255,255,.12)Divider / card border
--color-subtlergba(0,0,0,.05)rgba(255,255,255,.05)Subtle hairline — tertiary separators below --color-line (diff-gutter column rules, quiet dividers inside wells)
--color-selectedrgba(0,0,0,.05)rgba(255,255,255,.1)Neutral selected fill (sidebar rows, list pickers) — translucent, never accent-tinted
--color-hoverrgba(0,0,0,.03)rgba(255,255,255,.05)Row hover wash — lighter than the selected fill (hover < selected); translucent, sits on any surface. The global hover rule: transparent-base controls overlay this f1 wash (hover never darkens — never sunken); filled controls use their own hover token (accent-hover, send-bg-hover)
--color-selected-hoverrgba(0,0,0,.08)rgba(255,255,255,.14)Hover of a control RESTING at the selected fill (work cards) — one rung above f2, below f3: hover deepens/brightens a step, never drops below the rest state
--color-inline-code-bgrgba(0,0,0,.03)rgba(255,255,255,.1)Inline-code chip fill — fills.f1 / fills.f2; dark lifts off any dark surface (sunken == bg there)
--color-media-alpha-bg-1≈#858585≈#76797eCheckerboard square A of the <img> alpha canvas — color-mix of --color-bg/--color-text (52/48); applied via --media-alpha-canvas (16px period)
--color-media-alpha-bg-2≈#6b6b6b≈#8c8f93Checkerboard square B (42/58) — both squares stay ≥3:1 against white and black; opaque images cover the canvas
--color-sidebar-bg#f9fbfc#0d0d0dSidebar surface — one step off --color-bg (just under white in light, one step BELOW the page in dark) so the session column reads as its own plane and never brighter than the reading surface
--color-scrimrgba(0,0,0,.4)rgba(0,0,0,.6)Modal scrim — the dark veil behind dialogs/lightboxes (mask.base; legacy hardcoded overlays can migrate here)
--color-scrim-strongrgba(0,0,0,.6)rgba(0,0,0,.75)Stronger scrim for full-screen media previews (mask.strong — the PhotoSwipe image preview backdrop)
--color-text-on-scrim#ffffffsameText drawn on the scrim (captions over the media lightbox)
--color-accent#1783ff#1a88ffPrimary action / link / focus
--color-success#0e7a38#3fb950Success / pass
--color-warning#a9610a#d29922Warning / pending
--color-danger#c0392b#f85149Danger / error / abort

Palette

The palette is the production kimi.com palette (design tokens tokens.json): neutral-gray surfaces, an alpha-based label / fill / separator ramp (labels.* / fills.* / separator.s1), the KMBlue accent, and a true neutral dark ladder (#121212 → #1f1f1f → #292929; the deep chrome plane and sidebar derive one step below at #0d0d0d — the palette has nothing darker than primary).

The ONE deliberate exception is the status hues: success / warning / danger / done keep the app's own WCAG-tuned ramp (≥4.5:1 on the neutral surfaces) — the production status colours (positiveGreen #16c456, orange #ff9500, danger red #ff3849) are too bright against it. Diff add/del bands happen to coincide (both use the production 25% fills in light, 14% in dark).

Surface usage

The surface layers each have a role — choose by "field overlay / raised layer / content well / default flat layer / sunken layer / page background / deep chrome", and avoid treating --p-surface-raised as a universal background. In dark, elevation = lighter: floating layers sit above the content, content wells sit above the page, and chrome planes (sidebar, panel headers) sit below it — never the reverse. One consequence: on the page itself, never use --color-surface-sunken for a content carrier — it equals --color-bg in dark and the fill vanishes; use --color-well. Sunken stays correct INSIDE surface / raised cards, where it is a genuine recess. Field controls (selects, steppers) on a raised card use --color-surface-overlay, the top fill rung; floating layers keep --color-surface-raised — their elevation is shadow + hairline, not a lighter fill.

TokenLightDarkUsage
--p-surface-overlay#ffffff#22272eField controls on raised cards — select, stepper (top fill rung; light = white)
--p-surface-raised#ffffff#1c2128Raised card / dialog / input (raised layer)
--p-well#f3f5f8#13181eCode block / tool output / list carrier directly on the page (content well — light: recessed, dark: one rung above the page)
--p-surface#fafbfc#13181ePanel / sidebar / card head (default flat layer)
--p-surface-sunken#f3f5f8#0d1117Recessed area INSIDE a surface / raised card — never a content carrier on the page (sunken layer)
--p-bg#ffffff#0d1117Page background
--p-surface-deep#fafbfc#0a0d12Panel header / diff gutter (deep chrome layer — below the page in dark)

Borders & hairlines

Three line tokens, three jobs: --color-line is the default structural separator, --color-subtle the tertiary separator that must stay quieter (diff-gutter column rules, quiet dividers inside wells), and --color-line-strong the edge of interactive controls (inputs, selects, secondary buttons). Width is one: 0.5px — every stroke is the same hairline, on static structural edges (card rims, plane seams, header dividers), interactive control rims and floating layers alike. Separation comes from luminance first — planes one rung apart already read as distinct in dark, so their shared edge stays a 0.5px hairline rather than a heavier border; same-rung neighbours (list rows, card head / body) are exactly where a hairline is required. In dark, drop shadows fade on near-black surfaces, so a floating layer's edge IS its hairline — never ship a shadow-only floating surface. (Legacy --line / --line2 alias --color-line / --color-subtle for one cycle; new work references the v2 names.)

Focus ring

All focusable controls (button, input, link, menu item, switch, checkbox) use the focus-ring token uniformly; do not hand-write a box-shadow focus ring.

TokenValueUsage
--p-focus-ring0 0 0 3px var(--p-accent-soft)Default focus ring (link, menu item, switch, checkbox)
--p-focus-ring-strong0 0 0 3px var(--p-accent-soft), 0 0 0 1px var(--p-accent)Strong focus ring (button, primary action)

Text selection

The text-selection color uses --p-selection uniformly (light rgba(23,131,255,.18) / dark rgba(88,166,255,.32)), applied by the global ::selection rule; do not set a separate highlight background.

Disabled state

All disabled controls use opacity:.5 + cursor:not-allowed uniformly; do not separately grey out or recolor.

Font families

Kimi Web uses two font tokens: --font-ui (UI and body, with Schibsted Grotesk for Latin and Noto Sans SC for Simplified Chinese) and --font-mono (code and monospace). Components always reference the variables; do not hard-code font names.

--font-ui · UI & body (Schibsted Grotesk + Noto Sans SC)

Body and UI use self-hosted Schibsted Grotesk for Latin text and self-hosted Noto Sans SC Variable for Simplified Chinese. Platform fonts remain as fallbacks:

--font-ui
--font-ui: "Schibsted Grotesk Variable", "Helvetica Neue", Arial,
+      "Noto Sans SC Variable", "Noto Sans SC", "PingFang SC",
+      "Microsoft YaHei",
+      -apple-system, BlinkMacSystemFont, "Segoe UI",
+      Roboto, Ubuntu, sans-serif,
+      "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  • Schibsted Grotesk first: self-hosted Latin UI and body text, with normal and italic variable faces.
  • Western fallbacks next: Helvetica Neue / Arial for environments where Schibsted Grotesk cannot load.
  • Noto Sans SC Variable next: bundled Simplified Chinese glyphs with a weight range of 100–900.
  • System UI fallbacks last: PingFang SC / Microsoft YaHei, platform UI fonts, and emoji fonts.

--font-mono · Code & monospace

Code, line numbers, diffs, and Bash commands use JetBrains Mono (a self-hosted variable font), falling back to the system monospace. Other tool labels and summaries use the UI font:

--font-mono
--font-mono: "JetBrains Mono Variable", "JetBrains Mono",
+      ui-monospace, "SF Mono", Menlo, Consolas, monospace;

Loading strategy

FontSourceBundledUsage
JetBrains Mono@fontsource-variable/jetbrains-mono✓ self-hostedmonospace / code (--font-mono)
Schibsted Groteskprepare-fonts → app-ui/assets/fonts✓ generated + bundledUI / body / display (--font-ui, --font-display), wght 400-900, normal + italic
Noto Sans SCprepare-fonts → app-ui/assets/fonts✓ generated + bundledSimplified Chinese UI / body, wght 100–900
System UI / CJK fontsoperating systemlate fallback for UI / body
Schibsted Grotesk, Noto Sans SC, and JetBrains Mono are self-hosted. They make no external network requests and work offline; platform fonts remain as fallbacks.

Usage rules

  • Components always use var(--font-ui) / var(--font-mono); do not hard-code font names like 'Schibsted Grotesk' / 'JetBrains Mono'.
  • Body / UI use --font-ui (Schibsted Grotesk for Latin, Noto Sans SC for Simplified Chinese); code / monospace use --font-mono (JetBrains Mono).
  • Schibsted Grotesk is loaded from complete variable faces, including normal and italic styles; font-optical-sizing: auto is enabled globally.
  • Noto Sans SC is loaded from one complete weight-variable WOFF2 asset. Platform CJK fonts stay late in the fallback chain.

Type scale & weight

The user font-size preference is one of four named steps (small / medium / large / xlarge, Medium default) written to data-font-scale on <html>; the step name is persisted, never a px value. The step only moves --base-font; every size token derives additively (default + shift), and line heights are locked to integer px via round(size × ratio, 1px) — never a unitless ratio.

Two token groups share the shift but keep their own ratios: --ui-* for chrome (tight, 1.40–1.50) and --md-* for Markdown content + the composer (loose, 1.56–1.63; body is anchored to the UI body size — the spec's +2px offset was dropped as a product decision — while keeping its own looser line-height ratios). T0/T1 cap at 24/22px on the top steps (built into the tokens via min() — do not remove). Use the .text-ui-* / .text-md-* utility classes; legacy aliases --ui-font-size (→ --ui-b2), --content-font-size (→ --md-b1) and the whole 6-level --text-* ramp (xs→c1, sm→b2−1px, base→b2, lg→t2, xl→t1, 2xl→t0) keep older components on the ramp. Panel titles sit at the base step (--ui-b2); dropdown menu items sit one rung below (--text-sm = b2 − 1px) — both still follow the user's font scale.

Section Title
--ui-t1 · title (cap 22)
Card title
--ui-t2 · subtitle
UI emphasis
--ui-b1 · body strong
UI control / button / form
--ui-b2 · body
Helper text / table
--ui-c1 · caption
Badge / timestamp
--ui-c2 · non-critical only
Markdown H1
--md-h1
Chat body / message bubbles / composer
--md-b1 · prose body
Quote / table
--md-b2 · secondary
Code block / inline code
--md-b3 · weak / code

The fixed product type tokens still define scale-independent defaults: transcript prose enables text-autospace: normal for mixed CJK and Latin text. Drop stray font-weight: 650 / 750; converge on 400 / 500 (regular / emphasis), with a dedicated 600 weight for sidebar section labels.

TokenValueUsage
--font-ui"Schibsted Grotesk Variable", …, "Noto Sans SC Variable", …UI & body (Schibsted Grotesk + Noto Sans SC)
--font-kbd"Schibsted Grotesk Variable", system-ui, sans-serifkeyboard shortcut keycaps
--font-monoJetBrains Mono…code, Bash commands, line numbers, diffs
data-font-scalesmall / medium / large / xlargeuser preference on <html>; sets --base-font (12–18px), Medium = 14px default
--ui-t0…--ui-c2default + --ui-shift, t0/t1 capped via min()chrome type ramp (title / subtitle / body / caption); .text-ui-* classes
--md-h1…--md-b3default + --md-shiftMarkdown ramp (headings / body / secondary / code); .text-md-* classes
--ui-font-size / --content-font-sizevar(--ui-b2) / var(--md-b1)legacy aliases kept on the ramp
--code-font-sizecalc(var(--content-font-size) - 2px)standalone code surfaces (diff view, file preview, tool cards) — one step below body, 12px @ Medium; prose-embedded code stays on the --md-* ramp
--text-xs / sm / base / lg / xl / 2xlc1 / b2−1 / b2 / t2 / t1 / t0legacy ramp, aliased into the scale
--leading-tight/normal/prose/relaxed1.25 / 1.5 / 1.6 / 1.7headings / UI / chat prose / long text
--weight-regular/option-label/medium/ui-strong400 / 475 / 500 / 525body / settings labels / emphasis / compact UI emphasis
--weight-section-label600sidebar section labels

Icon size

Icons use three size tokens uniformly. The global .p-ic default is 16px (--p-ic-md); components pick as needed, and random pixel sizes are forbidden.

TokenValueUsage
--p-ic-sm14pxsmall button, badge, menu item, inline link icon
--p-ic-md16pxdefault (button, icon button, toolbar)
--p-ic-lg20pxToast status icon, empty-state illustration

Icon

Icons always come from the centralized registry lib/icons.ts: in templates use the <Icon name size /> component (components/ui/Icon.vue); for v-html contexts (such as a tool glyph) use iconSvg(name, size). Do not hand-write <svg> — the scripts/check-style.mjs icon-from-registry rule flags stray SVGs. Every glyph shares the 24×24 source grid and currentColor (colour follows text); size uses the three tokens below, and only icons imported in lib/icons.ts are bundled by unplugin-icons at build time. Three collections feed the registry, in this order of preference: ~icons/kimi/* — Kimi Design System icons (24×24 outlined, 1.8px stroke), local SVGs under src/icons/kimi/ registered as a custom collection in the Vite config, used whenever a Kimi glyph exists for the intent; ~icons/tabler/* — Tabler Icons (MIT), for the few gaps it uniquely covers (today: the right-panel toggle); and ~icons/ri/*Remix Icon (Apache-2.0), for the remaining intents the Kimi set does not cover yet. A few glyphs are filed under their intent rather than the upstream asset name (see the lib/icons.ts header). When an icon is missing, prefer a glyph from the Kimi icon set: copy the SVG into src/icons/kimi/ (kebab-case name, monochrome currentColor) and register it — two static imports (component + ?raw string) plus one entry in ICONS; reach for Remix only when no Kimi glyph fits, and never draw paths in a component.

Size scale

`,49)),t("div",O,[t("div",W,[(n(),l("svg",N,[...a[1]||(a[1]=[t("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[2]||(a[2]=e("sm · 14",-1))]),t("div",P,[(n(),l("svg",U,[...a[3]||(a[3]=[t("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[4]||(a[4]=e("md · 16",-1))]),t("div",F,[(n(),l("svg",j,[...a[5]||(a[5]=[t("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])),a[6]||(a[6]=e("lg · 20",-1))])]),a[8]||(a[8]=t("h4",{class:"mini"},"Icon library",-1)),a[9]||(a[9]=t("p",null,[e("Currently registered icons, grouped by purpose. The display order and grouping are defined by "),t("code",null,"ICON_GROUPS"),e(" in "),t("code",null,"lib/icons.ts"),e(" (a hand-maintained array covering the same icon names), and this catalog is rendered directly from that array so the registry and the document never drift.")],-1)),t("div",G,[(n(!0),l(g,null,y(s(B),([r,v])=>(n(),l(g,{key:r},[t("div",K,k(r),1),(n(!0),l(g,null,y(v,i=>(n(),l("div",{key:i,class:"icon-cell"},[c(s(d),{name:i},null,8,["name"]),t("span",J,k(i),1)]))),128))],64))),128))]),a[10]||(a[10]=o('

Do not use emoji as functional icons. The Kimi brand mark (the robot mascot logo) is a brand asset and is not part of this icon system.

A few special graphics are not in the registry; each has a dedicated component maintained in one place, and must not be copied by hand: <ContextRing :pct /> (the Composer context progress ring, data-driven), <AuthStateIcon kind /> (the success / expired / error colored illustrations in the login flow), <Spinner /> (loading state). Status dots (such as in the Provider list) always use CSS dots (border-radius:50%), not SVG. The scripts/check-style.mjs icon-from-registry rule exempts the above and the brand mark; all other hand-written <svg> is flagged.

Spacing

A 4px base grid. All spacing, gaps, and padding inside and outside components come from this scale — no arbitrary pixels.

--space-1 · 4
icon gap, badge padding
--space-1-5 · 6
workbar pill icon ↔ label
--space-2 · 8
control gap, small padding
--space-3 · 12
button padding, form-item gap
--space-4 · 16
card padding, grid gap
--space-5 · 20
dialog padding
--space-6 · 24
section gap
--space-8 · 32
large section gap

Dense list (sidebar / file tree)

High-density navigation lists like the sidebar share one rhythm, all on the 4px grid: in-row vertical padding --space-1 (4px), no margin between rows (the hover pill provides the separation); section gap (between logo / search / action buttons / group title / list) uniformly --space-2 (8px); between groups --space-2; the brand header is slightly looser at the top (--space-3). When building similar lists, reuse this scale — do not hand-write 1/6/7/10px.

Radius

Merge the existing 14 values into the nearest of 7 scale steps. Rule: the component type determines the radius, not the author's feel. The Composer shell is the sole product-specific exception: its 32px radius pairs with superellipse(1.5) so the flatter curve stays visually concentric with its controls.

xs · 4
sm · 6
md · 8
lg · 12
xl · 16
2xl · 20
composer · 32 / 1.5
full · 999
TokenValueUsageMerged from
--radius-xs4pxsmall badge, inline tag2/3/4px →
--radius-sm6pxsmall button, icon button, menu item5/6px →
--radius-md8pxbutton, input, badge, card7/8/9px →
--radius-lg12pxmenu, toast, bubble, floating card10/12px →
--radius-xl16pxcontainer baseline: dialogs, settings cards, sheets, work panel13/16px →
--radius-2xl20pxworkspace attachment card bottom (0 0 2xl 2xl) tucked under the composer18/20px →
--radius-composer32pxComposer shell, with --corner-shape-composerproduct-specific
--radius-menu-rowvar(--radius-sm)Menu rows inset 6px inside the plain --radius-lg menu frame (concentric: 12px − 6px hug)product-specific
--radius-full999pxpill badge, avatar, send button999px / 50%

Elevation & z-index

Shadows express only "elevation", never decoration (no colored glow). z-index is unified into a scale, eradicating 9999-style one-upping.

sm · dropdown menu / sticky
md · Toast
lg · overlay (reserved)
xl · dialog
Z-index TokenValueUsage
--z-base0normal flow
--z-raised1in-component local stacking (menu scroll thumbs, strip badges, floating pills) — never a global layer
--z-sticky100sticky header / sidebar
--z-dropdown200dropdown menu
--z-overlay300overlay / bottom Sheet
--z-modal400dialog — sibling overlays tie-break by DOM order, so the global confirm (ConfirmDialogHost) mounts on demand to always land last / on top
--z-modal-dropdown500menus / popovers that open above a modal dialog (teleported to <body>, e.g. the settings SecondaryModelPicker cascade)
--z-toast600toast
--z-tooltip650tooltip bubble — transient and pointer-events none, so it sits above everything (dialogs, toasts) to stay visible anywhere
--z-max9999reserved: only this tier for extreme fallback

Motion

TokenValueUsage
--ease-outcubic-bezier(0.16, 1, 0.3, 1)enter, hover, expand
--ease-in-outcubic-bezier(0.4, 0, 0.2, 1)panel width, layout changes
--duration-fast120mspress, focus
--duration-base160mshover, show/hide
--duration-slow260msdialog, Sheet, layout
--duration-hover-intent250mshover-intent reveal gate (TOC rail)
--duration-spin700msspinner rotation period (mention-tip probe spinner)
--duration-flash1200msone-shot attention flashes (search locate, provider-row added) — a highlight timeout, past the show/hide ramp on purpose
--anim-rive-spin416.7msnew-chat / folder-plus icon: plus spin on hover
--anim-leftbar533.3mssidebar toggle icon: arrow fly-in on hover
--anim-leftbar-shrink200mssidebar toggle icon: divider shrink on hover

The --anim-* lengths are track timings ported verbatim from the designer's Rive exports, so they sit outside the --duration-* ramp on purpose — retiming the ramp must not distort them. Their interpolation stays linear because the easing is already baked into the dense keyframe stops; a token easing would double-apply. Three hover tracks use them today: the sidebar toggle shrinks its divider to half height while an arrow flies in and settles (the expand variant mirrors the track from the left), and the new-chat / folder-plus pluses do one bouncy spin. Each track is keyed to an id inside its own glyph (#bar-divider, #bar-arrow / #bar-arrow-expand, #p1, #af-p1) so every instance of the icon animates, and all revert on mouse-out. They still fall under the global reduced-motion switch below.

Reduced motion

i
Under @media (prefers-reduced-motion: reduce), all animation and transition durations drop to about 0.001ms (effectively off), and the chat working indicator's mascot renders its static fallback instead of the Rive loop. Components should not check this individually; it is handled uniformly in the global styles. The switch clears durations, not transition-delay: a hover-intent gate (the conversation TOC's 250ms reveal) decides whether hidden content appears, and clearing it would make pointer fly-bys strobe content for reduced-motion users.

Layout & breakpoints

Layout sizes and responsive breakpoints are tokenized too: sidebar width, content reading-column width, and two global breakpoints. Components should not hard-code pixels.

TokenValueUsage
--p-sidebar-w264pxleft session sidebar width
--p-content-max760pxchat reading-column max width (regular chat prose)
--p-content-wide920pxwide content (settings / panel)
--p-table-max1040pxdesktop wide-table max width (see §04)
--p-table-cell-max700pxmax width of a single table column; longer cell content wraps (see §04)
--p-bp-sm640pxmobile / desktop boundary
--p-bp-md980pxnarrow / wide screen boundary
i
At ≤640px: dialogs become bottom Sheets, the sidebar collapses into an expandable drawer, and Composer toolbar controls are allowed to wrap.
',24))]),t("section",Y,[a[27]||(a[27]=o(`
03

Primitives

Component primitives are the "smallest correct units" of the site UI. Each primitive exposes variants along only two dimensions — variant / size — with appearance driven by tokens, so it naturally supports light / dark mode and customizable theme colors.

i
For every interactive primitive, the keyboard behavior, focus, and ARIA contract are in §08 Accessibility. New primitives must ship with a keyboard model — mouse-only interaction is not enough.

Component selection guide

ScenarioUse
Primary action (submit / confirm)Button variant=primary
Secondary action / cancelButton secondary / ghost
Destructive action (delete / abort)Button danger / danger-soft
Status markerBadge
Toolbar filter / model switchPill
2–5 mutually exclusive optionsSegmentedControl
Top tabsTabs
Switch / multi-selectSwitch / Checkbox
Scrollable regions with overlay controlsScrollArea
Floating content card / list action menuCard / Menu
Inline notice / global toastBanner / Toast
Dialog / confirmation · bottom panel (mobile)Dialog / Sheet

Button

4 semantic variants × 3 sizes. The primary action primary takes its color from the current theme color (§05 can switch between the blue and black families). Radius uses --radius-md uniformly (small size --radius-sm), weight 600, with a visible focus ring.

Variant matrix lightpreview
medium · default
small
With icon / state
Dark skin dark

API

Button.vue · usage
<Button variant="primary" size="md" :loading="submitting">Save</Button>
+    // variant: primary | secondary | ghost | danger | danger-soft
+    // size:    sm | md | lg
States

IconButton

Unified into three sizes — 26 / 32 / 44px — with the neutral --color-hover wash on hover and a visible focus ring. Replaces the ad-hoc icon + click areas scattered across components today.

IconButton
i
The desktop IconButton comes in sm 26 / md 32; on touch devices the tap target should be ≥ 44px, so use lg 44px, satisfying the §01 accessibility principle (the mobile three-piece set uses lg). Icon-only buttons must also name themselves on hover: pass tooltip (usually the same text as labellabel alone only sets the aria-label); bare icon <button>/<a> triggers wrap the Tooltip component directly.

Badge · Chip · Pill

Collapsed into two kinds: Badge (status badge, with an optional status dot) and Pill (the clickable pill in the composer toolbar). Radius, font size, and padding are all unified.

Badge · status badge
Semantic variants
pendingrunningcompletedneeds confirmationfailedKIMI
With icon / small size
planpassedread-only
`,19)),t("div",Q,[a[14]||(a[14]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Pill · toolbar pill (composer)")],-1)),t("div",Z,[a[12]||(a[12]=o('kimi-k2· thinking',1)),t("span",X,[c(s(d),{name:"shield-question",size:"sm"}),a[11]||(a[11]=e("yolo",-1))]),a[13]||(a[13]=t("span",{class:"p-pill"},[t("svg",{class:"p-ic",viewBox:"0 0 24 24",fill:"currentColor"},[t("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"})]),e("12k / 200k")],-1))])]),a[28]||(a[28]=o(`

Kbd · keyboard shortcut

Kbd renders a shortcut as keycaps — one block per key, never inline text like (⌘K). Caps are 18px tall (Badge sm rhythm): transparent ground with a 0.5px hairline edge, 11px --font-kbd (Inter + system-ui), text colour inherited from the row that carries it — the cap has no fill or colour of its own, so it follows its context (bright inside the accent-ringed recording box, quiet in a hint row). Typical placement: pushed to the row's trailing edge, opposite the label (e.g. the sidebar search row), and inside dialog navigation hints.

Kbd · keycaps
KCtrlKP

Card / Surface

All cards across the site share one structurehead / body / foot — and come in two tiers by visual weight:

  • Operation card —— composite "process" content such as the Swarm overview. (Individual tool calls are NOT cards anymore: they render as quiet borderless lines, see §04.) Flat shell: 0.5px hairline, --radius-md, no shadow. The head is compact mono with no fill, low weight by default, not competing with the conversation.
  • Attention card —— content that needs a user decision, such as Question / Approval. A floating neutral card: white raised surface, --radius-lg, a faint popover shadow (--shadow-menu), a plain dark title head, and a hairline footer whose actions read in number-key order (chips on the buttons) leading to one solid primary action. No semantic color band.
Operation card · compact mono head (no fill)
read_filesession.ts
The head uses mono + a neutral background to emphasize its "code / process" nature; the body uses sans for readability. Flat, radius-md, same shape as the Swarm composite card.
Attention card · floating neutral surface (no color band)
A decision needs your confirmation
A floating neutral card — no color band. The raised surface, large radius and soft shadow lift it above the transcript; the head is a plain dark title, and the hairline footer lines up quiet text buttons leading to one solid primary action.
Activity run · a summary row expands into the folded lines
Read 2 files
Readsession.tssrc/auth34 lines
Readmiddleware.tssrc/auth58 lines
  • One structure, two shells: every card is head / body / foot; operation cards are flat + 0.5px hairline + radius-md with no shadow, while the attention card is the single exception — raised surface, radius-lg and a soft shadow, because it floats above the transcript in place of the composer.
  • Differences are intentional: operation cards keep a compact mono head; attention cards get a plain dark title head and footer actions.
  • Grouping: consecutive activity (thinking + tool calls of any kind, cards included) folds into ONE activity-run row — a smart summary sentence that expands into the items in order; only text and successful media tools (inline media is the turn's output) stay out and break the run (see §04).
  • Turn fold: once an assistant turn settles, everything before its final text block (thinking, activity runs, interim text, standalone cards) folds into ONE bare "Worked Ns" row — no glyph, a faint one-line label + rotating chevron sharing the activity-run head's padding and hover language; while the turn streams the row stays hidden and the body forced open, and on settle the row appears and folds itself back. The span is the turn's elapsed time (daemon duration once settled, server message stamps for history; approval/question waits included by design), reading the generic "Work details" without any stamp. The final text — and anything after it, so trailing media / cards stay on screen — never folds; a text-only turn renders no row at all (see §04).
  • Status dots: running (pulsing blue) / done (green) / failed (red), sharing one color vocabulary (see §04 tool calls).

Input / Select / Textarea

Unified 38px height (32px small), --radius-md radius, --color-surface-overlay background, and a unified blue focus ring (0 0 0 3px accent-soft). Select is a custom combobox and listbox, not a native <select>; opening it centres the selected option in the scrollable menu. Open Select roots enter the dropdown layer; containing settings groups temporarily release clipping and join that layer so later sections cannot cover the menu.

Form primitives
Only letters, numbers, and hyphens are allowed.
States
Please enter a valid workspace name
Normal state · validation passed

Code / Diff

Diff controls: The non-selectable branch summary starts with a 14px branch icon, aligns to the panel header's 12px inset, uses 12px labels, and ends with a 0.5px hairline. List and tree choices use the 14px list and tree-view registry icons. Flat-list and tree-view paths use the UI font at 12px. Tree roots share the flat list's 14px content inset, then each depth advances by 12px and adds a grey indentation rule.

Diff empty state: Centre the clean-workspace message in the available panel height and lead with a quiet 32px status icon.

Diff detail body: the right-side diff detail reuses HighlightedCode unframed (the panel owns the edge and scroll) — shiki highlighting with the language inferred from the file path, an old/new line-number gutter, hunk headers as a muted band, at the shared code size --code-font-size (12px at Medium, one step below body text). The file preview's code body (text / JSON / HTML and Markdown source) renders through the same component with a per-row number gutter plus search-hit / jump-target row states.

Inline code, code blocks, and diff contents use the monospace font (--p-font-mono); diff change counts and branch summaries use the UI font. Code blocks have a filename title bar and a copy button; the action edge uses a compact 6px inset. Diffs use + / - row colors to express additions and deletions — additions use a success light background, deletions use a danger light background, with no gradients.

Code / Diff
inline code
The server uses jwt.verify(token) to verify the signature, returning 401 on failure.
code block
session.ts
import { verify } from './jwt';
+
+    export function auth(token: string) {
+      return verify(token, process.env.JWT_SECRET!);
+    }
diff
session.ts · +3 -1
import { verify } from './jwt';
-const secret = 'dev-secret';
+const secret = process.env.JWT_SECRET!;
return verify(token, secret);

Dialog

One dialog primitive replaces 6 hand-written implementations: unified --radius-xl radius, --shadow-xl shadow, 20px head padding, right-aligned footer actions, and an IconButton close button.

Dialog primitive
New chat
Create an independent Agent chat in the current workspace.
i
Size & height: Dialog offers three widths — md 440 / lg 640 / xl 760 (--p-content-max) — chosen by content weight. Height comes in two kinds: auto (default, grows with content up to max-height) and fixed (constant height min(680px, 100vh - 64px), with overflow scrolled inside the body). Content / multi-tab dialogs (settings, model picker, provider manager, folder browser) always use fixed so the frame size stays constant and doesn't jump when switching tabs or content length; short confirmation dialogs keep auto. Selectable controls inside Settings use 0.5px hairlines. Its navigation stays transparent on the grouped canvas — separated from the content region by the 0.5px hairline (horizontal in the stacked mobile layout) — and uses 12px labels at weight 525 with 16px registry icons; the selected tab paints the same neutral --color-hover wash as hover, with the label simply brightening to --color-text — the Kimi app settings nav's recipe (.ss-nav-item--activeFills-F1, no accent tint, no weight change); section captions use 16px UI text in --color-text. Every setting row has a plain-language description; option labels use --color-text at weight 475 with a 1px gap before that description. Chinese descriptions use “思考” and “计划模式” rather than the English terms; “skills” stays lowercase when it appears within a sentence. Every settings section puts its rows inside one rounded group with 0.5px dividers; the content region paints the flat --color-surface so each group (--color-surface-raised) reads one rung above it — never a sunken pit, which would sink the dialog's content below its chrome in dark. The font-size stepper is a compact 32px UI-font control with 12px values and custom minus and plus buttons. Its 52px desktop row centres the control with equal space above and below. Archived workspace headings reuse the sidebar’s folder-closed registry icon, and Restore actions lead with the undo icon. Archive counts use weight 500; timestamps and workspace paths use the UI font.

Dialog backdrop: Use a restrained 28% neutral overlay so the workspace remains legible without competing with the modal.

Settings regions: The settings title and close action belong to the right content region. The navigation is a separate full-height region that starts at the dialog's top edge, not content beneath a dialog-wide header.

Archived sessions: Start with the localized page title. Do not add a repeated English kicker above it.

Settings interaction: Notification labels and descriptions are not selectable; their switches remain fully interactive.

Conversation chrome: Header labels are not selectable; the rename input remains selectable and editable. Branch names start with a 14px branch icon. The overflow trigger is a compact 24px control with a 14px icon. Below a 720px header container, hide the workspace prefix and give the conversation title the available width. On macOS desktop the header doubles as the window-drag region and interactive controls opt out with no-drag; while one of its menus or a dock work panel is open every window-drag strip (chat header, sidebar header, panel header) drops the drag region so an outside press anywhere reaches the page and dismisses the overlay (window dragging is simply paused).

Session search: follows the §09 flush picker anatomy — a boxed Input under the head, and a result list that fills the body's available height and owns vertical scrolling.

Model picker: follows the §09 flush picker anatomy; the provider filter remains horizontally scrollable without showing a persistent scrollbar. Only the model list scrolls; the shortcut bar remains pinned at the bottom.

Toast

Unified information architecture: status icon + title + description. The status color appears only on the icon, avoiding large colored areas that create visual noise. For an undoable action there is a second, lighter form — the Action toast (ActionToast.vue): a pill floating top-center just below the 48px header, carrying a one-line sentence whose actions are plain inline <button>s (styled accent by the component), plus close. Self-timed (default 8s, hover pauses); the parent re-keys to reset and wraps it in a <Transition>. First used by session archive (Undo / Settings); warnings keep the bottom-right Toast stack.

Toast
Connected to server
The local server is responding normally; you can start a new chat.
Context usage 82%
Consider running /compact to free up space.
Action toast
or view archived chats in

Spinner

Loaders fall into two categories by scenario — do not mix them:

  • Spinner (plain · SVG ring) —— the default loader. Used for button loading, app startup (GlobalLoading), and general inline waits — "everything else".
  • WorkingIndicator (小蓝 mascot · brand signature) —— used only for the chat working state after a prompt is sent (the sending placeholder in ChatPane, the send → first-token loading in SideChatPanel). The label follows the phase: "Requesting…" until the assistant's reply starts, then "Working…".

Spinner · plain loader (default)

`,39)),t("div",$,[a[18]||(a[18]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Spinner · common scenarios")],-1)),t("div",_,[t("div",aa,[a[17]||(a[17]=o('Loading…',2)),t("button",ta,[(n(),l("svg",ea,[...a[15]||(a[15]=[t("circle",{class:"track",cx:"12",cy:"12",r:"9"},null,-1),t("circle",{class:"arc",cx:"12",cy:"12",r:"9"},null,-1)])])),a[16]||(a[16]=e("Submitting",-1))])])])]),a[29]||(a[29]=t("h4",{class:"mini"},"WorkingIndicator · 小蓝 mascot (only the chat working state)",-1)),t("div",ca,[a[20]||(a[20]=t("div",{class:"stage-bar"},[t("span",{class:"st"},[e("WorkingIndicator · chat working state only "),t("span",{class:"tag spec"},"signature")])],-1)),t("div",sa,[a[19]||(a[19]=t("span",{class:"stage-label"},"Usage · only while the chat has an unfinished prompt",-1)),t("div",da,[c(x,{label:"Requesting…"}),c(x,{label:"Working…"})])])]),a[30]||(a[30]=o('
i
The chat working state is rendered uniformly by WorkingIndicator — the 小蓝 mascot (KimiMascot, the kimi.com avatar Rive asset, with a static SVG fallback under reduced motion or when the runtime fails) plus a phase label. All other loading states use the plain Spinner.

Link

Inline text link: the default is the accent color with no underline; on hover it shows an underline and darkens. File links inside inline code use a 1.5px underline offset so the line stays clear of the chip background. The .muted variant uses the secondary text color. Used for in-text jumps, external links, "view all", and other lightweight actions.

Link · inline link
Read the full design token docs before building.View on GitHubView history

Menu / Dropdown

Desktop menus use a 3.5px panel inset. Standard items use 5px × 9px padding and a 7px icon gap. Their three-layer neutral shadow stays below 4% opacity.

Dropdown menu panel: frosted glass — the translucent --color-menu-bg fill over a blurred, saturated page backdrop (--p-menu-backdrop) — plus hairline + light shadow (--shadow-menu, a three-layer neutral ramp). This is the one place glassmorphism is the design language rather than an exception (§06); every floating menu surface (Menu.vue, the Select listbox, composer dropdowns, slash/mention popups) uses the token pair, never ad-hoc blur values. Menu items support icons, the current (active) state, the danger state, and the disabled state, with separators grouping items. All menu actions use 13px labels at weight 475 with 16px leading icons; both share a 16px line box for vertical alignment. Menu timestamps use the UI font. On touch / mobile, use lg (≥44px row height) while keeping the same type size. A dropdown menu pops in from its trigger corner — fade plus a slight 0.97 scale over --duration-base (exit --duration-fast), the composer model dropdown's motion language; the transform origin and the nudge direction follow the anchoring, including the upward flip near the viewport edge.

Row states: hover uses the mode-aware --color-hover wash (it lightens under dark, never darkens); a leading icon sits one rung below the label (--muted), and on hover both label and icon step up to --color-text-strong, the max foreground tier. Selection keeps the accent pair (--color-accent-soft / --color-accent-hover); danger keeps its own colour.

Menu · dropdown menu
Open file
Selected item
Disabled item
Delete chat

SegmentedControl

Mutually exclusive short option groups, commonly used for 2–5 option switches such as "light / dark / follow system" or the four font-scale steps. Options may include a 14px registry icon or a colour swatch. A single raised indicator with a soft shadow (no border — the edge stays clean) slides and resizes between options using the standard motion tokens. Three sizes: md (default, settings pages), sm (compact rows), and xs (dense menus such as the composer model dropdown — 20px items, 12px labels).

SegmentedControl
LightDarkFollow system

SecondaryModelPicker

Linked model + thinking-effort picker (settings → Agent → Subagents, experimental; components/settings/SecondaryModelPicker.vue, shared by both ends). Use it whenever two choices are only valid as a pair — here an effort is meaningless without its model, and every model declares a different supported set. It is a cascading variant of the §03 Select: the trigger is the Select trigger verbatim (value renders model · effort, the unset state uses the placeholder tint), and the dropdown opens as a SINGLE-LEVEL model list (grouped by provider) on the floating menu surface (--color-menu-bg / --p-menu-backdrop / --shadow-lg). The menu teleports to <body> with position: fixed — it opens on top of the settings modal (on the --z-modal-dropdown rung), and only a body-level surface escapes the dialog's scrolling-body clip; it re-anchors to the trigger on any outside scroll and closes on window resize (the UserMenu teleport's full recipe). Hovering or clicking a model row flies its effort submenu out to the RIGHT of the row — same menu surface, anchored to the row's live position, flipping to the left only near the viewport edge per the §03 anchoring rules — with a 250ms hover-intent grace (the UserMenu flyout's recipe) so the diagonal path into the submenu doesn't collapse it. Every model row carries a trailing chevron-right affordance; clicking an effort confirms the pair and closes — one atomic write, never two staggered patches. Flyout options follow the composer's thinking-level model (segmentsFor): effort models get off + their declared levels (always-thinking ones get no off), boolean-thinking models get on/off, unsupported models get off alone; while no effort is set at all, a "Model default" entry leads (it writes the model alone — POST /config merges and cannot clear a stored effort, so the entry disappears once one is set). A configured effort the model no longer declares is appended as an extra flyout option so the current pair stays visible and re-selectable. Keyboard mirrors the Select contract (focus stays on the trigger, Esc preventDefaults so the hosting dialog does not close): ↑/↓ move within the active level (the flyout follows model moves), → opens the flyout, ← collapses it, Enter confirms, Home/End jump. ARIA: combobox trigger → dialog menu holding a model listbox plus the effort listbox flyout with option rows. The menu itself flips upward when the trigger sits near the viewport bottom.

Tabs

Tabs with a bottom hairline, used for grouping and switching sibling content. The current tab is marked with accent text + an accent underline.

Tabs
GeneralAgentAdvanced

Switch

A two-state switch for settings that take effect immediately. The 36×20 track has a 0.5px hairline and full radius; its 16px knob uses 1.5px internal offsets so the visible inset remains 2px and symmetric after accounting for the border. On hover, the knob eases to an 18px rounded rectangle towards the track centre. When on, the track turns accent and the knob slides right.

Switch

Checkbox

A 17×17 checkbox. When checked it fills with the accent color and shows a white tick (inline SVG). Often paired with a text label.

Checkbox

Avatar

A 32px default avatar with md radius; .sm is 24px. Can hold an initial or an icon; falls back to this placeholder when there is no image.

Avatar
KK

EmptyState

A centered placeholder for empty lists / panels: a 48px faint icon + title + hint, avoiding blank pages.

EmptyState
No chats yet
Click "New chat" to start a conversation with Kimi

Divider

A 0.5px hairline divider (--p-line); .p-divider-v is the vertical divider, used between inline elements.

Divider
Content above

Content below
kimi-k2thinking

Tooltip

A CSS-only hover hint, wrapped in .p-tip. Inverted background (--p-text / --p-bg), single line, no wrapping — carries only short notes.

Tooltip (hover the button)
New chat

Banner

An inline notice bar placed at the top of a content area. Three states — .info / .warning / .danger — each with a matching 18px icon.

Banner
Connected to server
Currently in yolo mode; tool calls will run automatically

Sheet / BottomSheet

A mobile bottom slide-up panel: xl top radius + drag handle, xl shadow. At ≤640px, dialogs become bottom-anchored Sheets.

BottomSheet
Choose a model
kimi-k2 · thinking
kimi-k2 · instant

Skeleton

A placeholder for loading content, using a breathing opacity animation (no gradients), following the no-gradient-text rule. Composed into titles / text lines / avatars.

Skeleton

Command Bar

An inline combination of "primary action + command text + copy", sitting between a button and a code block — used for install / onboarding / one-click execution. The primary action reuses Button primary; the command area uses a mono light-grey background.

Command Bar
curl -fsSL https://code.kimi.com/install.sh | bash

TopBar

The application top bar. Solid by default; the .frost variant is translucent + background blur, used only for sticky navigation bars. Together with the floating menu surfaces (Menu / Dropdown), it is one of the two exceptions to the no-glassmorphism rule (see §06).

TopBar · solid / frosted glass
Solid TopBar
Frosted-glass TopBar · .frost

Find Bar · transcript search

The in-transcript find bar (Cmd/Ctrl+F), implemented by components/chat/TranscriptSearch.vue. A floating card pinned to the transcript's top-right (top: --panel-head-h + --space-3, right: --space-3 — equal inset on both axes), --z-sticky, raised surface + 0.5px hairline + --shadow-menu. One radius for both states: --radius-2xl is a full capsule at the collapsed height and a card once the footer expands — never animate between two radii.

PartRule
Input rowSearch icon (muted) + bare input — the list-style bare-input exception family (sidebar search row, inline rename), NOT the boxed Input primitive; the 38px bordered control would break the pill. Circular close IconButton sm (concentric with the capsule end); a 0.5px hairline separator before it. Height comes from the grid: 32px control (--space-8) + 2× --space-1 padding = 40px — at which --radius-2xl is exactly the half-height capsule.
Footer (results)Expands via the 0fr→1fr grid fold (--duration-slow), hairline top separator, prev/next IconButton sm left, right-aligned muted count (N/M results · --ui-font-size-sm). Only exists once a query has settled — while typing or empty, the bar stays a bare pill.
Statescollapsed (empty query) / searching (Spinner sm in the input row during the ~800ms debounce) / results / no-results (count reads "No results", nav disabled). Disabled is uniformly opacity:.5.
FocusComposer-style: a neutral hairline overlay (::after + --color-composer-focus-line) fading in on :focus-within. No accent ring.
Match inkCSS Custom Highlight API — the bar mutates no transcript DOM. All matches: --color-search-match (yellow); current: --color-search-match-current + a 2px --color-warning outline ring (a positioned overlay — highlight pseudos can't paint box outlines). Tokens live in app-ui/style.css with light/dark pairs.
KeyboardCmd/Ctrl+F opens + focuses (repeat = re-focus + select-all; hardcoded, reserved in the desktop keymap), Enter / Shift+Enter steps matches (wrapping), Esc closes from ANY control inside (container-level, so it never reaches the conversation's Esc-abort).
Matching semanticsRendered transcript DOM only (unloaded older pages are out of scope), capped at 1000 matches (count reads N/1000+). Matches span inline nodes within one block, never cross block breaks; inert and display:none content is excluded. Stepping scrolls the match's own rect into view, not its parent element.

SectionLabel

A small group title for sidebar lists, used to section the content below (such as Workspaces in the sidebar). Spec: 13px / 700 / uppercase / letter-spacing .08em, color --color-fg-faint; left-aligned to the row's starting padding (--sb-pad-x), keeping the same indent as the group rows below. For scripts without case (such as Chinese), text-transform:uppercase simply has no effect — no special handling needed.

',55)),t("div",oa,[a[26]||(a[26]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Sidebar · group title")],-1)),t("div",ia,[a[25]||(a[25]=t("div",{class:"p-section-label",style:{padding:"12px 16px 4px"}},"Workspaces",-1)),t("div",na,[(n(),l("svg",la,[...a[21]||(a[21]=[t("path",{fill:"currentColor",d:"M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])),a[22]||(a[22]=e(" kimi-code-web ",-1))]),t("div",ra,[(n(),l("svg",va,[...a[23]||(a[23]=[t("path",{fill:"currentColor",d:"M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])),a[24]||(a[24]=e(" playground ",-1))])])])]),t("section",pa,[a[136]||(a[136]=o('
04

Chat Interface Overhaul

The message stream is the core of Kimi Web. Tool calls render as quiet activity lines — one borderless line per call, bespoke per tool kind, auto-grouped, expanding on demand — while Question / Approval elevate to a floating neutral surface because they need a decision, and the Swarm composite keeps a card; the Composer collapses into a single rounded container.

Unified message stream

User-message bubbles follow the kimiwork production recipe (MessageItem .user-bubble): a neutral --color-user-bubble-bg fill (BubbleGray — #f5f5f5 light / #292929 dark), uniform --radius-lg corners, no border, no shadow.

Message timestamps use 12px UI text at weight 500, matching the compact metadata scale without switching to a monospace face.

The user-message metadata row sits one 8px spacing step below the bubble, so its actions and timestamp read as supporting information rather than part of the bubble edge.

Overlong user messages clamp at 10 measured lines, the tail dissolving through an alpha mask rather than a tint overlay (the translucent accent fill would double-composite); a floating pill toggle centred on the fade expands in place and collapses back, and the collapse pins the toggle itself so the reading position survives. Skill / plugin command args clamp through the same wrapper, beside the card head. Like the transcript's other disclosure controls (thinking row, turn fold, tool lines), the toggle is a bare native button carrying aria-expanded — chat-surface disclosure controls do not use the §03 Button primitive.

The floating jump-to-latest control uses 12px UI text at weight 525, led by the full down-arrow icon rather than a disclosure caret.

Thinking is an inline, borderless disclosure row in the message stream — never a side panel. The k15 bulb (the thinking registry icon) leads the row in every state; while streaming the "Thinking…" label breathes (opacity only, never a gradient shimmer) and whole elapsed seconds tick beside it, afterwards the label settles to "Thinking process" with the final span as · Ns (renderer-measured, live sessions only — history shows no seconds). Collapsed by default, it expands in place with the standard grid-rows animation and a 90° chevron rotation, and it folds itself back once the stream moves past it, even if the user expanded mid-stream. The header only animates its text colour on hover (standard duration and easing tokens), no card shell.

Conversation · 760px reading column
Please change the login endpoint to JWT and add the corresponding unit tests.
🌔Analyzing the auth module…
Read 2 files
Readsession.tssrc/auth · :12-4534 lines
12 export function verify(token: string) {
13 return jwt.verify(token, getSecret());
14 }
Readmiddleware.tssrc/auth58 lines
Editmiddleware.tssrc/auth+12−4
Search"jwt.verify"src/auth4 results

I looked at the structure of src/auth; it is currently based on a session cookie. The scope of the change is below — once you confirm, I'll start.

A decision needs your confirmation
How long should the JWT expiry be? Default 7 days, refresh token 30 days.
Write permission required
About to modify src/auth/middleware.ts, 42 lines changed. Allow?
Replace session with JWT signing
Refactor the auth middleware
Add unit tests

Wide markdown tables (desktop): regular chat prose stays within the 760px reading column (--p-content-max), and tables stay there too by default — an overflowing table scrolls horizontally inside its own wrapper, so the page and the chat area never scroll sideways. A clipped table shows a gradient fade at its truncated right edge, and hovering the table reveals a small widen button at its top-right corner; clicking it lets the table grow naturally with its content up to 1040px (--p-table-max), centred within the conversation pane, and clicking again restores the default width. At the default width a single column is capped at 36% of the pane; once widened the cap relaxes to 700px (--p-table-cell-max), so long cell content wraps inside the cell instead of stretching the table. The conversation outline (TOC) keeps its usual position just outside the reading column; when a widened table grows past it and scrolls under the rail, the TOC is hidden temporarily and returns as soon as the table leaves, without touching the user's TOC setting. On mobile a table never breaks out of the reading column.

Tool calls: quiet activity lines, bespoke per tool

High-frequency calls like read / bash / grep are "operational noise" — boxed, collapsible cards quickly drown out the conversation. Tool calls therefore render as one quiet borderless line in the message stream — never a card — and each tool kind composes that line for its own content, so the stream reads like an activity log rather than a pile of widgets. The three visual-weight tiers:

Three visual-weight tiers
① Tool line · lightest (default) — bespoke content per tool, no card chrome
Runpnpm run build && pnpm lint0.8s
② Activity run · medium (consecutive quiet activity — thinking + tool lines — folds to one smart-summary row)
Read 3 files
③ Sub Agent identity card · one per delegation — task title + agent type; the whole card opens the side panel (no in-stream expansion, never grouped)
分析双引擎架构Explore
④ Decision card · heavy (only question / approval, needs user input)
Write permission required
About to modify src/auth/middleware.ts, 42 lines changed.
  • A tool call renders as one quiet borderless line (~24px, the thinking row's rhythm): leading glyph, tool-specific content, trailing meta + status. There is no card chrome and no hover wash — the chevron hugging the line's text (thinking-row style, never pushed to the far edge) is the only disclosure affordance, a real <button> carrying aria-expanded (keyboard path); the head itself is a plain click target (mouse path), so trailing slots may hold genuine buttons of their own (e.g. Agent's "open detail").
  • One type scale for the whole stream: thinking rows, fold summary rows and tool lines all set 13px UI text; in-line mono and trailing meta run one step down at 12px (a monospace x-height reads larger, so 12px sits level next to 13px). Hierarchy comes from colour, never from size jumps or bold — everything on the line is regular weight: the only dark object is the file-name button (--color-text — the one interactive place to go); the action label (Run / Read / Edit…), the mono command / pattern and secondary context all sit at --color-text-muted; auxiliary elements (glyphs, chevrons, trailing meta) stay --color-text-faint. The stream thus reads in three quiet tiers: prose in text, tool lines in muted, thinking / captions in faint. Line content is centre-aligned so mono-only rows (Bash) sit level with the icon and chevron. Truncating line content (the CSS-ellipsis spans) sets --leading-tight rather than the row's line-height: 1 — a 1em line box is shorter than the font's ascent + descent, so overflow: hidden would clip descenders (j / p / g / y); mono runs take the font's own normal leading instead, since JetBrains Mono's ≈1.32em metrics exceed --leading-tight. The 16px chevron still drives the ~24px row height.
  • Every tool kind composes its own line, leading with the tool's localized action label (Run / Read / Edit / Write / Search / Find / Fetch…): Bash pairs its label with the full command in mono (CSS-truncated) plus a duration chip; Read / Edit / Write follow the label with the file name as a real button (opens the file preview) followed by the directory, a :line-range or a +N −M stat with a mini segmented bar; Grep shows the pattern in mono plus a match count; Glob / Ls list paths; Todo carries the active task with a done/total progress bar; goal tools show a coloured status pill; ExitPlanMode expands into a read-only plan receipt with its persisted review outcome. Unrecognized tools fall back to glyph + localized label + argument summary.
  • The settled question is the one exception to the quiet line: once AskUserQuestion settles with a recognized answer, it becomes a small receipt card — the question card's echo (raised surface, hairline edge, lg radius, --shadow-xs, flush with the stream's left edge, ≤560px). The card echoes only the picks, checked with the live QuestionCard's CSS glyph language one step down (14px); passed-over options are not echoed. Dismissed (or zero-answer) collapses to a slim italic one-line card; while running, and for unrecognized output (background launch / error), it stays the plain quiet disclosure line with the raw output.
  • Clicking a line expands it in place; the detail hangs below at the line's own left edge (no inset), so it reads as part of the stream rather than as a separate card. Details are one of: the mono output panel (content-well surface, hairline edge, 12-line scroll cap), the inline diff, or clickable match / file lists (path:line opens the preview at that line). Code-bearing details — the Read content, the Edit diff, the Write content — are syntax-highlighted by file type (github-light / github-dark, following the colour scheme), with the Read output's real line numbers as the gutter; highlighting mounts lazily on first expand and degrades to plain text for unknown languages or oversized content.
  • Rows sit flush with the message stream's left edge (same alignment as prose and the thinking row): no inset, no hover wash, and the glyph rides the thinking row's 4px icon-to-text rhythm with no padded slot. Expanded rows inside a group stack directly on the shared rhythm — no dividers.
  • Consecutive activity — thinking segments and tool calls of ANY kind, quiet lines and richer cards alike — folds into ONE activity-run row: a smart summary sentence that aggregates the run per tool kind in first-appearance order (Read 2 files · Ran 5 commands (1 failed) · 26s), the failure clause hanging on its kind in danger red, the total span faint at the tail — one line, ellipsis-truncated, the full sentence in the title tooltip. Thinking items fold into the run but are not narrated in the sentence. The row shares the thinking row's language (borderless faint text row, text-colour hover only, one whole-row button with a rotating chevron) but rides a roomier 8px vertical padding — 30px against the quiet lines' 22px, so the turn-level summary keeps its presence between prose paragraphs; while the turn streams through the run the row stays expanded and the summary turns live (current action + cumulative per-kind stats + ticking whole seconds), and once every item settles it folds itself back — even if the user expanded it mid-run (the thinking block's vocabulary); a settled → running transition (the stream appending to the same run) reopens it. The glyph carries the state: the current step's own icon breathing while running, green ✓ / red ✕ once settled. A run needs ≥ 2 steps — a lone step renders standalone as the block it always was. Text never folds (it breaks the run), and neither do successful media tools (no card — inline media is the turn's output); everything else folds, cards included: Todo / Goal progress narration, the sub-agent identity card, Question / Swarm cards and unrecognized kinds (skills, MCP tools) all join the run — the stay-expanded-while-live rule keeps a card visible exactly while it is active. The expanded run is the items flat in order (thinking rows + tool rows), each with its own in-row details intact — the lines keep their own 4px row rhythm but breathe 8px apart, with a small inset below the head.
  • Above the activity run sits the turn fold (TurnFold.vue): when an assistant turn settles, every block before the LAST text block — thinking segments, activity runs, interim text paragraphs, Todo / Goal / sub-agent cards — folds into a single bare row reading Worked 4m57s (whole seconds, no glyph, no summary sentence), expanding into the folded blocks in order, each with its own rendering intact. The span is the turn's ELAPSED time (turnWorkMs): it ticks from the stamped start while the turn is open — approval/question waits included by design, so no park bookkeeping exists — then reads the daemon's own durationMs once settled (the server message stamps for history turns); the wall clock only feeds the live tick, so throttled tabs, session switches and remounts cannot corrupt the settled value. Without any stamp the row falls back to the generic Work details. Streaming turns show no row and a forced-open body — the live transcript is untouched, the fold lands only when the stream moves past the turn (or the turn parks). The split never hides the turn's output: the final text block and any trailing blocks (inline media, standalone cards) stay visible, and a text-only turn folds nothing. Fold state is a plain component ref — nothing persists, switching sessions resets to folded. Inside the right-side sub-agent transcript, disclosure bodies open instantly while their chevrons retain the standard rotation: animating the height of a full historical stream would relayout the entire panel on every animation frame.
  • A sub-agent delegation is an identity card — never a quiet line: the card carries the TASK as its title and the agent type as a quiet meta line, while the orchestrator's full prompt stays out of the stream on purpose. The whole card is one action (the quiet shell vocabulary: raised surface, hairline edge, large radius, no shadow): click to open the subagent's live progress in the side panel — there is no in-stream expansion.
  • Status keeps the shared vocabulary: running (pulsing accent dot) / done (green ✓) / failed (red ✗), at the line's right edge. Only two types keep a full card: Question and Approval — they genuinely need the user's attention. The Swarm composite keeps one quiet card (raised surface, 0.5px hairline, large radius) for its phase overview + member accordion.
  • A task notification is a status card, not a quiet line (NotificationCard.vue): the hidden <notification> injections (background-task / sub-agent settlement) render where they landed in the turn — a 28px status chip + title/sub head tinted with the toast status token pairs (completed → success, failed / timed_out / lost → danger, killed → warning, else neutral surface), expanding in place to the fields, the body, an output-file row (copy path) and the raw payload. ≥2 CONSECUTIVE notifications merge into one neutral group card (count + per-item status dots + compact rows, each expanding on its own). Notifications break the activity run but are never turn boundaries, and they never fold — a notification is an event worth noticing, not process noise, so it punches out of the turn fold and renders right after the fold row, in order.
  • A turn that dies on a model-request failure leaves a persistent terminal card at the transcript tail (ChatPane's .turn-failed): the notification card's danger shell (danger-soft surface, danger hairline, 24px status chip with the warning glyph) carrying a title keyed by the wire error kind (model failure vs step-limit stop), the provider message as a muted sub, a mono diagnostics meta (code · HTTP status · request id), and exactly ONE secondary sm action — Continue, which submits a short continue prompt through the normal path. It renders only while the session sits idle on lastTurnReason === 'failed' (a turn with zero assistant output included, so it pins to the tail rather than any assistant row), it is not dismissible, and it vanishes the moment a new turn starts. While the turn is still fighting, the working indicator instead narrates the retry backoff ("retrying n/max" from the live agent.status.updated phase) — a retrying turn never shows the card. The transient error toast now fires only for background sessions; the viewed session's failure is fully covered by the card.
  • Turn failed card · persistent terminal marker + one resume action
    模型请求失败,本轮对话已中断429 The engine is currently overloaded, please try again laterprovider.rate_limit · HTTP 429 · req_01KZ8Y…
  • A goal-continuation turn carries a provenance row: the hidden goal_continuation trigger (goal mode's self-driven next turn — a turn boundary, unlike task notifications) never renders its machine prompt; instead the assistant turn it opens shows one faint 12px line flush with the stream's left edge — the target glyph shared with the Goal tool (this turn belongs to the goal) + a localized label — ABOVE the turn's content and OUTSIDE the turn fold, so the row survives as the turn's provenance after settling. The marker lands with the trigger (before the first assistant block), and while the newest exchange is a goal-continuation turn the undo affordances (edit-and-resend, Esc undo) are suppressed — rewinding would drop the hidden trigger while refilling the older user text.
  • A settled turn's file changes are one summary card (TurnFilesSummary.vue): between the turn's final text and its footer, a §03 Card (hairline border, no shadow — NOT the quiet tool line, the artifacts are worth a discrete object) lists every file the turn's Edit / Write calls touched. The head reads "N files changed" with the aggregate +A −D and the mini diffbar; the aggregate hides whenever any row's stats are incomplete (a Write or an underivable edit makes the total a lower bound, never presented as exact). Each row is one clickable workspace-relative path (short and self-locating; a file outside the cwd stays absolute) with its per-file +A −D at the right edge. The row's action keys on the tool kind, and the stats tell it apart: a Write has no per-file count (its diff is underivable) and opens the whole file in the preview; an Edit / MultiEdit carries its +A −D and opens that file's turn diff in the right-side detail layer (TurnDiffPanel.vue — the turn's own X→Y change, not the git diff), whose header keeps an open-file action. The first three files show inline; the rest collapse behind a "N more files" ghost-button row in the card's foot. Where nothing handles the row action (the BTW side chat), the card renders its file rows as plain text instead of links.
',15)),t("div",ha,[a[31]||(a[31]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Turn files summary · a real TurnFilesSummary (fixed sample)")],-1)),t("div",ua,[t("div",ga,[c(M,{changes:S,cwd:Dt,onOpenDiff:m,onOpenFile:m})])])]),a[137]||(a[137]=o('
Tool Call · quiet lines (expand on demand)
Read 2 files
Readsession.tssrc/auth · :12-4534 lines
12 export function verify(…
Readmiddleware.tssrc/auth58 lines
Editmiddleware.ts+12−4

Decision cards · Question / Approval

The two attention cards replace the composer in the dock and share one contract: a floating neutral shell (--color-surface-raised + hairline + --radius-lg + --shadow-menu), a plain dark 16px title head, and a hairline footer whose actions read in number-key order with exactly one accent primary. There is no semantic colour band — the floating card itself is the "needs a decision" signal.

Plan review · pinned option rows, second-line descriptions
按这份 plan 开始实现?
The plan markdown scrolls in a capped area; the approaches are pinned below it — label on the first line, full description always on the second. The number chip doubles as the keyboard hint.
1方案 A:静态徽章零依赖、渲染稳定,升级时需手动同步版本号。
2方案 B:动态徽章版本自动同步免维护,但要求仓库公开可访问。
  • Footer contract: actions are left-aligned in number-key order (1·2·3·4), each carrying a number chip — sized by --p-chip-num over --color-inline-code-bg, the same chip vocabulary as option rows and the multi-step chip; exactly one primary action, the rest are ghost. Feedback mode swaps the whole footer for submit / cancel.
  • Feedback input: the reject-with-feedback box is the shared §03 Textarea primitive (no bespoke input), three rows at rest, auto-growing with its content UPWARD — the card is bottom-anchored in the dock, so the bottom edge and the submit / cancel footer never move — capped at 40% of the VISUAL viewport, then scrolling internally. Height budgets follow --app-height (the visual viewport, which shrinks with the iOS keyboard where dvh does not): the card caps at calc(var(--app-height, 100dvh) - 72px) and the dock takes over the same budget. While the feedback box grows, every body kind yields and scrolls internally by default instead of pushing the card past its cap — the plan scroll area, code previews, shell output, todo lists, invocation chips and generic text — with only the one-line plan path pinned at full height. A plan review's option rows belong to the plan region and never shrink, so once fixed chrome (options, grown feedback box) exceeds what the capped card leaves — e.g. the iOS keyboard shrinking the visual viewport — the WHOLE plan region (body and options together) becomes one scroller, keeping an approve option reachable by scrolling instead of clipped out of reach. Below even that budget — the cap under the fixed chrome alone (header plus mobile's stacked ≥46px submit / cancel buttons), as when an iOS landscape keyboard leaves a ~200px visual viewport — the body has already shrunk to zero and the CARD itself becomes the scroller of last resort (overflow-y: auto, with its own scroll seam), so the footer buttons are never clipped away.
  • Body by kind: Write approvals preview the incoming content with HighlightedCode (syntax-highlighted, 24-row cap with scroll); Edit approvals render the before/after hunk as a highlighted line diff. Plan / diff / file kinds get a head expand toggle that lifts the cap so the block fills the card; the card itself never exceeds the pane (only the scroll area shrinks) — with the dock work pills visible, the dock takes over the same height budget as a flex column, so an expanded card yields the pills' height instead of pushing them past the pane's top edge. Once the plan scrolls, a soft shadow fades in at the scroll area's top edge — the sidebar's scroll-linked seam language, so clipped content reads as passing under the card chrome.
  • Danger hint: destructive shell commands (rm -rf, sudo, force-push…) show a danger-soft filled hint row under the command — detection is a display-layer heuristic on the client.
  • Minimized: the card collapses to a thin bar with a mono peek of the subject; the whole bar is the expand click target.
  • Question card: the title is the question itself (2-line clamp), with a step chip for multi-question flows and a × dismiss button. Options use CSS radio/checkbox glyphs (accent when selected); the number chip and glyph top-align with the option text, optically centred on the label's first line. The footer follows the same left-aligned action contract (primary first, ghosts after), with the keyboard hint pinned to the right edge; keyboard: ↑↓ moves (Space toggles in multi), digits pick, Enter advances/submits, Esc dismisses.

Composer

Unified into a single raised container: --radius-composer (32px) with --corner-shape-composer: superellipse(1.5) and a stable 0.5px edge. Focus crossfades a low-chroma line-and-accent edge over --duration-slow with --ease-in-out, while the neutral shadow stays unchanged — there is no added halo and no layout shift. The composer input (a ProseMirror contenteditable on desktop, a textarea on the web during the migration) uses text-autospace: normal for mixed CJK and Latin input. Toolbar controls use a quiet 32px full-round geometry with 8px edge inset; the send button remains a standard 32px circle, with its glyph at 28px (--composer-send-icon-size, the production kimi.com size; it sits outside the --p-ic-* scale on purpose).

Fill and edge tokens: the card's fill and rest border are their own tokens — --color-composer-bg and --color-composer-line — running the kimiwork / kimi.com production input recipe (.chat-input__shell): fill = groupedBackground.secondary (#ffffff light / #1f1f1f dark), rest border = separator.s1 (13% black / 12% white), focus line = fills.f4 (25% in both schemes), and --shadow-input = effect.shadow.inputDefault (0 5px 16px -4px rgba(0,0,0,0.07), kept identical in dark — the hairline carries the edge there). Only colours sit in the tokens; the 32px superellipse shape and the focus-only edge overlay are unchanged.

Send button tokens: the send circle runs on --color-send-bg / --color-send-bg-hover / --color-send-icon (+ *-disabled, --opacity-send-disabled, --shadow-send[-hover]), following the production recipe (.chat-input__send): a neutral labels.primary fill (90% black light / 84% white dark, hover #252525 / 84.8%) with the production lift shadow (0 7px 16px -13px 38% + 0 1px 2px 7%, one step larger on hover), a groupedBackground.secondary glyph, and a disabled state of the same vocabulary — fills.f2 fill with a labels.quaternary glyph at full opacity. The button is disabled exactly when submit would no-op — an empty draft with no ready attachment (image-only sends stay enabled), an upload in flight, or the starting spinner — so disabled is a first-class persistent state, never a fade.

Layering, anchors, and motion: the dock normally stays at --z-sticky so the Latest Messages pill can remain visible above its veil. While any Composer popup or work panel is open, the dock temporarily joins --z-dropdown, ensuring permission, work-mode, and model menus — and the work panel — always paint above that pill. The permission menu's left edge and the model menu's right edge each follow their own trigger pill. All three menus use --shadow-menu and the same trigger-corner pop motion as Session Row menus: 0.97 scale with a 2px shift toward the trigger, --duration-base on entry, and --duration-fast on exit.

Attachment strip: attachments hang inside the composer card above the input as two grouped rows — images/videos as shared MediaThumb rounded thumbnails, files as the shared AttachmentChip pill — the same pair the sent bubble renders, so a draft looks exactly like the sent message. File-store videos render a static play tile instead of fetching a first frame. The strip caps at two thumbnail rows and scrolls beyond that instead of pushing the input down; while overflowing, a quiet count badge pins to the bottom-left and new attachments auto-scroll into view (to the end of whichever group grew). With two or more attachments, a one-click clear-all pins to the strip's top-right corner as a quiet 22px badge (trash glyph, danger on hover). The composer's pending preview and the bubble's media clicks open the same MediaLightbox preview, which owns Escape via the shared dialog stack: images go through PhotoSwipe (@moonshot-ai/app-client's lib/mediaPreview) and zoom out of the clicked thumbnail (scrim = --color-scrim-strong, caption = --color-text-on-scrim; the slide area is inset — 24px sides matching the video modal, 56px top/bottom clearing the close button and caption — so a viewport-filling image never kisses the edges), videos keep the custom modal. Both share the --color-scrim-strong backdrop and the same close button — the raised 36px circle (.media-lightbox-close) fixed at the viewport's top-right, rendered by MediaLightbox for both (PhotoSwipe's own top bar is disabled; zoom stays on wheel / pinch / image click). ReadMedia tool cards open it too (an App-level instance fed by the openMedia chain): the image zooms out of the card's thumbnail, and videos show as a static play tile that opens the modal player — no more right-side-panel detour or inline <video>.

Mention pills: @-mentions render as inline pills in the editor — one element of the cross-surface rich-text vocabulary specified in §05 Rich Text Messages (visual recipe, wire forms, and behavior contract live there).

',12)),t("div",ma,[a[38]||(a[38]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Composer")],-1)),t("div",ba,[t("div",fa,[a[36]||(a[36]=t("div",{class:"p-composer-ta ph"},"Message Kimi, / to run a command, @ to reference a file…",-1)),t("div",wa,[t("div",ya,[a[33]||(a[33]=t("button",{class:"p-icon-btn"},[t("svg",{class:"p-ic",viewBox:"0 0 24 24",fill:"currentColor"},[t("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"})])],-1)),t("span",ka,[c(s(d),{name:"shield-question",size:"sm"}),a[32]||(a[32]=e("yolo",-1))]),a[34]||(a[34]=t("span",{class:"p-pill"},[t("svg",{class:"p-ic",viewBox:"0 0 24 24",fill:"currentColor"},[t("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"})]),e("plan")],-1))]),a[35]||(a[35]=o('
kimi-k2· thinking
',1))])]),a[37]||(a[37]=o('
kimi-code-web
',1))])]),a[138]||(a[138]=o('
i
Site-wide consistency: the composer uses one 32px superellipse shell and one 32px desktop control height. The add (+), permission, compact, and model controls are all full-round and transparent at rest; hover reveals a neutral wash, open/active may use accent-soft, and Send remains the sole persistent filled control — an inverted --color-text fill with a --color-bg glyph (never the accent), disabled while the input is empty or an upload is in flight. The transparent dock floats over the transcript, while the scrolling content receives bottom padding equal to the live dock height so its final item can still clear the composer. Composer chrome is not selectable; only the message input permits text selection. Each permission mode has its own registry icon — manual hand, yolo shield-question, auto full-access — paired with the label in the pill (collapsing to the accessible icon below a 620px composer container) and leading its dropdown row in the mode's colour, with the current row's check trailing the row's end. The right toolbar is the flexible region: the model pill shrink-wraps its content, then shrinks and truncates internally only when the toolbar runs out of room. The dock's work pills and panels — pill vocabulary, panel shell and motion, the two-tone head, per-kind bodies, filtering, and the open/cancel model — are specified in Dock · work pills & panels below.

Workspace attachment card: on the empty session, the workspace picker is a separate attachment card tucked under the composer — and the composer card itself stays complete (its own 0.5px border, --radius-composer corners with --corner-shape-composer, and shadow are never altered). The attachment lives inside the composer's padding box as the card's sibling, so its width always matches; its top --space-4 slides behind the card (the card is raised to --z-sticky), its square top edge stays hidden, and only the rounded bottom (0 0 --radius-xl --radius-xl) shows. Background --color-hover at 60% via color-mix (≈0.03 black in light, self-adapting in dark), no border, no shadow. Inside sits one quiet capsule trigger: transparent, --radius-full, 16px leading icon and 12px label at weight 475 in --color-text-muted; hover deepens to --color-selected and the label turns --color-text. The dropdown follows the §03 menu spec and is viewport-aware (flips above when more room, clamps max-height to the scrollport); at --z-dropdown it outranks both the card and the fixed click-outside backdrop (--z-sticky), which renders outside the composer because the card's container-type captures position: fixed descendants.

Autocomplete menus

The slash, mention, and add popups share one geometry, all on dedicated tokens: the --color-menu-bg-frost surface (the frostier recipe), frame padding --menu-row-hug, rows at --menu-row-padding-block × --menu-row-padding-inline with --radius-menu-row caps (plain corners — the frame is --radius-lg with NO corner-shape, and the row radius stays concentric: 12px frame − 6px hug = 6px), an icon-to-label gap of --menu-row-gap-icon, and a --menu-rows-seam between stacked rows. Touch rows pad to --menu-row-touch-padding-block with a hard floor of --touch-target-min. Scroll height caps at --p-slash-menu-h / --p-mention-menu-h / --p-add-menu-h; the scroll-edge fade is --menu-scroll-fade, and the overlay thumb rides --menu-scrollbar-width / --menu-scrollbar-edge / --menu-scrollbar-track-inset / --menu-scrollbar-thumb-min in --color-menu-scrollbar (hover --color-menu-scrollbar-hover) — 3px visually, with a wider invisible drag strip.

Add menu

The composer's + button opens the add menu — the autocomplete family's action-list member: one column of icon + label (+ muted description) rows (Files, Goal, Plan, Swarm) on the same frost surface and row geometry as the slash/mention popups, capped at --p-add-menu-h. Semantically it is an action menu, not an autocomplete listbox: rows are menuitem commands, DOM focus moves into the menu (arrows navigate, Enter activates, Escape closes), and the + button carries aria-haspopup="menu" — the textarea's combobox ARIA never points at it.

Design decision: deliberately NOT the §03 Menu/MenuItem primitives. Those are the trigger-dropdown family (sidebar, user menu, session rows) — --color-menu-bg, --radius-lg, a min-width box. The add menu instead shares the composer menus' material (the frostier surface, the composer corner curve, rows hugging the frame at the composer's text column, muted description sub-lines). Bending MenuItem into that material would require exactly the per-screen appearance overrides the primitive contract forbids, so the add menu keeps bespoke rows built directly on the shared --menu-row-* tokens. This paragraph is the canonical record of that choice — reviews should not re-litigate it.

',7)),t("div",xa,[a[46]||(a[46]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Add menu — family surface, icon + label + desc rows, keyboard focus wash")],-1)),t("div",Ta,[t("div",Sa,[t("span",Ca,[c(s(d),{name:"attachment",size:"sm"}),a[39]||(a[39]=t("span",{class:"n"},"Files",-1))]),t("span",za,[c(s(d),{name:"target",size:"sm"}),a[40]||(a[40]=t("span",{class:"n"},"Goal",-1)),a[41]||(a[41]=t("span",{class:"d"},"Set a goal to keep pursuing",-1))]),t("span",qa,[c(s(d),{name:"file-edit",size:"sm"}),a[42]||(a[42]=t("span",{class:"n"},"Plan",-1)),a[43]||(a[43]=t("span",{class:"d"},"Turn plan mode on",-1))]),t("span",Aa,[c(s(d),{name:"sparkles",size:"sm"}),a[44]||(a[44]=t("span",{class:"n"},"Swarm",-1)),a[45]||(a[45]=t("span",{class:"d"},"Turn swarm mode on",-1))])])])]),a[139]||(a[139]=o('

Work modes

Plan and Goal are the primary work modes — mutually exclusive, at most one armed at a time. Arming happens only through the slash commands (/plan, /goal) or the add menu; an armed mode renders as the input row's leading pill — a neutral --color-surface chip with the mode's 14px icon, its label, and a × that disarms. The × is an IconButton sized --wm-x-size (below the sm default, so its hover wash never outgrows the pill's rounded end) with a --wm-x-ring hit reserve that stays inside the textarea's indent; on touch it meets --touch-target-min. The input's first-line text indent reserves exactly the pill's width (the desktop ProseMirror editor applies it to the first paragraph), so the caret and placeholder slide right rather than colliding; arming Goal also swaps the placeholder to its objective prompt. Sending with Goal armed creates the goal and the pill hands off to the dock's goal pill; a live goal does NOT lock the primary modes — /goal then just focuses the goal's panel, and /plan still arms (the only hard rule: one message cannot both create a goal and enter plan — the goal write carries the plan disarm atomically — and a failed mode write is treated as a send failure: the optimistic message rolls back, the error toasts). Swarm is deliberately NOT a mode: an orthogonal toolbar chip with its own enable confirmation, disarmed from the chip's ×.

Dock · work pills & panels

Work pills (WorkPill.vue): the dock's workbar above the composer carries one pill vocabulary — font-driven by flex computation: the 1.5em leading icon and the label's own line box (--text-base at --leading-normal) both come to 21px at the 14px UI text, and 8px block padding wraps them to 37px, nothing pinning pixels, so the pills rescale with the font; borderless, with --radius-lg rounded-square corners, filled at the fills ladder's --color-selected rung over the shared --p-menu-backdrop blur — the panel's frosted recipe scaled down to a chip, so transcript text never reads through the light fill (the neutral hover wash layers on top — one layer, never two), the icon at full text colour, --space-2 / --space-3 block / inline padding — the trailing side adds a --space-05 optical compensation against the leading glyph — and a --space-1-5 content gap. Every pill stays expanded — the Code client does not collapse status chips — carrying icon + label and a trailing meta that answers one question — what is live on this surface right now — for background bash tasks, background sub-agents, todos, and the goal alike; the row insets to the composer's text column — dock inline inset + the card's 0.5px border + the input wrap's 16px inline padding — not the card edge. The active pill keeps the wash on permanently — one fills-ladder step deeper, neutral. The meta is always muted ink and surface-specific: the goal carries its status word, colour-coded by state (active --color-success, paused --color-warning, blocked --color-danger); the bash and sub-agent pills carry a pulsing dot and the running count, only while something runs (a quiet absence otherwise); the todos carry the done/total fraction. The plan pill joins the row only once plan mode is live server-side or a persisted plan exists — a merely armed directive stays in the composer's inline work-mode pill (its × cancels) and never reaches this bar, so every pill here reads as live server truth rather than local intent. Narrow panes wrap the row instead of clipping (the dock height observes); below the --p-bp-sm breakpoint the pills collapse to their icons — label and meta hide (the threshold is read from the token, never a hardcoded width).

Panel shell & motion: a pill toggles the shared work panel — the menu family material: 70% page background via color-mix over the shared --p-menu-backdrop blur (the frostier recipe, see §06 Glassmorphism exemption), a 0.5px --color-line edge, --radius-2xl, and the menu panel's --shadow-menu. The panel pops from the clicked pill along the trigger-corner motion tokens (--motion-panel-scale / --motion-panel-shift), and switching pills replays the pop from the newly clicked pill (the shell is keyed by panel kind); while it is open the dock raises to --z-dropdown so it clears the transcript's new-message pill, and every window-drag strip pauses so an outside press reaches the page and dismisses. The panel owns Escape while open (a document-capture handler guarded by the shared IME latch, so a candidate-cancelling Escape is never swallowed), and a scrolled body dissolves toward the head through the --menu-scroll-fade alpha mask instead of hard-clipping. Height is content-sized up to min(360px, 50vh); the filtered panels pin instead — see Filtering & sizing. The panel is chrome: nothing inside it is text-selectable, the head's filter chips included.

Panel head (WorkPanelHead.vue): every work panel head is one tab row — a leading icon at the pill's 1.5em glyph size, the panel title at full text colour, and a muted trailing meta (--color-text-muted) carrying that panel's one live number, joined by the row's --space-2 gap with no separator glyph: the goal's wall-clock time, the bash / sub-agent running count, the todos' done/total. Actions right-align in the head: the goal's pause / resume / cancel / close as quiet neutral IconButtons (cancel deliberately shares that neutral vocabulary), the plan's open-in-side-panel, dismiss-directive (shown only while the directive is live), and close, and the bash / sub-agent filter chips as a SegmentedControl. The plan head's meta carries the latest plan's review outcome. On touch these meet the 44px minimum (--touch-target-min) via the hover: none capability query — a width-only gate would miss tablets — and below 480px the head wraps so the actions take a full row.

Panel bodies: todos read as a quiet list — a green circle-check for done, a hollow ring for pending, an xs Spinner for in-progress. The goal's detail (full objective, completion criterion, rendered with the chat Markdown renderer) fills the body — no footer strip. Bash tasks are long rows (TasksPane.vue): a StatusDot while running, circle-check when done, a close glyph for failed and for cancelled (a user stop is neutral, never reported as a failure), the command as the meta line, and a bare duration that renders only when computable — never the raw protocol status word. Sub-agents form a card grid (SubagentGrid.vue) — an auto-fill grid (minmax --p-subagent-card-min) of cards at the --color-selected rung with --radius-lg corners; each card carries the task name, a stable session-wide number (creation order across the session's background sub-agents — unique even across swarms; once shown it sticks, so late-arriving history takes the next tail number), an optional prompt meta line one size down (--text-sm), an icon-led model · effort line and the status row a further size down (--text-xs) — the status row pairs the task-row state glyph with the localized label, plus a clock-led bare duration that renders only when computable; the full-bleed circle-check (drawn for the todo rows' ring family) is scaled onto the shared icon grid wherever it sits beside other glyphs (task rows, cards, filter chips). A failed row tints its name --color-danger; a cancelled one stays neutral. Rows hover with a rounded strip that grows by padding and a matching negative margin — the row metrics never shift. The row stop is danger-coloured; the card cancel reveals on hover and is always visible on touch as a --touch-target-min corner target. Every pane's empty state is centered and muted. State and time labels — the head meta included — set text-autospace: normal, the transcript's mixed CJK/numeric spacing rule, so durations like 9小时2分 breathe.

State vocabulary: two glyph families meet here by design — the activity dot (shared with the transcript's tool rows and swarm members) backs the task rows, the todo rows speak the default loader ring, and the sub-agent cards skip glyphs in favour of a localized text label:

',8)),t("table",Ba,[a[83]||(a[83]=t("thead",null,[t("tr",null,[t("th",null,"Surface"),t("th",null,"State"),t("th",null,"Meaning"),t("th",null,"Glyph"),t("th",null,"Ink")])],-1)),t("tbody",null,[t("tr",null,[a[48]||(a[48]=t("td",null,"Bash rows",-1)),a[49]||(a[49]=t("td",{class:"tk"},"running",-1)),a[50]||(a[50]=t("td",null,"Task in flight",-1)),t("td",null,[c(s(u),{status:"running"}),a[47]||(a[47]=e(" pulsing dot",-1))]),a[51]||(a[51]=t("td",null,[t("code",null,"--color-accent")],-1))]),t("tr",null,[a[54]||(a[54]=t("td",null,null,-1)),a[55]||(a[55]=t("td",{class:"tk"},"done",-1)),a[56]||(a[56]=t("td",null,"Finished cleanly",-1)),t("td",null,[c(s(d),{name:"circle-check",size:"sm"}),a[52]||(a[52]=e()),a[53]||(a[53]=t("code",null,"circle-check",-1))]),a[57]||(a[57]=t("td",null,[t("code",null,"--color-success")],-1))]),t("tr",null,[a[60]||(a[60]=t("td",null,null,-1)),a[61]||(a[61]=t("td",{class:"tk"},"failed",-1)),a[62]||(a[62]=t("td",null,"Errored — the row's name tints to match",-1)),t("td",null,[c(s(d),{name:"close",size:"sm"}),a[58]||(a[58]=e()),a[59]||(a[59]=t("code",null,"close",-1))]),a[63]||(a[63]=t("td",null,[t("code",null,"--color-danger")],-1))]),t("tr",null,[a[66]||(a[66]=t("td",null,null,-1)),a[67]||(a[67]=t("td",{class:"tk"},"cancelled",-1)),a[68]||(a[68]=t("td",null,"User stop — neutral, never a failure",-1)),t("td",null,[c(s(d),{name:"close",size:"sm"}),a[64]||(a[64]=e()),a[65]||(a[65]=t("code",null,"close",-1))]),a[69]||(a[69]=t("td",null,[t("code",null,"--color-text-muted")],-1))]),t("tr",null,[a[71]||(a[71]=t("td",null,"Todo rows",-1)),a[72]||(a[72]=t("td",{class:"tk"},"in_progress",-1)),a[73]||(a[73]=t("td",null,"Being worked on",-1)),t("td",null,[t("span",Ma,[c(s(I),{size:"xs"})]),a[70]||(a[70]=e(" xs Spinner ring",-1))]),a[74]||(a[74]=t("td",null,[e("the row's own ink ("),t("code",null,"--color-text"),e(")")],-1))]),a[81]||(a[81]=t("tr",null,[t("td"),t("td",{class:"tk"},"pending"),t("td",null,"Not started"),t("td",null,[t("span",{class:"dw-ring"}),e(" hollow ring")]),t("td",null,[t("code",null,"--color-line-strong"),e(" stroke")])],-1)),t("tr",null,[a[77]||(a[77]=t("td",null,null,-1)),a[78]||(a[78]=t("td",{class:"tk"},"done",-1)),a[79]||(a[79]=t("td",null,"Completed",-1)),t("td",null,[c(s(d),{name:"circle-check",size:"md"}),a[75]||(a[75]=e()),a[76]||(a[76]=t("code",null,"circle-check",-1))]),a[80]||(a[80]=t("td",null,[t("code",null,"--color-success")],-1))]),a[82]||(a[82]=t("tr",null,[t("td",null,"Sub-agent cards"),t("td",{class:"tk"},"all"),t("td",null,"The task-row glyph plus a localized label — failed alone tints danger — with a clock-led bare duration trailing"),t("td",null,"glyph + label"),t("td",null,"muted / danger")],-1))])]),a[140]||(a[140]=o("

Filtering & sizing: the bash and sub-agent heads carry the same four icon-led filter chips — recent (clock; running + the five most recently finished), running (play), done (circle-check; every terminal state), all (list) — and both filtered panels pin to --p-dock-panel-h so filtering never resizes the panel; the body scrolls inside. When the head runs out of room the chips collapse into a dropdown menu (FilterControl.vue measures the head itself, so the switch follows the panel's own width, not the viewport; the menu teleports to <body> and anchors to the trigger, so the panel's clip and backdrop-filter never squeeze it); the head title never wraps and is never clipped — once the filter is a dropdown the head always fits. An empty pane names its filter (no completed tasks is not no tasks).

Opening & cancelling: clicking a row or card opens the task's detail in the right-side panel. Opening is gated: the overlay navigation button renders only when a stable agentId (on-demand transcript) or locally held output exists, so a REST-only cold-loaded row stays inert instead of opening an empty panel — and says so with the not-allowed cursor. Open and cancel are sibling controls (a full-cover overlay button, the stop IconButton floating above it): no nested interactives, and the stop action exists only while the task runs.

",2)),t("div",Ia,[a[94]||(a[94]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Work pills — one vocabulary, a live count or status where one exists")],-1)),t("div",Ea,[t("div",Da,[t("span",Ha,[c(s(d),{name:"target",size:"md"}),a[84]||(a[84]=t("span",null,"Goal",-1)),a[85]||(a[85]=e()),a[86]||(a[86]=t("span",{class:"dw-live"},"Active",-1))]),t("span",Va,[c(s(d),{name:"terminal",size:"md"}),a[87]||(a[87]=t("span",null,"Bash",-1))]),t("span",La,[c(s(d),{name:"sparkles",size:"md"}),a[89]||(a[89]=t("span",null,"Background Agent",-1)),a[90]||(a[90]=e()),t("span",Ra,[c(s(u),{status:"running"}),a[88]||(a[88]=e("3",-1))])]),t("span",Oa,[c(s(d),{name:"list",size:"md"}),a[91]||(a[91]=t("span",null,"Progress",-1)),a[92]||(a[92]=e()),a[93]||(a[93]=t("span",{class:"dw-count"},"3/7",-1))])])])]),t("div",Wa,[a[135]||(a[135]=t("div",{class:"stage-bar"},[t("span",{class:"st"},"Work panels — two-tone head, filter chips, rows & card grid")],-1)),t("div",Na,[t("div",Pa,[t("div",Ua,[t("span",Fa,[c(s(d),{name:"terminal",size:"md"}),a[95]||(a[95]=e("Bash ",-1)),a[96]||(a[96]=t("span",{class:"dw-meta"},"1 running",-1))]),t("span",ja,[t("span",Ga,[c(s(d),{name:"clock",size:"sm"}),a[97]||(a[97]=e("Recent",-1))]),t("span",Ka,[c(s(d),{name:"play",size:"sm"}),a[98]||(a[98]=e("Running",-1))]),t("span",Ja,[c(s(d),{name:"circle-check",size:"sm"}),a[99]||(a[99]=e("Done",-1))]),t("span",Ya,[c(s(d),{name:"list",size:"sm"}),a[100]||(a[100]=e("All",-1))])])]),t("div",Qa,[t("div",Za,[c(s(u),{status:"running"}),a[101]||(a[101]=t("span",{class:"nm"},"pnpm test -- --watch",-1)),a[102]||(a[102]=t("span",{class:"tm"},"0:42",-1))]),t("div",Xa,[c(s(d),{name:"circle-check",size:"sm",class:"ok"}),a[103]||(a[103]=t("span",{class:"nm"},"pnpm run build",-1)),a[104]||(a[104]=t("span",{class:"tm"},"3m12s",-1))]),t("div",$a,[c(s(d),{name:"close",size:"sm"}),a[105]||(a[105]=t("span",{class:"nm"},"pnpm lint",-1)),a[106]||(a[106]=t("span",{class:"tm"},"1m05s",-1))]),t("div",_a,[c(s(d),{name:"close",size:"sm"}),a[107]||(a[107]=t("span",{class:"nm"},"node scripts/migrate.mjs",-1)),a[108]||(a[108]=t("span",{class:"tm"},"0:18",-1))])])]),t("div",at,[t("div",tt,[t("span",et,[c(s(d),{name:"sparkles",size:"md"}),a[109]||(a[109]=e("Background Agent ",-1)),a[110]||(a[110]=t("span",{class:"dw-meta"},"1 running",-1))]),t("span",ct,[t("span",st,[c(s(d),{name:"clock",size:"sm"}),a[111]||(a[111]=e("Recent",-1))]),t("span",dt,[c(s(d),{name:"play",size:"sm"}),a[112]||(a[112]=e("Running",-1))]),t("span",ot,[c(s(d),{name:"circle-check",size:"sm"}),a[113]||(a[113]=e("Done",-1))]),t("span",it,[c(s(d),{name:"list",size:"sm"}),a[114]||(a[114]=e("All",-1))])])]),t("div",nt,[t("div",lt,[a[118]||(a[118]=t("div",{class:"ct"},[t("span",{class:"nu"},"01"),t("span",{class:"nm"},"Explore the auth module")],-1)),a[119]||(a[119]=t("div",{class:"ds"},"Map every callsite of the legacy token refresh and report findings",-1)),t("div",rt,[t("div",vt,[c(s(d),{name:"robot",size:"sm"}),a[115]||(a[115]=t("span",null,"kimi-k2 · thinking",-1))]),t("div",pt,[t("span",ht,[c(s(u),{status:"running"}),a[116]||(a[116]=e("Running",-1))]),t("span",ut,[c(s(d),{name:"clock",size:"sm"}),a[117]||(a[117]=e("0:42",-1))])])])]),t("div",gt,[a[123]||(a[123]=t("div",{class:"ct"},[t("span",{class:"nu"},"02"),t("span",{class:"nm"},"Draft the release notes")],-1)),a[124]||(a[124]=t("div",{class:"ds"},"Summarize the merged PRs since the last tag into user-facing notes",-1)),t("div",mt,[t("div",bt,[c(s(d),{name:"robot",size:"sm"}),a[120]||(a[120]=t("span",null,"kimi-k2 · thinking",-1))]),t("div",ft,[t("span",wt,[c(s(d),{name:"circle-check",size:"sm",class:"ok"}),a[121]||(a[121]=e("Done",-1))]),t("span",yt,[c(s(d),{name:"clock",size:"sm"}),a[122]||(a[122]=e("3m12s",-1))])])])]),t("div",kt,[a[128]||(a[128]=t("div",{class:"ct"},[t("span",{class:"nu"},"03"),t("span",{class:"nm"},"Run the integration tests")],-1)),a[129]||(a[129]=t("div",{class:"ds"},"pnpm test against the staging daemon",-1)),t("div",xt,[t("div",Tt,[c(s(d),{name:"robot",size:"sm"}),a[125]||(a[125]=t("span",null,"kimi-k2 · thinking",-1))]),t("div",St,[t("span",Ct,[c(s(d),{name:"close",size:"sm"}),a[126]||(a[126]=e("Failed",-1))]),t("span",zt,[c(s(d),{name:"clock",size:"sm"}),a[127]||(a[127]=e("1m05s",-1))])])])]),t("div",qt,[a[133]||(a[133]=t("div",{class:"ct"},[t("span",{class:"nu"},"04"),t("span",{class:"nm"},"Migrate the config files")],-1)),a[134]||(a[134]=t("div",{class:"ds"},"Rewrite the workspace configs to the new schema",-1)),t("div",At,[t("div",Bt,[c(s(d),{name:"robot",size:"sm"}),a[130]||(a[130]=t("span",null,"kimi-k2 · thinking",-1))]),t("div",Mt,[t("span",It,[c(s(d),{name:"close",size:"sm"}),a[131]||(a[131]=e("Cancelled",-1))]),t("span",Et,[c(s(d),{name:"clock",size:"sm"}),a[132]||(a[132]=e("0:18",-1))])])])])])])])]),a[141]||(a[141]=t("h3",{class:"sub"},"Responsive",-1)),a[142]||(a[142]=t("p",null,[e("See §02 "),t("code",null,"--p-bp-sm"),e(" for the breakpoint. This section only gives mobile-adaptation pointers for the chat interface; a full mobile mockup is out of scope for this spec.")],-1)),a[143]||(a[143]=t("div",{class:"callout info"},[t("span",{class:"ico"},"i"),t("div",null," At ≤640px: dialogs anchor to the bottom as Sheets (xl top radius, top drag handle), the sidebar collapses into an expandable drawer, the Composer toolbar is allowed to wrap, and the chat reading column drops its max-width to fill the screen. ")],-1))]),a[145]||(a[145]=o('
05

Rich Text Messages

Structured references travel as plain text on the wire and render as pills at both ends: the composer's editing surface and the rendered message stream share one pill vocabulary, so what you type is what the message shows. This section is the category spec — every future rich-text element (marks, embeds, interactive chips) joins it here.

Mention pill

The mention is the first rich-text element. It exists in two synchronized forms: an atom inside the desktop composer's ProseMirror document, and a pill in the message stream — assistant Markdown decorates local links with the same classes, and user/queue bubbles (verbatim wire text, never Markdown) render through the declarative ComposerText component. Both are the same mark: not a filled chip — no background, no vertical padding — just body text in a heavier weight (--weight-ui-strong) on a lighter ink (--color-text-muted), so the baseline stays flush with the surrounding text; a 2px horizontal inset (padding-inline: var(--space-05)) supplies the CJK/Latin autospacing that can't cross element boundaries and sets the mention apart from plain text; a 13px muted kind glyph leads, and the label is the basename — never the full path, which lives on the tooltip. Hover deepens the ink (glyph included) toward --color-text on every surface; in the message stream the clickable kinds (file, skill) also take the pointer cursor and the link underline, while the composer keeps pure editing semantics — I-beam, no underline, a click just places the caret. The shared classes live in app-ui's global sheet; the kind → glyph mapping is single-sourced in app-composer (mentionIcons) and also drives the mention menu rows, so a file looks identical in the menu, the editor, and the sent bubble. Copying from a bubble re-serializes the selection back to the wire text — pills carry their full attrs in data-mention-*, so a copy/paste round trip restores the link instead of a truncated basename.

Kinds and wire forms (serialization is a Markdown link, so the daemon payload stays plain text and the TUI needs nothing new):

KindGlyphWire formClick (in messages)
Filesingle folded-corner file glyph for every file (no per-extension variants)[name](path) — the dest is canonically encoded per path segment (every non-unreserved ASCII character → %XX; non-ASCII stays literal, so a CJK path reads as itself — one decodeURIComponent restores it on every surface)opens the file preview
Folderfolder glyph[name](path/) — trailing slash marks the kind (dest %%25 as above)inert (no target yet)
Skillsparkling glyph[name](kimi-code://skill/<name>) — the app's deep-link protocolopens the skill's SKILL.md in the preview panel

Hover tooltip: one document-level singleton (mentionTooltip) serves every pill — composer NodeViews, ComposerText-rendered bubbles, and Markdown anchors are all raw DOM a Vue wrapper can't reach, so it delegates on document mouseover into a single shared bubble. The bubble keeps the design-system tooltip's dark skin but is interactive. File and folder pills show the full path, wrapping anywhere within a fixed max width: every / separator muted, the basename bold (--weight-semibold). Skill pills show a card — the name with an open button at the right (opens the skill's SKILL.md in the preview panel; the path rides the wire skill descriptor through AppSkill.path), the description below, clamped to four lines; an unresolvable skill degrades to the name alone. Timing mirrors TooltipBubble (150ms show delay, top placement with flip, viewport clamping) and the bubble stays open while hovered so the button is reachable; native title tooltips are removed wherever a pill appears. The bubble is a documented structural exception to the component-primitive rule (like the dock overlay): its anchors are ProseMirror NodeViews and pillified spans a Vue wrapper can't reach, so the open/copy buttons re-implement the Button primitive's contract (size, hover, :focus-visible ring) by hand instead of importing it.

Edge cases: labels cap at 32 chars — a longer name takes a middle ellipsis that keeps the head of the base name and the whole extension (the full name stays in the data attributes, the full path on the tooltip). A pill whose target was deleted after the fact: hovering fires a one-byte existence probe (an inline spinner sits at the tail of the tooltip's path text while in flight), and a definitive not-found fades the pill and strikes it through — in messages and in the composer alike. Clicks are never gated on the verdict (the preview's own not-found state is the final answer); only confirmed-existing verdicts are cached, scoped to the session, so a recreated file recovers on the next hover and a flaky daemon can never strike a pill by mistake.

Behavior contract: a bare @ opens the menu instantly with the workspace root listing (Esc dismisses); with a query, the menu groups Files (debounced daemon search) above Skills (instant local filter), captions shown only when both exist, and an in-flight search never hides the current rows (a corner spinner marks it). Full-width from IMEs triggers identically. Insertion replaces the @token and adds a separating trailing space; the pill is one atom — Backspace removes it whole, and a zero-width caret anchor keeps the caret on the pill's line when it ends a paragraph. Drafts, history recall, and queue reloads revive pills from their link form on load, and pasting mention-link text (e.g. a copied pill) revives them too — the serializer round-trips both ways. Skill activation: sending a message with exactly one skill pill activates that skill via the existing channel (the pill form of /skill:<name>, the full text — the pill traveling as its mention link — becomes the args, attachments ride along), and the sent bubble shows the original message verbatim with the pill revived in place (a slash-typed activation, whose bare args carry no pill, keeps the identity card instead); two or more skill pills degrade to plain references, because each activation is its own turn.

Implementation map: schema/serialization/offset mapping in app-composer's composerTextDoc (pure, node-tested); the editor surface in composerEditor; user/queue bubbles render via app-composer's ComposerText (one segment pass, declarative tree — no post-processing); assistant-side classification (classifyMentionHref) and decoration in app-markdown's Markdown.vue link pass; hover + skill-click routing in app-composer's mentionTooltip singleton, wired per app shell. When editing these, keep the two surfaces in lockstep — a pill that serializes one way in the composer must read the same way in a message.

06

Theming

Kimi Web uses one unified theme: the same components, fonts, radii, shadows, and surfaces — theming only swaps color values. Every semantic color token ships a light value in :root and a dark override in the data-color-scheme blocks; the semantic status colors (success / warning / danger) are independent palettes, one set each for light / dark.

Accent

The app has one accent: the brand blue (--color-accent, #1783ff light / #58a6ff dark). Use it sparingly — the accent is reserved for the primary action, focus rings, links, and active marks (current tab, toggles); large fills always come from the neutral surface tokens. Selection that means "where I am" (sidebar rows, list pickers) is deliberately NOT accent-tinted — it uses --color-selected so it reads as location, not as an action.

Light / dark mode

Each semantic token ships a light value in :root and a dark override in the two data-color-scheme blocks (explicit choice, or following the OS preference via prefers-color-scheme). Switching light / dark simply swaps between these two sets of derived tokens, with zero structural change.

Benefits of one theme: components, fonts, radii, and surfaces are consistent site-wide; a single accent keeps the brand identity unambiguous; light / dark mode works out of the box; semantic status colors are independently tunable.
07

Style Rules

Anti-pattern rules that all UI code must follow. These rules are also the basis of the check-style detection script, one-to-one with a warning.

Rule IDWhat it detectsAction
no-gradient-textgradient text / gradient backgroundForbidden
no-glassmorphismbackdrop-filter: blur (TopBar sticky nav bar and menu surfaces via --p-menu-backdrop are the exceptions)TopBar + menus exempt
no-color-glowcolored / large-radius box-shadow glowForbidden
no-emoji-iconusing emoji as a functional icon (no exceptions). Emoji inside user content — session titles, messages — is not chrome and is out of scope (see §07 Session row's emoji icon)Forbidden
no-hardcoded-hexunregistered hex color inside a component <style>Warning
no-hardcoded-fonthard-coded font-family in a component (e.g. 'Inter') instead of var(--font-ui)Warning
radius-from-scaleradius value not in {4,6,8,12,16,20,999}Warning
z-from-scalez-index using an unregistered large numberWarning
weight-from-scalefont-weight not in {400,500}Warning

State matrix

Every interactive primitive should define the following states where applicable; missing ones are flagged by the style rules. focus-visible always uses --p-focus-ring (appears only on keyboard focus, see §08); disabled is uniformly opacity:.5.

StateButtonInputCardMenu itemSwitch
default
hover
active / pressed
focus-visible
disabled
loading
selected / active
error
readonly

Chat working indicator

The chat working state ("prompt sent, turn unfinished") is a brand signature of Kimi Web, rendered uniformly by the WorkingIndicator component: the 小蓝 mascot plus a phase label — "Requesting…" until the assistant's reply starts, "Working…" once it is streaming. All other loading states (including ActivityNotice) use the plain Spinner.

Glassmorphism exemption

backdrop-filter: blur is banned site-wide, with two exceptions: the .frost variant of TopBar — only in the one place of the "sticky navigation bar", used to stay readable over scrolling content — and the floating menu surfaces: Menu.vue, the Select listbox and the composer dropdowns use the --color-menu-bg token (a 95% surface), while the autocomplete family — slash/mention popups and the dock work panel — deliberately runs a frostier recipe of its own: 70% page background (single-sourced as --color-menu-bg-frost) over the shared --p-menu-backdrop blur, which stays the single-sourced blur token across all of them. The dock's work surfaces — the work panel and its pills, persistent over the scrolling transcript — ride that same frostier recipe (specified per-surface in §04 (Dock · work pills & panels)) rather than a bespoke one. No other component (card, dialog, Toast, panel) may use glassmorphism; violations are flagged under no-glassmorphism, and menu blur with ad-hoc values (anything but the token) is flagged too.
08

App Shell & Sidebar

The structural spec for the app shell (three-column grid + right preview panel) and the left session sidebar. These are business-agnostic "skeletons" — components, fonts, radii, and surfaces are reused from §02 / §03, but layout and alignment have their own conventions.

Layout grid

On web it is a single-row 5-track grid: the sidebar and the right panel each occupy a permanent auto track, with the conversation column in the middle; two 0-width tracks are for the ResizeHandles. (The desktop app adds a second row for its terminal panel — desktop-only, see below.)

App.vue · .app
grid-template-columns: auto 0 minmax(0, 1fr) 0 auto;\n    /*         sidebar ↑    ↑handle  ↑conversation  ↑handle ↑right panel (auto) */
TokenValueUsage
sidebar width270px default (adjustable)expanded sidebar width, changed by dragging the ResizeHandle; should approach §02's --p-sidebar-w (264px)
--preview-w460pxwidth of the right preview panel when open
--panel-head-h48pxunified height for all right panel heads + the conversation column head; both use a 0.5px bottom hairline
--p-bp-sm640px≤640 switches to a mobile single column (top bar + conversation), no sidebar / handle / right panel
  • The right panel track exists permanently, with its width toggling between 0 ↔ var(--preview-w) and no transition — animating a grid track would relayout the whole app grid every frame (when open it squeezes the conversation column, rather than switching templates).
  • The sidebar collapses SYMMETRICALLY to the right panel: its container width animates to 0 while the content keeps its fixed width anchored to the right edge (clipped, sliding out left — no reflow, hairline stays on the clipped content). No rail remains. The collapse control differs by platform: on macOS desktop the toggle is a single resident floating IconButton pinned beside the traffic lights (rendered in both states, only the glyph swaps — the sidebar slides underneath it, never moves or flashes); on Windows / web the collapse button lives inside the sidebar header (right-aligned), and a floating expand button appears at the top-left only while collapsed. The conversation header uses a 0.5px bottom hairline and pads left in step with the transition while collapsed.
  • All grid children must have min-height:0; min-width:0, so only the inner scroll containers scroll and the page itself does not scroll.

Sidebar alignment system (--sb-*)

All sidebar rows (group head, session row, New chat, search, and Settings buttons) share 4 custom properties. Their 16px icon slots and --sb-gap place every label on the same x-axis as the workspace name.

TokenValueUsage
--sb-inset12pxrow box (hover/selected pill) inset from the sidebar edges — matches the brand header's 12px padding
--sb-pad-x20pxcontent start x (= --sb-inset + 8px row padding)
--sb-gutter16pxleading icon slot width — matches the workspace folder icon so the session title aligns under the workspace name
--sb-gap8pxgap between the icon slot and the text
i
The session title's starting x = --sb-pad-x + --sb-gutter + --sb-gap. The group head has a folder icon and the session row has a status slot; both icons are the same width and position, so the titles align naturally.

Sidebar structure

The sidebar from top to bottom: brand header → action group → pinned head (pinned section + "Workspaces" label) → scrolling grouped list (workspace head + session rows) → user-menu footer. New chat and Search are direct sibling controls in the same grid container; the optional new-workspace action shares the first row, while Search spans the next row. A 4px gap keeps Search clear of the scroll boundary. The pinned head sits OUTSIDE the scroll container (the action-group / footer pattern — never position: sticky, which would need an opaque plate over the frosted tint), so the pinned sessions and the "Workspaces" label stay put while the workspace groups scroll beneath; the pinned section is collapsible (a chevron on its label, revealed on hover/focus and kept visible while folded; state persisted) so a long pinned set can't eat the sidebar, and it re-expands when a new session is pinned. Both pinned edges use three light near, middle and far fades across 18px, entering over 260ms only while more session content exists beyond that edge — the top seam lives at the pinned head's bottom border. The footer seam is a 0.5px hairline. Controls reuse the §03 primitives as much as possible. The sidebar sits on --color-sidebar-bg (one step off --color-bg: warm off-white just under white in light, one step BELOW the page in dark — the session column reads as its own plane, and with dark elevation = lighter the chrome never sits brighter than the conversation pane; the hairline still separates it from the pane). Vertical rhythm: the brand header keeps 12px padding (on macOS desktop the left padding grows to 80px to clear the traffic lights); rows inside the action group stack flush (0 gap, same rhythm as the list rows); adjacent groups are separated by 12px. The search glyph has a -0.5px optical correction to align its visual centre with the label. Row hover uses --sb-hover (= the global --color-hover wash); the selected row uses the lighter --sb-selected wash derived from --color-selected — On macOS desktop the sidebar is instead frosted: the window carries a native NSVisualEffectView ('menu' vibrancy, following the in-app scheme via the nativeTheme mirror, its state pinned to inactive so the material keeps its flat pressed-down colour — ≈ #282829 dark / #E7E7E7 light — with no active/inactive drift) and the sidebar column drops --color-sidebar-bg for a single translucent --color-sidebar-tint wash that presses the pinned material one step — ≈ #282829 → ≈ #1e1e1f in dark (rgba(0,0,0,0.25)), ≈ #E7E7E7 → ≈ #f1f1f1 in light (rgba(255,255,255,0.4)) — with header and footer staying transparent so the tint reads as one uniform pane; the root chain (html/body/#app/.app) stays unpainted only under the macos-desktop + vibrancy flags — the latter is the Settings → Appearance accessibility switch (default on; persisted main-side so the window is created with the right material, and live-applied on toggle): off repaints the root chain and the sidebar falls back to opaque --color-sidebar-bg, while the traffic-light layout keeps keying off macos-desktop alone — while the conversation pane, chat header and right preview keep their own opaque surfaces. The list's hover-icon clusters (session-row kebab, group-head actions) paint NOTHING there — no plate, no wash, no blur (real backdrop blur does not even render over this window: Chromium's backdrop sampler returns a flat wash above the transparent BrowserWindow + vibrancy view). Instead the row's title/name dissolves before it ever reaches the buttons: a two-stage mask-image fade — a subtle 16px dissolve at rest, extending over the cluster zone only while the actions are revealed (row hover / keyboard focus / menu open): 34px on session rows (the pin+kebab cluster overhangs the title by ≈25px), 68px on group heads (the floating cluster is ≈60px wide). The fade is zone-based, so short rows render untouched, and text-overflow becomes clip so a long tail dissolves instead of dotting.

BlockUseNote
Brand headerlogo + name + collapse IconButton (right-aligned)on Windows / web the brand is left and the collapse IconButton sm is right-aligned inside the header; the dev-only backend version/address pill uses the UI font, not monospace; the logo is animated (a blinking eye). On macOS desktop the header is a bare drag strip (brand hidden, traffic lights + resident floating toggle over it)
New chatfull-width left-aligned button (custom)500-weight label; same rhythm as the session rows in the list (left-aligned, hover = --sb-hover). Do not use Button (centered, breaks the rhythm)
Searchbare search row (custom)500-weight label; no border, hover/focus shows the faint --color-hover wash; icon + label, with the Kbd keycaps (⌘K / Ctrl K) pushed to the trailing edge — label and shortcut are justified apart. Do not use Input (the 38px bordered version is too heavy). It is a direct sibling of New chat in the action group
Section label.p-section-labeluppercase muted small titles like "Workspaces", using --weight-section-label (600)
Pinned headfixed block above the scroll container (.sessions-head): the pinned section (PinnedSessionList.vue) + the "Workspaces" section labelstays put while the workspace groups scroll; owns the top scroll-linked seam (hairline + fade, only while scrolled). Pinned rows render in pure recency order (updatedAt desc — no manual ordering, no attention tiering): drag a session row in to pin it (the drop spot carries no position meaning), drag a pinned row out to unpin. The pinned section folds via its label chevron (persisted, kimi-web.pinned-collapsed) and re-expands only on an explicit pin (never on load backfill); the expanded rows are capped at 40vh with their own scroll so a long pinned set can't push the list or footer out of view
Workspace head / session rowsee next two sectionsshare --sb-* alignment
User-menu footeraccount area (components/UserMenu.vue) opening an upward §03 menupinned row under the session list, separated by a 0.5px --line hairline; trigger keeps the same list-style family as New chat (24px round avatar + nickname when signed in, user icon + sign-in hint otherwise). The menu box follows the trigger's left edge and width (ResizeObserver-tracked, so it survives a sidebar resize) and is teleported to body because the column's container-type would capture position:fixed. Rows: plan usage / theme / language are macOS-style hover flyout submenus — the parent row carries the module icon, a faint current value and a fixed chevron-right, and hovering (or moving focus to the parent row, or pressing Enter / Space / → on it) opens a teleported panel anchored to the parent menu's right edge (content-adaptive width floored by the menu's own min-width and capped at the parent menu's width; flips left near the viewport edge) with a 250ms hover-intent close grace; the usage panel shows weekly + 5h rows (used-percent values via settings.planUsage.usedPct, with severity colours), while the theme (three schemes) and language (two locales) panels move the check to the picked option without closing the menu — then the upgrade entry below the top plan level, settings (with an always-visible Kbd keycap shortcut hint on desktop) and a confirming sign-out; all menu icons come from the Kimi set, and the whole menu (flyouts included) runs one step above the §03 default density — base-size labels, taller rows
!
Why New chat / search / inline rename don't use Button / Input: they are "list-style" controls (full-width, left-aligned, compact, borderless), while Button is centered and Input is a 38px bordered control — forcing them in would break the sidebar's visual density and alignment. This is an intentional custom exception, not an oversight.

Session row

A session row is an inset rounded pill, structured as: status slot → title → time → attention Badge → hover actions (pin / archive).

PartRule
Containerpadding: 8px 8px inside the list's --sb-inset gutter, radius-sm; no fixed/min height — row height is font-driven (title line-height: --leading-tight, ≈16px) → ≈32px total, the sidebar-wide row rhythm. The hover actions are absolutely positioned so they never force the row taller (no hover jitter). hover = --sb-hover (the global --color-hover wash); active = --sb-selected (75% of the global selected wash) — neutral, no accent tint, no border, no weight change
Status slot (lead)fixed --sb-gutter width; running = Spinner sm, otherwise unread = 7px accent dot; empty while an attention Badge owns the row — one status at a time, decided by the shared SessionDisplayStatus enum (app-core sessionDisplayStatus.ts: approval › question › running › aborted › unread)
Titleflex:1 with truncation and user-select:none; double-click enters inline rename (compact input, not Input), whose text remains selectable
Emoji iconthe session icon is the title's LEADING emoji cluster (app-core splitSessionEmoji — no icon field; every client renders the title as-is). The emoji is an ordinary title character — no decoration at rest or on hover (it stays a <button> for a11y), and clicking it opens SessionEmojiPicker — a Menu-shelled panel (bare list-style search row → scrollable sections: Recently used persisted in localStorage (cap 8) + the grouped emoji dataset, with remove/random as MenuItems in the footer; a query swaps the sections for keyword-search results), teleported + fixed + --z-dropdown, popping from the trigger corner like the right-click menu. The menu's "Set Emoji…" opens the same picker and is the discoverable path. Inline rename edits the whole title — the emoji is an ordinary character in the input
Timemono xs, fg-faint; yields to the hover actions on hover
Attention BadgeBadge sm: info (needs answer) / warning (needs approval) / danger (aborted)
Hover actionsIconButton sm × 2 — pin + archive — cross-faded over the time on row hover (no kebab button). Right-clicking the row opens the full menu (copy ID / rename / emoji / fork / export / pin / archive + timestamp) anchored to the cursor, except over the inline rename input, where the native text-editing menu stays
Flat-style variant (flat list + pinned section)the sidebar's flat list rows AND — always, regardless of view mode — the pinned section's rows differ from the grouped row in three ways (all keyed off the facade projecting cwdLabel): ① no leading status slot — the title is left-aligned at the row's content edge; ② a second line under the title: folder-closed icon sm + the cwd's final directory name (- when the session has no cwd), xs faint like the time — except the icon, which takes --color-text-muted (one rung stronger, the same optical compensation as the group head's folder; the open-folder glyph's thin back-flap washed out at 14px) — rest-width tail mask fade; when the session has an associated PR (v2 git domain), a small tag (git-pull-request icon + #number, 2xs medium on a soft ground with a hairline edge and radius-sm corners — a mini §03 Badge) sits at the line's right edge, state-colored the GitHub way (open = --color-success-soft ground + --color-success text, merged = --color-done-soft + --color-done purple, closed = neutral sunken) and opens the PR on click; ③ the first line's right side shows status — attention Badges anchored to the row's right edge, running Spinner, unread dot — INSTEAD of the time, which only renders when there is nothing to report (the Spinner yields to the attention pills: a session waiting for approval/answer never shows both); on hover the actions cross-fade IN as the whole status cluster fades OUT — pills and pin/archive never co-exist (grouped rows keep pills visible on hover). Height stays font-driven — the pill just grows the line. Grouped rows never set cwdLabel and keep the classic structure. The flat ↔ grouped switch lives in a dropdown on the SESSIONS section label (fixed list-settings icon + hover tooltip; the menu opens with a muted group label, per-view icons, and the current view checked at the row's right edge; mode persisted per device)
Archiveno confirm — the hover archive button / menu item archives immediately, then App.vue shows the §03 ActionToast (top-center) with Undo (restores the session) and Settings (opens the archived list)

Workspace group

The group head and session rows share --sb-*: folder icon (open/closed) → name, with the kebab and "+" revealed on hover.

  • The folder icon leads the row (switching icons between open and closed states) with the plain --sb-gap before the name — it does not pad out the --sb-gutter slot.
  • The name uses 500 weight with muted color (--color-text-muted, one step lighter than session titles), so group heads remain clear without competing with list content. No path subtitle; hovering the name shows the full root path in a Tooltip.
  • The kebab (menu) and "+" (new chat in this workspace) both use IconButton sm inside a floating actions layer anchored to the row's right edge — no reserved layout space, so the name uses the full row width when idle. Shown on hover, keyboard focus, or while the menu is open; the layer backs itself with the sidebar surface (container background) plus the row hover wash (an ::after shown only while the row is hovered), so its color exactly equals the row's current background and the overlapped name tail doesn't bleed through (hidden via opacity:0, staying in the tab order). On macOS desktop the layer paints nothing at all — the name's mask-image fade (see the sidebar section above) dissolves the tail before it reaches the buttons
  • The group is collapsible; when collapsed its session list is hidden.
  • While the active workspace has no session selected (the draft state — e.g. right after adding the workspace, or after New chat), the group head carries the same neutral --sb-selected fill as a selected session row (selection reads as "where I am"; the fill wins over hover). Once a session is selected or created, the fill moves to that session row.

Show more & collapse

The "expand / collapse" controls at the bottom of each workspace group are compact list controls (same family as search, New chat, inline rename — not Buttons) sharing one row: expand (chevron-down) first, collapse (chevron-up) after a faint middot when both are present. Expanding reveals the next batch of sessions, fetching the next page from the server only when the locally loaded rows can't cover it — the control never exposes whether a reveal came from memory or the network.

PartRule
Rowa single flex row holding the controls, all content-width — hover washes just the button as a snug pill, never the full row. Font-driven height (≈32px like a session row), radius-sm; hover = --sb-hover (no text recolor); :focus-visible uses --p-focus-ring
Chevronsm (down = expand, up = collapse); the row indents by --sb-gutter + --sb-gap so the first button's chevron starts exactly at the session-title x, lining the control's leading edge up with the titles above
Labelfont-ui, text-xs, --color-text-muted; truncated
Separatorfaint middot (--color-text-faint) with --space-1 side margins, rendered only when both controls are present
Behavioreach group keeps a display cap starting at the first page; "Show more" steps it up by one batch (5) and fetches the next page only when the loaded rows fall short (busy = "Loading…", disabled); "Show less" resets the cap to the first page (view-layer trim — data is kept, no refetch). "Show more" exists while undisplayed loaded rows remain or the server has more; "Show less" appears once past the first page

ResizeHandle

A 4px grab strip layered over the 1px column border (margin: 0 -2px makes the whole 4px grabbable) with a centred 2px indicator bar. The bar stays transparent at rest and shows the neutral fills one step up the ramp — f2 on hover, f3 while the drag is live (the sidebar column is translucent on macOS, so f1 read too faint) — never the accent.

RuleValue
Width / cursor4px strip, 2px bar / col-resize mid-range; w-resize / e-resize at the drag limits (hints the direction that still resizes)
Normal / hover / dragtransparent / --color-selected (f2) / --color-line-strong (f3) — the neutral ramp one step up, never accent
Layer--z-dropdown, above pane-level sticky chrome (chat dock at --z-sticky) so the overhang stays visible and grabbable
Behaviorpanel width follows the pointer 1:1 while dragging (the parent disables transitions to avoid lag); on release it is persisted to localStorage

Right panel

The right panels (file preview / Diff / compaction summary / sub-agent / side chat) share one track and one head primitive.

  • The panel head uses the PanelHeader primitive (48px = --panel-head-h), the same height as the conversation column head, so the hairline runs as one line.
  • Panel head: bold mono title + optional muted subtitle + middle slot (Badge / control / path) + close IconButton on the right.
  • When opened, the panel width snaps from 0 → var(--preview-w) with no animation, squeezing the conversation column in a single layout.
  • At ≤640px the panel becomes a full-screen overlay (position:fixed; inset:0).

Bottom terminal panel (desktop-only)

The native terminal (components/terminal/) sits in the conversation column's own bottom grid slot — the sidebar and the right panel span BOTH rows and keep full height (the VS Code layout: the panel belongs to the editor area, not to the whole window). Its height transitions 0 ↔ var(--terminal-h) (260px default, 120 min, 60% viewport max; persisted), squeezing the conversation column above instead of overlaying it. The panel mounts lazily on first open and then stays mounted so xterm scrollback survives a collapse.

  • Resize: a horizontal twin of the ResizeHandle (4px strip over the 0.5px top hairline, row-resize mid-range, n/s-resize at the limits, same neutral f2/f3 ramp, never accent). The shared useResizable hook owns it via axis: 'y'; the height var is written imperatively during a drag (same no-Vue-rerender rule as --preview-w).
  • Toolbar (32px, 0.5px bottom hairline): tab strip on the left — each tab is a compact radius-sm pill (leading terminal glyph, muted while exited + shell label + hover close affordance), the active tab uses --color-selected, hover --color-hover; a "+" action appends a tab. Tabs follow the §08 tablist keyboard model (roving tabindex, ←/→/Home/End), the close affordance is its own button (no nested interactives), and the height separator is keyboard-operable (↑/↓ in steps, value exposed). Trailing actions: restart (only while the active tab exited) and a collapse chevron. Collapsing sets inert on the region — the xterm instances and their scrollback stay mounted but leave the tab order.
  • The xterm canvas cannot resolve CSS variables either, so its palette is resolved from the live --color-* tokens at runtime (re-read on scheme flips; the ANSI hues the status ramp doesn't cover use dedicated --color-term-magenta/cyan tokens); the font is the app JetBrains Mono stack sized off the content token scale. While focused, the panel owns every key except the registered app shortcuts (chat-level Esc / find / select-all chords stay inert inside it).
  • Entries: the chat header's terminal IconButton (right of Open in, lit while the panel is open) — on the empty-composer state, where no chat header renders, the same button floats at the conversation's top-right instead — plus ctrl+` (⌃` on macOS — VS Code's binding; ⌘` stays free for the OS window switcher — customizable in the shortcut registry), and the View menu's Toggle Terminal item. New tabs spawn in the visible workspace root. Terminal state is per session: switching sessions swaps the visible bucket while the others keep their PTYs and xterm views alive (scrollback survives a round trip; the ten most recent sessions are kept, LRU). The panel never renders on mobile / web.
i
One-sentence principle: the sidebar / shell is a "list + grid" skeleton that reuses the §02 tokens and §03 primitives (Button / IconButton / Badge / Kbd / Menu / Spinner / PanelHeader); compact list controls that don't fit a primitive (search, New chat, inline rename, show-more) keep their custom form, governed by this section.
09

Accessibility (pragmatic edition)

Kimi Web is a local developer tool; it does not target a specific WCAG conformance level, nor maintain a full screen-reader QA matrix. This section collects only the rules that are "low-cost, don't hurt the look, and directly benefit keyboard-heavy users", as the baseline contract for each primitive; the more expensive, lower-ROI parts (such as real-time announcement orchestration for streaming output) are not mandatory for now.

i
On the "ugly" focus ring: the focus visibility required below always uses :focus-visible (not :focus). It appears only on keyboard focus; mouse clicks don't trigger it, so it doesn't pollute the mouse-driven visual; the ring's strength is tuned uniformly with --p-focus-ring, not overridden per place.

1. Contrast & color

  • Body text vs. background contrast ≥ 4.5:1; control borders, icons, and key graphics ≥ 3:1. When changing theme colors / dark mode, verify against §05 together.
  • Button text vs. button background, and form controls (input, placeholder, helper / error text) vs. their section background must all have contrast ≥ 4.5:1 (large text ≥ 3:1). White-on-white text, a transparent borderless button floating over the page background, and a light placeholder on a near-white background are all flagged by the style rules.
  • State is not conveyed by color alone. Error, selected, and disabled states also carry text, an icon, or a shape change (for example an error state is not just red, but also carries text or an icon).

2. Keyboard operable

Anything doable with a mouse must also be doable with a keyboard; Tab order follows the DOM, with no invented skipping. Composite controls define their keyboard model per the table below; a missing model is treated as incomplete:

ControlKeyboard behavior
DialogTab cycles within the dialog (focus trap); Esc closes; focus returns to the trigger element after closing.
Menu / move the highlight, Enter selects, Esc closes.
Tabs / switch tabs (roving tabindex); only the current tab is in the Tab sequence.
Switch / Segmented / or Space / Enter to toggle.

3. Focus visibility

  • Every interactive element must have a visible focus indicator on keyboard focus, uniformly via :focus-visible + --p-focus-ring (primary actions may use --p-focus-ring-strong).
  • Bare outline: none is forbidden. To remove the default outline, you must provide an equivalent replacement style.

4. Labels & semantics

  • Semantic HTML first (button / a / input / dialog…); ARIA is added only when native semantics fall short.
  • Icon-only buttons must have an aria-labelIconButton already enforces this with a required label prop.
  • Dialog: role="dialog" + aria-modal="true", with the title as the dialog's accessible name.
  • Purely decorative SVG / icons get aria-hidden="true" to avoid being read out by screen readers.

5. Target size

Desktop click targets ≥ 32px; touch devices ≥ 44px (consistent with the §01 principle and the IconButton lg tier).

6. Reduced motion

Handled uniformly in the global styles per §02's @media (prefers-reduced-motion: reduce); components do not check this individually. The chat working indicator's mascot renders its static fallback.

7. Live announcements (non-mandatory)

Screen-reader announcements are not a mandatory contract in this product. Short hints like Toast can use role="status" / aria-live; chat streaming output is currently not announced word-by-word, which is an acceptable trade-off, to be added later if a real need arises.

Explicitly not mandatory for now: a WCAG conformance-level claim, a complete ARIA pattern table, a per-screen-reader QA matrix, and real-time announcement orchestration for streaming output — these are not written into the primitive contract, to avoid becoming slogans no one maintains.
10

Dialogs

Every overlay in the app — pickers, browsers, managers, confirmations — is built on the single §03 Dialog primitive. This chapter fixes the two layout anatomies allowed inside that frame, plus the row and footer contracts that make all dialogs read as one family. Do not hand-roll a third anatomy.

The frame (recap)

All dialogs share the §03 primitive: --radius-xl radius, --shadow-xl shadow, a restrained 28% neutral backdrop, a head (title + IconButton close), a body, and a right-aligned foot. Widths md 440 / lg 640 / xl 760 and auto / fixed height are chosen per §03. One interruptive overlay at a time; Esc closes; focus is trapped and restored. A blocking flow that must be resolved rather than dismissed (server token) uses hideClose with closeOnOverlay/closeOnEsc off — never a hand-written overlay.

Anatomy A — padded (forms & confirmations)

The default: the body carries its own padding and the caller drops content straight in. Confirmations put their Buttons in the #foot slot (right-aligned, cancel → confirm). Used by: confirm, login, status panel, server token.

Anatomy B — flush (pickers & browsers)

:padded="false" with height="fixed"; the consumer owns the zone layout inside a full-height column. The zones below are the whole vocabulary — a picker dialog composes them and adds nothing else. Used by: model picker, session search, folder browser, provider manager.

ZoneContract
SearchThe boxed §03 Input, inset 22px so its edge aligns with the head title. Autofocus on open. No leading icon, no borderless variant.
Filter chipsOptional. 28px pill: transparent + muted text by default, --color-hover on hover, --color-selected + medium --color-text when active. Horizontally scrollable with the scrollbar hidden. Never a row of Buttons.
Listflex:1, owns the vertical scrolling, padded 4px 8px so rows bleed near the dialog edge. role="listbox"; rows carry role="option" + aria-selected.
Row8px 12px padding, --radius-md. Two quiet lines: name 14/20 (medium when current) and a meta line 12/18 in --color-text-faint — provider · context · capability labels, dot-separated. No badge rows, no raw-id line (search still matches them). Trailing slot: check icon (current row only), then the star IconButton.
Row statesHover / keyboard-selected → --color-hover; current → --color-selected — a neutral "where I am" fill, never an accent tint, never an inset stroke. The star stays hidden until row hover, keyboard selection, or starred; it is always visible on touch devices and colored --star when starred.
State rowsLoading / unavailable / empty: centered on both axes, muted 14px; warning color only for the unavailable case.
Shortcut barThe footer: full-bleed, padding 8px 16px, border-top --color-line, left-aligned. Keyboard hints are Kbd keycaps + 12px --color-text-faint labels, groups separated by "·", the whole bar aria-hidden. An instructional sentence (folder browser) reuses the same bar without keycaps.

Keyboard & behavior contract

  • / move a keyboard selection (rendered identical to hover) and always scrollIntoView({ block: 'nearest' }); Enter selects and closes; Esc closes.
  • Pointer hover drives the same selection index, so keyboard and mouse never disagree about which row is active.
  • Rows transition background only (--duration-fast ease-out); the open/close animation lives in the primitive, not in the consumer.
  • Selection is a fill, not a border (surface over stroke). Accent blue is reserved for actions — primary buttons and focus rings — never for "which row am I on".

Dialog map

DialogAnatomyComposition
Model pickerflush · lg · fixedsearch + provider chips + model rows + shortcut bar
Session searchflush · lg · fixedsearch + result rows (sidebar-style alignment: one icon gutter, shared left text edge, shared right meta edge; workspace rows single-line name + right-aligned path, session rows title + time over a workspace · snippet meta line; quiet uppercase section heads with counts; empty query shows a few top workspaces + recent sessions) + shortcut bar
Folder browserflush · lg · fixedbreadcrumb bar + filter bar + folder rows + actions + hint bar
Provider managerflush · xl · fixedmanagement rows with inset dividers (rows are not selectable) + add section + shortcut bar
Confirm / Login / Statuspadded · md · autotitle + message or form + right-aligned foot
App update (desktop)padded · lg · autoversion title (stays "发现新版本 vX" even while downloading) + quiet meta line (release date · current version) + height-capped scrolling what's-new list + right-aligned action row (skip → download; downloading → background + disabled live-percent button; later → restart) with the auto-download checkbox right-aligned on its own foot row below (a pure preference for future checks)
Server tokenpadded · md · autohideClose, no Esc/overlay close — resolved only by a valid token
Settingsflush · xl · fixedpage-like exception: side-nav region, per §03
Onboarding wizardnot a Dialogfull-page takeover (not built on §03): one centered column (brand lockup → step content → ghost actions + centered primary CTA); selectable options share the option-card pattern — 0.5px --color-line hairline, --color-accent border + --color-accent-soft fill when selected
Design intent: a picker dialog should feel like a quiet command palette — one boxed search, calm rows, a neutral "you are here" fill, and a predictable shortcut bar. Anything noisier — badge clouds, accent-selected rows, per-dialog footer inventions — is a regression to weed out.
11

Session Admin Page

The session admin page (/admin/sessions, opened from the sidebar's list-management menu) is a full-pane management view for cross-workspace session triage: filters, a server-side paged table, and batch lifecycle actions. It is a main-view peer of the conversation pane (mainView in the facade, switched with v-show so the chat stays alive) and page-private by decision — everything lives under components/admin/ (SessionAdminView/Table/Pagination, FilterSelect, MultiSelectMenu, SessionAdminMenu, useAnchoredMenu); nothing here promotes to §03 until a second consumer exists. Data is one GET /api/v2/sessions page-mode call per filter/page change (all conditions pushed down, no client-side aggregation); batch archive/restore go through the v2 batch endpoints with per-item outcomes.

Page skeleton — a full-pane admin surface

A 48px title bar (a back IconButton — chevron-left, tooltip 返回, closing the page back to the chat underneath via closeSessionAdmin — then the page title, semibold base; hairline bottom edge; on macOS desktop it doubles as the window-drag region and takes the chat header's collapsed-sidebar clearance — 146px / 78px / Windows fallback — so ONLY the bar insets, the body never does) → muted subtitle → query-form filter bar → table card → pager. The title bar and the scroll container are siblings (bar fixed, body scrolls). The page wrapper spans the whole conversation column — do not apply the chat content measure (--p-content-max) here: under table-layout: fixed a narrow wrapper crushes the table's flexible columns to zero width (the title/prompt columns collapsed in practice). An admin table surface owns the pane width. The status filter defaults to 全部 (all) — the page is the whole inventory, 重置 restores that same default.

!
Lesson (content measure): --p-content-max is a READING measure for prose-like content (chat, dialogs). Full-bleed work surfaces — tables, grids, dashboards — span the pane instead. Pick one deliberately; inheriting the chat measure by default is the bug.

Table

The card is the flat shell: 0.5px --color-line hairline, --radius-lg, no shadow. Inside, table-layout: fixed with a colgroup: fixed-width utility columns (checkbox, workspace, status, the two time columns, actions) and two flexible content columns (title at max(200px, 20%) — a floor, not a bare percentage — last prompt taking the rest). The head row is a pinned-height 32px box (it hosts the batch transform below); body rows are 40px. Rows are separated by 0.5px --color-subtle hairlines (none after the last row), with a --color-hover wash on hover. Every cell truncates single-line with ellipsis and carries a title tooltip. Time columns are absolute (YYYY-MM-DD HH:mm) in --font-mono xs with tabular-nums — the admin page is an audit view, so no relative times; empty values render a faint . The status column sits right after the workspace column and reuses the sidebar row's lifecycle glyphs: state-open (dashed ring, --color-success) for 进行中 and state-done (checked ring, --color-done) for 已完成, icon + label. First load swaps the body for a centered §03 Spinner; refetches keep the stale rows and dim the card (opacity + pointer-events: none) rather than flashing it away; filters with no matches render the centered faint empty line.

Responsive steps (the card is the query container; web's narrow panes matter too): the time columns give ground FIRST — at ≤1020px their values swap to the compact MM-DD HH:mm at 108px (each time cell carries both spans, CSS toggles them — no JS measuring); at ≤760px the time columns hide outright (the col and the cells share sa-c-time/sa-col-time classes) and the workspace column drops its folder icon. The table itself floors at 640px and the card takes overflow-x: auto — past the floor the card scrolls horizontally instead of crushing title/prompt to zero, and auto still clips the rounded corners like hidden did.

ColumnWidthContent
checkbox36pxheader select-this-page (indeterminate) + row checkboxes
会话名20%title (emoji verbatim), weight 475, ellipsis; hosts inline rename
工作空间116pxfolder-closed icon + workspace name (cwd basename fallback)
状态88pxstate-open/state-done glyph + label
最后一条 promptflexmuted, ellipsis, faint when null
最后更新 / 完成时间140px ×2mono tabular-nums absolute time; completed shows while open
操作84pxlifecycle IconButton (state-done completes an open row, undo reopens a done one; tooltips carry 标记完成/恢复进行中) + ⋯ IconButton dropdown (Rename… / Fork / Export)

Batch header — the zero-offset transform

GitHub issues/PR semantics: while a selection exists, the head row transforms IN PLACE — the checkbox column stays put, and the remaining column headers swap for a single <th colspan> batch bar ("已选 n 项" + Mark-as-done / Reopen, each disabled when the selection holds no row of that lifecycle) inside the SAME pinned 32px box, so the table body does not move a pixel. Mark-as-done is the bar's one accent-primary button (fill + on-accent icon/label); Reopen stays a quiet hairline button. The selection itself is facade-owned (a reactive id set plus a per-id lifecycle map, reconciled against fresh rows on every landing) and survives page and filter changes — the batch count deliberately includes rows no longer visible. Successful batch items leave the selection and the current page is silently re-pulled; failures stay selected. There is deliberately no "clear selection" button for ordinary selections: unchecking rows or the header checkbox is the way out. Toasts ride App.vue's shared ActionToast channel (succeeded count, failed count when partial, Undo through the inverse batch endpoint); an all-failed batch has nothing to undo and surfaces as a WarningToast instead.

Select-all-matching — the Gmail move

Page-size caps (≤100) make "mark everything done" hopeless against thousands of rows, so the batch bar borrows Gmail's escalation: once the header checkbox has the whole page selected and total says more rows exist, a link-style button appears IN the bar (zero-offset — no banner pushing the table down): "选中当前条件下的全部 N 项" (busy-label 正在选中… while fetching). Activating it materializes every matching id into the selection via the ids projection (GET /api/v2/sessions?fields=id,archived — the one cheap shape whose page_size ceiling relaxes to 10000; cursor-walked for larger sets), merging atomically: a filter change mid-flight discards the fetch entirely. While active the count reads "已选中全部 n 项" and the link becomes 清除选择. Exclusions are free — unchecking a row just drops it from the set; emptying the selection drops the mode, as does a right-click single-row collapse. The mode ties itself to the filter fingerprint it was built from: a real condition change (query-form apply with different values, or any granular setter) clears the whole selection — re-applying the SAME conditions keeps it. Batch executions chunk at the wire's 5000-unique-ids ceiling (sequential, merged per-item outcomes; a thrown chunk aborts the rest and counts everything unexecuted as failed — the succeeded ids still reconcile).

The quiet-button border reset

All quiet icon/text buttons on the page (the batch bar's Reopen, the pager buttons) set border: none; background: transparent explicitly — or, for the bordered shapes (the filter triggers), an explicit 0.5px hairline. Row actions are pure §03 IconButtons (the sidebar row's language): the lifecycle glyph (state-done completes an open row, undo reopens a done one — tooltips carry the labels) plus the ⋯ dropdown; a text button per row read as visual noise once every row carried one.

!
Lesson (UA borders): the global reset clears button backgrounds only — a bare <button> still inherits the UA stylesheet's outset border, which reads as a stray box around every quiet control. Any quiet button outside the §03 primitives must reset both properties.

Quiet filter controls (query form)

The filter bar is a query form (antd Pro semantics): the controls edit a local DRAFT only — nothing is requested until an explicit apply. 查询 (a §03 Button variant=primary size=sm) applies the whole draft through the facade in one shot (applySessionAdminFilters — atomic write + page reset + exactly one request, never the per-setter debounce dribble), 重置 (a ghost sibling) restores defaults the same way, and Enter inside the bar queries too — except while any overlay (a select dropdown) is open, where Enter belongs to the overlay. Pagination is exempt: page/page-size changes still fetch immediately. Entry paths can pre-seed the conditions: the workspace home's 查看更多 opens the page with its workspace already selected in the filter (openSessionAdmin(workspaceId) applies the filter atomically with the navigation), and because the page is v-show-kept, the draft re-seeds from the applied filters on EVERY entry so the controls always show the true conditions. The controls themselves are muted sm labels plus a family of quiet 30px hairline controls (0.5px --color-line, --radius-md, transparent ground, --color-hover on hover/open) — deliberately NOT the §03 Select (a 32px+ form control with an accent focus ring, too heavy for a filter strip):

  • FilterSelect — quiet single-select (status, updated time, page size): the trigger carries the current label + a faint chevron; the dropdown is the §03 Menu surface with a leading fixed-width check slot and an optional lifecycle dot (--color-success open / --color-done done).
  • MultiSelectMenu — workspace multi-select: the trigger shows the selection as removable tags (at most two, then "+N"; empty = the 全部工作空间 placeholder). The anchored panel leads with a search row (case-insensitive name filter, autofocused, reset on close), then a Select-all row, then the option rows — no checkboxes, selected rows take the active highlight. The options area is capped at 320px with its own scroll (in-menu scrolls never close the panel); the panel STAYS OPEN on toggles so several workspaces can be picked in one go (Esc / outside click / outside scroll closes). Empty selection = no filter.
  • Updated-time presets — a FilterSelect of relative windows (全部时间 / 3 天以前 / 7 天以前 / 30 天以前): a pick maps onto the facade's updatedTo bound as the local calendar day N days back (computed at apply time, so a saved draft never goes stale), and the facade's day-end mapping turns it into updatedBefore. Deliberately not a calendar range picker — triage asks "older than X", not "between two dates".

Point-anchored context menus

useAnchoredMenu is the page's one menu mechanic: fixed-position §03 Menu surface, pop-from-anchor motion (fade + 0.97 scale on the menu tokens, origin and nudge following the upward flip at the viewport edge), closed by outside mousedown / Esc / scroll / resize. Three anchor modes — left-aligned under a trigger (filter selects), right-edge under a trigger (the row ⋯), and openAt(x, y) at a raw viewport point for the row contextmenu. The contextmenu has two shapes: on a row outside the multi-selection the selection first collapses to just that row and the menu is the single shape (Open session / Rename… / Fork / Export / — / the lifecycle action); on a row inside it, the multi shape (a muted count head + Mark-as-done (n) / Reopen (n), disabled per availability). Open session is the facade's selectSession — a user navigation that also leaves the admin page back to chat.

Inline rename

The title cell swaps for an accent-ringed input (--color-accent border + --color-accent-bd ring, --radius-sm) — Enter commits, Esc cancels, blur commits, settled once. The table is server-fed, so a commit is followed by a silent re-pull of the current page (the facade's pool update never reaches it).

',7))])])])]))}}),Rt=E(Ht,[["__scopeId","data-v-c695164c"]]);export{Rt as default}; diff --git a/apps/kimi-code/dist-web/assets/DesignSystemView-ModJnglN.css b/apps/kimi-code/dist-web/assets/DesignSystemView-ModJnglN.css new file mode 100644 index 000000000..52c46f0c0 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/DesignSystemView-ModJnglN.css @@ -0,0 +1 @@ +.ds-page[data-v-c695164c]{--d-bg: var(--color-bg);--d-surface: var(--color-surface);--d-surface-2: var(--color-surface-sunken);--d-surface-3: var(--color-line);--d-fg: var(--color-text);--d-fg-soft: var(--color-text-muted);--d-fg-muted: var(--color-text-muted);--d-fg-faint: var(--color-text-faint);--d-line: var(--color-line);--d-line-2: var(--color-line);--d-accent: var(--color-accent);--d-accent-2: var(--color-accent-hover);--d-accent-soft: var(--color-accent-soft);--d-accent-bd: var(--color-accent-bd);--d-green: var(--color-success);--d-green-soft: var(--color-success-soft);--d-amber: var(--color-warning);--d-amber-soft: var(--color-warning-soft);--d-red: var(--color-danger);--d-red-soft: var(--color-danger-soft);--d-violet: var(--color-done);--d-code-bg: var(--color-surface-sunken);--d-sidebar: var(--color-surface);--d-shadow-sm: var(--shadow-sm);--d-shadow-md: var(--shadow-md);--d-shadow-lg: var(--shadow-lg);--sidebar-w: var(--p-sidebar-w);--content-max: var(--p-content-wide)}.ds-page[data-v-c695164c] *,.ds-page[data-v-c695164c] *:before,.ds-page[data-v-c695164c] *:after{box-sizing:border-box}.ds-page[data-v-c695164c]{scroll-behavior:smooth}.ds-page[data-v-c695164c]{margin:0;background:var(--d-bg);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-base);line-height:1.65;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}h1[data-v-c695164c],h2[data-v-c695164c],h3[data-v-c695164c],h4[data-v-c695164c]{color:var(--d-fg);letter-spacing:-.01em;line-height:1.25;margin:0}p[data-v-c695164c]{margin:0 0 14px;color:var(--d-fg-soft)}a[data-v-c695164c]{color:var(--d-accent-2);text-decoration:none}a[data-v-c695164c]:hover{text-decoration:underline}code[data-v-c695164c],pre[data-v-c695164c],.mono[data-v-c695164c]{font-family:JetBrains Mono,ui-monospace,SF Mono,Menlo,Consolas,monospace}code[data-v-c695164c]{background:var(--d-code-bg);border:.5px solid var(--d-line-2);border-radius:5px;padding:1px 6px;font-size:.88em;color:#1f2937;white-space:nowrap}.layout[data-v-c695164c]{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);min-height:100vh}.sidebar[data-v-c695164c]{position:sticky;top:0;align-self:start;height:100vh;background:var(--d-sidebar);border-right:.5px solid var(--d-line);padding:26px 22px;overflow-y:auto}.brand[data-v-c695164c]{display:flex;align-items:center;gap:10px;margin-bottom:6px}.brand-mark[data-v-c695164c]{width:26px;height:26px;border-radius:7px;flex:none;background:var(--d-fg);color:#fff;display:grid;place-items:center;font-weight:800;font-size:14px;letter-spacing:-.04em}.brand-name[data-v-c695164c]{font-weight:700;font-size:15px;letter-spacing:-.01em}.brand-sub[data-v-c695164c]{font-size:12px;color:var(--d-fg-faint);margin-bottom:26px;padding-left:36px}.nav-group[data-v-c695164c]{margin:22px 0 8px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--d-fg-faint)}.p-section-label[data-v-c695164c]{font-size:12px;font-weight:600;text-transform:uppercase;color:var(--d-fg-faint)}.nav a[data-v-c695164c]{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:7px;font-size:13.5px;font-weight:500;color:var(--d-fg-soft);margin:1px 0;transition:background .15s,color .15s}.nav a .num[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:11px;color:var(--d-fg-faint);width:18px}.nav a[data-v-c695164c]:hover{background:var(--color-hover);color:var(--d-fg);text-decoration:none}.nav a.active[data-v-c695164c]{background:var(--color-hover);color:var(--d-fg)}.nav a.active .num[data-v-c695164c]{color:var(--d-fg-soft)}.content[data-v-c695164c]{min-width:0}.content-inner[data-v-c695164c]{max-width:var(--content-max);margin:0 auto;padding:64px 56px 120px}section[data-v-c695164c]{scroll-margin-top:32px;padding-top:8px}section+section[data-v-c695164c]{margin-top:72px}.hero[data-v-c695164c]{padding:8px 0 40px;border-bottom:.5px solid var(--d-line);margin-bottom:56px}.eyebrow[data-v-c695164c]{display:inline-flex;align-items:center;gap:8px;font-family:JetBrains Mono,monospace;font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--d-fg);background:#1783ff1a;border:none;padding:6px 12px;border-radius:8px;margin-bottom:22px}.hero h1[data-v-c695164c]{font-size:48px;font-weight:600;line-height:1.08;letter-spacing:-.025em;margin-bottom:18px}.hero h1 .grad[data-v-c695164c]{color:var(--d-accent)}.hero p.lead[data-v-c695164c]{font-size:18px;line-height:1.6;color:var(--d-fg-soft);max-width:680px}.hero-meta[data-v-c695164c]{display:flex;flex-wrap:wrap;gap:10px;margin-top:28px}.meta-chip[data-v-c695164c]{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--d-fg-muted);background:var(--d-surface);border:.5px solid var(--d-line);border-radius:8px;padding:7px 12px}.meta-chip b[data-v-c695164c]{color:var(--d-fg);font-weight:600}.meta-chip .dot[data-v-c695164c]{width:7px;height:7px;border-radius:50%;background:var(--d-green)}.sec-head[data-v-c695164c]{display:flex;align-items:baseline;gap:14px;margin-bottom:8px}.sec-num[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:13px;font-weight:600;color:var(--d-accent-2)}.sec-title[data-v-c695164c]{font-size:26px;letter-spacing:-.02em}.sec-desc[data-v-c695164c]{font-size:15.5px;color:var(--d-fg-muted);max-width:720px;margin-bottom:28px}h3.sub[data-v-c695164c]{font-size:17px;margin:40px 0 14px;display:flex;align-items:center;gap:10px}h3.sub[data-v-c695164c]:before{content:"";width:4px;height:16px;border-radius:2px;background:var(--d-accent)}h4.mini[data-v-c695164c]{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--d-fg-muted);margin:24px 0 12px}.stat-grid[data-v-c695164c]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.stat[data-v-c695164c]{background:var(--d-surface);border:.5px solid var(--d-line);border-radius:14px;padding:18px 18px 16px}.stat .v[data-v-c695164c]{font-size:34px;font-weight:800;letter-spacing:-.03em;line-height:1;color:var(--d-fg)}.stat .v small[data-v-c695164c]{font-size:16px;color:var(--d-fg-muted);font-weight:600}.stat .l[data-v-c695164c]{font-size:12.5px;color:var(--d-fg-muted);margin-top:8px;line-height:1.4}.stat.warn[data-v-c695164c]{background:var(--d-amber-soft);border-color:#f0d9b8}.stat.warn .v[data-v-c695164c]{color:var(--d-amber)}.stat.bad[data-v-c695164c]{background:var(--d-red-soft);border-color:#f0cccc}.stat.bad .v[data-v-c695164c]{color:var(--d-red)}.stat.good[data-v-c695164c]{background:var(--d-green-soft);border-color:#bfe3cc}.stat.good .v[data-v-c695164c]{color:var(--d-green)}.panel[data-v-c695164c]{background:var(--d-bg);border:.5px solid var(--d-line);border-radius:16px;box-shadow:var(--d-shadow-sm)}.panel-pad[data-v-c695164c]{padding:22px}.panel-soft[data-v-c695164c]{background:var(--d-surface);border:.5px solid var(--d-line);border-radius:14px}.callout[data-v-c695164c]{display:flex;gap:12px;padding:14px 16px;border-radius:12px;font-size:14px;line-height:1.55;background:var(--d-surface);border:.5px solid var(--d-line);color:var(--d-fg-soft);margin:18px 0}.callout .ico[data-v-c695164c]{flex:none;width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:12px;font-weight:800}.callout.info[data-v-c695164c]{background:var(--d-accent-soft);border-color:var(--d-accent-bd)}.callout.info .ico[data-v-c695164c]{background:var(--d-accent);color:#fff}.callout.warn[data-v-c695164c]{background:var(--d-amber-soft);border-color:#f0d9b8}.callout.warn .ico[data-v-c695164c]{background:var(--d-amber);color:#fff}.callout.good[data-v-c695164c]{background:var(--d-green-soft);border-color:#bfe3cc}.callout.good .ico[data-v-c695164c]{background:var(--d-green);color:#fff}table.dt[data-v-c695164c]{width:100%;border-collapse:collapse;font-size:13.5px;margin:16px 0}table.dt th[data-v-c695164c]{text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--d-fg-faint);font-weight:700;padding:10px 12px;border-bottom:.5px solid var(--d-line)}table.dt td[data-v-c695164c]{padding:11px 12px;border-bottom:.5px solid var(--d-line-2);color:var(--d-fg-soft);vertical-align:middle}table.dt tr:last-child td[data-v-c695164c]{border-bottom:none}table.dt td.tk[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:12.5px;color:var(--d-fg);white-space:nowrap}table.dt td.val[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.swatch[data-v-c695164c]{display:inline-block;width:16px;height:16px;border-radius:4px;border:.5px solid rgba(0,0,0,.08);vertical-align:-3px;margin-right:8px}.palette[data-v-c695164c]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}.color-card[data-v-c695164c]{border:.5px solid var(--d-line);border-radius:12px;overflow:hidden;background:var(--d-bg)}.color-chip[data-v-c695164c]{height:56px;border-bottom:.5px solid var(--d-line)}.color-meta[data-v-c695164c]{padding:10px 12px 12px}.color-meta .cn[data-v-c695164c]{font-size:13px;font-weight:600;color:var(--d-fg)}.color-meta .cv[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:11.5px;color:var(--d-fg-muted);margin-top:2px}.type-row[data-v-c695164c]{display:flex;align-items:baseline;gap:18px;padding:13px 0;border-bottom:.5px solid var(--d-line-2)}.type-row[data-v-c695164c]:last-child{border-bottom:none}.type-sample[data-v-c695164c]{flex:1;color:var(--d-fg);line-height:1.2}.type-meta[data-v-c695164c]{width:190px;flex:none;text-align:right;font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.space-row[data-v-c695164c]{display:flex;align-items:center;gap:16px;padding:10px 0;border-bottom:.5px solid var(--d-line-2)}.space-row[data-v-c695164c]:last-child{border-bottom:none}.space-bar[data-v-c695164c]{height:18px;border-radius:4px;background:linear-gradient(90deg,var(--d-accent),var(--d-accent-2));flex:none}.space-meta[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:12.5px;color:var(--d-fg-soft);width:150px}.space-use[data-v-c695164c]{font-size:12.5px;color:var(--d-fg-muted)}.radius-grid[data-v-c695164c]{display:flex;flex-wrap:wrap;gap:22px;align-items:flex-end;margin:16px 0}.radius-item[data-v-c695164c]{display:flex;flex-direction:column;align-items:center;gap:10px}.radius-box[data-v-c695164c]{width:64px;height:64px;border:.5px solid var(--d-accent);background:var(--d-accent-soft)}.radius-item .rl[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-soft)}.stage-wrap[data-v-c695164c]{border:.5px solid var(--d-line);border-radius:16px;overflow:hidden;margin:18px 0;background:var(--d-bg);box-shadow:var(--d-shadow-sm)}.stage-bar[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:.5px solid var(--d-line);background:var(--d-surface)}.stage-bar .st[data-v-c695164c]{font-size:13px;font-weight:600;color:var(--d-fg);display:flex;align-items:center;gap:8px}.stage-bar .st .tag[data-v-c695164c]{font-size:10.5px;font-weight:700;letter-spacing:.04em;padding:2px 7px;border-radius:999px}.tag.after[data-v-c695164c]{background:var(--d-green-soft);color:var(--d-green)}.tag.before[data-v-c695164c]{background:var(--d-red-soft);color:var(--d-red)}.tag.spec[data-v-c695164c]{background:var(--d-accent-soft);color:var(--d-accent-2)}.stage-bar .sactions[data-v-c695164c]{display:flex;gap:6px}.tab[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:11.5px;padding:4px 10px;border-radius:6px;color:var(--d-fg-muted);cursor:default}.tab.on[data-v-c695164c]{background:var(--d-bg);color:var(--d-fg);border:.5px solid var(--d-line)}.stage[data-v-c695164c]{padding:32px;display:flex;flex-wrap:wrap;align-items:center;gap:16px;background:radial-gradient(circle at 1px 1px,rgba(0,0,0,.045) 1px,transparent 0) 0 0 / 18px 18px,var(--d-surface)}.stage.col[data-v-c695164c]{flex-direction:column;align-items:stretch}.stage.dark[data-v-c695164c]{background:radial-gradient(circle at 1px 1px,rgba(255,255,255,.06) 1px,transparent 0) 0 0 / 18px 18px,#0d1117}.stage-label[data-v-c695164c]{width:100%;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--d-fg-faint);margin-bottom:-6px}.stage.dark .stage-label[data-v-c695164c]{color:#6b7280}.ba[data-v-c695164c]{display:grid;grid-template-columns:1fr 1fr;gap:0;border:.5px solid var(--d-line);border-radius:16px;overflow:hidden;margin:18px 0;box-shadow:var(--d-shadow-sm)}.ba-col[data-v-c695164c]{min-width:0}.ba-col+.ba-col[data-v-c695164c]{border-left:.5px solid var(--d-line)}.ba-head[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;padding:11px 16px;border-bottom:.5px solid var(--d-line)}.ba-head.before[data-v-c695164c]{background:var(--d-red-soft)}.ba-head.after[data-v-c695164c]{background:var(--d-green-soft)}.ba-head .bh[data-v-c695164c]{font-size:13px;font-weight:700}.ba-head.before .bh[data-v-c695164c]{color:var(--d-red)}.ba-head.after .bh[data-v-c695164c]{color:var(--d-green)}.ba-head .bh small[data-v-c695164c]{font-weight:500;opacity:.7;margin-left:6px}.ba-body[data-v-c695164c]{padding:24px;background:var(--d-surface);min-height:120px}.ba-col.after .ba-body[data-v-c695164c]{background:#fff}.code[data-v-c695164c]{background:#0d1117;border-radius:12px;overflow:hidden;margin:16px 0;border:.5px solid #1c2128}.code-bar[data-v-c695164c]{display:flex;align-items:center;gap:8px;padding:9px 14px;background:#13181e;border-bottom:.5px solid #1c2128}.code-bar .d[data-v-c695164c]{width:10px;height:10px;border-radius:50%;background:#30363d}.code-bar .fn[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:11.5px;color:#8b949e;margin-left:4px}.code pre[data-v-c695164c]{margin:0;padding:18px;overflow-x:auto;font-size:12.5px;line-height:1.7;color:#c9d1d9}.code .c[data-v-c695164c]{color:#8b949e}.code .k[data-v-c695164c]{color:#ff7b72}.code .s[data-v-c695164c]{color:#a5d6ff}.code .p[data-v-c695164c]{color:#79c0ff}.code .n[data-v-c695164c]{color:#d2a8ff}.code .v[data-v-c695164c]{color:#ffa657}.pill[data-v-c695164c]{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;border:.5px solid var(--d-line);background:var(--d-surface);color:var(--d-fg-soft)}.pill.blue[data-v-c695164c]{background:var(--d-accent-soft);border-color:var(--d-accent-bd);color:var(--d-accent-2)}.pill.green[data-v-c695164c]{background:var(--d-green-soft);border-color:#bfe3cc;color:var(--d-green)}.pill.amber[data-v-c695164c]{background:var(--d-amber-soft);border-color:#f0d9b8;color:var(--d-amber)}.pill.red[data-v-c695164c]{background:var(--d-red-soft);border-color:#f0cccc;color:var(--d-red)}.pill.mono[data-v-c695164c]{font-family:JetBrains Mono,monospace}ul.clean[data-v-c695164c]{list-style:none;padding:0;margin:14px 0}ul.clean li[data-v-c695164c]{position:relative;padding:8px 0 8px 26px;color:var(--d-fg-soft);border-bottom:.5px solid var(--d-line-2)}ul.clean li[data-v-c695164c]:last-child{border-bottom:none}ul.clean li[data-v-c695164c]:before{content:"";position:absolute;left:4px;top:17px;width:7px;height:7px;border-radius:50%;background:var(--d-accent)}ul.clean.check li[data-v-c695164c]:before{content:"✓";background:none;color:var(--d-green);font-weight:800;top:7px;left:0;font-size:14px}ul.clean.cross li[data-v-c695164c]:before{content:"✕";background:none;color:var(--d-red);font-weight:800;top:7px;left:0;font-size:13px}ul.clean li b[data-v-c695164c]{color:var(--d-fg)}ul.clean li .path[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:12px;color:var(--d-fg-muted)}.roadmap[data-v-c695164c]{position:relative;margin:24px 0}.phase[data-v-c695164c]{position:relative;display:grid;grid-template-columns:120px 1fr;gap:24px;padding:0 0 32px}.phase[data-v-c695164c]:not(:last-child):after{content:"";position:absolute;left:59px;top:36px;bottom:0;width:2px;background:var(--d-line)}.phase-tag[data-v-c695164c]{text-align:right;padding-top:4px}.phase-tag .pt[data-v-c695164c]{display:inline-block;font-family:JetBrains Mono,monospace;font-size:12px;font-weight:700;color:var(--d-accent-2);background:var(--d-accent-soft);border:.5px solid var(--d-accent-bd);padding:5px 10px;border-radius:8px}.phase-tag .pe[data-v-c695164c]{font-size:11.5px;color:var(--d-fg-faint);margin-top:8px}.phase-body[data-v-c695164c]{background:var(--d-bg);border:.5px solid var(--d-line);border-radius:14px;padding:18px 20px;box-shadow:var(--d-shadow-sm)}.phase-body h4[data-v-c695164c]{font-size:16px;margin-bottom:8px}.phase-body p[data-v-c695164c]{font-size:14px;margin-bottom:12px}.phase-body ul[data-v-c695164c]{margin:0}.matrix[data-v-c695164c]{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}.anti[data-v-c695164c]{border:.5px solid var(--d-line);border-radius:12px;padding:16px;background:var(--d-bg)}.anti .ah[data-v-c695164c]{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:700;margin-bottom:8px}.anti .ah .verdict[data-v-c695164c]{margin-left:auto;font-size:11px;font-weight:800;padding:2px 8px;border-radius:999px}.verdict.pass[data-v-c695164c]{background:var(--d-green-soft);color:var(--d-green)}.verdict.fail[data-v-c695164c]{background:var(--d-red-soft);color:var(--d-red)}.verdict.warn[data-v-c695164c]{background:var(--d-amber-soft);color:var(--d-amber)}.anti p[data-v-c695164c]{font-size:13px;margin:0;color:var(--d-fg-muted)}.footer[data-v-c695164c]{margin-top:80px;padding-top:28px;border-top:.5px solid var(--d-line);font-size:13px;color:var(--d-fg-faint);display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}.kbd[data-v-c695164c]{font-family:JetBrains Mono,monospace;font-size:11px;background:var(--d-surface-2);border:.5px solid var(--d-line);border-radius:5px;padding:1px 6px}@media(max-width:980px){.layout[data-v-c695164c]{grid-template-columns:1fr}.sidebar[data-v-c695164c]{position:static;height:auto}.nav[data-v-c695164c]{display:flex;flex-wrap:wrap;gap:4px}.content-inner[data-v-c695164c]{padding:40px 22px 80px}.stat-grid[data-v-c695164c]{grid-template-columns:repeat(2,1fr)}.ba[data-v-c695164c]{grid-template-columns:1fr}.ba-col+.ba-col[data-v-c695164c]{border-left:none;border-top:.5px solid var(--d-line)}.palette[data-v-c695164c]{grid-template-columns:repeat(2,1fr)}.matrix[data-v-c695164c]{grid-template-columns:1fr}}.ds-page .p[data-v-c695164c],.ds-page .stage.p-skin[data-v-c695164c],.ds-page [data-p][data-v-c695164c]{--p-font-sans: var(--font-ui);--p-font-kbd: var(--font-kbd);--p-font-mono: var(--font-mono);--p-bg: var(--color-bg);--p-surface: var(--color-surface);--p-surface-raised: var(--color-surface-raised);--p-surface-overlay: var(--color-surface-overlay);--p-surface-sunken: var(--color-surface-sunken);--p-well: var(--color-well);--p-surface-deep: var(--color-surface-deep);--p-hover: var(--color-hover);--p-text: var(--color-text);--p-text-strong: var(--color-text-strong);--p-muted: var(--muted);--p-text-muted: var(--color-text-muted);--p-text-faint: var(--color-text-faint);--p-text-on-accent: var(--color-text-on-accent);--p-line: var(--color-line);--p-line-strong: var(--color-line-strong);--p-accent: var(--color-accent);--p-accent-hover: var(--color-accent-hover);--p-accent-soft: var(--color-accent-soft);--p-user-bubble-bg: var(--color-user-bubble-bg);--p-accent-bd: var(--color-accent-bd);--p-success: var(--color-success);--p-success-soft: var(--color-success-soft);--p-success-bd: var(--color-success-bd);--p-warning: var(--color-warning);--p-warning-soft: var(--color-warning-soft);--p-warning-bd: var(--color-warning-bd);--p-danger: var(--color-danger);--p-danger-soft: var(--color-danger-soft);--p-danger-bd: var(--color-danger-bd);--p-info: var(--color-info);--p-sp-1: var(--space-1);--p-sp-2: var(--space-2);--p-sp-3: var(--space-3);--p-sp-4: var(--space-4);--p-sp-5: var(--space-5);--p-sp-6: var(--space-6);--p-sp-8: var(--space-8);--p-r-xs: var(--radius-xs);--p-r-sm: var(--radius-sm);--p-r-md: var(--radius-md);--p-r-lg: var(--radius-lg);--p-r-xl: var(--radius-xl);--p-r-composer: var(--radius-composer);--p-r-full: var(--radius-full);--p-corner-composer: var(--corner-shape-composer);--p-sh-xs: var(--shadow-xs);--p-sh-sm: var(--shadow-sm);--p-sh-menu: var(--shadow-menu);--p-sh-md: var(--shadow-md);--p-sh-input: var(--shadow-input);--p-sh-lg: var(--shadow-lg);--p-sh-xl: var(--shadow-xl);--p-font-size-xs: var(--text-xs);--p-font-size-sm: var(--text-sm);--p-font-size-base: var(--text-base);--p-font-size-md: var(--text-base);--p-font-size-lg: var(--text-lg);--p-font-size-xl: var(--text-xl);--p-font-size-2xl: var(--text-2xl);--p-leading-tight: var(--leading-tight);--p-leading-normal: var(--leading-normal);--p-leading-relaxed: var(--leading-relaxed);--p-ease: var(--ease-out);--p-ease-inout: var(--ease-in-out);--p-dur-fast: var(--duration-fast);--p-dur: var(--duration-base);--p-dur-slow: var(--duration-slow);--p-composer-focus-line: var(--color-composer-focus-line);font-family:var(--font-ui);color:var(--color-text);font-size:var(--text-base)}[data-p=dark][data-v-c695164c]{--p-bg: #0d1117;--p-surface: #13181e;--p-surface-raised: #1c2128;--p-surface-sunken: #0d1117;--p-well: #13181e;--p-surface-deep: #0a0d12;--p-surface-overlay: #22272e;--p-hover: #ffffff0d;--p-text: #e8eaed;--p-text-strong: #ffffff;--p-muted: #727983;--p-text-muted: #9aa0a8;--p-text-faint: #6b7280;--p-line: #2d333b;--p-line-strong: #3d444d;--p-accent: #58a6ff;--p-accent-hover: #79b8ff;--p-accent-soft: rgba(88,166,255,.14);--p-accent-bd: rgba(88,166,255,.28);--p-success: #3fb950;--p-success-soft: rgba(63,185,80,.14);--p-success-bd: rgba(63,185,80,.28);--p-warning: #d29922;--p-warning-soft: rgba(210,153,34,.14);--p-warning-bd: rgba(210,153,34,.28);--p-danger: #f85149;--p-danger-soft: rgba(248,81,73,.14);--p-danger-bd: rgba(248,81,73,.28);--p-sh-sm: 0 1px 2px rgba(0,0,0,.4);--p-sh-md: 0 4px 12px rgba(0,0,0,.45);--p-sh-lg: 0 12px 32px rgba(0,0,0,.55);--p-sh-input: var(--shadow-input);--p-selection: rgba(88,166,255,.32)}.p-ic[data-v-c695164c]{width:16px;height:16px;flex:none;display:inline-block;vertical-align:middle}.p-btn[data-v-c695164c]{--_h: 36px;--_px: 16px;--_fs: var(--p-font-size-base);--_r: var(--p-r-md);display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--_h);padding:0 var(--_px);border-radius:var(--_r);font-family:var(--p-font-sans);font-size:var(--_fs);font-weight:600;line-height:1;border:.5px solid transparent;cursor:pointer;white-space:nowrap;transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease),transform var(--p-dur-fast) var(--p-ease)}.p-btn[data-v-c695164c]:active{transform:scale(.98)}.p-btn[data-v-c695164c]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--p-accent-soft),0 0 0 1px var(--p-accent)}.p-btn .p-ic[data-v-c695164c]{width:16px;height:16px}.p-btn.sm[data-v-c695164c]{--_h: 30px;--_px: 12px;--_fs: var(--p-font-size-sm);--_r: var(--p-r-sm)}.p-btn.sm .p-ic[data-v-c695164c]{width:14px;height:14px}.p-btn.lg[data-v-c695164c]{--_h: 42px;--_px: 20px;--_fs: var(--p-font-size-md);--_r: var(--p-r-lg)}.p-btn.primary[data-v-c695164c]{background:var(--p-accent);color:var(--p-text-on-accent);border-color:var(--p-accent);box-shadow:var(--p-sh-xs)}.p-btn.primary[data-v-c695164c]:hover{background:var(--p-accent-hover);border-color:var(--p-accent-hover)}.p-btn.secondary[data-v-c695164c]{background:var(--p-surface-raised);color:var(--p-text);border-color:var(--p-line-strong);box-shadow:var(--p-sh-xs)}.p-btn.secondary[data-v-c695164c]:hover{background:var(--p-hover);border-color:var(--p-line-strong)}.p-btn.ghost[data-v-c695164c]{background:transparent;color:var(--p-text);border-color:transparent}.p-btn.ghost[data-v-c695164c]:hover{background:var(--p-hover);color:var(--p-text-strong)}.p-btn.danger[data-v-c695164c]{background:var(--p-danger);color:#fff;border-color:var(--p-danger);box-shadow:var(--p-sh-xs)}.p-btn.danger[data-v-c695164c]:hover{filter:brightness(.96)}.p-btn.danger-soft[data-v-c695164c]{background:var(--p-danger-soft);color:var(--p-danger);border-color:var(--p-danger-bd)}.p-btn.danger-soft[data-v-c695164c]:hover{background:var(--p-danger);color:#fff;border-color:var(--p-danger)}.p-btn[disabled][data-v-c695164c],.p-btn.disabled[data-v-c695164c]{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}.p-icon-btn[data-v-c695164c]{--_s: 32px;display:inline-grid;place-items:center;width:var(--_s);height:var(--_s);flex:none;border-radius:var(--p-r-md);border:.5px solid transparent;background:transparent;color:var(--p-text-muted);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-icon-btn[data-v-c695164c]:hover{background:var(--p-hover);color:var(--p-text)}.p-icon-btn[data-v-c695164c]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--p-accent-soft)}.p-icon-btn.sm[data-v-c695164c]{--_s: 26px;border-radius:var(--p-r-sm)}.p-icon-btn.lg[data-v-c695164c]{--_s: 44px}.p-icon-btn .p-ic[data-v-c695164c]{width:16px;height:16px}.p-icon-btn.lg .p-ic[data-v-c695164c]{width:20px;height:20px}.p-badge[data-v-c695164c]{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:var(--p-r-full);font-family:var(--p-font-sans);font-size:var(--p-font-size-xs);font-weight:600;line-height:1;border:.5px solid var(--p-line);background:var(--p-surface);color:var(--p-text);white-space:nowrap}.p-badge.sm[data-v-c695164c]{height:18px;padding:0 7px;font-size:11px}.p-badge .bd[data-v-c695164c]{width:7px;height:7px;border-radius:50%;background:currentColor}.p-badge.neutral[data-v-c695164c]{background:var(--p-surface-sunken);border-color:var(--p-line);color:var(--p-text-muted)}.p-badge.info[data-v-c695164c]{background:var(--p-accent-soft);border-color:var(--p-accent-bd);color:var(--p-accent-hover)}.p-badge.success[data-v-c695164c]{background:var(--p-success-soft);border-color:var(--p-success-bd);color:var(--p-success)}.p-badge.warning[data-v-c695164c]{background:var(--p-warning-soft);border-color:var(--p-warning-bd);color:var(--p-warning)}.p-badge.danger[data-v-c695164c]{background:var(--p-danger-soft);border-color:var(--p-danger-bd);color:var(--p-danger)}.p-badge.solid[data-v-c695164c]{background:var(--p-text);color:var(--p-bg);border-color:var(--p-text)}.p-badge .p-ic[data-v-c695164c]{width:12px;height:12px}.p-kbd[data-v-c695164c]{display:inline-flex;align-items:center;gap:3px}.p-kbd kbd[data-v-c695164c]{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border:.5px solid var(--p-line);border-radius:var(--p-r-xs);background:transparent;color:inherit;font-family:var(--p-font-kbd);font-size:11px;line-height:1}.p-pill[data-v-c695164c]{display:inline-flex;align-items:center;gap:4px;height:32px;padding:0 12px;border-radius:var(--p-r-full);border:.5px solid transparent;background:transparent;font-family:var(--p-font-sans);font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-pill[data-v-c695164c]:hover{background:var(--p-hover);color:var(--p-text-strong)}.p-pill .pp-strong[data-v-c695164c]{font-weight:700;color:var(--p-text)}.p-pill .pp-sub[data-v-c695164c]{color:var(--p-accent);font-weight:600}.p-pill .p-ic[data-v-c695164c]{width:14px;height:14px;color:var(--p-text-faint)}.p-card[data-v-c695164c]{background:var(--p-surface);border:.5px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;color:var(--p-text)}.p-card.interactive[data-v-c695164c]{transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease);cursor:pointer}.p-card.interactive[data-v-c695164c]:hover{background:var(--p-surface);border-color:var(--p-line-strong)}.p-card-head[data-v-c695164c]{display:flex;align-items:center;gap:9px;padding:10px 14px;border-bottom:.5px solid var(--p-line);background:var(--p-surface)}.p-card-title[data-v-c695164c]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text);font-family:var(--p-font-mono)}.p-card-body[data-v-c695164c]{padding:14px;font-size:var(--p-font-size-base);color:var(--p-text);line-height:var(--p-leading-normal)}.p-card-foot[data-v-c695164c]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:10px 14px;border-top:.5px solid var(--p-line);background:var(--p-surface)}.p-field[data-v-c695164c]{display:flex;flex-direction:column;gap:6px}.p-label[data-v-c695164c]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-input[data-v-c695164c],.p-select[data-v-c695164c],.p-textarea[data-v-c695164c]{width:100%;height:38px;padding:0 12px;border-radius:var(--p-r-md);border:.5px solid var(--p-line-strong);background:var(--p-surface-raised);font-family:var(--p-font-sans);font-size:var(--p-font-size-base);color:var(--p-text);box-shadow:var(--p-sh-xs);transition:border-color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease)}.p-textarea[data-v-c695164c]{height:auto;min-height:84px;padding:10px 12px;resize:vertical;line-height:var(--p-leading-normal)}.p-select[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;text-align:left}.p-select[data-v-c695164c]:after{content:"⌄";color:var(--p-text-muted)}.p-input[data-v-c695164c]:hover,.p-select[data-v-c695164c]:hover,.p-textarea[data-v-c695164c]:hover{border-color:var(--p-line-strong)}.p-input[data-v-c695164c]:focus,.p-select[data-v-c695164c]:focus,.p-textarea[data-v-c695164c]:focus{outline:none;border-color:var(--p-accent);box-shadow:0 0 0 3px var(--p-accent-soft)}.p-input[data-v-c695164c]::placeholder,.p-textarea[data-v-c695164c]::placeholder{color:var(--p-text-faint)}.p-input.sm[data-v-c695164c]{height:32px;font-size:var(--p-font-size-sm);border-radius:var(--p-r-sm)}.p-hint[data-v-c695164c]{font-size:var(--p-font-size-xs);color:var(--p-text-faint)}.p-dialog[data-v-c695164c]{width:480px;max-width:calc(100vw - 48px);background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-xl);box-shadow:var(--p-sh-xl);overflow:hidden;color:var(--p-text)}.p-dialog-head[data-v-c695164c]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px 14px}.p-dialog-title[data-v-c695164c]{font-size:var(--p-font-size-lg);font-weight:700;letter-spacing:-.01em}.p-dialog-desc[data-v-c695164c]{font-size:var(--p-font-size-base);color:var(--p-text-muted);margin-top:4px;line-height:var(--p-leading-normal)}.p-dialog-body[data-v-c695164c]{padding:4px 22px 18px}.p-dialog-foot[data-v-c695164c]{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 20px}.p-toast[data-v-c695164c]{display:flex;align-items:flex-start;gap:11px;width:360px;padding:13px 14px;background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-lg);box-shadow:var(--p-sh-md)}.p-toast .ti[data-v-c695164c]{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;flex:none;margin-top:1px}.p-toast.success .ti[data-v-c695164c]{background:var(--p-success-soft);color:var(--p-success)}.p-toast.warning .ti[data-v-c695164c]{background:var(--p-warning-soft);color:var(--p-warning)}.p-toast .tt[data-v-c695164c]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-text)}.p-toast .td[data-v-c695164c]{font-size:var(--p-font-size-sm);color:var(--p-text-muted);margin-top:2px;line-height:1.45}.p-action-toast[data-v-c695164c]{display:inline-flex;align-items:center;gap:8px;align-self:center;padding:4px 6px 4px 14px;background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-lg);box-shadow:var(--p-sh-sm);font-size:var(--p-font-size-base);color:var(--p-text);white-space:nowrap}.p-action-toast .lk[data-v-c695164c]{border:0;padding:0;background:none;color:var(--p-accent);cursor:pointer;font:inherit}.p-action-toast .x[data-v-c695164c]{color:var(--p-text-muted);width:14px;height:14px}.p-spinner[data-v-c695164c]{width:18px;height:18px;animation:p-spin-c695164c .85s linear infinite}.p-spinner.sm[data-v-c695164c]{width:14px;height:14px}.p-spinner circle[data-v-c695164c]{fill:none;stroke-width:2.2;stroke-linecap:round}.p-spinner .track[data-v-c695164c]{stroke:var(--p-line)}.p-spinner .arc[data-v-c695164c]{stroke:var(--p-accent);stroke-dasharray:56 56;stroke-dashoffset:38}@keyframes p-spin-c695164c{to{transform:rotate(360deg)}}.p-thinking[data-v-c695164c]{display:inline-flex;align-items:center;gap:9px;font-size:var(--p-font-size-sm);color:var(--p-text-muted);font-family:var(--p-font-sans)}.p-bubble-user[data-v-c695164c]{align-self:flex-end;max-width:78%;background:var(--p-user-bubble-bg);border:none;color:var(--p-text);border-radius:var(--p-r-lg);padding:10px 12px;font-size:var(--p-font-size-md);line-height:var(--p-leading-normal)}.p-msg[data-v-c695164c]{max-width:760px;font-size:var(--p-font-size-md);line-height:var(--p-leading-relaxed);color:var(--p-text)}.p-msg p[data-v-c695164c]{margin:0 0 10px;color:var(--p-text)}.p-msg code[data-v-c695164c]{font-family:var(--p-font-mono);background:var(--p-surface-sunken);border:0;color:var(--p-accent-hover);padding:1px 6px;border-radius:5px;font-size:.9em}.p-code[data-v-c695164c]{font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);line-height:1.65;background:var(--p-surface-sunken);border:.5px solid var(--p-line);border-radius:var(--p-r-md);padding:11px 13px;color:var(--p-text);overflow-x:auto}.p-action[data-v-c695164c]{border-radius:var(--p-r-lg);overflow:hidden;border:.5px solid var(--p-line);background:var(--p-surface-raised);box-shadow:var(--p-sh-menu)}.p-action-head[data-v-c695164c]{display:flex;align-items:center;gap:9px;padding:14px 16px 0}.p-action-title[data-v-c695164c]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-text)}.p-action-body[data-v-c695164c]{padding:12px 16px 0;font-size:var(--p-font-size-base);color:var(--p-text);line-height:var(--p-leading-normal)}.p-action-foot[data-v-c695164c]{display:flex;gap:8px;margin-top:12px;padding:10px 16px;border-top:.5px solid var(--p-line)}.p-opts[data-v-c695164c]{display:flex;flex-direction:column;gap:2px;margin-top:12px;padding:12px 16px;border-top:.5px solid var(--p-line)}.p-opt[data-v-c695164c]{display:flex;align-items:flex-start;gap:10px;padding:8px 12px;border-radius:var(--p-r-md);color:var(--p-text);font-size:var(--p-font-size-base)}.p-opt .n[data-v-c695164c]{width:var(--p-chip-num);height:var(--p-chip-num);margin-top:calc((var(--p-font-size-base) * var(--p-leading-normal) - var(--p-chip-num)) / 2);border-radius:var(--p-r-sm);background:var(--p-surface-sunken);color:var(--p-text);font-size:var(--p-font-size-xs);font-weight:500;display:inline-flex;align-items:center;justify-content:center;flex:none}.p-opt-text[data-v-c695164c]{display:flex;flex-direction:column;gap:2px;min-width:0}.p-opt-text .l[data-v-c695164c]{font-weight:500}.p-opt-text .d[data-v-c695164c]{font-size:var(--p-font-size-xs);color:var(--p-text-muted);line-height:var(--p-leading-normal)}.p-todo[data-v-c695164c]{background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-md);padding:6px}.p-todo-row[data-v-c695164c]{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--p-r-md);font-size:var(--p-font-size-base);color:var(--p-text)}.p-todo-row.done[data-v-c695164c]{color:var(--p-text-faint);text-decoration:line-through}.p-todo-row.active[data-v-c695164c]{background:var(--p-accent-soft);color:var(--p-text)}.p-todo-check[data-v-c695164c]{width:16px;flex:none;display:inline-flex;align-items:center;justify-content:center;user-select:none;color:var(--p-text-faint)}.p-todo-check svg[data-v-c695164c]{width:14px;height:14px}.p-todo-row.active .p-todo-check[data-v-c695164c]{color:var(--p-accent)}.p-todo-row.done .p-todo-check[data-v-c695164c]{color:var(--p-success)}.p-todo-row.active .p-todo-check[data-v-c695164c]{color:var(--p-accent);font-weight:500}.p-dot[data-v-c695164c]{width:7px;height:7px;border-radius:50%;flex:none;background:var(--p-text-faint)}.p-dot.done[data-v-c695164c]{background:var(--p-success)}.p-dot.error[data-v-c695164c]{background:var(--p-danger)}.p-dot.running[data-v-c695164c]{background:var(--p-accent);box-shadow:0 0 0 0 var(--p-accent-soft);animation:p-pulse-c695164c 1.4s ease-out infinite}@keyframes p-pulse-c695164c{0%{box-shadow:0 0 #1783ff66}to{box-shadow:0 0 0 6px #1783ff00}}.p-tool-group[data-v-c695164c]{overflow:hidden}.p-tool-group-head[data-v-c695164c]{display:flex;align-items:center;gap:4px;padding:4px 0;cursor:pointer;border-radius:6px;font-size:var(--p-font-size-sm);line-height:1;color:var(--p-text-faint);user-select:none;transition:color var(--p-dur) var(--p-ease)}.p-tool-group-head .tg-ic[data-v-c695164c]{width:14px;height:14px;color:var(--p-text-faint);flex:none}.p-tool-group-head[data-v-c695164c]:hover{color:var(--p-text)}.p-tool-group-head .tg-title[data-v-c695164c]{font-weight:500}.p-tool-group-head .tg-meta[data-v-c695164c]{color:var(--p-text-faint);font-weight:400}.p-tool-group-head .tg-car[data-v-c695164c]{width:14px;height:14px;color:var(--p-text-faint);transition:transform var(--p-dur) var(--p-ease)}.p-tool-group.open .p-tool-group-head .tg-car[data-v-c695164c]{transform:rotate(90deg)}.p-tool-row[data-v-c695164c]{position:relative;display:flex;align-items:center;gap:4px;padding:4px 0;border-radius:6px;cursor:pointer;font-family:var(--p-font-sans);font-size:var(--p-font-size-sm);line-height:1;color:var(--p-text)}.p-tool-row .tr-ic[data-v-c695164c]{width:14px;height:14px;color:var(--p-text-faint);flex:none}.p-tool-row .tr-name[data-v-c695164c]{font-weight:400;color:var(--p-text-muted);flex:none}.p-tool-row .tr-file[data-v-c695164c]{font-weight:400;color:var(--p-text);flex:none}.p-tool-row .tr-file[data-v-c695164c]:hover{color:var(--p-accent);text-decoration:underline;text-underline-offset:3px}.p-tool-row .tr-mono[data-v-c695164c]{font-family:var(--p-font-mono);font-size:var(--p-font-size-xs);line-height:normal;font-feature-settings:"liga" 0,"calt" 0;font-variant-ligatures:none;color:var(--p-text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.p-tool-row .tr-faint[data-v-c695164c]{color:var(--p-text-faint);line-height:var(--leading-tight);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.p-tool-row .tr-chip[data-v-c695164c]{margin-left:auto;color:var(--p-text-faint);font-size:var(--p-font-size-xs);flex:none}.p-tool-row .tr-add[data-v-c695164c]{margin-left:auto;color:var(--p-success);font-family:var(--p-font-mono);font-size:var(--p-font-size-xs);flex:none}.p-tool-row .tr-add~.tr-chip[data-v-c695164c],.p-tool-row .tr-add~.tr-add[data-v-c695164c]{margin-left:0}.p-tool-row .tr-del[data-v-c695164c]{color:var(--p-danger);font-family:var(--p-font-mono);font-size:var(--p-font-size-xs);flex:none}.p-tool-row .tr-bar[data-v-c695164c]{display:inline-flex;width:36px;height:3px;border-radius:999px;overflow:hidden;gap:1px;flex:none}.p-tool-row .tr-ok[data-v-c695164c]{color:var(--p-success);font-size:var(--p-font-size-xs);flex:none}.p-tool-row .tr-car[data-v-c695164c]{width:13px;height:13px;color:var(--p-text-faint);flex:none;transition:transform var(--p-dur) var(--p-ease)}.p-agent-card[data-v-c695164c]{display:flex;align-items:center;gap:8px;align-self:stretch;padding:8px 12px;background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-lg);cursor:pointer}.p-agent-card .pa-ic[data-v-c695164c]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:var(--p-surface-sunken);color:var(--p-text-muted);flex:none}.p-agent-card .pa-ic svg[data-v-c695164c]{width:14px;height:14px}.p-agent-card .pa-main[data-v-c695164c]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.p-agent-card .pa-task[data-v-c695164c]{font-size:var(--p-font-size-sm);line-height:1.4;color:var(--p-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-agent-card .pa-type[data-v-c695164c]{font-size:var(--p-font-size-xs);line-height:1.4;color:var(--p-text-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-agent-card .pa-ok[data-v-c695164c]{color:var(--p-success);font-size:var(--p-font-size-xs);flex:none}.p-agent-card .pa-go[data-v-c695164c]{color:var(--p-text-faint);flex:none}.p-tool-row.expanded .tr-car[data-v-c695164c]{transform:rotate(90deg)}.p-tool-detail[data-v-c695164c]{padding:2px 8px 4px 0}.p-tool-detail .p-code[data-v-c695164c]{margin-top:4px}.p-composer[data-v-c695164c]{background:var(--p-surface-raised);border:.5px solid var(--p-line-strong);border-radius:var(--p-r-composer);corner-shape:var(--p-corner-composer);box-shadow:var(--p-sh-input);overflow:hidden;position:relative;z-index:1}.p-composer[data-v-c695164c]:after{content:"";position:absolute;inset:0;border:inherit;border-color:var(--p-composer-focus-line);border-radius:var(--p-r-composer);corner-shape:var(--p-corner-composer);opacity:0;pointer-events:none;transition:opacity var(--p-dur-slow) var(--p-ease-inout)}.p-composer[data-v-c695164c]:focus-within:after{opacity:1}.p-composer-ta[data-v-c695164c]{padding:14px 16px 8px;font-family:var(--p-font-sans);font-size:var(--p-font-size-md);color:var(--p-text);line-height:var(--p-leading-normal);text-autospace:normal}.p-composer-ta.ph[data-v-c695164c]{color:var(--p-text-faint)}.p-composer-bar[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 8px 8px}.p-composer-strip[data-v-c695164c]{width:100%;max-width:620px;margin-top:calc(-1 * var(--space-4));display:flex;align-items:center;gap:var(--space-2);padding:calc(var(--space-4) + var(--space-2)) var(--space-2) var(--space-2);background:color-mix(in srgb,var(--color-hover) 60%,transparent);border-radius:0 0 var(--radius-2xl) var(--radius-2xl);font-family:var(--p-font-sans);font-size:var(--p-font-size-sm);color:var(--p-text-faint);cursor:pointer}.p-composer-strip .p-ic[data-v-c695164c]{width:16px;height:16px;color:var(--p-text-faint)}.p-composer-left[data-v-c695164c],.p-composer-right[data-v-c695164c]{display:flex;align-items:center;gap:4px}.p-composer .p-icon-btn[data-v-c695164c]{border-radius:var(--p-r-full)}.p-send[data-v-c695164c]{position:relative;width:32px;height:32px;border-radius:var(--p-r-full);display:grid;place-items:center;background:var(--p-text);color:var(--p-bg);border:none;cursor:pointer;box-shadow:var(--p-sh-xs);transition:transform var(--p-dur-fast) var(--p-ease)}.p-send[data-v-c695164c]:after{content:"";position:absolute;inset:0;border-radius:var(--p-r-full);background:var(--p-bg);opacity:0;transition:opacity var(--p-dur-slow) var(--p-ease);pointer-events:none}.p-send[data-v-c695164c]:hover:after{opacity:.28}.p-send[data-v-c695164c]:active{transform:scale(.92)}.p-send .p-ic[data-v-c695164c]{width:16px;height:16px}.dw-bar[data-v-c695164c]{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-1) var(--space-1-5)}.am-mock[data-v-c695164c]{display:flex;flex-direction:column;gap:var(--menu-rows-seam);width:100%;max-width:420px;padding:var(--space-1-5) var(--space-3);background:var(--color-menu-bg-frost);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border:.5px solid var(--p-line);border-radius:var(--radius-composer);corner-shape:var(--corner-shape-composer);box-shadow:var(--p-sh-menu);font-family:var(--font-ui)}.am-mock-row[data-v-c695164c]{display:flex;align-items:center;gap:var(--menu-row-gap-icon);padding:var(--menu-row-padding-block) var(--menu-row-padding-inline);border-radius:var(--radius-menu-row);color:var(--p-text);font-size:var(--p-font-size-base)}.am-mock-row.focus[data-v-c695164c]{background:var(--color-selected)}.am-mock-row .n[data-v-c695164c]{font-weight:var(--weight-medium)}.am-mock-row .d[data-v-c695164c]{margin-left:var(--space-1);color:var(--p-text-muted);font-size:var(--text-sm)}.dw-pill[data-v-c695164c]{position:relative;display:inline-flex;align-items:center;gap:var(--space-1-5);padding:var(--space-2) calc(var(--space-3) + var(--space-05)) var(--space-2) var(--space-3);border-radius:var(--radius-lg);background:var(--color-selected);color:var(--p-text);font-size:var(--p-font-size-base);font-weight:var(--weight-medium);line-height:var(--leading-normal)}.dw-pill[data-v-c695164c] svg{width:1.5em;height:1.5em}.dw-pill.on[data-v-c695164c]:after{content:"";position:absolute;inset:0;border-radius:var(--radius-lg);background:var(--color-hover);pointer-events:none}.dw-pill .dw-count[data-v-c695164c]{color:var(--p-text-muted)}.dw-pill .dw-running[data-v-c695164c]{display:inline-flex;align-items:center;gap:var(--space-1);color:var(--p-text-muted)}.dw-pill .dw-live[data-v-c695164c]{color:var(--p-success);font-weight:var(--weight-medium)}.dw-panel[data-v-c695164c]{width:100%;border:.5px solid var(--p-line);border-radius:var(--radius-2xl);background:color-mix(in srgb,var(--p-bg) 70%,transparent);box-shadow:var(--p-sh-menu);overflow:hidden}.dw-head[data-v-c695164c]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-4) var(--space-4) 0}.dw-tab[data-v-c695164c]{display:inline-flex;align-items:center;gap:var(--space-2);color:var(--p-text);font-size:var(--p-font-size-base);font-weight:var(--weight-medium);line-height:var(--leading-solid);white-space:nowrap}.dw-tab[data-v-c695164c] svg{width:1.5em;height:1.5em}.dw-tab .dw-meta[data-v-c695164c]{color:var(--p-text-muted)}.dw-chips[data-v-c695164c]{margin-left:auto;display:inline-flex;gap:var(--space-05);padding:var(--space-05);background:var(--p-surface-sunken);border:.5px solid var(--p-line);border-radius:var(--p-r-md)}.dw-chip[data-v-c695164c]{display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--p-sp-3);border-radius:var(--p-r-sm);color:var(--p-text-muted);font-size:var(--p-font-size-sm);font-weight:var(--weight-medium);line-height:var(--leading-solid);white-space:nowrap}.dw-chip.on[data-v-c695164c]{color:var(--p-text);background:var(--p-surface-raised);box-shadow:var(--p-sh-sm)}.dw-body[data-v-c695164c]{margin-top:var(--space-3);padding:0 var(--space-4) var(--space-4)}.dw-body.col[data-v-c695164c]{display:flex;flex-direction:column}.dw-row[data-v-c695164c]{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-1) 0;color:var(--p-text);font-size:var(--p-font-size-base)}.dw-row .nm[data-v-c695164c]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dw-row .tm[data-v-c695164c]{flex:none;color:var(--p-text-muted);font-variant-numeric:tabular-nums}.dw-row .ok[data-v-c695164c]{color:var(--p-success);transform:scale(.91)}.dw-row.fail .nm[data-v-c695164c],.dw-row.fail[data-v-c695164c] svg{color:var(--p-danger)}.dw-row.cancelled[data-v-c695164c] svg{color:var(--p-text-muted)}.dw-body.grid[data-v-c695164c]{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--p-subagent-card-min),1fr));gap:var(--space-2)}.dw-card[data-v-c695164c]{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-3);border-radius:var(--radius-lg);background:var(--color-selected)}.dw-card .ct[data-v-c695164c]{display:flex;align-items:center;gap:var(--space-2)}.dw-card .nm[data-v-c695164c]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--weight-medium)}.dw-card .nu[data-v-c695164c]{flex:none;color:var(--p-text-muted);font-size:var(--p-font-size-sm);font-variant-numeric:tabular-nums}.dw-card .ds[data-v-c695164c]{color:var(--p-text-muted);font-size:var(--p-font-size-sm);line-height:var(--leading-caption);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.dw-card .cs[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;color:var(--p-text-muted);font-size:var(--p-font-size-xs)}.dw-card .cf[data-v-c695164c]{display:flex;flex-direction:column;gap:var(--space-1)}.dw-card .cm[data-v-c695164c]{display:flex;align-items:center;gap:var(--space-1);color:var(--p-text-muted);font-size:var(--p-font-size-xs)}.dw-card .cm span[data-v-c695164c]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dw-card .cs .sl[data-v-c695164c]{display:inline-flex;align-items:center;gap:var(--space-1)}.dw-card .cs .sl .ok[data-v-c695164c]{color:var(--p-success);transform:scale(.91)}.dw-card .cs .tm[data-v-c695164c]{margin-left:auto;display:inline-flex;align-items:center;gap:var(--space-1);font-variant-numeric:tabular-nums}.dw-card.fail .cs .sl[data-v-c695164c]{color:var(--p-danger)}.dw-ring[data-v-c695164c]{display:inline-block;width:var(--p-ic-md);height:var(--p-ic-md);border:1.5px solid var(--p-line-strong);border-radius:var(--radius-full);vertical-align:middle}.dw-spin[data-v-c695164c]{display:inline-flex;color:var(--p-text);vertical-align:middle}.dt td .kw-dot[data-v-c695164c],.dt td[data-v-c695164c] svg{vertical-align:middle}.p[data-v-c695164c] ::selection,[data-p][data-v-c695164c] ::selection{background:var(--p-selection)}.p-link[data-v-c695164c]{color:var(--p-accent);text-decoration:none;font-family:var(--p-font-sans);transition:color var(--p-dur) var(--p-ease)}.p-link[data-v-c695164c]:hover{color:var(--p-accent-hover);text-decoration:underline}.p-link[data-v-c695164c]:focus-visible{outline:none;box-shadow:var(--p-focus-ring);border-radius:var(--p-r-xs)}.p-link.muted[data-v-c695164c]{color:var(--p-text-muted)}.p-link.muted[data-v-c695164c]:hover{color:var(--p-text)}.p-link .p-ic[data-v-c695164c]{width:var(--p-ic-sm);height:var(--p-ic-sm);vertical-align:-2px}.p-menu[data-v-c695164c]{background:var(--color-menu-bg);border:.5px solid var(--p-line);-webkit-backdrop-filter:var(--p-menu-backdrop);backdrop-filter:var(--p-menu-backdrop);border-radius:var(--p-r-lg);box-shadow:var(--p-sh-sm);padding:3.5px;min-width:180px;font-family:var(--p-font-sans);color:var(--p-text)}.p-menu-item[data-v-c695164c]{display:flex;align-items:center;gap:7px;padding:5px 9px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-sm);color:var(--p-text);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-menu-item[data-v-c695164c]:hover{background:var(--p-hover);color:var(--p-text-strong)}.p-menu-item.active[data-v-c695164c],.p-menu-item.active[data-v-c695164c]:hover{background:var(--p-hover);color:var(--p-text)}.p-menu-item.danger[data-v-c695164c]{color:var(--p-danger)}.p-menu-item.danger[data-v-c695164c]:hover{background:var(--p-danger-soft);color:var(--p-danger)}.p-menu-item.disabled[data-v-c695164c]{opacity:.5;cursor:not-allowed}.p-menu-item.disabled[data-v-c695164c]:hover{background:transparent;color:var(--p-text)}.p-menu-item .p-ic[data-v-c695164c]{width:var(--p-ic-sm);height:var(--p-ic-sm);color:var(--p-muted)}.p-menu-item:hover .p-ic[data-v-c695164c]{color:var(--p-text-strong)}.p-menu-item.active .p-ic[data-v-c695164c]{color:var(--p-accent-hover)}.p-menu-item.danger .p-ic[data-v-c695164c]{color:var(--p-danger)}.p-menu-item.lg[data-v-c695164c]{min-height:44px;padding:12px 14px;font-size:var(--p-font-size-sm)}.p-menu-sep[data-v-c695164c]{height:1px;background:var(--p-line);margin:4px 0}.p-seg[data-v-c695164c]{display:inline-flex;gap:2px;padding:2px;background:var(--p-surface-sunken);border:.5px solid var(--p-line);border-radius:var(--p-r-md);font-family:var(--p-font-sans)}.p-seg-item[data-v-c695164c]{display:inline-flex;align-items:center;gap:4px;padding:5px 12px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text);cursor:pointer;white-space:nowrap;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease),box-shadow var(--p-dur) var(--p-ease)}.p-seg-item[data-v-c695164c]:hover{color:var(--p-text)}.p-seg-item.on[data-v-c695164c]{background:var(--p-surface-raised);color:var(--p-text);box-shadow:var(--p-sh-sm)}.p-tabs[data-v-c695164c]{display:flex;align-items:center;gap:0;border-bottom:.5px solid var(--p-line);font-family:var(--p-font-sans)}.p-tab[data-v-c695164c]{padding:8px 14px;font-size:var(--p-font-size-sm);font-weight:500;color:var(--p-text-muted);cursor:pointer;white-space:nowrap;border-bottom:.5px solid transparent;margin-bottom:-.5px;transition:color var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease)}.p-tab[data-v-c695164c]:hover{color:var(--p-text)}.p-tab.on[data-v-c695164c]{color:var(--p-accent);border-bottom-color:var(--p-accent)}.p-switch[data-v-c695164c]{position:relative;display:inline-block;width:36px;height:20px;flex:none;border-radius:var(--p-r-full);background:var(--p-line-strong);cursor:pointer;transition:background var(--p-dur) var(--p-ease)}.p-switch[data-v-c695164c]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:var(--p-r-full);background:var(--p-surface-raised);box-shadow:var(--p-sh-xs);transform-origin:left center;transition:transform var(--p-dur) var(--p-ease)}.p-switch[data-v-c695164c]:hover:after{transform:scaleX(1.125)}.p-switch.on[data-v-c695164c]{background:var(--p-accent)}.p-switch.on[data-v-c695164c]:after{transform:translate(16px);transform-origin:right center}.p-switch.on[data-v-c695164c]:hover:after{transform:translate(16px) scaleX(1.125)}.p-switch[data-v-c695164c]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.p-check[data-v-c695164c]{width:17px;height:17px;flex:none;display:inline-grid;place-items:center;border:.5px solid var(--p-line-strong);border-radius:var(--p-r-sm);background:var(--p-surface-raised);color:var(--p-text-on-accent);cursor:pointer;transition:background var(--p-dur) var(--p-ease),border-color var(--p-dur) var(--p-ease)}.p-check.on[data-v-c695164c]{background:var(--p-accent);border-color:var(--p-accent)}.p-check[data-v-c695164c]:focus-visible{outline:none;box-shadow:var(--p-focus-ring)}.p-check .p-ic[data-v-c695164c]{width:12px;height:12px}.p-avatar[data-v-c695164c]{width:32px;height:32px;flex:none;display:grid;place-items:center;border-radius:var(--p-r-md);background:var(--p-surface-sunken);border:.5px solid var(--p-line);color:var(--p-text-muted);font-size:var(--p-font-size-sm);font-weight:600}.p-avatar.sm[data-v-c695164c]{width:24px;height:24px;border-radius:var(--p-r-sm);font-size:var(--p-font-size-xs)}.p-avatar .p-ic[data-v-c695164c]{width:16px;height:16px}.p-avatar.sm .p-ic[data-v-c695164c]{width:13px;height:13px}.p-empty[data-v-c695164c]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:32px 16px;color:var(--p-text-muted);text-align:center}.p-empty .em-ic[data-v-c695164c]{width:48px;height:48px;color:var(--p-text-faint)}.p-empty .em-title[data-v-c695164c]{font-size:var(--p-font-size-base);font-weight:600;color:var(--p-text)}.p-empty .em-hint[data-v-c695164c]{font-size:var(--p-font-size-sm);color:var(--p-text-muted)}.p-divider[data-v-c695164c]{width:100%;height:1px;background:var(--p-line);border:none}.p-divider-v[data-v-c695164c]{width:1px;align-self:stretch;background:var(--p-line);border:none}.p-turn-failed[data-v-c695164c]{display:flex;align-items:center;gap:var(--space-2);width:100%;max-width:560px;padding:var(--space-2) var(--space-3);border:var(--p-hairline) solid var(--color-danger-bd);border-radius:var(--radius-lg);background:var(--color-danger-soft);box-shadow:var(--shadow-xs)}.p-turn-failed .tf-chip[data-v-c695164c]{display:inline-flex;align-items:center;justify-content:center;width:var(--space-6);height:var(--space-6);flex:none;border-radius:var(--radius-md);background:var(--color-surface-raised);box-shadow:var(--shadow-xs);color:var(--color-danger)}.p-turn-failed .tf-chip svg[data-v-c695164c]{width:var(--p-ic-sm);height:var(--p-ic-sm)}.p-turn-failed .tf-main[data-v-c695164c]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.p-turn-failed .tf-title[data-v-c695164c]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text);line-height:var(--leading-normal)}.p-turn-failed .tf-sub[data-v-c695164c],.p-turn-failed .tf-meta[data-v-c695164c]{font-size:var(--text-xs);color:var(--color-text-muted);line-height:var(--leading-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-turn-failed .tf-meta[data-v-c695164c]{font-family:var(--font-mono);color:var(--color-text-faint)}.p-tip[data-v-c695164c]{position:relative;display:inline-flex}.p-tip .p-tooltip[data-v-c695164c]{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--p-text);color:var(--p-bg);font-size:var(--p-font-size-xs);padding:4px 8px;border-radius:var(--p-r-sm);white-space:nowrap;opacity:0;pointer-events:none;transition:opacity var(--p-dur-fast) var(--p-ease)}.p-tip:hover .p-tooltip[data-v-c695164c]{opacity:1}.p-banner[data-v-c695164c]{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:var(--p-r-md);border:.5px solid var(--p-line);background:var(--p-surface);font-size:var(--p-font-size-sm);color:var(--p-text)}.p-banner .bn-ic[data-v-c695164c]{width:18px;height:18px;flex:none}.p-banner.info[data-v-c695164c]{background:var(--p-accent-soft);border-color:var(--p-accent-bd)}.p-banner.info .bn-ic[data-v-c695164c]{color:var(--p-accent)}.p-banner.warning[data-v-c695164c]{background:var(--p-warning-soft);border-color:var(--p-warning-bd)}.p-banner.warning .bn-ic[data-v-c695164c]{color:var(--p-warning)}.p-banner.danger[data-v-c695164c]{background:var(--p-danger-soft);border-color:var(--p-danger-bd)}.p-banner.danger .bn-ic[data-v-c695164c]{color:var(--p-danger)}.p-sheet[data-v-c695164c]{background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-xl) var(--p-r-xl) 0 0;box-shadow:var(--p-sh-xl);padding:8px 16px 20px}.p-sheet-handle[data-v-c695164c]{width:36px;height:4px;border-radius:var(--p-r-full);background:var(--p-line-strong);margin:0 auto 8px}.p-skeleton[data-v-c695164c]{background:var(--p-surface-sunken);border-radius:var(--p-r-sm);animation:p-skel-c695164c 1.2s var(--p-ease-inout) infinite alternate}@keyframes p-skel-c695164c{0%{opacity:.5}to{opacity:1}}.p-cmdbar[data-v-c695164c]{display:flex;align-items:center;gap:8px;width:100%}.p-cmd[data-v-c695164c]{flex:1;min-width:0;height:38px;display:flex;align-items:center;gap:10px;padding:0 10px 0 14px;background:var(--p-surface-sunken);border:.5px solid var(--p-line);border-radius:var(--p-r-md);font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);color:var(--p-text-muted)}.p-cmd .cmd-text[data-v-c695164c]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.p-cmd .cmd-copy[data-v-c695164c]{margin-left:auto;flex:none;display:grid;place-items:center;width:26px;height:26px;border:none;background:transparent;border-radius:var(--p-r-sm);color:var(--p-text-faint);cursor:pointer;transition:background var(--p-dur) var(--p-ease),color var(--p-dur) var(--p-ease)}.p-cmd .cmd-copy[data-v-c695164c]:hover{background:var(--p-surface-raised);color:var(--p-text)}.p-cmd .cmd-copy .p-ic[data-v-c695164c]{width:15px;height:15px}.p-topbar[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;gap:12px;height:48px;padding:0 16px;background:var(--p-surface-raised);border:.5px solid var(--p-line);border-radius:var(--p-r-lg)}.p-topbar .tb-title[data-v-c695164c]{font-size:var(--p-font-size-sm);font-weight:600;color:var(--p-text)}.p-topbar .tb-actions[data-v-c695164c]{display:flex;align-items:center;gap:4px}.p-topbar.frost[data-v-c695164c]{background:#ffffffb8;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-color:#fff9}[data-p=dark] .p-topbar.frost[data-v-c695164c]{background:#161b22b8;border-color:#ffffff14}.demo-row[data-v-c695164c]{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.demo-stack[data-v-c695164c]{display:flex;flex-direction:column;gap:12px;width:100%}.demo-col[data-v-c695164c]{display:flex;flex-direction:column;gap:10px}.demo-grow[data-v-c695164c]{flex:1;min-width:0}.demo-chat[data-v-c695164c]{display:flex;flex-direction:column;gap:14px;width:100%;max-width:560px}.icon-grid[data-v-c695164c]{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px;margin:14px 0}.icon-group-label[data-v-c695164c]{grid-column:1 / -1;margin-top:10px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--d-fg-muted)}.icon-cell[data-v-c695164c]{display:flex;align-items:center;gap:10px;padding:8px 10px;border:.5px solid var(--d-line);border-radius:8px;background:var(--d-surface)}.icon-cell .kw-icon[data-v-c695164c]{width:20px;height:20px;color:var(--d-fg-soft)}.icon-cell .ic-name[data-v-c695164c]{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;color:var(--d-fg)}.icon-sizes[data-v-c695164c]{display:flex;align-items:end;gap:22px;flex-wrap:wrap}.icon-sizes .sz[data-v-c695164c]{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:11px;color:var(--d-fg-muted);font-family:JetBrains Mono,ui-monospace,monospace}.p-code-inline[data-v-c695164c]{font-family:var(--p-font-mono);background:var(--p-surface-sunken);color:var(--p-text);padding:0 5px;border-radius:var(--p-r-sm);font-size:.9em}.p-code-block[data-v-c695164c]{border:.5px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;background:var(--p-surface-sunken)}.p-code-block-head[data-v-c695164c]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--p-surface);border-bottom:.5px solid var(--p-line);font-family:var(--p-font-mono);font-size:var(--p-font-size-xs);color:var(--p-text-muted)}.p-code-block pre[data-v-c695164c]{margin:0;padding:12px 14px;font-family:var(--p-font-mono);font-size:var(--p-font-size-sm);line-height:1.65;color:var(--p-text);overflow-x:auto}.p-diff[data-v-c695164c]{border:.5px solid var(--p-line);border-radius:var(--p-r-md);overflow:hidden;font-family:var(--p-font-mono);font-size:var(--p-font-size-sm)}.p-diff-head[data-v-c695164c]{padding:8px 12px;background:var(--p-surface);border-bottom:.5px solid var(--p-line);font-size:var(--p-font-size-xs);color:var(--p-text-muted)}.p-diff-row[data-v-c695164c]{display:flex;gap:10px;padding:2px 12px;line-height:1.6}.p-diff-row .pm[data-v-c695164c]{width:14px;flex:none;color:var(--p-text-faint)}.p-diff-row.add[data-v-c695164c]{background:var(--p-success-soft)}.p-diff-row.add .pm[data-v-c695164c]{color:var(--p-success)}.p-diff-row.del[data-v-c695164c]{background:var(--p-danger-soft)}.p-diff-row.del .pm[data-v-c695164c]{color:var(--p-danger)}.p-diff-row .p-diff-code[data-v-c695164c]{color:var(--p-text)}.p-field-error[data-v-c695164c]{color:var(--p-danger);font-size:var(--p-font-size-xs)}.p-btn .p-spinner[data-v-c695164c]{vertical-align:middle}.p-btn .p-spinner .track[data-v-c695164c]{stroke:currentColor;opacity:.35}.p-btn .p-spinner .arc[data-v-c695164c]{stroke:currentColor}.ds-page[data-v-c695164c]{position:fixed;inset:0;z-index:var(--z-max);overflow-y:auto}.ds-topbar[data-v-c695164c]{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-4);background:var(--color-surface);border-bottom:.5px solid var(--color-line)}.ds-back[data-v-c695164c]{display:inline-flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-3);border:.5px solid var(--color-line);border-radius:var(--radius-md);background:var(--color-surface-raised);color:var(--color-text);font-family:var(--font-ui);font-size:var(--text-sm);cursor:pointer}.ds-back[data-v-c695164c]:hover{background:var(--color-hover)}.ds-topbar-title[data-v-c695164c]{font-size:var(--text-sm);font-weight:var(--weight-medium);color:var(--color-text-muted)} diff --git a/apps/kimi-code/dist-web/assets/Tooltip-C1-Eo-G7.js b/apps/kimi-code/dist-web/assets/Tooltip-YQT_xjmY.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-C1-Eo-G7.js rename to apps/kimi-code/dist-web/assets/Tooltip-YQT_xjmY.js index 1a3f4f03e..bd858f171 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-C1-Eo-G7.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-YQT_xjmY.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-ClWTW3HX.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-BdL5hCoZ.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-BN8u4QOj.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DevNBUbt.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-BN8u4QOj.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DevNBUbt.js index 6308869b5..2b74b8bd8 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-BN8u4QOj.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DevNBUbt.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CbeWHP1z.js";import{p as f}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{_ as n,l as o}from"./mermaid.core-Ci_ShHqV.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CC2YIE_t.js";import{p as f}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{_ as n,l as o}from"./mermaid.core-cXaFT3ek.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-CHrC_o96.js b/apps/kimi-code/dist-web/assets/arc-CHrC_o96.js deleted file mode 100644 index 5a0be34c3..000000000 --- a/apps/kimi-code/dist-web/assets/arc-CHrC_o96.js +++ /dev/null @@ -1 +0,0 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-Ci_ShHqV.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),sy))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(Ly?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{_ as gt,F as Ze,ad as qe,l as Se,b as Qe,a as Je,o as Ke,p as je,g as _e,s as tr,q as er,B as rr,z as ir,D as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,r as sr,aj as hr,b7 as lr}from"./mermaid.core-cXaFT3ek.js";import{p as fr}from"./cynefin-VYW2F7L2-BRNWksTk.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BdL5hCoZ.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CLFaORFU.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-1iWth3Xj.js similarity index 86% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CLFaORFU.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-1iWth3Xj.js index 58bec94f2..33d731e1f 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CLFaORFU.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-1iWth3Xj.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-CC9yzw-p.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-Ci_ShHqV.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-4YHX4t6b.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-KnT0i4wx.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,z as rt,d as D,e as Pe,l as k,q as Fe,t as We,c as R,aZ as Ye,a7 as He,a8 as Ke,a3 as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,y as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-cXaFT3ek.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-iWyrnKRM.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DchSxaek.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-COaaUOdd.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DchSxaek.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-COaaUOdd.js index c13bb6cda..06c792642 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-DchSxaek.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-COaaUOdd.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-BTh5nWiN.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-Ci_ShHqV.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-OEA_sg25.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-cXaFT3ek.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-4YHX4t6b.js b/apps/kimi-code/dist-web/assets/channel-4YHX4t6b.js deleted file mode 100644 index 29d695a2f..000000000 --- a/apps/kimi-code/dist-web/assets/channel-4YHX4t6b.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-Ci_ShHqV.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-iWyrnKRM.js b/apps/kimi-code/dist-web/assets/channel-iWyrnKRM.js new file mode 100644 index 000000000..78e29b369 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-iWyrnKRM.js @@ -0,0 +1 @@ +import{U as a,C as n}from"./mermaid.core-cXaFT3ek.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DzO9Jhzo.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BGw8VEOT.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DzO9Jhzo.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BGw8VEOT.js index c7d7cb1a1..645b59aa3 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-DzO9Jhzo.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-BGw8VEOT.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-Ci_ShHqV.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-cXaFT3ek.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BTh5nWiN.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-OEA_sg25.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BTh5nWiN.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-OEA_sg25.js index 0ec6777e0..5dd761b7f 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BTh5nWiN.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-OEA_sg25.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-Ci_ShHqV.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,n as d,j as o}from"./mermaid.core-cXaFT3ek.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CC9yzw-p.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-KnT0i4wx.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CC9yzw-p.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-KnT0i4wx.js index dd2d5d15a..a630e6ba3 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CC9yzw-p.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-KnT0i4wx.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-Ci_ShHqV.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-cXaFT3ek.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B4hMX7qz.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BzvUT-Ug.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B4hMX7qz.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BzvUT-Ug.js index e4cd65794..aaaddda43 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B4hMX7qz.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-BzvUT-Ug.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-gteaXiEE.js";import{s as ee}from"./chunk-VR4S4FIN-BBaFYq-u.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-Ci_ShHqV.js";import{f as fe}from"./chunk-32BRIVSS-BTh5nWiN.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-oeuDpJ1n.js";import{s as ee}from"./chunk-VR4S4FIN-Co_Tl-Vk.js";import{_ as f,l as _,c as $,x as se,y as ie,a as re,b as ae,g as ne,s as oe,o as le,p as ce,a9 as he,k as j,q as ue,d as bt,a5 as de}from"./mermaid.core-cXaFT3ek.js";import{f as fe}from"./chunk-32BRIVSS-OEA_sg25.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DvJ2Uoqv.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DYhWNXPR.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DvJ2Uoqv.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DYhWNXPR.js index 1979afb40..516952324 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DvJ2Uoqv.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-DYhWNXPR.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-Ci_ShHqV.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-cXaFT3ek.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CbeWHP1z.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CC2YIE_t.js similarity index 97% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CbeWHP1z.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CC2YIE_t.js index 56df277bf..aa49cd464 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CbeWHP1z.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-CC2YIE_t.js @@ -1,5 +1,5 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-Ci_ShHqV.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` -`),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` +import{_ as p,l as w,F as L,z as E,q as I,W as X,e as q,i as H,c as G}from"./mermaid.core-cXaFT3ek.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>H(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),W=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),_=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +`),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=W,re=_,ie={clear:U,setTitle:W,getTitle:_,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; font-size: ${a}px; @@ -84,5 +84,5 @@ import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mer .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),T=class{constructor(){this.d=""}static{p(this,"PathBuilder")}moveTo(e,i){return this.d+=`M ${e} ${i} `,this}lineTo(e,i){return this.d+=`L ${e} ${i} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,i,a,r,t,n,h){return this.d+=`A ${e} ${i} ${a} ${r?1:0} ${t?1:0} ${n} ${h} `,this}build(){return this.d.trim()}},me=class{constructor(e,i=M()){this.textCache=new Map,this.svg=e,this.config=i}static{p(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const i=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),a=i.node().getBBox(),r={width:a.width,height:a.height};return i.remove(),this.textCache.set(e,r),r}renderTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-terminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t).attr("rx",10).attr("ry",10),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderNonTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-nonterminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderSequence(e,i){const a=i.map(o=>this.renderExpression(e,o));let r=0,t=0,n=0;for(const o of a)r+=o.dimensions.width,t=Math.max(t,o.dimensions.up),n=Math.max(n,o.dimensions.down);r+=(a.length-1)*this.config.horizontalSeparation;const h=e.append("g").attr("class","railroad-sequence");let s=0;for(let o=0;othis.renderExpression(e,d));let r=0,t=0;for(const d of a)r=Math.max(r,d.dimensions.width),t+=d.dimensions.height;t+=(a.length-1)*this.config.verticalSeparation;const n=this.config.arcRadius,h=n*4,s=r+h,o=e.append("g").attr("class","railroad-choice");let u=0;const c=t/2;for(const d of a){const x=u,l=x+d.dimensions.up,f=n*2+(r-d.dimensions.width)/2;o.node().appendChild(d.element).setAttribute("transform",`translate(${f}, ${x})`);const v=new T,C=l>c;l===c?v.moveTo(0,c).lineTo(f,l):v.moveTo(0,c).arcTo(n,n,0,!1,C,n,c+(C?n:-n)).lineTo(n,l-(C?n:-n)).arcTo(n,n,0,!1,!C,n*2,l).lineTo(f,l),o.append("path").attr("class","railroad-line").attr("d",v.build());const $=new T,O=f+d.dimensions.width,P=s-n*2;l===c?$.moveTo(O,l).lineTo(s,c):$.moveTo(O,l).lineTo(P,l).arcTo(n,n,0,!1,!C,s-n,l+(C?-n:n)).lineTo(s-n,c+(C?n:-n)).arcTo(n,n,0,!1,C,s,c),o.append("path").attr("class","railroad-line").attr("d",$.build()),u+=d.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:s,height:t,up:c,down:t-c}}}renderOptional(e,i){const a=this.renderExpression(e,i),r=this.config.arcRadius,t=r*2,n=a.dimensions.width+r*4,h=a.dimensions.height+t,s=e.append("g").attr("class","railroad-optional"),o=r*2,u=t;s.node().appendChild(a.element).setAttribute("transform",`translate(${o}, ${u})`);const d=u+a.dimensions.up,x=new T().moveTo(0,d).lineTo(r*2,d);s.append("path").attr("class","railroad-line").attr("d",x.build());const l=new T().moveTo(o+a.dimensions.width,d).lineTo(n,d);s.append("path").attr("class","railroad-line").attr("d",l.build());const f=new T().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(n-r*2,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,d-r).arcTo(r,r,0,!1,!1,n,d);return s.append("path").attr("class","railroad-line").attr("d",f.build()),{element:s.node(),dimensions:{width:n,height:h,up:d,down:h-d}}}renderRepetition(e,i,a){const r=this.renderExpression(e,i),t=this.config.arcRadius,n=t*2,h=r.dimensions.width+t*4,s=a===0,o=r.dimensions.height+n+(s?n:0),u=e.append("g").attr("class","railroad-repetition"),c=t*2,d=s?n:0;u.node().appendChild(r.element).setAttribute("transform",`translate(${c}, ${d})`);const l=d+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(0,l).lineTo(t*2,l).build()),u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(c+r.dimensions.width,l).lineTo(h,l).build());const f=d+r.dimensions.height+t,y=new T().moveTo(c+r.dimensions.width,l).arcTo(t,t,0,!1,!0,c+r.dimensions.width+t,l+t).lineTo(c+r.dimensions.width+t,f).arcTo(t,t,0,!1,!0,c+r.dimensions.width,f+t).lineTo(t*2,f+t).arcTo(t,t,0,!1,!0,t,f).lineTo(t,l+t).arcTo(t,t,0,!1,!0,t*2,l);if(u.append("path").attr("class","railroad-line").attr("d",y.build()),s){const v=new T().moveTo(0,l).arcTo(t,t,0,!1,!1,t,l-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(h-t*2,0).arcTo(t,t,0,!1,!0,h-t,t).lineTo(h-t,l-t).arcTo(t,t,0,!1,!1,h,l);u.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:u.node(),dimensions:{width:h,height:o,up:l,down:o-l}}}renderSpecial(e,i){const a=this.measureText("? "+i+" ?"),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-special");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text("? "+i+" ?"),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderExpression(e,i){switch(i.type){case"terminal":return this.renderTerminal(e,i.value);case"nonterminal":return this.renderNonTerminal(e,i.name);case"sequence":return this.renderSequence(e,i.elements);case"choice":return this.renderChoice(e,i.alternatives);case"optional":return this.renderOptional(e,i.element);case"repetition":return this.renderRepetition(e,i.element,i.min);case"special":return this.renderSpecial(e,i.text);default:throw new Error(`Unknown node type: ${i.type}`)}}renderRule(e,i){const a=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${i})`),r=e.name+" =",t=this.measureText(r).width+20,n=t+20,h=a.append("g"),s=this.renderExpression(h,e.definition),o=Math.max(20,s.dimensions.up),u=o-s.dimensions.up;return h.attr("transform",`translate(${n}, ${u})`),a.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),a.append("g").attr("class","railroad-start").append("circle").attr("cx",t).attr("cy",o).attr("r",this.config.markerRadius),a.append("g").attr("class","railroad-end").append("circle").attr("cx",n+s.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(t+this.config.markerRadius,o).lineTo(n,o).build()),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(n+s.dimensions.width,o).lineTo(n+s.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:n+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let i=this.config.padding,a=0;for(const r of e){const t=this.renderRule(r,i);i+=t.height+this.config.verticalSeparation,a=Math.max(a,t.width)}return{width:a+this.config.padding*2,height:i+this.config.padding}}},D=p((e,i,a)=>{H(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),he=p((e,i,a)=>{w.debug(`[Railroad] Rendering diagram +`},"getStyles"),T=class{constructor(){this.d=""}static{p(this,"PathBuilder")}moveTo(e,i){return this.d+=`M ${e} ${i} `,this}lineTo(e,i){return this.d+=`L ${e} ${i} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,i,a,r,t,n,h){return this.d+=`A ${e} ${i} ${a} ${r?1:0} ${t?1:0} ${n} ${h} `,this}build(){return this.d.trim()}},me=class{constructor(e,i=M()){this.textCache=new Map,this.svg=e,this.config=i}static{p(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e))return this.textCache.get(e);const i=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e),a=i.node().getBBox(),r={width:a.width,height:a.height};return i.remove(),this.textCache.set(e,r),r}renderTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-terminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t).attr("rx",10).attr("ry",10),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderNonTerminal(e,i){const a=this.measureText(i),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-nonterminal");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text(i),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderSequence(e,i){const a=i.map(o=>this.renderExpression(e,o));let r=0,t=0,n=0;for(const o of a)r+=o.dimensions.width,t=Math.max(t,o.dimensions.up),n=Math.max(n,o.dimensions.down);r+=(a.length-1)*this.config.horizontalSeparation;const h=e.append("g").attr("class","railroad-sequence");let s=0;for(let o=0;othis.renderExpression(e,d));let r=0,t=0;for(const d of a)r=Math.max(r,d.dimensions.width),t+=d.dimensions.height;t+=(a.length-1)*this.config.verticalSeparation;const n=this.config.arcRadius,h=n*4,s=r+h,o=e.append("g").attr("class","railroad-choice");let u=0;const c=t/2;for(const d of a){const x=u,l=x+d.dimensions.up,f=n*2+(r-d.dimensions.width)/2;o.node().appendChild(d.element).setAttribute("transform",`translate(${f}, ${x})`);const v=new T,C=l>c;l===c?v.moveTo(0,c).lineTo(f,l):v.moveTo(0,c).arcTo(n,n,0,!1,C,n,c+(C?n:-n)).lineTo(n,l-(C?n:-n)).arcTo(n,n,0,!1,!C,n*2,l).lineTo(f,l),o.append("path").attr("class","railroad-line").attr("d",v.build());const $=new T,O=f+d.dimensions.width,P=s-n*2;l===c?$.moveTo(O,l).lineTo(s,c):$.moveTo(O,l).lineTo(P,l).arcTo(n,n,0,!1,!C,s-n,l+(C?-n:n)).lineTo(s-n,c+(C?n:-n)).arcTo(n,n,0,!1,C,s,c),o.append("path").attr("class","railroad-line").attr("d",$.build()),u+=d.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:s,height:t,up:c,down:t-c}}}renderOptional(e,i){const a=this.renderExpression(e,i),r=this.config.arcRadius,t=r*2,n=a.dimensions.width+r*4,h=a.dimensions.height+t,s=e.append("g").attr("class","railroad-optional"),o=r*2,u=t;s.node().appendChild(a.element).setAttribute("transform",`translate(${o}, ${u})`);const d=u+a.dimensions.up,x=new T().moveTo(0,d).lineTo(r*2,d);s.append("path").attr("class","railroad-line").attr("d",x.build());const l=new T().moveTo(o+a.dimensions.width,d).lineTo(n,d);s.append("path").attr("class","railroad-line").attr("d",l.build());const f=new T().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(n-r*2,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,d-r).arcTo(r,r,0,!1,!1,n,d);return s.append("path").attr("class","railroad-line").attr("d",f.build()),{element:s.node(),dimensions:{width:n,height:h,up:d,down:h-d}}}renderRepetition(e,i,a){const r=this.renderExpression(e,i),t=this.config.arcRadius,n=t*2,h=r.dimensions.width+t*4,s=a===0,o=r.dimensions.height+n+(s?n:0),u=e.append("g").attr("class","railroad-repetition"),c=t*2,d=s?n:0;u.node().appendChild(r.element).setAttribute("transform",`translate(${c}, ${d})`);const l=d+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(0,l).lineTo(t*2,l).build()),u.append("path").attr("class","railroad-line").attr("d",new T().moveTo(c+r.dimensions.width,l).lineTo(h,l).build());const f=d+r.dimensions.height+t,y=new T().moveTo(c+r.dimensions.width,l).arcTo(t,t,0,!1,!0,c+r.dimensions.width+t,l+t).lineTo(c+r.dimensions.width+t,f).arcTo(t,t,0,!1,!0,c+r.dimensions.width,f+t).lineTo(t*2,f+t).arcTo(t,t,0,!1,!0,t,f).lineTo(t,l+t).arcTo(t,t,0,!1,!0,t*2,l);if(u.append("path").attr("class","railroad-line").attr("d",y.build()),s){const v=new T().moveTo(0,l).arcTo(t,t,0,!1,!1,t,l-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(h-t*2,0).arcTo(t,t,0,!1,!0,h-t,t).lineTo(h-t,l-t).arcTo(t,t,0,!1,!1,h,l);u.append("path").attr("class","railroad-line").attr("d",v.build())}return{element:u.node(),dimensions:{width:h,height:o,up:l,down:o-l}}}renderSpecial(e,i){const a=this.measureText("? "+i+" ?"),r=a.width+this.config.padding*2,t=a.height+this.config.padding*2,n=e.append("g").attr("class","railroad-special");return n.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",t),n.append("text").attr("x",r/2).attr("y",t/2).text("? "+i+" ?"),{element:n.node(),dimensions:{width:r,height:t,up:t/2,down:t/2}}}renderExpression(e,i){switch(i.type){case"terminal":return this.renderTerminal(e,i.value);case"nonterminal":return this.renderNonTerminal(e,i.name);case"sequence":return this.renderSequence(e,i.elements);case"choice":return this.renderChoice(e,i.alternatives);case"optional":return this.renderOptional(e,i.element);case"repetition":return this.renderRepetition(e,i.element,i.min);case"special":return this.renderSpecial(e,i.text);default:throw new Error(`Unknown node type: ${i.type}`)}}renderRule(e,i){const a=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${i})`),r=e.name+" =",t=this.measureText(r).width+20,n=t+20,h=a.append("g"),s=this.renderExpression(h,e.definition),o=Math.max(20,s.dimensions.up),u=o-s.dimensions.up;return h.attr("transform",`translate(${n}, ${u})`),a.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),a.append("g").attr("class","railroad-start").append("circle").attr("cx",t).attr("cy",o).attr("r",this.config.markerRadius),a.append("g").attr("class","railroad-end").append("circle").attr("cx",n+s.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(t+this.config.markerRadius,o).lineTo(n,o).build()),a.append("path").attr("class","railroad-line").attr("d",new T().moveTo(n+s.dimensions.width,o).lineTo(n+s.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:n+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let i=this.config.padding,a=0;for(const r of e){const t=this.renderRule(r,i);i+=t.height+this.config.verticalSeparation,a=Math.max(a,t.width)}return{width:a+this.config.padding*2,height:i+this.config.padding}}},D=p((e,i,a)=>{q(e,i.height,i.width,a),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),he=p((e,i,a)=>{w.debug(`[Railroad] Rendering diagram `+e);try{const r=L(i);r.attr("class","railroad-diagram");const n=E().railroad?.useMaxWidth??!0,h=ie.getRules();if(w.debug(`[Railroad] Rendering ${h.length} rules`),h.length===0){w.warn("[Railroad] No rules to render"),D(r,{height:100,width:200},n);return}const o=new me(r,M()).renderDiagram(h);D(r,o,n),w.debug("[Railroad] Render complete")}catch(r){throw w.error("[Railroad] Render error:",r),r}},"draw"),ge={draw:he};export{ie as d,ue as g,ge as r}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Nm75jjZN.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-CdbRlOAH.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Nm75jjZN.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-CdbRlOAH.js index c30337599..1f547d130 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-Nm75jjZN.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-CdbRlOAH.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-Ci_ShHqV.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-cXaFT3ek.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Fuo1kQKN.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CfSRFy1I.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Fuo1kQKN.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CfSRFy1I.js index 5fafdb01a..e366602ce 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Fuo1kQKN.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-CfSRFy1I.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-CC9yzw-p.js";import{g as st}from"./chunk-XXDRQBXY-gteaXiEE.js";import{s as it}from"./chunk-VR4S4FIN-BBaFYq-u.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-Ci_ShHqV.js";import{f as gt}from"./chunk-32BRIVSS-BTh5nWiN.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-KnT0i4wx.js";import{g as st}from"./chunk-XXDRQBXY-oeuDpJ1n.js";import{s as it}from"./chunk-VR4S4FIN-Co_Tl-Vk.js";import{_ as f,l as Ie,c as F,v as at,x as nt,y as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,o as ht,p as dt,k as I,q as pt,r as At,i as ft,a6 as G}from"./mermaid.core-cXaFT3ek.js";import{f as gt}from"./chunk-32BRIVSS-OEA_sg25.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-BBaFYq-u.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Co_Tl-Vk.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-BBaFYq-u.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Co_Tl-Vk.js index b91b4f6da..481f2048f 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-BBaFYq-u.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Co_Tl-Vk.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-Ci_ShHqV.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-cXaFT3ek.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-gteaXiEE.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-oeuDpJ1n.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-gteaXiEE.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-oeuDpJ1n.js index 00b1740db..8116242e0 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-gteaXiEE.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-oeuDpJ1n.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-Ci_ShHqV.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-cXaFT3ek.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-Dq2EstyB.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-Dq2EstyB.js new file mode 100644 index 000000000..5a0cb4537 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-Dq2EstyB.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CfSRFy1I.js";import{_ as i}from"./mermaid.core-cXaFT3ek.js";import"./chunk-5VM5RSS4-KnT0i4wx.js";import"./chunk-XXDRQBXY-oeuDpJ1n.js";import"./chunk-VR4S4FIN-Co_Tl-Vk.js";import"./chunk-32BRIVSS-OEA_sg25.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-fCLlKdqH.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-fCLlKdqH.js deleted file mode 100644 index 3d1a68501..000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-fCLlKdqH.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Fuo1kQKN.js";import{_ as i}from"./mermaid.core-Ci_ShHqV.js";import"./chunk-5VM5RSS4-CC9yzw-p.js";import"./chunk-XXDRQBXY-gteaXiEE.js";import"./chunk-VR4S4FIN-BBaFYq-u.js";import"./chunk-32BRIVSS-BTh5nWiN.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-Dq2EstyB.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-Dq2EstyB.js new file mode 100644 index 000000000..5a0cb4537 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-Dq2EstyB.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-CfSRFy1I.js";import{_ as i}from"./mermaid.core-cXaFT3ek.js";import"./chunk-5VM5RSS4-KnT0i4wx.js";import"./chunk-XXDRQBXY-oeuDpJ1n.js";import"./chunk-VR4S4FIN-Co_Tl-Vk.js";import"./chunk-32BRIVSS-OEA_sg25.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-fCLlKdqH.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-fCLlKdqH.js deleted file mode 100644 index 3d1a68501..000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-fCLlKdqH.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Fuo1kQKN.js";import{_ as i}from"./mermaid.core-Ci_ShHqV.js";import"./chunk-5VM5RSS4-CC9yzw-p.js";import"./chunk-XXDRQBXY-gteaXiEE.js";import"./chunk-VR4S4FIN-BBaFYq-u.js";import"./chunk-32BRIVSS-BTh5nWiN.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-AXFCiq8K.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DHn7OB7F.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-AXFCiq8K.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DHn7OB7F.js index 1aafb583c..711b6e0cb 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-AXFCiq8K.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DHn7OB7F.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-Ci_ShHqV.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-ClWTW3HX.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-cXaFT3ek.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BdL5hCoZ.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-tAACGi5e.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BRNWksTk.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-tAACGi5e.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BRNWksTk.js index 06ec1a967..cf6e3e147 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-tAACGi5e.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BRNWksTk.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index-ClWTW3HX.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-BdL5hCoZ.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{s as gt,g as $t,p as bt,o as wt,a as Ct,b as vt,_ as s,l as O,F as Dt,e as kt,q as Tt,B as U,z as Q,D as At,W as ot}from"./mermaid.core-cXaFT3ek.js";import{p as Bt}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...At.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Rt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,_t=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Rt();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,F=o.boundaryAmplitude,R=i+b*2,_=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,_,R,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${R} ${_}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),V=Ft(i,f),Z=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=V[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,F)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,F)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=V[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=V[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=V[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(P=W.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=V[y.from],N=V[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,G=-x/C,ht=$/C,et=M+G*W,nt=P+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Vt={draw:_t},Et=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return` .cynefinDomain { stroke: none; } @@ -59,4 +59,4 @@ import{p as xt}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{s as gt,g as $t,o as bt font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),Gt=Ht,Ut={parser:Wt,db:Y,renderer:Ft,styles:Gt};export{Ut as diagram}; + `},"styles"),Gt=Ht,Ut={parser:It,db:Y,renderer:Vt,styles:Gt};export{Ut as diagram}; diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-Ig2tp1Qn.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BtN1M12b.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-Ig2tp1Qn.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BtN1M12b.js index 475df64e3..ffb84c59e 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-Ig2tp1Qn.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BtN1M12b.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-Nm75jjZN.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-Ci_ShHqV.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-CdbRlOAH.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-cXaFT3ek.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-B9qE72nE.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-Cz_FyLQ0.js similarity index 91% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-B9qE72nE.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-Cz_FyLQ0.js index 847fe7f6d..1a5c7678e 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-B9qE72nE.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-Cz_FyLQ0.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-Ci_ShHqV.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ -`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` -`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; +import{p as re}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{p as oe,o as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as D,d as ue,A as xe,q as fe,B as ge,z as M,D as he,i as y,w as P,ak as pe}from"./mermaid.core-cXaFT3ek.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var T="position frame",$="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:T,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:$,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[T]:V,[S]:J},Be={[$]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=D(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var De=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` +`,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=D(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),Te={draw:De},$e=o(e=>"","getStyles"),Ne=$e,Ue={parser:Ee,db:F,renderer:Te,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-D0B-MjGd.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-B9SHSI8I.js similarity index 84% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-D0B-MjGd.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-B9SHSI8I.js index 91404d06c..3212061c2 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-D0B-MjGd.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-B9SHSI8I.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-Ci_ShHqV.js";import{s as Fe}from"./chunk-VR4S4FIN-BBaFYq-u.js";import{p as Ne}from"./cynefin-VYW2F7L2-tAACGi5e.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{_ as w,W as ge,z as te,B as Q,F as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,o as be,p as we,g as Ce,s as Te,D as Le,bf as $e,q as Ae}from"./mermaid.core-cXaFT3ek.js";import{s as Fe}from"./chunk-VR4S4FIN-Co_Tl-Vk.js";import{p as Ne}from"./cynefin-VYW2F7L2-BRNWksTk.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function We(e){for(var a=this,n=Ee(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Ee(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function Re(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*qe(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function Ge(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:We,ancestors:Re,descendants:He,leaves:Ie,links:Oe,copy:Ge,[Symbol.iterator]:qe};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function q(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*E,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,W=10,G=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*W:960,x=o.nodeHeight?o.nodeHeight*W:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),E=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?G+W:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?W:0).paddingRight(t=>t.children&&t.children.length>0?W:0).paddingBottom(t=>t.children&&t.children.length>0?W:0).round(!0)(E),he=ne.descendants().filter(t=>t.children&&t.children.length>0),R=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);R.append("rect").attr("width",t=>t.x1-t.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),R.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",G),R.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DT7xCoFQ.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BWbx1T48.js similarity index 85% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DT7xCoFQ.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BWbx1T48.js index 43df95414..6b314b2da 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-DT7xCoFQ.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BWbx1T48.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-Ci_ShHqV.js";import{p as _}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{_ as b,B as u,F as $,e as C,l as m,b as S,a as D,o as T,p as z,g as F,s as P,z as E,D as A,q as W}from"./mermaid.core-cXaFT3ek.js";import{p as _}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var N=A.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},q={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},G=b(({packet:t}={})=>{const e=u(q,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -21,4 +21,4 @@ import{p as B}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{_ as b,A as u,D as $,e a stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),J={parser:v,get db(){return new w},renderer:j,styles:H};export{J as diagram}; + `},"styles"),J={parser:v,get db(){return new w},renderer:j,styles:G};export{J as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-SQ_tyDvO.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-D5RzcAVx.js similarity index 82% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-SQ_tyDvO.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-D5RzcAVx.js index 1f7747289..8d890da8f 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-SQ_tyDvO.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-D5RzcAVx.js @@ -1,7 +1,7 @@ -import{I as X}from"./chunk-2Q5K7J3B-DzO9Jhzo.js";import{p as O}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-Ci_ShHqV.js";import{p as ne}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-BGw8VEOT.js";import{p as O}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{o as G,b as Y,s as F,p as P,g as j,a as q,_ as f,B as A,l as D,F as Z,e as U,z as N,q as J,i as K,ai as Q,D as ee,aj as te}from"./mermaid.core-cXaFT3ek.js";import{p as ne}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram -`+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` +`),lineMap:t}}f(R,"preprocessBoxDrawing");var x=new X(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:q,getAccDescription:j,getDiagramTitle:P,setAccDescription:F,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function z(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(z,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=z(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,H=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",H(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${H(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram +`+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=Z(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` .treeView-node-label { font-size: ${e}; fill: ${t}; diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-BEYbFono.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-BEYbFono.js deleted file mode 100644 index ba985a815..000000000 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-BEYbFono.js +++ /dev/null @@ -1,41 +0,0 @@ -import{p as k}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-Ci_ShHqV.js";import{p as H}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` - .radarTitle { - font-size: ${t.fontSize}; - color: ${t.titleColor}; - dominant-baseline: hanging; - text-anchor: middle; - } - .radarAxisLine { - stroke: ${e.axisColor}; - stroke-width: ${e.axisStrokeWidth}; - } - .radarAxisLabel { - font-size: ${e.axisLabelFontSize}px; - color: ${e.axisColor}; - } - .radarGraticule { - fill: ${e.graticuleColor}; - fill-opacity: ${e.graticuleOpacity}; - stroke: ${e.graticuleColor}; - stroke-width: ${e.graticuleStrokeWidth}; - } - .radarLegendText { - text-anchor: start; - font-size: ${e.legendFontSize}px; - dominant-baseline: hanging; - } - ${ot(t,e)} - `},"styles"),xt={parser:tt,db:$,renderer:nt,styles:lt};export{xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-Br-kwRXz.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-Br-kwRXz.js new file mode 100644 index 000000000..b1fae1cb8 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-Br-kwRXz.js @@ -0,0 +1,41 @@ +import{p as k}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{s as R,g as F,p as I,o as _,a as D,b as E,_ as c,F as z,q as P,B as y,z as C,D as G,l as B,W,e as V}from"./mermaid.core-cXaFT3ek.js";import{p as H}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,q=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),N=c(()=>x.curves,"getCurves"),U=c(()=>x.options,"getOptions"),X=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Y=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:Z(t.entries)}))},"setCurves"),Z=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{P(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:N,getOptions:U,setAxes:X,setCurves:Y,setOptions:J,getConfig:q,clear:K,setAccTitle:E,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:F,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=z(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const t=W(),e=C(),r=y(t,e.themeVariables),s=y(r.radar,a);return{themeVariables:r,radarOptions:s}},"buildRadarStyleOptions"),lt=c(({radar:a}={})=>{const{themeVariables:t,radarOptions:e}=it(a);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${e.axisColor}; + stroke-width: ${e.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${e.axisLabelFontSize}px; + color: ${e.axisColor}; + } + .radarGraticule { + fill: ${e.graticuleColor}; + fill-opacity: ${e.graticuleOpacity}; + stroke: ${e.graticuleColor}; + stroke-width: ${e.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${e.legendFontSize}px; + dominant-baseline: hanging; + } + ${ot(t,e)} + `},"styles"),xt={parser:tt,db:$,renderer:nt,styles:lt};export{xt as diagram}; diff --git a/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-yztm9wUi.js b/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-KPWRxE9r.js similarity index 87% rename from apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-yztm9wUi.js rename to apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-KPWRxE9r.js index 494a61f18..340ef823e 100644 --- a/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-yztm9wUi.js +++ b/apps/kimi-code/dist-web/assets/ebnfDiagram-CCIWWBDH-KPWRxE9r.js @@ -1 +1 @@ -import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-CbeWHP1z.js";import{p}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{_ as t,l as o}from"./mermaid.core-Ci_ShHqV.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-CC2YIE_t.js";import{p}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{_ as t,l as o}from"./mermaid.core-cXaFT3ek.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Cab1pC4d.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-ihn8Hlr9.js similarity index 98% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Cab1pC4d.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-ihn8Hlr9.js index d77d6bf81..533874ec3 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Cab1pC4d.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-ihn8Hlr9.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-gteaXiEE.js";import{s as Bt}from"./chunk-VR4S4FIN-BBaFYq-u.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-Ci_ShHqV.js";import{c as Jt}from"./channel-4YHX4t6b.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-oeuDpJ1n.js";import{s as Bt}from"./chunk-VR4S4FIN-Co_Tl-Vk.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,o as Gt,p as Kt,c as it,l as V,q as Ut,r as Zt,t as jt,u as Wt,v as qt,x as Qt,d as Xt,y as Ht}from"./mermaid.core-cXaFT3ek.js";import{c as Jt}from"./channel-iWyrnKRM.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BLiHy1va.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-DOrRTzbR.js similarity index 96% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BLiHy1va.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-DOrRTzbR.js index 1079afce5..3772c9f8b 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-BLiHy1va.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-DOrRTzbR.js @@ -1,14 +1,14 @@ -import{g as He}from"./chunk-5VM5RSS4-CC9yzw-p.js";import{g as Xe}from"./chunk-XXDRQBXY-gteaXiEE.js";import{s as Qe}from"./chunk-VR4S4FIN-BBaFYq-u.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-Ci_ShHqV.js";import{f as ft}from"./chunk-32BRIVSS-BTh5nWiN.js";import{c as gt}from"./channel-4YHX4t6b.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-KnT0i4wx.js";import{g as Xe}from"./chunk-XXDRQBXY-oeuDpJ1n.js";import{s as Qe}from"./chunk-VR4S4FIN-Co_Tl-Vk.js";import{_ as b,b6 as Ze,X as Oe,l as Z,c as g1,v as Je,x as $e,y as ie,b as et,s as tt,o as st,a as it,g as rt,p as at,k as nt,Y as ut,Z as ot,bo as lt,r as te,d as se,a5 as ct,q as ht,b8 as dt,t as pt}from"./mermaid.core-cXaFT3ek.js";import{f as ft}from"./chunk-32BRIVSS-OEA_sg25.js";import{c as gt}from"./channel-iWyrnKRM.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` -}`,n=ut(k,{schema:ot})}const g=this.edges.find(k=>k.id===e);if(g){const k=n;k?.animate!==void 0&&(g.animate=k.animate),k?.animation!==void 0&&(g.animation=k.animation),k?.curve!==void 0&&(g.interpolate=k.curve);return}let B,f=this.vertices.get(e);if(f===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&J.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:bt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,i!==void 0?(this.config=g1(),B=this.sanitizeText(i.text.trim()),f.labelType=i.type,B.startsWith('"')&&B.endsWith('"')&&(B=B.substring(1,B.length-1)),f.text=B):f.text===void 0&&(f.text=e),r!==void 0&&(f.type=r),a?.forEach(k=>{f.styles.push(k)}),o?.forEach(k=>{f.classes.push(k)}),d!==void 0&&(f.dir=d),f.props===void 0?f.props=l:l!==void 0&&Object.assign(f.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!lt(n.shape))throw new Error(`No such shape: ${n.shape}.`);f.type=n?.shape}n?.label&&(f.text=n?.label,f.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(f.icon=n?.icon,!n.label?.trim()&&f.text===e&&(f.text="")),n?.form&&(f.form=n?.form),n?.pos&&(f.pos=n?.pos),n?.img&&(f.img=n?.img,!n.label?.trim()&&f.text===e&&(f.text="")),n?.constraint&&(f.constraint=n.constraint),n.w&&(f.assetWidth=Number(n.w)),n.h&&(f.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};J.info("abc78 Got edge...",l);const A=r.text;if(A!==void 0&&(l.text=this.sanitizeText(A.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(A.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(g=>g.start===l.start&&g.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))J.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,n=ut(k,{schema:ot})}const g=this.edges.find(k=>k.id===e);if(g){const k=n;k?.animate!==void 0&&(g.animate=k.animate),k?.animation!==void 0&&(g.animation=k.animation),k?.curve!==void 0&&(g.interpolate=k.curve);return}let B,f=this.vertices.get(e);if(f===void 0&&(i===void 0&&r===void 0&&a!==void 0&&a!==null&&Z.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:bt+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,i!==void 0?(this.config=g1(),B=this.sanitizeText(i.text.trim()),f.labelType=i.type,B.startsWith('"')&&B.endsWith('"')&&(B=B.substring(1,B.length-1)),f.text=B):f.text===void 0&&(f.text=e),r!==void 0&&(f.type=r),a?.forEach(k=>{f.styles.push(k)}),o?.forEach(k=>{f.classes.push(k)}),d!==void 0&&(f.dir=d),f.props===void 0?f.props=l:l!==void 0&&Object.assign(f.props,l),n!==void 0){if(n.shape){if(n.shape!==n.shape.toLowerCase()||n.shape.includes("_"))throw new Error(`No such shape: ${n.shape}. Shape names should be lowercase.`);if(!lt(n.shape))throw new Error(`No such shape: ${n.shape}.`);f.type=n?.shape}n?.label&&(f.text=n?.label,f.labelType=this.sanitizeNodeLabelType(n?.labelType)),n?.icon&&(f.icon=n?.icon,!n.label?.trim()&&f.text===e&&(f.text="")),n?.form&&(f.form=n?.form),n?.pos&&(f.pos=n?.pos),n?.img&&(f.img=n?.img,!n.label?.trim()&&f.text===e&&(f.text="")),n?.constraint&&(f.constraint=n.constraint),n.w&&(f.assetWidth=Number(n.w)),n.h&&(f.assetHeight=Number(n.h))}}addSingleLink(e,i,r,a){const l={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};Z.info("abc78 Got edge...",l);const A=r.text;if(A!==void 0&&(l.text=this.sanitizeText(A.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=this.sanitizeNodeLabelType(A.type)),r!==void 0&&(l.type=r.type,l.stroke=r.stroke,l.length=r.length>10?10:r.length),a&&!this.edges.some(n=>n.id===a))l.id=a,l.isUserDefinedId=!0;else{const n=this.edges.filter(g=>g.start===l.start&&g.end===l.end);n.length===0?l.id=te(l.start,l.end,{counter:0,prefix:"L"}):l.id=te(l.start,l.end,{counter:n.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))Z.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;J.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],A=d===i[0];l&&A?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ft();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const A=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+A.left+(A.right-A.left)/2+"px").style("top",window.scrollY+A.bottom+"px"),i.html(ct.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ht()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(Y=>{const F={boolean:{},number:{},string:{}},_=[];let b1;return{nodeList:Y.filter(function(j){const h1=typeof j;return j.stmt&&j.stmt==="dir"?(b1=j.value,!1):j.trim()===""?!1:h1 in F?F[h1].hasOwnProperty(j)?!1:F[h1][j]=!0:_.includes(j)?!1:_.push(j)}),dir:b1}},"uniq")(i.flat()),A=l.nodeList,n=l.dir,g=n!==void 0,B=g1().flowchart??{},f=n??(B.inheritDir?this.getDirection()??g1().direction??void 0:void 0);if(this.version==="gen-1")for(let Y=0;Y2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),A=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const g={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};A?i.push({...g,isGroup:!0,shape:"rect"}):i.push({...g,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const g=a[n];g.nodes.length>0&&d.set(g.id,!0);for(const B of g.nodes)o.set(B,g.id)}for(let n=a.length-1;n>=0;n--){const g=a[n];i.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:o.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"rect",dir:g.dir==="TD"?"TB":g.dir,explicitDir:g.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const A=this.getEdges();return A.forEach((n,g)=>{const{arrowTypeStart:B,arrowTypeEnd:f}=this.destructEdgeType(n.type),k=[...A.defaultStyle??[]];n.style&&k.push(...n.style);const Y={id:te(n.start,n.end,{counter:g,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":B,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:k,style:k,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Y)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return dt.flowchart}},kt=b(function(e,i){return i.db.getClasses()},"getClasses"),mt=b(async function(e,i,r,a,o){J.info("REF0:"),J.info("Drawing state diagram (v2)",i);const{securityLevel:d,flowchart:l,layout:A}=g1();a.db.setDiagramId(i),J.debug("Before getData: ");const n=a.db.getData();J.debug("Data: ",n);const g=Xe(i,d),B=a.db.getDirection();n.type=a.type,n.layoutAlgorithm=Ze(A),n.layoutAlgorithm==="dagre"&&A==="elk"&&J.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),n.direction=B,n.nodeSpacing=l?.nodeSpacing||50,n.rankSpacing=l?.rankSpacing||50,n.markers=["point","circle","cross"],n.diagramId=i,J.debug("REF1:",n),await $e(n,g,o);const f=n.config.flowchart?.diagramPadding??8;ie.insertTitle(g,"flowchartTitleText",l?.titleTopMargin||0,a.db.getDiagramTitle()),Qe(g,f,"flowchart",l?.useMaxWidth||!1)},"draw"),Dt={getClasses:kt,draw:mt},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],A=[1,14],n=[1,15],g=[1,16],B=[1,23],f=[1,25],k=[1,26],Y=[1,27],F=[1,50],_=[1,49],b1=[1,29],N1=[1,30],j=[1,31],h1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],D1=[8,9,11,75,77,78],ae=[1,79],E1=[1,92],C1=[1,97],T1=[1,96],S1=[1,93],y1=[1,89],x1=[1,95],F1=[1,91],_1=[1,98],B1=[1,94],v1=[1,99],L1=[1,90],A1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],q=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],V1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],j1=[1,125],K1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],De=[1,145],Ee=[1,146],Ce=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],x=[8,9,11],H=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],m=[1,177],z=[1,173],W=[1,174],D=[1,178],E=[1,175],C=[1,176],I1=[77,116,119],S=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],w1=[1,269],we=[8,9,11,106],Z=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,y,t,G1){var s=t.length-1;switch(y){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1]};break;case 78:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length};break;case 84:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(D1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:E1,44:C1,60:T1,80:[1,87],89:S1,95:[1,84],97:[1,85],101:86,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(A1,[2,51]),e(A1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:F,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:_,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(q,[2,181]),e(q,[2,142]),e(q,[2,143]),e(q,[2,144]),e(q,[2,145]),e(q,[2,146]),e(q,[2,147]),e(q,[2,148]),e(q,[2,149]),e(q,[2,150]),e(q,[2,151]),e(q,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(V1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:j1,119:K1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(D1,[2,48],{44:Le}),e(D1,[2,49],{18:156,10:d1,40:Ve}),e(A1,[2,44]),{44:F,47:158,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:F,47:162,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:F,47:163,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(x,[2,115],{120:168,10:[1,167],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,117],{10:[1,169]}),e(H,[2,183]),e(H,[2,170]),e(H,[2,171]),e(H,[2,172]),e(H,[2,173]),e(H,[2,174]),e(H,[2,175]),e(H,[2,176]),e(H,[2,177]),e(H,[2,178]),e(H,[2,179]),e(H,[2,180]),{44:F,47:170,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:179,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:181,50:[1,180],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:182,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:183,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:184,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{109:[1,185]},{30:186,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:187,65:[1,188],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:189,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:190,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:191,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(q,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(D1,[2,46],{39:192,18:193,10:d1,40:ae}),e(V1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{77:[1,197],79:198,116:j1,119:K1},e(I1,[2,79]),e(I1,[2,81]),e(I1,[2,82]),e(I1,[2,168]),e(I1,[2,169]),{76:199,79:121,80:ue,81:oe,116:j1,119:K1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(S,[2,101]),e(S,[2,103]),e(S,[2,104]),e(S,[2,157]),e(S,[2,158]),e(S,[2,159]),e(S,[2,160]),e(S,[2,161]),e(S,[2,162]),e(S,[2,163]),e(S,[2,164]),e(S,[2,165]),e(S,[2,166]),e(S,[2,167]),e(S,[2,90]),e(S,[2,91]),e(S,[2,92]),e(S,[2,93]),e(S,[2,94]),e(S,[2,95]),e(S,[2,96]),e(S,[2,97]),e(S,[2,98]),e(S,[2,99]),e(S,[2,100]),{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,203],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(A1,[2,43]),{10:[1,206],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(x,[2,109],{10:[1,213]}),e(x,[2,111],{10:[1,214]}),{80:[1,215]},e(H,[2,184]),{80:[1,216],98:[1,217]},e(A1,[2,55],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:m,82:219,116:D,117:E,118:C},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:m,82:219,116:D,117:E,118:C},{30:221,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{51:[1,222],67:m,82:219,116:D,117:E,118:C},{53:[1,223],67:m,82:219,116:D,117:E,118:C},{55:[1,224],67:m,82:219,116:D,117:E,118:C},{57:[1,225],67:m,82:219,116:D,117:E,118:C},{60:[1,226]},{64:[1,227],67:m,82:219,116:D,117:E,118:C},{66:[1,228],67:m,82:219,116:D,117:E,118:C},{30:229,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{31:[1,230],67:m,82:219,116:D,117:E,118:C},{67:m,69:[1,231],71:[1,232],82:219,116:D,117:E,118:C},{67:m,69:[1,234],71:[1,233],82:219,116:D,117:E,118:C},e(D1,[2,45],{18:156,10:d1,40:Ve}),e(D1,[2,47],{44:Le}),e(V1,[2,75]),e(V1,[2,74]),{62:[1,235],67:m,82:219,116:D,117:E,118:C},e(V1,[2,77]),e(I1,[2,80]),{77:[1,236],79:198,116:j1,119:K1},{30:237,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(X1,d,{5:238}),e(S,[2,102]),e(T,[2,35]),{43:239,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:F,47:258,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(x,[2,116]),e(x,[2,118],{10:[1,262]}),e(x,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:m,82:219,116:D,117:E,118:C},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:m,82:219,116:D,117:E,118:C},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(V1,[2,78]),{31:[1,266],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,267],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(A1,[2,53]),{43:268,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,121],{106:w1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(Z,[2,132]),e(Z,[2,134]),e(Z,[2,135]),e(Z,[2,136]),e(Z,[2,137]),e(Z,[2,138]),e(Z,[2,139]),e(Z,[2,140]),e(Z,[2,141]),e(x,[2,122],{106:w1}),{10:[1,271]},e(x,[2,123],{106:w1}),{10:[1,272]},e(Ie,[2,129]),e(x,[2,105],{106:w1}),e(x,[2,106],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(x,[2,110]),e(x,[2,112],{10:[1,273]}),e(x,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(A1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(Z,[2,133]),{14:E1,44:C1,60:T1,89:S1,101:280,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{14:E1,44:C1,60:T1,89:S1,101:281,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{98:[1,282]},e(x,[2,120]),e(U,[2,58]),{30:283,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(x,[2,126],{120:168,10:[1,285],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,127],{120:168,10:[1,286],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,114]),{31:[1,287],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,288],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(x,[2,124],{106:w1}),e(x,[2,125],{106:w1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],y=[null],t=[],G1=this.table,s="",v=0,Re=0,je=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),k1={yy:{}};for(var J1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J1)&&(k1.yy[J1]=this.yy[J1]);M.setInput(c,k1.yy),k1.yy.lexer=M,k1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var Z1=M.yylloc;t.push(Z1);var Ye=M.options&&M.options.ranges;typeof k1.yy.parseError=="function"?this.parseError=k1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qe(X){p.length=p.length-2*X,y.length=y.length-X,t.length=t.length-X}b(qe,"popStack");function Ge(){var X;return X=u.pop()||M.lex()||Ne,typeof X!="number"&&(X instanceof Array&&(u=X,X=u.pop()),X=h.symbols_[X]||X),X}b(Ge,"lex");for(var K,m1,Q,$1,R1={},q1,c1,Pe,H1;;){if(m1=p[p.length-1],this.defaultActions[m1]?Q=this.defaultActions[m1]:((K===null||typeof K>"u")&&(K=Ge()),Q=G1[m1]&&G1[m1][K]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";H1=[];for(q1 in G1[m1])this.terminals_[q1]&&q1>je&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(v+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,r){const a=this.isLinkData(r)?r.id.replace("@",""):void 0;Z.info("addLink",e,i,a);for(const o of e)for(const d of i){const l=o===e[e.length-1],A=d===i[0];l&&A?this.addSingleLink(o,d,r,a):this.addSingleLink(o,d,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{r==="default"?this.edges.defaultInterpolate=i:this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(a=>a?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){const r=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(a=>{let o=this.classes.get(a);o===void 0&&(o={id:a,styles:[],textStyles:[]},this.classes.set(a,o)),r?.forEach(d=>{if(/color/.exec(d)){const l=d.replace("fill","bgFill");o.textStyles.push(l)}o.styles.push(d)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,i){for(const r of e.split(",")){const a=this.vertices.get(r);a&&a.classes.push(i);const o=this.edges.find(l=>l.id===r);o&&o.classes.push(i);const d=this.subGraphLookup.get(r);d&&d.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(g1().securityLevel!=="loose"||i===void 0)return;let a=[];if(typeof r=="string"){a=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d{const d=this.lookUpDomId(e),l=document.querySelector(`[id="${d}"]`);l!==null&&l.addEventListener("click",()=>{ie.runFunc(i,...a)},!1)}))}setLink(e,i,r){e.split(",").forEach(a=>{const o=this.vertices.get(a);o!==void 0&&(o.link=ie.formatUrl(i,this.config),o.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(a=>{this.setClickFun(a,i,r)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const i=ft();se(e).select("svg").selectAll("g.node").on("mouseover",o=>{const d=se(o.currentTarget),l=d.attr("title");if(l===null)return;const A=o.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(d.attr("title")).style("left",window.scrollX+A.left+(A.right-A.left)/2+"px").style("top",window.scrollY+A.bottom+"px"),i.html(ct.sanitize(l)),d.classed("hover",!0)}).on("mouseout",o=>{i.transition().duration(500).style("opacity",0),se(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=g1(),ht()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,r){let a=e.text.trim(),o=r.text;e===r&&/\s/.exec(r.text)&&(a=void 0);const l=b(Y=>{const F={boolean:{},number:{},string:{}},_=[];let b1;return{nodeList:Y.filter(function(j){const h1=typeof j;return j.stmt&&j.stmt==="dir"?(b1=j.value,!1):j.trim()===""?!1:h1 in F?F[h1].hasOwnProperty(j)?!1:F[h1][j]=!0:_.includes(j)?!1:_.push(j)}),dir:b1}},"uniq")(i.flat()),A=l.nodeList,n=l.dir,g=n!==void 0,B=g1().flowchart??{},f=n??(B.inheritDir?this.getDirection()??g1().direction??void 0:void 0);if(this.version==="gen-1")for(let Y=0;Y2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let a=0,o=1;for(;a=0){const l=this.indexNodes2(e,d);if(l.result)return{result:!0,count:o+l.count};o=o+l.count}a=a+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let i=e.trim(),r="arrow_open";switch(i[0]){case"<":r="arrow_point",i=i.slice(1);break;case"x":r="arrow_cross",i=i.slice(1);break;case"o":r="arrow_circle",i=i.slice(1);break}let a="normal";return i.includes("=")&&(a="thick"),i.includes(".")&&(a="dotted"),{type:r,stroke:a}}countChar(e,i){const r=i.length;let a=0;for(let o=0;o":a="arrow_point",i.startsWith("<")&&(a="double_"+a,r=r.slice(1));break;case"o":a="arrow_circle",i.startsWith("o")&&(a="double_"+a,r=r.slice(1));break}let o="normal",d=r.length-1;r.startsWith("=")&&(o="thick"),r.startsWith("~")&&(o="invisible");const l=this.countChar(".",r);return l&&(o="dotted",d=l),{type:a,stroke:o,length:d}}destructLink(e,i){const r=this.destructEndLink(e);let a;if(i){if(a=this.destructStartLink(i),a.stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if(a.type==="arrow_open")a.type=r.type;else{if(a.type!==r.type)return{type:"INVALID",stroke:"INVALID"};a.type="double_"+a.type}return a.type==="double_arrow"&&(a.type="double_arrow_point"),a.length=r.length,a}return r}exists(e,i){for(const r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){const r=[];return e.nodes.forEach((a,o)=>{this.exists(i,a)||r.push(e.nodes[o])}),{nodes:r}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,i){return e.find(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,a,o,d){const l=r.get(e.id),A=a.get(e.id)??!1,n=this.findNode(i,e.id);if(n)n.cssStyles=e.styles,n.cssCompiledStyles=this.getCompiledStyles(e.classes),n.cssClasses=e.classes.join(" ");else{const g={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:l,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};A?i.push({...g,isGroup:!0,shape:"rect"}):i.push({...g,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let i=[];for(const r of e){const a=this.classes.get(r);a?.styles&&(i=[...i,...a.styles??[]].map(o=>o.trim())),a?.textStyles&&(i=[...i,...a.textStyles??[]].map(o=>o.trim()))}return i}getData(){const e=g1(),i=[],r=[],a=this.getSubGraphs(),o=new Map,d=new Map;for(let n=a.length-1;n>=0;n--){const g=a[n];g.nodes.length>0&&d.set(g.id,!0);for(const B of g.nodes)o.set(B,g.id)}for(let n=a.length-1;n>=0;n--){const g=a[n];i.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:o.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"rect",dir:g.dir==="TD"?"TB":g.dir,explicitDir:g.hasExplicitDir,isGroup:!0,look:e.look})}this.getVertices().forEach(n=>{this.addNodeFromVertex(n,i,o,d,e,e.look||"classic")});const A=this.getEdges();return A.forEach((n,g)=>{const{arrowTypeStart:B,arrowTypeEnd:f}=this.destructEdgeType(n.type),k=[...A.defaultStyle??[]];n.style&&k.push(...n.style);const Y={id:te(n.start,n.end,{counter:g,prefix:"L"},n.id),isUserDefinedId:n.isUserDefinedId,start:n.start,end:n.end,type:n.type??"normal",label:n.text,labelType:n.labelType,labelpos:"c",thickness:n.stroke,minlen:n.length,classes:n?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":B,arrowTypeEnd:n?.stroke==="invisible"||n?.type==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(n.classes),labelStyle:k,style:k,pattern:n.stroke,look:e.look,animate:n.animate,animation:n.animation,curve:n.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(Y)}),{nodes:i,edges:r,other:{},config:e}}defaultConfig(){return dt.flowchart}},kt=b(function(e,i){return i.db.getClasses()},"getClasses"),mt=b(async function(e,i,r,a,o){Z.info("REF0:"),Z.info("Drawing state diagram (v2)",i);const{securityLevel:d,flowchart:l,layout:A}=g1();a.db.setDiagramId(i),Z.debug("Before getData: ");const n=a.db.getData();Z.debug("Data: ",n);const g=Xe(i,d),B=a.db.getDirection();n.type=a.type,n.layoutAlgorithm=Je(A),n.layoutAlgorithm==="dagre"&&A==="elk"&&Z.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),n.direction=B,n.nodeSpacing=l?.nodeSpacing||50,n.rankSpacing=l?.rankSpacing||50,n.markers=["point","circle","cross"],n.diagramId=i,Z.debug("REF1:",n),await $e(n,g,o);const f=n.config.flowchart?.diagramPadding??8;ie.insertTitle(g,"flowchartTitleText",l?.titleTopMargin||0,a.db.getDiagramTitle()),Qe(g,f,"flowchart",l?.useMaxWidth||!1)},"draw"),Dt={getClasses:kt,draw:mt},re=(function(){var e=b(function(f1,c,h,p){for(h=h||{},p=f1.length;p--;h[f1[p]]=c);return h},"o"),i=[1,4],r=[1,3],a=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],d=[2,2],l=[1,13],A=[1,14],n=[1,15],g=[1,16],B=[1,23],f=[1,25],k=[1,26],Y=[1,27],F=[1,50],_=[1,49],b1=[1,29],N1=[1,30],j=[1,31],h1=[1,32],P1=[1,33],L=[1,45],V=[1,47],I=[1,43],w=[1,48],R=[1,44],N=[1,51],G=[1,46],P=[1,52],O=[1,53],O1=[1,34],M1=[1,35],U1=[1,36],z1=[1,37],W1=[1,38],d1=[1,58],T=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],$=[1,62],e1=[1,61],t1=[1,63],D1=[8,9,11,75,77,78],ae=[1,79],E1=[1,92],C1=[1,97],T1=[1,96],S1=[1,93],y1=[1,89],x1=[1,95],F1=[1,91],_1=[1,98],B1=[1,94],v1=[1,99],L1=[1,90],A1=[8,9,10,11,40,75,77,78],U=[8,9,10,11,40,46,75,77,78],q=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],ne=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],V1=[44,60,89,102,105,106,109,111,114,115,116],ue=[1,122],oe=[1,123],j1=[1,125],K1=[1,124],le=[44,60,62,74,89,102,105,106,109,111,114,115,116],ce=[1,134],he=[1,148],de=[1,149],pe=[1,150],fe=[1,151],ge=[1,136],be=[1,138],Ae=[1,142],ke=[1,143],me=[1,144],De=[1,145],Ee=[1,146],Ce=[1,147],Te=[1,152],Se=[1,153],ye=[1,132],xe=[1,133],Fe=[1,140],_e=[1,135],Be=[1,139],ve=[1,137],X1=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Le=[1,155],Ve=[1,157],x=[8,9,11],H=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],m=[1,177],z=[1,173],W=[1,174],D=[1,178],E=[1,175],C=[1,176],I1=[77,116,119],S=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Ie=[10,106],p1=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],s1=[1,248],i1=[1,246],r1=[1,250],a1=[1,244],n1=[1,245],u1=[1,247],o1=[1,249],l1=[1,251],w1=[1,269],we=[8,9,11,106],J=[8,9,10,11,60,84,105,106,109,110,111,112],Q1={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:b(function(c,h,p,u,y,t,G1){var s=t.length-1;switch(y){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 183:this.$=t[s];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(t[s-1]),this.$=t[s-1];break;case 27:this.$=t[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(t[s-6],t[s-1],t[s-4]);break;case 34:this.$=u.addSubGraph(t[s-3],t[s-1],t[s-3]);break;case 35:this.$=u.addSubGraph(void 0,t[s-1],void 0);break;case 37:this.$=t[s].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=t[s].trim(),u.setAccDescription(this.$);break;case 43:this.$=t[s-1]+t[s];break;case 44:this.$=t[s];break;case 45:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 46:u.addLink(t[s-2].stmt,t[s],t[s-1]),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 47:u.addLink(t[s-3].stmt,t[s-1],t[s-2]),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 48:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 49:u.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 50:this.$={stmt:t[s],nodes:t[s]};break;case 51:this.$=[t[s]];break;case 52:u.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4]),this.$=t[s-5].concat(t[s]);break;case 53:this.$=t[s-4].concat(t[s]);break;case 54:this.$=t[s];break;case 55:this.$=t[s-2],u.setClass(t[s-2],t[s]);break;case 56:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"square");break;case 57:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"doublecircle");break;case 58:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"circle");break;case 59:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"ellipse");break;case 60:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"stadium");break;case 61:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"subroutine");break;case 62:this.$=t[s-7],u.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]]));break;case 63:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"cylinder");break;case 64:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"round");break;case 65:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"diamond");break;case 66:this.$=t[s-5],u.addVertex(t[s-5],t[s-2],"hexagon");break;case 67:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"odd");break;case 68:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"trapezoid");break;case 69:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"inv_trapezoid");break;case 70:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_right");break;case 71:this.$=t[s-3],u.addVertex(t[s-3],t[s-1],"lean_left");break;case 72:this.$=t[s],u.addVertex(t[s]);break;case 73:t[s-1].text=t[s],this.$=t[s-1];break;case 74:case 75:t[s-2].text=t[s-1],this.$=t[s-2];break;case 76:this.$=t[s];break;case 77:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1]};break;case 78:var v=u.destructLink(t[s],t[s-2]);this.$={type:v.type,stroke:v.stroke,length:v.length,text:t[s-1],id:t[s-3]};break;case 79:this.$={text:t[s],type:"text"};break;case 80:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 81:this.$={text:t[s],type:"string"};break;case 82:this.$={text:t[s],type:"markdown"};break;case 83:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length};break;case 84:var v=u.destructLink(t[s]);this.$={type:v.type,stroke:v.stroke,length:v.length,id:t[s-1]};break;case 85:this.$=t[s-1];break;case 86:this.$={text:t[s],type:"text"};break;case 87:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 88:this.$={text:t[s],type:"string"};break;case 89:case 104:this.$={text:t[s],type:"markdown"};break;case 101:this.$={text:t[s],type:"text"};break;case 102:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 103:this.$={text:t[s],type:"text"};break;case 105:this.$=t[s-4],u.addClass(t[s-2],t[s]);break;case 106:this.$=t[s-4],u.setClass(t[s-2],t[s]);break;case 107:case 115:this.$=t[s-1],u.setClickEvent(t[s-1],t[s]);break;case 108:case 116:this.$=t[s-3],u.setClickEvent(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 109:this.$=t[s-2],u.setClickEvent(t[s-2],t[s-1],t[s]);break;case 110:this.$=t[s-4],u.setClickEvent(t[s-4],t[s-3],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 111:this.$=t[s-2],u.setLink(t[s-2],t[s]);break;case 112:this.$=t[s-4],u.setLink(t[s-4],t[s-2]),u.setTooltip(t[s-4],t[s]);break;case 113:this.$=t[s-4],u.setLink(t[s-4],t[s-2],t[s]);break;case 114:this.$=t[s-6],u.setLink(t[s-6],t[s-4],t[s]),u.setTooltip(t[s-6],t[s-2]);break;case 117:this.$=t[s-1],u.setLink(t[s-1],t[s]);break;case 118:this.$=t[s-3],u.setLink(t[s-3],t[s-2]),u.setTooltip(t[s-3],t[s]);break;case 119:this.$=t[s-3],u.setLink(t[s-3],t[s-2],t[s]);break;case 120:this.$=t[s-5],u.setLink(t[s-5],t[s-4],t[s]),u.setTooltip(t[s-5],t[s-2]);break;case 121:this.$=t[s-4],u.addVertex(t[s-2],void 0,void 0,t[s]);break;case 122:this.$=t[s-4],u.updateLink([t[s-2]],t[s]);break;case 123:this.$=t[s-4],u.updateLink(t[s-2],t[s]);break;case 124:this.$=t[s-8],u.updateLinkInterpolate([t[s-6]],t[s-2]),u.updateLink([t[s-6]],t[s]);break;case 125:this.$=t[s-8],u.updateLinkInterpolate(t[s-6],t[s-2]),u.updateLink(t[s-6],t[s]);break;case 126:this.$=t[s-6],u.updateLinkInterpolate([t[s-4]],t[s]);break;case 127:this.$=t[s-6],u.updateLinkInterpolate(t[s-4],t[s]);break;case 128:case 130:this.$=[t[s]];break;case 129:case 131:t[s-2].push(t[s]),this.$=t[s-2];break;case 133:this.$=t[s-1]+t[s];break;case 181:this.$=t[s];break;case 182:this.$=t[s-1]+""+t[s];break;case 184:this.$=t[s-1]+""+t[s];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:i,10:r,12:a},{1:[3]},e(o,d,{5:6}),{4:7,9:i,10:r,12:a},{4:8,9:i,10:r,12:a},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:d1,15:54,18:57},e(T,[2,3]),e(T,[2,4]),e(T,[2,5]),e(T,[2,6]),e(T,[2,7]),e(T,[2,8]),{8:$,9:e1,11:t1,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:$,9:e1,11:t1,21:68},{8:$,9:e1,11:t1,21:69},{8:$,9:e1,11:t1,21:70},{8:$,9:e1,11:t1,21:71},{8:$,9:e1,11:t1,21:72},{8:$,9:e1,10:[1,73],11:t1,21:74},e(T,[2,36]),{35:[1,75]},{37:[1,76]},e(T,[2,39]),e(D1,[2,50],{18:77,39:78,10:d1,40:ae}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:E1,44:C1,60:T1,80:[1,87],89:S1,95:[1,84],97:[1,85],101:86,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},e(T,[2,185]),e(T,[2,186]),e(T,[2,187]),e(T,[2,188]),e(T,[2,189]),e(A1,[2,51]),e(A1,[2,54],{46:[1,100]}),e(U,[2,72],{113:113,29:[1,101],44:F,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:_,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(q,[2,181]),e(q,[2,142]),e(q,[2,143]),e(q,[2,144]),e(q,[2,145]),e(q,[2,146]),e(q,[2,147]),e(q,[2,148]),e(q,[2,149]),e(q,[2,150]),e(q,[2,151]),e(q,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(ne,[2,26],{18:115,10:d1}),e(T,[2,27]),{42:116,43:39,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(V1,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:ue,81:oe,116:j1,119:K1},{75:[1,126],77:[1,127]},e(le,[2,83]),e(T,[2,28]),e(T,[2,29]),e(T,[2,30]),e(T,[2,31]),e(T,[2,32]),{10:ce,12:he,14:de,27:pe,28:128,32:fe,44:ge,60:be,75:Ae,80:[1,130],81:[1,131],83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:129,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(X1,d,{5:154}),e(T,[2,37]),e(T,[2,38]),e(D1,[2,48],{44:Le}),e(D1,[2,49],{18:156,10:d1,40:Ve}),e(A1,[2,44]),{44:F,47:158,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{102:[1,159],103:160,105:[1,161]},{44:F,47:162,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{44:F,47:163,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(x,[2,115],{120:168,10:[1,167],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,117],{10:[1,169]}),e(H,[2,183]),e(H,[2,170]),e(H,[2,171]),e(H,[2,172]),e(H,[2,173]),e(H,[2,174]),e(H,[2,175]),e(H,[2,176]),e(H,[2,177]),e(H,[2,178]),e(H,[2,179]),e(H,[2,180]),{44:F,47:170,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{30:171,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:179,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:181,50:[1,180],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:182,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:183,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:184,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{109:[1,185]},{30:186,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:187,65:[1,188],67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:189,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:190,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{30:191,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(q,[2,182]),e(o,[2,20]),e(ne,[2,25]),e(D1,[2,46],{39:192,18:193,10:d1,40:ae}),e(V1,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{77:[1,197],79:198,116:j1,119:K1},e(I1,[2,79]),e(I1,[2,81]),e(I1,[2,82]),e(I1,[2,168]),e(I1,[2,169]),{76:199,79:121,80:ue,81:oe,116:j1,119:K1},e(le,[2,84]),{8:$,9:e1,10:ce,11:t1,12:he,14:de,21:201,27:pe,29:[1,200],32:fe,44:ge,60:be,75:Ae,83:141,84:ke,85:me,86:De,87:Ee,88:Ce,89:Te,90:Se,91:202,105:ye,109:xe,111:Fe,114:_e,115:Be,116:ve},e(S,[2,101]),e(S,[2,103]),e(S,[2,104]),e(S,[2,157]),e(S,[2,158]),e(S,[2,159]),e(S,[2,160]),e(S,[2,161]),e(S,[2,162]),e(S,[2,163]),e(S,[2,164]),e(S,[2,165]),e(S,[2,166]),e(S,[2,167]),e(S,[2,90]),e(S,[2,91]),e(S,[2,92]),e(S,[2,93]),e(S,[2,94]),e(S,[2,95]),e(S,[2,96]),e(S,[2,97]),e(S,[2,98]),e(S,[2,99]),e(S,[2,100]),{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,203],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:d1,18:204},{44:[1,205]},e(A1,[2,43]),{10:[1,206],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,207]},{10:[1,208],106:[1,209]},e(Ie,[2,128]),{10:[1,210],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{10:[1,211],44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:113,114:G,115:P,116:O},{80:[1,212]},e(x,[2,109],{10:[1,213]}),e(x,[2,111],{10:[1,214]}),{80:[1,215]},e(H,[2,184]),{80:[1,216],98:[1,217]},e(A1,[2,55],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),{31:[1,218],67:m,82:219,116:D,117:E,118:C},e(p1,[2,86]),e(p1,[2,88]),e(p1,[2,89]),e(p1,[2,153]),e(p1,[2,154]),e(p1,[2,155]),e(p1,[2,156]),{49:[1,220],67:m,82:219,116:D,117:E,118:C},{30:221,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{51:[1,222],67:m,82:219,116:D,117:E,118:C},{53:[1,223],67:m,82:219,116:D,117:E,118:C},{55:[1,224],67:m,82:219,116:D,117:E,118:C},{57:[1,225],67:m,82:219,116:D,117:E,118:C},{60:[1,226]},{64:[1,227],67:m,82:219,116:D,117:E,118:C},{66:[1,228],67:m,82:219,116:D,117:E,118:C},{30:229,67:m,80:z,81:W,82:172,116:D,117:E,118:C},{31:[1,230],67:m,82:219,116:D,117:E,118:C},{67:m,69:[1,231],71:[1,232],82:219,116:D,117:E,118:C},{67:m,69:[1,234],71:[1,233],82:219,116:D,117:E,118:C},e(D1,[2,45],{18:156,10:d1,40:Ve}),e(D1,[2,47],{44:Le}),e(V1,[2,75]),e(V1,[2,74]),{62:[1,235],67:m,82:219,116:D,117:E,118:C},e(V1,[2,77]),e(I1,[2,80]),{77:[1,236],79:198,116:j1,119:K1},{30:237,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(X1,d,{5:238}),e(S,[2,102]),e(T,[2,35]),{43:239,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},{10:d1,18:240},{10:s1,60:i1,84:r1,92:241,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:252,104:[1,253],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:254,104:[1,255],105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{105:[1,256]},{10:s1,60:i1,84:r1,92:257,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{44:F,47:258,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(x,[2,116]),e(x,[2,118],{10:[1,262]}),e(x,[2,119]),e(U,[2,56]),e(p1,[2,87]),e(U,[2,57]),{51:[1,263],67:m,82:219,116:D,117:E,118:C},e(U,[2,64]),e(U,[2,59]),e(U,[2,60]),e(U,[2,61]),{109:[1,264]},e(U,[2,63]),e(U,[2,65]),{66:[1,265],67:m,82:219,116:D,117:E,118:C},e(U,[2,67]),e(U,[2,68]),e(U,[2,70]),e(U,[2,69]),e(U,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(V1,[2,78]),{31:[1,266],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,267],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},e(A1,[2,53]),{43:268,44:F,45:40,47:41,60:_,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O},e(x,[2,121],{106:w1}),e(we,[2,130],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(J,[2,132]),e(J,[2,134]),e(J,[2,135]),e(J,[2,136]),e(J,[2,137]),e(J,[2,138]),e(J,[2,139]),e(J,[2,140]),e(J,[2,141]),e(x,[2,122],{106:w1}),{10:[1,271]},e(x,[2,123],{106:w1}),{10:[1,272]},e(Ie,[2,129]),e(x,[2,105],{106:w1}),e(x,[2,106],{113:113,44:F,60:_,89:L,102:V,105:I,106:w,109:R,111:N,114:G,115:P,116:O}),e(x,[2,110]),e(x,[2,112],{10:[1,273]}),e(x,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:$,9:e1,11:t1,21:278},e(T,[2,34]),e(A1,[2,52]),{10:s1,60:i1,84:r1,105:a1,107:279,108:243,109:n1,110:u1,111:o1,112:l1},e(J,[2,133]),{14:E1,44:C1,60:T1,89:S1,101:280,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{14:E1,44:C1,60:T1,89:S1,101:281,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1,120:88},{98:[1,282]},e(x,[2,120]),e(U,[2,58]),{30:283,67:m,80:z,81:W,82:172,116:D,117:E,118:C},e(U,[2,66]),e(X1,d,{5:284}),e(we,[2,131],{108:270,10:s1,60:i1,84:r1,105:a1,109:n1,110:u1,111:o1,112:l1}),e(x,[2,126],{120:168,10:[1,285],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,127],{120:168,10:[1,286],14:E1,44:C1,60:T1,89:S1,105:y1,106:x1,109:F1,111:_1,114:B1,115:v1,116:L1}),e(x,[2,114]),{31:[1,287],67:m,82:219,116:D,117:E,118:C},{6:11,7:12,8:l,9:A,10:n,11:g,20:17,22:18,23:19,24:20,25:21,26:22,27:B,32:[1,288],33:24,34:f,36:k,38:Y,42:28,43:39,44:F,45:40,47:41,60:_,84:b1,85:N1,86:j,87:h1,88:P1,89:L,102:V,105:I,106:w,109:R,111:N,113:42,114:G,115:P,116:O,121:O1,122:M1,123:U1,124:z1,125:W1},{10:s1,60:i1,84:r1,92:289,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},{10:s1,60:i1,84:r1,92:290,105:a1,107:242,108:243,109:n1,110:u1,111:o1,112:l1},e(U,[2,62]),e(T,[2,33]),e(x,[2,124],{106:w1}),e(x,[2,125],{106:w1})],defaultActions:{},parseError:b(function(c,h){if(h.recoverable)this.trace(c);else{var p=new Error(c);throw p.hash=h,p}},"parseError"),parse:b(function(c){var h=this,p=[0],u=[],y=[null],t=[],G1=this.table,s="",v=0,Re=0,je=2,Ne=1,Ke=t.slice.call(arguments,1),M=Object.create(this.lexer),k1={yy:{}};for(var Z1 in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z1)&&(k1.yy[Z1]=this.yy[Z1]);M.setInput(c,k1.yy),k1.yy.lexer=M,k1.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var J1=M.yylloc;t.push(J1);var Ye=M.options&&M.options.ranges;typeof k1.yy.parseError=="function"?this.parseError=k1.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function qe(X){p.length=p.length-2*X,y.length=y.length-X,t.length=t.length-X}b(qe,"popStack");function Ge(){var X;return X=u.pop()||M.lex()||Ne,typeof X!="number"&&(X instanceof Array&&(u=X,X=u.pop()),X=h.symbols_[X]||X),X}b(Ge,"lex");for(var K,m1,Q,$1,R1={},q1,c1,Pe,H1;;){if(m1=p[p.length-1],this.defaultActions[m1]?Q=this.defaultActions[m1]:((K===null||typeof K>"u")&&(K=Ge()),Q=G1[m1]&&G1[m1][K]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";H1=[];for(q1 in G1[m1])this.terminals_[q1]&&q1>je&&H1.push("'"+this.terminals_[q1]+"'");M.showPosition?ee="Parse error on line "+(v+1)+`: `+M.showPosition()+` -Expecting `+H1.join(", ")+", got '"+(this.terminals_[K]||K)+"'":ee="Parse error on line "+(v+1)+": Unexpected "+(K==Ne?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[K]||K,line:M.yylineno,loc:Z1,expected:H1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m1+", token: "+K);switch(Q[0]){case 1:p.push(K),y.push(M.yytext),t.push(M.yylloc),p.push(Q[1]),K=null,Re=M.yyleng,s=M.yytext,v=M.yylineno,Z1=M.yylloc;break;case 2:if(c1=this.productions_[Q[1]][1],R1.$=y[y.length-c1],R1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},Ye&&(R1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(R1,[s,Re,v,k1.yy,Q[1],y,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),y=y.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[Q[1]][0]),y.push(R1.$),t.push(R1._$),Pe=G1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},We=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +Expecting `+H1.join(", ")+", got '"+(this.terminals_[K]||K)+"'":ee="Parse error on line "+(v+1)+": Unexpected "+(K==Ne?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(ee,{text:M.match,token:this.terminals_[K]||K,line:M.yylineno,loc:J1,expected:H1})}if(Q[0]instanceof Array&&Q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m1+", token: "+K);switch(Q[0]){case 1:p.push(K),y.push(M.yytext),t.push(M.yylloc),p.push(Q[1]),K=null,Re=M.yyleng,s=M.yytext,v=M.yylineno,J1=M.yylloc;break;case 2:if(c1=this.productions_[Q[1]][1],R1.$=y[y.length-c1],R1._$={first_line:t[t.length-(c1||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(c1||1)].first_column,last_column:t[t.length-1].last_column},Ye&&(R1._$.range=[t[t.length-(c1||1)].range[0],t[t.length-1].range[1]]),$1=this.performAction.apply(R1,[s,Re,v,k1.yy,Q[1],y,t].concat(Ke)),typeof $1<"u")return $1;c1&&(p=p.slice(0,-1*c1*2),y=y.slice(0,-1*c1),t=t.slice(0,-1*c1)),p.push(this.productions_[Q[1]][0]),y.push(R1.$),t.push(R1._$),Pe=G1[p[p.length-2]][p[p.length-1]],p.push(Pe);break;case 3:return!0}}return!0},"parse")},We=(function(){var f1={EOF:1,parseError:b(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:b(function(c,h){return this.yy=h||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var h=c.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:b(function(c){var h=c.length,p=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===u.length?this.yylloc.first_column:0)+u[u.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(c){this.unput(this.match.slice(c))},"less"),pastInput:b(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var c=this.pastInput(),h=new Array(c.length+1).join("-");return c+this.upcomingInput()+` `+h+"^"},"showPosition"),test_match:b(function(c,h){var p,u,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],p=this.performAction.call(this,this.yy,this,h,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),p)return p;if(this._backtrack){for(var t in y)this[t]=y[t];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,h,p,u;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;th[0].length)){if(h=p,u=t,this.options.backtrack_lexer){if(c=this.test_match(p,y[t]),c!==!1)return c;if(this._backtrack){h=!1;continue}else return!1}else if(!this.options.flex)break}return h?(c=this.test_match(h,y[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var h=this.next();return h||this.lex()},"lex"),begin:b(function(h){this.conditionStack.push(h)},"begin"),popState:b(function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},"topState"),pushState:b(function(h){this.begin(h)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(h,p,u,y){switch(u){case 0:return this.begin("acc_title"),34;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),36;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),p.yytext="",40;case 8:return this.pushState("shapeDataStr"),40;case 9:return this.popState(),40;case 10:const t=/\n\s*/g;return p.yytext=p.yytext.replace(t,"
"),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:return h.lex.firstGraph()&&this.begin("dir"),12;case 36:return h.lex.firstGraph()&&this.begin("dir"),12;case 37:return h.lex.firstGraph()&&this.begin("dir"),12;case 38:return h.lex.firstGraph()&&this.begin("dir"),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState("edgeText"),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState("thickEdgeText"),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState("dottedEdgeText"),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;case 83:return this.popState(),55;case 84:return this.pushState("text"),54;case 85:return this.popState(),57;case 86:return this.pushState("text"),56;case 87:return 58;case 88:return this.pushState("text"),67;case 89:return this.popState(),64;case 90:return this.pushState("text"),63;case 91:return this.popState(),49;case 92:return this.pushState("text"),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState("trapText"),68;case 97:return this.pushState("trapText"),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState("text"),62;case 111:return this.popState(),51;case 112:return this.pushState("text"),50;case 113:return this.popState(),31;case 114:return this.pushState("text"),29;case 115:return this.popState(),66;case 116:return this.pushState("text"),65;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return f1})();Q1.lexer=We;function Y1(){this.yy={}}return b(Y1,"Parser"),Y1.prototype=Q1,Q1.Parser=Y1,new Y1})();re.parser=re;var Me=re,Ue=Object.assign({},Me);Ue.parse=e=>{const i=e.replace(/}\s*\n/g,`} @@ -153,4 +153,4 @@ Expecting `+H1.join(", ")+", got '"+(this.terminals_[K]||K)+"'":ee="Parse error text-align: center; } ${He()} -`,"getStyles"),St=Tt,ze=b(({defaultLayout:e,styles:i=St}={})=>({parser:Et,get db(){return new At},renderer:Dt,styles:i,init:b(r=>{r.flowchart||(r.flowchart={});const a=Je().layout??e??r.layout;a&&Oe({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),yt=ze();const Vt=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:ze,diagram:yt},Symbol.toStringTag,{value:"Module"}));export{ze as c,Vt as f,St as s}; +`,"getStyles"),St=Tt,ze=b(({defaultLayout:e,styles:i=St}={})=>({parser:Et,get db(){return new At},renderer:Dt,styles:i,init:b(r=>{r.flowchart||(r.flowchart={});const a=Ze().layout??e??r.layout;a&&Oe({layout:a}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,Oe({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),yt=ze();const Vt=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:ze,diagram:yt},Symbol.toStringTag,{value:"Module"}));export{ze as c,Vt as f,St as s}; diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CUHNm3Ux.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BGBEep7_.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CUHNm3Ux.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BGBEep7_.js index 67c3af36b..18d722941 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-CUHNm3Ux.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BGBEep7_.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-Ci_ShHqV.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-BWo84Eox.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-ClWTW3HX.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,p as Vn,o as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,q as Gn,y as jn}from"./mermaid.core-cXaFT3ek.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DFIFDLPn.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-BdL5hCoZ.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CyA9YMJV.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-BrwVOQv1.js similarity index 95% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CyA9YMJV.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-BrwVOQv1.js index a60067f17..31cf7cded 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CyA9YMJV.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-BrwVOQv1.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-DzO9Jhzo.js";import{p as he}from"./chunk-JWPE2WC7-DvJ2Uoqv.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-Ci_ShHqV.js";import{p as Ee}from"./cynefin-VYW2F7L2-tAACGi5e.js";import"./index-ClWTW3HX.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-BGw8VEOT.js";import{p as he}from"./chunk-JWPE2WC7-DYhWNXPR.js";import{p as $e,o as fe,s as ge,g as ue,a as ye,b as xe,_ as h,z as J,l as w,d as me,c as W,y as pe,A as be,q as we,k as B,B as ke,D as ve,E as Ce}from"./mermaid.core-cXaFT3ek.js";import{p as Ee}from"./cynefin-VYW2F7L2-BRNWksTk.js";import"./index-BdL5hCoZ.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),qe=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),We=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:qe,getDirection:Pe,getHead:We,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,q=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),q.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=W(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} @@ -10,8 +10,8 @@ import{I as le}from"./chunk-2Q5K7J3B-DzO9Jhzo.js";import{p as he}from"./chunk-JW ${t.x+O},${u-c-2} ${t.x+O+i+4},${u-c-2} ${t.x+O+i+4},${u+c+2} - ${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),W=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return W(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=q(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` -`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;P=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,P,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,P),re(l,P,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(W().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.xf.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seql(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=W(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.ya.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.xa.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.ya.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=W(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+` +`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;q=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=W(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,q,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,q),re(l,q,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;ai.map(i=>d[i]); -import{bR as c}from"./index-ClWTW3HX.js";var Ft=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,to=Object.getOwnPropertyNames,no=Object.prototype.hasOwnProperty,an=(e,t)=>{let n={};for(var r in e)Ft(n,r,{get:e[r],enumerable:!0});return Ft(n,Symbol.toStringTag,{value:"Module"}),n},ro=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=to(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=eo(t,a))||r.enumerable});return e},Sr=(e,t,n)=>(ro(e,t,"default"),n);const Ne=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>c(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],at=Object.fromEntries(Ne.map(e=>[e.id,e.import])),lt=Object.fromEntries(Ne.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ut={...at,...lt},ct=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],dt=Object.fromEntries(ct.map(e=>[e.id,e.import]));var ln=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function io(){return 2147483648}function oo(){return typeof performance<"u"?performance.now():Date.now()}const so=(e,t)=>e+(t-e%t)%t;async function ao(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=io();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const y=Math.min(E,so(Math.max(h,g),65536));if(s(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let y="";for(;m>10,56320|I&1023)}}return y}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:oo,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>uo(e,typeof t!="symbol"?t+"":t,n);let D=null;function co(e){throw new ln(e.UTF8ToString(e.getLastOnigError()))}class pt{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=pt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ht=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new ln("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new pt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(ht,"LAST_ID",0);P(ht,"_sharedPtr",0);P(ht,"_sharedPtrInUse",!1);let Lr=ht;class po{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new ln("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),ho(r)?r=await r.instantiator(n):fo(r)?r=await r.default(n):(mo(r)&&(r=r.data),go(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await yo(r)(n):r=await Eo(r)(n):_o(r)?r=await Lt(r)(n):r instanceof WebAssembly.Module?r=await Lt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Lt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fe=t(),Fe}function Lt(e){return t=>WebAssembly.instantiate(e,t)}function yo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Eo(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Rr;function bo(e){Rr=e}function wo(){return Rr}async function un(e){return e&&await ft(e),{createScanner(t){return new po(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Lr(t)}}}const vo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:un,getDefaultWasmLoader:wo,loadWasm:ft,setDefaultWasmLoader:bo},Symbol.toStringTag,{value:"Module"}));var Ir=an({});Sr(Ir,vo);var L=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Co(e){return cn(e)}function cn(e){return Array.isArray(e)?Ao(e):e instanceof RegExp?e:typeof e=="object"?ko(e):e}function Ao(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function Pr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Pr(e.substring(0,e.length-1)):e.substr(~t+1)}var Rt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,je=class{static hasCaptures(e){return e===null?!1:(Rt.lastIndex=0,Rt.test(e))}static replaceCaptures(e,t,n){return e.replace(Rt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Or(e,t){return et?1:0}function xr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>So(e.parent,i.parentScopes));return r?new Vr(r.fontStyle,r.foreground,r.background):null}},It=class Ke{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ke(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Lo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Vr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ro(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Io(E,b,i,l,u,p)}}return n}var Io=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function To(e,t){e.sort((l,u)=>{let p=Or(l.scope,u.scope);return p!==0||(p=xr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Po(t),s=new Vr(n,o.getId(r),o.getId(i)),a=new xo(new jt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xo=class Ht{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ht._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Ht(this._mainRule.clone(),jt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ze(e,t){const n=[],r=Do(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Mn(i)){const l=[];do l.push(i),i=r.next();while(Mn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function Mn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Do(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Mr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$o=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Vo;for(const n of e)Mo(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Mo(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Qe({baseGrammar:o,selfGrammar:i},r):Wt(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function Wt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];et([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&et(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&et(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function et(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Tr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&et(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Gr(o);switch(s.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Wt(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Wt(s.ruleName,l,n):Qe(l,n)}else s.kind===4?n.add(new No(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Go=class{kind=0},Bo=class{kind=1},Uo=class{constructor(e){this.ruleName=e}kind=2},Fo=class{constructor(e){this.scopeName=e}kind=3},jo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gr(e){if(e==="$base")return new Go;if(e==="$self")return new Bo;const t=e.indexOf("#");if(t===-1)return new Fo(e);if(t===0)return new Uo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new jo(n,r)}}var Ho=/\\(\d+)/,Gn=/\\(\d+)/g,Wo=-1,Br=-2;var Ve=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=je.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=je.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Pr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:je.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:je.replaceCaptures(this._contentName,e,t)}},zo=class extends Ve{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},qo=class extends Ve{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bn=class extends Ve{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zt=class extends Ve{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tt=class extends Ve{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Br),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ur=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new zo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new qo(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Tr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Bn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new tt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new zt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Gn.lastIndex=0,this.source.replace(Gn,(i,o)=>Dr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new Un(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Un(e,r,this._items.map(i=>i.ruleId))}},Un=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{let n={};for(var r in e)Ft(n,r,{get:e[r],enumerable:!0});return Ft(n,Symbol.toStringTag,{value:"Module"}),n},ro=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=to(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=eo(t,a))||r.enumerable});return e},Sr=(e,t,n)=>(ro(e,t,"default"),n);const Ne=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>c(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>c(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[]))}],at=Object.fromEntries(Ne.map(e=>[e.id,e.import])),lt=Object.fromEntries(Ne.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ut={...at,...lt},ct=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>c(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],dt=Object.fromEntries(ct.map(e=>[e.id,e.import]));var ln=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function io(){return 2147483648}function oo(){return typeof performance<"u"?performance.now():Date.now()}const so=(e,t)=>e+(t-e%t)%t;async function ao(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,E){r.HEAPU8.copyWithin(h,m,m+E)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const E=io();if(h>E)return!1;for(let b=1;b<=4;b*=2){let g=m*(1+.2/b);g=Math.min(g,h+100663296);const y=Math.min(E,so(Math.max(h,g),65536));if(s(y))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,E=1024){const b=m+E;let g=m;for(;h[g]&&!(g>=b);)++g;if(g-m>16&&h.buffer&&l)return l.decode(h.subarray(m,g));let y="";for(;m>10,56320|I&1023)}}return y}function p(h,m){return h?u(r.HEAPU8,h,m):""}const d={emscripten_get_now:oo,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:d,wasi_snapshot_preview1:d});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=p}return await f(),r}var lo=Object.defineProperty,uo=(e,t,n)=>t in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>uo(e,typeof t!="symbol"?t+"":t,n);let D=null;function co(e){throw new ln(e.UTF8ToString(e.getLastOnigError()))}class pt{constructor(t){P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16Value"),P(this,"utf8Value"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16");const n=t.length,r=pt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&p<=56319&&u+1=56320&&h<=57343&&(d=(p-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ht=class X{constructor(t){if(P(this,"id",++X.LAST_ID),P(this,"_onigBinding"),P(this,"content"),P(this,"utf16Length"),P(this,"utf8Length"),P(this,"utf16OffsetToUtf8"),P(this,"utf8OffsetToUtf16"),P(this,"ptr"),!D)throw new ln("Must invoke loadWasm first.");this._onigBinding=D,this.content=t;const n=new pt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!X._sharedPtrInUse?(X._sharedPtr||(X._sharedPtr=D.omalloc(1e4)),X._sharedPtrInUse=!0,D.HEAPU8.set(n.utf8Value,X._sharedPtr),this.ptr=X._sharedPtr):this.ptr=n.createString(D)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===X._sharedPtr?X._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};P(ht,"LAST_ID",0);P(ht,"_sharedPtr",0);P(ht,"_sharedPtrInUse",!1);let Lr=ht;class po{constructor(t){if(P(this,"_onigBinding"),P(this,"_ptr"),!D)throw new ln("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),ho(r)?r=await r.instantiator(n):fo(r)?r=await r.default(n):(mo(r)&&(r=r.data),go(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await yo(r)(n):r=await Eo(r)(n):_o(r)?r=await Lt(r)(n):r instanceof WebAssembly.Module?r=await Lt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Lt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fe=t(),Fe}function Lt(e){return t=>WebAssembly.instantiate(e,t)}function yo(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Eo(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Rr;function bo(e){Rr=e}function wo(){return Rr}async function un(e){return e&&await ft(e),{createScanner(t){return new po(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Lr(t)}}}const vo=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:un,getDefaultWasmLoader:wo,loadWasm:ft,setDefaultWasmLoader:bo},Symbol.toStringTag,{value:"Module"}));var Ir=an({});Sr(Ir,vo);var L=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Co(e){return cn(e)}function cn(e){return Array.isArray(e)?Ao(e):e instanceof RegExp?e:typeof e=="object"?ko(e):e}function Ao(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function Pr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Pr(e.substring(0,e.length-1)):e.substr(~t+1)}var Rt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,je=class{static hasCaptures(e){return e===null?!1:(Rt.lastIndex=0,Rt.test(e))}static replaceCaptures(e,t,n){return e.replace(Rt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Or(e,t){return et?1:0}function xr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>So(e.parent,i.parentScopes));return r?new Vr(r.fontStyle,r.foreground,r.background):null}},It=class Ke{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Ke(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Lo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Lo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Vr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ro(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Io(E,b,i,l,u,p)}}return n}var Io=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},$=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))($||{});function To(e,t){e.sort((l,u)=>{let p=Or(l.scope,u.scope);return p!==0||(p=xr(l.parentScopes,u.parentScopes),p!==0)?p:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Po(t),s=new Vr(n,o.getId(r),o.getId(i)),a=new xo(new jt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},xo=class Ht{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ht._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let p;this._children.hasOwnProperty(l)?p=this._children[l]:(p=new Ht(this._mainRule.clone(),jt.cloneArr(this._rulesWithParentScopes)),this._children[l]=p),p.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),p=U.containsBalancedBrackets(t)?1:0,d=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(p=i?1:0),o!==-1&&(d=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|p<<10|d<<11|f<<15|h<<24)>>>0}};function Ze(e,t){const n=[],r=Do(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Mn(i)){const l=[];do l.push(i),i=r.next();while(Mn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return p=>l.every(d=>d(p))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return p=>l.some(d=>d(p))}}function Mn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Do(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Mr(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},No=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},$o=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Vo;for(const n of e)Mo(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Mo(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Qe({baseGrammar:o,selfGrammar:i},r):Wt(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Se(a))}function Wt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];et([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&et(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&et(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function et(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Tr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&et(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Gr(o);switch(s.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Wt(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Wt(s.ruleName,l,n):Qe(l,n)}else s.kind===4?n.add(new No(s.scopeName,s.ruleName)):n.add(new Se(s.scopeName));break}}}var Go=class{kind=0},Bo=class{kind=1},Uo=class{constructor(e){this.ruleName=e}kind=2},Fo=class{constructor(e){this.scopeName=e}kind=3},jo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Gr(e){if(e==="$base")return new Go;if(e==="$self")return new Bo;const t=e.indexOf("#");if(t===-1)return new Fo(e);if(t===0)return new Uo(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new jo(n,r)}}var Ho=/\\(\d+)/,Gn=/\\(\d+)/g,Wo=-1,Br=-2;var Ve=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=je.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=je.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Pr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:je.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:je.replaceCaptures(this._contentName,e,t)}},zo=class extends Ve{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},qo=class extends Ve{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Le(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bn=class extends Ve{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zt=class extends Ve{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this._end=new Le(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},tt=class extends Ve{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Le(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Le(s,Br),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Ur=class V{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new zo(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new qo(t.$vscodeTextmateLocation,t.id,t.name,t.match,V._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Tr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Bn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,V._compilePatterns(o,n,r))}return t.while?new tt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,V._compileCaptures(t.whileCaptures||t.captures,n,r),V._compilePatterns(t.patterns,n,r)):new zt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,V._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,V._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,V._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=V.getCompiledRuleId(t[s],n,r)),i[a]=V.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Gn.lastIndex=0,this.source.replace(Gn,(i,o)=>Dr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new Un(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new Un(e,r,this._items.map(i=>i.ruleId))}},Un=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Tt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(qt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ko=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Dr(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Fn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function jr(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,p=-1;if(s){const h=Qo(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,p=h.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Fn(i,!0);f()}return new Fn(i,!1);function f(){const h=Jo(e,t,n,r,i,p);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,E=h.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(E===Wo){const g=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ce(e,t,n,i,o,g.endCaptures,m),o.produce(i,m[0].end);const y=i;if(i=i.parent,p=y.getAnchorPos(),!b&&y.getEnterPos()===r){i=y,o.produce(i,l),u=!0;return}}else{const g=e.getRule(E);o.produce(i,m[0].start);const y=i,w=g.getName(t.content,m),A=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(E,r,p,m[0].end===l,null,A,A),g instanceof zt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(t.content,m))),!b&&y.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(g instanceof tt){const k=g;Ce(e,t,n,i,o,k.beginCaptures,m),o.produce(i,m[0].end),p=m[0].end;const I=k.getContentName(t.content,m),M=A.pushAttributed(I,e);if(i=i.withContentNameScopesList(M),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(t.content,m))),!b&&y.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ce(e,t,n,i,o,g.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function Qo(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof tt&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:p}=es(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,p);if(d){if(d.ruleId!==Br){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(o.produce(l.stack,d.captureIndices[0].start),Ce(e,t,n,l.stack,o,l.rule.whileCaptures,d.captureIndices),o.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function Jo(e,t,n,r,i,o){const s=Yo(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=Zo(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,p=l.captureIndices[0].start;return p=a)&&(a=w,l=y.captureIndices,u=y.ruleId,p=m.priority,a===i))break}return l?{priorityMatch:p===-1,captureIndices:l,matchedRuleId:u}:null}function Hr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function es(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ce(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],p=s[0].end;for(let d=0;dp)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const E=f.getName(a,s),b=r.contentNameScopesList.pushAttributed(E,e),g=f.getContentName(a,s),y=b.pushAttributed(g,e),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,y),A=e.createOnigString(a.substring(0,h.end));jr(e,A,n&&h.start===0,h.start,w,i,!1,0),Mr(A);continue}const m=f.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new ts(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var ts=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ns(e,t,n,r,i,o,s,a){return new is(e,t,n,r,i,o,s,a)}function jn(e,t,n,r,i){const o=Ze(t,nt),s=Ur.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function nt(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var is=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Xo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Hn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=Ze(l,nt);for(const p of u)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)jn(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&jn(t,l,a,this,a)}})}return t.sort((i,o)=>i.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Hn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ur.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Xt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),d=le.set(0,u.languageId,u.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Ae.createRootAndLookUpScopeName(f,d,this):h=Ae.createRoot("unknown",d),t=new Xt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` `;const o=this.createOnigString(e),s=o.content.length,a=new ss(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=jr(this,o,i,0,t,a,!0,r);return Mr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Hn(e,t){return e=Co(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ae=class K{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=It.push(i,o.scopeNames),r=new K(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new K(null,new It(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new It(null,t),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(n,i,s);return new K(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return K.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),le.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return K._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=K._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=K.mergeAttributes(t.tokenAttributes,i,s);return new K(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Xt=class ie{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new ie(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ie._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ae.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ie._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new ie(this,t,n,r,i,o,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ie(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Ae.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ie(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ae.fromExtension(r,n.contentNameScopesList))}},os=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ze(n,nt).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ze(n,nt).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ss=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=le.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=le.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Kt=Xt.NULL;function Ie(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function ee(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Wr(e){return Array.isArray(e)?e:[e]}async function dn(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function $e(e){return!e||["plaintext","txt","text","plain"].includes(e)}function pn(e){return e==="ansi"||$e(e)}function Me(e){return e==="none"}function hn(e){return Me(e)}const us=/(\r?\n)/g;function Ge(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(us);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Wn.light:Wn.dark),n||(n=t.type==="light"?zn.light:zn.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const p={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,p.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,p.settings.background=d}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,qn,{enumerable:!1,writable:!1,value:!0}),t}async function zr(e){return[...new Set((await Promise.all(e.filter(t=>!pn(t)).map(async t=>await dn(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function qr(e){return(await Promise.all(e.map(async t=>hn(t)?null:mt(await dn(t))))).filter(t=>!!t)}function Xr(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new L(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var cs=class extends ls{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=mt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ye.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Xr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new L(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},ds=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let ve=0;function gt(e){ve+=1,e.warnings!==!1&&ve>=10&&ve%10===0&&console.warn(`[Shiki] ${ve} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new L("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(mt),i=new cs(new ds(e.engine,n),r,n,e.langAlias);let o;function s(y){return Xr(y,e.langAlias)}function a(y){b();const w=i.getGrammar(typeof y=="string"?y:y.name);if(!w)throw new L(`Language \`${y}\` not found, you may need to load it first`);return w}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const w=i.getTheme(y);if(!w)throw new L(`Theme \`${y}\` not found, you may need to load it first`);return w}function u(y){b();const w=l(y);return o!==y&&(i.setTheme(w),o=y),{theme:w,colorMap:i.getColorMap()}}function p(){return b(),i.getLoadedThemes()}function d(){return b(),i.getLoadedLanguages()}function f(...y){b(),i.loadLanguages(y.flat(1))}async function h(...y){return f(await zr(y))}function m(...y){b();for(const w of y.flat(1))i.loadTheme(w)}async function E(...y){return b(),m(await qr(y))}function b(){if(t)throw new L("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),ve-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:E,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}const ps=gt;async function fn(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([qr(e.themes||[]),zr(e.langs||[]),e.engine]);return gt({...e,themes:t,langs:n,engine:r})}const hs=fn,Kr=new WeakMap;function _t(e,t){Kr.set(e,t)}function Te(e){return Kr.get(e)}var yt=class Qr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Qr(Object.fromEntries(Wr(n).map(r=>[r,Kt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return fs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fs(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function ms(e,t){if(!(e instanceof yt))throw new L("Invalid grammar state");return e.getInternalStack(t)}const gs=/,/,_s=/ /;function Jr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if($e(e.resolveLangAlias(n.lang||"text"))||Me(r))return Ge(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Zr(t,s,i,o,n)}function Yr(...e){if(e.length===2)return Te(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if($e(i)||Me(o))throw new L("Plain language does not have grammar state");if(i==="ansi")throw new L("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new yt(mn(n,l,s,a,r).stateStack,l.name,s.name)}function Zr(e,t,n,r,i){const o=mn(e,t,n,r,i),s=new yt(o.stateStack,t.name,n.name);return _t(o.tokens,s),o.tokens}function mn(e,t,n,r,i){const o=Ie(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Ge(e);let p=i.grammarState?ms(i.grammarState,n.name)??Kt:i.grammarContextCode!=null?mn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Kt,d=[];const f=[];for(let h=0,m=u.length;h0&&E.length>=s){d=[],f.push([{content:E,offset:b,color:"",fontStyle:0}]);continue}let g,y,w;l&&l!=="tokenType"&&(g=t.tokenizeLine(E,p,a),y=g.tokens,w=0);const A=t.tokenizeLine2(E,p,a),k=A.tokens.length/2;for(let I=0;ISt.trim());break;case"object":he=Q.scope;break;default:continue}Nn.push({settings:Q,selectors:he.map(St=>St.split(_s))})}q.explanation=[];let Vn=0;for(;M+Vn({scopeName:t}))}function Es(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)Xn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function ws(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(bs(s,t,n)){r.push(o);break}return r}function gn(e,t,n,r=Jr){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const p=r(e,t,{...n,theme:u.theme});return{tokens:p,state:Te(p),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=vs(...o.map(u=>u.tokens)),a=s[0].map((u,p)=>u.map((d,f)=>{const h={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=d.explanation),s.forEach((m,E)=>{const{content:b,explanation:g,offset:y,...w}=m[p][f];h.variants[i[E].color]=w}),h})),l=o[0].state?new yt(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&_t(a,l),a}function vs(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u4&&n.slice(0,4)==="data"&&Rs.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Qn,Ps);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Qn.test(o)){let s=o.replace(Ls,Ts);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=_n}return new i(r,t)}function Ts(e){return"-"+e.toLowerCase()}function Ps(e){return e.charAt(1).toUpperCase()}const Os=ei([ti,ks,ii,oi,si],"html"),ai=ei([ti,Ss,ii,oi,si],"svg"),Jn={}.hasOwnProperty;function xs(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&Jn.call(i,e)){const l=String(i[e]);s=Jn.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ds=/["&'<>`]/g,Ns=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Vs=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,$s=/[|\\{}()[\]^$+*?.]/g,Yn=new WeakMap;function Ms(e,t){if(e=e.replace(t.subset?Gs(t.subset):Ds,r),t.subset||t.escapeOnly)return e;return e.replace(Ns,n).replace(Vs,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function Gs(e){let t=Yn.get(e);return t||(t=Bs(e),Yn.set(e,t)),t}function Bs(e){const t=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},zs=["cent","copy","divide","gt","lt","not","para","times"],li={}.hasOwnProperty,Zt={};let He;for(He in Ot)li.call(Ot,He)&&(Zt[Ot[He]]=He);const qs=/[^\dA-Za-z]/;function Xs(e,t,n,r){const i=String.fromCharCode(e);if(li.call(Zt,i)){const o=Zt[i],s="&"+o;return n&&Ws.includes(o)&&!zs.includes(o)&&(!r||t&&t!==61&&qs.test(String.fromCharCode(t)))?s:s+";"}return""}function Ks(e,t,n){let r=Fs(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Xs(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Hs(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],Ys=["<",">"];function Zs(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return ye(o,Object.assign({},r.settings.characterReferences,{subset:Ys}))}}function ea(e,t,n,r){return""}function Zn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ta(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function na(e){return e.join(" ").trim()}const ra=/[ \t\n\f\r]/g;function yn(e){return typeof e=="object"?e.type==="text"?er(e.value):!1:er(e)}function er(e){return e.replace(ra,"")===""}const x=ci(1),ui=ci(-1),ia=[];function ci(e){return t;function t(n,r,i){const o=n?n.children:ia;let s=(r||0)+e,a=o[s];if(!i)for(;a&&yn(a);)s+=e,a=o[s];return a}}const oa={}.hasOwnProperty;function di(e){return t;function t(n,r,i){return oa.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const En=di({body:aa,caption:xt,colgroup:xt,dd:da,dt:ca,head:xt,html:sa,li:ua,optgroup:pa,option:ha,p:la,rp:tr,rt:tr,tbody:ma,td:nr,tfoot:ga,th:nr,thead:fa,tr:_a});function xt(e,t,n){const r=x(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&yn(r.value.charAt(0)))}function sa(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function aa(e,t,n){const r=x(n,t);return!r||r.type!=="comment"}function la(e,t,n){const r=x(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ua(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="li"}function ca(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function da(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tr(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function pa(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function ha(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function fa(e,t,n){const r=x(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ma(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function ga(e,t,n){return!x(n,t)}function _a(e,t,n){const r=x(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function nr(e,t,n){const r=x(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ya=di({body:wa,colgroup:va,head:ba,html:Ea,tbody:Ca});function Ea(e){const t=x(e,-1);return!t||t.type!=="comment"}function ba(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function wa(e){const t=x(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&yn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function va(e,t,n){const r=ui(n,t),i=x(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&En(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Ca(e,t,n){const r=ui(n,t),i=x(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&En(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const We={name:[[` \f\r &/=>`.split(""),` diff --git a/apps/kimi-code/dist-web/assets/index-D45vn5vH.js b/apps/kimi-code/dist-web/assets/index-BI9FmIbE.js similarity index 99% rename from apps/kimi-code/dist-web/assets/index-D45vn5vH.js rename to apps/kimi-code/dist-web/assets/index-BI9FmIbE.js index 80307a10b..09402b1d2 100644 --- a/apps/kimi-code/dist-web/assets/index-D45vn5vH.js +++ b/apps/kimi-code/dist-web/assets/index-BI9FmIbE.js @@ -1,4 +1,4 @@ -import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index-DqMCllSR.js";import{f as Ld}from"./index-DqMCllSR.js";import{bR as k}from"./index-ClWTW3HX.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` +import{t as pe,b as Ln,n as Or,c as Nr,a as Fr,d as zr,s as Ur,g as Vr,e as Br}from"./index--eupTVfk.js";import{f as Ld}from"./index--eupTVfk.js";import{bR as k}from"./index-BdL5hCoZ.js";const Ei="diffs-container",$r=(()=>{try{return!1}catch{return!1}})(),Wr=/(?=^From [a-f0-9]+ .+$)/m,Ti=/(?=^diff --git)/gm,Ul=/(?=^---\s+\S)/gm,Vl=/(?=^@@ )/gm,Gr=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,jr=/(?<=\n)/,qr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kr=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Yr=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Xr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Bl=/^<{7,}(?:\s.*)?$/,$l=/^\|{7,}(?:\s.*)?$/,Wl=/^={7,}$/,Gl=/^>{7,}(?:\s.*)?$/,on="header-prefix",sn="header-metadata",an="header-custom",_={dark:"pierre-dark",light:"pierre-light"},Ii="data-theme-css",Ri="data-unsafe-css",Qr="data-core-css",Jr="data-diffs-scrollbar-measure",Ai="--diffs-scrollbar-gutter-measured",jl=1,Zr=1e5,ln={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},_e={...ln,hunkLineCount:1},eo={paddingTop:8,paddingBottom:8,gap:8},to={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},no=Object.freeze({fromStart:0,fromEnd:0}),Ae={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Hi={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ie=new Set;let Re=null;function Y(e){Ie.add(e),Re??=requestAnimationFrame(Mi)}function io(e){Ie.delete(e),Ie.size===0&&Re!=null&&(cancelAnimationFrame(Re),Re=null)}function Mi(e){const t=new Set(Ie);Ie.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Ie.size>0?Re=requestAnimationFrame(Mi):Re=null}function He(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function dn(e,t){const n=e?.theme??_,i=t?.theme??_,r=kn(e),o=kn(t);return De(n,i)&&He(e,t,["theme","parseDiffOptions"])&&He(r,o)}function kn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Wt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Gt({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const h=Math.max(e-r,0),c=Math.min(e+l,t);return{top:h,bottom:Math.max(c,h)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function ro(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function W(e){return{type:"text",value:e}}function A({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function pt({name:e,width:t=16,height:n=16,properties:i}){return A({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[A({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function oo(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Ee(e){return A({tagName:"div",properties:{"data-gutter":""},children:e})}function Di(e,t,n,i={}){return A({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[A({tagName:"span",properties:{"data-line-number-content":""},children:[W(`${t}`)]})]:void 0})}function j(e,t,n){return A({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function so(){return A({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[pt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function ao(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Pi=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||Wt(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&et(e.composedPath())||(he(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(he(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(he(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){he(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();he(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);he(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Tt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Tt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(co(r)&&f!=null){f(r);break}if(ho(r)&&u!=null){u(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Tt(r))break;ut(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,b=g!=null,y=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||h!=null||c!=null||u||f||b;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,he(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const C=[];return(t==="both"||t==="click")&&(i!=null&&C.push("onLineClick"),r!=null&&C.push("onLineNumberClick"),h!=null&&C.push("expandable hunk separators"),c!=null&&C.push("merge conflict actions")),C})()),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),he(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const m=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&m||!b&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();et(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(ao(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=pe(so());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Ve(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(Ze(r));if(Ve(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(Ve(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Ve(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&et(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=Ze(e);if(t&&et(n))return;const i=fo(e);return i!=null?Ze(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=go(po(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?Ze(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=En(t)?t:En(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Wt(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,h=d.children.length;if(h!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let c=0;cs)break;if(g==null||gNumber.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Ke({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p},C,v,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:lo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:C,onMergeConflictActionClick:x,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:b,onLineSelectionStart:y,onLineSelectionChange:m,onLineSelectionEnd:p,getLineIndex:v}}function lo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Ve(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function Tt(e){return Ve(e)||ut(e)}function ho(e){return"type"in e&&e.type==="line-info"}function co(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function wn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ze(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function fo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function po(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function go(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function En(e){return e!=null&&typeof e.elementFromPoint=="function"}function Tn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function In(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function et(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function he(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var _i=class ue{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ue.resizeObserver??new ResizeObserver(ue.handleSharedResizeEntries);return ue.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=ue.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let h=l.get(d);h==null&&(h=[],l.set(d,h)),h.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[h,c]=d,u=h.firstElementChild,f=c.firstElementChild;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(u);if(g!=null){this.observedNodes.set(u,g),this.observedNodes.set(f,g),o.delete(u),o.delete(f);continue}const b=u.getBoundingClientRect().height,y=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:h,child:u,childHeight:b},column2:{container:c,child:f,childHeight:y},currentHeight:"auto"},i.add({child1:u,child2:f,item:g,newHeight:Math.max(b,y)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?bo(l):Co(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=ue,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),ue.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=ue,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),ue.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},h=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=h:o===a.numberElement&&(d.numberInlineSize=h),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?vo(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function vo(e){return Math.max(Math.ceil(e),0)}function bo(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function Co(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}const Se=new Map,It=new Map,jt=new Map,gt=new Set;function mt(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!gt.has(t))return!1;return!0}function Rn(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(gt.has(n.name))continue;let i=Se.get(n.name);i==null&&(i=n,Se.set(n.name,i)),gt.add(i.name),t.loadLanguageSync(i.data)}}function So(){Se.clear(),gt.clear()}function Oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function Ni(e){if(Oi())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=It.get(e);if(t!=null)return t;try{let n=jt.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Ln,e)&&(n=Ln[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Se.has(e)||Se.set(e,o),o});return It.set(e,i),await i}finally{It.delete(e)}}function Fi(e){return Se.get(e)??Ni(e)}const vt=new Set;function Ye(e){const t=[],n=new Set;for(const c of yo(e.themes)){const u=zi(c)?c.getThemes():[c];for(const f of u){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function h(c){if(c==null)return i;const{colorScheme:u,collection:f}=c;return f==null?u==="light"?r:u==="dark"?o:i:i.filter(g=>g.collection!==f?!1:u==null||g.colorScheme===u)}return{getTheme(c){return s.get(c)},getThemes(c){return h(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:h(c).map(u=>u.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ye({themes:i.map((u,f)=>({descriptor:u,index:f})).sort((u,f)=>{const g=c(u.descriptor,f.descriptor);return g!==0?g:u.index-f.index}).map(u=>u.descriptor)})},pick(c){const u=[],f=new Set;for(const g of c){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const b=s.get(g);if(b==null)throw new Error(`Theme collection does not contain theme "${g}"`);u.push(b)}return Ye({themes:u})},registerInto(c){for(const u of i)c.registerThemeIfAbsent(u.name,u.load)}}}function yo(e){return xo(e)?[e]:e}function xo(e){return zi(e)||Lo(e)}function Lo(e){return typeof e.name=="string"&&typeof e.load=="function"}function zi(e){return typeof e.getThemes=="function"}function Ui(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Vi=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},ko=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wo=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Eo(){const e=new Map,t=new Map,n=new Map;let i=0;function r(m,p){if(e.has(m))throw new Vi(m);e.set(m,p)}function o(m,p){return e.has(m)?!1:(e.set(m,p),!0)}function s(m){return e.has(m)}function l(m){const p=t.get(m);if(p!==void 0)return Promise.resolve(p);const C=n.get(m);if(C!==void 0)return C;const v=e.get(m);if(v===void 0)return Promise.reject(new ko(m));const x=i,S=v().then(L=>{const E=Ui(L);return x===i&&t.set(m,E),n.get(m)===S&&n.delete(m),E}).catch(L=>{throw n.get(m)===S&&n.delete(m),L});return n.set(m,S),S}function a(m){return Promise.all(m.map(p=>l(p)))}function d(m,p){t.set(m,p)}function h(m){for(const[p,C]of m)d(p,C)}function c(m){return t.get(m)}function u(m){const p=[];for(const C of m){const v=t.get(C);if(v===void 0)throw new wo(C);p.push(v)}return p}function f(m){return t.has(m)}function g(m){for(const p of m)if(!t.has(p))return!1;return!0}function b(m){const p=t.get(m);return p!==void 0?p:l(m)}function y(){i++,t.clear(),n.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:b,getResolvedTheme:c,getResolvedThemes:u,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:h}}const X=Eo();function An(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=X.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,X.getResolvedTheme(n)==null&&X.seedResolvedTheme(n,i);vt.has(n)||(vt.add(n),t.loadThemeSync(i))}}function To(){X.clearResolvedThemes(),vt.clear()}function hn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Io(t)}}function Io(e){return async()=>Or(Ui(await e()))}const Ro="pierre",Ao=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Bi=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Ho=[...Bi,...Ao],Mo=new Set(Bi);function Do(e){return Mo.has(e)?"light":"dark"}const Po={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},_o={"pierre-dark":()=>k(()=>import("./pierre-dark-CyvmCCZW.js"),[]),"pierre-dark-soft":()=>k(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[]),"pierre-dark-vibrant":()=>k(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[]),"pierre-dark-protanopia-deuteranopia":()=>k(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[]),"pierre-dark-tritanopia":()=>k(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[]),"pierre-light":()=>k(()=>import("./pierre-light-480U9XYS.js"),[]),"pierre-light-soft":()=>k(()=>import("./pierre-light-soft-CVdyfjmI.js"),[]),"pierre-light-vibrant":()=>k(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[]),"pierre-light-protanopia-deuteranopia":()=>k(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[]),"pierre-light-tritanopia":()=>k(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[])};function Oo(e){return hn({name:e,collection:Ro,colorScheme:Do(e),displayName:Po[e],load:_o[e]})}const $i=Ye({themes:Ho.map(e=>Oo(e))}),No="shiki",Wi=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Fo=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],zo=new Set(Wi);function Uo(e){return zo.has(e)?"light":"dark"}const Vo={andromeeda:()=>k(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>k(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>k(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>k(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>k(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>k(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>k(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>k(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>k(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>k(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>k(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>k(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>k(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>k(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>k(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>k(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>k(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>k(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>k(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>k(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>k(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>k(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>k(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>k(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>k(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>k(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>k(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>k(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>k(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>k(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>k(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>k(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>k(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>k(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>k(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>k(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>k(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>k(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>k(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>k(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>k(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>k(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>k(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>k(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>k(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>k(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>k(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>k(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>k(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>k(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>k(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>k(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>k(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>k(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>k(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>k(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>k(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>k(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>k(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>k(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>k(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>k(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>k(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>k(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>k(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function Hn(e){return hn({name:e,collection:No,colorScheme:Uo(e),load:Vo[e]})}const Gi=Ye({themes:Object.freeze([...Wi.map(e=>Hn(e)),...Fo.map(e=>Hn(e))])});Ye({themes:[$i,Gi]});function ji(e){if(Oi())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(X.hasRegisteredTheme(e))return;const t=Gi.getTheme(e);if(t!=null){X.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Bo(e){ji(e);const t=await X.resolveTheme(e);return qi(e,t),t}function $o(e){return X.getResolvedTheme(e)??Bo(e)}let $;async function xt({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){$??=Nr({themes:[],langs:["text"],engine:n==="shiki-wasm"?Fr(k(()=>import("./wasm-CG6Dc4jp.js"),[])):zr()});const i=Wo($)?await $:$;$=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Fi(s);"then"in l?r.push(l):Rn(l,i)}const o=[];for(const s of e){const l=$o(s);"then"in l?o.push(l):An(l,$)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Rn(s,i)}),Promise.all(o).then(s=>{An(s,i)})]),i}function ql(e=$){return e!=null&&!("then"in e)}function Ki(){if($!=null&&!("then"in $))return $}function Wo(e=$){return e!=null&&"then"in e}function Kl(e=$){return e==null}async function Yl(e){await xt(e)}async function Xl(){$!=null&&((await $).dispose(),So(),To(),$=void 0)}for(const e of $i.getThemes())X.registerThemeIfAbsent(e.name,e.load);function cn(e=_){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Ge(e){for(const t of cn(e))if(!vt.has(t))return!1;return!0}function Go(e){return X.hasResolvedThemes(e)}function Oe(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ae(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Lt(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function qt(e){return A({tagName:"div",children:[A({tagName:"div",children:e.annotations?.map(t=>A({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function jo(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Yi({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return A({tagName:"div",children:[t==="custom"?A({tagName:"slot",properties:{name:an}}):qo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ko(i)]],properties:r})}function qo({name:e,prevName:t,iconType:n}){const i=[A({tagName:"slot",properties:{name:on}}),pt({name:jo(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(t)]})],properties:{"data-prev-name":""}})),i.push(pt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(A({tagName:"div",children:[A({tagName:"bdi",children:[W(e)]})],properties:{"data-title":""}})),A({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ko(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(A({tagName:"span",children:[W(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(A({tagName:"span",children:[W(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(A({tagName:"slot",properties:{name:sn}})),A({tagName:"div",children:t,properties:{"data-metadata":""}})}function Xi(e){return A({tagName:"pre",properties:Yo(e)})}function Yo({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Z=new Map;let bt=0;const Ne={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Q(e){if(Z.has(e))return Z.get(e)??"text";if(Ne[e]!=null)return Ne[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Z.has(t[1]))return Z.get(t[1])??"text";if(Ne[t[1]]!=null)return Ne[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Z.has(n)?Z.get(n)??"text":Ne[n]??"text"}function Ql(e,t){if(e<=bt)return!1;Z.clear();for(const n in t){const i=t[n];i!=null&&Z.set(n,i)}return bt=e,!0}function Jl(){return bt}function Xo(e,t){const n=Z.get(e);return n===t?!1:(n!=null&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${n}" to "${t}"`),Z.set(e,t),bt++,!0)}function Zl(){return Object.fromEntries(Z)}function un(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:cn(t),preferredHighlighter:n}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function xe(e){return e.replace(/\n$|\r\n$/,"")}function Qo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(W(` `)),e}const tt=Symbol("no-token"),Rt=Symbol("multiple-tokens");function Qi(e){const t=Jo(e);if(t!=null)return t;let n=tt;const i=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){Zo(a,o);for(const d of a.children)ft(d)}else ft(a);i.push(a),r=[],o=void 0;return}for(const a of r)ft(a);i.push(A({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==tt){if(a===Rt){n=Rt;return}if(n===tt){n=a;return}n!==a&&(n=Rt)}};for(const a of e.children){const d=a.type==="element"?Qi(a):tt;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function Jo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ft(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ft(t)}}function Zo(e,t){e.properties["data-char"]=t}function es(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){let a=t+ts(typeof l=="string"?l:o(l))+n;return a=i(a),r.has(a)||r.set(a,typeof l=="string"?l:{...l}),a}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const h=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${h}`:d.htmlAttrs.class=h}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function ts(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function Ji(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=oo(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&Qi(a),s.push(Qo(a,l,n)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&i.push(ns,Mn),{state:n,transformers:i,toClass:Mn}}const Mn=es({classPrefix:"hl-"}),ns={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function B(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const is=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,rs=/^0(?:\.0+)?%?$/;function os(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function ss(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function At(e){if(e==null)return null;const t=ss(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Dn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||is.test(t))return!0;const n=os(t);return n!=null&&rs.test(n)}function as(e,t,n){if(t==null||n==null)return!1;const i=At(e),r=At(t),o=At(n);return i==null||r==null||o==null?!1:Math.abs(i-o){const s=e.at(-1);return s===""||s===` `||s===`\r `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s0||l<1/0,{state:h,transformers:c}=Ji(r),u=o?"text":e.lang??Q(e.name),f=typeof n=="string"?t.getTheme(n).type:void 0,g=fn({theme:n,highlighter:t});h.lineInfo=p=>({type:"context",lineIndex:p-1+s,lineNumber:p+s});const b=typeof n=="string"?{lang:u,theme:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:u,themes:n,transformers:c,defaultColor:!1,cssVariablePrefix:B("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},y=Kt(t.codeToHast(d?cs(a??St(e.contents),s,l):xe(e.contents),b)),m=d?new Array(s):y;return d&&m.push(...y),{code:m,themeStyles:g,baseThemeType:f}}function cs(e,t,n){let i="";return Ct({lines:e,startingLine:t,totalLines:n,callback({content:r}){i+=r}}),i}const Zi="-1,-1";function Yt(e){return e?.some(t=>t.lineNumber===0)??!1}function Xt(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function kt(e){return e.startingLine===0&&e.totalLines>0}function er(e,t){return A({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Qt(e){return(e.lang??Q(e.name))==="text"}function tr(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let us=-1;var fs=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++us}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:_},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ge(e.theme??_)?Ki():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Oe(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Qt(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??Q(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=_,tokenizeMaxLineLength:r=1e3}=this.options;return{theme:i,useTokenTransformer:tr(this.options),tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ae(e,n.file)||!Oe(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,St(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:St(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ae){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const r=this.getMatchingWorkerResultCache(e,n);r!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const o=this.getOrCreateLineCache(e),s=e.contents.length>0,l=!s||Qt(e)||Pt(o.length,this.getTokenizeMaxLength()),a=!ae(e,this.renderCache.file),d=!Lt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(a||d))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||a||d||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o)),this.renderCache.renderRange=t),!l&&s&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Q(e.name);const h=this.highlighter!=null&&Ge(n.theme),c=this.highlighter!=null&&mt(this.computedLang),u=!l&&c;if(this.highlighter!=null&&h&&(i||l||!this.renderCache.highlighted&&u||this.renderCache.result==null)){const{result:f,options:g}=this.renderFileWithHighlighter(e,this.highlighter,l||!c);this.renderCache={file:e,options:g,highlighted:u,result:f,renderRange:void 0}}(!h||!l&&!c)&&this.asyncHighlight(e).then(({result:f,options:g})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,f,g,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ae){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=Pt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??Q(e.name);const n=this.highlighter!=null&&Go(cn(this.options.theme)),i=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:hs(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{disableFileHeader:o=!1}=this.options,s=[],l=Ee(),a=this.getOrCreateLineCache(e);let d=0;const h=kt(t)?Xt(this.lineAnnotations):void 0;return h!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:-1,lineIndex:-1,annotations:h.map(c=>ge(c))})),d++),Ct({lines:a,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:c,lineNumber:u})=>{const f=n[c];if(f==null){const g="FileRenderer.processFileResult: Line doesnt exist";throw console.error(g,{name:e.name,lineIndex:c,lineNumber:u,lines:a}),new Error(g)}if(f!=null){l.children.push(Di("context",u,`${c}`)),s.push(f),d++;const g=this.lineAnnotations[u];g!=null&&(l.children.push(j("context","annotation",1)),s.push(qt({hunkIndex:0,lineIndex:u,annotations:g.map(b=>ge(b))})),d++)}}}),l.properties.style=`grid-row: span ${d}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(a.length),headerAST:o?void 0:this.renderHeader(e),totalLines:a.length,rowCount:d,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return Yi({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return pe(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(A({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ee();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,er(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?pe(A({tagName:"code",children:e,properties:{"data-code":""}})):pe(e)}async initializeHighlighter(){return this.highlighter=await xt(un(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!ae(e,this.renderCache.file)||!this.renderCache.highlighted||!Oe(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Oe(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ae(e,n.file)&&Oe(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return Xi({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Pt(e,t){return e>t}const nr=`
+`:`
+`)+`
+
    +`}function ube(){return`
+
+`}function cbe(e,t,n,i,s){let o=s.rules.footnote_anchor_name(e,t,n,i,s);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),`
  • `}function dbe(){return`
  • +`}function fbe(e,t,n,i,s){let o=s.rules.footnote_anchor_name(e,t,n,i,s);return e[t].meta.subId>0&&(o+=`:${e[t].meta.subId}`),` ↩︎`}function hbe(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=lbe,e.renderer.rules.footnote_block_open=abe,e.renderer.rules.footnote_block_close=ube,e.renderer.rules.footnote_open=cbe,e.renderer.rules.footnote_close=dbe,e.renderer.rules.footnote_anchor=fbe,e.renderer.rules.footnote_caption=rbe,e.renderer.rules.footnote_anchor_name=obe;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const g=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${g}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:g},m.level=l.level++,l.tokens.push(m);const y=l.bMarks[a],A=l.tShift[a],b=l.sCount[a],C=l.parentType,v=h,x=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let I=x;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,g=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,g);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:g}}return l.pos=f+1,l.posMax=u,!0}function o(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const g=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:g,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(g){return g.type==="footnote_reference_open"?(d=!0,u=[],c=g.meta.label,!1):g.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(g),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let g=0,m=h.length;g0?h[g].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function vbe(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let s=!1;for(;e.pos{t.exports=function(m,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),m.core.ruler.after("inline","github-task-lists",function(A){for(var b=A.tokens,C=0,v=2;v=0;b--)if(m[b].level===A)return b;return-1}function s(m,y){return d(m[y])&&f(m[y-1])&&h(m[y-2])&&g(m[y])}function o(m,y,A,b){var C=A.idPrefix+y;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(C,b)),m.children.push(a(b)),m.children.unshift(r(m,C,A,b)),A.divWrap&&(m.children.unshift(u(A,b)),m.children.push(c(b)))}function r(m,y,A,b){var C=new b("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&C.attrs.push(["checked","true"]),A.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(m,y){var A=new y("label_open","label",1);return A.attrs=[["for",m]],A}function a(m){return new m("label_close","label",-1)}function u(m,y){var A=new y("checkbox_open","div",0);return A.attrs=[["class",m.divClass]],A}function c(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function g(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})});const bbe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Abe(e){return e>=55296&&e<=57343||e>1114111?65533:bbe.get(e)??e}function Cbe(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let s=0,o=0;s=os.ZERO&&e<=os.NINE}function xbe(e){return e>=os.UPPER_A&&e<=os.UPPER_F||e>=os.LOWER_A&&e<=os.LOWER_F}function Sbe(e){return e>=os.UPPER_A&&e<=os.UPPER_Z||e>=os.LOWER_A&&e<=os.LOWER_Z||Qb(e)}function _be(e){return e===os.EQUALS||Sbe(e)}var lo;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(lo||(lo={}));var Pu;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Pu||(Pu={}));var Ibe=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=lo.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Pu.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=lo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case lo.EntityStart:return e.charCodeAt(t)===os.NUM?(this.state=lo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=lo.NamedEntity,this.stateNamedEntity(e,t));case lo.NumericStart:return this.stateNumericStart(e,t);case lo.NumericDecimal:return this.stateNumericDecimal(e,t);case lo.NumericHex:return this.stateNumericHex(e,t);case lo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|m_)===os.LOWER_X?(this.state=lo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=lo.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Jo.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],s=(i&Jo.VALUE_LENGTH)>>14}if(t>=e.length)break;const o=e.charCodeAt(t);if(o===os.SEMI&&s!==0&&(i&Jo.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);if(this.treeIndex=Ebe(n,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Pu.Attribute&&(s===0||_be(o))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],s=(i&Jo.VALUE_LENGTH)>>14,s!==0){if(o===os.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Pu.Strict&&(i&Jo.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Jo.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Jo.VALUE_LENGTH|Jo.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case lo.NamedEntity:return this.result!==0&&(this.decodeMode!==Pu.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lo.NumericDecimal:return this.emitNumericEntity(0,2);case lo.NumericHex:return this.emitNumericEntity(0,3);case lo.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lo.EntityStart:return 0}}};function Mbe(e){let t="";const n=new Ibe(e,i=>t+=String.fromCodePoint(i));return function(s,o){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(o);const u=n.write(s,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+s.slice(r);return t="",a}}function Ebe(e,t,n,i){const s=(t&Jo.BRANCH_LENGTH)>>7,o=t&Jo.JUMP_TABLE;if(s===0)return o!==0&&i===o?n:-1;if(o){const u=i-o;return u<0||u>=s?-1:e[n+u]-1}const r=s+1>>1;let l=0,a=s-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Tbe=Mbe(wbe);function N6(e,t=Pu.Legacy){return Tbe(e,t)}var Lbe=MB(kbe());const v_={};function Nbe(e){let t=v_[e];if(t)return t;t=v_[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?s+="���":s+=String.fromCharCode(c),o+=6;continue}}if((l&248)===240&&o+91114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),o+=9;continue}}s+="�"}return s})}Jy.defaultChars=";/?:@&=+$,#";Jy.componentChars="";var Yb=Jy;const y_={};function Fbe(e){let t=y_[e];if(t)return t;t=y_[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=Fbe(t);let s="";for(let o=0,r=e.length;o=55296&&l<=57343){if(l>=55296&&l<=56319&&o+1=56320&&a<=57343){s+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[o])}return s}Xy.defaultChars=";/?:@&=+$,-_.!~*'()#";Xy.componentChars="-_.!~*'()";var EB=Xy;function F6(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function xv(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Dbe=/^([a-z0-9.+-]+:)/i,$be=/:[0-9]*$/,Bbe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,zbe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),Rbe=["'"].concat(zbe),k_=["%","/","?",";","#"].concat(Rbe),b_=["/","?","#"],Obe=255,A_=/^[+a-z0-9A-Z_-]{0,63}$/,Pbe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C_={javascript:!0,"javascript:":!0},w_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function jbe(e,t){if(e&&e instanceof xv)return e;const n=new xv;return n.parse(e,t),n}xv.prototype.parse=function(e,t){let n,i,s,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const u=Bbe.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=Dbe.exec(o);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,o=o.substr(r.length)),(t||r||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=o.substr(0,2)==="//",s&&!(r&&C_[r])&&(o=o.substr(2),this.slashes=!0)),!C_[r]&&(s||r&&!w_[r])){let u=-1;for(let g=0;g127?b+="x":b+=A[C];if(!b.match(A_)){const C=g.slice(0,m),v=g.slice(m+1),x=A.match(Pbe);x&&(C.push(x[1]),v.unshift(x[2])),v.length&&(o=v.join(".")+o),this.hostname=C.join(".");break}}}}this.hostname.length>Obe&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=o.indexOf("#");l!==-1&&(this.hash=o.substr(l),o=o.slice(0,l));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),w_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};xv.prototype.parseHost=function(e){let t=$be.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var D6=jbe,TB=ibe({decode:()=>Yb,encode:()=>EB,format:()=>F6,parse:()=>D6}),Hbe=Object.defineProperty,LB=e=>{let t={};for(var n in e)Hbe(t,n,{get:e[n],enumerable:!0});return t},Xs=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Wbe=LB({arrayReplaceAt:()=>Qbe,assign:()=>Zbe,countLines:()=>gs,escapeHtml:()=>o8e,escapeRE:()=>l8e,fromCodePoint:()=>u0,has:()=>Vbe,isMdAsciiPunct:()=>Iv,isPunctChar:()=>_v,isPunctCode:()=>Jb,isSpace:()=>Gbe,isString:()=>Ube,isValidEntityCode:()=>t9,isWhiteSpace:()=>a0,lib:()=>a8e,mdurl:()=>TB,normalizeReference:()=>e9,ucmicro:()=>Sv,unescapeAll:()=>c0,unescapeMd:()=>e8e});const Sv={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function qbe(e){return Object.prototype.toString.call(e)}function Ube(e){return qbe(e)==="[object String]"}const Kbe=Object.prototype.hasOwnProperty;function Vbe(e,t){return Kbe.call(e,t)}function Zbe(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Gbe(e){return e===9||e===32}function a0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function _v(e){return Sv.P.test(e)||Sv.S.test(e)}const x_=new Map;function Jb(e){if(Iv(e))return!0;if(e>=0&&e<128)return!1;const t=x_.get(e);if(t!==void 0)return t;const n=_v(String.fromCharCode(e));return x_.set(e,n),n}function Iv(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function e9(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Qbe(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function t9(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function u0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const NB=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Ybe=new RegExp(`${NB.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Jbe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Xbe(e,t){if(t.charCodeAt(0)===35&&Jbe.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return t9(i)?u0(i):e}const n=N6(e);return n!==e?n:e}function e8e(e){return e.includes("\\")?e.replace(NB,"$1"):e}function c0(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Ybe,(t,n,i)=>n||Xbe(t,i))}const t8e=/[&<>"]/,n8e=/[&<>"]/g,i8e={"&":"&","<":"<",">":">",'"':"""};function s8e(e){return i8e[e]}function o8e(e){return t8e.test(e)?e.replace(n8e,s8e):e}const r8e=/[.?*+^$[\]\\(){}|-]/g;function l8e(e){return e.replace(r8e,"\\$&")}const a8e={mdurl:TB,ucmicro:Sv};function gs(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const u8e=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,c8e=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,d8e=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,$6=["references","footnotes","abbreviations","abbr","abbrs"],B6=Symbol.for("markdown-it-ts.global-state"),z6=Object.prototype.hasOwnProperty;function S_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $l(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yu(e){if(Array.isArray(e))return e.map(t=>Yu(t));if($l(e)){const t={};for(const n of Object.keys(e))t[n]=Yu(e[n]);return t}return e}function Mv(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$l(e)?Object.keys(e):[]}function Xb(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;no.has(r)?!Xb(s[r],FB(i.value,r)):!0)}}function ru(e){const t=R6(e);if(t){for(const n of $6){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){h8e(e,n,i);continue}i.existed?e[n]=f8e(e[n],i.value):delete e[n]}delete e[B6]}}function f3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const e8=Symbol.for("markdown-it-ts.diagnostics");function K0(e,t){if(e)try{const n=e[e8];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[e8]=i,i}catch{return}}function Pa(e){return K0(e,!1)}function g8e(e){if(e)try{const t=e[e8];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function er(e){g8e(e)}function _1(e,t){const n=K0(e,!0);n&&(n.stockFast=t)}function Ds(e,t){const n=K0(e,!0);n&&(n.strategy=t)}function h3(e,t){const n=K0(e,!0);n&&(n.chunk=t)}function DB(e,t){const n=K0(e,!0);n&&(n.unbounded=t)}const m8e=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v8e=/[\0-\x1F\x7F-\x9F]/,y8e=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,k8e=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var b8e=class{src_Any=m8e.source;src_Cc=v8e.source;src_Z=k8e.source;src_P=y8e.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),s=this.escapeRE(t),o=`(?:(?!${this.src_ZCc}|${i}|${s}).)`;let r=`${i}${o}{0,1000}${s}`;for(let l=2;l<=n;l++)r=`${i}(?:${o}|${r}){0,1000}${s}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},p3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const s=i.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)},A8e={"http:":p3,"https:":p3,"ftp:":p3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const s=i.exec(e);return s?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const s=i.exec(e);return s?s[0].length:0},normalize:(e,t)=>t.normalize(e)}},C8e="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",w8e="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function x8e(){const e=w8e.split("|");return C8e.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const s of t.slice(n+1))e.push(i+s)}),e}var S8e={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:x8e(),urlAuth:!1,maxLength:1e4},__=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const s=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=s,this.text=s,this.url=s}},$B=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...S8e,...n},this.__schemas__={...A8e},this.re=t||new b8e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,s)=>s.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),s=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const o=e.slice(Math.max(0,t.index-65),t.index);if(s.test(o))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,s,o,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(s=this.re.get_fuzzy_mail_host_search(),s.lastIndex=0,o=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(s&&o&&!d&&(!l||l.index=f)break;s.lastIndex=f)break;i.lastIndexg.lastIndex))&&(g=r);let m;if(!u)for(;;){if(!a){n.lastIndexg.index)break;const b=a;a=void 0;const C=this.testSchemaAt(e,b.schema,b.lastIndex);if(C){m={schema:b.schema,index:b.index,lastIndex:b.lastIndex+C};break}}let y=m;if((!y||l&&(l.indexy.lastIndex))&&(y=l),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===l?l=void 0:y===r&&(r=void 0);const A=new __(e,y.schema,y.index,y.lastIndex);A.schema?this.__schemas__[A.schema].normalize(A,this):this.normalize(A),t.push(A),f=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new __(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},_8e=IB({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,y=Math.floor,A=String.fromCharCode;function b(P){throw new RangeError(g[P])}function C(P,R){const q=[];let j=P.length;for(;j--;)q[j]=R(P[j]);return q}function v(P,R){const q=P.split("@");let j="";q.length>1&&(j=q[0]+"@",P=q[1]),P=P.replace(h,".");const W=C(P.split("."),R).join(".");return j+W}function x(P){const R=[];let q=0;const j=P.length;for(;q=55296&&W<=56319&&qString.fromCodePoint(...P),_=function(P){return P>=48&&P<58?26+(P-48):P>=65&&P<91?P-65:P>=97&&P<123?P-97:36},S=function(P,R){return P+22+75*(P<26)-((R!=0)<<5)},E=function(P,R,q){let j=0;for(P=q?y(P/700):P>>1,P+=y(P/R);P>m*26>>1;j+=36)P=y(P/m);return y(j+(m+1)*P/(P+38))},D=function(P){const R=[],q=P.length;let j=0,W=128,z=72,H=P.lastIndexOf("-");H<0&&(H=0);for(let X=0;X=128&&b("not-basic"),R.push(P.charCodeAt(X));for(let X=H>0?H+1:0;X=q&&b("invalid-input");const pe=_(P.charCodeAt(X++));pe>=36&&b("invalid-input"),pe>y((2147483647-j)/te)&&b("overflow"),j+=pe*te;const ue=V<=z?1:V>=z+26?26:V-z;if(pey(2147483647/fe)&&b("overflow"),te*=fe}const se=R.length+1;z=E(j-U,se,U==0),y(j/se)>2147483647-W&&b("overflow"),W+=y(j/se),j%=se,R.splice(j++,0,W)}return String.fromCodePoint(...R)},B=function(P){const R=[];P=x(P);const q=P.length;let j=128,W=0,z=72;for(const U of P)U<128&&R.push(A(U));const H=R.length;let X=H;for(H&&R.push("-");X=j&&tey((2147483647-W)/se)&&b("overflow"),W+=(U-j)*se,j=U;for(const te of P)if(te2147483647&&b("overflow"),te===j){let V=W;for(let pe=36;;pe+=36){const ue=pe<=z?1:pe>=z+26?26:pe-z;if(V32))return o;if(i===41){if(r===0)break;r--}s++}return t===s||r!==0||(o.str=c0(e.slice(t,s)),o.pos=s,o.ok=!0),o}var zB=j6;const i2=-2;function I8e(e,t,n,i){let s=1,o=t+1;for(;o=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=I8e(l,t,a,n);if(f!==i2)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(o);if(l!==34&&l!==39&&l!==40)return r;t++,o++,l===40&&(l=41),r.marker=l}for(;o=0?e.attrs[n][1]:null}function T8e(e,t,n){const i=n9(e,t);i<0?q6(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var L8e=LB({attrGet:()=>E8e,attrIndex:()=>n9,attrJoin:()=>T8e,attrPush:()=>q6,attrSet:()=>M8e,parseLinkDestination:()=>j6,parseLinkLabel:()=>H6,parseLinkTitle:()=>W6});function N8e(e){return e.includes("\r")||e.includes("\0")}function OB(e){return typeof e=="string"?e:e.toString()}function F8e(e){if(e.inlineMode){const t=new Xs("inline","",0);t.content=OB(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const D8e=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,$8e=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function B8e(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const s=n,o=e.posMax;for(;;){if(++n>=o)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(s+1,n);if($8e.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(D8e.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var PB=B8e;function z8e(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const s=i;i++;const o=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var jB=z8e;function I_(e){const t={},n=e.length;if(!n)return;let i=0,s=-2;const o=[];for(let r=0;ra;u-=o[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?o[u-1]+1:0;o[r]=r-u+h,o[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,s=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function R8e(e){const t=e.tokens_meta,n=e.tokens_meta.length;I_(e.delimiters);for(let i=0;i=0;s--){const o=t[s],r=o.marker;if(r!==95&&r!==42||o.end===-1)continue;const l=t[o.end],a=o.token,u=l.token,c=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===r&&t[s-1].token===a-1&&t[o.end+1].token===u+1,d=r===42?HB:WB,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[s-1].token].content="",i[t[o.end+1].token].content="",s--)}}function j8e(e){const t=e.tokens_meta,n=e.tokens_meta.length;M_(e,e.delimiters);for(let i=0;i=48&&e<=57}function H8e(e){const t=e|32;return U6(e)||t>=97&&t<=102}function UB(e){const t=e|32;return t>=97&&t<=122}function W8e(e){return UB(e)||U6(e)}function q8e(e,t,n){let i=t+2;if(i>=n)return null;let s=!1,o=7,r=i;for((e.charCodeAt(i)|32)===120&&(s=!0,o=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function U8e(e,t,n){let i=t+1;if(i>=n||!UB(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const s=e.slice(t,i+1);return qB(s)!==s?s:null}function K8e(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const s=q8e(e.src,n,i);if(s){if(!t){const o=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=t9(o)?u0(o):u0(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=U8e(e.src,n,i);if(s){const o=qB(s);if(!t){const r=e.push("text_special","",0);r.content=o,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var KB=K8e;const VB=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),n8=new Array(128),ZB=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);n8[e]=`\\${t}`,ZB[e]=VB[e]?t:n8[e]}function E_(e,t,n){e.pending&&e.pushPending();const i=new Xs("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function V8e(e,t){let n=e.pos;const i=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=i))return!1;let o=s.charCodeAt(n);if(o===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&o<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(o>=55296&&o<=56319&&n+1=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return E_(e,o<256&&VB[o]?r:l,l),e.pos=n+1,!0}var GB=V8e;function Z8e(e){let t,n,i=0;const s=e.tokens,o=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,YB="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Q8e=new RegExp(`^(?:${QB}|${YB}||<\\?[\\s\\S]*?\\?>|]*>|)`),Y8e=new RegExp(`^(?:${QB}|${YB})`);function JB(e){return e===32||e===9||e===10||e===12||e===13}function J8e(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||JB(t)}function X8e(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function t5e(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,s=e.src;if(s.charCodeAt(i)!==60||i+2>=n)return!1;const o=s.charCodeAt(i+1);if(o!==33&&o!==63&&o!==47&&!e5e(o))return!1;const r=s.slice(i).match(Q8e);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,J8e(l)&&e.linkLevel++,X8e(l)&&e.linkLevel--}return e.pos+=l.length,!0}var XB=t5e;function n5e(e,t){let n,i,s,o,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=Ev(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o=f)return!1;if(l=zB(e.src,o,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?o=l.pos:c="",u=o;o=f||e.src.charCodeAt(o)!==41)return e.pos=d,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?s=e.src.slice(u,o++):o=g+1):o=g+1,s||(s=e.src.slice(h,g)),r=e.env.references[e9(s)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,g);const m=[];e.md.inline.parse(i,e.md,e.env,m);const y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=m,y.content=i,a&&y.attrs.push(["title",a])}return e.pos=o,e.posMax=f,!0}var ez=n5e;function g3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,g),d||(d=n.slice(o,r)),l=g+1):d=n.slice(o,r)}else d=n.slice(o,r);const f=e.env.references[e9(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=o,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=s,!0}var tz=i5e;function nz(e){const t=e|32;return t>=97&&t<=122}function s5e(e){return e>=48&&e<=57}function o5e(e){return nz(e)||s5e(e)||e===43||e===45||e===46}function r5e(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&o5e(e.charCodeAt(t));)t--;return t++,t>=e.length||!nz(e.charCodeAt(t))?null:e.slice(t)}function l5e(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=r5e(e.pending);if(!s)return!1;const o=l5e(e.src,n-s.length,i),r=e.md.linkify.matchAtStart(o);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function a5e(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,s=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=s||L_(n.charCodeAt(i)))return!1;let o=i+1;for(;oi-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function h5e(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function rz(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:K6(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function mh(e,t,n,i,s,o){const r=rz(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=h5e(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),o?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=K6()}function p5e(e){const t=rz(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;is.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(i<0)return;const s=this.rules[i];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(r=>r.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(r=>r.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;for(const o of n){const r=this.rules.findIndex(l=>l.name===o);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}i.push(o),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;for(const o of n){const r=this.rules.findIndex(l=>l.name===o);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}i.push(o),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const s=t.has(i.name);i.enabled!==s&&(i.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const s of i.alt)e.add(s);const t=new Map,n=new Map;for(const i of e){const s=[],o=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(s.push(r.fn),o.push({name:r.name,fn:r.fn})));t.set(i,s),n.set(i,o)}this.cache=t,this.namedCache=n}},lz=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Xs("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Xs(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Xs(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(s),i}scanDelims(e,t){const{src:n,posMax:i}=this,s=n.charCodeAt(e);let o=e;for(;o0?n.charCodeAt(e-1):32,a=o@[\]\\^_`{}~]/;function F_(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return sz(e,t);case 33:return ez(e,t);case 38:return KB(e,t);case 42:case 95:return t8.tokenize(e,t);case 58:return e.md.options.linkify&&iz(e,t);case 60:return PB(e,t)||XB(e,t);case 91:return tz(e,t);case 92:return GB(e,t);case 96:return jB(e,t);case 126:return i8.tokenize(e,t);default:return oz(e,t)}}function az(e){return!g5e.test(e)}var m5e=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new N_,this.ruler2=new N_,this.ruler.push("text",oz),this.ruler.push("linkify",iz),this.ruler.push("newline",sz),this.ruler.push("escape",GB),this.ruler.push("backticks",jB),this.ruler.push("strikethrough",i8.tokenize),this.ruler.push("emphasis",t8.tokenize),this.ruler.push("link",tz),this.ruler.push("image",ez),this.ruler.push("autolink",PB),this.ruler.push("html_inline",XB),this.ruler.push("entity",KB),this.ruler2.push("balance_pairs",O8e),this.ruler2.push("strikethrough",i8.postProcess),this.ruler2.push("emphasis",t8.postProcess),this.ruler2.push("fragments_join",G8e),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,s=e.cache,o=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(o!==void 0){e.pos=o;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=F_(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const o=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&az(e)){const a=new Xs("text","",0);a.content=e,i.push(a);return}const s=new lz(e,t,n,i);this.tokenize(s);const o=this.getRules2(),r=o.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a0&&az(o.content)){const r=new Xs("text","",0);r.content=o.content,o.children.push(r);continue}e.md.inline.parse(o.content,e.md,e.env,o.children)}}}const y5e=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,k5e=/[0-9a-z]/i;function b5e(e){return/^\s]/i.test(e)}function A5e(e){return/^<\/a\s*>/i.test(e)}function C5e(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(b5e(l.content)&&o>0&&o--,A5e(l.content)&&o++),o>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>C5e(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&s[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const x=new Xs("text","",0);x.content=a.slice(f,A),x.level=d,c.push(x)}const b=new Xs("link_open","a",1);b.attrs=[["href",m]],b.level=d++,b.markup="linkify",b.info="auto",c.push(b);const C=new Xs("text","",0);C.content=y,C.level=d,c.push(C);const v=new Xs("link_close","a",-1);v.level=--d,v.markup="linkify",v.info="auto",c.push(v),f=g.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(M5e,T5e)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function N5e(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&uz.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function F5e(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");I5e.test(i)&&L5e(n.children||[]),uz.test(i)&&N5e(n.children||[])}}var D5e=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(o=>o.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(o=>o.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;for(const o of n){const r=this.rules.findIndex(l=>l.name===o);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}i.push(o),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;for(const o of n){const r=this.rules.findIndex(l=>l.name===o);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${o}`);continue}i.push(o),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const s=t.has(i.name);i.enabled!==s&&(i.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const $5e=/['"]/,D_=/['"]/g,$_="’";function gm(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function B5e(e,t){let n;const i=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let o=0;o=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)m=a.charCodeAt(d.index-1);else for(n=o-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&m<=57&&(h=f=!1),f&&h&&(f=A,h=b),!f&&!h){g&&(r.content=gm(r.content,d.index,$_));continue}if(h)for(n=i.length-1;n>=0;n--){let x=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!$5e.test(i)||!n.children||B5e(n.children,e)}}function R5e(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||s.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],g=[],m=[],y=[],A=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let C=!1,v;for(v=t;v=d)break;if(s.charCodeAt(c++)===62&&!E){let B=a[v]+1,T,N;s.charCodeAt(c)===32?(c++,B++,N=!1,T=!0):s.charCodeAt(c)===9?(T=!0,(u[v]+B)%4===3?(c++,B++,N=!1):N=!0):T=!1;let O=B;for(h.push(o[v]),o[v]=c;c=d,g.push(u[v]),u[v]=a[v]+1+(T?1:0),m.push(a[v]),a[v]=O-B,y.push(l[v]),l[v]=c-o[v];continue}if(C)break;let D=!1;for(let B=0,T=A.length;B";const _=[t,0];I.map=_,e.md.block.tokenize(e,t,v);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=b,_[1]=e.line;for(let E=0;E=4){i++,s=i;continue}break}e.line=s;const o=e.push("code_block","code",0);return o.content=`${e.getLines(t,s,4+e.blkIndent,!1)} +`,o.map=[t,e.line],!0}function q5e(e,t,n,i){let s=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>o)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const u=e.src.slice(l,s),c=e.src.slice(s,o);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],o=e.eMarks[d],s=4)&&(s=e.skipChars(s,r),!(s-l=4)return!1;let c=s.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=s.charCodeAt(++a);c===35&&a6||aa&&R_(s.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",B_[d],1);h.markup=z_[d],h.map=[t,e.line];const g=e.push("inline","",0);g.content=s.slice(a,u).trim(),g.map=[t,e.line],g.children=[];const m=e.push("heading_close",B_[d],-1);return m.markup=z_[d],!0}function K5e(e){switch(e){case 9:case 32:return!0}return!1}function V5e(e,t,n,i){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;o|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Y8e.source}\\s*$`),/^$/,!1]];function Z5e(e,t,n,i){let s=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,o),l=0;for(;l=48&&e<=57}var pz=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const s=this.src;let o=0,r=0,l=0,a=!1,u=0;for(let c=0,d=s.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let s=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let g=0;const m=this.src,y=this.bsCount,A=this.tShift;for(;fn?new Array(g-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const s=new Array(t-e),o=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?s[c]=new Array(f-n+1).join(" ")+o.slice(g,m):s[c]=o.slice(g,m)}return s.join("")}};pz.prototype.Token=Xs;function Q5e(e,t,n){for(let i=t;i=s)return!1;const o=n.charCodeAt(i);switch(o){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return o>=48&&o<=57?!0:Q5e(n,i,s)}const P_=["","h1","h2"];function Y5e(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,o=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=gz(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,g=t+1;for(;g=x)break;if(a[g]-u>3)continue;if(a[g]>=u&&(h=s.charCodeAt(v),h===45||h===61)){let _=v+1,S=_;for(;_=x){f=h===61?1:2;break}if(S-v>1)continue}if(a[g]<0||c&&!mz(e,g,s,v,x))continue;let I=!1;for(let _=0,S=i.length;_v;){const I=s.charCodeAt(x-1);if(I!==9&&I!==32)break;x--}m=s.slice(v,x)}else m=e.getLines(t,g,u,!1).trim();e.line=g+1;const y=h===61?"=":"-",A=e.push("heading_open",P_[f],1);A.markup=y,A.map=[t,e.line];const b=e.push("inline","",0);b.content=m,b.map=[t,e.line-1],b.children=[];const C=e.push("heading_close",P_[f],-1);return C.markup=y,e.parentType=d,!0}function vz(e){switch(e){case 9:case 32:return!0}return!1}function j_(e,t){const n=e.eMarks,i=e.bMarks,s=e.tShift,o=e.src,r=n[t];let l=i[t]+s[t];const a=o.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=o.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=o.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++s=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,g=e.bMarks,m=e.tShift,y=e.eMarks,A=e.sCount,b=e.bsCount,C=g[l]+m[l];if(C>=y[l])return!1;const v=h.charCodeAt(C);if(v>=48&&v<=57){if(f=H_(e,l),f<0||(c=!0,r=C,d=J5e(e,l,f),u&&d!==1))return!1}else if(v===42||v===45||v===43){if(f=j_(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=y[l])return!1;if(i)return!0;const x=h.charCodeAt(f-1),I=String.fromCharCode(x);if(c){const T=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(T.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const _=[l,0];e.tokens[e.tokens.length-1].map=_,e.tokens[e.tokens.length-1].markup=I;let S=!1;const E=e.tokens.length-1,D=e.md.block.ruler.getRulesForState(e,"list"),B=e.parentType;for(e.parentType="list";l=s?P=1:P=N-T,P>4&&(P=1);const R=T+P,q=e.push("list_item_open","li",1);q.markup=I;const j=[l,0];q.map=j,c&&(q.info=f-r-1===1?X5e[h.charCodeAt(r)-48]:h.slice(r,f-1));const W=e.tight,z=e.tShift[l],H=e.sCount[l],X=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[l]=O-g[l],e.sCount[l]=N,O>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=X,e.tShift[l]=z,e.sCount[l]=H,e.tight=W,e.push("list_item_close","li",-1).markup=I,l=e.line,j[1]=l,l>=n||e.sCount[l]=4)break;let U=!1;for(let se=0,te=D.length;se3||u[f]<0)continue;if(s==="list"&&u[f]>=c){const C=r[f]+l[f],v=a[f];if(C=v||W_(o.charCodeAt(C+1)))break}else if(x>=48&&x<=57&&C+1=v){I=-1;break}const _=o.charCodeAt(I++);if(_>=48&&_<=57){if(I-C>=10){I=-1;break}continue}if((_===41||_===46)&&(I>=v||W_(o.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const y=r[f]+l[f],A=a[f];if(d&&!mz(e,f,o,y,A))continue;let b=!1;for(let C=0,v=i.length;C=4||e.src.charCodeAt(s)!==91)return!1;function a(C){const v=e.lineMax;if(C>=v||e.isEmpty(C))return null;let x=!1;if(e.sCount[C]-e.blkIndent>3&&(x=!0),e.sCount[C]<0&&(x=!0),!x){const S=e.parentType;e.parentType="reference";let E=!1;for(let D=0,B=l.length;D"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:A,href:f}),e.line=r),!0):!1}function m3(e){switch(e){case 9:case 32:return!0}return!1}const s6e=65536;function v3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function o6e(e,t){if(e.lineFlags)return(e.lineFlags[t]&yp.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let s=t+1;if(e.sCount[s]=4)return!1;let o=e.bMarks[s]+e.tShift[s];if(o>=e.eMarks[s])return!1;const r=e.src.charCodeAt(o++);if(r!==124&&r!==45&&r!==58||o>=e.eMarks[s])return!1;const l=e.src.charCodeAt(o++);if(l!==124&&l!==45&&l!==58&&!m3(l)||r===45&&m3(l)||!o6e(e,t))return!1;for(;o=4)return!1;u=q_(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.push("table_open","table",1),m=[t,0];g.map=m;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const A=e.push("tr_open","tr",1);A.map=[t,t+1];for(let v=0;v=4||(u=q_(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>s6e))break;if(s===t+2){const I=e.push("tbody_open","tbody",1);I.map=b=[t+2,0]}const x=e.push("tr_open","tr",1);x.map=[s,s+1];for(let I=0;Ir.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(r=>r.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this._rules.findIndex(r=>r.name===t);o>=0&&this._rules.splice(o,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:s})=>(o,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=s(o,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return mh(o?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(s=>s.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;return n.forEach(o=>{const r=this._rules.findIndex(l=>l.name===o);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}i.push(o),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let s=!1;return n.forEach(o=>{const r=this._rules.findIndex(l=>l.name===o);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${o}`)}i.push(o),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const s=t.has(i.name);i.enabled!==s&&(i.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const s of i.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const i of e){const s=[],o=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(s.push(r.fn),o.push({name:r.name,fn:r.fn})));t[i]=s,n[i]=o}this.cache=t,this.namedCache=n}};const vm=[["table",r6e,["paragraph","reference"]],["code",W5e],["fence",q5e,["paragraph","reference","blockquote","list"]],["blockquote",H5e,["paragraph","reference","blockquote","list"]],["hr",V5e,["paragraph","reference","blockquote","list"]],["list",t6e,["paragraph","reference","blockquote"]],["reference",i6e],["html_block",Z5e,["paragraph","reference","blockquote"]],["heading",U5e,["paragraph","reference","blockquote"]],["lheading",Y5e],["paragraph",n6e]];var a6e=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new l6e;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=o){e.line=n;break}const h=e.line;let g=!1;for(let m=0;m=e.line)throw new Error("block rule didn't increment state.line");break}if(!g)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=o){e.line=n;break}const h=e.line;let g=!1;for(let m=0;m=e.line)throw new Error("block rule didn't increment state.line");break}}if(!g)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const s=new pz(e,t,n,i);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},yz=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};yz.prototype.Token=Xs;const U_=[["normalize",_5e],["block",F8e],["inline",v5e],["linkify",w5e],["replacements",F5e],["smartquotes",z5e],["text_join",R5e]],u6e={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},c6e={parseLinkLabel:H6,parseLinkDestination:j6,parseLinkTitle:W6};function d6e(){return{...u6e}}function f6e(){return{...c6e}}var h6e=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new a6e,this.inline=new m5e,this.ruler=new D5e;for(let e=0;e@[\]\\^_`{}~]/;function Tv(e){return!p6e.test(e)}function X1(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function s2(e,t,n){for(let i=t;i3)return Tv(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!Tv(c))return!1;const d=m6e[o],f=v6e[o],h=fl("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(V6(c,s,1));const g=fl("heading_close",d,-1,0);return g.markup=f,e.push(g),!0}function k6e(e,t,n){const i=fl("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(V6(t,n,1)),e.push(fl("paragraph_close","p",-1,0))}function b6e(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function A3(e,t){for(;t=1e5?V_:b3,s="",o=!1,r=!1,l=0,a=0;for(;l"]/,Z_=/[&<>"]/g,I6e=/&/g,M6e=/[<>"]/g,E6e={"&":"&","<":"<",">":">",'"':"""};function C3(e){return E6e[e]||e}function Ai(e){if(e.length===0)return"";if(e.length<32)return _6e.test(e)?e.replace(Z_,C3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),s=e.includes('"');return!t&&!n&&!i&&!s?e:t&&!n&&!i&&!s?e.replace(I6e,"&"):t?e.replace(Z_,C3):e.replace(M6e,C3)}const T6e=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),L6e=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function kz(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(T6e,(t,n,i)=>{if(n)return n;if(L6e.test(i)){const o=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return t9(o)?u0(o):"�"}const s=N6(t);return s!==t?s:t})}const N6e=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,F6e=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,D6e=/"/g;function Yf(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function Lv(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!Lv(e,t,Yf(e,t))}function G_(e,t,n){return t+2=n||e.charCodeAt(s)!==32)return null;let o=s+1;for(;oo&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>o&&e.charCodeAt(l-1)===35;)l--;if(l>o&&e.charCodeAt(l-1)===32)for(r=l-1;r>o&&e.charCodeAt(r-1)===32;)r--;const a=Z6(e.slice(o,r));return a===null?null:`${a} +`}function Q_(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • +`}function O6e(e,t,n){const i=t+2;if(n===i+1)return R6e(e,i);const s=Z6(e.slice(t+2,n));return s===null?null:`
  • ${s}
  • +`}function P6e(e,t,n){for(;tt;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let i=n;for(let s=t;s`:"
    ",i.lang=o,i.open=d),{html:`${d}${Ai(c)}
    +`,nextPos:u=25e4,o=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;v +`,l=A,a=b}let C=ym(e,y);for(;C${y}

    +`,u=h,c=g}const m=de.core.parse(t,n,e).tokens);let r=o2(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=K6e(r,s.maxChunks)),r2(t,r))return h3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),gh(n,o,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return h3(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:o||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!o}),gh(n,o,()=>{for(let u=0;u=3&&(c?c.marker===C&&x>=c.length&&(c=null):c={marker:C,length:x})}}const y=g-f;s+=y,o+=1,l+=1,m?(a=0,u=0):(a+=1,u+=y);const A=m;if((s>=t.maxChunkChars||o>=t.maxChunkLines)&&!c)if(A)d(g);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=b||u>=C)&&d(g)}f=g}return n&&d(e.length),i}function r2(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;se.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let s=i.children.length-1;s>=0;s--)n.push(i.children[s])}}function U6e(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let s=i.children.length-1;s>=0;s--)n.push(i.children[s])}}function wu(e){return e.length===0?0:gs(e)+(e.charCodeAt(e.length-1)===10?0:1)}function X6e(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=s===e.length?e.length:s+1}return n!==null}function t7e(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return X6e(e,n+1,e.length-1)?!e7e(e,t):!1}function n7e(e,t,n,i={}){const s=i.mode??"full",o=i.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??Q6e:e.options.fullChunkSizeChars??Z6e),l=i.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Y6e:e.options.fullChunkSizeLines??G6e);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:o}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:o}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:o}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:o}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:o}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:o}}var V0=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=wu(this.pending);if(this.pending.length=i||n>=s}function Sz(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Az))return"yes";const i=e.options.autoUnboundedThresholdLines??Cz;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const o=[],r=new V0(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){wz(o,l)}});if(s&&O6(n,s),r.feed(t),r.flushForce(n),s&&(P6(n),i.fallbackOnGlobalState===!1)){const l=Pa(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return o}const vh=(e,t,n)=>en?n:e;function _z(e){return e.experimental?{...e,...e.experimental}:e}const X_=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],eI=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Iz(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function l7e(e,t=Math.max(0,e/40|0),n={}){const i=_z(n),s=i.fullChunkFenceAware??!0,o=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:vh(Math.ceil(e/o),8e3,64e3),maxChunkLines:vh(Math.ceil(t/o),150,700),maxChunks:vh(Math.ceil(e/64e3),o,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:s,maxChunks:i.fullChunkMaxChunks}}function tI(e,t=Math.max(0,e/40|0),n={}){const i=_z(n),s=i.streamChunkFenceAware??!0,o=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:vh(Math.ceil(e/o),8e3,64e3),maxChunkLines:vh(Math.ceil(t/o),150,700),maxChunks:vh(Math.ceil(e/64e3),o,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:s}}var a7e={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},u7e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},c7e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function i9(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function l2(e,t){if(i9(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const nI=e=>i9(e)?e:Promise.resolve(e);function bp(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Ai(e)}}function cc(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${bp(t[0])}="${Ai(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} +`;const o=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${i}`;return o<0?r.push(["class",l]):(r[o]=r[o].slice(),r[o][1]+=` ${l}`),`
    ${t}
    +`}return`
    ${t}
    +`}function d0(e){return!e.attrs||e.attrs.length===0?`${Ai(e.content)}`:`${Ai(e.content)}`}function s8(e){const t=Ai(e.content);return e.attrs?`${t} +`:`
    ${t}
    +`}function d7e(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function iI(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function f7e(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function sI(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function Fv(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,s=e.tag;if(!n||n.length===0)return i===0?t?`<${s} />`:`<${s}>`:i===-1?``:`<${s}>`;let o=(i===-1?"`}const h7e={langPrefix:"language-",xhtmlOut:!1,breaks:!1},km=Object.prototype.hasOwnProperty,ti={code_inline(e,t){return d0(e[t])},code_block(e,t){return s8(e[t])},fence(e,t,n,i,s){const o=e[t],r=o.info?kz(o.info).trim():"",{langName:l,langAttrs:a}=Mz(r),u=n.highlight,c=Ai(o.content);if(!u)return Ap(o,c,r,l,n);const d=u(o.content,l,a);return i9(d)?d.then(f=>Ap(o,f||c,r,l,n)):Ap(o,d||c,r,l,n)},image(e,t,n,i,s){const o=e[t],r=s.renderInlineAsText(o.children||[],n,i),l=o.attrIndex("alt");return l>=0&&o.attrs?o.attrs[l][1]=r:o.attrs?o.attrs.push(["alt",r]):o.attrs=[["alt",r]],Fv(o,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`:`
    +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    +`:`
    +`:` +`},text(e,t){return Ai(e[t].content)},text_special(e,t){return Ai(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function oI(e,t,n){const i=e.info?kz(e.info).trim():"",{langName:s,langAttrs:o}=Mz(i),r=t.highlight,l=Ai(e.content);if(!r)return Ap(e,l,i,s,t);const a=r(e.content,s,o);if(i9(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Ap(e,a||l,i,s,t)}function w3(e,t,n,i){switch(e.type){case"text":return t.text===ti.text?e.content.length===0?"":Ai(e.content):null;case"text_special":return t.text_special===ti.text_special?e.content.length===0?"":Ai(e.content):null;case"softbreak":return t.softbreak===ti.softbreak?i:null;case"hardbreak":return t.hardbreak===ti.hardbreak?n:null;case"html_inline":return t.html_inline===ti.html_inline?e.content:null;case"code_inline":return t.code_inline===ti.code_inline?d0(e):null;default:return null}}function p7e(e,t,n,i,s){const o=e[0];switch(o.type){case"text":if(s.text===ti.text)return o.content.length===0?"":Ai(o.content);break;case"text_special":if(s.text_special===ti.text_special)return o.content.length===0?"":Ai(o.content);break;case"softbreak":if(s.softbreak===ti.softbreak)return t.breaks?t.xhtmlOut?`
    +`:`
    +`:` +`;break;case"hardbreak":if(s.hardbreak===ti.hardbreak)return t.xhtmlOut?`
    +`:`
    +`;break;case"html_inline":if(s.html_inline===ti.html_inline)return o.content;break;case"code_inline":if(s.code_inline===ti.code_inline)return d0(o);break}const r=s[o.type];if(!r)return Fv(o,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:l2(l,o.type)}var g7e=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...ti}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),s=n??{},o=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",g="",m=!1,y="";for(let A=0;A0&&e[A-1].hidden?` +`:"";if(C==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&A+3${this.renderInlineTokens(S.children||[],i,s)}`,A+=3;continue}}if(A+2 +`,A+=2;continue}}}if(C==="inline"){const _=b.children||[];if(_.length===1){m||(l=o.text,a=o.text_special,u=o.softbreak,c=o.hardbreak,d=o.html_inline,f=o.code_inline,h=i.xhtmlOut?`
    +`:`
    +`,g=i.breaks?h:` +`,m=!0);const S=_[0];switch(S.type){case"text":if(l===ti.text){y+=Ai(S.content);continue}break;case"text_special":if(a===ti.text_special){y+=Ai(S.content);continue}break;case"softbreak":if(u===ti.softbreak){y+=g;continue}break;case"hardbreak":if(c===ti.hardbreak){y+=h;continue}break;case"html_inline":if(d===ti.html_inline){y+=S.content;continue}break;case"code_inline":if(f===ti.code_inline){y+=d0(S);continue}break}}y+=this.renderInlineTokens(_,i,s);continue}const x=o[C];if(!x){const _=b.attrs;if(!b.hidden){if(!_||_.length===0)switch(C){case"hr":y+=r?`


    +`:`
    +`;continue;case"heading_open":y+=`<${b.tag}>`;continue;case"heading_close":y+=` +`;continue;case"paragraph_open":y+=`${v}

    `;continue;case"paragraph_close":y+=`

    +`;continue;case"list_item_open":{const S=e[A+1];y+=v+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
  • ":`
  • +`);continue}case"list_item_close":y+=`
  • +`;continue;case"bullet_list_open":y+=`${v}
      +`;continue;case"bullet_list_close":y+=`
    +`;continue;case"blockquote_open":y+=v+(e[A+1]&&e[A+1].nesting===-1&&e[A+1].tag==="blockquote"?"
    ":`
    +`);continue;case"blockquote_close":y+=`
    +`;continue;case"ordered_list_open":y+=`${v}
      +`;continue;case"ordered_list_close":y+=`
    +`;continue;case"table_open":y+=`${v} +`;continue;case"table_close":y+=`
    +`;continue;case"thead_open":y+=`${v} +`;continue;case"thead_close":y+=` +`;continue;case"tbody_open":y+=`${v} +`;continue;case"tbody_close":y+=` +`;continue;case"tr_open":y+=`${v} +`;continue;case"tr_close":y+=` +`;continue;case"td_open":y+=`${v}`;continue;case"td_close":y+=` +`;continue;case"th_open":y+=`${v}`;continue;case"th_close":y+=` +`;continue}else if(_.length===1){const S=_[0];if(C==="ordered_list_open"&&S[0]==="start"){y+=`${v}
      +`;continue}if(C==="td_open"&&S[0]==="style"){y+=`${v}`;continue}if(C==="th_open"&&S[0]==="style"){y+=`${v}`;continue}}}y+=this.renderToken(e,A,i);continue}if(C==="code_block"&&x===ti.code_block){y+=s8(b);continue}if(C==="fence"&&x===ti.fence){y+=oI(b,i);continue}if(C==="html_block"&&x===ti.html_block){y+=b.content;continue}const I=x(e,A,i,s,this);typeof I=="string"?y+=I:y+=l2(I,b.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),s=n??{},o=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` +`:"",c=a?`> +`:">";if(!l||l.length===0)return o===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:o===-1?`${u}(n||(n={...t}),n);if(km.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),km.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(i().langPrefix=s)}if(km.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(i().xhtmlOut=s)}if(km.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(i().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...h7e,...this.baseOptions})}renderSingleToken(e,t,n,i){const s=this.rules,o=t.type;if(o==="code_block"&&s.code_block===ti.code_block)return s8(t);if(o==="html_block"&&s.html_block===ti.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(o==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[o];if(!a)return t.block?this.renderToken(e,0,r):Fv(t,r.xhtmlOut===!0);if(o==="fence"&&a===ti.fence)return oI(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:l2(u,o)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return p7e(e,t,n,this,i);const s=t.xhtmlOut===!0,o=s?`
      +`:`
      +`,r=t.breaks?o:` +`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,g=i.link_close,m=i.em_open,y=i.em_close,A=i.strong_open,b=i.strong_close;let C="";for(let v=0;v`;if(u===ti.softbreak&&v+3`,v+=1;continue}if(x.type==="em_open"&&!m&&!y&&v+2${E}`,v+=2;continue}}}if(x.type==="strong_open"&&!A&&!b&&v+2${E}`,v+=2;continue}}}switch(x.type){case"text":if(l===ti.text){const S=x.content.length===0?"":Ai(x.content);if(d===ti.html_inline&&v+1=4)return!0;continue}if(l===9){if(r+=4-r%4,o++,r>=4)return!0;continue}break}if(o0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=o+1;for(;a57)break;a++}if(a=ue,!J&&fe!==void 0&&(Me=gs(e),J=Me>=fe)),J){const Q=this.parseFullDocument(e,N,n,Me,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ds(N,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Pa(N)?.unbounded}),Q.tokens}else if(j){const Q=(ge,me,Ee)=>geEe?Ee:ge;Me===void 0&&(Me=gs(e));const re=te&&!se?tI(e.length,Me,n.options):null,Ce=re?.maxChunkChars??(W?Q(Math.ceil(e.length/z),8e3,64e3):H??1e4),le=re?.maxChunkLines??(W?Q(Math.ceil(Me/z),150,700):X??200),oe=re?.maxChunks??(W?Q(Math.ceil(e.length/64e3),z,32):U),G=e.length>0&&e.charCodeAt(e.length-1)===10,ie=q&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&re?.strategy!=="plain";if((R||ie)&&(e.length>=Ce*2||Me>=le*2)&&G){const ge=Nv(n,e,N,{maxChunkChars:Ce,maxChunkLines:le,fenceAware:re?.fenceAware??V,maxChunks:oe});return this.cache={src:e,tokens:ge,env:N,lineCount:Me,lastSegment:void 0,globalStateReason:yr(e)},this.updateCacheLineCount(this.cache,Me),this.recordChunkedParseResult(N,R?"explicit-initial-large-doc":"default-initial-large-doc"),ge}}const Ae=this.parseFullDocument(e,N,n,Me);return Me=Ae.lineCount,this.cache={src:e,tokens:Ae.tokens,env:N,lineCount:Me,lastSegment:void 0,globalStateReason:yr(e)},this.updateCacheLineCount(this.cache,Me),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ds(N,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Pa(N)?.unbounded}),Ae.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Ds(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const o=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=yr(s.src),s.globalStateReason=r);const l=r?null:o!==null?this.detectGlobalStateForAppend(s,o):yr(e),a=r||l;if(a){const N=i??s.env;ru(N);const O=yr(e),P=this.parseFullDocument(e,N,n),R=P.tokens,q=P.lineCount;return this.cache={src:e,tokens:R,env:N,lineCount:q,lastSegment:void 0,globalStateReason:O},this.updateCacheLineCount(this.cache,q),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ds(N,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Pa(N)?.unbounded}),R}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length5e3?O=8:c.length>1e3?O=6:c.length>200&&(O=4),O=Math.min(O,N);let P=null;const R=n.options?.streamContextParseStrategy??"chars",q=n.options?.streamContextParseMinChars??200,j=n.options?.streamContextParseMinLines??2;let W;const z=()=>(W===void 0&&(W=gs(c)),W),H=this.canDirectlyParseAppend(s),X=H&&this.shouldUseUnboundedAppend(e,s,c);let U=!1;if(!H)switch(R){case"lines":U=z()>=j;break;case"constructs":if(c.length>=q){U=!0;break}if(y7e(c)){U=!0;break}U=z()>=j;break;case"chars":default:U=c.length>=q}if(O>0&&U){const V=this.getTailLines(s.src,O)+c;try{const pe=this.core.parse(V,s.env,n).tokens,ue=pe.findIndex(fe=>fe.map&&typeof fe.map[1]=="number"&&fe.map[1]>O);if(ue!==-1){const fe=pe.slice(ue),Me=N-O;Me!==0&&this.shiftTokenLines(fe,Me),P={tokens:fe}}}catch{P=null}}else P=null;if(!P){const V=N;if(X)P={tokens:kp(n,c,s.env,{mode:"stream"})},V>0&&this.shiftTokenLines(P.tokens,V);else{const pe=this.core.parse(c,s.env,n);V>0&&this.shiftTokenLines(pe.tokens,V),P=pe}}let se=0;if(s.tokens.length>0&&P.tokens.length>0){const V=s.tokens[s.tokens.length-1],pe=P.tokens[0];try{V.type==="inline"&&pe.type==="inline"&&(pe.children&&pe.children.length>0&&(V.children||(V.children=[]),this.appendTokens(V.children,pe.children)),V.content=(V.content||"")+(pe.content||""),se=1)}catch{se=0}}const te=s.tokens.length;if(P.tokens.length>se){const V=s.tokens,pe=P.tokens,ue=Math.min(V.length,pe.length-se);let fe=0;for(let Me=ue;Me>0;Me--){let J=!0;for(let Ae=0;Ae0&&(se+=fe),pe.length>se&&this.appendTokens(s.tokens,pe,se)}if(s.src=e,s.globalStateReason=null,s.lineCount=N+(W??z()),s.tokens.length>te){const V=this.getLastSegment(s.tokens,e,te,s.tokens.length,e.length-c.length,N);V?s.lastSegment=V:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,X&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Ds(s.env,{area:"stream",path:X?"stream-unbounded-append":"stream-append",reason:X?"large-delta":"safe-append",unbounded:X}),s.tokens}const d=i??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Ds(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,g=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,y=!h&&!c&&g,A=m||y,b=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,v=n.options?.streamChunkSizeChars,x=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,_=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,E=n.options?.streamChunkFenceAware??!0;let D=c&&s.lineCount!==void 0?s.lineCount+gs(c):void 0;if(A){D===void 0&&(D=gs(e));const N=(z,H,X)=>zX?X:z,O=S&&!_?tI(e.length,D,n.options):null,P=O?.maxChunkChars??(b?N(Math.ceil(e.length/C),8e3,64e3):v??1e4),R=O?.maxChunkLines??(b?N(Math.ceil(D/C),150,700):x??200),q=O?.maxChunks??(b?N(Math.ceil(e.length/64e3),C,32):I),j=e.length>0&&e.charCodeAt(e.length-1)===10,W=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&O?.strategy!=="plain";if((m||W)&&(e.length>=P*2||D>=R*2)&&j){const z=Nv(n,e,d,{maxChunkChars:P,maxChunkLines:R,fenceAware:O?.fenceAware??E,maxChunks:q});return this.cache={src:e,tokens:z,env:d,lineCount:D,lastSegment:void 0,globalStateReason:yr(e)},this.updateCacheLineCount(this.cache,D),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),z}}const B=this.parseFullDocument(e,d,n,D),T=B.tokens;return D=B.lineCount,this.cache={src:e,tokens:T,env:d,lineCount:D,lastSegment:void 0,globalStateReason:yr(e)},this.updateCacheLineCount(this.cache,D),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ds(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Pa(d)?.unbounded}),T}recordChunkedParseResult(e,t){const n=Pa(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",Ds(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!Pa(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Ds(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,s=!0){const o=yr(e);U0(t)&&ru(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Sz(n,e.length,i):"no";if(r==="yes"){const a=kp(n,e,t);return Ds(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(s?gs(e):0)}}let l=i;if(r==="need-lines"&&(l=gs(e),xz(n,e.length,l))){const a=kp(n,e,t);return Ds(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?gs(e):0),{tokens:gh(t,o,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:gs(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const i=n??t.slice(e.length);if(!i)return null;const s=i.length;if(i.charCodeAt(s-1)!==10)return null;let o=0,r=-1;for(let a=0;a=2));a++);if(o<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` +`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const o=t.src.slice(0,s.srcOffset);if(!e.startsWith(o))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,s,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return s.lineStart>0&&this.shiftTokenLines(u.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=s.lineStart+gs(l),c?t.lastSegment={tokenStart:s.tokenStart+c.tokenStart,tokenEnd:s.tokenStart+c.tokenEnd,lineStart:s.lineStart+c.lineStart,lineEnd:s.lineStart+c.lineEnd,srcOffset:s.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),s=i.length;let o=null,r=0;for(;r<=s;){let l=i.indexOf(` +`,r);l===-1&&(l=s);let a=r;for(;a=3&&(o?o.marker===u&&d>=o.length&&(o=null):o={marker:u,length:d})}}if(l===s)break;r=l+1}return o!==null}peek(){return this.cache?.tokens??v7e}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let s=n;sx3?n.slice(n.length-x3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,s,o){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,o)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,o)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let s=t,o=-1;for(;s>0;){if(o=e.indexOf(` +`,o+1),o===-1)return e.length;s--}return o+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,s=t-1;for(;i>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;i--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,s,o){if(!o||this.mayContainReferenceDefinition(o))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,s,o,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,s,o,r);default:return null}}tryListTailAppendMerge(e,t,n,i,s,o,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),g=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||g==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+gs(o);t.lineCount=m;const y=this.getDocLineCount(e,m);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,s,o,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(o))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(g.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(g,m);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,A=t.lineCount??gs(t.src);t.tokens.splice(y,0,...g),t.src=e,t.env=n,t.globalStateReason=null;const b=A+gs(o);t.lineCount=b;const C=this.getDocLineCount(e,b);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const v=t.tokens[h.tbodyOpenIndex];v?.map&&(v.map[1]=C)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:C,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`);if(t<0)return null;const n=e.indexOf(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){s=l;break}}if(s<0)return null;let o=-1,r=-1;for(let l=t+1;l=0){for(let l=s-1;l>o;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:o,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const s=e[0],o=e[e.length-1];if(s.type!==t||o.type!==n||s.level!==0||o.level!==0||i!==void 0&&s.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let s=!1,o=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=gs(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;o--)n.push(s.children[o]);for(;n.length>0;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let r=o.children.length-1;r>=0;r--)n.push(o.children[r])}}}}};const lI={default:u7e,zero:c7e,commonmark:a7e};function C7e(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function w7e(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function aI(e){return e.experimental?{...e,...e.experimental}:e}function ol(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function uI(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=uI(o?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=uI(o?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=cI(o?.options,s,"fullChunkedFallback"),u=cI(o?.options,s,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new h6e;let g=null;const m=()=>(g||(g=new m7e(n)),g);let y=null;const A=()=>(y||(y=new A7e(h)),y);let b=null;const C=()=>(b||(b=new $B({fuzzyLink:!0})),b),v=S=>!c&&!!d&&!w7e(S,d),x=(S,E)=>i==="default"&&!c&&g===null&&f!==null&&S.parse===f&&v(S)&&!S.stream.enabled&&E<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,I=(S,E)=>i==="default"&&!c&&v(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&E<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,_={core:h,block:h.block,inline:h.inline,get linkify(){const S=C();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=m();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return v(this)},set(S){const E=aI(S);return this.options={...this.options,...E},(ol(S,"fullChunkSizeChars")||ol(S,"fullChunkSizeLines")||ol(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ol(S,"streamChunkSizeChars")||ol(S,"streamChunkSizeLines")||ol(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ol(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ol(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),g&&g.set(E),typeof E.stream=="boolean"&&(this.stream.enabled=E.stream,y&&(y.reset(),y.resetStats())),this},configure(S){const E=typeof S=="string"?lI[S]:S;if(!E)throw new Error("Wrong `markdown-it` preset, can't be empty");if(E.options&&this.set(E.options),E.components){const D=E.components;D.core?.rules&&this.core.ruler.enableOnly(D.core.rules),D.block?.rules&&this.block.ruler.enableOnly(D.block.rules),D.inline?.rules&&this.inline.ruler.enableOnly(D.inline.rules),D.inline2?.rules&&this.inline.ruler2.enableOnly(D.inline2.rules)}return this},enable(S,E){const D=Array.isArray(S)?S:[S],B=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const N of B){if(!N)continue;const O=N.enable(D,!0);for(let P=0;P!T.has(O));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},disable(S,E){const D=Array.isArray(S)?S:[S],B=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const N of B){if(!N)continue;const O=N.disable(D,!0);for(let P=0;P!T.has(O));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},use(S,...E){const D=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!D)throw new TypeError("MarkdownIt.use: plugin must be a function");const B=[this,...E],T=S;return c=!0,D.apply(T,B),this},render(S,E){let D;if(x(this,S.length)){E!==void 0&&(er(E),D=f3("render"));const N=D?Ef():0,O=D?J_(S,D):Y_(S);if(D&&(D.attemptMs=Ef()-N,O===null&&(D.fallbackReason="unsupported-stock-subset"),_1(E,D)),O!==null)return E!==void 0&&Ds(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),O}const B=E??{},T=this.parse(S,B);return D&&_1(B,D),m().render(T,this.options,B)},async renderAsync(S,E){let D;if(x(this,S.length)){E!==void 0&&(er(E),D=f3("render"));const N=D?Ef():0,O=D?J_(S,D):Y_(S);if(D&&(D.attemptMs=Ef()-N,O===null&&(D.fallbackReason="unsupported-stock-subset"),_1(E,D)),O!==null)return E!==void 0&&Ds(E,{area:"render",path:"stock-fast",reason:"stock-subset"}),O}const B=E??{},T=this.parse(S,B);return D&&_1(B,D),m().renderAsync(T,this.options,B)},renderIterable(S,E={}){const D=this.parseIterable(S,E);return m().render(D,this.options,E)},async renderAsyncIterable(S,E={}){const D=await this.parseAsyncIterable(S,E);return m().renderAsync(D,this.options,E)},renderInline(S,E={}){const D=this.parseInline(S,E);return m().render(D,this.options,E)},validateLink:dz,normalizeLink:fz,normalizeLinkText:hz,utils:Wbe,helpers:{...L8e},parse(S,E){if(typeof S!="string")throw new TypeError("Input data should be a String");if(E!==void 0&&er(E),I(this,S.length)){const N=E===void 0?void 0:f3("parse"),O=N?Ef():0,P=S6e(S,N);if(N&&(N.attemptMs=Ef()-O,P===null&&(N.fallbackReason="unsupported-stock-subset"),_1(E,N)),P!==null)return E!==void 0&&Ds(E,{area:"parse",path:"stock-fast",reason:"stock-subset"}),P}const D=E??{};let B;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&v(this)){const N=Sz(this,S.length);if(N==="yes"){const O=kp(this,S,D);return Ds(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),O}N==="need-lines"&&(B=gs(S))}if(!this.stream.enabled){const N=S.length,O=this.options.autoTuneChunks!==!1,P=r,R=!a&&v(this),q=!!this.options.fullChunkedFallback,j=R&&N>=2e5;let W;(q||j||B!==void 0)&&(W=B??gs(S));const z=(q||j)&&O&&!P?l7e(N,W,this.options):null;if(q||j){const H=W??0;if(q?N>=(this.options.fullChunkThresholdChars??2e4)||H>=(this.options.fullChunkThresholdLines??400):j){if(z&&z.strategy!=="plain"){const X=Nv(this,S,D,{maxChunkChars:z.maxChunkChars,maxChunkLines:z.maxChunkLines,fenceAware:z.fenceAware,maxChunks:z.maxChunks});return E&&dI(E,q?"explicit-full-chunk":"default-large-string"),X}if(q){const X=(J,Ae,Q)=>JQ?Q:J,U=this.options.fullChunkAdaptive!==!1,se=this.options.fullChunkTargetChunks??8,te=X(Math.ceil(N/se),8e3,64e3),V=X(Math.ceil(H/se),150,700),pe=U?te:this.options.fullChunkSizeChars??1e4,ue=U?V:this.options.fullChunkSizeLines??200,fe=U?X(Math.ceil(N/64e3),se,32):this.options.fullChunkMaxChunks,Me=Nv(this,S,D,{maxChunkChars:pe,maxChunkLines:ue,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:fe});return E&&dI(E,"explicit-full-chunk"),Me}}}if(B!==void 0&&v(this)&&xz(this,N,W??B)){const H=kp(this,S,D);return Ds(E,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),H}}const T=yr(S);return Ds(E,{area:"parse",path:"plain",reason:"default-plain"}),gh(D,T,()=>h.parse(S,D,this).tokens)},parseIterable(S,E={}){return er(E),i7e(this,S,E)},parseAsyncIterable(S,E={}){return er(E),s7e(this,S,E)},parseIterableToSink(S,E,D={}){return er(D),o7e(this,S,E,D)},parseAsyncIterableToSink(S,E,D={}){return er(D),r7e(this,S,E,D)},parseInline(S,E={}){if(typeof S!="string")throw new TypeError("Input data should be a String");er(E),U0(E)&&ru(E);const D=h.createState(S,E,this);return D.inlineMode=!0,h.process(D),D.tokens}};if(_.stream={enabled:!!n.stream,parse(S,E){return _.stream.enabled?A().parse(S,E,_):_.parse(S,E??{})},reset(){A().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},o?.components){const S=o.components;S.core?.rules&&_.core.ruler.enableOnly(S.core.rules),S.block?.rules&&_.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&_.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&_.inline.ruler2.enableOnly(S.inline2.rules)}return d=C7e(_),f=_.parse,_}var S7e=x7e;const Tz=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],_7e=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Lz=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],I7e=["svg","g","path"],M7e=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],E7e=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],T7e=["action","data","href","src","srcset","poster","xlink:href","formaction"],L7e=["script"],N7e=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],dc=new Set(Tz),Nz=new Set(Lz),f0=new Set([...Tz,..._7e,...Lz,...I7e]),Fz=new Set([...f0,...M7e]),F7e=new Set(E7e),D7e=new Set(T7e),Z0=new Set(L7e),Dz=new Set(N7e);function $z(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const $7e={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function Bz(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,s)=>{const o=n??i;if(o){const r=Number.parseInt(o,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return $7e[String(s??"").toLowerCase()]??t})}const bm=new Set(["http","https","mailto","tel"]),B7e=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Xc=new Set(["http","https"]);function zz(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const z7e=/^https?:\/\//i;function R7e(e){if(!z7e.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function O7e(e,t,n){if(!Cp(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function Cp(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function P7e(e,t){return t==="href"||t==="xlink:href"?Cp(e,t)?bm:Xc:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Xc:(Cp(e,t),bm)}function Ed(e,t={}){if(R7e(e))return!1;const n=$z(Bz(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const o=zz(n);return o?o==="file"?!O7e(n,i,s):Cp(i,s)?B7e.has(o):!P7e(i,s).has(o):!1}function j7e(e){const t=Bz(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=zz($z(t).toLowerCase());return n==="http"||n==="https"}function H7e(e,t={}){const n=String(e??"").trim();return n?Ed(n,t)?"":n:""}function fI(e){return H7e(e,{tagName:"img",attrName:"src"})}function W7e(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function s(f,h,g,m,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,g,m,y)}n=n||{};const o=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||s;function d(f,h,g,m){let y,A=!1,b=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(b))return!1;for(y=b+1;y<=C&&r[(y-b)%a]===f.src[y];y++);const v=Math.floor((y-b)/a);if(v=g||(b=f.bMarks[_]+f.tShift[_],C=f.eMarks[_],b=4)){for(y=b+1;y<=C&&r[(y-b)%a]===f.src[y];y++);if(!(Math.floor((y-b)/a)=2){const r=Number(o[0]),l=Number(o[1]);Number.isFinite(r)&&Number.isFinite(l)&&(s.map=[r+t,Math.min(l+t,n)])}Array.isArray(s.children)&&Rz(s.children,t,n)}}function U7e(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(W7e,t,{render(n,i){return n[i].nesting===1?`
      `:`
      +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,s)=>{const o=t,r=o.bMarks[n]+o.tShift[n],l=o.eMarks[n],a=o.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const g=d.indexOf("{"),m=g>=0?d.slice(g).trimStart():void 0;if(g===-1)f=d||void 0;else{if(f=d.slice(0,g).trim()||void 0,m?.startsWith("{")){let I=0,_=-1;for(let S=0;S0&&(h=m.slice(0,_))}h||(f=d||void 0)}if(s)return!0;const y=!!o.env.__markstreamFinal;let A=n+1,b=!1;for(;A<=i;){const I=o.bMarks[A]+o.tShift[A],_=o.eMarks[A];if(o.src.slice(I,_).trim()===":::"){b=!0;break}A++}b||(A=i);const C=o.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,b?A:i],C.meta={...C.meta??{},unclosed:!b&&!y},f&&C.attrSet("data-args",f),h)try{const I=JSON.parse(h);for(const[_,S]of Object.entries(I)){const E=S!=null&&typeof S=="object";C.attrSet(`data-${_}`,E?JSON.stringify(S):String(S))}}catch{const I=q7e(h);if(I)for(const[_,S]of Object.entries(I)){const E=S!=null&&typeof S=="object";C.attrSet(`data-${_}`,E?JSON.stringify(S):String(S))}else C.attrSet("data-attrs",h)}const v=[];for(let I=n+1;II.trim().length>0)){let I=v.join(` +`);I.endsWith(` +`)||(I+=` +`),I.endsWith(` + +`)||(I+=` +`);const _=o.tokens[o.tokens.length-1];_&&(_.raw=I);const S=[];o.md.block.parse(I,o.md,o.env,S),Rz(S,n+1,n+1+v.length),o.tokens.push(...S)}const x=o.push("vmr_container_close","div",-1);return b||(x.hidden=!0,x.map=[i,i]),o.line=b?A+1:A,!0},{alt:["paragraph","reference","blockquote","list"]})}function Wl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ks(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function s9(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const s=i[1];if(!s)continue;const o=i[2]||i[3]||i[4]||"";t.push([s,o])}return t}const K7e=/^[a-z][a-z0-9_-]*$/;function hI(e){return K7e.test(String(e??"").trim().toLowerCase())}function ml(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return hI(t)?t.toLowerCase():"";let n=1;for(;n]/.test(o)?"":hI(s)?s:""}function nf(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const s=ml(i);!s||t.has(s)||(t.add(s),n.push(s))}return n}function V7e(...e){const t=new Set,n=[];for(const i of e)for(const s of nf(i))t.has(s)||(t.add(s),n.push(s));return n}function Z7e(e){const t=nf(e);return{key:t.join(","),tags:t}}function Oz(e){return ml(e)}function G7e(e,t){const n=String(e??""),i=ml(t);if(!i)return!1;const s=Wl(i),o=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return o?o[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function Pz(e,t){const n=ml(t);return!!n&&!f0.has(n)&&!G7e(e,n)}function Q7e(e,t){const n=String(e??""),i=ml(t);if(!i)return n;const s=Wl(i),o=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(o,"").replace(r,"")}const jz=dc,Y7e=f0,Hz=new Set(Nz);Hz.delete("details");const J7e=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,X7e=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,o8=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,eAe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Dv(e){return(e.match(o8)?.[1]??"").toLowerCase()}function G6(e){return/^\s*<\s*\//.test(e)}function Q6(e,t){return jz.has(t)||/\/\s*>\s*$/.test(e)}function tAe(e,t){let n=0;for(let i=0;i0&&n--;continue}Q6(s,o)||n++}}return n}function pI(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Wl(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let s=0,o;for(;(o=i.exec(e))!==null;){const r=o[0]??"",l=!!o[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:o.index,end:o.index+r.length};s--;continue}a||s++}return null}function iAe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Wl(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,s;for(;(s=n.exec(e))!==null;){const o=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(o);if(r){i>0&&i--;continue}l||i++}return i}function $v(e){const t=e;return String(t.raw??t.content??t.markup??"")}function sAe(e){const t=e;return t.meta||(t.meta={}),t.meta}function S3(e,t,n){const i=sAe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function oAe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Wl(h)}(?=[\s>/])`,"i")),i=[];let s=!1;const o=h=>h?n.some(g=>g.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const g of i)g.raw+=h,g.inner+=h},l=()=>{!i.length||!s||(r(` +`),s=!1)},a=h=>{r(h)},u=h=>{for(let m=0;m{const g=i[i.length-1]?.tag;if(!g)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Wl(g)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!c(h),f=(h,g,m)=>{const y=m??(h.type==="html_inline"?Dv(g):"");if(!(y&&t.has(y))){r(g);return}const A=G6(g),b=!A&&Q6(g,y);if(A){if(!i.length||i[i.length-1].tag!==y){r(g);return}u(g);return}if(r(g),b){S3(h,g,"");return}i.push({tag:y,token:h,raw:g,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const g=String(h.content??"");if(d(g)?s=!1:l(),!i.length&&!o(g)){s=!1;continue}let m=0,y=!0;for(const A of h.children){const b=$v(A),C=A.type==="html_inline"?Dv(b):"",v=C&&t.has(C);let x=b;if(y&&g&&b&&(i.length||v)){const I=g.indexOf(b,m);if(I!==-1)a(g.slice(m,I)),x=g.slice(I,I+b.length),m=I+b.length;else{if(i.length&&!v)continue;y=!1}}f(A,x,C)}y&&g&&m0;continue}if(i.length&&typeof h.content=="string"){const g=$v(h),m=h.type==="html_block"?c(g):null;if(m){u(`${s?` +`:""}${m}`),s=i.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of i)S3(h.token,h.raw,h.inner)}function rAe(e){return/^\s*<\s*[!?]/.test(e)}function lAe(e){const t=new Set(Y7e);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const s=i.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function gI(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function aAe(e,t){let n=null;for(const o of e.matchAll(J7e)){const r=o.index??-1;if(r<0)continue;const l=(o[1]??"").toLowerCase();gI(l,t)&&ks(e.slice(r))===-1&&(!n||r")&&(!n||o")&&(!n||o{const h=f,g=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const C of m){const v=ml(String(C??""));v&&g.add(v)}const y=lAe(Array.from(g)),A=new Set(dAe);for(const C of g)A.add(C);return{autoCloseInlineTagSet:A,commonHtmlTags:y,customTagSet:g,shouldMergeHtmlBlockTag:C=>g.has(C)||!y.has(C)||Hz.has(C)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},o=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const g=r(f);if(!/\S/.test(g))return[];if(l(g))return[{type:"code_block",content:a(g),raw:g}];const m=g.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const y={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[y]},c=(f,h,g)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":g,d=(f,h)=>{const g=r(h);return!/\S/.test(g)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${g}`,f.children.push({type:"text",content:g,raw:g}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:g,customTagSet:m}=i(f);for(const y of h){const A=y;if(A.type!=="inline"||!Array.isArray(A.children))continue;const b=String(A.content??""),C=A.children.length?A.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(C)try{const v=cAe(C,g);if(A.children=v.children,v.pendingBuffer){const x=b.lastIndexOf(v.pendingBuffer);if(x!==-1){const I=b.slice(0,x);A.content=I,typeof A.raw=="string"&&(A.raw=I)}}}catch(v){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",v)}}oAe(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:g,customTagSet:m,shouldMergeHtmlBlockTag:y}=i(f),A=[];for(let b=0;b0){const[x,I]=A[A.length-1];if(b!==I){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const _=String(C.content??C.raw??"");if(_){const S=h[I],E=`${String(S.content||"")} +${_}`,D=ks(E),B=D===-1?null:pI(E,x,D+1);if(B){const T=E.slice(0,B.end),N=E.slice(B.end);S.content=T,S.loading=!1,h.splice(b,1),A.pop();const O=d(S,N)?[]:u(N,c(h,b,"paragraph"));O.length&&h.splice(b,0,...O),b--;continue}S.content=E,S.loading!==!1&&(S.loading=!0)}h.splice(b,1),b--;continue}}const v=s(C);if(v){if(rAe(v))continue;const x=(v.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(v);if(!x||!y(x))continue;if(o(C,v),!I)x&&!new RegExp(`^\\s*<\\s*${x}\\b[^>]*\\/\\s*>`,"i").test(v)&&iAe(v,x)>0&&A.push([x,b]);else if(A.length>0&&x&&A[A.length-1][0]===x){const[,_]=A[A.length-1],S=h[_];S.content=`${String(S.content||"")} +${v}`,S.loading=!1,A.pop(),h.splice(b,1),b--}continue}else if(A.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(b,1),b--;continue}const x=C.content||"",I=new RegExp(`<\\s*\\/\\s*${A[A.length-1][0]}\\s*>`,"i").test(x);if(x){const[,_]=A[A.length-1],S=h[_];S.content=`${S.content||""} +${x}`,S.loading!==!1&&(S.loading=!I)}I&&A.pop(),h.splice(b,1),b--}else continue}if(m.size>0){const b=new Map,C=new Map,v=_=>{let S=b.get(_);return S||(S=new RegExp(`<\\s*${_}\\b`,"i"),b.set(_,S)),S},x=_=>{let S=C.get(_);return S||(S=new RegExp(`<\\s*\\/\\s*${_}\\s*>`,"i"),C.set(_,S)),S},I=[];for(let _=0;_0){const B=I[I.length-1],T=h[B.index],N=S.type==="html_block"?x(B.tag).exec(E):null;if(N){const R=N.index+N[0].length,q=E.slice(0,R),j=E.slice(R);T.content=`${String(T.content??"")} +${q}`,Array.isArray(T.children)&&T.children.push({type:"html_inline",content:``,raw:``}),I.pop();const W=d(T,j)?[]:u(j,c(h,_,"paragraph"));W.length?h.splice(_,1,...W):(h.splice(_,1),_--);continue}if(S.type!=="inline")continue;const O=Array.isArray(S.children)?S.children:[],P=tAe(O,B.tag);if(P!==-1){const R=O.slice(0,P+1),q=O.slice(P+1),j=R.map(W=>String(W?.content??W?.raw??"")).join("");if(T.content=`${String(T.content??"")} +${j}`,Array.isArray(T.children)&&T.children.push(...R),q.length){const W=q.map(z=>String(z.content??z.raw??"")).join("");if(W.trim()){const z=W.replace(/^\s+/,"");if(d(T,W))h.splice(_,1),_--;else if(z.startsWith("<"))h.splice(_,1,{type:"html_block",content:z});else{const H=u(W,c(h,_,"paragraph"));h.splice(_,1,...H)}}else h.splice(_,1),_--}else h.splice(_,1),_--;I.pop();continue}T.content=`${String(T.content??"")} +${E}`,Array.isArray(T.children)&&T.children.push(...O),h.splice(_,1),_--;continue}if(S.type!=="inline")continue;const D=Array.isArray(S.children)?S.children:[];for(const B of m)if((D.length?nAe(D,B):v(B).test(E)&&!x(B).test(E)?1:0)>0){I.push({tag:B,index:_});break}}}{let b=0;for(let C=0;C0?b--:(h.splice(C,1),C--))}}for(let b=0;b/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){C.loading=!1;continue}if(m.has(S)){const P=String(C.content??""),R=ks(P),q=R===-1?null:pI(P,S,R+1);C.loading=q?!1:C.loading!==void 0?C.loading:!0;const j=q?.start??-1,W=q?q.end-q.start:0;if(j!==-1){const z=P.slice(0,j+W);let H="";R!==-1&&R]+)))?/g;let D;for(;(D=E.exec(C.content||""))!==null;)D[1],D[2]||D[3]||D[4];const B=String(C.content??""),T=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(B),N=T?T.index:-1,O=T?T[0].length:0;if(N!==-1){const P=B.slice(0,N+O),R=(B.slice(N+O)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:P,tag:S,loading:!1}],C.content=P,C.raw=P,R&&h.splice(b+1,0,R.startsWith("<")?{type:"html_block",content:R}:{type:"text",content:R,raw:R})}else C.children=[{type:"html_block",content:C.content,tag:S,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),E=C.children[1],D=String(E?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(E?.type==="html_inline"&&D===S)continue;g.has(S)?(C.children[0].loading=!0,C.children[0].tag=S,C.children.push({type:"html_inline",tag:S,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:S,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(g.has(S))continue;C.children=[{type:"html_block",loading:!1,tag:S,content:C.children.map(E=>E.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const v=String(C.content),x=C,I=x.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(v)&&(x.children.length=0);continue}const _=String(I.content??v).match(eAe)?.[1]?.toLowerCase()??"";if(_){if(/\/\s*>\s*$/.test(v)||jz.has(_)){x.children=[{type:"html_inline",content:v}];continue}x.children.length=0}}})}function hAe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function pAe(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let s=0;sa.trim().length>0);if(l.length===1&&!hAe(l[0]??"")){const a=l[0]??"",u=o.level??0;i.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),s+=2}}})}const Wz=/\.([a-z0-9]{1,15})$/i,gAe=/[_()[\]{}<>]/u,mAe=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,vAe=/[?#@]/u,yAe=/[\\/]/u,kAe=/^[\p{L}\p{N}./\\-]+$/u,bAe=/^[A-Za-z0-9-]{1,63}$/u,AAe=/^xn--[a-z0-9-]{2,59}$/i,CAe=/^(?:[A-Z]{1,6}|\d{1,8})$/u,wAe=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,xAe=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,SAe=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,_Ae=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,IAe=2e3,MAe=512,EAe={},TAe=new Set(["ai","md","py","rs","sh","zip"]),qz=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),LAe=new Set([...qz,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),NAe=new Set(["com","dev","io","page","site"]),FAe=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),DAe=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),vd=new Map;function mI(e,t){if(!e||e.length>MAe)return t;for(vd.set(e,t);vd.size>IAe;){const n=vd.keys().next().value;if(!n)break;vd.delete(n)}return t}function h0(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function _3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return h0(n)?n:void 0}function vI(e,t){if(!h0(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function yI(e){const t=G0(e);return h0(t)?t:void 0}function $Ae(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function kI(e,t){if(!h0(t))return;const n=String(e??"").trim().split(/\s+/u).map($Ae).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(s=>Bv(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(s=>Bv(s,{marketTicker:!0}))&&(i.marketTicker=!0),h0(i)?i:void 0}function Tc(e,t=!1){let n;return{options(i){return t||i==null?vI(e,n):vI(e,_3(yI(i),kI(i,n)))},remember(i){const s=yI(i);n=t?_3(n,s):_3(s,kI(i,n))},reset(){n=void 0}}}function bI(e){return bAe.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function BAe(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return bI(n)||AAe.test(n)?t.every(bI):!1}function Uz(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function zAe(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function RAe(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function Kz(e,t,n){const i=zAe(t);return Uz(e)&&RAe(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function OAe(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function G0(e){const t=String(e??""),n=vd.get(t);return n?(vd.delete(t),vd.set(t,n),n):OAe(t)?mI(t,{explicitFilename:xAe.test(t),filename:SAe.test(t),marketTicker:_Ae.test(t)}):mI(t,EAe)}function PAe(e){return BAe(e.split(/[\\/]/)[0]??"")}function jAe(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function HAe(e){if(gAe.test(e)||!kAe.test(e))return!0;if(yAe.test(e))return!PAe(e);const t=e.replace(Wz,"");return Uz(t)?!0:t.split(".").filter(Boolean).some(jAe)}function WAe(e,t,n){if(!(n?LAe:qz).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?wAe:CAe).test(i)}function Bv(e,t={}){if(!e||mAe.test(e)||vAe.test(e))return!1;const n=e.match(Wz);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return WAe(e,i,t.marketTicker===!0)?!0:DAe.has(i)?!TAe.has(i)||t.filename?!0:HAe(e):!!(t.explicitFilename&&NAe.has(i)||t.filename&&FAe.has(i))}const Vz=new WeakMap,Zz=new WeakSet;function r8(e,t){return Vz.set(e,t),e}function qAe(e){return Vz.get(e)}function UAe(e){Zz.add(e)}function KAe(e){return e===void 0||Zz.has(e)}const AI=["!"];function CI(e){return e==="linkify"||e==="autolink"?e:"recovery"}function pr(e){return{type:"text",content:e,raw:e}}function ed(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function td(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function xu(e,t,n,i="recovery"){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return r8({type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function VAe(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(pr(t))}}function wI(e,t){let n=-1;for(const i of t){const s=e.indexOf(i);s!==-1&&(n===-1||sn?.[0]==="href")?.[1];return typeof t=="string"?t:""}function GAe(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function xI(e,t,n){let i="";for(let s=t+1;s{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let s=0;for(let r=0;r0&&u?SI(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?s++:d===")"&&s>0&&s--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?s++:a===")"&&s>0&&s--}const o=G0(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const g=SI(u);g!==-1&&(d===-1||g=m.content.length){h-=m.content.length;continue}if(h<0)break;const y=m.content[h],A=m.content.slice(0,h);let b=m.content.slice(h);for(let x=g+1;x0&&(e.splice(g+1,C),a=g+1);let v=c;if(y==="!"&&f!==-1)v=c.slice(0,f);else if(b){const x=encodeURI(b);if(x&&c.endsWith(x))v=c.slice(0,c.length-x.length);else{const I=y?encodeURI(y):"",_=I?c.indexOf(I):-1;_!==-1&&(v=c.slice(0,_))}}v!==c&&GAe(l,v),b&&e.splice(a+1,0,pr(b));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(xu(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(pr(h)),e.splice(r-4,8,...a)}else a.push(r8({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(A=>A[0]==="href")?.[1]||"",d=u.find(A=>A[0]==="title")?.[1]||"";let f=3,h=2;const g=(e[r-3]?.content||"").match(/^(\*+)$/),m=[];if(g){h+=1;const A=g[1].length;ed(m,A)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let A=r+1;Ay[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(m||f)+e[r+5].content,e[r+5].content=""):f=m||f,h+=3}let g=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const m=(e[r+2]?.content??"").indexOf(")");g=m===-1,m===-1&&(f+=e[r+2]?.content?.slice(0,m)||"",e[r+2].content="")}a.push(xu(d,f,g)),td(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];ed(d,2),d.push(xu(u,c,!1)),td(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[g].type==="text"&&e[g].content==="";)g--;const m=e[g];let y=c+1;for(;y=0&&e[g].type==="text"&&e[g].content==="";)g--;const m=e[g];let y=c+1;for(;y{const n=t;try{const i=cCe(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function _I(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function II(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function MI(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function Gz(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function I3(e){return Gz(e)!==null}function Qz(e){return/^:?-+:?$/.test(e.trim())}function oCe(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(Qz)}function rCe(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function lCe(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(Qz)&&rCe(n)}function aCe(e){return e==="|"||e==="|:"}function uCe(e){const t=Gz(e);return t!==null&&t.every(n=>!n.includes(":"))}function cCe(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const s=e.length-2,o=e[s];if(o.type==="inline"){const r=String(o.content??""),l=r.split(` +`)[0]??"",[a="",u="",...c]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&I3(r);if(!t&&(r.includes(` +`)&&c.length===0&&I3(a)&&lCe(u)||d)){const f=l.slice(1,-1).split("|").map(g=>g.trim()).flatMap(g=>MI(g)),h=[..._I(),...f,...II()];i.splice(s-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&I3(a)&&oCe(u)){const f=l.slice(1,-1).split("|").map(g=>g.trim()).flatMap(g=>MI(g)),h=[..._I(),...f,...II()];i.splice(s-1,3,...h)}else r.includes(` +`)&&c.length===0&&uCe(a)&&aCe(u)&&(o.content=r.slice(0,-2),o.children.splice(2,1))}return i}function dCe(e,t,n,i){const s=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const o=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===o?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var fCe=dCe;const hCe=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],zv=hCe.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),pCe=/\\[a-z]+/i,Yz="(?:\\\\|\\u0008)",gCe=new RegExp(String.raw`${Yz}(?:${zv})\s*\{[^}]+\}`,"i"),mCe=new RegExp(String.raw`(?:${Yz})?(?:${zv})\s*\{`,"i"),vCe=/\\(?:text|frac|left|right|times)/,yCe=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,kCe=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,bCe=/[A-Z]+\s*\([^)]+\)/i,ACe=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,CCe=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,wCe=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,xCe={"\b":"\\b","\v":"\\v","\f":"\\f"};function SCe(e){let t="";for(const n of e)t+=xCe[n]??n;return t}function ju(e){if(!e)return!1;const t=SCe(e),n=t.trim();if(wCe.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=pCe.test(t),s=gCe.test(t),o=mCe.test(t),r=vCe.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=yCe.test(t)&&!kCe.test(t),u=bCe.test(t),c=ACe.test(n),d=CCe.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||s||o||r||l||a||u||c||d||f||h}const Jz="__markstreamMathPluginApplied",l8=80,Xz=2e4,EI=Xz+4096;function Y6(e){return!!e[Jz]}function _Ce(e){e[Jz]=!0}const eR=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],ICe=["cdot","mathbf{","partial","mu_{"],tR=eR.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),nR="[ \r\b\f\v]",MCe=new RegExp(`([^\\\\])(${ICe.map(e=>e).join("|")})+`,"g"),ECe=/span\{([^}]+)\}/,TCe=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,LCe=/(^|[^\\])\\\r?\n/g,NCe=/(^|[^\\])\\$/g,FCe=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,DCe=new RegExp(`(${nR})|(${tR})\\b`,"g"),TI=new Map,LI=new Map;function $Ce(e){if(!e)return DCe;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=TI.get(n);if(i)return i;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,o=new RegExp(`(${nR})|(${s})\\b`,"g");return TI.set(n,o),o}function BCe(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),s=LI.get(i);if(s)return s;const o=e?[zv,tR].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),zv].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${o})\\s*\\{`,"g");return LI.set(i,r),r}const NI={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function FI(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function zCe(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&FCe.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function DI(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Su(e,t){const n=t?.commands??eR,i=t?.escapeExclamation??!0,s=t?.commands==null,o=$Ce(s?void 0:n);let r=e.replace(o,(u,c,d,f,h)=>{if(c!==void 0&&NI[c]!==void 0)return`\\${NI[c]}`;if(d&&n.includes(d)){const g=h&&typeof f=="number"?h[f-1]:void 0;return g==="\\"||g&&/\w/.test(g)?u:`\\${d}`}return u});i&&(r=zCe(r));let l=r;const a=BCe(s,s?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(ECe,"span\\{$1\\}").replace(TCe,"\\operatorname{span}\\{$1\\}"),l=l.replace(LCe,`$1\\\\ +`),l=l.replace(NCe,"$1\\\\"),l=l.replace(MCe,"$1\\$2"),l}function $I(e){const t=e.trim();return!(!ju(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function iR(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[o]==="\\"&&o+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function a8(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=Rv(s,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}Q0(e,a)||o++,r=a+Math.max(1,t.length)}return o}function J6(e,t,n){const i=g0(String(e??""));if(!i.endsWith(t))return-1;const s=i.length-t.length;if(s<=0||!g0(i.slice(0,s)).trim()||Q0(i,s))return-1;const o=iR(i);if(Rv(o,s))return-1;const r=BI(i,t,0,s,o);if(t==="$$"){if(r%2===1)return-1}else if(r>BI(i,n,0,s,o))return-1;return s}function p0(e){return e===" "||e===" "}function g0(e){let t=e.length;for(;t>0&&p0(e[t-1]);)t--;return e.slice(0,t)}function zI(e){let t=0;for(let n=0;n=48&&t<=57}function OCe(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function PCe(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function jCe(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(PCe)}function HCe(e){let t=0;if(!RI(e[t]))return!1;for(;RI(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:p0(e[t+1])}function sR(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&p0(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&p0(t[1])||HCe(t)||OCe(t)||jCe(t))}function OI(e,t){return e?t?`${e} +${t}`:e:t}function u8(e){const t=String(e??"").trim();return t?ju(t):!1}function PI(e){let t=0;for(let n=0;nl8){h=!0;break}const m=s[g],y=jf(m,c);if(y!==-1){const A=OI(f,m.slice(0,y));if(!u8(A)){h=!0;break}const b=m.slice(y+c.length),C=b.trim()?`suffix:${PI(b)}`:"nosuffix";return["closed",u,i+l,d,i+g,y,PI(A),C].join(":")}if(sR(m)){h=!0;break}if(f=OI(f,m),f.length>Xz){h=!0;break}}if(!h&&u8(f))return["pending",u,i+l,d].join(":")}}return null}function E3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function qCe(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function T3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function UCe(e,t){_Ce(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(b,C)=>{let v=C;for(;v=3&&(!v||/\s/.test(v))){const x=a.push("text","",0);return x.content=a.src.slice(a.pos,b),a.pos=b,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),g=Math.max(0,a.pos-h.length);let m=g,y=g;const A=g;for(const[b,C]of f){const v=a.src,x=iR(v),I=RCe(v,c);let _=!1;b==="$$"&&m!==A&&(m=A);let S=-1,E=-1,D=0;const B=T=>{if((T==="undefined"||T==null)&&(T=""),T==="\\"){a.pos=a.pos+T.length,m=a.pos;return}if(T==="\\)"||T==="\\("){const P=a.push("text_special","",0);P.content=T==="\\)"?")":"(",P.markup=T,a.pos=a.pos+T.length,m=a.pos;return}if(!T)return;if(b==="$$"&&T.includes("$")){let P=0;for(;P0&&T[R-1]==="$"||R+10){const q=T.slice(0,N),j=a.push("text","",0);j.content=q,a.pos=a.pos+q.length,m=a.pos}const P=T.slice(N).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(P){const[,q,j]=P,W=j.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),z=W?W[1]:j,H=W&&W[2]?W[2]:null,X=a.push("image","img",0);X.attrs=[["src",z],["alt",q]],H&&X.attrs.push(["title",H]),X.content=q,X.children=[{type:"text",content:q,tag:""}],a.pos=a.pos+P[0].length,m=a.pos;const U=T.slice(N+P[0].length);U&&B(U);return}const R=a.push("text","",0);R.content=T,a.pos=a.pos+T.length,m=a.pos;return}const O=a.push("text","",0);O.content=T,a.pos=a.pos+T.length,m=a.pos};for(;!(m>=v.length);){const T=v.indexOf(b,m);if(T===-1)break;if(Q0(v,T)){m=T+Math.max(1,b.length);continue}const N=Rv(x,T);if(N){m=N[1];continue}const O=Rv(I,T);if(O){m=O[1];continue}if(T===S&&m===E){if(D++,D>2){m=T+Math.max(1,b.length);continue}}else D=0,S=T,E=m;if(b==="("&&T>0){let U=T-1;for(;U>=0&&v[U]===" ";)U--;if(U>=0&&v[U]==="]"){m=T+b.length;continue}}if(b==="$"&&T>0&&v[T-1]==="$"){m=T+1;continue}if(b==="$"&&T=v.length);){const N=a8(v,T);if(N===-1)break;if(N+10&&v[N-1]==="$"){T=N+1;continue}const O=M3(v,N+1);if(O===-1)break;const P=v.slice(N+1,O),R=P.includes("`"),q=!P||!P.trim(),j=v[O+1],W=E3(P,j),z=T3(P);if(!R&&!q&&!W&&!z){const H=v.slice(m,N);H&&B(H);const X=a.push("math_inline","math",0);X.content=Su(P,t),X.markup="$",X.raw=`$${P}$`,X.loading=!1,m=O+1,T=O+1}else B("$"),T=N+1}T{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],g=c.bMarks[l]+c.tShift[l];let m=c.src.slice(g,c.eMarks[l]).trim(),y=!1,A="",b="",C=!1,v="",x=!1;for(const[H,X]of h)if(m.startsWith(H))if(H.includes("[")){const U=H==="\\["?m.slice(H.length):"";if(H==="\\["&&jf(U,X)===-1&&!/^\s*!\[/.test(U)&&!U.includes("`")&&ju(U)){y=!0,A=H,b=X;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1=0?"\\]":b,D=S>=0?S:jf(m,b,_);if(!C&&D>A.length){const H=m.slice(I+A.length,D),X=c.push("math_block","math",0);X.content=Su(H),X.markup=A==="$$"?"$$":A==="["?"[]":"\\[\\]",X.map=[l,l+1],X.raw=`${A}${H}${E}`,X.block=!0,X.loading=!1,c.line=l+1;const U=m.slice(D+E.length);return U.trim()&&n(c,U,l),!0}let B=l,T="",N=!1,O="",P=l;const R=C?m:m===A?"":m.slice(A.length),q=!f&&A==="\\["?"]":"",j=jf(R,b);if(j!==-1){const H=j;T=R.slice(0,H),O=R.slice(H+b.length),P=C?l+1:l,N=!0,B=P}else for(R&&!C&&(T=R),B=l+1;B{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function KCe(e){const t=e.renderer.rules.image||function(n,i,s,o,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,s):""};e.renderer.rules.image=(n,i,s,o,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,s,o,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const s=n[i],o=String(s.info??"").trim();return`
      ${e.utils.escapeHtml(String(s.content??""))}
      `})}const VCe=/^\s]/i,ZCe=/^<\/a\s*>/i;function GCe(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let s=n.length-1;s>=0;s--){const o=n[s];if(o?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==o.level&&n[s]?.type!=="link_open";)s--;continue}if(o?.type==="html_inline"){const r=String(o.content??"");VCe.test(r)&&i>0&&i--,ZCe.test(r)&&i++}if(!(i>0)&&o?.type==="text"&&t.test(String(o.content??"")))return!0}return!1}function QCe(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const s=Array.isArray(i.tokens)?i.tokens:[],o=i.md.linkify;if(!o)return;const r=s.filter(l=>GCe(l,o));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function YCe(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof s!="function")return;const o=e.validateLink,r=e;r.__markstreamOriginalValidateLink=o,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===o?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const u=a.validateLink;a.validateLink=o;try{return s(...l)}finally{a.validateLink=u}})}function JCe(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),o=new S7e({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!s){const r=l=>!Ed(l,{tagName:"a",attrName:"href"});UAe(r),o.set({validateLink:r})}return YCe(o),QCe(o),(e.enableMath??!0)&&UCe(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&U7e(o),e.enableFixIndentedCodeBlock!==!1&&pAe(o),QAe(o),eCe(o),JAe(o),sCe(o),KCe(o),fAe(o,{customHtmlTags:e.customHtmlTags}),o}function Td(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Td(n))),t}function XCe(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function ewe(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function twe(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Am(e,t,n){const i=[];let s="",o=t+1;const r=[];for(;on.startsWith(t)||t.startsWith(n)):!1}function jI(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function HI(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function owe(e,t){const n=[],i=[],s=[],o=[],r=e.split(iwe),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const g=h;if(!lR.some(m=>g.startsWith(m)))if(g.startsWith("-")){const m=g.slice(1);s.push(HI(m,a))}else if(g.startsWith("+")){const m=g.slice(1);o.push(HI(m,a))}else{jI(n,i,s,o);const m=a&&g.startsWith(" ")?g.slice(1):g;n.push(m),i.push(m)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||o.length>0)&&jI(n,i,s,o);const d=n.join(` +`),f=i.join(` +`);return{original:t&&l&&d?`${d} +`:d,updated:t&&l&&f?`${f} +`:f}}function X6(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,s=i===!0||i!==!1&&t,o=String(e.info??""),r=o.startsWith("diff"),l=r?(()=>{const u=o,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():o;let a=String(e.content??"");if(!s&&e.markup){const u=e.markup[0],c=e.markup.length,d=nwe(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=owe(a,s===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function rwe(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function lwe(){return{type:"hardbreak",raw:`\\ +`}}function awe(e,t,n){const i=[];let s="",o=t+1;const r=[];for(;o\s*$/.test(t)||dc.has(e)}function uwe(e){if(!e||e.length===0)return WI();const t=N3.get(e);if(t)return t;const n=e.map(ml).filter(Boolean);if(!n.length){const s=WI();return N3.set(e,s),s}const i={customTagSet:new Set(n),allowedTagSet:a9({customHtmlTags:e})};return N3.set(e,i),i}function dR(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function cwe(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function Ov(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[s,o]=e[i];if(String(s).toLowerCase()===n)return o}}function dwe(e,t,n){const i=e.slice();return Ov(i,"href")||i.push(["href",t]),n!=null&&!Ov(i,"title")&&i.push(["title",n]),i}function c8(e){return e.map(dR).join("")}function a2(e){const t=[],n=i=>{const s=String(i??"");if(!s)return;const o=t[t.length-1];if(o?.type==="text"){o.content=`${o.content}${s}`,o.raw=`${o.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:a2(i.children)});continue}t.push(i)}return t}function fwe(e,t,n){let i=0;for(let s=t;s`;m.toLowerCase().includes(x.toLowerCase())||(m+=x),A=!0,y=!0}const b=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let v;for(;(v=C.exec(l))!==null;){const x=v[1],I=v[2]||v[3]||v[4]||"";b.push([x,I])}if(u?.has(a)){const x=cwe(e);return[{type:a,tag:a,attrs:b,content:x?x.inner:h.innerTokens.length?c8(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,s,o,r):[],raw:x?.raw??m,loading:e.loading||y,autoClosed:A},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:m,children:g,raw:m,loading:y,autoClosed:A},h.nextIndex]}function fR(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>fR(t)).join(""):String(e.content??"")}function pwe(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>fR(t)).join("")}function qI(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),o=n.find(d=>d[0]==="alt")?.[1],r=pwe(i??e);let l="";r?l=r:o!=null&&String(o).length>0?l=String(o):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:s,alt:l,title:u,raw:c,loading:t}}function gwe(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function mwe(e,t,n){const i=[];let s="",o=t+1;const r=[];for(;o=0;i--){const[s,o]=e[i];if(String(s).toLowerCase()===n)return o}}function ywe(e,t,n){const i=e.slice();return Pv(i,"href")||i.push(["href",t]),n!=null&&!Pv(i,"title")&&i.push(["title",n]),i}function Cm(e,t,n){const i=e[t],s=vwe(i.attrs),o=String(Pv(s,"href")??""),r=Pv(s,"title"),l=r==null?null:String(r),a=ywe(s,o,l);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(h.content??""),A=String(h.raw??y),b=Td(h);b.content=y.slice(0,-2),b.raw=A.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=b}const g=as(f,void 0,void 0,n),m=g.map(y=>{const A=y;return"content"in y?String(A.content??""):String(A.raw??"")}).join("");return{node:{type:"link",href:o,title:l,text:m,children:g,raw:`[${m}](${o}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:o0?i:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:o?@[\\\]^_`{|}~]/,Lwe=/\p{P}/u,Nwe=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,Fwe=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,Dwe=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,$we=/:\/\//,d8=1,hR=2,Bwe=4,zwe=8,pR=16,Nu=32,u2=64,ep=128,gR=256,Rwe=512,tp=1024,Owe=1982;function wm(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function fc(e){return!!e&&Ewe.test(e)}function hc(e){return!!e&&(Twe.test(e)||Lwe.test(e))}function vR(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&Nwe.test(e)}function yR(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&Fwe.test(e)}function jwe(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||fc(i)?!1:!(hc(i)&&!vR(i,n)&&n&&!fc(n)&&!hc(n))}function Hwe(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||fc(n)?!1:!(hc(n)&&!yR(n,i)&&i&&!fc(i)&&!hc(i))}function Wwe(e,t,n=0){let i=n,s=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||fc(i)?!1:!(hc(i)&&!vR(i,n)&&n&&!fc(n)&&!hc(n))}function Uwe(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||fc(n)?!1:!(hc(n)&&!yR(n,i)&&i&&!fc(i)&&!hc(i))}function Kwe(e,t=0){let n=t,i=!1;for(;n=0&&e[o]==="\\";o--)s++;return s%2===1}const Qwe=/[\p{L}\p{N}]/u,Ywe=/^[\p{L}\p{N}]+$/u;function f8(e){return e?Qwe.test(e):!1}function kR(e){return e?Ywe.test(e):!1}function wp(e,t){let n=t;for(;n0?e[t-1]:void 0,s=n=2&&i.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n=3)return i;n=i+s.len}return-1}function txe(e){return e?Dwe.test(e)||$we.test(e):!1}function nxe(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function as(e,t,n,i){if(!e||e.length===0)return[];const s=i?.__linkifyDemotionContext,o=G0(t),r={filename:s?.filename||o.filename,explicitFilename:s?.explicitFilename||o.explicitFilename,marketTicker:s?.marketTicker||o.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function g(){u=null}function m(J,Ae){const Q=e.length===1?t:String(Ae.content??""),re=[],Ce=Jwe(J);if(Ce!==-1){x(J.slice(0,Ce),J.slice(0,Ce));const oe=J.slice(Ce);return oe&&(B({type:"text",content:oe,raw:oe}),c--),c++,!0}if(Swe.test(J)){const oe=J.indexOf("~~");oe!==-1&&re.push({type:"strikethrough",index:oe})}if(_we.test(J)){const oe=J.indexOf("**");oe!==-1&&re.push({type:"strong",index:oe})}if(/[^*]*\*[^*]+/.test(J)){const oe=Q?mR(Q,0):J.indexOf("*");if(Q&&oe===-1)return!1;oe!==-1&&re.push({type:"emphasis",index:oe})}re.sort((oe,G)=>oe.index!==G.index?oe.index-G.index:oe.type===G.type?0:oe.type==="strong"?-1:G.type==="strong"?1:0);const le=re[0];if(!le)return!1;if(le.type==="strikethrough"){const oe=le.index,G=oe>-1?J.slice(0,oe):"";if(G&&x(G,G),oe===-1)return c++,!0;const ie=J.indexOf("~~",oe+2),ge=ie===-1?J.slice(oe+2):J.slice(oe+2,ie),me=ie===-1?"":J.slice(ie+2),{node:Ee}=KI([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return g(),v(Ee),me&&(B({type:"text",content:me,raw:me}),c--),c++,!0}if(le.type==="strong"){const oe=le.index,G=oe>-1?J.slice(0,oe):"";if(G&&x(G,G),oe===-1)return c++,!0;if(t&&oe===0){let we=!1,Ne=0;for(;Ne=2)return x(J,J),c++,!0}}if(t&&(J.match(/\*/g)||[]).length>Pwe(t))return x(J.slice(G.length),J.slice(G.length)),c++,!0;const ie=wp(J,oe);if(ie.len>=3){const we=exe(J,oe+ie.len);if(we!==-1){const Ne=J.slice(oe+ie.len,we);if(Xwe(Ne)){const{node:it}=I1([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Ne,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);g(),v(it);const De=J.slice(we+3);return De&&(B({type:"text",content:De,raw:De}),c--),c++,!0}}}if(!qwe(J,oe)){const we=J.slice(oe,oe+ie.len);x(we,we);const Ne=J.slice(oe+ie.len);return Ne&&(B({type:"text",content:Ne,raw:Ne}),c--),c++,!0}const ge=Kwe(J,oe+2);let me="",Ee="";if(ge.index!==-1){me=J.slice(oe+2,ge.index),Ee=J.slice(ge.index+2);const we=ge.index,Ne=wp(J,we);if(ie.intraword&&Ne.intraword&&!kR(me)||!me&&ie.len>=4&&ie.intraword)return x(J.slice(G.length),J.slice(G.length)),c++,!0}else{if(d||ge.sawInvalidClose||ie.intraword)return x(J.slice(G.length),J.slice(G.length)),c++,!0;me=J.slice(oe+2),Ee=""}if(!me&&/^\*+$/.test(Ee))return x(J,J),c++,!0;const{node:Qe}=I1([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return g(),v(Qe),Ee&&(B({type:"text",content:Ee,raw:Ee}),c--),c++,!0}if(le.type==="emphasis"){let oe=le.index;oe===-1&&(oe=0);const G=J.slice(0,oe);if(G&&x(G,G),!jwe(J,oe)){x(J[oe],J[oe]);const we=J.slice(oe+1);return we&&(B({type:"text",content:we,raw:we}),c--),c++,!0}const ie=wp(J,oe),ge=Wwe(Q,J,oe+1),me=ge.index,Ee=e[c+1];if(i?.final&&Ee?.type==="em_open"&&me!==-1&&J.slice(oe+1,me).trim()!==J.slice(oe+1,me)||me===-1&&(ge.sawInvalidClose||i?.final||ie.intraword||!f8(J[oe+1])))return x(J.slice(oe),J.slice(oe)),c++,!0;const{node:Qe}=Am([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me>-1?J.slice(oe+1,me):J.slice(oe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(g(),v(Qe),me!==-1&&me{for(let Qe=0;Qe=0&&Ee[Ne]==="\\";Ne--)we++;if(we%2===0)return Qe}return-1})(J);if(re===-1)return!1;let Ce=1;for(let Ee=re+1;Eele?.type==="math_inline")||!Iwe.test(J))return null;const Q=Ae.parseInline(J,{__markstreamFinal:!!i?.final});if(!Array.isArray(Q)||Q.length===0)return null;const re=(Q.find(le=>le?.type==="inline")?.children??[]).filter(le=>!(le?.type==="text"&&String(le.content??"")===""));if(!re.length||!re.some(le=>le?.type!=="text")||re.length===1&&re[0]?.type==="text"&&String(re[0].content??"")===J)return null;const Ce=as(re,J,n,i);return Ce.length?Ce:null}function b(J){g(),a.push(J)}function C(J){g();const Ae=Td(J);a.push(Ae)}function v(J){b(J)}function x(J,Ae){u?(u.content+=J,u.raw+=Ae??J):(u={type:"text",content:String(J??""),raw:String(Ae??J??"")},a.push(u))}function I(J,Ae){if(!J)return;const Q=as([{...Ae,type:"text",content:J,raw:J}],J,n,i);if(Q.length===1&&Q[0]?.type==="text"){const re=Q[0];x(String(re.content??""),String(re.raw??re.content??""));return}for(const re of Q)v(re)}function _(J,Ae){return String(J.markup??"").startsWith(Ae)}function S(J){if(!u||J.loading!==!0||J.markup!=="\\(\\)")return;const Ae=e[c-1];!Ae||Ae.type!=="text"||!_(Ae,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function E(J){return J.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function D(J,Ae,Q=wm(J)){let re=J;const Ce=String(Ae.content??"");return(Q&d8)!==0&&re.endsWith("\\")&&!_(Ae,"\\\\")&&!Ce.endsWith("\\\\")&&(re=re.slice(0,-1)),(Q&tp)!==0&&re.endsWith("(")&&!_(Ae,"\\(")&&!Ce.endsWith("\\(")&&(re=re.slice(0,-1)),(Q&hR)!==0&&/\*+$/.test(re)&&!_(Ae,"\\*")&&!Ce.endsWith("\\*")&&(re=re.replace(/\*+$/,"")),re}for(;c=0;we--){const Ne=a[we];if(Ne.type!=="text")break;ie=we,ge=String(Ne.content??"")+ge}ieie==="href")?.[1],G=String(oe??"");if(t&&G){const ie=t.indexOf("](");if(ie!==-1){const ge=t.indexOf(")",ie+2);ge===-1?Q.loading=!0:Q.loading&&t.slice(ie+2,ge).includes(G)&&(Q.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(Q.href)&&z(Q,Ae-1)||q(Q)||b(Q)}function P(J){if(J.markup!=="linkify")return!1;const{node:Ae,nextIndex:Q}=Cm(e,c,i);return W(Ae,Q)?(c=Q,!0):!1}function R(J){g(),v(kwe(J)),c++}function q(J){if(J.type!=="link")return!1;const Ae=a[a.length-1];if(!Ae||Ae.type!=="text")return!1;const Q=String(Ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Q)return!1;const re=J,Ce=String(re.href??""),le=String(re.text??""),oe=String(Q[2]??""),G=Ce.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Ce||!(le===Ce||le===G||txe(le)))return!1;const ie=String(Q[1]??"");return ie?(Ae.content=ie,Ae.raw=ie):a.pop(),b({...J,text:oe,children:[{type:"text",content:oe,raw:oe}],raw:`[${oe}](${Ce}${re.title?` "${re.title}"`:""})`}),!0}function j(J){if(J.type!=="link")return!1;const Ae=J,Q=String(Ae.href??"");return Q?W({href:Q,title:Ae.title==null||Ae.title===""?null:String(Ae.title),loading:!!Ae.loading},c+1):!1}function W(J,Ae){const Q=a[a.length-1];if(Q?.type!=="image"||Q.src||!Q.loading||!String(Q.raw??"").endsWith("]("))return!1;const re=e[Ae],Ce=String(re?.content??"");if(re?.type!=="text"||!Ce.startsWith(")"))return!1;a.pop(),u=null;const le=String(Q.alt??"");b({type:"image",src:J.href,alt:le,title:J.title,raw:`![${le}](${J.href}${J.title?` "${J.title}"`:""})`,loading:!!J.loading});const oe=Ce.slice(1),G=Td(re);return G.content=oe,G.raw=oe,h()[Ae]=G,!0}function z(J,Ae=c-1){if(J.type!=="link")return!1;const Q=a[a.length-1],re=e[Ae];if(!Q||Q.type!=="text"||re?.type!=="text")return!1;const Ce=String(Q.content??""),le=String(re.content??"");if(!Ce.endsWith("!")||!le.endsWith("!")||_(re,"\\!"))return!1;const oe=Ce.slice(0,-1);oe?(Q.content=oe,Q.raw=oe,u=Q):(a.pop(),u=null);const G=J,ie=String(G.text??G.children?.map(Ee=>String(Ee?.content??Ee?.raw??"")).join("")??""),ge=String(G.href??""),me=G.title==null||G.title===""?null:String(G.title);return b({type:"image",src:ge,alt:ie,title:me,raw:`![${ie}](${ge}${me?` "${me}"`:""})`,loading:!!G.loading}),!0}function H(J,Ae="",Q=null){const re=String(J.alt??J.raw??"");return{type:"link",href:Ae,title:Q,text:re,children:[J],raw:`[${re}](${Ae}${Q?` "${Q}"`:""})`,loading:!0}}function X(J){const Ae=J.startsWith("![")?J:`![${J}`,Q=Ae.slice(2),re=Q.indexOf("](");return{type:"image",src:"",alt:re===-1?Q.replace(/\]$/,""):Q.slice(0,re),title:null,raw:Ae,loading:!0}}function U(J){const Ae=J.indexOf("[![");if(Ae===-1||typeof t=="string"&&e.length===1&&Gwe(t,Ae,"["))return!1;const Q=J.slice(0,Ae);return Q&&x(Q,Q),b(H(X(J.slice(Ae+1)))),c++,!0}function se(J){if(i?.final)return!1;const Ae=e[c-1];if(Ae?.type!=="text"||!String(Ae.content??"").endsWith("[")||_(Ae,"\\["))return!1;const Q=a[a.length-1];if(Q?.type==="text"&&Q.content.endsWith("[")){const re=Q.content.slice(0,-1);re?(Q.content=re,Q.raw=re,u=Q):(a.pop(),u=null)}return b(H(qI(J))),c++,!0}function te(J){if(J.type!=="link")return!1;const Ae=J,Q=String(Ae.raw??""),re=String(Ae.text??"");if(!Q.startsWith("[![")&&!re.startsWith("!["))return!1;const Ce=Ae.title==null||Ae.title===""?null:String(Ae.title);return b(H({type:"image",src:String(Ae.href??""),alt:re.replace(/^!\[/,"").replace(/\]$/,""),title:Ce,raw:Q.startsWith("[![")?Q.slice(1):Q,loading:!0})),!0}function V(J){if(!J.startsWith("]("))return!1;const Ae=e[c-2];if(Ae?.type==="text"&&String(Ae.content??"").endsWith("[")&&_(Ae,"\\["))return!1;const Q=a[a.length-1];if(Q?.type!=="image"&&Q?.type!=="link")return!1;const re=Q,Ce=Q?.type==="link"&&Array.isArray(re.children)&&re.children.length===1&&re.children[0]?.type==="image"?a.pop():null,le=Ce?Ce.children[0]:a.pop();if(!le||le.type!=="image")return!1;const oe=e[c+1];let G=String(Ce?.href??""),ie=Ce?.title==null?null:String(Ce.title),ge=!0;if(oe?.type==="link_open"){const{node:Ee,nextIndex:Qe}=Cm(e,c+1,i);G=Ee.href,ie=Ee.title,ge=!0,c=Qe}else{if(G=J.slice(2),G.includes('"')){const Ee=G.split('"');G=String(Ee[0]??"").trim(),ie=Ee[1]==null?null:String(Ee[1]).trim()}c++}const me=H(le,G,ie);return me.loading=ge,b(me),!0}function pe(){const J=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&J?.type==="text"&&String(J.content??"").endsWith("[")&&_(J,"\\[")}function ue(J,Ae){const Q=J.indexOf("[");if(Q===-1)return!1;let re=J.slice(0,Q);const Ce=J.indexOf("](",Q);if(Ce!==-1){const le=e[c+2];let oe=J.slice(Q+1,Ce);if(oe.includes("[")){const we=oe.indexOf("[");re+=J.slice(0,Q+we+1);const Ne=Q+we+1;oe=J.slice(Ne+1,Ce)}const G=e[c+1];if(J.endsWith("](")&&G?.type==="link_open"&&le){const we=e[c+4];let Ne=4,it=!0;if(we?.type==="text"){const Be=String(we.content??"");if(Be.startsWith(")")){it=!1;const Ze=Be.slice(1);if(Ze){const vt=Td(we);vt.content=Ze,vt.raw=Ze,h()[c+4]=vt}else Ne++}else Be==="."&&Ne++}I(re,Ae);const De=String(le.content??"");return i?.validateLink&&!i.validateLink(De)?x(oe,oe):b({type:"link",href:De,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:it}),c+=Ne,!0}const ie=J.indexOf(")",Ce),ge=ie!==-1?J.slice(Ce+2,ie):"",me=ie===-1;let Ee=re.match(/\*+$/);if(Ee&&(re=re.replace(/\*+$/,"")),I(re,Ae),Ee||(Ee=oe.match(/^\*+/)),!d&&Ee){const we=Ee[0].length;oe=oe.replace(/^\*+/,"").replace(/\*+$/,"");const Ne=[];if(we===1?Ne.push({type:"em_open",tag:"em",nesting:1}):we===2?Ne.push({type:"strong_open",tag:"strong",nesting:1}):we===3&&(Ne.push({type:"strong_open",tag:"strong",nesting:1}),Ne.push({type:"em_open",tag:"em",nesting:1})),Ne.push({type:"link",href:ge,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:me}),we===1){Ne.push({type:"em_close",tag:"em",nesting:-1});const{node:it}=Am(Ne,0,i);v(it)}else if(we===2){Ne.push({type:"strong_close",tag:"strong",nesting:-1});const{node:it}=I1(Ne,0,void 0,i);v(it)}else if(we===3){Ne.push({type:"em_close",tag:"em",nesting:-1}),Ne.push({type:"strong_close",tag:"strong",nesting:-1});const{node:it}=I1(Ne,0,void 0,i);v(it)}else{const{node:it}=Am(Ne,0,i);v(it)}}else i?.validateLink&&!i.validateLink(ge)?x(oe,oe):b({type:"link",href:ge,title:null,text:oe,children:[{type:"text",content:oe,raw:oe}],loading:me});const Qe=ie!==-1?J.slice(ie+1):"";return Qe&&(B({type:"text",content:Qe,raw:Qe}),c--),c++,!0}return!1}function fe(J){const Ae=J.indexOf("![");if(Ae===-1)return!1;const Q=J.slice(0,Ae);return Q&&!u?u={type:"text",content:Q,raw:Q}:Q&&u&&(u.content+=Q),u&&(a.push(u),u=null),b(X(J.slice(Ae))),c++,!0}function Me(J){if(!(J?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Ae=J.slice(1).match(/[^\s\]]/);if(Ae===null)return c++,!0;if(Ae&&/x/i.test(Ae[0])){const Q=Ae[0]==="x"||Ae[0]==="X";return b({type:"checkbox_input",checked:Q,raw:Q?"[x]":"[ ]"}),c++,!0}return!1}return a}function t7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const s=i(e),o=t>e?i(t-1).endLine:i(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,o)}}function VI(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let s=0;si&&e[s-1]!==` +`&&r++,{startLine:o,endLine:r}}function m0(e,t,n,i){const s=ixe(e,t,n);return t7(s.startLine,s.endLine,i)}function sxe(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),s=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(s)?null:t7(i,s,t)}function ii(e,t,n){if(!n?.includeSourceMap)return e;const i=sxe(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const s=e;s.startLine=i.startLine,s.endLine=i.endLine}return e}function oxe(e,t,n,i){if(!i?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const o=Number(s[0]),r=Number(s[1]),l=Number(n);return!Number.isFinite(o)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=t7(o,Math.max(r,l),i)),e}function rxe(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const s=i[i.length-1];if(!s){i.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){i.pop();continue}if(s.type==="text"){const o=String(s.content??""),r=o.replace(/[ \t\r\n]+$/g,"");if(r===o)break;if(r){s.content=r;break}i.pop();continue}break}}function lxe(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const s=i[i.length-1];if(!s){i.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){i.pop();continue}if(s.type==="text"){const o=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(o)){i.pop();continue}const r=o.replace(/[ \t\r\n\d.)]+$/g,"");r!==o&&(r?s.content=r:i.pop())}break}}function axe(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Uh(e,t,n){const i=e[t],s=[],o=Tc(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&ii(c,e[r],n),s.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:s,raw:s.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&ii(l,i,n),[l,r+1]}function uxe(e,t,n,i){const s=String(n[1]??"note"),o=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Tc(i,!0);let a=t+1;for(;au.raw).join(` +`)} +:::`},a+1]}const cxe=new Set(["warning","info","note","tip","danger","caution"]);function dxe(e){let t=0;for(;t=0;m--){const y=f[m];if(y.type==="text"&&/:+/.test(y.content)){h=m;break}}const g={type:"paragraph",children:as((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&ii(g,e[u],n),l.push(g),a.remember(g.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=Uh(e,u,a.options());n?.includeSourceMap&&ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Kh(e,u,a.options());n?.includeSourceMap&&ii(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=o9(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:s,title:o,children:l,raw:`:::${s} ${o} +${l.map(d=>d.raw).join(` +`)} +:::`},u+1]}const hxe=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function pxe(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const s=hxe.exec(String(i.info??""));return s?uxe(e,t,s,n):null}const n7={parseContainer:(e,t,n)=>fxe(e,t,n),matchAdmonition:pxe};function Kh(e,t,n){const i=[],s=Tc(n,!0);let o=t+1;for(;ol.raw).join(` +`)};return n?.includeSourceMap&&ii(r,e[t],n),[r,o+1]}function gxe(e){if(e.info?.startsWith("diff"))return X6(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!s}}function mxe(e,t,n){const i=[];let s=t+1,o=[],r=[];const l=Tc(n,!0);for(;su.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a0&&(i.push({type:"definition_item",term:o,definition:r,raw:`${o.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +`)}`}),o=[]),s=a+1}else s++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` +`)},s+1]}function vxe(e,t,n){const i=e[t].meta??{},s=String(i?.label??"0"),o=[],r=Tc(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function yxe(e,t,n){const i=e[t],s=i.attrs,o=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...o?{attrs:o}:{},children:as(a.children||[],u,void 0,n),raw:u}}function kxe(e,t,n){const i=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),o=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function bR(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const A=s(y);if(A)if(A.closing){for(let b=r.length-1;b>=0;b--)if(r[b]===A.tag){r.length=b;break}}else A.selfClosing||o(A.after,A.tag)||r.push(A.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function sSe(e,t,n){if(!n?.length)return!1;const i=new Set(nf(n));if(!i.size)return!1;const s=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},o=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&m!=="/")return null;const y=c.indexOf(">",d);if(y===-1)return null;let A=y-1;for(;A>=0&&o(c[A]);)A--;return{closing:f,tag:g,selfClosing:!f&&c[A]==="/",after:c.slice(y+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,g=Vh(h);if(g){const m=r(h.slice(g.index));if(m)if(m.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===m.tag){a.length=y;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function oSe(e,t){const n=$xe.exec(e);if(!n)return null;const i=n[1]??"",s=n.index+i.length,o=e.indexOf(` +`,s),r=e.slice(s,o===-1?e.length:o);return!Vh(r.endsWith("\r")?r.slice(0,-1):r)||TR(e,s)||iSe(e,s)||sSe(e,s,t)?null:`${e.slice(0,n.index)}${i}`}function u7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,o+=2;continue}o++;continue}if(t.inDollarMath){if(e.startsWith("$$",o)&&!ca(e,l)){i!=null&&s&&n+o+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,o+=2;continue}o++;continue}if(e[o]==="`"&&!ca(e,l)){const a=u7(e,o,"`"),u=LR(e,o+a,a);if(u===-1)break;o=u+a;continue}if(e.startsWith("\\[",o)&&!ca(e,l)){t.inMath=!0,t.mathOpenOffset=n+o,o+=2;continue}if(e.startsWith("$$",o)&&!ca(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+o,o+=2;continue}o++}return r}function rSe(e,t){if(!Y6(t))return e;const n=t,i=JI.get(n),s=i?.source===e?i.state:i&&e.startsWith(i.source)?NR(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:l9(e).state;JI.set(n,{source:e,state:s});const{context:o}=s,r=o.inMath?o.mathOpenOffset:o.inDollarMath?o.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return ju(l)&&!c?e:e.slice(0,r)}function lSe(e,t,n,i,s){const o=o7(e),r=r7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&l7(e)==null&&R3(t),t.inFence&&t.fenceInList&&e.trim()&&o.column=t.fenceLen&&/^\s*$/.test(l.rest)&&R3(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&o.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return nM(e,t,n,i,s)}else return nM(e,t,n,i,s);return!1}function l9(e,t=Jxe(),n=null,i=!1,s=0){const o=Sp(t);let r=Sp(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);lSe(h,o,s+u,n,i)&&(a=!0),d?(r=Sp(o),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:o,lineBuffer:l}}}function NR(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Sp(e.committedContext),context:Sp(e.context),lineBuffer:e.lineBuffer+t}}:l9(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function aSe(e,t){if(!Y6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,s=r9.get(i);if(s?.source===t)return;const o=s?t.startsWith(s.source):!1,r=o&&s?t.slice(s.source.length):"",l=o&&s?NR(s.explicitBracketMath,r,s.source.length-s.explicitBracketMath.lineBuffer.length):l9(t),a=l.state,u=o&&s?l.closedOpenMath:!1;if(s&&o&&s.key===null&&s.pendingCandidate===!1&&!u&&!nSe(s.source,r)&&!eSe(t)){s.source=t,s.explicitBracketMath=a;return}const c=WCe(t);(s&&(s&&!o||s.key!==c||u)||!s&&c)&&n.reset(),Xxe(e,t,c,a)}function uSe(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function FR(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((s,o)=>s===i[o])}function cSe(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let s=0;s":""}function rM(e){return{type:"paragraph",children:e,raw:e.map(pSe).join("")}}function lM(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function aM(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const s=Vxe(t);if(!s?.size)return null;let o=-1;for(let c=0;ch?.type==="hardbreak")){o=c;break}}if(o===-1)return null;const r=i.slice(0,o),l=i[o];if(!l)return null;const a=[];r.length&&a.push(rM(r)),a.push(l);const u=i.slice(o+1);return u.length&&a.push(rM(u)),a}function gSe(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function _p(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function mSe(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Wl(t)}\s*>\s*$`,"i").test(n)}const P3=new Set(["iframe","script","style","textarea","title"]);function Y0(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),s=f=>{if(e.startsWith("",f+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const h=ks(e.slice(f));if(h===-1)return null;const g=f+h+1,m=e.slice(f,g);if(/^<\s*[!?]/.test(m))return{closing:!1,end:g,selfClosing:!1,tag:""};let y=m.slice(1).trimStart();const A=y.startsWith("/");A&&(y=y.slice(1).trimStart());const b=y.match(/^([A-Z][\w:-]*)/i);return b?.[1]?{closing:A,end:g,selfClosing:/\/\s*>$/.test(m),tag:b[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},o=(f,h)=>{const g=new RegExp(String.raw`<\s*\/\s*${Wl(f)}(?=\s|>)`,"gi");g.lastIndex=h;const m=g.exec(e);if(!m||m.index==null)return null;const y=s(m.index);return y?{start:m.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(P3.has(i)){const f=o(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} +`}function uM(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function kSe(e,t,n){return n?e.includes(n,t)?!0:uM(e.slice(Math.max(0,t))).includes(uM(n)):!1}function bSe(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,s;for(;(s=n.exec(e))!==null;)i=s.index;return i}function $R(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const CSe=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),wSe=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function xSe(e){return/\n\s*\n/.test(e)||wSe.test(e)}function SSe(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>CSe.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const s=i;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!xSe(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function _Se(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const s=Y0(e,i[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function ISe(e,t,n,i){const s=n.customHtmlTags?.join("\0")??"",o=t,r=YI.get(o),l=r&&r.final===i&&r.customHtmlTags===s&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:yh(u,t,n));return YI.set(o,{blocks:e,children:a,customHtmlTags:s,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function MSe(e,t,n,i){return e.map(s=>{if(s?.type!=="html_block")return s;const o=s,r=String(o.tag??"").toLowerCase();if(!r||r==="details"||Dz.has(r)||Array.isArray(o.children))return s;const l=String(s.raw??o.content??"");if(!l)return s;const a=ks(l);if(a===-1)return s;const u=Y0(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return s;const h=$R(n,i),g=d?null:_Se(f),m=g?ISe(g,t,h,i):yh(f,t,h);return SSe(f,m)?{...s,children:m}:s})}function ESe(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function yh(e,t,n){return e.trim()?zR(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function TSe(e,t,n){const i=yh(e,t,n),s=i[0];return i.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:i}function LSe(e,t,n){const i=bR({content:e}),s=ks(e),o=DR(e,"summary");if(s!==-1&&o!==-1&&o>=s+1){const r=TSe(e.slice(s+1,o),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function NSe(e,t,n){const i=ks(e);if(i===-1)return[];const s=e.slice(i+1);if(!s.trim())return[];const o=Y0(s,"summary",0);if(!o)return yh(s,t,n);const r=s.slice(0,o.start),l=s.slice(o.end);return[...yh(r,t,n),LSe(o.raw,t,n),...yh(l,t,n)]}function BR(e,t,n,i,s,o=0){const r=[];let l=o;for(let a=0;a{const z=DR(f,"details");return z!==-1?f.slice(0,z):f})():f,[C]=BR(A?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,i,s,h+f.length),v=NSe(b,n,$R(i,s)),x=m===-1?"":String(e[m].raw??_p(e[m])??""),I=A||m!==-1&&y?.closed===!0,_=x.replace(/[\t\r\n ]+$/,""),S=I?(()=>{const z=(y?.raw??"").lastIndexOf(_);return z===-1?t.length:h+z})():t.length,E=ks(f),D=A&&E!==-1?h+E+1:h+f.length,B=t.slice(D,S===-1?t.length:S),T=n.parse(B,{__markstreamFinal:s}),N=n.renderer.render(T,n.options,{__markstreamFinal:s}),O=S+_.length,P=I?Math.max(S+x.length,bSe(t,O)):t.length,R=I?t.slice(S,P):x,q=I?t.slice(h,P):t.slice(h),j=A&&E!==-1?f.slice(0,E+1):f,W={...u,tag:"details",attrs:s9(f.slice(0,E+1)),raw:q,content:`${j}${N}${R}`,children:[...v,...C],loading:!s&&!I};if(i.includeSourceMap&&(W.sourceMap=m0(t,h,I?P:t.length,i)),r.push(W),l=I?P:t.length,m===-1&&!A)break;m!==-1&&(a=m)}return[r,l]}function FSe(e,t,n,i){if(!n)return e;const s=e.slice();let o=0;for(let r=0;r=d.start&&E.end<=d.end){s.splice(I,1);continue}break}x=S+_.length,s.splice(I,1)}}return s}function DSe(e){const t=l=>l===" "||l===" "||l===` +`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const y=m.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=m=>{const y=m.charCodeAt(0);return y>=48&&y<=57},d=m=>m==="!"||u(m),f=m=>u(m)||c(m)||m===":"||m==="-",h=m=>u(m)||c(m)||m==="_"||m==="."||m===":"||m==="-",g=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>TR(l,a),s=String(e??""),o=s.lastIndexOf("<");if(o===-1||i(s,o))return s;if(o>0){const l=s[o-1],a=l===" "||l===" "||l===` +`||l==="\r",u=s[o-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return s}const r=s.slice(o);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?s:s.slice(0,o)}function dM(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),s=[];let o=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(g??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=g=>g===" "||g===" ",s=g=>{const m=g.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||g==="_"||g==="-"||g===":"},o=g=>{if(!g)return!1;if(g[0]===" ")return!0;let m=0;for(let y=0;y=4)return!0;continue}if(A===" ")return!0;break}return!1},r=g=>{let m=!1,y=!1;for(let A=0;A")return A}return-1},l=g=>{let m=0;for(;m{if(o(g))return-1;const y=g.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let A=!1,b=0;for(;b=x.length){A=!0,b++;continue}const _=x[I];if(_==="!"||_==="?"){A=!0,b+=v+1;continue}if(_==="/"){A=!0,b+=v+1;continue}const S=I;for(;I"&&D!=="/"){A=!0,b++;continue}const B=new RegExp(String.raw`<\s*\/\s*${E}\s*>`,"i"),T=/\/\s*>$/.test(x),N=B.test(g.slice(b+v+1)),O=B.test(e.slice(m+b+v+1)),P=/[\r\n]/.test(e.slice(m+b+v+1));if(A&&n.has(E)&&!T&&!N&&(O||P))return b;A=!0,b+=v+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[g-1]==="\r",A=m?y?g-1:g:e.length,b=e.slice(h,A),C=m?y?`\r +`:` +`:"",v=l(b);let x=b;if(!u&&!v){const I=a(b,h);if(I!==-1){const _=C||` +`;x=`${b.slice(0,I).replace(/[ \t]+$/,"")}${_}${_}${b.slice(I).replace(/^[ \t]+/,"")}`}}f+=x,f+=C,v&&(u?v.markerChar===c&&v.markerLen>=d&&/^\s*$/.test(v.rest)&&(u=!1,c="",d=0):(u=!0,c=v.markerChar,d=v.markerLen)),h=m?g+1:e.length}return f}function BSe(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},o=d=>{let f=0;for(;f{let f=!1,h=!1;for(let g=0;g")return g}return-1},l=(d,f,h)=>{const g=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let y=m+1;for(;y=d.length||d[y]!=="/"){m=d.indexOf("<",m+1);continue}for(y++;yd.length){m=d.indexOf("<",m+1);continue}let A=!0;for(let C=0;C="A"&&v<="Z"?String.fromCharCode(v.charCodeAt(0)+32):v)!==g[C]){A=!1;break}}if(!A){m=d.indexOf("<",m+1);continue}let b=y+g.length;if(b")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,g=e.slice(c,h);u+=a(g),u+=f?`\r +`:` +`,c=d+1}return u}function zSe(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",s=f=>{let h=0,g=!1,m=0;for(;h=f.length||f[h]!==">")break;for(g=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",m=h?g?f-1:f:e.length,y=e.slice(d,m),A=h?g?`\r +`:` +`:"",b=s(y),C=b?.prefix??"",v=b?.content??y,x=o(v);x&&(l?x.markerChar===a&&x.markerLen>=u&&/^\s*$/.test(x.rest)&&(l=!1,a="",u=0):(l=!0,a=x.markerChar,u=x.markerLen));let I=v;if(!l&&I.includes("{if(B.replace(/^[\t ]+/,"").startsWith("|"))return S;const T=B.slice(0,D).replace(/^[\t ]+/,"");if(T.length>0){const N=E.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",O=T.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!N||!O||N!==O)return S}return`${E} + +`});if(C){const _=C+I.split(` +`).join(` +${C}`);c+=_}else c+=I;c+=A,d=h?f+1:e.length}return c}function RSe(e,t){if(!e||!t.length)return e;const n=new Set(t.map(T=>String(T??"").toLowerCase()));if(!n.size)return e;const i=T=>T===" "||T===" ",s=T=>{if(!T)return!1;if(T[0]===" ")return!0;let N=0;for(let O=0;O=4)return!0;continue}if(P===" ")return!0;break}return!1},o=T=>{const N=T.charCodeAt(0);return N>=65&&N<=90||N>=97&&N<=122||N>=48&&N<=57||T==="_"||T==="-"||T===":"},r=T=>{let N=0;for(;N{let N=0,O=!1,P=0;for(;N=T.length||T[N]!==">")break;for(O=!0,N++;Nr(T).startsWith("<"),u=T=>{for(let N=0;N{if(s(T))return"";const N=r(T);if(!N.startsWith("<"))return"";let O=1;for(;O=N.length||N[O]==="/"||N[O]==="!"||N[O]==="?")return"";const P=O;for(;O"&&q!=="/"?"":R},d=T=>{if(s(T))return null;const N=r(T);if(!N.startsWith("<"))return null;let O=1;for(;O=N.length)return null;const P=N[O]==="/";if(P)for(O++;O"&&W!=="/")return null;if(P)return{type:"close",name:j};if(/\/\s*>\s*$/.test(N))return{type:"open",name:j,complete:!0};const z=N.indexOf(">",O);if(z!==-1){const H=N.slice(z+1);if(new RegExp(`<\\s*\\/\\s*${j}\\s*>`,"i").test(H))return{type:"open",name:j,complete:!0}}return{type:"open",name:j,complete:!1}},f=T=>{if(s(T))return null;const N=r(T).replace(/[ \t]+$/,"");if(!N.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(N))return null;const O=N.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(O?.[1])return O[1].toLowerCase();const P=N.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!P?.[1]||!P[2])return null;const R=P[1].toLowerCase();return R===P[2].toLowerCase()?R:null};let h=!1,g="",m=0;const y=T=>{let N=0;for(;Ny(T),b=T=>{const N=r(T);return N?s(T)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(N):!1},C=(T,N,O)=>{let P=T,R=0;for(;PP&&e[q-1]==="\r",z=j?W?q-1:q:e.length,H=e.slice(P,z),X=l(H),U=X?.key??"";if(R>0&&N&&U!==N)break;const se=X?.content??H,te=d(se);if(te?.name===O){if(te.type==="open")te.complete||R++;else if(R>0&&(R--,R===0))return!1}else if(R>0&&(u(se)||b(se)))return!0;if(j)P=q+1;else break}return!1};let v="",x=0,I=!0,_=!1,S=!1,E=` +`;const D=[];let B="";for(;xx&&e[T-1]==="\r",P=N?O?T-1:T:e.length,R=e.slice(x,P),q=N?O?`\r +`:` +`:"",j=l(R),W=j?.key??"",z=j?.content??R,H=A(z);H&&(h?H.markerChar===g&&H.markerLen>=m&&/^\s*$/.test(H.rest)&&(h=!1,g="",m=0):(h=!0,g=H.markerChar,m=H.markerLen));const X=D.length>0;if(!h&&!X){const se=c(z),te=!!se&&!I&&_&&S&&C(x,W,se);se&&!I&&(!_||te)&&(W&&B&&W===B?v+=`${W}${E}`:W||(v+=E))}if(v+=R,v+=q,q&&(E=q),!h){const se=d(z);if(se){if(se.type==="open")se.complete||D.push(se.name);else for(let te=D.length-1;te>=0;te--)if(D[te]===se.name){D.length=te;break}}}const U=u(z);I=U,_=!U&&a(z),S=!U&&!!f(z),B=W,x=N?T+1:e.length}return v}function OSe(e){let t=!1,n="",i=0,s=!1,o=!1,r=!1,l=0;const a=(c,d)=>{const f=a7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>s||o||r}}function j3(e,t,n,i){let s=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const o=OSe(s);if(s=s.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{o.scanTo(u+1);const c=o.inMath();return o.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(s.endsWith("- *")&&(s=s.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(s)?s=s.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*--\s*$/.test(s)?s=s.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*>\s*$/.test(s)?s=s.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n\s*[*+]\s*$/.test(s)?s=s.replace(/\n\s*[*+]\s*$/,` +`):/(?:^|\n)\s*\d+\s*$/.test(s)?/^\d+$/.test(s.trim())||(s=s.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` +`)?` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(s)?s=s.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(s)?s=s.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n[[(]\n*$/.test(s)&&(s=s.replace(/(\n\[|\n\()+\n*$/g,` +`)),s=oSe(s,i.customHtmlTags)??s),i.customHtmlTags?.length&&s.includes("<")){const r=nf(i.customHtmlTags);if(r.length&&(s=$Se(s,r),s=BSe(s,r),s=RSe(s,r),s=zSe(s,r),s.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");s=s.replace(a,"$1$2$2")}}return t||(s=DSe(s)),s}function PSe(e,t,n,i){const s=e,o=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=p8.get(s);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===o&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Bxe-zxe),u=j3(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:j3(t,n,e,i)}else l=j3(t,n,e,i);return n||(l=rSe(l,e)),p8.set(s,{source:t,safeMarkdown:l,mode:o}),l}function zR(e,t,n={}){const i=xR(n),s=i?Ml():0,o=!!n.final,r=(e??"").toString();Qxe(t,n)&&(t.stream.reset(),Yxe(t),p8.delete(t));const l=PSe(t,r,o,n);i&&Ju(i,"safeMarkdownMs",Ml()-s);const a=gSe(l);if(a){if(n.includeSourceMap){const x={...n,__sourceLineMapper:dM(r,l)};a[0].sourceMap=m0(l,0,l.length,x)}const C=n.preTransformTokens,v=n.postTransformTokens;if(s7(t,n)||typeof C=="function"||typeof v=="function"){const x=oM(t,l,{__markstreamFinal:o},n),I=typeof C=="function"&&C(x)||x;typeof v=="function"&&v(I)}return XI(a,n,i,s)}const u=i?Ml():0,c=oM(t,l,{__markstreamFinal:o},n);if(i&&Ju(i,"tokenizeMs",Ml()-u),!c||!Array.isArray(c))return XI([],n,i,s);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const g=t,m=typeof g.validateLink=="function"&&g.__markstreamOriginalValidateLink&&g.validateLink!==g.__markstreamOriginalValidateLink?g.validateLink:void 0,y=n.validateLink??m??g.options?.validateLink??(typeof g.validateLink=="function"?g.validateLink:void 0),A={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?dM(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let b=Kxe(t,l,h,A,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const v=C[0],x=v?.type;v&&typeof x=="string"?b=Hf(C,{...A,__customHtmlBlockCursor:0},i):b=C}}if(ESe(b)){const C=i?Ml():0;b=FSe(b,o,l,A),b=BR(b,l,t,A,o)[0],b=MSe(b,t,A,o),i&&Ju(i,"htmlBlockPassesMs",Ml()-C)}if(o){const C=new WeakSet,v=x=>{if(!x||typeof x!="object"||C.has(x))return;if(C.add(x),Array.isArray(x)){for(const _ of x)v(_);return}const I=x;I.type==="html_block"&&I.loading===!0&&(I.loading=!1);for(const _ of Object.values(I))v(_)};v(b)}return b=_R(b,n),n.debug&&console.log("Parsed Markdown Tree Structure:",b),SR(b,i,s)}function fM(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=Tc(t),s=t?.__linkifyDemotionSeed;if(Array.isArray(s)&&s.length)for(const l of s)i.remember(String(l??""));const o=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(o)for(const d of c)ii(d,a,t);for(const d of c)ia(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};o&&ii(d,a,t);const f=aM(d,t);if(f){o&&lM(f,d);for(const h of f)ia(h,a,t);n.push(...f)}else ia(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const jSe=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,Ip=/\d/u,HSe=/[,.!?;:,。;、!?:]/u,WSe=/\d\p{Script=Han}{1,3}$/u;function qSe(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||o.refuseDigitRange&&qSe(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,ZSe=new Set([...Z0,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),GSe=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function hM(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function QSe(e){return typeof e=="string"?e:e==null?"":String(e)}function RR(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Hu(e){return QSe(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function OR(e){return Hu(e).replace(/`/g,"`")}function u9(e){return String(e??"").trim().toLowerCase()}function c7(e,t="safe"){const n=u9(e);return n?t==="escape"?!0:t==="trusted"?Z0.has(n):!GSe.has(n):!1}function PR(e,t="safe"){const n=u9(e);return n?t==="escape"?!0:t==="trusted"?Z0.has(n):ZSe.has(n):!1}function pM(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${OR(i)}"`).join("")}function jR(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(VSe);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function YSe(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const s=i.split(/\s+/,1)[0]??"";return!s||Ed(s,{tagName:t,attrName:"srcset"})})}function HR(e,t,n,i){return F7e.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?YSe(t,i):!!(D7e.has(e)&&t&&Ed(t,{tagName:i,attrName:e}))}function hd(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function WR(e,t,n,i=!1){if(t!=="safe"||u9(n)!=="a")return e;const s=hd(e,"href");if(i&&(!s||!e[s])){const a=hd(e,"target"),u=hd(e,"rel");return a&&delete e[a],u&&delete e[u],e}const o=hd(e,"target");if((o?String(e[o]).trim():"").toLowerCase()!=="_blank")return e;const r=hd(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function gM(e,t="safe",n){const i={};for(const[s,o]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!RR(r)||HR(l,o,t,n)||(i[r]=o)}return WR(i,t,n,!!hd(e,"href"))}function qR(e,t){const n=e.toLowerCase();return Fz.has(n)?!1:hM(t,n)||hM(t,e)}function d7(e,t="safe",n){const i={};for(const[s,o]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!RR(r)||HR(l,o,t,n)||(i[r]=o)}return WR(i,t,n,!!hd(e,"href"))}function Mp(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function c2(e,t="safe",n){const i=d7(Mp(e),t,n),s=Object.entries(i).map(([o,r])=>[o,r]);return s.length>0?s:void 0}function JSe(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function XSe(e){const t={};for(const[n,i]of Object.entries(e))t[n]=JSe(i,n);return t}function H3(e){return e.trim().length>0}function UR(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);H3(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const s=e.indexOf(">",i);if(s===-1)break;const o=jR(e.slice(i+1,s));if(!o){const r=e.slice(i,s+1);H3(r)&&t.push({type:"text",content:r}),n=s+1;continue}if(o.isClosing)t.push({type:"tag_close",tagName:o.tagName});else{const r={};if(o.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(o.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:o.isSelfClosing||dc.has(o.tagName.toLowerCase())?"self_closing":"tag_open",tagName:o.tagName,attrs:r})}n=s+1}return t}function e_e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",i);if(s===-1)break;const o=jR(e.slice(i+1,s));if(!o){t.push({type:"text",content:e.slice(i,s+1)}),n=s+1;continue}if(o.isClosing){t.push({type:"tag_close",tagName:o.tagName}),n=s+1;continue}const r={};if(o.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(o.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:o.isSelfClosing||dc.has(o.tagName.toLowerCase())?"self_closing":"tag_open",tagName:o.tagName,attrs:r}),n=s+1}return t}function t_e(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Hu(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,s])=>s===""?` ${Hu(i)}`:` ${Hu(i)}="${OR(s)}"`).join("");return e.type==="self_closing"?`<${Hu(t)}${n} />`:`<${Hu(t)}${n}>`}function n_e(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of UR(e))if((n.type==="tag_open"||n.type==="self_closing")&&qR(n.tagName??"",t))return!0;return!1}function kh(e,t="safe"){if(!e)return"";if(t==="escape")return Hu(e);const n=e_e(e),i=[],s=[],o=[];for(const r of n){if(r.type==="text"){o.length===0&&s.push(Hu(r.content??""));continue}const l=u9(r.tagName);if(!l)continue;if(PR(l,t)){r.type==="tag_open"?o.push(l):r.type==="tag_close"&&o[o.length-1]===l&&o.pop();continue}if(o.length>0)continue;if(t==="safe"&&c7(l,t)){s.push(t_e(r));continue}if(r.type==="self_closing"){s.push(`<${l}${pM(gM(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${pM(gM(r.attrs??{},t,l))}>`),dc.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&s.push(``)}const u=i.pop();u&&s.push(``)}for(;i.length>0;){const r=i.pop();r&&s.push(``)}return s.join("")}const i_e=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],mM="http://www.w3.org/2000/svg",s_e=new Set(["script","style","iframe","object","embed","link","meta"]),o_e=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),r_e=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),l_e=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),a_e=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function u_e(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function c_e(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function d_e(e){const t=e.nodeName.toLowerCase();return t==="use"?u_e(e):t==="image"?c_e(e):t==="text"||t==="tspan"?!!e.textContent?.trim():a_e.has(t)}function f_e(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function h_e(e,t,n){const i=e.toLowerCase(),s=t.toLowerCase(),o=String(n??"").trim();return o?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(s==="href"||s==="xlink:href")?o.startsWith("#")?o:"":i==="a"&&(s==="href"||s==="xlink:href")?Ed(o,{tagName:"a",attrName:"href"})?"":o:i==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ed(o,{tagName:"img",attrName:"src"})?"":o:s==="href"||s==="xlink:href"?o.startsWith("#")?o:"":Ed(o,{tagName:i,attrName:s})?"":o:""}function p_e(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const s=Number.parseInt(i,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function VR(e){const t=KR(e),n=t.toLowerCase();let i=0;for(;in.test(t))||VR(t)}function g_e(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Sm(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function ZR(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!s_e.has(i)){if(i==="br"){t.push(` +`);return}for(const s of Array.from(n.childNodes))ZR(s,t)}}function m_e(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];ZR(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const s=Sm(t.getAttribute("width")),o=Sm(t.getAttribute("height")),r=Sm(t.getAttribute("x")),l=Sm(t.getAttribute("y")),a=e.ownerDocument.createElementNS(mM,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+o/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(mM,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function v_e(e){m_e(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!o_e.has(i)){n.remove();continue}if(i==="style"&&vM(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const o of s){const r=o.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(o.name);continue}if(r==="style"&&o.value&&vM(o.value)){n.removeAttribute(o.name);continue}if(r==="srcdoc"){n.removeAttribute(o.name);continue}if(r_e.has(r)&&o.value){const l=h_e(i,r,o.value);if(!l){n.removeAttribute(o.name);continue}l!==o.value&&n.setAttribute(o.name,l);continue}if(l_e.has(r)&&o.value&&VR(o.value)){n.removeAttribute(o.name);continue}if(o.value){const l=f_e(o.value);l!==o.value&&n.setAttribute(o.name,l)}}g_e(n)}}function cat(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return v_e(n),y_e(n)?null:n}catch{return null}}function y_e(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const o=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(o)||!Number.isFinite(r)||o<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const s of n){d_e(s)&&(i=!0);for(const o of Array.from(s.attributes))if(/\bNaN\b/i.test(o.value)||o.name==="style"&&/max-width:\s*0(?:px)?/i.test(o.value))return!0}return!i}const _m=[];function W3(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function k_e(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function b_e(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function yM(e=`editor-${Date.now()}`,t={}){const n=JCe(t),i=n;i.__markstreamRegisteredPluginCount=_m.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||_m.length);const s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;o=g=>h[g]??s[g]??g}else o=h=>s[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const g=h;if(Array.isArray(g)){const[m,...y]=g;typeof m=="function"&&n.use(m,...y)}else typeof g=="function"&&n.use(g)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(g){console.error("[getMarkdown] apply function threw an error",g)}if(_m.length)for(const h of _m)if(Array.isArray(h)){const[g,...m]=h;typeof g=="function"&&n.use(g,...m)}else typeof h=="function"&&n.use(h);n.use(KSe),n.use(ybe),n.use(gbe);const r=Lbe,l=r.default??r;n.use(l),n.use(pbe),n.use(hbe),n.core.ruler.after("block","mark_fence_closed",h=>{const g=h,m=g.src,y=!!g.env?.__markstreamFinal,A=m.split(/\r?\n/);for(const b of g.tokens){if(b.type!=="fence"||!b.map||!b.markup)continue;const C=b.map[0],v=b.map[1],x=b.markup,I=x[0],_=x.length,S=A[Math.max(0,v-1)]??"";let E=0;for(;EC+1&&D>=_&&B===S.length,N=b;N.meta=N.meta??{},N.meta.unclosed=!T,N.meta.closed=!!T}}),n.renderer.rules.fence=(h,g)=>{const m=h[g],y=String(m.info??"").trim(),A=String(m.content??""),b=btoa(unescape(encodeURIComponent(A))),C=k_e(y),v=W3(C),x=b_e(`editor-${e}-${g}-${C}`),I=W3(o("common.copy"));return`
      +
      + ${W3(C.toUpperCase())} + +
      +
      +
      `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const g=u.exec(h);if(!g)return h!=="["&&!/^\[\d+$/.test(h);const m=String(g[1]??"");return h.slice(g[0].length).startsWith("(")?!1:!/^\d+$/.test(m)},d=(h,g)=>{const m=h;if(m.src[m.pos]!=="[")return!1;const y=a.exec(m.src.slice(m.pos));if(!y)return!1;const A=m.src.slice(Math.max(0,m.pos-120),m.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(A))return!1;const b=m.src.slice(m.pos+y[0].length);if(b.startsWith("](")||b.startsWith("(")||c(b))return!1;if(!g){const C=y[1],v=m.push("reference","span",0);v.content=C,v.markup=y[0],v.raw=y[0]}return m.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,g)=>{const y=String(h[g].content??"");return`${y}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}function A_e({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function GR({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:s=!1}){const o=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&o===e?s?{settledContent:o,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:A_e({nextContent:e,previousContent:t??o,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const C_e={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function w_e(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function QR(e){const t=w_e(e);return C_e[t]??t}function x_e(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>QR(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function S_e(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const s=i.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function __e(e){return S_e(e)?.join("\0")??""}function I_e(e,t){return`${__e(e)}\0\0${x_e(t)?.join("\0")??""}`}function Tf(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function kM(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var M_e=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const g=bM();this.startedAt=f&&this.hasStarted?g-this.normalizedStartDelayMs:g,this.lastTick=g,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=bM();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=N_e(g/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const A=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=L_e(this.source.slice(this.visible.length),A,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:s=900,catchUpLatencyMs:o=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=Tf(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Tf(i,1e3,1)),this.normalizedTargetLatencyMs=Tf(s,900,1),this.normalizedCatchUpLatencyMs=Tf(o,350,1),this.normalizedCatchUpThreshold=kM(r,600),this.normalizedStartDelayMs=kM(a,80),this.maxCommitFps=Math.trunc(Tf(l,30,1)),this.maxCharsPerCommit=Math.trunc(Tf(u,80,1)),this.flushOnFinish=c,this.segmenter=T_e(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function E_e(e={},t){const n=new M_e(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function T_e(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function L_e(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const o=Array.from(e).slice(0,t);return{text:o.join(""),graphemeCount:o.length}}let i="",s=0;for(const o of n.segment(e)){if(s>=t)break;i+=o.segment,s++}return{text:i,graphemeCount:s}}function bM(){return typeof performance<"u"?performance.now():Date.now()}function N_e(e,t,n){return Math.min(n,Math.max(t,e))}var F_e=(e,t,n)=>new Promise((i,s)=>{var o=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,r);l((n=n.apply(e,t)).next())});const m8=Symbol.for("markstream-vue:node-lifecycle");function dat(){}const f7=new Map;let YR="material";const Jf=new Map,AM=new Map;let v8=null;function D_e(e){f7.set(e.id,e)}function $_e(e){const t=f7.get(YR);if(!t)return;const n=t.core[e];if(n)return n;const i=Jf.get(t.id);if(i){const s=i[e];if(s)return s}t.loadExtended&&!Jf.has(t.id)&&z_e(t)}function B_e(){var e,t;return(t=(e=f7.get(YR))==null?void 0:e.fallback)!=null?t:""}function z_e(e){return F_e(this,null,function*(){var t,n,i;if(Jf.has(e.id))return(t=Jf.get(e.id))!=null?t:null;let s=AM.get(e.id);return s||(s=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(o=>(Jf.set(e.id,o),v8?.(),o)).catch(()=>(Jf.set(e.id,null),null)),AM.set(e.id,s)),s})}const CM='',wM='',R_e={id:"material",core:{"":wM,plain:'',text:wM,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:CM,csharp:CM,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>ys(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},O_e=ql(0);v8=()=>{O_e.value++},D_e(R_e);const P_e={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function c9(e){var t;const n=(function(i){if(!i)return"";const s=i.trim();if(!s)return"";const[o]=s.split(/\s+/),[r]=o.split(":");return r.toLowerCase()})(e);return(t=P_e[n])!=null?t:n}function fat(e){const t=c9(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function hat(e){return $_e(c9(e))||B_e()}const xM={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var d9=(e,t,n)=>new Promise((i,s)=>{var o=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,r);l((n=n.apply(e,t)).next())});let nr=null,yd=!1,kd=null,f9=p7;function J0(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function h7(){try{const e=globalThis;return J0(e?.katex)}catch{return null}}function p7(){return d9(null,null,function*(){const e=h7();if(e)return e;const t=yield ys(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ys(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return J0(t)})}function JR(e){const t=Promise.resolve(e).then(n=>{var i;return kd===t&&n?(nr=(i=J0(n))!=null?i:n,nr):null}).catch(()=>null).finally(()=>{kd===t&&(kd=null)});return kd=t,yd=!0,t}function j_e(e){f9=e,nr=null,yd=!1,kd=null}function H_e(e){j_e(p7)}function XR(){return typeof f9=="function"}function pat(){var e;const t=f9;if(!t||t===p7)return null;if(nr)return nr;const n=h7();if(n)return nr=n,nr;if(yd)return null;try{const i=t();return i?typeof i?.then=="function"?(JR(i),null):(nr=(e=J0(i))!=null?e:i,nr):null}catch{return null}}function eO(){return d9(this,null,function*(){var e;const t=h7();if(t)return nr=t,nr;if(nr)return nr;if(kd)return kd;if(yd)return null;const n=f9;if(!n)return yd=!0,null;try{const i=n();if(typeof i?.then=="function")return JR(i);if(i)return nr=(e=J0(i))!=null?e:i,yd=!0,nr}catch{}return yd=!0,null})}function tO(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Uu=null,Bu=null;const Co=new Map,Za=new Map;let v0=5;const Ld=new Set;function Ep(){if(Co.size{const{id:n,html:i,error:s}=t.data,o=Co.get(n);if(o)if(Co.delete(n),clearTimeout(o.timeoutId),o.cleanup(),Ep(),s)o.aborted||o.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Za.set(a,i),Za.size>200){const u=Za.keys().next().value;Za.delete(u)}}o.aborted||o.resolve(i)}},Uu.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Co.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Co.clear(),nO()}}function q_e(){var e;for(const t of Co.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Co.clear(),nO(),Uu&&((e=Uu.terminate)==null||e.call(Uu)),Uu=null,Bu=null}function U_e(e,t=!0,n=2e3,i){return d9(this,null,function*(){performance.now();const s=tO(e);if(!XR()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Bu)return Promise.reject(Bu);const o=`${t?"d":"i"}:${s}`,r=Za.get(o);if(r)return Ep(),Promise.resolve(r);const l=Uu||(Bu=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Bu.name="WorkerInitError",Bu.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Bu);if(Co.size>=v0){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Co.size,a.max=v0,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const m=new Error("Aborted");return m.name="AbortError",void u(m)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=Co.get(c);if(!m)return;Co.delete(c),m.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",m.aborted||m.reject(y),Ep()},n);d=()=>{const m=Co.get(c);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const h=a,g=u;Co.set(c,{resolve:m=>{h(m)},reject:m=>{g(m)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:s,displayMode:t})}catch(m){const y=Co.get(c);Co.delete(c),clearTimeout(f),y?.cleanup(),y?.reject(m),Ep()}})})}function gat(e,t=!0,n){const i=`${t?"d":"i"}:${tO(e)}`;if(Za.set(i,n),Za.size>200){const s=Za.keys().next().value;Za.delete(s)}}const K_e="WORKER_BUSY";function V_e(e=2e3,t){return Co.size{let s,o=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),Ld.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{o||(o=!0,a(),n())},Ld.add(l),s=globalThis.setTimeout(()=>{if(o)return;o=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>Ep()),t&&(r=()=>{if(o)return;o=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const M1={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function mat(e){return d9(this,arguments,function*(t,n=!0,i={}){var s,o,r,l;if(!XR()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=i.timeout)!=null?s:M1.timeout,u=(o=i.waitTimeout)!=null?o:M1.waitTimeout,c=(r=i.backoffMs)!=null?r:M1.backoffMs,d=(l=i.maxRetries)!=null?l:M1.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):M1.maxRetries,h=i.signal;let g=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield U_e(t,n,a,h)}catch(m){if(m?.code!==K_e||g>=f)throw m;if(g++,yield V_e(u,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*g)))}}})}function Xf(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Z_e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const s=i.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function jv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),i=Z_e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function Hv(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function iO(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Wv(e,t=360,n=500){return iO(e,t,n)}function qv(e,t=360,n=500){return iO(e,t,n)}var G_e=Object.defineProperty,Q_e=Object.defineProperties,Y_e=Object.getOwnPropertyDescriptors,SM=Object.getOwnPropertySymbols,J_e=Object.prototype.hasOwnProperty,X_e=Object.prototype.propertyIsEnumerable,_M=(e,t,n)=>t in e?G_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sO=(e,t)=>{for(var n in t||(t={}))J_e.call(t,n)&&_M(e,n,t[n]);if(SM)for(var n of SM(t))X_e.call(t,n)&&_M(e,n,t[n]);return e},IM=(e,t,n)=>new Promise((i,s)=>{var o=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,r);l((n=n.apply(e,t)).next())});const Uv=()=>ys(()=>import("./mermaid.core-cXaFT3ek.js").then(e=>e.bp),__vite__mapDeps([4,5]));let za=null,eh=Uv,ip=null,y8=!1,k8=!1,sp=0;function eIe(e){eh=e,sp++,za=null,ip=null,y8=!1,k8=!1}function tIe(e){eIe(Uv)}function MM(){return typeof eh=="function"}function EM(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=sO({},t),i={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:o=>typeof t.initialize=="function"?t.initialize(o):s.initialize?s.initialize(o):void 0},Q_e(n,Y_e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function TM(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=sO({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function vat(){return IM(this,null,function*(){if(za)return za;const e=(function(){try{const i=globalThis;return EM(i?.mermaid)}catch{return null}})();if(e)return za=e,TM(za),za;const t=eh,n=sp;return t?t===Uv&&y8?null:ip||(ip=IM(null,null,function*(){let i;try{i=yield t()}catch(s){if(t===Uv)return n===sp&&t===eh&&(y8=!0,(function(o){k8||(k8=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',o))})(s)),null;throw s}finally{n===sp&&t===eh&&(ip=null)}return n!==sp||t!==eh?null:i?(za=EM(i),TM(za),za):null}),ip):null})}let kr=null,zu=null;const El=new Map,ad=new Map;function d2(e){for(const t of El.values())t.reject(e);El.clear(),ad.clear()}let LM=5,NM=!1;const nIe="WORKER_BUSY",FM="MERMAID_DISABLED";function iIe(e){if(kr&&kr!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",d2(n)}kr=e,zu=null;const t=e;kr.onmessage=n=>{if(kr!==t)return;const{id:i,ok:s,result:o,error:r}=n.data,l=El.get(i);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(o))},kr.onerror=n=>{var i,s;if(kr===t)if(El.size!==0){try{NM?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}d2(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},kr.onmessageerror=n=>{var i,s;if(kr===t)if(El.size!==0){try{NM?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}d2(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function sIe(){var e;if(kr)try{d2(new Error("Worker cleared")),(e=kr.terminate)==null||e.call(kr)}catch{}kr=null,zu=null}function oO(e,t,n,i){if(!MM()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=FM,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let o=ad.get(s);return o||(o=(function(r,l,a=1400){if(!MM()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=FM,Promise.reject(c)}if(zu)return Promise.reject(zu);const u=kr||(zu=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),zu.name="WorkerInitError",zu.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(zu);if(El.size>=LM){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=nIe,c.inFlight=El.size,c.max=LM,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,g=!1;const m=()=>{g||(g=!0,h!=null&&globalThis.clearTimeout(h),El.delete(f))},y={resolve:A=>{m(),c(A)},reject:A=>{m(),d(A)}};El.set(f,y);try{u.postMessage({id:f,action:r,payload:l})}catch(A){return El.delete(f),void d(A)}h=globalThis.setTimeout(()=>{const A=new Error("Worker call timed out");A.name="WorkerTimeout",A.code="WORKER_TIMEOUT";const b=El.get(f);b&&b.reject(A)},a)})})(e,t,n),ad.set(s,o),o.then(()=>{ad.get(s)===o&&ad.delete(s)},()=>{ad.get(s)===o&&ad.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(o,i)}function yat(e,t,n=1400,i){return oO("canParse",{code:e,theme:t},n,i)}function kat(e,t,n=1400,i){return oO("findPrefix",{code:e,theme:t},n,i)}var oIe=Object.defineProperty,rIe=Object.defineProperties,lIe=Object.getOwnPropertyDescriptors,DM=Object.getOwnPropertySymbols,aIe=Object.prototype.hasOwnProperty,uIe=Object.prototype.propertyIsEnumerable,$M=(e,t,n)=>t in e?oIe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xt=(e,t)=>{for(var n in t||(t={}))aIe.call(t,n)&&$M(e,n,t[n]);if(DM)for(var n of DM(t))uIe.call(t,n)&&$M(e,n,t[n]);return e},vn=(e,t)=>rIe(e,lIe(t)),$i=(e,t,n)=>new Promise((i,s)=>{var o=a=>{try{l(n.next(a))}catch(u){s(u)}},r=a=>{try{l(n.throw(a))}catch(u){s(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,r);l((n=n.apply(e,t)).next())});const cIe="__global__",q3="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",b8=(()=>{const e=globalThis;if(e[q3])return e[q3];const t={scopedCustomComponents:{},revision:ql(0)};return e[q3]=t,t})(),BM=b8.revision,dIe=Symbol("markstreamCustomComponents"),fIe=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function X0(e){return fIe.has(String(e).trim().toLowerCase())}function hIe(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function U3(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const s of new Set([ml(n),ml(hIe(n))]))!s||X0(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=i)}return t}function Ws(e){const t=un(dIe,null);return L(()=>{var n;return BM.value,(function(i,s={}){return BM.value,xt(xt(xt({},U3(b8.scopedCustomComponents[cIe]||{})),U3(s)),U3((function(o){return o&&b8.scopedCustomComponents[o]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const pIe=["aria-label"],gIe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},mIe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},gi=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},Wr=gi(et({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),M("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),M("svg",mIe,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),M("svg",gIe,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,pIe))}),[["__scopeId","data-v-be21ab83"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const vIe={class:"emoji-node"},xr=gi(et({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),M("span",vIe,F(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);xr.install=e=>{e.component(xr.__name,xr)};const yIe=["id"],kIe=["title"],qr=gi(et({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,s)=>(k(),M("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+F(e.node.id)+"]",9,kIe)],8,yIe))}}),[["__scopeId","data-v-c1463a29"]]);qr.install=e=>{e.component(qr.__name,qr)};const rO=(()=>{try{return!1}catch{}return!1})();function K3(e){rO&&console.warn(e)}function zM(e,t="safe",n){return d7(e,t,n)}function lO(e){return XSe(e)}function V3(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function g7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=c2((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),V3(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),V3(r.value)]):Object.entries(s).map(([r,l])=>[r,V3(l)]):null,t,n);var s;if(!i)return;const o=lO(Mp(i));return Object.keys(o).length>0?o:void 0}function RM(e,t,n=!1){const i=Object.entries(t??{}),s=i.length>0?i.map(([o,r])=>r===""?` ${o}`:` ${o}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function E1(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Z3(e,t,n,i,s,o,r=!1){const l=(function(d,f){return qR(d,f)})(e,i);if(Z0.has(e.toLowerCase())||!l&&PR(e,o))return null;if(!l&&c7(e,o))return r?[RM(e,t,!0)]:[RM(e,t),...n,``];const a=d7(t,o,e),u=a.key,c=u!=null&&u!==""?u:s;if(l){const d=i[e]||i[e.toLowerCase()],f=lO(a);return pn(d,vn(xt({},f),{key:c}),n.length>0?n:void 0)}return pn(e,vn(xt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function aO(e,t){return n_e(e,t)}function Kv(e,t,n="safe"){if(!e)return[];try{return(function(o,r,l="safe"){let a=0;const u=[],c=[];for(const d of o)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=Z3(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);E1(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let g=u.length-1;g>=0;g--)if(u[g].tagName.toLowerCase()===f){h=g;break}if(h!==-1)for(;u.length>h;){const g=u.pop(),m=Z3(g.tagName,g.attrs||{},g.children,r,g.autoKey,l);u.length>0?E1(u[u.length-1].children,m):E1(c,m),g.tagName.toLowerCase()!==f&&u.length>h&&K3(`Auto-closing unclosed tag: <${g.tagName}>`)}else K3(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=Z3(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?E1(u[u.length-1].children,f):E1(c,f),K3(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(UR(e),t,n)}catch(s){return i=s,rO&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const bIe=["innerHTML"],Ur=gi(et({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=un("markstreamHtmlPolicy",void 0),i=L(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=Ws(()=>t.customId),o=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=L(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:kh(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=Kv(l,s.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!aO(l,s.value))return{mode:"html",content:kh(l,i.value)};const a=Kv(l,s.value,i.value);return a===null?{mode:"html",content:kh(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),M("span",{key:0,class:Fe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[K(p(o),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),M("span",{key:1,class:Fe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},F(r.value.content),3)):(k(),M("span",{key:2,class:Fe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,bIe))}}),[["__scopeId","data-v-d17f12b0"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const AIe={class:"inline-code"},CIe={key:0},qo=gi(et({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=zh(),i=un("markstreamFade",void 0),s=un("markstreamTextStreamState",void 0),o=un("markstreamStreamVersion",void 0),r=L(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=L(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=L(()=>{var b;return String((b=t.node.code)!=null?b:"")}),u=L(()=>!l.value),c=L(()=>{var b;const C=(b=n["index-key"])!=null?b:n.indexKey;return C==null||C===""?"":String(C)}),d=Z(t.node.code),f=Z(""),h=Z(0);let g;function m(){g?.(),g=void 0}function y(){m(),f.value&&(d.value=d.value+f.value,f.value="")}Ve([()=>t.node.code,c,l],([b])=>{const C=String(b??""),v=c.value,x=GR({nextContent:C,persistedContent:v?s?.get(v):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=x.settledContent,f.value=x.streamedDelta,x.appended?(h.value+=1,(function(){if(!f.value||g||!o)return;const I=o.value;g=Ve(()=>o.value,_=>{_!==I&&y()},{flush:"sync"})})()):f.value||m(),v&&s?.set(v,C)},{immediate:!0}),Jd(m);const A=L(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,C)=>(k(),M("code",AIe,[u.value?(k(),M(Te,{key:0},[Re(F(a.value),1)],64)):(k(),M(Te,{key:1},[d.value?(k(),M("span",CIe,F(d.value),1)):ee("",!0),f.value?(k(),M("span",{key:1,class:Fe(["inline-code-stream-delta",[A.value]]),onAnimationend:y},F(f.value),35)):ee("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);qo.install=e=>{e.component(qo.__name,qo)};const A8=Z(!1),OM=Z(""),PM=Z("top"),Tp=Z(null),Lp=Z(null),C8=Z(null),w8=Z(null),jM=Z(null);let f2=null,h2=null,x8=0;function uO(){f2&&(clearTimeout(f2),f2=null),h2&&(clearTimeout(h2),h2=null)}let Im=!1,Mm=null,HM=!1;function wIe(e,t,n="top",i=!1,s,o){if(!e)return;const r=++x8;uO();const l=()=>$i(null,null,function*(){var a,u;if(yield(function(){return $i(this,null,function*(){if(!Im&&!HM&&typeof document<"u"){Mm!=null||(Mm=$i(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([ys(()=>import("./vue.runtime.esm-bundler-BkbLUR3B.js"),[]),ys(()=>import("./Tooltip-YQT_xjmY.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var g;return d(f,{visible:A8.value,"anchor-el":Tp.value,content:OM.value,placement:PM.value,id:Lp.value,originX:C8.value,originY:w8.value,isDark:(g=jM.value)!=null?g:void 0})}}).mount(h),Im=!0}));try{yield Mm}catch(c){Im=!1,Mm=null,HM=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),Im&&r===x8){Lp.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Tp.value=e,OM.value=t,PM.value=n,C8.value=(a=s?.x)!=null?a:null,w8.value=(u=s?.y)!=null?u:null,jM.value=typeof o=="boolean"?o:null,A8.value=!0;try{e.setAttribute("aria-describedby",Lp.value)}catch{}}});i?l():f2=setTimeout(l,80)}function xIe(e=!1){x8+=1,uO();const t=()=>{if(Tp.value&&Lp.value)try{Tp.value.removeAttribute("aria-describedby")}catch{}A8.value=!1,Tp.value=null,Lp.value=null,C8.value=null,w8.value=null};e?t():h2=setTimeout(t,120)}const SIe={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},_Ie=Symbol("markstreamI18nFallback");function cO(e,t){var n;return(n=t?.[e])!=null?n:SIe[e]}const S8=(e,t)=>{var n;return(n=cO(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function WM(e,t){return{t(n){const i=cO(n,t);if(e.te&&i!=null&&!e.te(n))return S8(n,t);const s=e.t(n);return s===n&&i!=null?S8(n,t):s}}}function IIe(){const e=(function(){var n,i,s;try{const o=Hs(),r=_Ie,l=o?.provides,a=(n=o?.appContext)==null?void 0:n.provides;return(s=(i=l?.[r])!=null?i:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,i;try{const s=Hs(),o=s?.proxy,r=o?.$t;if(typeof r=="function"){const u=o?.$te;return{t:r.bind(o),te:typeof u=="function"?u.bind(o):void 0}}const l=(i=(n=s?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return WM(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return WM({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>S8(n,e)}}const dO=Symbol("ViewportPriority"),fO=Symbol("ViewportPriorityOptions"),hO=Symbol("OffscreenHeavyNodeDeferral"),MIe=L(()=>!1),Ud="400px";function m7(){return un(fO,void 0)}function v7(){return un(hO,MIe)}function EIe(e,t){var n,i;const s=typeof window<"u"&&typeof document<"u",o=typeof t=="boolean"?Z(t):t,r=s?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(i=window.cancelIdleCallback)!=null?i:_=>window.clearTimeout(_):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,g=null;function m(_){if(!_)return"viewport";let S=a.get(_);return S||(S=u++,a.set(_,S)),String(S)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function A(_){if(_){const S=c.get(_);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(_)}}d.size||f.size||y()}function b(_){const S=d.get(_);if(!S)return;const E=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{E?.io.unobserve(_)}catch{}E?.targets.delete(_),d.delete(_),f.delete(_),A(S.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const _=f.values().next().value;_&&(f.delete(_),b(_),f.size&&C())},{timeout:1200}))}function v(_,S){if(!s||typeof IntersectionObserver>"u")return null;const E=(function(P,R){var q,j,W;return{root:(q=e?.(P??null))!=null?q:null,rootMargin:(j=R?.rootMargin)!=null?j:Ud,threshold:(W=R?.threshold)!=null?W:0}})(_,S),D=[m((B=E).root),B.rootMargin,B.threshold].join("\0");var B;const T=c.get(D);if(T)return{key:D,bucket:T};let N;try{N=new IntersectionObserver(P=>{for(const R of P)(R.isIntersecting||R.intersectionRatio>0)&&b(R.target)},{root:E.root,rootMargin:E.rootMargin,threshold:E.threshold})}catch{return null}const O={io:N,targets:new Map};return c.set(D,O),{key:D,bucket:O}}function x(){if(s&&o.value)for(const[_,S]of Array.from(d.entries())){const E=v(_,S.opts);if(!E){b(_);continue}if(E.key===S.bucketKey)continue;const D=S.bucketKey,B=c.get(D);try{B?.io.unobserve(_)}catch{}B?.targets.delete(_),S.bucketKey=E.key,E.bucket.targets.set(_,S),E.bucket.io.observe(_),A(D)}}Ve(o,_=>{if(!_){for(const S of Array.from(d.keys()))b(S);y()}},{flush:"sync"});const I=(_,S)=>{const E=Z(!1);let D,B=!1;const T=new Promise(R=>{D=()=>{B||(B=!0,R())}}),N=()=>{const R=d.get(_);if(!R)return f.delete(_),void A();const q=c.get(R.bucketKey);try{q?.io.unobserve(_)}catch{}q?.targets.delete(_),d.delete(_),f.delete(_),A(R.bucketKey)};if(!s||!o.value)return E.value=!0,D(),{isVisible:E,whenVisible:T,destroy:N};const O=v(_,S);if(!O)return E.value=!0,D(),{isVisible:E,whenVisible:T,destroy:N};const P={resolve:D,visible:E,bucketKey:O.key,opts:S};return d.set(_,P),O.bucket.targets.set(_,P),O.bucket.io.observe(_),s&&g==null&&(g=window.requestAnimationFrame(()=>{g=null,x()})),S?.allowIdle!==!1&&(f.add(_),C()),{isVisible:E,whenVisible:T,destroy:N}};return I.refresh=x,Gn(dO,I),I}function y7(){var e,t;const n=un(dO,void 0);if(n)return n;const i=new WeakMap,s=new Map,o=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const g=s.get(h);if(g&&!g.targets.size){try{g.io.disconnect()}catch{}s.delete(h)}},d=h=>{const g=i.get(h);if(!g)return;const m=s.get(g.bucketKey);if(!g.visible.value){g.visible.value=!0;try{g.resolve()}catch{}}try{m?.io.unobserve(h)}catch{}i.delete(h),m?.targets.delete(h),o.delete(h),c(g.bucketKey),o.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&o.size&&(r=l(()=>{r=null;const h=o.values().next().value;h&&(o.delete(h),d(h),o.size&&f())},{timeout:1200}))};return(h,g)=>{const m=Z(!1);let y,A=!1;const b=new Promise(x=>{y=()=>{A||(A=!0,x())}}),C=()=>{const x=i.get(h);if(!x)return o.delete(h),void(o.size||u());const I=s.get(x.bucketKey);try{I?.io.unobserve(h)}catch{}i.delete(h),I?.targets.delete(h),o.delete(h),c(x.bucketKey),o.size||u()},v=(x=>{var I,_;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(N=>{var O,P;return[(O=N?.rootMargin)!=null?O:Ud,(P=N?.threshold)!=null?P:0].join("\0")})(x),E=s.get(S);if(E)return{key:S,bucket:E};const D=(I=x?.rootMargin)!=null?I:Ud;let B;try{B=new IntersectionObserver(N=>{for(const O of N)(O.isIntersecting||O.intersectionRatio>0)&&d(O.target)},{root:null,rootMargin:D,threshold:(_=x?.threshold)!=null?_:0})}catch{return null}const T={io:B,targets:new Set};return s.set(S,T),{key:S,bucket:T}})(g);return v?(i.set(h,{resolve:y,visible:m,bucketKey:v.key}),v.bucket.targets.add(h),v.bucket.io.observe(h),g?.allowIdle!==!1&&(o.add(h),f()),{isVisible:m,whenVisible:b,destroy:C}):(m.value=!0,y(),{isVisible:m,whenVisible:b,destroy:C})}}function TIe(e,t){var n,i;const s=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return s==null||s===""?"":String(s)}const LIe=["data-markstream-viewport-pending"],NIe=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],FIe={key:1,class:"image-placeholder"},DIe={key:1,class:"image-node__raw-text"},$Ie={key:2,class:"image-shimmer-overlay"},BIe={key:1,class:"image-node__raw-text"},zIe={key:3,class:"image-error"},Xu=gi(et({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,s;const o=e,r=t,l=Z(!1),a=Z(!1),u=Z(""),c=Z("primary"),d=Z(null),f=zh(),h=un(m8,null),g=y7(),m=m7(),y=v7(),A=L(()=>fI(o.node.src)),b=L(()=>fI(o.fallbackSrc)),C=(s=(i=(n=Hs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:s.call(i,"img"),v=typeof window<"u"&&C?.getAttribute("src")===(A.value||b.value),x=Z(typeof window>"u"||v||!y.value),I=ql(null);let _="",S=null;const E=L(()=>u.value),D=L(()=>!o.lazy),B=L(()=>typeof window<"u"&&y.value&&!v),T=L(()=>!B.value||x.value),N=L(()=>T.value?E.value:""),O=L(()=>{var ue,fe;return(fe=(ue=m?.value.heavyBlockMargin)!=null?ue:m?.value.rootMargin)!=null?fe:Ud}),P=L(()=>!o.node.loading&&c.value!=="failed"&&u.value.length>0),R=L(()=>c.value==="failed"),q=L(()=>(!D.value||B.value&&!x.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),j=L(()=>TIe(o,f));function W(ue=j.value){ue&&d.value&&h?.reportHeight(ue,d.value.offsetHeight)}function z(ue=j.value){ue&&kt(()=>{W(ue)})}function H(){S&&(clearTimeout(S),S=null)}function X(){const ue=j.value;ue&&_!==ue&&(_&&h?.markSettled(_),H(),_=ue,h?.markPending(ue),typeof window<"u"&&(S=window.setTimeout(()=>{_===ue&&(z(ue),U())},8e3)))}function U(){return $i(this,null,function*(){const ue=_;ue&&(H(),_="",yield kt(),W(ue),h?.markSettled(ue))})}function se(){if(c.value==="primary"&&b.value&&b.value!==u.value)return c.value="fallback",u.value=b.value,l.value=!1,a.value=!1,void z();c.value="failed",a.value=!0,r("error",u.value),z()}function te(){l.value=!0,a.value=!1,r("load",E.value),z()}function V(ue){ue.preventDefault(),l.value&&!a.value&&r("click",[ue,E.value])}const{t:pe}=IIe();return Ve([A,b,()=>o.node.loading],()=>(l.value=!1,a.value=!1,o.node.loading||A.value?(u.value=A.value,void(c.value="primary")):b.value?(u.value=b.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Ve([d,B],([ue,fe],Me,J)=>{var Ae;if((Ae=I.value)==null||Ae.destroy(),I.value=null,!fe||x.value)return void(x.value=!0);if(!ue)return void(x.value=!1);let Q=!0;const re=g(ue,{rootMargin:O.value,allowIdle:!1});I.value=re,x.value=re.isVisible.value,re.whenVisible.then(()=>{Q&&I.value===re&&(x.value=!0)}),J(()=>{Q=!1,re.destroy(),I.value===re&&(I.value=null)})},{immediate:!0}),Ve([P,l,a,E,()=>o.lazy,T],([ue,fe,Me,J,Ae,Q])=>ue&&J&&!Me&&Q?fe?(U(),void z()):Ae?(X(),void z()):void(fe||Me||X()):(U(),void z()),{flush:"post",immediate:!0}),Jn(()=>{var ue;(ue=I.value)==null||ue.destroy(),I.value=null,(function(){const fe=_;fe&&(H(),_="",h?.markSettled(fe))})()}),(ue,fe)=>{var Me,J,Ae,Q,re;return k(),M("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":B.value&&!x.value?"true":void 0},[P.value?(k(),M("img",{key:0,src:N.value||void 0,alt:String((J=(Me=o.node.alt)!=null?Me:o.node.title)!=null?J:""),title:String((Q=(Ae=o.node.title)!=null?Ae:o.node.alt)!=null?Q:""),class:Fe(["image-node__img",{"is-loading":!D.value&&!l.value,"is-loaded":D.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:o.lazy?"lazy":void 0,fetchpriority:D.value?"high":void 0,decoding:D.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(re=o.node.alt)!=null?re:p(pe)("image.preview"),onError:se,onLoad:te,onClick:V},null,42,NIe)):ee("",!0),e.node.loading&&!a.value?(k(),M("span",FIe,[o.usePlaceholder?jn(ue.$slots,"placeholder",{key:0,node:o.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:o.fallbackSrc,lazy:o.lazy},()=>[fe[0]||(fe[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(k(),M("span",DIe,F(e.node.raw),1))])):ee("",!0),q.value&&!e.node.loading?(k(),M("span",$Ie,[o.usePlaceholder?jn(ue.$slots,"placeholder",{key:0,node:o.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:o.fallbackSrc,lazy:o.lazy},()=>[fe[1]||(fe[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(k(),M("span",BIe,F(e.node.raw),1))])):ee("",!0),R.value?(k(),M("span",zIe,[jn(ue.$slots,"error",{node:o.node,displaySrc:E.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:o.fallbackSrc,lazy:o.lazy},()=>[fe[2]||(fe[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),w("span",null,F(p(pe)("image.loadError")),1)],!0)])):ee("",!0)],8,LIe)}}}),[["__scopeId","data-v-046e82ac"]]);Xu.install=e=>{e.component(Xu.__name,Xu)};const RIe={key:2},_a=et({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Ws(()=>t.customId),i=un("markstreamHtmlPolicy",void 0),s=un("markstreamNestedRendererProps",void 0),o=L(()=>{var g;return(g=i?.value)!=null?g:"safe"}),r=L(()=>{var g,m;const y=(g=s?.value)!=null?g:{};return vn(xt({},y),{customId:(m=t.customId)!=null?m:y.customId,htmlPolicy:o.value})}),l=Fl({loader:()=>Promise.resolve().then(()=>E7),suspensible:!1}),a=L(()=>t.components[String(t.node.type)]),u=L(()=>!!(a.value&&n.value[t.node.type]&&!X0(String(t.node.type)))),c=L(()=>u.value?g7(t.node,o.value):void 0),d=L(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=L(()=>{var g;return String((g=t.node.content)!=null?g:"")}),h=L(()=>{var g,m;return String((m=(g=t.node.content)!=null?g:t.node.raw)!=null?m:"")});return(g,m)=>a.value&&u.value?(k(),de(Ys(a.value),ni({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:he(()=>[d.value?(k(),de(p(l),ni({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),de(p(l),ni({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),de(Ys(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),M("span",RIe,F(h.value),1)):ee("",!0)}}),qM=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function OIe(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return vn(xt(xt({},qM),n),{enabled:(t=n.enabled)==null||t})}return xt({},qM)}function k7(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function pO(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const s=i[0];if(s!=="`"&&s!=="~"||i[1]!==s||i[2]!==s)return"";let o=3;for(;i[o]===s;)o+=1;return i.slice(o).trim()}function UM(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function PIe(e){var t;return e.diff===!0||UM(e.language)||UM(pO(String((t=e.raw)!=null?t:"")))}function jIe(e,t,n){const i=(function(s){const o=pO(s);if(!o)return"";const r=o.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const HIe=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],WIe={key:0,translate:"no",class:"markstream-pre__diff-code"},qIe={class:"markstream-pre__diff-pane-content"},UIe={class:"markstream-pre__diff-number","aria-hidden":"true"},KIe={class:"markstream-pre__diff-content"},VIe={class:"markstream-pre__diff-content-inner"},ZIe={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},GIe=["textContent"],QIe=["textContent"],br=et({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(V,pe){const ue=String(V??"");return pe?ue:ue.replace(/\r\n$|\n$|\r$/,"")}const i=L(()=>{var V,pe,ue;const fe=String((pe=(V=t.node)==null?void 0:V.language)!=null?pe:"");return String((ue=String(fe).split(/\s+/g)[0])!=null?ue:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=L(()=>`language-${i.value}`),o=L(()=>{var V;return t.loading===!0||((V=t.node)==null?void 0:V.loading)===!0}),r=L(()=>{var V;return n((V=t.node)==null?void 0:V.code,o.value)});let l="",a=1;const u=L(()=>(function(V){let pe=0,ue=1;V.startsWith(l)&&(pe=l.length,ue=a,pe>0&&V[pe-1]==="\r"&&V[pe]===` +`&&pe++);for(let fe=pe;fer.value.split(/\r\n|\n|\r/));let d=0,f="";const h=L(()=>{const V=u.value;V{var V;return t.showLineNumbers===!0&&((V=t.node)==null?void 0:V.diff)===!0}),m=L(()=>g.value&&t.diffInline===!0),y=L(()=>{const V=Number(t.reservedHeightPx);if(!Number.isFinite(V)||V<=0)return;const pe=`${Math.ceil(V)}px`;return o.value?{maxHeight:pe,overflow:"auto"}:{height:pe,minHeight:pe,maxHeight:pe,overflow:"auto"}}),A=["diff ","index ","--- ","+++ ","@@ "];function b(V){return String(V??"").trim().length===0}function C(V,pe="context",ue={}){const fe=b(V);return{code:V,kind:fe&&pe!=="hunk"&&pe!=="spacer"&&!ue.preserveBlankKind?"context":pe,empty:fe}}function v(V){const pe=n(V,o.value);return pe?pe.split(/\r\n|\n|\r/):[]}function x(V,pe){return!b(V[pe])||peA.some(ue=>pe.startsWith(ue)))}function E(V,pe){return pe||!V.startsWith(" ")||V.startsWith(" ")?V:` ${V}`}function D(V,pe){const ue=V.length,fe=pe.length,Me=[];let J=0;for(;J=J&&re>=J&&V[Q]===pe[re];)Ae.unshift({originalIndex:Q,modifiedIndex:re}),Q--,re--;const Ce=Q-J+1,le=re-J+1;if(Ce<=0||le<=0||o.value||(Ce+1)*(le+1)>15e5)return Me.concat(Ae);const oe=le+1,G=new Uint32Array((Ce+1)*(le+1));for(let Ee=Ce-1;Ee>=0;Ee--)for(let Qe=le-1;Qe>=0;Qe--){const we=Ee*oe+Qe;if(V[J+Ee]===pe[J+Qe])G[we]=G[(Ee+1)*oe+Qe+1]+1;else{const Ne=G[(Ee+1)*oe+Qe],it=G[Ee*oe+Qe+1];G[we]=Ne>=it?Ne:it}}const ie=[];let ge=0,me=0;for(;ge=G[ge*oe+me+1]?ge++:me++;return Me.concat(ie,Ae)}function B(V){var pe;const ue=(function(){var re,Ce;const le=t.diffHideUnchangedRegions;if(le==null||le===!1)return null;const oe=le===!0?{}:le;return oe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((re=oe.contextLineCount)!=null?re:2)),minimumLineCount:Math.max(1,Math.floor((Ce=oe.minimumLineCount)!=null?Ce:4))}})();if(!ue||V.length<1||V.length>2||V.length===2&&V[0].lines.length!==V[1].lines.length)return V;const fe=V[0].lines,Me=(pe=V[1])==null?void 0:pe.lines,J=re=>fe[re].kind==="context"&&(Me===void 0||Me[re].kind==="context"&&fe[re].code===Me[re].code),Ae=[];let Q=0;for(;Q=ue.minimumLineCount){const le=re+(re===0?0:ue.contextLineCount),oe=Ce-(Ce===fe.length?0:ue.contextLineCount);oe-le>=ue.minimumLineCount&&Ae.push({start:le,end:oe})}Q===re&&Q++}return Ae.length?V.map((re,Ce)=>{const le=[];let oe=0;for(const G of Ae)le.push(...re.lines.slice(oe,G.start)),le.push({code:Ce===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${re.key}-collapsed-${G.start}-${G.end}`,number:""}),oe=G.end;return le.push(...re.lines.slice(oe)),vn(xt({},re),{lines:le})}):V}const T=L(()=>{var V,pe,ue,fe;if(!g.value)return[];const Me=(function(Ce){const le=Ce.some(G=>I(G)),oe=Ce.some(G=>_(G));return le&&oe||(function(){var G,ie,ge,me;if(i.value==="diff")return!0;const Ee=(me=(ge=String((ie=(G=t.node)==null?void 0:G.raw)!=null?ie:"").split(/\r?\n/,1)[0])==null?void 0:ge.trim())!=null?me:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ee)})()&&(le||oe)})(c.value),J=(function(){var Ce,le;return((Ce=t.node)==null?void 0:Ce.originalCode)!=null||((le=t.node)==null?void 0:le.updatedCode)!=null})();if(m.value){const Ce=J?(function(le,oe){const G=v(le),ie=v(oe),ge=D(G,ie);if(ge.length>0){const it=[];let De=0,Be=0;for(const Ze of ge){for(;De=Ee&&we>=Ee&&G[Qe]===ie[we];)Ne.unshift(vn(xt({},C(ie[we])),{key:`inline-suffix-${we}`,number:we+1})),Qe--,we--;for(let it=Ee;it<=Qe;it++)me.push(vn(xt({},C(G[it],"removed",{preserveBlankKind:x(G,it)})),{key:`inline-removed-source-${it}`,number:it+1}));for(let it=Ee;it<=we;it++)me.push(vn(xt({},C(ie[it],"added",{preserveBlankKind:x(ie,it)})),{key:`inline-added-source-${it}`,number:it+1}));return me.concat(Ne)})((V=t.node)==null?void 0:V.originalCode,(pe=t.node)==null?void 0:pe.updatedCode):(function(le){const oe=[];let G=1,ie=1;const ge=S(le);for(const[me,Ee]of le.entries())if(Ee.startsWith("@@")){const Qe=Ee.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Qe&&(G=Number(Qe[1]),ie=Number(Qe[2])),oe.push(vn(xt({},C(Ee,"hunk")),{key:`inline-hunk-${me}`,number:""}))}else if(I(Ee))oe.push(vn(xt({},C(E(Ee.slice(1),ge),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${me}`,number:G++}));else if(_(Ee))oe.push(vn(xt({},C(E(Ee.slice(1),ge),"added",{preserveBlankKind:!0})),{key:`inline-added-${me}`,number:ie++}));else{const Qe=ge&&Ee.startsWith(" ")?Ee.slice(1):Ee;oe.push(vn(xt({},C(Qe)),{key:`inline-context-${me}`,number:ie})),G++,ie++}return oe})(c.value);return B([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:Ce}])}if(!Me&&J)return(function(Ce,le){const oe=v(Ce),G=v(le),ie=D(oe,G),ge=[],me=[];let Ee=0,Qe=0,we=0;const Ne=(it,De)=>{const Be=Math.max(it-Ee,De-Qe);for(let Ze=0;Zevn(xt({},Ce),{key:`original-${le}`,number:le+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((Ce,le)=>vn(xt({},Ce),{key:`modified-${le}`,number:le+1}))}])}),N=L(()=>{var V,pe;if(t.showLineNumbers!==!0)return;let ue=g.value?1:u.value;if(g.value){ue=Math.max(ue,v((V=t.node)==null?void 0:V.originalCode).length,v((pe=t.node)==null?void 0:pe.updatedCode).length);for(const Me of T.value)for(const J of Me.lines)typeof J.number=="number"&&(ue=Math.max(ue,J.number))}const fe=`${Math.max(2,String(ue).length)}ch`;return{"--markstream-pre-line-number-width":fe,"--markstream-pre-diff-line-number-width":fe,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),O=L(()=>T.value.some(V=>V.lines.some(pe=>pe.kind==="collapsed"))),P=L(()=>{const V=i.value;return V?`Code block: ${V}`:"Code block"}),R=Z(null),q=Z([]);let j=null,W=!1,z=null;function H(V){const pe=Number.parseFloat(String(V??""));return Number.isFinite(pe)&&pe>0?pe:0}function X(V,pe){var ue;if(!V)return pe;if(V.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const fe=V.querySelector(".markstream-pre__diff-content"),Me=fe?.getBoundingClientRect(),J=(ue=Me?.height)!=null?ue:0;return Math.max(pe,Math.ceil(J))}function U(){W||typeof window>"u"||(j!=null&&window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{j=null,W||(function(){var V,pe;j=null;const ue=R.value;if(!ue||!g.value||m.value||!ue.classList.contains("is-wrap"))return void(q.value.length&&(q.value=[]));const fe=(function(le){const oe=window.getComputedStyle(le),G=H(oe.getPropertyValue("--markstream-pre-diff-line-height"));if(G>0)return G;const ie=H(oe.lineHeight);return ie>0?ie:18})(ue),Me=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),J=Array.from(ue.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Ae=Math.max(Me.length,J.length),Q=[];for(let le=0;le{const G=Ce[oe];return G&&Math.abs(le.rowHeight-G.rowHeight)<=.5&&Math.abs(le.originalHeight-G.originalHeight)<=.5&&Math.abs(le.modifiedHeight-G.modifiedHeight)<=.5})||(q.value=Q)})()}))}function se(V){z?.disconnect(),z=null,V&&g.value&&!m.value&&typeof ResizeObserver<"u"&&(z=new ResizeObserver(()=>{U()}),z.observe(V))}function te(V,pe){const ue=q.value[V];if(!ue)return;const fe=pe==="original"?ue.originalHeight:ue.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ue.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(fe)}px`}}return Ve(R,V=>{se(V),kt(()=>U())},{flush:"post"}),Ve([g,m,T],()=>{se(R.value),kt(()=>U())},{flush:"post",immediate:!0}),Jn(()=>{W=!0,j!=null&&(window.cancelAnimationFrame(j),j=null),z?.disconnect(),z=null}),(V,pe)=>(k(),M("pre",{ref_key:"preRef",ref:R,style:qt([y.value,N.value]),class:Fe([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":g.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":O.value}]),"aria-busy":o.value,"aria-label":P.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[g.value?(k(),M("code",WIe,[(k(!0),M(Te,null,dt(T.value,ue=>(k(),M("span",{key:ue.key,class:Fe(["markstream-pre__diff-pane",ue.className])},[w("span",qIe,[(k(!0),M(Te,null,dt(ue.lines,(fe,Me)=>(k(),M("span",{key:fe.key,class:Fe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${fe.kind}`,{"markstream-pre__diff-line--empty":fe.empty}]]),style:qt(te(Me,ue.key))},[pe[0]||(pe[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",UIe,F(fe.number),1),w("span",KIe,[w("span",VIe,F(fe.code),1)])],6))),128))])],2))),128))])):(k(),M(Te,{key:1},[t.showLineNumbers?(k(),M("span",ZIe,[w("span",{class:"markstream-pre__line-numbers-text",textContent:F(h.value)},null,8,GIe)])):ee("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:F(r.value)},null,8,QIe)],64))],14,HIe))}});br.install=e=>{e.component(br.__name,br)};const bs=gi(et({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=zh(),i=un("markstreamFade",void 0),s=un("markstreamTextStreamState",void 0),o=un("markstreamStreamVersion",void 0),r=L(()=>{const x=n.fade;return x===""||x===!0||x==="true"||x!==!1&&x!=="false"&&void 0}),l=L(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=L(()=>{var x;const I=(x=n["index-key"])!=null?x:n.indexKey;return I==null||I===""?"":String(I)}),u=Z(t.node.content),c=Z(""),d=Z(0),f=Z(t.node.content);let h;const g=Z(null),m=Z(null);let y="",A=null;function b(){h?.(),h=void 0}function C(){b(),c.value&&(u.value=u.value+c.value,c.value="")}Ve([u,g,m],function(){var x,I;const _=g.value;if(!_)return;const S=String((x=u.value)!=null?x:""),E=m.value;return A||(A=_.firstChild,y=(I=A?.data)!=null?I:""),S.startsWith(y)?!A&&S?(_.textContent=S,A=_.firstChild,void(y=S)):void(S.length>y.length&&E&&(E.appendChild(document.createTextNode(S.slice(y.length))),y=S)):(_.textContent=S,A=_.firstChild,E&&(E.textContent=""),void(y=S))},{immediate:!0}),Ve([()=>t.node.content,a,l],([x])=>{const I=String(x??""),_=a.value,S=GR({nextContent:I,persistedContent:_?s?.get(_):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!o)return;const E=o.value;h=Ve(()=>o.value,D=>{D!==E&&C()},{flush:"sync"})})()):c.value||b(),_&&s?.set(_,I)},{immediate:!0}),Jd(b);const v=L(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(x,I)=>(k(),M("span",{class:Fe([[e.node.center?"text-node-center":""],"text-node"])},[On(w("span",{ref_key:"settledTextEl",ref:g},F(f.value),513),[[rs,u.value!==""]]),On(w("span",{ref_key:"settledAppendsEl",ref:m},null,512),[[rs,u.value!==""]]),c.value?(k(),M("span",{key:0,class:Fe(["text-node-stream-delta",[v.value]]),onAnimationend:C},F(c.value),35)):ee("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function op(e,t,n){return et({name:e,inheritAttrs:!1,setup(i,{attrs:s,slots:o}){var r,l;const a=y7(),u=m7(),c=v7(),d=typeof window<"u"&&((l=(r=Hs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=Z(typeof window>"u"||d||!c.value),h=ql(null);let g=null;function m(y){const A=y&&"$el"in y?y.$el:y;h.value=A instanceof HTMLElement?A:null}return typeof window<"u"&&Ve([h,c],([y,A],b,C)=>{if(g?.destroy(),g=null,!A||f.value)return void(f.value=!0);if(!y)return;let v=!0;const x=a(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});g=x,f.value=x.isVisible.value,x.whenVisible.then(()=>{v&&g===x&&(f.value=!0)}),C(()=>{v=!1,x.destroy(),g===x&&(g=null)})},{immediate:!0}),Jn(()=>{g?.destroy(),g=null}),()=>pn(f.value?t:n,vn(xt({},s),{ref:m}),o)}})}bs.install=e=>{e.component(bs.__name,bs)};const Vv=et({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,s,o,r,l,a,u;const c=c9(String((s=(i=n.node)==null?void 0:i.language)!=null?s:"")),d=xM[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):xM[""]),f=PIe(n.node),h=jIe(String((r=(o=n.node)==null?void 0:o.raw)!=null?r:""),d,f),g=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:k7(g??{},typeof window>"u"?0:window.innerWidth)),y=g?.diffAppearance,A=y==="dark"||y!=="light"&&n.isDark===!0,b=typeof g?.fontSize=="number"&&Number.isFinite(g.fontSize)&&g.fontSize>0?g.fontSize:12,C=typeof g?.lineHeight=="number"&&Number.isFinite(g.lineHeight)&&g.lineHeight>0?g.lineHeight:b===12?18:Math.max(12,Math.round(1.5*b)),v=typeof g?.tabSize=="number"&&Number.isFinite(g.tabSize)&&g.tabSize>0?g.tabSize:4,x=f?0:8,I=typeof((a=g?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(g.padding.top)&&g.padding.top>=0?g.padding.top:x,_=typeof((u=g?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(g.padding.bottom)&&g.padding.bottom>=0?g.padding.bottom:x,S=typeof g?.fontFamily=="string"?g.fontFamily.trim():"",E=xt(xt({fontSize:`${b}px`,lineHeight:`${C}px`,tabSize:v,paddingTop:`${I}px`,paddingBottom:`${_}px`,"--markstream-pre-line-number-top":`${I}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),S?{"--markstream-code-font-family":S}:{}),D=()=>pn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[pn("svg",{class:"action-icon",width:"14",height:"14"})]),B=n.isShowPreview!==!1&&(c==="html"||c==="svg"),T=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||B&&n.showPreviewButton!==!1,N=P=>{if(P!=null)return typeof P=="number"?`${P}px`:String(P)},O=xt(xt(xt({"--markstream-code-layout-character-width":"1ch"},N(n.minWidth)?{minWidth:N(n.minWidth)}:{}),N(n.maxWidth)?{maxWidth:N(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return pn("div",vn(xt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":A,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[O,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:pn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[pn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[pn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),pn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[pn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?pn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),pn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?pn("div",{class:"code-diff-stats","aria-hidden":"true"},[pn("span",{class:"code-diff-stat removed"},"-0"),pn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:D(),n.showCollapseButton===!1?null:D(),T?pn("div",{class:"relative"},[D()]):null])]),pn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[pn(br,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?OIe(g?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:E,"data-markstream-code-loading":"1"})]),pn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[pn("div",{class:"loading-skeleton"},[pn("div",{class:"skeleton-line"}),pn("div",{class:"skeleton-line"}),pn("div",{class:"skeleton-line short"})])]),pn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),G3=op("ViewportDeferredCodeBlockNode",Fl({loader:()=>$i(null,null,function*(){try{return(yield ys(()=>import("./CodeBlockNode-quY55RAx.js"),__vite__mapDeps([6,7]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),br}}),loadingComponent:Vv,delay:0,suspensible:!1}),Vv),Zl=Fl(()=>$i(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,s,o;return pn(bs,vn(xt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield eO(),(yield ys(()=>import("./index7-CK_1qBRq.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,s,o;return pn(bs,vn(xt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(o=t.node.raw)!=null?o:`$${(s=t.node.content)!=null?s:""}$`}}))}})),gO=Fl(()=>$i(null,null,function*(){try{return yield eO(),(yield ys(()=>import("./index6-Df7o-fck.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,s;return pn(bs,vn(xt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),or=gi(et({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),M("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},F(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);or.install=e=>{e.component(or.__name,or)};const YIe={class:"superscript-node"},Sr=gi(et({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,emphasis:ur,footnote_reference:qr,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,emoji:xr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("sup",YIe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Sr.install=e=>{e.component(Sr.__name,Sr)};const JIe={class:"subscript-node"},_r=gi(et({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,emphasis:ur,footnote_reference:qr,strikethrough:lr,highlight:Kr,insert:Ir,superscript:Sr,emoji:xr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("sub",JIe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);_r.install=e=>{e.component(_r.__name,_r)};const XIe={class:"strong-node"},rr=gi(et({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,emphasis:ur,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,footnote_reference:qr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("strong",XIe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);rr.install=e=>{e.component(rr.__name,rr)};const eMe={class:"strikethrough-node"},lr=gi(et({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,emphasis:ur,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,footnote_reference:qr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("del",eMe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);lr.install=e=>{e.component(lr.__name,lr)};const tMe=["href","title","aria-label","aria-hidden","target","rel"],nMe=["aria-hidden"],iMe={class:"link-text-wrapper relative inline-flex"},sMe={class:"leading-[normal] link-text"},ar=gi(et({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=un("markstreamShowTooltips",void 0),i=L(()=>{const A=n?.value;return typeof A=="boolean"?A:t.showTooltip}),s=L(()=>{var A,b,C,v,x;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",_=(A=t.animationOpacity)!=null?A:.35,S=Math.max(.12,Math.min(.5*_,_)),E={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":I,"--underline-opacity":String(_),"--underline-rest-opacity":String(S),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(v=t.animationTiming)!=null?v:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(x=t.animationIteration)!=null?x:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),o=Ws(()=>t.customId),r=L(()=>xt({text:bs,strong:rr,strikethrough:lr,emphasis:ur,image:Xu,html_inline:Ur,inline_code:qo},o.value)),l=zh(),a=L(()=>{var A,b;const C=(A=t.node)==null?void 0:A.attrs;if(!C||typeof C!="object")return{};const v={};if(Array.isArray(C))for(const x of C)Array.isArray(x)&&x[0]&&(v[String(x[0])]=String((b=x[1])!=null?b:""));else for(const[x,I]of Object.entries(C))x&&I!=null&&I!==!1&&(v[x]=I===!0?"":String(I));return zM(v,"safe","a")}),u=L(()=>xt(xt({},l),a.value)),c=L(()=>{var A,b;return zM({href:String((b=(A=t.node)==null?void 0:A.href)!=null?b:"")},"safe","a").href}),d=L(()=>{if(!c.value)return;const A=u.value.target;return(typeof A=="string"?A.trim():String(A??"").trim())||(j7e(c.value)?"_blank":void 0)}),f=L(()=>{var A;return String((A=d.value)!=null?A:"").trim().toLowerCase()==="_blank"}),h=L(()=>{if(!c.value)return;const A=u.value.rel,b=new Set((typeof A=="string"?A:String(A??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(b).filter(v=>v.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),g=L(()=>{const A=xt({},u.value);return delete A.title,delete A.href,delete A.target,delete A.rel,A});function m(){i.value&&xIe()}const y=L(()=>{var A,b;const C=(A=t.node)==null?void 0:A.title;return typeof C=="string"&&C.trim().length>0?C:String((b=c.value)!=null?b:"")});return(A,b)=>{var C,v;return e.node.loading?(k(),M("span",ni({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:s.value}),[w("span",iMe,[w("span",sMe,[K(p(bs),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((v=e.node.text)!=null?v:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,nMe)):(k(),M("a",ni({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},g.value,{style:s.value,onMouseenter:b[0]||(b[0]=x=>(function(I){var _,S,E,D;if(!i.value)return;const B=I,T=B?.clientX!=null&&B?.clientY!=null?{x:B.clientX,y:B.clientY}:void 0,N=((_=t.node)==null?void 0:_.title)||((S=c.value)!=null&&S.includes("xn--")&&((D=(E=t.node)==null?void 0:E.text)!=null&&D.includes("://"))?t.node.text:c.value)||"";wIe(I.currentTarget,N,"top",!1,T)})(x)),onMouseleave:m}),[(k(!0),M(Te,null,dt(e.node.children,(x,I)=>(k(),de(p(_a),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:x,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,tMe))}}}),[["__scopeId","data-v-367e6ca4"]]);ar.install=e=>{e.component(ar.__name,ar)};const oMe={class:"insert-node"},Ir=gi(et({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,emphasis:ur,strikethrough:lr,highlight:Kr,subscript:_r,superscript:Sr,emoji:xr,footnote_reference:qr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("ins",oMe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ir.install=e=>{e.component(Ir.__name,Ir)};const rMe={class:"highlight-node"},Kr=gi(et({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,emphasis:ur,strikethrough:lr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,footnote_reference:qr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("mark",rMe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Kr.install=e=>{e.component(Kr.__name,Kr)};const lMe={class:"emphasis-node"},ur=gi(et({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>xt({text:bs,inline_code:qo,link:ar,html_inline:Ur,strong:rr,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,footnote_reference:qr,math_inline:Zl,reference:or},n.value));return(s,o)=>(k(),M("em",lMe,[(k(!0),M(Te,null,dt(e.node.children,(r,l)=>(k(),de(p(_a),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);ur.install=e=>{e.component(ur.__name,ur)};const aMe={class:"hard-break"},ec=gi(et({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),M("br",aMe))}),[["__scopeId","data-v-50c58f70"]]);ec.install=e=>{e.component(ec.__name,ec)};const y0=et({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=St({checkbox:Wr,checkbox_input:Wr,emoji:xr,emphasis:ur,hardbreak:ec,highlight:Kr,inline_code:qo,insert:Ir,link:ar,reference:or,strikethrough:lr,strong:rr,subscript:_r,superscript:Sr,text:bs}),i=Ws(()=>t.customId),s=L(()=>{const o=i.value;return Object.keys(o).length>0?xt(xt({},n),o):n});return(o,r)=>(k(!0),M(Te,null,dt(e.nodes,(l,a)=>(k(),de(p(_a),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function _8(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(_8)}function Zv(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(_8))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const s=i.children;return(n||s.length>0)&&s.every(_8)?s:null}function Kd(e){var t,n;if(!e?.length)return null;let i="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;i+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return i}const uMe=["cite"],cMe={key:0,dir:"auto",class:"paragraph-node"},dMe=["custom-id"],p2=gi(et({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Ws(()=>t.customId),i=L(()=>!!n.value.paragraph),s=L(()=>!!n.value.text),o=L(()=>Zv(t.node.children,!i.value)),r=L(()=>t.fade!==!1||s.value?null:Kd(o.value));return Gn("markstreamShowTooltips",L(()=>t.showTooltips)),Gn("markstreamFade",L(()=>t.fade)),(l,a)=>(k(),M("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[o.value?(k(),M("p",cMe,[r.value!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(r.value),9,dMe)):(k(),de(p(y0),{key:1,nodes:o.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),de(p(Mr),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,uMe))}}),[["__scopeId","data-v-abfecebc"]]);p2.install=e=>{e.component(p2.__name,p2)};const fMe={class:"definition-list"},hMe={class:"definition-term"},pMe={class:"definition-desc"},g2=gi(et({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),M("dl",fMe,[(k(!0),M(Te,null,dt(t.node.items,(s,o)=>(k(),M(Te,{key:o},[w("dt",hMe,[K(p(Mr),{"index-key":`definition-term-${t.indexKey}-${o}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",pMe,[K(p(Mr),{"index-key":`definition-desc-${t.indexKey}-${o}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);g2.install=e=>{e.component(g2.__name,g2)};const gMe=["href","title"],Np=gi(et({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var s;if(i.preventDefault(),typeof document>"u")return;const o=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(o);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,s)=>(k(),M("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,gMe))}}),[["__scopeId","data-v-e1eb37b6"]]);Np.install=e=>{e.component(Np.__name,Np)};const mMe=["id"],vMe={class:"flex-1"},m2=et({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),M("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",vMe,[K(p(Mr),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,mMe))}});m2.install=e=>{e.component(m2.__name,m2)};const yMe=["custom-id"],I8=gi(et({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ws(()=>t.customId),i=un("markstreamFade",void 0),s=L(()=>i?.value!==!1||n.value.text?null:Kd(t.node.children)),o=L(()=>xt({text:bs,inline_code:qo,link:ar,image:Xu,strong:rr,emphasis:ur,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,checkbox:Wr,checkbox_input:Wr,footnote_reference:qr,hardbreak:ec,math_inline:Zl,reference:or},n.value));return(r,l)=>(k(),de(Ys(`h${e.node.level}`),ni({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:he(()=>[s.value!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(s.value),9,yMe)):(k(!0),M(Te,{key:1},dt(e.node.children,(a,u)=>(k(),de(p(_a),{key:u,components:o.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),h9=I8;h9.install=e=>{e.component(I8.__name,I8)};const kMe={key:0,dir:"auto",class:"paragraph-node"},bMe=["custom-id"],AMe={dir:"auto",class:"paragraph-node"},CMe=["custom-id"],bh=gi(et({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=L(()=>{var h;return(h=t.node)!=null?h:t.item}),i=Ws(()=>t.customId),s=L(()=>!!i.value.paragraph),o=L(()=>!!i.value.text),r=L(()=>{var h;return Zv((h=n.value)==null?void 0:h.children,!s.value)}),l=L(()=>{var h;if(s.value)return null;const g=(h=n.value)==null?void 0:h.children;if(!Array.isArray(g)||g.length<2)return null;const m=g[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const y=g.slice(1);if(!y.every(b=>b?.type==="list"))return null;const A=Zv([m]);return A?{paragraphChildren:A,nestedLists:y}:null});function a(){return t.fade===!1&&!o.value}const u=L(()=>a()?Kd(r.value):null),c=L(()=>{var h;return a()?Kd((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=L(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Gn("markstreamShowTooltips",L(()=>t.showTooltips)),Gn("markstreamFade",L(()=>t.fade)),(h,g)=>{var m,y;return k(),M("li",ni({class:"list-item",dir:"auto"},f.value),[r.value?(k(),M("p",kMe,[u.value!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(u.value),9,bMe)):(k(),de(p(y0),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),M(Te,{key:1},[w("p",AMe,[c.value!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(c.value),9,CMe)):(k(),de(p(y0),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),M(Te,null,dt(l.value.nestedLists,(A,b)=>(k(),de(p(Mr),{key:b,nodes:[A],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:g[0]||(g[0]=C=>h.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),de(p(Mr),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(m=n.value)==null?void 0:m.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:g[1]||(g[1]=A=>h.$emit("copy",A))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);bh.install=e=>{e.component(bh.__name,bh)};const Ah=gi(et({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Ws(()=>e.customId),n=L(()=>t.value.list_item||bh);return(i,s)=>(k(),de(Ys(e.node.ordered?"ol":"ul"),{class:Fe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:he(()=>[(k(!0),M(Te,null,dt(e.node.items,(o,r)=>{var l;return k(),de(Ys(n.value),ni({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Ah.install=e=>{e.component(Ah.__name,Ah)};const wMe={key:2,class:"html-block-node__raw"},xMe=["innerHTML"],SMe={key:1,class:"html-block-node__placeholder"},Fp=gi(et({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=un("markstreamHtmlPolicy",void 0),i=un("markstreamNestedRendererProps",void 0),s=L(()=>{var T,N;return(N=(T=t.htmlPolicy)!=null?T:n?.value)!=null?N:"safe"}),o=L(()=>{var T,N;const O=(T=i?.value)!=null?T:{};return vn(xt({},O),{customId:(N=t.customId)!=null?N:O.customId,htmlPolicy:s.value})}),r=Fl({loader:()=>Promise.resolve().then(()=>E7),suspensible:!1}),l=L(()=>{const T=c2(t.node.attrs,s.value);if(!T)return;const N=Mp(T);return Object.keys(N).length>0?N:void 0}),a=L(()=>{const T=String(t.node.tag||"").trim(),N=c2(t.node.attrs,s.value,T);if(!N)return;const O=Mp(N);return Object.keys(O).length>0?O:void 0}),u=Ws(()=>t.customId),c=et({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),f=Z(typeof window>"u"),h=Z(t.node.content),g=L(()=>Array.isArray(t.node.children)?t.node.children:[]),m=L(()=>String(t.node.tag||"div")),y=L(()=>{var T;if(m.value.trim().toLowerCase()!=="details"||(T=t.node.attrs)!=null&&T.some(([O])=>String(O).toLowerCase()==="open"))return null;const N=g.value[0];return N?.type==="html_block"&&String(N.tag||"").toLowerCase()==="summary"?N:null}),A=L(()=>{var T;return Kd((T=y.value)==null?void 0:T.children)}),b=L(()=>{const T=y.value;if(!T)return;const N=c2(T.attrs,s.value,"summary");if(!N)return;const O=Mp(N);return Object.keys(O).length>0?O:void 0}),C=L(()=>A.value==null?g.value:g.value.slice(1)),v=L(()=>{const T=m.value.trim().toLowerCase();return Dz.has(T)||c7(T,s.value)}),x=L(()=>g.value.length>0&&!!t.node.tag&&!v.value),I=L(()=>{var T,N,O;if(x.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(T=h.value)!=null?T:""};const P=(N=h.value)!=null?N:t.node.content;if(!P)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:kh(P,s.value)};if(t.node.loading){const q=Kv(P,u.value,s.value);return q===null?{mode:"text",content:(O=t.node.raw)!=null?O:P}:{mode:"dynamic",nodes:q}}if(!aO(P,u.value))return{mode:"html",content:kh(P,s.value)};const R=Kv(P,u.value,s.value);return R===null?{mode:"html",content:kh(P,s.value)}:{mode:"dynamic",nodes:R}}),_=y7(),S=m7(),E=v7(),D=ql(null),B=!!t.node.loading;return typeof window<"u"?(Ve([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([T],N,O)=>{var P,R,q,j;if((R=(P=D.value)==null?void 0:P.destroy)==null||R.call(P),D.value=null,!B)return f.value=!0,void(h.value=t.node.content);if(!T)return void(f.value=!1);let W=!0;const z=(j=(q=S?.value.heavyBlockMargin)!=null?q:S?.value.rootMargin)!=null?j:Ud,H=_(T,{rootMargin:z,allowIdle:!E.value});D.value=H,f.value=f.value||H.isVisible.value,H.whenVisible.then(()=>{W&&D.value===H&&(f.value=!0)}),O(()=>{W=!1,H.destroy(),D.value===H&&(D.value=null)})},{immediate:!0}),Ve(()=>t.node.content,T=>{B&&!f.value||(h.value=T)})):f.value=!0,Jn(()=>{var T,N;(N=(T=D.value)==null?void 0:T.destroy)==null||N.call(T),D.value=null}),(T,N)=>(k(),de(Ys(x.value?m.value:"div"),ni({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(E)&&!f.value?"true":void 0},x.value?a.value:void 0),{default:he(()=>[f.value?(k(),M(Te,{key:0},[I.value.mode==="structured"?(k(),M(Te,{key:0},[A.value!==null?(k(),M(Te,{key:0},[w("summary",NH(pN(b.value)),F(A.value),17),C.value.length?(k(),de(p(r),ni({key:0},o.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ee("",!0)],64)):(k(),de(p(r),ni({key:1},o.value,{nodes:g.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):I.value.mode==="dynamic"?(k(),de(p(c),{key:1,nodes:I.value.nodes},null,8,["nodes"])):I.value.mode==="text"?(k(),M("pre",wMe,F(I.value.content),1)):(k(),M("div",ni({key:3},l.value,{innerHTML:I.value.content}),null,16,xMe))],64)):(k(),M("div",SMe,[jn(T.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Fp.install=e=>{e.component(Fp.__name,Fp)};const _Me={dir:"auto",class:"paragraph-node"},IMe=["custom-id"],Nd=gi(et({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Ws(()=>t.customId),i=un("markstreamHtmlPolicy",void 0),s=un("markstreamFade",void 0),o=un("markstreamParseOptions",void 0),r=un("markstreamCustomMarkdownIt",void 0),l=un("markstreamNestedRendererProps",void 0),a=L(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=L(()=>{var S;return(S=t.parseOptions)!=null?S:o?.value}),c=L(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=L(()=>{var S,E;return(E=t.customHtmlTags)!=null?E:(S=l?.value)==null?void 0:S.customHtmlTags}),f=L(()=>{var S,E;const D=(S=l?.value)!=null?S:{};return vn(xt({},D),{customId:(E=t.customId)!=null?E:D.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Fl({loader:()=>Promise.resolve().then(()=>E7),suspensible:!1});function g(S){var E;return S.type==="text"&&String((E=S.content)!=null?E:"").trim()===""}const m=L(()=>t.node.children.filter(S=>!g(S))),y=L(()=>m.value.length>0&&m.value.every(S=>S.type==="image"||(function(E){var D;const B=(function(T){return T.type==="link"&&Array.isArray(T.children)?T.children.filter(N=>!g(N)):[]})(E);return B.length===1&&((D=B[0])==null?void 0:D.type)==="image"})(S))),A=L(()=>new Set(nf(d.value))),b=L(()=>{if(!y.value||m.value.length<=1)return t.node.children;const S=[];for(let E=0;E0,T=t.node.children.slice(E+1).some(N=>!g(N));B&&T&&S.push(vn(xt({},D),{content:" ",raw:" "}))}return S}),C=L(()=>s?.value===!1&&!n.value.text),v=L(()=>C.value?Kd(b.value):null);function x(S,E){return{node:S,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=L(()=>xt({inline_code:qo,image:Xu,link:ar,hardbreak:ec,emphasis:ur,strong:rr,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,html_inline:Ur,html_block:Fp,emoji:xr,checkbox:Wr,math_inline:Zl,checkbox_input:Wr,reference:or,footnote_anchor:Np,footnote_reference:qr,text:bs},n.value)),_=L(()=>b.value.map((S,E)=>{var D;const B=(function(T){var N,O,P,R;if(T.type==="html_block"||T.type==="html_inline"){const q=String((N=T.tag)!=null?N:"").trim().toLowerCase()||Oz(T.content);if(q&&!A.value.has(q)&&Pz((O=T.content)!=null?O:T.raw,q)){const j=String((R=(P=T.content)!=null?P:T.raw)!=null?R:"");return{child:{type:"text",content:j,raw:j},component:bs,isCustomComponent:!1}}}return{child:T,component:I.value[T.type],isCustomComponent:!!(n.value[T.type]&&!X0(String(T.type)))}})(S);return vn(xt({},B),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:B.isCustomComponent?g7(B.child,a.value):void 0,hasSlotChildren:Array.isArray(B.child.children)&&B.child.children.length>0,slotContent:String((D=B.child.content)!=null?D:""),originalChild:S})}));return(S,E)=>(k(),M("p",_Me,[v.value!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(v.value),9,IMe)):(k(!0),M(Te,{key:1},dt(_.value,D=>{return k(),M(Te,{key:D.key},[y.value&&g(D.originalChild)?(k(),M(Te,{key:0},[Re(F((B=D.originalChild,String((T=B.content)!=null?T:""))),1)],64)):D.isCustomComponent?(k(),de(Ys(D.component),ni({key:1,ref_for:!0},D.customAttrs,{node:D.child,loading:D.child.loading,"index-key":D.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:he(()=>[D.hasSlotChildren?(k(),de(p(h),ni({key:0,ref_for:!0},f.value,{nodes:D.child.children,"index-key":D.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):D.slotContent?(k(),de(p(h),ni({key:1,ref_for:!0},f.value,{content:D.slotContent,final:!D.child.loading,"index-key":`${D.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),de(Ys(D.component),ni({key:2,ref_for:!0},x(D.child,D.index)),null,16))],64);var B,T}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Nd.install=e=>{e.component(Nd.__name,Nd)};const MMe={class:"table-node-wrapper"},EMe=["aria-busy"],TMe={key:0},LMe=["custom-id"],NMe=["aria-label","onPointerdown"],FMe=["custom-id"],DMe={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Dp=gi(et({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=L(()=>{var A;return(A=t.node.loading)!=null&&A}),i=L(()=>{var A;return(A=t.node.rows)!=null?A:[]}),s=Z(null),o=Z([]);let r=null;const l=L(()=>t.node.header.cells.length),a=L(()=>o.value.some(A=>Number.isFinite(A)&&A>0)),u=L(()=>a.value?o.value.map(A=>A>0?{width:`${A}px`}:void 0):[]);Gn("markstreamShowTooltips",L(()=>t.showTooltips)),Gn("markstreamFade",L(()=>t.fade));const c=Ws(()=>t.customId),d=L(()=>!!c.value.text),f=L(()=>!!c.value.paragraph),h=new WeakMap;function g(A){const b=t.fade===!1&&!d.value,C=!f.value,v=h.get(A);if(v?.children===A.children&&v.textFastPath===b&&v.paragraphFastPath===C)return v.info;const x=Zv(A.children,C,!0),I={simpleChildren:x,plainText:x&&b?Kd(x):null};return h.set(A,{children:A.children,textFastPath:b,paragraphFastPath:C,info:I}),I}function m(A){if(!r)return;A.preventDefault();const b=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(b/2)),v=Math.max(C,Math.min(b-C,Math.round(r.startWidth+A.clientX-r.startX))),x=[...r.widths];x[r.index]=v,x[r.index+1]=b-v,o.value=x}function y(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return Ve(l,()=>{y(),o.value=[]}),Jn(y),(A,b)=>(k(),M("div",MMe,[w("table",{ref_key:"tableRef",ref:s,class:Fe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),M("colgroup",TMe,[(k(!0),M(Te,null,dt(e.node.header.cells,(C,v)=>(k(),M("col",{key:v,style:qt(u.value[v])},null,4))),128))])):ee("",!0),w("thead",null,[w("tr",null,[(k(!0),M(Te,null,dt(e.node.header.cells,(C,v)=>(k(),M("th",{key:v,dir:"auto",class:Fe([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[g(C).plainText!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(g(C).plainText),9,LMe)):g(C).simpleChildren?(k(),de(p(y0),{key:1,nodes:g(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${v}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(Mr),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=x=>A.$emit("copy",x))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),v(function(I,_){if(_.button!==0)return;const S=(function(){var B;const T=(B=s.value)==null?void 0:B.querySelectorAll("thead th");return Array.from(T??[],N=>Math.round(N.getBoundingClientRect().width))})(),E=S[I],D=S[I+1];E&&D&&(_.preventDefault(),r={index:I,startX:_.clientX,startWidth:E,nextStartWidth:D,widths:S},o.value=S,window.addEventListener("pointermove",m),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(v,x)},null,40,NMe)):ee("",!0)],2))),128))])]),w("tbody",null,[(k(!0),M(Te,null,dt(i.value,(C,v)=>(k(),M("tr",{key:v},[(k(!0),M(Te,null,dt(C.cells,(x,I)=>(k(),M("td",{key:I,class:Fe([x.align==="right"?"text-right":x.align==="center"?"text-center":"text-left"]),dir:"auto"},[g(x).plainText!==null?(k(),M("span",{key:0,class:"text-node","custom-id":t.customId},F(g(x).plainText),9,FMe)):g(x).simpleChildren?(k(),de(p(y0),{key:1,nodes:g(x).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${v}-${I}`},null,8,["nodes","custom-id","index-key"])):(k(),de(p(Mr),{key:2,nodes:x.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=_=>A.$emit("copy",_))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,EMe),K(ls,{name:"table-node-fade"},{default:he(()=>[n.value?(k(),M("div",DMe,[jn(A.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):ee("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Dp.install=e=>{e.component(Dp.__name,Dp)};const $Me={class:"hr-node"},v2=gi({},[["render",function(e,t){return k(),M("hr",$Me)}],["__scopeId","data-v-39b2349c"]]);v2.install=e=>{e.component(v2.__name,v2)};const BMe={class:"unknown-node"},M8=et({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),M("div",BMe,F(e.node.raw),1))}),y2=gi(et({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=L(()=>`vmr-container vmr-container-${t.node.name}`),i=Ws(()=>t.customId),s=L(()=>xt({text:bs,paragraph:Nd,heading:h9,inline_code:qo,link:ar,image:Xu,strong:rr,emphasis:ur,strikethrough:lr,insert:Ir,subscript:_r,superscript:Sr,checkbox:Wr,checkbox_input:Wr,hardbreak:ec,math_inline:Zl,reference:or,list:Ah,math_block:gO,table:Dp},i.value));return(o,r)=>(k(),M("div",ni({class:n.value},e.node.attrs),[(k(!0),M(Te,null,dt(e.node.children,(l,a)=>{return k(),de(Ys((u=l.type,s.value[u]||M8)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);y2.install=e=>{e.component(y2.__name,y2)};const zMe=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],KM=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function RMe(e){if(e<=255)return zMe[e];let t=0,n=KM.length-1;for(;t<=n;){const i=t+n>>1,s=KM[i];if(es[1]))return s[2];t=i+1}}return"L"}const OMe=/[ \t\n\r\f]+/g,PMe=/[\t\n\r\f]| {2,}|^ | $/;let Q3=null;const jMe=new RegExp("\\p{Script=Arabic}","u"),pc=new RegExp("\\p{M}","u"),b7=new RegExp("\\p{Nd}","u");function VM(e){return jMe.test(e)}function ZM(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function ha(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(ZM(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(ZM(n))return!0}}return!1}const HMe=new Set([" "," ","⁠","\uFEFF"]),WMe=new Set(["-","‐","–","—"]);function mO(e,t){return!((function(n){const i=$p(n);return i!==null&&HMe.has(i)})(e)||t&&((function(n){const i=$p(n);return i!==null&&(A7.has(i)||Vd.has(i))})(e)||(function(n){const i=$p(n);return i!==null&&WMe.has(i)})(e)))}const A7=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),p9=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),C7=new Set(["'","’"]),Vd=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),qMe=new Set([":",".","،","؛"]),UMe=new Set(["၏"]),KMe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function VMe(e){if(w7(e))return!0;let t=!1;for(const n of e)if(Vd.has(n)||Qv(n))t=!0;else if(!t||!pc.test(n))return!1;return t}function ZMe(e){for(const t of e)if(!A7.has(t)&&!Vd.has(t))return!1;return e.length>0}function GMe(e){if(w7(e))return!0;for(const t of e)if(!(p9.has(t)||C7.has(t)||pc.test(t)||Qv(t)))return!1;return e.length>0}function w7(e){let t=!1;for(const n of e)if(n!=="\\"&&!pc.test(n)){if(!(p9.has(n)||Vd.has(n)||C7.has(n)))return!1;t=!0}return t}function Gv(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const s=n-1;if(s<0)return n;const o=e.charCodeAt(s);return o>=55296&&o<=56319?s:n}function $p(e){if(e.length===0)return null;const t=Gv(e,e.length);return e.slice(t)}const QMe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Qv(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let s=0;s=i[s]&&n<=i[s+1])return!0;return!1})(t,QMe)}function YMe(e){const t=(function(n){for(const i of n)if(!pc.test(i))return i;return null})(e);return t!==null&&b7.test(t)}function JMe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(pc.test(i))n--;else{if(!p9.has(i)&&!C7.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function XMe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function GM(e,t,n,i){const s=t[i],o=e[i];if(s==null)return o;const r=n[i];if(o.length===r)return o;const l=s.repeat(r);return e[i]=l,l}function QM(e,t){return e&&t!==null&&qMe.has(t)}function eEe(e){const t=$p(e);return t!==null&&UMe.has(t)}function tEe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function E8(e){let t=e.length;for(;t>0;){const n=Gv(e,t),i=e.slice(n,t);if(KMe.has(i))return!0;if(!Vd.has(i))return!1;t=n}return!1}function nEe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const iEe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Sl(e){return e.length===1?e[0]:e.join("")}function sEe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Sl(n)}function oEe(e,t,n,i){if(!iEe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let o=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=nEe(c,i),f=d==="text"&&t;o===null||d!==o||f!==a?(o!==null&&s.push({text:Sl(r),isWordLike:a,kind:o,start:l}),o=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return o!==null&&s.push({text:Sl(r),isWordLike:a,kind:o,start:l}),s}function Y3(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const rEe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function lEe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||rEe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!fEe.has(e)&&!dEe.test(e)&&cEe.test(e)}function YM(e){let t=!1;for(const n of e)if(!pc.test(n)){if(!vO(n))return!1;t=!0}return t}function hEe(e,t,n,i){const s=!t&&YM(e),o=!i&&YM(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=Gv(c,d),h=c.slice(f,d);if(!pc.test(h))return h;d=f}return null})(a);return u!==null&&Qv(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=Gv(a,u),d=a.slice(c,u);if(!pc.test(d))return vO(d)||Qv(d);u=c}return!1})(e);return!!(s||o||l)&&!ha(e)&&!ha(n)&&(t||s||r)&&(i||o)}function JM(e){for(const t of e)if(b7.test(t))return!0;return!1}function k2(e){if(e.length===0)return!1;for(const t of e)if(!b7.test(t)&&!uEe.has(t))return!1;return!0}function pEe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let s=0;s0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const g=(Q3===null&&(Q3=new Intl.Segmenter(void 0,{granularity:"word"})),Q3);let m=0;const y=[],A=[],b=[],C=[],v=[],x=[],I=[],_=[],S=[],E=[],D=[],B=[];for(const R of g.segment(a))for(const q of oEe(R.segment,(d=R.isWordLike)!=null&&d,R.index,c)){let j=function(){x[V]!==null&&(A[V]=[GM(y,x,I,V)],x[V]=null),A[V].push(q.text),b[V]=b[V]||q.isWordLike,_[V]=_[V]||H,S[V]=S[V]||X,E[V]=se,D[V]=te,B[V]=QM(S[V],U)};const W=q.kind==="text",z=XMe(q.text,q.isWordLike,q.kind),H=ha(q.text),X=VM(q.text),U=$p(q.text),se=E8(q.text),te=eEe(q.text),V=m-1;u.carryCJKAfterClosingQuote&&W&&m>0&&C[V]==="text"&&H&&_[V]&&E[V]||W&&m>0&&C[V]==="text"&&ZMe(q.text)&&_[V]||W&&m>0&&C[V]==="text"&&D[V]?j():W&&m>0&&C[V]==="text"&&q.isWordLike&&X&&B[V]?(j(),b[V]=!0):z!==null&&m>0&&C[V]==="text"&&x[V]===z?I[V]=((f=I[V])!=null?f:1)+1:W&&!q.isWordLike&&m>0&&C[V]==="text"&&!_[V]&&(VMe(q.text)||q.text==="-"&&b[V])?j():(y[m]=q.text,A[m]=[q.text],b[m]=q.isWordLike,C[m]=q.kind,v[m]=q.start,x[m]=z,I[m]=z===null?0:1,_[m]=H,S[m]=X,E[m]=se,D[m]=te,B[m]=QM(X,U),m++)}for(let R=0;Rnull);let N=-1;for(let R=m-1;R>=0;R--){const q=y[R];if(q.length!==0){if(C[R]==="text"&&!b[R]&&N>=0&&C[N]==="text"&&(GMe(q)||q==="-"&&YMe(y[N]))){const j=(h=T[N])!=null?h:[];j.push(q),T[N]=j,v[N]=v[R],y[R]="";continue}N=R}}for(let R=0;RH+1){q.push(Sl(te)),j.push(pe),W.push("text"),z.push(R.starts[H]),H=V;continue}}q.push(X),j.push(se),W.push(U),z.push(R.starts[H]),H++}return{len:q.length,texts:q,isWordLike:j,kinds:W,starts:z}})((function(R){const q=[],j=[],W=[],z=[];for(let H=0;H1;for(let te=0;te=R.len||Y3(R.kinds[U]))continue;const se=[],te=R.starts[U];let V=U;for(;V0&&(q.push(Sl(se)),j.push(!0),W.push("text"),z.push(te),H=V-1)}return{len:q.length,texts:q,isWordLike:j,kinds:W,starts:z}})((function(R){const q=R.texts.slice(),j=R.isWordLike.slice(),W=R.kinds.slice(),z=R.starts.slice();for(let X=0;X=0&&!mO(u.texts[C-1],c)&&b(C),m<0&&(m=C),y=y||ha(v))}return b(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:g}})(o,r,t.breakKeepAllAfterPunctuation):r;return xt({normalized:o,chunks:pEe(l,s)},l)}let Lf=null;const XM=new Map;let Nf=null;const mEe=new RegExp("\\p{Emoji_Presentation}","u"),vEe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let J3=null;const eE=new Map;function T8(){if(Lf!==null)return Lf;if(typeof OffscreenCanvas<"u")return Lf=new OffscreenCanvas(1,1).getContext("2d"),Lf;if(typeof document<"u")return Lf=document.createElement("canvas").getContext("2d"),Lf;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function _u(e,t){let n=t.get(e);return n===void 0&&(n={width:T8().measureText(e).width,containsCJK:ha(e)},t.set(e,n)),n}function Yv(){if(Nf!==null)return Nf;if(typeof navigator>"u")return Nf={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Nf;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Nf={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Nf}function yO(){return J3===null&&(J3=new Intl.Segmenter(void 0,{granularity:"grapheme"})),J3}function yEe(e){return mEe.test(e)||e.includes("️")}function nd(e,t,n){return n===0?t.width:t.width-(function(i,s){return s.emojiCount===void 0&&(s.emojiCount=(function(o){let r=0;const l=yO();for(const a of l.segment(o))yEe(a.segment)&&r++;return r})(i)),s.emojiCount})(e,t)*n}function kEe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function tE(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function nE(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function x7(e,t){return t===0?0:e+t}function CEe(e,t,n,i,s){return x7(i,t==="tab"?s+(function(o,r){return o.letterSpacing!==0&&o.spacingGraphemeCounts[r]>0?o.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function iE(e,t,n,i){return x7(i,t==="tab"?0:e.lineEndFitAdvances[n])}function sE(e,t,n,i,s){return x7(i,t==="tab"?s:e.lineEndPaintAdvances[n])}function wEe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function xEe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Em(e,t,n){let i=t;for(;ij){if(le!==null&&G>Q){V(Ae,G,ie),ge=G,oe=Em(le,oe,ge+1),G=-1,ie=0;continue}V(),ue(Ae,ge,me)}else z+=me,X=Ae,U=ge+1;else ue(Ae,ge,me);const Ee=ge+1;le!==null&&le[oe]===Ee&&(G=Ee,ie=z,oe++),ge++}H&&X===Ae&&U===Ce.length&&(X=Ae+1,U=0)}let J=0;for(;J=O.length)));){const Ae=O[J],Q=tE(P[J]);if(H)if(z+Ae>j){if(Q){fe(J,Ae),V(J+1,0,z-Ae),J++;continue}if(se>=0){if(X>se||X===se&&U>0){V();continue}V(se,0,te);continue}if(Ae>j&&R[J]!==null){V(),Me(J,0),J++;continue}V()}else fe(J,Ae),Q&&(se=J+1,te=z-Ae),J++;else Ae>j&&R[J]!==null?Me(J,0):pe(J,Ae),Q&&(se=J+1,te=z-Ae),J++}return H&&V(),W})(n,i);const{widths:s,kinds:o,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(s.length===0||u.length===0)return 0;const c=Yv(),d=i+c.lineFitEpsilon;let f=0,h=0,g=!1,m=0,y=0,A=-1,b=0,C=null;function v(){A=-1,b=0,C=null}function x(T=m,N=y,O){f++,h=0,g=!1,v()}function I(T,N){g=!0,m=T+1,y=0,h=N}function _(T,N,O){g=!0,m=T,y=N+1,h=O}function S(T,N){g?(h+=N,m=T+1,y=0):I(T,N)}function E(T,N,O,P,R,q){if(!N)return;const j=iE(n,T,O,R);sE(n,T,O,R,P),A=O+1,b=h-q+j,C=T}function D(T,N){var O;const P=r[T],R=(O=l[T])!=null?O:null;let q=R===null?-1:Em(R,0,N+1),j=-1,W=N;for(;Wd){if(R!==null&&j>N){x(T,j),W=j,q=Em(R,q,W+1),j=-1;continue}x(),_(T,W,z)}else h=U,m=T,y=W+1}else _(T,W,z);const H=W+1;R!==null&&R[q]===H&&(j=H,q++),W++}g&&m===T&&y===P.length&&(m=T+1,y=0)}function B(T){f++,v()}for(let T=0;T=N.endSegmentIndex)));){const P=o[O],R=tE(P),q=AEe(n,g,O),j=P==="tab"?bEe(h+q,n.tabStopAdvance):s[O],W=q+j,z=CEe(n,P,O,q,j);if(P!=="soft-hyphen")if(g){if(h+z>d){const H=h+iE(n,P,O,q);if(sE(n,P,O,q,j),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){x(A,0);continue}if(R&&H<=d){S(O,W),x(O+1,0),O++;continue}if(A>=0&&b<=d){if(m>A||m===A&&y>0){x();continue}const X=A;x(X,0),O=X;continue}if(z>d&&r[O]!==null){x(),D(O,0),O++;continue}x();continue}S(O,W),E(P,R,O,j,q,W),O++}else z>d&&r[O]!==null?D(O,0):I(O,j),E(P,R,O,j,q,W),O++;else g&&(m=O+1,y=0,A=O+1,b=h+a,C=P),O++}g&&(N.consumedEndSegmentIndex,x(N.consumedEndSegmentIndex,0))}return f})(e,t)}let X3=null;function S7(){return X3===null&&(X3=new Intl.Segmenter(void 0,{granularity:"grapheme"})),X3}function _Ee(e,t){const n=[];let i=[],s=0,o=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:s}),i=[],o=!1,r=!1,l=!1)}function u(d,f,h){i=[d],s=f,o=h,r=E8(d),l=p9.has(d)}function c(d,f){i.push(d),o=o||f;const h=E8(d);r=d.length===1&&Vd.has(d)&&r||h,l=!1}for(const d of S7().segment(e)){const f=d.segment,h=ha(f);i.length!==0?l||A7.has(f)||Vd.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):o||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function IEe(e,t,n){if(t.length<=1)return t;const i=[];let s=-1,o=!1;function r(l){if(!(s<0)){if(o)s+1===l?i.push(t[s]):(function(a,u){const c=t[a].start,d=u=0&&!mO(t[l-1].text,n)&&r(l),s<0&&(s=l),o=o||ha(a.text)}return r(t.length),i}function oE(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=S7();for(const s of i.segment(e))n++;return n}function MEe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function EEe(e,t,n,i,s){const o=Yv(),{cache:r,emojiCorrection:l}=(function(B,T){T8().font=B;const N=(function(R){let q=XM.get(R);return q||(q=new Map,XM.set(R,q)),q})(B),O=(function(R){const q=R.match(/(\d+(?:\.\d+)?)\s*px/);return q?parseFloat(q[1]):16})(B),P=T?(function(R,q){let j=eE.get(R);if(j!==void 0)return j;const W=T8();W.font=R;const z=W.measureText("😀").width;if(j=0,z>q+.5&&typeof document<"u"&&document.body!==null){const H=document.createElement("span");H.style.font=R,H.style.display="inline-block",H.style.visibility="hidden",H.style.position="absolute",H.textContent="😀",document.body.appendChild(H);const X=H.getBoundingClientRect().width;document.body.removeChild(H),z-X>.5&&(j=z-X)}return eE.set(R,j),j})(B,O):0;return{cache:N,fontSize:O,emojiCorrection:P}})(t,(a=e.normalized,vEe.test(a)));var a;const u=nd("-",_u("-",r),l)+(s===0?0:2*s),c=8*nd(" ",_u(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],g=[],m=[];let y=e.chunks.length<=1&&!d;const A=null,b=[],C=[],v=[],x=null,I=Array.from({length:e.len});function _(B,T,N,O,P,R,q,j,W){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(y=!1),f.push(T),h.push(N),g.push(O),m.push(P),b.push(q),C.push(j),d&&v.push(W)}function S(B,T,N,O,P){const R=_u(B,r),q=d?oE(B,T):0,j=(function(X,U,se){return U>1?X+(U-1)*se:X})(nd(B,R,l),q,s),W=T==="space"||T==="preserved-space"||T==="zero-width-break"?0:j,z=W===0?0:W+(q>0?s:0),H=T==="space"||T==="zero-width-break"?0:j;if(P&&O&&B.length>1){let X="sum-graphemes";s!==0?X="segment-prefixes":k2(B)?X="pair-context":o.preferPrefixWidthsForBreakableRuns&&(X="segment-prefixes");const U=(function(te,V,pe,ue,fe){if(V.breakableFitAdvances!==void 0&&V.breakableFitMode===fe)return V.breakableFitAdvances;V.breakableFitMode=fe;const Me=yO(),J=[];for(const Ce of Me.segment(te))J.push(Ce.segment);if(J.length<=1)return V.breakableFitAdvances=null,V.breakableFitAdvances;if(fe==="sum-graphemes"){const Ce=[];for(const le of J){const oe=_u(le,pe);Ce.push(nd(le,oe,ue))}return V.breakableFitAdvances=Ce,V.breakableFitAdvances}if(fe==="pair-context"||J.length>96){const Ce=[];let le=null,oe=0;for(const G of J){const ie=nd(G,_u(G,pe),ue);if(le===null)Ce.push(ie);else{const ge=le+G,me=_u(ge,pe);Ce.push(nd(ge,me,ue)-oe)}le=G,oe=ie}return V.breakableFitAdvances=Ce,V.breakableFitAdvances}const Ae=[];let Q="",re=0;for(const Ce of J){Q+=Ce;const le=nd(Q,_u(Q,pe),ue);Ae.push(le-re),re=le}return V.breakableFitAdvances=Ae,V.breakableFitAdvances})(B,R,r,l,X),se=U===null||i==="keep-all"?null:(function(te){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(te))return null;const V=[];let pe=0;for(const ue of S7().segment(te))pe++,MEe(ue.segment)&&V.push(pe);return V.length===0?null:V})(B);return void _(B,j,z,H,T,N,U,se,q)}_(B,j,z,H,T,N,null,null,q)}for(let B=0;B=55296&&te<=56319&&se+1=56320&&fe<=57343&&(V=fe-56320+(te-55296<<10)+65536,pe=2)}const ue=RMe(V);ue!=="R"&&ue!=="AL"&&ue!=="AN"||(j=!0);for(let fe=0;fe=0&&q[te]==="ET";te--)q[te]="EN";for(te=se+1;te0?q[se-1]:X)!=="L"?"R":"L";if(V===((te{const e=globalThis;if(e[ek])return e[ek];const t={configs:{},controllers:{},revision:ql(0),preparedCache:new Map,blockEstimateCache:new Map};return e[ek]=t,t})();let T1=null;const tk=Gs.revision;function rE(e){var t;return e&&(t=Gs.configs[e])!=null?t:null}function lE(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function LEe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function nk(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const o of e){if(!LEe(o))return null;o.type==="text"?s+=String((t=o.content)!=null?t:""):o.type==="emoji"?s+=String((i=(n=o.name)!=null?n:o.raw)!=null?i:""):o.type==="hardbreak"&&(s+=` +`)}return s.length>0?s:null}function ik(e,t,n){var i,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var o;if(T1!=null)return T1;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return T1=!!((o=r.getContext)!=null&&o.call(r,"2d")),T1}catch{return T1=!1,!1}})())return null;try{const o=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,o,e].join("\0"),l=Gs.blockEstimateCache.get(r);if(l)return Gs.blockEstimateCache.delete(r),Gs.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",u=(function(h,g,m){const y=`${m}\0${g}\0${h}`,A=Gs.preparedCache.get(y);if(A)return Gs.preparedCache.delete(y),Gs.preparedCache.set(y,A),A.prepared;const b=(function(C,v,x){return(function(I,_,S,E){var D,B;const T=(D=E?.wordBreak)!=null?D:"normal",N=(B=E?.letterSpacing)!=null?B:0;return EEe(gEe(I,Yv(),E?.whiteSpace,T),_,!1,T,N)})(C,v,0,x)})(h,g,{whiteSpace:m});for(Gs.preparedCache.set(y,{prepared:b});Gs.preparedCache.size>240;){const C=Gs.preparedCache.keys().next().value;if(!C)break;Gs.preparedCache.delete(C)}return b})(e,n.font,a),c=(function(h,g,m){const y=SEe(h,g);return{lineCount:y,height:y*m}})(u,Math.max(24,o-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Gs.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Gs.blockEstimateCache.size>4e3;){const h=Gs.blockEstimateCache.keys().next().value;if(!h)break;Gs.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function kO(e,t,n){var i,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const o=nk(e.children);return o&&n.paragraph?ik(o,t,n.paragraph):null}if(e.type==="heading"){const o=Number(e.level||0),r=nk(e.children),l=n.headings[o];return r&&l?ik(r,t,l):null}if(e.type==="list_item"){const o=Array.isArray(e.children)?e.children:[];if(o.length!==1||((i=o[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=nk((s=o[0])==null?void 0:s.children);return r?ik(r,t,n.listItem):null}if(e.type==="list"){const o=Array.isArray(e.items)?e.items:[];if(!o.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of o){const a=kO(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function L1(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function id(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function sk(e,t,n=0){return e.diff?k7(t??{},n)?(function(i){const s=id(i.raw);if(s){const o=s.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,o.filter(r=>!TEe.some(l=>r.startsWith(l))).length):Math.max(1,o.length)}return L1(id(i.originalCode))+L1(id(i.updatedCode))})(e):(function(i){const s=i.originalCode,o=i.updatedCode;if(s!=null||o!=null)return Math.max(L1(id(s)),L1(id(o)));const r=id(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):L1(id(e.code,e.loading===!0))}function NEe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function ok(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),s=e.offsetHeight,o=lE(i.lineHeight,1.5*lE(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:NEe(i),lineHeight:o,wrapperOverhead:Math.max(0,s-o),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const FEe=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function aE(e,t={}){var n;const i={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const o=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(o))FEe.has(r)||s.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function uE(e,t,n,i){var s;const o=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,o);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,o-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),g=Math.abs(h-r);gd&&(e.scrollTop=u)}function cE(e,t){let n=0,i=null,s=null;const o=()=>{const r=s;s=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);s=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,s=null,e(...r)):i||(i=setTimeout(o,a))}}function dE(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const bO=Symbol("MarkstreamMathBlockMinHeightCache");function bat(){return un(bO,null)}const DEe=new Set(["text","inline_code","emoji","footnote_reference"]),$Ee=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function N1(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function sd(e,t,n,i=22){const s=String(e??"");if(!s)return n;const o=Math.max(18,Math.floor(Math.max(320,t)/8)),r=s.split(/\r?\n/).length,l=Math.ceil(s.length/o),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function AO(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(DEe.has(i))return!0;if(!$Ee.has(i))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(AO)}function L8(e){var t,n,i,s,o,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(o=(s=u.code)!=null?s:u.content)!=null?o:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const g=h.map(L8).filter(Boolean).join(" ");g&&d.push(g)}}return d.join(" ").replace(/\s+/g," ").trim()}function CO(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(CO)})}function BEe(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),o=Math.max(1,i,s);return 30+26*Math.max(0,o-1)}function zEe(e,t){var n,i,s,o,r,l,a,u,c,d,f,h,g,m;if(!e||typeof e!="object")return 32;const y=e,A=String((n=y.type)!=null?n:""),b=Number.isFinite(t)&&t>0?t:640;switch(A){case"heading":return(function(C){var v;const x=Number((v=C.level)!=null?v:C.depth);return x>=4?20:x===3?30:x===2?32:44})(y);case"paragraph":return(function(C,v){const x=String(C??"");if(!x)return 28;const I=Math.max(18,Math.floor(Math.max(320,v)/8)),_=x.split(/\r?\n/).length,S=Math.ceil(x.length/I);return Math.max(1,_,S)<=1?28:sd(x,v,34)})(String((s=(i=y.raw)!=null?i:y.content)!=null?s:""),b);case"list":return(function(C,v){var x;const I=Array.isArray(C.items)?C.items:[];if(!I.length)return 48;const _=Math.max(48,30*I.length+12);let S=12;for(const B of I)S+=BEe(L8(B)||String((x=B.raw)!=null?x:""),v);const E=Math.max(0,S-_);if(I.length>20){const B=Math.round(2.4*I.length);return Math.round(_+Math.max(B,Math.min(E,3*I.length)))}if(E<=0)return _;const D=I.length>8?8*I.length:E;return Math.round(_+Math.min(E,D))})(y,b);case"list_item":return sd(String((r=(o=y.raw)!=null?o:y.content)!=null?r:""),b,34);case"blockquote":return sd(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),b,56);case"table":return(function(C,v){const x=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!x.length){const I=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*I+48)}return Math.max(120,Math.round(4+x.reduce((I,_)=>I+(function(S,E){const D=Math.max(1,S.length),B=Math.max(80,(E-32)/D),T=Math.max(10,Math.floor(B/8)),N=Math.max(1,...S.map(O=>{var P;const R=L8(O)||String((P=O?.raw)!=null?P:"");return Math.ceil(R.length/T)||1}));return 54+34*Math.max(0,N-1)+(D<=3&&S.some(CO)?14:0)})((function(S){var E;return Array.isArray(S?.cells)&&(E=S.cells)!=null?E:[]})(_),v),0)))})(y,b);case"code_block":{const C=String((u=y.language)!=null?u:"").trim().toLowerCase(),v=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return C==="mermaid"?Wv(jv(v)):C==="infographic"?qv(Hv(v)):sd(v,b,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,v){var x,I,_;const S=C.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((x=S[1])!=null?x:"")?sd(((_=(I=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:I[1])==null?void 0:_.replace(/<[^>]*>/g,"").trim())||"Details",v,28,28):sd(C,v,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),b);case"thematic_break":return 24;default:return sd(String((m=(g=y.raw)!=null?g:y.content)!=null?m:""),b,40)}}function fE(e,t,n){return Math.min(Math.max(e,t),n)}const REe=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],OEe=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],PEe=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),wO=["raw","content","code","originalCode","updatedCode"],hE=new WeakMap,pE=new WeakMap;let jEe=1;function xl(){return typeof performance<"u"?performance.now():Date.now()}function gE(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Rr(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=hE.get(t);return n||(n=jEe++,hE.set(t,n)),String(n)}function mE(e,t,n,i={}){var s,o;const r=i.includeFinal!==!1,l={md:Rr(t),customMarkdownIt:Rr(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(o=e.streamParse)!=null?o:"auto",validateLink:Rr(e.validateLink),preTransformTokens:Rr(e.preTransformTokens),postTransformTokens:Rr(e.postTransformTokens),postTransformNodes:Rr(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function vE(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function yE(e){const t=xO(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function xO(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function SO(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function _7(e){const t=String(e??"");return`${t.length}:${SO(t)}`}function N8(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?_7(r):`${r.length}:${SO(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Rr(e)}`;if(typeof e!="object")return typeof e;const i=e,s=t.get(i);if(s)return`cycle:${s}`;if(n>=6)return`object:${Rr(i)}`;const o=Rr(i);if(t.set(i,o),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>N8(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${N8(r[u],t,n+1)}`).join(";")}`}return typeof e}function Jv(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function _O(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>Jv(i)?gc(i,t,n+1):_O(i,t,n+1)).join(",")}`:Jv(e)?gc(e,t,n):N8(e,t,n)}function HEe(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!wO.includes(i)).map(i=>{const s=e[i];return typeof s=="string"?`${i}=s:${_7(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${i}=${String(s)}`:typeof s=="function"?`${i}=fn:${Rr(s)}`:PEe.has(i)&&(Array.isArray(s)||typeof s=="object")?`${i}=${_O(s,t,n+1)}`:s&&typeof s=="object"?`${i}=object:${Rr(s)}`:""}).filter(Boolean).join(";")}function WEe(e){return wO.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${_7(n)}`:""}).filter(Boolean).join(";")}function gc(e,t=new WeakMap,n=0){const i=pE.get(e);if(i)return i;const s=e,o=t.get(s);if(o)return`node-cycle:${o}`;if(n>=6)return`node:${e.type}:${Rr(s)}`;const r=Rr(s);t.set(s,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(g=>gc(g,u,c+1)).join("|"):"";return[a.type,WEe(d),HEe(d,u,c),f.length,h].join(":")})(e,t,n);return pE.set(s,l),l}function IO(e,t){return gc(e)===gc(t)}function I7(e,t,n){const i=xl(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=xl()-i,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function kE(e,t,n){return I7(t,n,()=>gc(e))}function MO(e,t,n){return kE(e,n,"stabilizeSignatureMs")===kE(t,n,"stabilizeSignatureMs")}function Tm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function bE(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function AE(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function qEe(e,t){return e.length===t.length&&e===t}function M7(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,s=t,o=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(s).filter(c=>c!=="type"&&c!=="children").sort();if(o.length!==r.length)return!1;for(let c=0;c{i=M7(e,t)}),i??MO(e,t,n)}function VEe(e,t){const n={};for(const i of REe){const s=e[i],o=t?.[i];typeof s=="number"&&(n[i]=s-(typeof o=="number"?o:0))}return n}function ZEe(e,t){var n;const i=yM(t.instanceMsgId),s=new Map,o=(n=t.smoothStreamingEnabled)!=null?n:L(()=>!1),r=Z(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let O="",P=0,R=!1,q=!1,j=!1,W=!1;function z(){O="",P=0,R=!1,q=!1,j=!1,W=!1}function H(X){let U=!1;for(let se=0;se{if(!X||!U.startsWith(X)||U.length<=X.length)return z(),[!0,0];let se=0;O!==X&&(z(),H(X),se=X.length);const te=U.slice(X.length),V=H(te);return O=U,[V,se+te.length]}})();let h,g=0,m=0,y=xl(),A=-1,b=0;function C(O){A=Number.isInteger(O)?O:0,b+=1}function v(){h&&(clearTimeout(h),h=void 0)}function x(){v();const O=t.renderContent.value;r.value!==O&&(r.value=O),y=xl()}Ve([t.renderContent,t.effectiveFinal,o],([O,P,R])=>{r.value!==O&&(!R||P||(function(q,j){if(!q&&j||j.length<=80||j.length\s*|`{3,}|~{3,})/.test(W))||W.endsWith(` +`)&&!(function(z){const H=vE(z);if(yE(H))return!1;const X=xO(H);return X.length>=2&&X.some(U=>U.trim())})(j))})(r.value,O)?x():(function(){if(m+=1,h)return;const q=Math.max(0,(function(j){const W=j.parseCoalesceMs;return typeof W=="number"&&Number.isFinite(W)&&W>=0?W:80})(e)-(xl()-y));q<=0?x():h=setTimeout(x,q)})())},{flush:"sync",immediate:!0}),Jd(v);const I=L(()=>{var O,P,R,q;return V7e(e.customHtmlTags,(O=e.parseOptions)==null?void 0:O.customHtmlTags,(q=(R=(P=t.customComponentsMap)==null?void 0:P.value)!=null?R:{},Object.entries(q).map(([j,W])=>{const z=ml(j);return W==null||!z||X0(z)||Fz.has(z)||Z0.has(z)?"":z}).filter(Boolean)))}),_=L(()=>{const{key:O,tags:P}=Z7e(I.value);if(!O)return i;const R=s.get(O);if(R)return R;const q=yM(t.instanceMsgId,{customHtmlTags:P});return s.set(O,q),q}),S=L(()=>{const O=_.value;if(!e.customMarkdownIt)return O;const P=e.customMarkdownIt(O);return O.__markstreamHasCustomParserExtensions=!0,P.__markstreamHasCustomParserExtensions=!0,P}),E=L(()=>{var O,P;const R=(O=e.parseOptions)!=null?O:{},q=t.effectiveFinal.value,j=I.value,W=q!=null,z=j.length>0;return W||z||R.streamParse==null?xt(xt(vn(xt({},R),{streamParse:(P=R.streamParse)==null||P}),W?{final:q}:{}),z?{customHtmlTags:j}:{}):R}),D=L(()=>{var O;return new Set(((O=E.value.customHtmlTags)!=null?O:[]).map(P=>String(P).trim().toLowerCase()).filter(Boolean))}),B=L(()=>mE(E.value,S.value,e.customMarkdownIt,{includeFinal:!0})),T=L(()=>mE(E.value,S.value,e.customMarkdownIt,{includeFinal:!1}));Ve([B,T],([O,P],[R,q])=>{R&&(O===R&&P===q||(x(),P!==q&&(l=[],c="")))},{flush:"sync"});const N=L(()=>{var O,P,R,q,j,W,z,H,X,U,se;if((O=e.nodes)!=null&&O.length)return l=[],c="",C(0),St(e.nodes.slice());const te=r.value;if(!te)return l=[],c="",C(-1),[];const V=t.debugPerformanceEnabled.value,pe=V?xl():0,ue=S.value,fe=B.value,Me=T.value;a&&fe!==a&&(function(De){var Be,Ze;(Ze=(Be=De.stream)==null?void 0:Be.reset)==null||Ze.call(Be)})(ue),u&&Me!==u&&(l=[],c="");const J=Object.keys((R=(P=t.customComponentsMap)==null?void 0:P.value)!=null?R:{}).length>0||typeof E.value.postTransformNodes=="function";J!==d&&(l=[],c="");const Ae=!J&&l.length>0&&te.startsWith(c)&&Me===u,Q=V?gE(ue):null,re=V?{}:void 0,Ce=AE(ue),le=!Ce&&!J,oe=xt(xt(vn(xt({},E.value),{__reuseStableTopLevelNodes:le}),Ce?{__disableStreamParse:!0}:{}),re?{__timing:re}:{}),G=zR(te,ue,oe),ie=V?xl():0,ge=V?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let me,Ee=V?Tm(G.length):void 0,Qe=0,we=0,Ne=0;if(Ae){const De=V?xl():0,[Be,Ze]=(function(zt){var ct,At;const[Qt,wn]=zt.scanGlobalReferenceAppend(zt.previousContent,zt.content),fn=zt.parseOptions;return[zt.previousDirtyStartIndex>0&&fn.final!==!0&&!zt.customMarkdownIt&&!AE(zt.md)&&!Qt&&typeof fn.preTransformTokens!="function"&&typeof fn.postTransformTokens!="function"&&typeof fn.postTransformNodes!="function"&&((At=(ct=fn.customHtmlTags)==null?void 0:ct.length)!=null?At:0)===0?zt.previousDirtyStartIndex:0,wn]})({content:te,previousContent:c,previousDirtyStartIndex:A,parseOptions:E.value,customMarkdownIt:e.customMarkdownIt,md:ue,scanGlobalReferenceAppend:f});Ne=Ze;const vt=Be<=0;if(ge){const zt=(function(ct,At,Qt,wn={}){var fn;if(!At.length)return{nodes:ct,metrics:Tm(ct.length)};const Vt=(fn=wn.scanStartIndex)!=null?fn:0,Cn=wn.reuseDirtyTail!==!1,bn=(function(an,Bn,Ge,ot=0){const Et=Math.min(an.length,Bn.length);for(let Je=Math.min(Et,Math.max(0,ot));Jegc(De[vt]))})(me,ge,we):(function(De,Be=0){for(let Ze=Math.max(0,Be);Ze((j=Q?.total)!=null?j:0);t.logPerf(Be?"parse(stream)":"parse(sync)",xt(xt(xt({rendererId:t.instanceMsgId,ms:Math.round(xl()-pe),nodes:me.length,contentLength:te.length,parseCommitCount:g,parseCoalescedCount:m,nodeReuseMs:it,referenceDefinitionScanChars:Ne,signatureMs:(W=ge?.signatureMs)!=null?W:0,stabilizeSignatureMs:(z=ge?.stabilizeSignatureMs)!=null?z:0,primeSignatureMs:(H=ge?.primeSignatureMs)!=null?H:0,signatureCallCount:(X=ge?.signatureCallCount)!=null?X:0,stabilizeSignatureCallCount:(U=ge?.stabilizeSignatureCallCount)!=null?U:0,primeSignatureCallCount:(se=ge?.primeSignatureCallCount)!=null?se:0,stabilizeMs:Qe},Ee??{}),re?Object.fromEntries(OEe.map(Ze=>{var vt;return[Ze,(vt=re[Ze])!=null?vt:0]})):{}),De?{streamMode:De.lastMode,streamDelta:VEe(De,Q),streamStats:De}:{}))}return St(me)});return{effectiveCustomHtmlTags:I,effectiveCustomHtmlTagsSet:D,mdBase:_,mdInstance:S,mergedParseOptions:E,getParsedNodesDirtyStartIndex:()=>A,getParsedNodesRevision:()=>b,parsedNodes:N}}function GEe(e){const{isClient:t}=e,n=Z(new Set),i=new Map,s=new Map,o=new Map;function r(u){if(!t)return;const c=o.get(u);c!=null&&(window.clearTimeout(c),o.delete(u))}function l(){if(t)for(const u of o.values())window.clearTimeout(u);o.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:o,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((m=(g=e.shouldTrackVisibleNodeIndices)==null?void 0:g.call(e))!=null&&!m)return;var g,m;const y=n.value,A=y.has(f);if(h){if(A)return;const C=new Set(y);return C.add(f),void(n.value=C)}if(!A)return;const b=new Set(y);b.delete(f),n.value=b})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f{const c=s.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=s.subscribe(o);o();const l=L(()=>Math.max(0,t.value.length-n.value.length)),a=L(()=>l.value===0),u=L(()=>i.value&&a.value);return M0()&&Jd(()=>{r(),s.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>s.enqueue(c),finish:c=>s.finish(c),flush:()=>s.flush(),reset:c=>s.reset(c),pause:()=>s.pause(),resume:()=>s.resume()}}const YEe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},CE=/auto|scroll|overlay/i;function JEe(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return CE.test(t)||CE.test(n)}function XEe(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const eTe={class:"m-0 p-0"},tTe=["data-probe"],nTe=gi(et(vn(xt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var s,o;return(o=(s=t.headingNodes)==null?void 0:s[i])!=null?o:null}return(i,s)=>(k(),M("div",{class:"height-estimation-probes",style:qt({width:`${e.width}px`}),"aria-hidden":"true"},[w("div",{ref:o=>e.setParagraphWrapper(o),class:Fe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[K(p(Nd),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),w("div",{ref:o=>e.setListItemWrapper(o),class:Fe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[w("ul",eTe,[K(p(bh),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),w("div",{ref:o=>e.setListWrapper(o),class:Fe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[K(p(Ah),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),M(Te,null,dt(6,o=>w("div",{key:`probe-heading-${o}`,ref_for:!0,ref:r=>e.setHeadingWrapper(o,r),class:Fe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${o}`},[K(p(h9),{node:n(o),"index-key":`probe-heading-${o}`},null,8,["node","index-key"])],10,tTe)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),wE=et({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=L(()=>{var n,i;return qv((i=Xf(e.estimatedPreviewHeightPx))!=null?i:Hv(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return pn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?pn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[pn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[pn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),pn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),pn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>pn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,pn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[pn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),pn("div",{class:"absolute inset-0"},[pn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),xE=et({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=L(()=>{var n,i;return Wv((i=Xf(e.estimatedPreviewHeightPx))!=null?i:jv(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return pn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?pn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[pn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[pn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),pn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>pn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[pn("span",{class:"action-icon block"})])))]):null,pn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[pn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),pn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),iTe={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function ro(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const sTe=["data-custom-id"],oTe=["data-node-index","data-node-type"],SE="typewriter-simple-cursor-target",EO=gi(et(vn(xt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,s=n;function o($){if(!(typeof Event<"u"&&$ instanceof Event))return typeof $=="string"&&s("copy-code",$),void s("copy",$)}const r=Hs(),l=un("markstreamNestedRendererProps",void 0);function a($){const Y=r?.vnode.props;return!!Y&&(Object.prototype.hasOwnProperty.call(Y,$)||Object.prototype.hasOwnProperty.call(Y,String($).replace(/[A-Z]/g,ae=>`-${ae.toLowerCase()}`)))}function u($){var Y,ae;const ce=i[$];return a($)?ce:(ae=(Y=l?.value)==null?void 0:Y[$])!=null?ae:ce}const c=L(()=>{return($=u("mode"))==="chat"||$==="minimal"||$==="docs"?$:"docs";var $}),d=L(()=>dE(u("typewriter"))),f=L(()=>d.value!=="off"),h=L(()=>u("domMode")==="minimal"?"minimal":"full"),g=L(()=>{return($={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":$.codeRenderer==="pre"||$.codeRenderer==="shiki"||$.codeRenderer==="monaco"?$.codeRenderer:$.renderCodeBlocksAsPre===!1||$.mode==="docs"?"monaco":"pre";var $}),m=L(()=>iTe[c.value]),y=L(()=>{var $;return($=u("showTooltips"))!=null?$:m.value.showTooltips}),A=L(()=>{var $;return($=u("fade"))!=null?$:m.value.fade}),b=L(()=>{var $;return($=u("batchRendering"))!=null?$:m.value.batchRendering}),C=L(()=>{var $;return($=u("initialRenderBatchSize"))!=null?$:m.value.initialRenderBatchSize}),v=L(()=>{var $;return($=u("renderBatchSize"))!=null?$:m.value.renderBatchSize}),x=L(()=>{var $;return($=u("renderBatchDelay"))!=null?$:m.value.renderBatchDelay}),I=L(()=>{var $;return($=u("renderBatchBudgetMs"))!=null?$:m.value.renderBatchBudgetMs}),_=L(()=>{var $;return($=u("renderBatchIdleTimeoutMs"))!=null?$:m.value.renderBatchIdleTimeoutMs}),S=L(()=>{var $;return($=u("deferNodesUntilVisible"))!=null?$:m.value.deferNodesUntilVisible}),E=L(()=>{var $;return($=u("maxLiveNodes"))!=null?$:m.value.maxLiveNodes}),D=L(()=>{var $;return($=u("liveNodeBuffer"))!=null?$:m.value.liveNodeBuffer}),B=L(()=>{var $;return($=u("nodeVirtual"))!=null?$:m.value.nodeVirtual}),T={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return y.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return A.value},get batchRendering(){return b.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return v.value},get renderBatchDelay(){return x.value},get renderBatchBudgetMs(){return I.value},get renderBatchIdleTimeoutMs(){return _.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return E.value},get liveNodeBuffer(){return D.value},get nodeVirtual(){return B.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function N($){s("height-change",$)}function O($){s("virtual-state-change",$)}function P($){s("anchor-change",$)}const R=Z(),q=Z(null),j=Z(null),W=Z(null),z=Ss({1:null,2:null,3:null,4:null,5:null,6:null}),H=Z(!1),X=new Map,U=Z(0),se=Z(0),te=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function V($,Y){return typeof $!="string"?Y:$.trim()||Y}function pe($){const Y=Number($);return Number.isFinite(Y)&&Y>0?Math.max(1,Math.trunc(Y)):640}const ue=L(()=>{var $;const Y=($=T.viewportPriorityOptions)!=null?$:{},ae=V(Y.rootMargin,Ud);return{rootMargin:ae,heavyBlockMargin:V(Y.heavyBlockMargin,ae),maxTargets:pe(Y.maxTargets)}}),fe=L(()=>{var $;return($=ue.value.rootMargin)!=null?$:Ud}),Me=L(()=>{var $;return($=ue.value.maxTargets)!=null?$:640});function J(){var $,Y;if((($=i.virtualScroll)==null?void 0:$.enabled)!==!0)return null;const ae=(Y=i.virtualScroll)==null?void 0:Y.scrollRoot;return Ae(typeof ae=="function"?ae():ae)}function Ae($){return $?typeof HTMLElement<"u"&&$ instanceof HTMLElement?$:typeof $=="object"&&"value"in $?Ae($.value):typeof $=="object"&&"$el"in $?Ae($.$el):null:null}Gn(fO,ue);const{isClient:Q,renderAsFragment:re,debugPerformanceEnabled:Ce,resolvedShowTooltips:le,resolvedHtmlPolicy:oe,inheritedSmoothStreaming:G,ownsTypewriterCursor:ie}=(function($){const Y=typeof window<"u",ae=zh(),ce=un("markstreamHtmlPolicy",void 0),be=un("markstreamTypewriterCursor",void 0),Le=un("markstreamSmoothStreaming",void 0),Pe=L(()=>$.renderAsFragment===!0),qe=L(()=>!!($.debugPerformance&&Y&&typeof console<"u")),lt=L(()=>{var rt;if(typeof $.showTooltips=="boolean")return $.showTooltips;const je=(rt=ae.showTooltips)!=null?rt:ae["show-tooltips"];return je===""||je===!0||je==="true"||je!==!1&&je!=="false"&&void 0}),Ue=L(()=>{var rt,je;return(je=(rt=$.htmlPolicy)!=null?rt:ce?.value)!=null?je:"safe"}),tt=L(()=>be?.value!==!0);return{isClient:Y,renderAsFragment:Pe,debugPerformanceEnabled:qe,resolvedShowTooltips:lt,resolvedHtmlPolicy:Ue,inheritedSmoothStreaming:Le,inheritedTypewriterCursor:be,ownsTypewriterCursor:tt}})(T),{resolveViewportRoot:ge,resolveScrollContainer:me,isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:Qe,getOffsetTopWithinRoot:we}=(function($,Y){function ae(){var qe,lt;return(lt=(qe=Y.scrollRoot)==null?void 0:qe.call(Y))!=null?lt:null}function ce(qe){if(typeof window>"u")return null;const lt=ae();if(lt)return lt;const Ue=qe??$.value;if(!Ue)return null;const tt=Ue.ownerDocument||document,rt=tt.scrollingElement||tt.documentElement;let je=Ue;for(;je&&je!==tt.body&&je!==rt;){if(JEe(window.getComputedStyle(je))&&XEe(je))return je;je=je.parentElement}return null}function be(qe){if(!Y.isClient)return!1;try{const lt=window.getComputedStyle(qe);return!!(lt.display||"").toLowerCase().includes("flex")&&(lt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Le(qe,lt,Ue){var tt,rt;if(Ue)return Pe(lt);const je=qe.scrollTop;if(!be(qe))return je;const nt=je<0?-je:je;return Math.max(0,((tt=qe.scrollHeight)!=null?tt:0)-((rt=qe.clientHeight)!=null?rt:0))-nt}function Pe(qe){var lt,Ue,tt,rt,je;const nt=Number((lt=qe.scrollingElement)==null?void 0:lt.scrollTop),ut=Number((tt=(Ue=qe.documentElement)==null?void 0:Ue.scrollTop)!=null?tt:0),at=Number((je=(rt=qe.body)==null?void 0:rt.scrollTop)!=null?je:0);return Math.max(0,Number.isFinite(nt)?nt:0,Number.isFinite(ut)?ut:0,Number.isFinite(at)?at:0)}return{resolveViewportRoot:ce,resolveScrollContainer:function(qe){var lt,Ue,tt,rt;const je=ae();if(je)return je;const nt=ce((lt=qe??$.value)!=null?lt:null);if(nt)return nt;const ut=(rt=(tt=qe?.ownerDocument)!=null?tt:(Ue=$.value)==null?void 0:Ue.ownerDocument)!=null?rt:typeof document<"u"?document:null;return ut?.scrollingElement||ut?.documentElement||null},isReverseFlexScrollRoot:be,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:function(qe,lt){const Ue=lt.ownerDocument||qe.ownerDocument||document;if((function(nt,ut){return nt===ut.documentElement||nt===ut.body||nt===ut.scrollingElement})(lt,Ue))return qe.getBoundingClientRect().top+Pe(Ue);const tt=lt.getBoundingClientRect(),rt=qe.getBoundingClientRect(),je=Le(lt,Ue,!1);return rt.top-tt.top+je}}})(R,{isClient:Q,scrollRoot:J});Gn("markstreamShowTooltips",le),Gn("markstreamHtmlPolicy",oe),Gn("markstreamTypewriter",f),Gn("markstreamFade",L(()=>T.fade!==!1)),Gn("markstreamTypewriterCursor",L(()=>!0)),Gn("markstreamTextStreamState",X),Gn("markstreamStreamVersion",U),Gn("markstreamParseOptions",L(()=>T.parseOptions)),Gn("markstreamCustomMarkdownIt",L(()=>T.customMarkdownIt));const{smoothStreamingEnabled:Ne,renderContent:it,requestedFinal:De,effectiveFinal:Be}=(function($,Y){const ae=QEe(xt(xt({},YEe),$.smoothStreamingOptions)),ce=L(()=>{var je,nt,ut;return $.smoothStreaming!==!1&&!((je=$.nodes)!=null&&je.length)&&($.smoothStreaming===!0||!((nt=Y.inheritedSmoothStreaming)!=null&&nt.value))&&($.smoothStreaming===!0||dE($.typewriter)!=="off"||((ut=$.maxLiveNodes)!=null?ut:0)<=0)}),be=Z(!Y.isClient||$.smoothStreaming===!0);mn(()=>{be.value=!0});const Le=L(()=>be.value&&ce.value),Pe=L(()=>{var je;return Le.value?ae.visible.value:(je=$.content)!=null?je:""}),qe=L(()=>{var je,nt;const ut=(je=$.parseOptions)!=null?je:{};return(nt=$.final)!=null?nt:ut.final}),lt=L(()=>{const je=qe.value;return Le.value&&je!=null?!!je&&ae.caughtUp.value:je});let Ue=0,tt=!1;function rt(){Ue=0,tt=!1}return Ve([()=>$.content,()=>$.nodes,Le,qe],([je,nt,ut,at])=>{if(nt?.length)return rt(),void ae.reset("");const Lt=je??"";if(!ut)return rt(),ae.reset(Lt),void(at&&ae.finish({flush:!0}));const Ct=ae.source.value;if(Lt){if(Lt!==Ct)if(Lt.startsWith(Ct)){const Ot=Lt.slice(Ct.length),Ut=ae.pendingChars.value;Ot.length<=8?(Ue++,tt||Ue>=2&&Ut<=8?(tt=!0,ae.reset(Lt)):ae.enqueue(Ot)):(rt(),ae.enqueue(Ot))}else rt(),ae.reset(Lt)}else rt(),ae.reset("");at&&ae.finish()},{immediate:!0}),{smoothStream:ae,smoothStreamingEligible:ce,smoothStreamingEnabled:Le,renderContent:Pe,requestedFinal:qe,effectiveFinal:lt}})(T,{isClient:Q,inheritedSmoothStreaming:G}),Ze=De.value===!0;Gn("markstreamSmoothStreaming",Ne);const vt=Z(!1),zt=Z(!1),ct=Z(!1);let At="",Qt=!1,wn=null;function fn(){Q&&wn!=null&&(window.clearTimeout(wn),wn=null)}function Vt(){vt.value=!1,fn()}function Cn($,Y){if(!Ce.value)return;const ae=(function(){if(!Ce.value)return null;const ce=Bn(bn),be=Bn(xn),Le=Math.max(an,be);if(ce<=0&&Le<=0)return null;const Pe={total:ce,maxPerFrame:Le,byLabel:(qe=bn,Object.fromEntries(Array.from(qe.entries()).sort((lt,Ue)=>Ue[1]-lt[1]||lt[0].localeCompare(Ue[0]))))};var qe;return bn.clear(),xn.clear(),an=0,Pe})();console.info(`[markstream-vue][perf] ${$}`,ae?vn(xt({},Y),{layoutReads:ae}):Y)}Ve([()=>T.indexKey,()=>T.customId],()=>{var $,Y;Vt(),zt.value=!1,ct.value=!(($=i.nodes)!=null&&$.length)&&De.value!==!0&&!!i.content,At=(Y=it.value)!=null?Y:"",Qt=At.length>0},{flush:"sync"}),Ve([()=>i.content,()=>i.nodes,De],([$,Y,ae])=>{!Y?.length&&ae!==!0&&$&&(ct.value=!0)},{flush:"sync",immediate:!0}),Ve([it,()=>i.nodes,De],([$,Y,ae])=>{const ce=$??"";return Y?.length||ae===!0?(Vt(),zt.value=!1,At=ce,void(Qt=!0)):(ce.length>0&&(ct.value=!0),Qt?(At&&ce.length>At.length&&ce.startsWith(At)?(vt.value=!0,zt.value=!0,Q&&(fn(),wn=window.setTimeout(()=>{var be;wn=null,Be.value===!0||(be=i.nodes)!=null&&be.length||(mf(),vt.value=!1,Ta())},1200))):(ce.length"u")return null;const Le=window;if(Le.__markstreamLayoutReadPerformance)return Le.__markstreamLayoutReadPerformance;const Pe={total:0,maxPerFrame:0,byLabel:{}};return Le.__markstreamLayoutReadPerformance=Pe,Pe})();be&&(be.total=Number(be.total||0)+1,be.byLabel[ce]=Number(be.byLabel[ce]||0)+1,be.currentFrameTotal=Number(be.currentFrameTotal||0)+1,be.frameScheduled||(be.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>ot(be),0):queueMicrotask(()=>ot(be)):window.requestAnimationFrame(()=>ot(be))))})($),Nn||(Nn=!0,Q&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ge):typeof queueMicrotask!="function"?setTimeout(Ge,0):queueMicrotask(Ge)))}function Je($,Y){return Et($),Y()}const Yt=T.customId?`renderer-${T.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Tt=(function($){const Y=new Map;return{scope:$,cache:Y,clear:()=>Y.clear()}})(Yt),Dn=Yt;Gn(bO,Tt);const Xn=Ws(()=>T.customId),{effectiveCustomHtmlTagsSet:mi,mergedParseOptions:fs,parsedNodes:Ft,getParsedNodesDirtyStartIndex:Wi,getParsedNodesRevision:Xi}=ZEe(T,{instanceMsgId:Yt,renderContent:it,effectiveFinal:Be,smoothStreamingEnabled:Ne,debugPerformanceEnabled:Ce,customComponentsMap:Xn,logPerf:Cn});Ve(Ft,()=>{vt.value||Tt.clear(),U.value+=1},{immediate:!0});const Wn=L(()=>({customId:T.customId,customHtmlTags:fs.value.customHtmlTags,parseOptions:T.parseOptions,customMarkdownIt:T.customMarkdownIt,htmlPolicy:oe.value,viewportPriority:T.viewportPriority,viewportPriorityOptions:ue.value,mode:c.value,domMode:T.domMode,codeRenderer:g.value,codeBlockStream:T.codeBlockStream,codeBlockDarkTheme:T.codeBlockDarkTheme,codeBlockLightTheme:T.codeBlockLightTheme,codeBlockMonacoOptions:T.codeBlockMonacoOptions,renderCodeBlocksAsPre:T.renderCodeBlocksAsPre,codeBlockMinWidth:T.codeBlockMinWidth,codeBlockMaxWidth:T.codeBlockMaxWidth,codeBlockProps:T.codeBlockProps,mermaidProps:T.mermaidProps,d2Props:T.d2Props,infographicProps:T.infographicProps,showTooltips:le.value,themes:T.themes,langs:T.langs,isDark:T.isDark,typewriter:f.value,smoothStreamingOptions:T.smoothStreamingOptions,parseCoalesceMs:T.parseCoalesceMs,fade:T.fade}));Gn("markstreamNestedRendererProps",Wn);const Lo=L(()=>Ft.value),qs=L(()=>Ft.value.length),es=Z(null),ts=Z(null),hs=Z(null),No=Z(null),Fo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Ei=!Fo&&T.customId?rE(T.customId):null,si=L(()=>Ei?(tk.value,rE(T.customId)):null),Us=L(()=>{var $;return!!(!re.value&&T.customId&&!Fo&&(($=si.value)!=null&&$.enabled))}),Ko=L(()=>!!(Q&&Us.value)),Pn=L(()=>{var $;return!!(!re.value&&(($=i.virtualScroll)!=null&&$.enabled))}),on=L(()=>Pn.value),Ti=Z(!1);mn(()=>{Ti.value=!0});const Sn=L(()=>!!(Q&&Pn.value));Gn("markstreamHostScrollManaged",Sn);const As=L(()=>!!(Ti.value&&Sn.value)),Ri=L(()=>Ko.value||Sn.value),Li=L(()=>Ko.value||As.value),Is=L(()=>{var $;return Ri.value&&(($=si.value)==null?void 0:$.textEstimation)!==!1});function Oi(){const $=se.value||Je("getMeasuredContainerWidth.clientWidth",()=>{var Y;return((Y=R.value)==null?void 0:Y.clientWidth)||0});return Number.isFinite($)&&$>0?$:0}const po=L(()=>{const $=Oi();return $>0?Math.max(1,Math.round($)):640}),ns=L(()=>{var $,Y;return!(Be.value!==!0||Pn.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||($=i.nodes)!=null&&$.length||ct.value||!(((Y=T.maxLiveNodes)!=null?Y:0)<=0))}),Do=L(()=>{var $;return ns.value?50:Math.max(1,($=T.maxLiveNodes)!=null?$:320)}),di=L(()=>{var $;return ns.value?16:Math.max(0,($=T.liveNodeBuffer)!=null?$:60)}),kn=L(()=>{var $;return!re.value&&T.nodeVirtual!==!1&&!((($=T.maxLiveNodes)!=null?$:0)<=0&&!ns.value)&&(T.nodeVirtual===!0?Ft.value.length>0:Ft.value.length>Do.value)}),Ks=L(()=>kn.value||Ko.value||Sn.value),Cs=L(()=>T.viewportPriority!==!1),Ms=L(()=>!!Cs.value&&!H.value);var Es;Es=L(()=>Cs.value),Gn(hO,Es);const Fr=L(()=>{var $;return!(re.value||T.deferNodesUntilVisible===!1||(($=T.maxLiveNodes)!=null?$:0)<=0||kn.value||Ft.value.length>900||T.viewportPriority===!1)}),Ts=EIe($=>{var Y;return ge((Y=$??R.value)!=null?Y:null)},Cs),{requestFrame:Mi,cancelFrame:wi,hasIdleCallback:Vo,isTestEnv:Ls}=(function($){const Y=$.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ae=$.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ce=$.isClient&&typeof window.requestIdleCallback=="function",be=(function(){var Le;if(typeof globalThis>"u"||!("process"in globalThis))return;const Pe=(Le=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Le.value;return Pe?.env})();return{requestFrame:Y,cancelFrame:ae,hasIdleCallback:ce,isTestEnv:be?.NODE_ENV==="test"}})({isClient:Q}),Vs=L(()=>Be.value===!0&&!Pn.value),{resolvedBatchSize:dr,resolvedInitialBatch:Oe,batchingEnabled:He,incrementalRenderingActive:mt,renderedCount:yt,previousRenderContext:hn,adaptiveBatchSize:Pi,previousBatchConfig:ji}=(function($,Y){var ae;const ce=L(()=>{var rt;const je=Math.trunc((rt=$.renderBatchSize)!=null?rt:80);return Number.isFinite(je)?Math.max(0,je):0}),be=L(()=>{var rt;const je=Math.trunc((rt=$.initialRenderBatchSize)!=null?rt:ce.value);return Number.isFinite(je)?Math.max(0,je):ce.value}),Le=L(()=>!Y.renderAsFragment.value&&$.batchRendering!==!1&&ce.value>0&&Y.isClient&&!Y.isTestEnv),Pe=Z(0),qe=Z({key:$.indexKey,total:0}),lt=Z(Math.max(1,ce.value||1)),Ue=L(()=>{var rt,je,nt;return Le.value&&!((rt=Y.continuousStreaming)!=null&&rt.value)&&!((je=Y.forceFullRenderFinalContent)!=null&&je.value)&&((nt=$.maxLiveNodes)!=null?nt:0)<=0}),tt=Z({batchSize:ce.value,initial:be.value,delay:(ae=$.renderBatchDelay)!=null?ae:16,enabled:Ue.value});return{resolvedBatchSize:ce,resolvedInitialBatch:be,batchingEnabled:Le,incrementalRenderingActive:Ue,renderedCount:Pe,previousRenderContext:qe,adaptiveBatchSize:lt,previousBatchConfig:tt}})(T,{isClient:Q,isTestEnv:Ls,renderAsFragment:re,forceFullRenderFinalContent:Vs,continuousStreaming:L(()=>zt.value&&Be.value!==!0)}),qi=L(()=>{var $;return!re.value&&T.batchRendering!==!1&&dr.value>0&&!Ls&&(($=T.maxLiveNodes)!=null?$:0)<=0&&!Vs.value}),Zs=L(()=>qi.value),Ui=L(()=>Ri.value||Zs.value),ps=L(()=>{var $;return Ui.value&&(($=si.value)==null?void 0:$.codeBlockEstimation)!==!1}),Hn=new Map,Zo=new Map,Go=new WeakMap;let no=null;const yl=new WeakMap,st=new Map,Se=[];let ze=[],Tn=[],ne=-1;const ke=ql(Se),xe=new Set,We=Z(0);let Xe=0;const Ye=Z(0),_t=L(()=>(Ye.value,Array.from(Hn.entries()).sort(($,Y)=>$[0]-Y[0]))),ht=Z(null),Gt=Z(null);let Wt,gn=null,ei=0,jt=null;function Rt(){Wt.markFallbackHeightPrefixDirty()}function zn($){return Wt.getFallbackNodeHeight($)}function vi($,Y){return Wt.estimateHeightRange($,Y)}function is($){return Wt.estimateIndexForOffset($)}const{activeRestoreAnchor:io,getRelativeScrollTopWithinContainer:$o,setRelativeScrollTopWithinContainer:$e,resolveAnchorOffset:gt,clearRestoreReconcile:pt,scheduleRestoreReconcile:Jt,captureRestoreAnchor:Ki,restoreAnchor:so,getAnchorDrift:kl}=(function($){const{isClient:Y,containerRef:ae,parsedNodeCount:ce,requestFrame:be,cancelFrame:Le,resolveScrollContainer:Pe,getNormalizedScrollTop:qe,getOffsetTopWithinRoot:lt,isReverseFlexScrollRoot:Ue,estimateIndexForOffset:tt,estimateHeightRange:rt,getFallbackNodeHeight:je,clamp:nt}=$,ut=Z(null);let at=null,Lt=[];function Ct(){const ln=Pe(),Ln=ae.value;if(!ln||!Ln)return null;const Rn=ln.ownerDocument||Ln.ownerDocument||document;if(ln===Rn.documentElement||ln===Rn.body||ln===Rn.scrollingElement){const bi=Ln.getBoundingClientRect();return Math.max(0,-bi.top)}return Math.max(0,qe(ln,Rn,!1)-lt(Ln,ln))}function Ot(ln){var Ln;const Rn=Pe(),bi=ae.value;if(!Rn||!bi)return;const yo=Math.max(0,ln),oo=Rn.ownerDocument||bi.ownerDocument||document,Al=oo.defaultView||(typeof window<"u"?window:null);if(Rn===oo.documentElement||Rn===oo.body||Rn===oo.scrollingElement){const Xl=qe(Rn,oo,!0)+bi.getBoundingClientRect().top;return void((Ln=Al?.scrollTo)==null||Ln.call(Al,0,Math.max(0,Xl+yo)))}uE(Rn,oo,lt(bi,Rn)+yo,{isReverseFlexScrollRoot:Xl=>{var v1;return(v1=Ue?.(Xl))!=null&&v1},getNormalizedScrollTop:qe})}function Ut(ln){const Ln=ce.value,Rn=nt(ln.nodeIndex,0,Math.max(0,Ln-1));return rt(0,Rn)+Math.max(0,ln.offsetWithinNodePx)}function rn(){if(at!=null&&(Le?.(at),at=null),Y)for(const ln of Lt)window.clearTimeout(ln);Lt=[]}function en(ln){const Ln=Ut(ln),Rn=Ct();Rn!=null&&Math.abs(Rn-Ln)<=.5||Ot(Ln)}return{activeRestoreAnchor:ut,getRelativeScrollTopWithinContainer:Ct,setRelativeScrollTopWithinContainer:Ot,resolveAnchorOffset:Ut,clearRestoreReconcile:rn,applyRestoreAnchor:en,scheduleRestoreReconcile:function(){ut.value&&Y&&at==null&&(at=be?be(()=>{at=null,ut.value&&en(ut.value)}):null,at==null&&ut.value&&en(ut.value))},captureRestoreAnchor:function(){const ln=Ct(),Ln=ce.value;if(ln==null||Ln<=0)return null;const Rn=nt(tt(ln+1),0,Ln-1),bi=rt(0,Rn),yo=je(Rn);return{nodeIndex:Rn,offsetWithinNodePx:nt(ln-bi,0,Math.max(0,yo-1))}},restoreAnchor:function(ln){const Ln=ce.value;if(ut.value={nodeIndex:nt(ln.nodeIndex,0,Math.max(0,Ln-1)),offsetWithinNodePx:Math.max(0,ln.offsetWithinNodePx)},rn(),en(ut.value),Y)for(const Rn of[0,120,280,480])Lt.push(window.setTimeout(()=>{ut.value&&en(ut.value)},Rn))},getAnchorDrift:function(ln){const Ln=Ct();return Ln==null?null:Ln-Ut(ln)}}})({isClient:Q,containerRef:R,parsedNodeCount:qs,requestFrame:Mi,cancelFrame:wi,resolveScrollContainer:()=>ht.value||me(),getNormalizedScrollTop:Qe,getOffsetTopWithinRoot:we,isReverseFlexScrollRoot:Ee,estimateIndexForOffset:is,estimateHeightRange:vi,getFallbackNodeHeight:zn,clamp:vo}),{nodeHeights:ws,heightStats:xs,heightTreeSize:du,heightSumTree:Zh,heightKnownTree:ug,averageNodeHeight:Gh,resetHeightMeasurements:cg,pruneHeightMeasurements:dg,rebuildHeightTrees:$c,recordNodeHeight:x9,removeNodeHeights:S9,exportHeightCache:_9,importHeightCache:ye,fenwickRangeSum:_e}=(function($={}){const Y=Ss({}),ae=Ss({total:0,count:0}),ce=Z(0),be=Z([]),Le=Z([]);function Pe(){for(const je of Object.keys(Y))delete Y[Number(je)];ae.total=0,ae.count=0,ce.value=0,be.value=[],Le.value=[]}function qe(je,nt,ut){for(let at=nt+1;at0;at-=at&-at)ut+=je[at];return ut}function Ue(je){ce.value=je;const nt=new Array(je+1).fill(0),ut=new Array(je+1).fill(0);for(const[at,Lt]of Object.entries(Y)){const Ct=Number(at),Ot=Number(Lt);!Number.isFinite(Ct)||Ct<0||Ct>=je||!Number.isFinite(Ot)||Ot<=0||(qe(nt,Ct,Ot),qe(ut,Ct,1))}be.value=nt,Le.value=ut}function tt(je){if(!Number.isInteger(je)||je<0)return!1;const nt=Y[je];if(!Number.isFinite(nt)||nt<=0)return!1;if(delete Y[je],ae.total=Math.max(0,ae.total-nt),ae.count=Math.max(0,ae.count-1),ce.value>je){const ut=be.value,at=Le.value;ut.length&&at.length&&(qe(ut,je,-nt),qe(at,je,-1))}return!0}const rt=L(()=>ae.count>0?Math.max(12,ae.total/ae.count):32);return{nodeHeights:Y,heightStats:ae,heightTreeSize:ce,heightSumTree:be,heightKnownTree:Le,averageNodeHeight:rt,resetHeightMeasurements:Pe,pruneHeightMeasurements:function(je){if(je<=0)return void Pe();let nt=0,ut=0;for(const[at,Lt]of Object.entries(Y)){const Ct=Number(at),Ot=Number(Lt);!Number.isFinite(Ct)||Ct<0||Ct>=je||!Number.isFinite(Ot)||Ot<=0?delete Y[Ct]:(nt+=Ot,ut++)}ae.total=nt,ae.count=ut},rebuildHeightTrees:Ue,recordNodeHeight:function(je,nt,ut={}){(function(at,Lt,Ct={}){var Ot;if(!Number.isFinite(Lt)||Lt<=0)return!1;const Ut=Y[at];if(Ut&&(Ct.allowShrink===!1&&Ltat){const rn=be.value,en=Le.value;if(rn.length&&en.length)if(Ut){const ln=Lt-Ut;ln!==0&&qe(rn,at,ln)}else qe(rn,at,Lt),qe(en,at,1)}Ct.notify!==!1&&((Ot=$.onHeightRecorded)==null||Ot.call($))})(je,nt,vn(xt({},ut),{notify:!0}))},removeNodeHeight:function(je,nt={}){var ut;const at=tt(je);return at&&nt.notify!==!1&&((ut=$.onHeightRecorded)==null||ut.call($)),at},removeNodeHeights:function(je,nt={}){var ut;let at=0;for(const Lt of je)tt(Number(Lt))&&at++;return at>0&&nt.notify!==!1&&((ut=$.onHeightRecorded)==null||ut.call($)),at},exportHeightCache:function(){return Object.entries(Y).map(([je,nt])=>({index:Number(je),height:Number(nt)})).filter(je=>Number.isFinite(je.index)&&je.index>=0&&Number.isFinite(je.height)&&je.height>0).sort((je,nt)=>je.index-nt.index)},importHeightCache:function(je,nt={}){var ut;if(!Array.isArray(je))return;const at=ce.value;let Lt=!1;if(nt.mode!=="merge"){const Ct=Object.keys(Y);if(Ct.length>0){for(const Ot of Ct)delete Y[Number(Ot)];Lt=!0}}for(const Ct of je){const Ot=Number(Ct.index),Ut=Number(Ct.height);if(!Number.isInteger(Ot)||Ot<0||at>0&&Ot>=at||!Number.isFinite(Ut)||Ut<=0)continue;const rn=Y[Ot];rn&&Math.abs(rn-Ut)<=1||(Y[Ot]=Ut,Lt=!0)}Lt&&((function(){let Ct=0,Ot=0;const Ut=ce.value;for(const[rn,en]of Object.entries(Y)){const ln=Number(rn),Ln=Number(en);!Number.isFinite(ln)||ln<0||Ut>0&&ln>=Ut||!Number.isFinite(Ln)||Ln<=0?delete Y[ln]:(Ct+=Ln,Ot++)}ae.total=Ct,ae.count=Ot})(),at>0&&Ue(at),(ut=$.onHeightRecorded)==null||ut.call($))},fenwickRangeSum:function(je,nt,ut){if(ut<=nt)return 0;const at=lt(je,ut-1);return nt<=0?at:at-lt(je,nt-1)}}})({onHeightRecorded:()=>{Rt(),Sn.value&&d1(),io.value&&Jt(),Gt.value&&hf(),Fi("node-resize")}});function Ke($){Number.isInteger($)&&$>=0&&xe.add($)}function $t($){for(const Y of $)Ke(Number(Y))}function Xt($){Xe++;let Y=!0;try{const ae=$();return Y=ae!==!1,ae}finally{Xe--,Xe===0&&Y&&We.value++}}function _n(){ze=[],Tn=[],ne=-1,xe.clear(),ke.value=Se}function Zn(){_n(),Xt(()=>cg()),st.clear()}function Ni($){!Number.isInteger($)||$<0||$>=Ft.value.length||st.set($,e1($))}function go($,Y,ae={}){const ce=ws[$];Ke($),x9($,Y,ae);const be=ws[$];return Object.is(ce,be)?(xe.delete($),!1):(be&&be>0?Ni($):ce&&st.delete($),!0)}function Bc($,Y){const ae=Je("getNodeLayoutHeight.slot.offsetHeight",()=>{var ce,be;return(be=(ce=Hn.get($))==null?void 0:ce.offsetHeight)!=null?be:0});return ae>0?ae:Je("getNodeLayoutHeight.content.offsetHeight",()=>Y.offsetHeight)}function Qh($,Y={}){Y.mode!=="merge"?_n():$t($.map(ae=>ae.index)),Xt(()=>ye($,Y)),e4()}const Ql=L(()=>Fr.value&&Ms.value),Tj=L(()=>{var $;return!re.value&&T.batchRendering!==!1&&dr.value>0&&(($=T.maxLiveNodes)!=null?$:0)<=0}),Lj=L(()=>!re.value&&Ze&&Be.value===!0&&!kn.value&&!Pn.value&&!Us.value&&!Ql.value&&!Tj.value),rA=L(()=>!!Ts&&Ql.value),lA=L(()=>kn.value||Sn.value),{focusIndex:Ia,liveRange:mo,updateLiveRange:Yh}=(function($,Y){const{parsedNodeCount:ae,virtualizationEnabled:ce,maxLiveNodesResolved:be,liveNodeBufferResolved:Le,clamp:Pe}=Y,qe=Le??L(()=>{var tt;return Math.max(0,(tt=$.liveNodeBuffer)!=null?tt:60)}),lt=Z(0),Ue=Ss({start:0,end:0});return{liveNodeBufferResolved:qe,focusIndex:lt,liveRange:Ue,updateLiveRange:function(){const tt=ae.value;if(!ce.value||tt===0)return Ue.start=0,void(Ue.end=tt);const rt=Math.min(be.value,tt),je=qe.value,nt=Pe(lt.value-je,0,Math.max(0,tt-rt));Ue.start=nt,Ue.end=Math.min(tt,nt+rt)}}})(T,{parsedNodeCount:qs,virtualizationEnabled:kn,maxLiveNodesResolved:Do,liveNodeBufferResolved:di,clamp:vo}),Yl=new Map,zc=new Map,fu=new Map,fg=[],Ma=new Map,hu=new Set,aA=Z(0);let I9=!1;const uA=L(()=>(aA.value,hu.size)),Dr=new Map,Jl=new Map,cA=Z(0),M9=L(()=>{cA.value;let $=0;for(const Y of Dr.values())$+=Math.max(0,Y);return $});let $r=null;const hg=L(()=>{if(!kn.value)return Ft.value.length;const $=di.value,Y=Math.max(mo.end+$,Oe.value),ae=Math.min(Ft.value.length,Y);return Math.max(yt.value,ae)});function pg(){I9||(I9=!0,queueMicrotask(()=>{I9=!1,aA.value+=1}))}function dA($,Y,ae="node-resize"){if(!Q||typeof window>"u")return null;const ce=window.setTimeout(()=>{hu.delete(ce)&&pg();try{Y()}finally{Fi(ae)}},Math.max(0,$));return hu.add(ce),pg(),ce}function gg($){Q&&$!=null&&(hu.delete($)&&pg(),window.clearTimeout($))}function fA(){if(Q&&typeof window<"u")for(const $ of hu)window.clearTimeout($);hu.size&&(hu.clear(),pg()),fg.length=0,fu.clear()}function Nj($){q.value=$}function Fj($){j.value=$}function Dj($){W.value=$}const{cancelScheduledFocusSync:E9,scheduleFocusSync:bl}=(function($){const{isClient:Y,containerRef:ae,virtualizationEnabled:ce,requestFrame:be,cancelFrame:Le,syncFocusToScroll:Pe}=$;let qe=null;function lt(){var tt,rt,je;return(je=(rt=(tt=ae.value)==null?void 0:tt.ownerDocument)==null?void 0:rt.defaultView)!=null?je:typeof window<"u"?window:null}function Ue(){if(!qe)return;const tt=lt();qe.viaTimeout?tt?tt.clearTimeout(qe.id):clearTimeout(qe.id):Le?.(qe.id),qe=null}return{cancelScheduledFocusSync:Ue,scheduleFocusSync:function(tt={}){if(!ce.value)return;if(!Y)return void Pe(!0);if(tt.immediate)return Ue(),void Pe(!0);if(qe)return;const rt=()=>{qe=null,Pe()};if(be)return void(qe={id:be(rt),viaTimeout:!1});const je=lt();qe={id:je?je.setTimeout(rt,16):setTimeout(rt,16),viaTimeout:!0}}}})({isClient:Q,containerRef:R,virtualizationEnabled:kn,requestFrame:Mi,cancelFrame:wi,syncFocusToScroll:function($=!1){var Y;if(!kn.value)return;const ae=ht.value||me();if(!ae)return;const ce=ae.ownerDocument||((Y=R.value)==null?void 0:Y.ownerDocument)||document,be=ce?.defaultView||(typeof window<"u"?window:null),Le=ae===ce?.documentElement||ae===ce?.body,Pe=Ft.value.length;if(Pe<=0)return;if(!Le&&Pe>0&&Ee(ae)){const at=Je("syncFocusToScroll.clientHeight",()=>ae.clientHeight||0),Lt=Je("syncFocusToScroll.scrollTop",()=>ae.scrollTop),Ct=Lt<0?-Lt:Lt;return void yg(vo((qe=Math.max(0,Ct)+.5*Math.max(0,at),Wt.estimateIndexForOffsetFromEnd(qe)),0,Math.max(0,Pe-1)),$)}var qe;const lt=(function(at,Lt,Ct,Ot){const Ut=R.value;if(!Ut)return null;const rn=Ot?0:Je("syncFocusToScroll.model.root.getBoundingClientRect",()=>at.getBoundingClientRect().top),en=Je("syncFocusToScroll.model.container.getBoundingClientRect",()=>Ut.getBoundingClientRect().top),ln=Math.max(0,rn-en),Ln=Ot?Je("syncFocusToScroll.model.viewport.clientHeight",()=>{var Rn,bi,yo,oo;return(oo=(yo=(bi=Ct?.innerHeight)!=null?bi:(Rn=Lt.documentElement)==null?void 0:Rn.clientHeight)!=null?yo:at.clientHeight)!=null?oo:0}):Je("syncFocusToScroll.model.root.clientHeight",()=>at.clientHeight);return vo(is(ln+.5*Math.max(0,Ln)),0,Math.max(0,Ft.value.length-1))})(ae,ce,be,Le);if(lt!=null)return void yg(lt,$);const Ue=Le?null:Je("syncFocusToScroll.root.getBoundingClientRect",()=>ae.getBoundingClientRect()),tt=Le?0:Ue.top,rt=Le?Je("syncFocusToScroll.viewport.clientHeight",()=>{var at,Lt;return(Lt=(at=be?.innerHeight)!=null?at:ae.clientHeight)!=null?Lt:0}):Ue.bottom,je=_t.value;let nt=null,ut=null;for(const[at,Lt]of je){if(!Lt)continue;const Ct=Je("syncFocusToScroll.slot.getBoundingClientRect",()=>Lt.getBoundingClientRect());Ct.bottom<=tt||Ct.top>=rt||(nt==null&&(nt=at),ut=at)}if(nt==null||ut==null){const at=R.value;if(!at)return;const Lt=Le?{top:0}:Je("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ae.getBoundingClientRect()),Ct=Je("syncFocusToScroll.fallback.scrollTop",()=>Qe(ae,ce,Le)),Ot=Le?(()=>{const rn=Je("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>at.getBoundingClientRect()),en=(Le?0:Lt.top)-rn.top;return Math.max(0,en)})():(()=>{const rn=we(at,ae);return Math.max(0,Ct-rn)})(),Ut=Le?Je("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var rn,en,ln,Ln;return(Ln=(ln=(en=be?.innerHeight)!=null?en:(rn=ce?.documentElement)==null?void 0:rn.clientHeight)!=null?ln:ae.clientHeight)!=null?Ln:0}):Je("syncFocusToScroll.fallback.root.clientHeight",()=>ae.clientHeight);return void yg(vo(is(Ot+.5*Math.max(0,Ut)),0,Math.max(0,Ft.value.length-1)),!0)}yg(Math.round((nt+ut)/2),$)}}),{visibleNodeIndices:T9,nodeVisibilityHandles:rf,nodeVisibilityWatchStops:mg,nodeVisibilityFallbackTimers:hA,clearVisibilityFallback:vg,markNodeVisible:pu,cleanupNodeVisibility:$j,destroyNodeVisibilityState:L9}=GEe({isClient:Q,shouldTrackVisibleNodeIndices:()=>Ql.value,shouldCleanupNodeVisibility:()=>kn.value,onNodeMarkedVisible:$=>{kn.value?bl():Ia.value=vo($,0,Math.max(0,Ft.value.length-1))},onNodeVisibilityCleaned:$=>{Hn.delete($)&&jA()}}),{cleanupScrollListener:pA,setupScrollListener:Bj}=(function($){const{isClient:Y,virtualizationEnabled:ae,listenerEnabled:ce,scrollRootElement:be,resolveScrollContainer:Le,scheduleFocusSync:Pe,onScroll:qe}=$;let lt=null,Ue=null;function tt(){lt&&(lt(),lt=null),Ue=null,be.value=null}function rt(je){const nt=$.getScrollTop?$.getScrollTop(je):je.scrollTop;return Math.max(0,Number.isFinite(nt)?Math.abs(nt):0)}return{cleanupScrollListener:tt,setupScrollListener:function(){if(!Y)return;if(!((je=ce?.value)!=null?je:ae.value))return void tt();var je;const nt=Le();if(!nt)return void tt();if(be.value===nt&<)return;tt(),Ue=rt(nt);const ut=()=>{if(qe?.(),ae.value){const at=(function(Lt){const Ct=rt(Lt),Ot=Ue;Ue=Ct;const Ut=Math.max(480,.75*(Lt.clientHeight||0));return Ot==null?Ct>Ut?{immediate:!0}:void 0:Math.abs(Ct-Ot)>Ut?{immediate:!0}:void 0})(nt);at?Pe(at):Pe()}};nt.addEventListener("scroll",ut,{passive:!0}),be.value=nt,lt=()=>{nt.removeEventListener("scroll",ut)}}}})({isClient:Q,virtualizationEnabled:kn,listenerEnabled:lA,scrollRootElement:ht,resolveScrollContainer:me,scheduleFocusSync:bl,onScroll:function(){const $=Gt.value;if(!$)return;const Y=Xh();if(!Y||(function(ce){if(o1()>=ei)return jt=null,!1;const be=jt;if(be==null)return!0;const Le=Math.abs(ce.scrollTop-be)<=2;return Le||(jt=null),Le})(Y))return;const ae=EA(Y);ae!=null?(ae<-32||Math.abs(Math.max(0,ae)-Math.max(0,$.distanceFromBottomPx))>32)&&ff("restore"):ff("restore")},getScrollTop:$=>{var Y;const ae=$.ownerDocument||((Y=R.value)==null?void 0:Y.ownerDocument)||document,ce=$===ae.documentElement||$===ae.body||$===ae.scrollingElement;return Je("scrollListener.getScrollTop",()=>Qe($,ae,ce))}});function yg($,Y=!1){const ae=vo($,0,Math.max(0,Ft.value.length-1));!Y&&Math.abs(ae-Ia.value)<=1||(Ia.value=ae,Yh())}function vo($,Y,ae){return Math.min(Math.max($,Y),ae)}function N9($=Ft.value.length){const Y=Wi();return!Number.isInteger(Y)||Y<0?$:vo(Y,0,$)}function F9($){return $?.firstElementChild}function gA($,Y){var ae;return $?(ae=$.matches)!=null&&ae.call($,Y)?$:$.querySelector(Y):null}function zj($,Y){$<1||$>6||(z[$]=Y)}function mA(){if(!Ri.value)return void(se.value=0);const $=Je("updateExperimentContainerWidth.clientWidth",()=>{var Y,ae;return(ae=(Y=R.value)==null?void 0:Y.clientWidth)!=null?ae:0});se.value=$>0?$:0}let Jh=null;function D9(){Jh?.disconnect(),Jh=null}const vA=op("ViewportDeferredMarkdownCodeBlockNode",Fl({loader:()=>$i(null,null,function*(){return(yield ys(()=>import("./index5-BqWCpPta.js"),__vite__mapDeps([8,6,7]))).default}),loadingComponent:Vv,delay:0,suspensible:!1}),Vv);function yA($){return $===vA}const kA=L(()=>g.value==="pre"?br:g.value==="shiki"?vA:G3);function bA(){var $;return(($=T.codeBlockProps)==null?void 0:$.showHeader)!==!1}function AA($,Y,ae){const ce=ws[Y],be=typeof ce=="number"&&ce>0;if(Is.value&&!be&&!(function(Le){return!!Xn.value.paragraph&&(Le.type==="paragraph"||Le.type==="list_item"||Le.type==="list")})($)){const Le=kO($,ae,te.value);if(Le)return Le}if(ps.value&&$.type==="code_block"){const Le=(function(Pe){if(Pe.type!=="code_block")return null;const qe=XA(Pe,Mg(Pe));return yA(qe)?"markdown":qe===br?"pre":qe===kA.value||qe===G3?"monaco":null})($);if(Le==="monaco"||Le==="markdown"||Le==="pre")return(function(Pe,qe){var lt,Ue,tt;if(!Pe||Pe.type!=="code_block")return null;const rt=qe.rendererKind,je=rt!=="pre"&&qe.showHeader!==!1,nt=!!Pe.diff;let ut=0,at=500;if(rt==="monaco"){const Ct=(lt=qe.monacoOptions)!=null?lt:{},Ot=sk(Pe,Ct,qe.width),Ut=(function(en){const ln=typeof en?.fontSize=="number"&&en.fontSize>0?en.fontSize:12;return typeof en?.lineHeight=="number"&&en.lineHeight>0?en.lineHeight:Math.round(1.5*ln)})(Ct),rn=(function(en,ln){var Ln,Rn;const bi=typeof((Ln=en?.padding)==null?void 0:Ln.top)=="number"?en.padding.top:ln?0:8,yo=typeof((Rn=en?.padding)==null?void 0:Rn.bottom)=="number"?en.padding.bottom:ln?0:8;return Math.max(0,bi)+Math.max(0,yo)})(Ct,nt);at=typeof Ct.MAX_HEIGHT=="number"&&Ct.MAX_HEIGHT>0?Ct.MAX_HEIGHT:500,ut=Math.round(Ot*Ut+rn)}else if(rt==="markdown"){const Ct=sk(Pe);ut=Math.round(21*Ct+32)}else{const Ct=sk(Pe);ut=Math.round(28*Ct),at=Number.POSITIVE_INFINITY}const Lt=Math.max(1,Math.min(ut,at));return xt({kind:"code-block",height:Math.round(Lt+(je?40:0)),contentHeight:Lt,rendererKind:rt},nt&&rt==="monaco"?{diffInline:k7((Ue=qe.monacoOptions)!=null?Ue:{},(tt=qe.width)!=null?tt:0)}:{})})($,{rendererKind:Le,monacoOptions:T.codeBlockMonacoOptions,showHeader:bA(),width:ae})}return null}Sk(()=>{if(We.value,Xe>0)return;const $=Ft.value,Y=Xi();if(!$.length||!Ui.value)return ze=[],Tn=[],ne=-1,xe.clear(),void(ke.value=Se);const ae=se.value||Je("estimatedNodeHeights.clientWidth",()=>{var Ue;return((Ue=R.value)==null?void 0:Ue.clientWidth)||0});if(!Number.isFinite(ae)||ae<=0)return ze=[],Tn=[],ne=-1,xe.clear(),void(ke.value=Se);const ce=(function(Ue){return[Math.round(Ue),Is.value,ps.value,te.value,T.codeBlockMonacoOptions,bA(),g.value,Xn.value,tk.value]})(ae),be=ze.length<=$.length&&(Pe=ce,(Le=Tn).length===Pe.length&&Le.every((Ue,tt)=>Object.is(Ue,Pe[tt])));var Le,Pe;const qe=be&&ne===Y?$.length:be?N9($.length):0,lt=be?Array.from(xe):[];ze.length=$.length;for(let Ue=qe;Ue<$.length;Ue++)ze[Ue]=AA($[Ue],Ue,ae);for(const Ue of lt)Ue>=0&&Ue<$.length&&Ueke.value);Wt=(function($){let Y=!0,ae=[0],ce="";function be(tt){var rt;const je=$.nodeHeights[tt];if(Number.isFinite(je)&&je>0)return je;const nt=$.parsedNodes.value[tt],ut=nt?.type,at=!!((rt=$.hasCustomParagraphComponent)!=null&&rt.call($)),Lt=$.estimatedNodeHeights.value[tt],Ct=Lt?.height;if(!(function(Ut,rn,en){return!!(en&&rn?.kind==="simple-text"&&(Ut==="paragraph"||Ut==="list_item"||Ut==="list"))})(ut,Lt,at)&&Number.isFinite(Ct)&&Ct>0)return Ct;const Ot=zEe(nt,$.getContainerWidth()||640);return ut==="heading"||ut==="paragraph"&&Ot<=28&&(function(Ut,rn){if(rn)return!1;const en=Ut.children;return!Array.isArray(en)||!en.length||en.every(AO)})(nt,at)?Ot:Math.max($.averageNodeHeight.value,Ot)}function Le(){var tt;const rt=$.parsedNodes.value.length,je=$.getPrefixCacheKeyParts().join(":");if(!Y&&ce===je)return ae;const nt=new Array(rt+1);nt[0]=0;for(let ut=0;ut=((rt=ut[nt])!=null?rt:0))return nt-1;let at=0,Lt=nt-1,Ct=nt-1;for(;at<=Lt;){const Ot=at+Lt>>1;((je=ut[Ot+1])!=null?je:0)>=tt?(Ct=Ot,Lt=Ot-1):at=Ot+1}return Ct}function qe(tt,rt){var je,nt;if(tt>=rt)return 0;if($.heightEstimationActive.value)return(function(Lt,Ct){var Ot,Ut;const rn=$.parsedNodes.value.length,en=fE(Math.trunc(Lt),0,rn),ln=fE(Math.trunc(Ct),en,rn);if(en>=ln)return 0;const Ln=Le();return((Ot=Ln[ln])!=null?Ot:0)-((Ut=Ln[en])!=null?Ut:0)})(tt,rt);if($.heightTreeSize.value!==$.parsedNodes.value.length){let Lt=0;for(let Ct=tt;Cten<=0?0:$.fenwickRangeSum(at,0,en)+(en-$.fenwickRangeSum(Lt,0,en))*ut;let Ot=0,Ut=je.length-1,rn=je.length-1;for(;Ot<=Ut;){const en=Ot+Ut>>1;Ct(en+1)>=tt?(rn=en,Ut=en-1):Ot=en+1}return rn}let nt=tt;for(let ut=0;ut0||tt++}return tt}return{markFallbackHeightPrefixDirty:function(){Y=!0},getFallbackNodeHeight:be,estimateHeightRange:qe,estimateIndexForOffset:lt,estimateIndexForOffsetFromEnd:function(tt){var rt,je;const nt=$.parsedNodes.value;if(!nt.length)return 0;if(tt<=0)return Math.max(0,nt.length-1);if($.heightEstimationActive.value){const at=(rt=Le()[nt.length])!=null?rt:0;return Pe(Math.max(0,at-tt))}if($.heightTreeSize.value===nt.length){const at=qe(0,nt.length);return lt(Math.max(0,at-tt))}let ut=tt;for(let at=nt.length-1;at>=0;at--){const Lt=(je=$.nodeHeights[at])!=null?je:$.averageNodeHeight.value;if(ut<=Lt)return at;ut-=Lt}return 0},getEstimatedNodeHeightCount:Ue,buildVirtualHeightSummary:function(tt){var rt;const je=$.parsedNodes.value.length;return{totalNodes:je,measuredCount:$.heightStats.count,estimatedCount:Ue(),averageNodeHeight:$.averageNodeHeight.value,topSpacerHeight:tt.topSpacerHeight,bottomSpacerHeight:tt.bottomSpacerHeight,estimatedTotalHeight:qe(0,je),width:(rt=tt.width)!=null?rt:$.getContainerWidth()}}}})({parsedNodes:Ft,nodeHeights:ws,heightStats:xs,heightTreeSize:du,heightSumTree:Zh,heightKnownTree:ug,averageNodeHeight:Gh,heightEstimationActive:Ri,estimatedNodeHeights:lf,getContainerWidth:Oi,hasCustomParagraphComponent:()=>!!Xn.value.paragraph,getPrefixCacheKeyParts:()=>{var $;const Y=N1(se.value||Je("getFallbackHeightPrefix.clientWidth",()=>{var ce;return((ce=R.value)==null?void 0:ce.clientWidth)||0})),ae=(($=i.virtualScroll)==null?void 0:$.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Ft.value.length,xs.count,Math.round(xs.total),Math.round(100*Gh.value),ae,Y,Ri.value?1:0,tk.value,U.value,Xn.value.paragraph?1:0]},fenwickRangeSum:_e}),Ve(()=>Ft.value.length,$=>{var Y;Rt(),$<=0?Zn():($dg(Y))),$!==du.value&&$c($))},{immediate:!0});const Rj=L(()=>{if(!kn.value)return Ft.value.map((ce,be)=>({node:ce,index:be}));const $=Ft.value.length,Y=vo(mo.start,0,$),ae=vo(mo.end,Y,$);return Ft.value.slice(Y,ae).map((ce,be)=>({node:ce,index:Y+be}))}),$9=L(()=>kn.value?vi(0,Math.min(mo.start,Ft.value.length)):0),B9=L(()=>{if(!kn.value)return 0;const $=Ft.value.length;return vi(Math.min(mo.end,$),$)});function CA(){return Wt.buildVirtualHeightSummary({topSpacerHeight:$9.value,bottomSpacerHeight:B9.value,width:Rc()})}function Oj(){const $=Ft.value,Y=CA();return vn(xt({},Y),{probe:{paragraphReady:!!te.value.paragraph,listItemReady:!!te.value.listItem,listWrapperOverhead:te.value.listWrapperOverhead,headingReadyLevels:Object.entries(te.value.headings).filter(([,ae])=>!!ae).map(([ae])=>Number(ae))},nodes:$.map((ae,ce)=>{var be,Le,Pe,qe,lt,Ue,tt,rt,je;return{index:ce,type:ae.type,estimateKind:(Le=(be=lf.value[ce])==null?void 0:be.kind)!=null?Le:null,rendererKind:(qe=(Pe=lf.value[ce])==null?void 0:Pe.rendererKind)!=null?qe:null,estimatedHeight:(Ue=(lt=lf.value[ce])==null?void 0:lt.height)!=null?Ue:null,estimatedContentHeight:(rt=(tt=lf.value[ce])==null?void 0:tt.contentHeight)!=null?rt:null,measuredHeight:(je=ws[ce])!=null?je:null}})})}function z9(){return i.indexKey!=null?String(i.indexKey):Pn.value?`virtual-${Vi()}`:"markdown-renderer"}function wA($){const Y=String($),ae=`${z9()}-`;if(!Y.startsWith(ae))return null;const ce=Y.slice(ae.length).match(/^(\d+)(?:$|-)/);if(!ce)return null;const be=Number(ce[1]);return!Number.isInteger(be)||be<0||be>=Ft.value.length?null:be}function Vi(){var $,Y,ae;const ce=($=i.virtualScroll)==null?void 0:$.sessionKey;return String(ce!=null&&ce!==""?ce:(ae=(Y=i.indexKey)!=null?Y:T.customId)!=null?ae:Yt)}function Ns(){var $;const Y=($=i.virtualScroll)==null?void 0:$.threadKey;return Y==null||Y===""?void 0:String(Y)}const Pj=L(()=>{var $,Y,ae;return(ae=Ns())!=null?ae:String((Y=($=i.indexKey)!=null?$:T.customId)!=null?Y:Yt)});function R9($){var Y;return($??"")===((Y=Ns())!=null?Y:"")}function Ea(){var $,Y,ae;return Y=($=i.virtualScroll)==null?void 0:$.measurementKey,ae=(function(){const ce=g.value;return(function(be){var Le,Pe;const qe=be.renderer,lt=qe==="monaco"?be.codeBlockMonacoOptions:void 0,Ue=be.codeBlockProps,tt=qe==="shiki";return[be.isDark?"dark":"light",qe==="monaco"?"code-rich":qe==="pre"?"code-pre":"code-shiki",be.codeBlockStream===!1?"code-static":"code-stream",ro(be.codeBlockMinWidth),ro(be.codeBlockMaxWidth),...tt?[I_e((Le=Ue?.themes)!=null?Le:be.themes,(Pe=Ue?.langs)!=null?Pe:be.langs)]:[],ro(lt?.fontSize),ro(lt?.lineHeight),ro(lt?.fontFamily),ro(lt?.tabSize),ro(lt?.MAX_HEIGHT),ro(lt?.wordWrap),ro(lt?.wrappingIndent),ro(lt?.padding),ro(Ue?.showHeader),ro(Ue?.showCopyButton),ro(Ue?.showExpandButton),ro(Ue?.showPreviewButton),ro(Ue?.showCollapseButton),ro(Ue?.showFontSizeButtons)].join("\0")})({renderer:ce,isDark:T.isDark,codeBlockStream:T.codeBlockStream,codeBlockMinWidth:T.codeBlockMinWidth,codeBlockMaxWidth:T.codeBlockMaxWidth,codeBlockMonacoOptions:ce==="monaco"?T.codeBlockMonacoOptions:void 0,codeBlockProps:T.codeBlockProps,themes:ce==="shiki"?T.themes:void 0,langs:ce==="shiki"?T.langs:void 0})})(),[Y==null?"":String(Y),ae].join("\0")}function Rc(){return Oi()}const kg=L(()=>N1(Rc())),Br=L(()=>[Ea(),kg.value].join("\0")),jj=L(()=>{var $;return Pn.value?["virtual",($=Ns())!=null?$:"",Vi(),Br.value].join("\0"):i.indexKey});function af(){cA.value+=1}function O9($){return!(!$||!Number.isInteger($.index)||$.index<0||$.index>=Ft.value.length||$.sessionKey!==Vi()||$.threadKey!==Ns()||$.layoutEpochKey!==Br.value)}function xA($){const Y=String($),ae=Jl.get(Y);return ae?O9(ae)?ae.index:null:wA(Y)}function SA($="async-node"){(Dr.size||Jl.size)&&(Dr.clear(),Jl.clear(),af(),Fi($))}const uf=un(m8,null),P9={reportHeight($,Y){if(!Sn.value)return;const ae=xA($);if(ae==null)return;const ce=Yl.get(ae);if(!ce)return;const be=Number(Y),Le=Bc(ae,ce);(function(Pe,qe,lt={}){Xt(()=>go(Pe,qe,lt))})(ae,Number.isFinite(be)&&be>0?Math.max(be,Le||0):Le)},markPending($){if(!Sn.value)return;const Y=wA($);Y!=null&&(function(ae,ce){var be;const Le=Jl.get(ae);if(Le&&O9(Le))return Dr.set(ae,Math.max(0,(be=Dr.get(ae))!=null?be:0)+1),af(),void Fi("async-node");Dr.set(ae,1),Jl.set(ae,(function(Pe){return{index:Pe,sessionKey:Vi(),threadKey:Ns(),layoutEpochKey:Br.value}})(ce)),af(),Fi("async-node")})(String($),Y)},markSettled($){if(!Sn.value)return;const Y=String($),ae=xA($);(ae!=null||(function(ce){return Dr.has(String(ce))})(Y))&&(function(ce){var be;const Le=(be=Dr.get(ce))!=null?be:0;return!(Le<=0||(Le<=1?(Dr.delete(ce),Jl.delete(ce)):Dr.set(ce,Le-1),af(),Le===1&&Fi("async-node"),0))})(Y)&&ae!=null&&Ta()}};function Hj(){let $=0;for(const Y of Yl.values())$+=Je("getVisibleDomHeight.offsetHeight",()=>{var ae;return(ae=Y?.offsetHeight)!=null?ae:0});return Math.ceil(Math.max(0,$))}Gn(m8,{reportHeight($,Y){P9.reportHeight($,Y),uf?.reportHeight($,Y)},markPending($){P9.markPending($),uf?.markPending($)},markSettled($){P9.markSettled($),uf?.markSettled($)}});let j9,H9=null,cf=null;function bg($){return $!==!1&&$!=null&&$!==""}function _A(){return kn.value?(function(){if(!kn.value)return!0;const $=Ft.value.length,Y=vo(mo.start,0,$),ae=vo(mo.end,Y,$);if(Y>=ae)return!0;for(let ce=Y;ce=hg.value}function W9(){return Be.value===!0&&!vt.value&&M9.value===0&&hu.size===0&&Ma.size===0&&$r==null&&_A()}function IA(){var $,Y;if((($=i.virtualScroll)==null?void 0:$.settleMode)!=="manual"||H9===Vi()&&j9===Ns())return!0;const ae=(Y=i.virtualScroll)==null?void 0:Y.settledToken;return!!bg(ae)&&cf===f1(ae)}function q9(){return W9()&&IA()}function Wj($,Y){return Y.totalNodes<=0?$==="final"?"final":"estimate":Y.measuredCount>=Y.totalNodes?$==="final"?"final":"measured":Y.measuredCount>0||Y.estimatedCount>0?"mixed":"estimate"}function Oc($="manual",Y){const ae=CA(),ce=(function(be){return be||(Be.value!==!0?Ft.value.length>0?"streaming":"estimating":!_A()||Ma.size>0||$r!=null?"measuring":q9()?"settled":"settling")})(Y);return{sessionKey:Vi(),threadKey:Ns(),phase:ce,nodeCount:ae.totalNodes,liveRange:{start:mo.start,end:mo.end},renderedCount:yt.value,measuredCount:ae.measuredCount,estimatedCount:ae.estimatedCount,averageNodeHeight:ae.averageNodeHeight,topSpacerHeight:ae.topSpacerHeight,bottomSpacerHeight:ae.bottomSpacerHeight,visibleDomHeight:Hj(),totalHeight:MA(),width:ae.width,final:Be.value===!0,stable:q9(),confidence:Wj(ce,ae),reason:$}}function Xh(){const $=ht.value||me(),Y=R.value;if(!$||!Y)return null;const ae=$.ownerDocument||Y.ownerDocument||document,ce=$===ae.documentElement||$===ae.body||$===ae.scrollingElement,be=Je("getScrollBox.scrollTop",()=>Qe($,ae,ce)),Le=Je("getScrollBox.scrollHeight",()=>{var qe,lt,Ue,tt,rt;return ce?Math.max((lt=(qe=ae.documentElement)==null?void 0:qe.scrollHeight)!=null?lt:0,(tt=(Ue=ae.body)==null?void 0:Ue.scrollHeight)!=null?tt:0,(rt=$.scrollHeight)!=null?rt:0):$.scrollHeight}),Pe=Je("getScrollBox.clientHeight",()=>{var qe;return ce?((qe=ae.documentElement)==null?void 0:qe.clientHeight)||$.clientHeight||0:$.clientHeight});return{root:$,doc:ae,isViewportRoot:ce,scrollTop:be,scrollHeight:Le,clientHeight:Pe}}function MA(){const $=Ft.value.length,Y=Math.max(0,vi(0,$)),ae=Je("getRendererLogicalHeight.offsetHeight",()=>{var be,Le;return(Le=(be=R.value)==null?void 0:be.offsetHeight)!=null?Le:0}),ce=Math.max(0,ae>0?ae:Je("getRendererLogicalHeight.scrollHeight",()=>{var be,Le;return(Le=(be=R.value)==null?void 0:be.scrollHeight)!=null?Le:0}));return $<=0?Math.ceil(ae):kn.value?Y>0?Math.max(1,Math.ceil(Y),(function(){let be=$9.value+B9.value;for(const Le of Hn.values())Le&&(be+=Math.max(0,Je("getVirtualizedDomLogicalHeight.offsetHeight",()=>Le.offsetHeight||0)));return Math.ceil(Math.max(0,be))})(),(function(be,Le){return be<=0||Le<=0?0:Le<=be+Math.max(512,.05*be)?Math.ceil(Le):0})(Y,ce)):Math.max(1,Math.ceil(ce)):Sn.value?Y>0||xs.count>0||Wt.getEstimatedNodeHeightCount()>0?(mt.value&&yt.value,Math.max(1,Math.ceil(ce),Math.ceil(Y))):Math.ceil(ce):Math.max(1,Math.ceil(ce),Math.ceil(Y))}function EA($){const Y=R.value;if(!Y)return null;const ae=Je("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>Y.getBoundingClientRect());return(function(be){return be.isViewportRoot?be.clientHeight:Je("getViewportBottomInRoot.getBoundingClientRect",()=>be.root.getBoundingClientRect().bottom)})($)-ae.bottom}function qj($={}){const Y=$.requireViewport!==!1,ae=(function(Le=64){const Pe=Xh(),qe=R.value;if(!Pe||!qe)return!1;const lt=(function(tt){if(tt.isViewportRoot)return{top:0,bottom:tt.clientHeight};const rt=Je("getVirtualViewportRect.getBoundingClientRect",()=>tt.root.getBoundingClientRect());return{top:rt.top,bottom:rt.bottom}})(Pe),Ue=Je("isRendererNearVirtualViewport.getBoundingClientRect",()=>qe.getBoundingClientRect());return Ue.bottom>=lt.top-Le&&Ue.top<=lt.bottom+Le})();if(Y&&!ae)return null;const ce=(function(){const Le=Xh(),Pe=R.value;if(!Le||!Pe||Math.max(0,Le.scrollHeight-Le.scrollTop-Le.clientHeight)>64)return null;const qe=EA(Le);return qe==null?null:qe>=-8&&qe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,qe)}:null})();if(ce)return{anchor:ce,captured:!0};const be=Ki();if(be)return{anchor:{type:"node",nodeIndex:be.nodeIndex,offsetWithinNodePx:be.offsetWithinNodePx},captured:ae};if($.allowFallback===!0){const Le=(function(){const Pe=Ft.value.length;return Pe<=0?null:{type:"node",nodeIndex:vo(Ia.value,0,Math.max(0,Pe-1)),offsetWithinNodePx:0}})();return Le?{anchor:Le,captured:!1}:null}return null}function U9($){let Y=2166136261;for(let ae=0;ae<$.length;ae++)Y^=$.charCodeAt(ae),Y=Math.imul(Y,16777619);return(Y>>>0).toString(36)}function Uj($,Y){let ae=$;for(let ce=0;ce8192?`${ce.slice(0,8192)}...${ce.length}`:ce;return`${ce.length}:${U9(be)}`})($)}`;if(typeof $=="function")return"fn";if(typeof $!="object")return typeof $;if(Y.has($))return"cycle";if(ae>=6)return"max-depth";Y.add($);try{if(Array.isArray($)){if($.length<=160){const Ue=[];for(let tt=0;tt<$.length;tt++)Ue.push(Ag($[tt],Y,ae+1));return`a:${$.length}:${Ue.join(",")}`}const Le=[],Pe=[],qe=Math.max(0,$.length-32);let lt=2166136261;for(let Ue=0;Ue<$.length;Ue++){const tt=Ag($[Ue],Y,ae+1);lt=Uj(lt,tt),Ue<32&&Le.push(tt),Ue>=qe&&Pe.push(tt)}return[`a:${$.length}`,`h=${Le.join(",")}`,`t=${Pe.join(",")}`,`all=${(lt>>>0).toString(36)}`].join(":")}const ce=$,be=Object.keys(ce).filter(Le=>{const Pe=ce[Le];return Le!=="parent"&&Le!=="el"&&Le!=="component"&&(Pe==null||typeof Pe=="string"||typeof Pe=="number"||typeof Pe=="boolean"||Kj.has(Le))}).sort();return`o:${be.length}:${be.map(Le=>`${Le}=${Ag(ce[Le],Y,ae+1)}`).join(";")}`}finally{Y.delete($)}}let K9=-1,V9="",Pc=[2166136261];function e1($){const Y=Ft.value[$];return Y?U9(Ag(Y)):""}function Vj($,Y){let ae=$;for(let ce=0;ce>>0}function Z9(){var $,Y;const ae=U.value;if(K9===ae)return V9;const ce=Ft.value.length;let be=N9(ce);(K9!==ae-1||be>ce||Pc.length>>0).toString(36),K9=ae,V9}function df($,Y={}){var ae;const ce=Y.includeHeightCache===!0,be=(ae=Y.includeContentHash)!=null?ae:ce,Le=ce?(function(qe){const lt=(function(){var at,Lt;const Ct=Number((Lt=(at=i.virtualScroll)==null?void 0:at.heightCacheLimit)!=null?Lt:5e3);return!Number.isFinite(Ct)||Ct<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Ct))})();if(!Number.isFinite(lt)||qe.length<=lt)return qe;const Ue=new Map,tt=at=>{!at||Ue.size>=lt||Ue.set(at.index,at)},rt=Ft.value.length,je=vo(mo.start-2*di.value,0,rt),nt=vo(mo.end+2*di.value,je,rt);for(const at of qe)at.index>=je&&at.index=0&&Ue.sizeat.index-Lt.index).slice(0,lt)})(_9().map(qe=>{var lt;const Ue=Ft.value[qe.index];return Ue?vn(xt({},qe),{nodeType:String((lt=Ue.type)!=null?lt:""),signature:e1(qe.index)}):null}).filter(qe=>!!qe)):[],Pe=qj({allowFallback:Y.allowAnchorFallback===!0,requireViewport:Y.requireViewport});return Pe||Le.length||Y.includeEmptyState===!0?vn(xt({sessionKey:$.sessionKey,threadKey:$.threadKey},Pe?{anchor:Pe.anchor,anchorCaptured:Pe.captured}:{anchorCaptured:!1}),{metrics:$,width:$.width,contentHash:be?Z9():void 0,measurementKey:Ea()||void 0,heightCache:Le.length?Le:void 0}):null}function G9($){var Y,ae;const ce=Xh();if(!ce)return;const be=(function(qe){const lt=R.value;if(!lt)return null;const Ue=we(lt,qe.root),tt=Ft.value.length,rt=Je("getRendererBottomOffsetWithinRoot.offsetHeight",()=>lt.offsetHeight||0),je=Math.max(0,rt>0?rt:tt>0?Je("getRendererBottomOffsetWithinRoot.scrollHeight",()=>lt.scrollHeight||0):0),nt=MA();return Ue+Math.max(je,nt)})(ce);if(be==null)return;const Le=Math.max(0,$.distanceFromBottomPx),Pe=Math.max(0,be-ce.clientHeight-Le);(function(qe){ei=o1()+120,jt=qe})(Pe),ce.isViewportRoot?(ae=(Y=ce.doc.defaultView)==null?void 0:Y.scrollTo)==null||ae.call(Y,0,Pe):uE(ce.root,ce.doc,Pe,{isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:Qe})}const Q9=[];function TA(){if(Q)for(gn!=null&&(wi?.(gn),gn=null);Q9.length;){const $=Q9.pop();$!=null&&window.clearTimeout($)}}function ff($){const Y=!!Gt.value;Gt.value=null,ei=0,jt=null,TA(),Y&&$&&Fi($)}function hf(){if(!Gt.value||!Q||gn!=null)return;const $=()=>{gn=null;const Y=Gt.value;Y&&G9(Y)};gn=Mi?Mi($):null,gn==null&&$()}function LA($,Y={}){const ae=Ft.value.length;return ae<=0?[]:$.filter(ce=>!(!Number.isInteger(ce.index)||ce.index<0||ce.index>=ae)&&!(!Number.isFinite(ce.height)||ce.height<=0)&&!(Y.requireSignature&&!ce.signature)&&!(Y.requireCompatibilityMetadata&&!ce.nodeType&&!ce.signature)&&(function(be){var Le;const Pe=Ft.value[be.index];return!(!Pe||be.nodeType&&be.nodeType!==String((Le=Pe.type)!=null?Le:"")||be.signature&&be.signature!==e1(be.index))})(ce))}function NA($){const Y=N1(Rc()),ae=N1($);return Y!==-1&&ae!==-1&&Y===ae}function Y9($){var Y;const ae=Number($?.width);if(Number.isFinite(ae)&&ae>0)return ae;const ce=Number((Y=$?.metrics)==null?void 0:Y.width);return Number.isFinite(ce)&&ce>0?ce:null}function FA($){var Y;return $.sessionKey===Vi()&&!!R9($.threadKey)&&((Y=$.measurementKey)!=null?Y:"")===Ea()&&!!NA(Y9($))&&!!(function(ae){const ce=ae.heightCache;return!!ce?.length&&(DA(ae)?ce.some(be=>!!(be.nodeType||be.signature)):ce.some(be=>!!be.signature))})($)}function DA($){return!!($.contentHash&&$.contentHash===Z9())}function Zj($){return!DA($)}let jc=null,Hc=null,Cg=null,t1=null,n1=null;function J9($){var Y;const ae=$.map(be=>{var Le,Pe;return[be.index,Math.round(10*be.height),(Le=be.nodeType)!=null?Le:"",(Pe=be.signature)!=null?Pe:""].join("")}).join(""),ce=N1(Rc());return[(Y=Ns())!=null?Y:"",Vi(),Ea(),Ft.value.length,ce,$.length,U9(ae)].join(":")}function $A($=(Y=>(Y=i.virtualScroll)==null?void 0:Y.heightCache)()){if(!Sn.value||!$?.length||Ft.value.length<=0||!NA((Y=i.virtualScroll)==null?void 0:Y.heightCacheWidth))return!1;var Y;const ae=LA($,{requireSignature:!0});if(!ae.length)return!1;const ce=J9(ae);return ce===jc?(Hc="standalone",!0):(Qh(ae,{mode:"merge"}),Rt(),jc=ce,Hc="standalone",l1(),Fi("restore"),!0)}function X9($,Y={}){var ae,ce,be;if(!Sn.value||!$||$.sessionKey!==Vi()||!R9($.threadKey)||Ft.value.length<=0)return!1;const Le=!!((ae=$.heightCache)!=null&&ae.length)&&!wg(),Pe=!$.anchor||$.anchorCaptured===!1&&Y.allowUncapturedAnchor!==!0?null:$.anchor,qe=Y.restoreAnchor===!0&&!!Pe&&!wg()&&Number(Y9($))>0;let lt=!1;if((ce=$.heightCache)!=null&&ce.length&&FA($)){const tt=LA($.heightCache,{requireCompatibilityMetadata:!$.contentHash,requireSignature:Zj($)});tt.length&&(Qh(tt,{mode:"merge"}),Rt(),jc=J9(tt),Hc="restore",l1(),lt=!0)}if(Le||qe)return!1;if(!Y.restoreAnchor||!Pe)return lt&&Fi("restore"),!0;const Ue=(function(tt,rt){var je;const nt=tt.anchor,ut=nt?nt.type==="bottom"?`bottom:${Math.round(nt.distanceFromBottomPx)}`:`node:${nt.nodeIndex}:${Math.round(nt.offsetWithinNodePx)}`:"none";return[(je=Ns())!=null?je:"",Vi(),Ea(),kg.value,rt,ut].join(":")})($,(be=Y.restoreToken)!=null?be:"imperative");return Cg===Ue?(lt&&Fi("restore"),!0):(Cg=Ue,(function(tt){const rt=()=>{if(tt.type==="node")return ff(),void so({nodeIndex:tt.nodeIndex,offsetWithinNodePx:tt.offsetWithinNodePx});if(pt(),io.value=null,Gt.value=tt,TA(),G9(tt),Q)for(const je of[0,120,280,480])Q9.push(window.setTimeout(()=>{const nt=Gt.value;nt&&G9(nt)},je))};(function(je){if(!kn.value)return!1;const nt=Ft.value.length;return!(nt<=0||(Ia.value=je.type==="node"?vo(je.nodeIndex,0,nt-1):nt-1,Yh(),0))})(tt)?kt(rt):rt()})(Pe),Fi("restore"),!0)}function wg(){const $=Rc();return Number.isFinite($)&&$>0}function BA($){var Y;return $.sessionKey===Vi()&&!!R9($.threadKey)&&(Ft.value.length<=0||!(!((Y=$.heightCache)!=null&&Y.length)||wg())||!(!($.anchor&&Number(Y9($))>0)||wg()))}function e4(){st.clear();for(const $ of Object.keys(ws)){const Y=Number($);Number.isInteger(Y)&&Y>=0&&Y{let Y=!1,ae=null;const ce=()=>{Y||(Y=!0,ae!=null&&window.clearTimeout(ae),$())};if(Mi)return Mi(ce),void(ae=window.setTimeout(ce,50));ae=window.setTimeout(ce,0)})}function t4($,Y=Ns(),ae=Br.value){return Vi()===$&&Ns()===Y&&Br.value===ae}function n4(){return $i(this,arguments,function*($={}){var Y,ae,ce,be,Le;const Pe=Vi(),qe=Ns(),lt=Br.value,Ue=(Y=$.frames)!=null?Y:2,tt=(ae=$.timeoutMs)!=null?ae:120,rt=(ce=$.reason)!=null?ce:"manual",je=$.expectedSettledTokenKey,nt=$.flushPendingTimers===!0,ut=Oc(rt),at=()=>vn(xt({},ut),{phase:ut.final?"settling":ut.phase,stable:!1,confidence:ut.confidence==="final"?"mixed":ut.confidence,reason:rt}),Lt=()=>t4(Pe,qe,lt)&&(je==null||r1()===je);for(let rn=0;rnwindow.setTimeout(en,rn))})(tt),!Lt()||(nt&&fA(),Ta(),i1(),!Lt()))return at();const Ct=W9();Ct&&(H9=Pe,j9=qe,((be=i.virtualScroll)==null?void 0:be.settleMode)==="manual"&&je!=null&&bg((Le=i.virtualScroll)==null?void 0:Le.settledToken)&&r1()===je&&(cf=f1(i.virtualScroll.settledToken)));const Ot=Lt()&&Ct&&IA(),Ut=Oc(rt,Ot?"final":void 0);return l4(Ut,!0),Ut})}let i4="content",Wc=null,qc=null,s4=0,s1=null,pf=null,o4=null,r4=null;function o1(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function RA($){var Y,ae;const ce=s1;if(!ce)return!0;const be=(ae=(Y=i.virtualScroll)==null?void 0:Y.heightDiffThresholdPx)!=null?ae:1;return Math.abs($.totalHeight-ce.totalHeight)>be||$.sessionKey!==ce.sessionKey||$.phase!==ce.phase||$.stable!==ce.stable||$.final!==ce.final||$.threadKey!==ce.threadKey||$.nodeCount!==ce.nodeCount||$.measuredCount!==ce.measuredCount||$.width!==ce.width}function r1($=(Y=>(Y=i.virtualScroll)==null?void 0:Y.settledToken)()){return ro($)}function OA($,Y){var ae,ce;return[$,Y.sessionKey,(ae=Y.threadKey)!=null?ae:"",Ea(),Z9(),ro((ce=i.virtualScroll)==null?void 0:ce.settledToken),Math.round(Y.totalHeight),Math.round(Y.width)].join("\0")}function l1(){o4=null,r4=null,pf=null}function Gj($){const Y=$.heightCache;return Y?.length?J9(Y):""}function a1($){var Y,ae,ce;const be=$.metrics,Le=$.anchor?(Pe=$.anchor).type==="bottom"?`bottom:${Math.round(Pe.distanceFromBottomPx)}`:`node:${Pe.nodeIndex}:${Math.round(Pe.offsetWithinNodePx)}`:"none";var Pe;return[$.sessionKey,(Y=$.threadKey)!=null?Y:"",(ae=$.measurementKey)!=null?ae:Ea(),(ce=$.contentHash)!=null?ce:"",Gj($),Le,$.anchorCaptured?1:0,be.liveRange.start,be.liveRange.end,be.renderedCount,be.nodeCount,Math.round(be.totalHeight),Math.round(be.width),be.phase,be.stable?1:0].join("\0")}function l4($,Y=!1){if(!Sn.value||(function(Pe=!1){return!Pe&&Pn.value&&!As.value})(Y))return;const ae=Y||RA($),ce=(function(Pe,qe=!1){return qe||Pe.stable||Pe.phase==="final"?{state:df(Pe,{includeHeightCache:!0})}:{state:df(Pe)}})($,Y),be=ce.state,Le=!!(be&&(ae||(function(Pe,qe=!1){return!!qe||a1(Pe)!==pf})(be,Y)));if(ae&&(N($),s1=$,s4=o1()),be&&Le&&(O(be),be.anchor&&P(be.anchor),pf=a1(be)),$.stable){const Pe=OA("settled",$);if(Pe!==o4){o4=Pe;const qe=df($,{includeHeightCache:!0});qe&&(O(qe),pf=a1(qe)),(function(lt){s("render-settled",lt)})($)}}if($.phase==="final"){const Pe=OA("final",$);if(Pe!==r4){r4=Pe;const qe=df($,{includeHeightCache:!0});qe&&(O(qe),pf=a1(qe)),(function(lt){s("render-final",lt)})($)}}}function a4(){Wc!=null&&(wi?.(Wc),Wc=null),qc!=null&&Q&&(window.clearTimeout(qc),qc=null)}function PA(){Wc=null,qc=null,(function($){if(Ma.size>0||$r!=null)return!0;switch($){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(i4)&&(Ta(),i1()),l4(Oc(i4))}function Fi($){var Y,ae;if(!Sn.value||(i4=$,Wc!=null||qc!=null))return;const ce=Math.max(0,(ae=(Y=i.virtualScroll)==null?void 0:Y.emitIntervalMs)!=null?ae:32),be=Math.max(0,ce-(o1()-s4)),Le=()=>{qc=null,Wc=Mi?Mi(PA):null,Wc==null&&PA()};Q&&be>0?qc=window.setTimeout(Le,be):Le()}function jA(){Ye.value+=1}function xg($){if(mt.value&&$>=yt.value){const Y=Ft.value[$],ae=De.value===!0&&Be.value!==!0&&$>=Ft.value.length-2,ce=Y?.type==="code_block"||Y?.type==="image"||Y?.type==="mermaid"||Y?.type==="infographic";if(!ae||ce)return!1}return!Ql.value||$=Me.value&&(H.value||(H.value=!0,L9()),!rA.value||!Ts))return gf($),void(Y&&pu($,!0));if(${if(hA.delete(Le),!Ql.value||T9.value.has(Le))return;const lt=Hn.get(Le);if(!lt)return;const Ue=me(lt),tt=lt.ownerDocument||document,rt=tt.defaultView||window,je=!Ue||Ue===tt.documentElement||Ue===tt.body,nt=!je&&Ue?Je("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ue.getBoundingClientRect()):null,ut=je?0:nt.top,at=je?Je("nodeVisibilityFallback.clientHeight",()=>{var Ct,Ot;return(Ot=(Ct=rt.innerHeight)!=null?Ct:Ue?.clientHeight)!=null?Ot:0}):nt.bottom,Lt=Je("nodeVisibilityFallback.node.getBoundingClientRect",()=>lt.getBoundingClientRect());Lt.bottom>=ut-500&&Lt.top<=at+500&&pu(Le,!0)},1800+Pe);hA.set(Le,qe)})($);let be=null;be=Ve(()=>ce.isVisible.value,Le=>{if(Le){vg($),pu($,!0),be?.(),mg.delete($),rf.get($)===ce&&rf.delete($);try{ce.destroy()}catch{}}},{immediate:!0}),mg.set($,be),kn.value&&bl()}function u4(){$r=null,Xt(()=>{let $=!1;for(const[Y,ae]of Ma)Ma.delete(Y),Yl.get(Y)===ae.el&&zc.get(Y)===ae.version&&($=go(Y,ae.height,{allowShrink:ae.allowShrink})||$);return $})}function mf(){$r!=null&&(wi?.($r),$r=null),Ma.clear()}function _g($,Y){(function(ae,ce,be){var Le;if(!Number.isFinite(be)||be<=0||Yl.get(ae)!==ce)return;const Pe=zc.get(ae);if(Pe==null)return;const qe=Ft.value[ae],lt=vt.value&&Be.value!==!0&&!((Le=i.nodes)!=null&&Le.length)&&ae>=Ft.value.length-2,Ue=!(qe?.loading===!0||lt),tt=Ma.get(ae),rt=tt?tt.allowShrink&&Ue:Ue,je=tt&&!rt?Math.max(tt.height,be):be;Ma.set(ae,{height:je,allowShrink:rt,version:Pe,el:ce}),$r==null&&($r=Mi?Mi(u4):null,$r==null&&u4())})($,Y,Bc($,Y))}function Ta(){for(const[$,Y]of Yl)Y&&_g($,Y)}function HA(){no?.disconnect(),no=null,Zo.clear()}function c4(){for(;fg.length;)gg(fg.pop())}Ve(As,$=>{$&&Fi("content")},{flush:"post"}),t({getVirtualMetrics:Oc,captureVirtualState:function($={}){var Y;return df(Oc("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:$.allowFallbackAnchor===!0,requireViewport:$.requireViewport===!0,includeEmptyState:(Y=$.includeEmptyState)==null||Y})},restoreVirtualState:function($,Y={}){const ae=Y.restoreAnchor===!0,ce=Y.restoreToken==null?"imperative":String(Y.restoreToken);t1=$,n1={restoreAnchor:ae,restoreToken:ce,allowUncapturedAnchor:Y.allowUncapturedAnchor===!0},!X9($,{restoreAnchor:ae,restoreToken:ce,allowUncapturedAnchor:Y.allowUncapturedAnchor===!0})&&BA($)||(t1=null,n1=null)},forceMeasure:function($="manual"){return $i(this,null,function*(){yield kt(),yield zA(),Ta(),i1(),yield kt();const Y=Oc($);return l4(Y,!0),Y})},settle:n4,scrollToNode:function($,Y="start"){ff(),pt();const ae=Ft.value.length;if(ae<=0)return;const ce=vo($,0,ae-1),be=()=>{var Le;const Pe=gt({nodeIndex:ce,offsetWithinNodePx:0}),qe=zn(ce),lt=Xh(),Ue=(Le=lt?.clientHeight)!=null?Le:0,tt=$o();let rt=Pe;if(Y==="center")rt=Pe-Ue/2+qe/2;else if(Y==="end")rt=Pe-Ue+qe;else if(Y==="nearest"&&tt!=null){if(Pe>=tt&&Pe+qe<=tt+Ue)return;rt=PeKs.value,$=>{if(!$){HA();for(const Y of fu.values())for(const ae of Y)gg(ae);fu.clear(),zc.clear(),c4(),mf()}},{immediate:!0}),Ve(Be,$=>{$&&(function(){if(Q&&Be.value&&Yl.size){c4();for(const Y of[80,240,640]){const ae=dA(Y,()=>{for(const[ce,be]of Yl)be&&_g(ce,be)},"final");ae!=null&&fg.push(ae)}}})(),Fi($?"final":"content")});const Qj=cE(()=>Fi("content"),16),Yj=cE(()=>Fi("batch"),16);Ve([()=>Ft.value.length,()=>yt.value],()=>{Gt.value&&hf(),Qj()},{flush:"post",immediate:!0}),Ve([()=>mo.start,()=>mo.end],()=>{Yj()},{flush:"post"});const{cleanupBatchScheduler:Jj}=(function($){const{props:Y,isClient:ae,isTestEnv:ce,parsedNodesIdentity:be,parsedNodeCount:Le,desiredRenderedCount:Pe,datasetKey:qe,batchingEnabled:lt,incrementalRenderingActive:Ue,resolvedBatchSize:tt,resolvedInitialBatch:rt,renderedCount:je,adaptiveBatchSize:nt,previousRenderContext:ut,previousBatchConfig:at,requestFrame:Lt,cancelFrame:Ct,hasIdleCallback:Ot,cleanupNodeVisibility:Ut,onDatasetKeyChanged:rn,onDatasetChanged:en}=$;let ln=null,Ln="raf",Rn=null,bi=0,yo=!1,oo=!1;const Al=new Set,Xl=new Set;function v1(){if(ae){ln!=null&&(Ln==="raf"&&Ct?Ct(ln):Ln==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(ln):Ln==="timeout"&&window.clearTimeout(ln),ln=null),bi+=1;for(const Bo of Al)Ct&&Ct(Bo);for(const Bo of Xl)window.clearTimeout(Bo);Al.clear(),Xl.clear(),Rn=null,yo=!1,oo=!1}}function $g(){return typeof performance<"u"?performance.now():Date.now()}function rC(Bo){(function(La){var mu;if(!Ue.value)return;const Na=Math.max(2,(mu=Y.renderBatchBudgetMs)!=null?mu:6),Fa=Math.max(1,tt.value||1),Cl=Math.max(1,Math.floor(Fa/4));La>1.5*Na?nt.value=Math.max(Cl,Math.floor(.8*nt.value)):La<.6*Na&&nt.value=Na)return;const Fa=Math.max(1,Bo),Cl=()=>{const kf=$g();ln=null;const y1=Rn??Fa;Rn=null;const bf=$g();je.value=Math.min(Na,je.value+y1),Ut(je.value),(function(v4,Bg){if(!ae)return void rC(Bg);yo=!0;const cC=++bi;kt().then(()=>{var dC;if(cC!==bi)return;const kH=$g(),bH=Math.max(Bg,kH-v4),fC=()=>{cC===bi&&rC(bH)};if(Lt){let Kc=null,Af=null,pC=!1;const gC=()=>{pC||(pC=!0,Kc!==null&&(Al.delete(Kc),Kc=null),Af!==null&&(Xl.delete(Af),window.clearTimeout(Af),Af=null),fC())};return Kc=Lt(()=>{gC()}),Al.add(Kc),Af=window.setTimeout(()=>{Kc!==null&&Ct&&Ct(Kc),gC()},Math.max(32,(dC=Y.renderBatchIdleTimeoutMs)!=null?dC:120)),void Xl.add(Af)}const hC=window.setTimeout(()=>{Xl.delete(hC),fC()},0);Xl.add(hC)})})(kf,$g()-bf)};if(!ae||hr.immediate)return void Cl();const vu=Math.max(0,(La=Y.renderBatchDelay)!=null?La:16);if(Rn=Rn!=null?Math.max(Rn,Fa):Fa,ln==null){if(!ce&&Ot&&window.requestIdleCallback){const kf=Math.max(0,(mu=Y.renderBatchIdleTimeoutMs)!=null?mu:120);return Ln="idle",void(ln=window.requestIdleCallback(()=>Cl(),{timeout:kf}))}if(Lt&&!ce)return Ln="raf",void(ln=Lt(()=>{vu===0?Cl():(Ln="timeout",ln=window.setTimeout(()=>Cl(),vu))}));Ln="timeout",ln=window.setTimeout(()=>Cl(),vu)}}function aC(Bo,hr={}){yo?oo=!0:Bo==null?uC():lC(Bo,hr)}function uC(){Ue.value&&lC(lt.value?Math.max(1,Math.round(nt.value)):Math.max(1,tt.value))}return Ve([be,Le,qe,Ue,tt,rt,()=>Y.renderBatchDelay],()=>{var Bo;const hr=Le.value,La=ut.value,mu=qe.value,Na=!Object.is(mu,La.key),Fa=hr!==La.total,Cl=Na||Fa;ut.value={key:mu,total:hr};const vu=at.value,kf=(Bo=Y.renderBatchDelay)!=null?Bo:16,y1=vu.batchSize!==tt.value||vu.initial!==rt.value||vu.delay!==kf||vu.enabled!==Ue.value;at.value={batchSize:tt.value,initial:rt.value,delay:kf,enabled:Ue.value},Na&&rn(hr),(Cl||y1||!Ue.value)&&v1(),(Cl||y1)&&(nt.value=Math.max(1,tt.value||1)),Cl&&en();const bf=Pe.value;if(!hr)return je.value=0,void Ut(0);if(!Ue.value)return je.value=bf,void Ut(je.value);const v4=Na||La.total===0;je.value=v4||y1?Math.min(bf,rt.value):Math.min(je.value,bf);const Bg=Math.max(1,rt.value||tt.value||hr);je.value{Ue.value&&(typeof hr=="number"&&Bo<=hr||Bo>je.value&&aC())}),{cleanupBatchScheduler:v1}})({props:T,isClient:Q,isTestEnv:Ls,parsedNodesIdentity:Lo,parsedNodeCount:qs,desiredRenderedCount:hg,datasetKey:jj,batchingEnabled:He,incrementalRenderingActive:mt,resolvedBatchSize:dr,resolvedInitialBatch:Oe,renderedCount:yt,adaptiveBatchSize:Pi,previousRenderContext:hn,previousBatchConfig:ji,requestFrame:Mi,cancelFrame:wi,hasIdleCallback:Vo,cleanupNodeVisibility:$j,onDatasetKeyChanged:$=>{mf(),Zn(),Rt(),l1(),$>0&&$c($)},onDatasetChanged:()=>{kn.value&&bl({immediate:!0})}});Ve([lA,kn,()=>R.value,()=>J()],([$,Y])=>{if(!$)return pA(),void E9();Bj(),Y?bl({immediate:!0}):E9()},{flush:"post",immediate:!0}),Ve([()=>Ft.value.length,()=>kn.value],$=>$i(null,[$],function*([Y,ae]){ae&&Y&&Q&&(yield kt(),bl({immediate:!0}))}),{flush:"post"}),Ve(Ri,$=>{$&&(function(){var Y;if(es.value&&ts.value&&hs.value&&((Y=No.value)!=null&&Y[1]))return;const ae=St({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ce=St({type:"list_item",children:[ae],raw:"- Probe paragraph text"}),be=St({type:"list",ordered:!1,items:[ce],raw:"- Probe paragraph text"});es.value=ae,ts.value=ce,hs.value=be;const Le={1:null,2:null,3:null,4:null,5:null,6:null};for(let Pe=1;Pe<=6;Pe++)Le[Pe]=St({type:"heading",level:Pe,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Pe)} Probe heading`});No.value=Le})()},{immediate:!0}),Ve([()=>R.value,Ri],()=>{if(!Ri.value)return D9(),void(se.value=0);mA(),D9(),Ri.value&&R.value&&typeof ResizeObserver<"u"&&(Jh=new ResizeObserver(()=>{mA(),io.value&&Jt(),Gt.value&&hf(),Fi("resize")}),Jh.observe(R.value))},{immediate:!0}),Ve([Ri,po,Br],()=>$i(null,null,function*(){if(!Ri.value)return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Rt();yield kt(),(function(){if(!Ri.value||typeof window>"u")return te.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Rt();const $={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},Y=gA(F9(q.value),".paragraph-node");$.paragraph=ok(q.value,Y,"pre-wrap");const ae=F9(j.value),ce=ae?.querySelector(".paragraph-node");$.listItem=ok(j.value,ce,"pre-wrap");const be=Je("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Pe,qe;return(qe=(Pe=W.value)==null?void 0:Pe.offsetHeight)!=null?qe:0}),Le=Je("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Pe,qe;return(qe=(Pe=j.value)==null?void 0:Pe.offsetHeight)!=null?qe:0});$.listWrapperOverhead=Math.max(0,be-Le);for(let Pe=1;Pe<=6;Pe++){const qe=gA(F9(z[Pe]),`h${Pe}`);$.headings[Pe]=ok(z[Pe],qe,"pre-wrap")}te.value=$,Rt()})()}),{flush:"post",immediate:!0}),Ve(()=>Ft.value.length,()=>{kn.value&&bl({immediate:!0})}),Ve([Ri,se],()=>{Rt(),kn.value&&bl({immediate:!0}),io.value&&Jt(),Gt.value&&hf(),Fi("resize")},{immediate:!1}),Ve(()=>Ql.value,$=>{if($)for(const[Y,ae]of Hn)Sg(Y,ae);else if(L9(),kn.value)bl({immediate:!0});else for(const[Y,ae]of Hn)ae&&pu(Y,!0)},{immediate:!1}),Ve([fe,Me,()=>J()],()=>{var $;($=Ts.refresh)==null||$.call(Ts);for(const[Y,ae]of Hn)Sg(Y,ae)},{immediate:!1}),Ve([()=>T.viewportPriority,()=>Ft.value.length,Me],([$,Y,ae])=>{if($!==!1){if(H.value&&(Y<=200||Y<=ae)){H.value=!1;for(const[ce,be]of Hn)Sg(ce,be)}}else H.value=!1}),Ve(()=>yt.value,()=>{kn.value&&bl({immediate:!0})}),Ve([Ia,Do,di,()=>Ft.value.length,kn],()=>{Yh()},{immediate:!0});let u1=null,c1=!1,vf=null;function d1(){u1=null,H9=null,j9=void 0,cf=null,l1()}function d4(){mf(),Zn(),Rt(),st.clear();const $=Ft.value.length;$>0&&$c($),e4()}function f4(){a4(),fA(),s1=null,jc=null,Hc=null,Cg=null,t1=null,n1=null,c1=!1,d1(),SA("restore"),pt(),ff()}function f1($){var Y;return[(Y=Ns())!=null?Y:"",Vi(),Ea(),kg.value,r1($),Ft.value.length,Math.round(vi(0,Ft.value.length)),Math.round(Rc()),xs.count,Math.round(xs.total)].join(":")}function WA(){return $i(this,null,function*(){var $,Y,ae,ce;const be=($=i.virtualScroll)==null?void 0:$.settledToken,Le=r1(be),Pe=Vi(),qe=Ns(),lt=Br.value;if(Sn.value&&((Y=i.virtualScroll)==null?void 0:Y.settleMode)==="manual"&&bg(be))if(W9()){if(f1(be)!==cf&&!c1){c1=!0;try{const Ue=yield n4({reason:"manual",expectedSettledTokenKey:Le}),tt=r1()===Le;t4(Pe,qe,lt)&&Ue.sessionKey===Pe&&Ue.threadKey===qe&&tt&&Ue.stable&&Ue.phase==="final"&&(cf=f1((ae=i.virtualScroll)==null?void 0:ae.settledToken))}finally{c1=!1,yield kt();const Ue=(ce=i.virtualScroll)==null?void 0:ce.settledToken,tt=bg(Ue)?f1(Ue):"";t4(Pe,qe,lt)&&tt&&cf!==tt&&WA()}}}else Fi("manual")})}Ve(Sn,($,Y)=>{if($!==Y){if(!$)return f4(),void a4();f4(),d4(),vf=Br.value,Fi("content")}},{flush:"post"}),Ve([Sn,Br],([$,Y])=>{$?vf!=null?vf!==Y&&(vf=Y,(function(ae="resize"){mf(),Zn(),Rt(),st.clear();const ce=Ft.value.length;ce>0&&$c(ce),e4(),jc=null,Hc=null,Cg=null,s1=null,c1=!1,d1(),$A(),kt(()=>{Ta(),io.value&&Jt(),Gt.value&&hf(),Fi(ae)})})("resize")):vf=Y:vf=null},{flush:"post",immediate:!0}),Ve([Sn,()=>Vi(),()=>Ns()],([$])=>{$&&(f4(),d4(),SA("content"),Fi("content"))}),Ve([Sn,()=>Vi(),()=>Ns(),Br,()=>Ft.value.length],([$])=>{$&&(function(Y="async-node"){let ae=!1;for(const[ce,be]of Array.from(Jl.entries()))O9(be)||(Jl.delete(ce),Dr.delete(ce),ae=!0);ae&&(af(),Fi(Y))})("async-node")},{flush:"post"}),Ve([Sn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.sessionKey},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>i.indexKey,()=>U.value],([$])=>{$&&(l1(),(function(Y="content"){if(!Sn.value)return;const ae=[],ce=Ft.value.length,be=N9(ce);for(const Le of Array.from(st.keys())){if(Le>=ce){ae.push(Le);continue}if(Le=ce&&st.delete(Le);ae.length&&((function(Le,Pe={}){const qe=Array.from(Le,Number);$t(qe);let lt=0;if(Xt(()=>(lt=S9(qe,Pe),lt>0)),lt>0)(function(Ue){for(const tt of Ue)st.delete(tt)})(qe);else for(const Ue of qe)xe.delete(Ue)})(ae,{notify:!1}),Rt(),d1(),io.value&&Jt(),Gt.value&&hf(),Fi(Y))})("content"))},{flush:"post",immediate:!0}),Ve([Sn,()=>Ft.value.length,()=>Vi(),()=>Ns()],([$,Y,ae,ce],[be,Le,Pe,qe])=>{$&&be&&ae===Pe&&ce===qe&&Y!==Le&&d1()},{flush:"post"}),Ve([Sn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCache},()=>{var $;return($=i.virtualScroll)==null?void 0:$.heightCacheWidth},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ft.value.length,()=>Vi(),se],()=>{$A()},{flush:"post",immediate:!0}),Ve([Sn,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreAnchor},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey},()=>Ft.value.length,()=>Vi(),se],$=>$i(null,[$],function*([Y,ae]){if(!Y||!ae)return;yield kt();const ce=(function(){var be;const Le=(be=i.virtualScroll)==null?void 0:be.restoreAnchor;return Le==null||Le===!1?null:Le===!0?"true":String(Le)})();X9(ae,{restoreAnchor:ce!=null,restoreToken:ce??void 0})}),{flush:"post",immediate:!0}),Ve([Sn,se,()=>{var $;return($=i.virtualScroll)==null?void 0:$.restoreState},()=>{var $;return($=i.virtualScroll)==null?void 0:$.measurementKey}],([$])=>{var Y;if(!$)return;const ae=(Y=i.virtualScroll)==null?void 0:Y.restoreState;ae&&jc&&Hc==="restore"&&(FA(ae)||(d4(),jc=null,Hc=null,Fi("resize")))},{flush:"post"}),Ve([Sn,()=>Ft.value.length,()=>Vi(),se],$=>$i(null,[$],function*([Y]){var ae;const ce=t1,be=n1;Y&&ce&&(yield kt(),!X9(ce,{restoreAnchor:be?.restoreAnchor===!0,restoreToken:(ae=be?.restoreToken)!=null?ae:"imperative",allowUncapturedAnchor:be?.allowUncapturedAnchor===!0})&&BA(ce)||(t1=null,n1=null))}),{flush:"post",immediate:!0}),Ve([Sn,Be,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>Vi(),()=>Ns(),Br,M9,uA,()=>yt.value,hg,()=>xs.count,()=>xs.total],([$,Y,ae])=>{if(!$||Y!==!0||ae==="manual"||!q9())return;const ce=(function(){var be;const Le=Ft.value.length;return[(be=Ns())!=null?be:"",Vi(),Ea(),kg.value,Le,Math.round(vi(0,Le)),Math.round(Rc()),xs.count,Math.round(xs.total)].join(":")})();u1!==ce&&(u1=ce,n4({reason:"final"}).then(be=>{be.stable||u1!==ce||(u1=null)}))},{flush:"post",immediate:!0}),Ve([Sn,Be,()=>{var $;return($=i.virtualScroll)==null?void 0:$.settleMode},()=>{var $;return($=i.virtualScroll)==null?void 0:$.settledToken},()=>Vi(),()=>Ns(),Br,M9,uA,()=>yt.value,hg,()=>Ft.value.length,()=>xs.count,()=>xs.total],()=>{WA()},{flush:"post",immediate:!0}),Ve([()=>Ft.value.length,kn,Do,di,()=>mo.start,()=>mo.end],([$,Y,ae,ce,be,Le])=>{Ce.value&&Cn("virtualization",{nodes:$,virtualization:Y,maxLiveNodes:ae,buffer:ce,focusIndex:Ia.value,scroll:Y?(()=>{const Pe=ht.value||me();return Pe?{reverse:Ee(Pe),scrollTop:Math.round(Pe.scrollTop),scrollTopAbs:Math.round(Math.abs(Pe.scrollTop)),scrollHeight:Math.round(Pe.scrollHeight),clientHeight:Math.round(Pe.clientHeight)}:null})():null,liveRange:{start:be,end:Le},rendered:yt.value})}),Ve([()=>T.customId],([$],Y,ae)=>{if(!$||Fo)return;const ce=(function(be,Le){return be?(Gs.controllers[be]=Le,()=>{Gs.controllers[be]===Le&&delete Gs.controllers[be]}):()=>{}})($,{captureRestoreAnchor:Ki,restoreAnchor:so,getAnchorDrift:kl,getReport:Oj});ae(()=>{ce()})},{immediate:!0}),Jn(()=>{(function(){if(Sn.value)try{Ta(),i1();const $=Oc("manual");RA($)&&(N($),s1=$,s4=o1());const Y=df($,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});Y&&(O(Y),Y.anchor&&P(Y.anchor),pf=a1(Y))}catch{}})(),Jj(),L9(),fn(),HA();for(const $ of fu.values())for(const Y of $)gg(Y);fu.clear(),zc.clear(),st.clear(),c4(),mf(),D9(),pt(),ff(),a4(),pA(),E9()});const Xj=op("ViewportDeferredMermaidBlockNode",Fl({loader:()=>$i(null,null,function*(){try{return(yield ys(()=>import("./index11-BnTR7kQo.js"),__vite__mapDeps([9,7]))).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',$),br}}),loadingComponent:xE,delay:0}),xE),eH=op("ViewportDeferredInfographicBlockNode",Fl({loader:()=>$i(null,null,function*(){try{return(yield ys(()=>import("./index10-D6em_7oU.js"),[])).default}catch($){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',$),br}}),loadingComponent:wE,delay:0}),wE),tH=op("ViewportDeferredD2BlockNode",Fl(()=>$i(null,null,function*(){try{return(yield ys(()=>import("./index8-Cvw_4o5s.js"),[])).default}catch($){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',$),br}})),br),qA={text:bs,paragraph:Nd,heading:h9,code_block:G3,list:Ah,list_item:bh,blockquote:p2,table:Dp,definition_list:g2,footnote:m2,footnote_reference:qr,footnote_anchor:Np,admonition:b2,vmr_container:y2,hardbreak:ec,link:ar,image:Xu,thematic_break:v2,math_inline:Zl,math_block:gO,strong:rr,emphasis:ur,strikethrough:lr,highlight:Kr,insert:Ir,subscript:_r,superscript:Sr,emoji:xr,checkbox:Wr,checkbox_input:Wr,inline_code:qo,html_inline:Ur,reference:or,html_block:Fp},nH=L(()=>z9()),UA=L(()=>aE(T.codeBlockProps)),iH=L(()=>aE(T.codeBlockProps,{omit:["langs"]})),KA=L(()=>xt(xt({stream:T.codeBlockStream,darkTheme:T.codeBlockDarkTheme,lightTheme:T.codeBlockLightTheme,monacoOptions:T.codeBlockMonacoOptions,themes:T.themes,langs:g.value==="shiki"?T.langs:void 0,minWidth:T.codeBlockMinWidth,maxWidth:T.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),iH.value)),VA=L(()=>xt(vn(xt({},KA.value),{langs:T.langs}),UA.value));function ZA($){return typeof $=="boolean"?$:void 0}const sH=L(()=>{const $=T.codeBlockProps||{},Y={},ae=ZA($.showLineNumbers);ae!==void 0&&(Y.showLineNumbers=ae);const ce=ZA($.diffInline);ce!==void 0&&(Y.diffInline=ce);const be=(function(Le){const Pe=Number(Le);return Number.isFinite(Pe)&&Pe>0?Pe:void 0})($.reservedHeightPx);return be!==void 0&&(Y.reservedHeightPx=be),Y}),oH=L(()=>xt(xt({stream:T.codeBlockStream,darkTheme:T.codeBlockDarkTheme,lightTheme:T.codeBlockLightTheme,themes:T.themes,langs:T.langs,minWidth:T.codeBlockMinWidth,maxWidth:T.codeBlockMaxWidth},typeof le.value=="boolean"?{showTooltips:le.value}:{}),UA.value)),rH=L(()=>xt({},T.mermaidProps||{})),GA=L(()=>xt({},T.d2Props||{})),lH=L(()=>xt({},T.infographicProps||{})),h1=L(()=>({typewriter:f.value,fade:T.fade,customHtmlTags:fs.value.customHtmlTags})),aH=L(()=>xt(xt({},h1.value),typeof le.value=="boolean"?{showTooltip:le.value}:{})),uH=L(()=>xt(xt({},h1.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),cH=L(()=>xt(xt({},h1.value),typeof le.value=="boolean"?{showTooltips:le.value}:{})),dH=L(()=>xt(xt({},h1.value),typeof le.value=="boolean"?{showTooltips:le.value}:{}));function fH($){return Array.isArray($.children)&&$.children.length>0}const Ig=L(()=>Rj.value.map($=>{var Y,ae,ce,be,Le,Pe,qe,lt;let Ue=(function(Ct){var Ot,Ut,rn,en,ln,Ln,Rn;if(Ct.type!=="code_block")return Ct;const bi=Ct,yo=[String((Ot=bi.language)!=null?Ot:""),String((Ut=bi.loading)!=null?Ut:""),String((rn=bi.diff)!=null?rn:""),String((en=bi.code)!=null?en:""),String((ln=bi.originalCode)!=null?ln:""),String((Ln=bi.updatedCode)!=null?Ln:""),String((Rn=bi.raw)!=null?Rn:"")].join("\0"),oo=yl.get(bi);if(oo&&oo.signature===yo)return oo.node;const Al=xt({},bi);return yl.set(bi,{signature:yo,node:Al}),Al})($.node);const tt=Mg(Ue);let rt=XA(Ue,tt);if((Ue.type==="html_block"||Ue.type==="html_inline")&&rt===qA[Ue.type]){const Ct=Ue,Ot=String((Y=Ct.tag)!=null?Y:"").trim().toLowerCase()||Oz(Ct.content);if(Ot){const Ut=Xn.value[Ot];if(mi.value.has(Ot)&&Ut)rt=Ut,Ue=vn(xt({},Ct),{type:Ot,tag:Ot,content:Q7e(Ct.content,Ot)});else if(Pz((ae=Ct.content)!=null?ae:Ct.raw,Ot)){const rn=String((be=(ce=Ct.content)!=null?ce:Ct.raw)!=null?be:"");Ue.type==="html_inline"?(rt=bs,Ue={type:"text",content:rn,raw:rn}):(rt=Nd,Ue={type:"paragraph",children:[{type:"text",content:rn,raw:rn}],raw:rn})}}}const je=Ue.type==="code_block"&&g.value==="pre"&&rt===br&&!h4(Xn.value,tt);let nt=xt({},(function(Ct,Ot,Ut){const rn=Ot??Mg(Ct);if(Ct.type==="code_block"){const en=rn?h4(Xn.value,rn):void 0;if(Ut&&g.value==="pre"&&!en&&Ut===br)return sH.value;if(Ut&&rn&&Ut===en)return rn==="mermaid"?YA(Ct):rn==="infographic"?JA(Ct):rn==="d2"||rn==="d2lang"?GA.value:VA.value;if(Ut&&Ut===Xn.value.code_block)return VA.value;if(yA(Ut))return oH.value}return rn==="mermaid"?YA(Ct):rn==="infographic"?JA(Ct):rn==="d2"||rn==="d2lang"?GA.value:Ct.type==="link"?aH.value:Ct.type==="list"?uH.value:Ct.type==="blockquote"?cH.value:Ct.type==="table"?dH.value:Ct.type==="code_block"?KA.value:h1.value})(Ue,tt,rt));const ut=Ri.value?lf.value[$.index]:null;Ue.type==="code_block"&&ut?.kind==="code-block"&&(nt=vn(xt({},nt),je?{reservedHeightPx:(Le=ut.height)!=null?Le:ut.contentHeight}:{estimatedHeightPx:ut.height,estimatedContentHeightPx:ut.contentHeight,estimatedDiffInline:ut.diffInline})),je||Ue.type!=="code_block"||tt!=="mermaid"||Xf(nt.estimatedPreviewHeightPx)!=null||(nt=vn(xt({},nt),{estimatedPreviewHeightPx:Wv(jv(String((Pe=Ue.code)!=null?Pe:"")))})),je||Ue.type!=="code_block"||tt!=="infographic"||Xf(nt.estimatedPreviewHeightPx)!=null||(nt=vn(xt({},nt),{estimatedPreviewHeightPx:qv(Hv(String((qe=Ue.code)!=null?qe:"")))})),Ue.type==="math_block"&&(nt=vn(xt({},nt),{cacheScope:Dn}));const at=(function(Ct,Ot){const Ut=String(Ct.type);return!X0(Ut)&&Xn.value[Ut]===Ot})(Ue,rt),Lt=at?g7(Ue,oe.value):void 0;return vn(xt({},$),{node:Ue,component:rt,bindings:nt,customBindings:xt(xt({},Lt??{}),nt),rendersCustomNode:at,hasSlotChildren:fH(Ue),slotContent:String((lt=Ue.content)!=null?lt:""),isCodeBlock:Ue.type==="code_block",indexKey:`${nH.value}-${$.index}`,vnodeKey:`${Pj.value}\0${$.index}\0${Ue.type}`})}));function Mg($){var Y;return $?.type==="code_block"?String((Y=$.language)!=null?Y:"").trim().toLowerCase():""}function h4($,Y){const ae=Y.trim().toLowerCase();if(ae)for(const ce of[ae,c9(ae),QR(ae)]){const be=ce&&$[ce];if(be)return be}}function QA($,Y,ae,ce){var be,Le;const Pe=xt({},$.value);return Xf(Pe.estimatedPreviewHeightPx)==null&&(Pe.estimatedPreviewHeightPx=ce(ae(String((be=Y?.code)!=null?be:"")),void 0,Pe.maxHeight==="none"?null:(Le=Xf(Pe.maxHeight))!=null?Le:void 0)),Pe}function YA($){return QA(rH,$,jv,Wv)}function JA($){return QA(lH,$,Hv,qv)}function XA($,Y){if(!$)return M8;const ae=Xn.value,ce=ae[String($.type)];if($.type==="code_block"){const be=Y??Mg($),Le=be?h4(ae,be):void 0;return Le||(g.value==="pre"?ae.code_block||br:be==="mermaid"?ae.mermaid||Xj:be==="infographic"?ae.infographic||eH:be==="d2"||be==="d2lang"?ae.d2||tH:ce||ae.code_block||kA.value)}return ce||qA[String($.type)]||M8}function p4($){s("click",$)}function hH($){var Y;(Y=$.target)!=null&&Y.closest("[data-node-index]")&&s("mouseover",$)}function pH($){var Y;(Y=$.target)!=null&&Y.closest("[data-node-index]")&&s("mouseout",$)}function eC($){s("mouseover",$)}function tC($){s("mouseout",$)}const Uc=Z(null),fr=Z(!1),p1=Z(null),gH=L(()=>!(T.domMode!=="minimal"||re.value||T.fade!==!1||f.value||fr.value||qi.value||kn.value||on.value||Us.value||Fr.value||Object.keys(Xn.value).length!==0));let g1,yf=null,g4=0,Eg=0,Tg=0;const nC=["code_block","admonition","table","math_block","html_block","image","thematic_break"],mH=new Set(nC),iC=[".typewriter-cursor",".height-estimation-probes",...nC.map($=>`[data-node-type="${$}"]`),"script","style"].join(",");function sC($){if(!$||typeof $!="object")return!1;const Y=$.type;return typeof Y=="string"&&mH.has(Y)}function Lg($){var Y,ae;if(!$||typeof $!="object")return 0;const ce=$,be=(ae=(Y=ce.raw)!=null?Y:ce.content)!=null?ae:ce.code;if(typeof be=="string")return be.length;const Le=ce.children;if(Array.isArray(Le))return Le.reduce((qe,lt)=>qe+Lg(lt),0);const Pe=ce.items;return Array.isArray(Pe)?Pe.reduce((qe,lt)=>qe+Lg(lt),0):0}function Ng(){g1&&(clearTimeout(g1),g1=void 0)}function m4(){g4+=1,yf!=null&&(wi?.(yf),yf=null)}function m1(){m4(),gu(),Uc.value&&(Uc.value.style.visibility="hidden")}function vH($){var Y;if($.nodeType!==Node.TEXT_NODE||!((Y=$.textContent)!=null?Y:"").trim())return!1;const ae=$.parentElement;return!!ae&&!ae.closest(iC)}function yH($){let Y=$.lastChild;for(;Y;){if(vH(Y))return Y;if(Y.nodeType===Node.ELEMENT_NODE){const ae=Y;if(!ae.matches(iC)&&ae.lastChild){Y=ae.lastChild;continue}}for(;Y&&Y!==$&&!Y.previousSibling;)Y=Y.parentNode;if(!Y||Y===$)break;Y=Y.previousSibling}return null}function oC(){const $=Ig.value;for(let Y=$.length-1;Y>=0;Y--){const ae=$[Y];if(!ae||sC(ae.node)||!xg(ae.index))continue;const ce=Hn.get(ae.index);if(!ce)continue;const be=yH(ce);if(be)return be}return null}function gu(){p1.value&&(p1.value.classList.remove(SE),p1.value=null)}function Fg(){if(d.value!=="simple"||!Q||!fr.value||!R.value)return void gu();const $=oC(),Y=$?(function(ae){var ce;const be=(ce=ae.parentElement)==null?void 0:ce.closest(".text-node");return be instanceof HTMLElement?be:ae.parentElement})($):null;Y!==p1.value&&(gu(),Y&&(Y.classList.add(SE),p1.value=Y))}function Dg(){if(d.value!=="precise"||!Q||!fr.value||yf!=null)return;const $=g4,Y=()=>{yf=null,$===g4&&(function(){var ae,ce;if(d.value!=="precise"||!(Q&&fr.value&&R.value&&Uc.value))return;const be=R.value,Le=Uc.value;Le.style.visibility="hidden";const Pe=oC();if(!Pe)return;let qe=0,lt=0,Ue=20,tt=!1;if(Pe?.textContent){const rt=Pe.textContent.length,je=document.createRange();je.setStart(Pe,Math.max(0,rt-1)),je.setEnd(Pe,rt);const nt=typeof je.getClientRects=="function"?je.getClientRects():void 0,ut=(ce=nt?.[nt.length-1])!=null?ce:(ae=Pe.parentElement)==null?void 0:ae.getBoundingClientRect();if(ut){const at=Je("typewriterCursor.root.getBoundingClientRect",()=>be.getBoundingClientRect());qe=ut.right-at.left+be.scrollLeft,lt=ut.top-at.top+be.scrollTop,Ue=ut.height||Ue,tt=!0}je.detach()}tt&&(Le.style.transform=`translate(${Math.max(0,qe)}px, ${Math.max(0,lt)}px)`,Le.style.height=`${Ue}px`,Le.style.visibility="visible")})()};Mi?yf=Mi(Y):Y()}return Ve([it,()=>i.content,()=>i.nodes,()=>T.typewriter,Be],()=>$i(null,null,function*(){var $,Y;if(!Q||re.value||!ie.value)return;if(Be.value)return fr.value=!1,Ng(),void m1();if(($=i.nodes)!=null&&$.length)return fr.value=!1,Ng(),m1(),Eg=((Y=i.content)!=null?Y:"").length,void(Tg=it.value.length);const ae=(function(){var qe,lt;return(qe=i.nodes)!=null&&qe.length?i.nodes.reduce((Ue,tt)=>Ue+Lg(tt),0):((lt=i.content)!=null?lt:"").length})(),ce=(function(){var qe;return(qe=i.nodes)!=null&&qe.length?i.nodes.reduce((lt,Ue)=>lt+Lg(Ue),0):it.value.length})(),be=!sC(Ft.value[Ft.value.length-1]),Le=ae>Eg,Pe=ce>Tg;if(!f.value||!be||!Le&&!Pe)return f.value&&be||(fr.value=!1,m1()),Eg=ae,void(Tg=ce);Eg=ae,Tg=ce,fr.value=!0,d.value==="precise"&&Uc.value&&(Uc.value.style.visibility="hidden"),Ng(),yield kt(),d.value==="simple"?Fg():(gu(),Dg()),g1=setTimeout(()=>{g1=void 0,fr.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(fr,$=>$i(null,null,function*(){$?(yield kt(),d.value!=="simple"?(gu(),d.value==="precise"&&Dg()):Fg()):m1()}),{flush:"post"}),Ve(d,()=>$i(null,null,function*(){if(Q&&!re.value&&ie.value&&fr.value){if(yield kt(),d.value==="simple")return m4(),void Fg();gu(),d.value!=="precise"?m1():Dg()}}),{flush:"post"}),Ve([()=>yt.value,()=>mo.start,()=>mo.end],()=>$i(null,null,function*(){Q&&!re.value&&ie.value&&fr.value&&(yield kt(),d.value!=="simple"?(gu(),d.value==="precise"&&Dg()):Fg())}),{flush:"post"}),Jn(()=>{Ng(),m4(),gu(),Tt.clear()}),($,Y)=>{const ae=HL("NodeRenderer",!0);return p(re)?(k(!0),M(Te,{key:0},dt(Ig.value,ce=>(k(),M(Te,{key:ce.vnodeKey},[ce.rendersCustomNode?(k(),de(Ys(ce.component),ni({key:0,ref_for:!0},ce.customBindings,{node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey,"custom-id":T.customId,"is-dark":T.isDark,onClick:p4,onMouseover:eC,onMouseout:tC,onCopy:Y[0]||(Y[0]=be=>o(be)),onHandleArtifactClick:Y[1]||(Y[1]=be=>s("handleArtifactClick",be))}),{default:he(()=>[ce.hasSlotChildren?(k(),de(ae,ni({key:0,ref_for:!0},Wn.value,{nodes:ce.node.children,"index-key":ce.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ce.slotContent?(k(),de(ae,ni({key:1,ref_for:!0},Wn.value,{content:ce.slotContent,final:!ce.node.loading,"index-key":`${ce.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Ys(ce.component),ni({key:1,node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey},{ref_for:!0},ce.bindings,{"custom-id":T.customId,"is-dark":T.isDark,onClick:p4,onMouseover:eC,onMouseout:tC,onCopy:Y[2]||(Y[2]=be=>o(be)),onHandleArtifactClick:Y[3]||(Y[3]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),M("div",{key:1,ref_key:"containerRef",ref:R,class:Fe(["markstream-vue markdown-renderer",[{dark:T.isDark},{virtualized:kn.value},{"virtual-scroll-coordinated":As.value},{"stable-layout":Lj.value},{"typewriter-simple-cursor":fr.value&&d.value==="simple"}]]),"data-custom-id":T.customId,onClick:p4,onMouseover:hH,onMouseout:pH},[Li.value||kn.value?(k(),M(Te,{key:0},[Li.value?(k(),de(nTe,{key:0,width:po.value,"flow-root":kn.value||As.value,"paragraph-node":es.value,"list-item-node":ts.value,"list-node":hs.value,"heading-nodes":No.value,"set-paragraph-wrapper":Nj,"set-list-item-wrapper":Fj,"set-list-wrapper":Dj,"set-heading-wrapper":zj},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ee("",!0),kn.value?(k(),M("div",{key:1,class:"node-spacer",style:qt({height:`${$9.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],64)):ee("",!0),gH.value?(k(!0),M(Te,{key:1},dt(Ig.value,ce=>(k(),M(Te,{key:ce.vnodeKey},[xg(ce.index)?(k(),de(Ys(ce.component),ni({key:0,node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey},{ref_for:!0},ce.bindings,{"custom-id":T.customId,"is-dark":T.isDark,onMouseover:Y[4]||(Y[4]=be=>s("mouseover",be)),onMouseout:Y[5]||(Y[5]=be=>s("mouseout",be)),onCopy:Y[6]||(Y[6]=be=>o(be)),onHandleArtifactClick:Y[7]||(Y[7]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ee("",!0)],64))),128)):(k(!0),M(Te,{key:2},dt(Ig.value,ce=>(k(),M("div",{key:ce.vnodeKey,ref_for:!0,ref:be=>Sg(ce.index,be),class:"node-slot","data-node-index":ce.index,"data-node-type":ce.node.type},[xg(ce.index)?(k(),M("div",{key:0,ref_for:!0,ref:be=>(function(Le,Pe){var qe;Pe||(function(rt){const je=`${z9()}-${rt}`;let nt=!1;for(const ut of Array.from(Dr.keys())){const at=Jl.get(ut);(at?.index===rt||ut===je||ut.startsWith(`${je}-`))&&(Dr.delete(ut),Jl.delete(ut),nt=!0)}nt&&(af(),Fi("async-node"))})(Le),Ma.delete(Le),(function(rt){var je;const nt=((je=zc.get(rt))!=null?je:0)+1;zc.set(rt,nt)})(Le);const lt=fu.get(Le);if(lt){for(const rt of lt)gg(rt);fu.delete(Le)}if((function(rt){const je=Zo.get(rt);je&&(no?.unobserve(je),Go.delete(je),Zo.delete(rt))})(Le),!Pe||!Ks.value)return Yl.delete(Le),void zc.delete(Le);Yl.set(Le,Pe);const Ue=()=>{_g(Le,Pe)};queueMicrotask(Ue);const tt=(no||typeof ResizeObserver>"u"||(no=new ResizeObserver(rt=>{if(rt.length)for(const je of rt){const nt=Go.get(je.target),ut=Zo.get(nt??-1);nt!=null&&ut&&_g(nt,ut)}else Ta()})),no);if(tt&&(Zo.set(Le,Pe),Go.set(Pe,Le),tt.observe(Pe)),typeof window<"u"){const rt=((qe=Ft.value[Le])==null?void 0:qe.type)==="code_block"?[16,80,240,800]:Be.value?[80]:[];if(rt.length){const je=rt.map(nt=>dA(nt,Ue,"node-resize")).filter(nt=>nt!=null);je.length&&fu.set(Le,je)}}})(ce.index,be),class:"node-content"},[ce.isCodeBlock?ce.rendersCustomNode?(k(),de(Ys(ce.component),ni({key:1,ref_for:!0},ce.customBindings,{node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey,"custom-id":T.customId,"is-dark":T.isDark,onCopy:Y[12]||(Y[12]=be=>o(be)),onHandleArtifactClick:Y[13]||(Y[13]=be=>s("handleArtifactClick",be))}),{default:he(()=>[ce.hasSlotChildren?(k(),de(ae,ni({key:0,ref_for:!0},Wn.value,{nodes:ce.node.children,"index-key":ce.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ce.slotContent?(k(),de(ae,ni({key:1,ref_for:!0},Wn.value,{content:ce.slotContent,final:!ce.node.loading,"index-key":`${ce.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Ys(ce.component),ni({key:2,node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey},{ref_for:!0},ce.bindings,{"custom-id":T.customId,"is-dark":T.isDark,onCopy:Y[14]||(Y[14]=be=>o(be)),onHandleArtifactClick:Y[15]||(Y[15]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),de(ls,{key:0,name:"fade",css:T.fade!==!1,appear:T.fade!==!1},{default:he(()=>[ce.rendersCustomNode?(k(),de(Ys(ce.component),ni({key:0,ref_for:!0},ce.customBindings,{node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey,"custom-id":T.customId,"is-dark":T.isDark,onCopy:Y[8]||(Y[8]=be=>o(be)),onHandleArtifactClick:Y[9]||(Y[9]=be=>s("handleArtifactClick",be))}),{default:he(()=>[ce.hasSlotChildren?(k(),de(ae,ni({key:0,ref_for:!0},Wn.value,{nodes:ce.node.children,"index-key":ce.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ce.slotContent?(k(),de(ae,ni({key:1,ref_for:!0},Wn.value,{content:ce.slotContent,final:!ce.node.loading,"index-key":`${ce.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ee("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),de(Ys(ce.component),ni({key:1,node:ce.node,loading:ce.node.loading,"index-key":ce.indexKey},{ref_for:!0},ce.bindings,{"custom-id":T.customId,"is-dark":T.isDark,onCopy:Y[10]||(Y[10]=be=>o(be)),onHandleArtifactClick:Y[11]||(Y[11]=be=>s("handleArtifactClick",be))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),M("div",{key:1,class:"node-placeholder",style:qt({height:`${zn(ce.index)}px`})},null,4))],8,oTe))),128)),fr.value&&d.value==="precise"?(k(),M("span",{key:3,ref_key:"typewriterCursorRef",ref:Uc,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ee("",!0),kn.value?(k(),M("div",{key:4,class:"node-spacer",style:qt({height:`${B9.value}px`}),"aria-hidden":"true"},null,4)):ee("",!0)],42,sTe))}}})),[["__scopeId","data-v-a9489508"]]),Mr=EO;Mr.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Mr.__name,Mr.name].filter(n=>!!n));for(const n of t)e.component(n,EO)};const E7=Object.freeze(Object.defineProperty({__proto__:null,default:Mr},Symbol.toStringTag,{value:"Module"})),rTe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},lTe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},aTe={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},uTe={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},cTe={class:"admonition-title"},dTe=["aria-expanded","aria-controls"],fTe=["id"],b2=gi(et({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,s=t,o=L(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=Z(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),M("div",{class:Fe(["admonition",[`admonition-${i.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),M("svg",rTe,[...c[1]||(c[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),M("svg",lTe,[...c[2]||(c[2]=[w("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),M("svg",aTe,[...c[3]||(c[3]=[w("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),M("svg",uTe,[...c[4]||(c[4]=[w("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):ee("",!0),w("span",cTe,F(o.value),1),i.node.collapsible?(k(),M("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),M("svg",{style:qt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,dTe)):ee("",!0)]),On(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[K(p(Mr),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,fTe),[[rs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);b2.install=e=>{e.component(b2.__name,b2)};const F8=()=>ys(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Lm=null,Nm=F8,Fm=null,_E=!1,IE=!1;function Aat(){return $i(this,null,function*(){if(Lm)return Lm;const e=Nm;return e?e===F8&&_E?null:Fm||(Fm=$i(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===F8)return e===Nm&&(_E=!0,(function(i){IE||(IE=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===Nm&&(Fm=null)}return e!==Nm?null:t?(Lm=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(i=n.default)!=null?i:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),Lm):null}),Fm):null})}let Dm=null,TO=null,$m=null;function Cat(){return typeof TO=="function"}function wat(){return $i(this,null,function*(){if(Dm)return Dm;const e=TO;return e?$m||($m=$i(null,null,function*(){const t=yield e(),n=(function(i){var s,o,r;if(!i)return null;const l=(s=i.default)!=null?s:i,a=typeof l=="function"&&typeof((o=l.prototype)==null?void 0:o.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(Dm=n,Dm):null}).finally(()=>{$m=null}),$m):null})}const xat=Symbol("markstreamLanguageIconResolver"),ME=document.createElement("i");function hTe(e){const t="&"+e+";";ME.innerHTML=t;const n=ME.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wa(e,t,n,i){const s=e.length;let o=0,r;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);o0?(wa(e,e.length,0,t),e):t}const EE={}.hasOwnProperty;function pTe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function Bi(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let o=0;return r;function r(a){return hi(a)?(e.enter(n),l(a)):t(a)}function l(a){return hi(a)&&o++r))return;const _=t.events.length;let S=_,E,D;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(E){D=t.events[S][1].end;break}E=!0}for(A(i),I=_;IC;){const x=n[v];t.containerState=x[1],x[0].exit.call(t,e)}n.length=C}function b(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function _Te(e,t,n){return Bi(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function LE(e){if(e===null||Er(e)||ATe(e))return 1;if(bTe(e))return 2}function L7(e,t,n){const i=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};NE(d,-a),NE(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=cl(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=cl(u,[["enter",s,t],["enter",r,t],["exit",r,t],["enter",o,t]]),u=cl(u,L7(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=cl(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=cl(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,wa(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&hi(I)?Bi(e,b,"linePrefix",o+1)(I):b(I)}function b(I){return I===null||Mn(I)?e.check(FE,m,v)(I):(e.enter("codeFlowValue"),C(I))}function C(I){return I===null||Mn(I)?(e.exit("codeFlowValue"),b(I)):(e.consume(I),C)}function v(I){return e.exit("codeFenced"),t(I)}function x(I,_,S){let E=0;return D;function D(P){return I.enter("lineEnding"),I.consume(P),I.exit("lineEnding"),B}function B(P){return I.enter("codeFencedFence"),hi(P)?Bi(I,T,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):T(P)}function T(P){return P===l?(I.enter("codeFencedFenceSequence"),N(P)):S(P)}function N(P){return P===l?(E++,I.consume(P),N):E>=r?(I.exit("codeFencedFenceSequence"),hi(P)?Bi(I,O,"whitespace")(P):O(P)):S(P)}function O(P){return P===null||Mn(P)?(I.exit("codeFencedFence"),_(P)):S(P)}}}function RTe(e,t,n){const i=this;return s;function s(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o)}function o(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const rk={name:"codeIndented",tokenize:PTe},OTe={partial:!0,tokenize:jTe};function PTe(e,t,n){const i=this;return s;function s(u){return e.enter("codeIndented"),Bi(e,o,"linePrefix",5)(u)}function o(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Mn(u)?e.attempt(OTe,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Mn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function jTe(e,t,n){const i=this;return s;function s(r){return i.parser.lazy[i.now().line]?n(r):Mn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):Bi(e,o,"linePrefix",5)(r)}function o(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Mn(r)?s(r):n(r)}}const HTe={name:"codeText",previous:qTe,resolve:WTe,tokenize:UTe};function WTe(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&F1(this.left,i),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),F1(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),F1(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function $O(e,t,n,i,s,o,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(A){return A===60?(e.enter(i),e.enter(s),e.enter(o),e.consume(A),e.exit(o),f):A===null||A===32||A===41||D8(A)?n(A):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(A))}function f(A){return A===62?(e.enter(o),e.consume(A),e.exit(o),e.exit(s),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===62?(e.exit("chunkString"),e.exit(l),f(A)):A===null||A===60||Mn(A)?n(A):(e.consume(A),A===92?g:h)}function g(A){return A===60||A===62||A===92?(e.consume(A),h):h(A)}function m(A){return!c&&(A===null||A===41||Er(A))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(A)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(o),e.enter(s),e.consume(h),e.exit(s),e.exit(i),t):Mn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Mn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!hi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function zO(e,t,n,i,s,o){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(s),e.consume(f),e.exit(s),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(s),e.consume(f),e.exit(s),e.exit(i),t):(e.enter(o),u(f))}function u(f){return f===r?(e.exit(o),a(r)):f===null?n(f):Mn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Bi(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Mn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function Bp(e,t){let n;return i;function i(s){return Mn(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):hi(s)?Bi(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const XTe={name:"definition",tokenize:tLe},eLe={partial:!0,tokenize:nLe};function tLe(e,t,n){const i=this;let s;return o;function o(h){return e.enter("definition"),r(h)}function r(h){return BO.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return s=T7(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return Er(h)?Bp(e,u)(h):u(h)}function u(h){return $O(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(eLe,d,d)(h)}function d(h){return hi(h)?Bi(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Mn(h)?(e.exit("definition"),i.parser.defined.push(s),t(h)):n(h)}}function nLe(e,t,n){return i;function i(l){return Er(l)?Bp(e,s)(l):n(l)}function s(l){return zO(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return hi(l)?Bi(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Mn(l)?t(l):n(l)}}const iLe={name:"hardBreakEscape",tokenize:sLe};function sLe(e,t,n){return i;function i(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Mn(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const oLe={name:"headingAtx",resolve:rLe,tokenize:lLe};function rLe(e,t){let n=e.length-2,i=3,s,o;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},wa(e,i,n-i+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function lLe(e,t,n){let i=0;return s;function s(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||Er(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Mn(c)?(e.exit("atxHeading"),t(c)):hi(c)?Bi(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||Er(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const aLe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$E=["pre","script","style","textarea"],uLe={concrete:!0,name:"htmlFlow",resolveTo:fLe,tokenize:hLe},cLe={partial:!0,tokenize:gLe},dLe={partial:!0,tokenize:pLe};function fLe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hLe(e,t,n){const i=this;let s,o,r,l,a;return u;function u(U){return c(U)}function c(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),d}function d(U){return U===33?(e.consume(U),f):U===47?(e.consume(U),o=!0,m):U===63?(e.consume(U),s=3,i.interrupt?t:z):da(U)?(e.consume(U),r=String.fromCharCode(U),y):n(U)}function f(U){return U===45?(e.consume(U),s=2,h):U===91?(e.consume(U),s=5,l=0,g):da(U)?(e.consume(U),s=4,i.interrupt?t:z):n(U)}function h(U){return U===45?(e.consume(U),i.interrupt?t:z):n(U)}function g(U){const se="CDATA[";return U===se.charCodeAt(l++)?(e.consume(U),l===se.length?i.interrupt?t:T:g):n(U)}function m(U){return da(U)?(e.consume(U),r=String.fromCharCode(U),y):n(U)}function y(U){if(U===null||U===47||U===62||Er(U)){const se=U===47,te=r.toLowerCase();return!se&&!o&&$E.includes(te)?(s=1,i.interrupt?t(U):T(U)):aLe.includes(r.toLowerCase())?(s=6,se?(e.consume(U),A):i.interrupt?t(U):T(U)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):o?b(U):C(U))}return U===45||Bl(U)?(e.consume(U),r+=String.fromCharCode(U),y):n(U)}function A(U){return U===62?(e.consume(U),i.interrupt?t:T):n(U)}function b(U){return hi(U)?(e.consume(U),b):D(U)}function C(U){return U===47?(e.consume(U),D):U===58||U===95||da(U)?(e.consume(U),v):hi(U)?(e.consume(U),C):D(U)}function v(U){return U===45||U===46||U===58||U===95||Bl(U)?(e.consume(U),v):x(U)}function x(U){return U===61?(e.consume(U),I):hi(U)?(e.consume(U),x):C(U)}function I(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),a=U,_):hi(U)?(e.consume(U),I):S(U)}function _(U){return U===a?(e.consume(U),a=null,E):U===null||Mn(U)?n(U):(e.consume(U),_)}function S(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Er(U)?x(U):(e.consume(U),S)}function E(U){return U===47||U===62||hi(U)?C(U):n(U)}function D(U){return U===62?(e.consume(U),B):n(U)}function B(U){return U===null||Mn(U)?T(U):hi(U)?(e.consume(U),B):n(U)}function T(U){return U===45&&s===2?(e.consume(U),R):U===60&&s===1?(e.consume(U),q):U===62&&s===4?(e.consume(U),H):U===63&&s===3?(e.consume(U),z):U===93&&s===5?(e.consume(U),W):Mn(U)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(cLe,X,N)(U)):U===null||Mn(U)?(e.exit("htmlFlowData"),N(U)):(e.consume(U),T)}function N(U){return e.check(dLe,O,X)(U)}function O(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),P}function P(U){return U===null||Mn(U)?N(U):(e.enter("htmlFlowData"),T(U))}function R(U){return U===45?(e.consume(U),z):T(U)}function q(U){return U===47?(e.consume(U),r="",j):T(U)}function j(U){if(U===62){const se=r.toLowerCase();return $E.includes(se)?(e.consume(U),H):T(U)}return da(U)&&r.length<8?(e.consume(U),r+=String.fromCharCode(U),j):T(U)}function W(U){return U===93?(e.consume(U),z):T(U)}function z(U){return U===62?(e.consume(U),H):U===45&&s===2?(e.consume(U),z):T(U)}function H(U){return U===null||Mn(U)?(e.exit("htmlFlowData"),X(U)):(e.consume(U),H)}function X(U){return e.exit("htmlFlow"),t(U)}}function pLe(e,t,n){const i=this;return s;function s(r){return Mn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):n(r)}function o(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function gLe(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(g9,t,n)}}const mLe={name:"htmlText",tokenize:vLe};function vLe(e,t,n){const i=this;let s,o,r;return l;function l(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),a}function a(z){return z===33?(e.consume(z),u):z===47?(e.consume(z),x):z===63?(e.consume(z),C):da(z)?(e.consume(z),S):n(z)}function u(z){return z===45?(e.consume(z),c):z===91?(e.consume(z),o=0,g):da(z)?(e.consume(z),b):n(z)}function c(z){return z===45?(e.consume(z),h):n(z)}function d(z){return z===null?n(z):z===45?(e.consume(z),f):Mn(z)?(r=d,q(z)):(e.consume(z),d)}function f(z){return z===45?(e.consume(z),h):d(z)}function h(z){return z===62?R(z):z===45?f(z):d(z)}function g(z){const H="CDATA[";return z===H.charCodeAt(o++)?(e.consume(z),o===H.length?m:g):n(z)}function m(z){return z===null?n(z):z===93?(e.consume(z),y):Mn(z)?(r=m,q(z)):(e.consume(z),m)}function y(z){return z===93?(e.consume(z),A):m(z)}function A(z){return z===62?R(z):z===93?(e.consume(z),A):m(z)}function b(z){return z===null||z===62?R(z):Mn(z)?(r=b,q(z)):(e.consume(z),b)}function C(z){return z===null?n(z):z===63?(e.consume(z),v):Mn(z)?(r=C,q(z)):(e.consume(z),C)}function v(z){return z===62?R(z):C(z)}function x(z){return da(z)?(e.consume(z),I):n(z)}function I(z){return z===45||Bl(z)?(e.consume(z),I):_(z)}function _(z){return Mn(z)?(r=_,q(z)):hi(z)?(e.consume(z),_):R(z)}function S(z){return z===45||Bl(z)?(e.consume(z),S):z===47||z===62||Er(z)?E(z):n(z)}function E(z){return z===47?(e.consume(z),R):z===58||z===95||da(z)?(e.consume(z),D):Mn(z)?(r=E,q(z)):hi(z)?(e.consume(z),E):R(z)}function D(z){return z===45||z===46||z===58||z===95||Bl(z)?(e.consume(z),D):B(z)}function B(z){return z===61?(e.consume(z),T):Mn(z)?(r=B,q(z)):hi(z)?(e.consume(z),B):E(z)}function T(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),s=z,N):Mn(z)?(r=T,q(z)):hi(z)?(e.consume(z),T):(e.consume(z),O)}function N(z){return z===s?(e.consume(z),s=void 0,P):z===null?n(z):Mn(z)?(r=N,q(z)):(e.consume(z),N)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Er(z)?E(z):(e.consume(z),O)}function P(z){return z===47||z===62||Er(z)?E(z):n(z)}function R(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function q(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),j}function j(z){return hi(z)?Bi(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):W(z)}function W(z){return e.enter("htmlTextData"),r(z)}}const N7={name:"labelEnd",resolveAll:ALe,resolveTo:CLe,tokenize:wLe},yLe={tokenize:xLe},kLe={tokenize:SLe},bLe={tokenize:_Le};function ALe(e){let t=-1;const n=[];for(;++t=3&&(u===null||Mn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===s?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),hi(u)?Bi(e,l,"whitespace")(u):l(u))}}const gr={continuation:{tokenize:BLe},exit:RLe,name:"list",tokenize:$Le},FLe={partial:!0,tokenize:OLe},DLe={partial:!0,tokenize:zLe};function $Le(e,t,n){const i=this,s=i.events[i.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,r=0;return l;function l(h){const g=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:$8(h)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(A2,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return $8(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(g9,i.interrupt?n:c,e.attempt(FLe,f,d))}function c(h){return i.containerState.initialBlankLine=!0,o++,f(h)}function d(h){return hi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=o+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function BLe(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(g9,s,o);function s(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Bi(e,t,"listItemIndent",i.containerState.size+1)(l)}function o(l){return i.containerState.furtherBlankLines||!hi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(DLe,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,Bi(e,e.attempt(gr,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function zLe(e,t,n){const i=this;return Bi(e,s,"listItemIndent",i.containerState.size+1);function s(o){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(o):n(o)}}function RLe(e){e.exit(this.containerState.type)}function OLe(e,t,n){const i=this;return Bi(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const r=i.events[i.events.length-1];return!hi(o)&&r&&r[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const BE={name:"setextUnderline",resolveTo:PLe,tokenize:jLe};function PLe(e,t){let n=e.length,i,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",r,t]),e.splice(o+1,0,["exit",e[i][1],t]),e[i][1].end={...e[o][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function jLe(e,t,n){const i=this;let s;return o;function o(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),s=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),hi(u)?Bi(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Mn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const HLe={tokenize:WLe};function WLe(e){const t=this,n=e.attempt(g9,i,e.attempt(this.parser.constructs.flowInitial,s,Bi(e,e.attempt(this.parser.constructs.flow,s,e.attempt(ZTe,s)),"linePrefix")));return n;function i(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qLe={resolveAll:OO()},ULe=RO("string"),KLe=RO("text");function RO(e){return{resolveAll:OO(e==="text"?VLe:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],o=n.attempt(s,r,l);return r;function r(c){return u(c)?o(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=s[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}o>0&&r.push(e[s].slice(0,o))}return r}function rNe(e,t){let n=-1;const i=[];let s;for(;++n>1}};ko.from=function(e){if(e instanceof ko)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ko(t)};function PO(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let s=e.child(i),o=t.child(i);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let r=s.text,l=o.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function WO(e){return e>=55296&&e<56320}class Fn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,s+l,o||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,s+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,s){let o="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:o+=i),o+=u},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(s[s.length-1]=n.withText(n.text+i.text),o=1);ot)for(let o=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),s+=l.nodeSize),r=a}return new Fn(i,s)}cutByIndex(t,n){return t==n?Fn.empty:t==0&&n==this.content.length?this:new Fn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return s[t]=n,new Fn(s,o)}addToStart(t){return new Fn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Fn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=t)return o==t?Bm(n+1,o):Bm(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Fn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Fn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Fn.empty;let n,i=0;for(let s=0;sthis.type.rank&&(n||(n=t.slice(0,s)),n.push(this),i=!0),n&&n.push(o)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-s.type.rank),n}}zi.none=[];class k0 extends Error{}class Un{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=UO(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new Un(i,this.openStart,this.openEnd)}removeBetween(t,n){return new Un(qO(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Un.empty;let i=n.openStart||0,s=n.openEnd||0;if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Un(Fn.fromJSON(t,n.content),i,s)}static maxOpen(t,n=!0){let i=0,s=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new Un(t,i,s)}}Un.empty=new Un(Fn.empty,0,0);function qO(e,t,n){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(s==t||o.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(qO(o.content,t-s-1,n-s-1)))}function UO(e,t,n,i,s,o){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return o&&i<=0&&s<=0&&!o.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=UO(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?s-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function cNe(e,t,n){if(n.openStart>e.depth)throw new k0("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new k0("Inconsistent open depths");return KO(e,t,n,0)}function KO(e,t,n,i){let s=e.index(i),o=e.node(i);if(s==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function zp(e,t,n,i){let s=(t||e).node(n),o=0,r=t?t.index(n):s.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Fd(e.nodeAfter,i),o++));for(let l=o;ls&&z8(e,t,s+1),r=i.depth>s&&z8(n,i,s+1),l=[];return zp(null,e,s,l),o&&r&&t.index(s)==n.index(s)?(VO(o,r),Fd(Dd(o,ZO(e,t,n,i,s+1)),l)):(o&&Fd(Dd(o,ey(e,t,s+1)),l),zp(t,n,s,l),r&&Fd(Dd(r,ey(n,i,s+1)),l)),zp(i,null,s,l),new Fn(l)}function ey(e,t,n){let i=[];if(zp(null,e,n,i),e.depth>n){let s=z8(e,t,n+1);Fd(Dd(s,ey(e,t,n+1)),i)}return zp(t,null,n,i),new Fn(i)}function dNe(e,t){let n=t.depth-e.openStart,s=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)s=t.node(o).copy(Fn.from(s));return{start:s.resolveNoCache(e.openStart+n),end:s.resolveNoCache(s.content.size-e.openEnd-n)}}class b0{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=t.child(n);return i?t.child(n).cut(i):s}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new pNe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],s=0,o=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(o),u=o-a;if(i.push(r,l,s+a),!u||(r=r.child(l),r.isText))break;o=u-1,s+=a+1}return new b0(n,i,o)}static resolveCached(t,n){let i=RE.get(t);if(i)for(let o=0;ot&&this.nodesBetween(t,n,o=>(i.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),GO(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=Fn.empty,s=0,o=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,s,o),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=s;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let s=Fn.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,s,i);return o.type.checkAttrs(o.attrs),o}};Ch.prototype.text=void 0;class ty extends Ch{constructor(t,n,i,s){if(super(t,n,null,s),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):GO(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ty(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ty(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function GO(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Zd{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new mNe(t,n);if(i.next==null)return Zd.empty;let s=QO(i);i.next&&i.err("Unexpected trailing text");let o=wNe(CNe(s));return xNe(o,i),o}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let s=0;s{let o=s+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return o}).join(` +`)}}Zd.empty=new Zd(!0);class mNe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function QO(e){let t=[];do t.push(vNe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function vNe(e){let t=[];do t.push(yNe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function yNe(e){let t=ANe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=kNe(e,t);else break;return t}function OE(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function kNe(e,t){let n=OE(e),i=n;return e.eat(",")&&(e.next!="}"?i=OE(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function bNe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let s=[];for(let o in n){let r=n[o];r.isInGroup(t)&&s.push(r)}return s.length==0&&e.err("No node type or group '"+t+"' found"),s}function ANe(e){if(e.eat("(")){let t=QO(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=bNe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function CNe(e){let t=[[]];return s(o(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function s(r,l){r.forEach(a=>a.to=l)}function o(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(o(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=o(r.exprs[a],l);if(a==r.exprs.length-1)return u;s(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),s(o(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return s(o(r.expr,l),a),s(o(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(o(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||s.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=t[i.join(",")]=new Zd(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:XO(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ch(this,this.computeAttrs(t),Fn.from(n),zi.setFrom(i))}createChecked(t=null,n,i){return n=Fn.from(n),this.checkContent(n),new Ch(this,this.computeAttrs(t),n,zi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=Fn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore(Fn.empty,!0);return o?new Ch(this,t,n.append(o),zi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[o]=new nP(o,n,r));let s=n.spec.topNode||"doc";if(!i[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let o in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function SNe(e,t,n){let i=n.split("|");return s=>{let o=s===null?"null":typeof s;if(i.indexOf(o)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${o}`)}}class _Ne{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?SNe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class F7{constructor(t,n,i,s){this.name=t,this.rank=n,this.schema=i,this.spec=s,this.attrs=tP(t,s.attrs),this.excluded=null;let o=JO(this.attrs);this.instance=o?new zi(this,o):null}create(t=null){return!t&&this.instance?this.instance:new zi(this,XO(this.attrs,t))}static compile(t,n){let i=Object.create(null),s=0;return t.forEach((o,r)=>i[o]=new F7(o,s++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class INe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in t)n[s]=t[s];n.nodes=ko.from(t.nodes),n.marks=ko.from(t.marks||{}),this.nodes=jE.compile(this.spec.nodes,this),this.marks=F7.compile(this.spec.marks,this);let i=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],r=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=i[r]||(i[r]=Zd.parse(r,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?HE(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],r=o.spec.excludes;o.excluded=r==null?[o]:r==""?[]:HE(this,r.split(" "))}this.nodeFromJSON=s=>Ch.fromJSON(this,s),this.markFromJSON=s=>zi.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,s){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof jE){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,s)}text(t,n){let i=this.nodes.text;return new ty(i,i.defaultAttrs,t,zi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function HE(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function MNe(e){return e.tag!=null}function ENe(e){return e.style!=null}let TNe=class O8{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(s=>{if(MNe(s))this.tags.push(s);else if(ENe(s)){let o=/[^=]*/.exec(s.style)[0];i.indexOf(o)<0&&i.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=t.nodes[s.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let i=new qE(this,n,!1);return i.addAll(t,zi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new qE(this,n,!0);return i.addAll(t,zi.none,n.from,n.to),Un.maxOpen(i.finish())}matchTag(t,n,i){for(let s=i?this.tags.indexOf(i)+1:0;st.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(s){let o=s.priority==null?50:s.priority,r=0;for(;r{i(r=UE(r)),r.mark||r.ignore||r.clearMark||(r.mark=s)})}for(let s in t.nodes){let o=t.nodes[s].spec.parseDOM;o&&o.forEach(r=>{i(r=UE(r)),r.node||r.ignore||r.mark||(r.node=s)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new O8(t,O8.schemaRules(t)))}};const iP={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},LNe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sP={ol:!0,ul:!0},A0=1,P8=2,Rp=4;function WE(e,t,n){return t!=null?(t?A0:0)|(t==="full"?P8:0):e&&e.whitespace=="pre"?A0|P8:n&~Rp}class zm{constructor(t,n,i,s,o,r){this.type=t,this.attrs=n,this.marks=i,this.solid=s,this.options=r,this.content=[],this.activeMarks=zi.none,this.match=o||(r&Rp?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Fn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,s;return(s=i.findWrapping(t.type))?(this.match=i,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&A0)){let i=this.content[this.content.length-1],s;if(i&&i.isText&&(s=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let n=Fn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Fn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!iP.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class qE{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,r=WE(null,n.preserveWhitespace,0)|(i?Rp:0);s?o=new zm(s.type,s.attrs,zi.none,!0,n.topMatch||s.type.contentMatch,r):i?o=new zm(null,null,zi.none,!0,null,r):o=new zm(t.schema.topNodeType,null,zi.none,!0,null,r),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,s=this.top,o=s.options&P8?"full":this.localPreserveWS||(s.options&A0)>0,{schema:r}=this.parser;if(o==="full"||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(o)if(o==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,s){let o,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(o=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(s)this.addElement(t,i,s);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}o&&this.sync(l)&&this.open--}addAll(t,n,i,s){let o=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=s==null?null:t.childNodes[s];r!=l;r=r.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(r,n);this.findAtPoint(t,o)}findPlace(t,n,i){let s,o;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!s||s.length>u.length+l)&&(s=u,o=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!s)return null;this.sync(o);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):KE(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new zm(t,n,a,s,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=A0)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let s=i.length-1;s>=0;s--)t+=i[s].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,s=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+(s?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&s?this.nodes[a].type:i&&a>=o?i.node(a-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function NNe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&sP.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function FNe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function UE(e){let t={};for(let n in e)t[n]=e[n];return t}function KE(e,t){let n=t.schema.nodes;for(let i in n){let s=n[i];if(!s.allowsMarkType(e))continue;let o=[],r=l=>{o.push(l);for(let a=0;a{if(o.length||r.marks.length){let l=0,a=0;for(;l=0;s--){let o=this.serializeMark(t.marks[s],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(t,n,i={}){let s=this.marks[t.type.name];return s&&C2(Rm(i),s(t,n),null,t.attrs)}static renderSpec(t,n,i=null,s){return typeof n=="string"?{dom:t.createTextNode(n)}:C2(t,n,i,s)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new m9(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=VE(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return VE(t.marks)}}function VE(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Rm(e){return e.document||window.document}const ZE=new WeakMap;function DNe(e){let t=ZE.get(e);return t===void 0&&ZE.set(e,t=$Ne(e)),t}function $Ne(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let s=0;s-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=s.indexOf(" ");r>0&&(n=s.slice(0,r),s=s.slice(r+1));let l,a=n?e.createElementNS(n,s):e.createElement(s),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:g}=C2(e,f,n,i);if(a.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:a,contentDOM:l}}const oP=65535,rP=Math.pow(2,16);function BNe(e,t){return e+t*rP}function GE(e){return e&oP}function zNe(e){return(e-(e&oP))/rP}const lP=1,aP=2,w2=4,uP=8;class QE{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&uP)>0}get deletedBefore(){return(this.delInfo&(lP|w2))>0}get deletedAfter(){return(this.delInfo&(aP|w2))>0}get deletedAcross(){return(this.delInfo&w2)>0}}class Or{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Or.empty)return Or.empty}recover(t){let n=0,i=GE(t);if(!this.inverted)for(let s=0;st)break;let u=this.ranges[l+o],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+s+(f<0?0:c);if(i)return h;let g=t==(n<0?a:d)?null:BNe(l/3,t-a),m=t==a?aP:t==d?lP:w2;return(n<0?t!=a:t!=d)&&(m|=uP),new QE(h,m,g)}s+=c-u}return i?t+s:new QE(t+s,0,null)}touches(t,n){let i=0,s=GE(n),o=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+o],c=a+u;if(t<=c&&l==s*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let s=0,o=0;s!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),s),n.openStart,n.openEnd);return Os.fromReplace(t,this.from,this.to,o)}invert(){return new Ad(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new bd(n.pos,i.pos,this.mark)}merge(t){return t instanceof bd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new bd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bd(n.from,n.to,t.markFromJSON(n.mark))}}Uo.jsonID("addMark",bd);class Ad extends Uo{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new Un(D7(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),t),n.openStart,n.openEnd);return Os.fromReplace(t,this.from,this.to,i)}invert(){return new bd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Ad(n.pos,i.pos,this.mark)}merge(t){return t instanceof Ad&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ad(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ad(n.from,n.to,t.markFromJSON(n.mark))}}Uo.jsonID("removeMark",Ad);class Cd extends Uo{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Os.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Os.fromReplace(t,this.pos,this.pos+1,new Un(Fn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let s=0;si.pos?null:new wh(n.pos,i.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new wh(n.from,n.to,n.gapFrom,n.gapTo,Un.fromJSON(t,n.slice),n.insert,!!n.structure)}}Uo.jsonID("replaceAround",wh);function j8(e,t,n){let i=e.resolve(t),s=n-t,o=i.depth;for(;s>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,s--;if(s>0){let r=i.node(o).maybeChild(i.indexAfter(o));for(;s>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,s--}}return!1}function RNe(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let s=n.content;for(let o=0;o=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(o==1)c=u.canReplace(a,a,s);else{let d=u.contentMatchAt(a).findWrapping(s.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}class Op extends Uo{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return Os.fail("No node at attribute step's position");let i=Object.create(null);for(let o in n.attrs)i[o]=n.attrs[o];i[this.attr]=this.value;let s=n.type.create(i,null,n.marks);return Os.fromReplace(t,this.pos,this.pos+1,new Un(Fn.from(s),0,n.isLeaf?0:1))}getMap(){return Or.empty}invert(t){return new Op(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Op(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Op(n.pos,n.attr,n.value)}}Uo.jsonID("attr",Op);class ny extends Uo{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return Os.ok(i)}getMap(){return Or.empty}invert(t){return new ny(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ny(n.attr,n.value)}}Uo.jsonID("docAttr",ny);let w0=class extends Error{};w0=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};w0.prototype=Object.create(Error.prototype);w0.prototype.constructor=w0;w0.prototype.name="TransformError";const ck=Object.create(null);class ms{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new ONe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;o--){let r=n<0?Wf(t.node(0),t.node(o),t.before(o+1),t.index(o),n,i):Wf(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new ka(t.node(0))}static atStart(t){return Wf(t,t,0,0,1)||new ka(t)}static atEnd(t){return Wf(t,t,t.content.size,t.childCount,-1)||new ka(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=ck[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in ck)throw new RangeError("Duplicate use of selection JSON ID "+t);return ck[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Qi.between(this.$anchor,this.$head).getBookmark()}}ms.prototype.visible=!0;class ONe{constructor(t,n){this.$from=t,this.$to=n}}let YE=!1;function JE(e){!YE&&!e.parent.inlineContent&&(YE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Qi extends ms{constructor(t,n=t){JE(t),JE(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return ms.near(i);let s=t.resolve(n.map(this.anchor));return new Qi(s.parent.inlineContent?s:i,i)}replace(t,n=Un.empty){if(super.replace(t,n),n==Un.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof Qi&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new v9(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Qi(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let s=t.resolve(n);return new this(s,i==n?s:t.resolve(i))}static between(t,n,i){let s=t.pos-n.pos;if((!i||s)&&(i=s>=0?1:-1),!n.parent.inlineContent){let o=ms.findFrom(n,i,!0)||ms.findFrom(n,-i,!0);if(o)n=o.$head;else return ms.near(n,i)}return t.parent.inlineContent||(s==0?t=n:(t=(ms.findFrom(t,-i,!0)||ms.findFrom(t,i,!0)).$anchor,t.pos0?0:1);s>0?r=0;r+=s){let l=t.child(r);if(l.isAtom){if(!o&&ci.isSelectable(l))return ci.create(e,n-(s<0?l.nodeSize:0))}else{let a=Wf(e,l,n+s,s<0?l.childCount:0,s,o);if(a)return a}n+=l.nodeSize*s}return null}function XE(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(ms.near(e.doc.resolve(r),n))}function eT(e,t){return!t||!e?e:e.bind(t)}class Om{constructor(t,n,i){this.name=t,this.init=eT(n.init,i),this.apply=eT(n.apply,i)}}new Om("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Om("selection",{init(e,t){return e.selection||ms.atStart(t.doc)},apply(e){return e.selection}}),new Om("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new Om("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function cP(e,t,n){for(let i in e){let s=e[i];s instanceof Function?s=s.bind(t):i=="handleDOMEvents"&&(s=cP(s,t,{})),n[i]=s}return n}class jNe{constructor(t){this.spec=t,this.props={},t.props&&cP(t.props,this,this.props),this.key=t.key?t.key.key:HNe("plugin")}getState(t){return t[this.key]}}const dk=Object.create(null);function HNe(e){return e in dk?e+"$"+ ++dk[e]:(dk[e]=0,e+"$")}const iy="kimi-code://skill/";function dP(e){return e?e.startsWith(iy)&&e.length>iy.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function rp(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function fP(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function WNe(e){const t=e.split("/").map(fP).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function qNe(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function UNe(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function KNe(e){return e.replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function VNe(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");try{return decodeURIComponent(n)}catch{return n}}function hP(e){const t=e.slice(iy.length);try{return decodeURIComponent(t)}catch{return t}}function pP(e){const t=qNe(e.name);if(e.kind==="skill")return`[${t}](${iy}${fP(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${WNe(n)})`}const ZNe=new INe({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>pP(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}}}}),GNe={extensions:[{disable:{null:["attention","autolink","blockQuote","characterReference","codeFenced","codeIndented","codeText","definition","hardBreakEscape","headingAtx","htmlFlow","htmlText","list","setextUnderline","thematicBreak"]}}]};function B7(e){if(e.includes(` +`)){const a=[];let u=0;for(const c of e.split(` +`)){for(const d of B7(c))a.push({...d,start:d.start+u,end:d.end+u});u+=c.length+1}return a}const t=aNe(lNe(GNe).document().write(uNe()(e,void 0,!0))),n=[];let i=null,s=!1,o=!1,r=null,l=0;for(const[a,u]of t){if(u.type==="image"){l+=a==="enter"?1:-1;continue}if(l>0)continue;if(a==="enter"){u.type==="label"?i={start:u.start.offset,end:u.end.offset}:u.type==="resource"&&i!==null&&u.start.offset===i.end?(s=!0,o=!1,r=null):u.type==="resourceTitle"&&s?o=!0:u.type==="resourceDestination"&&s&&(r={start:u.start.offset,end:u.end.offset});continue}if(u.type!=="resource"||!s||i===null)continue;s=!1;const{start:c,end:d}=i;i=null;const f=u.end.offset;if(o||e[c]!=="["||r===null)continue;const h=e.slice(c+1,d-1);let g=e.slice(r.start,r.end),m=!1;if(g.startsWith("<")&&(m=!0,g=g.slice(1,-1)),!h||!g)continue;const y=dP(g);if(y!==null)if(y==="skill")n.push({start:c,end:f,attrs:{kind:y,name:hP(g),path:""},rawDest:g});else{const A=VNe(g,m);n.push({start:c,end:f,attrs:{kind:y,name:UNe(h),path:A},rawDest:g})}}return n}function QNe(e){const t=B7(e);if(t.length===0)return[{type:"text",value:e}];const n=[];let i=0;for(const s of t)s.start>i&&n.push({type:"text",value:e.slice(i,s.start)}),n.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}),i=s.end;return i2),ll=R7||(xa?/Mac/.test(xa.platform):!1),AP=xa?/Win/.test(xa.platform):!1,tg=/Android \d/.test(Nc),O7=!!nT&&"webkitFontSmoothing"in nT.documentElement.style,XNe=O7?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function eFe(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),o=s&&s.size==0,r=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(r<0)return null;let l=i.resolve(r),a,u;if(mP(n)){for(a=r;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&ci.isSelectable(d)&&s.parent&&!(d.isInline&&JNe(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;u=new ci(r==f?l:i.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=r,f=r;for(let h=0;h{(n.anchorNode!=i||n.anchorOffset!=s)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!CP(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function nFe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.collapse(n.parentNode,sf(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&eg&&kP<=11&&(n.disabled=!0,n.disabled=!1)}function iFe(e,t){if(t instanceof ci){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rT(e)}function rT(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function wP(e,t,n,i){return e.someProp("createSelectionBetween",s=>s(e,t,n))||Qi.between(t,n,i)}function sFe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function U8(e,t){let{$anchor:n,$head:i}=e.selection,s=t>0?n.max(i):n.min(i),o=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return o&&ms.findFrom(o,t)}function Ru(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function lT(e,t,n){let i=e.state.selection;if(i instanceof Qi)if(n.indexOf("s")>-1){let{$head:s}=i,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let r=e.state.doc.resolve(s.pos+o.nodeSize*(t<0?-1:1));return Ru(e,new Qi(i.$anchor,r))}else if(i.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let s=U8(e.state,t);return s&&s instanceof ci?Ru(e,s):!1}else if(!(ll&&n.indexOf("m")>-1)){let s=i.$head,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter,r;if(!o||o.isText)return!1;let l=t<0?s.pos-o.nodeSize:s.pos;return o.isAtom||(r=e.docView.descAt(l))&&!r.contentDOM?ci.isSelectable(o)?Ru(e,new ci(t<0?e.state.doc.resolve(s.pos-o.nodeSize):s)):O7?Ru(e,new Qi(e.state.doc.resolve(t<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(i instanceof ci&&i.node.isInline)return Ru(e,new Qi(t>0?i.$to:i.$from));{let s=U8(e.state,t);return s?Ru(e,s):!1}}}function oy(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pp(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Ff(e,t){return t<0?oFe(e):rFe(e)}function oFe(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let s,o,r=!1;for(y9&&n.nodeType==1&&i0){if(n.nodeType!=1)break;{let l=n.childNodes[i-1];if(Pp(l,-1))s=n,o=--i;else if(l.nodeType==3)n=l,i=n.nodeValue.length;else break}}else{if(xP(n))break;{let l=n.previousSibling;for(;l&&Pp(l,-1);)s=n.parentNode,o=sf(l),l=l.previousSibling;if(l)n=l,i=oy(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}r?K8(e,n,i):s&&K8(e,s,o)}function rFe(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let s=oy(n),o,r;for(;;)if(i{e.state==s&&P7(e)},50)}function aT(e,t){let n=e.state.doc.resolve(t);if(!(Fc||AP)&&n.parent.inlineContent){let s=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),r=(o.top+o.bottom)/2;if(r>s.top&&r1)return o.lefts.top&&r1)return o.left>s.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function uT(e,t,n){let i=e.state.selection;if(i instanceof Qi&&!i.empty||n.indexOf("s")>-1||ll&&n.indexOf("m")>-1)return!1;let{$from:s,$to:o}=i;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let r=U8(e.state,t);if(r&&r instanceof ci)return Ru(e,r)}if(!s.parent.inlineContent){let r=t<0?s:o,l=i instanceof ka?ms.near(r,t):ms.findFrom(r,t);return l?Ru(e,l):!1}return!1}function cT(e,t){if(!(e.state.selection instanceof Qi))return!0;let{$head:n,$anchor:i,empty:s}=e.state.selection;if(!n.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function dT(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function uFe(e){if(!of||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let i=t.firstChild;dT(e,i,"true"),setTimeout(()=>dT(e,i,"false"),20)}return!1}function cFe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function dFe(e,t){let n=t.keyCode,i=cFe(t);if(n==8||ll&&n==72&&i=="c")return cT(e,-1)||Ff(e,-1);if(n==46&&!t.shiftKey||ll&&n==68&&i=="c")return cT(e,1)||Ff(e,1);if(n==13||n==27)return!0;if(n==37||ll&&n==66&&i=="c"){let s=n==37?aT(e,e.state.selection.from)=="ltr"?-1:1:-1;return lT(e,s,i)||Ff(e,s)}else if(n==39||ll&&n==70&&i=="c"){let s=n==39?aT(e,e.state.selection.from)=="ltr"?1:-1:1;return lT(e,s,i)||Ff(e,s)}else{if(n==38||ll&&n==80&&i=="c")return uT(e,-1,i)||Ff(e,-1);if(n==40||ll&&n==78&&i=="c")return uFe(e)||uT(e,1,i)||Ff(e,1);if(i==(ll?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function SP(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:i,openStart:s,openEnd:o}=t;for(;s>1&&o>1&&i.childCount==1&&i.firstChild.childCount==1;){s--,o--;let h=i.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),i=h.content}let r=e.someProp("clipboardSerializer")||m9.fromSchema(e.state.schema),l=LP(),a=l.createElement("div");a.appendChild(r.serializeFragment(i,{document:l}));let u=a.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=TP[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let g=l.createElement(c[h]);for(;a.firstChild;)g.appendChild(a.firstChild);a.appendChild(g),d++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,` + +`);return{dom:a,text:f,slice:t}}function _P(e,t,n,i,s){let o=s.parent.type.spec.code,r,l;if(!n&&!t)return null;let a=!!t&&(i||o||!n);if(a){if(e.someProp("transformPastedText",f=>{t=f(t,o||i,e)}),o)return l=new Un(Fn.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0),e.someProp("transformPasted",f=>{l=f(l,e,!0)}),l;let d=e.someProp("clipboardTextParser",f=>f(t,s,i,e));if(d)l=d;else{let f=s.marks(),{schema:h}=e.state,g=m9.fromSchema(h);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=r.appendChild(document.createElement("p"));m&&y.appendChild(g.serializeNode(h.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),r=gFe(n),O7&&mFe(r);let u=r&&r.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=r.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;r=f}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||TNe.fromSchema(e.state.schema)).parseSlice(r,{preserveWhitespace:!!(a||c),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!fFe.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)l=vFe(fT(l,+c[1],+c[2]),c[4]);else if(l=Un.maxOpen(hFe(l.content,s),!0),l.openStart||l.openEnd){let d=0,f=0;for(let h=l.content.firstChild;d{l=d(l,e,a)}),l}const fFe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function hFe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let s=t.node(n).contentMatchAt(t.index(n)),o,r=[];if(e.forEach(l=>{if(!r)return;let a=s.findWrapping(l.type),u;if(!a)return r=null;if(u=r.length&&o.length&&MP(a,o,l,r[r.length-1],0))r[r.length-1]=u;else{r.length&&(r[r.length-1]=EP(r[r.length-1],o.length));let c=IP(l,a);r.push(c),s=s.matchType(c.type),o=a}}),r)return Fn.from(r)}return e}function IP(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,Fn.from(e));return e}function MP(e,t,n,i,s){if(s1&&(o=0),s=n&&(l=t<0?r.contentMatchAt(0).fillBefore(l,o<=s).append(l):l.append(r.contentMatchAt(r.childCount).fillBefore(Fn.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,r.copy(l))}function fT(e,t,n){return tn})),hk.createHTML(e)):e}function gFe(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=LP(),i=n.body,s=/<([a-z][^>\s]+)/i.exec(e),o;if((o=s&&TP[s[1].toLowerCase()])&&(e=o.map(r=>"<"+r+">").join("")+e+o.map(r=>"").reverse().join("")),i.innerHTML=pFe(e),o)for(let r=0;r=0;l-=2){let a=n.nodes[i[l]];if(!a||a.hasRequiredAttrs())break;s=Fn.from(a.create(i[l+1],s)),o++,r++}return new Un(s,o,r)}const Gl={},Yr={};function Ga(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Yr.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!$P(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(tg&&Fc&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),R7&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",s=>s(e,vP(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||dFe(e,n)?n.preventDefault():Ga(e,"key")};Yr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Yr.keypress=(e,t)=>{let n=t;if($P(e)||!n.charCode||n.ctrlKey&&!n.altKey||ll&&n.metaKey)return;if(e.someProp("handleKeyPress",s=>s(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof Qi)||!i.$from.sameParent(i.$to)){let s=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!e.someProp("handleTextInput",r=>r(e,i.$from.pos,i.$to.pos,s,o))&&e.dispatch(o()),n.preventDefault()}};function ng(e){return{left:e.clientX,top:e.clientY}}function yFe(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function j7(e,t,n,i,s){if(i==-1)return!1;let o=e.state.doc.resolve(i);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,l=>r>o.depth?l(e,n,o.nodeAfter,o.before(r),s,!0):l(e,n,o.node(r),o.before(r),s,!1)))return!0;return!1}function ig(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function kFe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&ci.isSelectable(i)?(ig(e,new ci(n)),!0):!1}function bFe(e,t){if(t==-1)return!1;let n=e.state.selection,i,s;n instanceof ci&&(i=n.node);let o=e.state.doc.resolve(t);for(let r=o.depth+1;r>0;r--){let l=r>o.depth?o.nodeAfter:o.node(r);if(ci.isSelectable(l)){i&&n.$from.depth>0&&r>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?s=o.before(n.$from.depth):s=o.before(r);break}}return s!=null?(ig(e,ci.create(e.state.doc,s)),!0):!1}function AFe(e,t,n,i,s){return j7(e,"handleClickOn",t,n,i)||e.someProp("handleClick",o=>o(e,t,i))||(s?bFe(e,n):kFe(e,n))}function CFe(e,t,n,i){return j7(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",s=>s(e,t,i))}function wFe(e,t,n,i){return j7(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",s=>s(e,t,i))||xFe(e,n,i)}function xFe(e,t,n){if(n.button!=0)return!1;let i=NP(e,t,!0),s=e.state.doc;return i?(ig(e,i),i instanceof Qi&&s.eq(e.state.doc)&&(e.input.mouseDown=new _Fe(e,i)),!0):!1}function NP(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?Qi.create(i,0,i.content.size):null;let s=i.resolve(t);for(let o=s.depth+1;o>0;o--){let r=o>s.depth?s.nodeAfter:s.node(o),l=s.before(o);if(r.inlineContent)return Qi.create(i,l+1,l+1+r.content.size);if(n&&ci.isSelectable(r))return ci.create(i,l)}return null}function H7(e){return ry(e)}const FP=ll?"metaKey":"ctrlKey";Gl.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=H7(e),s=Date.now(),o="singleClick";s-e.input.lastClick.time<500&&yFe(n,e.input.lastClick)&&!n[FP]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let r=e.posAtCoords(ng(n));r&&(o=="singleClick"?e.input.mouseDown=new SFe(e,r,n,!!i):(o=="doubleClick"?CFe:wFe)(e,r.pos,r.inside,n)?n.preventDefault():Ga(e,"pointer"))};class DP{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class SFe extends DP{constructor(t,n,i,s){super(t),this.pos=n,this.event=i,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[FP],this.allowDefault=i.shiftKey;let o,r;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),r=n.inside;else{let c=t.state.doc.resolve(n.pos);o=c.parent,r=c.depth?c.before():0}const l=s?null:i.target,a=l?t.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof ci&&u.from<=r&&u.to>r)&&(this.mightDrag={node:o,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&y9&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Ga(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||P7(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ng(t))),this.updateAllowDefault(t),this.allowDefault||!n?Ga(this.view,"pointer"):AFe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||of&&this.mightDrag&&!this.mightDrag.node.isAtom||Fc&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ig(this.view,ms.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Ga(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ga(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class _Fe extends DP{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),Ga(this.view,"pointer");let n=this.view.posAtCoords(ng(t)),i=n&&NP(this.view,n.inside,!1);if(!i)return;let{doc:s}=this.view.state,o=this.startSelection,[r,l]=i.from{e.input.lastTouch=Date.now(),H7(e),Ga(e,"pointer")};Gl.touchmove=e=>{e.input.lastTouch=Date.now(),Ga(e,"pointer")};Gl.contextmenu=e=>H7(e);function $P(e,t){return e.composing?!0:of&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const IFe=tg?5e3:-1;Yr.compositionstart=Yr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Qi&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||Fc&&AP&&MFe(e)))e.markCursor=e.state.storedMarks||n.marks(),ry(e,!0),e.markCursor=null;else if(ry(e,!t.selection.empty),y9&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let s=i.focusNode,o=i.focusOffset;s&&s.nodeType==1&&o!=0;){let r=o<0?s.lastChild:s.childNodes[o-1];if(!r)break;if(r.nodeType==3){let l=e.domSelection();l&&l.collapse(r,r.nodeValue.length);break}else s=r,o=-1}}e.input.composing=!0}BP(e,IFe)};function MFe(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Yr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,BP(e,20))};function BP(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ry(e),t))}function EFe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ry(e,t=!1){if(!(tg&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),EFe(e),t||e.docView&&e.docView.dirty){let n=eFe(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function TFe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),s=document.createRange();s.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const x0=eg&&kP<15||R7&&XNe<604;Gl.copy=Yr.cut=(e,t)=>{let n=t,i=e.state.selection,s=n.type=="cut";if(i.empty)return;let o=x0?null:n.clipboardData,r=i.content(),{dom:l,text:a}=SP(e,r);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):TFe(e,l),s&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function LFe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function NFe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let s=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?Z8(e,i.value,null,s,t):Z8(e,i.textContent,i.innerHTML,s,t)},50)}function Z8(e,t,n,i,s){let o=_P(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,s,o||Un.empty)))return!0;if(!o)return!1;let r=LFe(o),l=r?e.state.tr.replaceSelectionWith(r,i):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function zP(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Yr.paste=(e,t)=>{let n=t;if(e.composing&&!tg)return;let i=x0?null:n.clipboardData,s=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&Z8(e,zP(i),i.getData("text/html"),s,n)?n.preventDefault():NFe(e,n)};class FFe{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const DFe=ll?"altKey":"ctrlKey";function RP(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[DFe]}Gl.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let s=e.state.selection,o=s.empty?null:e.posAtCoords(ng(n)),r;if(!(o&&o.pos>=s.from&&o.pos<=(s instanceof ci?s.to-1:s.to))){if(i&&i.mightDrag)r=ci.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(r=ci.create(e.state.doc,d.posBefore))}}let l=(r||e.state.selection).content(),{dom:a,text:u,slice:c}=SP(e,l);(!n.dataTransfer.files.length||!Fc||bP>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(x0?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",x0||n.dataTransfer.setData("text/plain",u),e.dragging=new FFe(c,RP(e,n),r)};Gl.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Yr.dragover=Yr.dragenter=(e,t)=>t.preventDefault();Yr.drop=(e,t)=>{try{$Fe(e,t,e.dragging)}finally{e.dragging=null}};function $Fe(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(ng(t));if(!i)return;let s=e.state.doc.resolve(i.pos),o=n&&n.slice;o?e.someProp("transformPasted",h=>{o=h(o,e,!1)}):o=_P(e,zP(t.dataTransfer),x0?null:t.dataTransfer.getData("text/html"),!1,s);let r=!!(n&&RP(e,t));if(e.someProp("handleDrop",h=>h(e,t,o||Un.empty,r))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?RNe(e.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let a=e.state.tr;if(r){let{node:h}=n;h?h.replace(a):a.deleteSelection()}let u=a.mapping.map(l),c=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=a.doc;if(c?a.replaceRangeWith(u,u,o.content.firstChild):a.replaceRange(u,u,o),a.doc.eq(d))return;let f=a.doc.resolve(u);if(c&&ci.isSelectable(o.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(o.content.firstChild))a.setSelection(new ci(f));else{let h=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((g,m,y,A)=>h=A),a.setSelection(wP(e,f,a.doc.resolve(h)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}Gl.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&P7(e)},20))};Gl.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Gl.beforeinput=(e,t)=>{if(tg&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,vP(8,"Backspace")))))return;let{$cursor:s}=e.state.selection;s&&s.pos>0&&e.dispatch(e.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let e in Yr)Gl[e]=Yr[e];function S0(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class ly{constructor(t,n){this.toDOM=t,this.spec=n||$d,this.side=this.spec.side||0}map(t,n,i,s){let{pos:o,deleted:r}=t.mapResult(n.from+s,this.side<0?-1:1);return r?null:new pa(o-i,o-i,this)}valid(){return!0}eq(t){return this==t||t instanceof ly&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&S0(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class tc{constructor(t,n){this.attrs=t,this.spec=n||$d}map(t,n,i,s){let o=t.map(n.from+s,this.spec.inclusiveStart?-1:1)-i,r=t.map(n.to+s,this.spec.inclusiveEnd?1:-1)-i;return o>=r?null:new pa(o,r,this)}valid(t,n){return n.from=t&&(!o||o(l.spec))&&i.push(l.copy(l.from+s,l.to+s))}for(let r=0;rt){let l=this.children[r]+1;this.children[r+2].findInner(t-l,n-l,i,s+l,o)}}map(t,n,i){return this==Xo||t.maps.length==0?this:this.mapInner(t,n,0,0,i||$d)}mapInner(t,n,i,s,o){let r;for(let l=0;l{let u=a+i,c;if(c=PP(n,l,u)){for(s||(s=this.children.slice());ol&&d.to=t){this.children[l]==t&&(i=this.children[l+2]);break}let o=t+1,r=o+n.content.size;for(let l=0;lo&&a.type instanceof tc){let u=Math.max(o,a.from)-o,c=Math.min(r,a.to)-o;us.map(t,n,$d));return pd.from(i)}forChild(t,n){if(n.isLeaf)return co.empty;let i=[];for(let s=0;sn instanceof co)?t:t.reduce((n,i)=>n.concat(i instanceof co?i:i.members),[]))}}forEachSet(t){for(let n=0;n{let y=m-g-(h-f);for(let A=0;Ab+c-d)continue;let C=l[A]+c-d;h>=C?l[A+1]=f<=C?-2:-1:f>=c&&y&&(l[A]+=y,l[A+1]+=y)}d+=y}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u=i.content.size){a=!0;continue}let f=n.map(e[u+1]+o,-1),h=f-s,{index:g,offset:m}=i.content.findIndex(d),y=i.maybeChild(g);if(y&&m==d&&m+y.nodeSize==h){let A=l[u+2].mapInner(n,y,c+1,e[u]+o+1,r);A!=Xo?(l[u]=d,l[u+1]=h,l[u+2]=A):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=zFe(l,e,t,n,s,o,r),c=ay(u,i,0,r);t=c.local;for(let d=0;dn&&r.to{let u=PP(e,l,a+n);if(u){o=!0;let c=ay(u,l,n+a+1,i);c!=Xo&&s.push(a,a+l.nodeSize,c)}});let r=OP(o?jP(e):e,-n).sort(Bd);for(let l=0;l0;)t++;e.splice(t,0,n)}const RFe={sm:14,md:16,lg:20},OFe={file:Zb,folder:gB,skill:vB,copy:pB,check:hB,"external-link":mB};function Fh(e,t="md"){const n=RFe[t];return OFe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
      ([\s\S]*?)<\/summary>/,Lse=/([\s\S]*?)<\/resume_hint>/,n8=/]*)>|<\/subagent>/g,Nse="",zI=/(completed|failed|aborted):\s*(\d+)/g,jI=/([a-z_]+)="([^"]*)"/g;function Dse(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Fse(e){const t={};jI.lastIndex=0;let n;for(;(n=jI.exec(e))!==null;)t[n[1]]=Dse(n[2]);return t}function Bse(e){const t={completed:0,failed:0,aborted:0};zI.lastIndex=0;let n;for(;(n=zI.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function Rse(e,t){const n=Fse(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function Ose(e){const t=[],n=[];n8.lastIndex=0;let i;for(;(i=n8.exec(e))!==null;)if(i[0]===Nse){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(Rse(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:n8.lastIndex}):n.push(null);return t}function Pse(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e;if(!t.includes(""))return null;const n=Ese.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=Bse(n),r=Lse.exec(t)?.[1]?.trim(),l=Ose(t),a=i+o+s;return{summary:n,completed:i,failed:o,aborted:s,total:a>0?a:l.length,subagents:l,resumeHint:r}}const $se=3,zse="Use TaskOutput with one of the task_id values above to read the full output.";function th(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function jse(e,t){const n=Number(th(e,t)??0);return Number.isFinite(n)?n:0}function j$(e,t){return e.match(t)?.length??0}function HI(e,t,n){const i=new RegExp(`^\\[${t}\\]$`,"gm"),o=[];let s;for(;(s=i.exec(e))!==null;)s.index>=n&&o.push(s.index);return o}function WI(e,t){return t>=2&&e[t-1]===` -`&&e[t-2]===` -`}function qI(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function Hse(e){return e.endsWith(zse)}function Wse(e){const t=th(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?j$(e,/^task_id: /gm)===n:!1}function qse(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min($se,t))}function Use(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=th(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(th(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=qI(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const f of HI(t,"completed_during_wait",l)){if(!WI(t,f))continue;const h=qI(t,f,"completed_during_wait");Hse(h)&&(a=j$(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of HI(t,"still_running",l)){if(u>=0&&fc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=UI(o)||UI(i),r=s?o.toLowerCase():o,l=s?i.toLowerCase():i,a=r.endsWith("/")?r:`${r}/`;if(l!==r&&!l.startsWith(a))return null;const u=l===r?"":i.slice(a.length);return u.split("/").includes("..")?null:u||null}const cn={permission:"kimi-web.permission",permissionBySession:"kimi-web.permission-by-session",permissionExplicit:"kimi-web.permission-explicit",permissionStickyAt:"kimi-web.permission-sticky-at",permissionDaemonDefault:"kimi-web.permission-daemon-default",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},Zse="__new__";function gd(e){return e&&e.length>0?e:Zse}function ok(e){return`kimi-web.draft.${gd(e)}`}function VI(e){return`kimi-web.attachment-draft.${gd(e)}`}function sk(e){return`kimi-web.draft-atts.${gd(e)}`}function po(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ho(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Ns(e){try{globalThis.localStorage.removeItem(e)}catch{}}function $c(e){const t=po(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Vu(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function o7(){const e=po(cn.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function s7(e){const n={...o7()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];ho(cn.unread,JSON.stringify(n))}function Gse(){const e=$c(cn.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function i8(e){Vu(cn.collapsedWorkspaces,Array.from(e))}function Qse(){return $c(cn.pinnedCollapsed)===!0}function tC(e){Vu(cn.pinnedCollapsed,e)}function Yse(){return po(cn.sidebarViewMode)==="flat"?"flat":"grouped"}function Jse(e){ho(cn.sidebarViewMode,e)}function Xse(){return po(cn.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function ere(e){ho(cn.mobileSwitcherViewMode,e)}function tre(){const e=$c(cn.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function H$(e){Vu(cn.workspaceOrder,Array.from(e))}function nre(){return po(cn.workspaceSort)==="recent"?"recent":"manual"}function ire(e){ho(cn.workspaceSort,e)}function ore(){const e=$c(cn.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function W$(e){Vu(cn.workspaceRecencyFloor,e)}function q$(){const e=$c(cn.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function o8(e){Vu(cn.pinnedSessions,Array.from(e))}function K2(){const e=$c(cn.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function KI(e){Vu(cn.workspaceNameOverrides,e)}function qd(e){return e==="manual"||e==="auto"||e==="yolo"?e:void 0}function ZI(){return qd(po(cn.permission))??"manual"}function sre(e){ho(cn.permission,e)}function GI(){const e=po(cn.permissionStickyAt),t=Number(e);return Number.isFinite(t)&&t>0?t:e===null&&po(cn.permission)!==null?1:0}function Ep(e){ho(cn.permissionStickyAt,String(e))}function U$(e){const t=po(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n)){const r=qd(s);r!==void 0&&(i[o]=r)}return i}catch{return{}}}function V$(e,t){ho(e,JSON.stringify(t))}function QI(){return U$(cn.permissionBySession)}function s8(e){V$(cn.permissionBySession,e)}function YI(){return U$(cn.permissionExplicit)}function rre(e){V$(cn.permissionExplicit,e)}const JI={manual:0,yolo:1,auto:2};function lre(e){let t="auto",n=!1;for(const i of e)i!==void 0&&(n=!0,JI[i]typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?K$:Math.round(t.reduce((n,i)=>n+i,0))}function Z$(e){return e==null||!Number.isFinite(e)||e<=0?K$:Math.round(e)}const nC=96;function dre(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function fre(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):nC:nC}function hre(e){return e>ure}function XI(e){return Math.round(e*.4)}function pre(e){return e==null||!Number.isFinite(e)||e<=0?nC:Math.round(e)}function mre(e,t,n,i){const o=Z$(n),s=pre(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const l=Math.round(t)-s;return Math.max(o,Math.min(r,l))}function r8(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(Z$(n),Math.min(e,Math.round(t)))}function gre(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function vre(e,t){return t===null||t===e}const rk="application/x-kimi-session-row";function yre(e,t){return e.includes(t)?e:[...e,t]}function kre(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function bre(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const l=i.get(r);l!==void 0&&s.push(l)}return{pinned:s,unpinned:o}}const wre={"&":"&","<":"<",">":">",'"':""","'":"'"};function s0(e){return e.replace(/[&<>"']/g,t=>wre[t]??t)}function Cre(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Are(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return eT(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return eT(i,n*2);const r=Math.max(0,s-n),l=Math.min(i.length,s+o.length+n),a=r>0,u=l`${s}`)}const G$=/([\s\S]*?)<\/kbd>/g;function Q$(e){let t="",n=0;for(const i of e.matchAll(G$))t+=s0(e.slice(n,i.index)),t+=`${s0(i[1]??"")}`,n=i.index+i[0].length;return t+s0(e.slice(n))}function xre(e){return e.replace(G$,"$1")}let Sre=0;function _re(e,t){const n=++Sre;return e.pendingPlanBySession[t]=n,n}function r7(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function iC(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function Mre(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const Ire=30;function Tre(e){return e!==void 0&&e0?(l.push(t("settings.planUsage.durationDay",{n:o})),l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?l.push(t("settings.planUsage.durationMinute",{n:r})):l.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:l.join(" ")})}function oC(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function Yy(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function Ere(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const X$="kimiWeb.compaction",ez="managed:kimi-code",Lre=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function Z2(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function sC(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const tz=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function Nre(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!tz.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function nz(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function Dre(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:nz(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function Fre(e,t,n){const i=nz(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),l=n?.existingDefaultModel?.trim()??"",a=l.indexOf("/")>=0?l.slice(l.indexOf("/")+1):l;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...a!==""&&i.some(u=>u.model===a)?{defaultModel:a}:{}}}function iz(e){return e.id===ez&&e.type==="kimi"}const lk="/devices/",oz="kimi-rc-device-id";function Bre(e){return new URLSearchParams(e.search).get("rc")==="1"}function sz(e){const{pathname:t}=e;if(!t.startsWith(lk))return;const n=t.slice(lk.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function Rre(e){if(sz({pathname:e})===void 0)return e;const t=e.slice(lk.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function Ore(e){return`${lk}${encodeURIComponent(e)}/`}function rz(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function Pre(e){const t=sz(e);return t!==void 0?(zre(t),t):$re()}function $re(){try{return window.sessionStorage.getItem(oz)??void 0}catch{return}}function zre(e){try{window.sessionStorage.setItem(oz,e)}catch{}}const jre=/^(\d+)\t(.*)$/;function Hre(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=jre.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function tT(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",l=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(".."):l.push(u));const a=l.join("/");return n==="/"?`/${a}`:n!==""?a?`${n}/${a}`:`${n}/`:a}function lz(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function Wre(e,t){const n=lz(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function nT(e,t,n){const i=lz(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const l8={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function az(e,t,n={}){const i=n.isPageHidden??l8.isPageHidden,o=n.onVisibilityChange??l8.onVisibilityChange,s=n.observeIntersection??l8.observeIntersection;let r=!i(),l=!0,a=!1;function u(){const f=!r||!l;f!==a&&(a=f,a?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,f=>{l=f,u()});return u(),()=>{c(),d()}}const Js="kimi-web.server-credential",qre="token",Ure=10080*60*1e3;let Eu;const rC=new Set;function Vre(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(qre);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function lC(e){return{version:1,credential:e,expiresAt:Date.now()+Ure}}function Kre(e){return JSON.stringify(e)}function l7(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function aC(e){globalThis.localStorage?.setItem(Js,Kre(e))}function Zre(){try{const e=globalThis.localStorage?.getItem(Js);if(e){const n=l7(e);if(n===void 0){const i=lC(e);let o=!1;try{aC(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Js)===e&&globalThis.localStorage?.removeItem(Js),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Js)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Js),globalThis.localStorage?.getItem(Js)===e&&globalThis.localStorage?.removeItem(Js);return}const t=globalThis.sessionStorage?.getItem(Js);if(t){const n=lC(t);let i=!1;try{aC(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(Js),i=!0}catch{}return i?n:void 0}return}catch{return}}function Gre(){const e=Vre();return e?(uz(e),!0):(Eu=Zre(),Eu!==void 0)}function Qre(){if(Eu!==void 0){if(Eu.expiresAt<=Date.now()){Yre(Eu);return}return Eu.credential}}function Yre(e){Eu=void 0;try{globalThis.sessionStorage?.removeItem(Js);const t=globalThis.localStorage?.getItem(Js),n=t==null?void 0:l7(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Js)}catch{}}function uz(e){const t=lC(e);Eu=t;try{aC(t)}catch{}try{globalThis.sessionStorage?.removeItem(Js)}catch{}}function Jre(){const e=Eu;Eu=void 0;try{const t=globalThis.localStorage?.getItem(Js),i=(t==null?void 0:l7(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(Js),globalThis.sessionStorage?.removeItem(Js)}catch{}}function Xre(e){return rC.add(e),()=>{rC.delete(e)}}function ele(){Jre();for(const e of rC)try{e()}catch{}}function $v(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function iT(e){let t=null;for(const n of e){const i=$v(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let oT;function tle(e){if(typeof Intl.Segmenter=="function")return oT??=new Intl.Segmenter("und",{granularity:"grapheme"}),oT.segment(e)}const nle=/\p{Emoji_Presentation}/u,ile=/\p{Regional_Indicator}/u,ole=/\p{Extended_Pictographic}/u,sle="️";function rle(e){return nle.test(e)||ile.test(e)?!0:ole.test(e)&&e.includes(sle)}function cz(e){const t=tle(e)?.[Symbol.iterator]().next().value;if(t===void 0||!rle(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function lle(e,t){const{rest:n}=cz(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function dz(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function ale(e){return e===void 0||e.length===0?"/":`${uC}${encodeURIComponent(e)}`}function hz(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function ule(e,t=hz()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function cle(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function dle(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function lT(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function fle(e,t=hz()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const hle=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function ple(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of hle)if(n.test(t))return i}function df(e){return Array.isArray?Array.isArray(e):mz(e)==="[object Array]"}function mle(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function cC(e){return e==null?"":mle(e)}function yr(e){return typeof e=="string"}function Jy(e){return typeof e=="number"}function gle(e){return e===!0||e===!1||vle(e)&&mz(e)=="[object Boolean]"}function pz(e){return typeof e=="object"}function vle(e){return pz(e)&&e!==null}function Bl(e){return e!=null}function G2(e){return!e.trim().length}function mz(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const yle="Incorrect 'index' type",dC="Invalid doc index: must be a non-negative integer within the bounds of the docs array",kle=e=>`Invalid value for key ${e}`,ble=e=>`Pattern length exceeds max of ${e}.`,wle=e=>`Missing ${e} property in key`,Cle=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ale="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",aT=Object.prototype.hasOwnProperty;var xle=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=gz(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function gz(e){let t=null,n=null,i=null,o=1,s=null;if(yr(e)||df(e))i=e,t=uT(e),n=Xy(e);else{if(!aT.call(e,"name"))throw new Error(wle("name"));const r=e.name;if(i=r,aT.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(Cle(Xy(r)));t=uT(r),n=Xy(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function uT(e){return df(e)?e:e.split(".")}function Xy(e){return df(e)?e.join("."):e}function Sle(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(Bl(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!Bl(u))return;if(l===r.length-1&&(yr(u)||Jy(u)||gle(u)||typeof u=="bigint"))n.push(a!==void 0?{v:cC(u),i:a}:cC(u));else if(df(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function Lle(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let a=0;a{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(yr(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function vz(e,t,{getFn:n=On.getFn,fieldNormWeight:i=On.fieldNormWeight}={}){const o=new a7({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(gz)),o.setSources(t),o.create(),o}function Nle(e,{getFn:t=On.getFn,fieldNormWeight:n=On.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new a7({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function Dle(e=[],t=On.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function Fle(e,t,n,{location:i=On.location,distance:o=On.distance,threshold:s=On.threshold,findAllMatches:r=On.findAllMatches,minMatchCharLength:l=On.minMatchCharLength,includeMatches:a=On.includeMatches,ignoreLocation:u=On.ignoreLocation}={}){if(t.length>32)throw new Error(ble(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(_,S)=>{const E=_/c;if(u)return E;const M=Math.abs(f-S);return o?E+M/o:M?1:E},v=l>1||a,y=v?Array(d):[];let C;for(;(C=e.indexOf(t,m))>-1;){const _=g(0,C);if(h=Math.min(_,h),m=C+c,v){let S=0;for(;S=M;$-=1){const R=$-1,O=n[e[R]];if(H[$]=(H[$+1]<<1|1)&O,_&&(H[$]|=(w[$+1]|w[$])<<1|1|w[$+1]),H[$]&T&&(A=g(_,R),A<=h)){if(h=A,m=R,I=_,m<=f)break;M=Math.max(1,2*f-m)}}if(g(_+1,f)>h)break;w=H}if(v&&m>=0){const _=Math.min(d-1,m+c-1+I);for(let S=m;S<=_;S+=1)n[e[S]]&&(y[S]=1)}const b={isMatch:m>=0,score:Math.max(.001,A)};if(v){const _=Dle(y,l);_.length?a&&(b.indices=_):b.isMatch=!1}return b}function Ble(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Rle,t=>yz[t]):e=>e;var c7=class{constructor(e,{location:t=On.location,threshold:n=On.threshold,distance:i=On.distance,includeMatches:o=On.includeMatches,findAllMatches:s=On.findAllMatches,minMatchCharLength:r=On.minMatchCharLength,isCaseSensitive:l=On.isCaseSensitive,ignoreDiacritics:a=On.ignoreDiacritics,ignoreLocation:u=On.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:l,ignoreDiacritics:a,ignoreLocation:u},e=l?e:e.toLowerCase(),e=a?Y0(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:Ble(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:y,score:C,indices:w}=Fle(e,m,g,{location:o+v,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});y&&(f=!0),d+=C,y&&w&&c.push(...w)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=u7(c)),h}};const Ole=new Set(["fuzzy","include"]);function Ple(e){return e.startsWith("inverse")}const fC=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new c7(e,{location:t.location??On.location,threshold:t.threshold??On.threshold,distance:t.distance??On.distance,includeMatches:t.includeMatches??On.includeMatches,findAllMatches:t.findAllMatches??On.findAllMatches,minMatchCharLength:t.minMatchCharLength??On.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??On.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??On.ignoreDiacritics,ignoreLocation:t.ignoreLocation??On.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],cT=fC.length,$le="\0",zle="|";function jle(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=jle(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[uk.AND]||e[uk.OR]),qle=e=>!!e[pC.PATH],Ule=e=>!df(e)&&pz(e)&&!mC(e),fT=e=>({[uk.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function kz(e,t,{auto:n=!0}={}){const i=o=>{if(yr(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=ak(o,t)),a}const s=Object.keys(o),r=qle(o);if(!r&&s.length>1&&!mC(o))return i(fT(o));if(Ule(o)){const a=r?o[pC.PATH]:s[0],u=r?o[pC.PATTERN]:o[a];if(!yr(u))throw new Error(kle(a));const c={keyId:Xy(a),pattern:u};return n&&(c.searcher=ak(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];df(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return mC(e)||(e=fT(e)),i(e)}function gC(e,{ignoreFieldNorm:t=On.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function Vle(e,{ignoreFieldNorm:t=On.ignoreFieldNorm}){e.forEach(n=>{n.score=gC(n.matches,{ignoreFieldNorm:t})})}var Kle=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function Zle(e){const t=[];return e.matches.forEach(n=>{if(!Bl(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function Gle(e,t,{includeMatches:n=On.includeMatches,includeScore:i=On.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=Zle(o)),i&&(r.score=o.score),r})}const Qle=/[\p{L}\p{M}\p{N}_]+/gu,hT=new WeakSet;function Yle(e){hT.has(e)||(hT.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Jle(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||Yle(e),t=>t.match(e)||[]):t=>t.match(Qle)||[]}function vC({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Jle(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=Y0(o)),i(o)}}}var Xle=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=vC({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new c7(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,l=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,a={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(a.indices=u7(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function a8(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const l of s)r.set(l,(r.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function bz(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){a8(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)nae(e,l);const i=l=>{let a=0,u=n.length;for(;a>>1;n[c]o?i(l):l,a);e.docFieldCount=s;const r=new Map;for(const[l,a]of e.docTermFieldHits)r.set(l>o?i(l):l,a);e.docTermFieldHits=r}var ff=class{constructor(e,t,n){this.options={...On,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new xle(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=ak(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof a7))throw new Error(yle);if(this._myIndex=t||vz(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=vC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=eae(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!Bl(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=vC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});tae(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(dC);this._invertedIndex&&pT(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:l}=this.options;if(yr(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return Jy(n)&&n>-1&&(f=f.slice(0,n)),f}const a=s&&Jy(n)&&n>0&&yr(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(a){const f=new Kle(n,c);yr(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),d=f.extractSorted()}else d=yr(e)?yr(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Vle(d,{ignoreFieldNorm:l}),s&&d.sort(yr(e)?c:u),Jy(n)&&n>-1&&(d=d.slice(0,n));return Gle(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:l,i:a,n:u})=>{if(!Bl(l))return;const c=i.searchIn(l);if(c.isMatch){const d={score:c.score,value:l,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const f=[d];if(!o||this._coversAllTokens(f)){const h={item:l,idx:a,matches:f};t?(h.score=gC(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=kz(e,this.options),n=this._normalizedKeys(),i=(l,a,u)=>{if(!("children"in l)){const{keyId:h,searcher:m}=l;let g;return h===null?(g=[],n.forEach((v,y)=>{g.push(...this._findMatches({key:v,value:a[y],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:m}),g&&g.length?[{idx:u,item:a,matches:g}]:[]}const{children:c,operator:d}=l,f=[];for(let h=0,m=c.length;h{if(Bl(l)){const u=i(t,l,a);u.length&&(s.has(a)||(s.set(a,{idx:a,item:l,matches:[]}),r.push(s.get(a))),u.forEach(({matches:c})=>{s.get(a).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),l=t?null:[];return s.forEach(({$:a,i:u})=>{if(!Bl(a))return;const c=[];let d=!1,f=!1;if(r.forEach((h,m)=>{const g=this._findMatches({key:h,value:a[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&c.length&&(!o||this._coversAllTokens(c))){const h={idx:u,item:a,matches:c};t?(h.score=gC(h.matches,{ignoreFieldNorm:n}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!Bl(t))return[];const i=[];if(df(t))t.forEach(({v:o,i:s,n:r})=>{if(!Bl(o))return;const l=n.searchIn(o);if(l.isMatch){const a={score:l.score,key:e,value:o,idx:s,norm:r,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(a.matchedMask=l.matchedMask,a.matchedTerms=l.matchedTerms,a.termCount=l.termCount),i.push(a)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const l={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(l.matchedMask=r.matchedMask,l.matchedTerms=r.matchedTerms,l.termCount=r.termCount),i.push(l)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;od7(t))};var iae=ff;const oae=/^[\uD800-\uDBFF]$/,sae=/^[\uDC00-\uDFFF]$/,rae=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var mT;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(mT||(mT={}));const Zl={Normal:1,Surname:10,Custom:100};function $a(e){var t;return e.length-(((t=e.match(rae))===null||t===void 0?void 0:t.length)||0)}function yC(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const lae=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],aae=["j","q","x"],uae=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],cae={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},dae=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],gT={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},vT={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function fae(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in gT)for(let n in vT){const i=`${t}${n}`,o=`${gT[t]} ${vT[n]}`;e[i]=o}return e}const yT=fae(),hae=Object.keys(yT).map(e=>({zh:e,pinyin:yT[e],probability:1e-12,length:$a(e),priority:Zl.Normal,dict:Symbol("rule")})),Cz={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},pae={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},mae=Object.keys(Cz),kC={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},gae=Object.keys(kC).map(e=>({zh:e,pinyin:kC[e],probability:1+$a(e),length:$a(e),priority:Zl.Surname,dict:Symbol("surname")})),kT={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},Ud=new wz;Object.keys(kT).forEach(e=>{const t=kT[e];for(let n of t)Ud.set(n,e)});const bT={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},vae=Object.keys(bT).map(e=>({zh:e,pinyin:bT[e],probability:2e-8,length:2,priority:Zl.Normal,dict:Symbol("dict2")})),wT={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},yae=Object.keys(wT).map(e=>({zh:e,pinyin:wT[e],probability:2e-8,length:3,priority:Zl.Normal,dict:Symbol("dict3")})),CT={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},kae=Object.keys(CT).map(e=>({zh:e,pinyin:CT[e],probability:2e-8,length:4,priority:Zl.Normal,dict:Symbol("dict4")})),AT={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},bae=Object.keys(AT).map(e=>({zh:e,pinyin:AT[e],probability:2e-8,length:5,priority:Zl.Normal,dict:Symbol("dict5")}));function xT(e,t){return e&&(e.decimalt.probability)?e:t}function ST(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function wae(e){return e.priority===Zl.Custom?-(e.length*e.length*100):e.priority===Zl.Surname?-(e.length*e.length*10):0}function Cae(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+wae(o),patterns:r.patterns,concatPattern:o};ST(u),n[a]=xT(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};ST(l),n[s]=xT(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function _T(e,t){return e&&e.count<=t.count?e:t}function Aae(e){return e.priority===Zl.Custom?-(e.length*e.length*1e5):e.priority===Zl.Surname?-(e.length*e.length*100):1}function xae(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={count:Aae(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=_T(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=_T(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function Sae(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function _ae(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&Sae(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var MT;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(MT||(MT={}));class IT{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class Mae{constructor(){this.dictMap=new Map,this.queues=[],this.root=new IT(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=yC(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[$a(t.prefix)]||(this.queues[$a(t.prefix)]=[]),this.queues[$a(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=yC(t);for(let r=0;rn==="off"?c.priority!==Zl.Surname:n==="head"?c.length-1-r===0:!0);a&&o.push(Object.assign(Object.assign({},a),{index:r-a.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==Zl.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?_ae(o):i===3?xae(o,$a(t)):Cae(o,$a(t))}}const Iae=[...bae,...kae,...yae,...vae,...hae,...gae],Az=new Mae;Az.build(Iae);const Tae=new wz,Eae=()=>Tae,Lae=[];function Nae(){return Lae}const Lg=e=>{const t=Ud.get(e);return t?t.split(" ")[0]:e},Dae=e=>{const t=[],n=Nae();for(let i=0;i{const s=o?Dae(e):e,r=Az.search(s,n,i);let l=0;const a=yC(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),xz=(e,t="off")=>{const n=Eae();let i=Ud.get(e)?Ud.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=kC[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},Bae=(e,t="off")=>{let n=xz(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},ck=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of lae)if(s.startsWith(r)){let l=s.slice(r.length);aae.indexOf(r)!==-1&&uae.indexOf(l)!==-1&&(l=cae[l]),i.push(r),o.push(l);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},e9=e=>{const{final:t}=ck(e);let n="",i="",o="";return dae.indexOf(e4(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},t4=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,l=[];return e.split(" ").forEach(u=>{t.test(u)?l.push("1"):n.test(u)?l.push("2"):i.test(u)?l.push("3"):o.test(u)?l.push("4"):s.test(u)||r.test(u)?l.push("0"):l.push("")}),l.join(" ")},Rae=(e,t)=>{const n=e4(e).split(" "),i=t4(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},Sz=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function Oae(e,t,n){if(mae.indexOf(e)===-1)return Lg(e);if(t===n&&t&&Lg(t)!==t)return e4(Lg(e));if(n&&!pae[e].includes(n)){const i=Lg(n);if(i!==n){const o=t4(i),s=Cz[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function Pae(e,t){if(e==="了"&&(!t||!Ud.get(t)))return"liǎo"}function $ae(e,t){if(e==="々")return!t||!Ud.get(t)?"tóng":Ud.get(t).split(" ")[0]}function TT(e,t,n){return $ae(e,t)||Pae(e,t)||Oae(e,t,n)||Lg(e)}const zae=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function u8(e,t){return t instanceof RegExp?t.test(e):!0}const jae=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!u8(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&u8(o.origin,t.nonZhScope)&&u8(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},ET=(e,t)=>$a(e)===1&&t.multiple?Bae(e,t.surname):!1,Hae=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?t4(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?ck(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?ck(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=Sz(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?e9(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?e9(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?e9(n.result).tail:""});break}},Wae=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=e4(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=Rae(n.result,n.originPinyin))});break}}},qae=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},Uae=(e,t,n)=>{if(t.multiple&&$a(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=ck(o,t.initialPattern),{head:l,body:a,tail:u}=e9(o);let c=[];return o!==""&&(c=[o].concat(xz(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:Sz(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(t4(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Ud.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},Vae=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),Kae={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function dk(e,t){if(t=Object.assign(Object.assign({},Kae),t||{}),!zae(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array($a(e)),{list:o}=Fae(e,i,t.surname,t.segmentit,t.traditional);return o=Vae(o,t.toneSandhi),o=jae(o,t),ET(e,t)&&(o=ET(e,t)),Hae(o,t),Wae(o,t),qae(o,t),Uae(o,t,e)}var bC;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})(bC||(bC={}));bC.AllSegment;const _z=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function LT(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Mc="skill:";function Zae(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${Mc}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${Mc}`))return;const s=t.slice(1+Mc.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&f7(r.name)===s)}function f7(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(Mc)?t.slice(Mc.length):t}function Gae(e,t,n){for(const i of[`/${Mc}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function Mz(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Mc}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[..._z,...t]}const NT=new Map;function Iz(e){let t=NT.get(e);if(!t){const n=dk(e,{toneType:"none",type:"array"}),i=dk(e,{pattern:"first",toneType:"none",type:"array"});t=Qae(e,n,i),NT.set(e,t)}return t}const DT={full:[],first:[],offsets:[],literal:[]};function Qae(e,t,n){if(t.length!==n.length)return DT;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+l.length).toLowerCase()===l.toLowerCase()?(o.push(!0),s+=l.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?DT:{full:t,first:n,offsets:i,literal:o}}function wC(e,t,n,i){const o=e[t];let s=0,r=-1,l=-1,a=0,u=0;for(let f=0;f=0)return wC(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return wC(i,"full",s,s+t.length)}function tue(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=Xae(t,i),s=eue(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const nue={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function iue(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function BT(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function oue(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const l=wC(Iz(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?BT(n):void 0,desc:i.length>0?BT(i):void 0}}function sue(e,t=_z,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const l=n(s),a=Yae(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new iae(o,nue).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:iue(s.name,i),ranges:oue(s,l)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}function rue(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,l=e>s&&r>s,a=Math.min(e,l?r:s);return{left:l?t.left-i-a:t.right+i,maxWidth:a,flipped:l}}let lue=0;function aue(e,t){const n=++lue;return e.pendingSwarmBySession[t]=n,n}function h7(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function CC(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function RT(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,l=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),f=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(f===void 0)return u;r.add(f.id);const h=u.status==="running"&&f.status!=="running";return{...u,status:u.status==="running"?f.status:u.status,subagentPhase:h?f.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:f.completedAt??u.completedAt,completedAtEstimated:f.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:f.outputPreview??u.outputPreview,outputBytes:f.outputBytes??u.outputBytes,model:u.model??f.model,thinkingEffort:u.thinkingEffort??f.thinkingEffort,backgroundTaskId:f.id}});return[...e.filter(u=>!r.has(u.id)),...l]}function uue(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function cue(e,t=uue()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const due=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function fue(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function hue(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rOT(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=gue(OT(t).folded);if(r===null)return;const l=new RegExp(r,"g");function a(c){let d=0,f=s.length-1,h=0;for(;d<=f;){const m=d+f>>1;s[m]<=c?(h=m,d=m+1):f=m-1}return h}let u;for(;;){const c=l.exec(o);if(c===null)return;const d=c.index,f=d+c[0].length-1,h=a(d),m=a(f),g=n[h].map[d-s[h]],v=n[m].map[f-s[m]],y={startSeg:h,startOffset:g.start,endSeg:m,endOffset:v.start+v.length};u!==void 0&&u.startSeg===y.startSeg&&u.startOffset===y.startOffset&&u.endSeg===y.endSeg&&u.endOffset===y.endOffset||(u=y,yield y)}}const mue=/[.*+?^${}()|[\]\\]/g;function gue(e){const t=[];let n=0;for(;n=wue)return{ranges:a,truncated:!0};a.push(f)}}return{ranges:a,truncated:!1}}const Ez="kimi-transcript-search",AC="kimi-transcript-search-current";function Lz(){return globalThis.CSS?.highlights??null}function c8(e,t){const n=Lz(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){xC();return}const o=new i;for(const r of e)o.add(r);n.set(Ez,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(AC,r)}else n.delete(AC)}function xC(){const e=Lz();e?.delete(Ez),e?.delete(AC)}let Nz=null;function Aue(e){e!==null&&(Nz=e)}let $T=0,Q2=null;async function SC(e){const t=++$T,n=(async()=>{const o=await e();t===$T&&Aue(o)})(),i=(async()=>{await n,Q2!==null&&Q2.seq>t&&await Q2.promise})();return Q2={seq:t,promise:i},i}let Dz=null;function xue(e){Dz=e}const Sue=5e3;function _ue(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),Sue)})])}function Y2(){return`${Nz==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${op?"kimi_code_desktop":"kimi_code_web"}`}function zv(){const e=Dz;if(e===null){window.open(Y2(),"_blank","noopener");return}const t=()=>_ue(e);if(op){SC(t).then(()=>{window.open(Y2(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(Y2(),"_blank","noopener");return}try{n.opener=null}catch{}SC(t).then(()=>{try{n.location.href=Y2()}catch{}})}function Mue(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,l)=>(n.get(l)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function Iue(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function Tue(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const l=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function Lue(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function Nue(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function Due(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function Fue(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const Bue=5;function Rue(e,t,n,i=Bue){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const Oue={class:"error-boundary-title"},Pue=ut({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=Gt(),o=q(!1);YO(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(k(),L("div",{key:1,class:He(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),he(p(dn),{key:0,class:"error-boundary-close",size:"sm",label:p(i)("common.close"),tooltip:p(i)("common.close"),onClick:l[0]||(l[0]=a=>n("close"))},{default:ce(()=>[V(p(Se),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):ie("",!0),V(p(Se),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),x("p",Oue,B(p(i)("common.errorBoundaryTitle")),1),V(p(un),{size:"sm",onClick:s},{default:ce(()=>[We(B(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):jn(r.$slots,"default",{key:0},void 0,!0)}}),Fz=Tt(Pue,[["__scopeId","data-v-3c47f494"]]);var $ue=Object.create,p7=Object.defineProperty,zue=Object.getOwnPropertyDescriptor,Bz=Object.getOwnPropertyNames,jue=Object.getPrototypeOf,Hue=Object.prototype.hasOwnProperty,Rz=(e,t)=>function(){return t||(0,e[Bz(e)[0]])((t={exports:{}}).exports,t),t.exports},Wue=e=>{let t={};for(var n in e)p7(t,n,{get:e[n],enumerable:!0});return t},que=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Bz(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=zue(t,l))||i.enumerable});return e},Oz=(e,t,n)=>(n=e!=null?$ue(jue(e)):{},que(p7(n,"default",{value:e,enumerable:!0}),e));function Uue(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function Vue(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function Kue(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let l=s;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function Zue(e,t,n){return(n.xhtmlOut?`
      -`:`
      -`)+`
      -
        -`}function Gue(){return`
      -
      -`}function Que(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
    1. `}function Yue(){return`
    2. -`}function Jue(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function Xue(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Kue,e.renderer.rules.footnote_block_open=Zue,e.renderer.rules.footnote_block_close=Gue,e.renderer.rules.footnote_open=Que,e.renderer.rules.footnote_close=Yue,e.renderer.rules.footnote_anchor=Jue,e.renderer.rules.footnote_caption=Vue,e.renderer.rules.footnote_anchor_name=Uue;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const v=l.bMarks[a],y=l.tShift[a],C=l.sCount[a],w=l.parentType,A=h,I=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let N=I;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function ice(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,v){v=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},v),g.core.ruler.after("inline","github-task-lists",function(y){for(var C=y.tokens,w=0,A=2;A=0;C--)if(g[C].level===y)return C;return-1}function o(g,v){return d(g[v])&&f(g[v-1])&&h(g[v-2])&&m(g[v])}function s(g,v,y,C){var w=y.idPrefix+v;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(w,C)),g.children.push(a(C)),g.children.unshift(r(g,w,y,C)),y.divWrap&&(g.children.unshift(u(y,C)),g.children.push(c(C)))}function r(g,v,y,C){var w=new C("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",v]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),y.disabled===!0&&w.attrs.push(["disabled","true"]),w}function l(g,v){var y=new v("label_open","label",1);return y.attrs=[["for",g]],y}function a(g){return new g("label_close","label",-1)}function u(g,v){var y=new v("checkbox_open","div",0);return y.attrs=[["class",g.divClass]],y}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const rce=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function lce(e){return e>=55296&&e<=57343||e>1114111?65533:rce.get(e)??e}function ace(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Mo.ZERO&&e<=Mo.NINE}function cce(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_F||e>=Mo.LOWER_A&&e<=Mo.LOWER_F}function dce(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_Z||e>=Mo.LOWER_A&&e<=Mo.LOWER_Z||_C(e)}function fce(e){return e===Mo.EQUALS||dce(e)}var Ps;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ps||(Ps={}));var vd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vd||(vd={}));var hce=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ps.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=vd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ps.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ps.EntityStart:return e.charCodeAt(t)===Mo.NUM?(this.state=Ps.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ps.NamedEntity,this.stateNamedEntity(e,t));case Ps.NumericStart:return this.stateNumericStart(e,t);case Ps.NumericDecimal:return this.stateNumericDecimal(e,t);case Ps.NumericHex:return this.stateNumericHex(e,t);case Ps.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|zT)===Mo.LOWER_X?(this.state=Ps.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ps.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&Fr.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Mo.SEMI&&o!==0&&(i&Fr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=mce(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===vd.Attribute&&(o===0||fce(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Fr.VALUE_LENGTH)>>14,o!==0){if(s===Mo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==vd.Strict&&(i&Fr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&Fr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(Fr.VALUE_LENGTH|Fr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ps.NamedEntity:return this.result!==0&&(this.decodeMode!==vd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ps.NumericDecimal:return this.emitNumericEntity(0,2);case Ps.NumericHex:return this.emitNumericEntity(0,3);case Ps.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ps.EntityStart:return 0}}};function pce(e){let t="";const n=new hce(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function mce(e,t,n,i){const o=(t&Fr.BRANCH_LENGTH)>>7,s=t&Fr.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const gce=pce(uce);function m7(e,t=vd.Legacy){return gce(e,t)}var vce=Oz(sce());const jT={};function yce(e){let t=jT[e];if(t)return t;t=jT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}n4.defaultChars=";/?:@&=+$,#";n4.componentChars="";var MC=n4;const HT={};function kce(e){let t=HT[e];if(t)return t;t=HT[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=kce(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}i4.defaultChars=";/?:@&=+$,-_.!~*'()#";i4.componentChars="-_.!~*'()";var Pz=i4;function g7(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function fk(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const bce=/^([a-z0-9.+-]+:)/i,wce=/:[0-9]*$/,Cce=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ace=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),xce=["'"].concat(Ace),WT=["%","/","?",";","#"].concat(xce),qT=["/","?","#"],Sce=255,UT=/^[+a-z0-9A-Z_-]{0,63}$/,_ce=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,VT={javascript:!0,"javascript:":!0},KT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Mce(e,t){if(e&&e instanceof fk)return e;const n=new fk;return n.parse(e,t),n}fk.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Cce.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=bce.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&VT[r])&&(s=s.substr(2),this.slashes=!0)),!VT[r]&&(o||r&&!KT[r])){let u=-1;for(let m=0;m127?C+="x":C+=y[w];if(!C.match(UT)){const w=m.slice(0,g),A=m.slice(g+1),I=y.match(_ce);I&&(w.push(I[1]),A.unshift(I[2])),A.length&&(s=A.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>Sce&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),KT[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};fk.prototype.parseHost=function(e){let t=wce.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var v7=Mce,$z=Wue({decode:()=>MC,encode:()=>Pz,format:()=>g7,parse:()=>v7}),Ice=Object.defineProperty,zz=e=>{let t={};for(var n in e)Ice(t,n,{get:e[n],enumerable:!0});return t},Es=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Tce=zz({arrayReplaceAt:()=>Rce,assign:()=>Fce,countLines:()=>Ro,escapeHtml:()=>Uce,escapeRE:()=>Kce,fromCodePoint:()=>X0,has:()=>Dce,isMdAsciiPunct:()=>mk,isPunctChar:()=>pk,isPunctCode:()=>IC,isSpace:()=>Bce,isString:()=>Lce,isValidEntityCode:()=>s4,isWhiteSpace:()=>J0,lib:()=>Zce,mdurl:()=>$z,normalizeReference:()=>o4,ucmicro:()=>hk,unescapeAll:()=>ev,unescapeMd:()=>zce});const hk={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Ece(e){return Object.prototype.toString.call(e)}function Lce(e){return Ece(e)==="[object String]"}const Nce=Object.prototype.hasOwnProperty;function Dce(e,t){return Nce.call(e,t)}function Fce(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Bce(e){return e===9||e===32}function J0(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function pk(e){return hk.P.test(e)||hk.S.test(e)}const ZT=new Map;function IC(e){if(mk(e))return!0;if(e>=0&&e<128)return!1;const t=ZT.get(e);if(t!==void 0)return t;const n=pk(String.fromCharCode(e));return ZT.set(e,n),n}function mk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function o4(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Rce(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function s4(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function X0(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const jz=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Oce=new RegExp(`${jz.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Pce=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function $ce(e,t){if(t.charCodeAt(0)===35&&Pce.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return s4(i)?X0(i):e}const n=m7(e);return n!==e?n:e}function zce(e){return e.includes("\\")?e.replace(jz,"$1"):e}function ev(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Oce,(t,n,i)=>n||$ce(t,i))}const jce=/[&<>"]/,Hce=/[&<>"]/g,Wce={"&":"&","<":"<",">":">",'"':"""};function qce(e){return Wce[e]}function Uce(e){return jce.test(e)?e.replace(Hce,qce):e}const Vce=/[.?*+^$[\]\\(){}|-]/g;function Kce(e){return e.replace(Vce,"\\$&")}const Zce={mdurl:$z,ucmicro:hk};function Ro(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const Gce=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Qce=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Yce=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,y7=["references","footnotes","abbreviations","abbr","abbrs"],k7=Symbol.for("markdown-it-ts.global-state"),b7=Object.prototype.hasOwnProperty;function GT(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Ha(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ld(e){if(Array.isArray(e))return e.map(t=>Ld(t));if(Ha(e)){const t={};for(const n of Object.keys(e))t[n]=Ld(e[n]);return t}return e}function gk(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Ha(e)?Object.keys(e):[]}function TC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!TC(o[r],Hz(i.value,r)):!0)}}function Bc(e){const t=w7(e);if(t){for(const n of y7){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Xce(e,n,i);continue}i.existed?e[n]=Jce(e[n],i.value):delete e[n]}delete e[k7]}}function d8(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const EC=Symbol.for("markdown-it-ts.diagnostics");function Hv(e,t){if(e)try{const n=e[EC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[EC]=i,i}catch{return}}function cc(e){return Hv(e,!1)}function tde(e){if(e)try{const t=e[EC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Br(e){tde(e)}function ug(e,t){const n=Hv(e,!0);n&&(n.stockFast=t)}function ls(e,t){const n=Hv(e,!0);n&&(n.strategy=t)}function f8(e,t){const n=Hv(e,!0);n&&(n.chunk=t)}function Wz(e,t){const n=Hv(e,!0);n&&(n.unbounded=t)}const nde=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ide=/[\0-\x1F\x7F-\x9F]/,ode=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,sde=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var rde=class{src_Any=nde.source;src_Cc=ide.source;src_Z=sde.source;src_P=ode.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},h8={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},lde={"http:":h8,"https:":h8,"ftp:":h8,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},ade="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",ude="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function cde(){const e=ude.split("|");return ade.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var dde={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:cde(),urlAuth:!1,maxLength:1e4},QT=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},qz=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...dde,...n},this.__schemas__={...lde},this.re=t||new rde,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const C=a;a=void 0;const w=this.testSchemaAt(e,C.schema,C.lastIndex);if(w){g={schema:C.schema,index:C.index,lastIndex:C.lastIndex+w};break}}let v=g;if((!v||l&&(l.indexv.lastIndex))&&(v=l),(!v||r&&(r.indexv.lastIndex))&&(v=r),!v)break;v===l?l=void 0:v===r&&(r=void 0);const y=new QT(e,v.schema,v.index,v.lastIndex);y.schema?this.__schemas__[y.schema].normalize(y,this):this.normalize(y),t.push(y),f=v.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new QT(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},fde=Rz({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,v=Math.floor,y=String.fromCharCode;function C($){throw new RangeError(m[$])}function w($,R){const O=[];let z=$.length;for(;z--;)O[z]=R($[z]);return O}function A($,R){const O=$.split("@");let z="";O.length>1&&(z=O[0]+"@",$=O[1]),$=$.replace(h,".");const W=w($.split("."),R).join(".");return z+W}function I($){const R=[];let O=0;const z=$.length;for(;O=55296&&W<=56319&&OString.fromCodePoint(...$),T=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},b=function($,R){return $+22+75*($<26)-((R!=0)<<5)},_=function($,R,O){let z=0;for($=O?v($/700):$>>1,$+=v($/R);$>g*26>>1;z+=36)$=v($/g);return v(z+(g+1)*$/($+38))},S=function($){const R=[],O=$.length;let z=0,W=128,j=72,Q=$.lastIndexOf("-");Q<0&&(Q=0);for(let re=0;re=128&&C("not-basic"),R.push($.charCodeAt(re));for(let re=Q>0?Q+1:0;re=O&&C("invalid-input");const Me=T($.charCodeAt(re++));Me>=36&&C("invalid-input"),Me>v((2147483647-z)/le)&&C("overflow"),z+=Me*le;const Be=oe<=j?1:oe>=j+26?26:oe-j;if(Mev(2147483647/Pe)&&C("overflow"),le*=Pe}const ne=R.length+1;j=_(z-K,ne,K==0),v(z/ne)>2147483647-W&&C("overflow"),W+=v(z/ne),z%=ne,R.splice(z++,0,W)}return String.fromCodePoint(...R)},E=function($){const R=[];$=I($);const O=$.length;let z=128,W=0,j=72;for(const K of $)K<128&&R.push(y(K));const Q=R.length;let re=Q;for(Q&&R.push("-");re=z&&lev((2147483647-W)/ne)&&C("overflow"),W+=(K-z)*ne,z=K;for(const le of $)if(le2147483647&&C("overflow"),le===z){let oe=W;for(let Me=36;;Me+=36){const Be=Me<=j?1:Me>=j+26?26:Me-j;if(oe32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=ev(e.slice(t,o)),s.pos=o,s.ok=!0),s}var Vz=x7;const t9=-2;function hde(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=hde(l,t,a,n);if(f!==t9)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function gde(e,t,n){const i=r4(e,t);i<0?M7(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var vde=zz({attrGet:()=>mde,attrIndex:()=>r4,attrJoin:()=>gde,attrPush:()=>M7,attrSet:()=>pde,parseLinkDestination:()=>x7,parseLinkLabel:()=>S7,parseLinkTitle:()=>_7});function yde(e){return e.includes("\r")||e.includes("\0")}function Zz(e){return typeof e=="string"?e:e.toString()}function kde(e){if(e.inlineMode){const t=new Es("inline","",0);t.content=Zz(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const bde=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,wde=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Cde(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(wde.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(bde.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Gz=Cde;function Ade(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Qz=Ade;function YT(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function xde(e){const t=e.tokens_meta,n=e.tokens_meta.length;YT(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?Yz:Jz,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function Mde(e){const t=e.tokens_meta,n=e.tokens_meta.length;JT(e,e.delimiters);for(let i=0;i=48&&e<=57}function Ide(e){const t=e|32;return I7(e)||t>=97&&t<=102}function ej(e){const t=e|32;return t>=97&&t<=122}function Tde(e){return ej(e)||I7(e)}function Ede(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function Lde(e,t,n){let i=t+1;if(i>=n||!ej(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return Xz(o)!==o?o:null}function Nde(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Ede(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=s4(s)?X0(s):X0(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=Lde(e.src,n,i);if(o){const s=Xz(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var tj=Nde;const nj=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),NC=new Array(128),ij=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);NC[e]=`\\${t}`,ij[e]=nj[e]?t:NC[e]}function XT(e,t,n){e.pending&&e.pushPending();const i=new Es("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Dde(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return XT(e,s<256&&nj[s]?r:l,l),e.pos=n+1,!0}var oj=Dde;function Fde(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,rj="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Rde=new RegExp(`^(?:${sj}|${rj}||<\\?[\\s\\S]*?\\?>|]*>|)`),Ode=new RegExp(`^(?:${sj}|${rj})`);function lj(e){return e===32||e===9||e===10||e===12||e===13}function Pde(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||lj(t)}function $de(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function jde(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!zde(s))return!1;const r=o.slice(i).match(Rde);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Pde(l)&&e.linkLevel++,$de(l)&&e.linkLevel--}return e.pos+=l.length,!0}var aj=jde;function Hde(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=vk(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=Vz(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[o4(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const v=e.push("image","img",0);v.attrs=[["src",c],["alt",""]],v.children=g,v.content=i,a&&v.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var uj=Hde;function p8(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[o4(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var cj=Wde;function dj(e){const t=e|32;return t>=97&&t<=122}function qde(e){return e>=48&&e<=57}function Ude(e){return dj(e)||qde(e)||e===43||e===45||e===46}function Vde(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&Ude(e.charCodeAt(t));)t--;return t++,t>=e.length||!dj(e.charCodeAt(t))?null:e.slice(t)}function Kde(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=Vde(e.pending);if(!o)return!1;const s=Kde(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Zde(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||tE(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Xde(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function mj(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:T7(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function I1(e,t,n,i,o,s){const r=mj(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Xde(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=T7()}function efe(e){const t=mj(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},gj=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Es("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Es(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Es(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function iE(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return hj(e,t);case 33:return uj(e,t);case 38:return tj(e,t);case 42:case 95:return LC.tokenize(e,t);case 58:return e.md.options.linkify&&fj(e,t);case 60:return Gz(e,t)||aj(e,t);case 91:return cj(e,t);case 92:return oj(e,t);case 96:return Qz(e,t);case 126:return DC.tokenize(e,t);default:return pj(e,t)}}function vj(e){return!tfe.test(e)}var nfe=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new nE,this.ruler2=new nE,this.ruler.push("text",pj),this.ruler.push("linkify",fj),this.ruler.push("newline",hj),this.ruler.push("escape",oj),this.ruler.push("backticks",Qz),this.ruler.push("strikethrough",DC.tokenize),this.ruler.push("emphasis",LC.tokenize),this.ruler.push("link",cj),this.ruler.push("image",uj),this.ruler.push("autolink",Gz),this.ruler.push("html_inline",aj),this.ruler.push("entity",tj),this.ruler2.push("balance_pairs",Sde),this.ruler2.push("strikethrough",DC.postProcess),this.ruler2.push("emphasis",LC.postProcess),this.ruler2.push("fragments_join",Bde),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=iE(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&vj(e)){const a=new Es("text","",0);a.content=e,i.push(a);return}const o=new gj(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&vj(s.content)){const r=new Es("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const ofe=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,sfe=/[0-9a-z]/i;function rfe(e){return/^\s]/i.test(e)}function lfe(e){return/^<\/a\s*>/i.test(e)}function afe(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(rfe(l.content)&&s>0&&s--,lfe(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>afe(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const I=new Es("text","",0);I.content=a.slice(f,y),I.level=d,c.push(I)}const C=new Es("link_open","a",1);C.attrs=[["href",g]],C.level=d++,C.markup="linkify",C.info="auto",c.push(C);const w=new Es("text","",0);w.content=v,w.level=d,c.push(w);const A=new Es("link_close","a",-1);A.level=--d,A.markup="linkify",A.info="auto",c.push(A),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(pfe,gfe)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function yfe(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&yj.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function kfe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");hfe.test(i)&&vfe(n.children||[]),yj.test(i)&&yfe(n.children||[])}}var bfe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const wfe=/['"]/,oE=/['"]/g,sE="’";function J2(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Cfe(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let v=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=y,h=C),!f&&!h){m&&(r.content=J2(r.content,d.index,sE));continue}if(h)for(n=i.length-1;n>=0;n--){let I=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!wfe.test(i)||!n.children||Cfe(n.children,e)}}function xfe(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],v=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),C=e.parentType;e.parentType="blockquote";let w=!1,A;for(A=t;A=d)break;if(o.charCodeAt(c++)===62&&!_){let E=a[A]+1,M,F;o.charCodeAt(c)===32?(c++,E++,F=!1,M=!0):o.charCodeAt(c)===9?(M=!0,(u[A]+E)%4===3?(c++,E++,F=!1):F=!0):M=!1;let H=E;for(h.push(s[A]),s[A]=c;c=d,m.push(u[A]),u[A]=a[A]+1+(M?1:0),g.push(a[A]),a[A]=H-E,v.push(l[A]),l[A]=c-s[A];continue}if(w)break;let S=!1;for(let E=0,M=y.length;E";const T=[t,0];N.map=T,e.md.block.tokenize(e,t,A);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=f,e.parentType=C,T[1]=e.line;for(let _=0;_=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function Efe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&aE(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",rE[d],1);h.markup=lE[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",rE[d],-1);return g.markup=lE[d],!0}function Nfe(e){switch(e){case 9:case 32:return!0}return!1}function Dfe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Ode.source}\\s*$`),/^$/,!1]];function Ffe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var Aj=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,v=this.bsCount,y=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};Aj.prototype.Token=Es;function Rfe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:Rfe(n,i,o)}const cE=["","h1","h2"];function Ofe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=xj(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=I)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(A),h===45||h===61)){let T=A+1,b=T;for(;T=I){f=h===61?1:2;break}if(b-A>1)continue}if(a[m]<0||c&&!Sj(e,m,o,A,I))continue;let N=!1;for(let T=0,b=i.length;TA;){const N=o.charCodeAt(I-1);if(N!==9&&N!==32)break;I--}g=o.slice(A,I)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const v=h===61?"=":"-",y=e.push("heading_open",cE[f],1);y.markup=v,y.map=[t,e.line];const C=e.push("inline","",0);C.content=g,C.map=[t,e.line-1],C.children=[];const w=e.push("heading_close",cE[f],-1);return w.markup=v,e.parentType=d,!0}function _j(e){switch(e){case 9:case 32:return!0}return!1}function dE(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,v=e.eMarks,y=e.sCount,C=e.bsCount,w=m[l]+g[l];if(w>=v[l])return!1;const A=h.charCodeAt(w);if(A>=48&&A<=57){if(f=fE(e,l),f<0||(c=!0,r=w,d=Pfe(e,l,f),u&&d!==1))return!1}else if(A===42||A===45||A===43){if(f=dE(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=v[l])return!1;if(i)return!0;const I=h.charCodeAt(f-1),N=String.fromCharCode(I);if(c){const M=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(M.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const T=[l,0];e.tokens[e.tokens.length-1].map=T,e.tokens[e.tokens.length-1].markup=N;let b=!1;const _=e.tokens.length-1,S=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?$=1:$=F-M,$>4&&($=1);const R=M+$,O=e.push("list_item_open","li",1);O.markup=N;const z=[l,0];O.map=z,c&&(O.info=f-r-1===1?$fe[h.charCodeAt(r)-48]:h.slice(r,f-1));const W=e.tight,j=e.tShift[l],Q=e.sCount[l],re=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[l]=H-m[l],e.sCount[l]=F,H>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||b)&&(a=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=re,e.tShift[l]=j,e.sCount[l]=Q,e.tight=W,e.push("list_item_close","li",-1).markup=N,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let K=!1;for(let ne=0,le=S.length;ne3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+l[f],A=a[f];if(w=A||hE(s.charCodeAt(w+1)))break}else if(I>=48&&I<=57&&w+1=A){N=-1;break}const T=s.charCodeAt(N++);if(T>=48&&T<=57){if(N-w>=10){N=-1;break}continue}if((T===41||T===46)&&(N>=A||hE(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const v=r[f]+l[f],y=a[f];if(d&&!Sj(e,f,s,v,y))continue;let C=!1;for(let w=0,A=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function a(w){const A=e.lineMax;if(w>=A||e.isEmpty(w))return null;let I=!1;if(e.sCount[w]-e.blkIndent>3&&(I=!0),e.sCount[w]<0&&(I=!0),!I){const b=e.parentType;e.parentType="reference";let _=!1;for(let S=0,E=l.length;S"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:y,href:f}),e.line=r),!0):!1}function m8(e){switch(e){case 9:case 32:return!0}return!1}const qfe=65536;function g8(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Ufe(e,t){if(e.lineFlags)return(e.lineFlags[t]&r0.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!m8(l)||r===45&&m8(l)||!Ufe(e,t))return!1;for(;s=4)return!1;u=pE(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let A=0;A=4||(u=pE(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>qfe))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=C=[t+2,0]}const I=e.push("tr_open","tr",1);I.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return I1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const ey=[["table",Vfe,["paragraph","reference"]],["code",Tfe],["fence",Efe,["paragraph","reference","blockquote","list"]],["blockquote",Ife,["paragraph","reference","blockquote","list"]],["hr",Dfe,["paragraph","reference","blockquote","list"]],["list",jfe,["paragraph","reference","blockquote"]],["reference",Wfe],["html_block",Ffe,["paragraph","reference","blockquote"]],["heading",Lfe,["paragraph","reference","blockquote"]],["lheading",Ofe],["paragraph",Hfe]];var Zfe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Kfe;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new Aj(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Mj=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Mj.prototype.Token=Es;const mE=[["normalize",ffe],["block",kde],["inline",ife],["linkify",ufe],["replacements",kfe],["smartquotes",Afe],["text_join",xfe]],Gfe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Qfe={parseLinkLabel:S7,parseLinkDestination:x7,parseLinkTitle:_7};function Yfe(){return{...Gfe}}function Jfe(){return{...Qfe}}var Xfe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Zfe,this.inline=new nfe,this.ruler=new bfe;for(let e=0;e@[\]\\^_`{}~]/;function yk(e){return!ehe.test(e)}function Ng(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function n9(e,t,n){for(let i=t;i3)return yk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!yk(c))return!1;const d=nhe[s],f=ihe[s],h=ka("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(E7(c,o,1));const m=ka("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function she(e,t,n){const i=ka("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(E7(t,n,1)),e.push(ka("paragraph_close","p",-1,0))}function rhe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function b8(e,t){for(;t=1e5?vE:k8,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,yE=/[&<>"]/g,hhe=/&/g,phe=/[<>"]/g,mhe={"&":"&","<":"<",">":">",'"':"""};function w8(e){return mhe[e]||e}function Hi(e){if(e.length===0)return"";if(e.length<32)return fhe.test(e)?e.replace(yE,w8):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(hhe,"&"):t?e.replace(yE,w8):e.replace(phe,w8)}const ghe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),vhe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function Ij(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(ghe,(t,n,i)=>{if(n)return n;if(vhe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return s4(s)?X0(s):"�"}const o=m7(t);return o!==t?o:t})}const yhe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,khe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,bhe=/"/g;function l1(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function kk(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!kk(e,t,l1(e,t))}function kE(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=L7(e.slice(s,r));return a===null?null:`${a} -`}function bE(e,t,n){return t+1" -`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
    3. ${e[t]}
    4. -`}function She(e,t,n){const i=t+2;if(n===i+1)return xhe(e,i);const o=L7(e.slice(t+2,n));return o===null?null:`
    5. ${o}
    6. -`}function _he(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
      ",i.lang=s,i.open=d),{html:`${d}${Hi(c)}
      -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;A -`,l=y,a=C}let w=ty(e,v);for(;w${v}

      -`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=i9(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Nhe(r,o.maxChunks)),o9(t,r))return f8(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),M1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return f8(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),M1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&I>=c.length&&(c=null):c={marker:w,length:I})}}const v=m-f;o+=v,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=v);const y=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(y)d(m);else{const C=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(a>=C||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function o9(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Lhe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Yc(e){return e.length===0?0:Ro(e)+(e.charCodeAt(e.length-1)===10?0:1)}function $he(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function jhe(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return $he(e,n+1,e.length-1)?!zhe(e,t):!1}function Hhe(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??Rhe:e.options.fullChunkSizeChars??Fhe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Ohe:e.options.fullChunkSizeLines??Bhe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var Wv=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Yc(this.pending);if(this.pending.length=i||n>=o}function Fj(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??Ej))return"yes";const i=e.options.autoUnboundedThresholdLines??Lj;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new Wv(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){Nj(s,l)}});if(o&&C7(n,o),r.feed(t),r.flushForce(n),o&&(A7(n),i.fallbackOnGlobalState===!1)){const l=cc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const T1=(e,t,n)=>en?n:e;function Bj(e){return e.experimental?{...e,...e.experimental}:e}const AE=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],xE=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Rj(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function Khe(e,t=Math.max(0,e/40|0),n={}){const i=Bj(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:T1(Math.ceil(e/s),8e3,64e3),maxChunkLines:T1(Math.ceil(t/s),150,700),maxChunks:T1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function SE(e,t=Math.max(0,e/40|0),n={}){const i=Bj(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:T1(Math.ceil(e/s),8e3,64e3),maxChunkLines:T1(Math.ceil(t/s),150,700),maxChunks:T1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Zhe={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Ghe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Qhe={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function l4(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function s9(e,t){if(l4(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const _E=e=>l4(e)?e:Promise.resolve(e);function a0(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Hi(e)}}function Vd(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${a0(t[0])}="${Hi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
      ${t}
      -`}return`
      ${t}
      -`}function tv(e){return!e.attrs||e.attrs.length===0?`${Hi(e.content)}`:`${Hi(e.content)}`}function FC(e){const t=Hi(e.content);return e.attrs?`${t} -`:`
      ${t}
      -`}function Yhe(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

      `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function ME(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function Jhe(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function IE(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function wk(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Xhe={langPrefix:"language-",xhtmlOut:!1,breaks:!1},ny=Object.prototype.hasOwnProperty,mi={code_inline(e,t){return tv(e[t])},code_block(e,t){return FC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?Ij(s.info).trim():"",{langName:l,langAttrs:a}=Oj(r),u=n.highlight,c=Hi(s.content);if(!u)return u0(s,c,r,l,n);const d=u(s.content,l,a);return l4(d)?d.then(f=>u0(s,f||c,r,l,n)):u0(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],wk(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
      -`:`
      -`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
      -`:`
      -`:` -`},text(e,t){return Hi(e[t].content)},text_special(e,t){return Hi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function TE(e,t,n){const i=e.info?Ij(e.info).trim():"",{langName:o,langAttrs:s}=Oj(i),r=t.highlight,l=Hi(e.content);if(!r)return u0(e,l,i,o,t);const a=r(e.content,o,s);if(l4(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return u0(e,a||l,i,o,t)}function C8(e,t,n,i){switch(e.type){case"text":return t.text===mi.text?e.content.length===0?"":Hi(e.content):null;case"text_special":return t.text_special===mi.text_special?e.content.length===0?"":Hi(e.content):null;case"softbreak":return t.softbreak===mi.softbreak?i:null;case"hardbreak":return t.hardbreak===mi.hardbreak?n:null;case"html_inline":return t.html_inline===mi.html_inline?e.content:null;case"code_inline":return t.code_inline===mi.code_inline?tv(e):null;default:return null}}function epe(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===mi.text)return s.content.length===0?"":Hi(s.content);break;case"text_special":if(o.text_special===mi.text_special)return s.content.length===0?"":Hi(s.content);break;case"softbreak":if(o.softbreak===mi.softbreak)return t.breaks?t.xhtmlOut?`
      -`:`
      -`:` -`;break;case"hardbreak":if(o.hardbreak===mi.hardbreak)return t.xhtmlOut?`
      -`:`
      -`;break;case"html_inline":if(o.html_inline===mi.html_inline)return s.content;break;case"code_inline":if(o.code_inline===mi.code_inline)return tv(s);break}const r=o[s.type];if(!r)return wk(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:s9(l,s.type)}var tpe=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...mi}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,v="";for(let y=0;y0&&e[y-1].hidden?` -`:"";if(w==="list_item_open"&&(!C.attrs||C.attrs.length===0)&&y+3${this.renderInlineTokens(b.children||[],i,o)}`,y+=3;continue}}if(y+2 -`,y+=2;continue}}}if(w==="inline"){const T=C.children||[];if(T.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
      -`:`
      -`,m=i.breaks?h:` -`,g=!0);const b=T[0];switch(b.type){case"text":if(l===mi.text){v+=Hi(b.content);continue}break;case"text_special":if(a===mi.text_special){v+=Hi(b.content);continue}break;case"softbreak":if(u===mi.softbreak){v+=m;continue}break;case"hardbreak":if(c===mi.hardbreak){v+=h;continue}break;case"html_inline":if(d===mi.html_inline){v+=b.content;continue}break;case"code_inline":if(f===mi.code_inline){v+=tv(b);continue}break}}v+=this.renderInlineTokens(T,i,o);continue}const I=s[w];if(!I){const T=C.attrs;if(!C.hidden){if(!T||T.length===0)switch(w){case"hr":v+=r?`


      -`:`
      -`;continue;case"heading_open":v+=`<${C.tag}>`;continue;case"heading_close":v+=` -`;continue;case"paragraph_open":v+=`${A}

      `;continue;case"paragraph_close":v+=`

      -`;continue;case"list_item_open":{const b=e[y+1];v+=A+(b&&(b.type==="inline"||b.hidden||b.nesting===-1&&b.tag==="li")?"
    7. ":`
    8. -`);continue}case"list_item_close":v+=`
    9. -`;continue;case"bullet_list_open":v+=`${A}
        -`;continue;case"bullet_list_close":v+=`
      -`;continue;case"blockquote_open":v+=A+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"
      ":`
      -`);continue;case"blockquote_close":v+=`
      -`;continue;case"ordered_list_open":v+=`${A}
        -`;continue;case"ordered_list_close":v+=`
      -`;continue;case"table_open":v+=`${A} -`;continue;case"table_close":v+=`
      -`;continue;case"thead_open":v+=`${A} -`;continue;case"thead_close":v+=` -`;continue;case"tbody_open":v+=`${A} -`;continue;case"tbody_close":v+=` -`;continue;case"tr_open":v+=`${A} -`;continue;case"tr_close":v+=` -`;continue;case"td_open":v+=`${A}`;continue;case"td_close":v+=` -`;continue;case"th_open":v+=`${A}`;continue;case"th_close":v+=` -`;continue}else if(T.length===1){const b=T[0];if(w==="ordered_list_open"&&b[0]==="start"){v+=`${A}
        -`;continue}if(w==="td_open"&&b[0]==="style"){v+=`${A}`;continue}if(w==="th_open"&&b[0]==="style"){v+=`${A}`;continue}}}v+=this.renderToken(e,y,i);continue}if(w==="code_block"&&I===mi.code_block){v+=FC(C);continue}if(w==="fence"&&I===mi.fence){v+=TE(C,i);continue}if(w==="html_block"&&I===mi.html_block){v+=C.content;continue}const N=I(e,y,i,o,this);typeof N=="string"?v+=N:v+=s9(N,C.type)}return v}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` -`:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(ny.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),ny.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(ny.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(ny.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Xhe,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===mi.code_block)return FC(t);if(s==="html_block"&&o.html_block===mi.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):wk(t,r.xhtmlOut===!0);if(s==="fence"&&a===mi.fence)return TE(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:s9(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return epe(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
        -`:`
        -`,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,v=i.em_close,y=i.strong_open,C=i.strong_close;let w="";for(let A=0;A`;if(u===mi.softbreak&&A+3`,A+=1;continue}if(I.type==="em_open"&&!g&&!v&&A+2${_}`,A+=2;continue}}}if(I.type==="strong_open"&&!y&&!C&&A+2${_}`,A+=2;continue}}}switch(I.type){case"text":if(l===mi.text){const b=I.content.length===0?"":Hi(I.content);if(d===mi.html_inline&&A+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Be,!J&&Pe!==void 0&&(xe=Ro(e),J=xe>=Pe)),J){const U=this.parseFullDocument(e,F,n,xe,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(F,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!cc(F)?.unbounded}),U.tokens}else if(z){const U=(ue,ye,Ae)=>ueAe?Ae:ue;xe===void 0&&(xe=Ro(e));const G=le&&!ne?SE(e.length,xe,n.options):null,me=G?.maxChunkChars??(W?U(Math.ceil(e.length/j),8e3,64e3):Q??1e4),de=G?.maxChunkLines??(W?U(Math.ceil(xe/j),150,700):re??200),fe=G?.maxChunks??(W?U(Math.ceil(e.length/64e3),j,32):K),X=e.length>0&&e.charCodeAt(e.length-1)===10,Y=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&G?.strategy!=="plain";if((R||Y)&&(e.length>=me*2||xe>=de*2)&&X){const ue=bk(n,e,F,{maxChunkChars:me,maxChunkLines:de,fenceAware:G?.fenceAware??oe,maxChunks:fe});return this.cache={src:e,tokens:ue,env:F,lineCount:xe,lastSegment:void 0,globalStateReason:rl(e)},this.updateCacheLineCount(this.cache,xe),this.recordChunkedParseResult(F,R?"explicit-initial-large-doc":"default-initial-large-doc"),ue}}const se=this.parseFullDocument(e,F,n,xe);return xe=se.lineCount,this.cache={src:e,tokens:se.tokens,env:F,lineCount:xe,lastSegment:void 0,globalStateReason:rl(e)},this.updateCacheLineCount(this.cache,xe),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(F,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!cc(F)?.unbounded}),se.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ls(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=rl(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):rl(e),a=r||l;if(a){const F=i??o.env;Bc(F);const H=rl(e),$=this.parseFullDocument(e,F,n),R=$.tokens,O=$.lineCount;return this.cache={src:e,tokens:R,env:F,lineCount:O,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(F,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!cc(F)?.unbounded}),R}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?H=8:c.length>1e3?H=6:c.length>200&&(H=4),H=Math.min(H,F);let $=null;const R=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let W;const j=()=>(W===void 0&&(W=Ro(c)),W),Q=this.canDirectlyParseAppend(o),re=Q&&this.shouldUseUnboundedAppend(e,o,c);let K=!1;if(!Q)switch(R){case"lines":K=j()>=z;break;case"constructs":if(c.length>=O){K=!0;break}if(ope(c)){K=!0;break}K=j()>=z;break;case"chars":default:K=c.length>=O}if(H>0&&K){const oe=this.getTailLines(o.src,H)+c;try{const Me=this.core.parse(oe,o.env,n).tokens,Be=Me.findIndex(Pe=>Pe.map&&typeof Pe.map[1]=="number"&&Pe.map[1]>H);if(Be!==-1){const Pe=Me.slice(Be),xe=F-H;xe!==0&&this.shiftTokenLines(Pe,xe),$={tokens:Pe}}}catch{$=null}}else $=null;if(!$){const oe=F;if(re)$={tokens:l0(n,c,o.env,{mode:"stream"})},oe>0&&this.shiftTokenLines($.tokens,oe);else{const Me=this.core.parse(c,o.env,n);oe>0&&this.shiftTokenLines(Me.tokens,oe),$=Me}}let ne=0;if(o.tokens.length>0&&$.tokens.length>0){const oe=o.tokens[o.tokens.length-1],Me=$.tokens[0];try{oe.type==="inline"&&Me.type==="inline"&&(Me.children&&Me.children.length>0&&(oe.children||(oe.children=[]),this.appendTokens(oe.children,Me.children)),oe.content=(oe.content||"")+(Me.content||""),ne=1)}catch{ne=0}}const le=o.tokens.length;if($.tokens.length>ne){const oe=o.tokens,Me=$.tokens,Be=Math.min(oe.length,Me.length-ne);let Pe=0;for(let xe=Be;xe>0;xe--){let J=!0;for(let se=0;se0&&(ne+=Pe),Me.length>ne&&this.appendTokens(o.tokens,Me,ne)}if(o.src=e,o.globalStateReason=null,o.lineCount=F+(W??j()),o.tokens.length>le){const oe=this.getLastSegment(o.tokens,e,le,o.tokens.length,e.length-c.length,F);oe?o.lastSegment=oe:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,re&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ls(o.env,{area:"stream",path:re?"stream-unbounded-append":"stream-append",reason:re?"large-delta":"safe-append",unbounded:re}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ls(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,v=!h&&!c&&m,y=g||v,C=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,A=n.options?.streamChunkSizeChars,I=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,b=n.options?.autoTuneChunks!==!1,_=n.options?.streamChunkFenceAware??!0;let S=c&&o.lineCount!==void 0?o.lineCount+Ro(c):void 0;if(y){S===void 0&&(S=Ro(e));const F=(j,Q,re)=>jre?re:j,H=b&&!T?SE(e.length,S,n.options):null,$=H?.maxChunkChars??(C?F(Math.ceil(e.length/w),8e3,64e3):A??1e4),R=H?.maxChunkLines??(C?F(Math.ceil(S/w),150,700):I??200),O=H?.maxChunks??(C?F(Math.ceil(e.length/64e3),w,32):N),z=e.length>0&&e.charCodeAt(e.length-1)===10,W=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((g||W)&&(e.length>=$*2||S>=R*2)&&z){const j=bk(n,e,d,{maxChunkChars:$,maxChunkLines:R,fenceAware:H?.fenceAware??_,maxChunks:O});return this.cache={src:e,tokens:j,env:d,lineCount:S,lastSegment:void 0,globalStateReason:rl(e)},this.updateCacheLineCount(this.cache,S),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),j}}const E=this.parseFullDocument(e,d,n,S),M=E.tokens;return S=E.lineCount,this.cache={src:e,tokens:M,env:d,lineCount:S,lastSegment:void 0,globalStateReason:rl(e)},this.updateCacheLineCount(this.cache,S),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ls(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!cc(d)?.unbounded}),M}recordChunkedParseResult(e,t){const n=cc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ls(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!cc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ls(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=rl(e);jv(t)&&Bc(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Fj(n,e.length,i):"no";if(r==="yes"){const a=l0(n,e,t);return ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Ro(e):0)}}let l=i;if(r==="need-lines"&&(l=Ro(e),Dj(n,e.length,l))){const a=l0(n,e,t);return ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Ro(e):0),{tokens:M1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Ro(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Ro(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??ipe}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oA8?n.slice(n.length-A8):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Ro(s);t.lineCount=g;const v=this.getDocLineCount(e,g);return r.map&&(r.map[1]=v),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:v,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const v=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??Ro(t.src);t.tokens.splice(v,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const C=y+Ro(s);t.lineCount=C;const w=this.getDocLineCount(e,C);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const A=t.tokens[h.tbodyOpenIndex];A?.map&&(A.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` -`);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Ro(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const LE={default:Ghe,zero:Qhe,commonmark:Zhe};function ape(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function upe(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function NE(e){return e.experimental?{...e,...e.experimental}:e}function ca(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function DE(e,t,n){for(let i=0;i=4?n.quotes=[b[0],b[1],b[2],b[3]]:n.quotes=["“","”","‘","’"]}let r=DE(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=DE(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=FE(s?.options,o,"fullChunkedFallback"),u=FE(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Xfe;let m=null;const g=()=>(m||(m=new npe(n)),m);let v=null;const y=()=>(v||(v=new lpe(h)),v);let C=null;const w=()=>(C||(C=new qz({fuzzyLink:!0})),C),A=b=>!c&&!!d&&!upe(b,d),I=(b,_)=>i==="default"&&!c&&m===null&&f!==null&&b.parse===f&&A(b)&&!b.stream.enabled&&_<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.xhtmlOut===!1&&b.options.breaks===!1&&b.options.langPrefix==="language-"&&b.options.linkify===!1&&b.options.typographer===!1&&b.options.highlight===null,N=(b,_)=>i==="default"&&!c&&A(b)&&!b.stream.enabled&&!b.options.fullChunkedFallback&&_<(b.options.autoUnboundedThresholdChars??4e6)&&b.options.html===!1&&b.options.linkify===!1&&b.options.typographer===!1,T={core:h,block:h.block,inline:h.inline,get linkify(){const b=w();return Object.defineProperty(this,"linkify",{value:b,writable:!0,configurable:!0}),b},get renderer(){const b=g();return Object.defineProperty(this,"renderer",{value:b,writable:!0,configurable:!0}),b},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return A(this)},set(b){const _=NE(b);return this.options={...this.options,..._},(ca(b,"fullChunkSizeChars")||ca(b,"fullChunkSizeLines")||ca(b,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ca(b,"streamChunkSizeChars")||ca(b,"streamChunkSizeLines")||ca(b,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ca(b,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ca(b,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(_),typeof _.stream=="boolean"&&(this.stream.enabled=_.stream,v&&(v.reset(),v.resetStats())),this},configure(b){const _=typeof b=="string"?LE[b]:b;if(!_)throw new Error("Wrong `markdown-it` preset, can't be empty");if(_.options&&this.set(_.options),_.components){const S=_.components;S.core?.rules&&this.core.ruler.enableOnly(S.core.rules),S.block?.rules&&this.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&this.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&this.inline.ruler2.enableOnly(S.inline2.rules)}return this},enable(b,_){const S=Array.isArray(b)?b:[b],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const F of E){if(!F)continue;const H=F.enable(S,!0);for(let $=0;$!M.has(H));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},disable(b,_){const S=Array.isArray(b)?b:[b],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],M=new Set;for(const F of E){if(!F)continue;const H=F.disable(S,!0);for(let $=0;$!M.has(H));if(F.length)throw new Error(`Rules manager: invalid rule name ${F.join(", ")}`)}return this},use(b,..._){const S=typeof b=="function"?b:b&&typeof b.default=="function"?b.default:void 0;if(!S)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,..._],M=b;return c=!0,S.apply(M,E),this},render(b,_){let S;if(I(this,b.length)){_!==void 0&&(Br(_),S=d8("render"));const F=S?Np():0,H=S?CE(b,S):wE(b);if(S&&(S.attemptMs=Np()-F,H===null&&(S.fallbackReason="unsupported-stock-subset"),ug(_,S)),H!==null)return _!==void 0&&ls(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const E=_??{},M=this.parse(b,E);return S&&ug(E,S),g().render(M,this.options,E)},async renderAsync(b,_){let S;if(I(this,b.length)){_!==void 0&&(Br(_),S=d8("render"));const F=S?Np():0,H=S?CE(b,S):wE(b);if(S&&(S.attemptMs=Np()-F,H===null&&(S.fallbackReason="unsupported-stock-subset"),ug(_,S)),H!==null)return _!==void 0&&ls(_,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const E=_??{},M=this.parse(b,E);return S&&ug(E,S),g().renderAsync(M,this.options,E)},renderIterable(b,_={}){const S=this.parseIterable(b,_);return g().render(S,this.options,_)},async renderAsyncIterable(b,_={}){const S=await this.parseAsyncIterable(b,_);return g().renderAsync(S,this.options,_)},renderInline(b,_={}){const S=this.parseInline(b,_);return g().render(S,this.options,_)},validateLink:bj,normalizeLink:wj,normalizeLinkText:Cj,utils:Tce,helpers:{...vde},parse(b,_){if(typeof b!="string")throw new TypeError("Input data should be a String");if(_!==void 0&&Br(_),N(this,b.length)){const F=_===void 0?void 0:d8("parse"),H=F?Np():0,$=dhe(b,F);if(F&&(F.attemptMs=Np()-H,$===null&&(F.fallbackReason="unsupported-stock-subset"),ug(_,F)),$!==null)return _!==void 0&&ls(_,{area:"parse",path:"stock-fast",reason:"stock-subset"}),$}const S=_??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&A(this)){const F=Fj(this,b.length);if(F==="yes"){const H=l0(this,b,S);return ls(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}F==="need-lines"&&(E=Ro(b))}if(!this.stream.enabled){const F=b.length,H=this.options.autoTuneChunks!==!1,$=r,R=!a&&A(this),O=!!this.options.fullChunkedFallback,z=R&&F>=2e5;let W;(O||z||E!==void 0)&&(W=E??Ro(b));const j=(O||z)&&H&&!$?Khe(F,W,this.options):null;if(O||z){const Q=W??0;if(O?F>=(this.options.fullChunkThresholdChars??2e4)||Q>=(this.options.fullChunkThresholdLines??400):z){if(j&&j.strategy!=="plain"){const re=bk(this,b,S,{maxChunkChars:j.maxChunkChars,maxChunkLines:j.maxChunkLines,fenceAware:j.fenceAware,maxChunks:j.maxChunks});return _&&BE(_,O?"explicit-full-chunk":"default-large-string"),re}if(O){const re=(J,se,U)=>JU?U:J,K=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,le=re(Math.ceil(F/ne),8e3,64e3),oe=re(Math.ceil(Q/ne),150,700),Me=K?le:this.options.fullChunkSizeChars??1e4,Be=K?oe:this.options.fullChunkSizeLines??200,Pe=K?re(Math.ceil(F/64e3),ne,32):this.options.fullChunkMaxChunks,xe=bk(this,b,S,{maxChunkChars:Me,maxChunkLines:Be,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Pe});return _&&BE(_,"explicit-full-chunk"),xe}}}if(E!==void 0&&A(this)&&Dj(this,F,W??E)){const Q=l0(this,b,S);return ls(_,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),Q}}const M=rl(b);return ls(_,{area:"parse",path:"plain",reason:"default-plain"}),M1(S,M,()=>h.parse(b,S,this).tokens)},parseIterable(b,_={}){return Br(_),Whe(this,b,_)},parseAsyncIterable(b,_={}){return Br(_),qhe(this,b,_)},parseIterableToSink(b,_,S={}){return Br(S),Uhe(this,b,_,S)},parseAsyncIterableToSink(b,_,S={}){return Br(S),Vhe(this,b,_,S)},parseInline(b,_={}){if(typeof b!="string")throw new TypeError("Input data should be a String");Br(_),jv(_)&&Bc(_);const S=h.createState(b,_,this);return S.inlineMode=!0,h.process(S),S.tokens}};if(T.stream={enabled:!!n.stream,parse(b,_){return T.stream.enabled?y().parse(b,_,T):T.parse(b,_??{})},reset(){y().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},s?.components){const b=s.components;b.core?.rules&&T.core.ruler.enableOnly(b.core.rules),b.block?.rules&&T.block.ruler.enableOnly(b.block.rules),b.inline?.rules&&T.inline.ruler.enableOnly(b.inline.rules),b.inline2?.rules&&T.inline.ruler2.enableOnly(b.inline2.rules)}return d=ape(T),f=T.parse,T}var dpe=cpe;const $j=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],fpe=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],zj=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],hpe=["svg","g","path"],ppe=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],mpe=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],gpe=["action","data","href","src","srcset","poster","xlink:href","formaction"],vpe=["script"],ype=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Kd=new Set($j),jj=new Set(zj),nv=new Set([...$j,...fpe,...zj,...hpe]),Hj=new Set([...nv,...ppe]),kpe=new Set(mpe),bpe=new Set(gpe),qv=new Set(vpe),Wj=new Set(ype);function qj(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const wpe={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function Uj(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return wpe[String(o??"").toLowerCase()]??t})}const iy=new Set(["http","https","mailto","tel"]),Cpe=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Of=new Set(["http","https"]);function Vj(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const Ape=/^https?:\/\//i;function xpe(e){if(!Ape.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function Spe(e,t,n){if(!c0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function c0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function _pe(e,t){return t==="href"||t==="xlink:href"?c0(e,t)?iy:Of:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Of:(c0(e,t),iy)}function _h(e,t={}){if(xpe(e))return!1;const n=qj(Uj(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Vj(n);return s?s==="file"?!Spe(n,i,o):c0(i,o)?Cpe.has(s):!_pe(i,o).has(s):!1}function Mpe(e){const t=Uj(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Vj(qj(t).toLowerCase());return n==="http"||n==="https"}function Ipe(e,t={}){const n=String(e??"").trim();return n?_h(n,t)?"":n:""}function RE(e){return Ipe(e,{tagName:"img",attrName:"src"})}function Tpe(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,v){return f[h].nesting===1&&f[h].attrJoin("class",t),v.renderToken(f,h,m,g,v)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let v,y=!1,C=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(l!==f.src.charCodeAt(C))return!1;for(v=C+1;v<=w&&r[(v-C)%a]===f.src[v];v++);const A=Math.floor((v-C)/a);if(A=m||(C=f.bMarks[T]+f.tShift[T],w=f.eMarks[T],C=4)){for(v=C+1;v<=w&&r[(v-C)%a]===f.src[v];v++);if(!(Math.floor((v-C)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&Kj(o.children,t,n)}}function Lpe(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(Tpe,t,{render(n,i){return n[i].nesting===1?`
        `:`
        -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,T=-1;for(let b=0;b0&&(h=g.slice(0,T))}h||(f=d||void 0)}if(o)return!0;const v=!!s.env.__markstreamFinal;let y=n+1,C=!1;for(;y<=i;){const N=s.bMarks[y]+s.tShift[y],T=s.eMarks[y];if(s.src.slice(N,T).trim()===":::"){C=!0;break}y++}C||(y=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,C?y:i],w.meta={...w.meta??{},unclosed:!C&&!v},f&&w.attrSet("data-args",f),h)try{const N=JSON.parse(h);for(const[T,b]of Object.entries(N)){const _=b!=null&&typeof b=="object";w.attrSet(`data-${T}`,_?JSON.stringify(b):String(b))}}catch{const N=Epe(h);if(N)for(const[T,b]of Object.entries(N)){const _=b!=null&&typeof b=="object";w.attrSet(`data-${T}`,_?JSON.stringify(b):String(b))}else w.attrSet("data-attrs",h)}const A=[];for(let N=n+1;NN.trim().length>0)){let N=A.join(` -`);N.endsWith(` -`)||(N+=` -`),N.endsWith(` - -`)||(N+=` -`);const T=s.tokens[s.tokens.length-1];T&&(T.raw=N);const b=[];s.md.block.parse(N,s.md,s.env,b),Kj(b,n+1,n+1+A.length),s.tokens.push(...b)}const I=s.push("vmr_container_close","div",-1);return C||(I.hidden=!0,I.map=[i,i]),s.line=C?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Qa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function a4(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const Npe=/^[a-z][a-z0-9_-]*$/;function OE(e){return Npe.test(String(e??"").trim().toLowerCase())}function Sa(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return OE(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":OE(o)?o:""}function sp(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Sa(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function Dpe(...e){const t=new Set,n=[];for(const i of e)for(const o of sp(i))t.has(o)||(t.add(o),n.push(o));return n}function Fpe(e){const t=sp(e);return{key:t.join(","),tags:t}}function Zj(e){return Sa(e)}function Bpe(e,t){const n=String(e??""),i=Sa(t);if(!i)return!1;const o=Qa(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Gj(e,t){const n=Sa(t);return!!n&&!nv.has(n)&&!Bpe(e,n)}function Rpe(e,t){const n=String(e??""),i=Sa(t);if(!i)return n;const o=Qa(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Qj=Kd,Ope=nv,Yj=new Set(jj);Yj.delete("details");const Ppe=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,$pe=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,BC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,zpe=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Ck(e){return(e.match(BC)?.[1]??"").toLowerCase()}function N7(e){return/^\s*<\s*\//.test(e)}function D7(e,t){return Qj.has(t)||/\/\s*>\s*$/.test(e)}function jpe(e,t){let n=0;for(let i=0;i0&&n--;continue}D7(o,s)||n++}}return n}function PE(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Qa(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function Wpe(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Qa(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function Ak(e){const t=e;return String(t.raw??t.content??t.markup??"")}function qpe(e){const t=e;return t.meta||(t.meta={}),t.meta}function x8(e,t,n){const i=qpe(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Upe(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Qa(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Qa(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const v=g??(h.type==="html_inline"?Ck(m):"");if(!(v&&t.has(v))){r(m);return}const y=N7(m),C=!y&&D7(m,v);if(y){if(!i.length||i[i.length-1].tag!==v){r(m);return}u(m);return}if(r(m),C){x8(h,m,"");return}i.push({tag:v,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,v=!0;for(const y of h.children){const C=Ak(y),w=y.type==="html_inline"?Ck(C):"",A=w&&t.has(w);let I=C;if(v&&m&&C&&(i.length||A)){const N=m.indexOf(C,g);if(N!==-1)a(m.slice(g,N)),I=m.slice(N,N+C.length),g=N+C.length;else{if(i.length&&!A)continue;v=!1}}f(y,I,w)}v&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=Ak(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)x8(h.token,h.raw,h.inner)}function Vpe(e){return/^\s*<\s*[!?]/.test(e)}function Kpe(e){const t=new Set(Ope);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function $E(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Zpe(e,t){let n=null;for(const s of e.matchAll(Ppe)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();$E(l,t)&&zo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const A=Sa(String(w??""));A&&m.add(A)}const v=Kpe(Array.from(m)),y=new Set(Ype);for(const w of m)y.add(w);return{autoCloseInlineTagSet:y,commonHtmlTags:v,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!v.has(w)||Yj.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const v={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},v,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[v]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const v of h){const y=v;if(y.type!=="inline"||!Array.isArray(y.children))continue;const C=String(y.content??""),w=y.children.length?y.children:C.includes("<")?[{type:"text",content:C,raw:C}]:null;if(w)try{const A=Qpe(w,m);if(y.children=A.children,A.pendingBuffer){const I=C.lastIndexOf(A.pendingBuffer);if(I!==-1){const N=C.slice(0,I);y.content=N,typeof y.raw=="string"&&(y.raw=N)}}}catch(A){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",A)}}Upe(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:v}=i(f),y=[];for(let C=0;C0){const[I,N]=y[y.length-1];if(C!==N){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(C,1),C--;continue}const T=String(w.content??w.raw??"");if(T){const b=h[N],_=`${String(b.content||"")} -${T}`,S=zo(_),E=S===-1?null:PE(_,I,S+1);if(E){const M=_.slice(0,E.end),F=_.slice(E.end);b.content=M,b.loading=!1,h.splice(C,1),y.pop();const H=d(b,F)?[]:u(F,c(h,C,"paragraph"));H.length&&h.splice(C,0,...H),C--;continue}b.content=_,b.loading!==!1&&(b.loading=!0)}h.splice(C,1),C--;continue}}const A=o(w);if(A){if(Vpe(A))continue;const I=(A.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(A);if(!I||!v(I))continue;if(s(w,A),!N)I&&!new RegExp(`^\\s*<\\s*${I}\\b[^>]*\\/\\s*>`,"i").test(A)&&Wpe(A,I)>0&&y.push([I,C]);else if(y.length>0&&I&&y[y.length-1][0]===I){const[,T]=y[y.length-1],b=h[T];b.content=`${String(b.content||"")} -${A}`,b.loading=!1,y.pop(),h.splice(C,1),C--}continue}else if(y.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(C,1),C--;continue}const I=w.content||"",N=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(I);if(I){const[,T]=y[y.length-1],b=h[T];b.content=`${b.content||""} -${I}`,b.loading!==!1&&(b.loading=!N)}N&&y.pop(),h.splice(C,1),C--}else continue}if(g.size>0){const C=new Map,w=new Map,A=T=>{let b=C.get(T);return b||(b=new RegExp(`<\\s*${T}\\b`,"i"),C.set(T,b)),b},I=T=>{let b=w.get(T);return b||(b=new RegExp(`<\\s*\\/\\s*${T}\\s*>`,"i"),w.set(T,b)),b},N=[];for(let T=0;T0){const E=N[N.length-1],M=h[E.index],F=b.type==="html_block"?I(E.tag).exec(_):null;if(F){const R=F.index+F[0].length,O=_.slice(0,R),z=_.slice(R);M.content=`${String(M.content??"")} -${O}`,Array.isArray(M.children)&&M.children.push({type:"html_inline",content:``,raw:``}),N.pop();const W=d(M,z)?[]:u(z,c(h,T,"paragraph"));W.length?h.splice(T,1,...W):(h.splice(T,1),T--);continue}if(b.type!=="inline")continue;const H=Array.isArray(b.children)?b.children:[],$=jpe(H,E.tag);if($!==-1){const R=H.slice(0,$+1),O=H.slice($+1),z=R.map(W=>String(W?.content??W?.raw??"")).join("");if(M.content=`${String(M.content??"")} -${z}`,Array.isArray(M.children)&&M.children.push(...R),O.length){const W=O.map(j=>String(j.content??j.raw??"")).join("");if(W.trim()){const j=W.replace(/^\s+/,"");if(d(M,W))h.splice(T,1),T--;else if(j.startsWith("<"))h.splice(T,1,{type:"html_block",content:j});else{const Q=u(W,c(h,T,"paragraph"));h.splice(T,1,...Q)}}else h.splice(T,1),T--}else h.splice(T,1),T--;N.pop();continue}M.content=`${String(M.content??"")} -${_}`,Array.isArray(M.children)&&M.children.push(...H),h.splice(T,1),T--;continue}if(b.type!=="inline")continue;const S=Array.isArray(b.children)?b.children:[];for(const E of g)if((S.length?Hpe(S,E):A(E).test(_)&&!I(E).test(_)?1:0)>0){N.push({tag:E,index:T});break}}}{let C=0;for(let w=0;w0?C--:(h.splice(w,1),w--))}}for(let C=0;C/]+)/)?.[1]??"").toLowerCase();if(b.startsWith("!")||b.startsWith("?")){w.loading=!1;continue}if(g.has(b)){const $=String(w.content??""),R=zo($),O=R===-1?null:PE($,b,R+1);w.loading=O?!1:w.loading!==void 0?w.loading:!0;const z=O?.start??-1,W=O?O.end-O.start:0;if(z!==-1){const j=$.slice(0,z+W);let Q="";R!==-1&&R]+)))?/g;let S;for(;(S=_.exec(w.content||""))!==null;)S[1],S[2]||S[3]||S[4];const E=String(w.content??""),M=new RegExp(`<\\/\\s*${b}\\s*>`,"i").exec(E),F=M?M.index:-1,H=M?M[0].length:0;if(F!==-1){const $=E.slice(0,F+H),R=(E.slice(F+H)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:$,tag:b,loading:!1}],w.content=$,w.raw=$,R&&h.splice(C+1,0,R.startsWith("<")?{type:"html_block",content:R}:{type:"text",content:R,raw:R})}else w.children=[{type:"html_block",content:w.content,tag:b,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const b=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),_=w.children[1],S=String(_?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(_?.type==="html_inline"&&S===b)continue;m.has(b)?(w.children[0].loading=!0,w.children[0].tag=b,w.children.push({type:"html_inline",tag:b,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:b,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const b=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(b))continue;w.children=[{type:"html_block",loading:!1,tag:b,content:w.children.map(_=>_.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const A=String(w.content),I=w,N=I.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(A)&&(I.children.length=0);continue}const T=String(N.content??A).match(zpe)?.[1]?.toLowerCase()??"";if(T){if(/\/\s*>\s*$/.test(A)||Qj.has(T)){I.children=[{type:"html_inline",content:A}];continue}I.children.length=0}}})}function Xpe(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function e1e(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Xpe(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const Jj=/\.([a-z0-9]{1,15})$/i,t1e=/[_()[\]{}<>]/u,n1e=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,i1e=/[?#@]/u,o1e=/[\\/]/u,s1e=/^[\p{L}\p{N}./\\-]+$/u,r1e=/^[A-Za-z0-9-]{1,63}$/u,l1e=/^xn--[a-z0-9-]{2,59}$/i,a1e=/^(?:[A-Z]{1,6}|\d{1,8})$/u,u1e=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,c1e=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,d1e=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,f1e=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,h1e=2e3,p1e=512,m1e={},g1e=new Set(["ai","md","py","rs","sh","zip"]),Xj=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),v1e=new Set([...Xj,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),y1e=new Set(["com","dev","io","page","site"]),k1e=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),b1e=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),ch=new Map;function zE(e,t){if(!e||e.length>p1e)return t;for(ch.set(e,t);ch.size>h1e;){const n=ch.keys().next().value;if(!n)break;ch.delete(n)}return t}function iv(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function S8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return iv(n)?n:void 0}function jE(e,t){if(!iv(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function HE(e){const t=Uv(e);return iv(t)?t:void 0}function w1e(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function WE(e,t){if(!iv(t))return;const n=String(e??"").trim().split(/\s+/u).map(w1e).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>xk(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>xk(o,{marketTicker:!0}))&&(i.marketTicker=!0),iv(i)?i:void 0}function hf(e,t=!1){let n;return{options(i){return t||i==null?jE(e,n):jE(e,S8(HE(i),WE(i,n)))},remember(i){const o=HE(i);n=t?S8(n,o):S8(o,WE(i,n))},reset(){n=void 0}}}function qE(e){return r1e.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function C1e(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return qE(n)||l1e.test(n)?t.every(qE):!1}function eH(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function A1e(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function x1e(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function tH(e,t,n){const i=A1e(t);return eH(e)&&x1e(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function S1e(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Uv(e){const t=String(e??""),n=ch.get(t);return n?(ch.delete(t),ch.set(t,n),n):S1e(t)?zE(t,{explicitFilename:c1e.test(t),filename:d1e.test(t),marketTicker:f1e.test(t)}):zE(t,m1e)}function _1e(e){return C1e(e.split(/[\\/]/)[0]??"")}function M1e(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function I1e(e){if(t1e.test(e)||!s1e.test(e))return!0;if(o1e.test(e))return!_1e(e);const t=e.replace(Jj,"");return eH(t)?!0:t.split(".").filter(Boolean).some(M1e)}function T1e(e,t,n){if(!(n?v1e:Xj).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?u1e:a1e).test(i)}function xk(e,t={}){if(!e||n1e.test(e)||i1e.test(e))return!1;const n=e.match(Jj);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return T1e(e,i,t.marketTicker===!0)?!0:b1e.has(i)?!g1e.has(i)||t.filename?!0:I1e(e):!!(t.explicitFilename&&y1e.has(i)||t.filename&&k1e.has(i))}const nH=new WeakMap,iH=new WeakSet;function RC(e,t){return nH.set(e,t),e}function E1e(e){return nH.get(e)}function L1e(e){iH.add(e)}function N1e(e){return e===void 0||iH.has(e)}const UE=["!"];function VE(e){return e==="linkify"||e==="autolink"?e:"recovery"}function il(e){return{type:"text",content:e,raw:e}}function Pf(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function $f(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Jc(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return RC({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function D1e(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(il(t))}}function KE(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function B1e(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function ZE(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?GE(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=Uv(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=GE(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const v=g.content[h],y=g.content.slice(0,h);let C=g.content.slice(h);for(let I=m+1;I0&&(e.splice(m+1,w),a=m+1);let A=c;if(v==="!"&&f!==-1)A=c.slice(0,f);else if(C){const I=encodeURI(C);if(I&&c.endsWith(I))A=c.slice(0,c.length-I.length);else{const N=v?encodeURI(v):"",T=N?c.indexOf(N):-1;T!==-1&&(A=c.slice(0,T))}}A!==c&&B1e(l,A),C&&e.splice(a+1,0,il(C));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Jc(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(il(h)),e.splice(r-4,8,...a)}else a.push(RC({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(y=>y[0]==="href")?.[1]||"",d=u.find(y=>y[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const y=m[1].length;Pf(g,y)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let y=r+1;yv[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Jc(d,f,m)),$f(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];Pf(d,2),d.push(Jc(u,c,!1)),$f(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let v=c+1;for(;v{const n=t;try{const i=Q1e(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function QE(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function YE(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function JE(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function oH(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function _8(e){return oH(e)!==null}function sH(e){return/^:?-+:?$/.test(e.trim())}function U1e(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(sH)}function V1e(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function K1e(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(sH)&&V1e(n)}function Z1e(e){return e==="|"||e==="|:"}function G1e(e){const t=oH(e);return t!==null&&t.every(n=>!n.includes(":"))}function Q1e(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` -`)[0]??"",[a="",u="",...c]=r.split(` -`),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&_8(r);if(!t&&(r.includes(` -`)&&c.length===0&&_8(a)&&K1e(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>JE(m)),h=[...QE(),...f,...YE()];i.splice(o-1,3,...h)}else if(r.includes(` -`)&&c.length===0&&_8(a)&&U1e(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>JE(m)),h=[...QE(),...f,...YE()];i.splice(o-1,3,...h)}else r.includes(` -`)&&c.length===0&&G1e(a)&&Z1e(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Y1e(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var J1e=Y1e;const X1e=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Sk=X1e.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),eme=/\\[a-z]+/i,rH="(?:\\\\|\\u0008)",tme=new RegExp(String.raw`${rH}(?:${Sk})\s*\{[^}]+\}`,"i"),nme=new RegExp(String.raw`(?:${rH})?(?:${Sk})\s*\{`,"i"),ime=/\\(?:text|frac|left|right|times)/,ome=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,sme=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,rme=/[A-Z]+\s*\([^)]+\)/i,lme=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,ame=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,ume=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,cme={"\b":"\\b","\v":"\\v","\f":"\\f"};function dme(e){let t="";for(const n of e)t+=cme[n]??n;return t}function yd(e){if(!e)return!1;const t=dme(e),n=t.trim();if(ume.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=eme.test(t),o=tme.test(t),s=nme.test(t),r=ime.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=ome.test(t)&&!sme.test(t),u=rme.test(t),c=lme.test(n),d=ame.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const lH="__markstreamMathPluginApplied",OC=80,aH=2e4,XE=aH+4096;function F7(e){return!!e[lH]}function fme(e){e[lH]=!0}const uH=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],hme=["cdot","mathbf{","partial","mu_{"],cH=uH.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),dH="[ \r\b\f\v]",pme=new RegExp(`([^\\\\])(${hme.map(e=>e).join("|")})+`,"g"),mme=/span\{([^}]+)\}/,gme=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,vme=/(^|[^\\])\\\r?\n/g,yme=/(^|[^\\])\\$/g,kme=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,bme=new RegExp(`(${dH})|(${cH})\\b`,"g"),eL=new Map,tL=new Map;function wme(e){if(!e)return bme;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=eL.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${dH})|(${o})\\b`,"g");return eL.set(n,s),s}function Cme(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=tL.get(i);if(o)return o;const s=e?[Sk,cH].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sk].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return tL.set(i,r),r}const nL={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function iL(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Ame(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&kme.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function oL(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Xc(e,t){const n=t?.commands??uH,i=t?.escapeExclamation??!0,o=t?.commands==null,s=wme(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&nL[c]!==void 0)return`\\${nL[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=Ame(r));let l=r;const a=Cme(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(mme,"span\\{$1\\}").replace(gme,"\\operatorname{span}\\{$1\\}"),l=l.replace(vme,`$1\\\\ -`),l=l.replace(yme,"$1\\\\"),l=l.replace(pme,"$1\\$2"),l}function sL(e){const t=e.trim();return!(!yd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function fH(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function PC(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=_k(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}Vv(e,a)||s++,r=a+Math.max(1,t.length)}return s}function B7(e,t,n){const i=sv(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!sv(i.slice(0,o)).trim()||Vv(i,o))return-1;const s=fH(i);if(_k(s,o))return-1;const r=rL(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>rL(i,n,0,o,s))return-1;return o}function ov(e){return e===" "||e===" "}function sv(e){let t=e.length;for(;t>0&&ov(e[t-1]);)t--;return e.slice(0,t)}function lL(e){let t=0;for(let n=0;n=48&&t<=57}function Sme(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function _me(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function Mme(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(_me)}function Ime(e){let t=0;if(!aL(e[t]))return!1;for(;aL(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:ov(e[t+1])}function hH(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&ov(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&ov(t[1])||Ime(t)||Sme(t)||Mme(t))}function uL(e,t){return e?t?`${e} -${t}`:e:t}function $C(e){const t=String(e??"").trim();return t?yd(t):!1}function cL(e){let t=0;for(let n=0;nOC){h=!0;break}const g=o[m],v=Gp(g,c);if(v!==-1){const y=uL(f,g.slice(0,v));if(!$C(y)){h=!0;break}const C=g.slice(v+c.length),w=C.trim()?`suffix:${cL(C)}`:"nosuffix";return["closed",u,i+l,d,i+m,v,cL(y),w].join(":")}if(hH(g)){h=!0;break}if(f=uL(f,g),f.length>aH){h=!0;break}}if(!h&&$C(f))return["pending",u,i+l,d].join(":")}}return null}function I8(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function Eme(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function T8(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function Lme(e,t){fme(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(C,w)=>{let A=w;for(;A=3&&(!A||/\s/.test(A))){const I=a.push("text","",0);return I.content=a.src.slice(a.pos,C),a.pos=C,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,v=m;const y=m;for(const[C,w]of f){const A=a.src,I=fH(A),N=xme(A,c);let T=!1;C==="$$"&&g!==y&&(g=y);let b=-1,_=-1,S=0;const E=M=>{if((M==="undefined"||M==null)&&(M=""),M==="\\"){a.pos=a.pos+M.length,g=a.pos;return}if(M==="\\)"||M==="\\("){const $=a.push("text_special","",0);$.content=M==="\\)"?")":"(",$.markup=M,a.pos=a.pos+M.length,g=a.pos;return}if(!M)return;if(C==="$$"&&M.includes("$")){let $=0;for(;$0&&M[R-1]==="$"||R+10){const O=M.slice(0,F),z=a.push("text","",0);z.content=O,a.pos=a.pos+O.length,g=a.pos}const $=M.slice(F).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if($){const[,O,z]=$,W=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),j=W?W[1]:z,Q=W&&W[2]?W[2]:null,re=a.push("image","img",0);re.attrs=[["src",j],["alt",O]],Q&&re.attrs.push(["title",Q]),re.content=O,re.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+$[0].length,g=a.pos;const K=M.slice(F+$[0].length);K&&E(K);return}const R=a.push("text","",0);R.content=M,a.pos=a.pos+M.length,g=a.pos;return}const H=a.push("text","",0);H.content=M,a.pos=a.pos+M.length,g=a.pos};for(;!(g>=A.length);){const M=A.indexOf(C,g);if(M===-1)break;if(Vv(A,M)){g=M+Math.max(1,C.length);continue}const F=_k(I,M);if(F){g=F[1];continue}const H=_k(N,M);if(H){g=H[1];continue}if(M===b&&g===_){if(S++,S>2){g=M+Math.max(1,C.length);continue}}else S=0,b=M,_=g;if(C==="("&&M>0){let K=M-1;for(;K>=0&&A[K]===" ";)K--;if(K>=0&&A[K]==="]"){g=M+C.length;continue}}if(C==="$"&&M>0&&A[M-1]==="$"){g=M+1;continue}if(C==="$"&&M=A.length);){const F=PC(A,M);if(F===-1)break;if(F+10&&A[F-1]==="$"){M=F+1;continue}const H=M8(A,F+1);if(H===-1)break;const $=A.slice(F+1,H),R=$.includes("`"),O=!$||!$.trim(),z=A[H+1],W=I8($,z),j=T8($);if(!R&&!O&&!W&&!j){const Q=A.slice(g,F);Q&&E(Q);const re=a.push("math_inline","math",0);re.content=Xc($,t),re.markup="$",re.raw=`$${$}$`,re.loading=!1,g=H+1,M=H+1}else E("$"),M=F+1}M{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),v=!1,y="",C="",w=!1,A="",I=!1;for(const[Q,re]of h)if(g.startsWith(Q))if(Q.includes("[")){const K=Q==="\\["?g.slice(Q.length):"";if(Q==="\\["&&Gp(K,re)===-1&&!/^\s*!\[/.test(K)&&!K.includes("`")&&yd(K)){v=!0,y=Q,C=re;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":C,S=b>=0?b:Gp(g,C,T);if(!w&&S>y.length){const Q=g.slice(N+y.length,S),re=c.push("math_block","math",0);re.content=Xc(Q),re.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",re.map=[l,l+1],re.raw=`${y}${Q}${_}`,re.block=!0,re.loading=!1,c.line=l+1;const K=g.slice(S+_.length);return K.trim()&&n(c,K,l),!0}let E=l,M="",F=!1,H="",$=l;const R=w?g:g===y?"":g.slice(y.length),O=!f&&y==="\\["?"]":"",z=Gp(R,C);if(z!==-1){const Q=z;M=R.slice(0,Q),H=R.slice(Q+C.length),$=w?l+1:l,F=!0,E=$}else for(R&&!w&&(M=R),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function Nme(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
        ${e.utils.escapeHtml(String(o.content??""))}
        `})}const Dme=/^\s]/i,Fme=/^<\/a\s*>/i;function Bme(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");Dme.test(r)&&i>0&&i--,Fme.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function Rme(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>Bme(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function Ome(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function Pme(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new dpe({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!_h(l,{tagName:"a",attrName:"href"});L1e(r),s.set({validateLink:r})}return Ome(s),Rme(s),(e.enableMath??!0)&&Lme(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Lpe(s),e.enableFixIndentedCodeBlock!==!1&&e1e(s),R1e(s),z1e(s),P1e(s),q1e(s),Nme(s),Jpe(s,{customHtmlTags:e.customHtmlTags}),s}function Mh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Mh(n))),t}function $me(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function zme(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function jme(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function oy(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function dL(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function fL(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function Ume(e,t){const n=[],i=[],o=[],s=[],r=e.split(Wme),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!gH.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(fL(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(fL(g,a))}else{dL(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&dL(n,i,o,s);const d=n.join(` -`),f=i.join(` -`);return{original:t&&l&&d?`${d} -`:d,updated:t&&l&&f?`${f} -`:f}}function R7(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=Hme(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=Ume(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function Vme(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function Kme(){return{type:"hardbreak",raw:`\\ -`}}function Zme(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Kd.has(e)}function Gme(e){if(!e||e.length===0)return hL();const t=L8.get(e);if(t)return t;const n=e.map(Sa).filter(Boolean);if(!n.length){const o=hL();return L8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:f4({customHtmlTags:e})};return L8.set(e,i),i}function bH(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function Qme(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function Mk(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function Yme(e,t,n){const i=e.slice();return Mk(i,"href")||i.push(["href",t]),n!=null&&!Mk(i,"title")&&i.push(["title",n]),i}function zC(e){return e.map(bH).join("")}function r9(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:r9(i.children)});continue}t.push(i)}return t}function Jme(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(I.toLowerCase())||(g+=I),y=!0,v=!0}const C=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=w.exec(l))!==null;){const I=A[1],N=A[2]||A[3]||A[4]||"";C.push([I,N])}if(u?.has(a)){const I=Qme(e);return[{type:a,tag:a,attrs:C,content:I?I.inner:h.innerTokens.length?zC(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:I?.raw??g,loading:e.loading||v,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:C,content:g,children:m,raw:g,loading:v,autoClosed:y},h.nextIndex]}function wH(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>wH(t)).join(""):String(e.content??"")}function ege(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>wH(t)).join("")}function pL(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=ege(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function tge(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function nge(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function oge(e,t,n){const i=e.slice();return Ik(i,"href")||i.push(["href",t]),n!=null&&!Ik(i,"title")&&i.push(["title",n]),i}function sy(e,t,n){const i=e[t],o=ige(i.attrs),s=String(Ik(o,"href")??""),r=Ik(o,"title"),l=r==null?null:String(r),a=oge(o,s,l);let u=t+1;const c=[];let d=!0;for(;uv.type==="strong_open")){const v=String(h.content??""),y=String(h.raw??v),C=Mh(h);C.content=v.slice(0,-2),C.raw=y.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=C}const m=Io(f,void 0,void 0,n),g=m.map(v=>{const y=v;return"content"in v?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,vge=/\p{P}/u,yge=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,kge=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,bge=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,wge=/:\/\//,jC=1,CH=2,Cge=4,Age=8,AH=16,sd=32,l9=64,Dg=128,xH=256,xge=512,Fg=1024,Sge=1982;function ry(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Zd(e){return!!e&&mge.test(e)}function Gd(e){return!!e&&(gge.test(e)||vge.test(e))}function _H(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&yge.test(e)}function MH(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&kge.test(e)}function Mge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Zd(i)?!1:!(Gd(i)&&!_H(i,n)&&n&&!Zd(n)&&!Gd(n))}function Ige(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Zd(n)?!1:!(Gd(n)&&!MH(n,i)&&i&&!Zd(i)&&!Gd(i))}function Tge(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Zd(i)?!1:!(Gd(i)&&!_H(i,n)&&n&&!Zd(n)&&!Gd(n))}function Lge(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Zd(n)?!1:!(Gd(n)&&!MH(n,i)&&i&&!Zd(i)&&!Gd(i))}function Nge(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const Rge=/[\p{L}\p{N}]/u,Oge=/^[\p{L}\p{N}]+$/u;function HC(e){return e?Rge.test(e):!1}function IH(e){return e?Oge.test(e):!1}function d0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function jge(e){return e?bge.test(e)||wge.test(e):!1}function Hge(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function Io(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=Uv(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(J,se){const U=e.length===1?t:String(se.content??""),G=[],me=Pge(J);if(me!==-1){I(J.slice(0,me),J.slice(0,me));const fe=J.slice(me);return fe&&(E({type:"text",content:fe,raw:fe}),c--),c++,!0}if(dge.test(J)){const fe=J.indexOf("~~");fe!==-1&&G.push({type:"strikethrough",index:fe})}if(fge.test(J)){const fe=J.indexOf("**");fe!==-1&&G.push({type:"strong",index:fe})}if(/[^*]*\*[^*]+/.test(J)){const fe=U?SH(U,0):J.indexOf("*");if(U&&fe===-1)return!1;fe!==-1&&G.push({type:"emphasis",index:fe})}G.sort((fe,X)=>fe.index!==X.index?fe.index-X.index:fe.type===X.type?0:fe.type==="strong"?-1:X.type==="strong"?1:0);const de=G[0];if(!de)return!1;if(de.type==="strikethrough"){const fe=de.index,X=fe>-1?J.slice(0,fe):"";if(X&&I(X,X),fe===-1)return c++,!0;const Y=J.indexOf("~~",fe+2),ue=Y===-1?J.slice(fe+2):J.slice(fe+2,Y),ye=Y===-1?"":J.slice(Y+2),{node:Ae}=gL([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ue,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),A(Ae),ye&&(E({type:"text",content:ye,raw:ye}),c--),c++,!0}if(de.type==="strong"){const fe=de.index,X=fe>-1?J.slice(0,fe):"";if(X&&I(X,X),fe===-1)return c++,!0;if(t&&fe===0){let be=!1,pe=0;for(;pe=2)return I(J,J),c++,!0}}if(t&&(J.match(/\*/g)||[]).length>_ge(t))return I(J.slice(X.length),J.slice(X.length)),c++,!0;const Y=d0(J,fe);if(Y.len>=3){const be=zge(J,fe+Y.len);if(be!==-1){const pe=J.slice(fe+Y.len,be);if($ge(pe)){const{node:Te}=cg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),A(Te);const qe=J.slice(be+3);return qe&&(E({type:"text",content:qe,raw:qe}),c--),c++,!0}}}if(!Ege(J,fe)){const be=J.slice(fe,fe+Y.len);I(be,be);const pe=J.slice(fe+Y.len);return pe&&(E({type:"text",content:pe,raw:pe}),c--),c++,!0}const ue=Nge(J,fe+2);let ye="",Ae="";if(ue.index!==-1){ye=J.slice(fe+2,ue.index),Ae=J.slice(ue.index+2);const be=ue.index,pe=d0(J,be);if(Y.intraword&&pe.intraword&&!IH(ye)||!ye&&Y.len>=4&&Y.intraword)return I(J.slice(X.length),J.slice(X.length)),c++,!0}else{if(d||ue.sawInvalidClose||Y.intraword)return I(J.slice(X.length),J.slice(X.length)),c++,!0;ye=J.slice(fe+2),Ae=""}if(!ye&&/^\*+$/.test(Ae))return I(J,J),c++,!0;const{node:Le}=cg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ye,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),A(Le),Ae&&(E({type:"text",content:Ae,raw:Ae}),c--),c++,!0}if(de.type==="emphasis"){let fe=de.index;fe===-1&&(fe=0);const X=J.slice(0,fe);if(X&&I(X,X),!Mge(J,fe)){I(J[fe],J[fe]);const be=J.slice(fe+1);return be&&(E({type:"text",content:be,raw:be}),c--),c++,!0}const Y=d0(J,fe),ue=Tge(U,J,fe+1),ye=ue.index,Ae=e[c+1];if(i?.final&&Ae?.type==="em_open"&&ye!==-1&&J.slice(fe+1,ye).trim()!==J.slice(fe+1,ye)||ye===-1&&(ue.sawInvalidClose||i?.final||Y.intraword||!HC(J[fe+1])))return I(J.slice(fe),J.slice(fe)),c++,!0;const{node:Le}=oy([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ye>-1?J.slice(fe+1,ye):J.slice(fe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),A(Le),ye!==-1&&ye{for(let Le=0;Le=0&&Ae[pe]==="\\";pe--)be++;if(be%2===0)return Le}return-1})(J);if(G===-1)return!1;let me=1;for(let Ae=G+1;Aede?.type==="math_inline")||!hge.test(J))return null;const U=se.parseInline(J,{__markstreamFinal:!!i?.final});if(!Array.isArray(U)||U.length===0)return null;const G=(U.find(de=>de?.type==="inline")?.children??[]).filter(de=>!(de?.type==="text"&&String(de.content??"")===""));if(!G.length||!G.some(de=>de?.type!=="text")||G.length===1&&G[0]?.type==="text"&&String(G[0].content??"")===J)return null;const me=Io(G,J,n,i);return me.length?me:null}function C(J){m(),a.push(J)}function w(J){m();const se=Mh(J);a.push(se)}function A(J){C(J)}function I(J,se){u?(u.content+=J,u.raw+=se??J):(u={type:"text",content:String(J??""),raw:String(se??J??"")},a.push(u))}function N(J,se){if(!J)return;const U=Io([{...se,type:"text",content:J,raw:J}],J,n,i);if(U.length===1&&U[0]?.type==="text"){const G=U[0];I(String(G.content??""),String(G.raw??G.content??""));return}for(const G of U)A(G)}function T(J,se){return String(J.markup??"").startsWith(se)}function b(J){if(!u||J.loading!==!0||J.markup!=="\\(\\)")return;const se=e[c-1];!se||se.type!=="text"||!T(se,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function _(J){return J.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function S(J,se,U=ry(J)){let G=J;const me=String(se.content??"");return(U&jC)!==0&&G.endsWith("\\")&&!T(se,"\\\\")&&!me.endsWith("\\\\")&&(G=G.slice(0,-1)),(U&Fg)!==0&&G.endsWith("(")&&!T(se,"\\(")&&!me.endsWith("\\(")&&(G=G.slice(0,-1)),(U&CH)!==0&&/\*+$/.test(G)&&!T(se,"\\*")&&!me.endsWith("\\*")&&(G=G.replace(/\*+$/,"")),G}for(;c=0;be--){const pe=a[be];if(pe.type!=="text")break;Y=be,ue=String(pe.content??"")+ue}YY==="href")?.[1],X=String(fe??"");if(t&&X){const Y=t.indexOf("](");if(Y!==-1){const ue=t.indexOf(")",Y+2);ue===-1?U.loading=!0:U.loading&&t.slice(Y+2,ue).includes(X)&&(U.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(U.href)&&j(U,se-1)||O(U)||C(U)}function $(J){if(J.markup!=="linkify")return!1;const{node:se,nextIndex:U}=sy(e,c,i);return W(se,U)?(c=U,!0):!1}function R(J){m(),A(sge(J)),c++}function O(J){if(J.type!=="link")return!1;const se=a[a.length-1];if(!se||se.type!=="text")return!1;const U=String(se.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!U)return!1;const G=J,me=String(G.href??""),de=String(G.text??""),fe=String(U[2]??""),X=me.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!me||!(de===me||de===X||jge(de)))return!1;const Y=String(U[1]??"");return Y?(se.content=Y,se.raw=Y):a.pop(),C({...J,text:fe,children:[{type:"text",content:fe,raw:fe}],raw:`[${fe}](${me}${G.title?` "${G.title}"`:""})`}),!0}function z(J){if(J.type!=="link")return!1;const se=J,U=String(se.href??"");return U?W({href:U,title:se.title==null||se.title===""?null:String(se.title),loading:!!se.loading},c+1):!1}function W(J,se){const U=a[a.length-1];if(U?.type!=="image"||U.src||!U.loading||!String(U.raw??"").endsWith("]("))return!1;const G=e[se],me=String(G?.content??"");if(G?.type!=="text"||!me.startsWith(")"))return!1;a.pop(),u=null;const de=String(U.alt??"");C({type:"image",src:J.href,alt:de,title:J.title,raw:`![${de}](${J.href}${J.title?` "${J.title}"`:""})`,loading:!!J.loading});const fe=me.slice(1),X=Mh(G);return X.content=fe,X.raw=fe,h()[se]=X,!0}function j(J,se=c-1){if(J.type!=="link")return!1;const U=a[a.length-1],G=e[se];if(!U||U.type!=="text"||G?.type!=="text")return!1;const me=String(U.content??""),de=String(G.content??"");if(!me.endsWith("!")||!de.endsWith("!")||T(G,"\\!"))return!1;const fe=me.slice(0,-1);fe?(U.content=fe,U.raw=fe,u=U):(a.pop(),u=null);const X=J,Y=String(X.text??X.children?.map(Ae=>String(Ae?.content??Ae?.raw??"")).join("")??""),ue=String(X.href??""),ye=X.title==null||X.title===""?null:String(X.title);return C({type:"image",src:ue,alt:Y,title:ye,raw:`![${Y}](${ue}${ye?` "${ye}"`:""})`,loading:!!X.loading}),!0}function Q(J,se="",U=null){const G=String(J.alt??J.raw??"");return{type:"link",href:se,title:U,text:G,children:[J],raw:`[${G}](${se}${U?` "${U}"`:""})`,loading:!0}}function re(J){const se=J.startsWith("![")?J:`![${J}`,U=se.slice(2),G=U.indexOf("](");return{type:"image",src:"",alt:G===-1?U.replace(/\]$/,""):U.slice(0,G),title:null,raw:se,loading:!0}}function K(J){const se=J.indexOf("[![");if(se===-1||typeof t=="string"&&e.length===1&&Bge(t,se,"["))return!1;const U=J.slice(0,se);return U&&I(U,U),C(Q(re(J.slice(se+1)))),c++,!0}function ne(J){if(i?.final)return!1;const se=e[c-1];if(se?.type!=="text"||!String(se.content??"").endsWith("[")||T(se,"\\["))return!1;const U=a[a.length-1];if(U?.type==="text"&&U.content.endsWith("[")){const G=U.content.slice(0,-1);G?(U.content=G,U.raw=G,u=U):(a.pop(),u=null)}return C(Q(pL(J))),c++,!0}function le(J){if(J.type!=="link")return!1;const se=J,U=String(se.raw??""),G=String(se.text??"");if(!U.startsWith("[![")&&!G.startsWith("!["))return!1;const me=se.title==null||se.title===""?null:String(se.title);return C(Q({type:"image",src:String(se.href??""),alt:G.replace(/^!\[/,"").replace(/\]$/,""),title:me,raw:U.startsWith("[![")?U.slice(1):U,loading:!0})),!0}function oe(J){if(!J.startsWith("]("))return!1;const se=e[c-2];if(se?.type==="text"&&String(se.content??"").endsWith("[")&&T(se,"\\["))return!1;const U=a[a.length-1];if(U?.type!=="image"&&U?.type!=="link")return!1;const G=U,me=U?.type==="link"&&Array.isArray(G.children)&&G.children.length===1&&G.children[0]?.type==="image"?a.pop():null,de=me?me.children[0]:a.pop();if(!de||de.type!=="image")return!1;const fe=e[c+1];let X=String(me?.href??""),Y=me?.title==null?null:String(me.title),ue=!0;if(fe?.type==="link_open"){const{node:Ae,nextIndex:Le}=sy(e,c+1,i);X=Ae.href,Y=Ae.title,ue=!0,c=Le}else{if(X=J.slice(2),X.includes('"')){const Ae=X.split('"');X=String(Ae[0]??"").trim(),Y=Ae[1]==null?null:String(Ae[1]).trim()}c++}const ye=Q(de,X,Y);return ye.loading=ue,C(ye),!0}function Me(){const J=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&J?.type==="text"&&String(J.content??"").endsWith("[")&&T(J,"\\[")}function Be(J,se){const U=J.indexOf("[");if(U===-1)return!1;let G=J.slice(0,U);const me=J.indexOf("](",U);if(me!==-1){const de=e[c+2];let fe=J.slice(U+1,me);if(fe.includes("[")){const be=fe.indexOf("[");G+=J.slice(0,U+be+1);const pe=U+be+1;fe=J.slice(pe+1,me)}const X=e[c+1];if(J.endsWith("](")&&X?.type==="link_open"&&de){const be=e[c+4];let pe=4,Te=!0;if(be?.type==="text"){const mt=String(be.content??"");if(mt.startsWith(")")){Te=!1;const ct=mt.slice(1);if(ct){const yt=Mh(be);yt.content=ct,yt.raw=ct,h()[c+4]=yt}else pe++}else mt==="."&&pe++}N(G,se);const qe=String(de.content??"");return i?.validateLink&&!i.validateLink(qe)?I(fe,fe):C({type:"link",href:qe,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:Te}),c+=pe,!0}const Y=J.indexOf(")",me),ue=Y!==-1?J.slice(me+2,Y):"",ye=Y===-1;let Ae=G.match(/\*+$/);if(Ae&&(G=G.replace(/\*+$/,"")),N(G,se),Ae||(Ae=fe.match(/^\*+/)),!d&&Ae){const be=Ae[0].length;fe=fe.replace(/^\*+/,"").replace(/\*+$/,"");const pe=[];if(be===1?pe.push({type:"em_open",tag:"em",nesting:1}):be===2?pe.push({type:"strong_open",tag:"strong",nesting:1}):be===3&&(pe.push({type:"strong_open",tag:"strong",nesting:1}),pe.push({type:"em_open",tag:"em",nesting:1})),pe.push({type:"link",href:ue,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:ye}),be===1){pe.push({type:"em_close",tag:"em",nesting:-1});const{node:Te}=oy(pe,0,i);A(Te)}else if(be===2){pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=cg(pe,0,void 0,i);A(Te)}else if(be===3){pe.push({type:"em_close",tag:"em",nesting:-1}),pe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Te}=cg(pe,0,void 0,i);A(Te)}else{const{node:Te}=oy(pe,0,i);A(Te)}}else i?.validateLink&&!i.validateLink(ue)?I(fe,fe):C({type:"link",href:ue,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:ye});const Le=Y!==-1?J.slice(Y+1):"";return Le&&(E({type:"text",content:Le,raw:Le}),c--),c++,!0}return!1}function Pe(J){const se=J.indexOf("![");if(se===-1)return!1;const U=J.slice(0,se);return U&&!u?u={type:"text",content:U,raw:U}:U&&u&&(u.content+=U),u&&(a.push(u),u=null),C(re(J.slice(se))),c++,!0}function xe(J){if(!(J?.startsWith("[")&&n?.type==="list_item_open"))return!1;const se=J.slice(1).match(/[^\s\]]/);if(se===null)return c++,!0;if(se&&/x/i.test(se[0])){const U=se[0]==="x"||se[0]==="X";return C({type:"checkbox_input",checked:U,raw:U?"[x]":"[ ]"}),c++,!0}return!1}return a}function P7(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function vL(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function rv(e,t,n,i){const o=Wge(e,t,n);return P7(o.startLine,o.endLine,i)}function qge(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:P7(i,o,t)}function yi(e,t,n){if(!n?.includeSourceMap)return e;const i=qge(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Uge(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=P7(s,Math.max(r,l),i)),e}function Vge(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Kge(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Zge(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Am(e,t,n){const i=e[t],o=[],s=hf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&yi(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&yi(l,i,n),[l,r+1]}function Gge(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=hf(i,!0);let a=t+1;for(;au.raw).join(` -`)} -:::`},a+1]}const Qge=new Set(["warning","info","note","tip","danger","caution"]);function Yge(e){let t=0;for(;t=0;g--){const v=f[g];if(v.type==="text"&&/:+/.test(v.content)){h=g;break}}const m={type:"paragraph",children:Io((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&yi(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=Am(e,u,a.options());n?.includeSourceMap&&yi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=xm(e,u,a.options());n?.includeSourceMap&&yi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=u4(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} -${l.map(d=>d.raw).join(` -`)} -:::`},u+1]}const Xge=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function e0e(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Xge.exec(String(i.info??""));return o?Gge(e,t,o,n):null}const $7={parseContainer:(e,t,n)=>Jge(e,t,n),matchAdmonition:e0e};function xm(e,t,n){const i=[],o=hf(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&yi(r,e[t],n),[r,s+1]}function t0e(e){if(e.info?.startsWith("diff"))return R7(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function n0e(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=hf(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` -`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function i0e(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=hf(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function o0e(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:Io(a.children||[],u,void 0,n),raw:u}}function s0e(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function TH(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!v.includes(">");else if(u)u=!v.includes("?>");else if(v.startsWith("");else if(v.startsWith("");else if(v.startsWith("");else{const y=o(v);if(y)if(y.closing){for(let C=r.length-1;C>=0;C--)if(r[C]===y.tag){r.length=C;break}}else y.selfClosing||s(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function q0e(e,t,n){if(!n?.length)return!1;const i=new Set(sp(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const v=c.indexOf(">",d);if(v===-1)return null;let y=v-1;for(;y>=0&&s(c[y]);)y--;return{closing:f,tag:m,selfClosing:!f&&c[y]==="/",after:c.slice(v+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Sm(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let v=a.length-1;v>=0;v--)if(a[v]===g.tag){a.length=v;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function U0e(e,t){const n=w0e.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Sm(r.endsWith("\r")?r.slice(0,-1):r)||$H(e,o)||W0e(e,o)||q0e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function V7(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Su(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Su(e,l)){const a=V7(e,s,"`"),u=zH(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Su(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Su(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function V0e(e,t){if(!F7(t))return e;const n=t,i=CL.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?jH(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:d4(e).state;CL.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return yd(l)&&!c?e:e.slice(0,r)}function K0e(e,t,n,i,o){const s=H7(e),r=W7(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&q7(e)==null&&O8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&O8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return _L(e,t,n,i,o)}else return _L(e,t,n,i,o);return!1}function d4(e,t=P0e(),n=null,i=!1,o=0){const s=h0(t);let r=h0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);K0e(h,s,o+u,n,i)&&(a=!0),d?(r=h0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function jH(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:h0(e.committedContext),context:h0(e.context),lineBuffer:e.lineBuffer+t}}:d4(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function Z0e(e,t){if(!F7(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=c4.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?jH(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):d4(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!H0e(o.source,r)&&!z0e(t)){o.source=t,o.explicitBracketMath=a;return}const c=Tme(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),$0e(e,t,c,a)}function G0e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function HH(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function Q0e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function EL(e){return{type:"paragraph",children:e,raw:e.map(eve).join("")}}function LL(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function NL(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=D0e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(EL(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(EL(u)),a}function tve(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function p0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function nve(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Qa(t)}\s*>\s*$`,"i").test(n)}const $8=new Set(["iframe","script","style","textarea","title"]);function Kv(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=zo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let v=g.slice(1).trimStart();const y=v.startsWith("/");y&&(v=v.slice(1).trimStart());const C=v.match(/^([A-Z][\w:-]*)/i);return C?.[1]?{closing:y,end:m,selfClosing:/\/\s*>$/.test(g),tag:C[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Qa(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const v=o(g.index);return v?{start:g.index,end:v.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if($8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function DL(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function sve(e,t,n){return n?e.includes(n,t)?!0:DL(e.slice(Math.max(0,t))).includes(DL(n)):!1}function rve(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function qH(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const ave=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),uve=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function cve(e){return/\n\s*\n/.test(e)||uve.test(e)}function dve(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>ave.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!cve(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function fve(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Kv(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function hve(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=wL.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:E1(u,t,n));return wL.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function pve(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||Wj.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=zo(l);if(a===-1)return o;const u=Kv(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=qH(n,i),m=d?null:fve(f),g=m?hve(m,t,h,i):E1(f,t,h);return dve(f,g)?{...o,children:g}:o})}function mve(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function E1(e,t,n){return e.trim()?VH(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function gve(e,t,n){const i=E1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function vve(e,t,n){const i=TH({content:e}),o=zo(e),s=WH(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=gve(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function yve(e,t,n){const i=zo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Kv(o,"summary",0);if(!s)return E1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...E1(r,t,n),vve(s.raw,t,n),...E1(l,t,n)]}function UH(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const j=WH(f,"details");return j!==-1?f.slice(0,j):f})():f,[w]=UH(y?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),A=yve(C,n,qH(i,o)),I=g===-1?"":String(e[g].raw??p0(e[g])??""),N=y||g!==-1&&v?.closed===!0,T=I.replace(/[\t\r\n ]+$/,""),b=N?(()=>{const j=(v?.raw??"").lastIndexOf(T);return j===-1?t.length:h+j})():t.length,_=zo(f),S=y&&_!==-1?h+_+1:h+f.length,E=t.slice(S,b===-1?t.length:b),M=n.parse(E,{__markstreamFinal:o}),F=n.renderer.render(M,n.options,{__markstreamFinal:o}),H=b+T.length,$=N?Math.max(b+I.length,rve(t,H)):t.length,R=N?t.slice(b,$):I,O=N?t.slice(h,$):t.slice(h),z=y&&_!==-1?f.slice(0,_+1):f,W={...u,tag:"details",attrs:a4(f.slice(0,_+1)),raw:O,content:`${z}${F}${R}`,children:[...A,...w],loading:!o&&!N};if(i.includeSourceMap&&(W.sourceMap=rv(t,h,N?$:t.length,i)),r.push(W),l=N?$:t.length,g===-1&&!y)break;g!==-1&&(a=g)}return[r,l]}function kve(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&_.end<=d.end){o.splice(N,1);continue}break}I=b+T.length,o.splice(N,1)}}return o}function bve(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const v=g.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122},c=g=>{const v=g.charCodeAt(0);return v>=48&&v<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||v==='"'||v==="'"||v==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>$H(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` -`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function BL(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let v=0;v=4)return!0;continue}if(y===" ")return!0;break}return!1},r=m=>{let g=!1,v=!1;for(let y=0;y")return y}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const v=m.replace(/^[ \t]+/,"");if(!v||v.startsWith(">")||v.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(v))return-1;let y=!1,C=0;for(;C=I.length){y=!0,C++;continue}const T=I[N];if(T==="!"||T==="?"){y=!0,C+=A+1;continue}if(T==="/"){y=!0,C+=A+1;continue}const b=N;for(;N"&&S!=="/"){y=!0,C++;continue}const E=new RegExp(String.raw`<\s*\/\s*${_}\s*>`,"i"),M=/\/\s*>$/.test(I),F=E.test(m.slice(C+A+1)),H=E.test(e.slice(g+C+A+1)),$=/[\r\n]/.test(e.slice(g+C+A+1));if(y&&n.has(_)&&!M&&!F&&(H||$))return C;y=!0,C+=A+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",y=g?v?m-1:m:e.length,C=e.slice(h,y),w=g?v?`\r -`:` -`:"",A=l(C);let I=C;if(!u&&!A){const N=a(C,h);if(N!==-1){const T=w||` -`;I=`${C.slice(0,N).replace(/[ \t]+$/,"")}${T}${T}${C.slice(N).replace(/^[ \t]+/,"")}`}}f+=I,f+=w,A&&(u?A.markerChar===c&&A.markerLen>=d&&/^\s*$/.test(A.rest)&&(u=!1,c="",d=0):(u=!0,c=A.markerChar,d=A.markerLen)),h=g?m+1:e.length}return f}function Cve(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let v=g+1;for(;v=d.length||d[v]!=="/"){g=d.indexOf("<",g+1);continue}for(v++;vd.length){g=d.indexOf("<",g+1);continue}let y=!0;for(let w=0;w="A"&&A<="Z"?String.fromCharCode(A.charCodeAt(0)+32):A)!==m[w]){y=!1;break}}if(!y){g=d.indexOf("<",g+1);continue}let C=v+m.length;if(C")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r -`:` -`,c=d+1}return u}function Ave(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,v=e.slice(d,g),y=h?m?`\r -`:` -`:"",C=o(v),w=C?.prefix??"",A=C?.content??v,I=s(A);I&&(l?I.markerChar===a&&I.markerLen>=u&&/^\s*$/.test(I.rest)&&(l=!1,a="",u=0):(l=!0,a=I.markerChar,u=I.markerLen));let N=A;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return b;const M=E.slice(0,S).replace(/^[\t ]+/,"");if(M.length>0){const F=_.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=M.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!F||!H||F!==H)return b}return`${_} - -`});if(w){const T=w+N.split(` -`).join(` -${w}`);c+=T}else c+=N;c+=y,d=h?f+1:e.length}return c}function xve(e,t){if(!e||!t.length)return e;const n=new Set(t.map(M=>String(M??"").toLowerCase()));if(!n.size)return e;const i=M=>M===" "||M===" ",o=M=>{if(!M)return!1;if(M[0]===" ")return!0;let F=0;for(let H=0;H=4)return!0;continue}if($===" ")return!0;break}return!1},s=M=>{const F=M.charCodeAt(0);return F>=65&&F<=90||F>=97&&F<=122||F>=48&&F<=57||M==="_"||M==="-"||M===":"},r=M=>{let F=0;for(;F{let F=0,H=!1,$=0;for(;F=M.length||M[F]!==">")break;for(H=!0,F++;Fr(M).startsWith("<"),u=M=>{for(let F=0;F{if(o(M))return"";const F=r(M);if(!F.startsWith("<"))return"";let H=1;for(;H=F.length||F[H]==="/"||F[H]==="!"||F[H]==="?")return"";const $=H;for(;H"&&O!=="/"?"":R},d=M=>{if(o(M))return null;const F=r(M);if(!F.startsWith("<"))return null;let H=1;for(;H=F.length)return null;const $=F[H]==="/";if($)for(H++;H"&&W!=="/")return null;if($)return{type:"close",name:z};if(/\/\s*>\s*$/.test(F))return{type:"open",name:z,complete:!0};const j=F.indexOf(">",H);if(j!==-1){const Q=F.slice(j+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(Q))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=M=>{if(o(M))return null;const F=r(M).replace(/[ \t]+$/,"");if(!F.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(F))return null;const H=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const $=F.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!$?.[1]||!$[2])return null;const R=$[1].toLowerCase();return R===$[2].toLowerCase()?R:null};let h=!1,m="",g=0;const v=M=>{let F=0;for(;Fv(M),C=M=>{const F=r(M);return F?o(M)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(F):!1},w=(M,F,H)=>{let $=M,R=0;for(;$$&&e[O-1]==="\r",j=z?W?O-1:O:e.length,Q=e.slice($,j),re=l(Q),K=re?.key??"";if(R>0&&F&&K!==F)break;const ne=re?.content??Q,le=d(ne);if(le?.name===H){if(le.type==="open")le.complete||R++;else if(R>0&&(R--,R===0))return!1}else if(R>0&&(u(ne)||C(ne)))return!0;if(z)$=O+1;else break}return!1};let A="",I=0,N=!0,T=!1,b=!1,_=` -`;const S=[];let E="";for(;II&&e[M-1]==="\r",$=F?H?M-1:M:e.length,R=e.slice(I,$),O=F?H?`\r -`:` -`:"",z=l(R),W=z?.key??"",j=z?.content??R,Q=y(j);Q&&(h?Q.markerChar===m&&Q.markerLen>=g&&/^\s*$/.test(Q.rest)&&(h=!1,m="",g=0):(h=!0,m=Q.markerChar,g=Q.markerLen));const re=S.length>0;if(!h&&!re){const ne=c(j),le=!!ne&&!N&&T&&b&&w(I,W,ne);ne&&!N&&(!T||le)&&(W&&E&&W===E?A+=`${W}${_}`:W||(A+=_))}if(A+=R,A+=O,O&&(_=O),!h){const ne=d(j);if(ne){if(ne.type==="open")ne.complete||S.push(ne.name);else for(let le=S.length-1;le>=0;le--)if(S[le]===ne.name){S.length=le;break}}}const K=u(j);N=K,T=!K&&a(j),b=!K&&!!f(j),E=W,I=F?M+1:e.length}return A}function Sve(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=U7(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function z8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=Sve(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` -`)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=U0e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=sp(i.customHtmlTags);if(r.length&&(o=wve(o,r),o=Cve(o,r),o=xve(o,r),o=Ave(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=bve(o)),o}function _ve(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=qC.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-C0e-A0e),u=z8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:z8(t,n,e,i)}else l=z8(t,n,e,i);return n||(l=V0e(l,e)),qC.set(o,{source:t,safeMarkdown:l,mode:s}),l}function VH(e,t,n={}){const i=DH(n),o=i?Ra():0,s=!!n.final,r=(e??"").toString();R0e(t,n)&&(t.stream.reset(),O0e(t),qC.delete(t));const l=_ve(t,r,s,n);i&&Nd(i,"safeMarkdownMs",Ra()-o);const a=tve(l);if(a){if(n.includeSourceMap){const I={...n,__sourceLineMapper:BL(r,l)};a[0].sourceMap=rv(l,0,l.length,I)}const w=n.preTransformTokens,A=n.postTransformTokens;if(j7(t,n)||typeof w=="function"||typeof A=="function"){const I=TL(t,l,{__markstreamFinal:s},n),N=typeof w=="function"&&w(I)||I;typeof A=="function"&&A(N)}return AL(a,n,i,o)}const u=i?Ra():0,c=TL(t,l,{__markstreamFinal:s},n);if(i&&Nd(i,"tokenizeMs",Ra()-u),!c||!Array.isArray(c))return AL([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,v=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),y={...n,validateLink:v,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?BL(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let C=N0e(t,l,h,y,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const A=w[0],I=A?.type;A&&typeof I=="string"?C=Qp(w,{...y,__customHtmlBlockCursor:0},i):C=w}}if(mve(C)){const w=i?Ra():0;C=kve(C,s,l,y),C=UH(C,l,t,y,s)[0],C=pve(C,t,y,s),i&&Nd(i,"htmlBlockPassesMs",Ra()-w)}if(s){const w=new WeakSet,A=I=>{if(!I||typeof I!="object"||w.has(I))return;if(w.add(I),Array.isArray(I)){for(const T of I)A(T);return}const N=I;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const T of Object.values(N))A(T)};A(C)}return C=BH(C,n),n.debug&&console.log("Parsed Markdown Tree Structure:",C),FH(C,i,o)}function RL(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=hf(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)yi(d,a,t);for(const d of c)fu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&yi(d,a,t);const f=NL(d,t);if(f){s&&LL(f,d);for(const h of f)fu(h,a,t);n.push(...f)}else fu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const Mve=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,m0=/\d/u,Ive=/[,.!?;:,。;、!?:]/u,Tve=/\d\p{Script=Han}{1,3}$/u;function Eve(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&Eve(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,Fve=new Set([...qv,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Bve=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function OL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Rve(e){return typeof e=="string"?e:e==null?"":String(e)}function KH(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function kd(e){return Rve(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ZH(e){return kd(e).replace(/`/g,"`")}function h4(e){return String(e??"").trim().toLowerCase()}function K7(e,t="safe"){const n=h4(e);return n?t==="escape"?!0:t==="trusted"?qv.has(n):!Bve.has(n):!1}function GH(e,t="safe"){const n=h4(e);return n?t==="escape"?!0:t==="trusted"?qv.has(n):Fve.has(n):!1}function PL(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${ZH(i)}"`).join("")}function QH(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(Dve);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function Ove(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||_h(o,{tagName:t,attrName:"srcset"})})}function YH(e,t,n,i){return kpe.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?Ove(t,i):!!(bpe.has(e)&&t&&_h(t,{tagName:i,attrName:e}))}function ih(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function JH(e,t,n,i=!1){if(t!=="safe"||h4(n)!=="a")return e;const o=ih(e,"href");if(i&&(!o||!e[o])){const a=ih(e,"target"),u=ih(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=ih(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=ih(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function $L(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!KH(r)||YH(l,s,t,n)||(i[r]=s)}return JH(i,t,n,!!ih(e,"href"))}function XH(e,t){const n=e.toLowerCase();return Hj.has(n)?!1:OL(t,n)||OL(t,e)}function Z7(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!KH(r)||YH(l,s,t,n)||(i[r]=s)}return JH(i,t,n,!!ih(e,"href"))}function g0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function a9(e,t="safe",n){const i=Z7(g0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function Pve(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function $ve(e){const t={};for(const[n,i]of Object.entries(e))t[n]=Pve(i,n);return t}function j8(e){return e.trim().length>0}function eW(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);j8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=QH(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);j8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Kd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function zve(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=QH(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Kd.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function jve(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${kd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${kd(i)}`:` ${kd(i)}="${ZH(o)}"`).join("");return e.type==="self_closing"?`<${kd(t)}${n} />`:`<${kd(t)}${n}>`}function Hve(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of eW(e))if((n.type==="tag_open"||n.type==="self_closing")&&XH(n.tagName??"",t))return!0;return!1}function L1(e,t="safe"){if(!e)return"";if(t==="escape")return kd(e);const n=zve(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(kd(r.content??""));continue}const l=h4(r.tagName);if(!l)continue;if(GH(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&K7(l,t)){o.push(jve(r));continue}if(r.type==="self_closing"){o.push(`<${l}${PL($L(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${PL($L(r.attrs??{},t,l))}>`),Kd.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const Wve=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],zL="http://www.w3.org/2000/svg",qve=new Set(["script","style","iframe","object","embed","link","meta"]),Uve=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),Vve=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Kve=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Zve=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Gve(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Qve(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Yve(e){const t=e.nodeName.toLowerCase();return t==="use"?Gve(e):t==="image"?Qve(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Zve.has(t)}function Jve(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Xve(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?_h(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?_h(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":_h(s,{tagName:i,attrName:o})?"":s:""}function e2e(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function nW(e){const t=tW(e),n=t.toLowerCase();let i=0;for(;in.test(t))||nW(t)}function t2e(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function ay(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function iW(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!qve.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))iW(o,t)}}function n2e(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];iW(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=ay(t.getAttribute("width")),s=ay(t.getAttribute("height")),r=ay(t.getAttribute("x")),l=ay(t.getAttribute("y")),a=e.ownerDocument.createElementNS(zL,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(zL,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function i2e(e){n2e(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!Uve.has(i)){n.remove();continue}if(i==="style"&&jL(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&jL(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(Vve.has(r)&&s.value){const l=Xve(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Kve.has(r)&&s.value&&nW(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Jve(s.value);l!==s.value&&n.setAttribute(s.name,l)}}t2e(n)}}function Wkt(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return i2e(n),o2e(n)?null:n}catch{return null}}function o2e(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Yve(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const uy=[];function H8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function s2e(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function r2e(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function HL(e=`editor-${Date.now()}`,t={}){const n=Pme(t),i=n;i.__markstreamRegisteredPluginCount=uy.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||uy.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...v]=m;typeof g=="function"&&n.use(g,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(uy.length)for(const h of uy)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(Nve),n.use(oce),n.use(tce);const r=vce,l=r.default??r;n.use(l),n.use(ece),n.use(Xue),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,v=!!m.env?.__markstreamFinal,y=g.split(/\r?\n/);for(const C of m.tokens){if(C.type!=="fence"||!C.map||!C.markup)continue;const w=C.map[0],A=C.map[1],I=C.markup,N=I[0],T=I.length,b=y[Math.max(0,A-1)]??"";let _=0;for(;_w+1&&S>=T&&E===b.length,F=C;F.meta=F.meta??{},F.meta.unclosed=!M,F.meta.closed=!!M}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],v=String(g.info??"").trim(),y=String(g.content??""),C=btoa(unescape(encodeURIComponent(y))),w=s2e(v),A=H8(w),I=r2e(`editor-${e}-${m}-${w}`),N=H8(s("common.copy"));return`
        -
        - ${H8(w.toUpperCase())} - -
        -
        -
        `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const v=a.exec(g.src.slice(g.pos));if(!v)return!1;const y=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(y))return!1;const C=g.src.slice(g.pos+v[0].length);if(C.startsWith("](")||C.startsWith("(")||c(C))return!1;if(!m){const w=v[1],A=g.push("reference","span",0);A.content=w,A.markup=v[0],A.raw=v[0]}return g.pos+=v[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const v=String(h[m].content??"");return`${v}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const l2e="modulepreload",a2e=function(e){return"/"+e},WL={},Qo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=a2e(u),u in WL)return;WL[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":l2e,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function u2e({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function oW({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:u2e({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const c2e={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function d2e(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function sW(e){const t=d2e(e);return c2e[t]??t}function f2e(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>sW(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function h2e(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function p2e(e){return h2e(e)?.join("\0")??""}function m2e(e,t){return`${p2e(e)}\0\0${f2e(t)?.join("\0")??""}`}function Dp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function qL(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var g2e=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=UL();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=UL();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,v=b2e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(v-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),C=k2e(this.source.slice(this.visible.length),y,this.segmenter);C.text&&(this.visible+=C.text,this.charBudget=Math.max(0,this.charBudget-C.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=Dp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Dp(i,1e3,1)),this.normalizedTargetLatencyMs=Dp(o,900,1),this.normalizedCatchUpLatencyMs=Dp(s,350,1),this.normalizedCatchUpThreshold=qL(r,600),this.normalizedStartDelayMs=qL(a,80),this.maxCommitFps=Math.trunc(Dp(l,30,1)),this.maxCharsPerCommit=Math.trunc(Dp(u,80,1)),this.flushOnFinish=c,this.segmenter=y2e(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function v2e(e={},t){const n=new g2e(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function y2e(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function k2e(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function UL(){return typeof performance<"u"?performance.now():Date.now()}function b2e(e,t,n){return Math.min(n,Math.max(t,e))}var w2e=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const VC=Symbol.for("markstream-vue:node-lifecycle");function qkt(){}const G7=new Map;let rW="material";const a1=new Map,VL=new Map;let KC=null;function C2e(e){G7.set(e.id,e)}function A2e(e){const t=G7.get(rW);if(!t)return;const n=t.core[e];if(n)return n;const i=a1.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!a1.has(t.id)&&S2e(t)}function x2e(){var e,t;return(t=(e=G7.get(rW))==null?void 0:e.fallback)!=null?t:""}function S2e(e){return w2e(this,null,function*(){var t,n,i;if(a1.has(e.id))return(t=a1.get(e.id))!=null?t:null;let o=VL.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(a1.set(e.id,s),KC?.(),s)).catch(()=>(a1.set(e.id,null),null)),VL.set(e.id,o)),o})}const KL='',ZL='',_2e={id:"material",core:{"":ZL,plain:'',text:ZL,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:KL,csharp:KL,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>Qo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},M2e=Ja(0);KC=()=>{M2e.value++},C2e(_2e);const I2e={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function p4(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=I2e[n])!=null?t:n}function Ukt(e){const t=p4(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function Vkt(e){return A2e(p4(e))||x2e()}const GL={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var m4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Pr=null,dh=!1,fh=null,g4=Y7;function Zv(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Q7(){try{const e=globalThis;return Zv(e?.katex)}catch{return null}}function Y7(){return m4(null,null,function*(){const e=Q7();if(e)return e;const t=yield Qo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Qo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return Zv(t)})}function lW(e){const t=Promise.resolve(e).then(n=>{var i;return fh===t&&n?(Pr=(i=Zv(n))!=null?i:n,Pr):null}).catch(()=>null).finally(()=>{fh===t&&(fh=null)});return fh=t,dh=!0,t}function T2e(e){g4=e,Pr=null,dh=!1,fh=null}function E2e(e){T2e(Y7)}function aW(){return typeof g4=="function"}function Kkt(){var e;const t=g4;if(!t||t===Y7)return null;if(Pr)return Pr;const n=Q7();if(n)return Pr=n,Pr;if(dh)return null;try{const i=t();return i?typeof i?.then=="function"?(lW(i),null):(Pr=(e=Zv(i))!=null?e:i,Pr):null}catch{return null}}function uW(){return m4(this,null,function*(){var e;const t=Q7();if(t)return Pr=t,Pr;if(Pr)return Pr;if(fh)return fh;if(dh)return null;const n=g4;if(!n)return dh=!0,null;try{const i=n();if(typeof i?.then=="function")return lW(i);if(i)return Pr=(e=Zv(i))!=null?e:i,dh=!0,Pr}catch{}return dh=!0,null})}function cW(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let u9=null,Kf=null;const Rr=new Map,wc=new Map;let lv=5;const Ih=new Set;function v0(){if(Rr.size{const{id:n,html:i,error:o}=t.data,s=Rr.get(n);if(s)if(Rr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),v0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(wc.set(a,i),wc.size>200){const u=wc.keys().next().value;wc.delete(u)}}s.aborted||s.resolve(i)}},u9.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Rr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Rr.clear(),L2e()}}function D2e(e,t=!0,n=2e3,i){return m4(this,null,function*(){performance.now();const o=cW(e);if(!aW()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Kf)return Promise.reject(Kf);const s=`${t?"d":"i"}:${o}`,r=wc.get(s);if(r)return v0(),Promise.resolve(r);const l=u9||(Kf=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Kf.name="WorkerInitError",Kf.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Kf);if(Rr.size>=lv){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Rr.size,a.max=lv,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=Rr.get(c);if(!g)return;Rr.delete(c),g.cleanup();const v=new Error("Worker render timed out");v.name="WorkerTimeout",v.code="WORKER_TIMEOUT",g.aborted||g.reject(v),v0()},n);d=()=>{const g=Rr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const v=new Error("Aborted");v.name="AbortError",u(v)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Rr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const v=Rr.get(c);Rr.delete(c),clearTimeout(f),v?.cleanup(),v?.reject(g),v0()}})})}function Zkt(e,t=!0,n){const i=`${t?"d":"i"}:${cW(e)}`;if(wc.set(i,n),wc.size>200){const o=wc.keys().next().value;wc.delete(o)}}const F2e="WORKER_BUSY";function B2e(e=2e3,t){return Rr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),Ih.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},Ih.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>v0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const dg={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Gkt(e){return m4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!aW()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:dg.timeout,u=(s=i.waitTimeout)!=null?s:dg.waitTimeout,c=(r=i.backoffMs)!=null?r:dg.backoffMs,d=(l=i.maxRetries)!=null?l:dg.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):dg.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield D2e(t,n,a,h)}catch(g){if(g?.code!==F2e||m>=f)throw g;if(m++,yield B2e(u,h).catch(()=>{}),h?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}c>0&&(yield new Promise(v=>globalThis.setTimeout(v,c*m)))}}})}function u1(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function R2e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Tk(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=R2e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function Ek(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function dW(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Lk(e,t=360,n=500){return dW(e,t,n)}function Nk(e,t=360,n=500){return dW(e,t,n)}var O2e=Object.defineProperty,P2e=Object.defineProperties,$2e=Object.getOwnPropertyDescriptors,QL=Object.getOwnPropertySymbols,z2e=Object.prototype.hasOwnProperty,j2e=Object.prototype.propertyIsEnumerable,YL=(e,t,n)=>t in e?O2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fW=(e,t)=>{for(var n in t||(t={}))z2e.call(t,n)&&YL(e,n,t[n]);if(QL)for(var n of QL(t))j2e.call(t,n)&&YL(e,n,t[n]);return e},JL=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Dk=()=>Qo(()=>import("./mermaid.core-Ci_ShHqV.js").then(e=>e.bp),__vite__mapDeps([2,3]));let rc=null,c1=Dk,Rg=null,ZC=!1,GC=!1,Og=0;function H2e(e){c1=e,Og++,rc=null,Rg=null,ZC=!1,GC=!1}function W2e(e){H2e(Dk)}function XL(){return typeof c1=="function"}function eN(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=fW({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},P2e(n,$2e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function tN(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=fW({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function Qkt(){return JL(this,null,function*(){if(rc)return rc;const e=(function(){try{const i=globalThis;return eN(i?.mermaid)}catch{return null}})();if(e)return rc=e,tN(rc),rc;const t=c1,n=Og;return t?t===Dk&&ZC?null:Rg||(Rg=JL(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===Dk)return n===Og&&t===c1&&(ZC=!0,(function(s){GC||(GC=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===Og&&t===c1&&(Rg=null)}return n!==Og||t!==c1?null:i?(rc=eN(i),tN(rc),rc):null}),Rg):null})}let gu=null,Zf=null;const Oa=new Map,Gf=new Map;function W8(e){for(const t of Oa.values())t.reject(e);Oa.clear(),Gf.clear()}let nN=5,iN=!1;const q2e="WORKER_BUSY",oN="MERMAID_DISABLED";function U2e(e){if(gu&&gu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",W8(n)}gu=e,Zf=null;const t=e;gu.onmessage=n=>{if(gu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=Oa.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},gu.onerror=n=>{var i,o;if(gu===t)if(Oa.size!==0){try{iN?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}W8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},gu.onmessageerror=n=>{var i,o;if(gu===t)if(Oa.size!==0){try{iN?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}W8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function hW(e,t,n,i){if(!XL()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=oN,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Gf.get(o);return s||(s=(function(r,l,a=1400){if(!XL()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=oN,Promise.reject(c)}if(Zf)return Promise.reject(Zf);const u=gu||(Zf=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Zf.name="WorkerInitError",Zf.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Zf);if(Oa.size>=nN){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=q2e,c.inFlight=Oa.size,c.max=nN,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),Oa.delete(f))},v={resolve:y=>{g(),c(y)},reject:y=>{g(),d(y)}};Oa.set(f,v);try{u.postMessage({id:f,action:r,payload:l})}catch(y){return Oa.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const C=Oa.get(f);C&&C.reject(y)},a)})})(e,t,n),Gf.set(o,s),s.then(()=>{Gf.get(o)===s&&Gf.delete(o)},()=>{Gf.get(o)===s&&Gf.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function Ykt(e,t,n=1400,i){return hW("canParse",{code:e,theme:t},n,i)}function Jkt(e,t,n=1400,i){return hW("findPrefix",{code:e,theme:t},n,i)}var V2e=Object.defineProperty,K2e=Object.defineProperties,Z2e=Object.getOwnPropertyDescriptors,sN=Object.getOwnPropertySymbols,G2e=Object.prototype.hasOwnProperty,Q2e=Object.prototype.propertyIsEnumerable,rN=(e,t,n)=>t in e?V2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t)=>{for(var n in t||(t={}))G2e.call(t,n)&&rN(e,n,t[n]);if(sN)for(var n of sN(t))Q2e.call(t,n)&&rN(e,n,t[n]);return e},Fn=(e,t)=>K2e(e,Z2e(t)),so=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Y2e="__global__",q8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",QC=(()=>{const e=globalThis;if(e[q8])return e[q8];const t={scopedCustomComponents:{},revision:Ja(0)};return e[q8]=t,t})(),lN=QC.revision,J2e=Symbol("markstreamCustomComponents"),X2e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function Gv(e){return X2e.has(String(e).trim().toLowerCase())}function eye(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function U8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Sa(n),Sa(eye(n))]))!o||Gv(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function ks(e){const t=on(J2e,null);return D(()=>{var n;return lN.value,(function(i,o={}){return lN.value,$t($t($t({},U8(QC.scopedCustomComponents[Y2e]||{})),U8(o)),U8((function(s){return s&&QC.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const tye=["aria-label"],nye={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},iye={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Ti=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},zl=Ti(ut({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",iye,[...n[1]||(n[1]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),x("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",nye,[...n[0]||(n[0]=[x("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,tye))}),[["__scopeId","data-v-be21ab83"]]);zl.install=e=>{e.component(zl.__name,zl)};const oye={class:"emoji-node"},pl=Ti(ut({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",oye,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);pl.install=e=>{e.component(pl.__name,pl)};const sye=["id"],rye=["title"],jl=Ti(ut({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[x("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,rye)],8,sye))}}),[["__scopeId","data-v-c1463a29"]]);jl.install=e=>{e.component(jl.__name,jl)};const pW=(()=>{try{return!1}catch{}return!1})();function V8(e){pW&&console.warn(e)}function aN(e,t="safe",n){return Z7(e,t,n)}function mW(e){return $ve(e)}function K8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function J7(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=a9((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),K8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),K8(r.value)]):Object.entries(o).map(([r,l])=>[r,K8(l)]):null,t,n);var o;if(!i)return;const s=mW(g0(i));return Object.keys(s).length>0?s:void 0}function uN(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function fg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Z8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return XH(d,f)})(e,i);if(qv.has(e.toLowerCase())||!l&&GH(e,s))return null;if(!l&&K7(e,s))return r?[uN(e,t,!0)]:[uN(e,t),...n,``];const a=Z7(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=mW(a);return En(d,Fn($t({},f),{key:c}),n.length>0?n:void 0)}return En(e,Fn($t({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function gW(e,t){return Hve(e,t)}function Fk(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=Z8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);fg(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=Z8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?fg(u[u.length-1].children,g):fg(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&V8(`Auto-closing unclosed tag: <${m.tagName}>`)}else V8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=Z8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?fg(u[u.length-1].children,f):fg(c,f),V8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(eW(e),t,n)}catch(o){return i=o,pW&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const lye=["innerHTML"],Hl=Ti(ut({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=on("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=ks(()=>t.customId),s=ut({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:L1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=Fk(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!gW(l,o.value))return{mode:"html",content:L1(l,i.value)};const a=Fk(l,o.value,i.value);return a===null?{mode:"html",content:L1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[V(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(k(),L("span",{key:2,class:He(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,lye))}}),[["__scopeId","data-v-d17f12b0"]]);Hl.install=e=>{e.component(Hl.__name,Hl)};const aye={class:"inline-code"},uye={key:0},wr=Ti(ut({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=ym(),i=on("markstreamFade",void 0),o=on("markstreamTextStreamState",void 0),s=on("markstreamStreamVersion",void 0),r=D(()=>{const C=n.fade;return C===""||C===!0||C==="true"||C!==!1&&C!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var C;return String((C=t.node.code)!=null?C:"")}),u=D(()=>!l.value),c=D(()=>{var C;const w=(C=n["index-key"])!=null?C:n.indexKey;return w==null||w===""?"":String(w)}),d=q(t.node.code),f=q(""),h=q(0);let m;function g(){m?.(),m=void 0}function v(){g(),f.value&&(d.value=d.value+f.value,f.value="")}Ge([()=>t.node.code,c,l],([C])=>{const w=String(C??""),A=c.value,I=oW({nextContent:w,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=I.settledContent,f.value=I.streamedDelta,I.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const N=s.value;m=Ge(()=>s.value,T=>{T!==N&&v()},{flush:"sync"})})()):f.value||g(),A&&o?.set(A,w)},{immediate:!0}),sf(g);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(C,w)=>(k(),L("code",aye,[u.value?(k(),L(Re,{key:0},[We(B(a.value),1)],64)):(k(),L(Re,{key:1},[d.value?(k(),L("span",uye,B(d.value),1)):ie("",!0),f.value?(k(),L("span",{key:1,class:He(["inline-code-stream-delta",[y.value]]),onAnimationend:v},B(f.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);wr.install=e=>{e.component(wr.__name,wr)};const YC=q(!1),cN=q(""),dN=q("top"),y0=q(null),k0=q(null),JC=q(null),XC=q(null),fN=q(null);let c9=null,d9=null,eA=0;function vW(){c9&&(clearTimeout(c9),c9=null),d9&&(clearTimeout(d9),d9=null)}let cy=!1,dy=null,hN=!1;function cye(e,t,n="top",i=!1,o,s){if(!e)return;const r=++eA;vW();const l=()=>so(null,null,function*(){var a,u;if(yield(function(){return so(this,null,function*(){if(!cy&&!hN&&typeof document<"u"){dy!=null||(dy=so(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([Qo(()=>import("./vue.runtime.esm-bundler-DDlMase2.js"),[]),Qo(()=>import("./Tooltip-C1-Eo-G7.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:YC.value,"anchor-el":y0.value,content:cN.value,placement:dN.value,id:k0.value,originX:JC.value,originY:XC.value,isDark:(m=fN.value)!=null?m:void 0})}}).mount(h),cy=!0}));try{yield dy}catch(c){cy=!1,dy=null,hN=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),cy&&r===eA){k0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,y0.value=e,cN.value=t,dN.value=n,JC.value=(a=o?.x)!=null?a:null,XC.value=(u=o?.y)!=null?u:null,fN.value=typeof s=="boolean"?s:null,YC.value=!0;try{e.setAttribute("aria-describedby",k0.value)}catch{}}});i?l():c9=setTimeout(l,80)}function dye(e=!1){eA+=1,vW();const t=()=>{if(y0.value&&k0.value)try{y0.value.removeAttribute("aria-describedby")}catch{}YC.value=!1,y0.value=null,k0.value=null,JC.value=null,XC.value=null};e?t():d9=setTimeout(t,120)}const fye={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},hye=Symbol("markstreamI18nFallback");function yW(e,t){var n;return(n=t?.[e])!=null?n:fye[e]}const tA=(e,t)=>{var n;return(n=yW(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function pN(e,t){return{t(n){const i=yW(n,t);if(e.te&&i!=null&&!e.te(n))return tA(n,t);const o=e.t(n);return o===n&&i!=null?tA(n,t):o}}}function pye(){const e=(function(){var n,i,o;try{const s=ys(),r=hye,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=ys(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return pN(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return pN({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>tA(n,e)}}const kW=Symbol("ViewportPriority"),bW=Symbol("ViewportPriorityOptions"),wW=Symbol("OffscreenHeavyNodeDeferral"),mye=D(()=>!1),Hh="400px";function X7(){return on(bW,void 0)}function ex(){return on(wW,mye)}function gye(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:T=>window.clearTimeout(T):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(T){if(!T)return"viewport";let b=a.get(T);return b||(b=u++,a.set(T,b)),String(b)}function v(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(T){if(T){const b=c.get(T);if(b&&!b.targets.size){try{b.io.disconnect()}catch{}c.delete(T)}}d.size||f.size||v()}function C(T){const b=d.get(T);if(!b)return;const _=c.get(b.bucketKey);if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{_?.io.unobserve(T)}catch{}_?.targets.delete(T),d.delete(T),f.delete(T),y(b.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),C(T),f.size&&w())},{timeout:1200}))}function A(T,b){if(!o||typeof IntersectionObserver>"u")return null;const _=(function($,R){var O,z,W;return{root:(O=e?.($??null))!=null?O:null,rootMargin:(z=R?.rootMargin)!=null?z:Hh,threshold:(W=R?.threshold)!=null?W:0}})(T,b),S=[g((E=_).root),E.rootMargin,E.threshold].join("\0");var E;const M=c.get(S);if(M)return{key:S,bucket:M};let F;try{F=new IntersectionObserver($=>{for(const R of $)(R.isIntersecting||R.intersectionRatio>0)&&C(R.target)},{root:_.root,rootMargin:_.rootMargin,threshold:_.threshold})}catch{return null}const H={io:F,targets:new Map};return c.set(S,H),{key:S,bucket:H}}function I(){if(o&&s.value)for(const[T,b]of Array.from(d.entries())){const _=A(T,b.opts);if(!_){C(T);continue}if(_.key===b.bucketKey)continue;const S=b.bucketKey,E=c.get(S);try{E?.io.unobserve(T)}catch{}E?.targets.delete(T),b.bucketKey=_.key,_.bucket.targets.set(T,b),_.bucket.io.observe(T),y(S)}}Ge(s,T=>{if(!T){for(const b of Array.from(d.keys()))C(b);v()}},{flush:"sync"});const N=(T,b)=>{const _=q(!1);let S,E=!1;const M=new Promise(R=>{S=()=>{E||(E=!0,R())}}),F=()=>{const R=d.get(T);if(!R)return f.delete(T),void y();const O=c.get(R.bucketKey);try{O?.io.unobserve(T)}catch{}O?.targets.delete(T),d.delete(T),f.delete(T),y(R.bucketKey)};if(!o||!s.value)return _.value=!0,S(),{isVisible:_,whenVisible:M,destroy:F};const H=A(T,b);if(!H)return _.value=!0,S(),{isVisible:_,whenVisible:M,destroy:F};const $={resolve:S,visible:_,bucketKey:H.key,opts:b};return d.set(T,$),H.bucket.targets.set(T,$),H.bucket.io.observe(T),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,I()})),b?.allowIdle!==!1&&(f.add(T),w()),{isVisible:_,whenVisible:M,destroy:F}};return N.refresh=I,Yn(kW,N),N}function tx(){var e,t;const n=on(kW,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=q(!1);let v,y=!1;const C=new Promise(I=>{v=()=>{y||(y=!0,I())}}),w=()=>{const I=i.get(h);if(!I)return s.delete(h),void(s.size||u());const N=o.get(I.bucketKey);try{N?.io.unobserve(h)}catch{}i.delete(h),N?.targets.delete(h),s.delete(h),c(I.bucketKey),s.size||u()},A=(I=>{var N,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const b=(F=>{var H,$;return[(H=F?.rootMargin)!=null?H:Hh,($=F?.threshold)!=null?$:0].join("\0")})(I),_=o.get(b);if(_)return{key:b,bucket:_};const S=(N=I?.rootMargin)!=null?N:Hh;let E;try{E=new IntersectionObserver(F=>{for(const H of F)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:S,threshold:(T=I?.threshold)!=null?T:0})}catch{return null}const M={io:E,targets:new Set};return o.set(b,M),{key:b,bucket:M}})(m);return A?(i.set(h,{resolve:v,visible:g,bucketKey:A.key}),A.bucket.targets.add(h),A.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:C,destroy:w}):(g.value=!0,v(),{isVisible:g,whenVisible:C,destroy:w})}}function vye(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const yye=["data-markstream-viewport-pending"],kye=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],bye={key:1,class:"image-placeholder"},wye={key:1,class:"image-node__raw-text"},Cye={key:2,class:"image-shimmer-overlay"},Aye={key:1,class:"image-node__raw-text"},xye={key:3,class:"image-error"},Dd=Ti(ut({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=q(!1),a=q(!1),u=q(""),c=q("primary"),d=q(null),f=ym(),h=on(VC,null),m=tx(),g=X7(),v=ex(),y=D(()=>RE(s.node.src)),C=D(()=>RE(s.fallbackSrc)),w=(o=(i=(n=ys())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),A=typeof window<"u"&&w?.getAttribute("src")===(y.value||C.value),I=q(typeof window>"u"||A||!v.value),N=Ja(null);let T="",b=null;const _=D(()=>u.value),S=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&v.value&&!A),M=D(()=>!E.value||I.value),F=D(()=>M.value?_.value:""),H=D(()=>{var Be,Pe;return(Pe=(Be=g?.value.heavyBlockMargin)!=null?Be:g?.value.rootMargin)!=null?Pe:Hh}),$=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),R=D(()=>c.value==="failed"),O=D(()=>(!S.value||E.value&&!I.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>vye(s,f));function W(Be=z.value){Be&&d.value&&h?.reportHeight(Be,d.value.offsetHeight)}function j(Be=z.value){Be&&vt(()=>{W(Be)})}function Q(){b&&(clearTimeout(b),b=null)}function re(){const Be=z.value;Be&&T!==Be&&(T&&h?.markSettled(T),Q(),T=Be,h?.markPending(Be),typeof window<"u"&&(b=window.setTimeout(()=>{T===Be&&(j(Be),K())},8e3)))}function K(){return so(this,null,function*(){const Be=T;Be&&(Q(),T="",yield vt(),W(Be),h?.markSettled(Be))})}function ne(){if(c.value==="primary"&&C.value&&C.value!==u.value)return c.value="fallback",u.value=C.value,l.value=!1,a.value=!1,void j();c.value="failed",a.value=!0,r("error",u.value),j()}function le(){l.value=!0,a.value=!1,r("load",_.value),j()}function oe(Be){Be.preventDefault(),l.value&&!a.value&&r("click",[Be,_.value])}const{t:Me}=pye();return Ge([y,C,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||y.value?(u.value=y.value,void(c.value="primary")):C.value?(u.value=C.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&Ge([d,E],([Be,Pe],xe,J)=>{var se;if((se=N.value)==null||se.destroy(),N.value=null,!Pe||I.value)return void(I.value=!0);if(!Be)return void(I.value=!1);let U=!0;const G=m(Be,{rootMargin:H.value,allowIdle:!1});N.value=G,I.value=G.isVisible.value,G.whenVisible.then(()=>{U&&N.value===G&&(I.value=!0)}),J(()=>{U=!1,G.destroy(),N.value===G&&(N.value=null)})},{immediate:!0}),Ge([$,l,a,_,()=>s.lazy,M],([Be,Pe,xe,J,se,U])=>Be&&J&&!xe&&U?Pe?(K(),void j()):se?(re(),void j()):void(Pe||xe||re()):(K(),void j()),{flush:"post",immediate:!0}),Zn(()=>{var Be;(Be=N.value)==null||Be.destroy(),N.value=null,(function(){const Pe=T;Pe&&(Q(),T="",h?.markSettled(Pe))})()}),(Be,Pe)=>{var xe,J,se,U,G;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!I.value?"true":void 0},[$.value?(k(),L("img",{key:0,src:F.value||void 0,alt:String((J=(xe=s.node.alt)!=null?xe:s.node.title)!=null?J:""),title:String((U=(se=s.node.title)!=null?se:s.node.alt)!=null?U:""),class:He(["image-node__img",{"is-loading":!S.value&&!l.value,"is-loaded":S.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:S.value?"high":void 0,decoding:S.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(G=s.node.alt)!=null?G:p(Me)("image.preview"),onError:ne,onLoad:le,onClick:oe},null,42,kye)):ie("",!0),e.node.loading&&!a.value?(k(),L("span",bye,[s.usePlaceholder?jn(Be.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Pe[0]||(Pe[0]=x("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",wye,B(e.node.raw),1))])):ie("",!0),O.value&&!e.node.loading?(k(),L("span",Cye,[s.usePlaceholder?jn(Be.$slots,"placeholder",{key:0,node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Pe[1]||(Pe[1]=x("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",Aye,B(e.node.raw),1))])):ie("",!0),R.value?(k(),L("span",xye,[jn(Be.$slots,"error",{node:s.node,displaySrc:_.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Pe[2]||(Pe[2]=x("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[x("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),x("span",null,B(p(Me)("image.loadError")),1)],!0)])):ie("",!0)],8,yye)}}}),[["__scopeId","data-v-046e82ac"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const Sye={key:2},Ku=ut({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=ks(()=>t.customId),i=on("markstreamHtmlPolicy",void 0),o=on("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const v=(m=o?.value)!=null?m:{};return Fn($t({},v),{customId:(g=t.customId)!=null?g:v.customId,htmlPolicy:s.value})}),l=Tu({loader:()=>Promise.resolve().then(()=>fx),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!Gv(String(t.node.type)))),c=D(()=>u.value?J7(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),he(Oo(a.value),ni({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ce(()=>[d.value?(k(),he(p(l),ni({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),he(p(l),ni({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),he(Oo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",Sye,B(h.value),1)):ie("",!0)}}),mN=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function _ye(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Fn($t($t({},mN),n),{enabled:(t=n.enabled)==null||t})}return $t({},mN)}function nx(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function CW(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function gN(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function Mye(e){var t;return e.diff===!0||gN(e.language)||gN(CW(String((t=e.raw)!=null?t:"")))}function Iye(e,t,n){const i=(function(o){const s=CW(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const Tye=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Eye={key:0,translate:"no",class:"markstream-pre__diff-code"},Lye={class:"markstream-pre__diff-pane-content"},Nye={class:"markstream-pre__diff-number","aria-hidden":"true"},Dye={class:"markstream-pre__diff-content"},Fye={class:"markstream-pre__diff-content-inner"},Bye={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},Rye=["textContent"],Oye=["textContent"],ll=ut({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(oe,Me){const Be=String(oe??"");return Me?Be:Be.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var oe,Me,Be;const Pe=String((Me=(oe=t.node)==null?void 0:oe.language)!=null?Me:"");return String((Be=String(Pe).split(/\s+/g)[0])!=null?Be:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var oe;return t.loading===!0||((oe=t.node)==null?void 0:oe.loading)===!0}),r=D(()=>{var oe;return n((oe=t.node)==null?void 0:oe.code,s.value)});let l="",a=1;const u=D(()=>(function(oe){let Me=0,Be=1;oe.startsWith(l)&&(Me=l.length,Be=a,Me>0&&oe[Me-1]==="\r"&&oe[Me]===` -`&&Me++);for(let Pe=Me;Per.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const oe=u.value;oe{var oe;return t.showLineNumbers===!0&&((oe=t.node)==null?void 0:oe.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),v=D(()=>{const oe=Number(t.reservedHeightPx);if(!Number.isFinite(oe)||oe<=0)return;const Me=`${Math.ceil(oe)}px`;return s.value?{maxHeight:Me,overflow:"auto"}:{height:Me,minHeight:Me,maxHeight:Me,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function C(oe){return String(oe??"").trim().length===0}function w(oe,Me="context",Be={}){const Pe=C(oe);return{code:oe,kind:Pe&&Me!=="hunk"&&Me!=="spacer"&&!Be.preserveBlankKind?"context":Me,empty:Pe}}function A(oe){const Me=n(oe,s.value);return Me?Me.split(/\r\n|\n|\r/):[]}function I(oe,Me){return!C(oe[Me])||Mey.some(Be=>Me.startsWith(Be)))}function _(oe,Me){return Me||!oe.startsWith(" ")||oe.startsWith(" ")?oe:` ${oe}`}function S(oe,Me){const Be=oe.length,Pe=Me.length,xe=[];let J=0;for(;J=J&&G>=J&&oe[U]===Me[G];)se.unshift({originalIndex:U,modifiedIndex:G}),U--,G--;const me=U-J+1,de=G-J+1;if(me<=0||de<=0||s.value||(me+1)*(de+1)>15e5)return xe.concat(se);const fe=de+1,X=new Uint32Array((me+1)*(de+1));for(let Ae=me-1;Ae>=0;Ae--)for(let Le=de-1;Le>=0;Le--){const be=Ae*fe+Le;if(oe[J+Ae]===Me[J+Le])X[be]=X[(Ae+1)*fe+Le+1]+1;else{const pe=X[(Ae+1)*fe+Le],Te=X[Ae*fe+Le+1];X[be]=pe>=Te?pe:Te}}const Y=[];let ue=0,ye=0;for(;ue=X[ue*fe+ye+1]?ue++:ye++;return xe.concat(Y,se)}function E(oe){var Me;const Be=(function(){var G,me;const de=t.diffHideUnchangedRegions;if(de==null||de===!1)return null;const fe=de===!0?{}:de;return fe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((G=fe.contextLineCount)!=null?G:2)),minimumLineCount:Math.max(1,Math.floor((me=fe.minimumLineCount)!=null?me:4))}})();if(!Be||oe.length<1||oe.length>2||oe.length===2&&oe[0].lines.length!==oe[1].lines.length)return oe;const Pe=oe[0].lines,xe=(Me=oe[1])==null?void 0:Me.lines,J=G=>Pe[G].kind==="context"&&(xe===void 0||xe[G].kind==="context"&&Pe[G].code===xe[G].code),se=[];let U=0;for(;U=Be.minimumLineCount){const de=G+(G===0?0:Be.contextLineCount),fe=me-(me===Pe.length?0:Be.contextLineCount);fe-de>=Be.minimumLineCount&&se.push({start:de,end:fe})}U===G&&U++}return se.length?oe.map((G,me)=>{const de=[];let fe=0;for(const X of se)de.push(...G.lines.slice(fe,X.start)),de.push({code:me===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${G.key}-collapsed-${X.start}-${X.end}`,number:""}),fe=X.end;return de.push(...G.lines.slice(fe)),Fn($t({},G),{lines:de})}):oe}const M=D(()=>{var oe,Me,Be,Pe;if(!m.value)return[];const xe=(function(me){const de=me.some(X=>N(X)),fe=me.some(X=>T(X));return de&&fe||(function(){var X,Y,ue,ye;if(i.value==="diff")return!0;const Ae=(ye=(ue=String((Y=(X=t.node)==null?void 0:X.raw)!=null?Y:"").split(/\r?\n/,1)[0])==null?void 0:ue.trim())!=null?ye:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ae)})()&&(de||fe)})(c.value),J=(function(){var me,de;return((me=t.node)==null?void 0:me.originalCode)!=null||((de=t.node)==null?void 0:de.updatedCode)!=null})();if(g.value){const me=J?(function(de,fe){const X=A(de),Y=A(fe),ue=S(X,Y);if(ue.length>0){const Te=[];let qe=0,mt=0;for(const ct of ue){for(;qe=Ae&&be>=Ae&&X[Le]===Y[be];)pe.unshift(Fn($t({},w(Y[be])),{key:`inline-suffix-${be}`,number:be+1})),Le--,be--;for(let Te=Ae;Te<=Le;Te++)ye.push(Fn($t({},w(X[Te],"removed",{preserveBlankKind:I(X,Te)})),{key:`inline-removed-source-${Te}`,number:Te+1}));for(let Te=Ae;Te<=be;Te++)ye.push(Fn($t({},w(Y[Te],"added",{preserveBlankKind:I(Y,Te)})),{key:`inline-added-source-${Te}`,number:Te+1}));return ye.concat(pe)})((oe=t.node)==null?void 0:oe.originalCode,(Me=t.node)==null?void 0:Me.updatedCode):(function(de){const fe=[];let X=1,Y=1;const ue=b(de);for(const[ye,Ae]of de.entries())if(Ae.startsWith("@@")){const Le=Ae.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Le&&(X=Number(Le[1]),Y=Number(Le[2])),fe.push(Fn($t({},w(Ae,"hunk")),{key:`inline-hunk-${ye}`,number:""}))}else if(N(Ae))fe.push(Fn($t({},w(_(Ae.slice(1),ue),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ye}`,number:X++}));else if(T(Ae))fe.push(Fn($t({},w(_(Ae.slice(1),ue),"added",{preserveBlankKind:!0})),{key:`inline-added-${ye}`,number:Y++}));else{const Le=ue&&Ae.startsWith(" ")?Ae.slice(1):Ae;fe.push(Fn($t({},w(Le)),{key:`inline-context-${ye}`,number:Y})),X++,Y++}return fe})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:me}])}if(!xe&&J)return(function(me,de){const fe=A(me),X=A(de),Y=S(fe,X),ue=[],ye=[];let Ae=0,Le=0,be=0;const pe=(Te,qe)=>{const mt=Math.max(Te-Ae,qe-Le);for(let ct=0;ctFn($t({},me),{key:`original-${de}`,number:de+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:U.map((me,de)=>Fn($t({},me),{key:`modified-${de}`,number:de+1}))}])}),F=D(()=>{var oe,Me;if(t.showLineNumbers!==!0)return;let Be=m.value?1:u.value;if(m.value){Be=Math.max(Be,A((oe=t.node)==null?void 0:oe.originalCode).length,A((Me=t.node)==null?void 0:Me.updatedCode).length);for(const xe of M.value)for(const J of xe.lines)typeof J.number=="number"&&(Be=Math.max(Be,J.number))}const Pe=`${Math.max(2,String(Be).length)}ch`;return{"--markstream-pre-line-number-width":Pe,"--markstream-pre-diff-line-number-width":Pe,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),H=D(()=>M.value.some(oe=>oe.lines.some(Me=>Me.kind==="collapsed"))),$=D(()=>{const oe=i.value;return oe?`Code block: ${oe}`:"Code block"}),R=q(null),O=q([]);let z=null,W=!1,j=null;function Q(oe){const Me=Number.parseFloat(String(oe??""));return Number.isFinite(Me)&&Me>0?Me:0}function re(oe,Me){var Be;if(!oe)return Me;if(oe.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const Pe=oe.querySelector(".markstream-pre__diff-content"),xe=Pe?.getBoundingClientRect(),J=(Be=xe?.height)!=null?Be:0;return Math.max(Me,Math.ceil(J))}function K(){W||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,W||(function(){var oe,Me;z=null;const Be=R.value;if(!Be||!m.value||g.value||!Be.classList.contains("is-wrap"))return void(O.value.length&&(O.value=[]));const Pe=(function(de){const fe=window.getComputedStyle(de),X=Q(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(X>0)return X;const Y=Q(fe.lineHeight);return Y>0?Y:18})(Be),xe=Array.from(Be.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),J=Array.from(Be.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),se=Math.max(xe.length,J.length),U=[];for(let de=0;de{const X=me[fe];return X&&Math.abs(de.rowHeight-X.rowHeight)<=.5&&Math.abs(de.originalHeight-X.originalHeight)<=.5&&Math.abs(de.modifiedHeight-X.modifiedHeight)<=.5})||(O.value=U)})()}))}function ne(oe){j?.disconnect(),j=null,oe&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(j=new ResizeObserver(()=>{K()}),j.observe(oe))}function le(oe,Me){const Be=O.value[oe];if(!Be)return;const Pe=Me==="original"?Be.originalHeight:Be.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Be.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(Pe)}px`}}return Ge(R,oe=>{ne(oe),vt(()=>K())},{flush:"post"}),Ge([m,g,M],()=>{ne(R.value),vt(()=>K())},{flush:"post",immediate:!0}),Zn(()=>{W=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),j?.disconnect(),j=null}),(oe,Me)=>(k(),L("pre",{ref_key:"preRef",ref:R,style:ln([v.value,F.value]),class:He([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":H.value}]),"aria-busy":s.value,"aria-label":$.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",Eye,[(k(!0),L(Re,null,_t(M.value,Be=>(k(),L("span",{key:Be.key,class:He(["markstream-pre__diff-pane",Be.className])},[x("span",Lye,[(k(!0),L(Re,null,_t(Be.lines,(Pe,xe)=>(k(),L("span",{key:Pe.key,class:He(["markstream-pre__diff-line",[`markstream-pre__diff-line--${Pe.kind}`,{"markstream-pre__diff-line--empty":Pe.empty}]]),style:ln(le(xe,Be.key))},[Me[0]||(Me[0]=x("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),x("span",Nye,B(Pe.number),1),x("span",Dye,[x("span",Fye,B(Pe.code),1)])],6))),128))])],2))),128))])):(k(),L(Re,{key:1},[t.showLineNumbers?(k(),L("span",Bye,[x("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,Rye)])):ie("",!0),x("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,Oye)],64))],14,Tye))}});ll.install=e=>{e.component(ll.__name,ll)};const jo=Ti(ut({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=ym(),i=on("markstreamFade",void 0),o=on("markstreamTextStreamState",void 0),s=on("markstreamStreamVersion",void 0),r=D(()=>{const I=n.fade;return I===""||I===!0||I==="true"||I!==!1&&I!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var I;const N=(I=n["index-key"])!=null?I:n.indexKey;return N==null||N===""?"":String(N)}),u=q(t.node.content),c=q(""),d=q(0),f=q(t.node.content);let h;const m=q(null),g=q(null);let v="",y=null;function C(){h?.(),h=void 0}function w(){C(),c.value&&(u.value=u.value+c.value,c.value="")}Ge([u,m,g],function(){var I,N;const T=m.value;if(!T)return;const b=String((I=u.value)!=null?I:""),_=g.value;return y||(y=T.firstChild,v=(N=y?.data)!=null?N:""),b.startsWith(v)?!y&&b?(T.textContent=b,y=T.firstChild,void(v=b)):void(b.length>v.length&&_&&(_.appendChild(document.createTextNode(b.slice(v.length))),v=b)):(T.textContent=b,y=T.firstChild,_&&(_.textContent=""),void(v=b))},{immediate:!0}),Ge([()=>t.node.content,a,l],([I])=>{const N=String(I??""),T=a.value,b=oW({nextContent:N,persistedContent:T?o?.get(T):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=b.settledContent,c.value=b.streamedDelta,b.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const _=s.value;h=Ge(()=>s.value,S=>{S!==_&&w()},{flush:"sync"})})()):c.value||C(),T&&o?.set(T,N)},{immediate:!0}),sf(C);const A=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(I,N)=>(k(),L("span",{class:He([[e.node.center?"text-node-center":""],"text-node"])},[ii(x("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Ko,u.value!==""]]),ii(x("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Ko,u.value!==""]]),c.value?(k(),L("span",{key:0,class:He(["text-node-stream-delta",[A.value]]),onAnimationend:w},B(c.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function Pg(e,t,n){return ut({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=tx(),u=X7(),c=ex(),d=typeof window<"u"&&((l=(r=ys())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=q(typeof window>"u"||d||!c.value),h=Ja(null);let m=null;function g(v){const y=v&&"$el"in v?v.$el:v;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&Ge([h,c],([v,y],C,w)=>{if(m?.destroy(),m=null,!y||f.value)return void(f.value=!0);if(!v)return;let A=!0;const I=a(v,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=I,f.value=I.isVisible.value,I.whenVisible.then(()=>{A&&m===I&&(f.value=!0)}),w(()=>{A=!1,I.destroy(),m===I&&(m=null)})},{immediate:!0}),Zn(()=>{m?.destroy(),m=null}),()=>En(f.value?t:n,Fn($t({},o),{ref:g}),s)}})}jo.install=e=>{e.component(jo.__name,jo)};const Bk=ut({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=p4(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=GL[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):GL[""]),f=Mye(n.node),h=Iye(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:nx(m??{},typeof window>"u"?0:window.innerWidth)),v=m?.diffAppearance,y=v==="dark"||v!=="light"&&n.isDark===!0,C=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:C===12?18:Math.max(12,Math.round(1.5*C)),A=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,I=f?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:I,T=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:I,b=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",_=$t($t({fontSize:`${C}px`,lineHeight:`${w}px`,tabSize:A,paddingTop:`${N}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${N}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),b?{"--markstream-code-font-family":b}:{}),S=()=>En("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[En("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),M=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,F=$=>{if($!=null)return typeof $=="number"?`${$}px`:String($)},H=$t($t($t({"--markstream-code-layout-character-width":"1ch"},F(n.minWidth)?{minWidth:F(n.minWidth)}:{}),F(n.maxWidth)?{maxWidth:F(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return En("div",Fn($t({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:En("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[En("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[En("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),En("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[En("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?En("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),En("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?En("div",{class:"code-diff-stats","aria-hidden":"true"},[En("span",{class:"code-diff-stat removed"},"-0"),En("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:S(),n.showCollapseButton===!1?null:S(),M?En("div",{class:"relative"},[S()]):null])]),En("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[En(ll,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?_ye(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:_,"data-markstream-code-loading":"1"})]),En("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[En("div",{class:"loading-skeleton"},[En("div",{class:"skeleton-line"}),En("div",{class:"skeleton-line"}),En("div",{class:"skeleton-line short"})])]),En("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),G8=Pg("ViewportDeferredCodeBlockNode",Tu({loader:()=>so(null,null,function*(){try{return(yield Qo(()=>import("./CodeBlockNode-Bv3O_GdH.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),ll}}),loadingComponent:Bk,delay:0,suspensible:!1}),Bk),Xa=Tu(()=>so(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return En(jo,Fn($t({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield uW(),(yield Qo(()=>import("./index7-CCdv0QA9.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return En(jo,Fn($t({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),AW=Tu(()=>so(null,null,function*(){try{return yield uW(),(yield Qo(()=>import("./index6-dLC1iNFT.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return En(jo,Fn($t({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),jr=Ti(ut({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);jr.install=e=>{e.component(jr.__name,jr)};const Pye={class:"superscript-node"},ml=Ti(ut({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,emphasis:Ur,footnote_reference:jl,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,emoji:pl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("sup",Pye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);ml.install=e=>{e.component(ml.__name,ml)};const $ye={class:"subscript-node"},gl=Ti(ut({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,emphasis:Ur,footnote_reference:jl,strikethrough:Wr,highlight:Wl,insert:vl,superscript:ml,emoji:pl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("sub",$ye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);gl.install=e=>{e.component(gl.__name,gl)};const zye={class:"strong-node"},Hr=Ti(ut({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,emphasis:Ur,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("strong",zye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const jye={class:"strikethrough-node"},Wr=Ti(ut({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,emphasis:Ur,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("del",jye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Wr.install=e=>{e.component(Wr.__name,Wr)};const Hye=["href","title","aria-label","aria-hidden","target","rel"],Wye=["aria-hidden"],qye={class:"link-text-wrapper relative inline-flex"},Uye={class:"leading-[normal] link-text"},qr=Ti(ut({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=on("markstreamShowTooltips",void 0),i=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),o=D(()=>{var y,C,w,A,I;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(y=t.animationOpacity)!=null?y:.35,b=Math.max(.12,Math.min(.5*T,T)),_={"--underline-height":`${(C=t.underlineHeight)!=null?C:2}px`,"--underline-bottom":N,"--underline-opacity":String(T),"--underline-rest-opacity":String(b),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(A=t.animationTiming)!=null?A:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(I=t.animationIteration)!=null?I:"infinite"};return t.color&&(_["--link-color"]=t.color),_}),s=ks(()=>t.customId),r=D(()=>$t({text:jo,strong:Hr,strikethrough:Wr,emphasis:Ur,image:Dd,html_inline:Hl,inline_code:wr},s.value)),l=ym(),a=D(()=>{var y,C;const w=(y=t.node)==null?void 0:y.attrs;if(!w||typeof w!="object")return{};const A={};if(Array.isArray(w))for(const I of w)Array.isArray(I)&&I[0]&&(A[String(I[0])]=String((C=I[1])!=null?C:""));else for(const[I,N]of Object.entries(w))I&&N!=null&&N!==!1&&(A[I]=N===!0?"":String(N));return aN(A,"safe","a")}),u=D(()=>$t($t({},l),a.value)),c=D(()=>{var y,C;return aN({href:String((C=(y=t.node)==null?void 0:y.href)!=null?C:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const y=u.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(Mpe(c.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const y=u.value.rel,C=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(C).filter(A=>A.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=D(()=>{const y=$t({},u.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function g(){i.value&&dye()}const v=D(()=>{var y,C;const w=(y=t.node)==null?void 0:y.title;return typeof w=="string"&&w.trim().length>0?w:String((C=c.value)!=null?C:"")});return(y,C)=>{var w,A;return e.node.loading?(k(),L("span",ni({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[x("span",qye,[x("span",Uye,[V(p(jo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((A=e.node.text)!=null?A:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),C[1]||(C[1]=x("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Wye)):(k(),L("a",ni({key:0,class:"link-node",href:c.value,title:i.value?"":v.value,"aria-label":`Link: ${v.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:C[0]||(C[0]=I=>(function(N){var T,b,_,S;if(!i.value)return;const E=N,M=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,F=((T=t.node)==null?void 0:T.title)||((b=c.value)!=null&&b.includes("xn--")&&((S=(_=t.node)==null?void 0:_.text)!=null&&S.includes("://"))?t.node.text:c.value)||"";cye(N.currentTarget,F,"top",!1,M)})(I)),onMouseleave:g}),[(k(!0),L(Re,null,_t(e.node.children,(I,N)=>(k(),he(p(Ku),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:I,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Hye))}}}),[["__scopeId","data-v-367e6ca4"]]);qr.install=e=>{e.component(qr.__name,qr)};const Vye={class:"insert-node"},vl=Ti(ut({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,emphasis:Ur,strikethrough:Wr,highlight:Wl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("ins",Vye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vl.install=e=>{e.component(vl.__name,vl)};const Kye={class:"highlight-node"},Wl=Ti(ut({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,emphasis:Ur,strikethrough:Wr,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("mark",Kye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Wl.install=e=>{e.component(Wl.__name,Wl)};const Zye={class:"emphasis-node"},Ur=Ti(ut({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>$t({text:jo,inline_code:wr,link:qr,html_inline:Hl,strong:Hr,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,footnote_reference:jl,math_inline:Xa,reference:jr},n.value));return(o,s)=>(k(),L("em",Zye,[(k(!0),L(Re,null,_t(e.node.children,(r,l)=>(k(),he(p(Ku),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Ur.install=e=>{e.component(Ur.__name,Ur)};const Gye={class:"hard-break"},Fd=Ti(ut({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",Gye))}),[["__scopeId","data-v-50c58f70"]]);Fd.install=e=>{e.component(Fd.__name,Fd)};const av=ut({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Rt({checkbox:zl,checkbox_input:zl,emoji:pl,emphasis:Ur,hardbreak:Fd,highlight:Wl,inline_code:wr,insert:vl,link:qr,reference:jr,strikethrough:Wr,strong:Hr,subscript:gl,superscript:ml,text:jo}),i=ks(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?$t($t({},n),s):n});return(s,r)=>(k(!0),L(Re,null,_t(e.nodes,(l,a)=>(k(),he(p(Ku),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function nA(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(nA)}function Rk(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(nA))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(nA)?o:null}function Wh(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Qye=["cite"],Yye={key:0,dir:"auto",class:"paragraph-node"},Jye=["custom-id"],f9=Ti(ut({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=ks(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>Rk(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:Wh(s.value));return Yn("markstreamShowTooltips",D(()=>t.showTooltips)),Yn("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",Yye,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Jye)):(k(),he(p(av),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),he(p(yl),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Qye))}}),[["__scopeId","data-v-abfecebc"]]);f9.install=e=>{e.component(f9.__name,f9)};const Xye={class:"definition-list"},e9e={class:"definition-term"},t9e={class:"definition-desc"},h9=Ti(ut({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",Xye,[(k(!0),L(Re,null,_t(t.node.items,(o,s)=>(k(),L(Re,{key:s},[x("dt",e9e,[V(p(yl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),x("dd",t9e,[V(p(yl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);h9.install=e=>{e.component(h9.__name,h9)};const n9e=["href","title"],b0=Ti(ut({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,n9e))}}),[["__scopeId","data-v-e1eb37b6"]]);b0.install=e=>{e.component(b0.__name,b0)};const i9e=["id"],o9e={class:"flex-1"},p9=ut({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[x("div",o9e,[V(p(yl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,i9e))}});p9.install=e=>{e.component(p9.__name,p9)};const s9e=["custom-id"],iA=Ti(ut({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=ks(()=>t.customId),i=on("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:Wh(t.node.children)),s=D(()=>$t({text:jo,inline_code:wr,link:qr,image:Dd,strong:Hr,emphasis:Ur,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,footnote_reference:jl,hardbreak:Fd,math_inline:Xa,reference:jr},n.value));return(r,l)=>(k(),he(Oo(`h${e.node.level}`),ni({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ce(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,s9e)):(k(!0),L(Re,{key:1},_t(e.node.children,(a,u)=>(k(),he(p(Ku),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),v4=iA;v4.install=e=>{e.component(iA.__name,iA)};const r9e={key:0,dir:"auto",class:"paragraph-node"},l9e=["custom-id"],a9e={dir:"auto",class:"paragraph-node"},u9e=["custom-id"],N1=Ti(ut({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=ks(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return Rk((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const v=m.slice(1);if(!v.every(C=>C?.type==="list"))return null;const y=Rk([g]);return y?{paragraphChildren:y,nestedLists:v}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?Wh(r.value):null),c=D(()=>{var h;return a()?Wh((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Yn("markstreamShowTooltips",D(()=>t.showTooltips)),Yn("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,v;return k(),L("li",ni({class:"list-item",dir:"auto"},f.value),[r.value?(k(),L("p",r9e,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,l9e)):(k(),he(p(av),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(k(),L(Re,{key:1},[x("p",a9e,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,u9e)):(k(),he(p(av),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(Re,null,_t(l.value.nestedLists,(y,C)=>(k(),he(p(yl),{key:C,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${C}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),he(p(yl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(v=(g=n.value)==null?void 0:g.children)!=null?v:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);N1.install=e=>{e.component(N1.__name,N1)};const D1=Ti(ut({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=ks(()=>e.customId),n=D(()=>t.value.list_item||N1);return(i,o)=>(k(),he(Oo(e.node.ordered?"ol":"ul"),{class:He(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ce(()=>[(k(!0),L(Re,null,_t(e.node.items,(s,r)=>{var l;return k(),he(Oo(n.value),ni({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);D1.install=e=>{e.component(D1.__name,D1)};const c9e={key:2,class:"html-block-node__raw"},d9e=["innerHTML"],f9e={key:1,class:"html-block-node__placeholder"},w0=Ti(ut({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=on("markstreamHtmlPolicy",void 0),i=on("markstreamNestedRendererProps",void 0),o=D(()=>{var M,F;return(F=(M=t.htmlPolicy)!=null?M:n?.value)!=null?F:"safe"}),s=D(()=>{var M,F;const H=(M=i?.value)!=null?M:{};return Fn($t({},H),{customId:(F=t.customId)!=null?F:H.customId,htmlPolicy:o.value})}),r=Tu({loader:()=>Promise.resolve().then(()=>fx),suspensible:!1}),l=D(()=>{const M=a9(t.node.attrs,o.value);if(!M)return;const F=g0(M);return Object.keys(F).length>0?F:void 0}),a=D(()=>{const M=String(t.node.tag||"").trim(),F=a9(t.node.attrs,o.value,M);if(!F)return;const H=g0(F);return Object.keys(H).length>0?H:void 0}),u=ks(()=>t.customId),c=ut({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),f=q(typeof window>"u"),h=q(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),v=D(()=>{var M;if(g.value.trim().toLowerCase()!=="details"||(M=t.node.attrs)!=null&&M.some(([H])=>String(H).toLowerCase()==="open"))return null;const F=m.value[0];return F?.type==="html_block"&&String(F.tag||"").toLowerCase()==="summary"?F:null}),y=D(()=>{var M;return Wh((M=v.value)==null?void 0:M.children)}),C=D(()=>{const M=v.value;if(!M)return;const F=a9(M.attrs,o.value,"summary");if(!F)return;const H=g0(F);return Object.keys(H).length>0?H:void 0}),w=D(()=>y.value==null?m.value:m.value.slice(1)),A=D(()=>{const M=g.value.trim().toLowerCase();return Wj.has(M)||K7(M,o.value)}),I=D(()=>m.value.length>0&&!!t.node.tag&&!A.value),N=D(()=>{var M,F,H;if(I.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(M=h.value)!=null?M:""};const $=(F=h.value)!=null?F:t.node.content;if(!$)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:L1($,o.value)};if(t.node.loading){const O=Fk($,u.value,o.value);return O===null?{mode:"text",content:(H=t.node.raw)!=null?H:$}:{mode:"dynamic",nodes:O}}if(!gW($,u.value))return{mode:"html",content:L1($,o.value)};const R=Fk($,u.value,o.value);return R===null?{mode:"html",content:L1($,o.value)}:{mode:"dynamic",nodes:R}}),T=tx(),b=X7(),_=ex(),S=Ja(null),E=!!t.node.loading;return typeof window<"u"?(Ge([()=>d.value,()=>b?.value.heavyBlockMargin,()=>b?.value.rootMargin],([M],F,H)=>{var $,R,O,z;if((R=($=S.value)==null?void 0:$.destroy)==null||R.call($),S.value=null,!E)return f.value=!0,void(h.value=t.node.content);if(!M)return void(f.value=!1);let W=!0;const j=(z=(O=b?.value.heavyBlockMargin)!=null?O:b?.value.rootMargin)!=null?z:Hh,Q=T(M,{rootMargin:j,allowIdle:!_.value});S.value=Q,f.value=f.value||Q.isVisible.value,Q.whenVisible.then(()=>{W&&S.value===Q&&(f.value=!0)}),H(()=>{W=!1,Q.destroy(),S.value===Q&&(S.value=null)})},{immediate:!0}),Ge(()=>t.node.content,M=>{E&&!f.value||(h.value=M)})):f.value=!0,Zn(()=>{var M,F;(F=(M=S.value)==null?void 0:M.destroy)==null||F.call(M),S.value=null}),(M,F)=>(k(),he(Oo(I.value?g.value:"div"),ni({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(_)&&!f.value?"true":void 0},I.value?a.value:void 0),{default:ce(()=>[f.value?(k(),L(Re,{key:0},[N.value.mode==="structured"?(k(),L(Re,{key:0},[y.value!==null?(k(),L(Re,{key:0},[x("summary",WQ(AP(C.value)),B(y.value),17),w.value.length?(k(),he(p(r),ni({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ie("",!0)],64)):(k(),he(p(r),ni({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),he(p(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",c9e,B(N.value.content),1)):(k(),L("div",ni({key:3},l.value,{innerHTML:N.value.content}),null,16,d9e))],64)):(k(),L("div",f9e,[jn(M.$slots,"placeholder",{node:e.node},()=>[F[0]||(F[0]=x("span",{class:"html-block-node__placeholder-bar"},null,-1)),F[1]||(F[1]=x("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),F[2]||(F[2]=x("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);w0.install=e=>{e.component(w0.__name,w0)};const h9e={dir:"auto",class:"paragraph-node"},p9e=["custom-id"],Th=Ti(ut({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=ks(()=>t.customId),i=on("markstreamHtmlPolicy",void 0),o=on("markstreamFade",void 0),s=on("markstreamParseOptions",void 0),r=on("markstreamCustomMarkdownIt",void 0),l=on("markstreamNestedRendererProps",void 0),a=D(()=>{var b;return(b=i?.value)!=null?b:"safe"}),u=D(()=>{var b;return(b=t.parseOptions)!=null?b:s?.value}),c=D(()=>{var b;return(b=t.customMarkdownIt)!=null?b:r?.value}),d=D(()=>{var b,_;return(_=t.customHtmlTags)!=null?_:(b=l?.value)==null?void 0:b.customHtmlTags}),f=D(()=>{var b,_;const S=(b=l?.value)!=null?b:{};return Fn($t({},S),{customId:(_=t.customId)!=null?_:S.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Tu({loader:()=>Promise.resolve().then(()=>fx),suspensible:!1});function m(b){var _;return b.type==="text"&&String((_=b.content)!=null?_:"").trim()===""}const g=D(()=>t.node.children.filter(b=>!m(b))),v=D(()=>g.value.length>0&&g.value.every(b=>b.type==="image"||(function(_){var S;const E=(function(M){return M.type==="link"&&Array.isArray(M.children)?M.children.filter(F=>!m(F)):[]})(_);return E.length===1&&((S=E[0])==null?void 0:S.type)==="image"})(b))),y=D(()=>new Set(sp(d.value))),C=D(()=>{if(!v.value||g.value.length<=1)return t.node.children;const b=[];for(let _=0;_0,M=t.node.children.slice(_+1).some(F=>!m(F));E&&M&&b.push(Fn($t({},S),{content:" ",raw:" "}))}return b}),w=D(()=>o?.value===!1&&!n.value.text),A=D(()=>w.value?Wh(C.value):null);function I(b,_){return{node:b,"index-key":`${t.indexKey}-${_}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>$t({inline_code:wr,image:Dd,link:qr,hardbreak:Fd,emphasis:Ur,strong:Hr,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,html_inline:Hl,html_block:w0,emoji:pl,checkbox:zl,math_inline:Xa,checkbox_input:zl,reference:jr,footnote_anchor:b0,footnote_reference:jl,text:jo},n.value)),T=D(()=>C.value.map((b,_)=>{var S;const E=(function(M){var F,H,$,R;if(M.type==="html_block"||M.type==="html_inline"){const O=String((F=M.tag)!=null?F:"").trim().toLowerCase()||Zj(M.content);if(O&&!y.value.has(O)&&Gj((H=M.content)!=null?H:M.raw,O)){const z=String((R=($=M.content)!=null?$:M.raw)!=null?R:"");return{child:{type:"text",content:z,raw:z},component:jo,isCustomComponent:!1}}}return{child:M,component:N.value[M.type],isCustomComponent:!!(n.value[M.type]&&!Gv(String(M.type)))}})(b);return Fn($t({},E),{index:_,key:`${t.indexKey||"paragraph"}-${_}`,customAttrs:E.isCustomComponent?J7(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((S=E.child.content)!=null?S:""),originalChild:b})}));return(b,_)=>(k(),L("p",h9e,[A.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(A.value),9,p9e)):(k(!0),L(Re,{key:1},_t(T.value,S=>{return k(),L(Re,{key:S.key},[v.value&&m(S.originalChild)?(k(),L(Re,{key:0},[We(B((E=S.originalChild,String((M=E.content)!=null?M:""))),1)],64)):S.isCustomComponent?(k(),he(Oo(S.component),ni({key:1,ref_for:!0},S.customAttrs,{node:S.child,loading:S.child.loading,"index-key":S.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:ce(()=>[S.hasSlotChildren?(k(),he(p(h),ni({key:0,ref_for:!0},f.value,{nodes:S.child.children,"index-key":S.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):S.slotContent?(k(),he(p(h),ni({key:1,ref_for:!0},f.value,{content:S.slotContent,final:!S.child.loading,"index-key":`${S.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),he(Oo(S.component),ni({key:2,ref_for:!0},I(S.child,S.index)),null,16))],64);var E,M}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Th.install=e=>{e.component(Th.__name,Th)};const m9e={class:"table-node-wrapper"},g9e=["aria-busy"],v9e={key:0},y9e=["custom-id"],k9e=["aria-label","onPointerdown"],b9e=["custom-id"],w9e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},C0=Ti(ut({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),i=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),o=q(null),s=q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(y=>Number.isFinite(y)&&y>0)),u=D(()=>a.value?s.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);Yn("markstreamShowTooltips",D(()=>t.showTooltips)),Yn("markstreamFade",D(()=>t.fade));const c=ks(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(y){const C=t.fade===!1&&!d.value,w=!f.value,A=h.get(y);if(A?.children===y.children&&A.textFastPath===C&&A.paragraphFastPath===w)return A.info;const I=Rk(y.children,w,!0),N={simpleChildren:I,plainText:I&&C?Wh(I):null};return h.set(y,{children:y.children,textFastPath:C,paragraphFastPath:w,info:N}),N}function g(y){if(!r)return;y.preventDefault();const C=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(C/2)),A=Math.max(w,Math.min(C-w,Math.round(r.startWidth+y.clientX-r.startX))),I=[...r.widths];I[r.index]=A,I[r.index+1]=C-A,s.value=I}function v(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),r=null)}return Ge(l,()=>{v(),s.value=[]}),Zn(v),(y,C)=>(k(),L("div",m9e,[x("table",{ref_key:"tableRef",ref:o,class:He(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",v9e,[(k(!0),L(Re,null,_t(e.node.header.cells,(w,A)=>(k(),L("col",{key:A,style:ln(u.value[A])},null,4))),128))])):ie("",!0),x("thead",null,[x("tr",null,[(k(!0),L(Re,null,_t(e.node.header.cells,(w,A)=>(k(),L("th",{key:A,dir:"auto",class:He([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(w).plainText),9,y9e)):m(w).simpleChildren?(k(),he(p(av),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${A}`},null,8,["nodes","custom-id","index-key"])):(k(),he(p(yl),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:C[0]||(C[0]=I=>y.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),A(function(N,T){if(T.button!==0)return;const b=(function(){var E;const M=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(M??[],F=>Math.round(F.getBoundingClientRect().width))})(),_=b[N],S=b[N+1];_&&S&&(T.preventDefault(),r={index:N,startX:T.clientX,startWidth:_,nextStartWidth:S,widths:b},s.value=b,window.addEventListener("pointermove",g),window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v))})(A,I)},null,40,k9e)):ie("",!0)],2))),128))])]),x("tbody",null,[(k(!0),L(Re,null,_t(i.value,(w,A)=>(k(),L("tr",{key:A},[(k(!0),L(Re,null,_t(w.cells,(I,N)=>(k(),L("td",{key:N,class:He([I.align==="right"?"text-right":I.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(I).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},B(m(I).plainText),9,b9e)):m(I).simpleChildren?(k(),he(p(av),{key:1,nodes:m(I).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${A}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),he(p(yl),{key:2,nodes:I.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:C[1]||(C[1]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,g9e),V(fo,{name:"table-node-fade"},{default:ce(()=>[n.value?(k(),L("div",w9e,[jn(y.$slots,"loading",{isLoading:n.value},()=>[C[2]||(C[2]=x("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),C[3]||(C[3]=x("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);C0.install=e=>{e.component(C0.__name,C0)};const C9e={class:"hr-node"},m9=Ti({},[["render",function(e,t){return k(),L("hr",C9e)}],["__scopeId","data-v-39b2349c"]]);m9.install=e=>{e.component(m9.__name,m9)};const A9e={class:"unknown-node"},oA=ut({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",A9e,B(e.node.raw),1))}),g9=Ti(ut({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=ks(()=>t.customId),o=D(()=>$t({text:jo,paragraph:Th,heading:v4,inline_code:wr,link:qr,image:Dd,strong:Hr,emphasis:Ur,strikethrough:Wr,insert:vl,subscript:gl,superscript:ml,checkbox:zl,checkbox_input:zl,hardbreak:Fd,math_inline:Xa,reference:jr,list:D1,math_block:AW,table:C0},i.value));return(s,r)=>(k(),L("div",ni({class:n.value},e.node.attrs),[(k(!0),L(Re,null,_t(e.node.children,(l,a)=>{return k(),he(Oo((u=l.type,o.value[u]||oA)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);g9.install=e=>{e.component(g9.__name,g9)};const x9e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],vN=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function S9e(e){if(e<=255)return x9e[e];let t=0,n=vN.length-1;for(;t<=n;){const i=t+n>>1,o=vN[i];if(eo[1]))return o[2];t=i+1}}return"L"}const _9e=/[ \t\n\r\f]+/g,M9e=/[\t\n\r\f]| {2,}|^ | $/;let Q8=null;const I9e=new RegExp("\\p{Script=Arabic}","u"),Qd=new RegExp("\\p{M}","u"),ix=new RegExp("\\p{Nd}","u");function yN(e){return I9e.test(e)}function kN(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Lu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(kN(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(kN(n))return!0}}return!1}const T9e=new Set([" "," ","⁠","\uFEFF"]),E9e=new Set(["-","‐","–","—"]);function xW(e,t){return!((function(n){const i=A0(n);return i!==null&&T9e.has(i)})(e)||t&&((function(n){const i=A0(n);return i!==null&&(ox.has(i)||qh.has(i))})(e)||(function(n){const i=A0(n);return i!==null&&E9e.has(i)})(e)))}const ox=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),y4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),sx=new Set(["'","’"]),qh=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),L9e=new Set([":",".","،","؛"]),N9e=new Set(["၏"]),D9e=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function F9e(e){if(rx(e))return!0;let t=!1;for(const n of e)if(qh.has(n)||Pk(n))t=!0;else if(!t||!Qd.test(n))return!1;return t}function B9e(e){for(const t of e)if(!ox.has(t)&&!qh.has(t))return!1;return e.length>0}function R9e(e){if(rx(e))return!0;for(const t of e)if(!(y4.has(t)||sx.has(t)||Qd.test(t)||Pk(t)))return!1;return e.length>0}function rx(e){let t=!1;for(const n of e)if(n!=="\\"&&!Qd.test(n)){if(!(y4.has(n)||qh.has(n)||sx.has(n)))return!1;t=!0}return t}function Ok(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function A0(e){if(e.length===0)return null;const t=Ok(e,e.length);return e.slice(t)}const O9e=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Pk(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,O9e)}function P9e(e){const t=(function(n){for(const i of n)if(!Qd.test(i))return i;return null})(e);return t!==null&&ix.test(t)}function $9e(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(Qd.test(i))n--;else{if(!y4.has(i)&&!sx.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function z9e(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function bN(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function wN(e,t){return e&&t!==null&&L9e.has(t)}function j9e(e){const t=A0(e);return t!==null&&N9e.has(t)}function H9e(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function sA(e){let t=e.length;for(;t>0;){const n=Ok(e,t),i=e.slice(n,t);if(D9e.has(i))return!0;if(!qh.has(i))return!1;t=n}return!1}function W9e(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const q9e=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Fa(e){return e.length===1?e[0]:e.join("")}function U9e(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Fa(n)}function V9e(e,t,n,i){if(!q9e.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=W9e(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:Fa(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Fa(r),isWordLike:a,kind:s,start:l}),o}function Y8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const K9e=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Z9e(e,t){const n=e.texts[t];return!!n.startsWith("www.")||K9e.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!X9e.has(e)&&!J9e.test(e)&&Y9e.test(e)}function CN(e){let t=!1;for(const n of e)if(!Qd.test(n)){if(!SW(n))return!1;t=!0}return t}function eke(e,t,n,i){const o=!t&&CN(e),s=!i&&CN(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=Ok(c,d),h=c.slice(f,d);if(!Qd.test(h))return h;d=f}return null})(a);return u!==null&&Pk(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=Ok(a,u),d=a.slice(c,u);if(!Qd.test(d))return SW(d)||Pk(d);u=c}return!1})(e);return!!(o||s||l)&&!Lu(e)&&!Lu(n)&&(t||o||r)&&(i||s)}function AN(e){for(const t of e)if(ix.test(t))return!0;return!1}function v9(e){if(e.length===0)return!1;for(const t of e)if(!ix.test(t)&&!Q9e.has(t))return!1;return!0}function tke(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(Q8===null&&(Q8=new Intl.Segmenter(void 0,{granularity:"word"})),Q8);let g=0;const v=[],y=[],C=[],w=[],A=[],I=[],N=[],T=[],b=[],_=[],S=[],E=[];for(const R of m.segment(a))for(const O of V9e(R.segment,(d=R.isWordLike)!=null&&d,R.index,c)){let z=function(){I[oe]!==null&&(y[oe]=[bN(v,I,N,oe)],I[oe]=null),y[oe].push(O.text),C[oe]=C[oe]||O.isWordLike,T[oe]=T[oe]||Q,b[oe]=b[oe]||re,_[oe]=ne,S[oe]=le,E[oe]=wN(b[oe],K)};const W=O.kind==="text",j=z9e(O.text,O.isWordLike,O.kind),Q=Lu(O.text),re=yN(O.text),K=A0(O.text),ne=sA(O.text),le=j9e(O.text),oe=g-1;u.carryCJKAfterClosingQuote&&W&&g>0&&w[oe]==="text"&&Q&&T[oe]&&_[oe]||W&&g>0&&w[oe]==="text"&&B9e(O.text)&&T[oe]||W&&g>0&&w[oe]==="text"&&S[oe]?z():W&&g>0&&w[oe]==="text"&&O.isWordLike&&re&&E[oe]?(z(),C[oe]=!0):j!==null&&g>0&&w[oe]==="text"&&I[oe]===j?N[oe]=((f=N[oe])!=null?f:1)+1:W&&!O.isWordLike&&g>0&&w[oe]==="text"&&!T[oe]&&(F9e(O.text)||O.text==="-"&&C[oe])?z():(v[g]=O.text,y[g]=[O.text],C[g]=O.isWordLike,w[g]=O.kind,A[g]=O.start,I[g]=j,N[g]=j===null?0:1,T[g]=Q,b[g]=re,_[g]=ne,S[g]=le,E[g]=wN(re,K),g++)}for(let R=0;Rnull);let F=-1;for(let R=g-1;R>=0;R--){const O=v[R];if(O.length!==0){if(w[R]==="text"&&!C[R]&&F>=0&&w[F]==="text"&&(R9e(O)||O==="-"&&P9e(v[F]))){const z=(h=M[F])!=null?h:[];z.push(O),M[F]=z,A[F]=A[R],v[R]="";continue}F=R}}for(let R=0;RQ+1){O.push(Fa(le)),z.push(Me),W.push("text"),j.push(R.starts[Q]),Q=oe;continue}}O.push(re),z.push(ne),W.push(K),j.push(R.starts[Q]),Q++}return{len:O.length,texts:O,isWordLike:z,kinds:W,starts:j}})((function(R){const O=[],z=[],W=[],j=[];for(let Q=0;Q1;for(let le=0;le=R.len||Y8(R.kinds[K]))continue;const ne=[],le=R.starts[K];let oe=K;for(;oe0&&(O.push(Fa(ne)),z.push(!0),W.push("text"),j.push(le),Q=oe-1)}return{len:O.length,texts:O,isWordLike:z,kinds:W,starts:j}})((function(R){const O=R.texts.slice(),z=R.isWordLike.slice(),W=R.kinds.slice(),j=R.starts.slice();for(let re=0;re=0&&!xW(u.texts[w-1],c)&&C(w),g<0&&(g=w),v=v||Lu(A))}return C(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return $t({normalized:s,chunks:tke(l,o)},l)}let Fp=null;const xN=new Map;let Bp=null;const ike=new RegExp("\\p{Emoji_Presentation}","u"),oke=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let J8=null;const SN=new Map;function rA(){if(Fp!==null)return Fp;if(typeof OffscreenCanvas<"u")return Fp=new OffscreenCanvas(1,1).getContext("2d"),Fp;if(typeof document<"u")return Fp=document.createElement("canvas").getContext("2d"),Fp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ed(e,t){let n=t.get(e);return n===void 0&&(n={width:rA().measureText(e).width,containsCJK:Lu(e)},t.set(e,n)),n}function $k(){if(Bp!==null)return Bp;if(typeof navigator>"u")return Bp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Bp;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Bp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Bp}function _W(){return J8===null&&(J8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),J8}function ske(e){return ike.test(e)||e.includes("️")}function zf(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=_W();for(const a of l.segment(s))ske(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function rke(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function _N(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function MN(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function lx(e,t){return t===0?0:e+t}function uke(e,t,n,i,o){return lx(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function IN(e,t,n,i){return lx(i,t==="tab"?0:e.lineEndFitAdvances[n])}function TN(e,t,n,i,o){return lx(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function cke(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function dke(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function fy(e,t,n){let i=t;for(;iz){if(de!==null&&X>U){oe(se,X,Y),ue=X,fe=fy(de,fe,ue+1),X=-1,Y=0;continue}oe(),Be(se,ue,ye)}else j+=ye,re=se,K=ue+1;else Be(se,ue,ye);const Ae=ue+1;de!==null&&de[fe]===Ae&&(X=Ae,Y=j,fe++),ue++}Q&&re===se&&K===me.length&&(re=se+1,K=0)}let J=0;for(;J=H.length)));){const se=H[J],U=_N($[J]);if(Q)if(j+se>z){if(U){Pe(J,se),oe(J+1,0,j-se),J++;continue}if(ne>=0){if(re>ne||re===ne&&K>0){oe();continue}oe(ne,0,le);continue}if(se>z&&R[J]!==null){oe(),xe(J,0),J++;continue}oe()}else Pe(J,se),U&&(ne=J+1,le=j-se),J++;else se>z&&R[J]!==null?xe(J,0):Me(J,se),U&&(ne=J+1,le=j-se),J++}return Q&&oe(),W})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=$k(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,v=0,y=-1,C=0,w=null;function A(){y=-1,C=0,w=null}function I(M=g,F=v,H){f++,h=0,m=!1,A()}function N(M,F){m=!0,g=M+1,v=0,h=F}function T(M,F,H){m=!0,g=M,v=F+1,h=H}function b(M,F){m?(h+=F,g=M+1,v=0):N(M,F)}function _(M,F,H,$,R,O){if(!F)return;const z=IN(n,M,H,R);TN(n,M,H,R,$),y=H+1,C=h-O+z,w=M}function S(M,F){var H;const $=r[M],R=(H=l[M])!=null?H:null;let O=R===null?-1:fy(R,0,F+1),z=-1,W=F;for(;W<$.length;){const j=$[W];if(m){const re=cke(n,!0,j),K=h+re;if(dke(n,K)>d){if(R!==null&&z>F){I(M,z),W=z,O=fy(R,O,W+1),z=-1;continue}I(),T(M,W,j)}else h=K,g=M,v=W+1}else T(M,W,j);const Q=W+1;R!==null&&R[O]===Q&&(z=Q,O++),W++}m&&g===M&&v===$.length&&(g=M+1,v=0)}function E(M){f++,A()}for(let M=0;M=F.endSegmentIndex)));){const $=s[H],R=_N($),O=ake(n,m,H),z=$==="tab"?lke(h+O,n.tabStopAdvance):o[H],W=O+z,j=uke(n,$,H,O,z);if($!=="soft-hyphen")if(m){if(h+j>d){const Q=h+IN(n,$,H,O);if(TN(n,$,H,O,z),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&C<=d){I(y,0);continue}if(R&&Q<=d){b(H,W),I(H+1,0),H++;continue}if(y>=0&&C<=d){if(g>y||g===y&&v>0){I();continue}const re=y;I(re,0),H=re;continue}if(j>d&&r[H]!==null){I(),S(H,0),H++;continue}I();continue}b(H,W),_($,R,H,z,O,W),H++}else j>d&&r[H]!==null?S(H,0):N(H,z),_($,R,H,z,O,W),H++;else m&&(g=H+1,v=0,y=H+1,C=h+a,w=$),H++}m&&(F.consumedEndSegmentIndex,I(F.consumedEndSegmentIndex,0))}return f})(e,t)}let X8=null;function ax(){return X8===null&&(X8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),X8}function hke(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=sA(d),l=y4.has(d)}function c(d,f){i.push(d),s=s||f;const h=sA(d);r=d.length===1&&qh.has(d)&&r||h,l=!1}for(const d of ax().segment(e)){const f=d.segment,h=Lu(f);i.length!==0?l||ox.has(f)||qh.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function pke(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!xW(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Lu(a.text)}return r(t.length),i}function EN(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=ax();for(const o of i.segment(e))n++;return n}function mke(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function gke(e,t,n,i,o){const s=$k(),{cache:r,emojiCorrection:l}=(function(E,M){rA().font=E;const F=(function(R){let O=xN.get(R);return O||(O=new Map,xN.set(R,O)),O})(E),H=(function(R){const O=R.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(E),$=M?(function(R,O){let z=SN.get(R);if(z!==void 0)return z;const W=rA();W.font=R;const j=W.measureText("😀").width;if(z=0,j>O+.5&&typeof document<"u"&&document.body!==null){const Q=document.createElement("span");Q.style.font=R,Q.style.display="inline-block",Q.style.visibility="hidden",Q.style.position="absolute",Q.textContent="😀",document.body.appendChild(Q);const re=Q.getBoundingClientRect().width;document.body.removeChild(Q),j-re>.5&&(z=j-re)}return SN.set(R,z),z})(E,H):0;return{cache:F,fontSize:H,emojiCorrection:$}})(t,(a=e.normalized,oke.test(a)));var a;const u=zf("-",ed("-",r),l)+(o===0?0:2*o),c=8*zf(" ",ed(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let v=e.chunks.length<=1&&!d;const y=null,C=[],w=[],A=[],I=null,N=Array.from({length:e.len});function T(E,M,F,H,$,R,O,z,W){$!=="text"&&$!=="space"&&$!=="zero-width-break"&&(v=!1),f.push(M),h.push(F),m.push(H),g.push($),C.push(O),w.push(z),d&&A.push(W)}function b(E,M,F,H,$){const R=ed(E,r),O=d?EN(E,M):0,z=(function(re,K,ne){return K>1?re+(K-1)*ne:re})(zf(E,R,l),O,o),W=M==="space"||M==="preserved-space"||M==="zero-width-break"?0:z,j=W===0?0:W+(O>0?o:0),Q=M==="space"||M==="zero-width-break"?0:z;if($&&H&&E.length>1){let re="sum-graphemes";o!==0?re="segment-prefixes":v9(E)?re="pair-context":s.preferPrefixWidthsForBreakableRuns&&(re="segment-prefixes");const K=(function(le,oe,Me,Be,Pe){if(oe.breakableFitAdvances!==void 0&&oe.breakableFitMode===Pe)return oe.breakableFitAdvances;oe.breakableFitMode=Pe;const xe=_W(),J=[];for(const me of xe.segment(le))J.push(me.segment);if(J.length<=1)return oe.breakableFitAdvances=null,oe.breakableFitAdvances;if(Pe==="sum-graphemes"){const me=[];for(const de of J){const fe=ed(de,Me);me.push(zf(de,fe,Be))}return oe.breakableFitAdvances=me,oe.breakableFitAdvances}if(Pe==="pair-context"||J.length>96){const me=[];let de=null,fe=0;for(const X of J){const Y=zf(X,ed(X,Me),Be);if(de===null)me.push(Y);else{const ue=de+X,ye=ed(ue,Me);me.push(zf(ue,ye,Be)-fe)}de=X,fe=Y}return oe.breakableFitAdvances=me,oe.breakableFitAdvances}const se=[];let U="",G=0;for(const me of J){U+=me;const de=zf(U,ed(U,Me),Be);se.push(de-G),G=de}return oe.breakableFitAdvances=se,oe.breakableFitAdvances})(E,R,r,l,re),ne=K===null||i==="keep-all"?null:(function(le){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(le))return null;const oe=[];let Me=0;for(const Be of ax().segment(le))Me++,mke(Be.segment)&&oe.push(Me);return oe.length===0?null:oe})(E);return void T(E,z,j,Q,M,F,K,ne,O)}T(E,z,j,Q,M,F,null,null,O)}for(let E=0;E=55296&&le<=56319&&ne+1=56320&&Pe<=57343&&(oe=Pe-56320+(le-55296<<10)+65536,Me=2)}const Be=S9e(oe);Be!=="R"&&Be!=="AL"&&Be!=="AN"||(z=!0);for(let Pe=0;Pe=0&&O[le]==="ET";le--)O[le]="EN";for(le=ne+1;le0?O[ne-1]:re)!=="L"?"R":"L";if(oe===((le{const e=globalThis;if(e[e5])return e[e5];const t={configs:{},controllers:{},revision:Ja(0),preparedCache:new Map,blockEstimateCache:new Map};return e[e5]=t,t})();let hg=null;const t5=As.revision;function LN(e){var t;return e&&(t=As.configs[e])!=null?t:null}function NN(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function yke(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function n5(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!yke(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function i5(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(hg!=null)return hg;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return hg=!!((s=r.getContext)!=null&&s.call(r,"2d")),hg}catch{return hg=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=As.blockEstimateCache.get(r);if(l)return As.blockEstimateCache.delete(r),As.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const v=`${g}\0${m}\0${h}`,y=As.preparedCache.get(v);if(y)return As.preparedCache.delete(v),As.preparedCache.set(v,y),y.prepared;const C=(function(w,A,I){return(function(N,T,b,_){var S,E;const M=(S=_?.wordBreak)!=null?S:"normal",F=(E=_?.letterSpacing)!=null?E:0;return gke(nke(N,$k(),_?.whiteSpace,M),T,!1,M,F)})(w,A,0,I)})(h,m,{whiteSpace:g});for(As.preparedCache.set(v,{prepared:C});As.preparedCache.size>240;){const w=As.preparedCache.keys().next().value;if(!w)break;As.preparedCache.delete(w)}return C})(e,n.font,a),c=(function(h,m,g){const v=fke(h,m);return{lineCount:v,height:v*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(As.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});As.blockEstimateCache.size>4e3;){const h=As.blockEstimateCache.keys().next().value;if(!h)break;As.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function MW(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=n5(e.children);return s&&n.paragraph?i5(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=n5(e.children),l=n.headings[s];return r&&l?i5(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=n5((o=s[0])==null?void 0:o.children);return r?i5(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=MW(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function pg(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function jf(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function o5(e,t,n=0){return e.diff?nx(t??{},n)?(function(i){const o=jf(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!vke.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return pg(jf(i.originalCode))+pg(jf(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(pg(jf(o)),pg(jf(s)));const r=jf(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):pg(jf(e.code,e.loading===!0))}function kke(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function s5(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=NN(i.lineHeight,1.5*NN(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:kke(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const bke=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function DN(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))bke.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function FN(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function BN(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function RN(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const IW=Symbol("MarkstreamMathBlockMinHeightCache");function Xkt(){return on(IW,null)}const wke=new Set(["text","inline_code","emoji","footnote_reference"]),Cke=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function mg(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Hf(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function TW(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(wke.has(i))return!0;if(!Cke.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(TW)}function lA(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(lA).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function EW(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(EW)})}function Ake(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function xke(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const v=e,y=String((n=v.type)!=null?n:""),C=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(w){var A;const I=Number((A=w.level)!=null?A:w.depth);return I>=4?20:I===3?30:I===2?32:44})(v);case"paragraph":return(function(w,A){const I=String(w??"");if(!I)return 28;const N=Math.max(18,Math.floor(Math.max(320,A)/8)),T=I.split(/\r?\n/).length,b=Math.ceil(I.length/N);return Math.max(1,T,b)<=1?28:Hf(I,A,34)})(String((o=(i=v.raw)!=null?i:v.content)!=null?o:""),C);case"list":return(function(w,A){var I;const N=Array.isArray(w.items)?w.items:[];if(!N.length)return 48;const T=Math.max(48,30*N.length+12);let b=12;for(const E of N)b+=Ake(lA(E)||String((I=E.raw)!=null?I:""),A);const _=Math.max(0,b-T);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(T+Math.max(E,Math.min(_,3*N.length)))}if(_<=0)return T;const S=N.length>8?8*N.length:_;return Math.round(T+Math.min(_,S))})(v,C);case"list_item":return Hf(String((r=(s=v.raw)!=null?s:v.content)!=null?r:""),C,34);case"blockquote":return Hf(String((a=(l=v.raw)!=null?l:v.content)!=null?a:""),C,56);case"table":return(function(w,A){const I=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!I.length){const N=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+I.reduce((N,T)=>N+(function(b,_){const S=Math.max(1,b.length),E=Math.max(80,(_-32)/S),M=Math.max(10,Math.floor(E/8)),F=Math.max(1,...b.map(H=>{var $;const R=lA(H)||String(($=H?.raw)!=null?$:"");return Math.ceil(R.length/M)||1}));return 54+34*Math.max(0,F-1)+(S<=3&&b.some(EW)?14:0)})((function(b){var _;return Array.isArray(b?.cells)&&(_=b.cells)!=null?_:[]})(T),A),0)))})(v,C);case"code_block":{const w=String((u=v.language)!=null?u:"").trim().toLowerCase(),A=String((d=(c=v.code)!=null?c:v.raw)!=null?d:"");return w==="mermaid"?Lk(Tk(A)):w==="infographic"?Nk(Ek(A)):Hf(A,C,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,A){var I,N,T;const b=w.match(/^\s*]*)>/i);return b&&!/(?:^|\s)open(?:\s|=|$)/i.test((I=b[1])!=null?I:"")?Hf(((T=(N=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:T.replace(/<[^>]*>/g,"").trim())||"Details",A,28,28):Hf(w,A,96)})(String((h=(f=v.raw)!=null?f:v.content)!=null?h:""),C);case"thematic_break":return 24;default:return Hf(String((g=(m=v.raw)!=null?m:v.content)!=null?g:""),C,40)}}function ON(e,t,n){return Math.min(Math.max(e,t),n)}const Ske=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],_ke=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],Mke=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),LW=["raw","content","code","originalCode","updatedCode"],PN=new WeakMap,$N=new WeakMap;let Ike=1;function Da(){return typeof performance<"u"?performance.now():Date.now()}function zN(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Rl(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=PN.get(t);return n||(n=Ike++,PN.set(t,n)),String(n)}function jN(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:Rl(t),customMarkdownIt:Rl(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:Rl(e.validateLink),preTransformTokens:Rl(e.preTransformTokens),postTransformTokens:Rl(e.postTransformTokens),postTransformNodes:Rl(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function HN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function WN(e){const t=NW(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function NW(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function DW(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function ux(e){const t=String(e??"");return`${t.length}:${DW(t)}`}function aA(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?ux(r):`${r.length}:${DW(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Rl(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${Rl(i)}`;const s=Rl(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>aA(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${aA(r[u],t,n+1)}`).join(";")}`}return typeof e}function zk(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function FW(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>zk(i)?Yd(i,t,n+1):FW(i,t,n+1)).join(",")}`:zk(e)?Yd(e,t,n):aA(e,t,n)}function Tke(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!LW.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${ux(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${Rl(o)}`:Mke.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${FW(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${Rl(o)}`:""}).filter(Boolean).join(";")}function Eke(e){return LW.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${ux(n)}`:""}).filter(Boolean).join(";")}function Yd(e,t=new WeakMap,n=0){const i=$N.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${Rl(o)}`;const r=Rl(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Yd(m,u,c+1)).join("|"):"";return[a.type,Eke(d),Tke(d,u,c),f.length,h].join(":")})(e,t,n);return $N.set(o,l),l}function BW(e,t){return Yd(e)===Yd(t)}function cx(e,t,n){const i=Da(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Da()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function qN(e,t,n){return cx(t,n,()=>Yd(e))}function RW(e,t,n){return qN(e,n,"stabilizeSignatureMs")===qN(t,n,"stabilizeSignatureMs")}function hy(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function UN(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function VN(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function Lke(e,t){return e.length===t.length&&e===t}function dx(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=dx(e,t)}),i??RW(e,t,n)}function Fke(e,t){const n={};for(const i of Ske){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function Bke(e,t){var n;const i=HL(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=q(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let H="",$=0,R=!1,O=!1,z=!1,W=!1;function j(){H="",$=0,R=!1,O=!1,z=!1,W=!1}function Q(re){let K=!1;for(let ne=0;ne{if(!re||!K.startsWith(re)||K.length<=re.length)return j(),[!0,0];let ne=0;H!==re&&(j(),Q(re),ne=re.length);const le=K.slice(re.length),oe=Q(le);return H=K,[oe,ne+le.length]}})();let h,m=0,g=0,v=Da(),y=-1,C=0;function w(H){y=Number.isInteger(H)?H:0,C+=1}function A(){h&&(clearTimeout(h),h=void 0)}function I(){A();const H=t.renderContent.value;r.value!==H&&(r.value=H),v=Da()}Ge([t.renderContent,t.effectiveFinal,s],([H,$,R])=>{r.value!==H&&(!R||$||(function(O,z){if(!O&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(W))||W.endsWith(` -`)&&!(function(j){const Q=HN(j);if(WN(Q))return!1;const re=NW(Q);return re.length>=2&&re.some(K=>K.trim())})(z))})(r.value,H)?I():(function(){if(g+=1,h)return;const O=Math.max(0,(function(z){const W=z.parseCoalesceMs;return typeof W=="number"&&Number.isFinite(W)&&W>=0?W:80})(e)-(Da()-v));O<=0?I():h=setTimeout(I,O)})())},{flush:"sync",immediate:!0}),sf(A);const N=D(()=>{var H,$,R,O;return Dpe(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(O=(R=($=t.customComponentsMap)==null?void 0:$.value)!=null?R:{},Object.entries(O).map(([z,W])=>{const j=Sa(z);return W==null||!j||Gv(j)||Hj.has(j)||qv.has(j)?"":j}).filter(Boolean)))}),T=D(()=>{const{key:H,tags:$}=Fpe(N.value);if(!H)return i;const R=o.get(H);if(R)return R;const O=HL(t.instanceMsgId,{customHtmlTags:$});return o.set(H,O),O}),b=D(()=>{const H=T.value;if(!e.customMarkdownIt)return H;const $=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,$.__markstreamHasCustomParserExtensions=!0,$}),_=D(()=>{var H,$;const R=(H=e.parseOptions)!=null?H:{},O=t.effectiveFinal.value,z=N.value,W=O!=null,j=z.length>0;return W||j||R.streamParse==null?$t($t(Fn($t({},R),{streamParse:($=R.streamParse)==null||$}),W?{final:O}:{}),j?{customHtmlTags:z}:{}):R}),S=D(()=>{var H;return new Set(((H=_.value.customHtmlTags)!=null?H:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),E=D(()=>jN(_.value,b.value,e.customMarkdownIt,{includeFinal:!0})),M=D(()=>jN(_.value,b.value,e.customMarkdownIt,{includeFinal:!1}));Ge([E,M],([H,$],[R,O])=>{R&&(H===R&&$===O||(I(),$!==O&&(l=[],c="")))},{flush:"sync"});const F=D(()=>{var H,$,R,O,z,W,j,Q,re,K,ne;if((H=e.nodes)!=null&&H.length)return l=[],c="",w(0),Rt(e.nodes.slice());const le=r.value;if(!le)return l=[],c="",w(-1),[];const oe=t.debugPerformanceEnabled.value,Me=oe?Da():0,Be=b.value,Pe=E.value,xe=M.value;a&&Pe!==a&&(function(qe){var mt,ct;(ct=(mt=qe.stream)==null?void 0:mt.reset)==null||ct.call(mt)})(Be),u&&xe!==u&&(l=[],c="");const J=Object.keys((R=($=t.customComponentsMap)==null?void 0:$.value)!=null?R:{}).length>0||typeof _.value.postTransformNodes=="function";J!==d&&(l=[],c="");const se=!J&&l.length>0&&le.startsWith(c)&&xe===u,U=oe?zN(Be):null,G=oe?{}:void 0,me=VN(Be),de=!me&&!J,fe=$t($t(Fn($t({},_.value),{__reuseStableTopLevelNodes:de}),me?{__disableStreamParse:!0}:{}),G?{__timing:G}:{}),X=VH(le,Be,fe),Y=oe?Da():0,ue=oe?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ye,Ae=oe?hy(X.length):void 0,Le=0,be=0,pe=0;if(se){const qe=oe?Da():0,[mt,ct]=(function(Dt){var Ht,Vt;const[Ee,ze]=Dt.scanGlobalReferenceAppend(Dt.previousContent,Dt.content),Ye=Dt.parseOptions;return[Dt.previousDirtyStartIndex>0&&Ye.final!==!0&&!Dt.customMarkdownIt&&!VN(Dt.md)&&!Ee&&typeof Ye.preTransformTokens!="function"&&typeof Ye.postTransformTokens!="function"&&typeof Ye.postTransformNodes!="function"&&((Vt=(Ht=Ye.customHtmlTags)==null?void 0:Ht.length)!=null?Vt:0)===0?Dt.previousDirtyStartIndex:0,ze]})({content:le,previousContent:c,previousDirtyStartIndex:y,parseOptions:_.value,customMarkdownIt:e.customMarkdownIt,md:Be,scanGlobalReferenceAppend:f});pe=ct;const yt=mt<=0;if(ue){const Dt=(function(Ht,Vt,Ee,ze={}){var Ye;if(!Vt.length)return{nodes:Ht,metrics:hy(Ht.length)};const pt=(Ye=ze.scanStartIndex)!=null?Ye:0,Et=ze.reuseDirtyTail!==!1,Mt=(function(rt,Fe,Qe,gt=0){const Ut=Math.min(rt.length,Fe.length);for(let Wt=Math.min(Ut,Math.max(0,gt));WtYd(qe[yt]))})(ye,ue,be):(function(qe,mt=0){for(let ct=Math.max(0,mt);ct((z=U?.total)!=null?z:0);t.logPerf(mt?"parse(stream)":"parse(sync)",$t($t($t({rendererId:t.instanceMsgId,ms:Math.round(Da()-Me),nodes:ye.length,contentLength:le.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:Te,referenceDefinitionScanChars:pe,signatureMs:(W=ue?.signatureMs)!=null?W:0,stabilizeSignatureMs:(j=ue?.stabilizeSignatureMs)!=null?j:0,primeSignatureMs:(Q=ue?.primeSignatureMs)!=null?Q:0,signatureCallCount:(re=ue?.signatureCallCount)!=null?re:0,stabilizeSignatureCallCount:(K=ue?.stabilizeSignatureCallCount)!=null?K:0,primeSignatureCallCount:(ne=ue?.primeSignatureCallCount)!=null?ne:0,stabilizeMs:Le},Ae??{}),G?Object.fromEntries(_ke.map(ct=>{var yt;return[ct,(yt=G[ct])!=null?yt:0]})):{}),qe?{streamMode:qe.lastMode,streamDelta:Fke(qe,U),streamStats:qe}:{}))}return Rt(ye)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:S,mdBase:T,mdInstance:b,mergedParseOptions:_,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>C,parsedNodes:F}}function Rke(e){const{isClient:t}=e,n=q(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const v=n.value,y=v.has(f);if(h){if(y)return;const w=new Set(v);return w.add(f),void(n.value=w)}if(!y)return;const C=new Set(v);C.delete(f),n.value=C})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return Fv()&&sf(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const Pke={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},KN=/auto|scroll|overlay/i;function $ke(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return KN.test(t)||KN.test(n)}function zke(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const jke={class:"m-0 p-0"},Hke=["data-probe"],Wke=Ti(ut(Fn($t({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:ln({width:`${e.width}px`}),"aria-hidden":"true"},[x("div",{ref:s=>e.setParagraphWrapper(s),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(Th),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),x("div",{ref:s=>e.setListItemWrapper(s),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[x("ul",jke,[V(p(N1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),x("div",{ref:s=>e.setListWrapper(s),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(D1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(Re,null,_t(6,s=>x("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:He(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(v4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,Hke)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),ZN=ut({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return Nk((i=u1(e.estimatedPreviewHeightPx))!=null?i:Ek(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return En("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?En("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[En("div",{class:"flex items-center gap-x-2 overflow-hidden"},[En("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),En("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),En("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>En("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,En("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[En("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),En("div",{class:"absolute inset-0"},[En("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),GN=ut({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return Lk((i=u1(e.estimatedPreviewHeightPx))!=null?i:Tk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return En("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?En("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[En("div",{class:"flex items-center gap-x-2 overflow-hidden"},[En("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),En("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>En("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[En("span",{class:"action-icon block"})])))]):null,En("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[En("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),En("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),qke={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Os(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const Uke=["data-custom-id"],Vke=["data-node-index","data-node-type"],QN="typewriter-simple-cursor-target",OW=Ti(ut(Fn($t({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(P){if(!(typeof Event<"u"&&P instanceof Event))return typeof P=="string"&&o("copy-code",P),void o("copy",P)}const r=ys(),l=on("markstreamNestedRendererProps",void 0);function a(P){const te=r?.vnode.props;return!!te&&(Object.prototype.hasOwnProperty.call(te,P)||Object.prototype.hasOwnProperty.call(te,String(P).replace(/[A-Z]/g,ge=>`-${ge.toLowerCase()}`)))}function u(P){var te,ge;const ke=i[P];return a(P)?ke:(ge=(te=l?.value)==null?void 0:te[P])!=null?ge:ke}const c=D(()=>{return(P=u("mode"))==="chat"||P==="minimal"||P==="docs"?P:"docs";var P}),d=D(()=>RN(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(P={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":P.codeRenderer==="pre"||P.codeRenderer==="shiki"||P.codeRenderer==="monaco"?P.codeRenderer:P.renderCodeBlocksAsPre===!1||P.mode==="docs"?"monaco":"pre";var P}),g=D(()=>qke[c.value]),v=D(()=>{var P;return(P=u("showTooltips"))!=null?P:g.value.showTooltips}),y=D(()=>{var P;return(P=u("fade"))!=null?P:g.value.fade}),C=D(()=>{var P;return(P=u("batchRendering"))!=null?P:g.value.batchRendering}),w=D(()=>{var P;return(P=u("initialRenderBatchSize"))!=null?P:g.value.initialRenderBatchSize}),A=D(()=>{var P;return(P=u("renderBatchSize"))!=null?P:g.value.renderBatchSize}),I=D(()=>{var P;return(P=u("renderBatchDelay"))!=null?P:g.value.renderBatchDelay}),N=D(()=>{var P;return(P=u("renderBatchBudgetMs"))!=null?P:g.value.renderBatchBudgetMs}),T=D(()=>{var P;return(P=u("renderBatchIdleTimeoutMs"))!=null?P:g.value.renderBatchIdleTimeoutMs}),b=D(()=>{var P;return(P=u("deferNodesUntilVisible"))!=null?P:g.value.deferNodesUntilVisible}),_=D(()=>{var P;return(P=u("maxLiveNodes"))!=null?P:g.value.maxLiveNodes}),S=D(()=>{var P;return(P=u("liveNodeBuffer"))!=null?P:g.value.liveNodeBuffer}),E=D(()=>{var P;return(P=u("nodeVirtual"))!=null?P:g.value.nodeVirtual}),M={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return v.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return C.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return A.value},get renderBatchDelay(){return I.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return b.value},get maxLiveNodes(){return _.value},get liveNodeBuffer(){return S.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function F(P){o("height-change",P)}function H(P){o("virtual-state-change",P)}function $(P){o("anchor-change",P)}const R=q(),O=q(null),z=q(null),W=q(null),j=lo({1:null,2:null,3:null,4:null,5:null,6:null}),Q=q(!1),re=new Map,K=q(0),ne=q(0),le=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function oe(P,te){return typeof P!="string"?te:P.trim()||te}function Me(P){const te=Number(P);return Number.isFinite(te)&&te>0?Math.max(1,Math.trunc(te)):640}const Be=D(()=>{var P;const te=(P=M.viewportPriorityOptions)!=null?P:{},ge=oe(te.rootMargin,Hh);return{rootMargin:ge,heavyBlockMargin:oe(te.heavyBlockMargin,ge),maxTargets:Me(te.maxTargets)}}),Pe=D(()=>{var P;return(P=Be.value.rootMargin)!=null?P:Hh}),xe=D(()=>{var P;return(P=Be.value.maxTargets)!=null?P:640});function J(){var P,te;if(((P=i.virtualScroll)==null?void 0:P.enabled)!==!0)return null;const ge=(te=i.virtualScroll)==null?void 0:te.scrollRoot;return se(typeof ge=="function"?ge():ge)}function se(P){return P?typeof HTMLElement<"u"&&P instanceof HTMLElement?P:typeof P=="object"&&"value"in P?se(P.value):typeof P=="object"&&"$el"in P?se(P.$el):null:null}Yn(bW,Be);const{isClient:U,renderAsFragment:G,debugPerformanceEnabled:me,resolvedShowTooltips:de,resolvedHtmlPolicy:fe,inheritedSmoothStreaming:X,ownsTypewriterCursor:Y}=(function(P){const te=typeof window<"u",ge=ym(),ke=on("markstreamHtmlPolicy",void 0),Ne=on("markstreamTypewriterCursor",void 0),Ue=on("markstreamSmoothStreaming",void 0),et=D(()=>P.renderAsFragment===!0),it=D(()=>!!(P.debugPerformance&&te&&typeof console<"u")),Ct=D(()=>{var bt;if(typeof P.showTooltips=="boolean")return P.showTooltips;const tt=(bt=ge.showTooltips)!=null?bt:ge["show-tooltips"];return tt===""||tt===!0||tt==="true"||tt!==!1&&tt!=="false"&&void 0}),ot=D(()=>{var bt,tt;return(tt=(bt=P.htmlPolicy)!=null?bt:ke?.value)!=null?tt:"safe"}),ft=D(()=>Ne?.value!==!0);return{isClient:te,renderAsFragment:et,debugPerformanceEnabled:it,resolvedShowTooltips:Ct,resolvedHtmlPolicy:ot,inheritedSmoothStreaming:Ue,inheritedTypewriterCursor:Ne,ownsTypewriterCursor:ft}})(M),{resolveViewportRoot:ue,resolveScrollContainer:ye,isReverseFlexScrollRoot:Ae,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:be}=(function(P,te){function ge(){var it,Ct;return(Ct=(it=te.scrollRoot)==null?void 0:it.call(te))!=null?Ct:null}function ke(it){if(typeof window>"u")return null;const Ct=ge();if(Ct)return Ct;const ot=it??P.value;if(!ot)return null;const ft=ot.ownerDocument||document,bt=ft.scrollingElement||ft.documentElement;let tt=ot;for(;tt&&tt!==ft.body&&tt!==bt;){if($ke(window.getComputedStyle(tt))&&zke(tt))return tt;tt=tt.parentElement}return null}function Ne(it){if(!te.isClient)return!1;try{const Ct=window.getComputedStyle(it);return!!(Ct.display||"").toLowerCase().includes("flex")&&(Ct.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ue(it,Ct,ot){var ft,bt;if(ot)return et(Ct);const tt=it.scrollTop;if(!Ne(it))return tt;const ht=tt<0?-tt:tt;return Math.max(0,((ft=it.scrollHeight)!=null?ft:0)-((bt=it.clientHeight)!=null?bt:0))-ht}function et(it){var Ct,ot,ft,bt,tt;const ht=Number((Ct=it.scrollingElement)==null?void 0:Ct.scrollTop),It=Number((ft=(ot=it.documentElement)==null?void 0:ot.scrollTop)!=null?ft:0),xt=Number((tt=(bt=it.body)==null?void 0:bt.scrollTop)!=null?tt:0);return Math.max(0,Number.isFinite(ht)?ht:0,Number.isFinite(It)?It:0,Number.isFinite(xt)?xt:0)}return{resolveViewportRoot:ke,resolveScrollContainer:function(it){var Ct,ot,ft,bt;const tt=ge();if(tt)return tt;const ht=ke((Ct=it??P.value)!=null?Ct:null);if(ht)return ht;const It=(bt=(ft=it?.ownerDocument)!=null?ft:(ot=P.value)==null?void 0:ot.ownerDocument)!=null?bt:typeof document<"u"?document:null;return It?.scrollingElement||It?.documentElement||null},isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:Ue,getOffsetTopWithinRoot:function(it,Ct){const ot=Ct.ownerDocument||it.ownerDocument||document;if((function(ht,It){return ht===It.documentElement||ht===It.body||ht===It.scrollingElement})(Ct,ot))return it.getBoundingClientRect().top+et(ot);const ft=Ct.getBoundingClientRect(),bt=it.getBoundingClientRect(),tt=Ue(Ct,ot,!1);return bt.top-ft.top+tt}}})(R,{isClient:U,scrollRoot:J});Yn("markstreamShowTooltips",de),Yn("markstreamHtmlPolicy",fe),Yn("markstreamTypewriter",f),Yn("markstreamFade",D(()=>M.fade!==!1)),Yn("markstreamTypewriterCursor",D(()=>!0)),Yn("markstreamTextStreamState",re),Yn("markstreamStreamVersion",K),Yn("markstreamParseOptions",D(()=>M.parseOptions)),Yn("markstreamCustomMarkdownIt",D(()=>M.customMarkdownIt));const{smoothStreamingEnabled:pe,renderContent:Te,requestedFinal:qe,effectiveFinal:mt}=(function(P,te){const ge=Oke($t($t({},Pke),P.smoothStreamingOptions)),ke=D(()=>{var tt,ht,It;return P.smoothStreaming!==!1&&!((tt=P.nodes)!=null&&tt.length)&&(P.smoothStreaming===!0||!((ht=te.inheritedSmoothStreaming)!=null&&ht.value))&&(P.smoothStreaming===!0||RN(P.typewriter)!=="off"||((It=P.maxLiveNodes)!=null?It:0)<=0)}),Ne=q(!te.isClient||P.smoothStreaming===!0);gn(()=>{Ne.value=!0});const Ue=D(()=>Ne.value&&ke.value),et=D(()=>{var tt;return Ue.value?ge.visible.value:(tt=P.content)!=null?tt:""}),it=D(()=>{var tt,ht;const It=(tt=P.parseOptions)!=null?tt:{};return(ht=P.final)!=null?ht:It.final}),Ct=D(()=>{const tt=it.value;return Ue.value&&tt!=null?!!tt&&ge.caughtUp.value:tt});let ot=0,ft=!1;function bt(){ot=0,ft=!1}return Ge([()=>P.content,()=>P.nodes,Ue,it],([tt,ht,It,xt])=>{if(ht?.length)return bt(),void ge.reset("");const Kt=tt??"";if(!It)return bt(),ge.reset(Kt),void(xt&&ge.finish({flush:!0}));const Bt=ge.source.value;if(Kt){if(Kt!==Bt)if(Kt.startsWith(Bt)){const an=Kt.slice(Bt.length),fn=ge.pendingChars.value;an.length<=8?(ot++,ft||ot>=2&&fn<=8?(ft=!0,ge.reset(Kt)):ge.enqueue(an)):(bt(),ge.enqueue(an))}else bt(),ge.reset(Kt)}else bt(),ge.reset("");xt&&ge.finish()},{immediate:!0}),{smoothStream:ge,smoothStreamingEligible:ke,smoothStreamingEnabled:Ue,renderContent:et,requestedFinal:it,effectiveFinal:Ct}})(M,{isClient:U,inheritedSmoothStreaming:X}),ct=qe.value===!0;Yn("markstreamSmoothStreaming",pe);const yt=q(!1),Dt=q(!1),Ht=q(!1);let Vt="",Ee=!1,ze=null;function Ye(){U&&ze!=null&&(window.clearTimeout(ze),ze=null)}function pt(){yt.value=!1,Ye()}function Et(P,te){if(!me.value)return;const ge=(function(){if(!me.value)return null;const ke=Fe(Mt),Ne=Fe(Ft),Ue=Math.max(rt,Ne);if(ke<=0&&Ue<=0)return null;const et={total:ke,maxPerFrame:Ue,byLabel:(it=Mt,Object.fromEntries(Array.from(it.entries()).sort((Ct,ot)=>ot[1]-Ct[1]||Ct[0].localeCompare(ot[0]))))};var it;return Mt.clear(),Ft.clear(),rt=0,et})();console.info(`[markstream-vue][perf] ${P}`,ge?Fn($t({},te),{layoutReads:ge}):te)}Ge([()=>M.indexKey,()=>M.customId],()=>{var P,te;pt(),Dt.value=!1,Ht.value=!((P=i.nodes)!=null&&P.length)&&qe.value!==!0&&!!i.content,Vt=(te=Te.value)!=null?te:"",Ee=Vt.length>0},{flush:"sync"}),Ge([()=>i.content,()=>i.nodes,qe],([P,te,ge])=>{!te?.length&&ge!==!0&&P&&(Ht.value=!0)},{flush:"sync",immediate:!0}),Ge([Te,()=>i.nodes,qe],([P,te,ge])=>{const ke=P??"";return te?.length||ge===!0?(pt(),Dt.value=!1,Vt=ke,void(Ee=!0)):(ke.length>0&&(Ht.value=!0),Ee?(Vt&&ke.length>Vt.length&&ke.startsWith(Vt)?(yt.value=!0,Dt.value=!0,U&&(Ye(),ze=window.setTimeout(()=>{var Ne;ze=null,mt.value===!0||(Ne=i.nodes)!=null&&Ne.length||(Cp(),yt.value=!1,Xu())},1200))):(ke.length"u")return null;const Ue=window;if(Ue.__markstreamLayoutReadPerformance)return Ue.__markstreamLayoutReadPerformance;const et={total:0,maxPerFrame:0,byLabel:{}};return Ue.__markstreamLayoutReadPerformance=et,et})();Ne&&(Ne.total=Number(Ne.total||0)+1,Ne.byLabel[ke]=Number(Ne.byLabel[ke]||0)+1,Ne.currentFrameTotal=Number(Ne.currentFrameTotal||0)+1,Ne.frameScheduled||(Ne.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>gt(Ne),0):queueMicrotask(()=>gt(Ne)):window.requestAnimationFrame(()=>gt(Ne))))})(P),De||(De=!0,U&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Qe):typeof queueMicrotask!="function"?setTimeout(Qe,0):queueMicrotask(Qe)))}function Wt(P,te){return Ut(P),te()}const An=M.customId?`renderer-${M.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Nn=(function(P){const te=new Map;return{scope:P,cache:te,clear:()=>te.clear()}})(An),uo=An;Yn(IW,Nn);const bi=ks(()=>M.customId),{effectiveCustomHtmlTagsSet:Co,mergedParseOptions:st,parsedNodes:Xe,getParsedNodesDirtyStartIndex:at,getParsedNodesRevision:Ln}=Bke(M,{instanceMsgId:An,renderContent:Te,effectiveFinal:mt,smoothStreamingEnabled:pe,debugPerformanceEnabled:me,customComponentsMap:bi,logPerf:Et});Ge(Xe,()=>{yt.value||Nn.clear(),K.value+=1},{immediate:!0});const St=D(()=>({customId:M.customId,customHtmlTags:st.value.customHtmlTags,parseOptions:M.parseOptions,customMarkdownIt:M.customMarkdownIt,htmlPolicy:fe.value,viewportPriority:M.viewportPriority,viewportPriorityOptions:Be.value,mode:c.value,domMode:M.domMode,codeRenderer:m.value,codeBlockStream:M.codeBlockStream,codeBlockDarkTheme:M.codeBlockDarkTheme,codeBlockLightTheme:M.codeBlockLightTheme,codeBlockMonacoOptions:M.codeBlockMonacoOptions,renderCodeBlocksAsPre:M.renderCodeBlocksAsPre,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockProps:M.codeBlockProps,mermaidProps:M.mermaidProps,d2Props:M.d2Props,infographicProps:M.infographicProps,showTooltips:de.value,themes:M.themes,langs:M.langs,isDark:M.isDark,typewriter:f.value,smoothStreamingOptions:M.smoothStreamingOptions,parseCoalesceMs:M.parseCoalesceMs,fade:M.fade}));Yn("markstreamNestedRendererProps",St);const Rn=D(()=>Xe.value),Yo=D(()=>Xe.value.length),Bi=q(null),Qr=q(null),Hs=q(null),_r=q(null),Ao=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Wo=!Ao&&M.customId?LN(M.customId):null,ar=D(()=>Wo?(t5.value,LN(M.customId)):null),to=D(()=>{var P;return!!(!G.value&&M.customId&&!Ao&&((P=ar.value)!=null&&P.enabled))}),No=D(()=>!!(U&&to.value)),Ui=D(()=>{var P;return!!(!G.value&&((P=i.virtualScroll)!=null&&P.enabled))}),Yr=D(()=>Ui.value),Jo=q(!1);gn(()=>{Jo.value=!0});const Vn=D(()=>!!(U&&Ui.value));Yn("markstreamHostScrollManaged",Vn);const Ri=D(()=>!!(Jo.value&&Vn.value)),co=D(()=>No.value||Vn.value),Oi=D(()=>No.value||Ri.value),xi=D(()=>{var P;return co.value&&((P=ar.value)==null?void 0:P.textEstimation)!==!1});function oi(){const P=ne.value||Wt("getMeasuredContainerWidth.clientWidth",()=>{var te;return((te=R.value)==null?void 0:te.clientWidth)||0});return Number.isFinite(P)&&P>0?P:0}const ei=D(()=>{const P=oi();return P>0?Math.max(1,Math.round(P)):640}),Gn=D(()=>{var P,te;return!(mt.value!==!0||Ui.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(P=i.nodes)!=null&&P.length||Ht.value||!(((te=M.maxLiveNodes)!=null?te:0)<=0))}),ti=D(()=>{var P;return Gn.value?50:Math.max(1,(P=M.maxLiveNodes)!=null?P:320)}),ri=D(()=>{var P;return Gn.value?16:Math.max(0,(P=M.liveNodeBuffer)!=null?P:60)}),xn=D(()=>{var P;return!G.value&&M.nodeVirtual!==!1&&!(((P=M.maxLiveNodes)!=null?P:0)<=0&&!Gn.value)&&(M.nodeVirtual===!0?Xe.value.length>0:Xe.value.length>ti.value)}),Ws=D(()=>xn.value||No.value||Vn.value),Jr=D(()=>M.viewportPriority!==!1),Xo=D(()=>!!Jr.value&&!Q.value);var ur;ur=D(()=>Jr.value),Yn(wW,ur);const wi=D(()=>{var P;return!(G.value||M.deferNodesUntilVisible===!1||((P=M.maxLiveNodes)!=null?P:0)<=0||xn.value||Xe.value.length>900||M.viewportPriority===!1)}),Si=gye(P=>{var te;return ue((te=P??R.value)!=null?te:null)},Jr),{requestFrame:Ji,cancelFrame:Vi,hasIdleCallback:mo,isTestEnv:no}=(function(P){const te=P.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ge=P.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ke=P.isClient&&typeof window.requestIdleCallback=="function",Ne=(function(){var Ue;if(typeof globalThis>"u"||!("process"in globalThis))return;const et=(Ue=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ue.value;return et?.env})();return{requestFrame:te,cancelFrame:ge,hasIdleCallback:ke,isTestEnv:Ne?.NODE_ENV==="test"}})({isClient:U}),xo=D(()=>mt.value===!0&&!Ui.value),{resolvedBatchSize:Do,resolvedInitialBatch:es,batchingEnabled:Ql,incrementalRenderingActive:cr,renderedCount:Xi,previousRenderContext:_l,adaptiveBatchSize:$e,previousBatchConfig:ee}=(function(P,te){var ge;const ke=D(()=>{var bt;const tt=Math.trunc((bt=P.renderBatchSize)!=null?bt:80);return Number.isFinite(tt)?Math.max(0,tt):0}),Ne=D(()=>{var bt;const tt=Math.trunc((bt=P.initialRenderBatchSize)!=null?bt:ke.value);return Number.isFinite(tt)?Math.max(0,tt):ke.value}),Ue=D(()=>!te.renderAsFragment.value&&P.batchRendering!==!1&&ke.value>0&&te.isClient&&!te.isTestEnv),et=q(0),it=q({key:P.indexKey,total:0}),Ct=q(Math.max(1,ke.value||1)),ot=D(()=>{var bt,tt,ht;return Ue.value&&!((bt=te.continuousStreaming)!=null&&bt.value)&&!((tt=te.forceFullRenderFinalContent)!=null&&tt.value)&&((ht=P.maxLiveNodes)!=null?ht:0)<=0}),ft=q({batchSize:ke.value,initial:Ne.value,delay:(ge=P.renderBatchDelay)!=null?ge:16,enabled:ot.value});return{resolvedBatchSize:ke,resolvedInitialBatch:Ne,batchingEnabled:Ue,incrementalRenderingActive:ot,renderedCount:et,previousRenderContext:it,adaptiveBatchSize:Ct,previousBatchConfig:ft}})(M,{isClient:U,isTestEnv:no,renderAsFragment:G,forceFullRenderFinalContent:xo,continuousStreaming:D(()=>Dt.value&&mt.value!==!0)}),ae=D(()=>{var P;return!G.value&&M.batchRendering!==!1&&Do.value>0&&!no&&((P=M.maxLiveNodes)!=null?P:0)<=0&&!xo.value}),nt=D(()=>ae.value),wt=D(()=>co.value||nt.value),Yt=D(()=>{var P;return wt.value&&((P=ar.value)==null?void 0:P.codeBlockEstimation)!==!1}),In=new Map,Dn=new Map,Pi=new WeakMap;let Ei=null;const $i=new WeakMap,Li=new Map,dr=[];let go=[],qs=[],Xr=-1;const Mr=Ja(dr),bs=new Set,Yl=q(0);let ai=0;const Ml=q(0),ws=D(()=>(Ml.value,Array.from(In.entries()).sort((P,te)=>P[0]-te[0]))),Jl=q(null),Ki=q(null);let Ds,ts=null,nu=0,Fs=null;function zi(){Ds.markFallbackHeightPrefixDirty()}function Il(P){return Ds.getFallbackNodeHeight(P)}function Us(P,te){return Ds.estimateHeightRange(P,te)}function Fo(P){return Ds.estimateIndexForOffset(P)}const{activeRestoreAnchor:ns,getRelativeScrollTopWithinContainer:el,setRelativeScrollTopWithinContainer:Xl,resolveAnchorOffset:ea,clearRestoreReconcile:Ir,scheduleRestoreReconcile:Ta,captureRestoreAnchor:iu,restoreAnchor:Ea,getAnchorDrift:Zu}=(function(P){const{isClient:te,containerRef:ge,parsedNodeCount:ke,requestFrame:Ne,cancelFrame:Ue,resolveScrollContainer:et,getNormalizedScrollTop:it,getOffsetTopWithinRoot:Ct,isReverseFlexScrollRoot:ot,estimateIndexForOffset:ft,estimateHeightRange:bt,getFallbackNodeHeight:tt,clamp:ht}=P,It=q(null);let xt=null,Kt=[];function Bt(){const Cn=et(),$n=ge.value;if(!Cn||!$n)return null;const qn=Cn.ownerDocument||$n.ownerDocument||document;if(Cn===qn.documentElement||Cn===qn.body||Cn===qn.scrollingElement){const ji=$n.getBoundingClientRect();return Math.max(0,-ji.top)}return Math.max(0,it(Cn,qn,!1)-Ct($n,Cn))}function an(Cn){var $n;const qn=et(),ji=ge.value;if(!qn||!ji)return;const Gs=Math.max(0,Cn),Rs=qn.ownerDocument||ji.ownerDocument||document,La=Rs.defaultView||(typeof window<"u"?window:null);if(qn===Rs.documentElement||qn===Rs.body||qn===Rs.scrollingElement){const uu=it(qn,Rs,!0)+ji.getBoundingClientRect().top;return void(($n=La?.scrollTo)==null||$n.call(La,0,Math.max(0,uu+Gs)))}FN(qn,Rs,Ct(ji,qn)+Gs,{isReverseFlexScrollRoot:uu=>{var tg;return(tg=ot?.(uu))!=null&&tg},getNormalizedScrollTop:it})}function fn(Cn){const $n=ke.value,qn=ht(Cn.nodeIndex,0,Math.max(0,$n-1));return bt(0,qn)+Math.max(0,Cn.offsetWithinNodePx)}function wn(){if(xt!=null&&(Ue?.(xt),xt=null),te)for(const Cn of Kt)window.clearTimeout(Cn);Kt=[]}function yn(Cn){const $n=fn(Cn),qn=Bt();qn!=null&&Math.abs(qn-$n)<=.5||an($n)}return{activeRestoreAnchor:It,getRelativeScrollTopWithinContainer:Bt,setRelativeScrollTopWithinContainer:an,resolveAnchorOffset:fn,clearRestoreReconcile:wn,applyRestoreAnchor:yn,scheduleRestoreReconcile:function(){It.value&&te&&xt==null&&(xt=Ne?Ne(()=>{xt=null,It.value&&yn(It.value)}):null,xt==null&&It.value&&yn(It.value))},captureRestoreAnchor:function(){const Cn=Bt(),$n=ke.value;if(Cn==null||$n<=0)return null;const qn=ht(ft(Cn+1),0,$n-1),ji=bt(0,qn),Gs=tt(qn);return{nodeIndex:qn,offsetWithinNodePx:ht(Cn-ji,0,Math.max(0,Gs-1))}},restoreAnchor:function(Cn){const $n=ke.value;if(It.value={nodeIndex:ht(Cn.nodeIndex,0,Math.max(0,$n-1)),offsetWithinNodePx:Math.max(0,Cn.offsetWithinNodePx)},wn(),yn(It.value),te)for(const qn of[0,120,280,480])Kt.push(window.setTimeout(()=>{It.value&&yn(It.value)},qn))},getAnchorDrift:function(Cn){const $n=Bt();return $n==null?null:$n-fn(Cn)}}})({isClient:U,containerRef:R,parsedNodeCount:Yo,requestFrame:Ji,cancelFrame:Vi,resolveScrollContainer:()=>Jl.value||ye(),getNormalizedScrollTop:Le,getOffsetTopWithinRoot:be,isReverseFlexScrollRoot:Ae,estimateIndexForOffset:Fo,estimateHeightRange:Us,getFallbackNodeHeight:Il,clamp:Zs}),{nodeHeights:Cs,heightStats:is,heightTreeSize:Gu,heightSumTree:xf,heightKnownTree:ta,averageNodeHeight:ou,resetHeightMeasurements:su,pruneHeightMeasurements:Wc,rebuildHeightTrees:Tl,recordNodeHeight:ru,removeNodeHeights:lu,exportHeightCache:Tr,importHeightCache:fi,fenwickRangeSum:El}=(function(P={}){const te=lo({}),ge=lo({total:0,count:0}),ke=q(0),Ne=q([]),Ue=q([]);function et(){for(const tt of Object.keys(te))delete te[Number(tt)];ge.total=0,ge.count=0,ke.value=0,Ne.value=[],Ue.value=[]}function it(tt,ht,It){for(let xt=ht+1;xt0;xt-=xt&-xt)It+=tt[xt];return It}function ot(tt){ke.value=tt;const ht=new Array(tt+1).fill(0),It=new Array(tt+1).fill(0);for(const[xt,Kt]of Object.entries(te)){const Bt=Number(xt),an=Number(Kt);!Number.isFinite(Bt)||Bt<0||Bt>=tt||!Number.isFinite(an)||an<=0||(it(ht,Bt,an),it(It,Bt,1))}Ne.value=ht,Ue.value=It}function ft(tt){if(!Number.isInteger(tt)||tt<0)return!1;const ht=te[tt];if(!Number.isFinite(ht)||ht<=0)return!1;if(delete te[tt],ge.total=Math.max(0,ge.total-ht),ge.count=Math.max(0,ge.count-1),ke.value>tt){const It=Ne.value,xt=Ue.value;It.length&&xt.length&&(it(It,tt,-ht),it(xt,tt,-1))}return!0}const bt=D(()=>ge.count>0?Math.max(12,ge.total/ge.count):32);return{nodeHeights:te,heightStats:ge,heightTreeSize:ke,heightSumTree:Ne,heightKnownTree:Ue,averageNodeHeight:bt,resetHeightMeasurements:et,pruneHeightMeasurements:function(tt){if(tt<=0)return void et();let ht=0,It=0;for(const[xt,Kt]of Object.entries(te)){const Bt=Number(xt),an=Number(Kt);!Number.isFinite(Bt)||Bt<0||Bt>=tt||!Number.isFinite(an)||an<=0?delete te[Bt]:(ht+=an,It++)}ge.total=ht,ge.count=It},rebuildHeightTrees:ot,recordNodeHeight:function(tt,ht,It={}){(function(xt,Kt,Bt={}){var an;if(!Number.isFinite(Kt)||Kt<=0)return!1;const fn=te[xt];if(fn&&(Bt.allowShrink===!1&&Ktxt){const wn=Ne.value,yn=Ue.value;if(wn.length&&yn.length)if(fn){const Cn=Kt-fn;Cn!==0&&it(wn,xt,Cn)}else it(wn,xt,Kt),it(yn,xt,1)}Bt.notify!==!1&&((an=P.onHeightRecorded)==null||an.call(P))})(tt,ht,Fn($t({},It),{notify:!0}))},removeNodeHeight:function(tt,ht={}){var It;const xt=ft(tt);return xt&&ht.notify!==!1&&((It=P.onHeightRecorded)==null||It.call(P)),xt},removeNodeHeights:function(tt,ht={}){var It;let xt=0;for(const Kt of tt)ft(Number(Kt))&&xt++;return xt>0&&ht.notify!==!1&&((It=P.onHeightRecorded)==null||It.call(P)),xt},exportHeightCache:function(){return Object.entries(te).map(([tt,ht])=>({index:Number(tt),height:Number(ht)})).filter(tt=>Number.isFinite(tt.index)&&tt.index>=0&&Number.isFinite(tt.height)&&tt.height>0).sort((tt,ht)=>tt.index-ht.index)},importHeightCache:function(tt,ht={}){var It;if(!Array.isArray(tt))return;const xt=ke.value;let Kt=!1;if(ht.mode!=="merge"){const Bt=Object.keys(te);if(Bt.length>0){for(const an of Bt)delete te[Number(an)];Kt=!0}}for(const Bt of tt){const an=Number(Bt.index),fn=Number(Bt.height);if(!Number.isInteger(an)||an<0||xt>0&&an>=xt||!Number.isFinite(fn)||fn<=0)continue;const wn=te[an];wn&&Math.abs(wn-fn)<=1||(te[an]=fn,Kt=!0)}Kt&&((function(){let Bt=0,an=0;const fn=ke.value;for(const[wn,yn]of Object.entries(te)){const Cn=Number(wn),$n=Number(yn);!Number.isFinite(Cn)||Cn<0||fn>0&&Cn>=fn||!Number.isFinite($n)||$n<=0?delete te[Cn]:(Bt+=$n,an++)}ge.total=Bt,ge.count=an})(),xt>0&&ot(xt),(It=P.onHeightRecorded)==null||It.call(P))},fenwickRangeSum:function(tt,ht,It){if(It<=ht)return 0;const xt=Ct(tt,It-1);return ht<=0?xt:xt-Ct(tt,ht-1)}}})({onHeightRecorded:()=>{zi(),Vn.value&&Gm(),ns.value&&Ta(),Ki.value&&kp(),io("node-resize")}});function Z(P){Number.isInteger(P)&&P>=0&&bs.add(P)}function we(P){for(const te of P)Z(Number(te))}function Oe(P){ai++;let te=!0;try{const ge=P();return te=ge!==!1,ge}finally{ai--,ai===0&&te&&Yl.value++}}function Ve(){go=[],qs=[],Xr=-1,bs.clear(),Mr.value=dr}function Ze(){Ve(),Oe(()=>su()),Li.clear()}function Ke(P){!Number.isInteger(P)||P<0||P>=Xe.value.length||Li.set(P,Pm(P))}function lt(P,te,ge={}){const ke=Cs[P];Z(P),ru(P,te,ge);const Ne=Cs[P];return Object.is(ke,Ne)?(bs.delete(P),!1):(Ne&&Ne>0?Ke(P):ke&&Li.delete(P),!0)}function Ot(P,te){const ge=Wt("getNodeLayoutHeight.slot.offsetHeight",()=>{var ke,Ne;return(Ne=(ke=In.get(P))==null?void 0:ke.offsetHeight)!=null?Ne:0});return ge>0?ge:Wt("getNodeLayoutHeight.content.offsetHeight",()=>te.offsetHeight)}function ve(P,te={}){te.mode!=="merge"?Ve():we(P.map(ge=>ge.index)),Oe(()=>fi(P,te)),k3()}const Ce=D(()=>wi.value&&Xo.value),je=D(()=>{var P;return!G.value&&M.batchRendering!==!1&&Do.value>0&&((P=M.maxLiveNodes)!=null?P:0)<=0}),kt=D(()=>!G.value&&ct&&mt.value===!0&&!xn.value&&!Ui.value&&!to.value&&!Ce.value&&!je.value),Pt=D(()=>!!Si&&Ce.value),Jt=D(()=>xn.value||Vn.value),{focusIndex:en,liveRange:Zt,updateLiveRange:Qn}=(function(P,te){const{parsedNodeCount:ge,virtualizationEnabled:ke,maxLiveNodesResolved:Ne,liveNodeBufferResolved:Ue,clamp:et}=te,it=Ue??D(()=>{var ft;return Math.max(0,(ft=P.liveNodeBuffer)!=null?ft:60)}),Ct=q(0),ot=lo({start:0,end:0});return{liveNodeBufferResolved:it,focusIndex:Ct,liveRange:ot,updateLiveRange:function(){const ft=ge.value;if(!ke.value||ft===0)return ot.start=0,void(ot.end=ft);const bt=Math.min(Ne.value,ft),tt=it.value,ht=et(Ct.value-tt,0,Math.max(0,ft-bt));ot.start=ht,ot.end=Math.min(ft,ht+bt)}}})(M,{parsedNodeCount:Yo,virtualizationEnabled:xn,maxLiveNodesResolved:ti,liveNodeBufferResolved:ri,clamp:Zs}),hi=new Map,Bs=new Map,qo=new Map,na=[],pi=new Map,eo=new Set,So=q(0);let ia=!1;const cp=D(()=>(So.value,eo.size)),Uo=new Map,Bo=new Map,h2=q(0),au=D(()=>{h2.value;let P=0;for(const te of Uo.values())P+=Math.max(0,te);return P});let Er=null;const Sf=D(()=>{if(!xn.value)return Xe.value.length;const P=ri.value,te=Math.max(Zt.end+P,es.value),ge=Math.min(Xe.value.length,te);return Math.max(Xi.value,ge)});function dp(){ia||(ia=!0,queueMicrotask(()=>{ia=!1,So.value+=1}))}function fp(P,te,ge="node-resize"){if(!U||typeof window>"u")return null;const ke=window.setTimeout(()=>{eo.delete(ke)&&dp();try{te()}finally{io(ge)}},Math.max(0,P));return eo.add(ke),dp(),ke}function Ie(P){U&&P!=null&&(eo.delete(P)&&dp(),window.clearTimeout(P))}function dt(){if(U&&typeof window<"u")for(const P of eo)window.clearTimeout(P);eo.size&&(eo.clear(),dp()),na.length=0,qo.clear()}function Je(P){O.value=P}function At(P){z.value=P}function sn(P){W.value=P}const{cancelScheduledFocusSync:mn,scheduleFocusSync:vn}=(function(P){const{isClient:te,containerRef:ge,virtualizationEnabled:ke,requestFrame:Ne,cancelFrame:Ue,syncFocusToScroll:et}=P;let it=null;function Ct(){var ft,bt,tt;return(tt=(bt=(ft=ge.value)==null?void 0:ft.ownerDocument)==null?void 0:bt.defaultView)!=null?tt:typeof window<"u"?window:null}function ot(){if(!it)return;const ft=Ct();it.viaTimeout?ft?ft.clearTimeout(it.id):clearTimeout(it.id):Ue?.(it.id),it=null}return{cancelScheduledFocusSync:ot,scheduleFocusSync:function(ft={}){if(!ke.value)return;if(!te)return void et(!0);if(ft.immediate)return ot(),void et(!0);if(it)return;const bt=()=>{it=null,et()};if(Ne)return void(it={id:Ne(bt),viaTimeout:!1});const tt=Ct();it={id:tt?tt.setTimeout(bt,16):setTimeout(bt,16),viaTimeout:!0}}}})({isClient:U,containerRef:R,virtualizationEnabled:xn,requestFrame:Ji,cancelFrame:Vi,syncFocusToScroll:function(P=!1){var te;if(!xn.value)return;const ge=Jl.value||ye();if(!ge)return;const ke=ge.ownerDocument||((te=R.value)==null?void 0:te.ownerDocument)||document,Ne=ke?.defaultView||(typeof window<"u"?window:null),Ue=ge===ke?.documentElement||ge===ke?.body,et=Xe.value.length;if(et<=0)return;if(!Ue&&et>0&&Ae(ge)){const xt=Wt("syncFocusToScroll.clientHeight",()=>ge.clientHeight||0),Kt=Wt("syncFocusToScroll.scrollTop",()=>ge.scrollTop),Bt=Kt<0?-Kt:Kt;return void p2(Zs((it=Math.max(0,Bt)+.5*Math.max(0,xt),Ds.estimateIndexForOffsetFromEnd(it)),0,Math.max(0,et-1)),P)}var it;const Ct=(function(xt,Kt,Bt,an){const fn=R.value;if(!fn)return null;const wn=an?0:Wt("syncFocusToScroll.model.root.getBoundingClientRect",()=>xt.getBoundingClientRect().top),yn=Wt("syncFocusToScroll.model.container.getBoundingClientRect",()=>fn.getBoundingClientRect().top),Cn=Math.max(0,wn-yn),$n=an?Wt("syncFocusToScroll.model.viewport.clientHeight",()=>{var qn,ji,Gs,Rs;return(Rs=(Gs=(ji=Bt?.innerHeight)!=null?ji:(qn=Kt.documentElement)==null?void 0:qn.clientHeight)!=null?Gs:xt.clientHeight)!=null?Rs:0}):Wt("syncFocusToScroll.model.root.clientHeight",()=>xt.clientHeight);return Zs(Fo(Cn+.5*Math.max(0,$n)),0,Math.max(0,Xe.value.length-1))})(ge,ke,Ne,Ue);if(Ct!=null)return void p2(Ct,P);const ot=Ue?null:Wt("syncFocusToScroll.root.getBoundingClientRect",()=>ge.getBoundingClientRect()),ft=Ue?0:ot.top,bt=Ue?Wt("syncFocusToScroll.viewport.clientHeight",()=>{var xt,Kt;return(Kt=(xt=Ne?.innerHeight)!=null?xt:ge.clientHeight)!=null?Kt:0}):ot.bottom,tt=ws.value;let ht=null,It=null;for(const[xt,Kt]of tt){if(!Kt)continue;const Bt=Wt("syncFocusToScroll.slot.getBoundingClientRect",()=>Kt.getBoundingClientRect());Bt.bottom<=ft||Bt.top>=bt||(ht==null&&(ht=xt),It=xt)}if(ht==null||It==null){const xt=R.value;if(!xt)return;const Kt=Ue?{top:0}:Wt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ge.getBoundingClientRect()),Bt=Wt("syncFocusToScroll.fallback.scrollTop",()=>Le(ge,ke,Ue)),an=Ue?(()=>{const wn=Wt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>xt.getBoundingClientRect()),yn=(Ue?0:Kt.top)-wn.top;return Math.max(0,yn)})():(()=>{const wn=be(xt,ge);return Math.max(0,Bt-wn)})(),fn=Ue?Wt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wn,yn,Cn,$n;return($n=(Cn=(yn=Ne?.innerHeight)!=null?yn:(wn=ke?.documentElement)==null?void 0:wn.clientHeight)!=null?Cn:ge.clientHeight)!=null?$n:0}):Wt("syncFocusToScroll.fallback.root.clientHeight",()=>ge.clientHeight);return void p2(Zs(Fo(an+.5*Math.max(0,fn)),0,Math.max(0,Xe.value.length-1)),!0)}p2(Math.round((ht+It)/2),P)}}),{visibleNodeIndices:Wn,nodeVisibilityHandles:Sn,nodeVisibilityWatchStops:Zi,nodeVisibilityFallbackTimers:Lr,clearVisibilityFallback:Vs,markNodeVisible:Ks,cleanupNodeVisibility:Qu,destroyNodeVisibilityState:Yu}=Rke({isClient:U,shouldTrackVisibleNodeIndices:()=>Ce.value,shouldCleanupNodeVisibility:()=>xn.value,onNodeMarkedVisible:P=>{xn.value?vn():en.value=Zs(P,0,Math.max(0,Xe.value.length-1))},onNodeVisibilityCleaned:P=>{In.delete(P)&&O_()}}),{cleanupScrollListener:c_,setupScrollListener:KG}=(function(P){const{isClient:te,virtualizationEnabled:ge,listenerEnabled:ke,scrollRootElement:Ne,resolveScrollContainer:Ue,scheduleFocusSync:et,onScroll:it}=P;let Ct=null,ot=null;function ft(){Ct&&(Ct(),Ct=null),ot=null,Ne.value=null}function bt(tt){const ht=P.getScrollTop?P.getScrollTop(tt):tt.scrollTop;return Math.max(0,Number.isFinite(ht)?Math.abs(ht):0)}return{cleanupScrollListener:ft,setupScrollListener:function(){if(!te)return;if(!((tt=ke?.value)!=null?tt:ge.value))return void ft();var tt;const ht=Ue();if(!ht)return void ft();if(Ne.value===ht&&Ct)return;ft(),ot=bt(ht);const It=()=>{if(it?.(),ge.value){const xt=(function(Kt){const Bt=bt(Kt),an=ot;ot=Bt;const fn=Math.max(480,.75*(Kt.clientHeight||0));return an==null?Bt>fn?{immediate:!0}:void 0:Math.abs(Bt-an)>fn?{immediate:!0}:void 0})(ht);xt?et(xt):et()}};ht.addEventListener("scroll",It,{passive:!0}),Ne.value=ht,Ct=()=>{ht.removeEventListener("scroll",It)}}}})({isClient:U,virtualizationEnabled:xn,listenerEnabled:Jt,scrollRootElement:Jl,resolveScrollContainer:ye,scheduleFocusSync:vn,onScroll:function(){const P=Ki.value;if(!P)return;const te=Om();if(!te||(function(ke){if(Wm()>=nu)return Fs=null,!1;const Ne=Fs;if(Ne==null)return!0;const Ue=Math.abs(ke.scrollTop-Ne)<=2;return Ue||(Fs=null),Ue})(te))return;const ge=S_(te);ge!=null?(ge<-32||Math.abs(Math.max(0,ge)-Math.max(0,P.distanceFromBottomPx))>32)&&yp("restore"):yp("restore")},getScrollTop:P=>{var te;const ge=P.ownerDocument||((te=R.value)==null?void 0:te.ownerDocument)||document,ke=P===ge.documentElement||P===ge.body||P===ge.scrollingElement;return Wt("scrollListener.getScrollTop",()=>Le(P,ge,ke))}});function p2(P,te=!1){const ge=Zs(P,0,Math.max(0,Xe.value.length-1));!te&&Math.abs(ge-en.value)<=1||(en.value=ge,Qn())}function Zs(P,te,ge){return Math.min(Math.max(P,te),ge)}function Y4(P=Xe.value.length){const te=at();return!Number.isInteger(te)||te<0?P:Zs(te,0,P)}function J4(P){return P?.firstElementChild}function d_(P,te){var ge;return P?(ge=P.matches)!=null&&ge.call(P,te)?P:P.querySelector(te):null}function ZG(P,te){P<1||P>6||(j[P]=te)}function f_(){if(!co.value)return void(ne.value=0);const P=Wt("updateExperimentContainerWidth.clientWidth",()=>{var te,ge;return(ge=(te=R.value)==null?void 0:te.clientWidth)!=null?ge:0});ne.value=P>0?P:0}let Rm=null;function X4(){Rm?.disconnect(),Rm=null}const h_=Pg("ViewportDeferredMarkdownCodeBlockNode",Tu({loader:()=>so(null,null,function*(){return(yield Qo(()=>import("./index5-D69D8dfe.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Bk,delay:0,suspensible:!1}),Bk);function p_(P){return P===h_}const m_=D(()=>m.value==="pre"?ll:m.value==="shiki"?h_:G8);function g_(){var P;return((P=M.codeBlockProps)==null?void 0:P.showHeader)!==!1}function v_(P,te,ge){const ke=Cs[te],Ne=typeof ke=="number"&&ke>0;if(xi.value&&!Ne&&!(function(Ue){return!!bi.value.paragraph&&(Ue.type==="paragraph"||Ue.type==="list_item"||Ue.type==="list")})(P)){const Ue=MW(P,ge,le.value);if(Ue)return Ue}if(Yt.value&&P.type==="code_block"){const Ue=(function(et){if(et.type!=="code_block")return null;const it=G_(et,x2(et));return p_(it)?"markdown":it===ll?"pre":it===m_.value||it===G8?"monaco":null})(P);if(Ue==="monaco"||Ue==="markdown"||Ue==="pre")return(function(et,it){var Ct,ot,ft;if(!et||et.type!=="code_block")return null;const bt=it.rendererKind,tt=bt!=="pre"&&it.showHeader!==!1,ht=!!et.diff;let It=0,xt=500;if(bt==="monaco"){const Bt=(Ct=it.monacoOptions)!=null?Ct:{},an=o5(et,Bt,it.width),fn=(function(yn){const Cn=typeof yn?.fontSize=="number"&&yn.fontSize>0?yn.fontSize:12;return typeof yn?.lineHeight=="number"&&yn.lineHeight>0?yn.lineHeight:Math.round(1.5*Cn)})(Bt),wn=(function(yn,Cn){var $n,qn;const ji=typeof(($n=yn?.padding)==null?void 0:$n.top)=="number"?yn.padding.top:Cn?0:8,Gs=typeof((qn=yn?.padding)==null?void 0:qn.bottom)=="number"?yn.padding.bottom:Cn?0:8;return Math.max(0,ji)+Math.max(0,Gs)})(Bt,ht);xt=typeof Bt.MAX_HEIGHT=="number"&&Bt.MAX_HEIGHT>0?Bt.MAX_HEIGHT:500,It=Math.round(an*fn+wn)}else if(bt==="markdown"){const Bt=o5(et);It=Math.round(21*Bt+32)}else{const Bt=o5(et);It=Math.round(28*Bt),xt=Number.POSITIVE_INFINITY}const Kt=Math.max(1,Math.min(It,xt));return $t({kind:"code-block",height:Math.round(Kt+(tt?40:0)),contentHeight:Kt,rendererKind:bt},ht&&bt==="monaco"?{diffInline:nx((ot=it.monacoOptions)!=null?ot:{},(ft=it.width)!=null?ft:0)}:{})})(P,{rendererKind:Ue,monacoOptions:M.codeBlockMonacoOptions,showHeader:g_(),width:ge})}return null}C1(()=>{if(Yl.value,ai>0)return;const P=Xe.value,te=Ln();if(!P.length||!wt.value)return go=[],qs=[],Xr=-1,bs.clear(),void(Mr.value=dr);const ge=ne.value||Wt("estimatedNodeHeights.clientWidth",()=>{var ot;return((ot=R.value)==null?void 0:ot.clientWidth)||0});if(!Number.isFinite(ge)||ge<=0)return go=[],qs=[],Xr=-1,bs.clear(),void(Mr.value=dr);const ke=(function(ot){return[Math.round(ot),xi.value,Yt.value,le.value,M.codeBlockMonacoOptions,g_(),m.value,bi.value,t5.value]})(ge),Ne=go.length<=P.length&&(et=ke,(Ue=qs).length===et.length&&Ue.every((ot,ft)=>Object.is(ot,et[ft])));var Ue,et;const it=Ne&&Xr===te?P.length:Ne?Y4(P.length):0,Ct=Ne?Array.from(bs):[];go.length=P.length;for(let ot=it;ot=0&&otMr.value);Ds=(function(P){let te=!0,ge=[0],ke="";function Ne(ft){var bt;const tt=P.nodeHeights[ft];if(Number.isFinite(tt)&&tt>0)return tt;const ht=P.parsedNodes.value[ft],It=ht?.type,xt=!!((bt=P.hasCustomParagraphComponent)!=null&&bt.call(P)),Kt=P.estimatedNodeHeights.value[ft],Bt=Kt?.height;if(!(function(fn,wn,yn){return!!(yn&&wn?.kind==="simple-text"&&(fn==="paragraph"||fn==="list_item"||fn==="list"))})(It,Kt,xt)&&Number.isFinite(Bt)&&Bt>0)return Bt;const an=xke(ht,P.getContainerWidth()||640);return It==="heading"||It==="paragraph"&&an<=28&&(function(fn,wn){if(wn)return!1;const yn=fn.children;return!Array.isArray(yn)||!yn.length||yn.every(TW)})(ht,xt)?an:Math.max(P.averageNodeHeight.value,an)}function Ue(){var ft;const bt=P.parsedNodes.value.length,tt=P.getPrefixCacheKeyParts().join(":");if(!te&&ke===tt)return ge;const ht=new Array(bt+1);ht[0]=0;for(let It=0;It=((bt=It[ht])!=null?bt:0))return ht-1;let xt=0,Kt=ht-1,Bt=ht-1;for(;xt<=Kt;){const an=xt+Kt>>1;((tt=It[an+1])!=null?tt:0)>=ft?(Bt=an,Kt=an-1):xt=an+1}return Bt}function it(ft,bt){var tt,ht;if(ft>=bt)return 0;if(P.heightEstimationActive.value)return(function(Kt,Bt){var an,fn;const wn=P.parsedNodes.value.length,yn=ON(Math.trunc(Kt),0,wn),Cn=ON(Math.trunc(Bt),yn,wn);if(yn>=Cn)return 0;const $n=Ue();return((an=$n[Cn])!=null?an:0)-((fn=$n[yn])!=null?fn:0)})(ft,bt);if(P.heightTreeSize.value!==P.parsedNodes.value.length){let Kt=0;for(let Bt=ft;Btyn<=0?0:P.fenwickRangeSum(xt,0,yn)+(yn-P.fenwickRangeSum(Kt,0,yn))*It;let an=0,fn=tt.length-1,wn=tt.length-1;for(;an<=fn;){const yn=an+fn>>1;Bt(yn+1)>=ft?(wn=yn,fn=yn-1):an=yn+1}return wn}let ht=ft;for(let It=0;It0||ft++}return ft}return{markFallbackHeightPrefixDirty:function(){te=!0},getFallbackNodeHeight:Ne,estimateHeightRange:it,estimateIndexForOffset:Ct,estimateIndexForOffsetFromEnd:function(ft){var bt,tt;const ht=P.parsedNodes.value;if(!ht.length)return 0;if(ft<=0)return Math.max(0,ht.length-1);if(P.heightEstimationActive.value){const xt=(bt=Ue()[ht.length])!=null?bt:0;return et(Math.max(0,xt-ft))}if(P.heightTreeSize.value===ht.length){const xt=it(0,ht.length);return Ct(Math.max(0,xt-ft))}let It=ft;for(let xt=ht.length-1;xt>=0;xt--){const Kt=(tt=P.nodeHeights[xt])!=null?tt:P.averageNodeHeight.value;if(It<=Kt)return xt;It-=Kt}return 0},getEstimatedNodeHeightCount:ot,buildVirtualHeightSummary:function(ft){var bt;const tt=P.parsedNodes.value.length;return{totalNodes:tt,measuredCount:P.heightStats.count,estimatedCount:ot(),averageNodeHeight:P.averageNodeHeight.value,topSpacerHeight:ft.topSpacerHeight,bottomSpacerHeight:ft.bottomSpacerHeight,estimatedTotalHeight:it(0,tt),width:(bt=ft.width)!=null?bt:P.getContainerWidth()}}}})({parsedNodes:Xe,nodeHeights:Cs,heightStats:is,heightTreeSize:Gu,heightSumTree:xf,heightKnownTree:ta,averageNodeHeight:ou,heightEstimationActive:co,estimatedNodeHeights:hp,getContainerWidth:oi,hasCustomParagraphComponent:()=>!!bi.value.paragraph,getPrefixCacheKeyParts:()=>{var P;const te=mg(ne.value||Wt("getFallbackHeightPrefix.clientWidth",()=>{var ke;return((ke=R.value)==null?void 0:ke.clientWidth)||0})),ge=((P=i.virtualScroll)==null?void 0:P.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Xe.value.length,is.count,Math.round(is.total),Math.round(100*ou.value),ge,te,co.value?1:0,t5.value,K.value,bi.value.paragraph?1:0]},fenwickRangeSum:El}),Ge(()=>Xe.value.length,P=>{var te;zi(),P<=0?Ze():(PWc(te))),P!==Gu.value&&Tl(P))},{immediate:!0});const GG=D(()=>{if(!xn.value)return Xe.value.map((ke,Ne)=>({node:ke,index:Ne}));const P=Xe.value.length,te=Zs(Zt.start,0,P),ge=Zs(Zt.end,te,P);return Xe.value.slice(te,ge).map((ke,Ne)=>({node:ke,index:te+Ne}))}),e3=D(()=>xn.value?Us(0,Math.min(Zt.start,Xe.value.length)):0),t3=D(()=>{if(!xn.value)return 0;const P=Xe.value.length;return Us(Math.min(Zt.end,P),P)});function y_(){return Ds.buildVirtualHeightSummary({topSpacerHeight:e3.value,bottomSpacerHeight:t3.value,width:_f()})}function QG(){const P=Xe.value,te=y_();return Fn($t({},te),{probe:{paragraphReady:!!le.value.paragraph,listItemReady:!!le.value.listItem,listWrapperOverhead:le.value.listWrapperOverhead,headingReadyLevels:Object.entries(le.value.headings).filter(([,ge])=>!!ge).map(([ge])=>Number(ge))},nodes:P.map((ge,ke)=>{var Ne,Ue,et,it,Ct,ot,ft,bt,tt;return{index:ke,type:ge.type,estimateKind:(Ue=(Ne=hp.value[ke])==null?void 0:Ne.kind)!=null?Ue:null,rendererKind:(it=(et=hp.value[ke])==null?void 0:et.rendererKind)!=null?it:null,estimatedHeight:(ot=(Ct=hp.value[ke])==null?void 0:Ct.height)!=null?ot:null,estimatedContentHeight:(bt=(ft=hp.value[ke])==null?void 0:ft.contentHeight)!=null?bt:null,measuredHeight:(tt=Cs[ke])!=null?tt:null}})})}function n3(){return i.indexKey!=null?String(i.indexKey):Ui.value?`virtual-${vo()}`:"markdown-renderer"}function k_(P){const te=String(P),ge=`${n3()}-`;if(!te.startsWith(ge))return null;const ke=te.slice(ge.length).match(/^(\d+)(?:$|-)/);if(!ke)return null;const Ne=Number(ke[1]);return!Number.isInteger(Ne)||Ne<0||Ne>=Xe.value.length?null:Ne}function vo(){var P,te,ge;const ke=(P=i.virtualScroll)==null?void 0:P.sessionKey;return String(ke!=null&&ke!==""?ke:(ge=(te=i.indexKey)!=null?te:M.customId)!=null?ge:An)}function ss(){var P;const te=(P=i.virtualScroll)==null?void 0:P.threadKey;return te==null||te===""?void 0:String(te)}const YG=D(()=>{var P,te,ge;return(ge=ss())!=null?ge:String((te=(P=i.indexKey)!=null?P:M.customId)!=null?te:An)});function i3(P){var te;return(P??"")===((te=ss())!=null?te:"")}function Ju(){var P,te,ge;return te=(P=i.virtualScroll)==null?void 0:P.measurementKey,ge=(function(){const ke=m.value;return(function(Ne){var Ue,et;const it=Ne.renderer,Ct=it==="monaco"?Ne.codeBlockMonacoOptions:void 0,ot=Ne.codeBlockProps,ft=it==="shiki";return[Ne.isDark?"dark":"light",it==="monaco"?"code-rich":it==="pre"?"code-pre":"code-shiki",Ne.codeBlockStream===!1?"code-static":"code-stream",Os(Ne.codeBlockMinWidth),Os(Ne.codeBlockMaxWidth),...ft?[m2e((Ue=ot?.themes)!=null?Ue:Ne.themes,(et=ot?.langs)!=null?et:Ne.langs)]:[],Os(Ct?.fontSize),Os(Ct?.lineHeight),Os(Ct?.fontFamily),Os(Ct?.tabSize),Os(Ct?.MAX_HEIGHT),Os(Ct?.wordWrap),Os(Ct?.wrappingIndent),Os(Ct?.padding),Os(ot?.showHeader),Os(ot?.showCopyButton),Os(ot?.showExpandButton),Os(ot?.showPreviewButton),Os(ot?.showCollapseButton),Os(ot?.showFontSizeButtons)].join("\0")})({renderer:ke,isDark:M.isDark,codeBlockStream:M.codeBlockStream,codeBlockMinWidth:M.codeBlockMinWidth,codeBlockMaxWidth:M.codeBlockMaxWidth,codeBlockMonacoOptions:ke==="monaco"?M.codeBlockMonacoOptions:void 0,codeBlockProps:M.codeBlockProps,themes:ke==="shiki"?M.themes:void 0,langs:ke==="shiki"?M.langs:void 0})})(),[te==null?"":String(te),ge].join("\0")}function _f(){return oi()}const m2=D(()=>mg(_f())),Ll=D(()=>[Ju(),m2.value].join("\0")),JG=D(()=>{var P;return Ui.value?["virtual",(P=ss())!=null?P:"",vo(),Ll.value].join("\0"):i.indexKey});function pp(){h2.value+=1}function o3(P){return!(!P||!Number.isInteger(P.index)||P.index<0||P.index>=Xe.value.length||P.sessionKey!==vo()||P.threadKey!==ss()||P.layoutEpochKey!==Ll.value)}function b_(P){const te=String(P),ge=Bo.get(te);return ge?o3(ge)?ge.index:null:k_(te)}function w_(P="async-node"){(Uo.size||Bo.size)&&(Uo.clear(),Bo.clear(),pp(),io(P))}const mp=on(VC,null),s3={reportHeight(P,te){if(!Vn.value)return;const ge=b_(P);if(ge==null)return;const ke=hi.get(ge);if(!ke)return;const Ne=Number(te),Ue=Ot(ge,ke);(function(et,it,Ct={}){Oe(()=>lt(et,it,Ct))})(ge,Number.isFinite(Ne)&&Ne>0?Math.max(Ne,Ue||0):Ue)},markPending(P){if(!Vn.value)return;const te=k_(P);te!=null&&(function(ge,ke){var Ne;const Ue=Bo.get(ge);if(Ue&&o3(Ue))return Uo.set(ge,Math.max(0,(Ne=Uo.get(ge))!=null?Ne:0)+1),pp(),void io("async-node");Uo.set(ge,1),Bo.set(ge,(function(et){return{index:et,sessionKey:vo(),threadKey:ss(),layoutEpochKey:Ll.value}})(ke)),pp(),io("async-node")})(String(P),te)},markSettled(P){if(!Vn.value)return;const te=String(P),ge=b_(P);(ge!=null||(function(ke){return Uo.has(String(ke))})(te))&&(function(ke){var Ne;const Ue=(Ne=Uo.get(ke))!=null?Ne:0;return!(Ue<=0||(Ue<=1?(Uo.delete(ke),Bo.delete(ke)):Uo.set(ke,Ue-1),pp(),Ue===1&&io("async-node"),0))})(te)&&ge!=null&&Xu()}};function XG(){let P=0;for(const te of hi.values())P+=Wt("getVisibleDomHeight.offsetHeight",()=>{var ge;return(ge=te?.offsetHeight)!=null?ge:0});return Math.ceil(Math.max(0,P))}Yn(VC,{reportHeight(P,te){s3.reportHeight(P,te),mp?.reportHeight(P,te)},markPending(P){s3.markPending(P),mp?.markPending(P)},markSettled(P){s3.markSettled(P),mp?.markSettled(P)}});let r3,l3=null,gp=null;function g2(P){return P!==!1&&P!=null&&P!==""}function C_(){return xn.value?(function(){if(!xn.value)return!0;const P=Xe.value.length,te=Zs(Zt.start,0,P),ge=Zs(Zt.end,te,P);if(te>=ge)return!0;for(let ke=te;ke=Sf.value}function a3(){return mt.value===!0&&!yt.value&&au.value===0&&eo.size===0&&pi.size===0&&Er==null&&C_()}function A_(){var P,te;if(((P=i.virtualScroll)==null?void 0:P.settleMode)!=="manual"||l3===vo()&&r3===ss())return!0;const ge=(te=i.virtualScroll)==null?void 0:te.settledToken;return!!g2(ge)&&gp===Qm(ge)}function u3(){return a3()&&A_()}function eQ(P,te){return te.totalNodes<=0?P==="final"?"final":"estimate":te.measuredCount>=te.totalNodes?P==="final"?"final":"measured":te.measuredCount>0||te.estimatedCount>0?"mixed":"estimate"}function Mf(P="manual",te){const ge=y_(),ke=(function(Ne){return Ne||(mt.value!==!0?Xe.value.length>0?"streaming":"estimating":!C_()||pi.size>0||Er!=null?"measuring":u3()?"settled":"settling")})(te);return{sessionKey:vo(),threadKey:ss(),phase:ke,nodeCount:ge.totalNodes,liveRange:{start:Zt.start,end:Zt.end},renderedCount:Xi.value,measuredCount:ge.measuredCount,estimatedCount:ge.estimatedCount,averageNodeHeight:ge.averageNodeHeight,topSpacerHeight:ge.topSpacerHeight,bottomSpacerHeight:ge.bottomSpacerHeight,visibleDomHeight:XG(),totalHeight:x_(),width:ge.width,final:mt.value===!0,stable:u3(),confidence:eQ(ke,ge),reason:P}}function Om(){const P=Jl.value||ye(),te=R.value;if(!P||!te)return null;const ge=P.ownerDocument||te.ownerDocument||document,ke=P===ge.documentElement||P===ge.body||P===ge.scrollingElement,Ne=Wt("getScrollBox.scrollTop",()=>Le(P,ge,ke)),Ue=Wt("getScrollBox.scrollHeight",()=>{var it,Ct,ot,ft,bt;return ke?Math.max((Ct=(it=ge.documentElement)==null?void 0:it.scrollHeight)!=null?Ct:0,(ft=(ot=ge.body)==null?void 0:ot.scrollHeight)!=null?ft:0,(bt=P.scrollHeight)!=null?bt:0):P.scrollHeight}),et=Wt("getScrollBox.clientHeight",()=>{var it;return ke?((it=ge.documentElement)==null?void 0:it.clientHeight)||P.clientHeight||0:P.clientHeight});return{root:P,doc:ge,isViewportRoot:ke,scrollTop:Ne,scrollHeight:Ue,clientHeight:et}}function x_(){const P=Xe.value.length,te=Math.max(0,Us(0,P)),ge=Wt("getRendererLogicalHeight.offsetHeight",()=>{var Ne,Ue;return(Ue=(Ne=R.value)==null?void 0:Ne.offsetHeight)!=null?Ue:0}),ke=Math.max(0,ge>0?ge:Wt("getRendererLogicalHeight.scrollHeight",()=>{var Ne,Ue;return(Ue=(Ne=R.value)==null?void 0:Ne.scrollHeight)!=null?Ue:0}));return P<=0?Math.ceil(ge):xn.value?te>0?Math.max(1,Math.ceil(te),(function(){let Ne=e3.value+t3.value;for(const Ue of In.values())Ue&&(Ne+=Math.max(0,Wt("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ue.offsetHeight||0)));return Math.ceil(Math.max(0,Ne))})(),(function(Ne,Ue){return Ne<=0||Ue<=0?0:Ue<=Ne+Math.max(512,.05*Ne)?Math.ceil(Ue):0})(te,ke)):Math.max(1,Math.ceil(ke)):Vn.value?te>0||is.count>0||Ds.getEstimatedNodeHeightCount()>0?(cr.value&&Xi.value,Math.max(1,Math.ceil(ke),Math.ceil(te))):Math.ceil(ke):Math.max(1,Math.ceil(ke),Math.ceil(te))}function S_(P){const te=R.value;if(!te)return null;const ge=Wt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>te.getBoundingClientRect());return(function(Ne){return Ne.isViewportRoot?Ne.clientHeight:Wt("getViewportBottomInRoot.getBoundingClientRect",()=>Ne.root.getBoundingClientRect().bottom)})(P)-ge.bottom}function tQ(P={}){const te=P.requireViewport!==!1,ge=(function(Ue=64){const et=Om(),it=R.value;if(!et||!it)return!1;const Ct=(function(ft){if(ft.isViewportRoot)return{top:0,bottom:ft.clientHeight};const bt=Wt("getVirtualViewportRect.getBoundingClientRect",()=>ft.root.getBoundingClientRect());return{top:bt.top,bottom:bt.bottom}})(et),ot=Wt("isRendererNearVirtualViewport.getBoundingClientRect",()=>it.getBoundingClientRect());return ot.bottom>=Ct.top-Ue&&ot.top<=Ct.bottom+Ue})();if(te&&!ge)return null;const ke=(function(){const Ue=Om(),et=R.value;if(!Ue||!et||Math.max(0,Ue.scrollHeight-Ue.scrollTop-Ue.clientHeight)>64)return null;const it=S_(Ue);return it==null?null:it>=-8&&it<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,it)}:null})();if(ke)return{anchor:ke,captured:!0};const Ne=iu();if(Ne)return{anchor:{type:"node",nodeIndex:Ne.nodeIndex,offsetWithinNodePx:Ne.offsetWithinNodePx},captured:ge};if(P.allowFallback===!0){const Ue=(function(){const et=Xe.value.length;return et<=0?null:{type:"node",nodeIndex:Zs(en.value,0,Math.max(0,et-1)),offsetWithinNodePx:0}})();return Ue?{anchor:Ue,captured:!1}:null}return null}function c3(P){let te=2166136261;for(let ge=0;ge>>0).toString(36)}function nQ(P,te){let ge=P;for(let ke=0;ke8192?`${ke.slice(0,8192)}...${ke.length}`:ke;return`${ke.length}:${c3(Ne)}`})(P)}`;if(typeof P=="function")return"fn";if(typeof P!="object")return typeof P;if(te.has(P))return"cycle";if(ge>=6)return"max-depth";te.add(P);try{if(Array.isArray(P)){if(P.length<=160){const ot=[];for(let ft=0;ft=it&&et.push(ft)}return[`a:${P.length}`,`h=${Ue.join(",")}`,`t=${et.join(",")}`,`all=${(Ct>>>0).toString(36)}`].join(":")}const ke=P,Ne=Object.keys(ke).filter(Ue=>{const et=ke[Ue];return Ue!=="parent"&&Ue!=="el"&&Ue!=="component"&&(et==null||typeof et=="string"||typeof et=="number"||typeof et=="boolean"||iQ.has(Ue))}).sort();return`o:${Ne.length}:${Ne.map(Ue=>`${Ue}=${v2(ke[Ue],te,ge+1)}`).join(";")}`}finally{te.delete(P)}}let d3=-1,f3="",If=[2166136261];function Pm(P){const te=Xe.value[P];return te?c3(v2(te)):""}function oQ(P,te){let ge=P;for(let ke=0;ke>>0}function h3(){var P,te;const ge=K.value;if(d3===ge)return f3;const ke=Xe.value.length;let Ne=Y4(ke);(d3!==ge-1||Ne>ke||If.length>>0).toString(36),d3=ge,f3}function vp(P,te={}){var ge;const ke=te.includeHeightCache===!0,Ne=(ge=te.includeContentHash)!=null?ge:ke,Ue=ke?(function(it){const Ct=(function(){var xt,Kt;const Bt=Number((Kt=(xt=i.virtualScroll)==null?void 0:xt.heightCacheLimit)!=null?Kt:5e3);return!Number.isFinite(Bt)||Bt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Bt))})();if(!Number.isFinite(Ct)||it.length<=Ct)return it;const ot=new Map,ft=xt=>{!xt||ot.size>=Ct||ot.set(xt.index,xt)},bt=Xe.value.length,tt=Zs(Zt.start-2*ri.value,0,bt),ht=Zs(Zt.end+2*ri.value,tt,bt);for(const xt of it)xt.index>=tt&&xt.index=0&&ot.sizext.index-Kt.index).slice(0,Ct)})(Tr().map(it=>{var Ct;const ot=Xe.value[it.index];return ot?Fn($t({},it),{nodeType:String((Ct=ot.type)!=null?Ct:""),signature:Pm(it.index)}):null}).filter(it=>!!it)):[],et=tQ({allowFallback:te.allowAnchorFallback===!0,requireViewport:te.requireViewport});return et||Ue.length||te.includeEmptyState===!0?Fn($t({sessionKey:P.sessionKey,threadKey:P.threadKey},et?{anchor:et.anchor,anchorCaptured:et.captured}:{anchorCaptured:!1}),{metrics:P,width:P.width,contentHash:Ne?h3():void 0,measurementKey:Ju()||void 0,heightCache:Ue.length?Ue:void 0}):null}function p3(P){var te,ge;const ke=Om();if(!ke)return;const Ne=(function(it){const Ct=R.value;if(!Ct)return null;const ot=be(Ct,it.root),ft=Xe.value.length,bt=Wt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Ct.offsetHeight||0),tt=Math.max(0,bt>0?bt:ft>0?Wt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Ct.scrollHeight||0):0),ht=x_();return ot+Math.max(tt,ht)})(ke);if(Ne==null)return;const Ue=Math.max(0,P.distanceFromBottomPx),et=Math.max(0,Ne-ke.clientHeight-Ue);(function(it){nu=Wm()+120,Fs=it})(et),ke.isViewportRoot?(ge=(te=ke.doc.defaultView)==null?void 0:te.scrollTo)==null||ge.call(te,0,et):FN(ke.root,ke.doc,et,{isReverseFlexScrollRoot:Ae,getNormalizedScrollTop:Le})}const m3=[];function __(){if(U)for(ts!=null&&(Vi?.(ts),ts=null);m3.length;){const P=m3.pop();P!=null&&window.clearTimeout(P)}}function yp(P){const te=!!Ki.value;Ki.value=null,nu=0,Fs=null,__(),te&&P&&io(P)}function kp(){if(!Ki.value||!U||ts!=null)return;const P=()=>{ts=null;const te=Ki.value;te&&p3(te)};ts=Ji?Ji(P):null,ts==null&&P()}function M_(P,te={}){const ge=Xe.value.length;return ge<=0?[]:P.filter(ke=>!(!Number.isInteger(ke.index)||ke.index<0||ke.index>=ge)&&!(!Number.isFinite(ke.height)||ke.height<=0)&&!(te.requireSignature&&!ke.signature)&&!(te.requireCompatibilityMetadata&&!ke.nodeType&&!ke.signature)&&(function(Ne){var Ue;const et=Xe.value[Ne.index];return!(!et||Ne.nodeType&&Ne.nodeType!==String((Ue=et.type)!=null?Ue:"")||Ne.signature&&Ne.signature!==Pm(Ne.index))})(ke))}function I_(P){const te=mg(_f()),ge=mg(P);return te!==-1&&ge!==-1&&te===ge}function g3(P){var te;const ge=Number(P?.width);if(Number.isFinite(ge)&&ge>0)return ge;const ke=Number((te=P?.metrics)==null?void 0:te.width);return Number.isFinite(ke)&&ke>0?ke:null}function T_(P){var te;return P.sessionKey===vo()&&!!i3(P.threadKey)&&((te=P.measurementKey)!=null?te:"")===Ju()&&!!I_(g3(P))&&!!(function(ge){const ke=ge.heightCache;return!!ke?.length&&(E_(ge)?ke.some(Ne=>!!(Ne.nodeType||Ne.signature)):ke.some(Ne=>!!Ne.signature))})(P)}function E_(P){return!!(P.contentHash&&P.contentHash===h3())}function sQ(P){return!E_(P)}let Tf=null,Ef=null,y2=null,$m=null,zm=null;function v3(P){var te;const ge=P.map(Ne=>{var Ue,et;return[Ne.index,Math.round(10*Ne.height),(Ue=Ne.nodeType)!=null?Ue:"",(et=Ne.signature)!=null?et:""].join("")}).join(""),ke=mg(_f());return[(te=ss())!=null?te:"",vo(),Ju(),Xe.value.length,ke,P.length,c3(ge)].join(":")}function L_(P=(te=>(te=i.virtualScroll)==null?void 0:te.heightCache)()){if(!Vn.value||!P?.length||Xe.value.length<=0||!I_((te=i.virtualScroll)==null?void 0:te.heightCacheWidth))return!1;var te;const ge=M_(P,{requireSignature:!0});if(!ge.length)return!1;const ke=v3(ge);return ke===Tf?(Ef="standalone",!0):(ve(ge,{mode:"merge"}),zi(),Tf=ke,Ef="standalone",Um(),io("restore"),!0)}function y3(P,te={}){var ge,ke,Ne;if(!Vn.value||!P||P.sessionKey!==vo()||!i3(P.threadKey)||Xe.value.length<=0)return!1;const Ue=!!((ge=P.heightCache)!=null&&ge.length)&&!k2(),et=!P.anchor||P.anchorCaptured===!1&&te.allowUncapturedAnchor!==!0?null:P.anchor,it=te.restoreAnchor===!0&&!!et&&!k2()&&Number(g3(P))>0;let Ct=!1;if((ke=P.heightCache)!=null&&ke.length&&T_(P)){const ft=M_(P.heightCache,{requireCompatibilityMetadata:!P.contentHash,requireSignature:sQ(P)});ft.length&&(ve(ft,{mode:"merge"}),zi(),Tf=v3(ft),Ef="restore",Um(),Ct=!0)}if(Ue||it)return!1;if(!te.restoreAnchor||!et)return Ct&&io("restore"),!0;const ot=(function(ft,bt){var tt;const ht=ft.anchor,It=ht?ht.type==="bottom"?`bottom:${Math.round(ht.distanceFromBottomPx)}`:`node:${ht.nodeIndex}:${Math.round(ht.offsetWithinNodePx)}`:"none";return[(tt=ss())!=null?tt:"",vo(),Ju(),m2.value,bt,It].join(":")})(P,(Ne=te.restoreToken)!=null?Ne:"imperative");return y2===ot?(Ct&&io("restore"),!0):(y2=ot,(function(ft){const bt=()=>{if(ft.type==="node")return yp(),void Ea({nodeIndex:ft.nodeIndex,offsetWithinNodePx:ft.offsetWithinNodePx});if(Ir(),ns.value=null,Ki.value=ft,__(),p3(ft),U)for(const tt of[0,120,280,480])m3.push(window.setTimeout(()=>{const ht=Ki.value;ht&&p3(ht)},tt))};(function(tt){if(!xn.value)return!1;const ht=Xe.value.length;return!(ht<=0||(en.value=tt.type==="node"?Zs(tt.nodeIndex,0,ht-1):ht-1,Qn(),0))})(ft)?vt(bt):bt()})(et),io("restore"),!0)}function k2(){const P=_f();return Number.isFinite(P)&&P>0}function N_(P){var te;return P.sessionKey===vo()&&!!i3(P.threadKey)&&(Xe.value.length<=0||!(!((te=P.heightCache)!=null&&te.length)||k2())||!(!(P.anchor&&Number(g3(P))>0)||k2()))}function k3(){Li.clear();for(const P of Object.keys(Cs)){const te=Number(P);Number.isInteger(te)&&te>=0&&te{let te=!1,ge=null;const ke=()=>{te||(te=!0,ge!=null&&window.clearTimeout(ge),P())};if(Ji)return Ji(ke),void(ge=window.setTimeout(ke,50));ge=window.setTimeout(ke,0)})}function b3(P,te=ss(),ge=Ll.value){return vo()===P&&ss()===te&&Ll.value===ge}function w3(){return so(this,arguments,function*(P={}){var te,ge,ke,Ne,Ue;const et=vo(),it=ss(),Ct=Ll.value,ot=(te=P.frames)!=null?te:2,ft=(ge=P.timeoutMs)!=null?ge:120,bt=(ke=P.reason)!=null?ke:"manual",tt=P.expectedSettledTokenKey,ht=P.flushPendingTimers===!0,It=Mf(bt),xt=()=>Fn($t({},It),{phase:It.final?"settling":It.phase,stable:!1,confidence:It.confidence==="final"?"mixed":It.confidence,reason:bt}),Kt=()=>b3(et,it,Ct)&&(tt==null||qm()===tt);for(let wn=0;wnwindow.setTimeout(yn,wn))})(ft),!Kt()||(ht&&dt(),Xu(),jm(),!Kt()))return xt();const Bt=a3();Bt&&(l3=et,r3=it,((Ne=i.virtualScroll)==null?void 0:Ne.settleMode)==="manual"&&tt!=null&&g2((Ue=i.virtualScroll)==null?void 0:Ue.settledToken)&&qm()===tt&&(gp=Qm(i.virtualScroll.settledToken)));const an=Kt()&&Bt&&A_(),fn=Mf(bt,an?"final":void 0);return _3(fn,!0),fn})}let C3="content",Lf=null,Nf=null,A3=0,Hm=null,bp=null,x3=null,S3=null;function Wm(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function F_(P){var te,ge;const ke=Hm;if(!ke)return!0;const Ne=(ge=(te=i.virtualScroll)==null?void 0:te.heightDiffThresholdPx)!=null?ge:1;return Math.abs(P.totalHeight-ke.totalHeight)>Ne||P.sessionKey!==ke.sessionKey||P.phase!==ke.phase||P.stable!==ke.stable||P.final!==ke.final||P.threadKey!==ke.threadKey||P.nodeCount!==ke.nodeCount||P.measuredCount!==ke.measuredCount||P.width!==ke.width}function qm(P=(te=>(te=i.virtualScroll)==null?void 0:te.settledToken)()){return Os(P)}function B_(P,te){var ge,ke;return[P,te.sessionKey,(ge=te.threadKey)!=null?ge:"",Ju(),h3(),Os((ke=i.virtualScroll)==null?void 0:ke.settledToken),Math.round(te.totalHeight),Math.round(te.width)].join("\0")}function Um(){x3=null,S3=null,bp=null}function rQ(P){const te=P.heightCache;return te?.length?v3(te):""}function Vm(P){var te,ge,ke;const Ne=P.metrics,Ue=P.anchor?(et=P.anchor).type==="bottom"?`bottom:${Math.round(et.distanceFromBottomPx)}`:`node:${et.nodeIndex}:${Math.round(et.offsetWithinNodePx)}`:"none";var et;return[P.sessionKey,(te=P.threadKey)!=null?te:"",(ge=P.measurementKey)!=null?ge:Ju(),(ke=P.contentHash)!=null?ke:"",rQ(P),Ue,P.anchorCaptured?1:0,Ne.liveRange.start,Ne.liveRange.end,Ne.renderedCount,Ne.nodeCount,Math.round(Ne.totalHeight),Math.round(Ne.width),Ne.phase,Ne.stable?1:0].join("\0")}function _3(P,te=!1){if(!Vn.value||(function(et=!1){return!et&&Ui.value&&!Ri.value})(te))return;const ge=te||F_(P),ke=(function(et,it=!1){return it||et.stable||et.phase==="final"?{state:vp(et,{includeHeightCache:!0})}:{state:vp(et)}})(P,te),Ne=ke.state,Ue=!!(Ne&&(ge||(function(et,it=!1){return!!it||Vm(et)!==bp})(Ne,te)));if(ge&&(F(P),Hm=P,A3=Wm()),Ne&&Ue&&(H(Ne),Ne.anchor&&$(Ne.anchor),bp=Vm(Ne)),P.stable){const et=B_("settled",P);if(et!==x3){x3=et;const it=vp(P,{includeHeightCache:!0});it&&(H(it),bp=Vm(it)),(function(Ct){o("render-settled",Ct)})(P)}}if(P.phase==="final"){const et=B_("final",P);if(et!==S3){S3=et;const it=vp(P,{includeHeightCache:!0});it&&(H(it),bp=Vm(it)),(function(Ct){o("render-final",Ct)})(P)}}}function M3(){Lf!=null&&(Vi?.(Lf),Lf=null),Nf!=null&&U&&(window.clearTimeout(Nf),Nf=null)}function R_(){Lf=null,Nf=null,(function(P){if(pi.size>0||Er!=null)return!0;switch(P){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(C3)&&(Xu(),jm()),_3(Mf(C3))}function io(P){var te,ge;if(!Vn.value||(C3=P,Lf!=null||Nf!=null))return;const ke=Math.max(0,(ge=(te=i.virtualScroll)==null?void 0:te.emitIntervalMs)!=null?ge:32),Ne=Math.max(0,ke-(Wm()-A3)),Ue=()=>{Nf=null,Lf=Ji?Ji(R_):null,Lf==null&&R_()};U&&Ne>0?Nf=window.setTimeout(Ue,Ne):Ue()}function O_(){Ml.value+=1}function b2(P){if(cr.value&&P>=Xi.value){const te=Xe.value[P],ge=qe.value===!0&&mt.value!==!0&&P>=Xe.value.length-2,ke=te?.type==="code_block"||te?.type==="image"||te?.type==="mermaid"||te?.type==="infographic";if(!ge||ke)return!1}return!Ce.value||P=xe.value&&(Q.value||(Q.value=!0,Yu()),!Pt.value||!Si))return wp(P),void(te&&Ks(P,!0));if(P{if(Lr.delete(Ue),!Ce.value||Wn.value.has(Ue))return;const Ct=In.get(Ue);if(!Ct)return;const ot=ye(Ct),ft=Ct.ownerDocument||document,bt=ft.defaultView||window,tt=!ot||ot===ft.documentElement||ot===ft.body,ht=!tt&&ot?Wt("nodeVisibilityFallback.root.getBoundingClientRect",()=>ot.getBoundingClientRect()):null,It=tt?0:ht.top,xt=tt?Wt("nodeVisibilityFallback.clientHeight",()=>{var Bt,an;return(an=(Bt=bt.innerHeight)!=null?Bt:ot?.clientHeight)!=null?an:0}):ht.bottom,Kt=Wt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Ct.getBoundingClientRect());Kt.bottom>=It-500&&Kt.top<=xt+500&&Ks(Ue,!0)},1800+et);Lr.set(Ue,it)})(P);let Ne=null;Ne=Ge(()=>ke.isVisible.value,Ue=>{if(Ue){Vs(P),Ks(P,!0),Ne?.(),Zi.delete(P),Sn.get(P)===ke&&Sn.delete(P);try{ke.destroy()}catch{}}},{immediate:!0}),Zi.set(P,Ne),xn.value&&vn()}function I3(){Er=null,Oe(()=>{let P=!1;for(const[te,ge]of pi)pi.delete(te),hi.get(te)===ge.el&&Bs.get(te)===ge.version&&(P=lt(te,ge.height,{allowShrink:ge.allowShrink})||P);return P})}function Cp(){Er!=null&&(Vi?.(Er),Er=null),pi.clear()}function C2(P,te){(function(ge,ke,Ne){var Ue;if(!Number.isFinite(Ne)||Ne<=0||hi.get(ge)!==ke)return;const et=Bs.get(ge);if(et==null)return;const it=Xe.value[ge],Ct=yt.value&&mt.value!==!0&&!((Ue=i.nodes)!=null&&Ue.length)&&ge>=Xe.value.length-2,ot=!(it?.loading===!0||Ct),ft=pi.get(ge),bt=ft?ft.allowShrink&&ot:ot,tt=ft&&!bt?Math.max(ft.height,Ne):Ne;pi.set(ge,{height:tt,allowShrink:bt,version:et,el:ke}),Er==null&&(Er=Ji?Ji(I3):null,Er==null&&I3())})(P,te,Ot(P,te))}function Xu(){for(const[P,te]of hi)te&&C2(P,te)}function P_(){Ei?.disconnect(),Ei=null,Dn.clear()}function T3(){for(;na.length;)Ie(na.pop())}Ge(Ri,P=>{P&&io("content")},{flush:"post"}),t({getVirtualMetrics:Mf,captureVirtualState:function(P={}){var te;return vp(Mf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:P.allowFallbackAnchor===!0,requireViewport:P.requireViewport===!0,includeEmptyState:(te=P.includeEmptyState)==null||te})},restoreVirtualState:function(P,te={}){const ge=te.restoreAnchor===!0,ke=te.restoreToken==null?"imperative":String(te.restoreToken);$m=P,zm={restoreAnchor:ge,restoreToken:ke,allowUncapturedAnchor:te.allowUncapturedAnchor===!0},!y3(P,{restoreAnchor:ge,restoreToken:ke,allowUncapturedAnchor:te.allowUncapturedAnchor===!0})&&N_(P)||($m=null,zm=null)},forceMeasure:function(P="manual"){return so(this,null,function*(){yield vt(),yield D_(),Xu(),jm(),yield vt();const te=Mf(P);return _3(te,!0),te})},settle:w3,scrollToNode:function(P,te="start"){yp(),Ir();const ge=Xe.value.length;if(ge<=0)return;const ke=Zs(P,0,ge-1),Ne=()=>{var Ue;const et=ea({nodeIndex:ke,offsetWithinNodePx:0}),it=Il(ke),Ct=Om(),ot=(Ue=Ct?.clientHeight)!=null?Ue:0,ft=el();let bt=et;if(te==="center")bt=et-ot/2+it/2;else if(te==="end")bt=et-ot+it;else if(te==="nearest"&&ft!=null){if(et>=ft&&et+it<=ft+ot)return;bt=etWs.value,P=>{if(!P){P_();for(const te of qo.values())for(const ge of te)Ie(ge);qo.clear(),Bs.clear(),T3(),Cp()}},{immediate:!0}),Ge(mt,P=>{P&&(function(){if(U&&mt.value&&hi.size){T3();for(const te of[80,240,640]){const ge=fp(te,()=>{for(const[ke,Ne]of hi)Ne&&C2(ke,Ne)},"final");ge!=null&&na.push(ge)}}})(),io(P?"final":"content")});const lQ=BN(()=>io("content"),16),aQ=BN(()=>io("batch"),16);Ge([()=>Xe.value.length,()=>Xi.value],()=>{Ki.value&&kp(),lQ()},{flush:"post",immediate:!0}),Ge([()=>Zt.start,()=>Zt.end],()=>{aQ()},{flush:"post"});const{cleanupBatchScheduler:uQ}=(function(P){const{props:te,isClient:ge,isTestEnv:ke,parsedNodesIdentity:Ne,parsedNodeCount:Ue,desiredRenderedCount:et,datasetKey:it,batchingEnabled:Ct,incrementalRenderingActive:ot,resolvedBatchSize:ft,resolvedInitialBatch:bt,renderedCount:tt,adaptiveBatchSize:ht,previousRenderContext:It,previousBatchConfig:xt,requestFrame:Kt,cancelFrame:Bt,hasIdleCallback:an,cleanupNodeVisibility:fn,onDatasetKeyChanged:wn,onDatasetChanged:yn}=P;let Cn=null,$n="raf",qn=null,ji=0,Gs=!1,Rs=!1;const La=new Set,uu=new Set;function tg(){if(ge){Cn!=null&&($n==="raf"&&Bt?Bt(Cn):$n==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Cn):$n==="timeout"&&window.clearTimeout(Cn),Cn=null),ji+=1;for(const fr of La)Bt&&Bt(fr);for(const fr of uu)window.clearTimeout(fr);La.clear(),uu.clear(),qn=null,Gs=!1,Rs=!1}}function L2(){return typeof performance<"u"?performance.now():Date.now()}function nM(fr){(function(ec){var Uc;if(!ot.value)return;const tc=Math.max(2,(Uc=te.renderBatchBudgetMs)!=null?Uc:6),nc=Math.max(1,ft.value||1),Na=Math.max(1,Math.floor(nc/4));ec>1.5*tc?ht.value=Math.max(Na,Math.floor(.8*ht.value)):ec<.6*tc&&ht.value=tc)return;const nc=Math.max(1,fr),Na=()=>{const Sp=L2();Cn=null;const ng=qn??nc;qn=null;const _p=L2();tt.value=Math.min(tc,tt.value+ng),fn(tt.value),(function(R3,N2){if(!ge)return void nM(N2);Gs=!0;const rM=++ji;vt().then(()=>{var lM;if(rM!==ji)return;const EQ=L2(),LQ=Math.max(N2,EQ-R3),aM=()=>{rM===ji&&nM(LQ)};if(Kt){let Ff=null,Mp=null,cM=!1;const dM=()=>{cM||(cM=!0,Ff!==null&&(La.delete(Ff),Ff=null),Mp!==null&&(uu.delete(Mp),window.clearTimeout(Mp),Mp=null),aM())};return Ff=Kt(()=>{dM()}),La.add(Ff),Mp=window.setTimeout(()=>{Ff!==null&&Bt&&Bt(Ff),dM()},Math.max(32,(lM=te.renderBatchIdleTimeoutMs)!=null?lM:120)),void uu.add(Mp)}const uM=window.setTimeout(()=>{uu.delete(uM),aM()},0);uu.add(uM)})})(Sp,L2()-_p)};if(!ge||nl.immediate)return void Na();const Vc=Math.max(0,(ec=te.renderBatchDelay)!=null?ec:16);if(qn=qn!=null?Math.max(qn,nc):nc,Cn==null){if(!ke&&an&&window.requestIdleCallback){const Sp=Math.max(0,(Uc=te.renderBatchIdleTimeoutMs)!=null?Uc:120);return $n="idle",void(Cn=window.requestIdleCallback(()=>Na(),{timeout:Sp}))}if(Kt&&!ke)return $n="raf",void(Cn=Kt(()=>{Vc===0?Na():($n="timeout",Cn=window.setTimeout(()=>Na(),Vc))}));$n="timeout",Cn=window.setTimeout(()=>Na(),Vc)}}function oM(fr,nl={}){Gs?Rs=!0:fr==null?sM():iM(fr,nl)}function sM(){ot.value&&iM(Ct.value?Math.max(1,Math.round(ht.value)):Math.max(1,ft.value))}return Ge([Ne,Ue,it,ot,ft,bt,()=>te.renderBatchDelay],()=>{var fr;const nl=Ue.value,ec=It.value,Uc=it.value,tc=!Object.is(Uc,ec.key),nc=nl!==ec.total,Na=tc||nc;It.value={key:Uc,total:nl};const Vc=xt.value,Sp=(fr=te.renderBatchDelay)!=null?fr:16,ng=Vc.batchSize!==ft.value||Vc.initial!==bt.value||Vc.delay!==Sp||Vc.enabled!==ot.value;xt.value={batchSize:ft.value,initial:bt.value,delay:Sp,enabled:ot.value},tc&&wn(nl),(Na||ng||!ot.value)&&tg(),(Na||ng)&&(ht.value=Math.max(1,ft.value||1)),Na&&yn();const _p=et.value;if(!nl)return tt.value=0,void fn(0);if(!ot.value)return tt.value=_p,void fn(tt.value);const R3=tc||ec.total===0;tt.value=R3||ng?Math.min(_p,bt.value):Math.min(tt.value,_p);const N2=Math.max(1,bt.value||ft.value||nl);tt.value<_p?oM(N2,{immediate:!ge}):fn(tt.value)},{immediate:!0}),Ge(et,(fr,nl)=>{ot.value&&(typeof nl=="number"&&fr<=nl||fr>tt.value&&oM())}),{cleanupBatchScheduler:tg}})({props:M,isClient:U,isTestEnv:no,parsedNodesIdentity:Rn,parsedNodeCount:Yo,desiredRenderedCount:Sf,datasetKey:JG,batchingEnabled:Ql,incrementalRenderingActive:cr,resolvedBatchSize:Do,resolvedInitialBatch:es,renderedCount:Xi,adaptiveBatchSize:$e,previousRenderContext:_l,previousBatchConfig:ee,requestFrame:Ji,cancelFrame:Vi,hasIdleCallback:mo,cleanupNodeVisibility:Qu,onDatasetKeyChanged:P=>{Cp(),Ze(),zi(),Um(),P>0&&Tl(P)},onDatasetChanged:()=>{xn.value&&vn({immediate:!0})}});Ge([Jt,xn,()=>R.value,()=>J()],([P,te])=>{if(!P)return c_(),void mn();KG(),te?vn({immediate:!0}):mn()},{flush:"post",immediate:!0}),Ge([()=>Xe.value.length,()=>xn.value],P=>so(null,[P],function*([te,ge]){ge&&te&&U&&(yield vt(),vn({immediate:!0}))}),{flush:"post"}),Ge(co,P=>{P&&(function(){var te;if(Bi.value&&Qr.value&&Hs.value&&((te=_r.value)!=null&&te[1]))return;const ge=Rt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ke=Rt({type:"list_item",children:[ge],raw:"- Probe paragraph text"}),Ne=Rt({type:"list",ordered:!1,items:[ke],raw:"- Probe paragraph text"});Bi.value=ge,Qr.value=ke,Hs.value=Ne;const Ue={1:null,2:null,3:null,4:null,5:null,6:null};for(let et=1;et<=6;et++)Ue[et]=Rt({type:"heading",level:et,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(et)} Probe heading`});_r.value=Ue})()},{immediate:!0}),Ge([()=>R.value,co],()=>{if(!co.value)return X4(),void(ne.value=0);f_(),X4(),co.value&&R.value&&typeof ResizeObserver<"u"&&(Rm=new ResizeObserver(()=>{f_(),ns.value&&Ta(),Ki.value&&kp(),io("resize")}),Rm.observe(R.value))},{immediate:!0}),Ge([co,ei,Ll],()=>so(null,null,function*(){if(!co.value)return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void zi();yield vt(),(function(){if(!co.value||typeof window>"u")return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void zi();const P={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},te=d_(J4(O.value),".paragraph-node");P.paragraph=s5(O.value,te,"pre-wrap");const ge=J4(z.value),ke=ge?.querySelector(".paragraph-node");P.listItem=s5(z.value,ke,"pre-wrap");const Ne=Wt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var et,it;return(it=(et=W.value)==null?void 0:et.offsetHeight)!=null?it:0}),Ue=Wt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var et,it;return(it=(et=z.value)==null?void 0:et.offsetHeight)!=null?it:0});P.listWrapperOverhead=Math.max(0,Ne-Ue);for(let et=1;et<=6;et++){const it=d_(J4(j[et]),`h${et}`);P.headings[et]=s5(j[et],it,"pre-wrap")}le.value=P,zi()})()}),{flush:"post",immediate:!0}),Ge(()=>Xe.value.length,()=>{xn.value&&vn({immediate:!0})}),Ge([co,ne],()=>{zi(),xn.value&&vn({immediate:!0}),ns.value&&Ta(),Ki.value&&kp(),io("resize")},{immediate:!1}),Ge(()=>Ce.value,P=>{if(P)for(const[te,ge]of In)w2(te,ge);else if(Yu(),xn.value)vn({immediate:!0});else for(const[te,ge]of In)ge&&Ks(te,!0)},{immediate:!1}),Ge([Pe,xe,()=>J()],()=>{var P;(P=Si.refresh)==null||P.call(Si);for(const[te,ge]of In)w2(te,ge)},{immediate:!1}),Ge([()=>M.viewportPriority,()=>Xe.value.length,xe],([P,te,ge])=>{if(P!==!1){if(Q.value&&(te<=200||te<=ge)){Q.value=!1;for(const[ke,Ne]of In)w2(ke,Ne)}}else Q.value=!1}),Ge(()=>Xi.value,()=>{xn.value&&vn({immediate:!0})}),Ge([en,ti,ri,()=>Xe.value.length,xn],()=>{Qn()},{immediate:!0});let Km=null,Zm=!1,Ap=null;function Gm(){Km=null,l3=null,r3=void 0,gp=null,Um()}function E3(){Cp(),Ze(),zi(),Li.clear();const P=Xe.value.length;P>0&&Tl(P),k3()}function L3(){M3(),dt(),Hm=null,Tf=null,Ef=null,y2=null,$m=null,zm=null,Zm=!1,Gm(),w_("restore"),Ir(),yp()}function Qm(P){var te;return[(te=ss())!=null?te:"",vo(),Ju(),m2.value,qm(P),Xe.value.length,Math.round(Us(0,Xe.value.length)),Math.round(_f()),is.count,Math.round(is.total)].join(":")}function $_(){return so(this,null,function*(){var P,te,ge,ke;const Ne=(P=i.virtualScroll)==null?void 0:P.settledToken,Ue=qm(Ne),et=vo(),it=ss(),Ct=Ll.value;if(Vn.value&&((te=i.virtualScroll)==null?void 0:te.settleMode)==="manual"&&g2(Ne))if(a3()){if(Qm(Ne)!==gp&&!Zm){Zm=!0;try{const ot=yield w3({reason:"manual",expectedSettledTokenKey:Ue}),ft=qm()===Ue;b3(et,it,Ct)&&ot.sessionKey===et&&ot.threadKey===it&&ft&&ot.stable&&ot.phase==="final"&&(gp=Qm((ge=i.virtualScroll)==null?void 0:ge.settledToken))}finally{Zm=!1,yield vt();const ot=(ke=i.virtualScroll)==null?void 0:ke.settledToken,ft=g2(ot)?Qm(ot):"";b3(et,it,Ct)&&ft&&gp!==ft&&$_()}}}else io("manual")})}Ge(Vn,(P,te)=>{if(P!==te){if(!P)return L3(),void M3();L3(),E3(),Ap=Ll.value,io("content")}},{flush:"post"}),Ge([Vn,Ll],([P,te])=>{P?Ap!=null?Ap!==te&&(Ap=te,(function(ge="resize"){Cp(),Ze(),zi(),Li.clear();const ke=Xe.value.length;ke>0&&Tl(ke),k3(),Tf=null,Ef=null,y2=null,Hm=null,Zm=!1,Gm(),L_(),vt(()=>{Xu(),ns.value&&Ta(),Ki.value&&kp(),io(ge)})})("resize")):Ap=te:Ap=null},{flush:"post",immediate:!0}),Ge([Vn,()=>vo(),()=>ss()],([P])=>{P&&(L3(),E3(),w_("content"),io("content"))}),Ge([Vn,()=>vo(),()=>ss(),Ll,()=>Xe.value.length],([P])=>{P&&(function(te="async-node"){let ge=!1;for(const[ke,Ne]of Array.from(Bo.entries()))o3(Ne)||(Bo.delete(ke),Uo.delete(ke),ge=!0);ge&&(pp(),io(te))})("async-node")},{flush:"post"}),Ge([Vn,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.sessionKey},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.measurementKey},()=>i.indexKey,()=>K.value],([P])=>{P&&(Um(),(function(te="content"){if(!Vn.value)return;const ge=[],ke=Xe.value.length,Ne=Y4(ke);for(const Ue of Array.from(Li.keys())){if(Ue>=ke){ge.push(Ue);continue}if(Ue=ke&&Li.delete(Ue);ge.length&&((function(Ue,et={}){const it=Array.from(Ue,Number);we(it);let Ct=0;if(Oe(()=>(Ct=lu(it,et),Ct>0)),Ct>0)(function(ot){for(const ft of ot)Li.delete(ft)})(it);else for(const ot of it)bs.delete(ot)})(ge,{notify:!1}),zi(),Gm(),ns.value&&Ta(),Ki.value&&kp(),io(te))})("content"))},{flush:"post",immediate:!0}),Ge([Vn,()=>Xe.value.length,()=>vo(),()=>ss()],([P,te,ge,ke],[Ne,Ue,et,it])=>{P&&Ne&&ge===et&&ke===it&&te!==Ue&&Gm()},{flush:"post"}),Ge([Vn,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.heightCache},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.heightCacheWidth},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.restoreState},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.measurementKey},()=>Xe.value.length,()=>vo(),ne],()=>{L_()},{flush:"post",immediate:!0}),Ge([Vn,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.restoreState},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.restoreAnchor},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.measurementKey},()=>Xe.value.length,()=>vo(),ne],P=>so(null,[P],function*([te,ge]){if(!te||!ge)return;yield vt();const ke=(function(){var Ne;const Ue=(Ne=i.virtualScroll)==null?void 0:Ne.restoreAnchor;return Ue==null||Ue===!1?null:Ue===!0?"true":String(Ue)})();y3(ge,{restoreAnchor:ke!=null,restoreToken:ke??void 0})}),{flush:"post",immediate:!0}),Ge([Vn,ne,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.restoreState},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.measurementKey}],([P])=>{var te;if(!P)return;const ge=(te=i.virtualScroll)==null?void 0:te.restoreState;ge&&Tf&&Ef==="restore"&&(T_(ge)||(E3(),Tf=null,Ef=null,io("resize")))},{flush:"post"}),Ge([Vn,()=>Xe.value.length,()=>vo(),ne],P=>so(null,[P],function*([te]){var ge;const ke=$m,Ne=zm;te&&ke&&(yield vt(),!y3(ke,{restoreAnchor:Ne?.restoreAnchor===!0,restoreToken:(ge=Ne?.restoreToken)!=null?ge:"imperative",allowUncapturedAnchor:Ne?.allowUncapturedAnchor===!0})&&N_(ke)||($m=null,zm=null))}),{flush:"post",immediate:!0}),Ge([Vn,mt,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.settleMode},()=>vo(),()=>ss(),Ll,au,cp,()=>Xi.value,Sf,()=>is.count,()=>is.total],([P,te,ge])=>{if(!P||te!==!0||ge==="manual"||!u3())return;const ke=(function(){var Ne;const Ue=Xe.value.length;return[(Ne=ss())!=null?Ne:"",vo(),Ju(),m2.value,Ue,Math.round(Us(0,Ue)),Math.round(_f()),is.count,Math.round(is.total)].join(":")})();Km!==ke&&(Km=ke,w3({reason:"final"}).then(Ne=>{Ne.stable||Km!==ke||(Km=null)}))},{flush:"post",immediate:!0}),Ge([Vn,mt,()=>{var P;return(P=i.virtualScroll)==null?void 0:P.settleMode},()=>{var P;return(P=i.virtualScroll)==null?void 0:P.settledToken},()=>vo(),()=>ss(),Ll,au,cp,()=>Xi.value,Sf,()=>Xe.value.length,()=>is.count,()=>is.total],()=>{$_()},{flush:"post",immediate:!0}),Ge([()=>Xe.value.length,xn,ti,ri,()=>Zt.start,()=>Zt.end],([P,te,ge,ke,Ne,Ue])=>{me.value&&Et("virtualization",{nodes:P,virtualization:te,maxLiveNodes:ge,buffer:ke,focusIndex:en.value,scroll:te?(()=>{const et=Jl.value||ye();return et?{reverse:Ae(et),scrollTop:Math.round(et.scrollTop),scrollTopAbs:Math.round(Math.abs(et.scrollTop)),scrollHeight:Math.round(et.scrollHeight),clientHeight:Math.round(et.clientHeight)}:null})():null,liveRange:{start:Ne,end:Ue},rendered:Xi.value})}),Ge([()=>M.customId],([P],te,ge)=>{if(!P||Ao)return;const ke=(function(Ne,Ue){return Ne?(As.controllers[Ne]=Ue,()=>{As.controllers[Ne]===Ue&&delete As.controllers[Ne]}):()=>{}})(P,{captureRestoreAnchor:iu,restoreAnchor:Ea,getAnchorDrift:Zu,getReport:QG});ge(()=>{ke()})},{immediate:!0}),Zn(()=>{(function(){if(Vn.value)try{Xu(),jm();const P=Mf("manual");F_(P)&&(F(P),Hm=P,A3=Wm());const te=vp(P,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});te&&(H(te),te.anchor&&$(te.anchor),bp=Vm(te))}catch{}})(),uQ(),Yu(),Ye(),P_();for(const P of qo.values())for(const te of P)Ie(te);qo.clear(),Bs.clear(),Li.clear(),T3(),Cp(),X4(),Ir(),yp(),M3(),c_(),mn()});const cQ=Pg("ViewportDeferredMermaidBlockNode",Tu({loader:()=>so(null,null,function*(){try{return(yield Qo(()=>import("./index11-DoW-86Pd.js"),__vite__mapDeps([7,5]))).default}catch(P){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',P),ll}}),loadingComponent:GN,delay:0}),GN),dQ=Pg("ViewportDeferredInfographicBlockNode",Tu({loader:()=>so(null,null,function*(){try{return(yield Qo(()=>import("./index10-BwA5ekY4.js"),[])).default}catch(P){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',P),ll}}),loadingComponent:ZN,delay:0}),ZN),fQ=Pg("ViewportDeferredD2BlockNode",Tu(()=>so(null,null,function*(){try{return(yield Qo(()=>import("./index8-CfcFydw0.js"),[])).default}catch(P){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',P),ll}})),ll),z_={text:jo,paragraph:Th,heading:v4,code_block:G8,list:D1,list_item:N1,blockquote:f9,table:C0,definition_list:h9,footnote:p9,footnote_reference:jl,footnote_anchor:b0,admonition:y9,vmr_container:g9,hardbreak:Fd,link:qr,image:Dd,thematic_break:m9,math_inline:Xa,math_block:AW,strong:Hr,emphasis:Ur,strikethrough:Wr,highlight:Wl,insert:vl,subscript:gl,superscript:ml,emoji:pl,checkbox:zl,checkbox_input:zl,inline_code:wr,html_inline:Hl,reference:jr,html_block:w0},hQ=D(()=>n3()),j_=D(()=>DN(M.codeBlockProps)),pQ=D(()=>DN(M.codeBlockProps,{omit:["langs"]})),H_=D(()=>$t($t({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,monacoOptions:M.codeBlockMonacoOptions,themes:M.themes,langs:m.value==="shiki"?M.langs:void 0,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof de.value=="boolean"?{showTooltips:de.value}:{}),pQ.value)),W_=D(()=>$t(Fn($t({},H_.value),{langs:M.langs}),j_.value));function q_(P){return typeof P=="boolean"?P:void 0}const mQ=D(()=>{const P=M.codeBlockProps||{},te={},ge=q_(P.showLineNumbers);ge!==void 0&&(te.showLineNumbers=ge);const ke=q_(P.diffInline);ke!==void 0&&(te.diffInline=ke);const Ne=(function(Ue){const et=Number(Ue);return Number.isFinite(et)&&et>0?et:void 0})(P.reservedHeightPx);return Ne!==void 0&&(te.reservedHeightPx=Ne),te}),gQ=D(()=>$t($t({stream:M.codeBlockStream,darkTheme:M.codeBlockDarkTheme,lightTheme:M.codeBlockLightTheme,themes:M.themes,langs:M.langs,minWidth:M.codeBlockMinWidth,maxWidth:M.codeBlockMaxWidth},typeof de.value=="boolean"?{showTooltips:de.value}:{}),j_.value)),vQ=D(()=>$t({},M.mermaidProps||{})),U_=D(()=>$t({},M.d2Props||{})),yQ=D(()=>$t({},M.infographicProps||{})),Ym=D(()=>({typewriter:f.value,fade:M.fade,customHtmlTags:st.value.customHtmlTags})),kQ=D(()=>$t($t({},Ym.value),typeof de.value=="boolean"?{showTooltip:de.value}:{})),bQ=D(()=>$t($t({},Ym.value),typeof de.value=="boolean"?{showTooltips:de.value}:{})),wQ=D(()=>$t($t({},Ym.value),typeof de.value=="boolean"?{showTooltips:de.value}:{})),CQ=D(()=>$t($t({},Ym.value),typeof de.value=="boolean"?{showTooltips:de.value}:{}));function AQ(P){return Array.isArray(P.children)&&P.children.length>0}const A2=D(()=>GG.value.map(P=>{var te,ge,ke,Ne,Ue,et,it,Ct;let ot=(function(Bt){var an,fn,wn,yn,Cn,$n,qn;if(Bt.type!=="code_block")return Bt;const ji=Bt,Gs=[String((an=ji.language)!=null?an:""),String((fn=ji.loading)!=null?fn:""),String((wn=ji.diff)!=null?wn:""),String((yn=ji.code)!=null?yn:""),String((Cn=ji.originalCode)!=null?Cn:""),String(($n=ji.updatedCode)!=null?$n:""),String((qn=ji.raw)!=null?qn:"")].join("\0"),Rs=$i.get(ji);if(Rs&&Rs.signature===Gs)return Rs.node;const La=$t({},ji);return $i.set(ji,{signature:Gs,node:La}),La})(P.node);const ft=x2(ot);let bt=G_(ot,ft);if((ot.type==="html_block"||ot.type==="html_inline")&&bt===z_[ot.type]){const Bt=ot,an=String((te=Bt.tag)!=null?te:"").trim().toLowerCase()||Zj(Bt.content);if(an){const fn=bi.value[an];if(Co.value.has(an)&&fn)bt=fn,ot=Fn($t({},Bt),{type:an,tag:an,content:Rpe(Bt.content,an)});else if(Gj((ge=Bt.content)!=null?ge:Bt.raw,an)){const wn=String((Ne=(ke=Bt.content)!=null?ke:Bt.raw)!=null?Ne:"");ot.type==="html_inline"?(bt=jo,ot={type:"text",content:wn,raw:wn}):(bt=Th,ot={type:"paragraph",children:[{type:"text",content:wn,raw:wn}],raw:wn})}}}const tt=ot.type==="code_block"&&m.value==="pre"&&bt===ll&&!N3(bi.value,ft);let ht=$t({},(function(Bt,an,fn){const wn=an??x2(Bt);if(Bt.type==="code_block"){const yn=wn?N3(bi.value,wn):void 0;if(fn&&m.value==="pre"&&!yn&&fn===ll)return mQ.value;if(fn&&wn&&fn===yn)return wn==="mermaid"?K_(Bt):wn==="infographic"?Z_(Bt):wn==="d2"||wn==="d2lang"?U_.value:W_.value;if(fn&&fn===bi.value.code_block)return W_.value;if(p_(fn))return gQ.value}return wn==="mermaid"?K_(Bt):wn==="infographic"?Z_(Bt):wn==="d2"||wn==="d2lang"?U_.value:Bt.type==="link"?kQ.value:Bt.type==="list"?bQ.value:Bt.type==="blockquote"?wQ.value:Bt.type==="table"?CQ.value:Bt.type==="code_block"?H_.value:Ym.value})(ot,ft,bt));const It=co.value?hp.value[P.index]:null;ot.type==="code_block"&&It?.kind==="code-block"&&(ht=Fn($t({},ht),tt?{reservedHeightPx:(Ue=It.height)!=null?Ue:It.contentHeight}:{estimatedHeightPx:It.height,estimatedContentHeightPx:It.contentHeight,estimatedDiffInline:It.diffInline})),tt||ot.type!=="code_block"||ft!=="mermaid"||u1(ht.estimatedPreviewHeightPx)!=null||(ht=Fn($t({},ht),{estimatedPreviewHeightPx:Lk(Tk(String((et=ot.code)!=null?et:"")))})),tt||ot.type!=="code_block"||ft!=="infographic"||u1(ht.estimatedPreviewHeightPx)!=null||(ht=Fn($t({},ht),{estimatedPreviewHeightPx:Nk(Ek(String((it=ot.code)!=null?it:"")))})),ot.type==="math_block"&&(ht=Fn($t({},ht),{cacheScope:uo}));const xt=(function(Bt,an){const fn=String(Bt.type);return!Gv(fn)&&bi.value[fn]===an})(ot,bt),Kt=xt?J7(ot,fe.value):void 0;return Fn($t({},P),{node:ot,component:bt,bindings:ht,customBindings:$t($t({},Kt??{}),ht),rendersCustomNode:xt,hasSlotChildren:AQ(ot),slotContent:String((Ct=ot.content)!=null?Ct:""),isCodeBlock:ot.type==="code_block",indexKey:`${hQ.value}-${P.index}`,vnodeKey:`${YG.value}\0${P.index}\0${ot.type}`})}));function x2(P){var te;return P?.type==="code_block"?String((te=P.language)!=null?te:"").trim().toLowerCase():""}function N3(P,te){const ge=te.trim().toLowerCase();if(ge)for(const ke of[ge,p4(ge),sW(ge)]){const Ne=ke&&P[ke];if(Ne)return Ne}}function V_(P,te,ge,ke){var Ne,Ue;const et=$t({},P.value);return u1(et.estimatedPreviewHeightPx)==null&&(et.estimatedPreviewHeightPx=ke(ge(String((Ne=te?.code)!=null?Ne:"")),void 0,et.maxHeight==="none"?null:(Ue=u1(et.maxHeight))!=null?Ue:void 0)),et}function K_(P){return V_(vQ,P,Tk,Lk)}function Z_(P){return V_(yQ,P,Ek,Nk)}function G_(P,te){if(!P)return oA;const ge=bi.value,ke=ge[String(P.type)];if(P.type==="code_block"){const Ne=te??x2(P),Ue=Ne?N3(ge,Ne):void 0;return Ue||(m.value==="pre"?ge.code_block||ll:Ne==="mermaid"?ge.mermaid||cQ:Ne==="infographic"?ge.infographic||dQ:Ne==="d2"||Ne==="d2lang"?ge.d2||fQ:ke||ge.code_block||m_.value)}return ke||z_[String(P.type)]||oA}function D3(P){o("click",P)}function xQ(P){var te;(te=P.target)!=null&&te.closest("[data-node-index]")&&o("mouseover",P)}function SQ(P){var te;(te=P.target)!=null&&te.closest("[data-node-index]")&&o("mouseout",P)}function Q_(P){o("mouseover",P)}function Y_(P){o("mouseout",P)}const Df=q(null),tl=q(!1),Jm=q(null),_Q=D(()=>!(M.domMode!=="minimal"||G.value||M.fade!==!1||f.value||tl.value||ae.value||xn.value||Yr.value||to.value||wi.value||Object.keys(bi.value).length!==0));let Xm,xp=null,F3=0,S2=0,_2=0;const J_=["code_block","admonition","table","math_block","html_block","image","thematic_break"],MQ=new Set(J_),X_=[".typewriter-cursor",".height-estimation-probes",...J_.map(P=>`[data-node-type="${P}"]`),"script","style"].join(",");function eM(P){if(!P||typeof P!="object")return!1;const te=P.type;return typeof te=="string"&&MQ.has(te)}function M2(P){var te,ge;if(!P||typeof P!="object")return 0;const ke=P,Ne=(ge=(te=ke.raw)!=null?te:ke.content)!=null?ge:ke.code;if(typeof Ne=="string")return Ne.length;const Ue=ke.children;if(Array.isArray(Ue))return Ue.reduce((it,Ct)=>it+M2(Ct),0);const et=ke.items;return Array.isArray(et)?et.reduce((it,Ct)=>it+M2(Ct),0):0}function I2(){Xm&&(clearTimeout(Xm),Xm=void 0)}function B3(){F3+=1,xp!=null&&(Vi?.(xp),xp=null)}function eg(){B3(),qc(),Df.value&&(Df.value.style.visibility="hidden")}function IQ(P){var te;if(P.nodeType!==Node.TEXT_NODE||!((te=P.textContent)!=null?te:"").trim())return!1;const ge=P.parentElement;return!!ge&&!ge.closest(X_)}function TQ(P){let te=P.lastChild;for(;te;){if(IQ(te))return te;if(te.nodeType===Node.ELEMENT_NODE){const ge=te;if(!ge.matches(X_)&&ge.lastChild){te=ge.lastChild;continue}}for(;te&&te!==P&&!te.previousSibling;)te=te.parentNode;if(!te||te===P)break;te=te.previousSibling}return null}function tM(){const P=A2.value;for(let te=P.length-1;te>=0;te--){const ge=P[te];if(!ge||eM(ge.node)||!b2(ge.index))continue;const ke=In.get(ge.index);if(!ke)continue;const Ne=TQ(ke);if(Ne)return Ne}return null}function qc(){Jm.value&&(Jm.value.classList.remove(QN),Jm.value=null)}function T2(){if(d.value!=="simple"||!U||!tl.value||!R.value)return void qc();const P=tM(),te=P?(function(ge){var ke;const Ne=(ke=ge.parentElement)==null?void 0:ke.closest(".text-node");return Ne instanceof HTMLElement?Ne:ge.parentElement})(P):null;te!==Jm.value&&(qc(),te&&(te.classList.add(QN),Jm.value=te))}function E2(){if(d.value!=="precise"||!U||!tl.value||xp!=null)return;const P=F3,te=()=>{xp=null,P===F3&&(function(){var ge,ke;if(d.value!=="precise"||!(U&&tl.value&&R.value&&Df.value))return;const Ne=R.value,Ue=Df.value;Ue.style.visibility="hidden";const et=tM();if(!et)return;let it=0,Ct=0,ot=20,ft=!1;if(et?.textContent){const bt=et.textContent.length,tt=document.createRange();tt.setStart(et,Math.max(0,bt-1)),tt.setEnd(et,bt);const ht=typeof tt.getClientRects=="function"?tt.getClientRects():void 0,It=(ke=ht?.[ht.length-1])!=null?ke:(ge=et.parentElement)==null?void 0:ge.getBoundingClientRect();if(It){const xt=Wt("typewriterCursor.root.getBoundingClientRect",()=>Ne.getBoundingClientRect());it=It.right-xt.left+Ne.scrollLeft,Ct=It.top-xt.top+Ne.scrollTop,ot=It.height||ot,ft=!0}tt.detach()}ft&&(Ue.style.transform=`translate(${Math.max(0,it)}px, ${Math.max(0,Ct)}px)`,Ue.style.height=`${ot}px`,Ue.style.visibility="visible")})()};Ji?xp=Ji(te):te()}return Ge([Te,()=>i.content,()=>i.nodes,()=>M.typewriter,mt],()=>so(null,null,function*(){var P,te;if(!U||G.value||!Y.value)return;if(mt.value)return tl.value=!1,I2(),void eg();if((P=i.nodes)!=null&&P.length)return tl.value=!1,I2(),eg(),S2=((te=i.content)!=null?te:"").length,void(_2=Te.value.length);const ge=(function(){var it,Ct;return(it=i.nodes)!=null&&it.length?i.nodes.reduce((ot,ft)=>ot+M2(ft),0):((Ct=i.content)!=null?Ct:"").length})(),ke=(function(){var it;return(it=i.nodes)!=null&&it.length?i.nodes.reduce((Ct,ot)=>Ct+M2(ot),0):Te.value.length})(),Ne=!eM(Xe.value[Xe.value.length-1]),Ue=ge>S2,et=ke>_2;if(!f.value||!Ne||!Ue&&!et)return f.value&&Ne||(tl.value=!1,eg()),S2=ge,void(_2=ke);S2=ge,_2=ke,tl.value=!0,d.value==="precise"&&Df.value&&(Df.value.style.visibility="hidden"),I2(),yield vt(),d.value==="simple"?T2():(qc(),E2()),Xm=setTimeout(()=>{Xm=void 0,tl.value=!1},3e3)}),{flush:"post",immediate:!0}),Ge(tl,P=>so(null,null,function*(){P?(yield vt(),d.value!=="simple"?(qc(),d.value==="precise"&&E2()):T2()):eg()}),{flush:"post"}),Ge(d,()=>so(null,null,function*(){if(U&&!G.value&&Y.value&&tl.value){if(yield vt(),d.value==="simple")return B3(),void T2();qc(),d.value!=="precise"?eg():E2()}}),{flush:"post"}),Ge([()=>Xi.value,()=>Zt.start,()=>Zt.end],()=>so(null,null,function*(){U&&!G.value&&Y.value&&tl.value&&(yield vt(),d.value!=="simple"?(qc(),d.value==="precise"&&E2()):T2())}),{flush:"post"}),Zn(()=>{I2(),B3(),qc(),Nn.clear()}),(P,te)=>{const ge=rJ("NodeRenderer",!0);return p(G)?(k(!0),L(Re,{key:0},_t(A2.value,ke=>(k(),L(Re,{key:ke.vnodeKey},[ke.rendersCustomNode?(k(),he(Oo(ke.component),ni({key:0,ref_for:!0},ke.customBindings,{node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onClick:D3,onMouseover:Q_,onMouseout:Y_,onCopy:te[0]||(te[0]=Ne=>s(Ne)),onHandleArtifactClick:te[1]||(te[1]=Ne=>o("handleArtifactClick",Ne))}),{default:ce(()=>[ke.hasSlotChildren?(k(),he(ge,ni({key:0,ref_for:!0},St.value,{nodes:ke.node.children,"index-key":ke.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ke.slotContent?(k(),he(ge,ni({key:1,ref_for:!0},St.value,{content:ke.slotContent,final:!ke.node.loading,"index-key":`${ke.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),he(Oo(ke.component),ni({key:1,node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey},{ref_for:!0},ke.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onClick:D3,onMouseover:Q_,onMouseout:Y_,onCopy:te[2]||(te[2]=Ne=>s(Ne)),onHandleArtifactClick:te[3]||(te[3]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:R,class:He(["markstream-vue markdown-renderer",[{dark:M.isDark},{virtualized:xn.value},{"virtual-scroll-coordinated":Ri.value},{"stable-layout":kt.value},{"typewriter-simple-cursor":tl.value&&d.value==="simple"}]]),"data-custom-id":M.customId,onClick:D3,onMouseover:xQ,onMouseout:SQ},[Oi.value||xn.value?(k(),L(Re,{key:0},[Oi.value?(k(),he(Wke,{key:0,width:ei.value,"flow-root":xn.value||Ri.value,"paragraph-node":Bi.value,"list-item-node":Qr.value,"list-node":Hs.value,"heading-nodes":_r.value,"set-paragraph-wrapper":Je,"set-list-item-wrapper":At,"set-list-wrapper":sn,"set-heading-wrapper":ZG},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ie("",!0),xn.value?(k(),L("div",{key:1,class:"node-spacer",style:ln({height:`${e3.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),_Q.value?(k(!0),L(Re,{key:1},_t(A2.value,ke=>(k(),L(Re,{key:ke.vnodeKey},[b2(ke.index)?(k(),he(Oo(ke.component),ni({key:0,node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey},{ref_for:!0},ke.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onMouseover:te[4]||(te[4]=Ne=>o("mouseover",Ne)),onMouseout:te[5]||(te[5]=Ne=>o("mouseout",Ne)),onCopy:te[6]||(te[6]=Ne=>s(Ne)),onHandleArtifactClick:te[7]||(te[7]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ie("",!0)],64))),128)):(k(!0),L(Re,{key:2},_t(A2.value,ke=>(k(),L("div",{key:ke.vnodeKey,ref_for:!0,ref:Ne=>w2(ke.index,Ne),class:"node-slot","data-node-index":ke.index,"data-node-type":ke.node.type},[b2(ke.index)?(k(),L("div",{key:0,ref_for:!0,ref:Ne=>(function(Ue,et){var it;et||(function(bt){const tt=`${n3()}-${bt}`;let ht=!1;for(const It of Array.from(Uo.keys())){const xt=Bo.get(It);(xt?.index===bt||It===tt||It.startsWith(`${tt}-`))&&(Uo.delete(It),Bo.delete(It),ht=!0)}ht&&(pp(),io("async-node"))})(Ue),pi.delete(Ue),(function(bt){var tt;const ht=((tt=Bs.get(bt))!=null?tt:0)+1;Bs.set(bt,ht)})(Ue);const Ct=qo.get(Ue);if(Ct){for(const bt of Ct)Ie(bt);qo.delete(Ue)}if((function(bt){const tt=Dn.get(bt);tt&&(Ei?.unobserve(tt),Pi.delete(tt),Dn.delete(bt))})(Ue),!et||!Ws.value)return hi.delete(Ue),void Bs.delete(Ue);hi.set(Ue,et);const ot=()=>{C2(Ue,et)};queueMicrotask(ot);const ft=(Ei||typeof ResizeObserver>"u"||(Ei=new ResizeObserver(bt=>{if(bt.length)for(const tt of bt){const ht=Pi.get(tt.target),It=Dn.get(ht??-1);ht!=null&&It&&C2(ht,It)}else Xu()})),Ei);if(ft&&(Dn.set(Ue,et),Pi.set(et,Ue),ft.observe(et)),typeof window<"u"){const bt=((it=Xe.value[Ue])==null?void 0:it.type)==="code_block"?[16,80,240,800]:mt.value?[80]:[];if(bt.length){const tt=bt.map(ht=>fp(ht,ot,"node-resize")).filter(ht=>ht!=null);tt.length&&qo.set(Ue,tt)}}})(ke.index,Ne),class:"node-content"},[ke.isCodeBlock?ke.rendersCustomNode?(k(),he(Oo(ke.component),ni({key:1,ref_for:!0},ke.customBindings,{node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:te[12]||(te[12]=Ne=>s(Ne)),onHandleArtifactClick:te[13]||(te[13]=Ne=>o("handleArtifactClick",Ne))}),{default:ce(()=>[ke.hasSlotChildren?(k(),he(ge,ni({key:0,ref_for:!0},St.value,{nodes:ke.node.children,"index-key":ke.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ke.slotContent?(k(),he(ge,ni({key:1,ref_for:!0},St.value,{content:ke.slotContent,final:!ke.node.loading,"index-key":`${ke.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),he(Oo(ke.component),ni({key:2,node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey},{ref_for:!0},ke.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:te[14]||(te[14]=Ne=>s(Ne)),onHandleArtifactClick:te[15]||(te[15]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),he(fo,{key:0,name:"fade",css:M.fade!==!1,appear:M.fade!==!1},{default:ce(()=>[ke.rendersCustomNode?(k(),he(Oo(ke.component),ni({key:0,ref_for:!0},ke.customBindings,{node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey,"custom-id":M.customId,"is-dark":M.isDark,onCopy:te[8]||(te[8]=Ne=>s(Ne)),onHandleArtifactClick:te[9]||(te[9]=Ne=>o("handleArtifactClick",Ne))}),{default:ce(()=>[ke.hasSlotChildren?(k(),he(ge,ni({key:0,ref_for:!0},St.value,{nodes:ke.node.children,"index-key":ke.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ke.slotContent?(k(),he(ge,ni({key:1,ref_for:!0},St.value,{content:ke.slotContent,final:!ke.node.loading,"index-key":`${ke.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),he(Oo(ke.component),ni({key:1,node:ke.node,loading:ke.node.loading,"index-key":ke.indexKey},{ref_for:!0},ke.bindings,{"custom-id":M.customId,"is-dark":M.isDark,onCopy:te[10]||(te[10]=Ne=>s(Ne)),onHandleArtifactClick:te[11]||(te[11]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:ln({height:`${Il(ke.index)}px`})},null,4))],8,Vke))),128)),tl.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:Df,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),xn.value?(k(),L("div",{key:4,class:"node-spacer",style:ln({height:`${t3.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,Uke))}}})),[["__scopeId","data-v-a9489508"]]),yl=OW;yl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",yl.__name,yl.name].filter(n=>!!n));for(const n of t)e.component(n,OW)};const fx=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),Kke={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Zke={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Gke={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Qke={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Yke={class:"admonition-title"},Jke=["aria-expanded","aria-controls"],Xke=["id"],y9=Ti(ut({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=q(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:He(["admonition",[`admonition-${i.node.kind}`]])},[x("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",Kke,[...c[1]||(c[1]=[x("circle",{cx:"12",cy:"12",r:"10"},null,-1),x("path",{d:"M12 16v-4"},null,-1),x("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",Zke,[...c[2]||(c[2]=[x("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),x("path",{d:"M9 18h6"},null,-1),x("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",Gke,[...c[3]||(c[3]=[x("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),x("path",{d:"M12 9v4"},null,-1),x("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",Qke,[...c[4]||(c[4]=[x("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),x("path",{d:"M12 8v4"},null,-1),x("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),x("span",Yke,B(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:ln({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[x("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Jke)):ie("",!0)]),ii(x("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(yl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Xke),[[Ko,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);y9.install=e=>{e.component(y9.__name,y9)};const uA=()=>Qo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let py=null,my=uA,gy=null,YN=!1,JN=!1;function ebt(){return so(this,null,function*(){if(py)return py;const e=my;return e?e===uA&&YN?null:gy||(gy=so(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===uA)return e===my&&(YN=!0,(function(i){JN||(JN=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===my&&(gy=null)}return e!==my?null:t?(py=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),py):null}),gy):null})}let vy=null,PW=null,yy=null;function tbt(){return typeof PW=="function"}function nbt(){return so(this,null,function*(){if(vy)return vy;const e=PW;return e?yy||(yy=so(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(vy=n,vy):null}).finally(()=>{yy=null}),yy):null})}const ibt=Symbol("markstreamLanguageIconResolver");function ebe(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function tbe(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let XN=!1;function $W(){XN||typeof Worker>"u"||(XN=!0,N2e(new ebe),U2e(new tbe))}$W();function bd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function eD(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const hx={},jk=Symbol("resolveImage");class _u extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class ua extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class px extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function vi(e){return e instanceof _u||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function k4(e){return e instanceof ua||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function nbe(e){return k4(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function ibe(e){return e instanceof px||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const obe=41301,sbe=40922;function tD(e){return vi(e)&&e.code===sbe}const lc=3e4,ky=5*6e4,nD=5*6e4,zW="0123456789ABCDEFGHJKMNPQRSTVWXYZ",cA=500,jW=40101;function iD(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function by(e=lc){try{return AbortSignal.timeout(e)}catch{return}}function rbe(e,t){let n="",i=e;for(let o=0;ozW[n%32]).join("")}function gg(){return`${rbe(Date.now(),10)}${lbe(16)}`}function oD(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function r5(e){try{const t=await e.text();return t?t.length>cA?`${t.slice(0,cA)}...`:t:void 0}catch{return}}class sD{constructor(t){this.opts=t,this.tracer=t.tracer??hx}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=bd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;iD(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=gg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:by()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new ua({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:lc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new px({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new _u({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i?.allowCodes,i?.timeoutMs)}async postZip(t,n,i){const o="POST",s=bd(this.opts.origin,t,this.opts.restBasePath),r=gg(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:by(ky)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new ua({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:ky,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const v=h?.code??u.status,y=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:v,msg:y,envelopeRequestId:h?.request_id}),new _u({code:v,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new ua({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ky,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await r5(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new ua({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:ky,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=bd(this.opts.origin,t,this.opts.restBasePath),s=gg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:oD(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:by()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new ua({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:lc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new ua({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:lc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await r5(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new _u({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=bd(this.opts.origin,t,this.opts.restBasePath),s=gg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:oD(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=lc;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new ua({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:lc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new ua({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:lc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new ua({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:lc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,cA),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new _u({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s=[],r=lc){let l=bd(this.opts.origin,n,this.opts.restBasePath);if(o){const m=new URLSearchParams;iD(m,o);const g=m.toString();g&&(l=`${l}?${g}`)}const a=gg(),u={"X-Request-Id":a};this.addClientHeaders(u),i!==void 0&&(u["Content-Type"]="application/json; charset=utf-8");const c=Date.now();this.tracer.restRequest?.({method:t,path:n,url:l,requestId:a,body:i});let d;try{d=await fetch(l,{method:t,headers:u,body:i!==void 0?JSON.stringify(i):void 0,signal:by(r)})}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"fetch",durationMs:Date.now()-c,error:m}),new ua({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"fetch",timeoutMs:r,timestamp:Date.now(),durationMs:Date.now()-c})}let f;const h=d.clone();try{const m=await d.text();f=d.status===204&&m===""?{code:0,msg:"",data:null,request_id:a}:JSON.parse(m)}catch(m){throw this.tracer.restFailure?.({method:t,path:n,requestId:a,phase:"parse",durationMs:Date.now()-c,status:d.status,error:m}),new ua({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:l,requestId:a,phase:"parse",timeoutMs:r,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await r5(h),timestamp:Date.now(),durationMs:Date.now()-c})}if(this.tracer.restResponse?.({method:t,path:n,requestId:a,status:d.status,durationMs:Date.now()-c,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0&&!s.includes(f.code))throw new _u({code:typeof f.code=="number"?f.code:d.status,msg:typeof f.msg=="string"&&f.msg.length>0?f.msg:`HTTP ${d.status}${d.statusText?` ${d.statusText}`:""}`,requestId:f.request_id??a,details:f.details,timestamp:Date.now(),durationMs:Date.now()-c});return f.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===jW)&&this.opts.credentialStore?.markAuthRequired?.()}}function HW(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function rD(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function yu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:HW(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function wy(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:e.activity.model??"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function x0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function lD(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function mx(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:lD(e.source)};case"video":return{type:"video",source:lD(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function WW(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(mx),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function qW(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function abe(e){return{content:e.content.map(qW),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function ube(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function cbe(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function dbe(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function fbe(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(dbe),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function hbe(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(fbe),createdAt:e.created_at}}function pbe(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function mbe(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=pbe(i);return{answers:t,method:e.method,note:e.note}}function dA(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function aD(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function td(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Rp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function sa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function UW(e){if(!e||typeof e!="object")return null;const t=e,n=td(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:td(t,"goalId")??td(t,"goal_id")??"goal",objective:td(t,"objective")??"",completionCriterion:td(t,"completionCriterion")??td(t,"completion_criterion"),status:n,turnsUsed:Rp(t,"turnsUsed")??Rp(t,"turns_used")??0,tokensUsed:Rp(t,"tokensUsed")??Rp(t,"tokens_used")??0,wallClockMs:Rp(t,"wallClockMs")??Rp(t,"wall_clock_ms")??0,terminalReason:td(t,"terminalReason")??td(t,"terminal_reason"),budget:{tokenBudget:sa(o,"tokenBudget")??sa(o,"token_budget"),remainingTokens:sa(o,"remainingTokens")??sa(o,"remaining_tokens"),turnBudget:sa(o,"turnBudget")??sa(o,"turn_budget"),remainingTurns:sa(o,"remainingTurns")??sa(o,"remaining_turns"),wallClockBudgetMs:sa(o,"wallClockBudgetMs")??sa(o,"wall_clock_budget_ms"),remainingWallClockMs:sa(o,"remainingWallClockMs")??sa(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function gbe(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:yu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:yu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:x0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:x0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:HW(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=UW(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:WW(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(mx),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:cbe(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:hbe(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:dA(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:fA(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function vbe(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function Op(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function uD(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function fA(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function ybe(e){return e.session_id}function kbe(e){return e.seq}function bbe(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function cD(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const wbe={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function Cbe(e,t){switch(t.op){case"reset":return Abe(e,t);case"turn.upsert":return Sbe(e,t.turn);case"step.upsert":return Mbe(e,t.turnId,t.step);case"frame.upsert":return Tbe(e,t);case"append":return Lbe(e,t);case"marker.upsert":return fD(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return fD(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return Fbe(e,t.task);case"interaction.upsert":return Bbe(e,t.interaction);case"attachment.upsert":return Obe(e,t.attachment);case"todo.upsert":return $be(e,t.todo);case"prompt.upsert":return jbe(e,t.prompt);case"meta.merge":return qbe(e,t.meta);case"items.remove":return Dbe(e,t.ids)}}function Abe(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function dD(e,t){return{...e,kind:"turn",steps:[...t]}}function VW(e){return{kind:"turn",turnId:e,ordinal:bbe(e),state:"running",origin:{kind:"other"},steps:[]}}function xbe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function X1(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function gx(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function b4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function Sbe(e,t){const n=X1(e,t.turnId);return n?_be(n,t)?{state:e,changed:!1}:{state:{...e,items:b4(e.items,t.turnId,i=>dD(t,i.steps))},changed:!0}:{state:{...e,items:gx(e.items,dD(t,[]))},changed:!0}}function _be(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function Mbe(e,t,n){const i=X1(e,t)??VW(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&Ibe(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=X1(e,t)?b4(e.items,t,()=>l):gx(e.items,l);return{state:{...e,items:a},changed:!0}}function Ibe(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function Tbe(e,t){const n=X1(e,t.turnId)??VW(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??xbe(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&Ebe(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=X1(e,t.turnId)?b4(e.items,t.turnId,()=>a):gx(e.items,a);return{state:{...e,items:u},changed:!0}}function Ebe(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function Lbe(e,t){if(t.target.type==="task")return Nbe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=X1(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=KW(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:b4(e.items,n,()=>d)},changed:!0}}function Nbe(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=KW(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function KW(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function fD(e,t,n,i){if(e.items.some(s=>hA(s)===n)){let s=!1;const r=e.items.map(l=>hA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function hA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function Dbe(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(hA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function Fbe(e,t){const n=e.tasks.get(t.taskId);if(n&&Wbe(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function Bbe(e,t){const n=e.interactions.get(t.interactionId);if(n&&Rbe(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function Rbe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function Obe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&Pbe(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function Pbe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function $be(e,t){const n=e.todos.get(t.todoId);if(n&&zbe(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function zbe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function jbe(e,t){const n=e.prompts.get(t.promptId);if(n&&Hbe(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function Hbe(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function Wbe(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function qbe(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class Ube{constructor(t){this.agentId=t}#e=wbe;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=Cbe(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Nt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class F1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ZW extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const GW={};function Jd(e){return GW}function QW(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function pA(e,t){return typeof t=="bigint"?t.toString():t}function w4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vx(e){return e==null}function yx(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Vbe(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const hD=Symbol("evaluating");function Fi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==hD)return i===void 0&&(i=hD,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function rp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function pD(e){return JSON.stringify(e)}function Kbe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const YW="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function uv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Zbe=w4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function em(e){if(uv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(uv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function JW(e){return em(e)?{...e}:Array.isArray(e)?[...e]:e}const Gbe=new Set(["string","number","symbol"]);function tm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _n(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Qbe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ybe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Jbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=pf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return rp(this,"shape",r),r},checks:[]});return mf(e,s)}function Xbe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=pf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return rp(this,"shape",r),r},checks:[]});return mf(e,s)}function e4e(e,t){if(!em(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=pf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return rp(this,"shape",s),s}});return mf(e,o)}function t4e(e,t){if(!em(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=pf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return rp(this,"shape",i),i}});return mf(e,n)}function n4e(e,t){const n=pf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return rp(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return mf(e,n)}function i4e(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=pf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return rp(this,"shape",a),a},checks:[]});return mf(t,r)}function o4e(e,t,n){const i=pf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return rp(this,"shape",s),s}});return mf(t,i)}function d1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Cy(e){return typeof e=="string"?e:e?.message}function Xd(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Cy(e.inst?._zod.def?.error?.(e))??Cy(t?.error?.(e))??Cy(n.customError?.(e))??Cy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function kx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cv(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const XW=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,pA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eq=Nt("$ZodError",XW),tq=Nt("$ZodError",XW,{Parent:Error});function s4e(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function r4e(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new F1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Xd(a,s,Jd())));throw YW(l,o?.callee),l}return r.value},wx=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Xd(a,s,Jd())));throw YW(l,o?.callee),l}return r.value},C4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new F1;return s.issues.length?{success:!1,error:new(e??eq)(s.issues.map(r=>Xd(r,o,Jd())))}:{success:!0,data:s.value}},l4e=C4(tq),A4=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Xd(r,o,Jd())))}:{success:!0,data:s.value}},a4e=A4(tq),u4e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return bx(e)(t,n,o)},c4e=e=>(t,n,i)=>bx(e)(t,n,i),d4e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return wx(e)(t,n,o)},f4e=e=>async(t,n,i)=>wx(e)(t,n,i),h4e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return C4(e)(t,n,o)},p4e=e=>(t,n,i)=>C4(e)(t,n,i),m4e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return A4(e)(t,n,o)},g4e=e=>async(t,n,i)=>A4(e)(t,n,i),v4e=/^[cC][^\s-]{8,}$/,y4e=/^[0-9a-z]+$/,k4e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,b4e=/^[0-9a-vA-V]{20}$/,w4e=/^[A-Za-z0-9]{27}$/,C4e=/^[a-zA-Z0-9_-]{21}$/,A4e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,x4e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mD=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,S4e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_4e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function M4e(){return new RegExp(_4e,"u")}const I4e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E4e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,L4e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N4e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nq=/^[A-Za-z0-9_-]*$/,D4e=/^\+[1-9]\d{6,14}$/,iq="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",F4e=new RegExp(`^${iq}$`);function oq(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function B4e(e){return new RegExp(`^${oq(e)}$`)}function R4e(e){const t=oq({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${iq}T(?:${i})$`)}const O4e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},P4e=/^-?\d+$/,sq=/^-?\d+(?:\.\d+)?$/,$4e=/^(?:true|false)$/i,z4e=/^[^A-Z]*$/,j4e=/^[^a-z]*$/,xl=Nt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rq={number:"number",bigint:"bigint",object:"date"},lq=Nt("$ZodCheckLessThan",(e,t)=>{xl.init(e,t);const n=rq[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{xl.init(e,t);const n=rq[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),H4e=Nt("$ZodCheckMultipleOf",(e,t)=>{xl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Vbe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),W4e=Nt("$ZodCheckNumberFormat",(e,t)=>{xl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Ybe[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=P4e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),q4e=Nt("$ZodCheckMaxLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!vx(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=kx(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),U4e=Nt("$ZodCheckMinLength",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!vx(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=kx(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),V4e=Nt("$ZodCheckLengthEquals",(e,t)=>{var n;xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!vx(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=kx(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),x4=Nt("$ZodCheckStringFormat",(e,t)=>{var n,i;xl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),K4e=Nt("$ZodCheckRegex",(e,t)=>{x4.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Z4e=Nt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=z4e),x4.init(e,t)}),G4e=Nt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=j4e),x4.init(e,t)}),Q4e=Nt("$ZodCheckIncludes",(e,t)=>{xl.init(e,t);const n=tm(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Y4e=Nt("$ZodCheckStartsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`^${tm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),J4e=Nt("$ZodCheckEndsWith",(e,t)=>{xl.init(e,t);const n=new RegExp(`.*${tm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),X4e=Nt("$ZodCheckOverwrite",(e,t)=>{xl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class e3e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` -`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const t3e={major:4,minor:3,patch:6},To=Nt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=t3e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=d1(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new F1;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=d1(r,f)))});else{if(r.issues.length===f)continue;u||(u=d1(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(d1(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new F1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new F1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Fi(e,"~standard",()=>({validate:o=>{try{const s=l4e(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return a4e(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),Cx=Nt("$ZodString",(e,t)=>{To.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??O4e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),wo=Nt("$ZodStringFormat",(e,t)=>{x4.init(e,t),Cx.init(e,t)}),n3e=Nt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=x4e),wo.init(e,t)}),i3e=Nt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=mD(i))}else t.pattern??(t.pattern=mD());wo.init(e,t)}),o3e=Nt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=S4e),wo.init(e,t)}),s3e=Nt("$ZodURL",(e,t)=>{wo.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),r3e=Nt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=M4e()),wo.init(e,t)}),l3e=Nt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=C4e),wo.init(e,t)}),a3e=Nt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=v4e),wo.init(e,t)}),u3e=Nt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=y4e),wo.init(e,t)}),c3e=Nt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=k4e),wo.init(e,t)}),d3e=Nt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=b4e),wo.init(e,t)}),f3e=Nt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=w4e),wo.init(e,t)}),h3e=Nt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=R4e(t)),wo.init(e,t)}),p3e=Nt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=F4e),wo.init(e,t)}),m3e=Nt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=B4e(t)),wo.init(e,t)}),g3e=Nt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=A4e),wo.init(e,t)}),v3e=Nt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=I4e),wo.init(e,t),e._zod.bag.format="ipv4"}),y3e=Nt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=T4e),wo.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),k3e=Nt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=E4e),wo.init(e,t)}),b3e=Nt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=L4e),wo.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function uq(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const w3e=Nt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=N4e),wo.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{uq(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function C3e(e){if(!nq.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return uq(n)}const A3e=Nt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nq),wo.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{C3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),x3e=Nt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=D4e),wo.init(e,t)});function S3e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const _3e=Nt("$ZodJWT",(e,t)=>{wo.init(e,t),e._zod.check=n=>{S3e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),cq=Nt("$ZodNumber",(e,t)=>{To.init(e,t),e._zod.pattern=e._zod.bag.pattern??sq,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),M3e=Nt("$ZodNumberFormat",(e,t)=>{W4e.init(e,t),cq.init(e,t)}),I3e=Nt("$ZodBoolean",(e,t)=>{To.init(e,t),e._zod.pattern=$4e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),T3e=Nt("$ZodUnknown",(e,t)=>{To.init(e,t),e._zod.parse=n=>n}),E3e=Nt("$ZodNever",(e,t)=>{To.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function gD(e,t,n){e.issues.length&&t.issues.push(...f1(n,e.issues)),t.value[n]=e.value}const L3e=Nt("$ZodArray",(e,t)=>{To.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rgD(u,n,r))):gD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Hk(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...f1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function dq(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Qbe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fq(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>Hk(h,n,d,t,c))):Hk(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const N3e=Nt("$ZodObject",(e,t)=>{if(To.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=w4(()=>dq(t));Fi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=uv,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(v=>Hk(v,l,f,u,m))):Hk(g,l,f,u,m)}return s?fq(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),D3e=Nt("$ZodObjectJIT",(e,t)=>{N3e.init(e,t);const n=e._zod.parse,i=w4(()=>dq(t)),o=f=>{const h=new e3e(["shape","payload","ctx"]),m=i.value,g=w=>{const A=pD(w);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const w of m.keys)v[w]=`key_${y++}`;h.write("const newResult = {};");for(const w of m.keys){const A=v[w],I=pD(w),T=f[w]?._zod?.optout==="optional";h.write(`const ${A} = ${g(w)};`),T?h.write(` - if (${A}.issues.length) { - if (${I} in input) { - payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${I}, ...iss.path] : [${I}] - }))); - } - } - - if (${A}.value === undefined) { - if (${I} in input) { - newResult[${I}] = undefined; - } - } else { - newResult[${I}] = ${A}.value; - } - - `):h.write(` - if (${A}.issues.length) { - payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${I}, ...iss.path] : [${I}] - }))); - } - - if (${A}.value === undefined) { - if (${I} in input) { - newResult[${I}] = undefined; - } - } else { - newResult[${I}] = ${A}.value; - } - - `)}h.write("payload.value = newResult;"),h.write("return payload;");const C=h.compile();return(w,A)=>C(f,w,A)};let s;const r=uv,l=!GW.jitless,u=l&&Zbe.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?fq([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function vD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!d1(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>Xd(r,i,Jd())))}),t)}const hq=Nt("$ZodUnion",(e,t)=>{To.init(e,t),Fi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Fi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Fi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Fi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>yx(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>vD(a,o,e,s)):vD(l,o,e,s)}}),F3e=Nt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hq.init(e,t);const n=e._zod.parse;Fi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=w4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!uv(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),B3e=Nt("$ZodIntersection",(e,t)=>{To.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>yD(n,a,u)):yD(n,s,r)}});function mA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(em(e)&&em(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=mA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),d1(e))return e;const r=mA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const R3e=Nt("$ZodRecord",(e,t)=>{To.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!em(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...f1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...f1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&sq.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>Xd(d,i,Jd())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...f1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...f1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),O3e=Nt("$ZodEnum",(e,t)=>{To.init(e,t);const n=QW(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>Gbe.has(typeof o)).map(o=>typeof o=="string"?tm(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),P3e=Nt("$ZodLiteral",(e,t)=>{if(To.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?tm(i):i?tm(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),$3e=Nt("$ZodTransform",(e,t)=>{To.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new ZW(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new F1;return n.value=o,n}});function kD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const pq=Nt("$ZodOptional",(e,t)=>{To.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Fi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Fi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${yx(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>kD(s,n.value)):kD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),z3e=Nt("$ZodExactOptional",(e,t)=>{pq.init(e,t),Fi(e._zod,"values",()=>t.innerType._zod.values),Fi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),j3e=Nt("$ZodNullable",(e,t)=>{To.init(e,t),Fi(e._zod,"optin",()=>t.innerType._zod.optin),Fi(e._zod,"optout",()=>t.innerType._zod.optout),Fi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${yx(n.source)}|null)$`):void 0}),Fi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),H3e=Nt("$ZodDefault",(e,t)=>{To.init(e,t),e._zod.optin="optional",Fi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>bD(s,t)):bD(o,t)}});function bD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const W3e=Nt("$ZodPrefault",(e,t)=>{To.init(e,t),e._zod.optin="optional",Fi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),q3e=Nt("$ZodNonOptional",(e,t)=>{To.init(e,t),Fi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>wD(s,e)):wD(o,e)}});function wD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const U3e=Nt("$ZodCatch",(e,t)=>{To.init(e,t),Fi(e._zod,"optin",()=>t.innerType._zod.optin),Fi(e._zod,"optout",()=>t.innerType._zod.optout),Fi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Xd(r,i,Jd()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Xd(s,i,Jd()))},input:n.value}),n.issues=[]),n)}}),V3e=Nt("$ZodPipe",(e,t)=>{To.init(e,t),Fi(e._zod,"values",()=>t.in._zod.values),Fi(e._zod,"optin",()=>t.in._zod.optin),Fi(e._zod,"optout",()=>t.out._zod.optout),Fi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Ay(r,t.in,i)):Ay(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Ay(s,t.out,i)):Ay(o,t.out,i)}});function Ay(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const K3e=Nt("$ZodReadonly",(e,t)=>{To.init(e,t),Fi(e._zod,"propValues",()=>t.innerType._zod.propValues),Fi(e._zod,"values",()=>t.innerType._zod.values),Fi(e._zod,"optin",()=>t.innerType?._zod?.optin),Fi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(CD):CD(o)}});function CD(e){return e.value=Object.freeze(e.value),e}const Z3e=Nt("$ZodCustom",(e,t)=>{xl.init(e,t),To.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>AD(s,n,i,e));AD(o,n,i,e)}});function AD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(cv(o))}}var xD;class G3e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Q3e(){return new G3e}(xD=globalThis).__zod_globalRegistry??(xD.__zod_globalRegistry=Q3e());const $g=globalThis.__zod_globalRegistry;function Y3e(e,t){return new e({type:"string",..._n(t)})}function J3e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._n(t)})}function SD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._n(t)})}function X3e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._n(t)})}function e8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._n(t)})}function t8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._n(t)})}function n8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._n(t)})}function i8e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._n(t)})}function o8e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._n(t)})}function s8e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._n(t)})}function r8e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._n(t)})}function l8e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._n(t)})}function a8e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._n(t)})}function u8e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._n(t)})}function c8e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._n(t)})}function d8e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._n(t)})}function f8e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._n(t)})}function h8e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._n(t)})}function p8e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._n(t)})}function m8e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._n(t)})}function g8e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._n(t)})}function v8e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._n(t)})}function y8e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._n(t)})}function k8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._n(t)})}function b8e(e,t){return new e({type:"string",format:"date",check:"string_format",..._n(t)})}function w8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._n(t)})}function C8e(e,t){return new e({type:"string",format:"duration",check:"string_format",..._n(t)})}function A8e(e,t){return new e({type:"number",checks:[],..._n(t)})}function x8e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._n(t)})}function S8e(e,t){return new e({type:"boolean",..._n(t)})}function _8e(e){return new e({type:"unknown"})}function M8e(e,t){return new e({type:"never",..._n(t)})}function _D(e,t){return new lq({check:"less_than",..._n(t),value:e,inclusive:!1})}function l5(e,t){return new lq({check:"less_than",..._n(t),value:e,inclusive:!0})}function MD(e,t){return new aq({check:"greater_than",..._n(t),value:e,inclusive:!1})}function a5(e,t){return new aq({check:"greater_than",..._n(t),value:e,inclusive:!0})}function ID(e,t){return new H4e({check:"multiple_of",..._n(t),value:e})}function mq(e,t){return new q4e({check:"max_length",..._n(t),maximum:e})}function Wk(e,t){return new U4e({check:"min_length",..._n(t),minimum:e})}function gq(e,t){return new V4e({check:"length_equals",..._n(t),length:e})}function I8e(e,t){return new K4e({check:"string_format",format:"regex",..._n(t),pattern:e})}function T8e(e){return new Z4e({check:"string_format",format:"lowercase",..._n(e)})}function E8e(e){return new G4e({check:"string_format",format:"uppercase",..._n(e)})}function L8e(e,t){return new Q4e({check:"string_format",format:"includes",..._n(t),includes:e})}function N8e(e,t){return new Y4e({check:"string_format",format:"starts_with",..._n(t),prefix:e})}function D8e(e,t){return new J4e({check:"string_format",format:"ends_with",..._n(t),suffix:e})}function _m(e){return new X4e({check:"overwrite",tx:e})}function F8e(e){return _m(t=>t.normalize(e))}function B8e(){return _m(e=>e.trim())}function R8e(){return _m(e=>e.toLowerCase())}function O8e(){return _m(e=>e.toUpperCase())}function P8e(){return _m(e=>Kbe(e))}function $8e(e,t,n){return new e({type:"array",element:t,..._n(n)})}function z8e(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._n(n)})}function j8e(e){const t=H8e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(cv(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(cv(o))}},e(n.value,n)));return t}function H8e(e,t){const n=new xl({check:"custom",..._n(t)});return n._zod.check=e,n}function vq(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??$g,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function vs(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),vs(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Dr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function yq(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function kq(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:qk(t,"input",e.processors),output:qk(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Dr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Dr(i.element,n);if(i.type==="set")return Dr(i.valueType,n);if(i.type==="lazy")return Dr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Dr(i.innerType,n);if(i.type==="intersection")return Dr(i.left,n)||Dr(i.right,n);if(i.type==="record"||i.type==="map")return Dr(i.keyType,n)||Dr(i.valueType,n);if(i.type==="pipe")return Dr(i.in,n)||Dr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Dr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Dr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Dr(o,n))return!0;return!!(i.rest&&Dr(i.rest,n))}return!1}const W8e=(e,t={})=>n=>{const i=vq({...n,processors:t});return vs(e,i),yq(i,e),kq(i,e)},qk=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=vq({...o??{},target:s,io:t,processors:n});return vs(e,r),yq(r,e),kq(r,e)},q8e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},U8e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=q8e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},V8e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},K8e=(e,t,n,i)=>{n.type="boolean"},Z8e=(e,t,n,i)=>{n.not={}},G8e=(e,t,n,i)=>{},Q8e=(e,t,n,i)=>{const o=e._zod.def,s=QW(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},Y8e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},J8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},X8e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},e5e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=vs(s.element,t,{...i,path:[...i.path,"items"]})},t5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=vs(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=vs(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},n5e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>vs(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},i5e=(e,t,n,i)=>{const o=e._zod.def,s=vs(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=vs(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},o5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=vs(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=vs(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=vs(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},s5e=(e,t,n,i)=>{const o=e._zod.def,s=vs(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},r5e=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},l5e=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},a5e=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},u5e=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},c5e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;vs(s,t,i);const r=t.seen.get(e);r.ref=s},d5e=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},bq=(e,t,n,i)=>{const o=e._zod.def;vs(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},f5e=Nt("ZodISODateTime",(e,t)=>{h3e.init(e,t),Lo.init(e,t)});function h5e(e){return k8e(f5e,e)}const p5e=Nt("ZodISODate",(e,t)=>{p3e.init(e,t),Lo.init(e,t)});function m5e(e){return b8e(p5e,e)}const g5e=Nt("ZodISOTime",(e,t)=>{m3e.init(e,t),Lo.init(e,t)});function v5e(e){return w8e(g5e,e)}const y5e=Nt("ZodISODuration",(e,t)=>{g3e.init(e,t),Lo.init(e,t)});function k5e(e){return C8e(y5e,e)}const b5e=(e,t)=>{eq.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>r4e(e,n)},flatten:{value:n=>s4e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,pA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,pA,2)}},isEmpty:{get(){return e.issues.length===0}}})},_a=Nt("ZodError",b5e,{Parent:Error}),w5e=bx(_a),C5e=wx(_a),A5e=C4(_a),x5e=A4(_a),S5e=u4e(_a),_5e=c4e(_a),M5e=d4e(_a),I5e=f4e(_a),T5e=h4e(_a),E5e=p4e(_a),L5e=m4e(_a),N5e=g4e(_a),Eo=Nt("ZodType",(e,t)=>(To.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qk(e,"input"),output:qk(e,"output")}}),e.toJSONSchema=W8e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(pf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>mf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>w5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>A5e(e,n,i),e.parseAsync=async(n,i)=>C5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>x5e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>S5e(e,n,i),e.decode=(n,i)=>_5e(e,n,i),e.encodeAsync=async(n,i)=>M5e(e,n,i),e.decodeAsync=async(n,i)=>I5e(e,n,i),e.safeEncode=(n,i)=>T5e(e,n,i),e.safeDecode=(n,i)=>E5e(e,n,i),e.safeEncodeAsync=async(n,i)=>L5e(e,n,i),e.safeDecodeAsync=async(n,i)=>N5e(e,n,i),e.refine=(n,i)=>e.check(_we(n,i)),e.superRefine=n=>e.check(Mwe(n)),e.overwrite=n=>e.check(_m(n)),e.optional=()=>LD(e),e.exactOptional=()=>hwe(e),e.nullable=()=>ND(e),e.nullish=()=>LD(ND(e)),e.nonoptional=n=>kwe(e,n),e.array=()=>ki(e),e.or=n=>owe([e,n]),e.and=n=>lwe(e,n),e.transform=n=>DD(e,dwe(n)),e.default=n=>gwe(e,n),e.prefault=n=>ywe(e,n),e.catch=n=>wwe(e,n),e.pipe=n=>DD(e,n),e.readonly=()=>xwe(e),e.describe=n=>{const i=e.clone();return $g.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return $g.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return $g.get(e);const i=e.clone();return $g.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),wq=Nt("_ZodString",(e,t)=>{Cx.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(i,o,s)=>U8e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(I8e(...i)),e.includes=(...i)=>e.check(L8e(...i)),e.startsWith=(...i)=>e.check(N8e(...i)),e.endsWith=(...i)=>e.check(D8e(...i)),e.min=(...i)=>e.check(Wk(...i)),e.max=(...i)=>e.check(mq(...i)),e.length=(...i)=>e.check(gq(...i)),e.nonempty=(...i)=>e.check(Wk(1,...i)),e.lowercase=i=>e.check(T8e(i)),e.uppercase=i=>e.check(E8e(i)),e.trim=()=>e.check(B8e()),e.normalize=(...i)=>e.check(F8e(...i)),e.toLowerCase=()=>e.check(R8e()),e.toUpperCase=()=>e.check(O8e()),e.slugify=()=>e.check(P8e())}),D5e=Nt("ZodString",(e,t)=>{Cx.init(e,t),wq.init(e,t),e.email=n=>e.check(J3e(F5e,n)),e.url=n=>e.check(i8e(B5e,n)),e.jwt=n=>e.check(y8e(Q5e,n)),e.emoji=n=>e.check(o8e(R5e,n)),e.guid=n=>e.check(SD(TD,n)),e.uuid=n=>e.check(X3e(xy,n)),e.uuidv4=n=>e.check(e8e(xy,n)),e.uuidv6=n=>e.check(t8e(xy,n)),e.uuidv7=n=>e.check(n8e(xy,n)),e.nanoid=n=>e.check(s8e(O5e,n)),e.guid=n=>e.check(SD(TD,n)),e.cuid=n=>e.check(r8e(P5e,n)),e.cuid2=n=>e.check(l8e($5e,n)),e.ulid=n=>e.check(a8e(z5e,n)),e.base64=n=>e.check(m8e(K5e,n)),e.base64url=n=>e.check(g8e(Z5e,n)),e.xid=n=>e.check(u8e(j5e,n)),e.ksuid=n=>e.check(c8e(H5e,n)),e.ipv4=n=>e.check(d8e(W5e,n)),e.ipv6=n=>e.check(f8e(q5e,n)),e.cidrv4=n=>e.check(h8e(U5e,n)),e.cidrv6=n=>e.check(p8e(V5e,n)),e.e164=n=>e.check(v8e(G5e,n)),e.datetime=n=>e.check(h5e(n)),e.date=n=>e.check(m5e(n)),e.time=n=>e.check(v5e(n)),e.duration=n=>e.check(k5e(n))});function qt(e){return Y3e(D5e,e)}const Lo=Nt("ZodStringFormat",(e,t)=>{wo.init(e,t),wq.init(e,t)}),F5e=Nt("ZodEmail",(e,t)=>{o3e.init(e,t),Lo.init(e,t)}),TD=Nt("ZodGUID",(e,t)=>{n3e.init(e,t),Lo.init(e,t)}),xy=Nt("ZodUUID",(e,t)=>{i3e.init(e,t),Lo.init(e,t)}),B5e=Nt("ZodURL",(e,t)=>{s3e.init(e,t),Lo.init(e,t)}),R5e=Nt("ZodEmoji",(e,t)=>{r3e.init(e,t),Lo.init(e,t)}),O5e=Nt("ZodNanoID",(e,t)=>{l3e.init(e,t),Lo.init(e,t)}),P5e=Nt("ZodCUID",(e,t)=>{a3e.init(e,t),Lo.init(e,t)}),$5e=Nt("ZodCUID2",(e,t)=>{u3e.init(e,t),Lo.init(e,t)}),z5e=Nt("ZodULID",(e,t)=>{c3e.init(e,t),Lo.init(e,t)}),j5e=Nt("ZodXID",(e,t)=>{d3e.init(e,t),Lo.init(e,t)}),H5e=Nt("ZodKSUID",(e,t)=>{f3e.init(e,t),Lo.init(e,t)}),W5e=Nt("ZodIPv4",(e,t)=>{v3e.init(e,t),Lo.init(e,t)}),q5e=Nt("ZodIPv6",(e,t)=>{y3e.init(e,t),Lo.init(e,t)}),U5e=Nt("ZodCIDRv4",(e,t)=>{k3e.init(e,t),Lo.init(e,t)}),V5e=Nt("ZodCIDRv6",(e,t)=>{b3e.init(e,t),Lo.init(e,t)}),K5e=Nt("ZodBase64",(e,t)=>{w3e.init(e,t),Lo.init(e,t)}),Z5e=Nt("ZodBase64URL",(e,t)=>{A3e.init(e,t),Lo.init(e,t)}),G5e=Nt("ZodE164",(e,t)=>{x3e.init(e,t),Lo.init(e,t)}),Q5e=Nt("ZodJWT",(e,t)=>{_3e.init(e,t),Lo.init(e,t)}),Cq=Nt("ZodNumber",(e,t)=>{cq.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(i,o,s)=>V8e(e,i,o),e.gt=(i,o)=>e.check(MD(i,o)),e.gte=(i,o)=>e.check(a5(i,o)),e.min=(i,o)=>e.check(a5(i,o)),e.lt=(i,o)=>e.check(_D(i,o)),e.lte=(i,o)=>e.check(l5(i,o)),e.max=(i,o)=>e.check(l5(i,o)),e.int=i=>e.check(ED(i)),e.safe=i=>e.check(ED(i)),e.positive=i=>e.check(MD(0,i)),e.nonnegative=i=>e.check(a5(0,i)),e.negative=i=>e.check(_D(0,i)),e.nonpositive=i=>e.check(l5(0,i)),e.multipleOf=(i,o)=>e.check(ID(i,o)),e.step=(i,o)=>e.check(ID(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function kn(e){return A8e(Cq,e)}const Y5e=Nt("ZodNumberFormat",(e,t)=>{M3e.init(e,t),Cq.init(e,t)});function ED(e){return x8e(Y5e,e)}const J5e=Nt("ZodBoolean",(e,t)=>{I3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>K8e(e,n,i)});function Qv(e){return S8e(J5e,e)}const X5e=Nt("ZodUnknown",(e,t)=>{T3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>G8e()});function _s(){return _8e(X5e)}const ewe=Nt("ZodNever",(e,t)=>{E3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Z8e(e,n,i)});function twe(e){return M8e(ewe,e)}const nwe=Nt("ZodArray",(e,t)=>{L3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>e5e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(Wk(n,i)),e.nonempty=n=>e.check(Wk(1,n)),e.max=(n,i)=>e.check(mq(n,i)),e.length=(n,i)=>e.check(gq(n,i)),e.unwrap=()=>e.element});function ki(e,t){return $8e(nwe,e,t)}const iwe=Nt("ZodObject",(e,t)=>{D3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>t5e(e,n,i,o),Fi(e,"shape",()=>t.shape),e.keyof=()=>bo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_s()}),e.loose=()=>e.clone({...e._zod.def,catchall:_s()}),e.strict=()=>e.clone({...e._zod.def,catchall:twe()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>e4e(e,n),e.safeExtend=n=>t4e(e,n),e.merge=n=>n4e(e,n),e.pick=n=>Jbe(e,n),e.omit=n=>Xbe(e,n),e.partial=(...n)=>i4e(xq,e,n[0]),e.required=(...n)=>o4e(Sq,e,n[0])});function tn(e,t){const n={type:"object",shape:e??{},..._n(t)};return new iwe(n)}const Aq=Nt("ZodUnion",(e,t)=>{hq.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>n5e(e,n,i,o),e.options=t.options});function owe(e,t){return new Aq({type:"union",options:e,..._n(t)})}const swe=Nt("ZodDiscriminatedUnion",(e,t)=>{Aq.init(e,t),F3e.init(e,t)});function gf(e,t,n){return new swe({type:"union",options:t,discriminator:e,..._n(n)})}const rwe=Nt("ZodIntersection",(e,t)=>{B3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i5e(e,n,i,o)});function lwe(e,t){return new rwe({type:"intersection",left:e,right:t})}const awe=Nt("ZodRecord",(e,t)=>{R3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o5e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function Ax(e,t,n){return new awe({type:"record",keyType:e,valueType:t,..._n(n)})}const gA=Nt("ZodEnum",(e,t)=>{O3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(i,o,s)=>Q8e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new gA({...t,checks:[],..._n(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new gA({...t,checks:[],..._n(o),entries:s})}});function bo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new gA({type:"enum",entries:n,..._n(t)})}const uwe=Nt("ZodLiteral",(e,t)=>{P3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>Y8e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zn(e,t){return new uwe({type:"literal",values:Array.isArray(e)?e:[e],..._n(t)})}const cwe=Nt("ZodTransform",(e,t)=>{$3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>X8e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new ZW(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(cv(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(cv(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function dwe(e){return new cwe({type:"transform",transform:e})}const xq=Nt("ZodOptional",(e,t)=>{pq.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>bq(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function LD(e){return new xq({type:"optional",innerType:e})}const fwe=Nt("ZodExactOptional",(e,t)=>{z3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>bq(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function hwe(e){return new fwe({type:"optional",innerType:e})}const pwe=Nt("ZodNullable",(e,t)=>{j3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ND(e){return new pwe({type:"nullable",innerType:e})}const mwe=Nt("ZodDefault",(e,t)=>{H3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gwe(e,t){return new mwe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():JW(t)}})}const vwe=Nt("ZodPrefault",(e,t)=>{W3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ywe(e,t){return new vwe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():JW(t)}})}const Sq=Nt("ZodNonOptional",(e,t)=>{q3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>r5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function kwe(e,t){return new Sq({type:"nonoptional",innerType:e,..._n(t)})}const bwe=Nt("ZodCatch",(e,t)=>{U3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wwe(e,t){return new bwe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Cwe=Nt("ZodPipe",(e,t)=>{V3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c5e(e,n,i,o),e.in=t.in,e.out=t.out});function DD(e,t){return new Cwe({type:"pipe",in:e,out:t})}const Awe=Nt("ZodReadonly",(e,t)=>{K3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function xwe(e){return new Awe({type:"readonly",innerType:e})}const Swe=Nt("ZodCustom",(e,t)=>{Z3e.init(e,t),Eo.init(e,t),e._zod.processJSONSchema=(n,i,o)=>J8e(e,n)});function _we(e,t={}){return z8e(Swe,e,t)}function Mwe(e){return j8e(e)}const Uh=qt().min(1),xx=qt().min(1),Yv=qt().min(1),Vh=qt().min(1),Gl=qt().min(1),Iwe=/^[A-Za-z0-9._-]{1,128}$/;function Twe(e){return Iwe.test(e)&&e!=="."&&e!==".."}const _q=gf("kind",[tn({kind:zn("user"),payload:_s().optional()}),tn({kind:zn("cron"),taskId:Vh.optional(),payload:_s().optional()}),tn({kind:zn("task"),taskId:Vh,payload:_s().optional()}),tn({kind:zn("hook"),payload:_s().optional()}),tn({kind:zn("compaction"),payload:_s().optional()}),tn({kind:zn("side"),payload:_s().optional()}),tn({kind:zn("other"),payload:_s().optional()})]),Ewe=tn({inputTokens:kn().optional(),outputTokens:kn().optional(),cachedTokens:kn().optional(),cost:kn().optional()}),S0=tn({inputOther:kn(),output:kn(),inputCacheRead:kn(),inputCacheCreation:kn()}),Lwe=tn({llmFirstTokenLatencyMs:kn().optional(),llmStreamDurationMs:kn().optional(),llmRequestBuildMs:kn().optional(),llmServerFirstTokenMs:kn().optional(),llmServerDecodeMs:kn().optional(),llmClientConsumeMs:kn().optional()}),Nwe=tn({failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:qt(),errorMessage:qt(),statusCode:kn().optional()}),Mq=bo(["queued","running","completed","failed","cancelled"]),Dwe=bo(["running","completed","interrupted","failed"]),Fwe=tn({kind:zn("text"),frameId:Yv,role:bo(["assistant","user"]),text:qt(),attachmentIds:ki(qt()).optional(),taskId:Vh.optional(),promptIds:ki(qt()).optional()}),Bwe=tn({kind:zn("thinking"),frameId:Yv,text:qt()}),Rwe=tn({agentId:Gl,role:bo(["child","member"]).optional()}),Owe=tn({kind:bo(["stdout","stderr","progress","status","custom"]),text:qt().optional(),percent:kn().optional(),customKind:qt().optional(),customData:_s().optional()}),Pwe=tn({kind:zn("tool"),frameId:Yv,toolCallId:qt(),name:qt(),view:qt().optional(),state:bo(["running","done","error"]),input:_s().optional(),output:_s().optional(),display:_s().optional(),error:qt().optional(),inputText:qt().optional(),progress:Owe.optional(),taskId:Vh.optional(),approvalId:qt().optional(),todoId:qt().optional(),agentRefs:ki(Rwe).optional()}),Sx=tn({interactionId:qt(),interactionKind:bo(["approval","question"]),toolCallId:qt().optional(),state:bo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:_s().optional(),response:_s().optional()}),$we=tn({kind:zn("notice"),frameId:Yv,level:bo(["error","warning","info"]),source:qt().optional(),message:qt(),detail:_s().optional()}),Iq=gf("kind",[Fwe,Bwe,Pwe,$we]),Tq=tn({kind:zn("step"),stepId:xx,turnId:Uh,ordinal:kn().int(),state:Dwe,frames:ki(Iq),startedAt:qt().optional(),endedAt:qt().optional(),usage:S0.optional(),finishReason:qt().optional(),timing:Lwe.optional(),retry:Nwe.optional(),endReason:qt().optional(),endMessage:qt().optional()}),Eq=tn({kind:zn("turn"),turnId:Uh,ordinal:kn().int(),state:Mq,origin:_q,prompt:qt().optional(),attachmentIds:ki(qt()).optional(),steps:ki(Tq),startedAt:qt().optional(),endedAt:qt().optional(),usage:Ewe.optional(),durationMs:kn().optional(),error:qt().optional()}),Lq=tn({kind:zn("marker"),markerId:qt(),marker:qt(),payload:_s().optional(),at:qt().optional()}),Nq=tn({kind:zn("taskref"),refId:qt(),taskId:Vh,at:qt().optional()}),Dq=gf("kind",[Eq,Lq,Nq]),_x=tn({taskId:Vh,kind:bo(["shell","subagent","tool","other"]),state:bo(["running","completed","failed","timed_out","killed","lost"]),detached:Qv(),description:qt().optional(),agentId:Gl.optional(),outputTail:qt(),startedAt:qt().optional(),endedAt:qt().optional(),resultSummary:qt().optional(),error:qt().optional(),stateReason:qt().optional(),usage:S0.optional(),model:qt().optional(),thinkingEffort:qt().optional()}),Fq=tn({objective:qt(),status:bo(["active","paused","blocked","complete"]),completionCriterion:qt().optional(),budgetUsed:kn().optional(),budgetLimit:kn().optional()}),zwe=tn({plan:tn({reviewPath:qt().optional(),version:kn().optional()}).optional(),swarm:tn({trigger:qt().optional()}).optional(),tower:tn({}).optional()}),jwe=tn({plan:tn({reviewPath:qt().optional(),version:kn().optional()}).nullable().optional(),swarm:tn({trigger:qt().optional()}).nullable().optional(),tower:tn({}).nullable().optional()}),Hwe=gf("kind",[tn({kind:zn("idle")}),tn({kind:zn("running"),turnId:kn(),step:kn(),stepId:qt(),since:kn()}),tn({kind:zn("streaming"),turnId:kn(),step:kn(),stepId:qt(),stream:bo(["assistant","thinking","tool_call"]),toolCallId:qt().optional(),toolName:qt().optional(),since:kn()}),tn({kind:zn("tool_call"),turnId:kn(),step:kn(),toolCallId:qt(),name:qt(),since:kn()}),tn({kind:zn("retrying"),turnId:kn(),step:kn(),stepId:qt(),failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:qt().optional(),statusCode:kn().optional(),since:kn()}),tn({kind:zn("awaiting_approval"),turnId:kn(),step:kn().optional(),approval:_s().optional(),since:kn()}),tn({kind:zn("interrupted"),turnId:kn(),step:kn().optional(),reason:bo(["aborted","max_steps","error"]),message:qt().optional(),at:kn()}),tn({kind:zn("ended"),turnId:kn(),reason:bo(["completed","cancelled","failed","blocked"]),durationMs:kn().optional(),at:kn()})]),Wwe=tn({byModel:Ax(qt(),S0).optional(),currentTurn:S0.optional(),total:S0.optional()}),qwe=tn({model:qt().optional(),thinkingEffort:qt().optional(),usage:Wwe.optional(),contextTokens:kn().optional(),maxContextTokens:kn().optional(),contextUsage:kn().optional(),permission:bo(["manual","yolo","auto"]).optional(),phase:Hwe.optional()}),Mx=tn({goal:Fq.optional(),modes:zwe.optional(),activity:bo(["idle","turn","disposing","unknown"]).optional(),agent:qwe.optional()}),Uwe=Mx.extend({goal:Fq.nullable().optional(),modes:jwe.optional()}),S4=tn({attachmentId:qt(),mediaType:qt(),name:qt().optional(),size:kn().optional(),source:gf("kind",[tn({kind:zn("url"),url:qt()}),tn({kind:zn("file"),fileId:qt()}),tn({kind:zn("session_media"),fileId:qt()})]).optional(),placeholder:qt().optional()}),Vwe=tn({title:qt(),status:bo(["pending","in_progress","done"])}),Ix=tn({todoId:qt(),items:ki(Vwe),updatedAt:qt().optional()}),Tx=tn({promptId:qt(),status:bo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:qt().optional(),content:_s().optional(),createdAt:qt(),finishedAt:qt().optional(),steeredAt:qt().optional()}),Bq=tn({items:ki(Dq),tasks:ki(_x),interactions:ki(Sx).default([]),attachments:ki(S4).default([]),todos:ki(Ix).default([]),prompts:ki(Tx).default([]),meta:Mx,hasMoreOlder:Qv().optional()}),Kwe=Eq.omit({steps:!0}),Zwe=Tq.omit({frames:!0}),Gwe=gf("type",[tn({type:zn("frame"),turnId:Uh,stepId:xx,frameId:Yv}),tn({type:zn("task"),taskId:Vh})]),Ex=gf("op",[tn({op:zn("reset"),agentId:Gl,snapshot:Bq}),tn({op:zn("turn.upsert"),turn:Kwe}),tn({op:zn("step.upsert"),turnId:Uh,step:Zwe}),tn({op:zn("frame.upsert"),turnId:Uh,stepId:xx,frame:Iq}),tn({op:zn("append"),target:Gwe,offset:kn().int().nonnegative(),text:qt()}),tn({op:zn("marker.upsert"),item:Lq,beforeTurn:kn().int().optional()}),tn({op:zn("taskref.upsert"),item:Nq,beforeTurn:kn().int().optional()}),tn({op:zn("task.upsert"),task:_x}),tn({op:zn("interaction.upsert"),interaction:Sx}),tn({op:zn("attachment.upsert"),attachment:S4}),tn({op:zn("todo.upsert"),todo:Ix}),tn({op:zn("prompt.upsert"),prompt:Tx}),tn({op:zn("meta.merge"),meta:Uwe}),tn({op:zn("items.remove"),ids:ki(qt())})]);tn({agentId:Gl,ops:ki(Ex)});const Qwe=bo(["off","turn","block","delta"]),nm=kn().int().nonnegative(),Ywe=Ax(qt(),Qwe);tn({session_id:qt().min(1),transcript:Ywe,transcript_since:Ax(qt(),nm).optional()});tn({agent_id:Gl,before_turn:qt().min(1).optional(),after_turn:qt().min(1).optional(),page_size:kn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),Twe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const Jwe=tn({agentId:Gl,type:bo(["main","sub","independent"]).optional(),parentAgentId:Gl.optional(),label:qt().optional(),createdAt:qt().optional(),disposedAt:qt().optional()}),Xwe=tn({agent_id:Gl,items:ki(Dq),has_more:Qv(),tasks:ki(_x),interactions:ki(Sx).default([]),attachments:ki(S4).default([]),todos:ki(Ix).default([]),prompts:ki(Tx).default([]),meta:Mx,agents:ki(Jwe),pending_interactions:ki(qt()),seq:nm.optional()});tn({agent_id:Gl,batches:ki(tn({seq:nm,ops:ki(Ex)})),latest_seq:nm,complete:Qv()});const eCe=tn({turn_id:Uh,ordinal:kn().int(),state:Mq,origin:_q,prompt:qt(),attachment_ids:ki(qt()).optional(),started_at:qt().optional()});tn({agents:ki(tn({agent_id:Gl,messages:ki(eCe),attachments:ki(S4).default([])}))});const tCe=tn({state:bo(["pending","approved","rejected","cancelled"]),selected_option:qt().optional(),feedback:qt().optional()}),nCe=tn({tool_call_id:qt(),turn_id:Uh,source:bo(["interaction","display","output"]),plan:qt(),path:qt().optional(),options:ki(tn({label:qt(),description:qt().optional()})).optional(),review:tCe.optional()});tn({agent_id:Gl,plans:ki(nCe)});const iCe=tn({agent_id:Gl,snapshot:Bq,has_more_older:Qv(),seq:nm.optional()}),oCe=tn({agent_id:Gl,ops:ki(Ex),seq:nm.optional()}),Rq=iCe.extend({type:zn("transcript.reset")}),Oq=oCe.extend({type:zn("transcript.ops")});gf("type",[Rq,Oq]);const FD=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),sCe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),rCe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),lCe=new Set(["assistant.delta","thinking.delta"]);function aCe(e,t){if(rCe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return lCe.has(i)?uCe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?sCe.has(i)?{route:"protocol"}:FD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:FD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function uCe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const cCe="kimi-code.bearer.",dCe=3e4;class BD{constructor(t){this.opts=t,this.tracer=t.tracer??hx}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${cCe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=Sy(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Sy(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(Sy(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,dCe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=Rq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=Oq.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=Sy(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=aCe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Sy(e,t){return`${e}\0${t}`}async function fCe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=Xwe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const u5=10485760,hCe=5e3,RD=40001;function pCe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function mCe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function c5(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function OD(e){return e==="auto_compact"||e==="manual_compact"}class gCe{constructor(t){this.opts=t,this.tracer=t.tracer??hx,this.http=new sD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new sD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(yu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return yu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return yu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return yu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return UW(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return yu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(WW),hasMore:o.has_more}}async getSessionTranscript(t,n){return fCe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&vi(d)&&d.code===RD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:pCe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,abe(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...mCe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:nD});return yu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:nD});return yu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(yu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,ube(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,mbe(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>dA(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return dA(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(c5)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return c5(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return c5(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(qW));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(aD)])):void 0;return{items:o.items.map(aD),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:search",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async suggestFiles(t,n){const i={workspace:t,query:n.query};n.limit!==void 0&&(i.limit=n.limit);const o=await this.http.post("/workspace/fs:suggest",i);return{items:o.items.map(s=>({path:s.path,name:s.name,kind:s.kind,score:s.score,matchPositions:s.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return bd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(x0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return x0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return x0(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(vbe)}async listProviders(){return(await this.http.get("/providers")).items.map(Op)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=Op(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return Op(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:Op(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(uD)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return uD(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:Op(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(Op),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return d5(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return d5(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return d5(t)}async getConfig(){const t=await this.http.get("/config");return fA(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return fA(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&vi(i)&&i.code===RD)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),hCe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return bd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return bd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:u5});if(n.size>u5)throw new px({size:n.size,limit:u5});const i=n.type,o=!vCe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await yCe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=eD(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new BD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=ybe(s),l=kbe(s),a=gbe(s);a.type==="historyCompacted"&&!OD(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!OD(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new BD({wsUrl:eD(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function d5(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function vCe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function yCe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const kCe="main",bCe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function f5(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function wCe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function PD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function gr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ys(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ra(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function CCe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=gr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=gr(t,"goalId")??gr(t,"goal_id")??"goal",r=gr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:gr(t,"completionCriterion")??gr(t,"completion_criterion"),status:o,turnsUsed:Ys(t,"turnsUsed")??Ys(t,"turns_used")??0,tokensUsed:Ys(t,"tokensUsed")??Ys(t,"tokens_used")??0,wallClockMs:Ys(t,"wallClockMs")??Ys(t,"wall_clock_ms")??0,terminalReason:gr(t,"terminalReason")??gr(t,"terminal_reason"),budget:{tokenBudget:ra(i,"tokenBudget")??ra(i,"token_budget"),remainingTokens:ra(i,"remainingTokens")??ra(i,"remaining_tokens"),turnBudget:ra(i,"turnBudget")??ra(i,"turn_budget"),remainingTurns:ra(i,"remainingTurns")??ra(i,"remaining_turns"),wallClockBudgetMs:ra(i,"wallClockBudgetMs")??ra(i,"wall_clock_budget_ms"),remainingWallClockMs:ra(i,"remainingWallClockMs")??ra(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function dd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function ACe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=gr(n,"name")??gr(n,"toolName")??"tool",o=M$(e,xCe(i)),s=SCe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=gr(i,"text");if(s)return h5(s);const r=gr(i,"message");if(r)return h5(r)}const o=gr(n,"message");if(o)return h5(o)}return null}function xCe(e){return e.replace(/_\d+$/,"")}const $D=2e3;function h5(e){return e.length>$D?`${e.slice(0,$D)}…`:e}function SCe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return X6(e,t,i)}function _Ce(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=gr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=dd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),v=[];return g&&v.push({type:"taskCreated",sessionId:n,task:g}),v.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),v}const l=ACe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=dd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function MCe(e){return Array.isArray(e)?e.map(t=>mx(t)):[]}function ICe(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const TCe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function ECe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=CCe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function LCe(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=PD(),n.set(f,h)),h}function s(f){n.set(f,PD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(v){return xu("[agentProjector] Error projecting event:",f,v instanceof Error?v.message:v),[]}}function d(f,h,m,g){if(TCe.has(f))return ECe(f,h,m);const v=o(m),y=h,C=[],w=y?.agentId;if(typeof w=="string"&&w!==kCe){const A=i.has(w);if(f==="prompt.submitted"){if(!A)return[];const I=y?.promptId,N=y?.userMessageId;if(!I||!N)return[];const T=MCe(y?.content);return T.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:N,sessionId:m,role:"user",content:T,createdAt:typeof y?.createdAt=="string"?y.createdAt:new Date().toISOString(),promptId:I}}]}if(A&&(f==="thinking.delta"||f==="assistant.delta")){const I=y?.delta??"";return I?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:I}}]:[]}if(A&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:y?.reason}];if(bCe.has(f))return _Ce(t,v,m,w,f,y??{},i)}switch(f){case"turn.started":{const A=y?.turnId,I=v.currentPromptId??f5("pr_");v.currentPromptId=I,A!==void 0&&v.turnPromptId.set(A,I),C.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const A=wCe(y?.usage);v.totalInput+=A.input,v.totalOutput+=A.output,v.totalCacheRead+=A.cacheRead,v.totalCacheCreate+=A.cacheCreate;break}case"agent.status.updated":{y?.model&&(v.model=y.model),y?.contextTokens!==void 0&&(v.contextTokens=y.contextTokens),y?.maxContextTokens!==void 0&&(v.contextLimit=y.maxContextTokens);const A=y?.phase;A!=null&&A.kind==="retrying"?(v.retryActive=!0,C.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Ys(A,"failedAttempt")??0,nextAttempt:Ys(A,"nextAttempt")??0,maxAttempts:Ys(A,"maxAttempts")??0,delayMs:Ys(A,"delayMs")??0,errorName:gr(A,"errorName"),statusCode:Ys(A,"statusCode"),turnId:Ys(A,"turnId")}})):v.retryActive&&A!==void 0&&A!==null&&typeof A.kind=="string"&&(v.retryActive=!1,C.push({type:"turnRetry",sessionId:m,retry:void 0})),C.push({type:"sessionUsageUpdated",sessionId:m,usage:ICe(v),model:v.model||void 0,swarmMode:y?.swarmMode===!0?!0:y?.swarmMode===!1?!1:void 0,planMode:y?.planMode===!0?!0:y?.planMode===!1?!1:void 0,thinking:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:void 0});break}case"turn.ended":{const A=y?.turnId,I=(A!==void 0?v.turnPromptId.get(A):void 0)??v.currentPromptId;C.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:y?.reason,promptId:I}),v.turnCount++,v.currentPromptId=void 0;break}case"prompt.completed":{const A=y?.promptId;typeof A=="string"&&A.length>0&&C.push({type:"promptCompleted",sessionId:m,promptId:A,reason:y?.reason??"completed"});break}case"prompt.aborted":{const A=y?.promptId;typeof A=="string"&&A.length>0&&C.push({type:"promptAborted",sessionId:m,promptId:A});break}case"turn.step.retrying":{v.retryActive=!0,C.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Ys(y??{},"failedAttempt")??0,nextAttempt:Ys(y??{},"nextAttempt")??0,maxAttempts:Ys(y??{},"maxAttempts")??0,delayMs:Ys(y??{},"delayMs")??0,errorName:gr(y??{},"errorName"),statusCode:Ys(y??{},"statusCode"),turnId:typeof y?.turnId=="number"?y.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const A=typeof y?.subagentId=="string"&&y.subagentId.length>0?y.subagentId:f5("task_"),I=typeof y?.taskId=="string"&&y.taskId.length>0?y.taskId:void 0,N=I!==void 0&&I!==A?v.subagentMeta.get(I):void 0,T=v.subagentMeta.get(A);N!==void 0&&v.subagentMeta.delete(I),I!==void 0&&!v.registrationOrderByKey.has(I)&&v.registrationOrderByKey.set(I,++v.registrationSeq);const b=T===void 0||N===void 0?T??N:{...T,createdAt:N.createdAt,startedAt:N.startedAt??T.startedAt,runInBackground:!0,backgroundTaskId:T.backgroundTaskId??I},_=b?.backgroundTaskId??(b!==void 0&&I!==void 0&&b.id===I?I:void 0),S=I!==void 0?v.registrationOrderByKey.get(I):void 0,E=_!==void 0?v.registrationOrderByKey.get(_):void 0,M=v.retiredBindings.has(I??"")||S!==void 0&&E!==void 0&&S0?y.model:b?.model,thinkingEffort:typeof y?.thinkingEffort=="string"&&y.thinkingEffort.length>0?y.thinkingEffort:b?.thinkingEffort,parentToolCallId:typeof y?.parentToolCallId=="string"?y.parentToolCallId:b?.parentToolCallId,swarmIndex:typeof y?.swarmIndex=="number"?y.swarmIndex:b?.swarmIndex,runInBackground:F?y?.runInBackground===!0||y?.runInBackground===void 0&&b?.runInBackground===!0:y?.runInBackground===!0||b?.runInBackground===!0,outputPreview:F?void 0:b?.outputPreview,outputBytes:F?void 0:b?.outputBytes,outputLines:F?void 0:b?.outputLines,suspendedReason:F?void 0:b?.suspendedReason,text:F?void 0:b?.text,backgroundTaskId:M?b?.backgroundTaskId:F?I:I??b?.backgroundTaskId};v.subagentMeta.set($.id,$),C.push({type:"taskCreated",sessionId:m,task:$});break}case"subagent.started":{const A=typeof y?.subagentId=="string"?y.subagentId:void 0,I=A!==void 0&&(v.subagentMeta.get(A)?.status!==void 0&&v.subagentMeta.get(A).status!=="running"||v.settledByKernel.has(A));I&&v.settledByKernel.delete(A);const N=dd(t,v,m,y?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...I?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});I&&A!==void 0&&v.restartedThisRun.add(A),N&&C.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const A=dd(t,v,m,y?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof y?.reason=="string"?y.reason:void 0});A&&C.push({type:"taskCreated",sessionId:m,task:A});break}case"subagent.completed":{const A=typeof y?.resultSummary=="string"?y.resultSummary:void 0,I=dd(t,v,m,y?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});I&&C.push({type:"taskCreated",sessionId:m,task:I}),I!==null&&v.restartedThisRun.delete(I.id),C.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"completed",outputPreview:A});break}case"subagent.failed":{const A=typeof y?.error=="string"?y.error:void 0,I=dd(t,v,m,y?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});I&&C.push({type:"taskCreated",sessionId:m,task:I}),I!==null&&v.restartedThisRun.delete(I.id),C.push({type:"taskCompleted",sessionId:m,taskId:y?.subagentId??"",status:"failed",outputPreview:A});break}case"error":{C.push({type:"unknown",raw:{_agentError:!0,code:y?.code,message:y?.message,name:y?.name,details:y?.details,retryable:y?.retryable}});break}case"warning":{C.push({type:"unknown",raw:{_agentWarning:!0,message:y?.message}});break}case"task.started":case"background.task.started":{const A=y?.info??{},I=typeof A.startedAt=="number"?new Date(A.startedAt).toISOString():void 0,N=typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):f5("task_"),T=typeof A.description=="string"?A.description:typeof A.command=="string"?A.command:t("tasks.defaultDescription");if(A.kind==="agent"){const _=typeof A.agentId=="string"&&A.agentId.length>0?A.agentId:void 0;if(_!==void 0){const S=v.subagentMeta.get(_),E=v.registrationOrderByKey.get(N),M=S?.backgroundTaskId!==void 0?v.registrationOrderByKey.get(S.backgroundTaskId):void 0;if(v.retiredBindings.has(N)||E!==void 0&&M!==void 0&&EM.backgroundTaskId===N);if(S===void 0&&(v.retiredBindings.has(N)||v.registrationOrderByKey.has(N)&&v.registrationOrderByKey.get(N)0&&v.settledByKernel.add(A.agentId),C.push({type:"taskCompleted",sessionId:m,taskId:typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):"",status:A.status==="killed"?"cancelled":I?"failed":"completed"});break}}return C}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function NCe(e){return new gCe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>LCe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const DCe={t:e=>e},zD="Sub Agent";function FCe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function BCe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function RCe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function _y(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const OCe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function vA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?OCe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function PCe(e,t,n,i=DCe){const o=BCe(e);switch(RCe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!_y(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),v=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),y=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,C=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:v?g.status:t.task.status,subagentPhase:v?g.subagentPhase:t.task.subagentPhase,completedAt:v?g.completedAt:C?h.completedAt:t.task.completedAt,completedAtEstimated:v?g.completedAtEstimated:C?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:v?g.outputLines:y?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:v?g.text:y?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:v?g.outputPreview:t.task.outputPreview??(y?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:v?g.outputBytes:t.task.outputBytes??(y?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===zD&&h.description!==zD?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:y?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:y?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!_y(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!_y(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(_y(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,vA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function $Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,jCe=/([\w-]+)="([^"]*)"/g,HCe=/]*)>[\s\S]*?<\/output-file>/,WCe=/]*)>([\s\S]*?)<\/output-preview>/,qCe=/^Title: (.*)$/m,UCe=/^Severity: (.*)$/m;function k9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function p5(e){const t={};for(const n of e.matchAll(jCe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=k9(n[2]));return t}function VCe(e,t,n){const i=p5(e),o=qCe.exec(t)?.[1]?.trim()??"",s=UCe.exec(t)?.[1]?.trim()??"";let r=t.split(` -`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=HCe.exec(t),u=a?(()=>{const f=p5(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=WCe.exec(t),d=c?(()=>{const f=p5(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` -`),g=k9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),v=Number(f.bytes),y=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(v)?v:void 0,totalBytes:Number.isFinite(y)?y:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:k9(o),severity:s,body:k9(r),outputFile:u,outputPreview:d,raw:n}}function KCe(e){if(!e.includes("jD||s>jD||(o+1)*(s+1)>QCe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const HD=500;function WD(e,t){const n=[],i=Hu(e),o=Hu(t),s=Math.min(i.length,HD),r=Math.min(o.length,HD);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function $q(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}const YCe=/^read[_-]?media(?:file)?$/i,JCe=/^data:([^;]+);base64,(.*)$/s,XCe=/^<(image|video|audio)\s+path="([^"]+)">$/,eAe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,tAe=/Mime type:\s*([^.\s]+)/i,nAe=/Size:\s*(\d+)\s*bytes/i,iAe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,oAe="Image compressed to fit model limits:",sAe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function rAe(e){return e.includes(oAe)?e.replace(sAe,""):e}function lAe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function qD(e){const t=eAe.exec(e.trim());return t?{kind:t[1],path:lAe(t[2])}:null}const zq=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,aAe=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function kA(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return zq.test(i)?i:void 0}const uAe=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function UD(e){const t=uAe.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",i=aAe.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:i!==void 0&&zq.test(i)?i:void 0}}const cAe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function jq(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function kAe(e,t){if(xr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function bAe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Hq(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=Uk(o,s)??WD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=Uk(t.before,t.after)??WD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:ple(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Wq(e){const t=` -`,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):wAe(e)}function wAe(e){const t=e.split(` -`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function CAe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function AAe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return Wq(t)}function xAe(e,t){const n=e.metadata?.origin??{},i=AAe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function SAe(e,t,n){const{text:i,cron:o}=xAe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function _Ae(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function MAe(e){return e.metadata?.origin?.kind==="compaction_summary"}function IAe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function TAe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function EAe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function _4(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const v=d;if(d=null,!g&&v.blocks.length===0&&v.textParts.length===0&&v.thinkingParts.length===0&&v.tools.length===0)return;if(!g||!i)for(let C=0;CN.kind==="tool"&&N.tool.id===A.id);I&&I.kind==="tool"&&(I.tool=A)}const y={id:v.id,role:"assistant",no:a++,text:v.textParts.join(` -`),thinking:v.thinkingParts.length>0?v.thinkingParts.join(` -`):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs,createdAt:v.createdAt,endedAt:v.endedAt,goalContinuation:v.goalContinuation};l.push(y),u?.(y,v.sources)}function h(g,v){let y=null;for(const C of v)if(C.type==="text"){if(C.text){y==="text"?g.textParts[g.textParts.length-1]+=C.text:g.textParts.push(C.text);const w=g.blocks.at(-1);w&&w.kind==="text"?w.text+=(y==="text"?"":` -`)+C.text:g.blocks.push({kind:"text",text:C.text}),y="text"}}else if(C.type==="thinking"){if(C.thinking){y==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=C.thinking:g.thinkingParts.push(C.thinking);const w=g.blocks.at(-1);if(w&&w.kind==="thinking"){w.thinking+=(y==="thinking"?"":` -`)+C.thinking;const A=[w.startedAt,C.startedAt].filter(T=>T!==void 0).sort()[0],I=w.startedAt!==void 0&&w.durationMs===void 0||C.startedAt!==void 0&&C.durationMs===void 0,N=[w,C].flatMap(T=>T.startedAt!==void 0&&T.durationMs!==void 0?[Date.parse(T.startedAt)+T.durationMs]:[]);w.startedAt=A,w.durationMs=!I&&A!==void 0&&N.length>0?Math.max(...N)-Date.parse(A):void 0}else g.blocks.push({kind:"thinking",thinking:C.thinking,startedAt:C.startedAt,durationMs:C.durationMs});y="thinking"}}else if(C.type==="toolUse"){y=null;const w=c.get(C.toolCallId),A=C.toolName==="ExitPlanMode"?s[C.toolCallId]:void 0,I={id:C.toolCallId,name:C.toolName,arg:typeof C.input=="string"?C.input:JSON.stringify(C.input),agentId:xr(C.toolName)==="task"?C.agentRefs?.find(N=>N.role!=="member")?.agentId??C.agentRefs?.[0]?.agentId:void 0,status:"running",output:C.outputLines,plan:A,planPath:C.toolName==="ExitPlanMode"?A?.path??o[C.toolCallId]?.path:void 0};g.tools.push(I),g.blocks.push({kind:"tool",tool:I}),w&&(g.approval=Hq(w),g.approvalId=w.approvalId)}else if(C.type==="toolResult"){y=null;const w=g.tools.findIndex(A=>A.id===C.toolCallId);if(w!==-1){const A=g.tools[w],I=Lx(C.output),N={...A,status:C.isError?"error":"ok",output:I,media:C.isError?void 0:yAe(A.name,C.output),agentId:A.agentId??kAe(A.name,I)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=TAe(N.output)),g.tools[w]=N;const T=g.blocks.find(b=>b.kind==="tool"&&b.tool.id===C.toolCallId);T&&T.kind==="tool"&&(T.tool=N)}}else y=null}function m(g,v){if(g.type==="image"||g.type==="video"){const y=g.type,C=g.source;if(C.kind==="url")return{url:C.url,kind:y};if(C.kind==="base64")return{url:`data:${C.mediaType};base64,${C.data}`,kind:y};if(C.kind==="file"&&n)return{url:n(C.fileId),kind:y,fileId:C.fileId};if(C.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(v,C.fileId)??"",kind:y,fileId:C.fileId,sessionId:v}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(MAe(g)){f();const A=g.metadata?.[X$],I={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` -`),compaction:{trigger:A?.trigger,tokensBefore:A?.tokensBefore,tokensAfter:A?.tokensAfter}};l.push(I),u?.(I,[g]);continue}if(g.role==="user"){const A=CAe(g),I=g.metadata?.origin?.kind,N=I==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(A===void 0&&(I==="injection"||N))continue;if(A===void 0&&(I==="task"||I==="background_task"||I==="task_notification")){const ne=g.content.filter(Me=>Me.type==="text").map(Me=>Me.text).join(` -`),le=ZCe(g.metadata),oe=le!==void 0?[le]:KCe(ne);if(oe.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const Me of oe)d.blocks.push({kind:"notification",notification:{...Me,createdAt:g.createdAt}})}continue}if(f(),A!==void 0){const ne=SAe(g,a++,A);l.push(ne),u?.(ne,[g]);continue}if(I==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!_Ae(g))continue;const T=g.metadata?.origin,b=T?.kind==="skill_activation"&&T?.trigger==="user-slash",_=T?.kind==="plugin_command"&&T?.trigger==="user-slash",S=[],E=[];for(const ne of g.content){if(ne.type==="text")if(b){const oe=qD(ne.text);if(oe&&(oe.kind==="video"||oe.kind==="image")&&n){const Be=kA(oe.path);if(Be){E.push({url:n(Be),kind:oe.kind,fileId:Be});continue}}const Me=UD(ne.text);Me&&E.push({kind:"file",url:Me.fileId&&n?n(Me.fileId):"",fileId:Me.fileId,name:Me.name,mediaType:Me.mediaType,size:Me.size})}else if(_)S.push(T.commandArgs??"");else{const oe=qD(ne.text);if(oe&&(oe.kind==="video"||oe.kind==="image")&&n){const Pe=kA(oe.path);if(Pe){E.push({url:n(Pe),kind:oe.kind,fileId:Pe});continue}}const Me=UD(ne.text);if(Me){E.push({kind:"file",url:Me.fileId&&n?n(Me.fileId):"",fileId:Me.fileId,name:Me.name,mediaType:Me.mediaType,size:Me.size});continue}const Be=rAe(ne.text);if(Be!==ne.text&&Be.trim().length===0)continue;S.push(Be)}const le=m(ne,g.sessionId);if(le){E.push({url:le.url,kind:le.kind,name:ne.type==="file"?ne.name:void 0,fileId:le.fileId,sessionId:le.sessionId});continue}ne.type==="file"&&n&&E.push({kind:"file",url:n(ne.fileId),fileId:ne.fileId,name:ne.name,mediaType:ne.mediaType||void 0,size:ne.size})}const M=b?T?.skillArgs??"":S.join(` -`),F=hAe(M),H=pAe(M),$=E.filter(ne=>ne.kind==="file"),R=E.filter(ne=>ne.kind==="image"||ne.kind==="video"),O=[...F].some(ne=>ne<=$.length),z=[...H].some(ne=>ne<=R.length),W=O||z?E:[];let j=0,Q=0;const re=E.filter(ne=>ne.kind==="file"?(j+=1,!(O&&F.has(j))):ne.kind==="image"||ne.kind==="video"?(Q+=1,!(z&&H.has(Q))):!0),K={id:g.id,role:"user",no:a++,text:M,attachments:re.length>0?re:void 0,inlineAttachments:W.length>0?W:void 0,skillActivation:b?{name:T.skillName,args:T.skillArgs}:void 0,pluginCommand:_?{pluginId:T.pluginId,commandName:T.commandName,args:T.commandArgs}:void 0,createdAt:g.createdAt};l.push(K),u?.(K,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const v=g.promptId;IAe(d,v)?d!==null&&d.promptId===void 0&&v!==void 0&&(d.promptId=v):(f(),d={id:g.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const C=d;if(C===null)continue;const w=EAe(g.content);C.promptId!==void 0&&C.seenSigs.has(w)||(C.seenSigs.add(w),C.sources.push(g),g.durationMs!==void 0&&(C.durationMs=g.durationMs),h(C,g.content),g.endedAt!==void 0?C.endedAt=g.endedAt:g.id!==C.id&&(C.endedAt=g.createdAt))}return f(!0),l}function qq(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function LAe(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||qq(a,c,u)||(d.settledAt=i)}}}function NAe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function DAe(e,t,n,i){const o=e.items.filter(d=>d.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(d=>[d.taskId,d])),a=new Map(e.prompts.map(d=>[d.promptId,d])),u=e.items.flatMap(d=>d.kind==="turn"?Nx(d,e.attachments,l,d.turnId===s?n?.createdAt:void 0,d.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a}):[]),c=e.meta.activity==="turn";return _4(u,[],t,c,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(BAe)}function Nx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(v=>[v.attachmentId,v])),u=bA([e.startedAt,...e.steps.map(v=>v.startedAt),i])??"",c=VD(e.endedAt)??VD(o),d=e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h){const v=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const y of e.attachmentIds??[]){const C=KD(a.get(y));C!==void 0&&v.push(C)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:v,createdAt:u,promptId:d,metadata:r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(y.text.length===0&&!C)continue;if(y.role==="user"){if(y.taskId!==void 0){const I=FAe(y.taskId,y.text,n.get(y.taskId));l.push({id:y.frameId,sessionId:"",role:"user",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:y.taskId},[Pq]:I}});continue}const w=y.text.length>0?[{type:"text",text:y.text}]:[];for(const I of y.attachmentIds??[]){const N=KD(a.get(I));N!==void 0&&w.push(N)}const A=y.promptIds?.map(I=>r?.promptById?.get(I)).find(I=>I!==void 0);l.push({id:y.frameId,sessionId:s,role:"user",content:w,createdAt:A?.createdAt??v.startedAt??u,promptId:d});continue}l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:y.text}],createdAt:v.startedAt??u,promptId:d})}else if(y.kind==="thinking"){if(y.text.length===0)continue;const C=r?.pendingInteractionAtByStepId?.get(v.stepId),w=qq(v,y,C!==void 0),A=r?.thinkingTiming,I=A?.get(y.frameId);let N,T;if(I!==void 0)I.settledAt===void 0&&!w&&(I.settledAt=new Date().toISOString()),N=I.startedAt,T=m5(I.startedAt,I.settledAt);else if(A!==void 0&&w){const b=new Date().toISOString();A.set(y.frameId,{startedAt:b}),N=b}else N=v.startedAt,T=m5(v.startedAt,bA([v.endedAt,C]));l.push({id:y.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:y.text,startedAt:N,durationMs:T}],createdAt:v.startedAt??u,promptId:d})}else y.kind==="tool"&&(l.push({id:`${y.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:y.toolCallId,toolName:y.name,input:y.input??y.display??{},outputLines:y.state==="running"?Lx(y.output):void 0,agentRefs:y.agentRefs}],createdAt:v.startedAt??u,promptId:d}),y.state!=="running"&&l.push({id:`${y.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:y.toolCallId,output:y.output??y.error??"",isError:y.state==="error"}],createdAt:v.endedAt??v.startedAt??u,promptId:d}));const m=e.durationMs??m5(u||void 0,c),g=l.findLastIndex(v=>v.role==="assistant");return g>=0&&(m!==void 0||c!==void 0)&&(l[g]={...l[g],durationMs:m,endedAt:c??l[g].endedAt}),l}function FAe(e,t,n){const[i="",...o]=t.split(` -`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function BAe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function bA(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const ZD=6e3,wA=256*1024,RAe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function GD(e,t){return t===0?e:e-1}function OAe(e,t){const n=Hu(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=RAe.exec(s.text);if(!r)return null;const l=GD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=GD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;owA||Hu(n).length>ZD)return null;const i=OAe(e,n);return i===null||i.length>wA||Hu(i).length>ZD?null:{before:i,after:n}}const $Ae=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function zAe(e){return $Ae.has(e.type)}const jAe=50,HAe=100,CA=32*1024,WAe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,jAe)},cancelTask(e){clearTimeout(e)}};function qAe(e,t,n={}){const i=n.scheduler??WAe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??HAe)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const y=++u,C=()=>{y===u&&m()};l=i.requestFrame(C),a=i.requestTask(C)};m=()=>{f();let y=0;for(;!c&&y{if(!c){if(t(y)){const C=s.length>r?s.at(-1):void 0,w=C===void 0?void 0:n.coalesce?.(C,y);w===void 0?s.push(y):s[s.length-1]=w,g();return}if(d()===0){e(y);return}s.push(y),m()}});return v.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let C=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},v}function AA(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function UAe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=AA(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=CA)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function VAe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=AA(e.appEvent),s=AA(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>CA)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function KAe(e,t){const i=e.items.filter(d=>d.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(d=>[d.taskId,d])),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=d=>d.kind==="turn"?d.origin.payload??d.origin:void 0,l=new Set,a=e.items.flatMap((d,f)=>{if(d.kind==="turn"){const h=d.startedAt!==void 0||d.steps.some(m=>m.startedAt!==void 0);return ZAe(d,e.attachments,o,d.turnId===i&&!h&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s)}if(d.kind==="marker"&&d.marker==="compaction"){const h=GAe(d.payload,d.at,t.sessionId,d.markerId,YAe(e.items,f));return h===void 0?[]:[h]}if(d.kind==="marker"&&d.marker==="cron.fired"){const h=d.payload,m=h?.origin?.jobId,g=typeof h?.prompt=="string"?h.prompt:void 0,v=e.items.slice(f+1).find(C=>{if(C.kind!=="turn"||l.has(C.turnId))return!1;const w=r(C);return w?.kind==="cron_job"&&(m===void 0||w.jobId===m)&&(g===void 0||C.kind==="turn"&&Wq(C.prompt??"")===g)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const y=QAe(d.payload,d.at,t.sessionId,d.markerId);return y===void 0?[]:[y]}return[]}),u=e.interactions.map(d=>Yp(d,t.sessionId)).filter(d=>d!==void 0),c=e.meta.activity==="turn";return _4(a,u,t.getFileUrl,c,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(e6e)}function ZAe(e,t,n,i,o,s,r,l,a){const u=e.origin.payload??e.origin,c=u?.kind;return[...e.prompt===void 0&&c==="system_trigger"?[{id:`${e.turnId}:origin`,sessionId:s,role:"user",content:[],createdAt:bA([e.startedAt,...e.steps.map(f=>f.startedAt),i])??"",promptId:e.turnId,metadata:{origin:u}}]:[],...Nx(e,t,n,i,o,s,{includeOrigin:!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a})]}function GAe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[X$]:l}}}function QAe(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function YAe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function Yp(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function vg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(JAe),createdAt:""}}function JAe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(XAe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function XAe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function e6e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function t6e(){let e=[];const t=(n,i)=>{const s=KAe(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function n6e(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function i6e(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&n6e(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function QD(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function o6e(e){return e.suspendedReason||QD(e.text)||QD(e.outputLines?.join(` -`))||e.summary||""}function s6e(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function r6e(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function YD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:r6e(e.outcome),body:e.body}}function l6e(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function a6e(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:o6e(o),phase:o.phase,body:s6e(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>l6e(s,o))).map((o,s)=>YD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>YD(o,s))}const u6e=["queued","working","suspended","completed","failed","cancelled"];function Uq(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function c6e(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function d6e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:Uq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=c6e();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function f6e(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of u6e)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function h6e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:Uq(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function Dx(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Vq(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const zg=100*1024;function Kq(e){const t=xr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=Dx(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>zg||a.length>zg?null:Uk(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>zg||c.length>zg)return null;const d=Uk(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Hu(u).length,r+=Hu(c).length}return o}const p6e=5e3;function m6e(e){if(xr(e.name)!=="write")return null;const t=Dx(e.arg);return!t||typeof t.content!="string"||t.content.length>zg||t.content.split(` -`).length>p6e?null:{content:t.content,path:Vq(t)}}function JD(e){const t=Dx(e.arg);return t?Vq(t):void 0}function g6e(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function v6e(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function y6e(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function k6e(e){return Zq(e).parents}function Zq(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function b6e(e,t,n){const i=Zq(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=g6e(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:y6e(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?v6e(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function w6e(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(b,_)=>l.set(b,_);let v=n!==null;if(v){const b=n,_=Object.keys(h);v=_.length===Object.keys(b).length&&_.every(S=>h[S]===b[S])}let y=i!==null;if(y){const b=i,_=Object.keys(m);y=_.length===Object.keys(b).length&&_.every(S=>m[S]===b[S])}const C=e.length>0&&d===t&&v&&y&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,A=0,I=1;if(C){let b=-1;for(let _=e.length-1;_>=0;_--)if(e[_].role==="assistant"){b=_;break}for(let _=0;_0?[...e.slice(0,w),...N]:N;return e=T,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,T};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function C6e(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&(n++,t.set(o.id,n))}return t}const Gq=["light","dark","system"],A6e=["small","medium","large","xlarge"],g5="medium",Qq="kimi-web.color-scheme",xA="kimi-web.font-scale",XD="kimi-web.ui-font-size";function SA(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Fx(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function x6e(e){try{globalThis.localStorage.removeItem(e)}catch{}}function S6e(){const e=SA(Qq);return e&&Gq.includes(e)?e:"system"}const My={light:"#ffffff",dark:"#121212"};function _6e(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?My.dark:e==="light"?My.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?My.dark:My.light;i.setAttribute("content",n??s)})}function Yq(e){return A6e.includes(e)}function M6e(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function I6e(){const e=SA(xA);if(e==="xxlarge")return"xlarge";if(e!==null)return Yq(e)?e:g5;const t=SA(XD);if(t===null)return g5;const n=Number(t),i=Number.isFinite(n)?M6e(n):g5;return Fx(xA,i),x6e(XD),i}function T6e(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const Bx=q(S6e()),Rx=q(I6e());let eF=!1;function E6e(){eF||(eF=!0,Ge(Bx,_6e,{immediate:!0}),Ge(Rx,T6e,{immediate:!0}))}function L6e(e){Gq.includes(e)&&(Bx.value=e,Fx(Qq,e))}function N6e(e){Yq(e)&&(Rx.value=e,Fx(xA,e))}function Mm(){return E6e(),{colorScheme:Bx,fontScale:Rx,setColorScheme:L6e,setFontScale:N6e}}const Iy=q(!1);let tF=!1;function v5(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function M4(){return!tF&&typeof window<"u"&&typeof document<"u"&&(tF=!0,Iy.value=v5(),new MutationObserver(()=>{Iy.value=v5()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Iy.value=v5()})),Iy}const Jq="kimi-web.sidebar-multi-tab";function D6e(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function F6e(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function B6e(){return D6e(Jq)==="1"}const Xq=q(B6e());function R6e(e){Xq.value=e,F6e(Jq,e?"1":"0")}function Im(){return{sidebarTabs:Xq,setSidebarTabs:R6e}}const nF=document.createElement("i");function O6e(e){const t="&"+e+";";nF.innerHTML=t;const n=nF.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Wu(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Wu(e,e.length,0,t),e):t}const iF={}.hasOwnProperty;function P6e(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function ro(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Mi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Mi(a)&&s++r))return;const T=t.events.length;let b=T,_,S;for(;b--;)if(t.events[b][0]==="exit"&&t.events[b][1].type==="chunkFlow"){if(_){S=t.events[b][1].end;break}_=!0}for(y(i),N=T;Nw;){const I=n[A];t.containerState=I[1],I[0].exit.call(t,e)}n.length=w}function C(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Q6e(e,t,n){return ro(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sF(e){if(e===null||kl(e)||U6e(e))return 1;if(q6e(e))return 2}function Px(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};rF(d,-a),rF(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=pa(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=pa(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=pa(u,Px(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=pa(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=pa(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Wu(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Mi(N)?ro(e,C,"linePrefix",s+1)(N):C(N)}function C(N){return N===null||Pn(N)?e.check(lF,g,A)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Pn(N)?(e.exit("codeFlowValue"),C(N)):(e.consume(N),w)}function A(N){return e.exit("codeFenced"),t(N)}function I(N,T,b){let _=0;return S;function S($){return N.enter("lineEnding"),N.consume($),N.exit("lineEnding"),E}function E($){return N.enter("codeFencedFence"),Mi($)?ro(N,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):M($)}function M($){return $===l?(N.enter("codeFencedFenceSequence"),F($)):b($)}function F($){return $===l?(_++,N.consume($),F):_>=r?(N.exit("codeFencedFenceSequence"),Mi($)?ro(N,H,"whitespace")($):H($)):b($)}function H($){return $===null||Pn($)?(N.exit("codeFencedFence"),T($)):b($)}}}function a7e(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const y5={name:"codeIndented",tokenize:c7e},u7e={partial:!0,tokenize:d7e};function c7e(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),ro(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Pn(u)?e.attempt(u7e,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Pn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function d7e(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):ro(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Pn(r)?o(r):n(r)}}const f7e={name:"codeText",previous:p7e,resolve:h7e,tokenize:m7e};function h7e(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&yg(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),yg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),yg(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function oU(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return y===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(y),e.exit(s),f):y===null||y===32||y===41||_A(y)?n(y):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Pn(y)?n(y):(e.consume(y),y===92?m:h)}function m(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!c&&(y===null||y===41||kl(y))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(y)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Pn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Pn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Mi(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function rU(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):Pn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ro(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Pn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function _0(e,t){let n;return i;function i(o){return Pn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Mi(o)?ro(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const A7e={name:"definition",tokenize:S7e},x7e={partial:!0,tokenize:_7e};function S7e(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return sU.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=Ox(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return kl(h)?_0(e,u)(h):u(h)}function u(h){return oU(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(x7e,d,d)(h)}function d(h){return Mi(h)?ro(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Pn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function _7e(e,t,n){return i;function i(l){return kl(l)?_0(e,o)(l):n(l)}function o(l){return rU(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Mi(l)?ro(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Pn(l)?t(l):n(l)}}const M7e={name:"hardBreakEscape",tokenize:I7e};function I7e(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Pn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const T7e={name:"headingAtx",resolve:E7e,tokenize:L7e};function E7e(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Wu(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function L7e(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||kl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Pn(c)?(e.exit("atxHeading"),t(c)):Mi(c)?ro(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||kl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const N7e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],uF=["pre","script","style","textarea"],D7e={concrete:!0,name:"htmlFlow",resolveTo:R7e,tokenize:O7e},F7e={partial:!0,tokenize:$7e},B7e={partial:!0,tokenize:P7e};function R7e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function O7e(e,t,n){const i=this;let o,s,r,l,a;return u;function u(K){return c(K)}function c(K){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(K),d}function d(K){return K===33?(e.consume(K),f):K===47?(e.consume(K),s=!0,g):K===63?(e.consume(K),o=3,i.interrupt?t:j):Mu(K)?(e.consume(K),r=String.fromCharCode(K),v):n(K)}function f(K){return K===45?(e.consume(K),o=2,h):K===91?(e.consume(K),o=5,l=0,m):Mu(K)?(e.consume(K),o=4,i.interrupt?t:j):n(K)}function h(K){return K===45?(e.consume(K),i.interrupt?t:j):n(K)}function m(K){const ne="CDATA[";return K===ne.charCodeAt(l++)?(e.consume(K),l===ne.length?i.interrupt?t:M:m):n(K)}function g(K){return Mu(K)?(e.consume(K),r=String.fromCharCode(K),v):n(K)}function v(K){if(K===null||K===47||K===62||kl(K)){const ne=K===47,le=r.toLowerCase();return!ne&&!s&&uF.includes(le)?(o=1,i.interrupt?t(K):M(K)):N7e.includes(r.toLowerCase())?(o=6,ne?(e.consume(K),y):i.interrupt?t(K):M(K)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(K):s?C(K):w(K))}return K===45||Wa(K)?(e.consume(K),r+=String.fromCharCode(K),v):n(K)}function y(K){return K===62?(e.consume(K),i.interrupt?t:M):n(K)}function C(K){return Mi(K)?(e.consume(K),C):S(K)}function w(K){return K===47?(e.consume(K),S):K===58||K===95||Mu(K)?(e.consume(K),A):Mi(K)?(e.consume(K),w):S(K)}function A(K){return K===45||K===46||K===58||K===95||Wa(K)?(e.consume(K),A):I(K)}function I(K){return K===61?(e.consume(K),N):Mi(K)?(e.consume(K),I):w(K)}function N(K){return K===null||K===60||K===61||K===62||K===96?n(K):K===34||K===39?(e.consume(K),a=K,T):Mi(K)?(e.consume(K),N):b(K)}function T(K){return K===a?(e.consume(K),a=null,_):K===null||Pn(K)?n(K):(e.consume(K),T)}function b(K){return K===null||K===34||K===39||K===47||K===60||K===61||K===62||K===96||kl(K)?I(K):(e.consume(K),b)}function _(K){return K===47||K===62||Mi(K)?w(K):n(K)}function S(K){return K===62?(e.consume(K),E):n(K)}function E(K){return K===null||Pn(K)?M(K):Mi(K)?(e.consume(K),E):n(K)}function M(K){return K===45&&o===2?(e.consume(K),R):K===60&&o===1?(e.consume(K),O):K===62&&o===4?(e.consume(K),Q):K===63&&o===3?(e.consume(K),j):K===93&&o===5?(e.consume(K),W):Pn(K)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(F7e,re,F)(K)):K===null||Pn(K)?(e.exit("htmlFlowData"),F(K)):(e.consume(K),M)}function F(K){return e.check(B7e,H,re)(K)}function H(K){return e.enter("lineEnding"),e.consume(K),e.exit("lineEnding"),$}function $(K){return K===null||Pn(K)?F(K):(e.enter("htmlFlowData"),M(K))}function R(K){return K===45?(e.consume(K),j):M(K)}function O(K){return K===47?(e.consume(K),r="",z):M(K)}function z(K){if(K===62){const ne=r.toLowerCase();return uF.includes(ne)?(e.consume(K),Q):M(K)}return Mu(K)&&r.length<8?(e.consume(K),r+=String.fromCharCode(K),z):M(K)}function W(K){return K===93?(e.consume(K),j):M(K)}function j(K){return K===62?(e.consume(K),Q):K===45&&o===2?(e.consume(K),j):M(K)}function Q(K){return K===null||Pn(K)?(e.exit("htmlFlowData"),re(K)):(e.consume(K),Q)}function re(K){return e.exit("htmlFlow"),t(K)}}function P7e(e,t,n){const i=this;return o;function o(r){return Pn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function $7e(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(I4,t,n)}}const z7e={name:"htmlText",tokenize:j7e};function j7e(e,t,n){const i=this;let o,s,r;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),a}function a(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),I):j===63?(e.consume(j),w):Mu(j)?(e.consume(j),b):n(j)}function u(j){return j===45?(e.consume(j),c):j===91?(e.consume(j),s=0,m):Mu(j)?(e.consume(j),C):n(j)}function c(j){return j===45?(e.consume(j),h):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):Pn(j)?(r=d,O(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),h):d(j)}function h(j){return j===62?R(j):j===45?f(j):d(j)}function m(j){const Q="CDATA[";return j===Q.charCodeAt(s++)?(e.consume(j),s===Q.length?g:m):n(j)}function g(j){return j===null?n(j):j===93?(e.consume(j),v):Pn(j)?(r=g,O(j)):(e.consume(j),g)}function v(j){return j===93?(e.consume(j),y):g(j)}function y(j){return j===62?R(j):j===93?(e.consume(j),y):g(j)}function C(j){return j===null||j===62?R(j):Pn(j)?(r=C,O(j)):(e.consume(j),C)}function w(j){return j===null?n(j):j===63?(e.consume(j),A):Pn(j)?(r=w,O(j)):(e.consume(j),w)}function A(j){return j===62?R(j):w(j)}function I(j){return Mu(j)?(e.consume(j),N):n(j)}function N(j){return j===45||Wa(j)?(e.consume(j),N):T(j)}function T(j){return Pn(j)?(r=T,O(j)):Mi(j)?(e.consume(j),T):R(j)}function b(j){return j===45||Wa(j)?(e.consume(j),b):j===47||j===62||kl(j)?_(j):n(j)}function _(j){return j===47?(e.consume(j),R):j===58||j===95||Mu(j)?(e.consume(j),S):Pn(j)?(r=_,O(j)):Mi(j)?(e.consume(j),_):R(j)}function S(j){return j===45||j===46||j===58||j===95||Wa(j)?(e.consume(j),S):E(j)}function E(j){return j===61?(e.consume(j),M):Pn(j)?(r=E,O(j)):Mi(j)?(e.consume(j),E):_(j)}function M(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,F):Pn(j)?(r=M,O(j)):Mi(j)?(e.consume(j),M):(e.consume(j),H)}function F(j){return j===o?(e.consume(j),o=void 0,$):j===null?n(j):Pn(j)?(r=F,O(j)):(e.consume(j),F)}function H(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||kl(j)?_(j):(e.consume(j),H)}function $(j){return j===47||j===62||kl(j)?_(j):n(j)}function R(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function O(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),z}function z(j){return Mi(j)?ro(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):W(j)}function W(j){return e.enter("htmlTextData"),r(j)}}const $x={name:"labelEnd",resolveAll:U7e,resolveTo:V7e,tokenize:K7e},H7e={tokenize:Z7e},W7e={tokenize:G7e},q7e={tokenize:Q7e};function U7e(e){let t=-1;const n=[];for(;++t=3&&(u===null||Pn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Mi(u)?ro(e,l,"whitespace")(u):l(u))}}const ol={continuation:{tokenize:rxe},exit:axe,name:"list",tokenize:sxe},ixe={partial:!0,tokenize:uxe},oxe={partial:!0,tokenize:lxe};function sxe(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:MA(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(b9,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return MA(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(I4,i.interrupt?n:c,e.attempt(ixe,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Mi(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function rxe(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(I4,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,ro(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Mi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(oxe,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,ro(e,e.attempt(ol,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function lxe(e,t,n){const i=this;return ro(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function axe(e){e.exit(this.containerState.type)}function uxe(e,t,n){const i=this;return ro(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Mi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const cF={name:"setextUnderline",resolveTo:cxe,tokenize:dxe};function cxe(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function dxe(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Mi(u)?ro(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Pn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const fxe={tokenize:hxe};function hxe(e){const t=this,n=e.attempt(I4,i,e.attempt(this.parser.constructs.flowInitial,o,ro(e,e.attempt(this.parser.constructs.flow,o,e.attempt(y7e,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const pxe={resolveAll:aU()},mxe=lU("string"),gxe=lU("text");function lU(e){return{resolveAll:aU(e==="text"?vxe:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function Exe(e,t){let n=-1;const i=[];let o;for(;++n>1}};Qs.from=function(e){if(e instanceof Qs)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Qs(t)};function uU(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function fU(e){return e>=55296&&e<56320}class rn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new rn(i,o)}cutByIndex(t,n){return t==n?rn.empty:t==0&&n==this.content.length?this:new rn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new rn(o,s)}addToStart(t){return new rn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new rn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?Ty(n+1,s):Ty(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return rn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return rn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return rn.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Di.none=[];class dv extends Error{}class pn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=pU(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new pn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new pn(hU(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return pn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new pn(rn.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new pn(t,i,o)}}pn.empty=new pn(rn.empty,0,0);function hU(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(hU(s.content,t-o-1,n-o-1)))}function pU(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=pU(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function Fxe(e,t,n){if(n.openStart>e.depth)throw new dv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new dv("Inconsistent open depths");return mU(e,t,n,0)}function mU(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function M0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Eh(e.nodeAfter,i),s++));for(let l=s;lo&&TA(e,t,o+1),r=i.depth>o&&TA(n,i,o+1),l=[];return M0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(gU(s,r),Eh(Lh(s,vU(e,t,n,i,o+1)),l)):(s&&Eh(Lh(s,Kk(e,t,o+1)),l),M0(t,n,o,l),r&&Eh(Lh(r,Kk(n,i,o+1)),l)),M0(i,null,o,l),new rn(l)}function Kk(e,t,n){let i=[];if(M0(null,e,n,i),e.depth>n){let o=TA(e,t,n+1);Eh(Lh(o,Kk(e,t,n+1)),i)}return M0(t,null,n,i),new rn(i)}function Bxe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(rn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class fv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new Pxe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new fv(n,i,s)}static resolveCached(t,n){let i=fF.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),yU(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=rn.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=rn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};Nh.prototype.text=void 0;class Zk extends Nh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yU(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Zk(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Zk(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function yU(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Kh{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new zxe(t,n);if(i.next==null)return Kh.empty;let o=kU(i);i.next&&i.err("Unexpected trailing text");let s=Kxe(Vxe(o));return Zxe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}Kh.empty=new Kh(!0);class zxe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function kU(e){let t=[];do t.push(jxe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function jxe(e){let t=[];do t.push(Hxe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Hxe(e){let t=Uxe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=Wxe(e,t);else break;return t}function hF(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Wxe(e,t){let n=hF(e),i=n;return e.eat(",")&&(e.next!="}"?i=hF(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function qxe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function Uxe(e){if(e.eat("(")){let t=kU(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=qxe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Vxe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Kh(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:CU(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Nh(this,this.computeAttrs(t),rn.from(n),Di.setFrom(i))}createChecked(t=null,n,i){return n=rn.from(n),this.checkContent(n),new Nh(this,this.computeAttrs(t),n,Di.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=rn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(rn.empty,!0);return s?new Nh(this,t,n.append(s),Di.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new SU(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function Gxe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class Qxe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?Gxe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class T4{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=xU(t,o.attrs),this.excluded=null;let s=wU(this.attrs);this.instance=s?new Di(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Di(this,CU(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new T4(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class Yxe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Qs.from(t.nodes),n.marks=Qs.from(t.marks||{}),this.nodes=mF.compile(this.spec.nodes,this),this.marks=T4.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Kh.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?gF(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:gF(this,r.split(" "))}this.nodeFromJSON=o=>Nh.fromJSON(this,o),this.markFromJSON=o=>Di.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof mF){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new Zk(i,i.defaultAttrs,t,Di.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function gF(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function Jxe(e){return e.tag!=null}function Xxe(e){return e.style!=null}let _U=class LA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(Jxe(o))this.tags.push(o);else if(Xxe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new yF(this,n,!1);return i.addAll(t,Di.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new yF(this,n,!0);return i.addAll(t,Di.none,n.from,n.to),pn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=kF(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=kF(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new LA(t,LA.schemaRules(t)))}};const MU={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eSe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},IU={ol:!0,ul:!0},hv=1,NA=2,I0=4;function vF(e,t,n){return t!=null?(t?hv:0)|(t==="full"?NA:0):e&&e.whitespace=="pre"?hv|NA:n&~I0}class Ey{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Di.none,this.match=s||(r&I0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(rn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&hv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=rn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(rn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!MU.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class yF{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=vF(null,n.preserveWhitespace,0)|(i?I0:0);o?s=new Ey(o.type,o.attrs,Di.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new Ey(null,null,Di.none,!0,null,r):s=new Ey(t.schema.topNodeType,null,Di.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&NA?"full":this.localPreserveWS||(o.options&hv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):bF(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new Ey(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=hv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function tSe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&IU.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function nSe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function kF(e){let t={};for(let n in e)t[n]=e[n];return t}function bF(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&w9(Ly(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:w9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ou(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=wF(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return wF(t.marks)}}function wF(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Ly(e){return e.document||window.document}const CF=new WeakMap;function iSe(e){let t=CF.get(e);return t===void 0&&CF.set(e,t=oSe(e)),t}function oSe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=w9(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const TU=65535,EU=Math.pow(2,16);function sSe(e,t){return e+t*EU}function AF(e){return e&TU}function rSe(e){return(e-(e&TU))/EU}const LU=1,NU=2,C9=4,DU=8;class DA{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&DU)>0}get deletedBefore(){return(this.delInfo&(LU|C9))>0}get deletedAfter(){return(this.delInfo&(NU|C9))>0}get deletedAcross(){return(this.delInfo&C9)>0}}class Ol{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Ol.empty)return Ol.empty}recover(t){let n=0,i=AF(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:sSe(l/3,t-a),g=t==a?NU:t==d?LU:C9;return(n<0?t!=a:t!=d)&&(g|=DU),new DA(h,g,m)}o+=c-u}return i?t+o:new DA(t+o,0,null)}touches(t,n){let i=0,o=AF(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new pv;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,s)}invert(){return new Nu(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new xd(n.pos,i.pos,this.mark)}merge(t){return t instanceof xd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new xd(n.from,n.to,t.markFromJSON(n.mark))}}Sr.jsonID("addMark",xd);class Nu extends Sr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new pn(zx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,i)}invert(){return new xd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Nu(n.pos,i.pos,this.mark)}merge(t){return t instanceof Nu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Nu(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Nu(n.from,n.to,t.markFromJSON(n.mark))}}Sr.jsonID("removeMark",Nu);class Sd extends Sr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return fs.fromReplace(t,this.pos,this.pos+1,new pn(rn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new ql(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ql(n.from,n.to,n.gapFrom,n.gapTo,pn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Sr.jsonID("replaceAround",ql);function FA(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function lSe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function aSe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof T4){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new Nu(r.from,r.to,r.style)))}function jx(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function uSe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Hx(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=rn.from(i.node(m).copy(c)),d++):a--;let f=rn.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=rn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ql(o,s,o,s,new pn(i,0,0),n.length,!0))}function fSe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&hSe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&BU(e,r,l,s),jx(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new ql(d,f,d+1,f-1,new pn(rn.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&FU(e,r,l,s),!1}})}function FU(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function BU(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function hSe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function pSe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ql(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new pn(rn.from(r),0,0),1,!0))}function A9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function mSe(e,t,n=1,i){let o=e.doc.resolve(t),s=rn.empty,r=rn.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=rn.from(o.node(l).copy(s));let c=i&&i[u];r=rn.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new zs(t,t,new pn(s.append(r),n,n),!0))}function RU(e,t){let n=e.resolve(t),i=n.index();return vSe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function gSe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function Wx(e,t,n=t,i=pn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return OU(o,s,i)?new zs(t,n,i):new wSe(o,s,i).fit()}function OU(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class wSe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=rn.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=rn.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new pn(s,r,l);return t>-1?new ql(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new zs(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=C5(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(rn.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=C5(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new pn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=C5(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new pn(jg(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new pn(jg(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=v,c.push(PU(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=Hg(this.placed,n,rn.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=A5(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Hg(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Hg(this.placed,this.depth,rn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(rn.empty,!0);n.childCount&&(this.placed=Hg(this.placed,this.frontier.length,n))}}function jg(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(jg(e.firstChild.content,t-1,n)))}function Hg(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Hg(e.lastChild.content,t-1,n)))}function C5(e,t){for(let n=0;n1&&(i=i.replaceChild(0,PU(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(rn.empty,!0)))),e.copy(i)}function A5(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!CSe(n,s.content,r)?l:null}function CSe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=ASe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function $U(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(rn.empty,!0))}return e}function SSe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=kSe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new pn(rn.from(i),0,0))}function _Se(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=zU(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function zU(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class B1 extends Sr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return fs.fromReplace(t,this.pos,this.pos+1,new pn(rn.from(o),0,n.isLeaf?0:1))}getMap(){return Ol.empty}invert(t){return new B1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new B1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new B1(n.pos,n.attr,n.value)}}Sr.jsonID("attr",B1);class mv extends Sr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return fs.ok(i)}getMap(){return Ol.empty}invert(t){return new mv(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new mv(n.attr,n.value)}}Sr.jsonID("docAttr",mv);let im=class extends Error{};im=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};im.prototype=Object.create(Error.prototype);im.prototype.constructor=im;im.prototype.name="TransformError";class MSe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new pv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new im(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=pn.empty){let o=Wx(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new pn(rn.from(i),0,0))}delete(t,n){return this.replace(t,n,pn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return xSe(this,t,n,i),this}replaceRangeWith(t,n,i){return SSe(this,t,n,i),this}deleteRange(t,n){return _Se(this,t,n),this}lift(t,n){return cSe(this,t,n),this}join(t,n=1){return ySe(this,t,n),this}wrap(t,n){return dSe(this,t,n),this}setBlockType(t,n=t,i,o=null){return fSe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return pSe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new B1(t,n,i)),this}setDocAttribute(t,n){return this.step(new mv(t,n)),this}addNodeMark(t,n){return this.step(new Sd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Di)n.isInSet(i.marks)&&this.step(new Zh(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Zh(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return mSe(this,t,n,i),this}addMark(t,n,i){return lSe(this,t,n,i),this}removeMark(t,n,i){return aSe(this,t,n,i),this}clearIncompatible(t,n,i){return jx(this,t,n,i),this}}const x5=Object.create(null);class Wi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new ISe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?Jp(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):Jp(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Ul(t.node(0))}static atStart(t){return Jp(t,t,0,0,1)||new Ul(t)}static atEnd(t){return Jp(t,t,t.content.size,t.childCount,-1)||new Ul(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=x5[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in x5)throw new RangeError("Duplicate use of selection JSON ID "+t);return x5[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Kn.between(this.$anchor,this.$head).getBookmark()}}Wi.prototype.visible=!0;class ISe{constructor(t,n){this.$from=t,this.$to=n}}let xF=!1;function SF(e){!xF&&!e.parent.inlineContent&&(xF=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Kn extends Wi{constructor(t,n=t){SF(t),SF(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Wi.near(i);let o=t.resolve(n.map(this.anchor));return new Kn(o.parent.inlineContent?o:i,i)}replace(t,n=pn.empty){if(super.replace(t,n),n==pn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof Kn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new E4(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Kn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Wi.findFrom(n,i,!0)||Wi.findFrom(n,-i,!0);if(s)n=s.$head;else return Wi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Wi.findFrom(t,-i,!0)||Wi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Hn.isSelectable(l))return Hn.create(e,n-(o<0?l.nodeSize:0))}else{let a=Jp(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function _F(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Wi.near(e.doc.resolve(r),n))}const MF=1,Ny=2,IF=4;class ESe extends MSe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Ny,this}ensureMarks(t){return Di.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ny)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Ny,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Di.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Wi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=IF,this}get scrolledIntoView(){return(this.updated&IF)>0}}function TF(e,t){return!t||!e?e:e.bind(t)}class Wg{constructor(t,n,i){this.name=t,this.init=TF(n.init,i),this.apply=TF(n.apply,i)}}const LSe=[new Wg("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Wg("selection",{init(e,t){return e.selection||Wi.atStart(t.doc)},apply(e){return e.selection}}),new Wg("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new Wg("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class S5{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=LSe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Wg(i.key,i.spec.state,i))})}}class hh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new S5(t.schema,t.plugins),s=new hh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=Nh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Wi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function jU(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=jU(o,t,{})),n[i]=o}return n}class Tm{constructor(t){this.spec=t,this.props={},t.props&&jU(t.props,this,this.props),this.key=t.key?t.key.key:HU("plugin")}getState(t){return t[this.key]}}const _5=Object.create(null);function HU(e){return e in _5?e+"$"+ ++_5[e]:(_5[e]=0,e+"$")}class Ux{constructor(t="key"){this.key=HU(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const BA=` - - - - -`,WU=` - - - - -`,qU='',UU=` - - - -`,VU=` - - -`,KU='',ZU=` - - -`,GU=` - - -`,QU=` - - -`,NSe='',DSe='',FSe='',BSe='',RSe='',OSe={sm:14,md:16,lg:20},PSe={file:BA,folder:WU,skill:qU,copy:UU,check:VU,"external-link":KU,target:ZU,"file-edit":GU,close:QU,attachment:NSe,image:DSe,video:FSe,fullscreen:BSe,quote:RSe};function Vr(e,t="md"){const n=OSe[t];return PSe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^