@overvis/hmi-workspace-ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alarm-list-sheAq-pb.js +414 -0
- package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
- package/dist/alert-dialog-B60PF7S9.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
- package/dist/diagnostic-text-CsbENUNI.js +116 -0
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
- package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
- package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
- package/dist/editor-page-BWbVGJvU.js +1337 -0
- package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
- package/dist/entity-controls-BCuRx882.js +71 -0
- package/dist/errors-Cawve9yD.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
- package/dist/host.js +8143 -675
- package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5149 -5345
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-CH28rYUt.js} +54 -58
- package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
- package/dist/page-DpdkOGGb.js +449 -0
- package/dist/page-HCGXXGjy.js +507 -0
- package/dist/panel-BCwBlB_h.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
- package/dist/presence-code-cT6wxlTg.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
- package/dist/retention-note-nequESpo.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
- package/dist/run-text-DneX9rWh.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-yM4B49nd.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-CjXPq9Lk.js} +1 -2
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
package/dist/panel-DDy8tUNR.js
DELETED
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { a as e, l as t, m as n, o as r } from "./i18n-BgzakKoC.js";
|
|
2
|
-
import { t as i } from "./utils-CX-Pz5p6.js";
|
|
3
|
-
import { l as a, t as o } from "./spinner-C-HPNxOc.js";
|
|
4
|
-
import { t as s } from "./button-6SxPBYMz.js";
|
|
5
|
-
import { b as c, d as l, h as u, y as d } from "./dialog-BIhQXcZC.js";
|
|
6
|
-
import { a as f, i as p, o as m, r as h, t as g } from "./empty-B-QJ-06w.js";
|
|
7
|
-
import { n as _ } from "./theme-provider-BkRohQFU.js";
|
|
8
|
-
import { i as v, n as y, r as b, t as x } from "./tabs-CSIucYFP.js";
|
|
9
|
-
import { useEffect as S, useRef as C, useState as w } from "react";
|
|
10
|
-
import { Toaster as T } from "sonner";
|
|
11
|
-
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
12
|
-
import { BellIcon as k, CircleCheckIcon as A, InfoIcon as j, OctagonXIcon as M, TriangleAlertIcon as N, XIcon as P } from "lucide-react";
|
|
13
|
-
import { formatAppDateTime as F } from "@overvis/hmi-shared";
|
|
14
|
-
import { Dialog as I } from "@base-ui/react/dialog";
|
|
15
|
-
//#region src/ui/sheet.tsx
|
|
16
|
-
function L(e) {
|
|
17
|
-
return /* @__PURE__ */ D(I.Root, {
|
|
18
|
-
"data-slot": "sheet",
|
|
19
|
-
...l(e)
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function R({ ...e }) {
|
|
23
|
-
return /* @__PURE__ */ D(I.Trigger, {
|
|
24
|
-
"data-slot": "sheet-trigger",
|
|
25
|
-
...e
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function z({ ...e }) {
|
|
29
|
-
return /* @__PURE__ */ D(I.Close, {
|
|
30
|
-
"data-slot": "sheet-close",
|
|
31
|
-
...e
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
function B({ ...e }) {
|
|
35
|
-
let t = c(), n = t?.container;
|
|
36
|
-
return t != null && n == null ? null : /* @__PURE__ */ D(I.Portal, {
|
|
37
|
-
"data-slot": "sheet-portal",
|
|
38
|
-
...e,
|
|
39
|
-
container: n ?? void 0
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function V({ className: e, ...t }) {
|
|
43
|
-
d();
|
|
44
|
-
let n = c();
|
|
45
|
-
return /* @__PURE__ */ D(I.Backdrop, {
|
|
46
|
-
"data-slot": "sheet-overlay",
|
|
47
|
-
forceRender: !0,
|
|
48
|
-
className: i("\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),
|
|
49
|
-
...t
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function H({ className: e, children: t, side: r = "right", showCloseButton: a = !0, onKeyDown: o, ...l }) {
|
|
53
|
-
let d = n(), f = c();
|
|
54
|
-
return /* @__PURE__ */ O(B, { children: [/* @__PURE__ */ D(V, {}), /* @__PURE__ */ O(I.Popup, {
|
|
55
|
-
"data-slot": "sheet-content",
|
|
56
|
-
"data-side": r,
|
|
57
|
-
className: i("\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 ", f?.container == null ? "fixed" : "absolute", e),
|
|
58
|
-
...l,
|
|
59
|
-
onKeyDown: (e) => {
|
|
60
|
-
u(e, e.currentTarget), o?.(e);
|
|
61
|
-
},
|
|
62
|
-
children: [t, a ? /* @__PURE__ */ O(I.Close, {
|
|
63
|
-
"data-slot": "sheet-close",
|
|
64
|
-
render: /* @__PURE__ */ D(s, {
|
|
65
|
-
variant: "ghost",
|
|
66
|
-
className: "absolute top-3 right-3",
|
|
67
|
-
size: "icon-sm"
|
|
68
|
-
}),
|
|
69
|
-
children: [/* @__PURE__ */ D(P, {}), /* @__PURE__ */ D("span", {
|
|
70
|
-
className: "sr-only",
|
|
71
|
-
children: d("action_close")
|
|
72
|
-
})]
|
|
73
|
-
}) : null]
|
|
74
|
-
})] });
|
|
75
|
-
}
|
|
76
|
-
function U({ className: e, ...t }) {
|
|
77
|
-
return /* @__PURE__ */ D("div", {
|
|
78
|
-
"data-slot": "sheet-header",
|
|
79
|
-
className: i("flex flex-col gap-0.5 p-4", e),
|
|
80
|
-
...t
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function W({ className: e, ...t }) {
|
|
84
|
-
return /* @__PURE__ */ D("div", {
|
|
85
|
-
"data-slot": "sheet-footer",
|
|
86
|
-
className: i("mt-auto flex flex-col gap-2 p-4", e),
|
|
87
|
-
...t
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function G({ className: e, ...t }) {
|
|
91
|
-
return /* @__PURE__ */ D(I.Title, {
|
|
92
|
-
"data-slot": "sheet-title",
|
|
93
|
-
className: i("font-heading text-base font-medium text-foreground", e),
|
|
94
|
-
...t
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function K({ className: e, ...t }) {
|
|
98
|
-
return /* @__PURE__ */ D(I.Description, {
|
|
99
|
-
"data-slot": "sheet-description",
|
|
100
|
-
className: i("text-sm text-muted-foreground", e),
|
|
101
|
-
...t
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/ui/sonner.tsx
|
|
106
|
-
var q = ({ ...e }) => {
|
|
107
|
-
let { resolvedTheme: t } = _(), r = n();
|
|
108
|
-
return /* @__PURE__ */ D(T, {
|
|
109
|
-
theme: t,
|
|
110
|
-
className: "toaster group font-sans",
|
|
111
|
-
gap: 10,
|
|
112
|
-
icons: {
|
|
113
|
-
success: /* @__PURE__ */ D(A, { className: "size-4" }),
|
|
114
|
-
info: /* @__PURE__ */ D(j, { className: "size-4" }),
|
|
115
|
-
warning: /* @__PURE__ */ D(N, { className: "size-4" }),
|
|
116
|
-
error: /* @__PURE__ */ D(M, { className: "size-4" }),
|
|
117
|
-
loading: /* @__PURE__ */ D(o, { className: "size-4" }),
|
|
118
|
-
close: /* @__PURE__ */ D(P, { className: "size-3.5" })
|
|
119
|
-
},
|
|
120
|
-
toastOptions: {
|
|
121
|
-
unstyled: !0,
|
|
122
|
-
closeButton: !0,
|
|
123
|
-
closeButtonAriaLabel: r("messages_toast_close"),
|
|
124
|
-
classNames: {
|
|
125
|
-
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 ",
|
|
126
|
-
success: "\n [--toast-accent:var(--color-emerald-600)]\n dark:[--toast-accent:var(--color-emerald-400)]\n ",
|
|
127
|
-
info: "\n [--toast-accent:var(--color-sky-600)]\n dark:[--toast-accent:var(--color-sky-400)]\n ",
|
|
128
|
-
warning: "\n [--toast-accent:var(--color-amber-600)]\n dark:[--toast-accent:var(--color-amber-400)]\n ",
|
|
129
|
-
error: "[--toast-accent:var(--destructive)]",
|
|
130
|
-
loading: "[--toast-accent:var(--muted-foreground)]",
|
|
131
|
-
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 ",
|
|
132
|
-
content: "flex min-w-0 flex-1 flex-col gap-0.5 self-center",
|
|
133
|
-
title: "leading-5 font-medium wrap-anywhere",
|
|
134
|
-
description: "text-[13px]/5 wrap-anywhere text-muted-foreground",
|
|
135
|
-
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 ",
|
|
136
|
-
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 ",
|
|
137
|
-
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 "
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
...e
|
|
141
|
-
});
|
|
142
|
-
}, J = {
|
|
143
|
-
success: A,
|
|
144
|
-
info: j,
|
|
145
|
-
warning: N,
|
|
146
|
-
error: M
|
|
147
|
-
}, Y = {
|
|
148
|
-
success: "messages_kind_success",
|
|
149
|
-
info: "messages_kind_info",
|
|
150
|
-
warning: "messages_kind_warning",
|
|
151
|
-
error: "messages_kind_error"
|
|
152
|
-
};
|
|
153
|
-
function X({ message: e, active: a }) {
|
|
154
|
-
let o = n(), s = r(), c = C(null);
|
|
155
|
-
S(() => {
|
|
156
|
-
if (!a || e.seen || !c.current) return;
|
|
157
|
-
let t = !1, n = () => {
|
|
158
|
-
t && document.visibilityState === "visible" && document.hasFocus() && s.markSeen([e.id]);
|
|
159
|
-
}, r = new IntersectionObserver((e) => {
|
|
160
|
-
t = e.some((e) => e.isIntersecting && e.intersectionRatio > 0), n();
|
|
161
|
-
});
|
|
162
|
-
return r.observe(c.current), document.addEventListener("visibilitychange", n), window.addEventListener("focus", n), () => {
|
|
163
|
-
r.disconnect(), document.removeEventListener("visibilitychange", n), window.removeEventListener("focus", n);
|
|
164
|
-
};
|
|
165
|
-
}, [
|
|
166
|
-
a,
|
|
167
|
-
e.id,
|
|
168
|
-
e.seen,
|
|
169
|
-
s
|
|
170
|
-
]);
|
|
171
|
-
let l = J[e.kind], u = t(e.scope.href);
|
|
172
|
-
return /* @__PURE__ */ O("li", {
|
|
173
|
-
ref: c,
|
|
174
|
-
className: i("flex gap-3 px-5 py-3", e.kind === "error" && "bg-destructive/5"),
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ D(l, {
|
|
177
|
-
"aria-hidden": "true",
|
|
178
|
-
className: i("mt-0.5 size-4 shrink-0", {
|
|
179
|
-
"text-destructive": e.kind === "error",
|
|
180
|
-
"text-amber-600 dark:text-amber-400": e.kind === "warning",
|
|
181
|
-
"text-green-600 dark:text-green-400": e.kind === "success",
|
|
182
|
-
"text-muted-foreground": e.kind === "info"
|
|
183
|
-
})
|
|
184
|
-
}),
|
|
185
|
-
/* @__PURE__ */ O("div", {
|
|
186
|
-
className: "min-w-0 flex-1",
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ D("span", {
|
|
189
|
-
className: "sr-only",
|
|
190
|
-
children: o(Y[e.kind])
|
|
191
|
-
}),
|
|
192
|
-
/* @__PURE__ */ D("p", {
|
|
193
|
-
className: "wrap-anywhere whitespace-pre-wrap",
|
|
194
|
-
children: e.text
|
|
195
|
-
}),
|
|
196
|
-
/* @__PURE__ */ O("div", {
|
|
197
|
-
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 ",
|
|
198
|
-
children: [
|
|
199
|
-
/* @__PURE__ */ D("time", {
|
|
200
|
-
dateTime: new Date(e.time).toISOString(),
|
|
201
|
-
children: F(e.time)
|
|
202
|
-
}),
|
|
203
|
-
e.scope.workspaceId ? /* @__PURE__ */ D("span", {
|
|
204
|
-
className: "min-w-0 wrap-anywhere",
|
|
205
|
-
children: e.scope.workspaceName ?? e.scope.workspaceId
|
|
206
|
-
}) : null,
|
|
207
|
-
u ? /* @__PURE__ */ D("a", {
|
|
208
|
-
href: u,
|
|
209
|
-
className: "\n font-medium text-primary underline-offset-4\n hover:underline\n ",
|
|
210
|
-
children: o("messages_open")
|
|
211
|
-
}) : null
|
|
212
|
-
]
|
|
213
|
-
})
|
|
214
|
-
]
|
|
215
|
-
}),
|
|
216
|
-
e.seen ? null : /* @__PURE__ */ D("span", {
|
|
217
|
-
role: "img",
|
|
218
|
-
"aria-label": o("messages_unseen"),
|
|
219
|
-
className: "mt-1.5 size-2 shrink-0 rounded-full bg-primary"
|
|
220
|
-
})
|
|
221
|
-
]
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
function Z({ notifications: t, notificationUnreadCount: i = 0 }) {
|
|
225
|
-
let o = n(), c = e(), l = r(), [u, d] = w(!1), [_, S] = w("messages"), T = c.some((e) => !e.seen), A = C(null), j = o(t == null ? "messages_tab" : "messages_title"), M = /* @__PURE__ */ D("div", {
|
|
226
|
-
className: "flex min-h-0 flex-1 flex-col text-sm",
|
|
227
|
-
children: c.length > 0 ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O("div", {
|
|
228
|
-
className: "flex shrink-0 flex-wrap justify-end gap-1 border-b px-3 pb-2",
|
|
229
|
-
children: [/* @__PURE__ */ D(s, {
|
|
230
|
-
size: "sm",
|
|
231
|
-
variant: "ghost",
|
|
232
|
-
disabled: !T,
|
|
233
|
-
focusableWhenDisabled: !0,
|
|
234
|
-
className: "\n text-muted-foreground\n aria-disabled:opacity-40\n ",
|
|
235
|
-
onClick: () => {
|
|
236
|
-
l.markSeen(c.map((e) => e.id));
|
|
237
|
-
},
|
|
238
|
-
children: o("messages_mark_all")
|
|
239
|
-
}), /* @__PURE__ */ D(s, {
|
|
240
|
-
size: "sm",
|
|
241
|
-
variant: "ghost",
|
|
242
|
-
className: "text-muted-foreground",
|
|
243
|
-
onClick: () => {
|
|
244
|
-
A.current?.querySelector("[data-slot=\"sheet-close\"]")?.focus(), l.clear();
|
|
245
|
-
},
|
|
246
|
-
children: o("messages_clear")
|
|
247
|
-
})]
|
|
248
|
-
}), /* @__PURE__ */ D("ol", {
|
|
249
|
-
"aria-label": o("messages_tab"),
|
|
250
|
-
tabIndex: 0,
|
|
251
|
-
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 ",
|
|
252
|
-
children: c.map((e) => /* @__PURE__ */ D(X, {
|
|
253
|
-
message: e,
|
|
254
|
-
active: u && (t == null || _ === "messages")
|
|
255
|
-
}, e.id))
|
|
256
|
-
})] }) : /* @__PURE__ */ D(g, {
|
|
257
|
-
className: "justify-start px-8 py-16",
|
|
258
|
-
children: /* @__PURE__ */ O(p, { children: [
|
|
259
|
-
/* @__PURE__ */ D(f, {
|
|
260
|
-
variant: "icon",
|
|
261
|
-
children: /* @__PURE__ */ D(k, { "aria-hidden": "true" })
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ D(m, { children: o("messages_empty") }),
|
|
264
|
-
/* @__PURE__ */ D(h, { children: o("messages_empty_description") })
|
|
265
|
-
] })
|
|
266
|
-
})
|
|
267
|
-
});
|
|
268
|
-
return /* @__PURE__ */ O(L, {
|
|
269
|
-
open: u,
|
|
270
|
-
onOpenChange: (e) => {
|
|
271
|
-
e && t != null && i > 0 && S("notifications"), d(e);
|
|
272
|
-
},
|
|
273
|
-
children: [/* @__PURE__ */ O(R, {
|
|
274
|
-
render: /* @__PURE__ */ D(s, {
|
|
275
|
-
size: "icon",
|
|
276
|
-
variant: "ghost",
|
|
277
|
-
className: "relative",
|
|
278
|
-
"aria-label": [
|
|
279
|
-
j,
|
|
280
|
-
...T ? [o("messages_unseen")] : [],
|
|
281
|
-
...i > 0 ? [o("messages_notification_count", { count: i })] : []
|
|
282
|
-
].join(". ")
|
|
283
|
-
}),
|
|
284
|
-
children: [/* @__PURE__ */ D(k, {}), i > 0 ? /* @__PURE__ */ D(a, {
|
|
285
|
-
"aria-hidden": "true",
|
|
286
|
-
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 ",
|
|
287
|
-
children: i > 99 ? "99+" : i
|
|
288
|
-
}) : T ? /* @__PURE__ */ D("span", {
|
|
289
|
-
"aria-hidden": "true",
|
|
290
|
-
className: "absolute top-1 right-1 size-2 rounded-full bg-primary"
|
|
291
|
-
}) : null]
|
|
292
|
-
}), /* @__PURE__ */ O(H, {
|
|
293
|
-
ref: A,
|
|
294
|
-
className: "\n gap-0\n data-[side=right]:w-full\n data-[side=right]:sm:max-w-md\n ",
|
|
295
|
-
children: [
|
|
296
|
-
/* @__PURE__ */ D(U, {
|
|
297
|
-
className: "px-5 pt-3.5 pr-12 pb-3",
|
|
298
|
-
children: /* @__PURE__ */ D(G, { children: j })
|
|
299
|
-
}),
|
|
300
|
-
t == null ? M : /* @__PURE__ */ O(x, {
|
|
301
|
-
value: _,
|
|
302
|
-
onValueChange: (e) => {
|
|
303
|
-
S(String(e));
|
|
304
|
-
},
|
|
305
|
-
className: "min-h-0 flex-1 gap-0",
|
|
306
|
-
children: [
|
|
307
|
-
/* @__PURE__ */ O(b, {
|
|
308
|
-
className: "mx-5 mb-3 shrink-0",
|
|
309
|
-
children: [/* @__PURE__ */ D(v, {
|
|
310
|
-
value: "messages",
|
|
311
|
-
children: o("messages_tab")
|
|
312
|
-
}), /* @__PURE__ */ D(v, {
|
|
313
|
-
value: "notifications",
|
|
314
|
-
children: o("messages_notifications_tab")
|
|
315
|
-
})]
|
|
316
|
-
}),
|
|
317
|
-
/* @__PURE__ */ D(y, {
|
|
318
|
-
value: "messages",
|
|
319
|
-
className: "flex min-h-0 flex-col",
|
|
320
|
-
children: M
|
|
321
|
-
}),
|
|
322
|
-
/* @__PURE__ */ D(y, {
|
|
323
|
-
value: "notifications",
|
|
324
|
-
className: "min-h-0 overflow-y-auto overscroll-contain px-5",
|
|
325
|
-
children: t
|
|
326
|
-
})
|
|
327
|
-
]
|
|
328
|
-
}),
|
|
329
|
-
t == null || _ === "messages" ? /* @__PURE__ */ D(K, {
|
|
330
|
-
className: "shrink-0 border-t px-5 py-3 text-xs/relaxed",
|
|
331
|
-
children: o("messages_description")
|
|
332
|
-
}) : null
|
|
333
|
-
]
|
|
334
|
-
})]
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
//#endregion
|
|
338
|
-
export { H as a, U as c, z as i, G as l, q as n, K as o, L as r, W as s, Z as t, R as u };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./trpc-CvJUuUXp.js";
|
|
2
|
-
import { f as t } from "./i18n-BgzakKoC.js";
|
|
3
|
-
import { i as n } from "./mutation-form-validators-BNz5bsv1.js";
|
|
4
|
-
import { n as r, t as i } from "./api-error-9rQmUN5L.js";
|
|
5
|
-
import { useEffect as a, useRef as o } from "react";
|
|
6
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
7
|
-
//#region src/workspace/setup/endpoints/presence-challenge.tsx
|
|
8
|
-
function c(e, r, a) {
|
|
9
|
-
return n(e, r, { message: (e) => !a && i(e) === "endpoint_presence_not_pressed" ? t("error_endpoint_presence_not_pressed_button") : null });
|
|
10
|
-
}
|
|
11
|
-
function l(e) {
|
|
12
|
-
let t = i(e);
|
|
13
|
-
return t === "endpoint_presence_rejected" || t === "endpoint_presence_not_pressed" || t === "endpoint_presence_unavailable";
|
|
14
|
-
}
|
|
15
|
-
function u() {
|
|
16
|
-
let t = e.endpoint.beginPinPresence.useMutation(), n = e.endpoint.cancelPinPresence.useMutation(), r = o(n.mutate), i = o(null), s = o(!1);
|
|
17
|
-
return a(() => {
|
|
18
|
-
r.current = n.mutate;
|
|
19
|
-
}), a(() => (s.current = !1, () => {
|
|
20
|
-
s.current = !0;
|
|
21
|
-
let e = i.current;
|
|
22
|
-
i.current = null, e != null && r.current({ challengeId: e });
|
|
23
|
-
}), []), {
|
|
24
|
-
begin: async (e) => {
|
|
25
|
-
let n = await t.mutateAsync(e);
|
|
26
|
-
return s.current ? (n.presenceRequired && r.current({ challengeId: n.challengeId }), "closed") : n.presenceRequired ? (i.current = n.challengeId, {
|
|
27
|
-
challengeId: n.challengeId,
|
|
28
|
-
codeDisplayed: n.codeDisplayed
|
|
29
|
-
}) : null;
|
|
30
|
-
},
|
|
31
|
-
cancel: (e) => {
|
|
32
|
-
i.current === e && (i.current = null), r.current({ challengeId: e });
|
|
33
|
-
},
|
|
34
|
-
settle: (e) => {
|
|
35
|
-
i.current === e && (i.current = null);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function d({ challengeId: t, paused: n, onDone: c }) {
|
|
40
|
-
let l = e.endpoint.pollPinPresence.useQuery({ challengeId: t }, {
|
|
41
|
-
enabled: !n,
|
|
42
|
-
refetchInterval: (e) => {
|
|
43
|
-
let t = i(e.state.error);
|
|
44
|
-
return t === "endpoint_presence_invalid" || t === "endpoint_presence_unsupported" ? !1 : 1e3;
|
|
45
|
-
},
|
|
46
|
-
refetchIntervalInBackground: !0,
|
|
47
|
-
retry: !1,
|
|
48
|
-
gcTime: 0
|
|
49
|
-
}), u = i(l.error) === "endpoint_presence_invalid", d = l.data?.pressed === !0 ? l.dataUpdatedAt : 0, f = o(c), p = o(0), m = o(!1);
|
|
50
|
-
return a(() => {
|
|
51
|
-
f.current = c;
|
|
52
|
-
}), a(() => {
|
|
53
|
-
if (!n) {
|
|
54
|
-
if (u) {
|
|
55
|
-
m.current || (m.current = !0, f.current());
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
d > p.current && (p.current = d, f.current());
|
|
59
|
-
}
|
|
60
|
-
}, [
|
|
61
|
-
u,
|
|
62
|
-
n,
|
|
63
|
-
d
|
|
64
|
-
]), l.error == null || u ? null : /* @__PURE__ */ s("p", {
|
|
65
|
-
role: "status",
|
|
66
|
-
className: "text-sm text-destructive",
|
|
67
|
-
children: r(l.error)
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/workspace/setup/endpoints/presence-code.ts
|
|
72
|
-
function f(e) {
|
|
73
|
-
let t = e.trim();
|
|
74
|
-
return t.length === 0 ? {
|
|
75
|
-
ok: !0,
|
|
76
|
-
code: void 0
|
|
77
|
-
} : /^[1-9][0-9]{7}$/.test(t) ? {
|
|
78
|
-
ok: !0,
|
|
79
|
-
code: Number(t)
|
|
80
|
-
} : { ok: !1 };
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
export { u as a, l as i, d as n, c as r, f as t };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./utils-CX-Pz5p6.js";
|
|
2
|
-
import { m as t } from "./dialog-BIhQXcZC.js";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import { Tooltip as i } from "@base-ui/react/tooltip";
|
|
5
|
-
import { Progress as a } from "@base-ui/react/progress";
|
|
6
|
-
//#region src/ui/tooltip.tsx
|
|
7
|
-
function o({ delay: e = 0, ...t }) {
|
|
8
|
-
return /* @__PURE__ */ n(i.Provider, {
|
|
9
|
-
"data-slot": "tooltip-provider",
|
|
10
|
-
delay: e,
|
|
11
|
-
...t
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function s({ ...e }) {
|
|
15
|
-
return /* @__PURE__ */ n(i.Root, {
|
|
16
|
-
"data-slot": "tooltip",
|
|
17
|
-
...e
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function c({ ...e }) {
|
|
21
|
-
return /* @__PURE__ */ n(i.Trigger, {
|
|
22
|
-
"data-slot": "tooltip-trigger",
|
|
23
|
-
...e
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function l({ className: a, side: o = "top", sideOffset: s = 4, align: c = "center", alignOffset: l = 0, children: u, ...d }) {
|
|
27
|
-
let f = t();
|
|
28
|
-
return /* @__PURE__ */ n(i.Portal, { children: /* @__PURE__ */ n(i.Positioner, {
|
|
29
|
-
align: c,
|
|
30
|
-
alignOffset: l,
|
|
31
|
-
side: o,
|
|
32
|
-
sideOffset: s,
|
|
33
|
-
className: "isolate z-50",
|
|
34
|
-
children: /* @__PURE__ */ r(i.Popup, {
|
|
35
|
-
"data-slot": "tooltip-content",
|
|
36
|
-
"data-theme": f,
|
|
37
|
-
className: e("\n z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5\n rounded-md bg-foreground px-3 py-1.5 text-xs text-background\n has-data-[slot=kbd]:pr-1.5\n data-[side=bottom]:slide-in-from-top-2\n data-[side=inline-end]:slide-in-from-left-2\n data-[side=inline-start]:slide-in-from-right-2\n data-[side=left]:slide-in-from-right-2\n data-[side=right]:slide-in-from-left-2\n data-[side=top]:slide-in-from-bottom-2\n **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50\n **:data-[slot=kbd]:rounded-sm\n data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0\n data-[state=delayed-open]:zoom-in-95\n data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95\n data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\n ", a),
|
|
38
|
-
...d,
|
|
39
|
-
children: [u, /* @__PURE__ */ n(i.Arrow, { className: "\n z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground\n fill-foreground\n data-[side=bottom]:top-1\n data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1\n data-[side=inline-end]:-translate-y-1/2\n data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1\n data-[side=inline-start]:-translate-y-1/2\n data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2\n data-[side=right]:top-1/2! data-[side=right]:-left-1\n data-[side=right]:-translate-y-1/2\n data-[side=top]:-bottom-2.5\n " })]
|
|
40
|
-
})
|
|
41
|
-
}) });
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/ui/progress.tsx
|
|
45
|
-
function u({ className: t, children: i, value: o, ...s }) {
|
|
46
|
-
return /* @__PURE__ */ r(a.Root, {
|
|
47
|
-
value: o,
|
|
48
|
-
"data-slot": "progress",
|
|
49
|
-
className: e("flex flex-wrap gap-3", t),
|
|
50
|
-
...s,
|
|
51
|
-
children: [i, /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(f, {}) })]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function d({ className: t, ...r }) {
|
|
55
|
-
return /* @__PURE__ */ n(a.Track, {
|
|
56
|
-
className: e("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted", t),
|
|
57
|
-
"data-slot": "progress-track",
|
|
58
|
-
...r
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function f({ className: t, ...r }) {
|
|
62
|
-
return /* @__PURE__ */ n(a.Indicator, {
|
|
63
|
-
"data-slot": "progress-indicator",
|
|
64
|
-
className: e("h-full bg-primary transition-all", t),
|
|
65
|
-
...r
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function p({ className: t, ...r }) {
|
|
69
|
-
return /* @__PURE__ */ n(a.Label, {
|
|
70
|
-
className: e("text-sm font-medium", t),
|
|
71
|
-
"data-slot": "progress-label",
|
|
72
|
-
...r
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function m({ className: t, ...r }) {
|
|
76
|
-
return /* @__PURE__ */ n(a.Value, {
|
|
77
|
-
className: e("ml-auto text-sm text-muted-foreground tabular-nums", t),
|
|
78
|
-
"data-slot": "progress-value",
|
|
79
|
-
...r
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
export { m as a, o as c, d as i, c as l, f as n, s as o, p as r, l as s, u as t };
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./trpc-CvJUuUXp.js";
|
|
2
|
-
import { skipToken as t } from "@tanstack/react-query";
|
|
3
|
-
import { createContext as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
4
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
-
import { resolveLocalizedText as c } from "@overvis/hmi-shared";
|
|
6
|
-
import { alarmWatchEventSchema as l } from "@overvis/hmi-shared/automation";
|
|
7
|
-
import { formatExpressionValue as u } from "@overvis/hmi-shared/expression";
|
|
8
|
-
//#region src/workspace/alarms/model.ts
|
|
9
|
-
var d = "—", f = {
|
|
10
|
-
info: 0,
|
|
11
|
-
warning: 1,
|
|
12
|
-
urgent: 2
|
|
13
|
-
};
|
|
14
|
-
function p(e) {
|
|
15
|
-
return e.kind === "alarm_rule" ? e.alarmRuleId : e.automationId;
|
|
16
|
-
}
|
|
17
|
-
function m(e, t) {
|
|
18
|
-
return e.shelvedUntil != null && Date.parse(e.shelvedUntil) > t;
|
|
19
|
-
}
|
|
20
|
-
function h(e, t) {
|
|
21
|
-
return e.acknowledgedAt == null && !m(e, t);
|
|
22
|
-
}
|
|
23
|
-
function g(e, t) {
|
|
24
|
-
return e.filter((e) => h(e, t)).length;
|
|
25
|
-
}
|
|
26
|
-
function _(e, t) {
|
|
27
|
-
return e.filter((e) => e.severity !== "info" && h(e, t));
|
|
28
|
-
}
|
|
29
|
-
function v(e, t) {
|
|
30
|
-
return [...e].sort((e, n) => {
|
|
31
|
-
let r = Number(h(n, t)) - Number(h(e, t));
|
|
32
|
-
if (r !== 0) return r;
|
|
33
|
-
let i = f[n.severity] - f[e.severity];
|
|
34
|
-
return i === 0 ? Date.parse(n.raisedAt) - Date.parse(e.raisedAt) : i;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function y(e, t) {
|
|
38
|
-
let n = t.sourceIds == null ? null : new Set(t.sourceIds), r = t.parameterIds == null ? null : new Set(t.parameterIds);
|
|
39
|
-
return e.filter((e) => (n == null || n.has(p(e.source))) && (t.keyPrefix == null || e.key.startsWith(t.keyPrefix)) && (r == null || e.parameterIds.some((e) => r.has(e))));
|
|
40
|
-
}
|
|
41
|
-
function b(e, t) {
|
|
42
|
-
let n = null;
|
|
43
|
-
for (let r of e) {
|
|
44
|
-
if (r.shelvedUntil == null) continue;
|
|
45
|
-
let e = Date.parse(r.shelvedUntil);
|
|
46
|
-
e > t && (n == null || e < n) && (n = e);
|
|
47
|
-
}
|
|
48
|
-
return n;
|
|
49
|
-
}
|
|
50
|
-
function x(e, t, n, r) {
|
|
51
|
-
let i = new Intl.NumberFormat(n, { maximumFractionDigits: 6 });
|
|
52
|
-
return c(e, n).replace(/\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (e, n) => {
|
|
53
|
-
if (!Object.hasOwn(t, n)) return e;
|
|
54
|
-
let a = t[n];
|
|
55
|
-
return a?.value == null ? d : a.type === "number" && typeof a.value == "number" ? i.format(a.value) : u(a.value, a.type, r) ?? d;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function S(e, t, n) {
|
|
59
|
-
return {
|
|
60
|
-
title: x(e.title, e.params, t, n).trim(),
|
|
61
|
-
body: e.body == null ? "" : x(e.body, e.params, t, n).trim()
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/workspace/alarms/provider.tsx
|
|
66
|
-
var C = 1e3, w = n(null);
|
|
67
|
-
function T(n) {
|
|
68
|
-
let [r, a] = o(null), [s, c] = o(0), u = e.alarm.watch.useSubscription(n == null ? t : { workspaceId: n }, {
|
|
69
|
-
onData(e) {
|
|
70
|
-
let t = l["~standard"].validate(e);
|
|
71
|
-
t.issues != null || n == null || a({
|
|
72
|
-
workspaceId: n,
|
|
73
|
-
list: t.value.alarms,
|
|
74
|
-
configured: t.value.configured,
|
|
75
|
-
receivedAt: Date.now()
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
onComplete() {
|
|
79
|
-
c((e) => e + 1);
|
|
80
|
-
}
|
|
81
|
-
}), { reset: d } = u;
|
|
82
|
-
i(() => {
|
|
83
|
-
if (s === 0) return;
|
|
84
|
-
let e = setTimeout(d, C);
|
|
85
|
-
return () => {
|
|
86
|
-
clearTimeout(e);
|
|
87
|
-
};
|
|
88
|
-
}, [s, d]);
|
|
89
|
-
let f = r?.workspaceId === n ? r : null, [p, m] = o(0), h = Math.max(p, f?.receivedAt ?? 0);
|
|
90
|
-
return i(() => {
|
|
91
|
-
if (f == null) return;
|
|
92
|
-
let e = b(f.list, h);
|
|
93
|
-
if (e == null) return;
|
|
94
|
-
let t = setTimeout(() => {
|
|
95
|
-
m(Date.now());
|
|
96
|
-
}, Math.min(Math.max(e - Date.now(), 0) + 50, 2 ** 31 - 1));
|
|
97
|
-
return () => {
|
|
98
|
-
clearTimeout(t);
|
|
99
|
-
};
|
|
100
|
-
}, [f, h]), {
|
|
101
|
-
alarms: f?.list,
|
|
102
|
-
configured: f?.configured ?? !1,
|
|
103
|
-
failed: u.status === "error",
|
|
104
|
-
now: h
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function E({ workspaceId: e, children: t }) {
|
|
108
|
-
let { alarms: n, configured: r, failed: i, now: o } = T(e), c = a(() => ({
|
|
109
|
-
alarms: n,
|
|
110
|
-
configured: r,
|
|
111
|
-
failed: i,
|
|
112
|
-
now: o,
|
|
113
|
-
workspaceId: e
|
|
114
|
-
}), [
|
|
115
|
-
n,
|
|
116
|
-
r,
|
|
117
|
-
i,
|
|
118
|
-
o,
|
|
119
|
-
e
|
|
120
|
-
]);
|
|
121
|
-
return /* @__PURE__ */ s(w.Provider, {
|
|
122
|
-
value: c,
|
|
123
|
-
children: t
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function D(e) {
|
|
127
|
-
let t = r(w), n = T(t?.workspaceId === e ? null : e);
|
|
128
|
-
return t?.workspaceId === e ? t : n;
|
|
129
|
-
}
|
|
130
|
-
function O() {
|
|
131
|
-
return r(w);
|
|
132
|
-
}
|
|
133
|
-
//#endregion
|
|
134
|
-
export { p as a, m as c, _ as d, S as i, h as l, O as n, g as o, D as r, y as s, E as t, v as u };
|