@camstack/addon-training 0.1.91 → 0.1.93
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-kbJlg0c5.mjs → MotionZonesSettings-BDIz0ADl.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-B3gzWS6Y.mjs → PrivacyMaskSettings-Cz_1itEY.mjs} +2 -2
- package/dist/{SceneMonitorEditor-CjxaItjN.mjs → SceneMonitorEditor-DxdQN6e5.mjs} +119 -120
- package/dist/_stub.js +5328 -5342
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Cer78kD4.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-BZNWvnmy.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B6wwfPOo.mjs +26 -0
- package/dist/addon-training.css +1 -1
- package/dist/{dist-B3Dz3xDZ.mjs → dist-Bna6QSX9.mjs} +280 -30
- package/dist/{dist-uLc6FQWF.js → dist-Cv8pFcIo.js} +280 -30
- package/dist/{hostInit-C-l48gwp.mjs → hostInit-BsH6KoQn.mjs} +2 -2
- package/dist/index.js +1 -1
- package/dist/orchestrator/training.addon.js +1 -1
- package/dist/orchestrator/training.addon.mjs +1 -1
- package/dist/{player-overlays-DrA4TUe3.mjs → player-overlays-ClwLHxNP.mjs} +1 -1
- package/dist/providers/modal/training-modal.addon.js +1 -1
- package/dist/providers/modal/training-modal.addon.mjs +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-C46lpRSX.mjs → responsive-Cx4quvGq.mjs} +1 -1
- package/dist/{scene-monitor-copy-Cqfs4Vng.mjs → scene-monitor-copy-DIJUg8Ro.mjs} +63 -46
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-qVIpiQZD.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-C-gbqU_M.mjs} +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DM1LS5rC.mjs +0 -26
|
@@ -4,9 +4,9 @@ import { r as l, t as u } from "./ui-text-CqJgUCKX.mjs";
|
|
|
4
4
|
import { n as d, r as f, t as p } from "./rotate-ccw-Cu6tGrgG.mjs";
|
|
5
5
|
import { t as m } from "./settings-2-xV0I5Y5U.mjs";
|
|
6
6
|
import { t as h } from "./trash-2-BKfuhsgY.mjs";
|
|
7
|
-
import { c as g, d as _, h as v, p as y, u as b } from "./responsive-
|
|
8
|
-
import { a as x, c as S, i as C, n as
|
|
9
|
-
import { MaskShapeCanvas as
|
|
7
|
+
import { c as g, d as _, h as v, p as y, u as b } from "./responsive-Cx4quvGq.mjs";
|
|
8
|
+
import { a as x, c as S, i as C, l as w, n as T, o as E, r as D, s as ee, t as te } from "./scene-monitor-copy-DIJUg8Ro.mjs";
|
|
9
|
+
import { MaskShapeCanvas as ne } from "./MaskShapeCanvas-HNL0xNpy.mjs";
|
|
10
10
|
//#region ../ui-library/src/composites/cap-settings/SceneReferenceGallery.tsx
|
|
11
11
|
i();
|
|
12
12
|
var O = S("/addon/pipeline-analytics/event-media");
|
|
@@ -32,8 +32,8 @@ function j(e) {
|
|
|
32
32
|
return e.states.reduce((e, t) => e + t.references.length, 0);
|
|
33
33
|
}
|
|
34
34
|
var M = "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";
|
|
35
|
-
function
|
|
36
|
-
let r = l(), i = A(e),
|
|
35
|
+
function N({ monitor: e, disabled: t, onDelete: n }) {
|
|
36
|
+
let r = l(), i = A(e), a = j(e), c = w();
|
|
37
37
|
return i.length === 0 ? /* @__PURE__ */ o("p", {
|
|
38
38
|
className: `${g} leading-relaxed`,
|
|
39
39
|
children: r("uiLibrary.sceneReferenceGallery.empty", "No photographs captured yet. Press “Capture daylight” to take the one this scene will judge everything against.")
|
|
@@ -44,54 +44,53 @@ function ne({ monitor: e, disabled: t, onDelete: n }) {
|
|
|
44
44
|
children: [/* @__PURE__ */ s("p", {
|
|
45
45
|
className: "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle",
|
|
46
46
|
children: [
|
|
47
|
-
|
|
47
|
+
E(e.condition, r),
|
|
48
48
|
" · ",
|
|
49
49
|
e.tiles.length
|
|
50
50
|
]
|
|
51
51
|
}), /* @__PURE__ */ o("ul", {
|
|
52
52
|
className: "flex flex-wrap gap-1.5",
|
|
53
53
|
children: e.tiles.map((i) => {
|
|
54
|
-
let
|
|
54
|
+
let l = `${i.stateId}:${String(i.index)}`, u = a === 1;
|
|
55
55
|
return /* @__PURE__ */ s("li", {
|
|
56
56
|
className: "flex w-24 flex-col gap-1 rounded-md border border-border p-1",
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */ o(
|
|
58
|
+
/* @__PURE__ */ o(P, { reference: i.reference }),
|
|
59
59
|
/* @__PURE__ */ o("span", {
|
|
60
60
|
className: `${g} tabular-nums`,
|
|
61
|
-
children:
|
|
61
|
+
children: F(i.reference.capturedAt)
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ s("button", {
|
|
64
64
|
type: "button",
|
|
65
65
|
className: M,
|
|
66
66
|
disabled: t,
|
|
67
67
|
"aria-label": r("uiLibrary.sceneReferenceGallery.deleteLabel", "Delete the {{variant}} photograph from {{date}}", {
|
|
68
|
-
variant:
|
|
69
|
-
date:
|
|
68
|
+
variant: E(e.condition, r).toLowerCase(),
|
|
69
|
+
date: F(i.reference.capturedAt)
|
|
70
70
|
}),
|
|
71
71
|
onClick: () => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
(async () => {
|
|
73
|
+
u && !await c({
|
|
74
|
+
title: r("uiLibrary.sceneReferenceGallery.deleteTitle", "Delete the only photograph?"),
|
|
75
|
+
message: r("uiLibrary.sceneReferenceGallery.lastWarning", "This is the only photograph this scene has. Delete it and the scene no longer knows what normal looks like — it stops judging until you capture again."),
|
|
76
|
+
confirmLabel: r("uiLibrary.sceneReferenceGallery.delete", "Delete"),
|
|
77
|
+
variant: "danger"
|
|
78
|
+
}) || n({
|
|
79
|
+
stateId: i.stateId,
|
|
80
|
+
index: i.index
|
|
81
|
+
});
|
|
82
|
+
})();
|
|
80
83
|
},
|
|
81
|
-
children: [/* @__PURE__ */ o(h, { className: "mr-1 inline h-3 w-3" }),
|
|
82
|
-
}),
|
|
83
|
-
f && /* @__PURE__ */ o("p", {
|
|
84
|
-
className: "text-[10px] leading-snug text-warning",
|
|
85
|
-
children: r("uiLibrary.sceneReferenceGallery.lastWarning", "This is the only photograph this scene has. Delete it and the scene no longer knows what normal looks like — it stops judging until you capture again.")
|
|
84
|
+
children: [/* @__PURE__ */ o(h, { className: "mr-1 inline h-3 w-3" }), r("uiLibrary.sceneReferenceGallery.delete", "Delete")]
|
|
86
85
|
})
|
|
87
86
|
]
|
|
88
|
-
},
|
|
87
|
+
}, l);
|
|
89
88
|
})
|
|
90
89
|
})]
|
|
91
90
|
}, e.condition))
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
|
-
function
|
|
93
|
+
function P({ reference: e }) {
|
|
95
94
|
let t = l(), [n, r] = a(!1), i = e.thumbnailMediaId;
|
|
96
95
|
return i === void 0 || n ? /* @__PURE__ */ s("div", {
|
|
97
96
|
className: "flex h-16 w-full flex-col items-center justify-center gap-0.5 rounded bg-surface text-foreground-subtle",
|
|
@@ -108,7 +107,7 @@ function N({ reference: e }) {
|
|
|
108
107
|
onError: () => r(!0)
|
|
109
108
|
});
|
|
110
109
|
}
|
|
111
|
-
function
|
|
110
|
+
function F(e) {
|
|
112
111
|
let t = new Date(e);
|
|
113
112
|
return `${t.toLocaleDateString()} ${t.toLocaleTimeString([], {
|
|
114
113
|
hour: "2-digit",
|
|
@@ -118,21 +117,21 @@ function P(e) {
|
|
|
118
117
|
//#endregion
|
|
119
118
|
//#region ../ui-library/src/composites/cap-settings/SceneSettingsForm.tsx
|
|
120
119
|
i();
|
|
121
|
-
var
|
|
122
|
-
function
|
|
120
|
+
var I = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50", L = "text-[10px] font-medium text-foreground-subtle", R = "flex flex-col gap-2 rounded-md border border-border bg-surface/40 p-2", z = "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle", B = 5, V = 3600;
|
|
121
|
+
function H(e, t) {
|
|
123
122
|
switch (e) {
|
|
124
123
|
case "periodic": return t("uiLibrary.sceneSettingsForm.triggerHintPeriodic", "Only on the clock. Predictable, and it notices a change even on a camera nothing ever moves in front of.");
|
|
125
124
|
case "on-motion": return t("uiLibrary.sceneSettingsForm.triggerHintOnMotion", "Only after the camera has been still again for the quiet window below. Cheapest, but a change nobody walks past is never seen.");
|
|
126
125
|
case "both": return t("uiLibrary.sceneSettingsForm.triggerHintBoth", "Both — the clock is the safety net that lets the motion path miss. This is the right answer for almost every scene.");
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
|
-
function
|
|
128
|
+
function U(e, t) {
|
|
130
129
|
switch (e) {
|
|
131
130
|
case "skip": return t("uiLibrary.sceneSettingsForm.uncoveredHintSkip", "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.");
|
|
132
131
|
case "judge-anyway": return t("uiLibrary.sceneSettingsForm.uncoveredHintJudge", "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.");
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
|
-
function
|
|
134
|
+
function W(e) {
|
|
136
135
|
return {
|
|
137
136
|
label: e.label,
|
|
138
137
|
checkIntervalSec: e.checkIntervalSec ?? 60,
|
|
@@ -143,10 +142,10 @@ function U(e) {
|
|
|
143
142
|
confirmPrompt: e.confirm?.prompt ?? ""
|
|
144
143
|
};
|
|
145
144
|
}
|
|
146
|
-
function
|
|
147
|
-
let i = l(), [d, f] = a(() =>
|
|
145
|
+
function G({ monitor: t, disabled: n, onPatch: r }) {
|
|
146
|
+
let i = l(), [d, f] = a(() => W(t)), [p, m] = a(!1);
|
|
148
147
|
e(() => {
|
|
149
|
-
p || f(
|
|
148
|
+
p || f(W(t));
|
|
150
149
|
}, [t, p]);
|
|
151
150
|
let h = (e) => {
|
|
152
151
|
m(!1), r(e);
|
|
@@ -162,22 +161,22 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
162
161
|
className: "flex flex-col gap-2",
|
|
163
162
|
children: [
|
|
164
163
|
/* @__PURE__ */ s("div", {
|
|
165
|
-
className:
|
|
164
|
+
className: R,
|
|
166
165
|
children: [
|
|
167
166
|
/* @__PURE__ */ o("p", {
|
|
168
|
-
className:
|
|
167
|
+
className: z,
|
|
169
168
|
children: i("uiLibrary.sceneSettingsForm.whatItWatches", "What it watches")
|
|
170
169
|
}),
|
|
171
170
|
/* @__PURE__ */ s("label", {
|
|
172
171
|
className: "flex flex-col gap-1",
|
|
173
172
|
children: [/* @__PURE__ */ o("span", {
|
|
174
|
-
className:
|
|
173
|
+
className: L,
|
|
175
174
|
children: i("uiLibrary.sceneSettingsForm.name", "Name")
|
|
176
175
|
}), /* @__PURE__ */ o("input", {
|
|
177
176
|
type: "text",
|
|
178
177
|
value: d.label,
|
|
179
178
|
disabled: n,
|
|
180
|
-
className:
|
|
179
|
+
className: I,
|
|
181
180
|
onFocus: () => m(!0),
|
|
182
181
|
onChange: (e) => f((t) => ({
|
|
183
182
|
...t,
|
|
@@ -197,7 +196,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
197
196
|
disabled: n,
|
|
198
197
|
onChange: (e) => h({ enabled: e.target.checked })
|
|
199
198
|
}), /* @__PURE__ */ o("span", {
|
|
200
|
-
className:
|
|
199
|
+
className: L,
|
|
201
200
|
children: i("uiLibrary.sceneSettingsForm.watching", "Watching")
|
|
202
201
|
})]
|
|
203
202
|
}),
|
|
@@ -208,12 +207,12 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
208
207
|
/* @__PURE__ */ s("label", {
|
|
209
208
|
className: "flex flex-col gap-1",
|
|
210
209
|
children: [/* @__PURE__ */ o("span", {
|
|
211
|
-
className:
|
|
210
|
+
className: L,
|
|
212
211
|
children: i("uiLibrary.sceneSettingsForm.whenToLook", "When to look")
|
|
213
212
|
}), /* @__PURE__ */ s("select", {
|
|
214
213
|
value: t.triggerMode,
|
|
215
214
|
disabled: n,
|
|
216
|
-
className:
|
|
215
|
+
className: I,
|
|
217
216
|
onChange: (e) => {
|
|
218
217
|
let t = e.target.value;
|
|
219
218
|
(t === "periodic" || t === "on-motion" || t === "both") && h({ triggerMode: t });
|
|
@@ -236,27 +235,27 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
236
235
|
}),
|
|
237
236
|
/* @__PURE__ */ o("p", {
|
|
238
237
|
className: g,
|
|
239
|
-
children:
|
|
238
|
+
children: H(t.triggerMode, i)
|
|
240
239
|
}),
|
|
241
240
|
/* @__PURE__ */ s("label", {
|
|
242
241
|
className: "flex flex-col gap-1",
|
|
243
242
|
children: [/* @__PURE__ */ o("span", {
|
|
244
|
-
className:
|
|
243
|
+
className: L,
|
|
245
244
|
children: i("uiLibrary.sceneSettingsForm.checkEvery", "Check every (seconds)")
|
|
246
245
|
}), /* @__PURE__ */ o("input", {
|
|
247
246
|
type: "number",
|
|
248
|
-
min:
|
|
249
|
-
max:
|
|
247
|
+
min: B,
|
|
248
|
+
max: V,
|
|
250
249
|
value: d.checkIntervalSec,
|
|
251
250
|
disabled: n,
|
|
252
|
-
className:
|
|
251
|
+
className: I,
|
|
253
252
|
onFocus: () => m(!0),
|
|
254
253
|
onChange: (e) => f((t) => ({
|
|
255
254
|
...t,
|
|
256
255
|
checkIntervalSec: Number(e.target.value) || 0
|
|
257
256
|
})),
|
|
258
257
|
onBlur: () => {
|
|
259
|
-
let e =
|
|
258
|
+
let e = K(d.checkIntervalSec, B, V);
|
|
260
259
|
e === t.checkIntervalSec ? m(!1) : h({ checkIntervalSec: e });
|
|
261
260
|
}
|
|
262
261
|
})]
|
|
@@ -268,16 +267,16 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
268
267
|
]
|
|
269
268
|
}),
|
|
270
269
|
/* @__PURE__ */ s("div", {
|
|
271
|
-
className:
|
|
270
|
+
className: R,
|
|
272
271
|
children: [
|
|
273
272
|
/* @__PURE__ */ o("p", {
|
|
274
|
-
className:
|
|
273
|
+
className: z,
|
|
275
274
|
children: i("uiLibrary.sceneSettingsForm.howSure", "How sure it has to be")
|
|
276
275
|
}),
|
|
277
276
|
t.check.mode === "similarity" && /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ s("label", {
|
|
278
277
|
className: "flex flex-col gap-1",
|
|
279
278
|
children: [/* @__PURE__ */ o("span", {
|
|
280
|
-
className:
|
|
279
|
+
className: L,
|
|
281
280
|
children: /* @__PURE__ */ o(u, {
|
|
282
281
|
uiKey: "uiLibrary.sceneSettingsForm.matchThreshold",
|
|
283
282
|
fallback: "Match threshold — <0>{{value}}</0>",
|
|
@@ -310,7 +309,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
310
309
|
/* @__PURE__ */ s("label", {
|
|
311
310
|
className: "flex flex-col gap-1",
|
|
312
311
|
children: [/* @__PURE__ */ o("span", {
|
|
313
|
-
className:
|
|
312
|
+
className: L,
|
|
314
313
|
children: i("uiLibrary.sceneSettingsForm.agreeingChecks", "Agreeing checks before it changes its mind")
|
|
315
314
|
}), /* @__PURE__ */ o("input", {
|
|
316
315
|
type: "number",
|
|
@@ -318,14 +317,14 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
318
317
|
max: 10,
|
|
319
318
|
value: d.hysteresisCount,
|
|
320
319
|
disabled: n,
|
|
321
|
-
className:
|
|
320
|
+
className: I,
|
|
322
321
|
onFocus: () => m(!0),
|
|
323
322
|
onChange: (e) => f((t) => ({
|
|
324
323
|
...t,
|
|
325
324
|
hysteresisCount: Number(e.target.value) || 1
|
|
326
325
|
})),
|
|
327
326
|
onBlur: () => {
|
|
328
|
-
let e =
|
|
327
|
+
let e = K(d.hysteresisCount, 1, 10);
|
|
329
328
|
e === t.check.hysteresisCount ? m(!1) : h({ check: _({ hysteresisCount: e }) });
|
|
330
329
|
}
|
|
331
330
|
})]
|
|
@@ -337,7 +336,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
337
336
|
/* @__PURE__ */ s("label", {
|
|
338
337
|
className: "flex flex-col gap-1",
|
|
339
338
|
children: [/* @__PURE__ */ o("span", {
|
|
340
|
-
className:
|
|
339
|
+
className: L,
|
|
341
340
|
children: i("uiLibrary.sceneSettingsForm.quietFor", "Quiet for (seconds) before a check counts")
|
|
342
341
|
}), /* @__PURE__ */ o("input", {
|
|
343
342
|
type: "number",
|
|
@@ -345,14 +344,14 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
345
344
|
max: 3600,
|
|
346
345
|
value: d.quietSeconds,
|
|
347
346
|
disabled: n,
|
|
348
|
-
className:
|
|
347
|
+
className: I,
|
|
349
348
|
onFocus: () => m(!0),
|
|
350
349
|
onChange: (e) => f((t) => ({
|
|
351
350
|
...t,
|
|
352
351
|
quietSeconds: Number(e.target.value) || 0
|
|
353
352
|
})),
|
|
354
353
|
onBlur: () => {
|
|
355
|
-
let e =
|
|
354
|
+
let e = K(d.quietSeconds, 0, 3600);
|
|
356
355
|
e === t.quietSeconds ? m(!1) : h({ quietSeconds: e });
|
|
357
356
|
}
|
|
358
357
|
})]
|
|
@@ -364,7 +363,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
364
363
|
/* @__PURE__ */ s("label", {
|
|
365
364
|
className: "flex flex-col gap-1",
|
|
366
365
|
children: [/* @__PURE__ */ o("span", {
|
|
367
|
-
className:
|
|
366
|
+
className: L,
|
|
368
367
|
children: i("uiLibrary.sceneSettingsForm.minGap", "Minimum gap between counted checks (seconds)")
|
|
369
368
|
}), /* @__PURE__ */ o("input", {
|
|
370
369
|
type: "number",
|
|
@@ -372,14 +371,14 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
372
371
|
max: 3600,
|
|
373
372
|
value: d.minObservationSpacingSec,
|
|
374
373
|
disabled: n,
|
|
375
|
-
className:
|
|
374
|
+
className: I,
|
|
376
375
|
onFocus: () => m(!0),
|
|
377
376
|
onChange: (e) => f((t) => ({
|
|
378
377
|
...t,
|
|
379
378
|
minObservationSpacingSec: Number(e.target.value) || 0
|
|
380
379
|
})),
|
|
381
380
|
onBlur: () => {
|
|
382
|
-
let e =
|
|
381
|
+
let e = K(d.minObservationSpacingSec, 0, 3600);
|
|
383
382
|
e === t.minObservationSpacingSec ? m(!1) : h({ minObservationSpacingSec: e });
|
|
384
383
|
}
|
|
385
384
|
})]
|
|
@@ -391,21 +390,21 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
391
390
|
]
|
|
392
391
|
}),
|
|
393
392
|
/* @__PURE__ */ s("div", {
|
|
394
|
-
className:
|
|
393
|
+
className: R,
|
|
395
394
|
children: [
|
|
396
395
|
/* @__PURE__ */ o("p", {
|
|
397
|
-
className:
|
|
396
|
+
className: z,
|
|
398
397
|
children: i("uiLibrary.sceneSettingsForm.lighting", "Lighting")
|
|
399
398
|
}),
|
|
400
399
|
/* @__PURE__ */ s("label", {
|
|
401
400
|
className: "flex flex-col gap-1",
|
|
402
401
|
children: [/* @__PURE__ */ o("span", {
|
|
403
|
-
className:
|
|
402
|
+
className: L,
|
|
404
403
|
children: i("uiLibrary.sceneSettingsForm.noReference", "When a light has no reference of its own")
|
|
405
404
|
}), /* @__PURE__ */ s("select", {
|
|
406
405
|
value: t.onUncoveredCondition,
|
|
407
406
|
disabled: n,
|
|
408
|
-
className:
|
|
407
|
+
className: I,
|
|
409
408
|
onChange: (e) => {
|
|
410
409
|
let t = e.target.value;
|
|
411
410
|
(t === "skip" || t === "judge-anyway") && h({ onUncoveredCondition: t });
|
|
@@ -421,26 +420,26 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
421
420
|
}),
|
|
422
421
|
/* @__PURE__ */ o("p", {
|
|
423
422
|
className: g,
|
|
424
|
-
children:
|
|
423
|
+
children: U(t.onUncoveredCondition, i)
|
|
425
424
|
})
|
|
426
425
|
]
|
|
427
426
|
}),
|
|
428
427
|
/* @__PURE__ */ s("div", {
|
|
429
|
-
className:
|
|
428
|
+
className: R,
|
|
430
429
|
children: [
|
|
431
430
|
/* @__PURE__ */ o("p", {
|
|
432
|
-
className:
|
|
431
|
+
className: z,
|
|
433
432
|
children: i("uiLibrary.sceneSettingsForm.whatYouGetTold", "What you get told")
|
|
434
433
|
}),
|
|
435
434
|
/* @__PURE__ */ s("label", {
|
|
436
435
|
className: "flex flex-col gap-1",
|
|
437
436
|
children: [/* @__PURE__ */ o("span", {
|
|
438
|
-
className:
|
|
437
|
+
className: L,
|
|
439
438
|
children: i("uiLibrary.sceneSettingsForm.notificationsFollow", "Notifications follow")
|
|
440
439
|
}), /* @__PURE__ */ s("select", {
|
|
441
440
|
value: t.emit,
|
|
442
441
|
disabled: n,
|
|
443
|
-
className:
|
|
442
|
+
className: I,
|
|
444
443
|
onChange: (e) => {
|
|
445
444
|
let t = e.target.value;
|
|
446
445
|
(t === "latched" || t === "live") && h({ emit: t });
|
|
@@ -466,7 +465,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
466
465
|
disabled: n,
|
|
467
466
|
onChange: (e) => h({ autoRestore: e.target.checked })
|
|
468
467
|
}), /* @__PURE__ */ o("span", {
|
|
469
|
-
className:
|
|
468
|
+
className: L,
|
|
470
469
|
children: i("uiLibrary.sceneSettingsForm.autoRestore", "Clear the flag by itself when things look normal again")
|
|
471
470
|
})]
|
|
472
471
|
}),
|
|
@@ -477,10 +476,10 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
477
476
|
]
|
|
478
477
|
}),
|
|
479
478
|
/* @__PURE__ */ s("div", {
|
|
480
|
-
className:
|
|
479
|
+
className: R,
|
|
481
480
|
children: [
|
|
482
481
|
/* @__PURE__ */ o("p", {
|
|
483
|
-
className:
|
|
482
|
+
className: z,
|
|
484
483
|
children: i("uiLibrary.sceneSettingsForm.aiDoubleCheck", "AI double-check")
|
|
485
484
|
}),
|
|
486
485
|
/* @__PURE__ */ s("label", {
|
|
@@ -490,25 +489,25 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
490
489
|
checked: v,
|
|
491
490
|
disabled: n || d.confirmPrompt.trim().length === 0,
|
|
492
491
|
onChange: (e) => h(e.target.checked ? { confirm: {
|
|
493
|
-
...
|
|
492
|
+
...q(d.confirmPrompt.trim()),
|
|
494
493
|
enabled: !0
|
|
495
494
|
} } : { confirm: null })
|
|
496
495
|
}), /* @__PURE__ */ o("span", {
|
|
497
|
-
className:
|
|
496
|
+
className: L,
|
|
498
497
|
children: i("uiLibrary.sceneSettingsForm.askVision", "Ask a vision model before changing the answer")
|
|
499
498
|
})]
|
|
500
499
|
}),
|
|
501
500
|
/* @__PURE__ */ s("label", {
|
|
502
501
|
className: "flex flex-col gap-1",
|
|
503
502
|
children: [/* @__PURE__ */ o("span", {
|
|
504
|
-
className:
|
|
503
|
+
className: L,
|
|
505
504
|
children: i("uiLibrary.sceneSettingsForm.question", "The question to ask")
|
|
506
505
|
}), /* @__PURE__ */ o("input", {
|
|
507
506
|
type: "text",
|
|
508
507
|
value: d.confirmPrompt,
|
|
509
508
|
placeholder: i("uiLibrary.sceneSettingsForm.questionPlaceholder", "e.g. Is the wheelie bin still there?"),
|
|
510
509
|
disabled: n,
|
|
511
|
-
className:
|
|
510
|
+
className: I,
|
|
512
511
|
onFocus: () => m(!0),
|
|
513
512
|
onChange: (e) => f((t) => ({
|
|
514
513
|
...t,
|
|
@@ -517,7 +516,7 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
517
516
|
onBlur: () => {
|
|
518
517
|
let e = d.confirmPrompt.trim();
|
|
519
518
|
e.length > 0 && e !== t.confirm?.prompt ? h({ confirm: {
|
|
520
|
-
...
|
|
519
|
+
...q(e),
|
|
521
520
|
enabled: v
|
|
522
521
|
} }) : m(!1);
|
|
523
522
|
}
|
|
@@ -536,10 +535,10 @@ function W({ monitor: t, disabled: n, onPatch: r }) {
|
|
|
536
535
|
]
|
|
537
536
|
});
|
|
538
537
|
}
|
|
539
|
-
function
|
|
538
|
+
function K(e, t, n) {
|
|
540
539
|
return Math.min(n, Math.max(t, e));
|
|
541
540
|
}
|
|
542
|
-
function
|
|
541
|
+
function q(e) {
|
|
543
542
|
return {
|
|
544
543
|
enabled: !1,
|
|
545
544
|
prompt: e,
|
|
@@ -551,13 +550,13 @@ function K(e) {
|
|
|
551
550
|
//#endregion
|
|
552
551
|
//#region ../ui-library/src/composites/cap-settings/SceneMonitorEditor.tsx
|
|
553
552
|
i();
|
|
554
|
-
var
|
|
553
|
+
var J = "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", Y = "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", re = "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", ie = {
|
|
555
554
|
alarm: "border-danger/50 bg-danger/15 text-danger",
|
|
556
555
|
ok: "border-success/50 bg-success/15 text-success",
|
|
557
556
|
unknown: "border-border bg-surface text-foreground-subtle"
|
|
558
557
|
}, ae = .8, oe = 3;
|
|
559
|
-
function
|
|
560
|
-
let u = l(), d = _(v().trpcClient, i), S = y(d?.state.sceneMonitor),
|
|
558
|
+
function X({ deviceId: i }) {
|
|
559
|
+
let u = l(), d = _(v().trpcClient, i), S = y(d?.state.sceneMonitor), w = ee(i, { width: 640 }), [O, k] = a(null), [A, j] = a(!1), [M, P] = a(null), [F, I] = a(null), [L, R] = a(null), [z, B] = a(null), [V, H] = a(!1), [U, W] = a(null), [K, q] = a(""), X = r(!0);
|
|
561
560
|
e(() => (X.current = !0, () => {
|
|
562
561
|
X.current = !1;
|
|
563
562
|
}), []);
|
|
@@ -565,16 +564,16 @@ function Y({ deviceId: i }) {
|
|
|
565
564
|
if (d) try {
|
|
566
565
|
let e = await d.sceneMonitor?.listScenes({});
|
|
567
566
|
if (!X.current) return;
|
|
568
|
-
e &&
|
|
567
|
+
e && k(e);
|
|
569
568
|
} catch (e) {
|
|
570
569
|
if (!X.current) return;
|
|
571
|
-
b(e) ?
|
|
570
|
+
b(e) ? j(!0) : I(e instanceof Error ? e.message : String(e));
|
|
572
571
|
}
|
|
573
572
|
}, [d]);
|
|
574
573
|
e(() => {
|
|
575
|
-
|
|
574
|
+
k(null), j(!1), I(null), Z();
|
|
576
575
|
}, [Z]);
|
|
577
|
-
let Q = S?.monitors ??
|
|
576
|
+
let Q = S?.monitors ?? O?.monitors ?? [], se = Date.now(), $ = n(async (e, t) => {
|
|
578
577
|
P(e), I(null);
|
|
579
578
|
try {
|
|
580
579
|
await t(), await Z();
|
|
@@ -602,7 +601,7 @@ function Y({ deviceId: i }) {
|
|
|
602
601
|
]), le = n((e, t) => {
|
|
603
602
|
if (t.kind === "rect") {
|
|
604
603
|
if (e === "__draft__") {
|
|
605
|
-
|
|
604
|
+
W(t);
|
|
606
605
|
return;
|
|
607
606
|
}
|
|
608
607
|
$(`roi-${String(e)}`, async () => d?.sceneMonitor?.updateScene({
|
|
@@ -611,7 +610,7 @@ function Y({ deviceId: i }) {
|
|
|
611
610
|
}));
|
|
612
611
|
}
|
|
613
612
|
}, [d, $]), ue = n((e) => {
|
|
614
|
-
e.kind === "rect" &&
|
|
613
|
+
e.kind === "rect" && W(e);
|
|
615
614
|
}, []), de = n(async () => {
|
|
616
615
|
U === null || K.trim().length === 0 || (await $("create", async () => {
|
|
617
616
|
await d?.sceneMonitor?.createScene({
|
|
@@ -623,7 +622,7 @@ function Y({ deviceId: i }) {
|
|
|
623
622
|
hysteresisCount: oe
|
|
624
623
|
}
|
|
625
624
|
});
|
|
626
|
-
}),
|
|
625
|
+
}), W(null), q(""), H(!1));
|
|
627
626
|
}, [
|
|
628
627
|
d,
|
|
629
628
|
U,
|
|
@@ -632,7 +631,7 @@ function Y({ deviceId: i }) {
|
|
|
632
631
|
]);
|
|
633
632
|
return d ? /* @__PURE__ */ o("div", {
|
|
634
633
|
className: "flex flex-col gap-3",
|
|
635
|
-
children:
|
|
634
|
+
children: A ? /* @__PURE__ */ o("p", {
|
|
636
635
|
className: `${g} leading-relaxed`,
|
|
637
636
|
children: u("uiLibrary.sceneMonitor.unsupported", "Scene monitoring is not available for this camera.")
|
|
638
637
|
}) : /* @__PURE__ */ s(c, { children: [
|
|
@@ -642,7 +641,7 @@ function Y({ deviceId: i }) {
|
|
|
642
641
|
}),
|
|
643
642
|
/* @__PURE__ */ o("div", {
|
|
644
643
|
className: "relative overflow-hidden rounded-md border border-border",
|
|
645
|
-
children: /* @__PURE__ */ o(
|
|
644
|
+
children: /* @__PURE__ */ o(ne, {
|
|
646
645
|
items: ce,
|
|
647
646
|
supportedShapes: ["rect"],
|
|
648
647
|
selectedId: L ?? (U === null ? null : "__draft__"),
|
|
@@ -650,8 +649,8 @@ function Y({ deviceId: i }) {
|
|
|
650
649
|
onShapeChange: le,
|
|
651
650
|
onDrawComplete: ue,
|
|
652
651
|
drawingKind: V && U === null ? "rect" : null,
|
|
653
|
-
backdrop:
|
|
654
|
-
src:
|
|
652
|
+
backdrop: w.src === null ? null : /* @__PURE__ */ o("img", {
|
|
653
|
+
src: w.src,
|
|
655
654
|
alt: "",
|
|
656
655
|
className: "h-full w-full object-contain",
|
|
657
656
|
draggable: !1
|
|
@@ -662,18 +661,18 @@ function Y({ deviceId: i }) {
|
|
|
662
661
|
className: "flex flex-wrap items-center gap-2",
|
|
663
662
|
children: [/* @__PURE__ */ o("button", {
|
|
664
663
|
type: "button",
|
|
665
|
-
className: V ?
|
|
664
|
+
className: V ? Y : J,
|
|
666
665
|
"aria-pressed": V,
|
|
667
666
|
onClick: () => {
|
|
668
|
-
H((e) => !e),
|
|
667
|
+
H((e) => !e), W(null);
|
|
669
668
|
},
|
|
670
|
-
disabled:
|
|
669
|
+
disabled: M !== null,
|
|
671
670
|
children: V ? u("uiLibrary.sceneMonitor.cancel", "Cancel") : u("uiLibrary.sceneMonitor.newScene", "+ New scene")
|
|
672
671
|
}), /* @__PURE__ */ o("button", {
|
|
673
672
|
type: "button",
|
|
674
|
-
className:
|
|
675
|
-
onClick:
|
|
676
|
-
disabled:
|
|
673
|
+
className: J,
|
|
674
|
+
onClick: w.refresh,
|
|
675
|
+
disabled: M !== null,
|
|
677
676
|
children: u("uiLibrary.sceneMonitor.refresh", "Refresh frame")
|
|
678
677
|
})]
|
|
679
678
|
}),
|
|
@@ -693,14 +692,14 @@ function Y({ deviceId: i }) {
|
|
|
693
692
|
children: [/* @__PURE__ */ o("input", {
|
|
694
693
|
type: "text",
|
|
695
694
|
value: K,
|
|
696
|
-
onChange: (e) =>
|
|
695
|
+
onChange: (e) => q(e.target.value),
|
|
697
696
|
placeholder: u("uiLibrary.sceneMonitor.placeholder", "e.g. Immondizia prelevata"),
|
|
698
697
|
className: "flex-1 rounded-md border border-border bg-surface px-2 py-1 text-[12px] text-foreground"
|
|
699
698
|
}), /* @__PURE__ */ o("button", {
|
|
700
699
|
type: "button",
|
|
701
|
-
className:
|
|
700
|
+
className: Y,
|
|
702
701
|
onClick: () => void de(),
|
|
703
|
-
disabled: U === null || K.trim().length === 0 ||
|
|
702
|
+
disabled: U === null || K.trim().length === 0 || M !== null,
|
|
704
703
|
children: u("uiLibrary.sceneMonitor.create", "Create")
|
|
705
704
|
})]
|
|
706
705
|
})
|
|
@@ -716,7 +715,7 @@ function Y({ deviceId: i }) {
|
|
|
716
715
|
}) : /* @__PURE__ */ o("ul", {
|
|
717
716
|
className: "flex flex-col gap-2",
|
|
718
717
|
children: Q.map((e) => {
|
|
719
|
-
let t =
|
|
718
|
+
let t = T(e, u);
|
|
720
719
|
return /* @__PURE__ */ s("li", {
|
|
721
720
|
className: `flex flex-col gap-1.5 rounded-md border p-2 ${L === e.id ? "border-primary/50" : "border-border"}`,
|
|
722
721
|
children: [
|
|
@@ -738,11 +737,11 @@ function Y({ deviceId: i }) {
|
|
|
738
737
|
}),
|
|
739
738
|
/* @__PURE__ */ o("p", {
|
|
740
739
|
className: `${g} tabular-nums`,
|
|
741
|
-
children:
|
|
740
|
+
children: D(e, u)
|
|
742
741
|
}),
|
|
743
|
-
/* @__PURE__ */ o(
|
|
742
|
+
/* @__PURE__ */ o(N, {
|
|
744
743
|
monitor: e,
|
|
745
|
-
disabled:
|
|
744
|
+
disabled: M !== null,
|
|
746
745
|
onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () => d.sceneMonitor?.deleteReference({
|
|
747
746
|
monitorId: e.id,
|
|
748
747
|
stateId: t,
|
|
@@ -752,20 +751,20 @@ function Y({ deviceId: i }) {
|
|
|
752
751
|
/* @__PURE__ */ s("div", {
|
|
753
752
|
className: "flex flex-wrap items-center gap-1.5",
|
|
754
753
|
children: [
|
|
755
|
-
|
|
754
|
+
te.map((t) => {
|
|
756
755
|
let n = t === "ir";
|
|
757
756
|
return /* @__PURE__ */ s("button", {
|
|
758
757
|
type: "button",
|
|
759
|
-
className:
|
|
760
|
-
disabled:
|
|
761
|
-
title: n ? u("uiLibrary.sceneMonitor.optionalTitle", "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken.") : u("uiLibrary.sceneMonitor.captureTitle", "Take a fresh photo now and store it as the {{variant}} reference", { variant:
|
|
758
|
+
className: J,
|
|
759
|
+
disabled: M !== null,
|
|
760
|
+
title: n ? u("uiLibrary.sceneMonitor.optionalTitle", "Optional. Without a night reference the checks in infrared are simply skipped — the scene keeps working in daylight and nothing is reported as broken.") : u("uiLibrary.sceneMonitor.captureTitle", "Take a fresh photo now and store it as the {{variant}} reference", { variant: E(t, u).toLowerCase() }),
|
|
762
761
|
onClick: () => void $(`cap-${e.id}-${t}`, async () => d.sceneMonitor?.captureReference({
|
|
763
762
|
monitorId: e.id,
|
|
764
763
|
condition: t
|
|
765
764
|
})),
|
|
766
765
|
children: [
|
|
767
766
|
/* @__PURE__ */ o(f, { className: "mr-1 inline h-3 w-3" }),
|
|
768
|
-
u("uiLibrary.sceneMonitor.capture", "Capture {{variant}}", { variant:
|
|
767
|
+
u("uiLibrary.sceneMonitor.capture", "Capture {{variant}}", { variant: E(t, u).toLowerCase() }),
|
|
769
768
|
n && /* @__PURE__ */ o("span", {
|
|
770
769
|
className: "ml-1 text-foreground-subtle/70",
|
|
771
770
|
children: u("uiLibrary.sceneMonitor.optional", "(optional)")
|
|
@@ -775,40 +774,40 @@ function Y({ deviceId: i }) {
|
|
|
775
774
|
}),
|
|
776
775
|
/* @__PURE__ */ s("button", {
|
|
777
776
|
type: "button",
|
|
778
|
-
className:
|
|
779
|
-
disabled:
|
|
777
|
+
className: Y,
|
|
778
|
+
disabled: M !== null || e.states.length === 0,
|
|
780
779
|
title: u("uiLibrary.sceneMonitor.resetTitle", "Clear the flag and re-photograph what normal looks like right now"),
|
|
781
780
|
onClick: () => void $(`reset-${e.id}`, async () => d.sceneMonitor?.resetScene({ monitorId: e.id })),
|
|
782
781
|
children: [/* @__PURE__ */ o(p, { className: "mr-1 inline h-3 w-3" }), u("uiLibrary.sceneMonitor.reset", "Reset")]
|
|
783
782
|
}),
|
|
784
783
|
/* @__PURE__ */ o("button", {
|
|
785
784
|
type: "button",
|
|
786
|
-
className:
|
|
787
|
-
disabled:
|
|
785
|
+
className: J,
|
|
786
|
+
disabled: M !== null,
|
|
788
787
|
onClick: () => void $(`check-${e.id}`, async () => d.sceneMonitor?.recheckNow({ monitorId: e.id })),
|
|
789
788
|
children: u("uiLibrary.sceneMonitor.checkNow", "Check now")
|
|
790
789
|
}),
|
|
791
790
|
/* @__PURE__ */ s("button", {
|
|
792
791
|
type: "button",
|
|
793
|
-
className: z === e.id ?
|
|
792
|
+
className: z === e.id ? Y : J,
|
|
794
793
|
"aria-pressed": z === e.id,
|
|
795
794
|
"aria-label": u("uiLibrary.sceneMonitor.settingsFor", "Settings for {{label}}", { label: e.label }),
|
|
796
|
-
disabled:
|
|
795
|
+
disabled: M !== null,
|
|
797
796
|
onClick: () => B((t) => t === e.id ? null : e.id),
|
|
798
797
|
children: [/* @__PURE__ */ o(m, { className: "mr-1 inline h-3 w-3" }), u("uiLibrary.sceneMonitor.settings", "Settings")]
|
|
799
798
|
}),
|
|
800
799
|
/* @__PURE__ */ o("button", {
|
|
801
800
|
type: "button",
|
|
802
801
|
className: re,
|
|
803
|
-
disabled:
|
|
802
|
+
disabled: M !== null,
|
|
804
803
|
onClick: () => void $(`del-${e.id}`, async () => d.sceneMonitor?.deleteScene({ monitorId: e.id })),
|
|
805
804
|
children: /* @__PURE__ */ o(h, { className: "h-3 w-3" })
|
|
806
805
|
})
|
|
807
806
|
]
|
|
808
807
|
}),
|
|
809
|
-
z === e.id && /* @__PURE__ */ o(
|
|
808
|
+
z === e.id && /* @__PURE__ */ o(G, {
|
|
810
809
|
monitor: e,
|
|
811
|
-
disabled:
|
|
810
|
+
disabled: M !== null,
|
|
812
811
|
onPatch: (t) => void $(`tune-${e.id}`, async () => d.sceneMonitor?.updateScene({
|
|
813
812
|
monitorId: e.id,
|
|
814
813
|
patch: t
|
|
@@ -822,4 +821,4 @@ function Y({ deviceId: i }) {
|
|
|
822
821
|
}) : null;
|
|
823
822
|
}
|
|
824
823
|
//#endregion
|
|
825
|
-
export {
|
|
824
|
+
export { X as SceneMonitorEditor };
|