25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(docs): export database documentation as standalone HTML
Fernando Possebon63498da121c8
diff --git a/.gitattributes b/.gitattributesindex 4939cbd20b..3555aba67f 100644--- a/.gitattributes+++ b/.gitattributes@@ -1,6 +1,14 @@-# Keep formatter-sensitive source files consistent across platforms.+# Keep formatter-sensitive source files consistent across platforms. The three+# apps/desktop rules below the .vue line exist for+# docs_export_bundle_is_current, which hashes raw bytes: every extension it+# manifests (.css, tsconfig.json, and the one .ts outside src/ —+# vite.docs-export.config.ts) needs an explicit eol=lf, or a CRLF checkout+# fails the guard for files the contributor never touched.apps/desktop/src/**/*.ts text eol=lfapps/desktop/src/**/*.vue text eol=lf+apps/desktop/**/*.css text eol=lf+apps/desktop/tsconfig.json text eol=lf+apps/desktop/*.ts text eol=lfsrc-tauri/windows/nsis/**/*.nsi text eol=lf# Keep tests available for review and CI without counting them as shipped code@@ -12,3 +20,13 @@ apps/desktop/src/**/*.test.ts linguist-vendoredpackages/**/tests/** linguist-vendoredpackages/**/*.spec.ts linguist-vendoredpackages/**/*.test.ts linguist-vendored++# Build output, committed because the Rust crate embeds it. Minified and large,+# so it would drown every diff and review it appears in — `-diff` makes git+# report "Binary files differ" instead. The manifest stays diffable on purpose:+# it is how a reviewer sees which sources moved. `-text` disables any+# eol conversion on checkout: docs_export_bundle_is_current hashes these two+# files' raw bytes, and an autocrlf checkout would otherwise change those+# bytes and fail the guard for a contributor who touched neither file.+crates/dbx-core/assets/docs-export.js -text -diff linguist-generated+crates/dbx-core/assets/docs-export.css -text -diff linguist-generateddiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 3b8b5c7f74..aa761698e6 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -21,6 +21,12 @@ jobs:env:# The workspace intentionally contains platform-specific CLI/MCP packages for every release target.NPM_CONFIG_LOGLEVEL: error+ # Same two-layer cache as rust-test/rust-fmt-clippy: sccache cannot+ # reuse Cargo incremental artifacts, so avoid generating them in CI.+ CARGO_INCREMENTAL: "0"+ RUSTC_WRAPPER: sccache+ # Fork PRs cannot read repository secrets, so retain the GHA backend for them.+ SCCACHE_GHA_ENABLED: ${{ secrets.SCCACHE_S3_BUCKET == '' && 'true' || 'false' }}steps:- uses: actions/checkout@v5@@ -38,9 +44,98 @@ jobs:- name: Install frontend dependenciesrun: pnpm --filter dbx... install --frozen-lockfile+ - name: Setup Rust+ uses: dtolnay/[email protected]++ - name: Setup sccache+ uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10+ with:+ version: "v0.10.0"++ - name: Configure S3 sccache+ if: env.SCCACHE_GHA_ENABLED != 'true'+ shell: bash+ env:+ CACHE_BUCKET: ${{ secrets.SCCACHE_S3_BUCKET }}+ CACHE_ENDPOINT: ${{ secrets.SCCACHE_S3_ENDPOINT }}+ CACHE_REGION: ${{ secrets.SCCACHE_S3_REGION }}+ CACHE_KEY_PREFIX: ${{ secrets.SCCACHE_S3_KEY_PREFIX }}+ CACHE_ACCESS_KEY_ID: ${{ secrets.SCCACHE_S3_ACCESS_KEY_ID }}+ CACHE_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_S3_SECRET_ACCESS_KEY }}+ run: |+ {+ echo "SCCACHE_BUCKET=${CACHE_BUCKET}"+ echo "SCCACHE_ENDPOINT=${CACHE_ENDPOINT}"+ echo "SCCACHE_REGION=${CACHE_REGION}"+ echo "SCCACHE_S3_KEY_PREFIX=${CACHE_KEY_PREFIX}"+ echo "SCCACHE_S3_USE_SSL=true"+ echo "AWS_ACCESS_KEY_ID=${CACHE_ACCESS_KEY_ID}"+ echo "AWS_SECRET_ACCESS_KEY=${CACHE_SECRET_ACCESS_KEY}"+ } >> "$GITHUB_ENV"++ - name: Rust cache+ uses: swatinem/rust-cache@v2+ with:+ workspaces: "./ -> target"+ # Own key: this job builds one crate with --no-default-features,+ # a different fingerprint than either Rust job's feature set, so+ # sharing their key would only ever miss and waste cache space.+ shared-key: ci-frontend-docs-export-smoke-x86_64-unknown-linux-gnu+ # Preserve completed dependency builds when a later step fails.+ cache-on-failure: true+ # PR caches are large and branch-scoped; restore them from main without saving per-PR copies.+ save-if: ${{ github.ref == 'refs/heads/main' }}++ # exportSmoke.spec.ts shells out to this example to build a real+ # to_standalone_html fixture. Built here, before `pnpm check`, so the+ # test's own `cargo run` (same flags — see the spec's comment) is a+ # cache hit rather than a fresh compile of dbx-core inside a vitest+ # hook. `--no-default-features`: the docs module needs none of+ # duckdb-sidecar, mq-admin, sqlite-sqlcipher or system-fonts, so this+ # avoids requiring any system dev packages this job doesn't already+ # install.+ - name: Build the docs export smoke fixture example+ run: cargo build -p dbx-core --locked --no-default-features --example docs_export_smoke++ # Guards that the committed bundle (crates/dbx-core/assets/docs-export.*)+ # matches the sources under apps/desktop/ it was built from. This job is+ # what runs on a frontend-only change, so the guard has to run here too —+ # rust-test is gated on crates/**/src-tauri/**/Cargo.*, none of which a+ # frontend-only PR touches. Same `--no-default-features` fingerprint as+ # the prebuild step above, so this is a cache hit, not a fresh compile.+ - name: Guard the committed docs export bundle+ run: cargo test -p dbx-core --locked --no-default-features --lib docs::export++ - name: Show sccache stats+ if: always()+ continue-on-error: true+ run: ${SCCACHE_PATH} --show-stats+- name: Frontend checkrun: pnpm check+ # Advisory, not a guard: the manifest guard above hashes INPUTS, so it+ # cannot see a hand-edited artefact (no source hash moves) or a+ # toolchain bump (vite, tailwindcss and @vitejs/plugin-vue are+ # plugins, not modules — they never enter the graph). Rebuilding and+ # diffing checks the relationship between inputs and output instead,+ # closing both gaps. Must run last: it overwrites the committed+ # bundle, and both the guard above and `pnpm check` above (whose+ # exportSmoke.spec.ts executes the *committed* bundle) need it+ # untouched to be testing what is actually checked in.+ - name: Rebuild the docs export bundle+ run: pnpm build:docs-export++ # continue-on-error for one cycle: every reproducibility observation+ # so far was same-platform, and this job is ubuntu-22.04 x86_64 like+ # every contributor's toolchain is lockfile-pinned to expect. If a+ # byte ever differs cross-platform, surface it in the job summary+ # rather than reddening every PR at once on a repo we contribute to,+ # not maintain.+ - name: Report any docs export bundle drift+ run: git diff --exit-code -- crates/dbx-core/assets/+ continue-on-error: true+github-scripts:needs: changesif: needs.changes.outputs.github_scripts == 'true'@@ -476,6 +571,8 @@ jobs:- 'package.json'- '.oxfmtrc.json'- 'scripts/run-check.mjs'+ - 'crates/dbx-core/src/docs/**'+ - 'crates/dbx-core/assets/docs-export.*'- '.github/workflows/ci.yml'packages:- 'packages/cli/**'diff --git a/apps/desktop/src/components/docs/DatabaseDocsDialog.vue b/apps/desktop/src/components/docs/DatabaseDocsDialog.vueindex 1ae2616975..136f20ce2c 100644--- a/apps/desktop/src/components/docs/DatabaseDocsDialog.vue+++ b/apps/desktop/src/components/docs/DatabaseDocsDialog.vue@@ -1,7 +1,7 @@<script setup lang="ts">import { computed, ref, watch } from "vue";import { useI18n } from "vue-i18n";-import { Network } from "@lucide/vue";+import { Download, Network } from "@lucide/vue";import { Button } from "@/components/ui/button";import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";import DocsApp from "@/docs/DocsApp.vue";@@ -9,9 +9,14 @@ import { emptyAnnotations, removeGroup, setColumnNote, setProjectNote, setTableGimport type { AnnotationFile, DocsEdit, SchemaSnapshot } from "@/docs/types";import type { Translate } from "@/docs/docsWarnings";import * as api from "@/lib/backend/api";+import { isTauriRuntime } from "@/lib/backend/tauriRuntime";import { useConnectionStore } from "@/stores/connectionStore";import { createAutosave } from "./docsAutosave";+// The languages `to_standalone_html` accepts. Kept in sync manually — this+// component lives outside `src/docs/` and cannot import from dbx-core.+const EXPORT_LANGUAGES = ["en", "es", "it", "ja", "ko", "pt-BR", "zh-CN", "zh-TW"];+const props = defineProps<{prefillConnectionId?: string;prefillDatabase?: string;@@ -23,7 +28,7 @@ const open = defineModel<boolean>("open", { default: false });// This component lives OUTSIDE src/docs/, so it may and must use useI18n():// it is what supplies the `translate` prop that the viewer components need,// since they are banned from importing vue-i18n themselves.-const { t } = useI18n();+const { t, locale } = useI18n();// `Translate` is one narrow signature; vue-i18n's `t` is heavily overloaded and// does not assign to it directly, so bridge it explicitly.@@ -70,6 +75,9 @@ const statusLabel = computed(() => {const canOpenDiagram = computed(() => (props.prefillConnectionId ?? "") !== "" && (props.prefillDatabase ?? "") !== "");+const exporting = ref(false);+const exportError = ref<string | null>(null);+async function load(): Promise<void> {const connectionId = props.prefillConnectionId;const database = props.prefillDatabase;@@ -153,6 +161,32 @@ function openDiagram(): void {connectionStore.diagramSource = { connectionId, database, schema: props.prefillSchema };}+async function exportHtml(): Promise<void> {+ if (!snapshot.value) return;+ exporting.value = true;+ exportError.value = null;+ try {+ let outputPath = `${snapshot.value.project.name}-docs.html`;+ if (isTauriRuntime()) {+ const { save } = await import("@tauri-apps/plugin-dialog");+ const chosen = await save({ defaultPath: outputPath, filters: [{ name: "HTML", extensions: ["html"] }] });+ if (!chosen) return; // the user cancelled; not an error+ outputPath = chosen as string;+ }+ // `to_standalone_html` rejects any language outside its fixed list; the+ // app's locale is otherwise a superset risk, so fall back rather than+ // surface that rejection to the user.+ const lang = EXPORT_LANGUAGES.includes(locale.value) ? locale.value : "en";+ await api.exportDocsHtml(outputPath, snapshot.value, annotations.value, lang);+ } catch (error) {+ // Never swallowed: a failed export that reports success is the worst+ // outcome here, exactly as with a failed autosave.+ exportError.value = t("docs.exportFailed", { error: String(error) });+ } finally {+ exporting.value = false;+ }+}+watch(open,(isOpen, wasOpen) => {@@ -179,10 +213,15 @@ watch(<span v-if="statusLabel" class="text-xs font-normal" :class="status.state === 'failed' ? 'text-destructive' : 'text-muted-foreground'">{{ statusLabel }}</span>+ <span v-if="exportError" class="text-xs font-normal text-destructive">{{ exportError }}</span><Button v-if="canOpenDiagram" variant="outline" size="sm" class="ml-auto" @click="openDiagram()"><Network class="w-4 h-4" />{{ t("docs.openDiagram") }}</Button>+ <Button v-if="snapshot" variant="outline" size="sm" :disabled="exporting" @click="exportHtml()">+ <Download class="w-4 h-4" />+ {{ exporting ? t("docs.exporting") : t("docs.exportHtml") }}+ </Button></DialogTitle></DialogHeader>diff --git a/apps/desktop/src/components/explain/__tests__/ExplainPlanNodeTree.spec.ts b/apps/desktop/src/components/explain/__tests__/ExplainPlanNodeTree.spec.tsindex 6e3b36e35a..288dc712a4 100644--- a/apps/desktop/src/components/explain/__tests__/ExplainPlanNodeTree.spec.ts+++ b/apps/desktop/src/components/explain/__tests__/ExplainPlanNodeTree.spec.ts@@ -1,8 +1,9 @@import { readFileSync } from "node:fs";import { describe, expect, it } from "vitest";+import { readCascadeCss } from "../../../styles/__tests__/cascadeCss";const nodeTreeSource = readFileSync(new URL("../ExplainPlanNodeTree.vue", import.meta.url), "utf8");-const globalStyles = readFileSync(new URL("../../../styles/globals.css", import.meta.url), "utf8");+const globalStyles = readCascadeCss();type Rgb = [number, number, number];diff --git a/apps/desktop/src/docs-export/ExportApp.vue b/apps/desktop/src/docs-export/ExportApp.vuenew file mode 100644index 0000000000..bd2fcd2ddf--- /dev/null+++ b/apps/desktop/src/docs-export/ExportApp.vue@@ -0,0 +1,97 @@+<script setup lang="ts">+import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";+import DocsApp from "@/docs/DocsApp.vue";+import { formatDocsHash, parseDocsHash } from "@/docs/docsRoute";+import type { DocsRoute } from "@/docs/docsRoute";+import { LOCALE_OPTIONS } from "@/lib/app/localeOptions";+import type { ExportPayload } from "./exportPayload";+import { createExportTranslate, EXPORT_LOCALES } from "./exportTranslate";+import type { ExportLocale } from "./exportTranslate";++const props = defineProps<{ payload: ExportPayload }>();++/**+ * The reader is not the exporter, so both controls below are theirs to change+ * and neither is persisted: under `file://` every document shares one opaque+ * origin, so `localStorage` would leak one export's preference into an+ * unrelated one.+ */+const lang = ref<ExportLocale>(props.payload.lang in EXPORT_LOCALES ? props.payload.lang : "en");+const translate = computed(() => createExportTranslate(lang.value));++// Derived from the app's own list so the endonyms cannot drift, filtered to+// what this bundle can actually render.+const languages = LOCALE_OPTIONS.filter((option) => option.value in EXPORT_LOCALES);++/**+ * Nothing applies `.dark` in a standalone file: DBX's theme system is not+ * here. `prefers-color-scheme` is the only signal the document has on load,+ * and the select overrides it from then on.+ */+const theme = ref<"light" | "dark">(typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light");++watch(+ theme,+ (value) => {+ // The same two writes the app makes (composables/useTheme.ts): the class+ // drives the tokens and the `dark:` variant, `color-scheme` drives the+ // form controls and scrollbars the page does not style itself.+ const root = document.documentElement;+ root.classList.toggle("dark", value === "dark");+ root.style.colorScheme = value;+ },+ { immediate: true },+);++// export.rs sets `<html lang>` correctly at export time, but that is a+// snapshot of the moment the file was generated — nothing here kept it in+// sync with the reader's own choice. Without this, switching languages left+// screen readers and hyphenation reading the export-time locale forever.+watch(+ lang,+ (value) => {+ document.documentElement.lang = value;+ },+ { immediate: true },+);++const route = ref<DocsRoute>(parseDocsHash(location.hash, props.payload.snapshot, true));++// The URL is the source of truth, so Back and Forward work and a link to a+// table survives being copied out of the address bar.+function readHash(): void {+ route.value = parseDocsHash(location.hash, props.payload.snapshot, true);+}++function navigate(next: DocsRoute): void {+ route.value = next;+ const hash = formatDocsHash(next);+ if (location.hash !== hash) location.hash = hash;+}++onMounted(() => window.addEventListener("hashchange", readHash));+onBeforeUnmount(() => window.removeEventListener("hashchange", readHash));+</script>++<template>+ <div class="flex h-full min-h-0 flex-col bg-background text-foreground">+ <div class="flex shrink-0 flex-wrap items-center justify-end gap-4 border-b border-border px-4 py-2">+ <label class="flex items-center gap-2 text-xs text-muted-foreground">+ {{ translate("docs.theme") }}+ <select v-model="theme" class="rounded border border-border bg-background px-2 py-1 text-xs text-foreground">+ <option value="light">{{ translate("docs.themeLight") }}</option>+ <option value="dark">{{ translate("docs.themeDark") }}</option>+ </select>+ </label>++ <label class="flex items-center gap-2 text-xs text-muted-foreground">+ {{ translate("docs.language") }}+ <select v-model="lang" class="rounded border border-border bg-background px-2 py-1 text-xs text-foreground">+ <option v-for="option in languages" :key="option.value" :value="option.value">{{ option.label }}</option>+ </select>+ </label>+ </div>++ <DocsApp class="min-h-0 flex-1" :snapshot="payload.snapshot" :annotations="payload.annotations" :readonly="true" :translate="translate" :route="route" diagram="inline" @update:route="navigate" />+ </div>+</template>diff --git a/apps/desktop/src/docs-export/__tests__/exportPayload.spec.ts b/apps/desktop/src/docs-export/__tests__/exportPayload.spec.tsnew file mode 100644index 0000000000..96d647f140--- /dev/null+++ b/apps/desktop/src/docs-export/__tests__/exportPayload.spec.ts@@ -0,0 +1,57 @@+// @vitest-environment happy-dom+import { afterEach, describe, expect, it } from "vitest";+import { readPayload } from "../exportPayload";++/** Write the document Task 6's Rust side emits: base64 of UTF-8 JSON. */+function embed(payload: unknown): void {+ document.body.innerHTML = `<div id="app"></div>`;+ const node = document.createElement("script");+ node.type = "application/dbx-snapshot";+ node.textContent = Buffer.from(JSON.stringify(payload), "utf8").toString("base64");+ document.body.appendChild(node);+}++const snapshot = { formatVersion: 1, project: { name: "顧客データベース", databaseType: "postgres" }, tables: [{ schema: "public", name: "顧客", columns: [{ name: "名前", note: "Café — naïve ★" }] }] };++afterEach(() => {+ document.body.innerHTML = "";+});++describe("readPayload", () => {+ it("round-trips non-ASCII through base64", () => {+ // The regression this exists to catch: `JSON.parse(atob(text))` mounts and+ // renders, so every test downstream of it passes — while a Japanese table+ // name arrives as mojibake in a file someone opens offline with no way to+ // report it. atob yields one byte per character; the payload is UTF-8.+ embed({ snapshot, annotations: { formatVersion: 1 }, lang: "ja" });+ const payload = readPayload();+ expect(payload.snapshot.project.name).toBe("顧客データベース");+ expect(payload.snapshot.tables[0].name).toBe("顧客");+ expect(payload.snapshot.tables[0].columns[0].note).toBe("Café — naïve ★");+ expect(payload.lang).toBe("ja");+ });++ it("carries the annotations layer through unchanged", () => {+ // Task 6 must emit this key even when empty — DocsApp reads+ // `annotations.groups` and a missing object throws before anything renders.+ embed({ snapshot, annotations: { formatVersion: 1, groups: [{ id: "a", name: "Grupo", hue: 210 }] }, lang: "pt-BR" });+ expect(readPayload().annotations.groups?.[0].name).toBe("Grupo");+ });++ it("names the missing element rather than throwing something opaque", () => {+ document.body.innerHTML = `<div id="app"></div>`;+ expect(() => readPayload()).toThrow(/application\/dbx-snapshot/);+ });++ it("throws on a payload that is not base64", () => {+ document.body.innerHTML = `<div id="app"></div><script type="application/dbx-snapshot">not base64 at all!</script>`;+ expect(() => readPayload()).toThrow();+ // The two failures must stay distinguishable: a document with no payload+ // and a document with a damaged one are different problems for whoever+ // produced the file. The decoder's own wording is not asserted — Chrome,+ // Firefox and Safari each phrase it differently — but it must not be+ // mistaken for the missing-element case. `main.spec.ts` covers what the+ // reader actually sees for both.+ expect(() => readPayload()).not.toThrow(/application\/dbx-snapshot/);+ });+});diff --git a/apps/desktop/src/docs-export/__tests__/exportSmoke.spec.ts b/apps/desktop/src/docs-export/__tests__/exportSmoke.spec.tsnew file mode 100644index 0000000000..2806674ee4--- /dev/null+++ b/apps/desktop/src/docs-export/__tests__/exportSmoke.spec.ts@@ -0,0 +1,53 @@+import { execFileSync } from "node:child_process";+import { readFileSync } from "node:fs";+import os from "node:os";+import path from "node:path";+import { beforeAll, describe, expect, it } from "vitest";++// @vitest-environment happy-dom++// Not under the workspace's `target/`: this repo's global `~/.cargo/config.toml`+// can redirect cargo's target-dir elsewhere (to dedupe build artefacts across+// worktrees), so a path assuming `<repo>/target/` is not portable. `os.tmpdir()`+// has no such dependency on cargo configuration.+const htmlPath = path.join(os.tmpdir(), "docs-export-smoke.html");++describe("the exported file", () => {+ beforeAll(() => {+ // Generated by a small Rust example so the test exercises the REAL+ // to_standalone_html output rather than a hand-built approximation.+ //+ // `--no-default-features`: the docs module doesn't touch duckdb-sidecar,+ // mq-admin, sqlite-sqlcipher or system-fonts, and matching that flag here+ // to the CI workflow's prebuild step (same cargo invocation, same+ // fingerprint) is what makes this a cache hit instead of a fresh compile+ // of dbx-core inside the hook. If this flag ever drifts from the+ // workflow's build step, the hook goes back to compiling from scratch+ // and risks the 120s timeout below.+ execFileSync("cargo", ["run", "-p", "dbx-core", "--no-default-features", "--example", "docs_export_smoke", "--", htmlPath], { stdio: "inherit" });+ // The CI workflow prebuilds this example in its own step so this hook+ // only pays for a freshness check and a run (well under a second warm,+ // measured locally). 120s covers a slow/cold worst case without making+ // an unrelated hook's timeout wait this long by raising it globally.+ }, 120_000);++ it("mounts and renders a table name", async () => {+ // The route is read from `location.hash` at mount time (ExportApp.vue),+ // so landing directly on the table page is what makes the assertion+ // below check rendered CONTENT rather than merely an element's presence:+ // the index page lists "orders" and "public" as separate text nodes+ // (a schema header, then a bare table name), never the joined string+ // "public.orders" that only the table page's heading produces.+ location.hash = "#/table/public.orders";+ document.documentElement.innerHTML = readFileSync(htmlPath, "utf8");+ for (const script of Array.from(document.querySelectorAll("script"))) {+ if (script.getAttribute("type") === null) new Function(script.textContent ?? "")();+ }+ await new Promise((resolve) => setTimeout(resolve, 100));+ const rendered = document.querySelector("#app")?.textContent ?? "";+ expect(rendered).toContain("public.orders");+ // Column data, not just the heading — proves the fixture's real+ // structure (built by the Rust example, not this test) reached the DOM.+ expect(rendered).toContain("customer_id");+ });+});diff --git a/apps/desktop/src/docs-export/__tests__/exportTranslate.spec.ts b/apps/desktop/src/docs-export/__tests__/exportTranslate.spec.tsnew file mode 100644index 0000000000..a4682f1c75--- /dev/null+++ b/apps/desktop/src/docs-export/__tests__/exportTranslate.spec.ts@@ -0,0 +1,27 @@+import { describe, expect, it } from "vitest";+import { createExportTranslate, EXPORT_LOCALES } from "../exportTranslate";++describe("createExportTranslate", () => {+ it("carries every locale the app ships", () => {+ expect(Object.keys(EXPORT_LOCALES).sort()).toEqual(["en", "es", "it", "ja", "ko", "pt-BR", "zh-CN", "zh-TW"]);+ });++ it("resolves a nested key under the docs prefix", () => {+ expect(createExportTranslate("en")("docs.columns")).toBe("Columns");+ expect(createExportTranslate("en")("docs.warnings.orphanedNotes.title")).toBe("Some notes no longer match anything");+ });++ it("substitutes placeholders", () => {+ expect(createExportTranslate("en")("docs.shadowedComment", { comment: "hi" })).toBe("Database comment: hi");+ });++ it("falls back to English for an unknown locale", () => {+ // A hand-edited payload, or a --lang that slipped through, must render+ // English rather than raw keys in a file someone opens offline.+ expect(createExportTranslate("kl" as never)("docs.columns")).toBe("Columns");+ });++ it("returns the key when nothing resolves", () => {+ expect(createExportTranslate("en")("docs.nope.missing")).toBe("docs.nope.missing");+ });+});diff --git a/apps/desktop/src/docs-export/__tests__/main.spec.ts b/apps/desktop/src/docs-export/__tests__/main.spec.tsnew file mode 100644index 0000000000..623b3d824b--- /dev/null+++ b/apps/desktop/src/docs-export/__tests__/main.spec.ts@@ -0,0 +1,40 @@+// @vitest-environment happy-dom+import { beforeEach, describe, expect, it, vi } from "vitest";++// Mounting is `main.ts`'s module-level side effect, so importing it IS the+// test. The module cache would return the first import's result for the+// second, running nothing — hence resetModules between cases.+beforeEach(() => {+ vi.resetModules();+ document.body.innerHTML = `<div id="app"></div>`;+});++describe("the export entry point", () => {+ it("says so when the document carries no payload at all", async () => {+ await import("../main");+ expect(document.querySelector("#app")?.textContent).toContain("could not be read");+ expect(document.querySelector("#app")?.textContent).toContain("application/dbx-snapshot");+ });++ it("says so when the payload is present but not decodable", async () => {+ // A truncated file, or one an editor has line-wrapped and mangled. This+ // failure arrives as a DOMException from `atob` rather than the Error+ // thrown above, so it is a genuinely different path through the catch —+ // and the reader must still get a sentence instead of a white screen.+ const node = document.createElement("script");+ node.type = "application/dbx-snapshot";+ node.textContent = "not base64 at all!";+ document.body.appendChild(node);++ await import("../main");+ const rendered = document.querySelector("#app")?.textContent ?? "";+ expect(rendered).toContain("could not be read");+ // Deliberately not asserting the decoder's own wording: Chrome, Firefox and+ // Safari each phrase the atob failure differently, and pinning one of them+ // would make this test a statement about the runtime rather than about the+ // export. What must hold is that the message is ours and is not the+ // missing-element one.+ expect(rendered).not.toContain("no <script");+ expect(rendered.length).toBeGreaterThan("This documentation file could not be read: ".length);+ });+});diff --git a/apps/desktop/src/docs-export/export.css b/apps/desktop/src/docs-export/export.cssnew file mode 100644index 0000000000..8495fa4ca8--- /dev/null+++ b/apps/desktop/src/docs-export/export.css@@ -0,0 +1,37 @@+/*+ * The standalone export's Tailwind entry point.+ *+ * `source(none)` turns OFF automatic content detection, which otherwise scans+ * the whole repository from the project root and would emit every utility in+ * DBX — the same reason this file cannot simply import globals.css. `@source`+ * is additive with no way to un-source, so the narrowing has to happen here,+ * at the import.+ */+@import "tailwindcss" source(none);+@source "../docs/**/*.vue";+@source "../docs-export/**/*.vue";++/*+ * Carries the raw `--background`/`--border` properties AND the `@theme inline`+ * block that maps them onto `--color-*`. Without that block Tailwind defines+ * every custom property and generates none of `bg-background`,+ * `border-border`, `fill-card` — a build that succeeds while emitting an+ * unstyled page.+ */+@import "../styles/tokens.css";++/*+ * The export owns its own page box. Task 6 emits the surrounding HTML from+ * Rust, so nothing outside this bundle can be relied on to size the document:+ * DocsApp is `h-full` and would collapse to zero height against an unsized+ * ancestor.+ */+html,+body,+#app {+ height: 100%;+}++/* No `@font-face` here — the Vite plugin prepends one with the font already+ * inlined as a data URI, so no rule can reference a path that fails under+ * `file://`. */diff --git a/apps/desktop/src/docs-export/exportPayload.ts b/apps/desktop/src/docs-export/exportPayload.tsnew file mode 100644index 0000000000..43dc1a7c06--- /dev/null+++ b/apps/desktop/src/docs-export/exportPayload.ts@@ -0,0 +1,37 @@+import type { AnnotationFile, SchemaSnapshot } from "@/docs/types";+import type { ExportLocale } from "./exportTranslate";++/**+ * The contract between the exporter and this bundle.+ *+ * Task 6's Rust side serialises exactly this object as JSON, encodes it UTF-8+ * then base64, and writes it as the text of+ * `<script type="application/dbx-snapshot">`. Nothing else in the emitted+ * document is read by the bundle.+ *+ * `lang` picks the starting locale only. The reader can change it — the+ * person who exported the file is rarely the person who opens it.+ */+export interface ExportPayload {+ snapshot: SchemaSnapshot;+ annotations: AnnotationFile;+ lang: ExportLocale;+}++/**+ * Read the snapshot the exporter embedded in the document.+ *+ * This lives here rather than in `main.ts` so a spec can call it: importing+ * `main.ts` mounts the application as a side effect. It is the whole of the+ * contract with Task 6's Rust side, and the only thing in the emitted document+ * the bundle reads.+ */+export function readPayload(): ExportPayload {+ const node = document.querySelector("script[type='application/dbx-snapshot']");+ if (node === null) throw new Error("no <script type='application/dbx-snapshot'> in this document");+ // `atob` yields one byte per character; the payload is UTF-8, so it must be+ // widened before decoding or every non-ASCII table name and note is mangled.+ const binary = atob((node.textContent ?? "").trim());+ const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));+ return JSON.parse(new TextDecoder().decode(bytes)) as ExportPayload;+}diff --git a/apps/desktop/src/docs-export/exportTranslate.ts b/apps/desktop/src/docs-export/exportTranslate.tsnew file mode 100644index 0000000000..d99e6d6535--- /dev/null+++ b/apps/desktop/src/docs-export/exportTranslate.ts@@ -0,0 +1,41 @@+import en from "@/i18n/locales/docs/en";+import es from "@/i18n/locales/docs/es";+import it from "@/i18n/locales/docs/it";+import ja from "@/i18n/locales/docs/ja";+import ko from "@/i18n/locales/docs/ko";+import ptBR from "@/i18n/locales/docs/pt-BR";+import zhCN from "@/i18n/locales/docs/zh-CN";+import zhTW from "@/i18n/locales/docs/zh-TW";+import type { Translate } from "@/docs/docsWarnings";++export const EXPORT_LOCALES = { en, es, it, ja, ko, "pt-BR": ptBR, "zh-CN": zhCN, "zh-TW": zhTW } as const;++export type ExportLocale = keyof typeof EXPORT_LOCALES;++function lookup(source: unknown, key: string): string | null {+ const value = key.split(".").reduce<unknown>((node, part) => (node && typeof node === "object" ? (node as Record<string, unknown>)[part] : undefined), source);+ return typeof value === "string" ? value : null;+}++/**+ * Build a `Translate` over a bundled namespace.+ *+ * English is the fallback rather than the raw key. The parity test guarantees+ * all 8 namespaces agree, so this should never fire — it exists so an+ * artefact opened offline degrades to English instead of showing+ * `docs.columns` to a reader. This is not the Part 3b hazard where a fallback+ * masked drift: there the fallback replaced the guard, here the guard runs in+ * CI and this is only a runtime backstop.+ */+export function createExportTranslate(lang: ExportLocale): Translate {+ const primary = EXPORT_LOCALES[lang] ?? EXPORT_LOCALES.en;+ return (key, params) => {+ // Keys arrive prefixed with `docs.` because that is how the namespace is+ // mounted in the app; the bundled modules are the namespace itself.+ const bare = key.startsWith("docs.") ? key.slice("docs.".length) : key;+ const template = lookup(primary, bare) ?? lookup(EXPORT_LOCALES.en, bare);+ if (template === null) return key;+ if (!params) return template;+ return template.replace(/\{(\w+)\}/g, (match, name: string) => (name in params ? String(params[name]) : match));+ };+}diff --git a/apps/desktop/src/docs-export/main.ts b/apps/desktop/src/docs-export/main.tsnew file mode 100644index 0000000000..682852a4b4--- /dev/null+++ b/apps/desktop/src/docs-export/main.ts@@ -0,0 +1,16 @@+import { createApp } from "vue";+import ExportApp from "./ExportApp.vue";+import { readPayload } from "./exportPayload";+import "./export.css";++try {+ createApp(ExportApp, { payload: readPayload() }).mount("#app");+} catch (error) {+ // A blank page would be the reader's only clue that the file is damaged.+ // English is not a choice here: `lang` lives inside the payload that just+ // failed to parse, so there is no locale to translate into.+ const message = document.createElement("p");+ message.style.cssText = "margin:2rem;font-family:system-ui,sans-serif";+ message.textContent = `This documentation file could not be read: ${error instanceof Error ? error.message : String(error)}`;+ document.querySelector("#app")?.replaceChildren(message);+}diff --git a/apps/desktop/src/docs/DocsApp.vue b/apps/desktop/src/docs/DocsApp.vueindex 52b5f4ef29..c2c8c5debe 100644--- a/apps/desktop/src/docs/DocsApp.vue+++ b/apps/desktop/src/docs/DocsApp.vue@@ -5,30 +5,44 @@ import DocsSidebar from "./components/DocsSidebar.vue";import EnumPage from "./components/EnumPage.vue";import GroupEditor from "./components/GroupEditor.vue";import NoteEditor from "./components/NoteEditor.vue";+import SchemaDiagram from "./components/SchemaDiagram.vue";import TablePage from "./components/TablePage.vue";import WarningBanner from "./components/WarningBanner.vue";import WikiIndex from "./components/WikiIndex.vue";import "./docs.css";import type { Translate } from "./docsWarnings";import { qualifiedTableKey } from "./docsKeys";+import type { DocsRoute } from "./docsRoute";import { groupBySchema, groupByTableGroup } from "./docsIndex";import type { AnnotationFile, DocsEdit, GroupAnnotation, SchemaSnapshot } from "./types";-const props = defineProps<{- snapshot: SchemaSnapshot;- /**- * The local notes layer. `snapshot` already carries notes merged for display,- * so this is here for what the merge erases: `groups` holds the editable- * `GroupAnnotation` records, while `snapshot.groups` holds resolved- * `TableGroup`s that GroupEditor and GroupPicker cannot write back to.- */- annotations: AnnotationFile;- readonly?: boolean;- translate: Translate;-}>();+const props = withDefaults(+ defineProps<{+ snapshot: SchemaSnapshot;+ /**+ * The local notes layer. `snapshot` already carries notes merged for display,+ * so this is here for what the merge erases: `groups` holds the editable+ * `GroupAnnotation` records, while `snapshot.groups` holds resolved+ * `TableGroup`s that GroupEditor and GroupPicker cannot write back to.+ */+ annotations: AnnotationFile;+ readonly?: boolean;+ translate: Translate;+ /**+ * When provided, navigation is controlled by the host and mirrored back+ * through `update:route`. Absent — the dialog's case — DocsApp owns its+ * own navigation exactly as before and never touches the URL.+ */+ route?: DocsRoute;+ /** `inline` renders SchemaDiagram; `external` leaves the host to offer its own. */+ diagram?: "inline" | "external";+ }>(),+ { diagram: "external" },+);const emit = defineEmits<{edit: [edit: DocsEdit];+ "update:route": [route: DocsRoute];}>();/** `readonly` is the one optional prop; absent means editing is allowed. */@@ -39,8 +53,26 @@ const annotationGroups = computed<GroupAnnotation[]>(() => props.annotations.gro// Grouping is computed once here and handed to both the sidebar and the index,// so the two can never disagree about what the sections are.const mode = ref<"schema" | "group">(props.snapshot.groups.length > 0 ? "group" : "schema");-const activeKey = ref<string | null>(null);-const activeEnumName = ref<string | null>(null);++// Owned only when `route` is absent — see the prop doc above. `effectiveRoute`+// prefers `props.route`, so once the host controls navigation, a click here+// still updates these (harmless) but the DISPLAYED view tracks the prop, not+// this state. That is what keeps the two from disagreeing if the host+// declines to apply an `update:route`.+const internalKey = ref<string | null>(null);+const internalEnumName = ref<string | null>(null);+const internalDiagram = ref(false);++const effectiveRoute = computed<DocsRoute>(() => {+ if (props.route) return props.route;+ if (internalDiagram.value) return { kind: "diagram" };+ if (internalEnumName.value !== null) return { kind: "enum", name: internalEnumName.value };+ if (internalKey.value !== null) return { kind: "table", key: internalKey.value };+ return { kind: "index" };+});++const activeKey = computed(() => (effectiveRoute.value.kind === "table" ? effectiveRoute.value.key : null));+const activeEnumName = computed(() => (effectiveRoute.value.kind === "enum" ? effectiveRoute.value.name : null));const sections = computed(() => (mode.value === "schema" ? groupBySchema(props.snapshot) : groupByTableGroup(props.snapshot)));@@ -53,7 +85,10 @@ const activeTable = computed(() => props.snapshot.tables.find((table) => qualifi*/const activeEnum = computed(() => (activeEnumName.value === null ? null : (props.snapshot.enums.find((value) => value.name === activeEnumName.value) ?? null)));-const view = computed<"index" | "table" | "enum">(() => {+const view = computed<"index" | "table" | "enum" | "diagram">(() => {+ if (effectiveRoute.value.kind === "diagram") {+ return "diagram";+ }if (activeEnum.value !== null) {return "enum";}@@ -72,21 +107,34 @@ function open(key: string): void {// A key naming no table leaves the reader where they are rather than// dropping them on a blank page.if (props.snapshot.tables.some((table) => qualifiedTableKey(table) === key)) {- activeEnumName.value = null;- activeKey.value = key;+ internalEnumName.value = null;+ internalDiagram.value = false;+ internalKey.value = key;+ emit("update:route", { kind: "table", key });}}function openEnum(name: string): void {if (props.snapshot.enums.some((value) => value.name === name)) {- activeKey.value = null;- activeEnumName.value = name;+ internalKey.value = null;+ internalDiagram.value = false;+ internalEnumName.value = name;+ emit("update:route", { kind: "enum", name });}}+function openDiagram(): void {+ internalKey.value = null;+ internalEnumName.value = null;+ internalDiagram.value = true;+ emit("update:route", { kind: "diagram" });+}+function home(): void {- activeKey.value = null;- activeEnumName.value = null;+ internalKey.value = null;+ internalEnumName.value = null;+ internalDiagram.value = false;+ emit("update:route", { kind: "index" });}/**@@ -109,7 +157,18 @@ function createGroupFor(tableKey: string): void {<template><div class="flex h-full min-h-0 bg-background text-foreground">- <DocsSidebar :sections="sections" :mode="mode" :active-key="activeKey" @update:mode="mode = $event" @select="open" @home="home()" />+ <div class="flex h-full min-h-0 w-64 shrink-0 flex-col">+ <DocsSidebar class="min-h-0 flex-1" :sections="sections" :mode="mode" :active-key="activeKey" :translate="translate" @update:mode="mode = $event" @select="open" @home="home()" />+ <button+ v-if="diagram === 'inline'"+ type="button"+ class="shrink-0 border-t border-r border-border bg-background px-3 py-2 text-left text-xs font-medium transition-colors"+ :class="view === 'diagram' ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-muted/40'"+ @click="openDiagram()"+ >+ {{ translate("docs.diagram") }}+ </button>+ </div><main class="flex min-w-0 flex-1 flex-col gap-4 overflow-y-auto p-4"><header class="flex flex-wrap items-start justify-between gap-3">@@ -119,17 +178,17 @@ function createGroupFor(tableKey: string): void {{{ snapshot.project.databaseType }}<template v-if="snapshot.project.database"> · {{ snapshot.project.database }}</template> · {{ snapshot.tables.length }} tables · generated {{ snapshot.project.generatedAt }}</p></div>- <DocsSearch :snapshot="snapshot" @select="open" @select-enum="openEnum" />+ <DocsSearch :snapshot="snapshot" :translate="translate" @select="open" @select-enum="openEnum" /></header><WarningBanner :warnings="snapshot.warnings" :translate="translate" /><div v-if="view === 'index'" class="flex flex-col gap-4"><NoteEditor :model-value="snapshot.project.note ?? ''" :readonly="isReadonly" :translate="translate" @update:model-value="emit('edit', { kind: 'projectNote', note: $event })" />- <WikiIndex :sections="sections" @select="open" />+ <WikiIndex :sections="sections" :translate="translate" @select="open" /><section v-if="!isReadonly && annotationGroups.length > 0" class="flex flex-col gap-2">- <h2 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Groups</h2>+ <h2 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">{{ translate("docs.groups") }}</h2><GroupEditor v-for="group in annotationGroups" :key="group.id" :group="group" :translate="translate" @update:group="emit('edit', { kind: 'upsertGroup', group: $event })" @delete="emit('edit', { kind: 'removeGroup', groupId: $event })" /></section></div>@@ -148,6 +207,8 @@ function createGroupFor(tableKey: string): void {/><EnumPage v-else-if="activeEnum" :enum-type="activeEnum" :snapshot="snapshot" :translate="translate" @select="open" />++ <SchemaDiagram v-else-if="view === 'diagram'" :snapshot="snapshot" @select="open" /></main></div></template>diff --git a/apps/desktop/src/docs/__tests__/componentContract.spec.ts b/apps/desktop/src/docs/__tests__/componentContract.spec.tsindex b9077eb4c8..9500663183 100644--- a/apps/desktop/src/docs/__tests__/componentContract.spec.ts+++ b/apps/desktop/src/docs/__tests__/componentContract.spec.ts@@ -2,17 +2,18 @@ import { readdirSync, readFileSync } from "node:fs";import path from "node:path";import { describe, expect, it } from "vitest";import { parse } from "vue/compiler-sfc";+import ts from "typescript";const docsRoot = path.resolve(__dirname, "..");-function vueFiles(): string[] {+function filesWithExtension(extension: string): string[] {const found: string[] = [];const walk = (dir: string) => {for (const entry of readdirSync(dir, { withFileTypes: true })) {const full = path.join(dir, entry.name);if (entry.isDirectory() && entry.name !== "__tests__" && entry.name !== "fixtures") {walk(full);- } else if (entry.isFile() && entry.name.endsWith(".vue")) {+ } else if (entry.isFile() && entry.name.endsWith(extension)) {found.push(full);}}@@ -21,12 +22,122 @@ function vueFiles(): string[] {return found;}+function vueFiles(): string[] {+ return filesWithExtension(".vue");+}++// Every pure module beside the components — docsIndex.ts, docsSearch.ts,+// docsWarnings.ts, and so on. "(no group)" lived in one of these+// (docsIndex.ts) and was invisible to the guard below until this existed:+// that guard only ever walked .vue files, so a literal that never touches a+// template — only a data field a template later reads — was outside its+// reach entirely.+function tsFiles(): string[] {+ return filesWithExtension(".ts");+}++/**+ * Every namespace-key VALUE currently spelled out in en.ts, long enough and+ * plain enough to check for. Shared by both the .vue and .ts scans below so+ * there is exactly one definition of "what counts as a hardcoded literal" —+ * not two lists that can drift out of step with each other.+ */+async function namespaceLiterals(): Promise<string[]> {+ const en = (await import("../../i18n/locales/docs/en")).default as Record<string, unknown>;+ const literals: string[] = [];+ const walk = (node: unknown) => {+ if (typeof node === "string") {+ // Skip short strings (false positives on words like "LOCAL") and any+ // string carrying a placeholder, which cannot appear verbatim anyway.+ if (node.length >= 4 && !node.includes("{")) literals.push(node);+ return;+ }+ if (node && typeof node === "object") Object.values(node).forEach(walk);+ };+ walk(en);+ return literals;+}+function scriptOf(file: string): string {const { descriptor } = parse(readFileSync(file, "utf8"), { filename: file });return `${descriptor.script?.content ?? ""}\n${descriptor.scriptSetup?.content ?? ""}`;}-const EXPECTED = ["ColumnTable.vue", "DocsApp.vue", "DocsSearch.vue", "DocsSidebar.vue", "EnumPage.vue", "GroupEditor.vue", "GroupPicker.vue", "NoteEditor.vue", "RelationshipList.vue", "TablePage.vue", "WarningBanner.vue", "WikiIndex.vue"];+/**+ * Splits a component's template into the two channels that can actually+ * reach the reader as text: static text between tags, and the JS+ * expressions inside `{{ }}` interpolations. Attribute values (`:class="…"`,+ * `:title="…"`) are deliberately excluded — see the guard below for why.+ *+ * The two channels get different treatment below: `staticText` is scanned+ * with plain substring matching, because it can't contain anything but+ * literal characters. `interpolations` holds JS, where a bare identifier+ * (`table.viewDefinition`, `snapshot.project.databaseType`) can innocently+ * contain a locale word as a substring — only a *quoted* occurrence+ * (`"literal"` or `'literal'`) inside an expression counts as hardcoded copy.+ */+function domTextOf(file: string): { staticText: string; interpolations: string[] } {+ const { descriptor } = parse(readFileSync(file, "utf8"), { filename: file });+ const template = descriptor.template?.content ?? "";+ // Comments are prose, not display text, and can otherwise trip a+ // substring match by coincidence (a comment mentioning "the note" would+ // false-positive on the `noteHeader` key).+ const withoutComments = template.replace(/<!--[\s\S]*?-->/g, "");++ const interpolations: string[] = [];+ const withoutInterpolations = withoutComments.replace(/{{([\s\S]*?)}}/g, (_match, expr) => {+ interpolations.push(expr);+ return "";+ });++ // Whatever sits between a tag's closing `>` and the next `<` is DOM text;+ // whatever sits before that `>`, inside the tag itself, is an attribute+ // and mostly doesn't render as visible text — so this intentionally+ // doesn't look there on purpose. "Mostly" because the split is a regex,+ // not a parser: an attribute value containing a bare `>` (a comparison+ // like `v-if="count > 0"`) ends the match early and leaks the tail of+ // that attribute into a segment. That leak runs in the safe direction —+ // it can only add text to scan, never drop real display text — so the+ // risk is a false positive below, never a missed literal.+ const segments: string[] = [];+ for (const match of withoutInterpolations.matchAll(/>([^<]*)</g)) {+ segments.push(match[1]);+ }+ return { staticText: segments.join(" "), interpolations };+}++/**+ * Every string literal in a .ts file that could become a runtime VALUE —+ * and, from there, reach a template as display text, exactly how+ * docsIndex.ts's `label: "(no group)"` did. Excludes string literals in TYPE+ * position, e.g. `type NoteSource = "DATABASE" | "LOCAL" | "NONE"`: those+ * disappear at compile time and can never be displayed, so flagging them+ * would be the .ts equivalent of the `=== 'LOCAL'` false positive from the+ * last round. `ts.isLiteralTypeNode` is TypeScript's own distinction+ * between the two, not a hand-picked exception — the same check the+ * compiler itself uses to know it is looking at a type, not a value.+ *+ * Unlike domTextOf's split of display-vs-comparison text, this collects+ * every value-position literal with no such distinction — a literal used+ * only in a comparison (`type === "LOCAL"`) is indistinguishable here from+ * one that reaches a template as display text. Accepted as this scan's+ * blind spot rather than chased, for the same reason: the risk is a false+ * positive, not a missed literal.+ */+function valueStringLiteralsOf(file: string): string[] {+ const source = ts.createSourceFile(file, readFileSync(file, "utf8"), ts.ScriptTarget.Latest, true);+ const literals: string[] = [];+ const visit = (node: ts.Node): void => {+ if (ts.isStringLiteral(node) && !ts.isLiteralTypeNode(node.parent)) {+ literals.push(node.text);+ }+ ts.forEachChild(node, visit);+ };+ visit(source);+ return literals;+}++const EXPECTED = ["ColumnTable.vue", "DocsApp.vue", "DocsSearch.vue", "DocsSidebar.vue", "EnumPage.vue", "GroupEditor.vue", "GroupPicker.vue", "NoteEditor.vue", "RelationshipList.vue", "SchemaDiagram.vue", "TablePage.vue", "WarningBanner.vue", "WikiIndex.vue"];describe("docs viewer component contract", () => {it("finds every expected component", () => {@@ -154,4 +265,65 @@ describe("docs viewer component contract", () => {expect(block, `${selector} must define --group-tint without oklch`).toContain("--group-tint: hsl(");}});++ it("renders no English literal that already has a key", async () => {+ // Derived from the namespace, NOT an enumerated list of strings. A key+ // added tomorrow is covered tomorrow. This is the guard Part 3b lacked:+ // docsNamespaceParity compares locale files to EACH OTHER, so a key that+ // no component ever calls passes every existing test.+ const literals = await namespaceLiterals();+ expect(literals.length).toBeGreaterThan(10);++ const files = vueFiles();+ expect(files.length).toBe(EXPECTED.length);+ for (const file of files) {+ // Deliberately scoped to what reaches the DOM as text — see domTextOf+ // — rather than the whole file. Two earlier, narrower shapes of this+ // same guard both ran green over a real defect: matching only+ // `>literal<` misses a literal buried in a JS fallback+ // (`section.label || "(no schema)"`, DocsSidebar.vue/WikiIndex.vue);+ // matching any quoted occurrence anywhere in the template misses+ // nothing display-related but flags plenty that isn't — a bare+ // identifier like `table.viewDefinition` or+ // `snapshot.project.databaseType` shares a substring with a locale+ // word purely by accident, and an attribute-only comparison like+ // `noteOf(column)?.source === 'LOCAL'` tests data, not copy.+ const { staticText, interpolations } = domTextOf(file);+ for (const literal of literals) {+ // Static text, e.g. `>Overview<` or `>⬤ LOCAL<` — anything literally+ // written between tags is definitionally display text, so a plain+ // substring match is safe here.+ expect(staticText.includes(literal), `${path.basename(file)} hardcodes "${literal}" — call translate() instead`).toBe(false);+ // A JS expression inside a `{{ }}` mustache, e.g.+ // `section.label || "(no schema)"`. Only a *quoted* occurrence+ // counts — an unquoted one is a property/variable name, not copy.+ expect(+ interpolations.some((expr) => expr.includes(`"${literal}"`) || expr.includes(`'${literal}'`)),+ `${path.basename(file)} hardcodes "${literal}" in a template expression — call translate() instead`,+ ).toBe(false);+ }+ }+ // Known gap, accepted rather than chased: a literal passed to an+ // attribute binding — `:title="'Hardcoded text'"` — can still reach the+ // reader (as a tooltip, an aria-label, …) and this guard does not see+ // it, because attribute values are excluded by design to avoid the+ // data-comparison false positives above. If a future defect turns out+ // to live in an attribute, that's this guard's known blind spot, not a+ // regression in it.++ // The pure modules beside the components — docsIndex.ts's+ // `label: "(no group)"` was exactly this: a literal that never touches a+ // template directly, only a data field a template reads later. A .vue-only+ // scan is structurally blind to it no matter how the .vue scan itself is+ // shaped, so this is a second, independent walk over a different file+ // extension rather than a wider regex over the same one.+ const tsSourceFiles = tsFiles();+ expect(tsSourceFiles.length).toBeGreaterThan(0);+ for (const file of tsSourceFiles) {+ const valueLiterals = valueStringLiteralsOf(file);+ for (const literal of literals) {+ expect(valueLiterals.includes(literal), `${path.basename(file)} hardcodes "${literal}" — call translate() instead`).toBe(false);+ }+ }+ });});diff --git a/apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts b/apps/desktop/src/docs/__tests__/diagramGeometry.spec.tsnew file mode 100644index 0000000000..259bbe5b0b--- /dev/null+++ b/apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts@@ -0,0 +1,35 @@+import { describe, expect, it } from "vitest";+import { clipToCard } from "../diagramGeometry";++describe("clipToCard", () => {+ const half = { width: 100, height: 50 };++ it("exits through the vertical edge for a horizontal run", () => {+ // Centre (0,0) to (500,0): the line leaves through the right edge at+ // x = +100, not through the top or bottom.+ expect(clipToCard({ x: 0, y: 0 }, { x: 500, y: 0 }, half)).toEqual({ x: 100, y: 0 });+ });++ it("exits through the horizontal edge for a vertical run", () => {+ expect(clipToCard({ x: 0, y: 0 }, { x: 0, y: 500 }, half)).toEqual({ x: 0, y: 50 });+ });++ it("picks the nearer edge on a diagonal", () => {+ // Slope 1 against a 2:1 card: the vertical edge is reached first, so the+ // result sits ON x = 100 with |y| < 50. Clipping to the wrong axis puts+ // the endpoint outside the card and the line visibly overshoots.+ const point = clipToCard({ x: 0, y: 0 }, { x: 500, y: 500 }, half);+ expect(point.x).toBeCloseTo(50);+ expect(point.y).toBeCloseTo(50);+ });++ it("returns the centre when both points coincide", () => {+ // Two tables laid out at the same position would otherwise divide by zero+ // and emit NaN into the SVG path, which renders nothing at all.+ expect(clipToCard({ x: 7, y: 7 }, { x: 7, y: 7 }, half)).toEqual({ x: 7, y: 7 });+ });++ it("handles negative directions symmetrically", () => {+ expect(clipToCard({ x: 0, y: 0 }, { x: -500, y: 0 }, half)).toEqual({ x: -100, y: 0 });+ });+});diff --git a/apps/desktop/src/docs/__tests__/docsIndex.spec.ts b/apps/desktop/src/docs/__tests__/docsIndex.spec.tsindex 1195758bd9..d721321828 100644--- a/apps/desktop/src/docs/__tests__/docsIndex.spec.ts+++ b/apps/desktop/src/docs/__tests__/docsIndex.spec.ts@@ -45,6 +45,14 @@ describe("groupBySchema", () => {expect(sections).toHaveLength(1);expect(sections[0].tables[0].name).toBe("orders");});++ it("tags every section with the schema fallback key", () => {+ // The render sites fall back to `translate(section.fallbackKey)` when+ // `label` is empty — schema sections must carry docs.noSchema, not the+ // sibling docs.noGroup key groupByTableGroup uses.+ const sections = groupBySchema(snapshot([table("public", "orders")]));+ expect(sections[0].fallbackKey).toBe("docs.noSchema");+ });});describe("groupByTableGroup", () => {@@ -62,11 +70,18 @@ describe("groupByTableGroup", () => {expect(sections[0].note).toBe("Checkout.");});- it("collects ungrouped tables into a trailing (no group) section", () => {+ it("collects ungrouped tables into a trailing, unlabelled section", () => {const sections = groupByTableGroup(snapshot([table("core", "orders", "order-mgmt"), table("core", "users", null)], groups));const last = sections[sections.length - 1];expect(last.key).toBe("");+ // Empty, not a hardcoded "(no group)": the render sites translate this via+ // `translate(section.fallbackKey)` when `label` is falsy. A non-empty+ // English literal here would bypass that fallback and render untranslated+ // in every non-English locale — this guarded a real defect, not a+ // hypothetical one.+ expect(last.label).toBe("");+ expect(last.fallbackKey).toBe("docs.noGroup");expect(last.hue).toBeNull();expect(last.tables.map((t) => t.name)).toEqual(["users"]);});diff --git a/apps/desktop/src/docs/__tests__/docsRoute.spec.ts b/apps/desktop/src/docs/__tests__/docsRoute.spec.tsnew file mode 100644index 0000000000..e455540a94--- /dev/null+++ b/apps/desktop/src/docs/__tests__/docsRoute.spec.ts@@ -0,0 +1,64 @@+import { describe, expect, it } from "vitest";+import { formatDocsHash, parseDocsHash } from "../docsRoute";+import type { SchemaSnapshot } from "../types";++// `formatVersion` is top-level on SchemaSnapshot, not inside `project`.+const snapshot = {+ formatVersion: 1,+ project: { name: "shop", databaseType: "postgres", database: "shop", schemas: ["public"], generatedAt: "2026-08-06T00:00:00Z", note: null },+ tables: [+ { schema: "public", name: "orders", columns: [], indexes: [] },+ { schema: null, name: "a/b", columns: [], indexes: [] },+ ],+ enums: [{ schema: "public", name: "order_status", values: ["pending"] }],+ relationships: [],+ groups: [],+ warnings: [],+} as unknown as SchemaSnapshot;++describe("parseDocsHash", () => {+ it("reads a table route", () => {+ expect(parseDocsHash("#/table/public.orders", snapshot, true)).toEqual({ kind: "table", key: "public.orders" });+ });++ it("decodes an identifier containing a slash", () => {+ // A table named `a/b` must survive the round trip; an undecoded hash+ // would split into a bogus segment and silently fall back to the index.+ expect(parseDocsHash("#/table/a%2Fb", snapshot, true)).toEqual({ kind: "table", key: "a/b" });+ });++ it("reads an enum route", () => {+ expect(parseDocsHash("#/enum/order_status", snapshot, true)).toEqual({ kind: "enum", name: "order_status" });+ });++ it("falls back to the index for a table that is not in the snapshot", () => {+ // A deep link into a since-dropped table is the EXPECTED case for a file+ // someone saved months ago. It must never render a blank page.+ expect(parseDocsHash("#/table/public.gone", snapshot, true)).toEqual({ kind: "index" });+ });++ it("falls back to the index for junk, empty and bare hashes", () => {+ for (const hash of ["", "#", "#/", "#/nonsense", "#/table", "#/table/", "not-a-hash"]) {+ expect(parseDocsHash(hash, snapshot, true), hash).toEqual({ kind: "index" });+ }+ });++ it("refuses the diagram route when the host has not enabled it", () => {+ // The dialog passes diagram="external" and keeps its button to the full+ // SchemaDiagramDialog. A hash must not render a view that host declined.+ expect(parseDocsHash("#/diagram", snapshot, false)).toEqual({ kind: "index" });+ expect(parseDocsHash("#/diagram", snapshot, true)).toEqual({ kind: "diagram" });+ });+});++describe("formatDocsHash", () => {+ it("round-trips every route kind", () => {+ for (const route of [{ kind: "index" }, { kind: "table", key: "public.orders" }, { kind: "enum", name: "order_status" }, { kind: "diagram" }] as const) {+ expect(parseDocsHash(formatDocsHash(route), snapshot, true)).toEqual(route);+ }+ });++ it("encodes a slash in an identifier", () => {+ expect(formatDocsHash({ kind: "table", key: "a/b" })).toBe("#/table/a%2Fb");+ });+});diff --git a/apps/desktop/src/docs/__tests__/tokens.spec.ts b/apps/desktop/src/docs/__tests__/tokens.spec.tsnew file mode 100644index 0000000000..fd03ec58f1--- /dev/null+++ b/apps/desktop/src/docs/__tests__/tokens.spec.ts@@ -0,0 +1,42 @@+import { readFileSync } from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";++const stylesDir = path.resolve(__dirname, "../../styles");++/** Every `--name:` custom property declared in a stylesheet. */+function declaredTokens(file: string): Set<string> {+ const source = readFileSync(path.join(stylesDir, file), "utf8");+ return new Set(Array.from(source.matchAll(/^\s*(--[a-z0-9-]+)\s*:/gm), (match) => match[1]));+}++describe("design tokens", () => {+ it("defines the tokens the docs viewer resolves against", () => {+ // These are the utilities used in src/docs/**: bg-background,+ // text-foreground, text-muted-foreground, bg-muted, border-border,+ // focus:border-ring. If a token stops being declared here the export+ // renders unstyled while the app, which has globals.css, looks fine —+ // so this must be checked against tokens.css, not globals.css.+ const tokens = declaredTokens("tokens.css");+ for (const token of ["--background", "--foreground", "--muted", "--muted-foreground", "--border", "--ring"]) {+ expect(tokens.has(token), `tokens.css must declare ${token}`).toBe(true);+ }+ });++ it("keeps globals.css importing the extracted tokens", () => {+ const globals = readFileSync(path.join(stylesDir, "globals.css"), "utf8");+ expect(globals.includes('@import "./tokens.css"')).toBe(true);+ });++ it("declares the dark overrides after the light ones", () => {+ // Custom properties resolve at use time, but override order still+ // decides which block wins. A tokens.css with .dark BEFORE :root leaves+ // dark mode rendering light values.+ const source = readFileSync(path.join(stylesDir, "tokens.css"), "utf8");+ const root = source.search(/^:root\s*\{/m);+ const dark = source.search(/^\.dark\s*\{/m);+ expect(root, "tokens.css must declare :root").toBeGreaterThan(-1);+ expect(dark, "tokens.css must declare .dark").toBeGreaterThan(-1);+ expect(dark).toBeGreaterThan(root);+ });+});diff --git a/apps/desktop/src/docs/components/ColumnTable.vue b/apps/desktop/src/docs/components/ColumnTable.vueindex 86b05ca6f5..317240b3e9 100644--- a/apps/desktop/src/docs/components/ColumnTable.vue+++ b/apps/desktop/src/docs/components/ColumnTable.vue@@ -68,10 +68,10 @@ function shadowedTitle(column: ColumnInfo): string | undefined {<table class="w-full text-xs"><thead><tr class="bg-muted/30">- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Column</th>- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Type</th>- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Settings</th>- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Note</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.columnHeader") }}</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.typeHeader") }}</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.settingsHeader") }}</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.noteHeader") }}</th></tr></thead><tbody>@@ -87,7 +87,7 @@ function shadowedTitle(column: ColumnInfo): string | undefined {</td><td class="px-2 py-1.5 text-muted-foreground"><div class="flex items-start gap-1">- <span v-if="noteOf(column)?.source === 'LOCAL'" class="mt-0.5 shrink-0 text-[10px] font-medium" :title="shadowedTitle(column)">⬤ LOCAL</span>+ <span v-if="noteOf(column)?.source === 'LOCAL'" class="mt-0.5 shrink-0 text-[10px] font-medium" :title="shadowedTitle(column)">⬤ {{ translate("docs.localNote") }}</span><!-- Merged note, for the same reason as TablePage: NoteEditorrenders and edits one value, and the local layer alone wouldhide notes that came from the database. -->diff --git a/apps/desktop/src/docs/components/DocsSearch.vue b/apps/desktop/src/docs/components/DocsSearch.vueindex 9cc5277998..55101da755 100644--- a/apps/desktop/src/docs/components/DocsSearch.vue+++ b/apps/desktop/src/docs/components/DocsSearch.vue@@ -1,10 +1,12 @@<script setup lang="ts">import { computed, nextTick, onBeforeUnmount, onMounted, ref } from "vue";import { searchDocs, type SearchHit } from "../docsSearch";+import type { Translate } from "../docsWarnings";import type { SchemaSnapshot } from "../types";const props = defineProps<{snapshot: SchemaSnapshot;+ translate: Translate;}>();const emit = defineEmits<{@@ -71,13 +73,13 @@ onBeforeUnmount(() => window.removeEventListener("keydown", onKeydown));<template><div><button type="button" class="flex items-center gap-2 rounded border border-border bg-background px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/40" @click="show()">- <span>Search</span>+ <span>{{ translate("docs.searchLabel") }}</span><span class="rounded bg-muted/50 px-1 py-0.5 text-[10px]">⌘K</span></button><div v-if="open" class="fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-24" @click.self="open = false"><div class="w-full max-w-lg overflow-hidden rounded-md border border-border bg-background shadow-lg">- <input ref="input" v-model="query" type="text" placeholder="Search tables, columns, groups, enums…" class="w-full border-b border-border bg-transparent px-3 py-2 text-sm text-foreground outline-none" />+ <input ref="input" v-model="query" type="text" :placeholder="translate('docs.search')" class="w-full border-b border-border bg-transparent px-3 py-2 text-sm text-foreground outline-none" /><ul class="max-h-80 overflow-y-auto"><li v-if="query.trim() !== '' && hits.length === 0" class="px-3 py-4 text-center text-xs text-muted-foreground">Nothing matches “{{ query }}”.</li><li v-for="(hit, position) in hits" :key="`${hit.kind}-${hit.context}-${hit.label}-${position}`">diff --git a/apps/desktop/src/docs/components/DocsSidebar.vue b/apps/desktop/src/docs/components/DocsSidebar.vueindex d3bbc7dea3..a2358e80bf 100644--- a/apps/desktop/src/docs/components/DocsSidebar.vue+++ b/apps/desktop/src/docs/components/DocsSidebar.vue@@ -2,12 +2,14 @@import type { IndexSection } from "../docsIndex";import { qualifiedTableKey } from "../docsKeys";import { groupStyle } from "../groupColor";+import type { Translate } from "../docsWarnings";defineProps<{sections: IndexSection[];mode: "schema" | "group";/** Qualified name of the table currently open, or null on the index. */activeKey: string | null;+ translate: Translate;}>();const emit = defineEmits<{@@ -19,13 +21,13 @@ const emit = defineEmits<{<template><nav class="flex w-64 shrink-0 flex-col gap-3 overflow-y-auto border-r border-border bg-background p-3">- <button type="button" class="rounded px-2 py-1 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/40" @click="emit('home')">Overview</button>+ <button type="button" class="rounded px-2 py-1 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/40" @click="emit('home')">{{ translate("docs.overview") }}</button><div class="flex flex-col gap-1">- <span class="px-2 text-[10px] uppercase tracking-wide text-muted-foreground">Group by</span>+ <span class="px-2 text-[10px] uppercase tracking-wide text-muted-foreground">{{ translate("docs.groupBy") }}</span><div class="flex rounded border border-border p-0.5">- <button type="button" class="flex-1 rounded px-2 py-1 text-xs transition-colors" :class="mode === 'schema' ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-muted/40'" @click="emit('update:mode', 'schema')">Schemas</button>- <button type="button" class="flex-1 rounded px-2 py-1 text-xs transition-colors" :class="mode === 'group' ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-muted/40'" @click="emit('update:mode', 'group')">Table Groups</button>+ <button type="button" class="flex-1 rounded px-2 py-1 text-xs transition-colors" :class="mode === 'schema' ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-muted/40'" @click="emit('update:mode', 'schema')">{{ translate("docs.groupBySchema") }}</button>+ <button type="button" class="flex-1 rounded px-2 py-1 text-xs transition-colors" :class="mode === 'group' ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-muted/40'" @click="emit('update:mode', 'group')">{{ translate("docs.groupByTableGroup") }}</button></div></div>@@ -33,7 +35,7 @@ const emit = defineEmits<{<div class="flex items-center gap-1.5 px-2 py-1" :class="{ 'docs-group': section.hue !== null }" :style="groupStyle(section.hue)"><span v-if="section.hue !== null" class="h-2 w-2 shrink-0 rounded-full" style="background-color: var(--group-c)"></span><span class="truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">- {{ section.label || "(no schema)" }}+ {{ section.label || translate(section.fallbackKey) }}</span></div><buttondiff --git a/apps/desktop/src/docs/components/RelationshipList.vue b/apps/desktop/src/docs/components/RelationshipList.vueindex ed5b59428b..e8c0b5bc24 100644--- a/apps/desktop/src/docs/components/RelationshipList.vue+++ b/apps/desktop/src/docs/components/RelationshipList.vue@@ -1,6 +1,7 @@<script setup lang="ts">import { computed } from "vue";import { qualifiedTableKey } from "../docsKeys";+import type { Translate } from "../docsWarnings";import type { FieldRef, Relationship } from "../types";const props = defineProps<{@@ -8,6 +9,7 @@ const props = defineProps<{relationships: Relationship[];schema: string | null;table: string;+ translate: Translate;}>();const emit = defineEmits<{@@ -50,8 +52,8 @@ const incoming = computed(() => props.relationships.filter((relationship) => isC<template><div class="grid gap-4 sm:grid-cols-2"><section>- <h4 class="mb-1.5 text-xs font-medium text-muted-foreground">References ({{ outgoing.length }})</h4>- <p v-if="outgoing.length === 0" class="text-xs text-muted-foreground">This table references no other table.</p>+ <h4 class="mb-1.5 text-xs font-medium text-muted-foreground">{{ translate("docs.references") }} ({{ outgoing.length }})</h4>+ <p v-if="outgoing.length === 0" class="text-xs text-muted-foreground">{{ translate("docs.noOutgoingRelationships") }}</p><ul v-else class="flex flex-col gap-1"><li v-for="relationship in outgoing" :key="relationship.id" class="text-xs"><button type="button" class="w-full rounded border border-border bg-background px-2 py-1.5 text-left transition-colors hover:bg-muted/40" @click="emit('select', keyOf(relationship.to))">@@ -67,8 +69,8 @@ const incoming = computed(() => props.relationships.filter((relationship) => isC</section><section>- <h4 class="mb-1.5 text-xs font-medium text-muted-foreground">Referenced by ({{ incoming.length }})</h4>- <p v-if="incoming.length === 0" class="text-xs text-muted-foreground">No table references this one.</p>+ <h4 class="mb-1.5 text-xs font-medium text-muted-foreground">{{ translate("docs.referencedBy") }} ({{ incoming.length }})</h4>+ <p v-if="incoming.length === 0" class="text-xs text-muted-foreground">{{ translate("docs.noIncomingRelationships") }}</p><ul v-else class="flex flex-col gap-1"><li v-for="relationship in incoming" :key="relationship.id" class="text-xs"><button type="button" class="w-full rounded border border-border bg-background px-2 py-1.5 text-left transition-colors hover:bg-muted/40" @click="emit('select', keyOf(relationship.from))">diff --git a/apps/desktop/src/docs/components/SchemaDiagram.vue b/apps/desktop/src/docs/components/SchemaDiagram.vuenew file mode 100644index 0000000000..e42ad93199--- /dev/null+++ b/apps/desktop/src/docs/components/SchemaDiagram.vue@@ -0,0 +1,114 @@+<script setup lang="ts">+import { computed } from "vue";+import { layoutDiagramTables } from "@/lib/diagram/erDiagram";+import { clipToCard } from "../diagramGeometry";+import type { Point } from "../diagramGeometry";+import { qualifiedTableKey } from "../docsKeys";+import { groupStyle } from "../groupColor";+import type { SchemaSnapshot } from "../types";++const props = defineProps<{+ snapshot: SchemaSnapshot;+}>();++const emit = defineEmits<{+ select: [tableKey: string];+}>();++// Mirrors layoutDiagramTables' own defaults (lib/diagram/erDiagram.ts) so the+// card geometry drawn here matches the slot the layout actually left for it.+const CARD_WIDTH = 260;+const CARD_HEIGHT = 220;+const MARGIN = 40;+const MAX_VISIBLE_COLUMNS = 8;+const HALF = { width: CARD_WIDTH / 2, height: CARD_HEIGHT / 2 };++const positions = computed(() => layoutDiagramTables(props.snapshot.tables.map((table) => ({ name: qualifiedTableKey(table), columns: table.columns }))));++const groupsById = computed(() => new Map(props.snapshot.groups.map((group) => [group.id, group])));++interface DiagramCard {+ key: string;+ x: number;+ y: number;+ hue: number | null;+ columns: string[];+}++const cards = computed<DiagramCard[]>(() =>+ props.snapshot.tables.map((table) => {+ const key = qualifiedTableKey(table);+ const position = positions.value[key] ?? { x: MARGIN, y: MARGIN };+ const group = table.groupId ? (groupsById.value.get(table.groupId) ?? null) : null;+ return {+ key,+ x: position.x,+ y: position.y,+ hue: group?.hue ?? null,+ columns: table.columns.slice(0, MAX_VISIBLE_COLUMNS).map((column) => column.name),+ };+ }),+);++function centreOf(key: string): Point {+ const position = positions.value[key] ?? { x: MARGIN, y: MARGIN };+ return { x: position.x + CARD_WIDTH / 2, y: position.y + CARD_HEIGHT / 2 };+}++interface DiagramEdge {+ id: string;+ from: Point;+ to: Point;+}++const edges = computed<DiagramEdge[]>(() => {+ const known = new Set(Object.keys(positions.value));+ return props.snapshot.relationships+ .map((relationship) => ({+ relationship,+ fromKey: qualifiedTableKey({ schema: relationship.from.schema, name: relationship.from.table }),+ toKey: qualifiedTableKey({ schema: relationship.to.schema, name: relationship.to.table }),+ }))+ .filter(({ fromKey, toKey }) => known.has(fromKey) && known.has(toKey))+ .map(({ relationship, fromKey, toKey }) => {+ const fromCentre = centreOf(fromKey);+ const toCentre = centreOf(toKey);+ return {+ id: relationship.id,+ from: clipToCard(fromCentre, toCentre, HALF),+ to: clipToCard(toCentre, fromCentre, HALF),+ };+ });+});++// Empty-diagram guard: Math.max(0, ...[]) is 0 rather than -Infinity, so a+// snapshot with no tables still produces a valid (if empty) canvas.+const svgWidth = computed(() => Math.max(0, ...cards.value.map((card) => card.x + CARD_WIDTH)) + MARGIN);+const svgHeight = computed(() => Math.max(0, ...cards.value.map((card) => card.y + CARD_HEIGHT)) + MARGIN);++/**+ * `background-color` has no effect on SVG shapes — they paint through `fill`+ * — so the group accent is the card's fill rather than a CSS background, tied+ * to the same `--group-tint`/`--h` tokens `groupStyle` drives everywhere else+ * in the viewer.+ */+function cardFillStyle(hue: number | null): Record<string, string> {+ return hue === null ? {} : { ...groupStyle(hue), fill: "var(--group-tint)" };+}+</script>++<template>+ <div class="overflow-auto">+ <svg :width="svgWidth" :height="svgHeight" :viewBox="`0 0 ${svgWidth} ${svgHeight}`" class="block">+ <line v-for="edge in edges" :key="edge.id" :x1="edge.from.x" :y1="edge.from.y" :x2="edge.to.x" :y2="edge.to.y" class="stroke-border" stroke-width="1.5" />++ <g v-for="card in cards" :key="card.key">+ <rect :x="card.x" :y="card.y" :width="CARD_WIDTH" :height="CARD_HEIGHT" rx="6" class="cursor-pointer stroke-border" :class="card.hue === null ? 'fill-card' : 'docs-group'" :style="cardFillStyle(card.hue)" stroke-width="1" @click="emit('select', card.key)" />+ <text :x="card.x + 10" :y="card.y + 22" class="pointer-events-none fill-foreground font-mono text-[11px] font-semibold">{{ card.key }}</text>+ <text v-for="(column, index) in card.columns" :key="column" :x="card.x + 10" :y="card.y + 42 + index * 18" class="pointer-events-none fill-muted-foreground font-mono text-[10px]">+ {{ column }}+ </text>+ </g>+ </svg>+ </div>+</template>diff --git a/apps/desktop/src/docs/components/TablePage.vue b/apps/desktop/src/docs/components/TablePage.vueindex 6e03cda732..92d844bf32 100644--- a/apps/desktop/src/docs/components/TablePage.vue+++ b/apps/desktop/src/docs/components/TablePage.vue@@ -56,7 +56,7 @@ const shadowedTitle = computed(() => (props.table.shadowedNote ? `Database commeone shadows that comment, which is what noteSource and shadowedNotebelow exist to disclose. --><div class="flex items-start gap-2">- <span v-if="table.noteSource === 'LOCAL'" class="mt-0.5 shrink-0 text-[10px] font-medium text-muted-foreground" :title="shadowedTitle">⬤ LOCAL</span>+ <span v-if="table.noteSource === 'LOCAL'" class="mt-0.5 shrink-0 text-[10px] font-medium text-muted-foreground" :title="shadowedTitle">⬤ {{ translate("docs.localNote") }}</span><NoteEditor class="min-w-0 flex-1" :model-value="table.note ?? ''" :readonly="readonly" :translate="translate" @update:model-value="emit('edit', { kind: 'tableNote', tableKey: qualified, note: $event })" /></div>@@ -64,19 +64,19 @@ const shadowedTitle = computed(() => (props.table.shadowedNote ? `Database comme</header><section>- <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Columns</h3>+ <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">{{ translate("docs.columns") }}</h3><ColumnTable :columns="table.columns" :column-notes="table.columnNotes" :table-key="qualified" :readonly="readonly" :translate="translate" @edit="emit('edit', $event)" /></section><section v-if="table.indexes.length > 0">- <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Indexes</h3>+ <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">{{ translate("docs.indexes") }}</h3><div class="overflow-hidden rounded-md border border-border"><table class="w-full text-xs"><thead><tr class="bg-muted/30">- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Name</th>- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Columns</th>- <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">Settings</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.nameHeader") }}</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.columns") }}</th>+ <th class="px-2 py-1.5 text-left font-medium text-muted-foreground">{{ translate("docs.settingsHeader") }}</th></tr></thead><tbody>@@ -100,12 +100,12 @@ const shadowedTitle = computed(() => (props.table.shadowedNote ? `Database comme</section><section>- <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Relationships</h3>- <RelationshipList :relationships="relationships" :schema="table.schema" :table="table.name" @select="emit('select', $event)" />+ <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">{{ translate("docs.relationships") }}</h3>+ <RelationshipList :relationships="relationships" :schema="table.schema" :table="table.name" :translate="translate" @select="emit('select', $event)" /></section><section v-if="table.viewDefinition">- <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">Definition</h3>+ <h3 class="mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground">{{ translate("docs.definitionHeader") }}</h3><pre class="overflow-x-auto rounded-md border border-border bg-muted/20 p-2 font-mono text-xs">{{ table.viewDefinition }}</pre></section></article>diff --git a/apps/desktop/src/docs/components/WikiIndex.vue b/apps/desktop/src/docs/components/WikiIndex.vueindex 9a9942d62e..e2a58f5007 100644--- a/apps/desktop/src/docs/components/WikiIndex.vue+++ b/apps/desktop/src/docs/components/WikiIndex.vue@@ -3,9 +3,11 @@ import type { IndexSection } from "../docsIndex";import { qualifiedTableKey } from "../docsKeys";import { groupStyle } from "../groupColor";import { renderNote } from "../renderNote";+import type { Translate } from "../docsWarnings";defineProps<{sections: IndexSection[];+ translate: Translate;}>();const emit = defineEmits<{@@ -18,7 +20,7 @@ const emit = defineEmits<{<section v-for="section in sections" :key="section.key" class="flex flex-col gap-2"><div class="flex flex-col gap-1 border-l-2 pl-3" :class="{ 'docs-group': section.hue !== null }" style="border-color: var(--group-c, var(--border))" :style="groupStyle(section.hue)"><div class="flex items-baseline gap-2">- <h2 class="text-sm font-semibold text-foreground">{{ section.label || "(no schema)" }}</h2>+ <h2 class="text-sm font-semibold text-foreground">{{ section.label || translate(section.fallbackKey) }}</h2><span class="text-xs text-muted-foreground">{{ section.tables.length }} tables</span></div><div v-if="section.note" class="text-xs text-muted-foreground" v-html="renderNote(section.note)"></div>diff --git a/apps/desktop/src/docs/diagramGeometry.ts b/apps/desktop/src/docs/diagramGeometry.tsnew file mode 100644index 0000000000..5a46afef8c--- /dev/null+++ b/apps/desktop/src/docs/diagramGeometry.ts@@ -0,0 +1,32 @@+export interface Point {+ x: number;+ y: number;+}++export interface Size {+ width: number;+ height: number;+}++/**+ * Where a line from one card's centre towards another leaves the first card.+ *+ * Without this, edges terminate under the card and appear to sprout from a+ * table's middle. Scaling both axes and taking the smaller factor picks+ * whichever edge the ray actually reaches first.+ *+ * `half` is the card's HALF width and height, measured from its centre.+ */+export function clipToCard(from: Point, to: Point, half: Size): Point {+ const dx = to.x - from.x;+ const dy = to.y - from.y;+ if (dx === 0 && dy === 0) {+ // Coincident centres would divide by zero and put NaN in the path data,+ // which renders as nothing rather than as an error.+ return { x: from.x, y: from.y };+ }+ const scaleX = dx === 0 ? Number.POSITIVE_INFINITY : half.width / Math.abs(dx);+ const scaleY = dy === 0 ? Number.POSITIVE_INFINITY : half.height / Math.abs(dy);+ const scale = Math.min(scaleX, scaleY);+ return { x: from.x + dx * scale, y: from.y + dy * scale };+}diff --git a/apps/desktop/src/docs/docsIndex.ts b/apps/desktop/src/docs/docsIndex.tsindex 66579856fe..faf3ac27f0 100644--- a/apps/desktop/src/docs/docsIndex.ts+++ b/apps/desktop/src/docs/docsIndex.ts@@ -5,6 +5,21 @@ export interface IndexSection {/** Schema name, group id, or "" for the ungrouped bucket. */key: string;label: string;+ /**+ * Locale key to show in place of `label` when it's empty — "docs.noSchema"+ * from groupBySchema, "docs.noGroup" from groupByTableGroup. This module+ * stays translator-free (it is pure, tested without Vue, and every other+ * pure module in src/docs/ follows the same rule), so it hands back a KEY+ * rather than calling translate() itself; the render site decides how.+ *+ * Carrying the key on the section — rather than each render site inferring+ * it from a `mode` prop — means a fallback can never silently pick the+ * wrong word for the section it labels: WikiIndex.vue doesn't even receive+ * `mode`, so a mode-based guess there would either require threading a prop+ * that has no other use, or duplicate this same schema/group decision at a+ * second call site to keep in sync with this one.+ */+ fallbackKey: "docs.noSchema" | "docs.noGroup";/** Group hue, or null for schema sections and the ungrouped bucket. */hue: number | null;note: string | null;@@ -32,6 +47,7 @@ export function groupBySchema(snapshot: SchemaSnapshot): IndexSection[] {.map(([key, tables]) => ({key,label: key,+ fallbackKey: "docs.noSchema" as const,hue: null,note: null,tables: [...tables].sort(byName),@@ -52,6 +68,7 @@ export function groupByTableGroup(snapshot: SchemaSnapshot): IndexSection[] {sections.push({key: group.id,label: group.name,+ fallbackKey: "docs.noGroup",hue: group.hue,note: group.note,tables,@@ -63,7 +80,10 @@ export function groupByTableGroup(snapshot: SchemaSnapshot): IndexSection[] {const ungrouped = snapshot.tables.filter((table) => table.groupId === null || !known.has(table.groupId)).sort(byName);if (ungrouped.length > 0) {- sections.push({ key: "", label: "(no group)", hue: null, note: null, tables: ungrouped });+ // Empty, not "(no group)": the render sites already fall back to a+ // translated label when `label` is empty (see IndexSection.fallbackKey).+ // A non-empty English literal here would bypass that fallback entirely.+ sections.push({ key: "", label: "", fallbackKey: "docs.noGroup", hue: null, note: null, tables: ungrouped });}return sections;diff --git a/apps/desktop/src/docs/docsRoute.ts b/apps/desktop/src/docs/docsRoute.tsnew file mode 100644index 0000000000..d258b9993c--- /dev/null+++ b/apps/desktop/src/docs/docsRoute.ts@@ -0,0 +1,61 @@+import { qualifiedTableKey } from "./docsKeys";+import type { SchemaSnapshot } from "./types";++/**+ * Where the viewer is pointing.+ *+ * This exists so the standalone export can drive navigation from+ * `location.hash` without DocsApp itself touching the URL: DBX has no+ * router, and a viewer that wrote to the address bar would hijack the host+ * application's.+ */+export type DocsRoute = { kind: "index" } | { kind: "table"; key: string } | { kind: "enum"; name: string } | { kind: "diagram" };++const INDEX: DocsRoute = { kind: "index" };++/**+ * Resolve a hash against a snapshot.+ *+ * Anything unrecognised — junk, a table that no longer exists, the diagram+ * route on a host that did not enable it — resolves to the index. A saved+ * file whose schema has since changed is the expected case, not an exotic+ * one, and must never render blank.+ */+export function parseDocsHash(hash: string, snapshot: SchemaSnapshot, allowDiagram: boolean): DocsRoute {+ if (!hash.startsWith("#")) return INDEX;+ const segments = hash.slice(1).replace(/^\//, "").split("/");+ const [kind, ...rest] = segments;+ const identifier = rest.join("/");++ if (kind === "diagram" && identifier === "") return allowDiagram ? { kind: "diagram" } : INDEX;++ if (identifier === "") return INDEX;+ let decoded: string;+ try {+ decoded = decodeURIComponent(identifier);+ } catch {+ // A malformed percent-escape throws rather than returning null.+ return INDEX;+ }++ if (kind === "table") {+ return snapshot.tables.some((table) => qualifiedTableKey(table) === decoded) ? { kind: "table", key: decoded } : INDEX;+ }+ if (kind === "enum") {+ return (snapshot.enums ?? []).some((value) => value.name === decoded) ? { kind: "enum", name: decoded } : INDEX;+ }+ return INDEX;+}++export function formatDocsHash(route: DocsRoute): string {+ switch (route.kind) {+ case "table":+ return `#/table/${encodeURIComponent(route.key)}`;+ case "enum":+ return `#/enum/${encodeURIComponent(route.name)}`;+ case "diagram":+ return "#/diagram";+ default:+ return "#/";+ }+}diff --git a/apps/desktop/src/i18n/locales/docs/en.ts b/apps/desktop/src/i18n/locales/docs/en.tsindex f0f72d6342..1ec86e9bd3 100644--- a/apps/desktop/src/i18n/locales/docs/en.ts+++ b/apps/desktop/src/i18n/locales/docs/en.ts@@ -23,6 +23,27 @@ export default {saving: "Saving…",saved: "Saved",saveFailed: "Could not save notes: {error}",+ overview: "Overview",+ groupBy: "Group by",+ searchLabel: "Search",+ groups: "Groups",+ relationships: "Relationships",+ columnHeader: "Column",+ typeHeader: "Type",+ settingsHeader: "Settings",+ noteHeader: "Note",+ nameHeader: "Name",+ definitionHeader: "Definition",+ noOutgoingRelationships: "This table references no other table.",+ noIncomingRelationships: "No table references this one.",+ diagram: "Diagram",+ language: "Language",+ theme: "Theme",+ themeLight: "Light",+ themeDark: "Dark",+ exportHtml: "Export HTML…",+ exporting: "Exporting…",+ exportFailed: "Could not export: {error}",warnings: {tableSkipped: {title: "A table could not be documented",diff --git a/apps/desktop/src/i18n/locales/docs/es.ts b/apps/desktop/src/i18n/locales/docs/es.tsindex eed9b3f0de..361af96d6a 100644--- a/apps/desktop/src/i18n/locales/docs/es.ts+++ b/apps/desktop/src/i18n/locales/docs/es.ts@@ -23,6 +23,27 @@ export default {saving: "Guardando…",saved: "Guardado",saveFailed: "No se pudieron guardar las notas: {error}",+ overview: "Información general",+ groupBy: "Agrupar por",+ searchLabel: "Buscar",+ groups: "Grupos",+ relationships: "Relaciones",+ columnHeader: "Columna",+ typeHeader: "Tipo",+ settingsHeader: "Configuración",+ noteHeader: "Nota",+ nameHeader: "Nombre",+ definitionHeader: "Definición",+ noOutgoingRelationships: "Esta tabla no referencia ninguna otra tabla.",+ noIncomingRelationships: "Ninguna tabla referencia esta.",+ diagram: "Diagrama",+ language: "Idioma",+ theme: "Tema",+ themeLight: "Claro",+ themeDark: "Oscuro",+ exportHtml: "Exportar HTML…",+ exporting: "Exportando…",+ exportFailed: "No se pudo exportar: {error}",warnings: {tableSkipped: {title: "No se pudo documentar una tabla",diff --git a/apps/desktop/src/i18n/locales/docs/it.ts b/apps/desktop/src/i18n/locales/docs/it.tsindex c78a5e9fef..b154d9a693 100644--- a/apps/desktop/src/i18n/locales/docs/it.ts+++ b/apps/desktop/src/i18n/locales/docs/it.ts@@ -23,6 +23,27 @@ export default {saving: "Salvataggio…",saved: "Salvato",saveFailed: "Impossibile salvare le note: {error}",+ overview: "Panoramica",+ groupBy: "Raggruppa per",+ searchLabel: "Cerca",+ groups: "Gruppi",+ relationships: "Relazioni",+ columnHeader: "Colonna",+ typeHeader: "Tipo",+ settingsHeader: "Impostazioni",+ noteHeader: "Nota",+ nameHeader: "Nome",+ definitionHeader: "Definizione",+ noOutgoingRelationships: "Questa tabella non fa riferimento a nessun'altra tabella.",+ noIncomingRelationships: "Nessuna tabella fa riferimento a questa.",+ diagram: "Diagramma",+ language: "Lingua",+ theme: "Tema",+ themeLight: "Chiaro",+ themeDark: "Scuro",+ exportHtml: "Esporta HTML…",+ exporting: "Esportazione…",+ exportFailed: "Impossibile esportare: {error}",warnings: {tableSkipped: {title: "Impossibile documentare una tabella",diff --git a/apps/desktop/src/i18n/locales/docs/ja.ts b/apps/desktop/src/i18n/locales/docs/ja.tsindex b8267a63ae..59337e46c4 100644--- a/apps/desktop/src/i18n/locales/docs/ja.ts+++ b/apps/desktop/src/i18n/locales/docs/ja.ts@@ -23,6 +23,27 @@ export default {saving: "保存中…",saved: "保存済み",saveFailed: "メモを保存できませんでした: {error}",+ overview: "概要",+ groupBy: "グループ化",+ searchLabel: "検索",+ groups: "グループ",+ relationships: "リレーションシップ",+ columnHeader: "カラム",+ typeHeader: "型",+ settingsHeader: "設定",+ noteHeader: "メモ",+ nameHeader: "名前",+ definitionHeader: "定義",+ noOutgoingRelationships: "このテーブルは他のテーブルを参照していません。",+ noIncomingRelationships: "このテーブルを参照しているテーブルはありません。",+ diagram: "図",+ language: "言語",+ theme: "テーマ",+ themeLight: "ライト",+ themeDark: "ダーク",+ exportHtml: "HTMLをエクスポート…",+ exporting: "エクスポート中…",+ exportFailed: "エクスポートできませんでした: {error}",warnings: {tableSkipped: {title: "ドキュメント化できないテーブルがあります",diff --git a/apps/desktop/src/i18n/locales/docs/ko.ts b/apps/desktop/src/i18n/locales/docs/ko.tsindex da6652376c..3e4897fb94 100644--- a/apps/desktop/src/i18n/locales/docs/ko.ts+++ b/apps/desktop/src/i18n/locales/docs/ko.ts@@ -23,6 +23,27 @@ export default {saving: "저장 중…",saved: "저장됨",saveFailed: "메모를 저장할 수 없습니다: {error}",+ overview: "개요",+ groupBy: "그룹화 기준",+ searchLabel: "검색",+ groups: "그룹",+ relationships: "관계",+ columnHeader: "컬럼",+ typeHeader: "유형",+ settingsHeader: "설정",+ noteHeader: "메모",+ nameHeader: "이름",+ definitionHeader: "정의",+ noOutgoingRelationships: "이 테이블은 다른 테이블을 참조하지 않습니다.",+ noIncomingRelationships: "이 테이블을 참조하는 테이블이 없습니다.",+ diagram: "다이어그램",+ language: "언어",+ theme: "테마",+ themeLight: "라이트",+ themeDark: "다크",+ exportHtml: "HTML 내보내기…",+ exporting: "내보내는 중…",+ exportFailed: "내보낼 수 없습니다: {error}",warnings: {tableSkipped: {title: "문서화할 수 없는 테이블이 있습니다",diff --git a/apps/desktop/src/i18n/locales/docs/pt-BR.ts b/apps/desktop/src/i18n/locales/docs/pt-BR.tsindex 276d907081..3225bb83e1 100644--- a/apps/desktop/src/i18n/locales/docs/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/docs/pt-BR.ts@@ -23,6 +23,27 @@ export default {saving: "Salvando…",saved: "Salvo",saveFailed: "Não foi possível salvar as notas: {error}",+ overview: "Visão geral",+ groupBy: "Agrupar por",+ searchLabel: "Buscar",+ groups: "Grupos",+ relationships: "Relacionamentos",+ columnHeader: "Coluna",+ typeHeader: "Tipo",+ settingsHeader: "Configurações",+ noteHeader: "Nota",+ nameHeader: "Nome",+ definitionHeader: "Definição",+ noOutgoingRelationships: "Esta tabela não referencia nenhuma outra tabela.",+ noIncomingRelationships: "Nenhuma tabela referencia esta.",+ diagram: "Diagrama",+ language: "Idioma",+ theme: "Tema",+ themeLight: "Claro",+ themeDark: "Escuro",+ exportHtml: "Exportar HTML…",+ exporting: "Exportando…",+ exportFailed: "Não foi possível exportar: {error}",warnings: {tableSkipped: {title: "Uma tabela não pôde ser documentada",diff --git a/apps/desktop/src/i18n/locales/docs/zh-CN.ts b/apps/desktop/src/i18n/locales/docs/zh-CN.tsindex c968bc8acc..df85b0f7b8 100644--- a/apps/desktop/src/i18n/locales/docs/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/docs/zh-CN.ts@@ -23,6 +23,27 @@ export default {saving: "保存中…",saved: "已保存",saveFailed: "无法保存备注: {error}",+ overview: "概览",+ groupBy: "分组方式",+ searchLabel: "搜索",+ groups: "分组",+ relationships: "关系",+ columnHeader: "列",+ typeHeader: "类型",+ settingsHeader: "设置",+ noteHeader: "备注",+ nameHeader: "名称",+ definitionHeader: "定义",+ noOutgoingRelationships: "此表未引用任何其他表。",+ noIncomingRelationships: "没有表引用此表。",+ diagram: "图",+ language: "语言",+ theme: "主题",+ themeLight: "浅色",+ themeDark: "深色",+ exportHtml: "导出 HTML…",+ exporting: "导出中…",+ exportFailed: "无法导出: {error}",warnings: {tableSkipped: {title: "有一张表无法生成文档",diff --git a/apps/desktop/src/i18n/locales/docs/zh-TW.ts b/apps/desktop/src/i18n/locales/docs/zh-TW.tsindex 48a53fd047..62ed4a7569 100644--- a/apps/desktop/src/i18n/locales/docs/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/docs/zh-TW.ts@@ -23,6 +23,27 @@ export default {saving: "儲存中…",saved: "已儲存",saveFailed: "無法儲存備註: {error}",+ overview: "總覽",+ groupBy: "分組方式",+ searchLabel: "搜尋",+ groups: "分組",+ relationships: "關聯",+ columnHeader: "欄位",+ typeHeader: "類型",+ settingsHeader: "設定",+ noteHeader: "備註",+ nameHeader: "名稱",+ definitionHeader: "定義",+ noOutgoingRelationships: "此資料表未參照任何其他資料表。",+ noIncomingRelationships: "沒有資料表參照此資料表。",+ diagram: "圖表",+ language: "語言",+ theme: "主題",+ themeLight: "淺色",+ themeDark: "深色",+ exportHtml: "匯出 HTML…",+ exporting: "匯出中…",+ exportFailed: "無法匯出: {error}",warnings: {tableSkipped: {title: "有一張資料表無法產生文件",diff --git a/apps/desktop/src/lib/backend/api.ts b/apps/desktop/src/lib/backend/api.tsindex 152502cfaa..bb2f13a730 100644--- a/apps/desktop/src/lib/backend/api.ts+++ b/apps/desktop/src/lib/backend/api.ts@@ -184,6 +184,7 @@ export const collectDocsSnapshot = forward("collectDocsSnapshot");export const loadDocsAnnotations = forward("loadDocsAnnotations");export const applyDocsAnnotations = forward("applyDocsAnnotations");export const saveDocsAnnotations = forward("saveDocsAnnotations");+export const exportDocsHtml = forward("exportDocsHtml");// Queryexport const executeQuery = forward("executeQuery");diff --git a/apps/desktop/src/lib/backend/http.ts b/apps/desktop/src/lib/backend/http.tsindex dac91dc842..dfa586a2b9 100644--- a/apps/desktop/src/lib/backend/http.ts+++ b/apps/desktop/src/lib/backend/http.ts@@ -860,6 +860,21 @@ export async function saveDocsAnnotations(connectionId: string, annotations: Annreturn post("/api/docs/annotations/save", { connectionId, annotations });}+export async function exportDocsHtml(filePath: string, snapshot: SchemaSnapshot, annotations: AnnotationFile, lang: string): Promise<void> {+ const result = await post<{ content: string }>("/api/docs/export", { snapshot, annotations, lang });+ // No `downloadTextFile` here: it prepends a BOM, which the Tauri command's+ // `std::fs::write(&file_path, html)` does not. The two callers must produce+ // byte-identical output for the same inputs.+ const fileName = filePath.split(/[\\/]/).pop() || "docs.html";+ const blob = new Blob([result.content], { type: "text/html;charset=utf-8" });+ const url = URL.createObjectURL(blob);+ const a = document.createElement("a");+ a.href = url;+ a.download = fileName;+ a.click();+ URL.revokeObjectURL(url);+}+// ---------------------------------------------------------------------------// Query// ---------------------------------------------------------------------------diff --git a/apps/desktop/src/lib/backend/tauri.ts b/apps/desktop/src/lib/backend/tauri.tsindex f757116e85..45f7daef37 100644--- a/apps/desktop/src/lib/backend/tauri.ts+++ b/apps/desktop/src/lib/backend/tauri.ts@@ -1681,6 +1681,10 @@ export async function saveDocsAnnotations(connectionId: string, annotations: Annreturn invoke("docs_save_annotations", { connectionId, annotations });}+export async function exportDocsHtml(filePath: string, snapshot: SchemaSnapshot, annotations: AnnotationFile, lang: string): Promise<void> {+ return invoke("docs_export_html", { filePath, snapshot, annotations, lang });+}+export async function saveConnections(configs: ConnectionConfig[]): Promise<void> {return invoke("save_connections", { configs });}diff --git a/apps/desktop/src/styles/__tests__/cascadeCss.ts b/apps/desktop/src/styles/__tests__/cascadeCss.tsnew file mode 100644index 0000000000..0b8d4e7fc1--- /dev/null+++ b/apps/desktop/src/styles/__tests__/cascadeCss.ts@@ -0,0 +1,23 @@+import { readFileSync } from "node:fs";++const IMPORT_STATEMENT = '@import "./tokens.css";';++/**+ * Reads the desktop stylesheet the way the browser assembles it: globals.css+ * with its `@import "./tokens.css"` replaced, in place, by the imported file.+ *+ * Design tokens live in tokens.css so the standalone documentation export can+ * reuse them without pulling in the app shell. Assertions about declaration+ * order are assertions about the cascade, so a spec that reads only globals.css+ * sees half the stylesheet and draws the wrong conclusion.+ */+export function readCascadeCss(): string {+ const globals = readFileSync(new URL("../globals.css", import.meta.url), "utf8");+ const tokens = readFileSync(new URL("../tokens.css", import.meta.url), "utf8");+ if (!globals.includes(IMPORT_STATEMENT)) {+ // Failing loudly beats returning globals.css alone: a silent half-stylesheet+ // would resurface as an unrelated-looking assertion failure somewhere else.+ throw new Error(`globals.css no longer pulls in tokens.css with \`${IMPORT_STATEMENT}\``);+ }+ return globals.replace(IMPORT_STATEMENT, tokens);+}diff --git a/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts b/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.tsindex 007cf6f6b1..41b02049ba 100644--- a/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts+++ b/apps/desktop/src/styles/__tests__/legacyWebviewFallback.spec.ts@@ -1,7 +1,8 @@import { readFileSync } from "node:fs";import { describe, expect, it } from "vitest";+import { readCascadeCss } from "./cascadeCss";-const globalsCss = readFileSync(new URL("../globals.css", import.meta.url), "utf8");+const globalsCss = readCascadeCss();const dialogContentSource = readFileSync(new URL("../../components/ui/dialog/DialogContent.vue", import.meta.url), "utf8");const dialogScrollContentSource = readFileSync(new URL("../../components/ui/dialog/DialogScrollContent.vue", import.meta.url), "utf8");const dialogOverlaySource = readFileSync(new URL("../../components/ui/dialog/DialogOverlay.vue", import.meta.url), "utf8");diff --git a/apps/desktop/src/styles/globals.css b/apps/desktop/src/styles/globals.cssindex 5b710c08ec..8988ce8834 100644--- a/apps/desktop/src/styles/globals.css+++ b/apps/desktop/src/styles/globals.css@@ -66,128 +66,15 @@}}-@custom-variant dark (&:is(.dark *));--@theme inline {- --font-sans: "Geist Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;- --font-heading: var(--font-sans);- --color-sidebar-ring: var(--sidebar-ring);- --color-sidebar-border: var(--sidebar-border);- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);- --color-sidebar-accent: var(--sidebar-accent);- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);- --color-sidebar-primary: var(--sidebar-primary);- --color-sidebar-foreground: var(--sidebar-foreground);- --color-sidebar: var(--sidebar);- --color-chart-5: var(--chart-5);- --color-chart-4: var(--chart-4);- --color-chart-3: var(--chart-3);- --color-chart-2: var(--chart-2);- --color-chart-1: var(--chart-1);- --color-ring: var(--ring);- --color-input: var(--input);- --color-border: var(--border);- --color-destructive: var(--destructive);- /* Aliases for legacy MQ panel styles (used across components/mq/*). */- --color-error: var(--destructive);- --color-error-bg: color-mix(in srgb, var(--destructive) 10%, transparent);- --color-error-alpha: var(--color-error-bg);- --color-success: var(--success);- --color-success-bg: var(--success-bg);- --color-success-alpha: var(--success-bg);- --color-warning: var(--warning);- --color-warning-bg: var(--warning-bg);- --color-warning-alpha: var(--warning-bg);- --color-info: var(--info);- --color-info-bg: var(--info-bg);- --color-info-alpha: var(--info-bg);- --color-hover: var(--accent);- --color-background-secondary: var(--muted);- --color-text: var(--foreground);- --color-text-secondary: var(--muted-foreground);- --color-text-tertiary: color-mix(in srgb, var(--muted-foreground) 70%, transparent);- --color-border-light: color-mix(in srgb, var(--border) 60%, transparent);- --color-primary-alpha: color-mix(in srgb, var(--primary) 12%, transparent);- --color-accent-foreground: var(--accent-foreground);- --color-accent: var(--accent);- --color-muted-foreground: var(--muted-foreground);- --color-muted: var(--muted);- --color-secondary-foreground: var(--secondary-foreground);- --color-secondary: var(--secondary);- --color-primary-foreground: var(--primary-foreground);- --color-primary: var(--primary);- --color-popover-foreground: var(--popover-foreground);- --color-popover: var(--popover);- --color-card-foreground: var(--card-foreground);- --color-card: var(--card);- --color-foreground: var(--foreground);- --color-background: var(--background);- --radius-sm: var(--dbx-radius-sm);- --radius-md: var(--dbx-radius-md);- --radius-lg: var(--dbx-radius-lg);- --radius-xl: var(--dbx-radius-xl);-}--:root {- --background: rgb(255 255 255);- --foreground: rgb(10 10 10);- --card: rgb(255 255 255);- --card-foreground: rgb(10 10 10);- --popover: rgb(255 255 255);- --popover-foreground: rgb(10 10 10);- --primary: rgb(23 23 23);- --primary-foreground: rgb(250 250 250);- --secondary: rgb(245 245 245);- --secondary-foreground: rgb(23 23 23);- --muted: rgb(245 245 245);- --muted-foreground: rgb(115 115 115);- --accent: rgb(245 245 245);- --accent-foreground: rgb(23 23 23);- --destructive: rgb(231 0 11);- --destructive-rgb: 231, 0, 11;- --border: rgb(229 229 229);- --input: rgb(229 229 229);- --ring: rgb(161 161 161);- --chart-1: rgb(212 212 212);- --chart-2: rgb(115 115 115);- --chart-3: rgb(82 82 82);- --chart-4: rgb(64 64 64);- --chart-5: rgb(38 38 38);- --radius: var(--dbx-radius-md);- --dbx-radius-default: 4px;- --dbx-radius-sm: 4px;- --dbx-radius-md: 4px;- --dbx-radius-lg: 6px;- --dbx-radius-xl: 6px;- --dbx-radius-fixed-4: 4px;- --dbx-radius-fixed-5: 5px;- --dbx-radius-fixed-6: 6px;- --sidebar: rgb(250 250 250);- --sidebar-foreground: rgb(10 10 10);- --sidebar-primary: rgb(23 23 23);- --sidebar-primary-foreground: rgb(250 250 250);- --sidebar-accent: rgb(245 245 245);- --sidebar-accent-foreground: rgb(23 23 23);- --sidebar-border: rgb(229 229 229);- --sidebar-ring: rgb(161 161 161);- --success: rgb(22 163 74);- --success-foreground: rgb(240 253 244);- --success-bg: color-mix(in srgb, var(--success) 12%, transparent);- --warning: rgb(217 119 6);- --warning-foreground: rgb(255 251 235);- --warning-bg: color-mix(in srgb, var(--warning) 14%, transparent);- --info: rgb(37 99 235);- --info-foreground: rgb(239 246 255);- --info-bg: color-mix(in srgb, var(--info) 12%, transparent);- --dbx-chrome: rgb(245 245 245);- --dbx-chrome-muted: rgb(240 240 240);- --dbx-content: rgb(255 255 255);- --dbx-editor-toolbar: rgb(250 250 250);- --dbx-gutter: rgb(243 243 243);- --dbx-sidebar-header: rgb(250 250 250);- --dbx-window-top-border: rgb(0 0 0 / 0.35);- --dbx-viewport-height: 100vh;-}+/*+ * `@custom-variant dark` and the `@theme inline` block that maps the raw+ * tokens onto Tailwind's `--color-*` namespace both live in tokens.css now:+ * they are plumbing for those tokens, and the standalone documentation export+ * imports tokens.css without this file. Utilities like `bg-background` come+ * from that block, so an entry point with the raw properties and no `@theme`+ * emits none of them.+ */+@import "./tokens.css";:root[data-corner-style="large"] {--dbx-radius-default: 6px;@@ -293,57 +180,6 @@}}-.dark {- --background: rgb(19 20 22);- --foreground: rgb(215 215 219);- --card: rgb(27 27 30);- --card-foreground: rgb(215 215 219);- --popover: rgb(30 30 32);- --popover-foreground: rgb(221 221 226);- --primary: rgb(208 208 214);- --primary-foreground: rgb(19 20 22);- --secondary: rgb(42 42 45);- --secondary-foreground: rgb(215 215 219);- --muted: rgb(42 42 45);- --muted-foreground: rgb(151 152 157);- --accent: rgb(46 47 51);- --accent-foreground: rgb(221 221 226);- --destructive: rgb(243 98 95);- --destructive-rgb: 243, 98, 95;- --border: rgb(110 110 114 / 0.28);- --input: rgb(110 110 114 / 0.34);- --ring: rgb(133 134 139);- --chart-1: rgb(212 212 212);- --chart-2: rgb(115 115 115);- --chart-3: rgb(82 82 82);- --chart-4: rgb(64 64 64);- --chart-5: rgb(38 38 38);- --sidebar: rgb(25 25 28);- --sidebar-foreground: rgb(208 208 213);- --sidebar-primary: rgb(208 208 214);- --sidebar-primary-foreground: rgb(19 20 22);- --sidebar-accent: rgb(44 44 48);- --sidebar-accent-foreground: rgb(221 221 226);- --sidebar-border: rgb(110 110 114 / 0.28);- --sidebar-ring: rgb(133 134 139);- --success: rgb(74 222 128);- --success-foreground: rgb(20 30 24);- --success-bg: color-mix(in srgb, var(--success) 16%, transparent);- --warning: rgb(251 191 36);- --warning-foreground: rgb(40 32 12);- --warning-bg: color-mix(in srgb, var(--warning) 16%, transparent);- --info: rgb(96 165 250);- --info-foreground: rgb(18 28 46);- --info-bg: color-mix(in srgb, var(--info) 16%, transparent);- --dbx-chrome: rgb(27 27 30);- --dbx-chrome-muted: rgb(32 32 36);- --dbx-content: rgb(19 20 22);- --dbx-editor-toolbar: rgb(25 25 28);- --dbx-gutter: rgb(23 23 25);- --dbx-sidebar-header: rgb(25 25 28);- --dbx-window-top-border: rgb(255 255 255 / 0.18);-}-html.theme-soft {--background: rgb(250 251 253);--foreground: rgb(40 44 52);diff --git a/apps/desktop/src/styles/tokens.css b/apps/desktop/src/styles/tokens.cssnew file mode 100644index 0000000000..64d7c055fc--- /dev/null+++ b/apps/desktop/src/styles/tokens.css@@ -0,0 +1,210 @@+/*+ * Design tokens, shared by the application shell and the standalone+ * documentation export.+ *+ * These live apart from globals.css because the export's Tailwind entry+ * cannot import globals.css: its `@source` scans the whole application and+ * `@source` is additive, so the export would emit every utility in DBX. The+ * export still needs these tokens, and duplicating them is how the values+ * drift.+ *+ * Order matters: `.dark` must stay declared after `:root`.+ *+ * Scope: this file carries only the base light (`:root`) and dark (`.dark`)+ * token sets, in rgb. It deliberately does NOT carry the alternate+ * installable app themes (`html.theme-soft`, `.theme-graphite`, etc., still+ * in globals.css), the `@supports (color: oklch(...))` progressive+ * enhancement that re-declares these same tokens in oklch for wide-gamut+ * displays (also still in globals.css, after the tokens.css import), or the+ * `:root[data-corner-style]` radius variants. None of those apply to a+ * static file:// export with no theme picker and no live preference to+ * express — pulling them in here would just be duplication with nothing to+ * show for it.+ *+ * The `@theme inline` block below is part of the same plumbing and has to+ * travel with the raw properties. Tailwind generates `bg-background`,+ * `border-border` and `fill-card` from the `--color-*` entries here, NOT from+ * the `--background`/`--border` properties themselves — an entry point that+ * imports only the raw tokens defines every custom property and emits none of+ * the utilities that read them, which renders as a completely unstyled page+ * while every build and test stays green.+ *+ * `@custom-variant dark` travels with it for the same reason: Tailwind's stock+ * `dark:` variant keys off `prefers-color-scheme`, so without this the app's+ * (and the export's) `.dark` class would flip the token values while every+ * `dark:` utility kept following the OS.+ */++@custom-variant dark (&:is(.dark *));++@theme inline {+ --font-sans: "Geist Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;+ --font-heading: var(--font-sans);+ --color-sidebar-ring: var(--sidebar-ring);+ --color-sidebar-border: var(--sidebar-border);+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);+ --color-sidebar-accent: var(--sidebar-accent);+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);+ --color-sidebar-primary: var(--sidebar-primary);+ --color-sidebar-foreground: var(--sidebar-foreground);+ --color-sidebar: var(--sidebar);+ --color-chart-5: var(--chart-5);+ --color-chart-4: var(--chart-4);+ --color-chart-3: var(--chart-3);+ --color-chart-2: var(--chart-2);+ --color-chart-1: var(--chart-1);+ --color-ring: var(--ring);+ --color-input: var(--input);+ --color-border: var(--border);+ --color-destructive: var(--destructive);+ /* Aliases for legacy MQ panel styles (used across components/mq/*). */+ --color-error: var(--destructive);+ --color-error-bg: color-mix(in srgb, var(--destructive) 10%, transparent);+ --color-error-alpha: var(--color-error-bg);+ --color-success: var(--success);+ --color-success-bg: var(--success-bg);+ --color-success-alpha: var(--success-bg);+ --color-warning: var(--warning);+ --color-warning-bg: var(--warning-bg);+ --color-warning-alpha: var(--warning-bg);+ --color-info: var(--info);+ --color-info-bg: var(--info-bg);+ --color-info-alpha: var(--info-bg);+ --color-hover: var(--accent);+ --color-background-secondary: var(--muted);+ --color-text: var(--foreground);+ --color-text-secondary: var(--muted-foreground);+ --color-text-tertiary: color-mix(in srgb, var(--muted-foreground) 70%, transparent);+ --color-border-light: color-mix(in srgb, var(--border) 60%, transparent);+ --color-primary-alpha: color-mix(in srgb, var(--primary) 12%, transparent);+ --color-accent-foreground: var(--accent-foreground);+ --color-accent: var(--accent);+ --color-muted-foreground: var(--muted-foreground);+ --color-muted: var(--muted);+ --color-secondary-foreground: var(--secondary-foreground);+ --color-secondary: var(--secondary);+ --color-primary-foreground: var(--primary-foreground);+ --color-primary: var(--primary);+ --color-popover-foreground: var(--popover-foreground);+ --color-popover: var(--popover);+ --color-card-foreground: var(--card-foreground);+ --color-card: var(--card);+ --color-foreground: var(--foreground);+ --color-background: var(--background);+ --radius-sm: var(--dbx-radius-sm);+ --radius-md: var(--dbx-radius-md);+ --radius-lg: var(--dbx-radius-lg);+ --radius-xl: var(--dbx-radius-xl);+}++:root {+ --background: rgb(255 255 255);+ --foreground: rgb(10 10 10);+ --card: rgb(255 255 255);+ --card-foreground: rgb(10 10 10);+ --popover: rgb(255 255 255);+ --popover-foreground: rgb(10 10 10);+ --primary: rgb(23 23 23);+ --primary-foreground: rgb(250 250 250);+ --secondary: rgb(245 245 245);+ --secondary-foreground: rgb(23 23 23);+ --muted: rgb(245 245 245);+ --muted-foreground: rgb(115 115 115);+ --accent: rgb(245 245 245);+ --accent-foreground: rgb(23 23 23);+ --destructive: rgb(231 0 11);+ --destructive-rgb: 231, 0, 11;+ --border: rgb(229 229 229);+ --input: rgb(229 229 229);+ --ring: rgb(161 161 161);+ --chart-1: rgb(212 212 212);+ --chart-2: rgb(115 115 115);+ --chart-3: rgb(82 82 82);+ --chart-4: rgb(64 64 64);+ --chart-5: rgb(38 38 38);+ --radius: var(--dbx-radius-md);+ --dbx-radius-default: 4px;+ --dbx-radius-sm: 4px;+ --dbx-radius-md: 4px;+ --dbx-radius-lg: 6px;+ --dbx-radius-xl: 6px;+ --dbx-radius-fixed-4: 4px;+ --dbx-radius-fixed-5: 5px;+ --dbx-radius-fixed-6: 6px;+ --sidebar: rgb(250 250 250);+ --sidebar-foreground: rgb(10 10 10);+ --sidebar-primary: rgb(23 23 23);+ --sidebar-primary-foreground: rgb(250 250 250);+ --sidebar-accent: rgb(245 245 245);+ --sidebar-accent-foreground: rgb(23 23 23);+ --sidebar-border: rgb(229 229 229);+ --sidebar-ring: rgb(161 161 161);+ --success: rgb(22 163 74);+ --success-foreground: rgb(240 253 244);+ --success-bg: color-mix(in srgb, var(--success) 12%, transparent);+ --warning: rgb(217 119 6);+ --warning-foreground: rgb(255 251 235);+ --warning-bg: color-mix(in srgb, var(--warning) 14%, transparent);+ --info: rgb(37 99 235);+ --info-foreground: rgb(239 246 255);+ --info-bg: color-mix(in srgb, var(--info) 12%, transparent);+ --dbx-chrome: rgb(245 245 245);+ --dbx-chrome-muted: rgb(240 240 240);+ --dbx-content: rgb(255 255 255);+ --dbx-editor-toolbar: rgb(250 250 250);+ --dbx-gutter: rgb(243 243 243);+ --dbx-sidebar-header: rgb(250 250 250);+ --dbx-window-top-border: rgb(0 0 0 / 0.35);+ --dbx-viewport-height: 100vh;+}++.dark {+ --background: rgb(19 20 22);+ --foreground: rgb(215 215 219);+ --card: rgb(27 27 30);+ --card-foreground: rgb(215 215 219);+ --popover: rgb(30 30 32);+ --popover-foreground: rgb(221 221 226);+ --primary: rgb(208 208 214);+ --primary-foreground: rgb(19 20 22);+ --secondary: rgb(42 42 45);+ --secondary-foreground: rgb(215 215 219);+ --muted: rgb(42 42 45);+ --muted-foreground: rgb(151 152 157);+ --accent: rgb(46 47 51);+ --accent-foreground: rgb(221 221 226);+ --destructive: rgb(243 98 95);+ --destructive-rgb: 243, 98, 95;+ --border: rgb(110 110 114 / 0.28);+ --input: rgb(110 110 114 / 0.34);+ --ring: rgb(133 134 139);+ --chart-1: rgb(212 212 212);+ --chart-2: rgb(115 115 115);+ --chart-3: rgb(82 82 82);+ --chart-4: rgb(64 64 64);+ --chart-5: rgb(38 38 38);+ --sidebar: rgb(25 25 28);+ --sidebar-foreground: rgb(208 208 213);+ --sidebar-primary: rgb(208 208 214);+ --sidebar-primary-foreground: rgb(19 20 22);+ --sidebar-accent: rgb(44 44 48);+ --sidebar-accent-foreground: rgb(221 221 226);+ --sidebar-border: rgb(110 110 114 / 0.28);+ --sidebar-ring: rgb(133 134 139);+ --success: rgb(74 222 128);+ --success-foreground: rgb(20 30 24);+ --success-bg: color-mix(in srgb, var(--success) 16%, transparent);+ --warning: rgb(251 191 36);+ --warning-foreground: rgb(40 32 12);+ --warning-bg: color-mix(in srgb, var(--warning) 16%, transparent);+ --info: rgb(96 165 250);+ --info-foreground: rgb(18 28 46);+ --info-bg: color-mix(in srgb, var(--info) 16%, transparent);+ --dbx-chrome: rgb(27 27 30);+ --dbx-chrome-muted: rgb(32 32 36);+ --dbx-content: rgb(19 20 22);+ --dbx-editor-toolbar: rgb(25 25 28);+ --dbx-gutter: rgb(23 23 25);+ --dbx-sidebar-header: rgb(25 25 28);+ --dbx-window-top-border: rgb(255 255 255 / 0.18);+}diff --git a/apps/desktop/vite.docs-export.config.ts b/apps/desktop/vite.docs-export.config.tsnew file mode 100644index 0000000000..5c173d1be1--- /dev/null+++ b/apps/desktop/vite.docs-export.config.ts@@ -0,0 +1,160 @@+import { createHash } from "node:crypto";+import { readFileSync, statSync, writeFileSync } from "node:fs";+import path from "node:path";+import { defineConfig } from "vite";+import vue from "@vitejs/plugin-vue";+import tailwindcss from "@tailwindcss/vite";++const repoRoot = path.resolve(__dirname, "../..");+const assetsDir = path.join(repoRoot, "crates/dbx-core/assets");+const fontPath = path.join(__dirname, "public/fonts/geist-latin-wght-normal.woff2");++function sha256(buffer: Buffer | string): string {+ return createHash("sha256").update(buffer).digest("hex");+}++function isFile(file: string): boolean {+ try {+ return statSync(file).isFile();+ } catch {+ return false;+ }+}++interface BundleChunk {+ type: string;+ source?: string | Uint8Array;+ code?: string;+ modules?: Record<string, unknown>;+}++/**+ * Every `@import` a stylesheet actually makes, followed to the files on disk.+ *+ * Tailwind resolves CSS `@import` inside its own plugin, so tokens.css never+ * becomes a Rollup module and the module graph alone cannot see it. This+ * follows the same edges the build follows, from the same bytes — a new+ * `@import` is picked up because it is read out of the file, not matched+ * against a list. Bare specifiers (`tailwindcss`) resolve inside a package and+ * are left to `deps`.+ */+function cssImportsOf(file: string, seen: Set<string>): void {+ const source = readFileSync(file, "utf8");+ for (const match of source.matchAll(/@import\s+(?:url\()?["']([^"']+)["']/g)) {+ const specifier = match[1];+ if (!specifier.startsWith(".") && !specifier.startsWith("/")) continue;+ const resolved = path.resolve(path.dirname(file), specifier);+ if (seen.has(resolved) || !isFile(resolved)) continue;+ seen.add(resolved);+ cssImportsOf(resolved, seen);+ }+}++/**+ * Inline the font and write the staleness manifest.+ *+ * The manifest is derived from Rollup's ACTUAL module graph — plus the CSS+ * `@import` graph the module graph cannot see — never from a hand-written+ * glob. SchemaDiagram.vue imports erDiagram.ts from outside src/docs/, so a+ * glob of that directory would miss it and the guard would pass while the+ * artefact was stale — the same shape as the three guards this feature has+ * already had to widen after the fact.+ *+ * New files are covered for free: a module can only enter the bundle by being+ * imported, which means editing an existing file, which changes that file's+ * hash. The one hole would be `import.meta.glob`, which the viewer does not+ * use.+ */+function exportBundlePlugin() {+ return {+ name: "dbx-docs-export",+ // Vite's own `vite:css-post` creates the stylesheet asset in its+ // generateBundle, and it runs after normal user plugins. Without `post`+ // this hook fires while the CSS does not exist yet and the `@font-face`+ // silently never lands.+ enforce: "post" as const,+ generateBundle(_options: unknown, bundle: Record<string, BundleChunk>) {+ const font = readFileSync(fontPath).toString("base64");+ const fontFace = `@font-face{font-family:"Geist Variable";font-style:normal;font-display:swap;font-weight:100 900;src:url("data:font/woff2;base64,${font}") format("woff2-variations")}\n`;++ const sources: Record<string, string> = {};+ const deps: Record<string, string> = {};++ const record = (rawId: string): void => {+ // Vue splits an SFC into `File.vue?vue&type=style&…` sub-requests and+ // Vite tags CSS the same way. The file on disk is the part before the+ // query; without stripping it every SFC would be missing from the+ // manifest, which is the failure this whole derivation exists to avoid.+ const id = rawId.split("?")[0];+ if (!path.isAbsolute(id)) return;++ // `lastIndexOf`: under pnpm a real path is+ // `<root>/node_modules/.pnpm/[email protected]/node_modules/marked/…`, and+ // the FIRST occurrence yields the package name `.pnpm`.+ const nodeModules = id.lastIndexOf("/node_modules/");+ if (nodeModules !== -1) {+ const after = id.slice(nodeModules + "/node_modules/".length);+ const name = after.startsWith("@") ? after.split("/").slice(0, 2).join("/") : after.split("/")[0];+ if (name in deps) return;+ const manifest = path.join(id.slice(0, nodeModules), "node_modules", name, "package.json");+ if (!isFile(manifest)) return;+ deps[name] = JSON.parse(readFileSync(manifest, "utf8")).version;+ return;+ }++ if (!id.startsWith(repoRoot) || !isFile(id)) return;+ sources[path.relative(repoRoot, id)] = sha256(readFileSync(id));+ };++ const stylesheets = new Set<string>();+ for (const chunk of Object.values(bundle)) {+ for (const id of Object.keys(chunk.modules ?? {})) {+ record(id);+ const file = id.split("?")[0];+ if (file.endsWith(".css") && isFile(file)) cssImportsOf(file, stylesheets);+ }+ }+ for (const file of stylesheets) record(file);+ record(fontPath);+ // This file, and the tsconfig esbuild reads `target` out of. Neither is a+ // module, and both decide emitted bytes: the @font-face template below,+ // `format: "iife"`, the `@source` narrowing. Without them someone can+ // change how the bundle is built, not rebuild, and leave the staleness+ // guard green over artefacts that no longer match the tree.+ record(__filename);+ record(path.join(__dirname, "tsconfig.json"));++ for (const [name, chunk] of Object.entries(bundle)) {+ if (name.endsWith(".css") && typeof chunk.source === "string") chunk.source = fontFace + chunk.source;+ }++ writeFileSync(+ path.join(assetsDir, "docs-export.manifest.json"),+ `${JSON.stringify({ sources: Object.fromEntries(Object.entries(sources).sort()), deps: Object.fromEntries(Object.entries(deps).sort()) }, null, 2)}\n`,+ );+ },+ };+}++export default defineConfig({+ root: __dirname,+ // The app's public/ holds the font files this build inlines. Left on, Vite+ // would copy all of them into crates/dbx-core/assets beside the bundle.+ publicDir: false,+ plugins: [vue(), tailwindcss(), exportBundlePlugin()],+ resolve: { alias: { "@": path.resolve(__dirname, "src") } },+ build: {+ outDir: assetsDir,+ emptyOutDir: false,+ cssCodeSplit: false,+ rollupOptions: {+ input: path.resolve(__dirname, "src/docs-export/main.ts"),+ // `iife`, not the default `es`, for two reasons: Task 6 inlines this into+ // a document opened over file://, where a module script is subject to+ // CORS-flavoured rules no plain <script> has to satisfy — and an iife is+ // one file by construction, where an es bundle could split into chunks+ // the export would have to load over a network it does not have.+ output: { format: "iife", entryFileNames: "docs-export.js", assetFileNames: "docs-export.[ext]" },+ },+ },+});diff --git a/crates/dbx-cli/src/main.rs b/crates/dbx-cli/src/main.rsindex 21588f71a9..76cd97b9d4 100644--- a/crates/dbx-cli/src/main.rs+++ b/crates/dbx-cli/src/main.rs@@ -94,6 +94,7 @@ struct Flags {file: Option<PathBuf>,out: Option<PathBuf>,notes: Option<PathBuf>,+ lang: Option<String>,allow_writes: bool,allow_dangerous: bool,help: bool,@@ -245,6 +246,9 @@ async fn run_with_backend(backend: &dyn DbxBackend, flags: Flags) -> Result<Striif args.first().is_some_and(|arg| arg == "dbml") {return run_dbml(backend, &flags).await;}+ if args.first().is_some_and(|arg| arg == "docs") {+ return run_docs(backend, &flags).await;+ }if args.first().is_some_and(|arg| arg == "open") {ensure_arg_count(args, 3, "dbx open")?;let connection = required(args.get(1), "Connection name is required.")?;@@ -498,6 +502,61 @@ async fn run_dbml(backend: &dyn DbxBackend, flags: &Flags) -> Result<String, Cli}}+async fn run_docs(backend: &dyn DbxBackend, flags: &Flags) -> Result<String, CliError> {+ let args = &flags.args;+ let connection_name = required(args.get(1), "Connection name is required.")?;+ let connection = find_connection(backend, connection_name).await?;+ let database = selected_database(&connection, flags.database.as_deref());++ let options = DocsSnapshotOptions {+ schemas: flags.schema.clone().into_iter().collect(),+ tables: flags.tables.clone(),+ project_name: Some(connection.name.clone()),+ };++ let mut snapshot = backend.collect_docs_snapshot(&connection, &database, options).await.map_err(command_error)?;++ // Unlike run_dbml, the AnnotationFile is needed AFTER it has been applied:+ // the merge resolves groups into TableGroups and drops the hue the viewer+ // colours with, so the raw file has to travel too.+ //+ // AnnotationFile does not derive Default and `format_version` must be 1,+ // so the empty value is constructed explicitly rather than defaulted.+ let mut annotations = dbx_core::docs::annotations::AnnotationFile {+ format_version: 1,+ project: None,+ groups: Vec::new(),+ tables: std::collections::BTreeMap::new(),+ };+ if let Some(path) = flags.notes.as_ref() {+ require_notes_file(path)?;+ if let Some(loaded) = dbx_core::docs::annotations::load_annotations(path)+ .map_err(|error| CliError::new("NOTES_INVALID", error))?+ {+ dbx_core::docs::annotations::apply_annotations(&mut snapshot, &loaded, connection.db_type);+ annotations = loaded;+ }+ }++ for warning in &snapshot.warnings {+ eprintln!("warning: {warning}");+ }++ let lang = flags.lang.as_deref().unwrap_or("en");+ let html = dbx_core::docs::to_standalone_html(&snapshot, &annotations, lang)+ .map_err(|error| CliError::new("EXPORT_FAILED", error))?;++ match flags.out.as_ref() {+ Some(path) => {+ std::fs::write(path, &html).map_err(|error| {+ CliError::new("WRITE_FAILED", format!("Failed to write {}: {error}", path.display()))+ })?;+ Ok(format!("Wrote {} bytes to {}", html.len(), path.display()))+ }+ None => Ok(html),+ }+}+async fn find_connection(backend: &dyn DbxBackend, name: &str) -> Result<ConnectionConfig, CliError> {backend.load_connections()@@ -525,6 +584,7 @@ fn parse_flags(argv: &[String]) -> Result<Flags, CliError> {file: None,out: None,notes: None,+ lang: None,allow_writes: false,allow_dangerous: false,help: false,@@ -571,6 +631,7 @@ fn parse_flags(argv: &[String]) -> Result<Flags, CliError> {"--file" => flags.file = Some(PathBuf::from(option_value(argv, &mut index, "--file")?)),"--out" => flags.out = Some(PathBuf::from(option_value(argv, &mut index, "--out")?)),"--notes" => flags.notes = Some(PathBuf::from(option_value(argv, &mut index, "--notes")?)),+ "--lang" => flags.lang = Some(option_value(argv, &mut index, "--lang")?),"--allow-writes" => flags.allow_writes = true,"--allow-dangerous-sql" => flags.allow_dangerous = true,value if value.starts_with('-') => {@@ -914,7 +975,7 @@ fn csv_cell(value: &str) -> String {}fn usage() -> &'static str {- "Usage:\n dbx doctor [--json]\n dbx capabilities [--json]\n dbx connections list [--json]\n dbx schema list <connection> [--schema name] [--json]\n dbx schema describe <connection> <table> [--schema name] [--json]\n dbx query <connection> <sql> [--file path] [--limit n] [--timeout 10s] [--allow-writes] [--allow-dangerous-sql] [--json]\n dbx context <connection> [--schema name] [--tables a,b] [--max-tables n] [--json]\n dbx dbml <connection> [--out path] [--notes path] [--schema name] [--database name] [--tables a,b]\n dbx open <connection> <table> [--schema name] [--database name] [--json]"+ "Usage:\n dbx doctor [--json]\n dbx capabilities [--json]\n dbx connections list [--json]\n dbx schema list <connection> [--schema name] [--json]\n dbx schema describe <connection> <table> [--schema name] [--json]\n dbx query <connection> <sql> [--file path] [--limit n] [--timeout 10s] [--allow-writes] [--allow-dangerous-sql] [--json]\n dbx context <connection> [--schema name] [--tables a,b] [--max-tables n] [--json]\n dbx dbml <connection> [--out path] [--notes path] [--schema name] [--database name] [--tables a,b]\n dbx docs <connection> [--out path] [--notes path] [--lang code] [--schema name] [--database name] [--tables a,b]\n dbx open <connection> <table> [--schema name] [--database name] [--json]"}#[cfg(test)]@@ -1251,4 +1312,21 @@ mod tests {fn dbml_appears_in_the_usage_text() {assert!(usage().contains("dbx dbml <connection>"), "got: {}", usage());}++ #[test]+ fn parses_the_lang_flag() {+ let flags = parse_flags(&args(&["docs", "local", "--lang", "zh-CN"])).expect("parse");+ assert_eq!(flags.args, args(&["docs", "local"]));+ assert_eq!(flags.lang.as_deref(), Some("zh-CN"));+ }++ #[test]+ fn lang_requires_a_value() {+ parse_flags(&args(&["docs", "local", "--lang"])).expect_err("should fail");+ }++ #[test]+ fn docs_appears_in_the_usage_text() {+ assert!(usage().contains("dbx docs <connection>"), "got: {}", usage());+ }}diff --git a/crates/dbx-core/assets/docs-export.css b/crates/dbx-core/assets/docs-export.cssnew file mode 100644index 0000000000..b9cf839c15--- /dev/null+++ b/crates/dbx-core/assets/docs-export.css@@ -0,0 +1,3 @@+@font-face{font-family:"Geist Variable";font-style:normal;font-display:swap;font-weight:100 900;src:url("data:font/woff2;base64,d09GMgABAAAAAHLYABQAAAABAQgAAHJiAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoYFG4GfHhyHTD9IVkFSh1s/TVZBUjwGYD9TVEFUgTgAhRAvfhEICvZo3iMLhEIAMIGoaAE2AiQDiQAEIAWIGgeLSQwHGyLxFWxXY6CewOalNZfPMyrYrmbcDkTU+r1qNsKGjQMg3hwT/X9SUhlDE9iTFqA63e4PtWQjlBo5goYcMo0ZqbViQ0jvqjjmPNf7mgM3sj6o9UXp+5FQOzPJbOE3Jx5hd/ytpmpjm0pYR9BzruG68ZnXxBVYEMSHMTAwnWpYTZ0wG3f74drkjkO9/6wik1904hQkUpdYDWmJLZFY0pNBEcb7IndF19PSj1kEuE38iIQcX4SK1qgisnr6gFERPc4+OgJHpJCEZJaAxtzpl8/CAc8Rzfk/exe9hCSEEEII4fAAIZilNJgFLUVSVAJFvJRHwV/VaP29R8UpddoiNaXiVOXz+nnW8vzTuOd/7TP3wUxgI76kJCdlOHSryZ2cIZquptBglVCzlLbxtmnUViK7SXY3ySbepI23Th21In7G/T/8PXD3nBn2TjlRgXtD5X9y8/sLj1BKDapUxtT7bcyW//zF1njpmb9ZiFmfWWVarEkKASLEBdHC8/y9O39WtzE54I1pQBMnULgfMHXC/yed9r1BDQhtGTCKA5+y+w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Ly5jUDhRbmNnsrE46aPimx013ePY7wB8LW5oMvlSGjTjokAGH/aHfSadQEfHQUy+9McfUpUOvHr+aFx+VpHujzQn0TKPdChyffTGIZMrEUpm28sOIr9NVCQmLiGrRqk27mLgOnbokJFkgwHx3PXLPfY9TM2oOlBhJT6QLxgd7xGI5JJaJJfN7RP1DyX7a45hLtkllKpaUw/My8Yxom9R6543Fx5aeR/TJYGTuofT7jWXmDA2m756xyWzm7Z7uxffcvdYV354Jfo32TNk735xd7e12DfYMzny9+sJ2zwuWCmEWBGHmB4lAVgBhLwv7FwuwQ31pC5YCHBRAAhDcHAgAIKk95Y6RilXieKJYDGuiUk/Ge3JEFVFlVOWq5XtB4qbcklP32SR+z/ecmD4hC1n70ILKKLdyL4G95M4h0yd/JxCIrhvh4IA7C/c7mOtTjcaqnyj01bCUh+1qnSV3zm4du3P2bdjJP3guwdzukfexk+PD8yP2N5i98J4Qq7Gsav6xIo9fyA4kPKlkMxLuolJPGV8Gmj/W05+6m0telBsa6ttNYpBjC1NDY3tHXHVbkKr8ETJ1oVS0gv9gq+1iSywHTbIO9GwYeTXv/u5eynYA") format("woff2-variations")}+.docs-group{--group-c:hsl(var(--h,220), 55%, 38%);--group-tint:hsl(var(--h,220), 55%, 94%)}.dark .docs-group{--group-c:hsl(var(--h,220), 50%, 72%);--group-tint:hsl(var(--h,220), 30%, 18%)}.docs-ground-light .docs-group{--group-c:hsl(var(--h,220), 55%, 38%);--group-tint:hsl(var(--h,220), 55%, 94%)}@supports (color:oklch(1 0 0)){.docs-group{--group-c:oklch(.55 .15 var(--h,220));--group-tint:oklch(.96 .03 var(--h,220))}.dark .docs-group{--group-c:oklch(.76 .13 var(--h,220));--group-tint:oklch(.28 .05 var(--h,220))}.docs-ground-light .docs-group{--group-c:oklch(.55 .15 var(--h,220));--group-tint:oklch(.96 .03 var(--h,220))}}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-neutral-900:oklch(20.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--leading-relaxed:1.625;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Geist Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.fixed{position:fixed}.inset-0{inset:calc(var(--spacing) * 0)}.z-50{z-index:50}.mx-1\.5{margin-inline:calc(var(--spacing) * 1.5)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline{display:inline}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-full{height:100%}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-0{min-height:calc(var(--spacing) * 0)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-14{width:calc(var(--spacing) * 14)}.w-64{width:calc(var(--spacing) * 64)}.w-full{width:100%}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize-y{resize:vertical}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--dbx-radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-300{border-color:var(--color-amber-300)}.border-border{border-color:var(--border)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-background{background-color:var(--background)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-muted,.bg-muted\/20{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/20{background-color:color-mix(in oklab, var(--muted) 20%, transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/30{background-color:color-mix(in oklab, var(--muted) 30%, transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/50{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.fill-card{fill:var(--card)}.fill-foreground{fill:var(--foreground)}.fill-muted-foreground{fill:var(--muted-foreground)}.stroke-border{stroke:var(--border)}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-amber-900{color:var(--color-amber-900)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.uppercase{text-transform:uppercase}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ring{--tw-ring-color:var(--ring)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:bg-muted\/30:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/30:hover{background-color:color-mix(in oklab, var(--muted) 30%, transparent)}}.hover\:bg-muted\/40:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/40:hover{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}}.focus\:border-ring:focus{border-color:var(--ring)}@media (width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.dark\:border-amber-900\/40:is(.dark *){border-color:#7b330666}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-900\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-amber-900) 40%, transparent)}}.dark\:bg-amber-950\/30:is(.dark *){background-color:#4619014d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-950\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-950) 30%, transparent)}}.dark\:text-amber-200:is(.dark *){color:var(--color-amber-200)}}:root{--background:#fff;--foreground:#0a0a0a;--card:#fff;--card-foreground:#0a0a0a;--popover:#fff;--popover-foreground:#0a0a0a;--primary:#171717;--primary-foreground:#fafafa;--secondary:#f5f5f5;--secondary-foreground:#171717;--muted:#f5f5f5;--muted-foreground:#737373;--accent:#f5f5f5;--accent-foreground:#171717;--destructive:#e7000b;--destructive-rgb:231, 0, 11;--border:#e5e5e5;--input:#e5e5e5;--ring:#a1a1a1;--chart-1:#d4d4d4;--chart-2:#737373;--chart-3:#525252;--chart-4:#404040;--chart-5:#262626;--radius:var(--dbx-radius-md);--dbx-radius-default:4px;--dbx-radius-sm:4px;--dbx-radius-md:4px;--dbx-radius-lg:6px;--dbx-radius-xl:6px;--dbx-radius-fixed-4:4px;--dbx-radius-fixed-5:5px;--dbx-radius-fixed-6:6px;--sidebar:#fafafa;--sidebar-foreground:#0a0a0a;--sidebar-primary:#171717;--sidebar-primary-foreground:#fafafa;--sidebar-accent:#f5f5f5;--sidebar-accent-foreground:#171717;--sidebar-border:#e5e5e5;--sidebar-ring:#a1a1a1;--success:#16a34a;--success-foreground:#f0fdf4;--success-bg:var(--success)}@supports (color:color-mix(in lab, red, red)){:root{--success-bg:color-mix(in srgb, var(--success) 12%, transparent)}}:root{--warning:#d97706;--warning-foreground:#fffbeb;--warning-bg:var(--warning)}@supports (color:color-mix(in lab, red, red)){:root{--warning-bg:color-mix(in srgb, var(--warning) 14%, transparent)}}:root{--info:#2563eb;--info-foreground:#eff6ff;--info-bg:var(--info)}@supports (color:color-mix(in lab, red, red)){:root{--info-bg:color-mix(in srgb, var(--info) 12%, transparent)}}:root{--dbx-chrome:#f5f5f5;--dbx-chrome-muted:#f0f0f0;--dbx-content:#fff;--dbx-editor-toolbar:#fafafa;--dbx-gutter:#f3f3f3;--dbx-sidebar-header:#fafafa;--dbx-window-top-border:#00000059;--dbx-viewport-height:100vh}.dark{--background:#131416;--foreground:#d7d7db;--card:#1b1b1e;--card-foreground:#d7d7db;--popover:#1e1e20;--popover-foreground:#dddde2;--primary:#d0d0d6;--primary-foreground:#131416;--secondary:#2a2a2d;--secondary-foreground:#d7d7db;--muted:#2a2a2d;--muted-foreground:#97989d;--accent:#2e2f33;--accent-foreground:#dddde2;--destructive:#f3625f;--destructive-rgb:243, 98, 95;--border:#6e6e7247;--input:#6e6e7257;--ring:#85868b;--chart-1:#d4d4d4;--chart-2:#737373;--chart-3:#525252;--chart-4:#404040;--chart-5:#262626;--sidebar:#19191c;--sidebar-foreground:#d0d0d5;--sidebar-primary:#d0d0d6;--sidebar-primary-foreground:#131416;--sidebar-accent:#2c2c30;--sidebar-accent-foreground:#dddde2;--sidebar-border:#6e6e7247;--sidebar-ring:#85868b;--success:#4ade80;--success-foreground:#141e18;--success-bg:var(--success)}@supports (color:color-mix(in lab, red, red)){.dark{--success-bg:color-mix(in srgb, var(--success) 16%, transparent)}}.dark{--warning:#fbbf24;--warning-foreground:#28200c;--warning-bg:var(--warning)}@supports (color:color-mix(in lab, red, red)){.dark{--warning-bg:color-mix(in srgb, var(--warning) 16%, transparent)}}.dark{--info:#60a5fa;--info-foreground:#121c2e;--info-bg:var(--info)}@supports (color:color-mix(in lab, red, red)){.dark{--info-bg:color-mix(in srgb, var(--info) 16%, transparent)}}.dark{--dbx-chrome:#1b1b1e;--dbx-chrome-muted:#202024;--dbx-content:#131416;--dbx-editor-toolbar:#19191c;--dbx-gutter:#171719;--dbx-sidebar-header:#19191c;--dbx-window-top-border:#ffffff2e}html,body,#app{height:100%}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}+/*$vite$:1*/\ No newline at end of filediff --git a/crates/dbx-core/assets/docs-export.js b/crates/dbx-core/assets/docs-export.jsnew file mode 100644index 0000000000..5be8fc080d--- /dev/null+++ b/crates/dbx-core/assets/docs-export.js@@ -0,0 +1,64 @@+(function(){function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),ee=e=>x(e).slice(8,-1),S=e=>x(e)===`[object Object]`,te=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ne=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),re=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ie=/-\w/g,C=re(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),ae=/\B([A-Z])/g,w=re(e=>e.replace(ae,`-$1`).toLowerCase()),oe=re(e=>e.charAt(0).toUpperCase()+e.slice(1)),se=re(e=>e?`on${oe(e)}`:``),ce=(e,t)=>!Object.is(e,t),le=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},T=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ue=e=>{let t=parseFloat(e);return isNaN(t)?e:t},de,fe=()=>de||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function E(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?ge(r):E(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(g(e)||v(e))return e}var pe=/;(?![^(]*\))/g,me=/:([^]+)/,he=/\/\*[^]*?\*\//g;function ge(e){let t={};return e.replace(he,``).split(pe).forEach(e=>{if(e){let n=e.split(me);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function D(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=D(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var _e=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ve=e(_e);_e+``;function ye(e){return!!e||e===``}function be(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=xe(e[r],t[r]);return n}function xe(e,t){if(e===t)return!0;let n=m(e),r=m(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=_(e),r=_(t),n||r)return e===t;if(n=d(e),r=d(t),n||r)return n&&r?be(e,t):!1;if(n=v(e),r=v(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!xe(e[n],t[n]))return!1}}return String(e)===String(t)}function Se(e,t){return e.findIndex(e=>xe(e,t))}var Ce=e=>!!(e&&e.__v_isRef===!0),O=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?Ce(e)?O(e.value):JSON.stringify(e,we,2):String(e),we=(e,t)=>Ce(t)?we(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Te(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Te(e))}:_(t)?Te(t):v(t)&&!d(t)&&!S(t)?String(t):t,Te=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,k,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&k&&(k.active?(this.parent=k,this.index=(k.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=k;try{return k=this,e()}finally{k=t}}}on(){++this._on===1&&(this.prevScope=k,k=this)}off(){if(this._on>0&&--this._on===0){if(k===this)k=this.prevScope;else{let e=k;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function De(){return k}var A,Oe=new WeakSet,ke=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,k&&(k.active?k.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Oe.has(this)&&(Oe.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ne(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ke(this),Ie(this);let e=A,t=He;A=this,He=!0;try{return this.fn()}finally{Le(this),A=e,He=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Be(e);this.deps=this.depsTail=void 0,Ke(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Oe.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Re(this)&&this.run()}get dirty(){return Re(this)}},Ae=0,je,Me;function Ne(e,t=!1){if(e.flags|=8,t){e.next=Me,Me=e;return}e.next=je,je=e}function Pe(){Ae++}function Fe(){if(--Ae>0)return;if(Me){let e=Me;for(Me=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;je;){let t=je;for(je=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ie(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Le(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Be(r),Ve(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Re(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ze(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ze(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qe)||(e.globalVersion=qe,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Re(e))))return;e.flags|=2;let t=e.dep,n=A,r=He;A=e,He=!0;try{Ie(e);let n=e.fn(e._value);(t.version===0||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{A=n,He=r,Le(e),e.flags&=-3}}function Be(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Be(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ve(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var He=!0,Ue=[];function We(){Ue.push(He),He=!1}function Ge(){let e=Ue.pop();He=e===void 0?!0:e}function Ke(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=A;A=void 0;try{t()}finally{A=e}}}var qe=0,Je=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ye=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!A||!He||A===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==A)t=this.activeLink=new Je(A,this),A.deps?(t.prevDep=A.depsTail,A.depsTail.nextDep=t,A.depsTail=t):A.deps=A.depsTail=t,Xe(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=A.depsTail,t.nextDep=void 0,A.depsTail.nextDep=t,A.depsTail=t,A.deps===t&&(A.deps=e)}return t}trigger(e){this.version++,qe++,this.notify(e)}notify(e){Pe();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Fe()}}};function Xe(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Xe(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Ze=new WeakMap,Qe=Symbol(``),$e=Symbol(``),et=Symbol(``);function j(e,t,n){if(He&&A){let t=Ze.get(e);t||Ze.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ye),r.map=t,r.key=n),r.track()}}function tt(e,t,n,r,i,a){let o=Ze.get(e);if(!o){qe++;return}let s=e=>{e&&e.trigger()};if(Pe(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&te(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===et||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(et)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Qe)),f(e)&&s(o.get($e)));break;case`delete`:i||(s(o.get(Qe)),f(e)&&s(o.get($e)));break;case`set`:f(e)&&s(o.get(Qe));break}}Fe()}function nt(e){let t=M(e);return t===e?t:(j(t,`iterate`,et),Vt(e)?t:t.map(Wt))}function rt(e){return j(e=M(e),`iterate`,et),e}function it(e,t){return Bt(e)?Gt(zt(e)?Wt(t):t):Wt(t)}var at={__proto__:null,[Symbol.iterator](){return ot(this,Symbol.iterator,e=>it(this,e))},concat(...e){return nt(this).concat(...e.map(e=>d(e)?nt(e):e))},entries(){return ot(this,`entries`,e=>(e[1]=it(this,e[1]),e))},every(e,t){return ct(this,`every`,e,t,void 0,arguments)},filter(e,t){return ct(this,`filter`,e,t,e=>e.map(e=>it(this,e)),arguments)},find(e,t){return ct(this,`find`,e,t,e=>it(this,e),arguments)},findIndex(e,t){return ct(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return ct(this,`findLast`,e,t,e=>it(this,e),arguments)},findLastIndex(e,t){return ct(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return ct(this,`forEach`,e,t,void 0,arguments)},includes(...e){return ut(this,`includes`,e)},indexOf(...e){return ut(this,`indexOf`,e)},join(e){return nt(this).join(e)},lastIndexOf(...e){return ut(this,`lastIndexOf`,e)},map(e,t){return ct(this,`map`,e,t,void 0,arguments)},pop(){return dt(this,`pop`)},push(...e){return dt(this,`push`,e)},reduce(e,...t){return lt(this,`reduce`,e,t)},reduceRight(e,...t){return lt(this,`reduceRight`,e,t)},shift(){return dt(this,`shift`)},some(e,t){return ct(this,`some`,e,t,void 0,arguments)},splice(...e){return dt(this,`splice`,e)},toReversed(){return nt(this).toReversed()},toSorted(e){return nt(this).toSorted(e)},toSpliced(...e){return nt(this).toSpliced(...e)},unshift(...e){return dt(this,`unshift`,e)},values(){return ot(this,`values`,e=>it(this,e))}};function ot(e,t,n){let r=rt(e),i=r[t]();return r!==e&&!Vt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var st=Array.prototype;function ct(e,t,n,r,i,a){let o=rt(e),s=o!==e&&!Vt(e),c=o[t];if(c!==st[t]){let t=c.apply(e,a);return s?Wt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,it(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function lt(e,t,n,r){let i=rt(e),a=i!==e&&!Vt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=it(e,t)),n.call(this,t,it(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?it(e,c):c}function ut(e,t,n){let r=M(e);j(r,`iterate`,et);let i=r[t](...n);return(i===-1||i===!1)&&Ht(n[0])?(n[0]=M(n[0]),r[t](...n)):i}function dt(e,t,n=[]){We(),Pe();let r=M(e)[t].apply(e,n);return Fe(),Ge(),r}var ft=e(`__proto__,__v_isRef,__isVue`),pt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function mt(e){_(e)||(e=String(e));let t=M(this);return j(t,`has`,e),t.hasOwnProperty(e)}var ht=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Nt:Mt:i?jt:At).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=at[t]))return e;if(t===`hasOwnProperty`)return mt}let o=Reflect.get(e,t,N(e)?e:n);if((_(t)?pt.has(t):ft(t))||(r||j(e,`get`,t),i))return o;if(N(o)){let e=a&&te(t)?o:o.value;return r&&v(e)?Lt(e):e}return v(o)?r?Lt(o):Ft(o):o}},gt=class extends ht{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&te(t);if(!this._isShallow){let e=Bt(i);if(!Vt(n)&&!Bt(n)&&(i=M(i),n=M(n)),!a&&N(i)&&!N(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:u(e,t),s=Reflect.set(e,t,n,N(e)?e:r);return e===M(r)&&(o?ce(n,i)&&tt(e,`set`,t,n,i):tt(e,`add`,t,n)),s}deleteProperty(e,t){let n=u(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&tt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!_(t)||!pt.has(t))&&j(e,`has`,t),n}ownKeys(e){return j(e,`iterate`,d(e)?`length`:Qe),Reflect.ownKeys(e)}},_t=class extends ht{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},vt=new gt,yt=new _t,bt=new gt(!0),xt=e=>e,St=e=>Reflect.getPrototypeOf(e);function Ct(e,t,n){return function(...r){let i=this.__v_raw,a=M(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?xt:t?Gt:Wt;return!t&&j(a,`iterate`,l?$e:Qe),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function wt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Tt(e,t){let n={get(n){let r=this.__v_raw,i=M(r),a=M(n);e||(ce(n,a)&&j(i,`get`,n),j(i,`get`,a));let{has:o}=St(i),s=t?xt:e?Gt:Wt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&j(M(t),`iterate`,Qe),t.size},has(t){let n=this.__v_raw,r=M(n),i=M(t);return e||(ce(t,i)&&j(r,`has`,t),j(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=M(a),s=t?xt:e?Gt:Wt;return!e&&j(o,`iterate`,Qe),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:wt(`add`),set:wt(`set`),delete:wt(`delete`),clear:wt(`clear`)}:{add(e){let n=M(this),r=St(n),i=M(e),a=!t&&!Vt(e)&&!Bt(e)?i:e;return r.has.call(n,a)||ce(e,a)&&r.has.call(n,e)||ce(i,a)&&r.has.call(n,i)||(n.add(a),tt(n,`add`,a,a)),this},set(e,n){!t&&!Vt(n)&&!Bt(n)&&(n=M(n));let r=M(this),{has:i,get:a}=St(r),o=i.call(r,e);o||=(e=M(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?ce(n,s)&&tt(r,`set`,e,n,s):tt(r,`add`,e,n),this},delete(e){let t=M(this),{has:n,get:r}=St(t),i=n.call(t,e);i||=(e=M(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&tt(t,`delete`,e,void 0,a),o},clear(){let e=M(this),t=e.size!==0,n=e.clear();return t&&tt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ct(r,e,t)}),n}function Et(e,t){let n=Tt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var Dt={get:Et(!1,!1)},Ot={get:Et(!1,!0)},kt={get:Et(!0,!1)},At=new WeakMap,jt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap;function Pt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Ft(e){return Bt(e)?e:Rt(e,!1,vt,Dt,At)}function It(e){return Rt(e,!1,bt,Ot,jt)}function Lt(e){return Rt(e,!0,yt,kt,Mt)}function Rt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Pt(ee(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function zt(e){return Bt(e)?zt(e.__v_raw):!!(e&&e.__v_isReactive)}function Bt(e){return!!(e&&e.__v_isReadonly)}function Vt(e){return!!(e&&e.__v_isShallow)}function Ht(e){return e?!!e.__v_raw:!1}function M(e){let t=e&&e.__v_raw;return t?M(t):e}function Ut(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&T(e,`__v_skip`,!0),e}var Wt=e=>v(e)?Ft(e):e,Gt=e=>v(e)?Lt(e):e;function N(e){return e?e.__v_isRef===!0:!1}function P(e){return Kt(e,!1)}function Kt(e,t){return N(e)?e:new qt(e,t)}var qt=class{constructor(e,t){this.dep=new Ye,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:M(e),this._value=t?e:Wt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Vt(e)||Bt(e);e=n?e:M(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Wt(e),this.dep.trigger())}};function F(e){return N(e)?e.value:e}var Jt={get:(e,t,n)=>t===`__v_raw`?e:F(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return N(i)&&!N(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Yt(e){return zt(e)?e:new Proxy(e,Jt)}var Xt=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ye(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qe-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&A!==this)return Ne(this,!0),!0}get value(){let e=this.dep.track();return ze(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Zt(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new Xt(r,i,n)}var Qt={},$t=new WeakMap,en=void 0;function tn(e,t=!1,n=en){if(n){let t=$t.get(n);t||$t.set(n,t=[]),t.push(e)}}function nn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:Vt(e)||o===!1||o===0?rn(e,1):rn(e),m,g,_,v,y=!1,b=!1;if(N(e)?(g=()=>e.value,y=Vt(e)):zt(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>zt(e)||Vt(e)),g=()=>e.map(e=>{if(N(e))return e.value;if(zt(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){We();try{_()}finally{Ge()}}let t=en;en=m;try{return f?f(e,3,[v]):e(v)}finally{en=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>rn(e(),t)}let x=De(),ee=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{e(...t),ee()}}let S=b?Array(e.length).fill(Qt):Qt,te=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(n){let e=m.run();if(o||y||(b?e.some((e,t)=>ce(e,S[t])):ce(e,S))){_&&_();let t=en;en=m;try{let t=[e,S===Qt?void 0:b&&S[0]===Qt?[]:S,v];S=e,f?f(n,3,t):n(...t)}finally{en=t}}}else m.run()};return u&&u(te),m=new ke(g),m.scheduler=l?()=>l(te,!1):te,v=e=>tn(e,!1,m),_=m.onStop=()=>{let e=$t.get(m);if(e){if(f)f(e,4);else for(let t of e)t();$t.delete(m)}},n?a?te(!0):S=m.run():l?l(te.bind(null,!0),!0):m.run(),ee.pause=m.pause.bind(m),ee.resume=m.resume.bind(m),ee.stop=ee,ee}function rn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,N(e))rn(e.value,t,n);else if(d(e))for(let r=0;r<e.length;r++)rn(e[r],t,n);else if(p(e)||f(e))e.forEach(e=>{rn(e,t,n)});else if(S(e)){for(let r in e)rn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&rn(e[r],t,n)}return e}function an(e,t,n,r){try{return r?e(...r):e()}catch(e){sn(e,t,n)}}function on(e,t,n,r){if(h(e)){let i=an(e,t,n,r);return i&&y(i)&&i.catch(e=>{sn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a<e.length;a++)i.push(on(e[a],t,n,r));return i}}function sn(e,n,r,i=!0){let a=n?n.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=n&&n.appContext.config||t;if(n){let t=n.parent,i=n.proxy,a=`https://vuejs.org/error-reference/#runtime-${r}`;for(;t;){let n=t.ec;if(n){for(let t=0;t<n.length;t++)if(n[t](e,i,a)===!1)return}t=t.parent}if(o){We(),an(o,null,10,[e,i,a]),Ge();return}}cn(e,r,a,i,s)}function cn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var I=[],ln=-1,un=[],dn=null,fn=0,pn=Promise.resolve(),mn=null;function hn(e){let t=mn||pn;return e?t.then(this?e.bind(this):e):t}function gn(e){let t=ln+1,n=I.length;for(;t<n;){let r=t+n>>>1,i=I[r],a=Sn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function _n(e){if(!(e.flags&1)){let t=Sn(e),n=I[I.length-1];!n||!(e.flags&2)&&t>=Sn(n)?I.push(e):I.splice(gn(t),0,e),e.flags|=1,vn()}}function vn(){mn||=pn.then(Cn)}function yn(e){d(e)?un.push(...e):dn&&e.id===-1?dn.splice(fn+1,0,e):e.flags&1||(un.push(e),e.flags|=1),vn()}function bn(e,t,n=ln+1){for(;n<I.length;n++){let t=I[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;I.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function xn(e){if(un.length){let e=[...new Set(un)].sort((e,t)=>Sn(e)-Sn(t));if(un.length=0,dn){dn.push(...e);return}for(dn=e,fn=0;fn<dn.length;fn++){let e=dn[fn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}dn=null,fn=0}}var Sn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Cn(e){try{for(ln=0;ln<I.length;ln++){let e=I[ln];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),an(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ln<I.length;ln++){let e=I[ln];e&&(e.flags&=-2)}ln=-1,I.length=0,xn(e),mn=null,(I.length||un.length)&&Cn(e)}}var wn=null,Tn=null;function En(e){let t=wn;return wn=e,Tn=e&&e.type.__scopeId||null,t}function Dn(e,t=wn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ki(-1);let i=En(t),a;try{a=e(...n)}finally{En(i),r._d&&ki(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function On(e,n){if(wn===null)return e;let r=la(wn),i=e.dirs||=[];for(let e=0;e<n.length;e++){let[a,o,s,c=t]=n[e];a&&(h(a)&&(a={mounted:a,updated:a}),a.deep&&rn(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function kn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(We(),on(c,n,8,[e.el,s,e,t]),Ge())}}function An(e,t){if(J){let n=J.provides,r=J.parent&&J.parent.provides;r===n&&(n=J.provides=Object.create(r)),n[e]=t}}function jn(e,t,n=!1){let r=Ji();if(r||Pr){let i=Pr?Pr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&h(t)?t.call(r&&r.proxy):t}}var Mn=Symbol.for(`v-scx`),Nn=()=>jn(Mn);function Pn(e,t,n){return Fn(e,t,n)}function Fn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(ea){if(c===`sync`){let e=Nn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=J;u.call=(e,t,n)=>on(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{B(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():_n(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=nn(e,n,u);return ea&&(f?f.push(h):d&&h()),h}function In(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Ln(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Zi(this),s=Fn(i,a.bind(r),n);return o(),s}function Ln(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Rn=Symbol(`_vte`),zn=e=>e.__isTeleport,Bn=Symbol(`_leaveCb`);function Vn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function L(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function Hn(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function Un(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Wn=new WeakMap;function Gn(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>Gn(e,n&&(d(n)?n[t]:n),r,a,o));return}if(qn(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Gn(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?la(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=M(v),b=v===t?i:e=>Un(_,e)?!1:u(y,e),x=(e,t)=>!(t&&Un(_,t));if(m!=null&&m!==p){if(Kn(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(N(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))an(p,f,12,[l,_]);else{let t=g(p),n=N(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),Wn.delete(e)};t.id=-1,Wn.set(e,t),B(t,r)}else Kn(e),i()}}}function Kn(e){let t=Wn.get(e);t&&(t.flags|=8,Wn.delete(e))}fe().requestIdleCallback,fe().cancelIdleCallback;var qn=e=>!!e.type.__asyncLoader,Jn=e=>e.type.__isKeepAlive;function Yn(e,t){Zn(e,`a`,t)}function Xn(e,t){Zn(e,`da`,t)}function Zn(e,t,n=J){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if($n(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Jn(e.parent.vnode)&&Qn(r,t,n,e),e=e.parent}}function Qn(e,t,n,r){let i=$n(t,e,r,!0);or(()=>{c(r[t],i)},n)}function $n(e,t,n=J,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{We();let i=Zi(n),a=on(t,n,e,r);return i(),Ge(),a};return r?i.unshift(a):i.push(a),a}}var er=e=>(t,n=J)=>{(!ea||e===`sp`)&&$n(e,(...e)=>t(...e),n)},tr=er(`bm`),nr=er(`m`),rr=er(`bu`),ir=er(`u`),ar=er(`bum`),or=er(`um`),sr=er(`sp`),cr=er(`rtg`),lr=er(`rtc`);function ur(e,t=J){$n(`ec`,e,t)}var dr=Symbol.for(`v-ndc`);function R(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&zt(e),r=!1,s=!1;n&&(r=!Vt(e),s=Bt(e),e=rt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Gt(Wt(e[n])):Wt(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(v(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}var fr=e=>e?$i(e)?la(e):fr(e.parent):null,pr=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>fr(e.parent),$root:e=>fr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Sr(e),$forceUpdate:e=>e.f||=()=>{_n(e.update)},$nextTick:e=>e.n||=hn.bind(e.proxy),$watch:e=>In.bind(e)}),mr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),hr={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(mr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else _r&&(s[n]=0)}let d=pr[n],f,p;if(d)return n===`$attrs`&&j(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return mr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||mr(n,c)||u(o,c)||u(i,c)||u(pr,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function gr(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var _r=!0;function vr(e){let t=Sr(e),n=e.proxy,i=e.ctx;_r=!1,t.beforeCreate&&br(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:ee,destroyed:S,unmounted:te,render:ne,renderTracked:re,renderTriggered:ie,errorCaptured:C,serverPrefetch:ae,expose:w,inheritAttrs:oe,components:se,directives:ce,filters:le}=t;if(u&&yr(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=Ft(t))}if(_r=!0,o)for(let e in o){let t=o[e],a=Y({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)xr(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{An(t,e[t])})}f&&br(f,e,`c`);function T(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(T(tr,p),T(nr,m),T(rr,g),T(ir,_),T(Yn,y),T(Xn,b),T(ur,C),T(lr,re),T(cr,ie),T(ar,ee),T(or,te),T(sr,ae),d(w))if(w.length){let t=e.exposed||={};w.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};ne&&e.render===r&&(e.render=ne),oe!=null&&(e.inheritAttrs=oe),se&&(e.components=se),ce&&(e.directives=ce),ae&&Hn(e)}function yr(e,t,n=r){d(e)&&(e=Dr(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?jn(r.from||n,r.default,!0):jn(r.from||n):jn(r),N(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function br(e,t,n){on(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function xr(e,t,n,r){let i=r.includes(`.`)?Ln(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Pn(i,n)}else if(h(e))Pn(i,e.bind(n));else if(v(e))if(d(e))e.forEach(e=>xr(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Pn(i,r,e)}}function Sr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Cr(c,e,o,!0)),Cr(c,t,o)),v(t)&&a.set(t,c),c}function Cr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Cr(e,a,n,!0),i&&i.forEach(t=>Cr(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=wr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var wr={data:Tr,props:kr,emits:kr,methods:Or,computed:Or,beforeCreate:z,created:z,beforeMount:z,mounted:z,beforeUpdate:z,updated:z,beforeDestroy:z,beforeUnmount:z,destroyed:z,unmounted:z,activated:z,deactivated:z,errorCaptured:z,serverPrefetch:z,components:Or,directives:Or,watch:Ar,provide:Tr,inject:Er};function Tr(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function Er(e,t){return Or(Dr(e),Dr(t))}function Dr(e){if(d(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function z(e,t){return e?[...new Set([].concat(e,t))]:t}function Or(e,t){return e?s(Object.create(null),e,t):t}function kr(e,t){return e?d(e)&&d(t)?[...new Set([...e,...t])]:s(Object.create(null),gr(e),gr(t??{})):t}function Ar(e,t){if(!e)return t;if(!t)return e;let n=s(Object.create(null),e);for(let r in t)n[r]=z(e[r],t[r]);return n}function jr(){return{app:null,config:{isNativeTag:i,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Mr=0;function Nr(e,t){return function(n,r=null){h(n)||(n=s({},n)),r!=null&&!v(r)&&(r=null);let i=jr(),a=new WeakSet,o=[],c=!1,l=i.app={_uid:Mr++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:da,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&h(e.install)?(a.add(e),e.install(l,...t)):h(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,s){if(!c){let u=l._ceVNode||K(n,r);return u.appContext=i,s===!0?s=`svg`:s===!1&&(s=void 0),o&&t?t(u,a):e(u,a,s),c=!0,l._container=a,a.__vue_app__=l,la(u.component)}},onUnmount(e){o.push(e)},unmount(){c&&(on(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=Pr;Pr=l;try{return e()}finally{Pr=t}}};return l}}var Pr=null,Fr=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${C(t)}Modifiers`]||e[`${w(t)}Modifiers`];function Ir(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&Fr(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(ue)));let c,l=i[c=se(n)]||i[c=se(C(n))];!l&&o&&(l=i[c=se(w(n))]),l&&on(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,on(u,e,6,a)}}var Lr=new WeakMap;function Rr(e,t,n=!1){let r=n?Lr:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Rr(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function zr(e,t){return!e||!a(t)?!1:(t=t.slice(2).replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,w(t))||u(e,t))}function Br(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=En(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Bi(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Bi(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Vr(c)}}catch(t){Ei.length=0,sn(t,e,1),v=K(wi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=Hr(y,a)),b=Ri(b,y,!1,!0))}return n.dirs&&(b=Ri(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Vn(b,n.transition),v=b,En(_),v}var Vr=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},Hr=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ur(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Wr(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Gr(o,r,n)&&!zr(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?Wr(r,o,l):!0:!!o;return!1}function Wr(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Gr(t,e,a)&&!zr(n,a))return!0}return!1}function Gr(e,t,n){let r=e[n],i=t[n];return n===`style`&&v(r)&&v(i)?!xe(r,i):r!==i}function Kr({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var qr={},Jr=()=>Object.create(qr),Yr=e=>Object.getPrototypeOf(e)===qr;function Xr(e,t,n,r=!1){let i={},a=Jr();e.propsDefaults=Object.create(null),Qr(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:It(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Zr(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=M(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(zr(e.emitsOptions,o))continue;let d=t[o];if(c)if(u(a,o))d!==a[o]&&(a[o]=d,l=!0);else{let t=C(o);i[t]=$r(c,s,t,d,e,!1)}else d!==a[o]&&(a[o]=d,l=!0)}}}else{Qr(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!u(t,a)&&((r=w(a))===a||!u(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=$r(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!u(t,e))&&(delete a[e],l=!0)}l&&tt(e.attrs,`set`,``)}function Qr(e,n,r,i){let[a,o]=e.propsOptions,s=!1,c;if(n)for(let t in n){if(ne(t))continue;let l=n[t],d;a&&u(a,d=C(t))?!o||!o.includes(d)?r[d]=l:(c||={})[d]=l:zr(e.emitsOptions,t)||(!(t in i)||l!==i[t])&&(i[t]=l,s=!0)}if(o){let n=M(r),i=c||t;for(let t=0;t<o.length;t++){let s=o[t];r[s]=$r(a,n,s,i[s],e,!u(i,s))}}return s}function $r(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=u(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&h(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Zi(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===w(n))&&(r=!0))}return r}var ei=new WeakMap;function ti(e,r,i=!1){let a=i?ei:r.propsCache,o=a.get(e);if(o)return o;let c=e.props,l={},f=[],p=!1;if(!h(e)){let t=e=>{p=!0;let[t,n]=ti(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;e<c.length;e++){let n=C(c[e]);ni(n)&&(l[n]=t)}else if(c)for(let e in c){let t=C(e);if(ni(t)){let n=c[e],r=l[t]=d(n)||h(n)?{type:n}:s({},n),i=r.type,a=!1,o=!0;if(d(i))for(let e=0;e<i.length;++e){let t=i[e],n=h(t)&&t.name;if(n===`Boolean`){a=!0;break}else n===`String`&&(o=!1)}else a=h(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||u(r,`default`))&&f.push(t)}}let m=[l,f];return v(e)&&a.set(e,m),m}function ni(e){return e[0]!==`$`&&!ne(e)}var ri=e=>e===`_`||e===`_ctx`||e===`$stable`,ii=e=>d(e)?e.map(Bi):[Bi(e)],ai=(e,t,n)=>{if(t._n)return t;let r=Dn((...e)=>ii(t(...e)),n);return r._c=!1,r},oi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ri(n))continue;let i=e[n];if(h(i))t[n]=ai(n,i,r);else if(i!=null){let e=ii(i);t[n]=()=>e}}},si=(e,t)=>{let n=ii(t);e.slots.default=()=>n},ci=(e,t,n)=>{for(let r in t)(n||!ri(r))&&(e[r]=t[r])},li=(e,t,n)=>{let r=e.slots=Jr();if(e.vnode.shapeFlag&32){let e=t._;e?(ci(r,t,n),n&&T(r,`_`,e,!0)):oi(t,r)}else t&&si(e,t)},ui=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:ci(a,n,r):(o=!n.$stable,oi(n,a)),s=n}else n&&(si(e,n),s={default:1});if(o)for(let e in a)!ri(e)&&s[e]==null&&delete a[e]},B=Si;function di(e){return fi(e)}function fi(e,i){let a=fe();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ni(e,t)&&(r=xe(e),D(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Ci:y(e,t,n,r);break;case wi:b(e,t,n,r);break;case Ti:e??x(t,n,r,o);break;case V:se(e,t,n,r,i,a,o,s,c);break;default:d&1?te(e,t,n,r,i,a,o,s,c):d&6?ce(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,O)}u!=null&&i?Gn(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Gn(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},ee=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},S=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},te=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)re(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ae(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},re=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&C(e.children,d,null,r,i,pi(e,a),s,u),_&&kn(e,null,r,`created`),ie(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!ne(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Wi(f,r,e)}_&&kn(e,null,r,`beforeMount`);let v=hi(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&B(()=>{try{f&&Wi(f,r,e),v&&g.enter(d),_&&kn(e,null,r,`mounted`)}finally{}},i)},ie=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||xi(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;ie(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},C=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)v(null,e[l]=s?Vi(e[l]):Bi(e[l]),t,n,r,i,a,o,s)},ae=(e,n,r,i,a,o,s)=>{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&mi(r,!1),(g=h.onVnodeBeforeUpdate)&&Wi(g,r,n,e),f&&kn(n,e,r,`beforeUpdate`),r&&mi(r,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?w(e.dynamicChildren,d,l,r,i,pi(n,a),o):s||pe(e,n,l,null,r,i,pi(n,a),o,!1),u>0){if(u&16)oe(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==n.children&&p(l,n.children)}else !s&&d==null&&oe(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&B(()=>{g&&Wi(g,r,n,e),f&&kn(n,e,r,`updated`)},i)},w=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];v(c,l,c.el&&(c.type===V||!Ni(c,l)||c.shapeFlag&198)?m(c.el):n,null,r,i,a,o,!0)}},oe=(e,n,r,i,a)=>{if(n!==r){if(n!==t)for(let t in n)!ne(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(ne(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},se=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),C(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(w(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&gi(e,t,!0)):pe(e,t,n,f,i,a,s,c,l)},ce=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):T(t,n,r,i,a,o,c):ue(e,t,c)},T=(e,t,n,r,i,a,o)=>{let s=e.component=qi(e,r,i);if(Jn(e)&&(s.ctx.renderer=O),ta(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,de,o),!e.el){let r=s.subTree=K(wi);b(null,r,t,n),e.placeholder=r.el}}else de(s,e,t,n,i,a,o)},ue=(e,t,n)=>{let r=t.component=e.component;if(Ur(e,t,n))if(r.asyncDep&&!r.asyncResolved){E(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},de=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=vi(e);if(n){t&&(t.el=c.el,E(e,t,o)),n.asyncDep.then(()=>{B(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;mi(e,!1),t?(t.el=c.el,E(e,t,o)):t=c,n&&le(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Wi(d,s,t,c),mi(e,!0);let f=Br(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),xe(p),e,i,a),t.el=f.el,u===null&&Kr(e,f.el),r&&B(r,i),(d=t.props&&t.props.onVnodeUpdated)&&B(()=>Wi(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=qn(t);if(mi(e,!1),l&&le(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Wi(o,d,t),mi(e,!0),s&&Te){let t=()=>{e.subTree=Br(e),Te(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Br(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&B(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;B(()=>Wi(o,d,e),i)}(t.shapeFlag&256||d&&qn(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&B(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ke(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>_n(u),mi(e,!0),l()},E=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Zr(e,t.props,r,n),ui(e,t.children,n),We(),bn(e),Ge()},pe=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){he(l,d,n,r,i,a,o,s,c);return}else if(f&256){me(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&be(l,i,a),d!==l&&p(n,d)):u&16?m&16?he(l,d,n,r,i,a,o,s,c):be(l,i,a,!0):(u&8&&p(n,``),m&16&&C(d,n,r,i,a,o,s,c))},me=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let n=t[p]=l?Vi(t[p]):Bi(t[p]);v(e[p],n,r,null,a,o,s,c,l)}u>d?be(e,a,o,!0,!1,f):C(t,r,i,a,o,s,c,l,f)},he=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Vi(t[u]):Bi(t[u]);if(Ni(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Vi(t[p]):Bi(t[p]);if(Ni(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?Vi(t[u]):Bi(t[u]),r,n,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)D(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Vi(t[u]):Bi(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,ee=0,S=Array(b);for(u=0;u<b;u++)S[u]=0;for(u=m;u<=f;u++){let n=e[u];if(y>=b){D(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(S[_-h]===0&&Ni(n,t[_])){i=_;break}i===void 0?D(n,a,o,!0):(S[i-h]=u+1,i>=ee?ee=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let te=x?_i(S):n;for(_=te.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1<d?f.el||bi(f):i;S[u]===0?v(null,n,r,p,a,o,s,c,l):x&&(_<0||u!==te[_]?ge(n,r,p,2):_--)}}},ge=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ge(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,O);return}if(c===V){o(a,t,n);for(let e=0;e<u.length;e++)ge(u[e],t,n,r);o(e.anchor,t,n);return}if(c===Ti){ee(e,t,n);return}if(r!==2&&d&1&&l)if(r===0)l.persisted&&!a[Bn]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),B(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Bn];a._isLeaving&&a[Bn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},D=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(We(),Gn(s,null,n,e,!0),Ge()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!qn(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Wi(_,t,e),u&6)ye(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&kn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,O,r):l&&!l.hasOnce&&(a!==V||d>0&&d&64)?be(l,t,n,!1,!0):(a===V&&d&384||!i&&u&16)&&be(c,t,n),r&&_e(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&B(()=>{_&&Wi(_,t,e),h&&kn(e,null,t,`unmounted`),v&&(e.el=null)},n)},_e=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===V){ve(n,r);return}if(t===Ti){S(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ve=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},ye=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;yi(c),yi(l),r&&le(r),i.stop(),a&&(a.flags|=8,D(o,e,t,n)),s&&B(s,t),B(()=>{e.isUnmounted=!0},t)},be=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)D(e[o],t,n,r,i)},xe=e=>{if(e.shapeFlag&6)return xe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Rn];return n?h(n):t},Se=!1,Ce=(e,t,n)=>{let r;e==null?t._vnode&&(D(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,Se||=(Se=!0,bn(r),xn(),!1)},O={p:v,um:D,m:ge,r:_e,mt:T,mc:C,pc:pe,pbc:w,n:xe,o:e},we,Te;return i&&([we,Te]=i(O)),{render:Ce,hydrate:we,createApp:Nr(Ce,we)}}function pi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function mi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function hi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gi(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Vi(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&gi(t,a)),a.type===Ci&&(a.patchFlag===-1&&(a=i[e]=Vi(a)),a.el=t.el),a.type===wi&&!a.el&&(a.el=t.el)}}function _i(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function vi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vi(t)}function yi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function bi(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?bi(t.subTree):null}var xi=e=>e.__isSuspense;function Si(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):yn(e)}var V=Symbol.for(`v-fgt`),Ci=Symbol.for(`v-txt`),wi=Symbol.for(`v-cmt`),Ti=Symbol.for(`v-stc`),Ei=[],H=null;function U(e=!1){Ei.push(H=e?null:[])}function Di(){Ei.pop(),H=Ei[Ei.length-1]||null}var Oi=1;function ki(e,t=!1){Oi+=e,e<0&&H&&t&&(H.hasOnce=!0)}function Ai(e){return e.dynamicChildren=Oi>0?H||n:null,Di(),Oi>0&&H&&H.push(e),e}function W(e,t,n,r,i,a){return Ai(G(e,t,n,r,i,a,!0))}function ji(e,t,n,r,i){return Ai(K(e,t,n,r,i,!0))}function Mi(e){return e?e.__v_isVNode===!0:!1}function Ni(e,t){return e.type===t.type&&e.key===t.key}var Pi=({key:e})=>e??null,Fi=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||N(e)||h(e)?{i:wn,r:e,k:t,f:!!n}:e);function G(e,t=null,n=null,r=0,i=null,a=e===V?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Pi(t),ref:t&&Fi(t),scopeId:Tn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:wn};return s?(Hi(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),Oi>0&&!o&&H&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&H.push(c),c}var K=Ii;function Ii(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===dr)&&(e=wi),Mi(e)){let r=Ri(e,t,!0);return n&&Hi(r,n),Oi>0&&!a&&H&&(r.shapeFlag&6?H[H.indexOf(e)]=r:H.push(r)),r.patchFlag=-2,r}if(ua(e)&&(e=e.__vccOpts),t){t=Li(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=D(e)),v(n)&&(Ht(n)&&!d(n)&&(n=s({},n)),t.style=E(n))}let o=g(e)?1:xi(e)?128:zn(e)?64:v(e)?4:h(e)?2:0;return G(e,t,n,r,i,o,a,!0)}function Li(e){return e?Ht(e)||Yr(e)?s({},e):e:null}function Ri(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Ui(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Pi(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Fi(t)):[a,Fi(t)]:Fi(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==V?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ri(e.ssContent),ssFallback:e.ssFallback&&Ri(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Vn(u,c.clone(u)),u}function zi(e=` `,t=0){return K(Ci,null,e,t)}function q(e=``,t=!1){return t?(U(),ji(wi,null,e)):K(wi,null,e)}function Bi(e){return e==null||typeof e==`boolean`?K(wi):d(e)?K(V,null,e.slice()):Mi(e)?Vi(e):K(Ci,null,String(e))}function Vi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ri(e)}function Hi(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Hi(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!Yr(t)?t._ctx=wn:r===3&&wn&&(wn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else h(t)?(t={default:t,_ctx:wn},n=32):(t=String(t),r&64?(n=16,t=[zi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ui(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=D([t.class,r.class]));else if(e===`style`)t.style=E([t.style,r.style]);else if(a(e)){let n=t[e],i=r[e];i&&n!==i&&!(d(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!o(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Wi(e,t,n,r=null){on(e,t,7,[n,r])}var Gi=jr(),Ki=0;function qi(e,n,r){let i=e.type,a=(n?n.appContext:e.appContext)||Gi,o={uid:Ki++,vnode:e,type:i,parent:n,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ee(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(a.provides),ids:n?n.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ti(i,a),emitsOptions:Rr(i,a),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=n?n.root:o,o.emit=Ir.bind(null,o),e.ce&&e.ce(o),o}var J=null,Ji=()=>J||wn,Yi,Xi;{let e=fe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Yi=t(`__VUE_INSTANCE_SETTERS__`,e=>J=e),Xi=t(`__VUE_SSR_SETTERS__`,e=>ea=e)}var Zi=e=>{let t=J;return Yi(e),e.scope.on(),()=>{e.scope.off(),Yi(t)}},Qi=()=>{J&&J.scope.off(),Yi(null)};function $i(e){return e.vnode.shapeFlag&4}var ea=!1;function ta(e,t=!1,n=!1){t&&Xi(t);let{props:r,children:i}=e.vnode,a=$i(e);Xr(e,r,a,t),li(e,i,n||t);let o=a?na(e,t):void 0;return t&&Xi(!1),o}function na(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hr);let{setup:r}=n;if(r){We();let n=e.setupContext=r.length>1?ca(e):null,i=Zi(e),a=an(r,e,0,[e.props,n]),o=y(a);if(Ge(),i(),(o||e.sp)&&!qn(e)&&Hn(e),o){if(a.then(Qi,Qi),t)return a.then(n=>{ra(e,n,t)}).catch(t=>{sn(t,e,0)});e.asyncDep=a}else ra(e,a,t)}else oa(e,t)}function ra(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=Yt(t)),oa(e,n)}var ia,aa;function oa(e,t,n){let i=e.type;if(!e.render){if(!t&&ia&&!i.render){let t=i.template||Sr(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i;i.render=ia(t,s(s({isCustomElement:n,delimiters:a},r),o))}}e.render=i.render||r,aa&&aa(e)}{let t=Zi(e);We();try{vr(e)}finally{Ge(),t()}}}var sa={get(e,t){return j(e,`get`,``),e[t]}};function ca(e){return{attrs:new Proxy(e.attrs,sa),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function la(e){return e.exposed?e.exposeProxy||=new Proxy(Yt(Ut(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in pr)return pr[n](e)},has(e,t){return t in e||t in pr}}):e.proxy}function ua(e){return h(e)&&`__vccOpts`in e}var Y=(e,t)=>Zt(e,t,ea),da=`3.5.35`,fa=void 0,pa=typeof window<`u`&&window.trustedTypes;if(pa)try{fa=pa.createPolicy(`vue`,{createHTML:e=>e})}catch{}var ma=fa?e=>fa.createHTML(e):e=>e,ha=`http://www.w3.org/2000/svg`,ga=`http://www.w3.org/1998/Math/MathML`,_a=typeof document<`u`?document:null,va=_a&&_a.createElement(`template`),ya={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?_a.createElementNS(ha,e):t===`mathml`?_a.createElementNS(ga,e):n?_a.createElement(e,{is:n}):_a.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>_a.createTextNode(e),createComment:e=>_a.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>_a.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{va.innerHTML=ma(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=va.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ba=Symbol(`_vtc`);function xa(e,t,n){let r=e[ba];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Sa=Symbol(`_vod`),Ca=Symbol(`_vsh`),wa=Symbol(``),Ta=/(?:^|;)\s*display\s*:/;function Ea(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t)if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Oa(r,t,``)}else for(let e in t)n[e]??Oa(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Oa(r,i,``):Ma(e,i,!g(t)&&t?t[i]:void 0,o)||Oa(r,i,o)}}else if(i){if(t!==n){let e=r[wa];e&&(n+=`;`+e),r.cssText=n,a=Ta.test(n)}}else t&&e.removeAttribute(`style`);Sa in e&&(e[Sa]=a?r.display:``,e[Ca]&&(r.display=`none`))}var Da=/\s*!important$/;function Oa(e,t,n){if(d(n))n.forEach(n=>Oa(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=ja(e,t);Da.test(n)?e.setProperty(w(r),n.replace(Da,``),`important`):e[r]=n}}var ka=[`Webkit`,`Moz`,`ms`],Aa={};function ja(e,t){let n=Aa[t];if(n)return n;let r=C(t);if(r!==`filter`&&r in e)return Aa[t]=r;r=oe(r);for(let n=0;n<ka.length;n++){let i=ka[n]+r;if(i in e)return Aa[t]=i}return t}function Ma(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&g(r)&&n===r}var Na=`http://www.w3.org/1999/xlink`;function Pa(e,t,n,r,i,a=ve(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Na,t.slice(6,t.length)):e.setAttributeNS(Na,t,n):n==null||a&&!ye(n)?e.removeAttribute(t):e.setAttribute(t,a?``:_(n)?String(n):n)}function Fa(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?ma(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ye(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ia(e,t,n,r){e.addEventListener(t,n,r)}function La(e,t,n,r){e.removeEventListener(t,n,r)}var Ra=Symbol(`_vei`);function za(e,t,n,r,i=null){let a=e[Ra]||(e[Ra]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Va(t);r?Ia(e,n,a[t]=Ga(r,i),s):o&&(La(e,n,o,s),a[t]=void 0)}}var Ba=/(?:Once|Passive|Capture)$/;function Va(e){let t;if(Ba.test(e)){t={};let n;for(;n=e.match(Ba);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):w(e.slice(2)),t]}var Ha=0,Ua=Promise.resolve(),Wa=()=>Ha||=(Ua.then(()=>Ha=0),Date.now());function Ga(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&on(e,t,5,a)}}else on(r,t,5,[e])};return n.value=e,n.attached=Wa(),n}var Ka=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,qa=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?xa(e,r,c):t===`style`?Ea(e,n,r):a(t)?o(t)||za(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Ja(e,t,r,c))?(Fa(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Pa(e,t,r,c,s,t!==`value`)):e._isVueCE&&(Ya(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Fa(e,C(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Pa(e,t,r,c))};function Ja(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Ka(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Ka(t)&&g(n)?!1:t in e}function Ya(e,t){let n=e._def.props;if(!n)return!1;let r=C(t);return Array.isArray(n)?n.some(e=>C(e)===r):Object.keys(n).some(e=>C(e)===r)}var Xa=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>le(t,e):t};function Za(e){e.target.composing=!0}function Qa(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var $a=Symbol(`_assign`);function eo(e,t,n){return t&&(e=e.trim()),n&&(e=ue(e)),e}var to={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[$a]=Xa(i);let a=r||i.props&&i.props.type===`number`;Ia(e,t?`change`:`input`,t=>{t.target.composing||e[$a](eo(e.value,n,a))}),(n||a)&&Ia(e,`change`,()=>{e.value=eo(e.value,n,a)}),t||(Ia(e,`compositionstart`,Za),Ia(e,`compositionend`,Qa),Ia(e,`change`,Qa))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[$a]=Xa(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ue(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},no={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=p(t);Ia(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ue(io(e)):io(e));e[$a](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,hn(()=>{e._assigning=!1})}),e[$a]=Xa(r)},mounted(e,{value:t}){ro(e,t)},beforeUpdate(e,t,n){e[$a]=Xa(n)},updated(e,{value:t}){e._assigning||ro(e,t)}};function ro(e,t){let n=e.multiple,r=d(t);if(!(n&&!r&&!p(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=io(a);if(n)if(r){let e=typeof o;e===`string`||e===`number`?a.selected=t.some(e=>String(e)===String(o)):a.selected=Se(t,o)>-1}else a.selected=t.has(o);else if(xe(io(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function io(e){return`_value`in e?e._value:e.value}var ao=[`ctrl`,`shift`,`alt`,`meta`],oo={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ao.some(n=>e[`${n}Key`]&&!t.includes(n))},so=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=oo[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},co={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},lo=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=w(n.key);if(t.some(e=>e===r||co[e]===r))return e(n)}))},uo=s({patchProp:qa},ya),fo;function po(){return fo||=di(uo)}var mo=((...e)=>{let t=po().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=go(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,ho(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function ho(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function go(e){return g(e)?document.querySelector(e):e}function X(e){return e.schema?`${e.schema}.${e.name}`:e.name}var _o={table:20,column:20,group:10,enum:10};function vo(e,t){let n=t.trim().toLowerCase();if(n.length===0)return[];let r=[],i=[];for(let t of e.tables){let e=X(t);t.name.toLowerCase().includes(n)&&r.push({kind:`table`,label:t.name,context:e,tableKey:e});for(let r of t.columns)r.name.toLowerCase().includes(n)&&i.push({kind:`column`,label:r.name,context:e,tableKey:e})}let a=e.groups.filter(e=>e.name.toLowerCase().includes(n)).map(t=>({kind:`group`,label:t.name,context:`${e.tables.filter(e=>e.groupId===t.id).length} tables`,tableKey:null})),o=e.enums.filter(e=>e.name.toLowerCase().includes(n)).map(e=>({kind:`enum`,label:e.name,context:`${e.values.length} values`,tableKey:null}));return[...r.slice(0,_o.table),...i.slice(0,_o.column),...a.slice(0,_o.group),...o.slice(0,_o.enum)]}var yo={class:`w-full max-w-lg overflow-hidden rounded-md border border-border bg-background shadow-lg`},bo=[`placeholder`],xo={class:`max-h-80 overflow-y-auto`},So={key:0,class:`px-3 py-4 text-center text-xs text-muted-foreground`},Co=[`disabled`,`onClick`],wo={class:`w-14 shrink-0 text-[10px] uppercase text-muted-foreground`},To={class:`font-mono text-foreground`},Eo={class:`truncate text-[11px] text-muted-foreground`},Do=L({__name:`DocsSearch`,props:{snapshot:{},translate:{type:Function}},emits:[`select`,`selectEnum`],setup(e,{emit:t}){let n=e,r=t,i=P(!1),a=P(``),o=P(null),s=Y(()=>vo(n.snapshot,a.value));async function c(){i.value=!0,a.value=``,await hn(),o.value?.focus()}function l(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),i.value?i.value=!1:c();return}e.key===`Escape`&&i.value&&(i.value=!1)}function u(e){return e.kind===`enum`||e.tableKey!==null}function d(e){if(e.kind===`enum`){r(`selectEnum`,e.label),i.value=!1;return}e.tableKey!==null&&(r(`select`,e.tableKey),i.value=!1)}return nr(()=>window.addEventListener(`keydown`,l)),ar(()=>window.removeEventListener(`keydown`,l)),(t,n)=>(U(),W(`div`,null,[G(`button`,{type:`button`,class:`flex items-center gap-2 rounded border border-border bg-background px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/40`,onClick:n[0]||=e=>c()},[G(`span`,null,O(e.translate(`docs.searchLabel`)),1),n[3]||=G(`span`,{class:`rounded bg-muted/50 px-1 py-0.5 text-[10px]`},`⌘K`,-1)]),i.value?(U(),W(`div`,{key:0,class:`fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-24`,onClick:n[2]||=so(e=>i.value=!1,[`self`])},[G(`div`,yo,[On(G(`input`,{ref_key:`input`,ref:o,"onUpdate:modelValue":n[1]||=e=>a.value=e,type:`text`,placeholder:e.translate(`docs.search`),class:`w-full border-b border-border bg-transparent px-3 py-2 text-sm text-foreground outline-none`},null,8,bo),[[to,a.value]]),G(`ul`,xo,[a.value.trim()!==``&&s.value.length===0?(U(),W(`li`,So,`Nothing matches “`+O(a.value)+`”.`,1)):q(``,!0),(U(!0),W(V,null,R(s.value,(e,t)=>(U(),W(`li`,{key:`${e.kind}-${e.context}-${e.label}-${t}`},[G(`button`,{type:`button`,class:D([`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs transition-colors`,u(e)?`hover:bg-muted/40`:`cursor-default text-muted-foreground`]),disabled:!u(e),onClick:t=>d(e)},[G(`span`,wo,O(e.kind),1),G(`span`,To,O(e.label),1),G(`span`,Eo,O(e.context),1)],10,Co)]))),128))])])])):q(``,!0)]))}});function Oo(e){if(e===null)return{};let t=(Math.trunc(e)%360+360)%360;return{"--h":String(t)}}var ko={class:`flex w-64 shrink-0 flex-col gap-3 overflow-y-auto border-r border-border bg-background p-3`},Ao={class:`flex flex-col gap-1`},jo={class:`px-2 text-[10px] uppercase tracking-wide text-muted-foreground`},Mo={class:`flex rounded border border-border p-0.5`},No={key:0,class:`h-2 w-2 shrink-0 rounded-full`,style:{"background-color":`var(--group-c)`}},Po={class:`truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`},Fo=[`onClick`],Io=L({__name:`DocsSidebar`,props:{sections:{},mode:{},activeKey:{},translate:{type:Function}},emits:[`update:mode`,`select`,`home`],setup(e,{emit:t}){let n=t;return(t,r)=>(U(),W(`nav`,ko,[G(`button`,{type:`button`,class:`rounded px-2 py-1 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/40`,onClick:r[0]||=e=>n(`home`)},O(e.translate(`docs.overview`)),1),G(`div`,Ao,[G(`span`,jo,O(e.translate(`docs.groupBy`)),1),G(`div`,Mo,[G(`button`,{type:`button`,class:D([`flex-1 rounded px-2 py-1 text-xs transition-colors`,e.mode===`schema`?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/40`]),onClick:r[1]||=e=>n(`update:mode`,`schema`)},O(e.translate(`docs.groupBySchema`)),3),G(`button`,{type:`button`,class:D([`flex-1 rounded px-2 py-1 text-xs transition-colors`,e.mode===`group`?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/40`]),onClick:r[2]||=e=>n(`update:mode`,`group`)},O(e.translate(`docs.groupByTableGroup`)),3)])]),(U(!0),W(V,null,R(e.sections,t=>(U(),W(`div`,{key:t.key,class:`flex flex-col gap-0.5`},[G(`div`,{class:D([`flex items-center gap-1.5 px-2 py-1`,{"docs-group":t.hue!==null}]),style:E(F(Oo)(t.hue))},[t.hue===null?q(``,!0):(U(),W(`span`,No)),G(`span`,Po,O(t.label||e.translate(t.fallbackKey)),1)],6),(U(!0),W(V,null,R(t.tables,t=>(U(),W(`button`,{key:F(X)(t),type:`button`,class:D([`truncate rounded px-2 py-1 text-left font-mono text-xs transition-colors`,e.activeKey===F(X)(t)?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/40`]),onClick:e=>n(`select`,F(X)(t))},O(t.name),11,Fo))),128))]))),128))]))}});function Lo(e,t){return e.name.localeCompare(t.name)}function Ro(e){let t=new Map;for(let n of e.tables){let e=n.schema??``,r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({key:e,label:e,fallbackKey:`docs.noSchema`,hue:null,note:null,tables:[...t].sort(Lo)}))}function zo(e){let t=new Map(e.groups.map(e=>[e.id,e])),n=[];for(let t of e.groups){let r=e.tables.filter(e=>e.groupId===t.id).sort(Lo);r.length!==0&&n.push({key:t.id,label:t.name,fallbackKey:`docs.noGroup`,hue:t.hue,note:t.note,tables:r})}let r=e.tables.filter(e=>e.groupId===null||!t.has(e.groupId)).sort(Lo);return r.length>0&&n.push({key:``,label:``,fallbackKey:`docs.noGroup`,hue:null,note:null,tables:r}),n}function Bo(e,t){let n=[];for(let r of e.tables)for(let e of r.columns)e.data_type===t&&n.push({tableKey:X(r),table:r.name,column:e.name});return n}function Vo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ho=Vo();function Uo(e){Ho=e}var Wo={exec:()=>null};function Go(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Q.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ko=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Q={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Go(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Go(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Go(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Go(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Go(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Go(e=>RegExp(`^ {0,${e}}>`))},qo=/^(?:[ \t]*(?:\n|$))+/,Jo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Qo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,$o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,es=Z($o).replace(/bull/g,Qo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ts=Z($o).replace(/bull/g,Qo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ns=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rs=/^[^\n]+/,is=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,as=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,is).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),os=Z(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qo).getRegex(),ss=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,cs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ls=Z(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,cs).replace(`tag`,ss).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),us=Z(ns).replace(`hr`,Xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ss).getRegex(),ds={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,us).getRegex(),code:Jo,def:as,fences:Yo,heading:Zo,hr:Xo,html:ls,lheading:es,list:os,newline:qo,paragraph:us,table:Wo,text:rs},fs=Z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ss).getRegex(),ps={...ds,lheading:ts,table:fs,paragraph:Z(ns).replace(`hr`,Xo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,fs).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ss).getRegex()},ms={...ds,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,cs).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(ns).replace(`hr`,Xo).replace(`heading`,` *#{1,6} *[^+]`).replace(`lheading`,es).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},hs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_s=/^( {2,}|\\)\n(?!\s*$)/,vs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ys=/[\p{P}\p{S}]/u,bs=/[\s\p{P}\p{S}]/u,xs=/[^\s\p{P}\p{S}]/u,Ss=Z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,bs).getRegex(),Cs=/(?!~)[\p{P}\p{S}]/u,ws=/(?!~)[\s\p{P}\p{S}]/u,Ts=/(?:[^\s\p{P}\p{S}]|~)/u,Es=Z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ko?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ds=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Os=Z(Ds,`u`).replace(/punct/g,ys).getRegex(),ks=Z(Ds,`u`).replace(/punct/g,Cs).getRegex(),As=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,js=Z(As,`gu`).replace(/notPunctSpace/g,xs).replace(/punctSpace/g,bs).replace(/punct/g,ys).getRegex(),Ms=Z(As,`gu`).replace(/notPunctSpace/g,Ts).replace(/punctSpace/g,ws).replace(/punct/g,Cs).getRegex(),Ns=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,xs).replace(/punctSpace/g,bs).replace(/punct/g,ys).getRegex(),Ps=Z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,ys).getRegex(),Fs=Z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,xs).replace(/punctSpace/g,bs).replace(/punct/g,ys).getRegex(),Is=Z(/\\(punct)/,`gu`).replace(/punct/g,ys).getRegex(),Ls=Z(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Rs=Z(cs).replace(`(?:-->|$)`,`-->`).getRegex(),zs=Z(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Rs).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Vs=Z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Bs).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hs=Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Bs).replace(`ref`,is).getRegex(),Us=Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,is).getRegex(),Ws=Z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Hs).replace(`nolink`,Us).getRegex(),Gs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ks={_backpedal:Wo,anyPunctuation:Is,autolink:Ls,blockSkip:Es,br:_s,code:gs,del:Wo,delLDelim:Wo,delRDelim:Wo,emStrongLDelim:Os,emStrongRDelimAst:js,emStrongRDelimUnd:Ns,escape:hs,link:Vs,nolink:Us,punctuation:Ss,reflink:Hs,reflinkSearch:Ws,tag:zs,text:vs,url:Wo},qs={...Ks,link:Z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Bs).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Bs).getRegex()},Js={...Ks,emStrongRDelimAst:Ms,emStrongLDelim:ks,delLDelim:Ps,delRDelim:Fs,url:Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Gs).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Gs).getRegex()},Ys={...Js,br:Z(_s).replace(`{2,}`,`*`).getRegex(),text:Z(Js.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Xs={normal:ds,gfm:ps,pedantic:ms},Zs={normal:Ks,gfm:Js,breaks:Ys,pedantic:qs},Qs={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},$s=e=>Qs[e];function ec(e,t){if(t){if(Q.escapeTest.test(e))return e.replace(Q.escapeReplace,$s)}else if(Q.escapeTestNoEncode.test(e))return e.replace(Q.escapeReplaceNoEncode,$s);return e}function tc(e){try{e=encodeURI(e).replace(Q.percentDecode,`%`)}catch{return null}return e}function nc(e,t){let n=e.replace(Q.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Q.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Q.slashPipe,`|`);return n}function rc(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ic(e){let t=e.split(`+`),n=t.length-1;for(;n>=0&&Q.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`+`)}function ac(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function oc(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function sc(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function cc(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`+`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`+`)}var lc=class{options;rules;lexer;constructor(e){this.options=e||Ho}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ic(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=cc(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=rc(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:rc(t[0],`+`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:rc(t[0],`+`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=rc(t[0],`+`).split(`+`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`+`),c=s.replace(this.rules.other.blockquoteSetextReplace,`+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}+${s}`:s,r=r?`${r}+${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`+`+e.join(`+`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`+`+e.join(`+`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`+`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=oc(t[2].split(`+`,1)[0],t[1].length),l=e.split(`+`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`+`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`+`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`+`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`+`+l}u=!l.trim(),r+=p+`+`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ic(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:rc(t[0],`+`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=nc(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`+`):[],a={type:`table`,raw:rc(t[0],`+`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(nc(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:rc(t[0],`+`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`+`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=rc(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ac(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),sc(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return sc(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},uc=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ho,this.options.tokenizer=this.options.tokenizer||new lc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Q,block:Xs.normal,inline:Zs.normal};this.options.pedantic?(t.block=Xs.pedantic,t.inline=Zs.pedantic):this.options.gfm&&(t.block=Xs.gfm,this.options.breaks?t.inline=Zs.breaks:t.inline=Zs.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xs,inline:Zs}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Q.carriageReturn,`+`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Q.tabCharGlobal,` `).replace(Q.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`+`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`+`)?``:`+`)+i.raw,n.text+=`+`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`+`)?``:`+`)+i.raw,n.text+=`+`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`+`)?``:`+`)+i.raw,r.text+=`+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`+`)?``:`+`)+i.raw,n.text+=`+`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},dc=class{options;parser;constructor(e){this.options=e||Ho}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Q.notSpaceStart)?.[0],i=e.replace(Q.endingNewline,``)+`+`;return r?`<pre><code class="language-`+ec(r)+`">`+(n?i:ec(i,!0))+`</code></pre>+`:`<pre><code>`+(n?i:ec(i,!0))+`</code></pre>+`}blockquote({tokens:e}){return`<blockquote>+${this.parser.parse(e)}</blockquote>+`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>+`}hr(e){return`<hr>+`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>+`+r+`</`+i+`>+`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>+`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>+`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>+<thead>+`+t+`</thead>+`+r+`</table>+`}tablerow({text:e}){return`<tr>+${e}</tr>+`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>+`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ec(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=tc(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+ec(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=tc(e);if(i===null)return ec(n);e=i;let a=`<img src="${e}" alt="${ec(n)}"`;return t&&(a+=` title="${ec(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:ec(e.text)}},fc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},pc=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ho,this.options.renderer=this.options.renderer||new dc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new fc}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},mc=class{options;block;constructor(e){this.options=e||Ho}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?uc.lex:uc.lexInline}provideParser(e=this.block){return e?pc.parse:pc.parseInline}},hc=class{defaults=Vo();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pc;Renderer=dc;TextRenderer=fc;Lexer=uc;Tokenizer=lc;Hooks=mc;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new dc(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new lc(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new mc;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];mc.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&mc.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return uc.lex(e,t??this.defaults)}parser(e,t){return pc.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?uc.lex:uc.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?pc.parse:pc.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?uc.lex:uc.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?pc.parse:pc.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`+Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+ec(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},gc=new hc;function $(e,t){return gc.parse(e,t)}$.options=$.setOptions=function(e){return gc.setOptions(e),$.defaults=gc.defaults,Uo($.defaults),$},$.getDefaults=Vo,$.defaults=Ho,$.use=function(...e){return gc.use(...e),$.defaults=gc.defaults,Uo($.defaults),$},$.walkTokens=function(e,t){return gc.walkTokens(e,t)},$.parseInline=gc.parseInline,$.Parser=pc,$.parser=pc.parse,$.Renderer=dc,$.TextRenderer=fc,$.Lexer=uc,$.lexer=uc.lex,$.Tokenizer=lc,$.Hooks=mc,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,pc.parse,uc.lex;function _c(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var vc=/^(https?:|mailto:)/i;function yc(e){let t=String(e??``).trim();return t===``||/^[/\\]{2}/.test(t)?null:t.startsWith(`#`)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||vc.test(t)?t:null}var bc=new hc({renderer:{html({text:e}){return _c(e)},link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=yc(e);if(i===null)return r;let a=t?` title="${_c(t)}"`:``;return`<a href="${_c(i)}"${a}>${r}</a>`},image({href:e,title:t,text:n}){let r=yc(e);if(r===null)return _c(n);let i=t?` title="${_c(t)}"`:``;return`<img src="${_c(r)}" alt="${_c(n)}"${i}>`}}});function xc(e){return e===null||e.trim()===``?``:bc.parse(e)}var Sc={class:`text-sm text-muted-foreground`},Cc=[`title`,`innerHTML`],wc=L({__name:`NoteEditor`,props:{modelValue:{},readonly:{type:Boolean},translate:{type:Function}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=P(!1),a=P(``),o=P(null);async function s(){n.readonly||(a.value=n.modelValue,i.value=!0,await hn(),o.value?.focus())}function c(){i.value=!1,a.value!==n.modelValue&&r(`update:modelValue`,a.value)}function l(){a.value=n.modelValue,i.value=!1}return(t,n)=>(U(),W(`div`,Sc,[i.value?On((U(),W(`textarea`,{key:0,ref_key:`input`,ref:o,"onUpdate:modelValue":n[0]||=e=>a.value=e,rows:`4`,class:`w-full resize-y rounded border border-border bg-background p-2 font-mono text-xs text-foreground outline-none focus:border-ring`,onBlur:n[1]||=e=>c(),onKeydown:n[2]||=lo(e=>l(),[`escape`])},null,544)),[[to,a.value]]):e.modelValue.trim()===``?e.readonly?q(``,!0):(U(),W(`button`,{key:2,type:`button`,class:`rounded border border-dashed border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/40`,onClick:n[4]||=e=>s()},O(e.translate(`docs.addNote`)),1)):(U(),W(`div`,{key:1,class:D([`leading-relaxed`,e.readonly?``:`cursor-text rounded transition-colors hover:bg-muted/30`]),title:e.readonly?void 0:e.translate(`docs.editNote`),onClick:n[3]||=e=>s(),innerHTML:F(xc)(e.modelValue)},null,10,Cc))]))}}),Tc={class:`flex flex-col gap-5`},Ec={class:`flex flex-col gap-2`},Dc={class:`flex flex-wrap items-center gap-2`},Oc={class:`font-mono text-lg font-semibold text-foreground`},kc={key:0,class:`rounded bg-muted/50 px-1.5 py-0.5 text-[10px] uppercase text-muted-foreground`},Ac={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},jc={class:`flex flex-wrap gap-1`},Mc={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},Nc={key:0,class:`text-xs text-muted-foreground`},Pc={key:1,class:`flex flex-col gap-1`},Fc=[`onClick`],Ic=L({__name:`EnumPage`,props:{enumType:{},snapshot:{},translate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>n.enumType.schema?`${n.enumType.schema}.${n.enumType.name}`:n.enumType.name),a=Y(()=>Bo(n.snapshot,n.enumType.name));return(t,n)=>(U(),W(`article`,Tc,[G(`header`,Ec,[G(`div`,Dc,[G(`h2`,Oc,O(i.value),1),e.enumType.synthesized?(U(),W(`span`,kc,`synthesized`)):q(``,!0)]),K(wc,{"model-value":e.enumType.note??``,readonly:``,translate:e.translate},null,8,[`model-value`,`translate`])]),G(`section`,null,[G(`h3`,Ac,O(e.translate(`docs.enumValues`)),1),G(`ul`,jc,[(U(!0),W(V,null,R(e.enumType.values,e=>(U(),W(`li`,{key:e,class:`rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[11px] text-foreground`},O(e),1))),128))])]),G(`section`,null,[G(`h3`,Mc,O(e.translate(`docs.usedBy`)),1),a.value.length===0?(U(),W(`p`,Nc,`No column uses this enum.`)):(U(),W(`ul`,Pc,[(U(!0),W(V,null,R(a.value,e=>(U(),W(`li`,{key:`${e.tableKey}.${e.column}`,class:`text-xs`},[G(`button`,{type:`button`,class:`w-full rounded border border-border bg-background px-2 py-1.5 text-left font-mono transition-colors hover:bg-muted/40`,onClick:t=>r(`select`,e.tableKey)},O(e.tableKey)+`.`+O(e.column),9,Fc)]))),128))]))])]))}}),Lc={class:`flex flex-col gap-3`},Rc={class:`flex flex-col gap-1`},zc={class:`text-[10px] uppercase tracking-wide text-muted-foreground`},Bc=[`value`,`placeholder`],Vc={class:`flex flex-col gap-2`},Hc={class:`text-[10px] uppercase tracking-wide text-muted-foreground`},Uc={class:`flex items-center gap-1.5`},Wc=[`title`,`onClick`],Gc=[`value`,`title`],Kc={class:`grid grid-cols-2 gap-2`},qc={class:`docs-ground-light flex items-center gap-2 overflow-hidden rounded border border-border bg-white p-2`},Jc={class:`dark flex items-center gap-2 overflow-hidden rounded border border-border bg-neutral-900 p-2`},Yc={class:`flex justify-end`},Xc=L({__name:`GroupEditor`,props:{group:{},translate:{type:Function}},emits:[`update:group`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=Array.from({length:12},(e,t)=>t*30);function a(e){r(`update:group`,{...n.group,name:e.target.value})}function o(e){r(`update:group`,{...n.group,hue:e})}function s(e){o(Number(e.target.value))}function c(e){return`${n.translate(`docs.groupColour`)} ${e}°`}return(t,n)=>(U(),W(`div`,Lc,[G(`label`,Rc,[G(`span`,zc,O(e.translate(`docs.groupName`)),1),G(`input`,{type:`text`,value:e.group.name,placeholder:e.translate(`docs.groupName`),class:`rounded border border-border bg-background px-2 py-1 text-sm text-foreground outline-none focus:border-ring`,onInput:n[0]||=e=>a(e)},null,40,Bc)]),G(`div`,Vc,[G(`span`,Hc,O(e.translate(`docs.groupColour`)),1),G(`div`,Uc,[(U(!0),W(V,null,R(F(i),t=>(U(),W(`button`,{key:t,type:`button`,class:D([`docs-group h-6 w-6 rounded-full border ring-offset-background transition hover:scale-105`,e.group.hue===t?`ring-2 ring-ring ring-offset-2`:`border-border`]),style:E([{"background-color":`var(--group-c)`},F(Oo)(t)]),title:c(t),onClick:e=>o(t)},null,14,Wc))),128))]),G(`input`,{type:`range`,min:`0`,max:`359`,value:e.group.hue,class:`w-full`,title:c(e.group.hue),onInput:n[1]||=e=>s(e)},null,40,Gc),G(`div`,Kc,[G(`div`,qc,[G(`span`,{class:`docs-group h-4 w-4 shrink-0 rounded-full`,style:E([{"background-color":`var(--group-c)`},F(Oo)(e.group.hue)])},null,4),G(`span`,{class:`docs-group truncate rounded px-1.5 py-0.5 text-[11px] font-medium`,style:E([{"background-color":`var(--group-tint)`,color:`var(--group-c)`},F(Oo)(e.group.hue)])},O(e.group.name),5)]),G(`div`,Jc,[G(`span`,{class:`docs-group h-4 w-4 shrink-0 rounded-full`,style:E([{"background-color":`var(--group-c)`},F(Oo)(e.group.hue)])},null,4),G(`span`,{class:`docs-group truncate rounded px-1.5 py-0.5 text-[11px] font-medium`,style:E([{"background-color":`var(--group-tint)`,color:`var(--group-c)`},F(Oo)(e.group.hue)])},O(e.group.name),5)])])]),G(`div`,Yc,[G(`button`,{type:`button`,class:`rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/40`,onClick:n[2]||=t=>r(`delete`,e.group.id)},O(e.translate(`docs.deleteGroup`)),1)])]))}});function Zc(e,t={}){let n=Math.max(1,t.columnsPerRow??Math.ceil(Math.sqrt(Math.max(e.length,1)))),r=t.cardWidth??260,i=t.gapX??56,a=t.gapY??40,o=t.margin??40,s=t.rowHeight,c=e=>s??44+(e.columns?.length??0)*24+12,l={},u=o;for(let t=0;t<e.length;t+=n){let s=e.slice(t,t+n),d=Math.max(...s.map(c));s.forEach((e,t)=>{l[e.name]={x:o+t*(r+i),y:u}}),u+=d+a}return l}function Qc(e,t,n){let r=t.x-e.x,i=t.y-e.y;if(r===0&&i===0)return{x:e.x,y:e.y};let a=r===0?1/0:n.width/Math.abs(r),o=i===0?1/0:n.height/Math.abs(i),s=Math.min(a,o);return{x:e.x+r*s,y:e.y+i*s}}var $c={class:`overflow-auto`},el=[`width`,`height`,`viewBox`],tl=[`x1`,`y1`,`x2`,`y2`],nl=[`x`,`y`,`onClick`],rl=[`x`,`y`],il=[`x`,`y`],al=260,ol=220,sl=40,cl=8,ll=L({__name:`SchemaDiagram`,props:{snapshot:{}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i={width:al/2,height:ol/2},a=Y(()=>Zc(n.snapshot.tables.map(e=>({name:X(e),columns:e.columns})))),o=Y(()=>new Map(n.snapshot.groups.map(e=>[e.id,e]))),s=Y(()=>n.snapshot.tables.map(e=>{let t=X(e),n=a.value[t]??{x:sl,y:sl},r=e.groupId?o.value.get(e.groupId)??null:null;return{key:t,x:n.x,y:n.y,hue:r?.hue??null,columns:e.columns.slice(0,cl).map(e=>e.name)}}));function c(e){let t=a.value[e]??{x:sl,y:sl};return{x:t.x+al/2,y:t.y+ol/2}}let l=Y(()=>{let e=new Set(Object.keys(a.value));return n.snapshot.relationships.map(e=>({relationship:e,fromKey:X({schema:e.from.schema,name:e.from.table}),toKey:X({schema:e.to.schema,name:e.to.table})})).filter(({fromKey:t,toKey:n})=>e.has(t)&&e.has(n)).map(({relationship:e,fromKey:t,toKey:n})=>{let r=c(t),a=c(n);return{id:e.id,from:Qc(r,a,i),to:Qc(a,r,i)}})}),u=Y(()=>Math.max(0,...s.value.map(e=>e.x+al))+sl),d=Y(()=>Math.max(0,...s.value.map(e=>e.y+ol))+sl);function f(e){return e===null?{}:{...Oo(e),fill:`var(--group-tint)`}}return(e,t)=>(U(),W(`div`,$c,[(U(),W(`svg`,{width:u.value,height:d.value,viewBox:`0 0 ${u.value} ${d.value}`,class:`block`},[(U(!0),W(V,null,R(l.value,e=>(U(),W(`line`,{key:e.id,x1:e.from.x,y1:e.from.y,x2:e.to.x,y2:e.to.y,class:`stroke-border`,"stroke-width":`1.5`},null,8,tl))),128)),(U(!0),W(V,null,R(s.value,e=>(U(),W(`g`,{key:e.key},[G(`rect`,{x:e.x,y:e.y,width:al,height:ol,rx:`6`,class:D([`cursor-pointer stroke-border`,e.hue===null?`fill-card`:`docs-group`]),style:E(f(e.hue)),"stroke-width":`1`,onClick:t=>r(`select`,e.key)},null,14,nl),G(`text`,{x:e.x+10,y:e.y+22,class:`pointer-events-none fill-foreground font-mono text-[11px] font-semibold`},O(e.key),9,rl),(U(!0),W(V,null,R(e.columns,(t,n)=>(U(),W(`text`,{key:t,x:e.x+10,y:e.y+42+n*18,class:`pointer-events-none fill-muted-foreground font-mono text-[10px]`},O(t),9,il))),128))]))),128))],8,el))]))}}),ul={class:`overflow-hidden rounded-md border border-border`},dl={class:`w-full text-xs`},fl={class:`bg-muted/30`},pl={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},ml={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},hl={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},gl={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},_l={class:`px-2 py-1.5 font-mono font-medium text-foreground`},vl={class:`px-2 py-1.5 font-mono text-muted-foreground`},yl={class:`px-2 py-1.5`},bl={class:`flex flex-wrap gap-1`},xl={class:`px-2 py-1.5 text-muted-foreground`},Sl={class:`flex items-start gap-1`},Cl=[`title`],wl=L({__name:`ColumnTable`,props:{columns:{},columnNotes:{},tableKey:{},readonly:{type:Boolean},translate:{type:Function}},emits:[`edit`],setup(e,{emit:t}){let n=e,r=t;function i(e){if(e.character_maximum_length!==null)return`${e.data_type}(${e.character_maximum_length})`;if(e.numeric_precision!==null){let t=e.numeric_scale===null?``:`,${e.numeric_scale}`;return`${e.data_type}(${e.numeric_precision}${t})`}return e.data_type}function a(e){let t=[];return e.is_primary_key&&t.push(`pk`),e.is_nullable||t.push(`not null`),e.column_default!==null&&t.push(`default: ${e.column_default}`),e.extra!==null&&e.extra!==``&&t.push(e.extra),e.enum_values!==void 0&&e.enum_values.length>0&&t.push(`enum: ${e.enum_values.join(`, `)}`),t}function o(e){return n.columnNotes[e.name]??null}function s(e){let t=o(e)?.shadowed;return t?`Database comment: ${t}`:void 0}return(t,n)=>(U(),W(`div`,ul,[G(`table`,dl,[G(`thead`,null,[G(`tr`,fl,[G(`th`,pl,O(e.translate(`docs.columnHeader`)),1),G(`th`,ml,O(e.translate(`docs.typeHeader`)),1),G(`th`,hl,O(e.translate(`docs.settingsHeader`)),1),G(`th`,gl,O(e.translate(`docs.noteHeader`)),1)])]),G(`tbody`,null,[(U(!0),W(V,null,R(e.columns,t=>(U(),W(`tr`,{key:t.name,class:`border-t border-border align-top`},[G(`td`,_l,O(t.name),1),G(`td`,vl,O(i(t)),1),G(`td`,yl,[G(`div`,bl,[(U(!0),W(V,null,R(a(t),e=>(U(),W(`span`,{key:e,class:`rounded bg-muted/50 px-1.5 py-0.5 text-[10px] text-muted-foreground`},O(e),1))),128))])]),G(`td`,xl,[G(`div`,Sl,[o(t)?.source===`LOCAL`?(U(),W(`span`,{key:0,class:`mt-0.5 shrink-0 text-[10px] font-medium`,title:s(t)},`⬤ `+O(e.translate(`docs.localNote`)),9,Cl)):q(``,!0),K(wc,{class:`min-w-0 flex-1`,"model-value":o(t)?.note??``,readonly:e.readonly,translate:e.translate,"onUpdate:modelValue":n=>r(`edit`,{kind:`columnNote`,tableKey:e.tableKey,column:t.name,note:n})},null,8,[`model-value`,`readonly`,`translate`,`onUpdate:modelValue`])])])]))),128))])])]))}}),Tl={class:`flex items-center gap-1.5`},El=[`value`],Dl={value:``},Ol=[`value`],kl=`__dbx_new_group__`,Al=L({__name:`GroupPicker`,props:{groups:{},modelValue:{},translate:{type:Function}},emits:[`update:modelValue`,`create`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>n.groups.find(e=>e.id===n.modelValue)??null);function a(e){let t=e.target;if(t.value===kl&&!n.groups.some(e=>e.id===kl)){t.value=n.modelValue??``,r(`create`);return}r(`update:modelValue`,t.value===``?null:t.value)}return(t,n)=>(U(),W(`div`,Tl,[i.value?(U(),W(`span`,{key:0,class:`docs-group h-3 w-3 shrink-0 rounded-full`,style:E([{"background-color":`var(--group-c)`},F(Oo)(i.value.hue)])},null,4)):q(``,!0),G(`select`,{value:e.modelValue??``,class:`rounded border border-border bg-background px-2 py-1 text-xs text-foreground outline-none focus:border-ring`,onChange:n[0]||=e=>a(e)},[G(`option`,Dl,O(e.translate(`docs.noGroup`)),1),(U(!0),W(V,null,R(e.groups,e=>(U(),W(`option`,{key:e.id,value:e.id},O(e.name),9,Ol))),128)),G(`option`,{value:kl},O(e.translate(`docs.newGroup`)),1)],40,El)]))}}),jl={class:`grid gap-4 sm:grid-cols-2`},Ml={class:`mb-1.5 text-xs font-medium text-muted-foreground`},Nl={key:0,class:`text-xs text-muted-foreground`},Pl={key:1,class:`flex flex-col gap-1`},Fl=[`onClick`],Il={class:`font-mono`},Ll={class:`mx-1.5 text-muted-foreground`},Rl={class:`font-mono`},zl={key:0,class:`ml-1.5 text-[10px] text-muted-foreground`},Bl={class:`mb-1.5 text-xs font-medium text-muted-foreground`},Vl={key:0,class:`text-xs text-muted-foreground`},Hl={key:1,class:`flex flex-col gap-1`},Ul=[`onClick`],Wl={class:`font-mono`},Gl={class:`mx-1.5 text-muted-foreground`},Kl={class:`font-mono`},ql={key:0,class:`ml-1.5 text-[10px] text-muted-foreground`},Jl=L({__name:`RelationshipList`,props:{relationships:{},schema:{},table:{},translate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t;function i(e){return e.table===n.table&&(e.schema??null)===n.schema}function a(e){return X({schema:e.schema,name:e.table})}function o(e){return`${a(e)}.${e.column}`}function s(e){return e.cardinality===`ONE_TO_ONE`?`1 – 1`:`* – 1`}function c(e){let t=[];return e.onUpdate&&t.push(`on update ${e.onUpdate}`),e.onDelete&&t.push(`on delete ${e.onDelete}`),t}let l=Y(()=>n.relationships.filter(e=>i(e.from))),u=Y(()=>n.relationships.filter(e=>i(e.to)));return(t,n)=>(U(),W(`div`,jl,[G(`section`,null,[G(`h4`,Ml,O(e.translate(`docs.references`))+` (`+O(l.value.length)+`)`,1),l.value.length===0?(U(),W(`p`,Nl,O(e.translate(`docs.noOutgoingRelationships`)),1)):(U(),W(`ul`,Pl,[(U(!0),W(V,null,R(l.value,e=>(U(),W(`li`,{key:e.id,class:`text-xs`},[G(`button`,{type:`button`,class:`w-full rounded border border-border bg-background px-2 py-1.5 text-left transition-colors hover:bg-muted/40`,onClick:t=>r(`select`,a(e.to))},[G(`span`,Il,O(e.from.column),1),G(`span`,Ll,O(s(e)),1),G(`span`,Rl,O(o(e.to)),1),c(e).length>0?(U(),W(`span`,zl,O(c(e).join(`, `)),1)):q(``,!0)],8,Fl)]))),128))]))]),G(`section`,null,[G(`h4`,Bl,O(e.translate(`docs.referencedBy`))+` (`+O(u.value.length)+`)`,1),u.value.length===0?(U(),W(`p`,Vl,O(e.translate(`docs.noIncomingRelationships`)),1)):(U(),W(`ul`,Hl,[(U(!0),W(V,null,R(u.value,e=>(U(),W(`li`,{key:e.id,class:`text-xs`},[G(`button`,{type:`button`,class:`w-full rounded border border-border bg-background px-2 py-1.5 text-left transition-colors hover:bg-muted/40`,onClick:t=>r(`select`,a(e.from))},[G(`span`,Wl,O(o(e.from)),1),G(`span`,Gl,O(s(e)),1),G(`span`,Kl,O(e.to.column),1),c(e).length>0?(U(),W(`span`,ql,O(c(e).join(`, `)),1)):q(``,!0)],8,Ul)]))),128))]))])]))}}),Yl={class:`flex flex-col gap-5`},Xl={class:`flex flex-col gap-2`},Zl={class:`flex flex-wrap items-center gap-2`},Ql={class:`font-mono text-lg font-semibold text-foreground`},$l={class:`rounded bg-muted/50 px-1.5 py-0.5 text-[10px] uppercase text-muted-foreground`},eu={key:1,class:`text-[10px] text-muted-foreground`},tu={class:`flex items-start gap-2`},nu=[`title`],ru={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},iu={key:0},au={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},ou={class:`overflow-hidden rounded-md border border-border`},su={class:`w-full text-xs`},cu={class:`bg-muted/30`},lu={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},uu={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},du={class:`px-2 py-1.5 text-left font-medium text-muted-foreground`},fu={class:`px-2 py-1.5 font-mono`},pu={class:`px-2 py-1.5 font-mono text-muted-foreground`},mu={class:`px-2 py-1.5`},hu={class:`flex flex-wrap gap-1 text-[10px] text-muted-foreground`},gu={key:0,class:`rounded bg-muted/50 px-1.5 py-0.5`},_u={key:1,class:`rounded bg-muted/50 px-1.5 py-0.5`},vu={key:2,class:`rounded bg-muted/50 px-1.5 py-0.5`},yu={key:3,class:`rounded bg-muted/50 px-1.5 py-0.5`},bu={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},xu={key:1},Su={class:`mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground`},Cu={class:`overflow-x-auto rounded-md border border-border bg-muted/20 p-2 font-mono text-xs`},wu=L({__name:`TablePage`,props:{table:{},relationships:{},group:{},annotationGroups:{},readonly:{type:Boolean},translate:{type:Function}},emits:[`select`,`edit`,`createGroup`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>X(n.table)),a=Y(()=>n.table.kind.toLowerCase().replace(/_/g,` `)),o=Y(()=>n.table.shadowedNote?`Database comment: ${n.table.shadowedNote}`:void 0);return(t,n)=>(U(),W(`article`,Yl,[G(`header`,Xl,[G(`div`,Zl,[G(`h2`,Ql,O(i.value),1),G(`span`,$l,O(a.value),1),e.group?(U(),W(`span`,{key:0,class:`docs-group rounded px-1.5 py-0.5 text-[10px] font-medium`,style:E([{"background-color":`var(--group-tint)`,color:`var(--group-c)`},F(Oo)(e.group.hue)])},O(e.group.name),5)):q(``,!0),e.table.estimatedRows===null?q(``,!0):(U(),W(`span`,eu,` ~`+O(e.table.estimatedRows)+` rows `,1))]),G(`div`,tu,[e.table.noteSource===`LOCAL`?(U(),W(`span`,{key:0,class:`mt-0.5 shrink-0 text-[10px] font-medium text-muted-foreground`,title:o.value},`⬤ `+O(e.translate(`docs.localNote`)),9,nu)):q(``,!0),K(wc,{class:`min-w-0 flex-1`,"model-value":e.table.note??``,readonly:e.readonly,translate:e.translate,"onUpdate:modelValue":n[0]||=e=>r(`edit`,{kind:`tableNote`,tableKey:i.value,note:e})},null,8,[`model-value`,`readonly`,`translate`])]),e.readonly?q(``,!0):(U(),ji(Al,{key:0,groups:e.annotationGroups,"model-value":e.table.groupId,translate:e.translate,"onUpdate:modelValue":n[1]||=e=>r(`edit`,{kind:`tableGroup`,tableKey:i.value,groupId:e}),onCreate:n[2]||=e=>r(`createGroup`,i.value)},null,8,[`groups`,`model-value`,`translate`]))]),G(`section`,null,[G(`h3`,ru,O(e.translate(`docs.columns`)),1),K(wl,{columns:e.table.columns,"column-notes":e.table.columnNotes,"table-key":i.value,readonly:e.readonly,translate:e.translate,onEdit:n[3]||=e=>r(`edit`,e)},null,8,[`columns`,`column-notes`,`table-key`,`readonly`,`translate`])]),e.table.indexes.length>0?(U(),W(`section`,iu,[G(`h3`,au,O(e.translate(`docs.indexes`)),1),G(`div`,ou,[G(`table`,su,[G(`thead`,null,[G(`tr`,cu,[G(`th`,lu,O(e.translate(`docs.nameHeader`)),1),G(`th`,uu,O(e.translate(`docs.columns`)),1),G(`th`,du,O(e.translate(`docs.settingsHeader`)),1)])]),G(`tbody`,null,[(U(!0),W(V,null,R(e.table.indexes,e=>(U(),W(`tr`,{key:e.name,class:`border-t border-border align-top`},[G(`td`,fu,O(e.name),1),G(`td`,pu,[zi(O(e.columns.join(`, `)),1),e.included_columns&&e.included_columns.length>0?(U(),W(V,{key:0},[zi(` (include `+O(e.included_columns.join(`, `))+`) `,1)],64)):q(``,!0)]),G(`td`,mu,[G(`div`,hu,[e.is_primary?(U(),W(`span`,gu,`pk`)):q(``,!0),e.is_unique?(U(),W(`span`,_u,`unique`)):q(``,!0),e.index_type?(U(),W(`span`,vu,O(e.index_type),1)):q(``,!0),e.filter?(U(),W(`span`,yu,`where `+O(e.filter),1)):q(``,!0)])])]))),128))])])])])):q(``,!0),G(`section`,null,[G(`h3`,bu,O(e.translate(`docs.relationships`)),1),K(Jl,{relationships:e.relationships,schema:e.table.schema,table:e.table.name,translate:e.translate,onSelect:n[4]||=e=>r(`select`,e)},null,8,[`relationships`,`schema`,`table`,`translate`])]),e.table.viewDefinition?(U(),W(`section`,xu,[G(`h3`,Su,O(e.translate(`docs.definitionHeader`)),1),G(`pre`,Cu,O(e.table.viewDefinition),1)])):q(``,!0)]))}});function Tu(e,t){switch(e.kind){case`tableSkipped`:return{severity:`warning`,title:t(`docs.warnings.tableSkipped.title`),detail:t(`docs.warnings.tableSkipped.detail`,{table:e.table,reason:e.reason})};case`noForeignKeyMetadata`:return{severity:`info`,title:t(`docs.warnings.noForeignKeyMetadata.title`),detail:t(`docs.warnings.noForeignKeyMetadata.detail`,{engine:e.engine})};case`commentsUnsupported`:return{severity:`info`,title:t(`docs.warnings.commentsUnsupported.title`),detail:t(`docs.warnings.commentsUnsupported.detail`,{engine:e.engine})};case`orphanedNotes`:return{severity:`warning`,title:t(`docs.warnings.orphanedNotes.title`),detail:t(`docs.warnings.orphanedNotes.detail`,{count:e.count})};case`dbmlOmitted`:return{severity:`info`,title:t(`docs.warnings.dbmlOmitted.title`),detail:t(`docs.warnings.dbmlOmitted.detail`,{item:e.item,table:e.table,reason:e.reason})}}}var Eu={key:0,class:`flex flex-col gap-2`},Du={class:`font-medium`},Ou={class:`mt-0.5 leading-relaxed`},ku=L({__name:`WarningBanner`,props:{warnings:{},translate:{type:Function}},setup(e){let t=e,n=Y(()=>t.warnings.map((e,n)=>({key:`${e.kind}-${n}`,...Tu(e,t.translate)})));return(e,t)=>n.value.length>0?(U(),W(`div`,Eu,[(U(!0),W(V,null,R(n.value,e=>(U(),W(`div`,{key:e.key,class:D([`rounded-md border px-3 py-2 text-xs`,e.severity===`warning`?`border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/30 dark:text-amber-200`:`border-border bg-muted/30 text-muted-foreground`])},[G(`div`,Du,O(e.title),1),G(`div`,Ou,O(e.detail),1)],2))),128))])):q(``,!0)}}),Au={class:`flex flex-col gap-6`},ju={class:`flex items-baseline gap-2`},Mu={class:`text-sm font-semibold text-foreground`},Nu={class:`text-xs text-muted-foreground`},Pu=[`innerHTML`],Fu={class:`grid gap-1 sm:grid-cols-2 lg:grid-cols-3`},Iu=[`onClick`],Lu={class:`font-mono text-xs font-medium text-foreground`},Ru={key:0,class:`text-[10px] uppercase text-muted-foreground`},zu=[`innerHTML`],Bu=L({__name:`WikiIndex`,props:{sections:{},translate:{type:Function}},emits:[`select`],setup(e,{emit:t}){let n=t;return(t,r)=>(U(),W(`div`,Au,[(U(!0),W(V,null,R(e.sections,t=>(U(),W(`section`,{key:t.key,class:`flex flex-col gap-2`},[G(`div`,{class:D([`flex flex-col gap-1 border-l-2 pl-3`,{"docs-group":t.hue!==null}]),style:E([{"border-color":`var(--group-c, var(--border))`},F(Oo)(t.hue)])},[G(`div`,ju,[G(`h2`,Mu,O(t.label||e.translate(t.fallbackKey)),1),G(`span`,Nu,O(t.tables.length)+` tables`,1)]),t.note?(U(),W(`div`,{key:0,class:`text-xs text-muted-foreground`,innerHTML:F(xc)(t.note)},null,8,Pu)):q(``,!0)],6),G(`ul`,Fu,[(U(!0),W(V,null,R(t.tables,e=>(U(),W(`li`,{key:F(X)(e),class:`flex flex-col gap-0.5 rounded border border-border bg-background px-2 py-1.5 transition-colors hover:bg-muted/40`},[G(`button`,{type:`button`,class:`flex w-full items-baseline gap-1.5 text-left`,onClick:t=>n(`select`,F(X)(e))},[G(`span`,Lu,O(e.name),1),e.kind===`TABLE`?q(``,!0):(U(),W(`span`,Ru,O(e.kind.toLowerCase().replace(/_/g,` `)),1))],8,Iu),e.note?(U(),W(`div`,{key:0,class:`line-clamp-2 text-[11px] text-muted-foreground`,innerHTML:F(xc)(e.note)},null,8,zu)):q(``,!0)]))),128))])]))),128))]))}}),Vu={class:`flex h-full min-h-0 bg-background text-foreground`},Hu={class:`flex h-full min-h-0 w-64 shrink-0 flex-col`},Uu={class:`flex min-w-0 flex-1 flex-col gap-4 overflow-y-auto p-4`},Wu={class:`flex flex-wrap items-start justify-between gap-3`},Gu={class:`flex flex-col gap-1`},Ku={class:`text-base font-semibold`},qu={class:`text-xs text-muted-foreground`},Ju={key:0,class:`flex flex-col gap-4`},Yu={key:0,class:`flex flex-col gap-2`},Xu={class:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`},Zu=L({__name:`DocsApp`,props:{snapshot:{},annotations:{},readonly:{type:Boolean},translate:{},route:{},diagram:{default:`external`}},emits:[`edit`,`update:route`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>n.readonly??!1),a=Y(()=>n.annotations.groups??[]),o=P(n.snapshot.groups.length>0?`group`:`schema`),s=P(null),c=P(null),l=P(!1),u=Y(()=>n.route?n.route:l.value?{kind:`diagram`}:c.value===null?s.value===null?{kind:`index`}:{kind:`table`,key:s.value}:{kind:`enum`,name:c.value}),d=Y(()=>u.value.kind===`table`?u.value.key:null),f=Y(()=>u.value.kind===`enum`?u.value.name:null),p=Y(()=>o.value===`schema`?Ro(n.snapshot):zo(n.snapshot)),m=Y(()=>n.snapshot.tables.find(e=>X(e)===d.value)??null),h=Y(()=>f.value===null?null:n.snapshot.enums.find(e=>e.name===f.value)??null),g=Y(()=>u.value.kind===`diagram`?`diagram`:h.value===null?m.value===null?`index`:`table`:`enum`),_=Y(()=>{let e=m.value?.groupId;return e?n.snapshot.groups.find(t=>t.id===e)??null:null});function v(e){n.snapshot.tables.some(t=>X(t)===e)&&(c.value=null,l.value=!1,s.value=e,r(`update:route`,{kind:`table`,key:e}))}function y(e){n.snapshot.enums.some(t=>t.name===e)&&(s.value=null,l.value=!1,c.value=e,r(`update:route`,{kind:`enum`,name:e}))}function b(){s.value=null,c.value=null,l.value=!0,r(`update:route`,{kind:`diagram`})}function x(){s.value=null,c.value=null,l.value=!1,r(`update:route`,{kind:`index`})}function ee(e){let t={id:crypto.randomUUID(),name:n.translate(`docs.newGroup`),hue:a.value.length*47%360};r(`edit`,{kind:`upsertGroup`,group:t}),r(`edit`,{kind:`tableGroup`,tableKey:e,groupId:t.id})}return(t,n)=>(U(),W(`div`,Vu,[G(`div`,Hu,[K(Io,{class:`min-h-0 flex-1`,sections:p.value,mode:o.value,"active-key":d.value,translate:e.translate,"onUpdate:mode":n[0]||=e=>o.value=e,onSelect:v,onHome:n[1]||=e=>x()},null,8,[`sections`,`mode`,`active-key`,`translate`]),e.diagram===`inline`?(U(),W(`button`,{key:0,type:`button`,class:D([`shrink-0 border-t border-r border-border bg-background px-3 py-2 text-left text-xs font-medium transition-colors`,g.value===`diagram`?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/40`]),onClick:n[2]||=e=>b()},O(e.translate(`docs.diagram`)),3)):q(``,!0)]),G(`main`,Uu,[G(`header`,Wu,[G(`div`,Gu,[G(`h1`,Ku,O(e.snapshot.project.name),1),G(`p`,qu,[zi(O(e.snapshot.project.databaseType),1),e.snapshot.project.database?(U(),W(V,{key:0},[zi(` · `+O(e.snapshot.project.database),1)],64)):q(``,!0),zi(` · `+O(e.snapshot.tables.length)+` tables · generated `+O(e.snapshot.project.generatedAt),1)])]),K(Do,{snapshot:e.snapshot,translate:e.translate,onSelect:v,onSelectEnum:y},null,8,[`snapshot`,`translate`])]),K(ku,{warnings:e.snapshot.warnings,translate:e.translate},null,8,[`warnings`,`translate`]),g.value===`index`?(U(),W(`div`,Ju,[K(wc,{"model-value":e.snapshot.project.note??``,readonly:i.value,translate:e.translate,"onUpdate:modelValue":n[3]||=e=>r(`edit`,{kind:`projectNote`,note:e})},null,8,[`model-value`,`readonly`,`translate`]),K(Bu,{sections:p.value,translate:e.translate,onSelect:v},null,8,[`sections`,`translate`]),!i.value&&a.value.length>0?(U(),W(`section`,Yu,[G(`h2`,Xu,O(e.translate(`docs.groups`)),1),(U(!0),W(V,null,R(a.value,t=>(U(),ji(Xc,{key:t.id,group:t,translate:e.translate,"onUpdate:group":n[4]||=e=>r(`edit`,{kind:`upsertGroup`,group:e}),onDelete:n[5]||=e=>r(`edit`,{kind:`removeGroup`,groupId:e})},null,8,[`group`,`translate`]))),128))])):q(``,!0)])):g.value===`table`&&m.value?(U(),ji(wu,{key:1,table:m.value,relationships:e.snapshot.relationships,group:_.value,"annotation-groups":a.value,readonly:i.value,translate:e.translate,onSelect:v,onEdit:n[6]||=e=>r(`edit`,e),onCreateGroup:ee},null,8,[`table`,`relationships`,`group`,`annotation-groups`,`readonly`,`translate`])):h.value?(U(),ji(Ic,{key:2,"enum-type":h.value,snapshot:e.snapshot,translate:e.translate,onSelect:v},null,8,[`enum-type`,`snapshot`,`translate`])):g.value===`diagram`?(U(),ji(ll,{key:3,snapshot:e.snapshot,onSelect:v},null,8,[`snapshot`])):q(``,!0)])]))}}),Qu={kind:`index`};function $u(e,t,n){if(!e.startsWith(`#`))return Qu;let[r,...i]=e.slice(1).replace(/^\//,``).split(`/`),a=i.join(`/`);if(r===`diagram`&&a===``)return n?{kind:`diagram`}:Qu;if(a===``)return Qu;let o;try{o=decodeURIComponent(a)}catch{return Qu}return r===`table`?t.tables.some(e=>X(e)===o)?{kind:`table`,key:o}:Qu:r===`enum`&&(t.enums??[]).some(e=>e.name===o)?{kind:`enum`,name:o}:Qu}function ed(e){switch(e.kind){case`table`:return`#/table/${encodeURIComponent(e.key)}`;case`enum`:return`#/enum/${encodeURIComponent(e.name)}`;case`diagram`:return`#/diagram`;default:return`#/`}}var td=[{value:`en`,flag:`🇺🇸`,label:`English`},{value:`es`,flag:`🇪🇸`,label:`Español`},{value:`it`,flag:`🇮🇹`,label:`Italiano`},{value:`ja`,flag:`🇯🇵`,label:`日本語`},{value:`ko`,flag:`🇰🇷`,label:`한국어`},{value:`pt-BR`,flag:`🇧🇷`,label:`Português`},{value:`zh-CN`,flag:`🇨🇳`,label:`简体中文`},{value:`zh-TW`,flag:`繁`,label:`繁體中文`}],nd={en:{title:`Documentation`,groupBySchema:`Schemas`,groupByTableGroup:`Table Groups`,noGroup:`(no group)`,noSchema:`(no schema)`,search:`Search tables, columns, groups…`,columns:`Columns`,indexes:`Indexes`,references:`References`,referencedBy:`Referenced by`,localNote:`LOCAL`,shadowedComment:`Database comment: {comment}`,addNote:`Add a note`,editNote:`Edit note`,newGroup:`New group…`,groupName:`Group name`,groupColour:`Colour`,deleteGroup:`Delete group`,enumValues:`Values`,usedBy:`Used by`,openDiagram:`Open schema diagram`,saving:`Saving…`,saved:`Saved`,saveFailed:`Could not save notes: {error}`,overview:`Overview`,groupBy:`Group by`,searchLabel:`Search`,groups:`Groups`,relationships:`Relationships`,columnHeader:`Column`,typeHeader:`Type`,settingsHeader:`Settings`,noteHeader:`Note`,nameHeader:`Name`,definitionHeader:`Definition`,noOutgoingRelationships:`This table references no other table.`,noIncomingRelationships:`No table references this one.`,diagram:`Diagram`,language:`Language`,theme:`Theme`,themeLight:`Light`,themeDark:`Dark`,exportHtml:`Export HTML…`,exporting:`Exporting…`,exportFailed:`Could not export: {error}`,warnings:{tableSkipped:{title:`A table could not be documented`,detail:`{table} was skipped: {reason}. It is missing from this documentation.`},noForeignKeyMetadata:{title:`No relationships available`,detail:`{engine} does not report foreign key metadata, so no relationship edges could be derived. The diagram is complete for this engine.`},commentsUnsupported:{title:`Database comments unavailable`,detail:`{engine} does not support table or column comments, so every description here comes from this project's own notes.`},orphanedNotes:{title:`Some notes no longer match anything`,detail:`{count} note(s) refer to a table or column that no longer exists. Nothing was deleted — re-map or remove them in the notes file.`},dbmlOmitted:{title:`Not representable in DBML`,detail:`{item} on {table} is documented here but omitted from the exported DBML: {reason}.`}}},es:{title:`Documentación`,groupBySchema:`Esquemas`,groupByTableGroup:`Grupos de tablas`,noGroup:`(sin grupo)`,noSchema:`(sin esquema)`,search:`Buscar tablas, columnas, grupos…`,columns:`Columnas`,indexes:`Índices`,references:`Referencias`,referencedBy:`Referenciado por`,localNote:`LOCAL`,shadowedComment:`Comentario de la base de datos: {comment}`,addNote:`Agregar una nota`,editNote:`Editar nota`,newGroup:`Nuevo grupo…`,groupName:`Nombre del grupo`,groupColour:`Color`,deleteGroup:`Eliminar grupo`,enumValues:`Valores`,usedBy:`Usado por`,openDiagram:`Abrir diagrama del esquema`,saving:`Guardando…`,saved:`Guardado`,saveFailed:`No se pudieron guardar las notas: {error}`,overview:`Información general`,groupBy:`Agrupar por`,searchLabel:`Buscar`,groups:`Grupos`,relationships:`Relaciones`,columnHeader:`Columna`,typeHeader:`Tipo`,settingsHeader:`Configuración`,noteHeader:`Nota`,nameHeader:`Nombre`,definitionHeader:`Definición`,noOutgoingRelationships:`Esta tabla no referencia ninguna otra tabla.`,noIncomingRelationships:`Ninguna tabla referencia esta.`,diagram:`Diagrama`,language:`Idioma`,theme:`Tema`,themeLight:`Claro`,themeDark:`Oscuro`,exportHtml:`Exportar HTML…`,exporting:`Exportando…`,exportFailed:`No se pudo exportar: {error}`,warnings:{tableSkipped:{title:`No se pudo documentar una tabla`,detail:`{table} fue omitida: {reason}. Falta en esta documentación.`},noForeignKeyMetadata:{title:`No hay relaciones disponibles`,detail:`{engine} no reporta metadatos de claves foráneas, por lo que no se pudieron derivar relaciones. El diagrama está completo para este motor.`},commentsUnsupported:{title:`Comentarios de base de datos no disponibles`,detail:`{engine} no admite comentarios en tablas o columnas, por lo que toda descripción aquí proviene de las notas de este proyecto.`},orphanedNotes:{title:`Algunas notas ya no coinciden con nada`,detail:`{count} nota(s) hacen referencia a una tabla o columna que ya no existe. No se eliminó nada — vuelva a asignarlas o elimínelas en el archivo de notas.`},dbmlOmitted:{title:`No representable en DBML`,detail:`{item} en {table} está documentado aquí pero se omitió del DBML exportado: {reason}.`}}},it:{title:`Documentazione`,groupBySchema:`Schemi`,groupByTableGroup:`Gruppi di tabelle`,noGroup:`(nessun gruppo)`,noSchema:`(nessuno schema)`,search:`Cerca tabelle, colonne, gruppi…`,columns:`Colonne`,indexes:`Indici`,references:`Riferimenti`,referencedBy:`Referenziato da`,localNote:`LOCALE`,shadowedComment:`Commento del database: {comment}`,addNote:`Aggiungi una nota`,editNote:`Modifica nota`,newGroup:`Nuovo gruppo…`,groupName:`Nome del gruppo`,groupColour:`Colore`,deleteGroup:`Elimina gruppo`,enumValues:`Valori`,usedBy:`Usato da`,openDiagram:`Apri diagramma dello schema`,saving:`Salvataggio…`,saved:`Salvato`,saveFailed:`Impossibile salvare le note: {error}`,overview:`Panoramica`,groupBy:`Raggruppa per`,searchLabel:`Cerca`,groups:`Gruppi`,relationships:`Relazioni`,columnHeader:`Colonna`,typeHeader:`Tipo`,settingsHeader:`Impostazioni`,noteHeader:`Nota`,nameHeader:`Nome`,definitionHeader:`Definizione`,noOutgoingRelationships:`Questa tabella non fa riferimento a nessun'altra tabella.`,noIncomingRelationships:`Nessuna tabella fa riferimento a questa.`,diagram:`Diagramma`,language:`Lingua`,theme:`Tema`,themeLight:`Chiaro`,themeDark:`Scuro`,exportHtml:`Esporta HTML…`,exporting:`Esportazione…`,exportFailed:`Impossibile esportare: {error}`,warnings:{tableSkipped:{title:`Impossibile documentare una tabella`,detail:`{table} è stata saltata: {reason}. Manca da questa documentazione.`},noForeignKeyMetadata:{title:`Nessuna relazione disponibile`,detail:`{engine} non riporta i metadati delle chiavi esterne, quindi non è stato possibile derivare alcuna relazione. Il diagramma è completo per questo motore.`},commentsUnsupported:{title:`Commenti del database non disponibili`,detail:`{engine} non supporta i commenti su tabelle o colonne, quindi ogni descrizione qui proviene dalle note di questo progetto.`},orphanedNotes:{title:`Alcune note non corrispondono più a nulla`,detail:`{count} nota/e fanno riferimento a una tabella o colonna che non esiste più. Nulla è stato eliminato — rimappa o rimuovi queste note nel file delle note.`},dbmlOmitted:{title:`Non rappresentabile in DBML`,detail:`{item} su {table} è documentato qui ma omesso dal DBML esportato: {reason}.`}}},ja:{title:`ドキュメント`,groupBySchema:`スキーマ`,groupByTableGroup:`テーブルグループ`,noGroup:`(グループなし)`,noSchema:`(スキーマなし)`,search:`テーブル、カラム、グループを検索…`,columns:`カラム`,indexes:`インデックス`,references:`参照`,referencedBy:`参照元`,localNote:`ローカル`,shadowedComment:`データベースのコメント: {comment}`,addNote:`メモを追加`,editNote:`メモを編集`,newGroup:`新しいグループ…`,groupName:`グループ名`,groupColour:`色`,deleteGroup:`グループを削除`,enumValues:`値`,usedBy:`使用元`,openDiagram:`スキーマ図を開く`,saving:`保存中…`,saved:`保存済み`,saveFailed:`メモを保存できませんでした: {error}`,overview:`概要`,groupBy:`グループ化`,searchLabel:`検索`,groups:`グループ`,relationships:`リレーションシップ`,columnHeader:`カラム`,typeHeader:`型`,settingsHeader:`設定`,noteHeader:`メモ`,nameHeader:`名前`,definitionHeader:`定義`,noOutgoingRelationships:`このテーブルは他のテーブルを参照していません。`,noIncomingRelationships:`このテーブルを参照しているテーブルはありません。`,diagram:`図`,language:`言語`,theme:`テーマ`,themeLight:`ライト`,themeDark:`ダーク`,exportHtml:`HTMLをエクスポート…`,exporting:`エクスポート中…`,exportFailed:`エクスポートできませんでした: {error}`,warnings:{tableSkipped:{title:`ドキュメント化できないテーブルがあります`,detail:`{table} はスキップされました: {reason}。このドキュメントには含まれていません。`},noForeignKeyMetadata:{title:`リレーションシップを表示できません`,detail:`{engine} は外部キーのメタデータを報告しないため、リレーションシップを導出できませんでした。この図はこのエンジンについては完全です。`},commentsUnsupported:{title:`データベースのコメントは利用できません`,detail:`{engine} はテーブルやカラムのコメントをサポートしていないため、ここでの説明はすべてこのプロジェクトのメモから提供されています。`},orphanedNotes:{title:`対象がなくなったメモがあります`,detail:`{count} 件のメモが、既に存在しないテーブルまたはカラムを参照しています。何も削除されていません。メモファイルで再割り当てまたは削除してください。`},dbmlOmitted:{title:`DBMLでは表現できません`,detail:`{table} の {item} はここに記載されていますが、エクスポートされたDBMLからは除外されています: {reason}。`}}},ko:{title:`문서`,groupBySchema:`스키마`,groupByTableGroup:`테이블 그룹`,noGroup:`(그룹 없음)`,noSchema:`(스키마 없음)`,search:`테이블, 컬럼, 그룹 검색…`,columns:`컬럼`,indexes:`인덱스`,references:`참조`,referencedBy:`참조된 위치`,localNote:`로컬`,shadowedComment:`데이터베이스 코멘트: {comment}`,addNote:`메모 추가`,editNote:`메모 편집`,newGroup:`새 그룹…`,groupName:`그룹 이름`,groupColour:`색상`,deleteGroup:`그룹 삭제`,enumValues:`값`,usedBy:`사용처`,openDiagram:`스키마 다이어그램 열기`,saving:`저장 중…`,saved:`저장됨`,saveFailed:`메모를 저장할 수 없습니다: {error}`,overview:`개요`,groupBy:`그룹화 기준`,searchLabel:`검색`,groups:`그룹`,relationships:`관계`,columnHeader:`컬럼`,typeHeader:`유형`,settingsHeader:`설정`,noteHeader:`메모`,nameHeader:`이름`,definitionHeader:`정의`,noOutgoingRelationships:`이 테이블은 다른 테이블을 참조하지 않습니다.`,noIncomingRelationships:`이 테이블을 참조하는 테이블이 없습니다.`,diagram:`다이어그램`,language:`언어`,theme:`테마`,themeLight:`라이트`,themeDark:`다크`,exportHtml:`HTML 내보내기…`,exporting:`내보내는 중…`,exportFailed:`내보낼 수 없습니다: {error}`,warnings:{tableSkipped:{title:`문서화할 수 없는 테이블이 있습니다`,detail:`{table} 을(를) 건너뛰었습니다: {reason}. 이 문서에서 누락되었습니다.`},noForeignKeyMetadata:{title:`표시할 관계가 없습니다`,detail:`{engine} 은(는) 외래 키 메타데이터를 보고하지 않으므로 관계를 도출할 수 없습니다. 이 엔진에 대해서는 다이어그램이 완전합니다.`},commentsUnsupported:{title:`데이터베이스 코멘트를 사용할 수 없습니다`,detail:`{engine} 은(는) 테이블 또는 컬럼 코멘트를 지원하지 않으므로 여기의 모든 설명은 이 프로젝트의 메모에서만 제공됩니다.`},orphanedNotes:{title:`더 이상 일치하는 대상이 없는 메모가 있습니다`,detail:`{count} 개의 메모가 더 이상 존재하지 않는 테이블 또는 컬럼을 참조하고 있습니다. 삭제된 항목은 없습니다 — 메모 파일에서 다시 매핑하거나 제거하세요.`},dbmlOmitted:{title:`DBML로 표현할 수 없습니다`,detail:`{table} 의 {item} 은(는) 여기에 문서화되어 있지만 내보낸 DBML에서는 제외되었습니다: {reason}.`}}},"pt-BR":{title:`Documentação`,groupBySchema:`Schemas`,groupByTableGroup:`Grupos de tabelas`,noGroup:`(sem grupo)`,noSchema:`(sem schema)`,search:`Buscar tabelas, colunas, grupos…`,columns:`Colunas`,indexes:`Índices`,references:`Referências`,referencedBy:`Referenciado por`,localNote:`LOCAL`,shadowedComment:`Comentário do banco de dados: {comment}`,addNote:`Adicionar uma nota`,editNote:`Editar nota`,newGroup:`Novo grupo…`,groupName:`Nome do grupo`,groupColour:`Cor`,deleteGroup:`Excluir grupo`,enumValues:`Valores`,usedBy:`Usado por`,openDiagram:`Abrir diagrama do schema`,saving:`Salvando…`,saved:`Salvo`,saveFailed:`Não foi possível salvar as notas: {error}`,overview:`Visão geral`,groupBy:`Agrupar por`,searchLabel:`Buscar`,groups:`Grupos`,relationships:`Relacionamentos`,columnHeader:`Coluna`,typeHeader:`Tipo`,settingsHeader:`Configurações`,noteHeader:`Nota`,nameHeader:`Nome`,definitionHeader:`Definição`,noOutgoingRelationships:`Esta tabela não referencia nenhuma outra tabela.`,noIncomingRelationships:`Nenhuma tabela referencia esta.`,diagram:`Diagrama`,language:`Idioma`,theme:`Tema`,themeLight:`Claro`,themeDark:`Escuro`,exportHtml:`Exportar HTML…`,exporting:`Exportando…`,exportFailed:`Não foi possível exportar: {error}`,warnings:{tableSkipped:{title:`Uma tabela não pôde ser documentada`,detail:`{table} foi ignorada: {reason}. Ela está faltando nesta documentação.`},noForeignKeyMetadata:{title:`Nenhum relacionamento disponível`,detail:`{engine} não reporta metadados de foreign key, então nenhum relacionamento pôde ser derivado. O diagrama está completo para este engine.`},commentsUnsupported:{title:`Comentários do banco de dados indisponíveis`,detail:`{engine} não suporta comentários em tabelas ou colunas, então toda descrição aqui vem apenas das notas deste projeto.`},orphanedNotes:{title:`Algumas notas não correspondem mais a nada`,detail:`{count} nota(s) referenciam uma tabela ou coluna que não existe mais. Nada foi excluído — remapeie ou remova essas notas no arquivo de notas.`},dbmlOmitted:{title:`Não representável em DBML`,detail:`{item} em {table} está documentado aqui mas foi omitido do DBML exportado: {reason}.`}}},"zh-CN":{title:`文档`,groupBySchema:`Schema`,groupByTableGroup:`表分组`,noGroup:`(无分组)`,noSchema:`(无 Schema)`,search:`搜索表、列、分组…`,columns:`列`,indexes:`索引`,references:`引用`,referencedBy:`被引用`,localNote:`本地`,shadowedComment:`数据库注释: {comment}`,addNote:`添加备注`,editNote:`编辑备注`,newGroup:`新建分组…`,groupName:`分组名称`,groupColour:`颜色`,deleteGroup:`删除分组`,enumValues:`值`,usedBy:`被使用于`,openDiagram:`打开 Schema 图`,saving:`保存中…`,saved:`已保存`,saveFailed:`无法保存备注: {error}`,overview:`概览`,groupBy:`分组方式`,searchLabel:`搜索`,groups:`分组`,relationships:`关系`,columnHeader:`列`,typeHeader:`类型`,settingsHeader:`设置`,noteHeader:`备注`,nameHeader:`名称`,definitionHeader:`定义`,noOutgoingRelationships:`此表未引用任何其他表。`,noIncomingRelationships:`没有表引用此表。`,diagram:`图`,language:`语言`,theme:`主题`,themeLight:`浅色`,themeDark:`深色`,exportHtml:`导出 HTML…`,exporting:`导出中…`,exportFailed:`无法导出: {error}`,warnings:{tableSkipped:{title:`有一张表无法生成文档`,detail:`{table} 被跳过: {reason}。此文档中缺少该表。`},noForeignKeyMetadata:{title:`没有可用的关系`,detail:`{engine} 不报告外键元数据,因此无法推导出任何关系。此图对该数据库引擎而言已经完整。`},commentsUnsupported:{title:`数据库注释不可用`,detail:`{engine} 不支持表或列注释,因此这里的所有描述均仅来自本项目的备注。`},orphanedNotes:{title:`部分备注已不再对应任何内容`,detail:`{count} 条备注引用的表或列已不存在。没有任何内容被删除 — 请在备注文件中重新映射或移除它们。`},dbmlOmitted:{title:`无法在 DBML 中表示`,detail:`{table} 上的 {item} 已在此处记录,但已从导出的 DBML 中省略: {reason}。`}}},"zh-TW":{title:`文件`,groupBySchema:`Schema`,groupByTableGroup:`資料表分組`,noGroup:`(無分組)`,noSchema:`(無 Schema)`,search:`搜尋資料表、欄位、分組…`,columns:`欄位`,indexes:`索引`,references:`參照`,referencedBy:`被參照`,localNote:`本機`,shadowedComment:`資料庫註解: {comment}`,addNote:`新增備註`,editNote:`編輯備註`,newGroup:`新增分組…`,groupName:`分組名稱`,groupColour:`顏色`,deleteGroup:`刪除分組`,enumValues:`值`,usedBy:`被使用於`,openDiagram:`開啟 Schema 圖`,saving:`儲存中…`,saved:`已儲存`,saveFailed:`無法儲存備註: {error}`,overview:`總覽`,groupBy:`分組方式`,searchLabel:`搜尋`,groups:`分組`,relationships:`關聯`,columnHeader:`欄位`,typeHeader:`類型`,settingsHeader:`設定`,noteHeader:`備註`,nameHeader:`名稱`,definitionHeader:`定義`,noOutgoingRelationships:`此資料表未參照任何其他資料表。`,noIncomingRelationships:`沒有資料表參照此資料表。`,diagram:`圖表`,language:`語言`,theme:`主題`,themeLight:`淺色`,themeDark:`深色`,exportHtml:`匯出 HTML…`,exporting:`匯出中…`,exportFailed:`無法匯出: {error}`,warnings:{tableSkipped:{title:`有一張資料表無法產生文件`,detail:`{table} 被略過: {reason}。此文件中缺少該資料表。`},noForeignKeyMetadata:{title:`沒有可用的關聯`,detail:`{engine} 未回報外鍵中繼資料,因此無法推導出任何關聯。此圖對該資料庫引擎而言已經完整。`},commentsUnsupported:{title:`資料庫註解無法使用`,detail:`{engine} 不支援資料表或欄位註解,因此這裡的所有說明均僅來自本專案的備註。`},orphanedNotes:{title:`部分備註已不再對應任何內容`,detail:`{count} 筆備註參照的資料表或欄位已不存在。沒有任何內容被刪除 — 請在備註檔案中重新對應或移除它們。`},dbmlOmitted:{title:`無法在 DBML 中表示`,detail:`{table} 上的 {item} 已在此處記錄,但已從匯出的 DBML 中省略: {reason}。`}}}};function rd(e,t){let n=t.split(`.`).reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e);return typeof n==`string`?n:null}function id(e){let t=nd[e]??nd.en;return(e,n)=>{let r=e.startsWith(`docs.`)?e.slice(5):e,i=rd(t,r)??rd(nd.en,r);return i===null?e:n?i.replace(/\{(\w+)\}/g,(e,t)=>t in n?String(n[t]):e):i}}var ad={class:`flex h-full min-h-0 flex-col bg-background text-foreground`},od={class:`flex shrink-0 flex-wrap items-center justify-end gap-4 border-b border-border px-4 py-2`},sd={class:`flex items-center gap-2 text-xs text-muted-foreground`},cd={value:`light`},ld={value:`dark`},ud={class:`flex items-center gap-2 text-xs text-muted-foreground`},dd=[`value`],fd=L({__name:`ExportApp`,props:{payload:{}},setup(e){let t=e,n=P(t.payload.lang in nd?t.payload.lang:`en`),r=Y(()=>id(n.value)),i=td.filter(e=>e.value in nd),a=P(typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);Pn(a,e=>{let t=document.documentElement;t.classList.toggle(`dark`,e===`dark`),t.style.colorScheme=e},{immediate:!0}),Pn(n,e=>{document.documentElement.lang=e},{immediate:!0});let o=P($u(location.hash,t.payload.snapshot,!0));function s(){o.value=$u(location.hash,t.payload.snapshot,!0)}function c(e){o.value=e;let t=ed(e);location.hash!==t&&(location.hash=t)}return nr(()=>window.addEventListener(`hashchange`,s)),ar(()=>window.removeEventListener(`hashchange`,s)),(t,s)=>(U(),W(`div`,ad,[G(`div`,od,[G(`label`,sd,[zi(O(r.value(`docs.theme`))+` `,1),On(G(`select`,{"onUpdate:modelValue":s[0]||=e=>a.value=e,class:`rounded border border-border bg-background px-2 py-1 text-xs text-foreground`},[G(`option`,cd,O(r.value(`docs.themeLight`)),1),G(`option`,ld,O(r.value(`docs.themeDark`)),1)],512),[[no,a.value]])]),G(`label`,ud,[zi(O(r.value(`docs.language`))+` `,1),On(G(`select`,{"onUpdate:modelValue":s[1]||=e=>n.value=e,class:`rounded border border-border bg-background px-2 py-1 text-xs text-foreground`},[(U(!0),W(V,null,R(F(i),e=>(U(),W(`option`,{key:e.value,value:e.value},O(e.label),9,dd))),128))],512),[[no,n.value]])])]),K(Zu,{class:`min-h-0 flex-1`,snapshot:e.payload.snapshot,annotations:e.payload.annotations,readonly:!0,translate:r.value,route:o.value,diagram:`inline`,"onUpdate:route":c},null,8,[`snapshot`,`annotations`,`translate`,`route`])]))}});function pd(){let e=document.querySelector(`script[type='application/dbx-snapshot']`);if(e===null)throw Error(`no <script type='application/dbx-snapshot'> in this document`);let t=atob((e.textContent??``).trim()),n=Uint8Array.from(t,e=>e.charCodeAt(0));return JSON.parse(new TextDecoder().decode(n))}try{mo(fd,{payload:pd()}).mount(`#app`)}catch(e){let t=document.createElement(`p`);t.style.cssText=`margin:2rem;font-family:system-ui,sans-serif`,t.textContent=`This documentation file could not be read: ${e instanceof Error?e.message:String(e)}`,document.querySelector(`#app`)?.replaceChildren(t)}})();\ No newline at end of filediff --git a/crates/dbx-core/assets/docs-export.manifest.json b/crates/dbx-core/assets/docs-export.manifest.jsonnew file mode 100644index 0000000000..eede3c590f--- /dev/null+++ b/crates/dbx-core/assets/docs-export.manifest.json@@ -0,0 +1,52 @@+{+ "sources": {+ "apps/desktop/public/fonts/geist-latin-wght-normal.woff2": "19f9c92546aa300c312235e3125af1b81394d8db9a4bc4a425cd5b641d2d54e1",+ "apps/desktop/src/docs-export/ExportApp.vue": "499ba5beb89cc411ef32f92d9aaff356a43663f5f455a0a168bb3ade86dd143c",+ "apps/desktop/src/docs-export/export.css": "c96e413fb305e7b06932248d6f03e68ad05928954dc89bac075a79a6d4cf4a9d",+ "apps/desktop/src/docs-export/exportPayload.ts": "d2355903843aa8a2e37b83827de9c4df2187d6df92fd514e3ab2fd89390e4b6c",+ "apps/desktop/src/docs-export/exportTranslate.ts": "2e01bf9ad20fb38f3dfab96769ed87c44a24e5eb8d0aa352f4b398606fb77e3b",+ "apps/desktop/src/docs-export/main.ts": "08c541f19fa6e368ea42fd096320da4312624f1961cd2b59387aa618288fc397",+ "apps/desktop/src/docs/DocsApp.vue": "60fa8c3f434efb39622688f8ad65dcad77eedd99bde9ffb9103d711519aa29d3",+ "apps/desktop/src/docs/components/ColumnTable.vue": "a3e40f27e2d20f46c16b8b5b4f5cb83037ebb35ee667563a351dbe0a41e2f745",+ "apps/desktop/src/docs/components/DocsSearch.vue": "163d585dc3400b30d7ff37b4efec7ce646933699131e11e4120979b2d3286c78",+ "apps/desktop/src/docs/components/DocsSidebar.vue": "cf4a394b9b1ceff18e463c3ba5366921b61033d6ccf530373a9b300b23f0baf8",+ "apps/desktop/src/docs/components/EnumPage.vue": "e570c3b0f322816646025b185909cf4a46e85cc87ff153706d9080f5e3c36f84",+ "apps/desktop/src/docs/components/GroupEditor.vue": "57c241281d4c3cf90aa60b5544b72955177e48bbe80bdd78d5b7f417fb635e18",+ "apps/desktop/src/docs/components/GroupPicker.vue": "2bf6066c3574935402b0acc9f50a6580b1fb256b94bac960bafb183fd77a0c98",+ "apps/desktop/src/docs/components/NoteEditor.vue": "ab905e106734bd27e46bfb306c168d624e3f0eba9bd878975f738c69eb50d394",+ "apps/desktop/src/docs/components/RelationshipList.vue": "bc9d074aa942c878405f19dd49cea8f7aa492bbcde7fffa0c93e2a51dad0abf7",+ "apps/desktop/src/docs/components/SchemaDiagram.vue": "5942d6d86bf56efeabcd9e0aee2179515778a067760d4bb7a71e09b694deefef",+ "apps/desktop/src/docs/components/TablePage.vue": "48b3fb848c2bede191b5ff04379c24b5088b49ea53e7b7be853ba904ad6cd371",+ "apps/desktop/src/docs/components/WarningBanner.vue": "5b9ea68de1c7221cee9c5a5af6488316902fcc5c3a2bbce5d69e0ab767c1b059",+ "apps/desktop/src/docs/components/WikiIndex.vue": "eea6724bc705b98969eceb56852928cede06ca8b32c0b125f425eec2c57bd7e6",+ "apps/desktop/src/docs/diagramGeometry.ts": "839ba0fb02560bfcd4cb686568ec664de1c041a6c364b8c7b27438ce884f9dbf",+ "apps/desktop/src/docs/docs.css": "7a2b1f5344b453c7d3673eff7027f7226d0011eb714561e33d1a3e19bc3431c9",+ "apps/desktop/src/docs/docsIndex.ts": "7e993b2039761c69dca2a1eb440eae1d24ac0e8d67802091221f52aaf73a5d72",+ "apps/desktop/src/docs/docsKeys.ts": "f98396155fd83b595080a9311092b86cd50d637f01b0986abe17d56568bdbb24",+ "apps/desktop/src/docs/docsRoute.ts": "bd7a97b31bef4825e518596937c302a8792ea45e2e31c5b7a1066390aa4de5d2",+ "apps/desktop/src/docs/docsSearch.ts": "2ca70bb8c31510823058b62402999d158592844a6f57205b5a73019d320ef84f",+ "apps/desktop/src/docs/docsWarnings.ts": "0378b27c0c7c841fc9703f4522e13944ee1116db2fbda823f9cd7a8e8fdd3134",+ "apps/desktop/src/docs/groupColor.ts": "a6cee9c5af8e531eaf15486678307b8cad41e75b9ec688ebae6f33c8a0da6a73",+ "apps/desktop/src/docs/renderNote.ts": "aa2f3ef12deb2aa399de13f6f0d0d747595c384a50f501ae0d7c4a1182e63e1c",+ "apps/desktop/src/i18n/locales/docs/en.ts": "caacc3011fdf80e1810eb3fb8f48f658825a1312809cb9444f610d2db25407e7",+ "apps/desktop/src/i18n/locales/docs/es.ts": "950eeee11572cea85d4d226e0646484876fe62d8a9e7d641c3fb3704ec714258",+ "apps/desktop/src/i18n/locales/docs/it.ts": "878fb388813e994a4f9dafba0847d3cdaf06d7e9d1ecd18625c9ee772c149128",+ "apps/desktop/src/i18n/locales/docs/ja.ts": "ecaeb17c683b811bc361deaafa421749e64677a804d6f77ab08c1ea6554a6c25",+ "apps/desktop/src/i18n/locales/docs/ko.ts": "271d21eb054b6731d108621eae216c69b49dada868774239b085e399dcc0ecf3",+ "apps/desktop/src/i18n/locales/docs/pt-BR.ts": "f92c0b95b1b807c60a5136677808ed5014d9061dffd970aa5866eb1c82300dc5",+ "apps/desktop/src/i18n/locales/docs/zh-CN.ts": "2092c39277f2a6774405124d1f167bbcbc5f633d8f82bbd2b28ff5e12d78f3f7",+ "apps/desktop/src/i18n/locales/docs/zh-TW.ts": "691cf502248dbd09358c6c276990945013b26c52fb682bcd56b26f378daea29c",+ "apps/desktop/src/lib/app/localeOptions.ts": "c269b1ca1d5c71dc27dd2ab5422a902c848722acabf0dbd205275624fc9482e6",+ "apps/desktop/src/lib/diagram/erDiagram.ts": "1b9522b41cd2ee15ef04dc11e0f855459287fca2d5e0f551263dfc6f8de5764e",+ "apps/desktop/src/styles/tokens.css": "5f050d28e3e278c259929e55ffc7bad63e5c3e8340ab6c04c018cbfd941c2b44",+ "apps/desktop/tsconfig.json": "5ad521941835ad8529e9b81ba79c11650e5f020f0e376b7a9f17e22a9306fa76",+ "apps/desktop/vite.docs-export.config.ts": "ba99d16885a572aaccaab46fcd61a5c4ac0c3bea572ea92582fca64118f83d86"+ },+ "deps": {+ "@vue/reactivity": "3.5.35",+ "@vue/runtime-core": "3.5.35",+ "@vue/runtime-dom": "3.5.35",+ "@vue/shared": "3.5.35",+ "marked": "18.0.4"+ }+}diff --git a/crates/dbx-core/examples/docs_export_smoke.rs b/crates/dbx-core/examples/docs_export_smoke.rsnew file mode 100644index 0000000000..a6669c1ca3--- /dev/null+++ b/crates/dbx-core/examples/docs_export_smoke.rs@@ -0,0 +1,89 @@+//! Builds a small two-table snapshot and writes the real+//! `to_standalone_html` output to `argv[1]`.+//!+//! Exists so `exportSmoke.spec.ts` can execute genuine export output in+//! happy-dom rather than a hand-built approximation of it.++use std::collections::BTreeMap;+use std::env;+use std::fs;++use dbx_core::docs::annotations::AnnotationFile;+use dbx_core::docs::{+ to_standalone_html, Cardinality, DocTable, FieldRef, ProjectMeta, Relationship, SchemaSnapshot, TableKind,+};+use dbx_core::types::ColumnInfo;++fn main() {+ let out_path = env::args().nth(1).expect("usage: docs_export_smoke <output-path>");++ let orders = DocTable {+ schema: Some("public".into()),+ name: "orders".into(),+ kind: TableKind::Table,+ columns: vec![+ ColumnInfo { name: "id".into(), data_type: "bigint".into(), is_primary_key: true, ..Default::default() },+ ColumnInfo { name: "customer_id".into(), data_type: "bigint".into(), ..Default::default() },+ ],+ indexes: vec![],+ foreign_keys: vec![],+ group_id: None,+ note: Some("Checkout rows.".into()),+ note_source: dbx_core::docs::NoteSource::Database,+ shadowed_note: None,+ column_notes: BTreeMap::new(),+ estimated_rows: Some(2_400_000),+ view_definition: None,+ };++ let customers = DocTable {+ schema: Some("public".into()),+ name: "customers".into(),+ kind: TableKind::Table,+ columns: vec![ColumnInfo {+ name: "id".into(),+ data_type: "bigint".into(),+ is_primary_key: true,+ ..Default::default()+ }],+ indexes: vec![],+ foreign_keys: vec![],+ group_id: None,+ note: None,+ note_source: dbx_core::docs::NoteSource::None,+ shadowed_note: None,+ column_notes: BTreeMap::new(),+ estimated_rows: Some(50_000),+ view_definition: None,+ };++ let snapshot = SchemaSnapshot {+ format_version: 1,+ project: ProjectMeta {+ name: "shop".into(),+ database_type: "postgres".into(),+ database: Some("shop".into()),+ schemas: vec!["public".into()],+ generated_at: "2026-08-06T00:00:00Z".into(),+ note: None,+ },+ tables: vec![orders, customers],+ relationships: vec![Relationship {+ id: "orders.customer_id->customers.id".into(),+ name: None,+ from: FieldRef { schema: Some("public".into()), table: "orders".into(), column: "customer_id".into() },+ to: FieldRef { schema: Some("public".into()), table: "customers".into(), column: "id".into() },+ cardinality: Cardinality::ManyToOne,+ on_update: None,+ on_delete: None,+ }],+ groups: vec![],+ enums: vec![],+ warnings: vec![],+ };++ let annotations = AnnotationFile { format_version: 1, project: None, groups: Vec::new(), tables: BTreeMap::new() };++ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");+ fs::write(&out_path, html).expect("write output file");+}diff --git a/crates/dbx-core/src/docs/export.rs b/crates/dbx-core/src/docs/export.rsnew file mode 100644index 0000000000..fc76629319--- /dev/null+++ b/crates/dbx-core/src/docs/export.rs@@ -0,0 +1,277 @@+use base64::Engine as _;++use crate::docs::annotations::AnnotationFile;+use crate::docs::snapshot::SchemaSnapshot;++/// The viewer bundle, built by `pnpm build:docs-export` and committed.+///+/// Committed rather than built by cargo because Rust cannot run Vite and+/// `dbx docs` must work from a plain `cargo install` on a machine with no+/// Node. `docs_export_bundle_is_current` is what keeps it honest.+const EXPORT_JS: &str = include_str!("../../assets/docs-export.js");+const EXPORT_CSS: &str = include_str!("../../assets/docs-export.css");++pub const EXPORT_LANGUAGES: [&str; 8] = ["en", "es", "it", "ja", "ko", "pt-BR", "zh-CN", "zh-TW"];++/// Render a snapshot as one self-contained HTML file.+///+/// `snapshot` must already have annotations applied — `apply_annotations` is+/// Rust and the export has no Rust at runtime. `annotations` travels too,+/// because the merge erases what the viewer needs to colour groups:+/// `snapshot.groups` holds resolved `TableGroup`s, `annotations.groups` holds+/// the hue.+pub fn to_standalone_html(+ snapshot: &SchemaSnapshot,+ annotations: &AnnotationFile,+ lang: &str,+) -> Result<String, String> {+ if !EXPORT_LANGUAGES.contains(&lang) {+ return Err(format!("Unknown language \"{lang}\". Valid values: {}.", EXPORT_LANGUAGES.join(", ")));+ }++ let payload = serde_json::json!({ "snapshot": snapshot, "annotations": annotations, "lang": lang });+ let json = serde_json::to_vec(&payload)+ .map_err(|error| format!("Failed to serialise the documentation payload: {error}"))?;+ // base64 rather than escaped JSON: the alphabet cannot contain `<`, so no+ // escaping rule exists to forget. The alternative's correctness depends+ // on every serialisation path applying the escape.+ let encoded = base64::engine::general_purpose::STANDARD.encode(&json);++ let title = html_escape(&snapshot.project.name);+ Ok(format!(+ "<!doctype html>\n<html lang=\"{lang}\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>{title}</title>\n<style>{EXPORT_CSS}</style>\n</head>\n<body>\n<div id=\"app\"></div>\n<script type=\"application/dbx-snapshot\">{encoded}</script>\n<script>{EXPORT_JS}</script>\n</body>\n</html>\n"+ ))+}++fn html_escape(value: &str) -> String {+ value.replace('&', "&").replace('<', "<").replace('>', ">").replace('"', """)+}++#[cfg(test)]+mod tests {+ use super::*;+ use crate::docs::annotations::AnnotationFile;+ use crate::docs::snapshot::SchemaSnapshot;++ /// `SchemaSnapshot` is `#[serde(rename_all = "camelCase")]` with+ /// `format_version` at the TOP level — not inside `project` — and+ /// `ProjectMeta` requires `name`, `databaseType`, `schemas` and+ /// `generatedAt`. `AnnotationFile` does NOT derive `Default`, and its+ /// `format_version` must be 1, so it is built explicitly.+ fn fixture() -> (SchemaSnapshot, AnnotationFile) {+ let snapshot: SchemaSnapshot = serde_json::from_str(+ r#"{"formatVersion":1,"project":{"name":"shop","databaseType":"postgres","database":"shop","schemas":["public"],"generatedAt":"2026-08-06T00:00:00Z","note":null},"tables":[],"enums":[],"relationships":[],"groups":[],"warnings":[]}"#,+ )+ .expect("fixture snapshot");+ let annotations = AnnotationFile {+ format_version: 1,+ project: None,+ groups: Vec::new(),+ tables: std::collections::BTreeMap::new(),+ };+ (snapshot, annotations)+ }++ #[test]+ fn a_note_containing_a_closing_script_tag_survives() {+ // THE reason the payload is base64. A note discussing HTML is+ // entirely plausible in a schema document, and inlined as text it+ // would terminate the script element early and inject the rest of+ // the payload as markup.+ let (snapshot, mut annotations) = fixture();+ annotations.project = Some(crate::docs::annotations::ProjectAnnotation {+ name: None,+ note: Some("</script><img src=x onerror=alert(1)>".into()),+ });+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");++ assert!(!html.contains("<img src=x"), "the payload leaked into markup");+ assert_eq!(html.matches("</script>").count(), 2, "exactly the two real script elements");+ }++ #[test]+ fn the_payload_round_trips() {+ let (snapshot, annotations) = fixture();+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");+ let start = html.find("application/dbx-snapshot").expect("payload element");+ let body = &html[start..];+ let encoded = body[body.find('>').unwrap() + 1..body.find("</script>").unwrap()].trim();+ let decoded =+ base64::Engine::decode(&base64::engine::general_purpose::STANDARD, encoded).expect("valid base64");+ let value: serde_json::Value = serde_json::from_slice(&decoded).expect("valid json");+ assert_eq!(value["snapshot"]["project"]["name"], "shop");+ assert_eq!(value["lang"], "en");+ }++ #[test]+ fn the_shell_and_stylesheet_reference_no_external_resources() {+ // This test's reach stops at the hand-authored shell and the+ // bundled CSS's `url(...)` references — it does not scan EXPORT_JS+ // for network calls. A substring scan of the bundle can't prove+ // that: it legitimately contains the literal `http://` four times+ // (three SVG/MathML/xlink XML namespace URIs passed to+ // `createElementNS`, one inside the markdown autolinker building an+ // href for `www.`-prefixed text), none of which are fetched. The+ // bundle's purity is covered on the viewer side instead:+ // `componentContract.spec.ts` forbids `fetch(`, `axios` and+ // `invoke(` in every viewer source, and the manifest guard ties the+ // committed bundle to those sources.+ let (snapshot, annotations) = fixture();+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");++ // 1. Every `url(...)` in the emitted stylesheet must be a `data:`+ // URI — an allowlist of the one legitimate scheme, not a+ // blocklist of bad ones, so a new absolute font or image url()+ // fails without anyone having to extend a list. The match is+ // case-insensitive because CSS's `url()` function name is+ // case-insensitive per spec (`URL(...)` is legal); an ASCII-only+ // bundle makes a byte-wise check safe here.+ fn find_url_ci(s: &str, from: usize) -> Option<usize> {+ let bytes = s.as_bytes();+ (from..bytes.len().saturating_sub(3)).find(|&i| bytes[i..i + 4].eq_ignore_ascii_case(b"url("))+ }++ let style_start = html.find("<style>").expect("style element") + "<style>".len();+ let style_end = html.find("</style>").expect("style element closes");+ let style = &html[style_start..style_end];+ let mut cursor = 0;+ let mut url_count = 0;+ while let Some(pos) = find_url_ci(style, cursor) {+ let rest = &style[pos + "url(".len()..];+ let end = rest.find(')').expect("unterminated url(");+ let value = rest[..end].trim().trim_matches('\'').trim_matches('"');+ assert!(value.starts_with("data:"), "stylesheet references a non-data url(): {value}");+ url_count += 1;+ cursor = pos + "url(".len() + end + 1;+ }+ // A scan that finds nothing hasn't verified anything — today the+ // font is inlined via exactly one `url()`, so zero would mean the+ // build stopped inlining it, not that there is nothing left to check.+ assert!(url_count >= 1, "found no url(...) in the stylesheet — the scan above verified nothing");++ // 2. The hand-authored shell — the document with the bundle's own+ // CSS, JS, and the base64 payload removed — must contain no+ // `src=` or `href=` at all. Checked against the shell alone so+ // neither the bundle's contents nor the payload can influence+ // the result.+ let payload_start = html.find("application/dbx-snapshot").expect("payload element");+ let payload_body = &html[payload_start..];+ let encoded = payload_body[payload_body.find('>').unwrap() + 1..payload_body.find("</script>").unwrap()].trim();+ let shell = html.replace(EXPORT_CSS, "").replace(EXPORT_JS, "").replace(encoded, "");+ assert!(!shell.contains("src="), "the shell references an external src");+ assert!(!shell.contains("href="), "the shell references an external href");+ }++ #[test]+ fn an_unknown_language_is_rejected() {+ let (snapshot, annotations) = fixture();+ let error = to_standalone_html(&snapshot, &annotations, "kl").expect_err("should reject");+ assert!(error.contains("kl"), "got: {error}");+ assert!(error.contains("en"), "the error must list the valid locales, got: {error}");+ }++ /// The committed bundle must match the sources it was built from.+ ///+ /// Skips only when the crate is consumed from a published package, where+ /// `apps/desktop/` does not exist. That skip is itself a hazard — a+ /// vacuous skip in CI would silently disable this guard — so it keys off+ /// a repository-only marker rather than off the absence of the sources.+ #[test]+ fn docs_export_bundle_is_current() {+ use sha2::{Digest, Sha256};++ let workspace =+ std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..").canonicalize().expect("workspace root");+ if !workspace.join("pnpm-workspace.yaml").exists() {+ return; // packaged crate: the sources are genuinely absent+ }++ let manifest: serde_json::Value = serde_json::from_str(include_str!("../../assets/docs-export.manifest.json"))+ .expect("manifest is valid JSON");+ let sources = manifest["sources"].as_object().expect("manifest.sources");+ assert!(sources.len() > 5, "manifest lists only {} sources — the build emitted an empty graph", sources.len());++ let mut stale = Vec::new();+ for (relative, expected) in sources {+ let path = workspace.join(relative);+ let Ok(bytes) = std::fs::read(&path) else {+ stale.push(format!("{relative} (missing)"));+ continue;+ };+ let actual = format!("{:x}", Sha256::digest(&bytes));+ if actual != expected.as_str().unwrap_or_default() {+ stale.push(relative.clone());+ }+ }++ assert!(+ stale.is_empty(),+ "the committed docs export bundle is stale.\nChanged: {}\nRun: pnpm build:docs-export",+ stale.join(", ")+ );+ }++ /// `EXPORT_JS` is interpolated into `<script>{EXPORT_JS}</script>` raw —+ /// unlike the base64 payload, nothing escapes it. That is safe against a+ /// literal `</script>` (asserted above), but the HTML tokenizer has two+ /// more states that can hide one: inside a `<script>` element, a literal+ /// `<!--` switches it to script-data-escaped, and a `<script` seen while+ /// in that state switches it again to script-data-double-escaped — where+ /// `</script>` no longer closes the element. Both sequences exist in+ /// EXPORT_JS today (third-party minified output) and are safe only+ /// because every `<!--` is closed by a `-->` before the next `<script`.+ /// This pins that ordering so a dependency bump can't silently trade it+ /// away and swallow the real closing tag, leaving the reader a blank+ /// page. Deliberately not a full tokenizer: it only checks the ordering+ /// the double-escape trap actually depends on.+ #[test]+ fn embedded_export_js_closes_every_comment_before_the_next_script_tag() {+ let lower = EXPORT_JS.to_ascii_lowercase();+ let mut pos = 0;+ while let Some(open_rel) = lower[pos..].find("<!--") {+ let open = pos + open_rel;+ let close = lower[open..].find("-->").map(|offset| open + offset);+ let next_script = lower[open..].find("<script").map(|offset| open + offset);+ match (close, next_script) {+ (Some(close), Some(script)) => assert!(+ close < script,+ "an unmatched <!-- at byte {open} precedes a <script at byte {script} \+ before its --> closes — this would trap the browser in \+ script-data-double-escaped state and swallow our own closing </script>"+ ),+ (None, Some(script)) => panic!(+ "an unclosed <!-- at byte {open} precedes a <script at byte {script} \+ with no matching --> anywhere after it"+ ),+ (Some(_), None) | (None, None) => {}+ }+ pos = open + "<!--".len();+ }+ }++ /// Tailwind v4 generates utility classes like `bg-background` from the+ /// `--color-*` entries inside an `@theme` block (in `tokens.css`), not+ /// from raw custom properties. If that block were lost, the build would+ /// still succeed and emit a stylesheet — just one with no utilities in+ /// it — and the export would render completely unstyled while every+ /// other test here passed. Nothing else in this file guards it.+ #[test]+ fn the_stylesheet_carries_resolved_utilities() {+ assert!(+ EXPORT_CSS.contains(".bg-background{background-color:var("),+ "the stylesheet is missing a resolved `.bg-background` utility — \+ `@theme` in tokens.css may have been lost, or the token it \+ resolves through is gone"+ );++ // `@custom-variant dark` — its failure is invisible in light mode,+ // where the export would look correct right up until dark mode+ // shipped unstyled.+ assert!(+ EXPORT_CSS.contains(":is(.dark *)"),+ "the stylesheet has no `:is(.dark *)` selector — the dark variant \+ may have been lost; this would ship undetected because light \+ mode looks fine"+ );+ }+}diff --git a/crates/dbx-core/src/docs/mod.rs b/crates/dbx-core/src/docs/mod.rsindex dabea07811..d4f8497a23 100644--- a/crates/dbx-core/src/docs/mod.rs+++ b/crates/dbx-core/src/docs/mod.rs@@ -2,6 +2,7 @@ pub mod annotations;pub mod collector;pub mod color;pub mod dbml;+pub mod export;pub mod keys;pub mod relations;pub mod snapshot;@@ -9,6 +10,7 @@ pub mod snapshot;pub use collector::{collect_snapshot, CollectOptions, CollectProgress};pub use color::hue_to_hex;pub use dbml::{to_dbml, DbmlOutput};+pub use export::{to_standalone_html, EXPORT_LANGUAGES};pub use keys::{column_key, fold_identifier, table_key};pub use relations::build_relationships;pub use snapshot::*;diff --git a/crates/dbx-web/src/main.rs b/crates/dbx-web/src/main.rsindex 44c2c3798f..c9e70406fe 100644--- a/crates/dbx-web/src/main.rs+++ b/crates/dbx-web/src/main.rs@@ -381,6 +381,7 @@ async fn main() {.route("/docs/annotations/load", post(routes::docs::load_annotations)).route("/docs/annotations/apply", post(routes::docs::apply_annotations)).route("/docs/annotations/save", post(routes::docs::save_annotations))+ .route("/docs/export", post(routes::docs::export_html)).route("/dialect/data-types", get(routes::dialect::list_data_types)).route("/schema-diff/prepare", post(routes::schema_diff::prepare_schema_diff)).route("/schema-diff/generate-sync-sql", post(routes::schema_diff::generate_schema_sync_sql))diff --git a/crates/dbx-web/src/routes/docs.rs b/crates/dbx-web/src/routes/docs.rsindex 071e189577..0dadaedd33 100644--- a/crates/dbx-web/src/routes/docs.rs+++ b/crates/dbx-web/src/routes/docs.rs@@ -5,7 +5,7 @@ use axum::extract::State;use axum::Json;use dbx_core::docs::{CollectOptions, SchemaSnapshot};use dbx_core::models::connection::ConnectionConfig;-use serde::Deserialize;+use serde::{Deserialize, Serialize};use crate::error::AppError;use crate::state::WebState;@@ -112,3 +112,26 @@ pub async fn save_annotations(dbx_core::docs::annotations::save_annotations(&path, &request.annotations).map_err(AppError::from)?;Ok(Json(()))}++#[derive(Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct DocsExportRequest {+ pub snapshot: SchemaSnapshot,+ pub annotations: dbx_core::docs::annotations::AnnotationFile,+ pub lang: String,+}++#[derive(Serialize)]+#[serde(rename_all = "camelCase")]+pub struct DocsExportResponse {+ pub content: String,+}++/// Returns the rendered HTML as a string rather than writing a file: the+/// browser has no filesystem to write to, so `http.ts` downloads this content+/// as a blob instead of the Tauri command's `std::fs::write`.+pub async fn export_html(Json(request): Json<DocsExportRequest>) -> Result<Json<DocsExportResponse>, AppError> {+ let content = dbx_core::docs::to_standalone_html(&request.snapshot, &request.annotations, &request.lang)+ .map_err(AppError::from)?;+ Ok(Json(DocsExportResponse { content }))+}diff --git a/docs/superpowers/plans/2026-08-06-database-documentation-export.md b/docs/superpowers/plans/2026-08-06-database-documentation-export.mdnew file mode 100644index 0000000000..30c25997b3--- /dev/null+++ b/docs/superpowers/plans/2026-08-06-database-documentation-export.md@@ -0,0 +1,1631 @@+# Standalone Documentation Export Implementation Plan++> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.++**Goal:** Produce one self-contained HTML file — from a `dbx docs` CLI verb and from a button in the app — that renders a database's documentation from `file://` on a machine with no DBX installed.++**Architecture:** The existing pure viewer under `apps/desktop/src/docs/` is bundled by a dedicated Vite entry into one JS and one CSS file, committed into `crates/dbx-core/assets/` and embedded with `include_str!`. A Rust function `to_standalone_html` base64-encodes the snapshot payload and emits the HTML; the CLI and a Tauri command both call it. A build-derived manifest makes the committed artefact unable to drift from its sources without a test failing.++**Tech Stack:** Rust (dbx-core, dbx-cli, Tauri), Vue 3.5 `<script setup lang="ts">`, Vite 8, Tailwind v4, vitest 4 + happy-dom 20, `base64 0.22` and `sha2 0.10` (both already dbx-core dependencies).++## Global Constraints++- **No new dependencies.** `base64 0.22` and `sha2 0.10` are already in `crates/dbx-core/Cargo.toml` (lines 61 and 67). `happy-dom ^20.10.6` is already a devDependency. Adding anything else requires explicit approval.+- **`apps/desktop/src/docs/**/*.vue` must make zero backend calls.** Enforced by `apps/desktop/src/docs/__tests__/componentContract.spec.ts`, whose forbidden list is `["@/lib/backend", "@tauri-apps", "invoke(", "useConnectionStore", "useQueryStore", "useSettingsStore", "fetch(", "axios", "vue-i18n", "useI18n("]`. Extend it; never weaken it.+- **Every component uses `<script setup lang="ts">`.** Asserted by the same contract test.+- **No colour computed in a component.** `oklch(` and 6-digit hex literals are banned in `src/docs/**`; hues go through `groupStyle(hue)` from `apps/desktop/src/docs/groupColor.ts`.+- **`v-html` may only ever be bound to `renderNote` output.** Both quote styles are checked; `innerHTML` is banned outright.+- **All 8 locales.** `en`, `es`, `it`, `ja`, `ko`, `pt-BR`, `zh-CN`, `zh-TW` in `apps/desktop/src/i18n/locales/docs/`. Parity is enforced by `apps/desktop/src/i18n/__tests__/docsNamespaceParity.spec.ts`.+- **Tests live at** `apps/desktop/src/**/*.spec.ts` (vitest `include` at `vitest.config.ts:14`). Run one with `pnpm vitest run <path> -t "<test name>"`.+- **Rust docs tests** run with `cargo test -p dbx-core --lib docs`.+- **Every new test gets the deliberate-break treatment:** break the behaviour, run the named test, confirm it fails, restore, and report the exact failure message in the task report. Parts 3a and 3b caught four defects this way that no amount of reading found.+- **Commit after every task.** Conventional Commits. End every commit message with:+ ```+ Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+ Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+ ```++---++## File Structure++**Created**++| Path | Responsibility |+|---|---|+| `apps/desktop/src/docs/docsRoute.ts` | Pure parse/format between a hash string and `DocsRoute` |+| `apps/desktop/src/docs/diagramGeometry.ts` | Pure edge clipping — line from card centre to card border |+| `apps/desktop/src/docs/components/SchemaDiagram.vue` | Minimal read-only SVG ER renderer |+| `apps/desktop/src/docs-export/main.ts` | Export entry: decode payload, mount `ExportApp` |+| `apps/desktop/src/docs-export/ExportApp.vue` | Export shell: hash sync, language switcher, `readonly`, `diagram="inline"` |+| `apps/desktop/src/docs-export/exportTranslate.ts` | Build a `Translate` from a bundled locale, English fallback |+| `apps/desktop/src/docs-export/export.css` | Tailwind entry with `@source` narrowed to `../docs/**` |+| `apps/desktop/src/styles/tokens.css` | Design tokens extracted from `globals.css` |+| `apps/desktop/vite.docs-export.config.ts` | Single-file bundle config, font inlining, manifest emission |+| `crates/dbx-core/src/docs/export.rs` | `to_standalone_html` + the staleness guard test |+| `src-tauri/src/commands/docs.rs` (modify) | `docs_export_html` command |++**Modified**++| Path | Change |+|---|---|+| `apps/desktop/src/docs/DocsApp.vue` | Optional `v-model:route`, `diagram` prop, translate its own literals |+| `apps/desktop/src/docs/components/{DocsSidebar,DocsSearch,TablePage,ColumnTable,RelationshipList}.vue` | Accept and use `translate` |+| `apps/desktop/src/i18n/locales/docs/*.ts` (×8) | ~18 new keys |+| `apps/desktop/src/docs/__tests__/componentContract.spec.ts` | Add `SchemaDiagram.vue`; add the hardcoded-literal guard |+| `apps/desktop/src/styles/globals.css` | Token blocks replaced by `@import "./tokens.css"` |+| `crates/dbx-core/src/docs/mod.rs` | `pub mod export;` + re-export |+| `crates/dbx-cli/src/main.rs` | `--lang` flag, `run_docs`, usage line |+| `apps/desktop/src/lib/backend/{api,tauri,http}.ts` | `exportDocsHtml` |+| `apps/desktop/src/components/docs/DatabaseDocsDialog.vue` | Export HTML button |+| `crates/dbx-web/src/{main.rs,routes/docs.rs}` | `/docs/export` route |+| `package.json` | `build:docs-export` script |++---++## Task 1: Internationalise the viewer++The `docs` namespace has 40 keys across 8 locales and a passing parity test, but most of the viewer renders English literals instead of calling them. `groupBySchema: "Schemas"` and `groupByTableGroup: "Table Groups"` exist *specifically* for `DocsSidebar.vue`, which hardcodes both words.++This is a prerequisite: a language switcher over a viewer that is two-thirds hardcoded English would be worse than none. It is also a live defect in the open PR — a Chinese user opening the docs dialog today sees mostly English chrome.++**Files:**+- Modify: `apps/desktop/src/docs/DocsApp.vue`+- Modify: `apps/desktop/src/docs/components/DocsSidebar.vue`+- Modify: `apps/desktop/src/docs/components/DocsSearch.vue`+- Modify: `apps/desktop/src/docs/components/TablePage.vue`+- Modify: `apps/desktop/src/docs/components/ColumnTable.vue`+- Modify: `apps/desktop/src/docs/components/RelationshipList.vue`+- Modify: `apps/desktop/src/i18n/locales/docs/{en,es,it,ja,ko,pt-BR,zh-CN,zh-TW}.ts`+- Test: `apps/desktop/src/docs/__tests__/componentContract.spec.ts`++**Interfaces:**+- Consumes: `Translate` from `apps/desktop/src/docs/docsWarnings.ts` — exactly `export type Translate = (key: string, params?: Record<string, string | number>) => string;`+- Produces: every component under `src/docs/` accepts a required `translate: Translate` prop. Later tasks rely on `DocsSidebar` and `SchemaDiagram` having it.++**Keys already present — wire these, do not re-add:** `groupBySchema`, `groupByTableGroup`, `search`, `columns`, `indexes`, `references`, `referencedBy`, `noGroup`, `noSchema`.++Leave the existing `search` value (`"Search tables, columns, groups…"`) unchanged even though search now also covers enums. Rewording one clause across 8 locales invites translation drift for negligible gain, and results are already labelled by kind.++- [ ] **Step 1: Write the failing guard test**++Append to `apps/desktop/src/docs/__tests__/componentContract.spec.ts`, inside the existing `describe`:++```ts+ it("renders no English literal that already has a key", async () => {+ // Derived from the namespace, NOT an enumerated list of strings. A key+ // added tomorrow is covered tomorrow. This is the guard Part 3b lacked:+ // docsNamespaceParity compares locale files to EACH OTHER, so a key that+ // no component ever calls passes every existing test.+ const en = (await import("../../i18n/locales/docs/en")).default as Record<string, unknown>;+ const literals: string[] = [];+ const walk = (node: unknown) => {+ if (typeof node === "string") {+ // Skip short strings (false positives on words like "LOCAL") and any+ // string carrying a placeholder, which cannot appear verbatim anyway.+ if (node.length >= 4 && !node.includes("{")) literals.push(node);+ return;+ }+ if (node && typeof node === "object") Object.values(node).forEach(walk);+ };+ walk(en);+ expect(literals.length).toBeGreaterThan(10);++ const files = vueFiles();+ expect(files.length).toBe(EXPECTED.length);+ for (const file of files) {+ const source = readFileSync(file, "utf8");+ for (const literal of literals) {+ expect(source.includes(`>${literal}<`), `${path.basename(file)} hardcodes "${literal}" — call translate() instead`).toBe(false);+ expect(source.includes(`="${literal}"`), `${path.basename(file)} hardcodes "${literal}" — call translate() instead`).toBe(false);+ }+ }+ });+```++- [ ] **Step 2: Run it and watch it fail**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/componentContract.spec.ts -t "renders no English literal"`++Expected: FAIL. `DocsSidebar.vue hardcodes "Schemas" — call translate() instead: expected true to be false` (or another of the six components; any one failing is the correct starting state).++- [ ] **Step 3: Add the new keys to `en.ts`**++Insert into `apps/desktop/src/i18n/locales/docs/en.ts` before the `warnings:` block:++```ts+ overview: "Overview",+ groupBy: "Group by",+ searchLabel: "Search",+ groups: "Groups",+ relationships: "Relationships",+ columnHeader: "Column",+ typeHeader: "Type",+ settingsHeader: "Settings",+ noteHeader: "Note",+ nameHeader: "Name",+ definitionHeader: "Definition",+ noOutgoingRelationships: "This table references no other table.",+ noIncomingRelationships: "No table references this one.",+ diagram: "Diagram",+ language: "Language",+ exportHtml: "Export HTML…",+ exporting: "Exporting…",+ exportFailed: "Could not export: {error}",+```++- [ ] **Step 4: Translate the 18 new keys into the other 7 locales**++Add the same 18 keys to `es.ts`, `it.ts`, `ja.ts`, `ko.ts`, `pt-BR.ts`, `zh-CN.ts`, `zh-TW.ts`, matching each file's existing tone and terminology.++**`{error}` must survive verbatim in every locale.** The Part 3b review caught that no automated test verifies placeholder preservation — parity compares key *names*, so a translated or renamed `{error}` would render literal braces to users and pass every test. Check each one by eye.++- [ ] **Step 5: Wire `DocsSidebar.vue`**++Add to its `defineProps`: `translate: Translate;` with `import type { Translate } from "../docsWarnings";`. Then replace the four literals:++```+>Overview< → >{{ translate("docs.overview") }}<+>Group by< → >{{ translate("docs.groupBy") }}<+>Schemas< → >{{ translate("docs.groupBySchema") }}<+>Table Groups< → >{{ translate("docs.groupByTableGroup") }}<+```++- [ ] **Step 6: Wire the remaining five components**++`DocsSearch.vue` — add the `translate` prop; `>Search<` becomes `{{ translate("docs.searchLabel") }}`, and `placeholder="Search tables, columns, groups, enums…"` becomes `:placeholder='translate("docs.search")'`.++`TablePage.vue` — already receives `translate` and passes it down; now use it for its own headings: `Columns` → `docs.columns`, `Indexes` → `docs.indexes`, `Relationships` → `docs.relationships`, `Name` → `docs.nameHeader`, `Settings` → `docs.settingsHeader`, `Definition` → `docs.definitionHeader`.++`ColumnTable.vue` — headers `Column` → `docs.columnHeader`, `Type` → `docs.typeHeader`, `Settings` → `docs.settingsHeader`, `Note` → `docs.noteHeader`.++`RelationshipList.vue` — add the `translate` prop and thread it from `TablePage.vue`:++```+>References ({{ outgoing.length }})< → >{{ translate("docs.references") }} ({{ outgoing.length }})<+>Referenced by ({{ incoming.length }})< → >{{ translate("docs.referencedBy") }} ({{ incoming.length }})<+>This table references no other table.< → >{{ translate("docs.noOutgoingRelationships") }}<+>No table references this one.< → >{{ translate("docs.noIncomingRelationships") }}<+```++`DocsApp.vue` — `>Groups<` becomes `{{ translate("docs.groups") }}`.++- [ ] **Step 7: Run the guard, the parity test and typecheck**++Run: `pnpm vitest run apps/desktop/src/docs apps/desktop/src/i18n`+Expected: PASS, with the new guard among them.++Run: `pnpm typecheck`+Expected: clean. A missing `translate` prop on a threaded component fails here.++- [ ] **Step 8: Commit**++```bash+git add apps/desktop/src/docs apps/desktop/src/i18n+git commit -m "$(cat <<'EOF'+fix(docs): translate the viewer's own chrome++The docs namespace has carried 40 keys across 8 locales since Part 3b, with+a parity test that passes — but most components rendered English literals+instead of calling them. `groupBySchema: "Schemas"` existed specifically for+DocsSidebar, which hardcoded the word.++Parity compares locale files to each other, so a key no component ever calls+is invisible to it. The new guard derives its forbidden literals FROM the+English namespace, so a key added later is covered without anyone+remembering to register it.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 2: Extract the design tokens++The export's Tailwind entry cannot import `globals.css`: line 40 is `@source "../**/*.{vue,ts,tsx,js,jsx,html}"`, which scans the whole application, and `@source` is additive with no way to un-source. But the viewer's utilities still resolve against tokens defined in `globals.css` from line 131.++**Files:**+- Create: `apps/desktop/src/styles/tokens.css`+- Modify: `apps/desktop/src/styles/globals.css`+- Test: `apps/desktop/src/docs/__tests__/tokens.spec.ts`++**Interfaces:**+- Produces: `apps/desktop/src/styles/tokens.css`, importable by both `globals.css` and (Task 5) `export.css`.++This edits a 76 KB stylesheet the whole application depends on. The move is mechanical, but **cascade order between `:root` and `.dark` must be preserved exactly** — `.dark` must still be declared after `:root`.++- [ ] **Step 1: Write the failing test**++Create `apps/desktop/src/docs/__tests__/tokens.spec.ts`:++```ts+import { readFileSync } from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";++const stylesDir = path.resolve(__dirname, "../../styles");++/** Every `--name:` custom property declared in a stylesheet. */+function declaredTokens(file: string): Set<string> {+ const source = readFileSync(path.join(stylesDir, file), "utf8");+ return new Set(Array.from(source.matchAll(/^\s*(--[a-z0-9-]+)\s*:/gm), (match) => match[1]));+}++describe("design tokens", () => {+ it("defines the tokens the docs viewer resolves against", () => {+ // These are the utilities used in src/docs/**: bg-background,+ // text-foreground, text-muted-foreground, bg-muted, border-border,+ // focus:border-ring. If a token stops being declared here the export+ // renders unstyled while the app, which has globals.css, looks fine —+ // so this must be checked against tokens.css, not globals.css.+ const tokens = declaredTokens("tokens.css");+ for (const token of ["--background", "--foreground", "--muted", "--muted-foreground", "--border", "--ring"]) {+ expect(tokens.has(token), `tokens.css must declare ${token}`).toBe(true);+ }+ });++ it("keeps globals.css importing the extracted tokens", () => {+ const globals = readFileSync(path.join(stylesDir, "globals.css"), "utf8");+ expect(globals.includes('@import "./tokens.css"')).toBe(true);+ });++ it("declares the dark overrides after the light ones", () => {+ // Custom properties resolve at use time, but override order still+ // decides which block wins. A tokens.css with .dark BEFORE :root leaves+ // dark mode rendering light values.+ const source = readFileSync(path.join(stylesDir, "tokens.css"), "utf8");+ const root = source.search(/^:root\s*\{/m);+ const dark = source.search(/^\.dark\s*\{/m);+ expect(root, "tokens.css must declare :root").toBeGreaterThan(-1);+ expect(dark, "tokens.css must declare .dark").toBeGreaterThan(-1);+ expect(dark).toBeGreaterThan(root);+ });+});+```++- [ ] **Step 2: Run it and watch it fail**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/tokens.spec.ts`+Expected: FAIL — `ENOENT: no such file or directory, open '.../styles/tokens.css'`.++- [ ] **Step 3: Move the token blocks**++Read `apps/desktop/src/styles/globals.css` and find the `:root { … }` block starting at line 131 and its corresponding `.dark { … }` block. Cut both **verbatim** into a new `apps/desktop/src/styles/tokens.css` with this header:++```css+/*+ * Design tokens, shared by the application shell and the standalone+ * documentation export.+ *+ * These live apart from globals.css because the export's Tailwind entry+ * cannot import globals.css: its `@source` scans the whole application and+ * `@source` is additive, so the export would emit every utility in DBX. The+ * export still needs these tokens, and duplicating them is how the values+ * drift.+ *+ * Order matters: `.dark` must stay declared after `:root`.+ */+```++Do not reformat, reorder or "tidy" the declarations while moving them — a diff that is a pure move is reviewable; one that also reformats is not.++- [ ] **Step 4: Import from globals.css**++At the point in `globals.css` where the `:root` block used to begin, put:++```css+@import "./tokens.css";+```++Leave `@theme inline` (line 71) and the `@import "tailwindcss"` / `@source` lines exactly where they are.++- [ ] **Step 5: Verify the application is unchanged**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/tokens.spec.ts`+Expected: PASS (all three).++Run: `pnpm build`+Expected: succeeds. Then confirm the built CSS still carries the tokens:++```bash+grep -c -- "--muted-foreground" dist/assets/*.css+```+Expected: at least 1. A zero here means the `@import` did not resolve and the whole application would render unstyled.++- [ ] **Step 6: Deliberate break**++Reorder `tokens.css` so `.dark` precedes `:root`. Run the test; confirm it fails with `expected <n> to be greater than <m>`. Restore. Report the message.++- [ ] **Step 7: Commit**++```bash+git add apps/desktop/src/styles apps/desktop/src/docs/__tests__/tokens.spec.ts+git commit -m "$(cat <<'EOF'+refactor(styles): extract design tokens for reuse by the export++The standalone export's Tailwind entry cannot import globals.css — its+`@source` scans the whole application and `@source` is additive, so the+export would emit every utility in DBX rather than the ~40 the viewer uses.++The tokens move verbatim; globals.css imports them. Copying the values into+the export instead is exactly the duplication that has produced this+feature's recurring defects.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 3: `DocsRoute` and optional `v-model:route`++**Files:**+- Create: `apps/desktop/src/docs/docsRoute.ts`+- Create: `apps/desktop/src/docs/__tests__/docsRoute.spec.ts`+- Modify: `apps/desktop/src/docs/DocsApp.vue`++**Interfaces:**+- Produces: `export type DocsRoute`, `export function parseDocsHash(hash: string, snapshot: SchemaSnapshot, allowDiagram: boolean): DocsRoute`, `export function formatDocsHash(route: DocsRoute): string`. Task 5's `ExportApp.vue` consumes both.+- Produces: `DocsApp` accepts optional `route?: DocsRoute` and emits `update:route`.++`DocsApp` must stay uncontrolled when `route` is absent — DBX has no router (`vue-router` is not a dependency), so a `DocsApp` that always wrote to the URL would hijack the host application's address bar.++- [ ] **Step 1: Write the failing test**++Create `apps/desktop/src/docs/__tests__/docsRoute.spec.ts`:++```ts+import { describe, expect, it } from "vitest";+import { formatDocsHash, parseDocsHash } from "../docsRoute";+import type { SchemaSnapshot } from "../types";++// `formatVersion` is top-level on SchemaSnapshot, not inside `project`.+const snapshot = {+ formatVersion: 1,+ project: { name: "shop", databaseType: "postgres", database: "shop", schemas: ["public"], generatedAt: "2026-08-06T00:00:00Z", note: null },+ tables: [{ schema: "public", name: "orders", columns: [], indexes: [] }, { schema: null, name: "a/b", columns: [], indexes: [] }],+ enums: [{ schema: "public", name: "order_status", values: ["pending"] }],+ relationships: [],+ groups: [],+ warnings: [],+} as unknown as SchemaSnapshot;++describe("parseDocsHash", () => {+ it("reads a table route", () => {+ expect(parseDocsHash("#/table/public.orders", snapshot, true)).toEqual({ kind: "table", key: "public.orders" });+ });++ it("decodes an identifier containing a slash", () => {+ // A table named `a/b` must survive the round trip; an undecoded hash+ // would split into a bogus segment and silently fall back to the index.+ expect(parseDocsHash("#/table/a%2Fb", snapshot, true)).toEqual({ kind: "table", key: "a/b" });+ });++ it("reads an enum route", () => {+ expect(parseDocsHash("#/enum/order_status", snapshot, true)).toEqual({ kind: "enum", name: "order_status" });+ });++ it("falls back to the index for a table that is not in the snapshot", () => {+ // A deep link into a since-dropped table is the EXPECTED case for a file+ // someone saved months ago. It must never render a blank page.+ expect(parseDocsHash("#/table/public.gone", snapshot, true)).toEqual({ kind: "index" });+ });++ it("falls back to the index for junk, empty and bare hashes", () => {+ for (const hash of ["", "#", "#/", "#/nonsense", "#/table", "#/table/", "not-a-hash"]) {+ expect(parseDocsHash(hash, snapshot, true), hash).toEqual({ kind: "index" });+ }+ });++ it("refuses the diagram route when the host has not enabled it", () => {+ // The dialog passes diagram="external" and keeps its button to the full+ // SchemaDiagramDialog. A hash must not render a view that host declined.+ expect(parseDocsHash("#/diagram", snapshot, false)).toEqual({ kind: "index" });+ expect(parseDocsHash("#/diagram", snapshot, true)).toEqual({ kind: "diagram" });+ });+});++describe("formatDocsHash", () => {+ it("round-trips every route kind", () => {+ for (const route of [{ kind: "index" }, { kind: "table", key: "public.orders" }, { kind: "enum", name: "order_status" }, { kind: "diagram" }] as const) {+ expect(parseDocsHash(formatDocsHash(route), snapshot, true)).toEqual(route);+ }+ });++ it("encodes a slash in an identifier", () => {+ expect(formatDocsHash({ kind: "table", key: "a/b" })).toBe("#/table/a%2Fb");+ });+});+```++- [ ] **Step 2: Run it and watch it fail**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/docsRoute.spec.ts`+Expected: FAIL — `Failed to resolve import "../docsRoute"`.++- [ ] **Step 3: Implement `docsRoute.ts`**++```ts+import { qualifiedTableKey } from "./docsKeys";+import type { SchemaSnapshot } from "./types";++/**+ * Where the viewer is pointing.+ *+ * This exists so the standalone export can drive navigation from+ * `location.hash` without DocsApp itself touching the URL: DBX has no+ * router, and a viewer that wrote to the address bar would hijack the host+ * application's.+ */+export type DocsRoute = { kind: "index" } | { kind: "table"; key: string } | { kind: "enum"; name: string } | { kind: "diagram" };++const INDEX: DocsRoute = { kind: "index" };++/**+ * Resolve a hash against a snapshot.+ *+ * Anything unrecognised — junk, a table that no longer exists, the diagram+ * route on a host that did not enable it — resolves to the index. A saved+ * file whose schema has since changed is the expected case, not an exotic+ * one, and must never render blank.+ */+export function parseDocsHash(hash: string, snapshot: SchemaSnapshot, allowDiagram: boolean): DocsRoute {+ if (!hash.startsWith("#")) return INDEX;+ const segments = hash.slice(1).replace(/^\//, "").split("/");+ const [kind, ...rest] = segments;+ const identifier = rest.join("/");++ if (kind === "diagram" && identifier === "") return allowDiagram ? { kind: "diagram" } : INDEX;++ if (identifier === "") return INDEX;+ let decoded: string;+ try {+ decoded = decodeURIComponent(identifier);+ } catch {+ // A malformed percent-escape throws rather than returning null.+ return INDEX;+ }++ if (kind === "table") {+ return snapshot.tables.some((table) => qualifiedTableKey(table) === decoded) ? { kind: "table", key: decoded } : INDEX;+ }+ if (kind === "enum") {+ return (snapshot.enums ?? []).some((value) => value.name === decoded) ? { kind: "enum", name: decoded } : INDEX;+ }+ return INDEX;+}++export function formatDocsHash(route: DocsRoute): string {+ switch (route.kind) {+ case "table":+ return `#/table/${encodeURIComponent(route.key)}`;+ case "enum":+ return `#/enum/${encodeURIComponent(route.name)}`;+ case "diagram":+ return "#/diagram";+ default:+ return "#/";+ }+}+```++- [ ] **Step 4: Run the test**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/docsRoute.spec.ts`+Expected: PASS (8 tests).++- [ ] **Step 5: Make `DocsApp` optionally controlled**++In `apps/desktop/src/docs/DocsApp.vue`, add to `defineProps`:++```ts+ /**+ * When provided, navigation is controlled by the host and mirrored back+ * through `update:route`. Absent — the dialog's case — DocsApp owns its+ * own navigation exactly as before and never touches the URL.+ */+ route?: DocsRoute;+ /** `inline` renders SchemaDiagram; `external` leaves the host to offer its own. */+ diagram?: "inline" | "external";+```++Add `"update:route": [route: DocsRoute]` to `defineEmits`. Replace the internal `activeKey` / `activeEnumName` reads with a computed that prefers `props.route` when present, and have `open()` / `home()` / `openEnum()` emit `update:route` in addition to setting internal state. Default `diagram` to `"external"`.++- [ ] **Step 6: Verify nothing regressed**++Run: `pnpm vitest run apps/desktop/src/docs && pnpm typecheck`+Expected: PASS, clean.++- [ ] **Step 7: Deliberate break**++Change `parseDocsHash` to return `{ kind: "table", key: decoded }` without the `snapshot.tables.some(...)` check. Run the test; confirm `falls back to the index for a table that is not in the snapshot` fails. Restore. Report the message.++- [ ] **Step 8: Commit**++```bash+git add apps/desktop/src/docs+git commit -m "$(cat <<'EOF'+feat(docs): add a route model the export can drive from the URL++DocsApp gains an OPTIONAL v-model:route. Absent, it owns navigation exactly+as before — which is what the in-app dialog needs, since DBX has no router+and a viewer that wrote to location.hash would hijack the host's address bar.++Parsing is total: junk, a dropped table, or the diagram route on a host that+did not enable it all resolve to the index. A deep link into a file saved+months ago is the expected case, not an exotic one.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 4: The minimal ER renderer++**Files:**+- Create: `apps/desktop/src/docs/diagramGeometry.ts`+- Create: `apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts`+- Create: `apps/desktop/src/docs/components/SchemaDiagram.vue`+- Modify: `apps/desktop/src/docs/DocsApp.vue`+- Modify: `apps/desktop/src/docs/__tests__/componentContract.spec.ts`++**Interfaces:**+- Consumes: `layoutDiagramTables(tables: Pick<DiagramTable, "name" | "columns">[], options?: DiagramLayoutOptions): Record<string, DiagramPosition>` from `@/lib/diagram/erDiagram` — permitted by the contract test, which forbids only `@/lib/backend`; that module has exactly one import and it is `import type`, so it bundles cleanly.+- Produces: `export function clipToCard(from: Point, to: Point, half: Size): Point` and `export interface Point { x: number; y: number }`.++Layout is reused. **Edge routing is the genuinely new work** — nothing in the codebase draws a line between two cards.++- [ ] **Step 1: Write the failing geometry test**++Create `apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts`:++```ts+import { describe, expect, it } from "vitest";+import { clipToCard } from "../diagramGeometry";++describe("clipToCard", () => {+ const half = { width: 100, height: 50 };++ it("exits through the vertical edge for a horizontal run", () => {+ // Centre (0,0) to (500,0): the line leaves through the right edge at+ // x = +100, not through the top or bottom.+ expect(clipToCard({ x: 0, y: 0 }, { x: 500, y: 0 }, half)).toEqual({ x: 100, y: 0 });+ });++ it("exits through the horizontal edge for a vertical run", () => {+ expect(clipToCard({ x: 0, y: 0 }, { x: 0, y: 500 }, half)).toEqual({ x: 0, y: 50 });+ });++ it("picks the nearer edge on a diagonal", () => {+ // Slope 1 against a 2:1 card: the vertical edge is reached first, so the+ // result sits ON x = 100 with |y| < 50. Clipping to the wrong axis puts+ // the endpoint outside the card and the line visibly overshoots.+ const point = clipToCard({ x: 0, y: 0 }, { x: 500, y: 500 }, half);+ expect(point.x).toBeCloseTo(50);+ expect(point.y).toBeCloseTo(50);+ });++ it("returns the centre when both points coincide", () => {+ // Two tables laid out at the same position would otherwise divide by zero+ // and emit NaN into the SVG path, which renders nothing at all.+ expect(clipToCard({ x: 7, y: 7 }, { x: 7, y: 7 }, half)).toEqual({ x: 7, y: 7 });+ });++ it("handles negative directions symmetrically", () => {+ expect(clipToCard({ x: 0, y: 0 }, { x: -500, y: 0 }, half)).toEqual({ x: -100, y: 0 });+ });+});+```++- [ ] **Step 2: Run it and watch it fail**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts`+Expected: FAIL — `Failed to resolve import "../diagramGeometry"`.++- [ ] **Step 3: Implement `diagramGeometry.ts`**++```ts+export interface Point {+ x: number;+ y: number;+}++export interface Size {+ width: number;+ height: number;+}++/**+ * Where a line from one card's centre towards another leaves the first card.+ *+ * Without this, edges terminate under the card and appear to sprout from a+ * table's middle. Scaling both axes and taking the smaller factor picks+ * whichever edge the ray actually reaches first.+ *+ * `half` is the card's HALF width and height, measured from its centre.+ */+export function clipToCard(from: Point, to: Point, half: Size): Point {+ const dx = to.x - from.x;+ const dy = to.y - from.y;+ if (dx === 0 && dy === 0) {+ // Coincident centres would divide by zero and put NaN in the path data,+ // which renders as nothing rather than as an error.+ return { x: from.x, y: from.y };+ }+ const scaleX = dx === 0 ? Number.POSITIVE_INFINITY : half.width / Math.abs(dx);+ const scaleY = dy === 0 ? Number.POSITIVE_INFINITY : half.height / Math.abs(dy);+ const scale = Math.min(scaleX, scaleY);+ return { x: from.x + dx * scale, y: from.y + dy * scale };+}+```++- [ ] **Step 4: Run the geometry test**++Run: `pnpm vitest run apps/desktop/src/docs/__tests__/diagramGeometry.spec.ts`+Expected: PASS (5 tests).++- [ ] **Step 5: Create `SchemaDiagram.vue`**++`apps/desktop/src/docs/components/SchemaDiagram.vue` — `<script setup lang="ts">`, props `{ snapshot: SchemaSnapshot; translate: Translate }`, emits `{ select: [tableKey: string] }`.++Compute positions with `layoutDiagramTables(snapshot.tables.map((t) => ({ name: qualifiedTableKey(t), columns: t.columns })))`. Render an `<svg>` sized to the layout extent inside a `<div class="overflow-auto">` — scrolling *is* panning; there are no zoom controls by design.++For each table draw a `<rect>` plus its qualified name and up to eight column names. Apply `groupStyle(hue)` and `style="background-color: var(--group-c)"` for the group accent — never a computed colour, which the contract test bans. For each relationship draw a `<line>` whose endpoints come from `clipToCard` in both directions. A `<rect>` per table carries `@click="emit('select', key)"`.++- [ ] **Step 6: Register it in the contract test and render it in `DocsApp`**++In `componentContract.spec.ts`, add `"SchemaDiagram.vue"` to `EXPECTED` — keep the array alphabetically sorted, since the first test compares against a sorted list.++In `DocsApp.vue`, render `<SchemaDiagram v-else-if="view === 'diagram'" … />` and add a Diagram entry to the sidebar only when `diagram === "inline"`.++- [ ] **Step 7: Run everything and typecheck**++Run: `pnpm vitest run apps/desktop/src/docs && pnpm typecheck`+Expected: PASS, clean. The contract test must confirm `SchemaDiagram.vue` references none of the forbidden needles and computes no colour.++- [ ] **Step 8: Deliberate break**++In `clipToCard`, replace `Math.min(scaleX, scaleY)` with `scaleX`. Run the geometry test; confirm `picks the nearer edge on a diagonal` fails with `expected 100 to be close to 50`. Restore. Report the message.++- [ ] **Step 9: Commit**++```bash+git add apps/desktop/src/docs+git commit -m "$(cat <<'EOF'+feat(docs): add a minimal read-only ER renderer++Reuses layoutDiagramTables from lib/diagram/erDiagram, which is bundleable+as-is: 211 lines with exactly one import, and that import is `import type`.++Edge routing is the new part — nothing in the codebase drew a line between+two cards. clipToCard scales both axes and takes the smaller factor, so an+edge stops on whichever border the ray reaches first instead of vanishing+under the card.++Deliberately minimal: scroll is the pan, there is no zoom, and the host+chooses whether to show this at all. In-app the dialog keeps its button to+the full SchemaDiagramDialog, so no screen offers two ER views.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 5: The export shell and the bundle++**Files:**+- Create: `apps/desktop/src/docs-export/{main.ts,ExportApp.vue,exportTranslate.ts,export.css}`+- Create: `apps/desktop/vite.docs-export.config.ts`+- Create: `apps/desktop/src/docs-export/__tests__/exportTranslate.spec.ts`+- Modify: `package.json`++**Interfaces:**+- Consumes: `parseDocsHash`, `formatDocsHash`, `DocsRoute` (Task 3); `DocsApp` with `route`/`diagram` props (Tasks 3–4); `tokens.css` (Task 2).+- Produces: `crates/dbx-core/assets/docs-export.js`, `docs-export.css`, `docs-export.manifest.json`. Tasks 6 and 7 consume all three.+- Produces: the payload contract — `{ snapshot, annotations, lang }` — which Task 6's Rust side must emit exactly.++- [ ] **Step 1: Write the failing translate test**++Create `apps/desktop/src/docs-export/__tests__/exportTranslate.spec.ts`:++```ts+import { describe, expect, it } from "vitest";+import { createExportTranslate, EXPORT_LOCALES } from "../exportTranslate";++describe("createExportTranslate", () => {+ it("carries every locale the app ships", () => {+ expect(Object.keys(EXPORT_LOCALES).sort()).toEqual(["en", "es", "it", "ja", "ko", "pt-BR", "zh-CN", "zh-TW"]);+ });++ it("resolves a nested key under the docs prefix", () => {+ expect(createExportTranslate("en")("docs.columns")).toBe("Columns");+ expect(createExportTranslate("en")("docs.warnings.orphanedNotes.title")).toBe("Some notes no longer match anything");+ });++ it("substitutes placeholders", () => {+ expect(createExportTranslate("en")("docs.shadowedComment", { comment: "hi" })).toBe("Database comment: hi");+ });++ it("falls back to English for an unknown locale", () => {+ // A hand-edited payload, or a --lang that slipped through, must render+ // English rather than raw keys in a file someone opens offline.+ expect(createExportTranslate("kl" as never)("docs.columns")).toBe("Columns");+ });++ it("returns the key when nothing resolves", () => {+ expect(createExportTranslate("en")("docs.nope.missing")).toBe("docs.nope.missing");+ });+});+```++- [ ] **Step 2: Run it and watch it fail**++Run: `pnpm vitest run apps/desktop/src/docs-export`+Expected: FAIL — `Failed to resolve import "../exportTranslate"`.++- [ ] **Step 3: Implement `exportTranslate.ts`**++```ts+import en from "@/i18n/locales/docs/en";+import es from "@/i18n/locales/docs/es";+import it from "@/i18n/locales/docs/it";+import ja from "@/i18n/locales/docs/ja";+import ko from "@/i18n/locales/docs/ko";+import ptBR from "@/i18n/locales/docs/pt-BR";+import zhCN from "@/i18n/locales/docs/zh-CN";+import zhTW from "@/i18n/locales/docs/zh-TW";+import type { Translate } from "@/docs/docsWarnings";++export const EXPORT_LOCALES = { en, es, it, ja, ko, "pt-BR": ptBR, "zh-CN": zhCN, "zh-TW": zhTW } as const;++export type ExportLocale = keyof typeof EXPORT_LOCALES;++function lookup(source: unknown, key: string): string | null {+ const value = key.split(".").reduce<unknown>((node, part) => (node && typeof node === "object" ? (node as Record<string, unknown>)[part] : undefined), source);+ return typeof value === "string" ? value : null;+}++/**+ * Build a `Translate` over a bundled namespace.+ *+ * English is the fallback rather than the raw key. The parity test guarantees+ * all 8 namespaces agree, so this should never fire — it exists so an+ * artefact opened offline degrades to English instead of showing+ * `docs.columns` to a reader. This is not the Part 3b hazard where a fallback+ * masked drift: there the fallback replaced the guard, here the guard runs in+ * CI and this is only a runtime backstop.+ */+export function createExportTranslate(lang: ExportLocale): Translate {+ const primary = EXPORT_LOCALES[lang] ?? EXPORT_LOCALES.en;+ return (key, params) => {+ // Keys arrive prefixed with `docs.` because that is how the namespace is+ // mounted in the app; the bundled modules are the namespace itself.+ const bare = key.startsWith("docs.") ? key.slice("docs.".length) : key;+ const template = lookup(primary, bare) ?? lookup(EXPORT_LOCALES.en, bare);+ if (template === null) return key;+ if (!params) return template;+ return template.replace(/\{(\w+)\}/g, (match, name: string) => (name in params ? String(params[name]) : match));+ };+}+```++- [ ] **Step 4: Run the translate test**++Run: `pnpm vitest run apps/desktop/src/docs-export`+Expected: PASS (5 tests).++- [ ] **Step 5: Write `export.css`**++```css+@import "tailwindcss";+/*+ * Narrowed deliberately. globals.css sources the whole application, and+ * `@source` is additive with no way to un-source, so importing it would emit+ * every utility in DBX rather than the ~40 the viewer uses.+ */+@source "../docs/**/*.vue";+@source "../docs-export/**/*.vue";++@import "../styles/tokens.css";+```++No `@font-face` here — the Vite plugin in Step 6 prepends it with the font already inlined, so no rule can reference a path that fails under `file://`.++- [ ] **Step 6: Write `vite.docs-export.config.ts`**++```ts+import { createHash } from "node:crypto";+import { readFileSync, writeFileSync } from "node:fs";+import path from "node:path";+import { defineConfig } from "vite";+import vue from "@vitejs/plugin-vue";+import tailwindcss from "@tailwindcss/vite";++const repoRoot = path.resolve(__dirname, "../..");+const assetsDir = path.join(repoRoot, "crates/dbx-core/assets");+const fontPath = path.join(__dirname, "public/fonts/geist-latin-wght-normal.woff2");++function sha256(buffer: Buffer | string): string {+ return createHash("sha256").update(buffer).digest("hex");+}++/**+ * Inline the font and write the staleness manifest.+ *+ * The manifest is derived from Rollup's ACTUAL module graph, never from a+ * hand-written glob. SchemaDiagram.vue imports erDiagram.ts from outside+ * src/docs/, so a glob of that directory would miss it and the guard would+ * pass while the artefact was stale — the same shape as the three guards+ * this feature has already had to widen after the fact.+ *+ * New files are covered for free: a module can only enter the bundle by being+ * imported, which means editing an existing file, which changes that file's+ * hash. The one hole would be `import.meta.glob`, which the viewer does not+ * use.+ */+function exportBundlePlugin() {+ return {+ name: "dbx-docs-export",+ generateBundle(_options: unknown, bundle: Record<string, { type: string; source?: string | Uint8Array; code?: string; modules?: Record<string, unknown> }>) {+ const font = readFileSync(fontPath).toString("base64");+ const fontFace = `@font-face{font-family:"Geist Variable";font-style:normal;font-display:swap;font-weight:100 900;src:url("data:font/woff2;base64,${font}") format("woff2-variations")}\n`;++ const sources: Record<string, string> = {};+ const deps: Record<string, string> = {};+ for (const chunk of Object.values(bundle)) {+ for (const id of Object.keys(chunk.modules ?? {})) {+ if (!path.isAbsolute(id)) continue;+ const nodeModules = id.indexOf("/node_modules/");+ if (nodeModules !== -1) {+ const after = id.slice(nodeModules + "/node_modules/".length);+ const name = after.startsWith("@") ? after.split("/").slice(0, 2).join("/") : after.split("/")[0];+ if (!(name in deps)) {+ const pkg = JSON.parse(readFileSync(path.join(id.slice(0, nodeModules), "node_modules", name, "package.json"), "utf8"));+ deps[name] = pkg.version;+ }+ continue;+ }+ if (!id.startsWith(repoRoot)) continue;+ const relative = path.relative(repoRoot, id);+ sources[relative] = sha256(readFileSync(id));+ }+ }+ sources[path.relative(repoRoot, fontPath)] = sha256(readFileSync(fontPath));++ for (const [name, chunk] of Object.entries(bundle)) {+ if (name.endsWith(".css") && typeof chunk.source === "string") chunk.source = fontFace + chunk.source;+ }++ writeFileSync(+ path.join(assetsDir, "docs-export.manifest.json"),+ `${JSON.stringify({ sources: Object.fromEntries(Object.entries(sources).sort()), deps: Object.fromEntries(Object.entries(deps).sort()) }, null, 2)}\n`,+ );+ },+ };+}++export default defineConfig({+ plugins: [vue(), tailwindcss(), exportBundlePlugin()],+ resolve: { alias: { "@": path.resolve(__dirname, "src") } },+ build: {+ outDir: assetsDir,+ emptyOutDir: false,+ cssCodeSplit: false,+ // One JS file. Without this the export would need to load chunks over the+ // network, which is precisely what a file:// artefact cannot do.+ rollupOptions: {+ input: path.resolve(__dirname, "src/docs-export/main.ts"),+ output: { inlineDynamicImports: true, entryFileNames: "docs-export.js", assetFileNames: "docs-export.[ext]" },+ },+ },+});+```++- [ ] **Step 7: Write `main.ts` and `ExportApp.vue`**++`main.ts` reads the base64 payload from `<script type="application/dbx-snapshot">`, decodes it, and mounts:++```ts+import { createApp } from "vue";+import ExportApp from "./ExportApp.vue";+import "./export.css";++const node = document.querySelector("script[type='application/dbx-snapshot']");+// `atob` yields one byte per character; the payload is UTF-8, so it must be+// widened before decoding or every non-ASCII table name and note is mangled.+const binary = atob((node?.textContent ?? "").trim());+const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));+const payload = JSON.parse(new TextDecoder().decode(bytes));++createApp(ExportApp, { payload }).mount("#app");+```++`ExportApp.vue` holds a `route` ref initialised from `parseDocsHash(location.hash, payload.snapshot, true)`, listens for `hashchange`, writes `location.hash = formatDocsHash(route)` on `update:route`, renders a `<select>` of `EXPORT_LOCALES` bound to a `lang` ref, and renders:++```+<DocsApp :snapshot="payload.snapshot" :annotations="payload.annotations" :readonly="true"+ :translate="translate" :route="route" diagram="inline" @update:route="route = $event" />+```++Language is **not persisted**: under `file://` every document shares one opaque origin, so `localStorage` would leak one export's preference into an unrelated one.++- [ ] **Step 8: Add the build script**++In the root `package.json` `scripts`, after `"build"`:++```json+ "build:docs-export": "vite build --config apps/desktop/vite.docs-export.config.ts",+```++- [ ] **Step 9: Build and inspect**++Run: `pnpm build:docs-export`+Expected: succeeds, writing three files. Verify:++```bash+ls -la crates/dbx-core/assets/docs-export.*+grep -c "url(/" crates/dbx-core/assets/docs-export.css+```+Expected: three files; `0` external URL references.++- [ ] **Step 10: Commit**++```bash+git add apps/desktop/src/docs-export apps/desktop/vite.docs-export.config.ts package.json crates/dbx-core/assets+git commit -m "$(cat <<'EOF'+feat(docs): bundle the viewer as a single-file export++One JS and one CSS, with the font inlined as a data URI, built from the+same components the app renders — which is what the purity contract on+src/docs/ has been protecting since Part 3a.++The staleness manifest is derived from Rollup's module graph rather than a+glob. SchemaDiagram.vue imports erDiagram.ts from outside src/docs/, so a+glob of that directory would miss it and pass while the artefact was stale.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 6: `to_standalone_html`++**Files:**+- Create: `crates/dbx-core/src/docs/export.rs`+- Modify: `crates/dbx-core/src/docs/mod.rs`++**Interfaces:**+- Consumes: `crates/dbx-core/assets/docs-export.{js,css}` (Task 5); `SchemaSnapshot` and `AnnotationFile` from `docs::snapshot` / `docs::annotations`.+- Produces: `pub fn to_standalone_html(snapshot: &SchemaSnapshot, annotations: &AnnotationFile, lang: &str) -> Result<String, String>` and `pub const EXPORT_LANGUAGES: [&str; 8]`. Tasks 8 and 9 both call it.++- [ ] **Step 1: Write the failing tests**++Create `crates/dbx-core/src/docs/export.rs` with only its test module, so the tests fail to compile against a missing function:++```rust+#[cfg(test)]+mod tests {+ use super::*;+ use crate::docs::annotations::AnnotationFile;+ use crate::docs::snapshot::SchemaSnapshot;++ /// `SchemaSnapshot` is `#[serde(rename_all = "camelCase")]` with+ /// `format_version` at the TOP level — not inside `project` — and+ /// `ProjectMeta` requires `name`, `databaseType`, `schemas` and+ /// `generatedAt`. `AnnotationFile` does NOT derive `Default`, and its+ /// `format_version` must be 1, so it is built explicitly.+ fn fixture() -> (SchemaSnapshot, AnnotationFile) {+ let snapshot: SchemaSnapshot = serde_json::from_str(+ r#"{"formatVersion":1,"project":{"name":"shop","databaseType":"postgres","database":"shop","schemas":["public"],"generatedAt":"2026-08-06T00:00:00Z","note":null},"tables":[],"enums":[],"relationships":[],"groups":[],"warnings":[]}"#,+ )+ .expect("fixture snapshot");+ let annotations = AnnotationFile {+ format_version: 1,+ project: None,+ groups: Vec::new(),+ tables: std::collections::BTreeMap::new(),+ };+ (snapshot, annotations)+ }++ #[test]+ fn a_note_containing_a_closing_script_tag_survives() {+ // THE reason the payload is base64. A note discussing HTML is+ // entirely plausible in a schema document, and inlined as text it+ // would terminate the script element early and inject the rest of+ // the payload as markup.+ let (snapshot, mut annotations) = fixture();+ annotations.project = Some(crate::docs::annotations::ProjectAnnotation {+ name: None,+ note: Some("</script><img src=x onerror=alert(1)>".into()),+ });+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");++ assert!(!html.contains("<img src=x"), "the payload leaked into markup");+ assert_eq!(html.matches("</script>").count(), 2, "exactly the two real script elements");+ }++ #[test]+ fn the_payload_round_trips() {+ let (snapshot, annotations) = fixture();+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");+ let start = html.find("application/dbx-snapshot").expect("payload element");+ let body = &html[start..];+ let encoded = body[body.find('>').unwrap() + 1..body.find("</script>").unwrap()].trim();+ let decoded = base64::Engine::decode(&base64::engine::general_purpose::STANDARD, encoded).expect("valid base64");+ let value: serde_json::Value = serde_json::from_slice(&decoded).expect("valid json");+ assert_eq!(value["snapshot"]["project"]["name"], "shop");+ assert_eq!(value["lang"], "en");+ }++ #[test]+ fn nothing_is_loaded_from_the_network() {+ // The whole point of the artefact. A single absolute URL left in the+ // CSS means the file renders unstyled on a machine with no network,+ // and nothing else would catch it.+ let (snapshot, annotations) = fixture();+ let html = to_standalone_html(&snapshot, &annotations, "en").expect("export");+ for needle in ["http://", "https://", "url(/", "src=\"/", "href=\"/"] {+ assert!(!html.contains(needle), "export references {needle}");+ }+ }++ #[test]+ fn an_unknown_language_is_rejected() {+ let (snapshot, annotations) = fixture();+ let error = to_standalone_html(&snapshot, &annotations, "kl").expect_err("should reject");+ assert!(error.contains("kl"), "got: {error}");+ assert!(error.contains("en"), "the error must list the valid locales, got: {error}");+ }+}+```++- [ ] **Step 2: Run and watch it fail**++Run: `cargo test -p dbx-core --lib docs::export`+Expected: FAIL to compile — `cannot find function to_standalone_html in this scope`.++- [ ] **Step 3: Implement `to_standalone_html`**++Above the test module in the same file:++```rust+use base64::Engine as _;++use crate::docs::annotations::AnnotationFile;+use crate::docs::snapshot::SchemaSnapshot;++/// The viewer bundle, built by `pnpm build:docs-export` and committed.+///+/// Committed rather than built by cargo because Rust cannot run Vite and+/// `dbx docs` must work from a plain `cargo install` on a machine with no+/// Node. `docs_export_bundle_is_current` is what keeps it honest.+const EXPORT_JS: &str = include_str!("../../assets/docs-export.js");+const EXPORT_CSS: &str = include_str!("../../assets/docs-export.css");++pub const EXPORT_LANGUAGES: [&str; 8] = ["en", "es", "it", "ja", "ko", "pt-BR", "zh-CN", "zh-TW"];++/// Render a snapshot as one self-contained HTML file.+///+/// `snapshot` must already have annotations applied — `apply_annotations` is+/// Rust and the export has no Rust at runtime. `annotations` travels too,+/// because the merge erases what the viewer needs to colour groups:+/// `snapshot.groups` holds resolved `TableGroup`s, `annotations.groups` holds+/// the hue.+pub fn to_standalone_html(snapshot: &SchemaSnapshot, annotations: &AnnotationFile, lang: &str) -> Result<String, String> {+ if !EXPORT_LANGUAGES.contains(&lang) {+ return Err(format!("Unknown language \"{lang}\". Valid values: {}.", EXPORT_LANGUAGES.join(", ")));+ }++ let payload = serde_json::json!({ "snapshot": snapshot, "annotations": annotations, "lang": lang });+ let json = serde_json::to_vec(&payload).map_err(|error| format!("Failed to serialise the documentation payload: {error}"))?;+ // base64 rather than escaped JSON: the alphabet cannot contain `<`, so no+ // escaping rule exists to forget. The alternative's correctness depends+ // on every serialisation path applying the escape.+ let encoded = base64::engine::general_purpose::STANDARD.encode(&json);++ let title = html_escape(&snapshot.project.name);+ Ok(format!(+ "<!doctype html>\n<html lang=\"{lang}\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>{title}</title>\n<style>{EXPORT_CSS}</style>\n</head>\n<body>\n<div id=\"app\"></div>\n<script type=\"application/dbx-snapshot\">{encoded}</script>\n<script>{EXPORT_JS}</script>\n</body>\n</html>\n"+ ))+}++fn html_escape(value: &str) -> String {+ value.replace('&', "&").replace('<', "<").replace('>', ">").replace('"', """)+}+```++Add to `crates/dbx-core/src/docs/mod.rs`:++```rust+pub mod export;+```+and to the re-export list:+```rust+pub use export::{to_standalone_html, EXPORT_LANGUAGES};+```++- [ ] **Step 4: Run the tests**++Run: `cargo test -p dbx-core --lib docs::export`+Expected: PASS (4 tests).++- [ ] **Step 5: Deliberate break**++Replace the base64 encode with `String::from_utf8(json).unwrap()`. Run the tests; confirm `a_note_containing_a_closing_script_tag_survives` fails with `the payload leaked into markup`. Restore. Report the message.++- [ ] **Step 6: Commit**++```bash+git add crates/dbx-core/src/docs+git commit -m "$(cat <<'EOF'+feat(docs): render a snapshot as one self-contained HTML file++The payload is base64 rather than escaped JSON. A note containing the+literal `</script>` — plausible in any schema document that discusses HTML —+would otherwise terminate the script element early and inject the remainder+as markup. base64's alphabet cannot contain `<`, so the property holds by+construction rather than by remembering to escape on every path.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 7: The staleness guard++**Files:**+- Modify: `crates/dbx-core/src/docs/export.rs`++**Interfaces:**+- Consumes: `crates/dbx-core/assets/docs-export.manifest.json` (Task 5).++- [ ] **Step 1: Write the test**++Append to the `tests` module in `export.rs`:++```rust+ /// The committed bundle must match the sources it was built from.+ ///+ /// Skips only when the crate is consumed from a published package, where+ /// `apps/desktop/` does not exist. That skip is itself a hazard — a+ /// vacuous skip in CI would silently disable this guard — so it keys off+ /// a repository-only marker rather than off the absence of the sources.+ #[test]+ fn docs_export_bundle_is_current() {+ use sha2::{Digest, Sha256};++ let workspace = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../..").canonicalize().expect("workspace root");+ if !workspace.join("pnpm-workspace.yaml").exists() {+ return; // packaged crate: the sources are genuinely absent+ }++ let manifest: serde_json::Value =+ serde_json::from_str(include_str!("../../assets/docs-export.manifest.json")).expect("manifest is valid JSON");+ let sources = manifest["sources"].as_object().expect("manifest.sources");+ assert!(sources.len() > 5, "manifest lists only {} sources — the build emitted an empty graph", sources.len());++ let mut stale = Vec::new();+ for (relative, expected) in sources {+ let path = workspace.join(relative);+ let Ok(bytes) = std::fs::read(&path) else {+ stale.push(format!("{relative} (missing)"));+ continue;+ };+ let actual = format!("{:x}", Sha256::digest(&bytes));+ if actual != expected.as_str().unwrap_or_default() {+ stale.push(relative.clone());+ }+ }++ assert!(stale.is_empty(), "the committed docs export bundle is stale.\nChanged: {}\nRun: pnpm build:docs-export", stale.join(", "));+ }+```++- [ ] **Step 2: Run it**++Run: `cargo test -p dbx-core --lib docs::export::tests::docs_export_bundle_is_current`+Expected: PASS — the bundle was built in Task 5 and nothing has changed since.++- [ ] **Step 3: Deliberate break**++Append a blank line to `apps/desktop/src/docs/DocsApp.vue`. Run the test. Confirm it fails with `the committed docs export bundle is stale. Changed: apps/desktop/src/docs/DocsApp.vue`. Revert the edit and re-run to confirm it passes. Report the message.++- [ ] **Step 4: Verify the guard reaches outside `src/docs/`**++This is the whole reason the manifest is derived rather than globbed. Append a blank line to `apps/desktop/src/lib/diagram/erDiagram.ts` — a file a `src/docs/**` glob would have missed entirely. Run the test; confirm it fails naming that file. Revert. Report the message.++- [ ] **Step 5: Commit**++```bash+git add crates/dbx-core/src/docs/export.rs+git commit -m "$(cat <<'EOF'+test(docs): fail when the committed export bundle is stale++Verified to bite on a change to erDiagram.ts, which lives outside src/docs/+and which a directory glob would have missed — the failure mode this guard+exists to prevent.++The packaged-crate skip keys off pnpm-workspace.yaml rather than off the+absence of the sources, so a CI checkout cannot silently skip it.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 8: The `dbx docs` verb++**Files:**+- Modify: `crates/dbx-cli/src/main.rs`++**Interfaces:**+- Consumes: `dbx_core::docs::to_standalone_html` and `EXPORT_LANGUAGES` (Task 6).++`run_docs` mirrors `run_dbml` (line 461) exactly, with one difference: `run_dbml` scopes `annotations` inside its `if let`, but the export needs the `AnnotationFile` **after** applying it, so it must be hoisted.++- [ ] **Step 1: Write the failing flag tests**++Add beside the existing `dbml` flag tests (around line 1148):++```rust+ #[test]+ fn parses_the_lang_flag() {+ let flags = parse_flags(&args(&["docs", "local", "--lang", "zh-CN"])).expect("parse");+ assert_eq!(flags.args, args(&["docs", "local"]));+ assert_eq!(flags.lang.as_deref(), Some("zh-CN"));+ }++ #[test]+ fn lang_requires_a_value() {+ parse_flags(&args(&["docs", "local", "--lang"])).expect_err("should fail");+ }++ #[test]+ fn docs_appears_in_the_usage_text() {+ assert!(usage().contains("dbx docs <connection>"), "got: {}", usage());+ }+```++- [ ] **Step 2: Run and watch them fail**++Run: `cargo test -p dbx-cli parses_the_lang_flag`+Expected: FAIL to compile — `no field 'lang' on type 'Flags'`.++- [ ] **Step 3: Add the flag**++Add `lang: Option<String>,` to `struct Flags`, and beside the `"--notes"` arm (line 573):++```rust+ "--lang" => flags.lang = Some(option_value(argv, &mut index, "--lang")?),+```++- [ ] **Step 4: Add the verb**++Beside the `dbml` dispatch (line 245):++```rust+ if args.first().is_some_and(|arg| arg == "docs") {+ return run_docs(backend, &flags).await;+ }+```++And the function, mirroring `run_dbml`:++```rust+async fn run_docs(backend: &dyn DbxBackend, flags: &Flags) -> Result<String, CliError> {+ let args = &flags.args;+ let connection_name = required(args.get(1), "Connection name is required.")?;+ let connection = find_connection(backend, connection_name).await?;+ let database = selected_database(&connection, flags.database.as_deref());++ let options = DocsSnapshotOptions {+ schemas: flags.schema.clone().into_iter().collect(),+ tables: flags.tables.clone(),+ project_name: Some(connection.name.clone()),+ };++ let mut snapshot = backend.collect_docs_snapshot(&connection, &database, options).await.map_err(command_error)?;++ // Unlike run_dbml, the AnnotationFile is needed AFTER it has been applied:+ // the merge resolves groups into TableGroups and drops the hue the viewer+ // colours with, so the raw file has to travel too.+ //+ // AnnotationFile does not derive Default and `format_version` must be 1,+ // so the empty value is constructed explicitly rather than defaulted.+ let mut annotations = dbx_core::docs::annotations::AnnotationFile {+ format_version: 1,+ project: None,+ groups: Vec::new(),+ tables: std::collections::BTreeMap::new(),+ };+ if let Some(path) = flags.notes.as_ref() {+ require_notes_file(path)?;+ if let Some(loaded) = dbx_core::docs::annotations::load_annotations(path)+ .map_err(|error| CliError::new("NOTES_INVALID", error))?+ {+ dbx_core::docs::annotations::apply_annotations(&mut snapshot, &loaded, connection.db_type);+ annotations = loaded;+ }+ }++ for warning in &snapshot.warnings {+ eprintln!("warning: {warning}");+ }++ let lang = flags.lang.as_deref().unwrap_or("en");+ let html = dbx_core::docs::to_standalone_html(&snapshot, &annotations, lang).map_err(|error| CliError::new("EXPORT_FAILED", error))?;++ match flags.out.as_ref() {+ Some(path) => {+ std::fs::write(path, &html)+ .map_err(|error| CliError::new("WRITE_FAILED", format!("Failed to write {}: {error}", path.display())))?;+ Ok(format!("Wrote {} bytes to {}", html.len(), path.display()))+ }+ None => Ok(html),+ }+}+```++- [ ] **Step 5: Add the usage line**++In `usage()`, after the `dbx dbml` line:++```+\n dbx docs <connection> [--out path] [--notes path] [--lang code] [--schema name] [--database name] [--tables a,b]+```++- [ ] **Step 6: Run the tests and try it**++Run: `cargo test -p dbx-cli`+Expected: PASS.++Run against a live connection:+```bash+cargo run -p dbx-cli -- docs <connection> --database <db> --schema public --out /tmp/schema.html+```+Expected: `Wrote N bytes to /tmp/schema.html`. Then open it in a browser over `file://` and confirm the index renders, a table page opens, the hash updates, a reload keeps the page, and the language switcher works.++- [ ] **Step 7: Commit**++```bash+git add crates/dbx-cli/src/main.rs+git commit -m "$(cat <<'EOF'+feat(cli): add the dbx docs verb++Mirrors dbx dbml's flags and collector, plus --lang. An unknown language+fails with the list of valid values rather than falling back — the same+reasoning that made --notes explicit in Part 2.++Unlike run_dbml, the AnnotationFile is kept after being applied: the merge+resolves groups into TableGroups and drops the hue the viewer colours with.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 9: The in-app export button++**Files:**+- Modify: `src-tauri/src/commands/docs.rs`, `src-tauri/src/lib.rs`+- Modify: `crates/dbx-web/src/routes/docs.rs`, `crates/dbx-web/src/main.rs`+- Modify: `apps/desktop/src/lib/backend/{api,tauri,http}.ts`+- Modify: `apps/desktop/src/components/docs/DatabaseDocsDialog.vue`++**Interfaces:**+- Consumes: `to_standalone_html` (Task 6); the `docs.exportHtml` / `docs.exporting` / `docs.exportFailed` keys (Task 1).+- Produces: `exportDocsHtml(filePath: string, snapshot: SchemaSnapshot, annotations: AnnotationFile, lang: string): Promise<void>` on both transports.++**Rust writes the file; the frontend supplies the path.** This mirrors `exportQueryResultCsv(filePath, columns, rows)` at `apps/desktop/src/lib/backend/tauri.ts:3807`, and avoids returning a ~400 KB string across IPC only to write it back out.++**Every backend operation exists twice** — once in `tauri.ts`, once in `http.ts`. `api.ts` types the backend as `typeof TauriModule` and resolves either at runtime, so a signature that differs between them compiles on both sides and fails only when a user clicks the button. Add both.++- [ ] **Step 1: Add the Tauri command**++In `src-tauri/src/commands/docs.rs`, following the shape at line 34:++```rust+#[tauri::command]+pub async fn docs_export_html(+ file_path: String,+ snapshot: SchemaSnapshot,+ annotations: AnnotationFile,+ lang: String,+) -> Result<(), String> {+ let html = dbx_core::docs::to_standalone_html(&snapshot, &annotations, &lang)?;+ std::fs::write(&file_path, html).map_err(|error| format!("Failed to write {file_path}: {error}"))+}+```++Tauri converts argument names between camelCase and snake_case **by name**: the frontend sends `filePath` and this receives `file_path`. A mismatch compiles cleanly on both sides and fails only at runtime, so keep the names aligned.++Register it in `src-tauri/src/lib.rs` beside the other four (lines 1742–1745): `commands::docs::docs_export_html,`.++- [ ] **Step 2: Add the web route**++In `crates/dbx-web/src/routes/docs.rs` add a handler with a `#[serde(rename_all = "camelCase")]` request struct carrying `snapshot`, `annotations`, `lang`, returning the HTML string. Register it in `crates/dbx-web/src/main.rs` beside the existing docs routes (around line 377):++```rust+ .route("/docs/export", post(routes::docs::export_html))+```++- [ ] **Step 3: Add both transports**++`apps/desktop/src/lib/backend/tauri.ts`, beside `collectDocsSnapshot` (line 1626):++```ts+export async function exportDocsHtml(filePath: string, snapshot: SchemaSnapshot, annotations: AnnotationFile, lang: string): Promise<void> {+ return invoke("docs_export_html", { filePath, snapshot, annotations, lang });+}+```++`http.ts` gets the same signature posting to `/docs/export`. `api.ts`, after line 185:++```ts+export const exportDocsHtml = forward("exportDocsHtml");+```++- [ ] **Step 4: Add the button**++In `DatabaseDocsDialog.vue`, beside the existing diagram button (line ~182), add an Export button. Follow the established export pattern from `apps/desktop/src/composables/useDataGridExport.ts:649-662` — a default filename, replaced by a real path from the Tauri save dialog when running in Tauri, then one call that is identical in both runtimes:++```ts+async function exportHtml(): Promise<void> {+ if (!snapshot.value) return;+ exporting.value = true;+ exportError.value = null;+ try {+ let outputPath = `${snapshot.value.project.name}-docs.html`;+ if (isTauriRuntime()) {+ const { save } = await import("@tauri-apps/plugin-dialog");+ const chosen = await save({ defaultPath: outputPath, filters: [{ name: "HTML", extensions: ["html"] }] });+ if (!chosen) return; // the user cancelled; not an error+ outputPath = chosen as string;+ }+ await api.exportDocsHtml(outputPath, snapshot.value, annotations.value, locale.value);+ } catch (error) {+ // Never swallowed: a failed export that reports success is the worst+ // outcome here, exactly as with a failed autosave.+ exportError.value = translate("docs.exportFailed", { error: String(error) });+ } finally {+ exporting.value = false;+ }+}+```++`locale.value` comes from `useI18n()`, which this component already imports — it lives outside `src/docs/` and so is permitted to. If the app's locale is not one of the eight, `to_standalone_html` rejects it; map it to `"en"` before calling rather than surfacing that error.++Show `docs.exporting` on the button while in flight and `docs.exportFailed` on failure.++- [ ] **Step 5: Verify**++Run: `cargo check --workspace && pnpm typecheck`+Expected: clean.++Then run the app (`pnpm dev:web` with `DBX_DISABLE_PASSWORD=1` plus the backend) and click Export. Confirm the saved file opens over `file://` and is **byte-identical** to the CLI's output for the same inputs:++```bash+cmp /tmp/from-cli.html /tmp/from-app.html && echo "identical"+```+Expected: `identical`. They call the same function; any difference means one caller is passing something the other is not.++- [ ] **Step 6: Commit**++```bash+git add src-tauri crates/dbx-web apps/desktop/src+git commit -m "$(cat <<'EOF'+feat(docs): export documentation as HTML from the app++The button and `dbx docs` call the same Rust function, so the two cannot+drift — verified by comparing their output byte-for-byte.++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Task 10: Prove the exported file actually runs++Every test so far checks that the artefact *looks* right. None executes it. This task attempts the one that does.++**Files:**+- Create: `apps/desktop/src/docs-export/__tests__/exportSmoke.spec.ts`++- [ ] **Step 1: Attempt the happy-dom smoke test**++```ts+import { execFileSync } from "node:child_process";+import { readFileSync } from "node:fs";+import path from "node:path";+import { beforeAll, describe, expect, it } from "vitest";++// @vitest-environment happy-dom++const htmlPath = path.resolve(__dirname, "../../../../../target/docs-export-smoke.html");++describe("the exported file", () => {+ beforeAll(() => {+ // Generated by a small Rust example so the test exercises the REAL+ // to_standalone_html output rather than a hand-built approximation.+ execFileSync("cargo", ["run", "-p", "dbx-core", "--example", "docs_export_smoke", "--", htmlPath], { stdio: "inherit" });+ });++ it("mounts and renders a table name", async () => {+ document.documentElement.innerHTML = readFileSync(htmlPath, "utf8");+ for (const script of Array.from(document.querySelectorAll("script"))) {+ if (script.getAttribute("type") === null) new Function(script.textContent ?? "")();+ }+ await new Promise((resolve) => setTimeout(resolve, 100));+ expect(document.querySelector("#app")?.textContent ?? "").toContain("public.orders");+ });+});+```++This needs a `crates/dbx-core/examples/docs_export_smoke.rs` that builds a two-table snapshot, calls `to_standalone_html`, and writes it to `argv[1]`.++- [ ] **Step 2: Run it**++Run: `pnpm vitest run apps/desktop/src/docs-export/__tests__/exportSmoke.spec.ts`++- [ ] **Step 3: Decide honestly**++If it passes, keep it — it is the most valuable test in this part.++**If happy-dom cannot execute the Vue bundle, delete the test rather than weakening it into something that passes without proving anything.** Record in the task report exactly what failed and with what message, and note that the artefact is instead covered by `nothing_is_loaded_from_the_network` plus manual `file://` verification. A test that mounts nothing but asserts `true` is worse than no test, because it reads as coverage.++- [ ] **Step 4: Manual verification either way**++Open the generated file in a real browser over `file://` with the network disabled. Confirm: the index renders with the correct font; a table page opens; the hash updates; a reload lands on the same page; a deep link to a removed table falls back to the index; the language switcher changes the chrome; the diagram renders and clicking a table navigates.++- [ ] **Step 5: Commit**++```bash+git add apps/desktop/src/docs-export crates/dbx-core/examples+git commit -m "$(cat <<'EOF'+test(docs): execute the exported file rather than only inspecting it++Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>+Claude-Session: https://claude.ai/code/session_01Ro4mfGEmsbbH32WYsvxsfH+EOF+)"+```++---++## Final verification++- [ ] `make check` — format, lint, typecheck, tests+- [ ] `make cargo-check-fast`+- [ ] `cargo test -p dbx-core --lib docs`+- [ ] `pnpm vitest run apps/desktop/src/docs apps/desktop/src/docs-export apps/desktop/src/i18n`+- [ ] `pnpm build:docs-export && git diff --exit-code crates/dbx-core/assets/` — confirms the committed bundle is what the current sources produce+- [ ] Update PR #5559's body with the export screenshots and the `dbx docs` usage++Note: `queryStore.test.ts > result cache eviction keeps recently accessed inactive tabs` is a known wall-clock-timeout flake under full-suite load. It passes in isolation and on re-run, and is untouched by this work. Re-run before investigating.diff --git a/docs/superpowers/specs/2026-08-06-database-documentation-export-design.md b/docs/superpowers/specs/2026-08-06-database-documentation-export-design.mdnew file mode 100644index 0000000000..e8e76df746--- /dev/null+++ b/docs/superpowers/specs/2026-08-06-database-documentation-export-design.md@@ -0,0 +1,302 @@+# Standalone documentation export — design++**Part 3c of the database-documentation feature.** Parts 1, 2, 3a and 3b are complete on+`feature/docs-snapshot-dbml` and open upstream as PR #5559: `SchemaSnapshot` collection with a DBML+serializer and a `dbx dbml` verb, a file-backed annotation store, a pure Vue viewer, and that+viewer mounted in DBX with autosaved editing.++This part makes the documentation leave the application: one self-contained HTML file, produced by+a `dbx docs` verb and by a button in the app, that opens from `file://` on a machine with no DBX+installed.++## Goal++A user runs `dbx docs prod --out schema.html` in CI, or clicks **Export HTML** in the docs dialog,+and gets a single file they can commit, attach to a ticket, or email to a colleague. It opens with+no network, no server and no install. Deep links into it survive a reload, and the reader chooses+their own language.++## Scope++**In scope**++- A standalone Vite bundle of the existing viewer, built to one JS and one CSS+- `crates/dbx-core/src/docs/export.rs` — `to_standalone_html(snapshot, annotations, lang)`+- The `dbx docs` CLI verb, mirroring `dbx dbml`'s flags+- A Tauri command and an **Export HTML** button in `DatabaseDocsDialog.vue`+- Hash routing in the export shell, so `schema.html#/table/public.orders` is a link+- A language switcher over all 8 bundled `docs` namespaces+- `SchemaDiagram.vue` — a minimal read-only ER renderer+- A staleness guard so the committed bundle cannot drift from its sources++**Out of scope**++- Editing in the export. It is read-only; `readonly` exists on `DocsApp` for exactly this.+- Zoom, pan controls, drag, custom relationships or join-SQL in the diagram — that is what the+ full `SchemaDiagramDialog` is for.+- The `latin-ext` font subset. The latin subset is inlined; `latin-ext` doubles the font cost to+ serve characters most schemas never use, and the fallback is graceful.+- Persisting the reader's language choice. See "Language" below.++## Decisions taken before design++| Question | Decision |+|---|---|+| How does the built bundle reach the Rust binary? | Committed build artefact in `crates/dbx-core/assets/`, embedded with `include_str!`, with a staleness guard |+| Where does the ER renderer live? | `src/docs/`, with the host choosing the affordance |+| What language is the export? | All 8 namespaces bundled, switchable by the reader |+| Is there an in-app export button? | Yes — same Rust function, two callers |+| How is a stale bundle detected? | Content hash against a manifest, derived from the build |+| How is the payload embedded? | base64 |++## Architecture++### Three pieces, each with one job++```+apps/desktop/src/docs-export/ the export shell (browser)+ main.ts mounts ExportApp, decodes the payload+ ExportApp.vue hash routing, language switcher, readonly=true, diagram="inline"+ export.css @source narrowed to ../docs/** + inlined @font-face++pnpm build:docs-export vite.docs-export.config.ts+ → one JS, one CSS, font as data URI, no code splitting+ → crates/dbx-core/assets/docs-export.{js,css,manifest.json}++crates/dbx-core/src/docs/export.rs to_standalone_html(snapshot, annotations, lang)+ → include_str! the two assets, base64 the payload, emit one HTML file+```++### Why the bundle is committed rather than built by cargo++Rust cannot run Vite, and `dbx docs` must work from a plain `cargo install` on a machine with no+Node. A `build.rs` that shells out to pnpm would break exactly that case, and neither existing+`build.rs` invokes an external toolchain.++There is partial precedent: `crates/dbx-core/src/ai_pi_agent_cli.rs:24` embeds+`include_str!("../assets/pi-mcp-bridge.mjs")`, and `crates/dbx-core/assets/` already carries a+54.8 KB driver manifest. The caveat is honest and belongs in the PR: `pi-mcp-bridge.mjs` is+hand-written, so the precedent covers committing a *source* asset, not a *build artefact*. The+staleness guard is what makes the difference acceptable.++### Data flow++`dbx docs` collects a snapshot exactly as `dbx dbml` does — same collector, same `--schema`,+`--database`, `--tables`, `--notes` flags, same warnings on stderr through the `Display` impl. It+then calls `to_standalone_html`. The Tauri command calls the identical function.++The snapshot is passed **with annotations already applied**, because `apply_annotations` is Rust+and the export has no Rust at runtime. The raw `AnnotationFile` also travels, for the same reason+the dialog needs it: `snapshot.groups` holds resolved `TableGroup`s, while `annotations.groups`+holds the `GroupAnnotation` records that carry each group's hue.++### The payload is base64++The exported page contains user-authored Markdown. A note containing the literal text `</script>`+— entirely plausible in a schema document that discusses HTML — would terminate the script element+early and inject the remainder as markup.++base64 removes the problem structurally rather than procedurally: the alphabet is `A-Za-z0-9+/=`,+so no escaping rule exists to forget, and the property is auditable by inspection instead of by+reviewing every serialization path. It costs +33% on the JSON only.++The alternatives were considered and rejected. A `<script type="application/json">` in which every+`<` is rewritten as its JSON unicode escape (backslash, `u`, `003c`) is what SSR frameworks do and+is sound, but its correctness depends on that rewrite being applied on every path. A JS string literal needs four independent escaping rules —+quotes, backslashes, `</script>`, and U+2028/U+2029, which `JSON.stringify` emits raw because they+are valid JSON but which were line terminators inside JS string literals until ES2019.++The cost of base64 is that the embedded schema is no longer readable in a text editor. That is+accepted.++### Styling: `globals.css` cannot be reused++Two facts decide this.++`apps/desktop/src/styles/globals.css:40` is `@source "../**/*.{vue,ts,tsx,js,jsx,html}"`. Tailwind+v4 scans the entire application, so importing `globals.css` into the export would emit every+utility used anywhere in DBX. The 76 KB of source is not the cost; the generated utility surface+is. `@source` is additive — there is no way to un-source it.++Its four `@font-face` blocks use absolute `/fonts/…` URLs, which under `file://` resolve against+the filesystem root and fail silently to a system font.++So `export.css` is its own entry: `@source` narrowed to `../docs/**`, and `@font-face` redeclared+with the woff2 inlined as a data URI (~38 KB base64).++### One shared-file change: `tokens.css`++The viewer's utilities resolve against tokens — `--background`, `--foreground`,+`--muted-foreground`, `--border`, `--ring` — defined in `globals.css` from line 131, interleaved+with roughly 2300 lines of application-specific rules. A narrowed `@source` still needs those+tokens.++The token blocks move to `apps/desktop/src/styles/tokens.css`, imported by **both** `globals.css`+and `export.css`. One definition, no drift. Copying the values into the export instead is exactly+the duplication that produced this feature's recurring defects.++**This is a real risk and the plan must treat it as one.** It edits a 76 KB stylesheet the whole+application depends on, on an already-large branch. The move is mechanical — a contiguous block+plus one `@import` — but the cascade order between `:root` and `.dark` must be preserved exactly.+A test asserts every custom property defined at `:root` before the extraction still resolves after+it.++## The export shell++### Hash routing stays out of the shared tree++`DocsApp` owns navigation internally today: `activeKey`, `activeEnumName`, and a computed+`view: "index" | "table" | "enum"`. It gains an **optional** `v-model:route`:++```ts+type DocsRoute =+ | { kind: "index" }+ | { kind: "table"; key: string }+ | { kind: "enum"; name: string }+ | { kind: "diagram" };+```++Absent, `DocsApp` behaves exactly as it does today and the dialog is untouched. Present, the shell+controls navigation and mirrors `location.hash`.++`{ kind: "diagram" }` is only reachable when `diagram="inline"`. Under `diagram="external"` the+route resolves to the index, so a hash of `#/diagram` in the dialog's context cannot render a view+that host has deliberately not enabled.++This separation is not stylistic. DBX has **no router at all** — `vue-router` is not a dependency,+and the only `location.hash` reference in the frontend is a debug logger at+`lib/backend/debugLog.ts:214`. A `DocsApp` that wrote to the URL would hijack the host+application's address bar.++Hash grammar, with `encodeURIComponent` on the identifier so a table named `a/b` round-trips:++```+#/ index+#/table/public.orders table page+#/enum/order_status enum page+#/diagram ER diagram+```++Hash routing rather than `pushState` because the target is `file://`, where `pushState` is+unusable but a fragment survives a reload and makes `schema.html#/table/public.orders` a link+worth pasting.++**Parsing is defensive by contract.** An unparseable hash, or one naming a table or enum absent+from the payload, resolves to the index. A stale deep link into a since-dropped table is the+expected case, not an exotic one, and must never produce a blank page.++### Language++All 8 `docs` namespaces are bundled. They total 15,197 bytes of source across+`apps/desktop/src/i18n/locales/docs/{en,es,it,ja,ko,pt-BR,zh-CN,zh-TW}.ts` — roughly 3 KB gzipped,+negligible against the bundle. The payload carries an initial `lang` from `--lang` or the app's+current locale; the switcher rebuilds `translate` from the bundled namespace.++**No persistence.** Under `file://` every document shares one opaque origin, so `localStorage`+would leak one export's preference into an unrelated one. A single-session document is the honest+model.++**Missing keys fall back to English.** The parity test guarantees all 8 namespaces agree, so this+should never fire; it exists so an artefact opened offline degrades to English rather than+rendering a raw key. This does not repeat the Part 3b hazard where a fallback masked drift — there+the fallback replaced the guard, here the guard runs in CI and the fallback is a runtime backstop.++The switcher is worth having because **the reader is usually not the exporter**: the file gets+sent to someone else, and upstream's largest user base does not read English.++### The ER renderer++`SchemaDiagram.vue` lives in `src/docs/` and is added to the contract test's expected component+list. It imports `layoutDiagramTables` from `@/lib/diagram/erDiagram` — permitted, since only+`@/lib/backend` is forbidden, and that module has exactly one import which is `import type`,+making it fully bundleable.++So the grid layout is reused, not reinvented. What is genuinely new is **edge routing**, which+exists nowhere in the codebase today: a straight line between two cards' centres, clipped at each+card's border so it terminates on the edge rather than under the box. Crossings are tolerated.++Deliberately minimal: SVG at natural size inside an `overflow: auto` container, because scrolling+*is* panning. No zoom, no drag, no custom relationships, no join-SQL. Group colours come from+`groupStyle(hue)` so the diagram agrees with the wiki, and clicking a table navigates to its page —+which under hash routing makes the diagram a usable table of contents.++The host chooses the affordance. `DatabaseDocsDialog` passes `diagram="external"` and keeps its+existing button to the full `SchemaDiagramDialog`; the export passes `diagram="inline"`. No screen+shows both, and neither host gets a worse diagram than it could have.++## The staleness guard++`pnpm build:docs-export` emits `docs-export.js`, `docs-export.css` and `docs-export.manifest.json`+into `crates/dbx-core/assets/`.++**The manifest is derived from Rollup's module graph, not from a hand-written glob.** This is the+single most important detail in this section. `SchemaDiagram.vue` imports `erDiagram.ts`, which+lives outside `src/docs/` — a glob of `src/docs/**` would miss it and the guard would pass while+the artefact was stale. That is the same defect shape that has now bitten this feature three times:+`vue-i18n` absent from the contract test's forbidden list, `DocEnum` unpinned by an enum-free+fixture, `.docs-ground-light` absent from the CSS selector list. **A guard that enumerates its+targets silently excludes everything added later.**++So the build script writes the manifest from every repo file that actually entered the bundle,+plus the resolved versions of the node_modules packages it pulled in.++This closes the loop on new files, and the reason should be stated in the plan rather than left+implied: a new module can only enter the bundle by being imported, which means editing an existing+file, which changes that file's hash. The one hole is `import.meta.glob`, which would add modules+without editing an importer — the viewer does not use it, and the plan says so explicitly.++The Rust test recomputes the hashes and fails with the regeneration command. It must skip when the+crate is consumed from a published package where `apps/desktop/` does not exist — and that skip is+itself a hazard, since a vacuous skip in CI would silently disable the guard. The skip therefore+keys off a repository-only marker (`pnpm-workspace.yaml`): marker present, the test runs; marker+absent, the crate is genuinely packaged and there is nothing to check.++## Error handling++- `--out` omitted writes to stdout, matching `dbx dbml`. A 400 KB HTML in a terminal is unpleasant,+ but consistency and `dbx docs prod | gzip > docs.html.gz` are worth more than a special case.+- `--lang xx` fails with the list of valid locales rather than falling back. A typo should be loud,+ the same reasoning that made `--notes` an explicit flag in Part 2.+- A missing or malformed notes file behaves exactly as `dbx dbml` does, through the existing+ `require_notes_file`.++## Testing++| Layer | Approach |+|---|---|+| `to_standalone_html` | Rust: base64 round-trip; a note containing `</script>` survives intact |+| Self-containedness | Rust: the emitted HTML contains no `http://`, `https://`, `url(/`, or external `src`/`href` |+| Route parsing | TS: pure parse/format — unknown table resolves to index, encoded identifiers, empty hash |+| Language | TS: the translate factory picks the right namespace; unknown lang falls back to English |+| Edge clipping | TS: the line-to-card-border intersection is a pure function |+| Contract | `SchemaDiagram.vue` added to the expected component list |+| Token extraction | Every custom property defined at `:root` before the move still resolves after it |+| Staleness | The manifest test, verified by touching a source file and watching it fail |++**Every new test gets the deliberate-break treatment**: break the behaviour, watch the named test+fail, restore, report the failure message. Across Parts 3a and 3b this caught a vacuous ranking+test, a CSS ordering bug that let a whole theme's colours be deleted silently, a capability warning+that contradicted its own data, and an atomicity test that was vacuous because of the fix+instruction I had written myself.++### The test worth attempting but not promising++A `happy-dom` smoke test that loads the generated HTML, executes the inline bundle, and asserts a+known table name reaches the DOM is the only test that proves the artefact *works* rather than+merely looks right. `happy-dom ^20.10.6` is already a dependency; Playwright and Puppeteer are not.++happy-dom can execute scripts, but running a full Vue bundle in it is not guaranteed. If it works+it is the most valuable test in this part. If it does not, the plan says so plainly and falls back+to the structural self-containedness test plus opening the file in a real browser over `file://` —+the method already used to verify the viewer for PR #5559's screenshots.++## Success criteria++- `dbx docs prod --out schema.html` produces one file that opens from `file://` with no network, no+ server and no DBX installed.+- `schema.html#/table/public.orders` survives a reload and can be pasted to a colleague.+- A reader switches language without re-exporting.+- The in-app button and the CLI produce byte-identical output for the same inputs, because they+ call the same function.+- The committed bundle cannot drift from its sources without a test failing.+- `apps/desktop/src/docs/**/*.vue` still makes zero backend calls, enforced by the contract test.diff --git a/package.json b/package.jsonindex 0675f02f91..12ebfcbd6b 100644--- a/package.json+++ b/package.json@@ -25,6 +25,7 @@"build:knowledge-base": "node scripts/build-knowledge-base.mjs","typecheck": "vue-tsc --noEmit --project apps/desktop/tsconfig.json","build": "vite build --config apps/desktop/vite.config.ts",+ "build:docs-export": "vite build --config apps/desktop/vite.docs-export.config.ts","build:checked": "pnpm typecheck && pnpm build","check": "node scripts/run-check.mjs","db:env": "node scripts/database-env.mjs",diff --git a/src-tauri/src/commands/docs.rs b/src-tauri/src/commands/docs.rsindex a5ac446886..8d9dba7c2d 100644--- a/src-tauri/src/commands/docs.rs+++ b/src-tauri/src/commands/docs.rs@@ -8,7 +8,7 @@ use dbx_core::connection::AppState;use dbx_core::docs::annotations::{apply_annotations, load_annotations, resolve_notes_path, save_annotations, AnnotationFile,};-use dbx_core::docs::{collect_snapshot, CollectOptions, SchemaSnapshot};+use dbx_core::docs::{collect_snapshot, to_standalone_html, CollectOptions, SchemaSnapshot};use dbx_core::models::connection::ConnectionConfig;use tauri::State;@@ -81,3 +81,14 @@ pub async fn docs_save_annotations(let path = notes_path_of(&state, &connection_id).await?;save_annotations(&path, &annotations)}++#[tauri::command]+pub async fn docs_export_html(+ file_path: String,+ snapshot: SchemaSnapshot,+ annotations: AnnotationFile,+ lang: String,+) -> Result<(), String> {+ let html = to_standalone_html(&snapshot, &annotations, &lang)?;+ std::fs::write(&file_path, html).map_err(|error| format!("Failed to write {file_path}: {error}"))+}diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rsindex 2e218ddfdb..29e8c628bd 100644--- a/src-tauri/src/lib.rs+++ b/src-tauri/src/lib.rs@@ -1873,6 +1873,7 @@ pub fn run() {commands::docs::docs_load_annotations,commands::docs::docs_apply_annotations,commands::docs::docs_save_annotations,+ commands::docs::docs_export_html,commands::document_cmd::document_list_databases,commands::document_cmd::document_list_collections,commands::document_cmd::document_find_documents,