@overvis/hmi-workspace-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/alarm-list-DKFio0hg.js +414 -0
  2. package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
  3. package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
  4. package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
  5. package/dist/alert-dialog-D_iDv2lQ.js +891 -0
  6. package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
  7. package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
  8. package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
  9. package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
  10. package/dist/dashboard-bindings.js +1 -2
  11. package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
  12. package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
  13. package/dist/diagnostic-text-CYZFPiND.js +116 -0
  14. package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
  15. package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
  16. package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
  17. package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
  18. package/dist/editor-page-CaN52OQh.js +1337 -0
  19. package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
  20. package/dist/entity-controls-DJT47yeV.js +71 -0
  21. package/dist/errors-BAWoH_5w.js +25 -0
  22. package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
  23. package/dist/host.js +8254 -675
  24. package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
  25. package/dist/i18n.js +1 -2
  26. package/dist/index.js +5168 -5353
  27. package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
  28. package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
  29. package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.js} +6 -6
  30. package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
  31. package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
  32. package/dist/{notice-card-DyGywFsW.js → notice-card-V_0K0lO0.js} +54 -58
  33. package/dist/page-B5te_1Lc.js +449 -0
  34. package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
  35. package/dist/page-DxF7FOve.js +507 -0
  36. package/dist/panel-DuZD-cBP.js +949 -0
  37. package/dist/parameter-values.js +3 -16
  38. package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
  39. package/dist/presence-code-DsabLTZs.js +73 -0
  40. package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
  41. package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
  42. package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
  43. package/dist/retention-note-CmMeHV_u.js +40 -0
  44. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  45. package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
  46. package/dist/run-text-CDdfbKbg.js +112 -0
  47. package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
  48. package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
  49. package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
  50. package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
  51. package/dist/src/code-editor/code-editor.d.ts +3 -0
  52. package/dist/src/code-editor/taskfile-language.d.ts +22 -2
  53. package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
  54. package/dist/src/i18n/catalogs/de.d.ts +3 -0
  55. package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
  56. package/dist/src/i18n/catalogs/en.d.ts +3 -0
  57. package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
  58. package/dist/src/i18n/catalogs/pl.d.ts +3 -0
  59. package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
  60. package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
  61. package/dist/src/i18n/catalogs/ru.d.ts +7 -4
  62. package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
  63. package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
  64. package/dist/src/i18n/catalogs/uk.d.ts +7 -4
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
  67. package/dist/src/workspace/local-workspace-app.d.ts +1 -1
  68. package/dist/src/workspace/routes.d.ts +1 -1
  69. package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
  70. package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
  71. package/dist/styles.css +1 -1
  72. package/dist/ui.js +334 -374
  73. package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
  74. package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
  75. package/package.json +15 -9
  76. package/dist/alarm-list-BL3xQ5Lf.js +0 -423
  77. package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
  78. package/dist/alert-B8MAoIO8.js +0 -45
  79. package/dist/alert-dialog-CYkuMg5D.js +0 -129
  80. package/dist/api-error-9rQmUN5L.js +0 -93
  81. package/dist/breadcrumb-DzVL1yHa.js +0 -74
  82. package/dist/button-6SxPBYMz.js +0 -44
  83. package/dist/context-u9KJQmdB.js +0 -102
  84. package/dist/copyable-id-DYGiAcnq.js +0 -40
  85. package/dist/dashboard-context-CBfG6DoT.js +0 -191
  86. package/dist/date-time-picker-C3FhMXk6.js +0 -266
  87. package/dist/diagnostic-text-BAkzW0SE.js +0 -111
  88. package/dist/diagnostic-text-DiKd2i1w.js +0 -76
  89. package/dist/dialog-BIhQXcZC.js +0 -237
  90. package/dist/dialog-BqyIxMD-.js +0 -54
  91. package/dist/dropdown-menu-DSzbBq3v.js +0 -136
  92. package/dist/editor-page-BiSZJz5b.js +0 -1353
  93. package/dist/empty-B-QJ-06w.js +0 -59
  94. package/dist/entity-controls-D1K4Ot3O.js +0 -76
  95. package/dist/errors-CcsvDHu8.js +0 -26
  96. package/dist/history-page-sAAhG54V.js +0 -1400
  97. package/dist/icon-D-pR9htW.js +0 -57
  98. package/dist/index-page-DMH82fZe.js +0 -214
  99. package/dist/item-B5SaTFQU.js +0 -120
  100. package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
  101. package/dist/mutations-THtGG6Ai.js +0 -240
  102. package/dist/page-2KPemaAj.js +0 -328
  103. package/dist/page-6rIoTg2L.js +0 -459
  104. package/dist/page-C6giEoEd.js +0 -1935
  105. package/dist/page-DCbTxKsi.js +0 -313
  106. package/dist/page-DWO427hT.js +0 -208
  107. package/dist/page-LXu_2zm3.js +0 -137
  108. package/dist/page-aaUiVOnk.js +0 -513
  109. package/dist/page-header-RB2YFWlE.js +0 -55
  110. package/dist/page-title-CdCbiLt8.js +0 -14
  111. package/dist/panel-DDy8tUNR.js +0 -338
  112. package/dist/presence-code-BfSXr50g.js +0 -83
  113. package/dist/progress-C7cxNJA1.js +0 -83
  114. package/dist/provider-BOeYHi0n.js +0 -134
  115. package/dist/quick-report-CUVJnbKP.js +0 -416
  116. package/dist/radio-group-CZGqVbkJ.js +0 -26
  117. package/dist/retention-note-CHhA6gjY.js +0 -42
  118. package/dist/run-text-DvaO8LDF.js +0 -113
  119. package/dist/select-eNgZdZ30.js +0 -521
  120. package/dist/skeleton-6yk8Tdh5.js +0 -19
  121. package/dist/slider-DorDsoF8.js +0 -37
  122. package/dist/status-page-DAHiKM9P.js +0 -3286
  123. package/dist/switch-BqD0RH_G.js +0 -18
  124. package/dist/table-Q2-voLuw.js +0 -65
  125. package/dist/tabs-CSIucYFP.js +0 -57
  126. package/dist/theme-provider-BkRohQFU.js +0 -61
  127. package/dist/toggle-group-9Bs0Mm3r.js +0 -82
  128. package/dist/trpc-CvJUuUXp.js +0 -153
  129. package/dist/utils-CX-Pz5p6.js +0 -8
  130. package/dist/writability-BuH-spxv.js +0 -57
