@camstack/addon-benchmark 1.2.107 → 1.2.108
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/{MotionZonesSettings-DBCk8fy7.mjs → MotionZonesSettings-BkYrk68c.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-Cki0qli_.mjs → PrivacyMaskSettings-WtzX9-WN.mjs} +4 -4
- package/dist/{SceneMonitorEditor-CYCGhMHq.mjs → SceneMonitorEditor-DE_xUu8q.mjs} +116 -113
- package/dist/_stub.js +62 -175
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-BQnfxvBG.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-B4PfkaKf.mjs} +4 -4
- package/dist/_virtual_mf___mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DCJqNvwa.mjs +26 -0
- package/dist/{hostInit-DOd3TZNm.mjs → hostInit-XbRhWZX6.mjs} +3 -3
- package/dist/{player-overlays-BrFU5MIi.mjs → player-overlays-DOCEh8Ga.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-CTtLu_DG.mjs → responsive-DaTEy-eH.mjs} +3 -3
- package/dist/{square-Zdn4JdAm.mjs → square-BhyT83YJ.mjs} +1 -1
- package/dist/{trash-2-CSiEAcux.mjs → trash-2-Bnhja3YI.mjs} +1 -1
- package/dist/{use-device-snapshot-BYfCxMkP.mjs → use-device-snapshot-D37O0Rv-.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-BO5Aj32j.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-F1tQmCOy.mjs} +1 -1
- package/package.json +2 -2
- package/dist/_virtual_mf___mfe_internal__addon_benchmark_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-6crENvEu.mjs +0 -26
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as e, g as t, h as n, p as r, u as i, x as a } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs";
|
|
2
|
-
import { a as o, c as s, n as c, o as l, r as u, t as d } from "./responsive-
|
|
3
|
-
import { a as f, d as p, f as ee, i as
|
|
4
|
-
import { t as y } from "./trash-2-
|
|
2
|
+
import { a as o, c as s, n as c, o as l, r as u, t as d } from "./responsive-DaTEy-eH.mjs";
|
|
3
|
+
import { a as f, d as p, f as ee, i as te, l as m, n as h, o as g, r as ne, s as _, t as re, u as v } from "./use-device-snapshot-D37O0Rv-.mjs";
|
|
4
|
+
import { t as y } from "./trash-2-Bnhja3YI.mjs";
|
|
5
5
|
import { n as b, r as x, t as S } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-SOU_VnTj.mjs";
|
|
6
|
-
import { MaskShapeCanvas as
|
|
7
|
-
var
|
|
6
|
+
import { MaskShapeCanvas as C } from "./MaskShapeCanvas-BDvrLf-K.mjs";
|
|
7
|
+
var ie = s("settings-2", [
|
|
8
8
|
["path", {
|
|
9
9
|
d: "M14 17H5",
|
|
10
10
|
key: "gfn3mx"
|
|
@@ -29,8 +29,11 @@ var C = s("settings-2", [
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region ../ui-library/src/composites/cap-settings/SceneReferenceGallery.tsx
|
|
31
31
|
a();
|
|
32
|
-
var w =
|
|
32
|
+
var w = m("/addon/pipeline-analytics/event-media");
|
|
33
33
|
function T(e) {
|
|
34
|
+
return `${w}/m/${e}`;
|
|
35
|
+
}
|
|
36
|
+
function E(e) {
|
|
34
37
|
let t = /* @__PURE__ */ new Map();
|
|
35
38
|
for (let n of e.states) n.references.forEach((e, r) => {
|
|
36
39
|
let i = t.get(e.condition) ?? [];
|
|
@@ -45,12 +48,12 @@ function T(e) {
|
|
|
45
48
|
tiles: [...t].sort((e, t) => t.reference.capturedAt - e.reference.capturedAt)
|
|
46
49
|
})).sort((e, t) => e.condition.localeCompare(t.condition));
|
|
47
50
|
}
|
|
48
|
-
function
|
|
51
|
+
function D(e) {
|
|
49
52
|
return e.states.reduce((e, t) => e + t.references.length, 0);
|
|
50
53
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
53
|
-
let i =
|
|
54
|
+
var O = "rounded border border-danger/50 bg-danger/10 px-1 py-0.5 text-[10px] font-medium text-danger hover:bg-danger/20 disabled:opacity-40 transition-colors";
|
|
55
|
+
function k({ monitor: e, disabled: n, onDelete: r }) {
|
|
56
|
+
let i = E(e), a = D(e), [o, s] = t(null);
|
|
54
57
|
return i.length === 0 ? /* @__PURE__ */ b("p", {
|
|
55
58
|
className: `${d} leading-relaxed`,
|
|
56
59
|
children: "No photographs captured yet. Press “Capture daylight” to take the one this scene will judge everything against."
|
|
@@ -61,7 +64,7 @@ function O({ monitor: e, disabled: n, onDelete: r }) {
|
|
|
61
64
|
children: [/* @__PURE__ */ x("p", {
|
|
62
65
|
className: "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle",
|
|
63
66
|
children: [
|
|
64
|
-
|
|
67
|
+
_(e.condition),
|
|
65
68
|
" · ",
|
|
66
69
|
e.tiles.length
|
|
67
70
|
]
|
|
@@ -72,16 +75,16 @@ function O({ monitor: e, disabled: n, onDelete: r }) {
|
|
|
72
75
|
return /* @__PURE__ */ x("li", {
|
|
73
76
|
className: "flex w-24 flex-col gap-1 rounded-md border border-border p-1",
|
|
74
77
|
children: [
|
|
75
|
-
/* @__PURE__ */ b(
|
|
78
|
+
/* @__PURE__ */ b(A, { reference: t.reference }),
|
|
76
79
|
/* @__PURE__ */ b("span", {
|
|
77
80
|
className: `${d} tabular-nums`,
|
|
78
|
-
children:
|
|
81
|
+
children: j(t.reference.capturedAt)
|
|
79
82
|
}),
|
|
80
83
|
/* @__PURE__ */ x("button", {
|
|
81
84
|
type: "button",
|
|
82
|
-
className:
|
|
85
|
+
className: O,
|
|
83
86
|
disabled: n,
|
|
84
|
-
"aria-label": `Delete the ${
|
|
87
|
+
"aria-label": `Delete the ${_(e.condition).toLowerCase()} photograph from ${j(t.reference.capturedAt)}`,
|
|
85
88
|
onClick: () => {
|
|
86
89
|
if (c && !l) {
|
|
87
90
|
s(i);
|
|
@@ -105,7 +108,7 @@ function O({ monitor: e, disabled: n, onDelete: r }) {
|
|
|
105
108
|
}, e.condition))
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function A({ reference: e }) {
|
|
109
112
|
let [n, r] = t(!1), i = e.thumbnailMediaId;
|
|
110
113
|
return i === void 0 || n ? /* @__PURE__ */ x("div", {
|
|
111
114
|
className: "flex h-16 w-full flex-col items-center justify-center gap-0.5 rounded bg-surface text-foreground-subtle",
|
|
@@ -115,14 +118,14 @@ function k({ reference: e }) {
|
|
|
115
118
|
children: "no picture"
|
|
116
119
|
})]
|
|
117
120
|
}) : /* @__PURE__ */ b("img", {
|
|
118
|
-
src:
|
|
121
|
+
src: T(i),
|
|
119
122
|
alt: "",
|
|
120
123
|
loading: "lazy",
|
|
121
124
|
className: "h-16 w-full rounded object-cover",
|
|
122
125
|
onError: () => r(!0)
|
|
123
126
|
});
|
|
124
127
|
}
|
|
125
|
-
function
|
|
128
|
+
function j(e) {
|
|
126
129
|
let t = new Date(e);
|
|
127
130
|
return `${t.toLocaleDateString()} ${t.toLocaleTimeString([], {
|
|
128
131
|
hour: "2-digit",
|
|
@@ -132,15 +135,15 @@ function A(e) {
|
|
|
132
135
|
//#endregion
|
|
133
136
|
//#region ../ui-library/src/composites/cap-settings/SceneSettingsForm.tsx
|
|
134
137
|
a();
|
|
135
|
-
var
|
|
138
|
+
var M = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50", N = "text-[10px] font-medium text-foreground-subtle", P = "flex flex-col gap-2 rounded-md border border-border bg-surface/40 p-2", F = "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle", I = 5, L = 3600, R = {
|
|
136
139
|
periodic: "Only on the clock. Predictable, and it notices a change even on a camera nothing ever moves in front of.",
|
|
137
140
|
"on-motion": "Only after the camera has been still again for the quiet window below. Cheapest, but a change nobody walks past is never seen.",
|
|
138
141
|
both: "Both — the clock is the safety net that lets the motion path miss. This is the right answer for almost every scene."
|
|
139
|
-
},
|
|
142
|
+
}, z = {
|
|
140
143
|
skip: "Sit that light out. No verdict, no alarm, no flag touched — it picks itself back up when a light it knows returns. This is why the night capture is optional.",
|
|
141
144
|
"judge-anyway": "Compare against the references you do have. Only correct when the two lights genuinely look alike (a floodlit driveway, an indoor lamp) — against a real infrared frame it will report a change that did not happen."
|
|
142
145
|
};
|
|
143
|
-
function
|
|
146
|
+
function B(e) {
|
|
144
147
|
return {
|
|
145
148
|
label: e.label,
|
|
146
149
|
checkIntervalSec: e.checkIntervalSec ?? 60,
|
|
@@ -151,10 +154,10 @@ function z(e) {
|
|
|
151
154
|
confirmPrompt: e.confirm?.prompt ?? ""
|
|
152
155
|
};
|
|
153
156
|
}
|
|
154
|
-
function
|
|
155
|
-
let [a, o] = t(() =>
|
|
157
|
+
function V({ monitor: e, disabled: n, onPatch: r }) {
|
|
158
|
+
let [a, o] = t(() => B(e)), [s, c] = t(!1);
|
|
156
159
|
i(() => {
|
|
157
|
-
s || o(
|
|
160
|
+
s || o(B(e));
|
|
158
161
|
}, [e, s]);
|
|
159
162
|
let l = (e) => {
|
|
160
163
|
c(!1), r(e);
|
|
@@ -170,22 +173,22 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
170
173
|
className: "flex flex-col gap-2",
|
|
171
174
|
children: [
|
|
172
175
|
/* @__PURE__ */ x("div", {
|
|
173
|
-
className:
|
|
176
|
+
className: P,
|
|
174
177
|
children: [
|
|
175
178
|
/* @__PURE__ */ b("p", {
|
|
176
|
-
className:
|
|
179
|
+
className: F,
|
|
177
180
|
children: "What it watches"
|
|
178
181
|
}),
|
|
179
182
|
/* @__PURE__ */ x("label", {
|
|
180
183
|
className: "flex flex-col gap-1",
|
|
181
184
|
children: [/* @__PURE__ */ b("span", {
|
|
182
|
-
className:
|
|
185
|
+
className: N,
|
|
183
186
|
children: "Name"
|
|
184
187
|
}), /* @__PURE__ */ b("input", {
|
|
185
188
|
type: "text",
|
|
186
189
|
value: a.label,
|
|
187
190
|
disabled: n,
|
|
188
|
-
className:
|
|
191
|
+
className: M,
|
|
189
192
|
onFocus: () => c(!0),
|
|
190
193
|
onChange: (e) => o((t) => ({
|
|
191
194
|
...t,
|
|
@@ -205,7 +208,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
205
208
|
disabled: n,
|
|
206
209
|
onChange: (e) => l({ enabled: e.target.checked })
|
|
207
210
|
}), /* @__PURE__ */ b("span", {
|
|
208
|
-
className:
|
|
211
|
+
className: N,
|
|
209
212
|
children: "Watching"
|
|
210
213
|
})]
|
|
211
214
|
}),
|
|
@@ -216,12 +219,12 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
216
219
|
/* @__PURE__ */ x("label", {
|
|
217
220
|
className: "flex flex-col gap-1",
|
|
218
221
|
children: [/* @__PURE__ */ b("span", {
|
|
219
|
-
className:
|
|
222
|
+
className: N,
|
|
220
223
|
children: "When to look"
|
|
221
224
|
}), /* @__PURE__ */ x("select", {
|
|
222
225
|
value: e.triggerMode,
|
|
223
226
|
disabled: n,
|
|
224
|
-
className:
|
|
227
|
+
className: M,
|
|
225
228
|
onChange: (e) => {
|
|
226
229
|
let t = e.target.value;
|
|
227
230
|
(t === "periodic" || t === "on-motion" || t === "both") && l({ triggerMode: t });
|
|
@@ -244,27 +247,27 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
244
247
|
}),
|
|
245
248
|
/* @__PURE__ */ b("p", {
|
|
246
249
|
className: d,
|
|
247
|
-
children:
|
|
250
|
+
children: R[e.triggerMode]
|
|
248
251
|
}),
|
|
249
252
|
/* @__PURE__ */ x("label", {
|
|
250
253
|
className: "flex flex-col gap-1",
|
|
251
254
|
children: [/* @__PURE__ */ b("span", {
|
|
252
|
-
className:
|
|
255
|
+
className: N,
|
|
253
256
|
children: "Check every (seconds)"
|
|
254
257
|
}), /* @__PURE__ */ b("input", {
|
|
255
258
|
type: "number",
|
|
256
|
-
min:
|
|
257
|
-
max:
|
|
259
|
+
min: I,
|
|
260
|
+
max: L,
|
|
258
261
|
value: a.checkIntervalSec,
|
|
259
262
|
disabled: n,
|
|
260
|
-
className:
|
|
263
|
+
className: M,
|
|
261
264
|
onFocus: () => c(!0),
|
|
262
265
|
onChange: (e) => o((t) => ({
|
|
263
266
|
...t,
|
|
264
267
|
checkIntervalSec: Number(e.target.value) || 0
|
|
265
268
|
})),
|
|
266
269
|
onBlur: () => {
|
|
267
|
-
let t =
|
|
270
|
+
let t = H(a.checkIntervalSec, I, L);
|
|
268
271
|
t === e.checkIntervalSec ? c(!1) : l({ checkIntervalSec: t });
|
|
269
272
|
}
|
|
270
273
|
})]
|
|
@@ -276,16 +279,16 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
276
279
|
]
|
|
277
280
|
}),
|
|
278
281
|
/* @__PURE__ */ x("div", {
|
|
279
|
-
className:
|
|
282
|
+
className: P,
|
|
280
283
|
children: [
|
|
281
284
|
/* @__PURE__ */ b("p", {
|
|
282
|
-
className:
|
|
285
|
+
className: F,
|
|
283
286
|
children: "How sure it has to be"
|
|
284
287
|
}),
|
|
285
288
|
e.check.mode === "similarity" && /* @__PURE__ */ x(S, { children: [/* @__PURE__ */ x("label", {
|
|
286
289
|
className: "flex flex-col gap-1",
|
|
287
290
|
children: [/* @__PURE__ */ x("span", {
|
|
288
|
-
className:
|
|
291
|
+
className: N,
|
|
289
292
|
children: ["Match threshold — ", /* @__PURE__ */ b("span", {
|
|
290
293
|
className: "tabular-nums",
|
|
291
294
|
children: a.threshold.toFixed(2)
|
|
@@ -316,7 +319,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
316
319
|
/* @__PURE__ */ x("label", {
|
|
317
320
|
className: "flex flex-col gap-1",
|
|
318
321
|
children: [/* @__PURE__ */ b("span", {
|
|
319
|
-
className:
|
|
322
|
+
className: N,
|
|
320
323
|
children: "Agreeing checks before it changes its mind"
|
|
321
324
|
}), /* @__PURE__ */ b("input", {
|
|
322
325
|
type: "number",
|
|
@@ -324,14 +327,14 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
324
327
|
max: 10,
|
|
325
328
|
value: a.hysteresisCount,
|
|
326
329
|
disabled: n,
|
|
327
|
-
className:
|
|
330
|
+
className: M,
|
|
328
331
|
onFocus: () => c(!0),
|
|
329
332
|
onChange: (e) => o((t) => ({
|
|
330
333
|
...t,
|
|
331
334
|
hysteresisCount: Number(e.target.value) || 1
|
|
332
335
|
})),
|
|
333
336
|
onBlur: () => {
|
|
334
|
-
let t =
|
|
337
|
+
let t = H(a.hysteresisCount, 1, 10);
|
|
335
338
|
t === e.check.hysteresisCount ? c(!1) : l({ check: u({ hysteresisCount: t }) });
|
|
336
339
|
}
|
|
337
340
|
})]
|
|
@@ -343,7 +346,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
343
346
|
/* @__PURE__ */ x("label", {
|
|
344
347
|
className: "flex flex-col gap-1",
|
|
345
348
|
children: [/* @__PURE__ */ b("span", {
|
|
346
|
-
className:
|
|
349
|
+
className: N,
|
|
347
350
|
children: "Quiet for (seconds) before a check counts"
|
|
348
351
|
}), /* @__PURE__ */ b("input", {
|
|
349
352
|
type: "number",
|
|
@@ -351,14 +354,14 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
351
354
|
max: 3600,
|
|
352
355
|
value: a.quietSeconds,
|
|
353
356
|
disabled: n,
|
|
354
|
-
className:
|
|
357
|
+
className: M,
|
|
355
358
|
onFocus: () => c(!0),
|
|
356
359
|
onChange: (e) => o((t) => ({
|
|
357
360
|
...t,
|
|
358
361
|
quietSeconds: Number(e.target.value) || 0
|
|
359
362
|
})),
|
|
360
363
|
onBlur: () => {
|
|
361
|
-
let t =
|
|
364
|
+
let t = H(a.quietSeconds, 0, 3600);
|
|
362
365
|
t === e.quietSeconds ? c(!1) : l({ quietSeconds: t });
|
|
363
366
|
}
|
|
364
367
|
})]
|
|
@@ -370,7 +373,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
370
373
|
/* @__PURE__ */ x("label", {
|
|
371
374
|
className: "flex flex-col gap-1",
|
|
372
375
|
children: [/* @__PURE__ */ b("span", {
|
|
373
|
-
className:
|
|
376
|
+
className: N,
|
|
374
377
|
children: "Minimum gap between counted checks (seconds)"
|
|
375
378
|
}), /* @__PURE__ */ b("input", {
|
|
376
379
|
type: "number",
|
|
@@ -378,14 +381,14 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
378
381
|
max: 3600,
|
|
379
382
|
value: a.minObservationSpacingSec,
|
|
380
383
|
disabled: n,
|
|
381
|
-
className:
|
|
384
|
+
className: M,
|
|
382
385
|
onFocus: () => c(!0),
|
|
383
386
|
onChange: (e) => o((t) => ({
|
|
384
387
|
...t,
|
|
385
388
|
minObservationSpacingSec: Number(e.target.value) || 0
|
|
386
389
|
})),
|
|
387
390
|
onBlur: () => {
|
|
388
|
-
let t =
|
|
391
|
+
let t = H(a.minObservationSpacingSec, 0, 3600);
|
|
389
392
|
t === e.minObservationSpacingSec ? c(!1) : l({ minObservationSpacingSec: t });
|
|
390
393
|
}
|
|
391
394
|
})]
|
|
@@ -397,21 +400,21 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
397
400
|
]
|
|
398
401
|
}),
|
|
399
402
|
/* @__PURE__ */ x("div", {
|
|
400
|
-
className:
|
|
403
|
+
className: P,
|
|
401
404
|
children: [
|
|
402
405
|
/* @__PURE__ */ b("p", {
|
|
403
|
-
className:
|
|
406
|
+
className: F,
|
|
404
407
|
children: "Lighting"
|
|
405
408
|
}),
|
|
406
409
|
/* @__PURE__ */ x("label", {
|
|
407
410
|
className: "flex flex-col gap-1",
|
|
408
411
|
children: [/* @__PURE__ */ b("span", {
|
|
409
|
-
className:
|
|
412
|
+
className: N,
|
|
410
413
|
children: "When a light has no reference of its own"
|
|
411
414
|
}), /* @__PURE__ */ x("select", {
|
|
412
415
|
value: e.onUncoveredCondition,
|
|
413
416
|
disabled: n,
|
|
414
|
-
className:
|
|
417
|
+
className: M,
|
|
415
418
|
onChange: (e) => {
|
|
416
419
|
let t = e.target.value;
|
|
417
420
|
(t === "skip" || t === "judge-anyway") && l({ onUncoveredCondition: t });
|
|
@@ -427,26 +430,26 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
427
430
|
}),
|
|
428
431
|
/* @__PURE__ */ b("p", {
|
|
429
432
|
className: d,
|
|
430
|
-
children:
|
|
433
|
+
children: z[e.onUncoveredCondition]
|
|
431
434
|
})
|
|
432
435
|
]
|
|
433
436
|
}),
|
|
434
437
|
/* @__PURE__ */ x("div", {
|
|
435
|
-
className:
|
|
438
|
+
className: P,
|
|
436
439
|
children: [
|
|
437
440
|
/* @__PURE__ */ b("p", {
|
|
438
|
-
className:
|
|
441
|
+
className: F,
|
|
439
442
|
children: "What you get told"
|
|
440
443
|
}),
|
|
441
444
|
/* @__PURE__ */ x("label", {
|
|
442
445
|
className: "flex flex-col gap-1",
|
|
443
446
|
children: [/* @__PURE__ */ b("span", {
|
|
444
|
-
className:
|
|
447
|
+
className: N,
|
|
445
448
|
children: "Notifications follow"
|
|
446
449
|
}), /* @__PURE__ */ x("select", {
|
|
447
450
|
value: e.emit,
|
|
448
451
|
disabled: n,
|
|
449
|
-
className:
|
|
452
|
+
className: M,
|
|
450
453
|
onChange: (e) => {
|
|
451
454
|
let t = e.target.value;
|
|
452
455
|
(t === "latched" || t === "live") && l({ emit: t });
|
|
@@ -472,7 +475,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
472
475
|
disabled: n,
|
|
473
476
|
onChange: (e) => l({ autoRestore: e.target.checked })
|
|
474
477
|
}), /* @__PURE__ */ b("span", {
|
|
475
|
-
className:
|
|
478
|
+
className: N,
|
|
476
479
|
children: "Clear the flag by itself when things look normal again"
|
|
477
480
|
})]
|
|
478
481
|
}),
|
|
@@ -483,10 +486,10 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
483
486
|
]
|
|
484
487
|
}),
|
|
485
488
|
/* @__PURE__ */ x("div", {
|
|
486
|
-
className:
|
|
489
|
+
className: P,
|
|
487
490
|
children: [
|
|
488
491
|
/* @__PURE__ */ b("p", {
|
|
489
|
-
className:
|
|
492
|
+
className: F,
|
|
490
493
|
children: "AI double-check"
|
|
491
494
|
}),
|
|
492
495
|
/* @__PURE__ */ x("label", {
|
|
@@ -496,25 +499,25 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
496
499
|
checked: f,
|
|
497
500
|
disabled: n || a.confirmPrompt.trim().length === 0,
|
|
498
501
|
onChange: (e) => l(e.target.checked ? { confirm: {
|
|
499
|
-
...
|
|
502
|
+
...U(a.confirmPrompt.trim()),
|
|
500
503
|
enabled: !0
|
|
501
504
|
} } : { confirm: null })
|
|
502
505
|
}), /* @__PURE__ */ b("span", {
|
|
503
|
-
className:
|
|
506
|
+
className: N,
|
|
504
507
|
children: "Ask a vision model before changing the answer"
|
|
505
508
|
})]
|
|
506
509
|
}),
|
|
507
510
|
/* @__PURE__ */ x("label", {
|
|
508
511
|
className: "flex flex-col gap-1",
|
|
509
512
|
children: [/* @__PURE__ */ b("span", {
|
|
510
|
-
className:
|
|
513
|
+
className: N,
|
|
511
514
|
children: "The question to ask"
|
|
512
515
|
}), /* @__PURE__ */ b("input", {
|
|
513
516
|
type: "text",
|
|
514
517
|
value: a.confirmPrompt,
|
|
515
518
|
placeholder: "e.g. Is the wheelie bin still there?",
|
|
516
519
|
disabled: n,
|
|
517
|
-
className:
|
|
520
|
+
className: M,
|
|
518
521
|
onFocus: () => c(!0),
|
|
519
522
|
onChange: (e) => o((t) => ({
|
|
520
523
|
...t,
|
|
@@ -523,7 +526,7 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
523
526
|
onBlur: () => {
|
|
524
527
|
let t = a.confirmPrompt.trim();
|
|
525
528
|
t.length > 0 && t !== e.confirm?.prompt ? l({ confirm: {
|
|
526
|
-
...
|
|
529
|
+
...U(t),
|
|
527
530
|
enabled: f
|
|
528
531
|
} }) : c(!1);
|
|
529
532
|
}
|
|
@@ -542,10 +545,10 @@ function B({ monitor: e, disabled: n, onPatch: r }) {
|
|
|
542
545
|
]
|
|
543
546
|
});
|
|
544
547
|
}
|
|
545
|
-
function
|
|
548
|
+
function H(e, t, n) {
|
|
546
549
|
return Math.min(n, Math.max(t, e));
|
|
547
550
|
}
|
|
548
|
-
function
|
|
551
|
+
function U(e) {
|
|
549
552
|
return {
|
|
550
553
|
enabled: !1,
|
|
551
554
|
prompt: e,
|
|
@@ -557,13 +560,13 @@ function H(e) {
|
|
|
557
560
|
//#endregion
|
|
558
561
|
//#region ../ui-library/src/composites/cap-settings/SceneMonitorEditor.tsx
|
|
559
562
|
a();
|
|
560
|
-
var
|
|
563
|
+
var W = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", G = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors", K = "rounded-md border border-danger/50 bg-danger/10 px-2 py-1 text-[11px] font-medium text-danger hover:bg-danger/20 disabled:opacity-40 transition-colors", q = {
|
|
561
564
|
alarm: "border-danger/50 bg-danger/15 text-danger",
|
|
562
565
|
ok: "border-success/50 bg-success/15 text-success",
|
|
563
566
|
unknown: "border-border bg-surface text-foreground-subtle"
|
|
564
|
-
},
|
|
565
|
-
function
|
|
566
|
-
let s = u(l().trpcClient, a), p = o(s?.state.sceneMonitor),
|
|
567
|
+
}, J = .8, Y = 3;
|
|
568
|
+
function X({ deviceId: a }) {
|
|
569
|
+
let s = u(l().trpcClient, a), p = o(s?.state.sceneMonitor), m = re(a, { width: 640 }), [w, T] = t(null), [E, D] = t(!1), [O, A] = t(null), [j, M] = t(null), [N, P] = t(null), [F, I] = t(null), [L, R] = t(!1), [z, B] = t(null), [H, U] = t(""), X = n(!0);
|
|
567
570
|
i(() => (X.current = !0, () => {
|
|
568
571
|
X.current = !1;
|
|
569
572
|
}), []);
|
|
@@ -604,7 +607,7 @@ function Y({ deviceId: a }) {
|
|
|
604
607
|
}, [Q, z]), se = e((e, t) => {
|
|
605
608
|
if (t.kind === "rect") {
|
|
606
609
|
if (e === "__draft__") {
|
|
607
|
-
|
|
610
|
+
B(t);
|
|
608
611
|
return;
|
|
609
612
|
}
|
|
610
613
|
$(`roi-${String(e)}`, async () => s?.sceneMonitor?.updateScene({
|
|
@@ -613,7 +616,7 @@ function Y({ deviceId: a }) {
|
|
|
613
616
|
}));
|
|
614
617
|
}
|
|
615
618
|
}, [s, $]), ce = e((e) => {
|
|
616
|
-
e.kind === "rect" &&
|
|
619
|
+
e.kind === "rect" && B(e);
|
|
617
620
|
}, []), le = e(async () => {
|
|
618
621
|
z === null || H.trim().length === 0 || (await $("create", async () => {
|
|
619
622
|
await s?.sceneMonitor?.createScene({
|
|
@@ -621,11 +624,11 @@ function Y({ deviceId: a }) {
|
|
|
621
624
|
roi: z,
|
|
622
625
|
check: {
|
|
623
626
|
mode: "similarity",
|
|
624
|
-
threshold:
|
|
625
|
-
hysteresisCount:
|
|
627
|
+
threshold: J,
|
|
628
|
+
hysteresisCount: Y
|
|
626
629
|
}
|
|
627
630
|
});
|
|
628
|
-
}),
|
|
631
|
+
}), B(null), U(""), R(!1));
|
|
629
632
|
}, [
|
|
630
633
|
s,
|
|
631
634
|
z,
|
|
@@ -644,7 +647,7 @@ function Y({ deviceId: a }) {
|
|
|
644
647
|
}),
|
|
645
648
|
/* @__PURE__ */ b("div", {
|
|
646
649
|
className: "relative overflow-hidden rounded-md border border-border",
|
|
647
|
-
children: /* @__PURE__ */ b(
|
|
650
|
+
children: /* @__PURE__ */ b(C, {
|
|
648
651
|
items: oe,
|
|
649
652
|
supportedShapes: ["rect"],
|
|
650
653
|
selectedId: N ?? (z === null ? null : "__draft__"),
|
|
@@ -652,8 +655,8 @@ function Y({ deviceId: a }) {
|
|
|
652
655
|
onShapeChange: se,
|
|
653
656
|
onDrawComplete: ce,
|
|
654
657
|
drawingKind: L && z === null ? "rect" : null,
|
|
655
|
-
backdrop:
|
|
656
|
-
src:
|
|
658
|
+
backdrop: m.src === null ? null : /* @__PURE__ */ b("img", {
|
|
659
|
+
src: m.src,
|
|
657
660
|
alt: "",
|
|
658
661
|
className: "h-full w-full object-contain",
|
|
659
662
|
draggable: !1
|
|
@@ -664,18 +667,18 @@ function Y({ deviceId: a }) {
|
|
|
664
667
|
className: "flex flex-wrap items-center gap-2",
|
|
665
668
|
children: [/* @__PURE__ */ b("button", {
|
|
666
669
|
type: "button",
|
|
667
|
-
className: L ?
|
|
670
|
+
className: L ? G : W,
|
|
668
671
|
"aria-pressed": L,
|
|
669
672
|
onClick: () => {
|
|
670
|
-
R((e) => !e),
|
|
673
|
+
R((e) => !e), B(null);
|
|
671
674
|
},
|
|
672
|
-
disabled:
|
|
675
|
+
disabled: O !== null,
|
|
673
676
|
children: L ? "Cancel" : "+ New scene"
|
|
674
677
|
}), /* @__PURE__ */ b("button", {
|
|
675
678
|
type: "button",
|
|
676
|
-
className:
|
|
677
|
-
onClick:
|
|
678
|
-
disabled:
|
|
679
|
+
className: W,
|
|
680
|
+
onClick: m.refresh,
|
|
681
|
+
disabled: O !== null,
|
|
679
682
|
children: "Refresh frame"
|
|
680
683
|
})]
|
|
681
684
|
}),
|
|
@@ -695,14 +698,14 @@ function Y({ deviceId: a }) {
|
|
|
695
698
|
children: [/* @__PURE__ */ b("input", {
|
|
696
699
|
type: "text",
|
|
697
700
|
value: H,
|
|
698
|
-
onChange: (e) =>
|
|
701
|
+
onChange: (e) => U(e.target.value),
|
|
699
702
|
placeholder: "e.g. Immondizia prelevata",
|
|
700
703
|
className: "flex-1 rounded-md border border-border bg-surface px-2 py-1 text-[12px] text-foreground"
|
|
701
704
|
}), /* @__PURE__ */ b("button", {
|
|
702
705
|
type: "button",
|
|
703
|
-
className:
|
|
706
|
+
className: G,
|
|
704
707
|
onClick: () => void le(),
|
|
705
|
-
disabled: z === null || H.trim().length === 0 ||
|
|
708
|
+
disabled: z === null || H.trim().length === 0 || O !== null,
|
|
706
709
|
children: "Create"
|
|
707
710
|
})]
|
|
708
711
|
})
|
|
@@ -718,7 +721,7 @@ function Y({ deviceId: a }) {
|
|
|
718
721
|
}) : /* @__PURE__ */ b("ul", {
|
|
719
722
|
className: "flex flex-col gap-2",
|
|
720
723
|
children: Q.map((e) => {
|
|
721
|
-
let t =
|
|
724
|
+
let t = ne(e);
|
|
722
725
|
return /* @__PURE__ */ x("li", {
|
|
723
726
|
className: `flex flex-col gap-1.5 rounded-md border p-2 ${N === e.id ? "border-primary/50" : "border-border"}`,
|
|
724
727
|
children: [
|
|
@@ -730,21 +733,21 @@ function Y({ deviceId: a }) {
|
|
|
730
733
|
onClick: () => P(e.id),
|
|
731
734
|
children: e.label
|
|
732
735
|
}), /* @__PURE__ */ b("span", {
|
|
733
|
-
className: `rounded border px-1.5 py-0.5 text-[10px] font-medium ${
|
|
736
|
+
className: `rounded border px-1.5 py-0.5 text-[10px] font-medium ${q[t.tone]}`,
|
|
734
737
|
children: t.text
|
|
735
738
|
})]
|
|
736
739
|
}),
|
|
737
740
|
/* @__PURE__ */ b("p", {
|
|
738
741
|
className: `${d} leading-relaxed`,
|
|
739
|
-
children:
|
|
742
|
+
children: g(e, ae)
|
|
740
743
|
}),
|
|
741
744
|
/* @__PURE__ */ b("p", {
|
|
742
745
|
className: `${d} tabular-nums`,
|
|
743
|
-
children:
|
|
746
|
+
children: te(e)
|
|
744
747
|
}),
|
|
745
|
-
/* @__PURE__ */ b(
|
|
748
|
+
/* @__PURE__ */ b(k, {
|
|
746
749
|
monitor: e,
|
|
747
|
-
disabled:
|
|
750
|
+
disabled: O !== null,
|
|
748
751
|
onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () => s.sceneMonitor?.deleteReference({
|
|
749
752
|
monitorId: e.id,
|
|
750
753
|
stateId: t,
|
|
@@ -754,13 +757,13 @@ function Y({ deviceId: a }) {
|
|
|
754
757
|
/* @__PURE__ */ x("div", {
|
|
755
758
|
className: "flex flex-wrap items-center gap-1.5",
|
|
756
759
|
children: [
|
|
757
|
-
|
|
760
|
+
h.map((t) => {
|
|
758
761
|
let n = t === "ir";
|
|
759
762
|
return /* @__PURE__ */ x("button", {
|
|
760
763
|
type: "button",
|
|
761
|
-
className:
|
|
762
|
-
disabled:
|
|
763
|
-
title: n ? "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken." : `Take a fresh photo now and store it as the ${
|
|
764
|
+
className: W,
|
|
765
|
+
disabled: O !== null,
|
|
766
|
+
title: n ? "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken." : `Take a fresh photo now and store it as the ${_(t).toLowerCase()} reference`,
|
|
764
767
|
onClick: () => void $(`cap-${e.id}-${t}`, async () => s.sceneMonitor?.captureReference({
|
|
765
768
|
monitorId: e.id,
|
|
766
769
|
condition: t
|
|
@@ -768,7 +771,7 @@ function Y({ deviceId: a }) {
|
|
|
768
771
|
children: [
|
|
769
772
|
/* @__PURE__ */ b(ee, { className: "mr-1 inline h-3 w-3" }),
|
|
770
773
|
"Capture ",
|
|
771
|
-
|
|
774
|
+
_(t).toLowerCase(),
|
|
772
775
|
n && /* @__PURE__ */ b("span", {
|
|
773
776
|
className: "ml-1 text-foreground-subtle/70",
|
|
774
777
|
children: "(optional)"
|
|
@@ -778,40 +781,40 @@ function Y({ deviceId: a }) {
|
|
|
778
781
|
}),
|
|
779
782
|
/* @__PURE__ */ x("button", {
|
|
780
783
|
type: "button",
|
|
781
|
-
className:
|
|
782
|
-
disabled:
|
|
784
|
+
className: G,
|
|
785
|
+
disabled: O !== null || e.states.length === 0,
|
|
783
786
|
title: "Clear the flag and re-photograph what normal looks like right now",
|
|
784
787
|
onClick: () => void $(`reset-${e.id}`, async () => s.sceneMonitor?.resetScene({ monitorId: e.id })),
|
|
785
|
-
children: [/* @__PURE__ */ b(
|
|
788
|
+
children: [/* @__PURE__ */ b(v, { className: "mr-1 inline h-3 w-3" }), "Reset"]
|
|
786
789
|
}),
|
|
787
790
|
/* @__PURE__ */ b("button", {
|
|
788
791
|
type: "button",
|
|
789
|
-
className:
|
|
790
|
-
disabled:
|
|
792
|
+
className: W,
|
|
793
|
+
disabled: O !== null,
|
|
791
794
|
onClick: () => void $(`check-${e.id}`, async () => s.sceneMonitor?.recheckNow({ monitorId: e.id })),
|
|
792
795
|
children: "Check now"
|
|
793
796
|
}),
|
|
794
797
|
/* @__PURE__ */ x("button", {
|
|
795
798
|
type: "button",
|
|
796
|
-
className: F === e.id ?
|
|
799
|
+
className: F === e.id ? G : W,
|
|
797
800
|
"aria-pressed": F === e.id,
|
|
798
801
|
"aria-label": `Settings for ${e.label}`,
|
|
799
|
-
disabled:
|
|
802
|
+
disabled: O !== null,
|
|
800
803
|
onClick: () => I((t) => t === e.id ? null : e.id),
|
|
801
|
-
children: [/* @__PURE__ */ b(
|
|
804
|
+
children: [/* @__PURE__ */ b(ie, { className: "mr-1 inline h-3 w-3" }), "Settings"]
|
|
802
805
|
}),
|
|
803
806
|
/* @__PURE__ */ b("button", {
|
|
804
807
|
type: "button",
|
|
805
|
-
className:
|
|
806
|
-
disabled:
|
|
808
|
+
className: K,
|
|
809
|
+
disabled: O !== null,
|
|
807
810
|
onClick: () => void $(`del-${e.id}`, async () => s.sceneMonitor?.deleteScene({ monitorId: e.id })),
|
|
808
811
|
children: /* @__PURE__ */ b(y, { className: "h-3 w-3" })
|
|
809
812
|
})
|
|
810
813
|
]
|
|
811
814
|
}),
|
|
812
|
-
F === e.id && /* @__PURE__ */ b(
|
|
815
|
+
F === e.id && /* @__PURE__ */ b(V, {
|
|
813
816
|
monitor: e,
|
|
814
|
-
disabled:
|
|
817
|
+
disabled: O !== null,
|
|
815
818
|
onPatch: (t) => void $(`tune-${e.id}`, async () => s.sceneMonitor?.updateScene({
|
|
816
819
|
monitorId: e.id,
|
|
817
820
|
patch: t
|
|
@@ -825,4 +828,4 @@ function Y({ deviceId: a }) {
|
|
|
825
828
|
}) : null;
|
|
826
829
|
}
|
|
827
830
|
//#endregion
|
|
828
|
-
export {
|
|
831
|
+
export { X as SceneMonitorEditor };
|