@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
@@ -0,0 +1,949 @@
1
+ import { a as e, f as t, l as n, m as r, o as i } from "./i18n-ChjEbYEg.js";
2
+ import { J as a, Mt as o, N as s, Nt as c, Ot as l, at as u, ct as d, jt as f, kt as p, lt as m, st as h, ut as g, wt as _ } from "./alert-dialog-D_iDv2lQ.js";
3
+ import { c as v, d as y, f as b, g as x, l as S, q as C, t as ee } from "./spinner-B-KLtBjp.js";
4
+ import * as w from "react";
5
+ import { createContext as te, useCallback as ne, useContext as re, useEffect as T, useMemo as ie, useRef as E, useState as D } from "react";
6
+ import { Toaster as ae } from "sonner";
7
+ import { Fragment as oe, jsx as O, jsxs as k } from "react/jsx-runtime";
8
+ import { BellIcon as A, CalendarIcon as j, ChevronDownIcon as se, ChevronLeftIcon as ce, ChevronRightIcon as le, CircleCheckIcon as ue, InfoIcon as de, MoreHorizontalIcon as fe, OctagonXIcon as pe, TriangleAlertIcon as M, XIcon as N } from "lucide-react";
9
+ import { cva as P } from "class-variance-authority";
10
+ import { formatAppDateTime as F, parseAppDateTime as I, parseExactAppDateTime as L } from "@overvis/hmi-shared";
11
+ import { Dialog as R } from "@base-ui/react/dialog";
12
+ import { mergeProps as z } from "@base-ui/react/merge-props";
13
+ import { useRender as B } from "@base-ui/react/use-render";
14
+ import { DayPicker as me, getDefaultClassNames as V } from "react-day-picker";
15
+ import { Radio as H } from "@base-ui/react/radio";
16
+ import { RadioGroup as he } from "@base-ui/react/radio-group";
17
+ import { Tabs as U } from "@base-ui/react/tabs";
18
+ // src/ui/breadcrumb.tsx
19
+ function ge({ className: e, ...t }) {
20
+ let n = r();
21
+ return /* @__PURE__ */ O("nav", {
22
+ "aria-label": n("ui_breadcrumb"),
23
+ "data-slot": "breadcrumb",
24
+ className: c(e),
25
+ ...t
26
+ });
27
+ }
28
+ function _e({ className: e, ...t }) {
29
+ return /* @__PURE__ */ O("ol", {
30
+ "data-slot": "breadcrumb-list",
31
+ className: c("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground", e),
32
+ ...t
33
+ });
34
+ }
35
+ function ve({ className: e, ...t }) {
36
+ return /* @__PURE__ */ O("li", {
37
+ "data-slot": "breadcrumb-item",
38
+ className: c("inline-flex items-center gap-1", e),
39
+ ...t
40
+ });
41
+ }
42
+ function ye({ className: e, render: t, ...n }) {
43
+ return B({
44
+ defaultTagName: "a",
45
+ props: z({ className: c("\n transition-colors\n hover:text-foreground\n ", e) }, n),
46
+ render: t,
47
+ state: { slot: "breadcrumb-link" }
48
+ });
49
+ }
50
+ function be({ className: e, ...t }) {
51
+ return /* @__PURE__ */ O("span", {
52
+ "data-slot": "breadcrumb-page",
53
+ role: "link",
54
+ "aria-disabled": "true",
55
+ "aria-current": "page",
56
+ className: c("font-normal text-foreground", e),
57
+ ...t
58
+ });
59
+ }
60
+ function xe({ children: e, className: t, ...n }) {
61
+ return /* @__PURE__ */ O("li", {
62
+ "data-slot": "breadcrumb-separator",
63
+ role: "presentation",
64
+ "aria-hidden": "true",
65
+ className: c("[&>svg]:size-3.5", t),
66
+ ...n,
67
+ children: e ?? /* @__PURE__ */ O(le, {})
68
+ });
69
+ }
70
+ function Se({ className: e, ...t }) {
71
+ let n = r();
72
+ return /* @__PURE__ */ k("span", {
73
+ "data-slot": "breadcrumb-ellipsis",
74
+ role: "presentation",
75
+ "aria-hidden": "true",
76
+ className: c("\n flex size-5 items-center justify-center\n [&>svg]:size-4\n ", e),
77
+ ...t,
78
+ children: [/* @__PURE__ */ O(fe, {}), /* @__PURE__ */ O("span", {
79
+ className: "sr-only",
80
+ children: n("ui_more")
81
+ })]
82
+ });
83
+ }
84
+ // src/ui/calendar.tsx
85
+ function Ce({ className: e, rootRef: t, ...n }) {
86
+ return /* @__PURE__ */ O("div", {
87
+ "data-slot": "calendar",
88
+ ref: t,
89
+ className: c(e),
90
+ ...n
91
+ });
92
+ }
93
+ function we({ className: e, orientation: t, ...n }) {
94
+ return O(t === "left" ? ce : t === "right" ? le : se, {
95
+ className: c("size-4", e),
96
+ ...n
97
+ });
98
+ }
99
+ function W({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", locale: a, formatters: s, components: l, ...u }) {
100
+ let d = V();
101
+ return /* @__PURE__ */ O(me, {
102
+ showOutsideDays: n,
103
+ className: c("\n group/calendar bg-background p-2 [--cell-radius:var(--radius-md)]\n [--cell-size:--spacing(7)]\n in-data-[slot=card-content]:bg-transparent\n in-data-[slot=popover-content]:bg-transparent\n ", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
104
+ captionLayout: r,
105
+ locale: a,
106
+ formatters: {
107
+ formatMonthDropdown: (e) => e.toLocaleString(a?.code, { month: "short" }),
108
+ ...s
109
+ },
110
+ classNames: {
111
+ root: c("w-fit", d.root),
112
+ months: c("\n relative flex flex-col gap-4\n md:flex-row\n ", d.months),
113
+ month: c("flex w-full flex-col gap-4", d.month),
114
+ nav: c("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", d.nav),
115
+ button_previous: c(o({ variant: i }), "\n size-(--cell-size) p-0 select-none\n aria-disabled:opacity-50\n ", d.button_previous),
116
+ button_next: c(o({ variant: i }), "\n size-(--cell-size) p-0 select-none\n aria-disabled:opacity-50\n ", d.button_next),
117
+ month_caption: c("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", d.month_caption),
118
+ dropdowns: c("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", d.dropdowns),
119
+ dropdown_root: c("relative rounded-(--cell-radius)", d.dropdown_root),
120
+ dropdown: c("absolute inset-0 bg-popover opacity-0", d.dropdown),
121
+ caption_label: c("font-medium select-none", r === "label" ? "text-sm" : "\n flex items-center gap-1 rounded-(--cell-radius) text-sm\n [&>svg]:size-3.5 [&>svg]:text-muted-foreground\n ", d.caption_label),
122
+ month_grid: c("w-full border-collapse", d.month_grid),
123
+ weekdays: c("flex", d.weekdays),
124
+ weekday: c("\n flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground\n select-none\n ", d.weekday),
125
+ week: c("mt-2 flex w-full", d.week),
126
+ week_number_header: c("w-(--cell-size) select-none", d.week_number_header),
127
+ week_number: c("text-[0.8rem] text-muted-foreground select-none", d.week_number),
128
+ day: c("\n group/day relative aspect-square size-full rounded-(--cell-radius) p-0 text-center\n select-none\n [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)\n ", u.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", d.day),
129
+ range_start: c("\n relative isolate z-0 rounded-l-(--cell-radius) bg-muted\n after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted\n ", d.range_start),
130
+ range_middle: c("rounded-none", d.range_middle),
131
+ range_end: c("\n relative isolate z-0 rounded-r-(--cell-radius) bg-muted\n after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted\n ", d.range_end),
132
+ today: c("\n rounded-(--cell-radius) bg-muted text-foreground\n data-[selected=true]:rounded-none\n ", d.today),
133
+ outside: c("\n text-muted-foreground\n aria-selected:text-muted-foreground\n ", d.outside),
134
+ disabled: c("text-muted-foreground opacity-50", d.disabled),
135
+ hidden: c("invisible", d.hidden),
136
+ ...t
137
+ },
138
+ components: {
139
+ Root: Ce,
140
+ Chevron: we,
141
+ DayButton: ({ ...e }) => /* @__PURE__ */ O(G, {
142
+ ...e,
143
+ ...a == null ? {} : { locale: a }
144
+ }),
145
+ WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ O("td", {
146
+ ...t,
147
+ children: /* @__PURE__ */ O("div", {
148
+ className: "flex size-(--cell-size) items-center justify-center text-center",
149
+ children: e
150
+ })
151
+ }),
152
+ ...l
153
+ },
154
+ ...u
155
+ });
156
+ }
157
+ function G({ className: e, day: t, modifiers: n, locale: r, ...i }) {
158
+ let a = V(), o = w.useRef(null);
159
+ return w.useEffect(() => {
160
+ n.focused && o.current?.focus();
161
+ }, [n]), /* @__PURE__ */ O(f, {
162
+ variant: "ghost",
163
+ size: "icon",
164
+ "data-day": t.date.toLocaleDateString(r?.code),
165
+ "data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
166
+ "data-range-start": n.range_start,
167
+ "data-range-end": n.range_end,
168
+ "data-range-middle": n.range_middle,
169
+ className: c("\n relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col\n gap-1 border-0 leading-none font-normal\n group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10\n group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px]\n group-data-[focused=true]/day:ring-ring/50\n data-[range-end=true]:rounded-(--cell-radius)\n data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary\n data-[range-end=true]:text-primary-foreground\n data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted\n data-[range-middle=true]:text-foreground\n data-[range-start=true]:rounded-(--cell-radius)\n data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary\n data-[range-start=true]:text-primary-foreground\n data-[selected-single=true]:bg-primary\n data-[selected-single=true]:text-primary-foreground\n dark:hover:text-foreground\n [&>span]:text-xs [&>span]:opacity-70\n ", a.day, e),
170
+ ...i
171
+ });
172
+ }
173
+ // src/ui/date-time-picker.tsx
174
+ var K = "dddd-dd-dd dd:dd:dd";
175
+ function Te(e) {
176
+ return e.length < 19 && Array.from(e).every((e, t) => K[t] === "d" ? /^\d$/.test(e) : e === K[t]);
177
+ }
178
+ function Ee(e) {
179
+ return L(e) == null ? Te(e) ? "incomplete" : "invalid" : "valid";
180
+ }
181
+ function De(e, t = !1) {
182
+ if (t && e === "") return {
183
+ draft: "",
184
+ status: "valid"
185
+ };
186
+ let n = Ee(e);
187
+ if (n === "incomplete") return {
188
+ draft: e,
189
+ status: n
190
+ };
191
+ let r = I(e);
192
+ return r == null ? {
193
+ draft: e,
194
+ status: n
195
+ } : {
196
+ draft: F(r),
197
+ status: "valid"
198
+ };
199
+ }
200
+ function Oe(e) {
201
+ let t = I(e) ?? void 0;
202
+ return {
203
+ date: t,
204
+ time: t == null ? "00:00:00" : F(t).slice(11)
205
+ };
206
+ }
207
+ function q(e, t) {
208
+ let n = `${F(new Date(e.getFullYear(), e.getMonth(), e.getDate())).slice(0, 10)} ${t}`;
209
+ return L(n) == null ? null : n;
210
+ }
211
+ function ke(e) {
212
+ let t = I(e.from), n = I(e.to);
213
+ return t != null && n != null && t.getTime() >= n.getTime();
214
+ }
215
+ function J({ value: e, onValueChange: n, className: i, placeholder: a = t("ui_select_date_time"), disabled: o, id: s, optional: l = !1, ...u }) {
216
+ let d = r(), [p, m] = w.useState({
217
+ disabled: o,
218
+ open: !1
219
+ }), h = p.disabled === o ? p : {
220
+ disabled: o,
221
+ open: !1
222
+ }, { draft: g, status: _ } = De(e, l), { date: S, time: C } = Oe(e);
223
+ return /* @__PURE__ */ k("div", {
224
+ "data-slot": "date-time-picker",
225
+ className: c("space-y-1", i),
226
+ children: [/* @__PURE__ */ k("div", {
227
+ className: "flex gap-1",
228
+ children: [/* @__PURE__ */ O(v, {
229
+ ...u,
230
+ id: s,
231
+ value: g,
232
+ placeholder: a,
233
+ disabled: o,
234
+ "aria-invalid": _ === "invalid",
235
+ onChange: (e) => {
236
+ n(e.currentTarget.value);
237
+ }
238
+ }), o === !0 ? /* @__PURE__ */ O(f, {
239
+ type: "button",
240
+ variant: "outline",
241
+ size: "icon",
242
+ disabled: !0,
243
+ "aria-label": a,
244
+ children: /* @__PURE__ */ O(j, {})
245
+ }) : /* @__PURE__ */ k(y, {
246
+ open: h.open,
247
+ onOpenChange: (e) => {
248
+ m({
249
+ disabled: o,
250
+ open: e
251
+ });
252
+ },
253
+ children: [/* @__PURE__ */ O(x, {
254
+ render: /* @__PURE__ */ O(f, {
255
+ type: "button",
256
+ variant: "outline",
257
+ size: "icon",
258
+ "aria-label": a
259
+ }),
260
+ children: /* @__PURE__ */ O(j, {})
261
+ }), /* @__PURE__ */ k(b, {
262
+ "aria-label": a,
263
+ align: "end",
264
+ className: "w-auto",
265
+ children: [/* @__PURE__ */ O(W, {
266
+ mode: "single",
267
+ labels: { labelNav: () => a },
268
+ ...S == null ? {} : {
269
+ selected: S,
270
+ defaultMonth: S
271
+ },
272
+ onSelect: (e) => {
273
+ if (e == null) return;
274
+ let t = q(e, C);
275
+ t != null && n(t);
276
+ }
277
+ }), /* @__PURE__ */ O(v, {
278
+ type: "time",
279
+ step: 1,
280
+ value: C,
281
+ "aria-label": a,
282
+ onChange: (e) => {
283
+ let t = q(S ?? /* @__PURE__ */ new Date(), e.currentTarget.value);
284
+ t != null && n(t);
285
+ }
286
+ })]
287
+ })]
288
+ })]
289
+ }), _ === "invalid" ? /* @__PURE__ */ O("p", {
290
+ role: "alert",
291
+ className: "text-xs text-destructive",
292
+ children: d("ui_invalid_date_time")
293
+ }) : _ === "incomplete" ? /* @__PURE__ */ O("p", {
294
+ className: "text-xs text-muted-foreground",
295
+ children: d("ui_incomplete_date_time")
296
+ }) : null]
297
+ });
298
+ }
299
+ function Ae({ value: e, onValueChange: t, className: n, disabled: i, optional: a = !1 }) {
300
+ let o = r(), s = ke(e);
301
+ return /* @__PURE__ */ k("div", {
302
+ "data-slot": "date-time-range-picker",
303
+ className: c("space-y-1", n),
304
+ children: [/* @__PURE__ */ k("div", {
305
+ className: c("grid gap-2", "sm:grid-cols-2"),
306
+ children: [/* @__PURE__ */ O(J, {
307
+ value: e.from,
308
+ disabled: i,
309
+ optional: a,
310
+ "aria-label": o("ui_start_date_time"),
311
+ placeholder: o("ui_start_date_time"),
312
+ onValueChange: (n) => {
313
+ t({
314
+ ...e,
315
+ from: n
316
+ });
317
+ }
318
+ }), /* @__PURE__ */ O(J, {
319
+ value: e.to,
320
+ disabled: i,
321
+ optional: a,
322
+ "aria-label": o("ui_end_date_time"),
323
+ placeholder: o("ui_end_date_time"),
324
+ onValueChange: (n) => {
325
+ t({
326
+ ...e,
327
+ to: n
328
+ });
329
+ }
330
+ })]
331
+ }), s && /* @__PURE__ */ O("p", {
332
+ role: "alert",
333
+ className: "text-xs text-destructive",
334
+ children: o("ui_invalid_date_time_range")
335
+ })]
336
+ });
337
+ }
338
+ // src/ui/item.tsx
339
+ function je({ className: e, ...t }) {
340
+ return /* @__PURE__ */ O("div", {
341
+ "data-slot": "item-group",
342
+ className: c("\n group/item-group flex w-full flex-col gap-4\n has-data-[size=sm]:gap-2.5\n has-data-[size=xs]:gap-2\n ", e),
343
+ ...t
344
+ });
345
+ }
346
+ function Me({ className: e, ...t }) {
347
+ return /* @__PURE__ */ O(C, {
348
+ "data-slot": "item-separator",
349
+ orientation: "horizontal",
350
+ className: c("my-2", e),
351
+ ...t
352
+ });
353
+ }
354
+ var Ne = P("\n group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors\n duration-100 outline-none\n focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\n [a]:transition-colors\n [a]:hover:bg-muted\n ", {
355
+ variants: {
356
+ variant: {
357
+ default: "border-transparent",
358
+ outline: "border-border",
359
+ muted: "border-transparent bg-muted/50"
360
+ },
361
+ size: {
362
+ default: "gap-2.5 px-3 py-2.5",
363
+ sm: "gap-2.5 px-3 py-2.5",
364
+ xs: "\n gap-2 px-2.5 py-2\n in-data-[slot=dropdown-menu-content]:p-0\n "
365
+ }
366
+ },
367
+ defaultVariants: {
368
+ variant: "default",
369
+ size: "default"
370
+ }
371
+ });
372
+ function Pe({ className: e, variant: t = "default", size: n = "default", render: r, ...i }) {
373
+ return B({
374
+ defaultTagName: "div",
375
+ props: z({ className: c(Ne({
376
+ variant: t,
377
+ size: n,
378
+ className: e
379
+ })) }, i),
380
+ render: r,
381
+ state: {
382
+ slot: "item",
383
+ variant: t,
384
+ size: n
385
+ }
386
+ });
387
+ }
388
+ var Fe = P("\n flex shrink-0 items-center justify-center gap-2\n group-has-data-[slot=item-description]/item:translate-y-0.5\n group-has-data-[slot=item-description]/item:self-start\n [&_svg]:pointer-events-none\n ", {
389
+ variants: { variant: {
390
+ default: "bg-transparent",
391
+ icon: "[&_svg:not([class*='size-'])]:size-4",
392
+ image: "\n size-10 overflow-hidden rounded-sm\n group-data-[size=sm]/item:size-8\n group-data-[size=xs]/item:size-6\n [&_img]:size-full [&_img]:object-cover\n "
393
+ } },
394
+ defaultVariants: { variant: "default" }
395
+ });
396
+ function Ie({ className: e, variant: t = "default", ...n }) {
397
+ return /* @__PURE__ */ O("div", {
398
+ "data-slot": "item-media",
399
+ "data-variant": t,
400
+ className: c(Fe({
401
+ variant: t,
402
+ className: e
403
+ })),
404
+ ...n
405
+ });
406
+ }
407
+ function Le({ className: e, ...t }) {
408
+ return /* @__PURE__ */ O("div", {
409
+ "data-slot": "item-content",
410
+ className: c("\n flex flex-1 flex-col gap-1\n group-data-[size=xs]/item:gap-0\n [&+[data-slot=item-content]]:flex-none\n ", e),
411
+ ...t
412
+ });
413
+ }
414
+ function Re({ className: e, ...t }) {
415
+ return /* @__PURE__ */ O("div", {
416
+ "data-slot": "item-title",
417
+ className: c("line-clamp-1 flex w-fit items-center gap-2 text-sm/snug font-medium underline-offset-4", e),
418
+ ...t
419
+ });
420
+ }
421
+ function ze({ className: e, ...t }) {
422
+ return /* @__PURE__ */ O("p", {
423
+ "data-slot": "item-description",
424
+ className: c("\n line-clamp-2 text-left text-sm/normal font-normal text-muted-foreground\n group-data-[size=xs]/item:text-xs\n [&>a]:underline [&>a]:underline-offset-4\n [&>a:hover]:text-primary\n ", e),
425
+ ...t
426
+ });
427
+ }
428
+ function Be({ className: e, ...t }) {
429
+ return /* @__PURE__ */ O("div", {
430
+ "data-slot": "item-actions",
431
+ className: c("flex items-center gap-2", e),
432
+ ...t
433
+ });
434
+ }
435
+ function Ve({ className: e, ...t }) {
436
+ return /* @__PURE__ */ O("div", {
437
+ "data-slot": "item-header",
438
+ className: c("flex basis-full items-center justify-between gap-2", e),
439
+ ...t
440
+ });
441
+ }
442
+ function He({ className: e, ...t }) {
443
+ return /* @__PURE__ */ O("div", {
444
+ "data-slot": "item-footer",
445
+ className: c("flex basis-full items-center justify-between gap-2", e),
446
+ ...t
447
+ });
448
+ }
449
+ // src/ui/page-header.tsx
450
+ function Ue({ icon: e, breadcrumbs: t, title: n, description: r, titleActions: i, actions: a, children: o, className: l, ...u }) {
451
+ return /* @__PURE__ */ k("header", {
452
+ "data-slot": "page-header",
453
+ className: c("flex flex-col gap-3 px-4 py-3", l),
454
+ ...u,
455
+ children: [
456
+ /* @__PURE__ */ k("div", {
457
+ className: "flex flex-wrap items-center gap-x-4 gap-y-2",
458
+ children: [/* @__PURE__ */ k("div", {
459
+ className: "flex min-w-0 flex-1 basis-56 flex-col gap-0.5",
460
+ children: [
461
+ t == null ? null : /* @__PURE__ */ O("div", {
462
+ className: "min-w-0 pb-0.5",
463
+ children: t
464
+ }),
465
+ /* @__PURE__ */ k("div", {
466
+ className: "flex w-fit max-w-full min-w-0 items-center gap-2.5",
467
+ children: [
468
+ e == null ? null : /* @__PURE__ */ O("span", {
469
+ className: "\n flex shrink-0 text-muted-foreground\n [&_svg]:size-6\n ",
470
+ children: e
471
+ }),
472
+ /* @__PURE__ */ O(s, {
473
+ size: "large",
474
+ className: "w-fit max-w-full truncate",
475
+ children: n
476
+ }),
477
+ i == null ? null : /* @__PURE__ */ O("div", {
478
+ className: "flex shrink-0 items-center gap-1.5",
479
+ children: i
480
+ })
481
+ ]
482
+ }),
483
+ r == null ? null : /* @__PURE__ */ O("div", {
484
+ className: c("min-w-0 text-[13px] text-muted-foreground", e != null && "sm:pl-8.5"),
485
+ children: r
486
+ })
487
+ ]
488
+ }), a == null ? null : /* @__PURE__ */ O("div", {
489
+ className: "ml-auto flex shrink-0 flex-wrap items-center gap-1.5",
490
+ children: a
491
+ })]
492
+ }),
493
+ o,
494
+ /* @__PURE__ */ O(C, {})
495
+ ]
496
+ });
497
+ }
498
+ // src/ui/radio-group.tsx
499
+ function We({ className: e, ...t }) {
500
+ return /* @__PURE__ */ O(he, {
501
+ "data-slot": "radio-group",
502
+ className: c("grid w-full gap-2", e),
503
+ ...t
504
+ });
505
+ }
506
+ function Ge({ className: e, ...t }) {
507
+ return /* @__PURE__ */ O(H.Root, {
508
+ "data-slot": "radio-group-item",
509
+ className: c("\n group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full\n border border-input outline-none\n group-has-focus-visible/field-label:ring-0\n group-has-focus-visible/field-label:not-data-checked:border-input\n after:absolute after:-inset-x-3 after:-inset-y-2\n focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\n disabled:cursor-not-allowed disabled:opacity-50\n aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20\n aria-invalid:aria-checked:border-primary\n dark:bg-input/30\n dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\n data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground\n group-has-focus-visible/field-label:data-checked:border-primary\n dark:data-checked:bg-primary\n ", e),
510
+ ...t,
511
+ children: /* @__PURE__ */ O(H.Indicator, {
512
+ "data-slot": "radio-group-indicator",
513
+ className: "flex size-4 items-center justify-center",
514
+ children: /* @__PURE__ */ O("span", { className: "\n absolute top-1/2 left-1/2 size-2 -translate-1/2 rounded-full bg-primary-foreground\n " })
515
+ })
516
+ });
517
+ }
518
+ // src/ui/sheet.tsx
519
+ function Y(e) {
520
+ return /* @__PURE__ */ O(R.Root, {
521
+ "data-slot": "sheet",
522
+ ...a(e)
523
+ });
524
+ }
525
+ function X({ ...e }) {
526
+ return /* @__PURE__ */ O(R.Trigger, {
527
+ "data-slot": "sheet-trigger",
528
+ ...e
529
+ });
530
+ }
531
+ function Ke({ ...e }) {
532
+ return /* @__PURE__ */ O(R.Close, {
533
+ "data-slot": "sheet-close",
534
+ ...e
535
+ });
536
+ }
537
+ function qe({ ...e }) {
538
+ let t = p(), n = t?.container;
539
+ return t != null && n == null ? null : /* @__PURE__ */ O(R.Portal, {
540
+ "data-slot": "sheet-portal",
541
+ ...e,
542
+ container: n ?? void 0
543
+ });
544
+ }
545
+ function Je({ className: e, ...t }) {
546
+ l();
547
+ let n = p();
548
+ return /* @__PURE__ */ O(R.Backdrop, {
549
+ "data-slot": "sheet-overlay",
550
+ forceRender: !0,
551
+ className: c("\n inset-0 z-50 bg-black/10 transition-opacity duration-150\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n supports-backdrop-filter:backdrop-blur-xs\n ", n?.container == null ? "fixed" : "absolute", e),
552
+ ...t
553
+ });
554
+ }
555
+ function Ye({ className: e, children: t, side: n = "right", showCloseButton: i = !0, onKeyDown: a, ...o }) {
556
+ let s = r(), l = p();
557
+ return /* @__PURE__ */ k(qe, { children: [/* @__PURE__ */ O(Je, {}), /* @__PURE__ */ k(R.Popup, {
558
+ "data-slot": "sheet-content",
559
+ "data-side": n,
560
+ className: c("\n z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground\n shadow-lg transition duration-200 ease-in-out\n data-ending-style:opacity-0\n data-starting-style:opacity-0\n data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto\n data-[side=bottom]:border-t\n data-[side=bottom]:data-ending-style:translate-y-10\n data-[side=bottom]:data-starting-style:translate-y-10\n data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full\n data-[side=left]:w-3/4 data-[side=left]:border-r\n data-[side=left]:data-ending-style:-translate-x-10\n data-[side=left]:data-starting-style:-translate-x-10\n data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full\n data-[side=right]:w-3/4 data-[side=right]:border-l\n data-[side=right]:data-ending-style:translate-x-10\n data-[side=right]:data-starting-style:translate-x-10\n data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto\n data-[side=top]:border-b\n data-[side=top]:data-ending-style:-translate-y-10\n data-[side=top]:data-starting-style:-translate-y-10\n data-[side=left]:sm:max-w-sm\n data-[side=right]:sm:max-w-sm\n ", l?.container == null ? "fixed" : "absolute", e),
561
+ ...o,
562
+ onKeyDown: (e) => {
563
+ _(e, e.currentTarget), a?.(e);
564
+ },
565
+ children: [t, i ? /* @__PURE__ */ k(R.Close, {
566
+ "data-slot": "sheet-close",
567
+ render: /* @__PURE__ */ O(f, {
568
+ variant: "ghost",
569
+ className: "absolute top-3 right-3",
570
+ size: "icon-sm"
571
+ }),
572
+ children: [/* @__PURE__ */ O(N, {}), /* @__PURE__ */ O("span", {
573
+ className: "sr-only",
574
+ children: s("action_close")
575
+ })]
576
+ }) : null]
577
+ })] });
578
+ }
579
+ function Xe({ className: e, ...t }) {
580
+ return /* @__PURE__ */ O("div", {
581
+ "data-slot": "sheet-header",
582
+ className: c("flex flex-col gap-0.5 p-4", e),
583
+ ...t
584
+ });
585
+ }
586
+ function Ze({ className: e, ...t }) {
587
+ return /* @__PURE__ */ O("div", {
588
+ "data-slot": "sheet-footer",
589
+ className: c("mt-auto flex flex-col gap-2 p-4", e),
590
+ ...t
591
+ });
592
+ }
593
+ function Qe({ className: e, ...t }) {
594
+ return /* @__PURE__ */ O(R.Title, {
595
+ "data-slot": "sheet-title",
596
+ className: c("font-heading text-base font-medium text-foreground", e),
597
+ ...t
598
+ });
599
+ }
600
+ function $e({ className: e, ...t }) {
601
+ return /* @__PURE__ */ O(R.Description, {
602
+ "data-slot": "sheet-description",
603
+ className: c("text-sm text-muted-foreground", e),
604
+ ...t
605
+ });
606
+ }
607
+ // src/theme-provider.tsx
608
+ var et = te(void 0);
609
+ function tt(e) {
610
+ return e === "dark" || e === "light" || e === "system";
611
+ }
612
+ function nt() {
613
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
614
+ }
615
+ function rt(e) {
616
+ let t = window.document.documentElement;
617
+ t.classList.remove("light", "dark"), t.classList.add(e);
618
+ }
619
+ function it(e, t) {
620
+ try {
621
+ let n = localStorage.getItem(e);
622
+ return tt(n) ? n : t;
623
+ } catch {
624
+ return t;
625
+ }
626
+ }
627
+ function at({ children: e, defaultTheme: t = "system", storageKey: n = "vite-ui-theme" }) {
628
+ let [r, i] = D(() => it(n, t)), [a, o] = D(nt), s = r === "system" ? a : r;
629
+ T(() => {
630
+ rt(s);
631
+ }, [s]), T(() => {
632
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
633
+ function t() {
634
+ o(e.matches ? "dark" : "light");
635
+ }
636
+ return e.addEventListener("change", t), () => {
637
+ e.removeEventListener("change", t);
638
+ };
639
+ }, []);
640
+ let c = ne((e) => {
641
+ try {
642
+ localStorage.setItem(n, e);
643
+ } catch {}
644
+ i(e);
645
+ }, [n]), l = ie(() => ({
646
+ theme: r,
647
+ resolvedTheme: s,
648
+ setTheme: c
649
+ }), [
650
+ r,
651
+ s,
652
+ c
653
+ ]);
654
+ return /* @__PURE__ */ O(et.Provider, {
655
+ value: l,
656
+ children: e
657
+ });
658
+ }
659
+ function ot() {
660
+ let e = re(et);
661
+ if (e === void 0) throw Error("useTheme must be used within a ThemeProvider");
662
+ return e;
663
+ }
664
+ // src/ui/sonner.tsx
665
+ var st = ({ ...e }) => {
666
+ let { resolvedTheme: t } = ot(), n = r();
667
+ return /* @__PURE__ */ O(ae, {
668
+ theme: t,
669
+ className: "toaster group font-sans",
670
+ gap: 10,
671
+ icons: {
672
+ success: /* @__PURE__ */ O(ue, { className: "size-4" }),
673
+ info: /* @__PURE__ */ O(de, { className: "size-4" }),
674
+ warning: /* @__PURE__ */ O(M, { className: "size-4" }),
675
+ error: /* @__PURE__ */ O(pe, { className: "size-4" }),
676
+ loading: /* @__PURE__ */ O(ee, { className: "size-4" }),
677
+ close: /* @__PURE__ */ O(N, { className: "size-3.5" })
678
+ },
679
+ toastOptions: {
680
+ unstyled: !0,
681
+ closeButton: !0,
682
+ closeButtonAriaLabel: n("messages_toast_close"),
683
+ classNames: {
684
+ toast: "\n group/toast flex w-(--width) items-start gap-3 rounded-lg border bg-popover py-3 pr-10\n pl-3 text-sm text-popover-foreground shadow-lg shadow-black/5 outline-none\n focus-visible:ring-3 focus-visible:ring-ring/50\n data-[expanded=false]:data-[front=false]:*:opacity-0\n dark:shadow-black/30\n ",
685
+ success: "\n [--toast-accent:var(--color-emerald-600)]\n dark:[--toast-accent:var(--color-emerald-400)]\n ",
686
+ info: "\n [--toast-accent:var(--color-sky-600)]\n dark:[--toast-accent:var(--color-sky-400)]\n ",
687
+ warning: "\n [--toast-accent:var(--color-amber-600)]\n dark:[--toast-accent:var(--color-amber-400)]\n ",
688
+ error: "[--toast-accent:var(--destructive)]",
689
+ loading: "[--toast-accent:var(--muted-foreground)]",
690
+ icon: "\n flex size-7 shrink-0 items-center justify-center rounded-md bg-(--toast-accent)/12\n text-(--toast-accent)\n empty:hidden\n ",
691
+ content: "flex min-w-0 flex-1 flex-col gap-0.5 self-center",
692
+ title: "leading-5 font-medium wrap-anywhere",
693
+ description: "text-[13px]/5 wrap-anywhere text-muted-foreground",
694
+ actionButton: "\n inline-flex h-7 shrink-0 cursor-pointer items-center self-center rounded-md border\n bg-background px-2.5 text-xs font-medium shadow-xs transition-colors outline-none\n hover:bg-accent hover:text-accent-foreground\n focus-visible:ring-3 focus-visible:ring-ring/50\n ",
695
+ cancelButton: "\n inline-flex h-7 shrink-0 cursor-pointer items-center self-center rounded-md px-2.5\n text-xs font-medium text-muted-foreground transition-colors outline-none\n hover:bg-accent hover:text-accent-foreground\n focus-visible:ring-3 focus-visible:ring-ring/50\n ",
696
+ closeButton: "\n absolute top-2 right-2 flex size-6 cursor-pointer items-center justify-center rounded-md\n border-0 bg-transparent! text-muted-foreground! opacity-0 transition-opacity outline-none\n group-hover/toast:opacity-100\n hover:bg-accent! hover:text-accent-foreground!\n focus-visible:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50\n pointer-coarse:opacity-100\n "
697
+ }
698
+ },
699
+ ...e
700
+ });
701
+ };
702
+ // src/ui/tabs.tsx
703
+ function ct({ className: e, orientation: t = "horizontal", ...n }) {
704
+ return /* @__PURE__ */ O(U.Root, {
705
+ "data-slot": "tabs",
706
+ "data-orientation": t,
707
+ className: c("\n group/tabs flex gap-2\n data-horizontal:flex-col\n ", e),
708
+ ...n
709
+ });
710
+ }
711
+ var lt = P("\n group/tabs-list inline-flex w-fit items-center justify-center rounded-lg text-muted-foreground\n group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col\n data-[variant=line]:rounded-none\n ", {
712
+ variants: {
713
+ variant: {
714
+ default: "bg-muted",
715
+ line: "gap-1 bg-transparent"
716
+ },
717
+ size: {
718
+ default: "\n p-[3px]\n group-data-horizontal/tabs:h-8\n ",
719
+ sm: "\n p-0.5\n group-data-horizontal/tabs:h-7\n "
720
+ }
721
+ },
722
+ defaultVariants: {
723
+ variant: "default",
724
+ size: "default"
725
+ }
726
+ });
727
+ function Z({ className: e, variant: t = "default", size: n = "default", ...r }) {
728
+ return /* @__PURE__ */ O(U.List, {
729
+ "data-slot": "tabs-list",
730
+ "data-variant": t,
731
+ "data-size": n,
732
+ className: c(lt({
733
+ variant: t,
734
+ size: n
735
+ }), e),
736
+ ...r
737
+ });
738
+ }
739
+ function Q({ className: e, ...t }) {
740
+ return /* @__PURE__ */ O(U.Tab, {
741
+ "data-slot": "tabs-trigger",
742
+ className: c("\n relative inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center\n gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium\n whitespace-nowrap text-foreground/60 transition-all\n group-data-[size=sm]/tabs-list:px-2 group-data-[size=sm]/tabs-list:text-xs\n group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start\n hover:text-foreground\n focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\n focus-visible:outline-1 focus-visible:outline-ring\n disabled:pointer-events-none disabled:opacity-50\n has-data-[icon=inline-end]:pr-1\n has-data-[icon=inline-start]:pl-1\n aria-disabled:pointer-events-none aria-disabled:opacity-50\n dark:text-muted-foreground\n dark:hover:text-foreground\n group-data-[variant=default]/tabs-list:data-active:shadow-sm\n group-data-[variant=line]/tabs-list:data-active:shadow-none\n [&_svg]:pointer-events-none [&_svg]:shrink-0\n [&_svg:not([class*='size-'])]:size-4\n ", "\n group-data-[variant=line]/tabs-list:bg-transparent\n group-data-[variant=line]/tabs-list:data-active:bg-transparent\n dark:group-data-[variant=line]/tabs-list:data-active:border-transparent\n dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent\n ", "\n data-active:bg-background data-active:text-foreground\n dark:data-active:border-input dark:data-active:bg-input/30\n dark:data-active:text-foreground\n ", "\n after:absolute after:bg-foreground after:opacity-0 after:transition-opacity\n group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px]\n group-data-horizontal/tabs:after:h-0.5\n group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1\n group-data-vertical/tabs:after:w-0.5\n group-data-[variant=line]/tabs-list:data-active:after:opacity-100\n ", e),
743
+ ...t
744
+ });
745
+ }
746
+ function $({ className: e, ...t }) {
747
+ return /* @__PURE__ */ O(U.Panel, {
748
+ "data-slot": "tabs-content",
749
+ className: c("flex-1 text-sm outline-none", e),
750
+ ...t
751
+ });
752
+ }
753
+ // src/ui/message-history/panel.tsx
754
+ var ut = {
755
+ success: ue,
756
+ info: de,
757
+ warning: M,
758
+ error: pe
759
+ }, dt = {
760
+ success: "messages_kind_success",
761
+ info: "messages_kind_info",
762
+ warning: "messages_kind_warning",
763
+ error: "messages_kind_error"
764
+ };
765
+ function ft({ message: e, active: t }) {
766
+ let a = r(), o = i(), s = E(null);
767
+ T(() => {
768
+ if (!t || e.seen || !s.current) return;
769
+ let n = !1, r = () => {
770
+ n && document.visibilityState === "visible" && document.hasFocus() && o.markSeen([e.id]);
771
+ }, i = new IntersectionObserver((e) => {
772
+ n = e.some((e) => e.isIntersecting && e.intersectionRatio > 0), r();
773
+ });
774
+ return i.observe(s.current), document.addEventListener("visibilitychange", r), window.addEventListener("focus", r), () => {
775
+ i.disconnect(), document.removeEventListener("visibilitychange", r), window.removeEventListener("focus", r);
776
+ };
777
+ }, [
778
+ t,
779
+ e.id,
780
+ e.seen,
781
+ o
782
+ ]);
783
+ let l = ut[e.kind], u = n(e.scope.href);
784
+ return /* @__PURE__ */ k("li", {
785
+ ref: s,
786
+ className: c("flex gap-3 px-5 py-3", e.kind === "error" && "bg-destructive/5"),
787
+ children: [
788
+ /* @__PURE__ */ O(l, {
789
+ "aria-hidden": "true",
790
+ className: c("mt-0.5 size-4 shrink-0", {
791
+ "text-destructive": e.kind === "error",
792
+ "text-amber-600 dark:text-amber-400": e.kind === "warning",
793
+ "text-green-600 dark:text-green-400": e.kind === "success",
794
+ "text-muted-foreground": e.kind === "info"
795
+ })
796
+ }),
797
+ /* @__PURE__ */ k("div", {
798
+ className: "min-w-0 flex-1",
799
+ children: [
800
+ /* @__PURE__ */ O("span", {
801
+ className: "sr-only",
802
+ children: a(dt[e.kind])
803
+ }),
804
+ /* @__PURE__ */ O("p", {
805
+ className: "wrap-anywhere whitespace-pre-wrap",
806
+ children: e.text
807
+ }),
808
+ /* @__PURE__ */ k("div", {
809
+ className: "\n mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground\n *:not-first:before:mr-2 *:not-first:before:inline-block *:not-first:before:font-normal\n *:not-first:before:text-muted-foreground *:not-first:before:content-['·'/'']\n ",
810
+ children: [
811
+ /* @__PURE__ */ O("time", {
812
+ dateTime: new Date(e.time).toISOString(),
813
+ children: F(e.time)
814
+ }),
815
+ e.scope.workspaceId ? /* @__PURE__ */ O("span", {
816
+ className: "min-w-0 wrap-anywhere",
817
+ children: e.scope.workspaceName ?? e.scope.workspaceId
818
+ }) : null,
819
+ u ? /* @__PURE__ */ O("a", {
820
+ href: u,
821
+ className: "\n font-medium text-primary underline-offset-4\n hover:underline\n ",
822
+ children: a("messages_open")
823
+ }) : null
824
+ ]
825
+ })
826
+ ]
827
+ }),
828
+ e.seen ? null : /* @__PURE__ */ O("span", {
829
+ role: "img",
830
+ "aria-label": a("messages_unseen"),
831
+ className: "mt-1.5 size-2 shrink-0 rounded-full bg-primary"
832
+ })
833
+ ]
834
+ });
835
+ }
836
+ function pt({ notifications: t, notificationUnreadCount: n = 0 }) {
837
+ let a = r(), o = e(), s = i(), [c, l] = D(!1), [p, _] = D("messages"), v = o.some((e) => !e.seen), y = E(null), b = a(t == null ? "messages_tab" : "messages_title"), x = /* @__PURE__ */ O("div", {
838
+ className: "flex min-h-0 flex-1 flex-col text-sm",
839
+ children: o.length > 0 ? /* @__PURE__ */ k(oe, { children: [/* @__PURE__ */ k("div", {
840
+ className: "flex shrink-0 flex-wrap justify-end gap-1 border-b px-3 pb-2",
841
+ children: [/* @__PURE__ */ O(f, {
842
+ size: "sm",
843
+ variant: "ghost",
844
+ disabled: !v,
845
+ focusableWhenDisabled: !0,
846
+ className: "\n text-muted-foreground\n aria-disabled:opacity-40\n ",
847
+ onClick: () => {
848
+ s.markSeen(o.map((e) => e.id));
849
+ },
850
+ children: a("messages_mark_all")
851
+ }), /* @__PURE__ */ O(f, {
852
+ size: "sm",
853
+ variant: "ghost",
854
+ className: "text-muted-foreground",
855
+ onClick: () => {
856
+ y.current?.querySelector("[data-slot=\"sheet-close\"]")?.focus(), s.clear();
857
+ },
858
+ children: a("messages_clear")
859
+ })]
860
+ }), /* @__PURE__ */ O("ol", {
861
+ "aria-label": a("messages_tab"),
862
+ tabIndex: 0,
863
+ className: "\n min-h-0 flex-1 divide-y overflow-y-auto overscroll-contain outline-none\n focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset\n ",
864
+ children: o.map((e) => /* @__PURE__ */ O(ft, {
865
+ message: e,
866
+ active: c && (t == null || p === "messages")
867
+ }, e.id))
868
+ })] }) : /* @__PURE__ */ O(u, {
869
+ className: "justify-start px-8 py-16",
870
+ children: /* @__PURE__ */ k(d, { children: [
871
+ /* @__PURE__ */ O(m, {
872
+ variant: "icon",
873
+ children: /* @__PURE__ */ O(A, { "aria-hidden": "true" })
874
+ }),
875
+ /* @__PURE__ */ O(g, { children: a("messages_empty") }),
876
+ /* @__PURE__ */ O(h, { children: a("messages_empty_description") })
877
+ ] })
878
+ })
879
+ });
880
+ return /* @__PURE__ */ k(Y, {
881
+ open: c,
882
+ onOpenChange: (e) => {
883
+ e && t != null && n > 0 && _("notifications"), l(e);
884
+ },
885
+ children: [/* @__PURE__ */ k(X, {
886
+ render: /* @__PURE__ */ O(f, {
887
+ size: "icon",
888
+ variant: "ghost",
889
+ className: "relative",
890
+ "aria-label": [
891
+ b,
892
+ ...v ? [a("messages_unseen")] : [],
893
+ ...n > 0 ? [a("messages_notification_count", { count: n })] : []
894
+ ].join(". ")
895
+ }),
896
+ children: [/* @__PURE__ */ O(A, {}), n > 0 ? /* @__PURE__ */ O(S, {
897
+ "aria-hidden": "true",
898
+ className: "\n absolute -top-0.5 -right-0.5 h-4 min-w-4 justify-center rounded-full px-1 text-[10px]\n tabular-nums\n ",
899
+ children: n > 99 ? "99+" : n
900
+ }) : v ? /* @__PURE__ */ O("span", {
901
+ "aria-hidden": "true",
902
+ className: "absolute top-1 right-1 size-2 rounded-full bg-primary"
903
+ }) : null]
904
+ }), /* @__PURE__ */ k(Ye, {
905
+ ref: y,
906
+ className: "\n gap-0\n data-[side=right]:w-full\n data-[side=right]:sm:max-w-md\n ",
907
+ children: [
908
+ /* @__PURE__ */ O(Xe, {
909
+ className: "px-5 pt-3.5 pr-12 pb-3",
910
+ children: /* @__PURE__ */ O(Qe, { children: b })
911
+ }),
912
+ t == null ? x : /* @__PURE__ */ k(ct, {
913
+ value: p,
914
+ onValueChange: (e) => {
915
+ _(String(e));
916
+ },
917
+ className: "min-h-0 flex-1 gap-0",
918
+ children: [
919
+ /* @__PURE__ */ k(Z, {
920
+ className: "mx-5 mb-3 shrink-0",
921
+ children: [/* @__PURE__ */ O(Q, {
922
+ value: "messages",
923
+ children: a("messages_tab")
924
+ }), /* @__PURE__ */ O(Q, {
925
+ value: "notifications",
926
+ children: a("messages_notifications_tab")
927
+ })]
928
+ }),
929
+ /* @__PURE__ */ O($, {
930
+ value: "messages",
931
+ className: "flex min-h-0 flex-col",
932
+ children: x
933
+ }),
934
+ /* @__PURE__ */ O($, {
935
+ value: "notifications",
936
+ className: "min-h-0 overflow-y-auto overscroll-contain px-5",
937
+ children: t
938
+ })
939
+ ]
940
+ }),
941
+ t == null || p === "messages" ? /* @__PURE__ */ O($e, {
942
+ className: "shrink-0 border-t px-5 py-3 text-xs/relaxed",
943
+ children: a("messages_description")
944
+ }) : null
945
+ ]
946
+ })]
947
+ });
948
+ }
949
+ export { Re as A, be as B, Le as C, Ve as D, je as E, ge as F, Se as I, ve as L, Ae as M, W as N, Ie as O, G as P, ye as R, Be as S, He as T, xe as V, X as _, Q as a, Ue as b, at as c, Ke as d, Ye as f, Qe as g, Xe as h, Z as i, J as j, Me as k, ot as l, Ze as m, ct as n, lt as o, $e as p, $ as r, st as s, pt as t, Y as u, We as v, ze as w, Pe as x, Ge as y, _e as z };