@@ -1,1400 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { r as t } from "./trpc-CvJUuUXp.js";
3
- import { f as n, m as r } from "./i18n-BgzakKoC.js";
4
- import { a as i, d as a, t as o } from "./mutation-form-validators-BNz5bsv1.js";
5
- import { A as s, M as c, V as l, c as u, l as d } from "./spinner-C-HPNxOc.js";
6
- import { t as f } from "./button-6SxPBYMz.js";
7
- import { a as p, i as m, l as h, o as g, r as _, t as v } from "./dialog-BIhQXcZC.js";
8
- import { n as y } from "./skeleton-6yk8Tdh5.js";
9
- import { n as b, t as x } from "./api-error-9rQmUN5L.js";
10
- import { c as S, i as C, n as w, o as T, s as E, t as D } from "./table-Q2-voLuw.js";
11
- import { i as O, r as k, t as A } from "./alert-B8MAoIO8.js";
12
- import { n as ee, t as te } from "./toggle-group-9Bs0Mm3r.js";
13
- import { r as j } from "./mutations-THtGG6Ai.js";
14
- import { a as M, h as ne, r as N, t as P } from "./dropdown-menu-DSzbBq3v.js";
15
- import { a as F, d as I, i as L, o as R, r as re, s as ie, t as ae } from "./alert-dialog-CYkuMg5D.js";
16
- import { n as oe } from "./date-time-picker-C3FhMXk6.js";
17
- import { t as se } from "./page-header-RB2YFWlE.js";
18
- import { r as z, t as B } from "./query-gate-DVhNIkge.js";
19
- import { t as ce } from "./breadcrumbs-0cjsV2cq.js";
20
- import { a as le, t as ue } from "./presence-code-BfSXr50g.js";
21
- import { Fragment as V, useEffect as H, useRef as U, useState as W } from "react";
22
- import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
23
- import de from "typebox";
24
- import { BotIcon as fe, CheckIcon as pe, ChevronRightIcon as me, CogIcon as he, DownloadIcon as ge, FlagIcon as _e, HistoryIcon as ve, KeyRoundIcon as ye, Loader2Icon as be, MoreHorizontalIcon as xe, TriangleAlertIcon as Se, UserIcon as Ce, WorkflowIcon as we, XIcon as Te } from "lucide-react";
25
- import { formatAppDateTime as J, parseExactAppDateTime as Ee, schema as De } from "@overvis/hmi-shared";
26
- //#region src/audit/checkpoint-presentation.ts
27
- function Oe(e) {
28
- switch (e) {
29
- case "named": return n("checkpoint_kind_named");
30
- case "before_push": return n("checkpoint_kind_before_push");
31
- case "before_assistant_turn": return n("checkpoint_kind_before_assistant_turn");
32
- case "before_template": return n("checkpoint_kind_before_template");
33
- case "before_import": return n("checkpoint_kind_before_import");
34
- case "before_revert": return n("checkpoint_kind_before_revert");
35
- case "before_bulk_delete": return n("checkpoint_kind_before_bulk_delete");
36
- case "daily": return n("checkpoint_kind_daily");
37
- }
38
- }
39
- //#endregion
40
- //#region src/audit/history-presentation.ts
41
- var ke = [
42
- "label",
43
- "title",
44
- "name",
45
- "email",
46
- "path"
47
- ], Ae = [
48
- "uk",
49
- "pl",
50
- "ru"
51
- ], je = [
52
- "ui",
53
- "assistant",
54
- "api",
55
- "auth",
56
- "http",
57
- "admin",
58
- "system",
59
- "pmapper",
60
- "automation-runner"
61
- ];
62
- function Y(e, t) {
63
- if (!(typeof e != "object" || !e || Array.isArray(e))) return Object.entries(e).find(([e]) => e === t)?.[1];
64
- }
65
- function Me(e) {
66
- if (typeof e == "string") return e.trim() === "" ? null : e;
67
- if (typeof e != "object" || !e || Array.isArray(e)) return null;
68
- let t = Y(e, "en");
69
- if (typeof t == "string" && t.trim() !== "") return t;
70
- for (let t of Ae) {
71
- let n = Y(e, t);
72
- if (typeof n == "string" && n.trim() !== "") return n;
73
- }
74
- return null;
75
- }
76
- function Ne(e) {
77
- for (let t of ke) {
78
- let n = Me(Y(e, t));
79
- if (n != null) return n;
80
- }
81
- return null;
82
- }
83
- function X(e) {
84
- return Me(e.targetName) ?? Ne(e.after) ?? Ne(e.before);
85
- }
86
- function Pe(e) {
87
- return typeof e == "object" && !!e && !Array.isArray(e);
88
- }
89
- var Fe = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, Ie = /(_at|_since|_until|At|Since|Until)$/;
90
- function Le(e, t, n) {
91
- if (Pe(e) && Object.keys(e).length > 0) {
92
- for (let [r, i] of Object.entries(e)) Le(i, [...t, r], n);
93
- return;
94
- }
95
- t.length === 0 && (e == null || Pe(e)) || n.set(JSON.stringify(t), {
96
- path: t,
97
- value: e
98
- });
99
- }
100
- function Re(e) {
101
- return e.map((e, t) => /^[^.[\]"]+$/.test(e) ? t === 0 ? e : `.${e}` : `[${JSON.stringify(e)}]`).join("");
102
- }
103
- function Z(e, t) {
104
- if (typeof e == "string") {
105
- let n = t.length === 1 ? t[0] : void 0, r = n != null && Ie.test(n) ? Fe.exec(e) : null;
106
- return r == null ? e : J(r[2] == null ? `${e}Z` : e);
107
- }
108
- return typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e);
109
- }
110
- function ze(e, t) {
111
- for (let [n, r] of e) Pe(r.value) && [...t.values()].some((e) => e.path.length > r.path.length && r.path.every((t, n) => e.path[n] === t)) && e.delete(n);
112
- }
113
- function Be(e) {
114
- let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
115
- Le(e.before, [], t), Le(e.after, [], n), ze(t, n), ze(n, t);
116
- let r = [];
117
- for (let e of /* @__PURE__ */ new Set([...t.keys(), ...n.keys()])) {
118
- let i = t.get(e), a = n.get(e), o = (i ?? a)?.path ?? [];
119
- if (i == null || a == null) {
120
- r.push({
121
- path: o,
122
- before: i == null ? null : Z(i.value, o),
123
- after: a == null ? null : Z(a.value, o)
124
- });
125
- continue;
126
- }
127
- let s = JSON.stringify(i.value), c = JSON.stringify(a.value);
128
- if (s === c) continue;
129
- let l = Z(i.value, o), u = Z(a.value, o);
130
- r.push(l === u ? {
131
- path: o,
132
- before: s,
133
- after: c
134
- } : {
135
- path: o,
136
- before: l,
137
- after: u
138
- });
139
- }
140
- return r;
141
- }
142
- function Ve(e) {
143
- return Be(e).map(({ path: e, before: t, after: n }) => ({
144
- field: Re(e),
145
- before: t,
146
- after: n
147
- }));
148
- }
149
- function He(e) {
150
- if (e.operation === "write") {
151
- let t = Y(e.after, "requested"), n = Y(t, "value");
152
- if (typeof n == "string") return `= ${n}`;
153
- let r = Y(t, "rawHex");
154
- return typeof r == "string" ? `= 0x${r}` : null;
155
- }
156
- if (e.operation === "call") {
157
- let t = Y(e.after, "operation");
158
- return typeof t == "string" ? t : null;
159
- }
160
- if (e.operation === "delete" && (e.targetType === "readings" || e.targetType === "audit_history" || e.targetType === "alarm_log")) {
161
- let t = Y(e.after, "records");
162
- return typeof t == "number" ? Y(e.after, "completed") === !1 ? e.targetType === "readings" ? n("audit_storage_records_incomplete", { count: String(t) }) : n("audit_storage_records_stopped", { count: String(t) }) : n("audit_storage_records_deleted", { count: String(t) }) : null;
163
- }
164
- if (e.operation !== "update") return null;
165
- let t = Be(e), r = t.length === 1 ? t[0] : void 0;
166
- if (r != null) return `${Re(r.path)}: ${r.before ?? "—"} → ${r.after ?? "—"}`;
167
- let i = [...new Set(t.map((e) => Re(e.path.slice(0, 1))))];
168
- return i.length === 0 ? null : i.join(", ");
169
- }
170
- function Q(e) {
171
- return e === "workspace" ? n("audit_target_type_workspace") : e === "workspace_permission" ? n("audit_target_type_workspace_permission") : e === "workspace_invitation" ? n("audit_target_type_workspace_invitation") : e === "workspace_file" ? n("audit_target_type_workspace_file") : e === "dashboard" ? n("audit_target_type_dashboard") : e === "endpoint" ? n("audit_target_type_endpoint") : e === "device_api" ? n("audit_target_type_device_api") : e === "readings" ? n("audit_target_type_readings") : e === "audit_history" ? n("audit_target_type_audit_history") : e === "alarm_log" ? n("audit_target_type_alarm_log") : e === "readings_retention_override" ? n("audit_target_type_readings_retention_override") : e === "edge_program" ? n("audit_target_type_edge_program") : e === "parameter_tree_branch" ? n("audit_target_type_parameter_tree_branch") : e === "parameter" ? n("audit_target_type_parameter") : e === "report_preset" ? n("audit_target_type_report_preset") : e === "report_preset_parameter" ? n("audit_target_type_report_preset_parameter") : e === "report_comment" ? n("audit_target_type_report_comment") : e === "alarm_rule" ? n("audit_target_type_alarm_rule") : e === "automation" ? n("audit_target_type_automation") : e === "workspace_billing_link" ? n("audit_target_type_workspace_billing_link") : e === "workspace_suspension" ? n("audit_target_type_workspace_suspension") : e === "user" ? n("audit_target_type_user") : e === "account" ? n("audit_target_type_account") : e === "api_key" ? n("audit_target_type_api_key") : e === "impersonation_grant" ? n("audit_target_type_impersonation_grant") : e === "session" ? n("audit_target_type_support_session") : e === "audit_probe" ? n("audit_target_type_audit_probe") : e;
172
- }
173
- function Ue(e) {
174
- return X(e) ?? Q(e.targetType);
175
- }
176
- function We(e) {
177
- return e === "ui" ? n("audit_origin_ui") : e === "assistant" ? n("audit_origin_assistant") : e === "api" ? n("audit_origin_api") : e === "auth" ? n("audit_origin_auth") : e === "http" ? n("audit_origin_http") : e === "admin" ? n("audit_origin_admin") : e === "system" ? n("audit_origin_system") : e === "pmapper" ? n("audit_origin_pmapper") : e === "automation-runner" ? n("audit_origin_automation_runner") : e;
178
- }
179
- function Ge(e) {
180
- return je.find((t) => t === e);
181
- }
182
- //#endregion
183
- //#region src/audit/revert-device-confirmation.tsx
184
- function Ke({ name: e, onCode: t }) {
185
- let n = r(), [i, a] = W(""), [o, s] = W(!1);
186
- return /* @__PURE__ */ q("form", {
187
- className: "\n flex flex-col gap-2\n sm:flex-row sm:items-start\n ",
188
- onSubmit: (e) => {
189
- e.preventDefault();
190
- let n = ue(i);
191
- if (!n.ok || n.code == null) {
192
- s(!0);
193
- return;
194
- }
195
- s(!1), t(n.code);
196
- },
197
- children: [/* @__PURE__ */ q("div", {
198
- className: "flex min-w-0 flex-1 flex-col gap-1",
199
- children: [/* @__PURE__ */ K(u, {
200
- value: i,
201
- onChange: (e) => {
202
- a(e.target.value);
203
- },
204
- "aria-label": `${n("endpoint_presence_code_label")}: ${e}`,
205
- "aria-invalid": o,
206
- placeholder: n("endpoint_presence_code_label"),
207
- autoComplete: "off",
208
- spellCheck: !1,
209
- inputMode: "numeric"
210
- }), o ? /* @__PURE__ */ K("p", {
211
- role: "alert",
212
- className: "text-destructive",
213
- children: n("endpoint_presence_code_invalid")
214
- }) : null]
215
- }), /* @__PURE__ */ K(f, {
216
- type: "submit",
217
- size: "sm",
218
- variant: "outline",
219
- children: n("endpoint_presence_submit")
220
- })]
221
- });
222
- }
223
- function qe({ workspaceId: e, device: n, settled: i, confirmed: a, onProof: o, onRetry: s }) {
224
- let c = r(), l = le(), [u, d] = W(null), [p, m] = W(null), [h, g] = W(null), _ = U(l), v = U(o);
225
- H(() => {
226
- _.current = l, v.current = o;
227
- }), H(() => {
228
- let t = !0;
229
- return _.current.begin({
230
- workspaceId: e,
231
- pinCode: n.pinCode
232
- }).then((e) => {
233
- t && e !== "closed" && e != null && d(e);
234
- }).catch((e) => {
235
- t && m(b(e));
236
- }), () => {
237
- t = !1;
238
- };
239
- }, [n.pinCode, e]), H(() => {
240
- i && u != null && _.current.settle(u.challengeId);
241
- }, [i, u]);
242
- let y = t.endpoint.pollPinPresence.useQuery({ challengeId: u?.challengeId ?? "" }, {
243
- enabled: u != null && h == null && !a,
244
- refetchInterval: (e) => e.state.data?.pressed === !0 || x(e.state.error) === "endpoint_presence_invalid" ? !1 : 1e3,
245
- refetchIntervalInBackground: !0,
246
- retry: !1,
247
- gcTime: 0
248
- }), S = y.data?.pressed === !0, C = x(y.error) === "endpoint_presence_invalid", w = u?.challengeId;
249
- H(() => {
250
- w != null && (S || h != null) && v.current({
251
- endpointId: n.endpointId,
252
- challengeId: w,
253
- ...h != null && !S ? { authorizationCode: h } : {}
254
- });
255
- }, [
256
- w,
257
- S,
258
- h,
259
- n.endpointId
260
- ]);
261
- let T = u != null && (S || h != null), E = n.name ?? n.endpointId, D = p ?? (C && !T ? b(y.error) : null);
262
- return /* @__PURE__ */ q("li", {
263
- className: "flex flex-col gap-2 rounded-lg border p-3",
264
- children: [
265
- /* @__PURE__ */ q("div", {
266
- className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",
267
- children: [
268
- T ? /* @__PURE__ */ K(pe, {
269
- "aria-hidden": !0,
270
- className: "\n size-4 shrink-0 text-emerald-700\n dark:text-emerald-300\n "
271
- }) : /* @__PURE__ */ K(be, {
272
- "aria-hidden": !0,
273
- className: "size-4 shrink-0 animate-spin text-muted-foreground"
274
- }),
275
- /* @__PURE__ */ K("span", {
276
- className: "truncate font-medium",
277
- title: E,
278
- children: E
279
- }),
280
- /* @__PURE__ */ K("span", {
281
- className: "shrink-0 font-mono text-muted-foreground",
282
- children: `${c("endpoint_list_pin")}: ${n.pinCode}`
283
- }),
284
- /* @__PURE__ */ K("span", {
285
- className: "ml-auto shrink-0 text-muted-foreground",
286
- children: c(T ? "checkpoint_revert_device_confirmed" : "endpoint_presence_waiting")
287
- })
288
- ]
289
- }),
290
- D == null ? null : /* @__PURE__ */ q("div", {
291
- className: "flex flex-col items-start gap-2",
292
- children: [/* @__PURE__ */ K("p", {
293
- role: "alert",
294
- className: "text-destructive",
295
- children: D
296
- }), /* @__PURE__ */ K(f, {
297
- type: "button",
298
- size: "sm",
299
- variant: "outline",
300
- onClick: () => {
301
- o(null), s();
302
- },
303
- children: c("checkpoint_revert_device_retry")
304
- })]
305
- }),
306
- !T && D == null && u != null ? /* @__PURE__ */ q(G, { children: [
307
- /* @__PURE__ */ K("p", {
308
- className: "text-muted-foreground",
309
- children: c("endpoint_presence_button")
310
- }),
311
- y.error == null ? null : /* @__PURE__ */ K("p", {
312
- role: "status",
313
- className: "text-destructive",
314
- children: b(y.error)
315
- }),
316
- u.codeDisplayed ? /* @__PURE__ */ K(Ke, {
317
- name: E,
318
- onCode: g
319
- }) : null
320
- ] }) : null
321
- ]
322
- });
323
- }
324
- function Je(e) {
325
- let [t, n] = W(0);
326
- return /* @__PURE__ */ K(qe, {
327
- ...e,
328
- onRetry: () => {
329
- n((e) => e + 1);
330
- }
331
- }, t);
332
- }
333
- //#endregion
334
- //#region src/audit/setup-change-list.tsx
335
- var Ye = 100;
336
- function Xe(e) {
337
- return e === "created" ? "success" : e === "deleted" ? "destructive" : "secondary";
338
- }
339
- function Ze({ changes: e }) {
340
- let t = r(), n = (e) => t(e === "created" ? "audit_operation_create" : e === "deleted" ? "audit_operation_delete" : "audit_operation_update");
341
- return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("ul", {
342
- className: "flex flex-col gap-1",
343
- children: e.slice(0, Ye).map((e) => /* @__PURE__ */ q("li", {
344
- className: "flex min-w-0 items-baseline gap-2",
345
- children: [
346
- /* @__PURE__ */ K(d, {
347
- variant: Xe(e.change),
348
- className: "shrink-0 self-center",
349
- children: n(e.change)
350
- }),
351
- /* @__PURE__ */ K("span", {
352
- className: "shrink-0 text-muted-foreground",
353
- children: Q(e.target)
354
- }),
355
- /* @__PURE__ */ K("span", {
356
- className: "truncate",
357
- title: e.name ?? e.key,
358
- children: e.name ?? e.key
359
- })
360
- ]
361
- }, `${e.target}:${e.key}`))
362
- }), e.length > Ye ? /* @__PURE__ */ K("p", {
363
- className: "text-muted-foreground",
364
- children: t("audit_more_targets", { count: e.length - Ye })
365
- }) : null] });
366
- }
367
- //#endregion
368
- //#region src/audit/revert-checkpoint-dialog.tsx
369
- function Qe({ workspaceId: e, preview: t, settled: n, attempt: i, confirmed: a, onProof: o }) {
370
- let s = r();
371
- return /* @__PURE__ */ q("div", {
372
- className: "flex flex-col gap-3 text-sm",
373
- children: [
374
- t.unreadable.length > 0 ? /* @__PURE__ */ q(A, {
375
- variant: "destructive",
376
- children: [
377
- /* @__PURE__ */ K(Se, {}),
378
- /* @__PURE__ */ K(O, { children: s("checkpoint_revert_unreadable") }),
379
- /* @__PURE__ */ K(k, { children: /* @__PURE__ */ K("ul", {
380
- className: "list-disc pl-5",
381
- children: t.unreadable.map((e) => /* @__PURE__ */ K("li", {
382
- className: "wrap-break-word",
383
- children: `${Q(e.target)}: ${e.name ?? e.key}`
384
- }, e.key))
385
- }) })
386
- ]
387
- }) : null,
388
- t.devices.length > 0 ? /* @__PURE__ */ q("div", {
389
- className: "flex flex-col gap-2",
390
- children: [/* @__PURE__ */ q(A, {
391
- variant: "warning",
392
- children: [
393
- /* @__PURE__ */ K(Se, {}),
394
- /* @__PURE__ */ K(O, { children: s("checkpoint_revert_devices") }),
395
- /* @__PURE__ */ K(k, { children: s("checkpoint_revert_devices_description") })
396
- ]
397
- }), /* @__PURE__ */ K("ul", {
398
- className: "flex flex-col gap-2",
399
- children: t.devices.map((t) => /* @__PURE__ */ K(Je, {
400
- workspaceId: e,
401
- device: t,
402
- settled: n,
403
- confirmed: a.has(t.endpointId),
404
- onProof: (e) => {
405
- o(t.endpointId, e);
406
- }
407
- }, `${t.endpointId}:${String(i)}`))
408
- })]
409
- }) : null,
410
- t.changes.length === 0 ? /* @__PURE__ */ K("p", {
411
- className: "text-muted-foreground",
412
- children: s("checkpoint_revert_no_changes")
413
- }) : /* @__PURE__ */ q("div", {
414
- className: "flex flex-col gap-1.5",
415
- children: [/* @__PURE__ */ K("p", {
416
- className: "font-medium",
417
- children: s("checkpoint_revert_changes")
418
- }), /* @__PURE__ */ K(Ze, { changes: t.changes })]
419
- }),
420
- t.constValues.changed > 0 ? /* @__PURE__ */ K("p", { children: s("checkpoint_revert_const_values", { count: t.constValues.changed }) }) : null,
421
- /* @__PURE__ */ K("p", {
422
- className: "text-muted-foreground",
423
- children: s("checkpoint_revert_readings")
424
- })
425
- ]
426
- });
427
- }
428
- function $e({ workspaceId: e, checkpointId: n, onChange: i }) {
429
- let a = r(), { revert: o } = j(e), [s, c] = W(/* @__PURE__ */ new Map()), [l, u] = W(0), d = t.workspace.checkpoint.revertPreview.useQuery({
430
- workspaceId: e,
431
- checkpointId: n
432
- }, {
433
- staleTime: 0,
434
- gcTime: 0,
435
- refetchOnWindowFocus: !1
436
- }), f = d.data, p = f?.changes.length === 0 && f.constValues.changed === 0, m = f == null || f.unreadable.length > 0 || f.devices.some((e) => !s.has(e.endpointId)), h = U(o.mutateAsync);
437
- H(() => {
438
- h.current = o.mutateAsync;
439
- });
440
- let g = U(i);
441
- return H(() => {
442
- g.current = i;
443
- }), H(() => {
444
- if (f == null || m) {
445
- g.current(null);
446
- return;
447
- }
448
- g.current({
449
- unchanged: p,
450
- revert: () => h.current({
451
- workspaceId: e,
452
- checkpointId: n,
453
- expectedRevision: f.revision,
454
- ...s.size > 0 ? { devices: [...s.values()] } : {}
455
- }).catch((e) => {
456
- throw s.size > 0 && (c(/* @__PURE__ */ new Map()), u((e) => e + 1)), e;
457
- })
458
- });
459
- }, [
460
- f,
461
- m,
462
- p,
463
- s,
464
- e,
465
- n
466
- ]), /* @__PURE__ */ K(z, {
467
- query: d,
468
- loading: /* @__PURE__ */ q("div", {
469
- className: "flex flex-col gap-1.5",
470
- "aria-label": a("checkpoint_revert_loading"),
471
- children: [
472
- /* @__PURE__ */ K(y, { className: "h-4 w-1/2" }),
473
- /* @__PURE__ */ K(y, { className: "h-4 w-2/3" }),
474
- /* @__PURE__ */ K(y, { className: "h-4 w-1/3" })
475
- ]
476
- }),
477
- error: (e) => /* @__PURE__ */ K(B, { message: b(e) }),
478
- children: (t) => /* @__PURE__ */ K(Qe, {
479
- workspaceId: e,
480
- preview: t,
481
- settled: o.isSuccess,
482
- attempt: l,
483
- confirmed: new Set(s.keys()),
484
- onProof: (e, t) => {
485
- c((n) => {
486
- let r = new Map(n);
487
- return t == null ? r.delete(e) : r.set(e, t), r;
488
- });
489
- }
490
- })
491
- });
492
- }
493
- function et({ workspaceId: e, checkpoint: t, title: n, onClose: i }) {
494
- let a = r(), [o, s] = W(null), [c, l] = W(!1), [u, d] = W(null);
495
- return /* @__PURE__ */ K(v, {
496
- open: !0,
497
- onOpenChange: (e) => {
498
- e || i();
499
- },
500
- children: /* @__PURE__ */ q(_, {
501
- className: "sm:max-w-lg",
502
- children: [
503
- /* @__PURE__ */ q(g, { children: [/* @__PURE__ */ K(h, { children: a("checkpoint_revert_title", { name: n }) }), /* @__PURE__ */ K(m, { children: a("checkpoint_revert_description", { time: J(t.createdAt) }) })] }),
504
- /* @__PURE__ */ K("div", {
505
- className: "max-h-[50vh] min-w-0 overflow-y-auto",
506
- children: /* @__PURE__ */ K($e, {
507
- workspaceId: e,
508
- checkpointId: t.id,
509
- onChange: s
510
- })
511
- }),
512
- u == null ? null : /* @__PURE__ */ K("p", {
513
- role: "alert",
514
- className: "text-sm text-destructive",
515
- children: b(u)
516
- }),
517
- /* @__PURE__ */ q(p, { children: [/* @__PURE__ */ K(f, {
518
- type: "button",
519
- variant: "outline",
520
- onClick: i,
521
- children: a("action_cancel")
522
- }), /* @__PURE__ */ K(f, {
523
- type: "button",
524
- variant: "destructive",
525
- disabled: o == null || o.unchanged || c,
526
- onClick: () => {
527
- o != null && (l(!0), d(null), o.revert().then(i, (e) => {
528
- d(e), l(!1);
529
- }));
530
- },
531
- children: a(c ? "checkpoint_revert_pending" : "checkpoint_revert_confirm")
532
- })] })
533
- ]
534
- })
535
- });
536
- }
537
- //#endregion
538
- //#region src/audit/checkpoints.tsx
539
- var tt = De(de.Object({
540
- name: de.String({
541
- minLength: 1,
542
- maxLength: 120,
543
- pattern: "\\S"
544
- }),
545
- reason: de.String({ maxLength: 500 })
546
- }));
547
- function nt(e) {
548
- return e.name ?? Oe(e.kind);
549
- }
550
- function rt({ checkpoint: e }) {
551
- let t = e.authorName ?? n("checkpoint_author_deleted"), [r, i] = e.authorKind === "system" ? [he, n("audit_actor_system")] : e.authorKind === "assistant" ? [fe, n("checkpoint_author_assistant", { name: t })] : [Ce, t];
552
- return /* @__PURE__ */ q("span", {
553
- className: "flex min-w-0 items-center gap-1.5",
554
- children: [/* @__PURE__ */ K(r, {
555
- "aria-hidden": !0,
556
- className: "size-3.5 shrink-0"
557
- }), /* @__PURE__ */ K("span", {
558
- className: "truncate",
559
- title: i,
560
- children: i
561
- })]
562
- });
563
- }
564
- function it({ workspaceId: e, checkpointId: n, scope: i }) {
565
- let a = r();
566
- return /* @__PURE__ */ K(z, {
567
- query: t.workspace.checkpoint.summary.useQuery({
568
- workspaceId: e,
569
- checkpointId: n,
570
- scope: i
571
- }),
572
- loading: /* @__PURE__ */ q("div", {
573
- className: "flex flex-col gap-1.5",
574
- "aria-label": a("checkpoint_changes_loading"),
575
- children: [/* @__PURE__ */ K(y, { className: "h-4 w-1/2" }), /* @__PURE__ */ K(y, { className: "h-4 w-1/3" })]
576
- }),
577
- error: (e) => /* @__PURE__ */ K(B, { message: b(e) }),
578
- isEmpty: (e) => e.changes.length === 0,
579
- empty: /* @__PURE__ */ K("p", {
580
- className: "text-muted-foreground",
581
- children: a("checkpoint_changes_none")
582
- }),
583
- children: (e) => /* @__PURE__ */ q("div", {
584
- className: "flex flex-col gap-1.5",
585
- children: [/* @__PURE__ */ K("p", {
586
- className: "font-medium",
587
- children: e.untilCheckpointId == null ? a("checkpoint_changes_until_now") : a("checkpoint_changes_until_next")
588
- }), /* @__PURE__ */ K(Ze, { changes: e.changes })]
589
- })
590
- });
591
- }
592
- function at({ workspaceId: e, checkpoint: t, scope: n }) {
593
- let i = r(), [a, o] = W(!1), [s, c] = W(null), l = nt(t);
594
- return /* @__PURE__ */ q("div", {
595
- role: "group",
596
- "aria-label": `${i("checkpoint_marker")}: ${l}`,
597
- className: "flex flex-col gap-2 border-l-4 border-primary bg-primary/5 px-3 py-2",
598
- children: [
599
- /* @__PURE__ */ q("div", {
600
- className: "flex items-start gap-2",
601
- children: [
602
- /* @__PURE__ */ K(_e, {
603
- "aria-hidden": !0,
604
- className: "mt-0.5 size-4 shrink-0 text-primary"
605
- }),
606
- /* @__PURE__ */ q("div", {
607
- className: "flex min-w-0 flex-1 flex-col gap-1",
608
- children: [
609
- /* @__PURE__ */ q("div", {
610
- className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",
611
- children: [/* @__PURE__ */ K("span", {
612
- className: "truncate font-medium",
613
- title: l,
614
- children: l
615
- }), t.name == null ? null : /* @__PURE__ */ K(d, {
616
- variant: "outline",
617
- children: Oe(t.kind)
618
- })]
619
- }),
620
- /* @__PURE__ */ q("div", {
621
- className: "\n flex min-w-0 flex-col gap-x-4 gap-y-0.5 text-muted-foreground\n @md:flex-row @md:items-center\n ",
622
- children: [/* @__PURE__ */ K("span", {
623
- className: "shrink-0 tabular-nums",
624
- children: J(t.createdAt)
625
- }), /* @__PURE__ */ K(rt, { checkpoint: t })]
626
- }),
627
- t.reason == null ? null : /* @__PURE__ */ K("p", {
628
- className: "wrap-break-word whitespace-pre-wrap text-muted-foreground",
629
- children: t.reason
630
- })
631
- ]
632
- }),
633
- /* @__PURE__ */ q("div", {
634
- className: "flex shrink-0 items-center gap-1",
635
- children: [/* @__PURE__ */ q(P, { children: [/* @__PURE__ */ K(ne, {
636
- render: /* @__PURE__ */ K(f, {
637
- type: "button",
638
- variant: "ghost",
639
- size: "icon-xs",
640
- "aria-label": i("checkpoint_actions", { name: l })
641
- }),
642
- children: /* @__PURE__ */ K(xe, {})
643
- }), /* @__PURE__ */ q(N, {
644
- align: "end",
645
- className: "w-auto min-w-36",
646
- children: [/* @__PURE__ */ K(M, {
647
- onClick: () => {
648
- c("revert");
649
- },
650
- children: i("checkpoint_revert")
651
- }), t.kind === "named" ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(M, {
652
- onClick: () => {
653
- c("rename");
654
- },
655
- children: i("checkpoint_rename")
656
- }), /* @__PURE__ */ K(M, {
657
- variant: "destructive",
658
- onClick: () => {
659
- c("delete");
660
- },
661
- children: i("checkpoint_delete")
662
- })] }) : null]
663
- })] }), /* @__PURE__ */ K(f, {
664
- type: "button",
665
- variant: "ghost",
666
- size: "icon-xs",
667
- "aria-expanded": a,
668
- "aria-label": i(a ? "checkpoint_hide_changes" : "checkpoint_show_changes"),
669
- title: i(a ? "checkpoint_hide_changes" : "checkpoint_show_changes"),
670
- onClick: () => {
671
- o((e) => !e);
672
- },
673
- children: /* @__PURE__ */ K(me, { className: `
674
- transition-transform
675
- ${a ? "rotate-90" : ""}
676
- ` })
677
- })]
678
- })
679
- ]
680
- }),
681
- a ? /* @__PURE__ */ K("div", {
682
- className: "ml-6",
683
- children: /* @__PURE__ */ K(it, {
684
- workspaceId: e,
685
- checkpointId: t.id,
686
- scope: n
687
- })
688
- }) : null,
689
- s === "rename" ? /* @__PURE__ */ K(ot, {
690
- workspaceId: e,
691
- checkpoint: t,
692
- onClose: () => {
693
- c(null);
694
- }
695
- }) : null,
696
- s === "revert" ? /* @__PURE__ */ K(et, {
697
- workspaceId: e,
698
- checkpoint: t,
699
- title: l,
700
- onClose: () => {
701
- c(null);
702
- }
703
- }) : null,
704
- s === "delete" ? /* @__PURE__ */ K(st, {
705
- workspaceId: e,
706
- checkpoint: t,
707
- onClose: () => {
708
- c(null);
709
- }
710
- }) : null
711
- ]
712
- });
713
- }
714
- function ot({ workspaceId: e, checkpoint: t, onClose: n }) {
715
- let s = r(), c = j(e), u = i({
716
- defaultValues: {
717
- name: t?.name ?? "",
718
- reason: ""
719
- },
720
- validators: o({
721
- schema: tt,
722
- submit: async (n) => {
723
- let r = n.name.trim();
724
- if (t == null) {
725
- let t = n.reason.trim();
726
- await c.create.mutateAsync({
727
- workspaceId: e,
728
- name: r,
729
- ...t === "" ? {} : { reason: t }
730
- });
731
- } else await c.rename.mutateAsync({
732
- workspaceId: e,
733
- checkpointId: t.id,
734
- name: r
735
- });
736
- return null;
737
- }
738
- }),
739
- onSubmitInvalid: a,
740
- onSubmit: n
741
- });
742
- return /* @__PURE__ */ K(v, {
743
- open: !0,
744
- onOpenChange: (e) => {
745
- e || n();
746
- },
747
- children: /* @__PURE__ */ K(_, { children: /* @__PURE__ */ K(u.AppForm, { children: /* @__PURE__ */ q(u.FormRoot, {
748
- layout: "dialog",
749
- children: [
750
- /* @__PURE__ */ q(g, { children: [/* @__PURE__ */ K(h, { children: s(t == null ? "checkpoint_create" : "checkpoint_rename_title") }), /* @__PURE__ */ K(m, { children: t == null ? s("checkpoint_create_description") : nt(t) })] }),
751
- /* @__PURE__ */ q(l, { children: [/* @__PURE__ */ K(u.AppField, {
752
- name: "name",
753
- children: (e) => /* @__PURE__ */ K(e.TextField, {
754
- label: s("checkpoint_name"),
755
- maxLength: 120,
756
- autoFocus: !0
757
- })
758
- }), t == null ? /* @__PURE__ */ K(u.AppField, {
759
- name: "reason",
760
- children: (e) => /* @__PURE__ */ K(e.TextAreaField, {
761
- label: s("checkpoint_reason"),
762
- maxLength: 500,
763
- rows: 3
764
- })
765
- }) : null] }),
766
- /* @__PURE__ */ q(p, { children: [/* @__PURE__ */ K(f, {
767
- type: "button",
768
- variant: "outline",
769
- onClick: n,
770
- children: s("action_cancel")
771
- }), t == null ? /* @__PURE__ */ K(u.SubmitButton, {
772
- label: s("checkpoint_create"),
773
- pendingLabel: s("action_creating")
774
- }) : /* @__PURE__ */ K(u.SubmitButton, {
775
- label: s("action_save"),
776
- pendingLabel: s("action_saving")
777
- })] })
778
- ]
779
- }) }) })
780
- });
781
- }
782
- function st({ workspaceId: e, checkpoint: t, onClose: n }) {
783
- let i = r(), { remove: a } = j(e);
784
- return /* @__PURE__ */ K(ae, {
785
- open: !0,
786
- onOpenChange: (e) => {
787
- e || n();
788
- },
789
- children: /* @__PURE__ */ q(L, { children: [
790
- /* @__PURE__ */ q(ie, { children: [/* @__PURE__ */ K(I, { children: i("checkpoint_delete_title", { name: nt(t) }) }), /* @__PURE__ */ K(F, { children: i("checkpoint_delete_description") })] }),
791
- a.error == null ? null : /* @__PURE__ */ K("p", {
792
- role: "alert",
793
- className: "text-sm text-destructive",
794
- children: b(a.error)
795
- }),
796
- /* @__PURE__ */ q(R, { children: [/* @__PURE__ */ K(re, { children: i("action_cancel") }), /* @__PURE__ */ K(f, {
797
- type: "button",
798
- variant: "destructive",
799
- disabled: a.isPending,
800
- onClick: () => {
801
- a.mutate({
802
- workspaceId: e,
803
- checkpointId: t.id
804
- }, { onSuccess: n });
805
- },
806
- children: a.isPending ? i("action_deleting") : i("checkpoint_delete")
807
- })] })
808
- ] })
809
- });
810
- }
811
- function ct({ workspaceId: e }) {
812
- let t = r(), [n, i] = W(!1);
813
- return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(f, {
814
- size: "sm",
815
- onClick: () => {
816
- i(!0);
817
- },
818
- children: [/* @__PURE__ */ K(_e, { "data-icon": "inline-start" }), t("checkpoint_create")]
819
- }), n ? /* @__PURE__ */ K(ot, {
820
- workspaceId: e,
821
- onClose: () => {
822
- i(!1);
823
- }
824
- }) : null] });
825
- }
826
- function lt({ workspaceId: e, scope: n }) {
827
- let i = r(), a = t.workspace.checkpoint.list.useInfiniteQuery({
828
- workspaceId: e,
829
- scope: n,
830
- limit: 50
831
- }, { getNextPageParam: (e) => e.nextCursor ?? void 0 });
832
- return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(z, {
833
- query: a,
834
- loading: /* @__PURE__ */ K(y, { className: "h-52 w-full" }),
835
- error: (e) => /* @__PURE__ */ K(B, { message: b(e) }),
836
- isEmpty: (e) => e.pages.every((e) => e.checkpoints.length === 0),
837
- empty: /* @__PURE__ */ K("p", {
838
- className: "rounded-lg border py-10 text-center text-sm text-muted-foreground",
839
- children: i("checkpoint_empty")
840
- }),
841
- children: (t) => /* @__PURE__ */ K("ul", {
842
- className: "flex flex-col divide-y overflow-hidden rounded-lg border text-xs",
843
- children: t.pages.flatMap((e) => e.checkpoints).map((t) => /* @__PURE__ */ K("li", { children: /* @__PURE__ */ K(at, {
844
- workspaceId: e,
845
- checkpoint: t,
846
- scope: n
847
- }) }, t.id))
848
- })
849
- }), a.hasNextPage ? /* @__PURE__ */ K(f, {
850
- variant: "outline",
851
- size: "sm",
852
- className: "self-center",
853
- disabled: a.isFetchingNextPage,
854
- onClick: () => {
855
- a.fetchNextPage();
856
- },
857
- children: i("audit_more")
858
- }) : null] });
859
- }
860
- //#endregion
861
- //#region src/audit/history-model.ts
862
- function ut(e) {
863
- let t = /* @__PURE__ */ new Map();
864
- for (let n of e) {
865
- let e = t.get(n.operationId);
866
- e == null ? t.set(n.operationId, [n]) : e.push(n);
867
- }
868
- return [...t.values()];
869
- }
870
- //#endregion
871
- //#region src/audit/history-page.tsx
872
- var dt = /* @__PURE__ */ e({ AuditHistoryPage: () => mt });
873
- function ft(e) {
874
- return n(e === "user" ? "audit_actor_user" : e === "assistant" ? "audit_actor_assistant" : e === "api_key" ? "audit_actor_api_key" : e === "automation" ? "audit_actor_automation" : "audit_actor_system");
875
- }
876
- function $(e) {
877
- return n(e === "create" ? "audit_operation_create" : e === "update" ? "audit_operation_update" : e === "delete" ? "audit_operation_delete" : e === "call" ? "audit_operation_call" : "audit_operation_write");
878
- }
879
- function pt(e, t, n) {
880
- let r = URL.createObjectURL(new Blob([e], { type: t })), i = document.createElement("a");
881
- i.href = r, i.download = n, i.click(), setTimeout(() => {
882
- URL.revokeObjectURL(r);
883
- }, 1e3);
884
- }
885
- function mt({ workspaceId: e, archived: n = !1, view: i, onViewChange: a }) {
886
- let o = r(), l = e != null && !n && i != null ? {
887
- workspaceId: e,
888
- ...i
889
- } : null, d = l?.view === "checkpoints", [p, m] = W(), [h, g] = W(""), [_, v] = W(), [x, S] = W(""), [C, w] = W(), [T, E] = W(""), [D, O] = W(""), [k, A] = W(!1), j = p != null || h !== "" || _ != null || x !== "" || C != null || T !== "" || D !== "";
890
- function M() {
891
- A(!1);
892
- }
893
- function ne() {
894
- m(void 0), g(""), v(void 0), S(""), w(void 0), E(""), O(""), M();
895
- }
896
- let N = Ee(T)?.toISOString(), P = Ee(D)?.toISOString(), F = {
897
- ...e == null ? {} : { workspaceId: e },
898
- ...n ? { archived: !0 } : {},
899
- ...p == null ? {} : { actorKind: p },
900
- ...h.trim() === "" ? {} : { actor: h.trim() },
901
- ..._ == null ? {} : { origin: _ },
902
- ...x.trim() === "" ? {} : { target: x.trim() },
903
- ...C == null ? {} : { operation: C },
904
- ...N == null ? {} : { from: N },
905
- ...P == null ? {} : { to: P }
906
- }, I = t.audit.list.useInfiniteQuery({
907
- ...F,
908
- ...l == null ? {} : { checkpoints: l.scope },
909
- limit: 50
910
- }, {
911
- getNextPageParam: (e) => e.nextCursor ?? void 0,
912
- enabled: !d
913
- }), L = t.audit.export.useQuery({
914
- ...F,
915
- format: "json"
916
- }, { enabled: !1 }), R = t.audit.export.useQuery({
917
- ...F,
918
- format: "csv"
919
- }, { enabled: !1 });
920
- async function re(e) {
921
- A(!1);
922
- let t = await (e === "json" ? L.refetch() : R.refetch());
923
- t.data && (A(t.data.truncated), pt(t.data.content, t.data.contentType, t.data.filename));
924
- }
925
- return /* @__PURE__ */ q("div", {
926
- className: "\n @container mx-auto flex w-full max-w-6xl flex-1 flex-col gap-4 p-4\n md:p-6\n ",
927
- children: [
928
- /* @__PURE__ */ K(se, {
929
- icon: /* @__PURE__ */ K(ve, {}),
930
- breadcrumbs: e != null && !n ? /* @__PURE__ */ K(ce, { workspaceId: e }) : void 0,
931
- title: o("audit_title"),
932
- description: o("audit_description"),
933
- className: "p-0",
934
- actions: /* @__PURE__ */ K(G, { children: d ? null : /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(f, {
935
- variant: "outline",
936
- size: "sm",
937
- disabled: L.isFetching || R.isFetching,
938
- onClick: () => void re("json"),
939
- children: [/* @__PURE__ */ K(ge, { "data-icon": "inline-start" }), o("audit_export_json")]
940
- }), /* @__PURE__ */ q(f, {
941
- variant: "outline",
942
- size: "sm",
943
- disabled: L.isFetching || R.isFetching,
944
- onClick: () => void re("csv"),
945
- children: [/* @__PURE__ */ K(ge, { "data-icon": "inline-start" }), o("audit_export_csv")]
946
- })] }) })
947
- }),
948
- l == null ? null : /* @__PURE__ */ q("div", {
949
- className: "\n flex flex-col gap-2\n @2xl:flex-row @2xl:items-center @2xl:justify-between\n ",
950
- children: [/* @__PURE__ */ q(te, {
951
- variant: "outline",
952
- size: "sm",
953
- spacing: 0,
954
- "aria-label": o("audit_view"),
955
- value: [l.view],
956
- onValueChange: (e) => {
957
- let t = ["activity", "checkpoints"].find((t) => t === e[0]);
958
- t != null && a?.({
959
- view: t,
960
- scope: l.scope
961
- });
962
- },
963
- children: [/* @__PURE__ */ K(ee, {
964
- value: "activity",
965
- children: o("audit_view_activity")
966
- }), /* @__PURE__ */ K(ee, {
967
- value: "checkpoints",
968
- children: o("audit_view_checkpoints")
969
- })]
970
- }), /* @__PURE__ */ q("div", {
971
- className: "flex items-center gap-2",
972
- children: [/* @__PURE__ */ q(s, {
973
- className: "\n min-w-0 flex-1\n @2xl:w-56 @2xl:flex-none\n ",
974
- "aria-label": o("checkpoint_scope"),
975
- value: l.scope,
976
- onChange: (e) => {
977
- a?.({
978
- view: l.view,
979
- scope: e.target.value === "all" ? "all" : "important"
980
- });
981
- },
982
- children: [/* @__PURE__ */ K(c, {
983
- value: "important",
984
- children: o("checkpoint_scope_important")
985
- }), /* @__PURE__ */ K(c, {
986
- value: "all",
987
- children: o("checkpoint_scope_all")
988
- })]
989
- }), /* @__PURE__ */ K(ct, { workspaceId: l.workspaceId })]
990
- })]
991
- }),
992
- l != null && d ? /* @__PURE__ */ K(lt, {
993
- workspaceId: l.workspaceId,
994
- scope: l.scope
995
- }) : /* @__PURE__ */ q(G, { children: [
996
- /* @__PURE__ */ q("div", {
997
- role: "group",
998
- "aria-label": o("audit_filters"),
999
- className: "\n grid grid-cols-2 items-start gap-2\n @2xl:grid-cols-6\n @4xl:grid-cols-12\n ",
1000
- children: [
1001
- /* @__PURE__ */ K(u, {
1002
- className: "\n col-span-2\n @2xl:col-span-3\n ",
1003
- "aria-label": o("audit_target"),
1004
- placeholder: o("audit_target"),
1005
- value: x,
1006
- onChange: (e) => {
1007
- M(), S(e.target.value);
1008
- }
1009
- }),
1010
- /* @__PURE__ */ K(u, {
1011
- className: "\n col-span-2\n @2xl:col-span-3\n ",
1012
- "aria-label": o("audit_filter_actor"),
1013
- placeholder: o("audit_filter_actor"),
1014
- value: h,
1015
- onChange: (e) => {
1016
- M(), g(e.target.value);
1017
- }
1018
- }),
1019
- /* @__PURE__ */ q(s, {
1020
- className: "\n w-full\n @2xl:col-span-2\n ",
1021
- "aria-label": o("audit_actor"),
1022
- value: p ?? "",
1023
- onChange: (e) => {
1024
- let t = e.target.value;
1025
- M(), m(t === "user" || t === "assistant" || t === "api_key" || t === "automation" || t === "system" ? t : void 0);
1026
- },
1027
- children: [
1028
- /* @__PURE__ */ K(c, {
1029
- value: "",
1030
- children: o("audit_all_actors")
1031
- }),
1032
- /* @__PURE__ */ K(c, {
1033
- value: "user",
1034
- children: o("audit_actor_user")
1035
- }),
1036
- /* @__PURE__ */ K(c, {
1037
- value: "assistant",
1038
- children: o("audit_actor_assistant")
1039
- }),
1040
- /* @__PURE__ */ K(c, {
1041
- value: "api_key",
1042
- children: o("audit_actor_api_key")
1043
- }),
1044
- /* @__PURE__ */ K(c, {
1045
- value: "automation",
1046
- children: o("audit_actor_automation")
1047
- }),
1048
- /* @__PURE__ */ K(c, {
1049
- value: "system",
1050
- children: o("audit_actor_system")
1051
- })
1052
- ]
1053
- }),
1054
- /* @__PURE__ */ q(s, {
1055
- className: "\n w-full\n @2xl:col-span-2\n ",
1056
- "aria-label": o("audit_filter_origin"),
1057
- value: _ ?? "",
1058
- onChange: (e) => {
1059
- M(), v(Ge(e.target.value));
1060
- },
1061
- children: [/* @__PURE__ */ K(c, {
1062
- value: "",
1063
- children: o("audit_all_origins")
1064
- }), je.map((e) => /* @__PURE__ */ K(c, {
1065
- value: e,
1066
- children: We(e)
1067
- }, e))]
1068
- }),
1069
- /* @__PURE__ */ q(s, {
1070
- className: "col-span-2 w-full",
1071
- "aria-label": o("audit_action"),
1072
- value: C ?? "",
1073
- onChange: (e) => {
1074
- M();
1075
- let t = e.target.value;
1076
- w(t === "create" || t === "update" || t === "delete" || t === "write" || t === "call" ? t : void 0);
1077
- },
1078
- children: [
1079
- /* @__PURE__ */ K(c, {
1080
- value: "",
1081
- children: o("audit_all_actions")
1082
- }),
1083
- /* @__PURE__ */ K(c, {
1084
- value: "create",
1085
- children: o("audit_operation_create")
1086
- }),
1087
- /* @__PURE__ */ K(c, {
1088
- value: "update",
1089
- children: o("audit_operation_update")
1090
- }),
1091
- /* @__PURE__ */ K(c, {
1092
- value: "delete",
1093
- children: o("audit_operation_delete")
1094
- }),
1095
- /* @__PURE__ */ K(c, {
1096
- value: "write",
1097
- children: o("audit_operation_write")
1098
- }),
1099
- /* @__PURE__ */ K(c, {
1100
- value: "call",
1101
- children: o("audit_operation_call")
1102
- })
1103
- ]
1104
- }),
1105
- /* @__PURE__ */ K("div", {
1106
- role: "group",
1107
- "aria-label": o("audit_period"),
1108
- className: "\n col-span-2\n @2xl:col-span-4\n @4xl:col-span-6\n ",
1109
- children: /* @__PURE__ */ K(oe, {
1110
- optional: !0,
1111
- value: {
1112
- from: T,
1113
- to: D
1114
- },
1115
- onValueChange: (e) => {
1116
- M(), E(e.from), O(e.to);
1117
- }
1118
- })
1119
- }),
1120
- j ? /* @__PURE__ */ q(f, {
1121
- variant: "ghost",
1122
- className: "col-span-2 justify-self-start",
1123
- onClick: ne,
1124
- children: [/* @__PURE__ */ K(Te, { "data-icon": "inline-start" }), o("audit_clear_filters")]
1125
- }) : null
1126
- ]
1127
- }),
1128
- k ? /* @__PURE__ */ K("p", {
1129
- role: "status",
1130
- className: "text-sm text-destructive",
1131
- children: o("audit_export_truncated")
1132
- }) : null,
1133
- /* @__PURE__ */ K(z, {
1134
- query: I,
1135
- loading: /* @__PURE__ */ K(y, { className: "h-52 w-full" }),
1136
- error: (e) => /* @__PURE__ */ K(B, { message: b(e) }),
1137
- isEmpty: (e) => e.pages.every((e) => e.events.length === 0 && e.checkpoints.length === 0),
1138
- empty: /* @__PURE__ */ K("p", {
1139
- className: "rounded-lg border py-10 text-center text-sm text-muted-foreground",
1140
- children: o("audit_empty")
1141
- }),
1142
- children: (e) => /* @__PURE__ */ K(ht, {
1143
- pages: e.pages,
1144
- checkpoints: l == null ? null : {
1145
- workspaceId: l.workspaceId,
1146
- scope: l.scope
1147
- }
1148
- })
1149
- }),
1150
- I.hasNextPage ? /* @__PURE__ */ K(f, {
1151
- variant: "outline",
1152
- size: "sm",
1153
- className: "self-center",
1154
- disabled: I.isFetchingNextPage,
1155
- onClick: () => {
1156
- I.fetchNextPage();
1157
- },
1158
- children: o("audit_more")
1159
- }) : null
1160
- ] })
1161
- ]
1162
- });
1163
- }
1164
- function ht({ pages: e, checkpoints: t }) {
1165
- let n = r(), i = (e) => t == null ? null : e.map((e) => /* @__PURE__ */ K(S, {
1166
- className: "\n block\n hover:bg-transparent\n @4xl:table-row\n ",
1167
- children: /* @__PURE__ */ K(C, {
1168
- colSpan: 6,
1169
- className: "\n block p-0 whitespace-normal\n @4xl:table-cell\n ",
1170
- children: /* @__PURE__ */ K(at, {
1171
- workspaceId: t.workspaceId,
1172
- checkpoint: e,
1173
- scope: t.scope
1174
- })
1175
- })
1176
- }, e.id));
1177
- return /* @__PURE__ */ K("div", {
1178
- className: "overflow-hidden rounded-lg border",
1179
- children: /* @__PURE__ */ q(D, {
1180
- className: "\n block text-xs\n @4xl:table @4xl:table-fixed\n ",
1181
- children: [/* @__PURE__ */ K(E, {
1182
- className: "\n sr-only bg-muted/50\n @4xl:not-sr-only @4xl:table-header-group\n ",
1183
- children: /* @__PURE__ */ q(S, { children: [
1184
- /* @__PURE__ */ K(T, {
1185
- className: "w-38 pl-3",
1186
- children: n("audit_time")
1187
- }),
1188
- /* @__PURE__ */ K(T, {
1189
- className: "w-36",
1190
- children: n("audit_actor")
1191
- }),
1192
- /* @__PURE__ */ K(T, {
1193
- className: "w-32",
1194
- children: n("audit_action")
1195
- }),
1196
- /* @__PURE__ */ K(T, { children: n("audit_target") }),
1197
- /* @__PURE__ */ K(T, {
1198
- className: "w-36",
1199
- children: n("audit_via")
1200
- }),
1201
- /* @__PURE__ */ K(T, { className: "w-9" })
1202
- ] })
1203
- }), /* @__PURE__ */ K(w, {
1204
- className: "\n block\n @4xl:table-row-group\n ",
1205
- children: e.map((e) => ut(e.events).map((t) => {
1206
- let n = t[0].operationId;
1207
- return /* @__PURE__ */ q(V, { children: [i(e.checkpoints.filter((e) => e.aboveOperationId === n)), /* @__PURE__ */ K(vt, { events: t })] }, n);
1208
- }).concat(/* @__PURE__ */ K(V, { children: i(e.checkpoints.filter((e) => e.aboveOperationId == null)) }, `${e.nextCursor ?? "end"}:checkpoints`)))
1209
- })]
1210
- })
1211
- });
1212
- }
1213
- function gt({ kind: e }) {
1214
- return /* @__PURE__ */ K(e === "user" ? Ce : e === "assistant" ? fe : e === "api_key" ? ye : e === "automation" ? we : he, {
1215
- "aria-label": ft(e),
1216
- className: "size-3.5 shrink-0 text-muted-foreground"
1217
- });
1218
- }
1219
- function _t(e) {
1220
- return e === "create" ? "success" : e === "delete" ? "destructive" : e === "write" || e === "call" ? "outline" : "secondary";
1221
- }
1222
- function vt({ events: e }) {
1223
- let t = r(), [n, i] = W(!1), a = e[0], o = e.flatMap((e) => e.changes), s = [...new Set(e.map((e) => e.action))].join(", "), c = [...new Set(o.map((e) => e.operation))], l = c.at(0), u = [...new Set(e.map((e) => We(e.origin)))].join(", "), p = [...new Set(o.map(Ue))], m = o.at(0), h = Math.max(0, p.length - 1), g = new Set(o.map(He)), _ = g.size === 1 ? [...g][0] ?? null : null, v = e.some((e) => e.writeOutcome === "partial") ? "partial" : e.some((e) => e.writeOutcome === "complete") ? "complete" : null, y = a.actorName ?? ft(a.actorKind);
1224
- return /* @__PURE__ */ q(V, { children: [/* @__PURE__ */ q(S, {
1225
- className: "\n grid cursor-pointer grid-cols-[auto_1fr_auto_auto] items-center gap-x-2 gap-y-1 px-3 py-2\n @4xl:table-row\n ",
1226
- onClick: () => {
1227
- i((e) => !e);
1228
- },
1229
- children: [
1230
- /* @__PURE__ */ K(C, {
1231
- className: "\n order-5 p-0 text-muted-foreground tabular-nums\n @4xl:px-2 @4xl:py-1.5 @4xl:pl-3\n ",
1232
- children: J(a.occurredAt)
1233
- }),
1234
- /* @__PURE__ */ K(C, {
1235
- className: "\n order-6 col-span-3 min-w-0 p-0\n @4xl:px-2 @4xl:py-1.5\n ",
1236
- children: /* @__PURE__ */ q("div", {
1237
- className: "flex min-w-0 items-center gap-1.5",
1238
- children: [/* @__PURE__ */ K(gt, { kind: a.actorKind }), /* @__PURE__ */ K("span", {
1239
- className: "truncate",
1240
- title: y,
1241
- children: y
1242
- })]
1243
- })
1244
- }),
1245
- /* @__PURE__ */ K(C, {
1246
- className: "\n order-3 col-span-2 min-w-0 p-0\n @4xl:px-2 @4xl:py-1.5\n ",
1247
- children: /* @__PURE__ */ q("div", {
1248
- className: "flex items-center gap-1",
1249
- title: c.map($).join(", "),
1250
- children: [l == null ? null : /* @__PURE__ */ K(d, {
1251
- variant: _t(l),
1252
- children: $(l)
1253
- }), c.length > 1 ? /* @__PURE__ */ q(d, {
1254
- variant: "outline",
1255
- children: [/* @__PURE__ */ q("span", {
1256
- "aria-hidden": !0,
1257
- children: ["+", c.length - 1]
1258
- }), /* @__PURE__ */ K("span", {
1259
- className: "sr-only",
1260
- children: c.slice(1).map($).join(", ")
1261
- })]
1262
- }) : null]
1263
- })
1264
- }),
1265
- /* @__PURE__ */ K(C, {
1266
- className: "\n order-1 col-span-3 min-w-0 p-0\n @4xl:px-2 @4xl:py-1.5\n ",
1267
- children: /* @__PURE__ */ q("div", {
1268
- className: "flex min-w-0 items-baseline gap-2",
1269
- children: [
1270
- m == null ? null : /* @__PURE__ */ K("span", {
1271
- className: "shrink-0 text-muted-foreground",
1272
- children: Q(m.targetType)
1273
- }),
1274
- m != null && X(m) != null ? /* @__PURE__ */ K("span", {
1275
- className: "truncate font-medium",
1276
- title: p.join(", "),
1277
- children: X(m)
1278
- }) : null,
1279
- _ == null ? null : /* @__PURE__ */ K("span", {
1280
- className: "min-w-8 flex-1 truncate font-mono text-xs text-muted-foreground",
1281
- title: _,
1282
- children: _
1283
- }),
1284
- v === "partial" ? /* @__PURE__ */ K(d, {
1285
- variant: "destructive",
1286
- className: "self-center",
1287
- children: t("audit_write_partial")
1288
- }) : null,
1289
- h > 0 ? /* @__PURE__ */ K(d, {
1290
- variant: "outline",
1291
- className: "self-center",
1292
- children: t("audit_more_targets", { count: h })
1293
- }) : null
1294
- ]
1295
- })
1296
- }),
1297
- /* @__PURE__ */ K(C, {
1298
- className: "\n order-4 col-span-2 justify-self-end p-0 text-muted-foreground\n @4xl:px-2 @4xl:py-1.5\n ",
1299
- children: /* @__PURE__ */ K("span", {
1300
- className: "block truncate",
1301
- title: u,
1302
- children: u
1303
- })
1304
- }),
1305
- /* @__PURE__ */ K(C, {
1306
- className: "\n order-2 justify-self-end p-0\n @4xl:py-1.5 @4xl:pr-2\n ",
1307
- children: /* @__PURE__ */ K(f, {
1308
- variant: "ghost",
1309
- size: "icon-xs",
1310
- "aria-expanded": n,
1311
- "aria-label": t(n ? "audit_hide_details" : "audit_show_details"),
1312
- children: /* @__PURE__ */ K(me, { className: `
1313
- transition-transform
1314
- ${n ? "rotate-90" : ""}
1315
- ` })
1316
- })
1317
- })
1318
- ]
1319
- }), n ? /* @__PURE__ */ K(S, {
1320
- className: "\n block bg-muted/30\n hover:bg-muted/30\n @4xl:table-row\n ",
1321
- children: /* @__PURE__ */ K(C, {
1322
- colSpan: 6,
1323
- className: "\n block p-3 whitespace-normal\n @4xl:table-cell\n ",
1324
- children: /* @__PURE__ */ q("div", {
1325
- className: "flex flex-col gap-3",
1326
- children: [/* @__PURE__ */ q("div", {
1327
- className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs",
1328
- children: [
1329
- /* @__PURE__ */ K("span", {
1330
- className: "font-mono text-muted-foreground",
1331
- children: s
1332
- }),
1333
- a.actorCredentialId == null ? null : /* @__PURE__ */ K("span", {
1334
- className: "font-mono text-muted-foreground",
1335
- children: t("audit_credential", { id: a.actorCredentialId })
1336
- }),
1337
- v === "partial" ? /* @__PURE__ */ K(d, {
1338
- variant: "destructive",
1339
- children: t("audit_write_partial")
1340
- }) : v === "complete" ? /* @__PURE__ */ K(d, {
1341
- variant: "success",
1342
- children: t("audit_write_complete")
1343
- }) : null
1344
- ]
1345
- }), o.map((e) => /* @__PURE__ */ K(yt, { change: e }, e.id))]
1346
- })
1347
- })
1348
- }) : null] });
1349
- }
1350
- function yt({ change: e }) {
1351
- let t = r(), n = Ve(e), i = e.operation === "update";
1352
- return /* @__PURE__ */ q("div", {
1353
- className: "overflow-hidden rounded-md border bg-background",
1354
- children: [/* @__PURE__ */ q("div", {
1355
- className: "flex flex-wrap items-center gap-x-2 gap-y-1 border-b px-2 py-1.5",
1356
- children: [
1357
- /* @__PURE__ */ K(d, {
1358
- variant: _t(e.operation),
1359
- children: $(e.operation)
1360
- }),
1361
- /* @__PURE__ */ K("span", {
1362
- className: "text-xs text-muted-foreground",
1363
- children: Q(e.targetType)
1364
- }),
1365
- /* @__PURE__ */ K("span", {
1366
- className: "text-xs font-medium",
1367
- children: X(e) ?? null
1368
- }),
1369
- /* @__PURE__ */ K("span", {
1370
- className: "ml-auto truncate font-mono text-xs text-muted-foreground",
1371
- title: t("audit_target_key", { key: e.targetKey }),
1372
- children: t("audit_target_key", { key: e.targetKey })
1373
- })
1374
- ]
1375
- }), n.length > 0 ? /* @__PURE__ */ q(D, {
1376
- className: "table-fixed text-xs",
1377
- children: [/* @__PURE__ */ K(E, { children: /* @__PURE__ */ q(S, { children: [/* @__PURE__ */ K(T, {
1378
- className: "w-1/4",
1379
- children: t("audit_field")
1380
- }), i ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(T, { children: t("audit_before") }), /* @__PURE__ */ K(T, { children: t("audit_after") })] }) : /* @__PURE__ */ K(T, { children: t("audit_value") })] }) }), /* @__PURE__ */ K(w, { children: n.map((e) => /* @__PURE__ */ q(S, {
1381
- className: "\n font-mono\n hover:bg-transparent\n ",
1382
- children: [/* @__PURE__ */ K(C, {
1383
- className: "py-1 align-top break-all whitespace-normal text-muted-foreground",
1384
- children: e.field
1385
- }), i ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(C, {
1386
- className: "py-1 align-top break-all whitespace-pre-wrap",
1387
- children: e.before ?? "—"
1388
- }), /* @__PURE__ */ K(C, {
1389
- className: "py-1 align-top break-all whitespace-pre-wrap",
1390
- children: e.after ?? "—"
1391
- })] }) : /* @__PURE__ */ K(C, {
1392
- className: "py-1 align-top break-all whitespace-pre-wrap",
1393
- children: e.after ?? e.before ?? "—"
1394
- })]
1395
- }, e.field)) })]
1396
- }) : null]
1397
- });
1398
- }
1399
- //#endregion
1400
- export { dt as n, $e as r, mt as t };