@hiai-gg/docsmint 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/src/lib/logger.ts +45 -15
- package/dist/backend/index.js +238 -150
- package/dist/frontend/CategoryDialog-DphkZqIB.js +611 -0
- package/dist/frontend/ConfirmDialog-BLF3x_hr.js +214 -0
- package/dist/frontend/CreateSnapshotDialog-D5vPvFTL.js +216 -0
- package/dist/frontend/DatePicker-CLNTdvTk.js +259 -0
- package/dist/frontend/DeleteDialog-DxYFJivN.js +174 -0
- package/dist/frontend/FolderDialog-CRVZM2Oi.js +250 -0
- package/dist/frontend/FolderNode-C2zG7uii.js +298 -0
- package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
- package/dist/frontend/Icon-CooFj4Ee.js +64 -0
- package/dist/frontend/SettingsDialog-DCM4-N6_.js +1016 -0
- package/dist/frontend/ShareDialog-DYu3RKQu.js +165 -0
- package/dist/frontend/TagCreateDialog-DXQs2bL9.js +260 -0
- package/dist/frontend/api/attachments.d.ts +6 -0
- package/dist/frontend/api/attachments.js +2 -0
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/documents.js +1 -1
- package/dist/frontend/api/folders.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/share.d.ts +5 -0
- package/dist/frontend/api/share.js +2 -0
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/api-keys-CpkrA8rD.js +35 -0
- package/dist/frontend/attachments-BuILSs56.js +50 -0
- package/dist/frontend/{settings-PCrOtied.js → auth-client-Cygmp1I2.js} +205 -265
- package/dist/frontend/awareness-snQ3RD9f.js +3714 -0
- package/dist/frontend/camera-iKXDOOWT.js +29 -0
- package/dist/frontend/{categories-BE6ZpZl8.js → categories-izQovv2w.js} +1 -1
- package/dist/frontend/check-D-UuvBuh.js +25 -0
- package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
- package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
- package/dist/frontend/{client-B9hzI0W8.js → client-GbtOH90i.js} +1 -1
- package/dist/frontend/clipboard-Cgzxc0_R.js +16 -0
- package/dist/frontend/clock-DJHbHZb8.js +29 -0
- package/dist/frontend/clsx-C7bIvsDS.js +1738 -0
- package/dist/frontend/collaboration.d.ts +6 -0
- package/dist/frontend/collaboration.js +182 -0
- package/dist/frontend/components/category-dialog.d.ts +2 -0
- package/dist/frontend/components/category-dialog.js +2 -0
- package/dist/frontend/components/create-snapshot-dialog.d.ts +2 -0
- package/dist/frontend/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend/components/delete-dialog.d.ts +2 -0
- package/dist/frontend/components/delete-dialog.js +2 -0
- package/dist/frontend/components/editor/document-editor.d.ts +3 -0
- package/dist/frontend/components/editor/document-editor.js +3032 -0
- package/dist/frontend/components/editor/document-title.d.ts +2 -0
- package/dist/frontend/components/editor/document-title.js +31 -0
- package/dist/frontend/components/editor/docx-serializer.d.ts +2 -0
- package/dist/frontend/components/editor/docx-serializer.js +14600 -0
- package/dist/frontend/components/editor/extensions.d.ts +2 -0
- package/dist/frontend/components/editor/extensions.js +2 -0
- package/dist/frontend/components/editor/markdown-toggle.d.ts +2 -0
- package/dist/frontend/components/editor/markdown-toggle.js +72 -0
- package/dist/frontend/components/editor/markdown.d.ts +1 -0
- package/dist/frontend/components/editor/markdown.js +2 -0
- package/dist/frontend/components/folder-node.d.ts +3 -0
- package/dist/frontend/components/folder-node.js +2 -0
- package/dist/frontend/components/folder-tree-selector.d.ts +2 -0
- package/dist/frontend/components/folder-tree-selector.js +2 -0
- package/dist/frontend/components/save-as-dialog.d.ts +2 -0
- package/dist/frontend/components/save-as-dialog.js +272 -0
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.d.ts +2 -0
- package/dist/frontend/components/share-dialog.js +2 -0
- package/dist/frontend/components/sidebar.js +1145 -3693
- package/dist/frontend/components/tag-create-dialog.d.ts +2 -0
- package/dist/frontend/components/tag-create-dialog.js +2 -0
- package/dist/frontend/components/version-history.d.ts +2 -0
- package/dist/frontend/components/version-history.js +294 -0
- package/dist/frontend/{context-DbnW5yib.js → context-BMD6XTPe.js} +0 -3
- package/dist/frontend/copy-GppwRMjX.js +32 -0
- package/dist/frontend/dashboard.js +1113 -1157
- package/dist/frontend/{SettingsDialog-D4pgFD0D.js → db-ByrlYfaI.js} +923 -2002
- package/dist/frontend/dialog-D6NxYVmy.js +213 -0
- package/dist/frontend/dndzone-BzsOINtP.js +1199 -0
- package/dist/frontend/doc-tabs.d.ts +7 -0
- package/dist/frontend/doc-tabs.js +14 -0
- package/dist/frontend/document-drop-coordinator-C4xHMjwC.js +68 -0
- package/dist/frontend/document-drop-coordinator.d.ts +2 -0
- package/dist/frontend/document-drop-coordinator.js +2 -0
- package/dist/frontend/{documents-DFVS9SsL.js → documents-BsDkvzCm.js} +1 -1
- package/dist/frontend/editorExtensions-BMHvUbdk.js +27021 -0
- package/dist/frontend/ellipsis-vertical-P9MHvCps.js +530 -0
- package/dist/frontend/extension.js +8 -7
- package/dist/frontend/floating-layer-anchor-CPwucTfd.js +4515 -0
- package/dist/frontend/folder-DeWhnD7O.js +45 -0
- package/dist/frontend/folder-refresh.d.ts +8 -0
- package/dist/frontend/folder-refresh.js +2 -0
- package/dist/frontend/{folders-CGe9diAG.js → folders-CTuV_JtU.js} +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/i18n.js +1 -1
- package/dist/frontend/identity-DyWeNzu_.js +69 -0
- package/dist/frontend/input-B5Rak-5G.js +23 -0
- package/dist/frontend/keyboard.d.ts +14 -0
- package/dist/frontend/keyboard.js +2 -0
- package/dist/frontend/keyboard.svelte-CApmX0vl.js +133 -0
- package/dist/frontend/label-CW9rxoAb.js +30 -0
- package/dist/frontend/loader-circle-BA6aLO71.js +268 -0
- package/dist/frontend/markdown-BwnyjITU.js +11 -0
- package/dist/frontend/messages-BpYaLbzE.js +1091 -0
- package/dist/frontend/offline/identity.d.ts +6 -0
- package/dist/frontend/offline/identity.js +2 -0
- package/dist/frontend/resolve-BG4HgzpN.js +19 -0
- package/dist/frontend/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
- package/dist/frontend/search.js +637 -602
- package/dist/frontend/select-value-sF86Geyh.js +1446 -0
- package/dist/frontend/settings-blyobazp.js +62 -0
- package/dist/frontend/share-Cu7SSJuJ.js +28 -0
- package/dist/frontend/shared-document.js +94 -93
- package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
- package/dist/frontend/tag-HxRazVN_.js +54 -0
- package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
- package/dist/frontend/{tags-DVXTut0p.js → tags-CtCV0Djo.js} +1 -1
- package/dist/frontend/textarea-i1720bE7.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
- package/dist/frontend/types.d.ts +6 -0
- package/dist/frontend/types.js +0 -0
- package/dist/frontend/utils/clipboard.d.ts +1 -0
- package/dist/frontend/utils/clipboard.js +2 -0
- package/dist/frontend/utils/dndzone.d.ts +4 -0
- package/dist/frontend/utils/dndzone.js +2 -0
- package/dist/frontend/utils-CffiyuTo.js +19 -0
- package/dist/frontend/utils-hzdMVeCv.js +7 -0
- package/dist/frontend/utils.d.ts +4 -0
- package/dist/frontend/utils.js +2 -0
- package/dist/frontend/x-CzBsnJ2x.js +25 -0
- package/dist/frontend-ssr/api/attachments.js +2 -0
- package/dist/frontend-ssr/api/categories.js +2 -0
- package/dist/frontend-ssr/api/documents.js +2 -0
- package/dist/frontend-ssr/api/folders.js +2 -0
- package/dist/frontend-ssr/api/settings.js +2 -0
- package/dist/frontend-ssr/api/share.js +2 -0
- package/dist/frontend-ssr/api/tags.js +2 -0
- package/dist/frontend-ssr/assets/CategoryDialog-C2xaZKHq.js +584 -0
- package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
- package/dist/frontend-ssr/assets/CreateSnapshotDialog-BRw1xJW1.js +214 -0
- package/dist/frontend-ssr/assets/DatePicker-DnXniwlZ.js +312 -0
- package/dist/frontend-ssr/assets/DeleteDialog-BCfZy3Zn.js +154 -0
- package/dist/frontend-ssr/assets/FolderDialog-Dq7I2cKZ.js +429 -0
- package/dist/frontend-ssr/assets/FolderNode-DRfBfpft.js +171 -0
- package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
- package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
- package/dist/frontend-ssr/assets/SettingsDialog-CX8Noa8A.js +1107 -0
- package/dist/frontend-ssr/assets/ShareDialog-Cge49ZdJ.js +54 -0
- package/dist/frontend-ssr/assets/TagCreateDialog-EAChgBF-.js +264 -0
- package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
- package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
- package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
- package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
- package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
- package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
- package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
- package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
- package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
- package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
- package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
- package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
- package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
- package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
- package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
- package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
- package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
- package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
- package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
- package/dist/frontend-ssr/assets/ellipsis-vertical-C-0hgkZn.js +555 -0
- package/dist/frontend-ssr/assets/floating-layer-anchor-uzw9K8qN.js +6114 -0
- package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
- package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
- package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
- package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
- package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
- package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
- package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
- package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
- package/dist/frontend-ssr/assets/messages-DhXqlcJI.js +11125 -0
- package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
- package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
- package/dist/frontend-ssr/assets/select-value-DngdSmLI.js +1526 -0
- package/dist/frontend-ssr/assets/settings-E6qSAWM2.js +64 -0
- package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
- package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
- package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
- package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
- package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
- package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
- package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
- package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
- package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
- package/dist/frontend-ssr/collaboration.js +39 -0
- package/dist/frontend-ssr/components/category-dialog.js +2 -0
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend-ssr/components/delete-dialog.js +2 -0
- package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
- package/dist/frontend-ssr/components/editor/document-title.js +11 -0
- package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
- package/dist/frontend-ssr/components/editor/extensions.js +2 -0
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
- package/dist/frontend-ssr/components/editor/markdown.js +2 -0
- package/dist/frontend-ssr/components/folder-node.js +2 -0
- package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
- package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
- package/dist/frontend-ssr/components/settings.js +2 -0
- package/dist/frontend-ssr/components/share-dialog.js +2 -0
- package/dist/frontend-ssr/components/sidebar.js +2033 -0
- package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
- package/dist/frontend-ssr/components/version-history.js +370 -0
- package/dist/frontend-ssr/dashboard.js +2542 -0
- package/dist/frontend-ssr/doc-tabs.js +23 -0
- package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
- package/dist/frontend-ssr/extension.js +13 -0
- package/dist/frontend-ssr/folder-refresh.js +2 -0
- package/dist/frontend-ssr/i18n.js +10 -0
- package/dist/frontend-ssr/keyboard.js +2 -0
- package/dist/frontend-ssr/offline/identity.js +2 -0
- package/dist/frontend-ssr/search.js +332 -0
- package/dist/frontend-ssr/shared-document.js +273 -0
- package/dist/frontend-ssr/theme.js +9 -0
- package/dist/frontend-ssr/types.js +1 -0
- package/dist/frontend-ssr/utils/clipboard.js +2 -0
- package/dist/frontend-ssr/utils/dndzone.js +2 -0
- package/dist/frontend-ssr/utils.js +2 -0
- package/package.json +130 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -0
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/DatePicker-BcMD49PV.js +0 -275
- package/dist/frontend/ShareDialog-Dzh7rV7J.js +0 -1317
- package/dist/frontend/client-C6QQGb0e.js +0 -2766
- package/dist/frontend/input-ieWIt8I7.js +0 -257
- package/dist/frontend/messages-CTGAsqFu.js +0 -1106
- package/dist/frontend/resolve-Bl6xmJl_.js +0 -2068
- package/dist/frontend/tag-C5xrg-bb.js +0 -53
- package/dist/frontend/tag-store.svelte-B3839FYq.js +0 -6152
- package/dist/frontend/theme.svelte-ei0QxXa8.js +0 -49
|
@@ -0,0 +1,1107 @@
|
|
|
1
|
+
import { An as theme_dark, Cn as new_password, Dn as settings_email_change_warning, En as settings_name, Fn as settings_profile, In as settings_title, Mn as settings_theme, Nn as settings_appearance, On as settings_email, Pn as settings_account, Sn as confirm_password, Tn as settings_save, bn as auth_password, dn as action_close, jn as theme_light, kn as theme_system, wn as password_label, xn as change_password, yn as auth_logout } from "./messages-DhXqlcJI.js";
|
|
2
|
+
import { t as cn } from "./utils-DtlPPXpJ.js";
|
|
3
|
+
import { a as Dialog, i as Dialog_description, n as Dialog_header, o as Button, r as Dialog_footer, t as Dialog_title } from "./dialog-BOV1u6zP.js";
|
|
4
|
+
import { t as Label } from "./label-Bj8-TfFN.js";
|
|
5
|
+
import { t as Icon } from "./Icon-B0Zqppjo.js";
|
|
6
|
+
import { i as listCategories } from "./categories-AOqgcsn4.js";
|
|
7
|
+
import { t as Input } from "./input-DezGsU3y.js";
|
|
8
|
+
import { t as getFrontendExtensions } from "./context-jz1GGEUi.js";
|
|
9
|
+
import { t as resolveExtensions } from "./resolve-BqHozBXl.js";
|
|
10
|
+
import { r as signOut } from "./auth-client-x26kqY8Z.js";
|
|
11
|
+
import { r as getProfile } from "./settings-E6qSAWM2.js";
|
|
12
|
+
import { a as listApiKeys, i as createGlobalApiKey, n as categoryIdFromScopes, o as revealCategoryApiKey, s as revokeApiKey, t as apiKeyClipboardValue } from "./api-keys-DFqX39MT.js";
|
|
13
|
+
import { a as resolveOfflineIdentity, t as disableOfflineAccess } from "./identity-B3uHoDtf.js";
|
|
14
|
+
import { n as getOfflineDB, t as deleteOfflineDB } from "./db-CnxeO66n.js";
|
|
15
|
+
import { t as themeStore } from "./theme.svelte-Co0-ssaD.js";
|
|
16
|
+
import * as $ from "svelte/internal/server";
|
|
17
|
+
import { onMount } from "svelte";
|
|
18
|
+
import { goto } from "$app/navigation";
|
|
19
|
+
import { page } from "$app/state";
|
|
20
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/log-out.svelte
|
|
21
|
+
function Log_out($$renderer, $$props) {
|
|
22
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
23
|
+
/**
|
|
24
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
25
|
+
*
|
|
26
|
+
* ISC License
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
29
|
+
*
|
|
30
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
31
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
32
|
+
* copyright notice and this permission notice appear in all copies.
|
|
33
|
+
*
|
|
34
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
35
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
36
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
37
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
38
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
39
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
40
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
41
|
+
*
|
|
42
|
+
* ---
|
|
43
|
+
*
|
|
44
|
+
* The following Lucide icons are derived from the Feather project:
|
|
45
|
+
*
|
|
46
|
+
* airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
47
|
+
*
|
|
48
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
51
|
+
*
|
|
52
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
53
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
54
|
+
* in the Software without restriction, including without limitation the rights
|
|
55
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
56
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
57
|
+
* furnished to do so, subject to the following conditions:
|
|
58
|
+
*
|
|
59
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
60
|
+
* copies or substantial portions of the Software.
|
|
61
|
+
*
|
|
62
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
63
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
64
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
65
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
66
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
67
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
68
|
+
* SOFTWARE.
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
Icon($$renderer, $.spread_props([
|
|
72
|
+
{ name: "log-out" },
|
|
73
|
+
$$sanitized_props,
|
|
74
|
+
{
|
|
75
|
+
/**
|
|
76
|
+
* @component @name LogOut
|
|
77
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
78
|
+
*
|
|
79
|
+
* @preview  - https://lucide.dev/icons/log-out
|
|
80
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
81
|
+
*
|
|
82
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
83
|
+
* @returns {FunctionalComponent} Svelte component
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
iconNode: [
|
|
87
|
+
["path", { "d": "m16 17 5-5-5-5" }],
|
|
88
|
+
["path", { "d": "M21 12H9" }],
|
|
89
|
+
["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]
|
|
90
|
+
],
|
|
91
|
+
children: ($$renderer) => {
|
|
92
|
+
$$renderer.push(`<!--[-->`);
|
|
93
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
94
|
+
$$renderer.push(`<!--]-->`);
|
|
95
|
+
},
|
|
96
|
+
$$slots: { default: true }
|
|
97
|
+
}
|
|
98
|
+
]));
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region ../node_modules/.bun/lucide-svelte@1.0.1+ff5f301bb2db9a0d/node_modules/lucide-svelte/dist/icons/save.svelte
|
|
102
|
+
function Save($$renderer, $$props) {
|
|
103
|
+
const $$sanitized_props = $.sanitize_props($$props);
|
|
104
|
+
/**
|
|
105
|
+
* @license lucide-svelte v1.0.1 - ISC
|
|
106
|
+
*
|
|
107
|
+
* ISC License
|
|
108
|
+
*
|
|
109
|
+
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
110
|
+
*
|
|
111
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
112
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
113
|
+
* copyright notice and this permission notice appear in all copies.
|
|
114
|
+
*
|
|
115
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
116
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
117
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
118
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
119
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
120
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
121
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
122
|
+
*
|
|
123
|
+
* ---
|
|
124
|
+
*
|
|
125
|
+
* The following Lucide icons are derived from the Feather project:
|
|
126
|
+
*
|
|
127
|
+
* airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
128
|
+
*
|
|
129
|
+
* The MIT License (MIT) (for the icons listed above)
|
|
130
|
+
*
|
|
131
|
+
* Copyright (c) 2013-present Cole Bemis
|
|
132
|
+
*
|
|
133
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
134
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
135
|
+
* in the Software without restriction, including without limitation the rights
|
|
136
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
137
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
138
|
+
* furnished to do so, subject to the following conditions:
|
|
139
|
+
*
|
|
140
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
141
|
+
* copies or substantial portions of the Software.
|
|
142
|
+
*
|
|
143
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
144
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
145
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
146
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
147
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
148
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
149
|
+
* SOFTWARE.
|
|
150
|
+
*
|
|
151
|
+
*/
|
|
152
|
+
Icon($$renderer, $.spread_props([
|
|
153
|
+
{ name: "save" },
|
|
154
|
+
$$sanitized_props,
|
|
155
|
+
{
|
|
156
|
+
/**
|
|
157
|
+
* @component @name Save
|
|
158
|
+
* @description Lucide SVG icon component, renders SVG Element with children.
|
|
159
|
+
*
|
|
160
|
+
* @preview  - https://lucide.dev/icons/save
|
|
161
|
+
* @see https://lucide.dev/guide/packages/lucide-svelte - Documentation
|
|
162
|
+
*
|
|
163
|
+
* @param {Object} props - Lucide icons props and any valid SVG attribute
|
|
164
|
+
* @returns {FunctionalComponent} Svelte component
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
iconNode: [
|
|
168
|
+
["path", { "d": "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" }],
|
|
169
|
+
["path", { "d": "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" }],
|
|
170
|
+
["path", { "d": "M7 3v4a1 1 0 0 0 1 1h7" }]
|
|
171
|
+
],
|
|
172
|
+
children: ($$renderer) => {
|
|
173
|
+
$$renderer.push(`<!--[-->`);
|
|
174
|
+
$.slot($$renderer, $$props, "default", {}, null);
|
|
175
|
+
$$renderer.push(`<!--]-->`);
|
|
176
|
+
},
|
|
177
|
+
$$slots: { default: true }
|
|
178
|
+
}
|
|
179
|
+
]));
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/lib/stores/search-preferences.ts
|
|
183
|
+
var DEFAULT_SEARCH_PREFERENCES = { graphSearchEnabled: true };
|
|
184
|
+
var SEARCH_PREFERENCES_KEY = "docsmint:search-preferences";
|
|
185
|
+
function normalizeSearchPreferences(value) {
|
|
186
|
+
if (!value || typeof value !== "object") return { ...DEFAULT_SEARCH_PREFERENCES };
|
|
187
|
+
const candidate = value;
|
|
188
|
+
return { graphSearchEnabled: typeof candidate.graphSearchEnabled === "boolean" ? candidate.graphSearchEnabled : DEFAULT_SEARCH_PREFERENCES.graphSearchEnabled };
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/tabs/tabs.svelte
|
|
192
|
+
function Tabs($$renderer, $$props) {
|
|
193
|
+
$$renderer.component(($$renderer) => {
|
|
194
|
+
let { value = "", class: className, children } = $$props;
|
|
195
|
+
$$renderer.push(`<div${$.attr_class($.clsx(cn("w-full", className)))}${$.attr("data-tabs-value", value)}>`);
|
|
196
|
+
if (children) {
|
|
197
|
+
$$renderer.push("<!--[0-->");
|
|
198
|
+
children($$renderer);
|
|
199
|
+
$$renderer.push(`<!---->`);
|
|
200
|
+
} else $$renderer.push("<!--[-1-->");
|
|
201
|
+
$$renderer.push(`<!--]--></div>`);
|
|
202
|
+
$.bind_props($$props, { value });
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/tabs/tabs-content.svelte
|
|
207
|
+
function Tabs_content($$renderer, $$props) {
|
|
208
|
+
$$renderer.component(($$renderer) => {
|
|
209
|
+
const { value: tabValue, currentValue, class: className, children } = $$props;
|
|
210
|
+
if (currentValue === tabValue) {
|
|
211
|
+
$$renderer.push("<!--[0-->");
|
|
212
|
+
$$renderer.push(`<div${$.attr_class($.clsx(cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className)))} role="tabpanel">`);
|
|
213
|
+
if (children) {
|
|
214
|
+
$$renderer.push("<!--[0-->");
|
|
215
|
+
children($$renderer);
|
|
216
|
+
$$renderer.push(`<!---->`);
|
|
217
|
+
} else $$renderer.push("<!--[-1-->");
|
|
218
|
+
$$renderer.push(`<!--]--></div>`);
|
|
219
|
+
} else $$renderer.push("<!--[-1-->");
|
|
220
|
+
$$renderer.push(`<!--]-->`);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/tabs/tabs-list.svelte
|
|
225
|
+
function Tabs_list($$renderer, $$props) {
|
|
226
|
+
$$renderer.component(($$renderer) => {
|
|
227
|
+
const { class: className, children } = $$props;
|
|
228
|
+
$$renderer.push(`<div${$.attr_class($.clsx(cn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground", className)))} role="tablist">`);
|
|
229
|
+
if (children) {
|
|
230
|
+
$$renderer.push("<!--[0-->");
|
|
231
|
+
children($$renderer);
|
|
232
|
+
$$renderer.push(`<!---->`);
|
|
233
|
+
} else $$renderer.push("<!--[-1-->");
|
|
234
|
+
$$renderer.push(`<!--]--></div>`);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/tabs/tabs-trigger.svelte
|
|
239
|
+
function Tabs_trigger($$renderer, $$props) {
|
|
240
|
+
$$renderer.component(($$renderer) => {
|
|
241
|
+
const { value, selected = false, class: className, children, onclick } = $$props;
|
|
242
|
+
$$renderer.push(`<button type="button" role="tab"${$.attr("aria-selected", selected)}${$.attr("data-state", selected ? "active" : "inactive")}${$.attr_class($.clsx(cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", selected ? "bg-primary text-primary-foreground shadow" : "text-muted-foreground hover:bg-accent hover:text-accent-foreground", className)))}>`);
|
|
243
|
+
if (children) {
|
|
244
|
+
$$renderer.push("<!--[0-->");
|
|
245
|
+
children($$renderer);
|
|
246
|
+
$$renderer.push(`<!---->`);
|
|
247
|
+
} else $$renderer.push("<!--[-1-->");
|
|
248
|
+
$$renderer.push(`<!--]--></button>`);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/lib/components/settings/ApiAccessSettings.svelte
|
|
253
|
+
function ApiAccessSettings($$renderer, $$props) {
|
|
254
|
+
$$renderer.component(($$renderer) => {
|
|
255
|
+
let keys = [];
|
|
256
|
+
let categories = [];
|
|
257
|
+
let keyName = "Global API key";
|
|
258
|
+
let issuedKeys = {};
|
|
259
|
+
let latestIssuedId = null;
|
|
260
|
+
let loading = true;
|
|
261
|
+
let busy = false;
|
|
262
|
+
let error = null;
|
|
263
|
+
const latestIssuedKey = $.derived(() => latestIssuedId ? issuedKeys[latestIssuedId] : void 0);
|
|
264
|
+
const globalKeys = $.derived(() => keys.filter((key) => key.scopes.includes("global")));
|
|
265
|
+
const categoryKeys = $.derived(() => keys.filter((key) => categoryIdFromScopes(key.scopes) !== null));
|
|
266
|
+
function categoryName(id) {
|
|
267
|
+
return categories.find((category) => category.id === id)?.name ?? "Unknown category";
|
|
268
|
+
}
|
|
269
|
+
async function refresh() {
|
|
270
|
+
loading = true;
|
|
271
|
+
error = null;
|
|
272
|
+
try {
|
|
273
|
+
const [keyResult, categoryResult] = await Promise.all([listApiKeys(), listCategories()]);
|
|
274
|
+
keys = keyResult.keys;
|
|
275
|
+
categories = categoryResult;
|
|
276
|
+
} catch (err) {
|
|
277
|
+
error = err instanceof Error ? err.message : "Failed to load API access";
|
|
278
|
+
} finally {
|
|
279
|
+
loading = false;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
onMount(refresh);
|
|
283
|
+
async function issueGlobalKey() {
|
|
284
|
+
busy = true;
|
|
285
|
+
error = null;
|
|
286
|
+
try {
|
|
287
|
+
const issued = await createGlobalApiKey(keyName.trim() || void 0);
|
|
288
|
+
issuedKeys = {
|
|
289
|
+
...issuedKeys,
|
|
290
|
+
[issued.id]: issued.key
|
|
291
|
+
};
|
|
292
|
+
latestIssuedId = issued.id;
|
|
293
|
+
await refresh();
|
|
294
|
+
} catch (err) {
|
|
295
|
+
error = err instanceof Error ? err.message : "Failed to create API key";
|
|
296
|
+
} finally {
|
|
297
|
+
busy = false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
async function revoke(id) {
|
|
301
|
+
busy = true;
|
|
302
|
+
try {
|
|
303
|
+
await revokeApiKey(id);
|
|
304
|
+
const { [id]: _revoked, ...remainingIssuedKeys } = issuedKeys;
|
|
305
|
+
issuedKeys = remainingIssuedKeys;
|
|
306
|
+
if (latestIssuedId === id) latestIssuedId = null;
|
|
307
|
+
await refresh();
|
|
308
|
+
} finally {
|
|
309
|
+
busy = false;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async function copyKey(key) {
|
|
313
|
+
const rawKey = issuedKeys[key.id] ?? await revealCategoryApiKey(key.id);
|
|
314
|
+
await navigator.clipboard.writeText(apiKeyClipboardValue(key, rawKey));
|
|
315
|
+
}
|
|
316
|
+
let $$settled = true;
|
|
317
|
+
let $$inner_renderer;
|
|
318
|
+
function $$render_inner($$renderer) {
|
|
319
|
+
$$renderer.push(`<div class="space-y-5 rounded-lg border border-border bg-card p-6"><div><h2 class="text-lg font-medium">API</h2> <p class="text-sm text-muted-foreground">Create a user-wide key or review category-scoped access. Global keys are shown once.</p></div> <div class="flex gap-2">`);
|
|
320
|
+
Input($$renderer, {
|
|
321
|
+
"aria-label": "Global API key name",
|
|
322
|
+
get value() {
|
|
323
|
+
return keyName;
|
|
324
|
+
},
|
|
325
|
+
set value($$value) {
|
|
326
|
+
keyName = $$value;
|
|
327
|
+
$$settled = false;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
$$renderer.push(`<!----> `);
|
|
331
|
+
Button($$renderer, {
|
|
332
|
+
onclick: issueGlobalKey,
|
|
333
|
+
disabled: busy,
|
|
334
|
+
children: ($$renderer) => {
|
|
335
|
+
$$renderer.push(`<!---->Create global key`);
|
|
336
|
+
},
|
|
337
|
+
$$slots: { default: true }
|
|
338
|
+
});
|
|
339
|
+
$$renderer.push(`<!----></div> `);
|
|
340
|
+
if (latestIssuedKey()) {
|
|
341
|
+
$$renderer.push("<!--[0-->");
|
|
342
|
+
$$renderer.push(`<div class="rounded-lg border border-primary/30 bg-primary/10 p-4 text-primary"><p class="text-sm font-medium">Copy this key now. It will not be shown again.</p> <code class="mt-2 block break-all rounded bg-background/80 p-2 text-xs text-foreground">${$.escape(latestIssuedKey())}</code> `);
|
|
343
|
+
Button($$renderer, {
|
|
344
|
+
class: "mt-2",
|
|
345
|
+
size: "sm",
|
|
346
|
+
variant: "outline",
|
|
347
|
+
onclick: () => navigator.clipboard.writeText(latestIssuedKey()),
|
|
348
|
+
children: ($$renderer) => {
|
|
349
|
+
$$renderer.push(`<!---->Copy key`);
|
|
350
|
+
},
|
|
351
|
+
$$slots: { default: true }
|
|
352
|
+
});
|
|
353
|
+
$$renderer.push(`<!----></div>`);
|
|
354
|
+
} else $$renderer.push("<!--[-1-->");
|
|
355
|
+
$$renderer.push(`<!--]--> `);
|
|
356
|
+
if (error) {
|
|
357
|
+
$$renderer.push("<!--[0-->");
|
|
358
|
+
$$renderer.push(`<p class="text-sm text-destructive" role="alert">${$.escape(error)}</p>`);
|
|
359
|
+
} else $$renderer.push("<!--[-1-->");
|
|
360
|
+
$$renderer.push(`<!--]--> `);
|
|
361
|
+
if (loading) {
|
|
362
|
+
$$renderer.push("<!--[0-->");
|
|
363
|
+
$$renderer.push(`<p class="text-sm text-muted-foreground">Loading API access…</p>`);
|
|
364
|
+
} else {
|
|
365
|
+
$$renderer.push("<!--[-1-->");
|
|
366
|
+
$$renderer.push(`<div class="max-h-72 space-y-5 overflow-y-auto pr-1" aria-label="API key management list"><section class="space-y-2"><h3 class="text-sm font-semibold">Global keys</h3> `);
|
|
367
|
+
const each_array = $.ensure_array_like(globalKeys());
|
|
368
|
+
if (each_array.length !== 0) {
|
|
369
|
+
$$renderer.push("<!--[-->");
|
|
370
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
371
|
+
let key = each_array[$$index];
|
|
372
|
+
$$renderer.push(`<div class="flex items-center justify-between rounded-md border p-3 text-sm"><div><div class="font-medium">${$.escape(key.name)}</div><div class="text-muted-foreground">${$.escape(key.prefix)}…</div></div> `);
|
|
373
|
+
Button($$renderer, {
|
|
374
|
+
size: "sm",
|
|
375
|
+
variant: "destructive",
|
|
376
|
+
onclick: () => revoke(key.id),
|
|
377
|
+
disabled: busy,
|
|
378
|
+
children: ($$renderer) => {
|
|
379
|
+
$$renderer.push(`<!---->Revoke`);
|
|
380
|
+
},
|
|
381
|
+
$$slots: { default: true }
|
|
382
|
+
});
|
|
383
|
+
$$renderer.push(`<!----></div>`);
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
$$renderer.push("<!--[!-->");
|
|
387
|
+
$$renderer.push(`<p class="text-sm text-muted-foreground">No global API keys.</p>`);
|
|
388
|
+
}
|
|
389
|
+
$$renderer.push(`<!--]--></section> <section class="space-y-2"><h3 class="text-sm font-semibold">Category keys</h3> `);
|
|
390
|
+
const each_array_1 = $.ensure_array_like(categoryKeys());
|
|
391
|
+
if (each_array_1.length !== 0) {
|
|
392
|
+
$$renderer.push("<!--[-->");
|
|
393
|
+
for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
|
|
394
|
+
let key = each_array_1[$$index_1];
|
|
395
|
+
$$renderer.push(`<div class="flex items-center justify-between gap-3 rounded-md border border-dashed p-3 text-sm"><div><div class="font-medium">${$.escape(categoryName(categoryIdFromScopes(key.scopes)))}: ${$.escape(key.name)}</div><div class="text-muted-foreground">${$.escape(key.prefix)}… · ${$.escape(key.scopes.map((scope) => scope.split(":").at(-1)).join(" / "))}</div></div> <div class="flex shrink-0 gap-2">`);
|
|
396
|
+
Button($$renderer, {
|
|
397
|
+
size: "sm",
|
|
398
|
+
variant: "outline",
|
|
399
|
+
onclick: () => copyKey(key),
|
|
400
|
+
disabled: !key.recoverable && !issuedKeys[key.id],
|
|
401
|
+
children: ($$renderer) => {
|
|
402
|
+
$$renderer.push(`<!---->${$.escape(key.recoverable || issuedKeys[key.id] ? "Copy key" : "Rotate to enable copy")}`);
|
|
403
|
+
},
|
|
404
|
+
$$slots: { default: true }
|
|
405
|
+
});
|
|
406
|
+
$$renderer.push(`<!----> `);
|
|
407
|
+
Button($$renderer, {
|
|
408
|
+
size: "sm",
|
|
409
|
+
variant: "destructive",
|
|
410
|
+
onclick: () => revoke(key.id),
|
|
411
|
+
disabled: busy,
|
|
412
|
+
children: ($$renderer) => {
|
|
413
|
+
$$renderer.push(`<!---->Revoke`);
|
|
414
|
+
},
|
|
415
|
+
$$slots: { default: true }
|
|
416
|
+
});
|
|
417
|
+
$$renderer.push(`<!----></div></div>`);
|
|
418
|
+
}
|
|
419
|
+
} else {
|
|
420
|
+
$$renderer.push("<!--[!-->");
|
|
421
|
+
$$renderer.push(`<p class="text-sm text-muted-foreground">No category API keys.</p>`);
|
|
422
|
+
}
|
|
423
|
+
$$renderer.push(`<!--]--></section></div>`);
|
|
424
|
+
}
|
|
425
|
+
$$renderer.push(`<!--]--></div>`);
|
|
426
|
+
}
|
|
427
|
+
do {
|
|
428
|
+
$$settled = true;
|
|
429
|
+
$$inner_renderer = $$renderer.copy();
|
|
430
|
+
$$render_inner($$inner_renderer);
|
|
431
|
+
} while (!$$settled);
|
|
432
|
+
$$renderer.subsume($$inner_renderer);
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/lib/offline/cleanup.ts
|
|
437
|
+
/**
|
|
438
|
+
* Wipe all offline data for the current identity. Called on logout so a
|
|
439
|
+
* shared browser never leaks one user's cached documents, drafts, or queued
|
|
440
|
+
* mutations to the next user.
|
|
441
|
+
*
|
|
442
|
+
* Best-effort: failures are logged but never thrown, so logout always
|
|
443
|
+
* completes.
|
|
444
|
+
*/
|
|
445
|
+
async function cleanupOfflineData() {
|
|
446
|
+
let identity = null;
|
|
447
|
+
try {
|
|
448
|
+
identity = await resolveOfflineIdentity();
|
|
449
|
+
} catch {} finally {
|
|
450
|
+
disableOfflineAccess();
|
|
451
|
+
}
|
|
452
|
+
const cachePrefix = `hiai-docs::hiai-docs-pwa-local::pwa-v1`;
|
|
453
|
+
try {
|
|
454
|
+
if (identity) try {
|
|
455
|
+
const db = getOfflineDB(identity);
|
|
456
|
+
await Promise.allSettled([
|
|
457
|
+
db.documents.clear(),
|
|
458
|
+
db.folders.clear(),
|
|
459
|
+
db.drafts.clear(),
|
|
460
|
+
db.mutationQueue?.clear(),
|
|
461
|
+
db.metadata.clear()
|
|
462
|
+
]);
|
|
463
|
+
} finally {
|
|
464
|
+
await deleteOfflineDB(identity).catch(() => void 0);
|
|
465
|
+
}
|
|
466
|
+
const cacheNames = await caches.keys();
|
|
467
|
+
await Promise.all(cacheNames.filter((name) => name.startsWith(`${cachePrefix}::`) || name.startsWith(`${cachePrefix}-`)).map((name) => caches.delete(name)));
|
|
468
|
+
if ("serviceWorker" in navigator) (await navigator.serviceWorker.getRegistration("/"))?.active?.postMessage({
|
|
469
|
+
type: "CLEAR_HOST_CACHES",
|
|
470
|
+
cachePrefix
|
|
471
|
+
});
|
|
472
|
+
} catch {}
|
|
473
|
+
}
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/lib/stores/editor-preferences.ts
|
|
476
|
+
var DEFAULT_EDITOR_PREFERENCES = {
|
|
477
|
+
showVisualMode: true,
|
|
478
|
+
showMarkdownMode: true,
|
|
479
|
+
minimalToolbar: false,
|
|
480
|
+
showScrollToTop: true
|
|
481
|
+
};
|
|
482
|
+
function normalizeEditorPreferences(value) {
|
|
483
|
+
if (!value || typeof value !== "object") return { ...DEFAULT_EDITOR_PREFERENCES };
|
|
484
|
+
const candidate = value;
|
|
485
|
+
const requestedVisualMode = typeof candidate.showVisualMode === "boolean" ? candidate.showVisualMode : DEFAULT_EDITOR_PREFERENCES.showVisualMode;
|
|
486
|
+
const showMarkdownMode = typeof candidate.showMarkdownMode === "boolean" ? candidate.showMarkdownMode : DEFAULT_EDITOR_PREFERENCES.showMarkdownMode;
|
|
487
|
+
return {
|
|
488
|
+
showVisualMode: requestedVisualMode || !showMarkdownMode,
|
|
489
|
+
showMarkdownMode,
|
|
490
|
+
minimalToolbar: typeof candidate.minimalToolbar === "boolean" ? candidate.minimalToolbar : DEFAULT_EDITOR_PREFERENCES.minimalToolbar,
|
|
491
|
+
showScrollToTop: typeof candidate.showScrollToTop === "boolean" ? candidate.showScrollToTop : DEFAULT_EDITOR_PREFERENCES.showScrollToTop
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/lib/stores/editor-preferences.svelte.ts
|
|
496
|
+
var STORAGE_KEY = "docsmint-editor-preferences";
|
|
497
|
+
var preferences$1 = { ...DEFAULT_EDITOR_PREFERENCES };
|
|
498
|
+
var initialized$1 = false;
|
|
499
|
+
function isBrowser() {
|
|
500
|
+
return typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
501
|
+
}
|
|
502
|
+
function init$1() {
|
|
503
|
+
if (!isBrowser() || initialized$1) return;
|
|
504
|
+
initialized$1 = true;
|
|
505
|
+
try {
|
|
506
|
+
preferences$1 = normalizeEditorPreferences(JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "null"));
|
|
507
|
+
} catch {
|
|
508
|
+
preferences$1 = { ...DEFAULT_EDITOR_PREFERENCES };
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function update$1(patch) {
|
|
512
|
+
preferences$1 = normalizeEditorPreferences({
|
|
513
|
+
...preferences$1,
|
|
514
|
+
...patch
|
|
515
|
+
});
|
|
516
|
+
if (isBrowser()) localStorage.setItem(STORAGE_KEY, JSON.stringify(preferences$1));
|
|
517
|
+
}
|
|
518
|
+
var editorPreferences = {
|
|
519
|
+
get value() {
|
|
520
|
+
return preferences$1;
|
|
521
|
+
},
|
|
522
|
+
get showMarkdownMode() {
|
|
523
|
+
return preferences$1.showMarkdownMode;
|
|
524
|
+
},
|
|
525
|
+
get showVisualMode() {
|
|
526
|
+
return preferences$1.showVisualMode;
|
|
527
|
+
},
|
|
528
|
+
get minimalToolbar() {
|
|
529
|
+
return preferences$1.minimalToolbar;
|
|
530
|
+
},
|
|
531
|
+
get showScrollToTop() {
|
|
532
|
+
return preferences$1.showScrollToTop;
|
|
533
|
+
},
|
|
534
|
+
init: init$1,
|
|
535
|
+
update: update$1
|
|
536
|
+
};
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region src/lib/stores/search-preferences.svelte.ts
|
|
539
|
+
var initialized = false;
|
|
540
|
+
var preferences = { ...DEFAULT_SEARCH_PREFERENCES };
|
|
541
|
+
function persist() {
|
|
542
|
+
if (typeof localStorage === "undefined") return;
|
|
543
|
+
try {
|
|
544
|
+
localStorage.setItem(SEARCH_PREFERENCES_KEY, JSON.stringify(preferences));
|
|
545
|
+
} catch {}
|
|
546
|
+
}
|
|
547
|
+
function init() {
|
|
548
|
+
if (initialized || typeof window === "undefined") return;
|
|
549
|
+
initialized = true;
|
|
550
|
+
try {
|
|
551
|
+
preferences = normalizeSearchPreferences(JSON.parse(localStorage.getItem("docsmint:search-preferences") ?? "null"));
|
|
552
|
+
} catch {
|
|
553
|
+
preferences = { ...DEFAULT_SEARCH_PREFERENCES };
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
function update(next) {
|
|
557
|
+
preferences = {
|
|
558
|
+
...preferences,
|
|
559
|
+
...next
|
|
560
|
+
};
|
|
561
|
+
persist();
|
|
562
|
+
}
|
|
563
|
+
var searchPreferences = {
|
|
564
|
+
get graphSearchEnabled() {
|
|
565
|
+
return preferences.graphSearchEnabled;
|
|
566
|
+
},
|
|
567
|
+
init,
|
|
568
|
+
update
|
|
569
|
+
};
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/lib/components/SettingsDialog.svelte
|
|
572
|
+
function SettingsDialog($$renderer, $$props) {
|
|
573
|
+
$$renderer.component(($$renderer) => {
|
|
574
|
+
let { open = false } = $$props;
|
|
575
|
+
let activeTab = "profile";
|
|
576
|
+
const frontendExtensions = getFrontendExtensions();
|
|
577
|
+
const settingsExtensions = $.derived(() => resolveExtensions(frontendExtensions.settingsSections, { pathname: page.url.pathname }));
|
|
578
|
+
let name = "";
|
|
579
|
+
let email = "";
|
|
580
|
+
let currentPassword = "";
|
|
581
|
+
let newPassword = "";
|
|
582
|
+
let confirmPassword = "";
|
|
583
|
+
onMount(async () => {
|
|
584
|
+
editorPreferences.init();
|
|
585
|
+
searchPreferences.init();
|
|
586
|
+
try {
|
|
587
|
+
const profile = await getProfile();
|
|
588
|
+
if (profile.name) name = profile.name;
|
|
589
|
+
if (profile.email) {
|
|
590
|
+
email = profile.email;
|
|
591
|
+
profile.email;
|
|
592
|
+
}
|
|
593
|
+
} catch {}
|
|
594
|
+
});
|
|
595
|
+
const themeOptions = [
|
|
596
|
+
{
|
|
597
|
+
value: "light",
|
|
598
|
+
label: theme_light(),
|
|
599
|
+
key: "light"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
value: "dark",
|
|
603
|
+
label: theme_dark(),
|
|
604
|
+
key: "dark"
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
value: "system",
|
|
608
|
+
label: theme_system(),
|
|
609
|
+
key: "system"
|
|
610
|
+
}
|
|
611
|
+
];
|
|
612
|
+
let loggingOut = false;
|
|
613
|
+
async function handleLogout() {
|
|
614
|
+
loggingOut = true;
|
|
615
|
+
try {
|
|
616
|
+
await cleanupOfflineData();
|
|
617
|
+
await signOut();
|
|
618
|
+
open = false;
|
|
619
|
+
goto("/login");
|
|
620
|
+
} catch {
|
|
621
|
+
loggingOut = false;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function close() {
|
|
625
|
+
open = false;
|
|
626
|
+
}
|
|
627
|
+
let $$settled = true;
|
|
628
|
+
let $$inner_renderer;
|
|
629
|
+
function $$render_inner($$renderer) {
|
|
630
|
+
if (Dialog) {
|
|
631
|
+
$$renderer.push("<!--[-->");
|
|
632
|
+
Dialog($$renderer, {
|
|
633
|
+
get open() {
|
|
634
|
+
return open;
|
|
635
|
+
},
|
|
636
|
+
set open($$value) {
|
|
637
|
+
open = $$value;
|
|
638
|
+
$$settled = false;
|
|
639
|
+
},
|
|
640
|
+
children: ($$renderer) => {
|
|
641
|
+
if (Dialog_header) {
|
|
642
|
+
$$renderer.push("<!--[-->");
|
|
643
|
+
Dialog_header($$renderer, {
|
|
644
|
+
children: ($$renderer) => {
|
|
645
|
+
if (Dialog_title) {
|
|
646
|
+
$$renderer.push("<!--[-->");
|
|
647
|
+
Dialog_title($$renderer, {
|
|
648
|
+
children: ($$renderer) => {
|
|
649
|
+
$$renderer.push(`<!---->${$.escape(settings_title())}`);
|
|
650
|
+
},
|
|
651
|
+
$$slots: { default: true }
|
|
652
|
+
});
|
|
653
|
+
$$renderer.push("<!--]-->");
|
|
654
|
+
} else {
|
|
655
|
+
$$renderer.push("<!--[!-->");
|
|
656
|
+
$$renderer.push("<!--]-->");
|
|
657
|
+
}
|
|
658
|
+
$$renderer.push(` `);
|
|
659
|
+
if (Dialog_description) {
|
|
660
|
+
$$renderer.push("<!--[-->");
|
|
661
|
+
Dialog_description($$renderer, {
|
|
662
|
+
children: ($$renderer) => {
|
|
663
|
+
$$renderer.push(`<!---->${$.escape(settings_account())}`);
|
|
664
|
+
},
|
|
665
|
+
$$slots: { default: true }
|
|
666
|
+
});
|
|
667
|
+
$$renderer.push("<!--]-->");
|
|
668
|
+
} else {
|
|
669
|
+
$$renderer.push("<!--[!-->");
|
|
670
|
+
$$renderer.push("<!--]-->");
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
$$slots: { default: true }
|
|
674
|
+
});
|
|
675
|
+
$$renderer.push("<!--]-->");
|
|
676
|
+
} else {
|
|
677
|
+
$$renderer.push("<!--[!-->");
|
|
678
|
+
$$renderer.push("<!--]-->");
|
|
679
|
+
}
|
|
680
|
+
$$renderer.push(` `);
|
|
681
|
+
if (Tabs) {
|
|
682
|
+
$$renderer.push("<!--[-->");
|
|
683
|
+
Tabs($$renderer, {
|
|
684
|
+
class: "w-full",
|
|
685
|
+
get value() {
|
|
686
|
+
return activeTab;
|
|
687
|
+
},
|
|
688
|
+
set value($$value) {
|
|
689
|
+
activeTab = $$value;
|
|
690
|
+
$$settled = false;
|
|
691
|
+
},
|
|
692
|
+
children: ($$renderer) => {
|
|
693
|
+
if (Tabs_list) {
|
|
694
|
+
$$renderer.push("<!--[-->");
|
|
695
|
+
Tabs_list($$renderer, {
|
|
696
|
+
class: "grid w-full grid-cols-[repeat(auto-fit,minmax(0,1fr))] gap-1",
|
|
697
|
+
children: ($$renderer) => {
|
|
698
|
+
if (Tabs_trigger) {
|
|
699
|
+
$$renderer.push("<!--[-->");
|
|
700
|
+
Tabs_trigger($$renderer, {
|
|
701
|
+
value: "profile",
|
|
702
|
+
selected: activeTab === "profile",
|
|
703
|
+
onclick: (v) => activeTab = v,
|
|
704
|
+
children: ($$renderer) => {
|
|
705
|
+
$$renderer.push(`<!---->${$.escape(settings_profile())}`);
|
|
706
|
+
},
|
|
707
|
+
$$slots: { default: true }
|
|
708
|
+
});
|
|
709
|
+
$$renderer.push("<!--]-->");
|
|
710
|
+
} else {
|
|
711
|
+
$$renderer.push("<!--[!-->");
|
|
712
|
+
$$renderer.push("<!--]-->");
|
|
713
|
+
}
|
|
714
|
+
$$renderer.push(` `);
|
|
715
|
+
if (Tabs_trigger) {
|
|
716
|
+
$$renderer.push("<!--[-->");
|
|
717
|
+
Tabs_trigger($$renderer, {
|
|
718
|
+
value: "password",
|
|
719
|
+
selected: activeTab === "password",
|
|
720
|
+
onclick: (v) => activeTab = v,
|
|
721
|
+
children: ($$renderer) => {
|
|
722
|
+
$$renderer.push(`<!---->${$.escape(password_label())}`);
|
|
723
|
+
},
|
|
724
|
+
$$slots: { default: true }
|
|
725
|
+
});
|
|
726
|
+
$$renderer.push("<!--]-->");
|
|
727
|
+
} else {
|
|
728
|
+
$$renderer.push("<!--[!-->");
|
|
729
|
+
$$renderer.push("<!--]-->");
|
|
730
|
+
}
|
|
731
|
+
$$renderer.push(` `);
|
|
732
|
+
if (Tabs_trigger) {
|
|
733
|
+
$$renderer.push("<!--[-->");
|
|
734
|
+
Tabs_trigger($$renderer, {
|
|
735
|
+
value: "api",
|
|
736
|
+
selected: activeTab === "api",
|
|
737
|
+
onclick: (v) => activeTab = v,
|
|
738
|
+
children: ($$renderer) => {
|
|
739
|
+
$$renderer.push(`<!---->API`);
|
|
740
|
+
},
|
|
741
|
+
$$slots: { default: true }
|
|
742
|
+
});
|
|
743
|
+
$$renderer.push("<!--]-->");
|
|
744
|
+
} else {
|
|
745
|
+
$$renderer.push("<!--[!-->");
|
|
746
|
+
$$renderer.push("<!--]-->");
|
|
747
|
+
}
|
|
748
|
+
$$renderer.push(` `);
|
|
749
|
+
if (Tabs_trigger) {
|
|
750
|
+
$$renderer.push("<!--[-->");
|
|
751
|
+
Tabs_trigger($$renderer, {
|
|
752
|
+
value: "appearance",
|
|
753
|
+
selected: activeTab === "appearance",
|
|
754
|
+
onclick: (v) => activeTab = v,
|
|
755
|
+
children: ($$renderer) => {
|
|
756
|
+
$$renderer.push(`<!---->Style`);
|
|
757
|
+
},
|
|
758
|
+
$$slots: { default: true }
|
|
759
|
+
});
|
|
760
|
+
$$renderer.push("<!--]-->");
|
|
761
|
+
} else {
|
|
762
|
+
$$renderer.push("<!--[!-->");
|
|
763
|
+
$$renderer.push("<!--]-->");
|
|
764
|
+
}
|
|
765
|
+
$$renderer.push(` <!--[-->`);
|
|
766
|
+
const each_array = $.ensure_array_like(settingsExtensions());
|
|
767
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
768
|
+
let section = each_array[$$index];
|
|
769
|
+
if (Tabs_trigger) {
|
|
770
|
+
$$renderer.push("<!--[-->");
|
|
771
|
+
Tabs_trigger($$renderer, {
|
|
772
|
+
value: section.id,
|
|
773
|
+
selected: activeTab === section.id,
|
|
774
|
+
onclick: (value) => activeTab = value,
|
|
775
|
+
children: ($$renderer) => {
|
|
776
|
+
$$renderer.push(`<!---->${$.escape(section.label)}`);
|
|
777
|
+
},
|
|
778
|
+
$$slots: { default: true }
|
|
779
|
+
});
|
|
780
|
+
$$renderer.push("<!--]-->");
|
|
781
|
+
} else {
|
|
782
|
+
$$renderer.push("<!--[!-->");
|
|
783
|
+
$$renderer.push("<!--]-->");
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
$$renderer.push(`<!--]-->`);
|
|
787
|
+
},
|
|
788
|
+
$$slots: { default: true }
|
|
789
|
+
});
|
|
790
|
+
$$renderer.push("<!--]-->");
|
|
791
|
+
} else {
|
|
792
|
+
$$renderer.push("<!--[!-->");
|
|
793
|
+
$$renderer.push("<!--]-->");
|
|
794
|
+
}
|
|
795
|
+
$$renderer.push(` `);
|
|
796
|
+
if (Tabs_content) {
|
|
797
|
+
$$renderer.push("<!--[-->");
|
|
798
|
+
Tabs_content($$renderer, {
|
|
799
|
+
value: "profile",
|
|
800
|
+
currentValue: activeTab,
|
|
801
|
+
children: ($$renderer) => {
|
|
802
|
+
$$renderer.push(`<form class="space-y-4"><div class="space-y-2">`);
|
|
803
|
+
Label($$renderer, {
|
|
804
|
+
for: "settings-name",
|
|
805
|
+
children: ($$renderer) => {
|
|
806
|
+
$$renderer.push(`<!---->${$.escape(settings_name())}`);
|
|
807
|
+
},
|
|
808
|
+
$$slots: { default: true }
|
|
809
|
+
});
|
|
810
|
+
$$renderer.push(`<!----> `);
|
|
811
|
+
Input($$renderer, {
|
|
812
|
+
id: "settings-name",
|
|
813
|
+
type: "text",
|
|
814
|
+
name: "name",
|
|
815
|
+
autocomplete: "name",
|
|
816
|
+
get value() {
|
|
817
|
+
return name;
|
|
818
|
+
},
|
|
819
|
+
set value($$value) {
|
|
820
|
+
name = $$value;
|
|
821
|
+
$$settled = false;
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
$$renderer.push(`<!----></div> <div class="space-y-2">`);
|
|
825
|
+
Label($$renderer, {
|
|
826
|
+
for: "settings-email",
|
|
827
|
+
children: ($$renderer) => {
|
|
828
|
+
$$renderer.push(`<!---->${$.escape(settings_email())}`);
|
|
829
|
+
},
|
|
830
|
+
$$slots: { default: true }
|
|
831
|
+
});
|
|
832
|
+
$$renderer.push(`<!----> `);
|
|
833
|
+
Input($$renderer, {
|
|
834
|
+
id: "settings-email",
|
|
835
|
+
type: "email",
|
|
836
|
+
name: "email",
|
|
837
|
+
autocomplete: "email",
|
|
838
|
+
get value() {
|
|
839
|
+
return email;
|
|
840
|
+
},
|
|
841
|
+
set value($$value) {
|
|
842
|
+
email = $$value;
|
|
843
|
+
$$settled = false;
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
$$renderer.push(`<!----> <p class="text-xs text-muted-foreground">${$.escape(settings_email_change_warning())}</p> `);
|
|
847
|
+
$$renderer.push("<!--[-1-->");
|
|
848
|
+
$$renderer.push(`<!--]--></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">GraphRAG search</span> <span class="block text-xs text-muted-foreground">Use graph expansion for related documents. Disable it for faster standard RAG search.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": searchPreferences.graphSearchEnabled })}${$.attr("aria-checked", searchPreferences.graphSearchEnabled)} aria-label="Use GraphRAG search"><span class="svelte-1eaqpj"></span></button></div> `);
|
|
849
|
+
$$renderer.push("<!--[-1-->");
|
|
850
|
+
$$renderer.push(`<!--]--> `);
|
|
851
|
+
Button($$renderer, {
|
|
852
|
+
type: "submit",
|
|
853
|
+
disabled: false,
|
|
854
|
+
class: "w-full sm:w-auto",
|
|
855
|
+
children: ($$renderer) => {
|
|
856
|
+
$$renderer.push("<!--[-1-->");
|
|
857
|
+
Save($$renderer, { class: "mr-2 size-4" });
|
|
858
|
+
$$renderer.push(`<!--]--> ${$.escape(settings_save())}`);
|
|
859
|
+
},
|
|
860
|
+
$$slots: { default: true }
|
|
861
|
+
});
|
|
862
|
+
$$renderer.push(`<!----></form>`);
|
|
863
|
+
},
|
|
864
|
+
$$slots: { default: true }
|
|
865
|
+
});
|
|
866
|
+
$$renderer.push("<!--]-->");
|
|
867
|
+
} else {
|
|
868
|
+
$$renderer.push("<!--[!-->");
|
|
869
|
+
$$renderer.push("<!--]-->");
|
|
870
|
+
}
|
|
871
|
+
$$renderer.push(` `);
|
|
872
|
+
if (Tabs_content) {
|
|
873
|
+
$$renderer.push("<!--[-->");
|
|
874
|
+
Tabs_content($$renderer, {
|
|
875
|
+
value: "password",
|
|
876
|
+
currentValue: activeTab,
|
|
877
|
+
children: ($$renderer) => {
|
|
878
|
+
$$renderer.push(`<form class="space-y-4"><div class="space-y-2">`);
|
|
879
|
+
Label($$renderer, {
|
|
880
|
+
for: "settings-current-password",
|
|
881
|
+
children: ($$renderer) => {
|
|
882
|
+
$$renderer.push(`<!---->${$.escape(auth_password())}`);
|
|
883
|
+
},
|
|
884
|
+
$$slots: { default: true }
|
|
885
|
+
});
|
|
886
|
+
$$renderer.push(`<!----> `);
|
|
887
|
+
Input($$renderer, {
|
|
888
|
+
id: "settings-current-password",
|
|
889
|
+
type: "password",
|
|
890
|
+
name: "current-password",
|
|
891
|
+
autocomplete: "current-password",
|
|
892
|
+
get value() {
|
|
893
|
+
return currentPassword;
|
|
894
|
+
},
|
|
895
|
+
set value($$value) {
|
|
896
|
+
currentPassword = $$value;
|
|
897
|
+
$$settled = false;
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
$$renderer.push(`<!----></div> <div class="space-y-2">`);
|
|
901
|
+
Label($$renderer, {
|
|
902
|
+
for: "settings-new-password",
|
|
903
|
+
children: ($$renderer) => {
|
|
904
|
+
$$renderer.push(`<!---->${$.escape(new_password())}`);
|
|
905
|
+
},
|
|
906
|
+
$$slots: { default: true }
|
|
907
|
+
});
|
|
908
|
+
$$renderer.push(`<!----> `);
|
|
909
|
+
Input($$renderer, {
|
|
910
|
+
id: "settings-new-password",
|
|
911
|
+
type: "password",
|
|
912
|
+
name: "new-password",
|
|
913
|
+
autocomplete: "new-password",
|
|
914
|
+
get value() {
|
|
915
|
+
return newPassword;
|
|
916
|
+
},
|
|
917
|
+
set value($$value) {
|
|
918
|
+
newPassword = $$value;
|
|
919
|
+
$$settled = false;
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
$$renderer.push(`<!----></div> <div class="space-y-2">`);
|
|
923
|
+
Label($$renderer, {
|
|
924
|
+
for: "settings-confirm-password",
|
|
925
|
+
children: ($$renderer) => {
|
|
926
|
+
$$renderer.push(`<!---->${$.escape(confirm_password())}`);
|
|
927
|
+
},
|
|
928
|
+
$$slots: { default: true }
|
|
929
|
+
});
|
|
930
|
+
$$renderer.push(`<!----> `);
|
|
931
|
+
Input($$renderer, {
|
|
932
|
+
id: "settings-confirm-password",
|
|
933
|
+
type: "password",
|
|
934
|
+
name: "confirm-password",
|
|
935
|
+
autocomplete: "new-password",
|
|
936
|
+
get value() {
|
|
937
|
+
return confirmPassword;
|
|
938
|
+
},
|
|
939
|
+
set value($$value) {
|
|
940
|
+
confirmPassword = $$value;
|
|
941
|
+
$$settled = false;
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
$$renderer.push(`<!----></div> `);
|
|
945
|
+
$$renderer.push("<!--[-1-->");
|
|
946
|
+
$$renderer.push(`<!--]--> `);
|
|
947
|
+
Button($$renderer, {
|
|
948
|
+
type: "submit",
|
|
949
|
+
disabled: false,
|
|
950
|
+
class: "w-full sm:w-auto",
|
|
951
|
+
children: ($$renderer) => {
|
|
952
|
+
$$renderer.push("<!--[-1-->");
|
|
953
|
+
$$renderer.push(`<!--]--> ${$.escape(change_password())}`);
|
|
954
|
+
},
|
|
955
|
+
$$slots: { default: true }
|
|
956
|
+
});
|
|
957
|
+
$$renderer.push(`<!----></form>`);
|
|
958
|
+
},
|
|
959
|
+
$$slots: { default: true }
|
|
960
|
+
});
|
|
961
|
+
$$renderer.push("<!--]-->");
|
|
962
|
+
} else {
|
|
963
|
+
$$renderer.push("<!--[!-->");
|
|
964
|
+
$$renderer.push("<!--]-->");
|
|
965
|
+
}
|
|
966
|
+
$$renderer.push(` `);
|
|
967
|
+
if (Tabs_content) {
|
|
968
|
+
$$renderer.push("<!--[-->");
|
|
969
|
+
Tabs_content($$renderer, {
|
|
970
|
+
value: "appearance",
|
|
971
|
+
currentValue: activeTab,
|
|
972
|
+
children: ($$renderer) => {
|
|
973
|
+
$$renderer.push(`<div class="space-y-6"><div class="space-y-2">`);
|
|
974
|
+
Label($$renderer, {
|
|
975
|
+
children: ($$renderer) => {
|
|
976
|
+
$$renderer.push(`<!---->${$.escape(settings_theme())}`);
|
|
977
|
+
},
|
|
978
|
+
$$slots: { default: true }
|
|
979
|
+
});
|
|
980
|
+
$$renderer.push(`<!----> <p class="text-xs text-muted-foreground">${$.escape(settings_appearance())}</p></div> <div class="grid grid-cols-3 gap-2"><!--[-->`);
|
|
981
|
+
const each_array_1 = $.ensure_array_like(themeOptions);
|
|
982
|
+
for (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {
|
|
983
|
+
let opt = each_array_1[$$index_1];
|
|
984
|
+
$$renderer.push(`<button type="button"${$.attr_class($.clsx(["rounded-md border px-3 py-2 text-sm font-medium transition-colors", themeStore.value === opt.value ? "border-primary bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-accent hover:text-accent-foreground"].join(" ")), "svelte-1eaqpj")}>${$.escape(opt.label)}</button>`);
|
|
985
|
+
}
|
|
986
|
+
$$renderer.push(`<!--]--></div> <details class="editor-settings border-t pt-5 svelte-1eaqpj"><summary class="flex cursor-pointer items-center justify-between gap-3 rounded-md px-1 py-2 svelte-1eaqpj"><span><span class="block text-sm font-medium">Editor modes</span> <span class="block text-xs text-muted-foreground">Source views and toolbar layout</span></span> <span class="editor-settings-chevron svelte-1eaqpj" aria-hidden="true">⌄</span></summary> <div class="mt-3 space-y-3"><div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Visual editor</span> <span class="block text-xs text-muted-foreground">Show the standard WYSIWYG editor mode.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showVisualMode })}${$.attr("aria-checked", editorPreferences.showVisualMode)} aria-label="Show visual editor"${$.attr("disabled", !editorPreferences.showMarkdownMode, true)}><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Raw Markdown</span> <span class="block text-xs text-muted-foreground">Show the Markdown source button in documents.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showMarkdownMode })}${$.attr("aria-checked", editorPreferences.showMarkdownMode)} aria-label="Show Raw Markdown"${$.attr("disabled", !editorPreferences.showVisualMode, true)}><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Minimal toolbar</span> <span class="block text-xs text-muted-foreground">Bold, italic, underline, lists, highlight, and copy.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.minimalToolbar })}${$.attr("aria-checked", editorPreferences.minimalToolbar)} aria-label="Use minimal toolbar"><span class="svelte-1eaqpj"></span></button></div> <div class="flex items-center justify-between gap-4 rounded-md border p-3"><span><span class="block text-sm font-medium">Scroll to top</span> <span class="block text-xs text-muted-foreground">Show the floating arrow after scrolling down.</span></span> <button type="button" role="switch"${$.attr_class("preference-switch svelte-1eaqpj", void 0, { "enabled": editorPreferences.showScrollToTop })}${$.attr("aria-checked", editorPreferences.showScrollToTop)} aria-label="Show scroll to top"><span class="svelte-1eaqpj"></span></button></div></div></details></div>`);
|
|
987
|
+
},
|
|
988
|
+
$$slots: { default: true }
|
|
989
|
+
});
|
|
990
|
+
$$renderer.push("<!--]-->");
|
|
991
|
+
} else {
|
|
992
|
+
$$renderer.push("<!--[!-->");
|
|
993
|
+
$$renderer.push("<!--]-->");
|
|
994
|
+
}
|
|
995
|
+
$$renderer.push(` `);
|
|
996
|
+
if (Tabs_content) {
|
|
997
|
+
$$renderer.push("<!--[-->");
|
|
998
|
+
Tabs_content($$renderer, {
|
|
999
|
+
value: "api",
|
|
1000
|
+
currentValue: activeTab,
|
|
1001
|
+
children: ($$renderer) => {
|
|
1002
|
+
ApiAccessSettings($$renderer, {});
|
|
1003
|
+
},
|
|
1004
|
+
$$slots: { default: true }
|
|
1005
|
+
});
|
|
1006
|
+
$$renderer.push("<!--]-->");
|
|
1007
|
+
} else {
|
|
1008
|
+
$$renderer.push("<!--[!-->");
|
|
1009
|
+
$$renderer.push("<!--]-->");
|
|
1010
|
+
}
|
|
1011
|
+
$$renderer.push(` <!--[-->`);
|
|
1012
|
+
const each_array_2 = $.ensure_array_like(settingsExtensions());
|
|
1013
|
+
for (let $$index_2 = 0, $$length = each_array_2.length; $$index_2 < $$length; $$index_2++) {
|
|
1014
|
+
let section = each_array_2[$$index_2];
|
|
1015
|
+
if (Tabs_content) {
|
|
1016
|
+
$$renderer.push("<!--[-->");
|
|
1017
|
+
Tabs_content($$renderer, {
|
|
1018
|
+
value: section.id,
|
|
1019
|
+
currentValue: activeTab,
|
|
1020
|
+
children: ($$renderer) => {
|
|
1021
|
+
const Section = section.component;
|
|
1022
|
+
if (Section) {
|
|
1023
|
+
$$renderer.push("<!--[-->");
|
|
1024
|
+
Section($$renderer, {});
|
|
1025
|
+
$$renderer.push("<!--]-->");
|
|
1026
|
+
} else {
|
|
1027
|
+
$$renderer.push("<!--[!-->");
|
|
1028
|
+
$$renderer.push("<!--]-->");
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
$$slots: { default: true }
|
|
1032
|
+
});
|
|
1033
|
+
$$renderer.push("<!--]-->");
|
|
1034
|
+
} else {
|
|
1035
|
+
$$renderer.push("<!--[!-->");
|
|
1036
|
+
$$renderer.push("<!--]-->");
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
$$renderer.push(`<!--]-->`);
|
|
1040
|
+
},
|
|
1041
|
+
$$slots: { default: true }
|
|
1042
|
+
});
|
|
1043
|
+
$$renderer.push("<!--]-->");
|
|
1044
|
+
} else {
|
|
1045
|
+
$$renderer.push("<!--[!-->");
|
|
1046
|
+
$$renderer.push("<!--]-->");
|
|
1047
|
+
}
|
|
1048
|
+
$$renderer.push(` `);
|
|
1049
|
+
if (Dialog_footer) {
|
|
1050
|
+
$$renderer.push("<!--[-->");
|
|
1051
|
+
Dialog_footer($$renderer, {
|
|
1052
|
+
class: "settings-dialog-footer gap-4 max-sm:flex-col max-sm:items-stretch",
|
|
1053
|
+
children: ($$renderer) => {
|
|
1054
|
+
if (activeTab === "profile") {
|
|
1055
|
+
$$renderer.push("<!--[0-->");
|
|
1056
|
+
Button($$renderer, {
|
|
1057
|
+
id: "logout-button",
|
|
1058
|
+
variant: "ghost",
|
|
1059
|
+
onclick: handleLogout,
|
|
1060
|
+
disabled: loggingOut,
|
|
1061
|
+
class: "mr-auto text-muted-foreground hover:text-destructive max-sm:mr-0",
|
|
1062
|
+
children: ($$renderer) => {
|
|
1063
|
+
Log_out($$renderer, { class: "mr-2 size-4" });
|
|
1064
|
+
$$renderer.push(`<!----> ${$.escape(loggingOut ? "…" : auth_logout())}`);
|
|
1065
|
+
},
|
|
1066
|
+
$$slots: { default: true }
|
|
1067
|
+
});
|
|
1068
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1069
|
+
$$renderer.push(`<!--]--> `);
|
|
1070
|
+
Button($$renderer, {
|
|
1071
|
+
variant: "outline",
|
|
1072
|
+
onclick: close,
|
|
1073
|
+
class: "w-full sm:w-auto",
|
|
1074
|
+
children: ($$renderer) => {
|
|
1075
|
+
$$renderer.push(`<!---->${$.escape(action_close())}`);
|
|
1076
|
+
},
|
|
1077
|
+
$$slots: { default: true }
|
|
1078
|
+
});
|
|
1079
|
+
$$renderer.push(`<!---->`);
|
|
1080
|
+
},
|
|
1081
|
+
$$slots: { default: true }
|
|
1082
|
+
});
|
|
1083
|
+
$$renderer.push("<!--]-->");
|
|
1084
|
+
} else {
|
|
1085
|
+
$$renderer.push("<!--[!-->");
|
|
1086
|
+
$$renderer.push("<!--]-->");
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
$$slots: { default: true }
|
|
1090
|
+
});
|
|
1091
|
+
$$renderer.push("<!--]-->");
|
|
1092
|
+
} else {
|
|
1093
|
+
$$renderer.push("<!--[!-->");
|
|
1094
|
+
$$renderer.push("<!--]-->");
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
do {
|
|
1098
|
+
$$settled = true;
|
|
1099
|
+
$$inner_renderer = $$renderer.copy();
|
|
1100
|
+
$$render_inner($$inner_renderer);
|
|
1101
|
+
} while (!$$settled);
|
|
1102
|
+
$$renderer.subsume($$inner_renderer);
|
|
1103
|
+
$.bind_props($$props, { open });
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
//#endregion
|
|
1107
|
+
export { SettingsDialog as t };
|