@camstack/addon-model-studio 1.1.306 → 1.1.307
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-BdAF3Lx2.mjs → MotionZonesSettings-DkgjOPCB.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-bRMKWnGr.mjs → PrivacyMaskSettings-fESQpFIS.mjs} +4 -4
- package/dist/{SceneMonitorEditor-DffVOhzN.mjs → SceneMonitorEditor-C9B7EixP.mjs} +123 -124
- package/dist/_stub.js +4265 -4277
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DVVRygHY.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DLl1PFV-.mjs} +3 -3
- package/dist/{_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CsIeC3fr.mjs → _virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BQQ1gj_P.mjs} +1 -1
- package/dist/addon-model-studio.css +1 -1
- package/dist/{hostInit-fNjQtgdi.mjs → hostInit-DHIO-yMd.mjs} +2 -2
- package/dist/model-studio.addon.js +37 -6
- package/dist/model-studio.addon.mjs +37 -6
- package/dist/{player-overlays-BQux3aXS.mjs → player-overlays-SAR77Y-f.mjs} +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-BOS8RfJa.mjs → responsive-DhsW4w_p.mjs} +1 -1
- package/dist/{scene-monitor-copy-CaVNQakt.mjs → scene-monitor-copy-BYVAve5e.mjs} +63 -50
- package/dist/{square-DCA-7eaY.mjs → square-Dy3-P6UW.mjs} +1 -1
- package/dist/{trash-2-DYZFq4gu.mjs → trash-2-DScdmxQC.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CWXLGHpz.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-cC9vn7dW.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { S as e, _ as t, d as n, g as r, l as i, v as a } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DMBKVIH7.mjs";
|
|
2
2
|
import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
|
|
3
3
|
import { r as l, t as u } from "./ui-text-BqZa5BNK.mjs";
|
|
4
|
-
import { _ as d, d as f, f as p, h as m, l as h, p as g } from "./responsive-
|
|
5
|
-
import { a as _, c as v, d as y,
|
|
6
|
-
import { t as
|
|
7
|
-
import { MaskShapeCanvas as
|
|
4
|
+
import { _ as d, d as f, f as p, h as m, l as h, p as g } from "./responsive-DhsW4w_p.mjs";
|
|
5
|
+
import { a as _, c as v, d as y, f as ee, i as b, l as x, n as S, o as C, r as w, s as T, t as E, u as D } from "./scene-monitor-copy-BYVAve5e.mjs";
|
|
6
|
+
import { t as O } from "./trash-2-DScdmxQC.mjs";
|
|
7
|
+
import { MaskShapeCanvas as k } from "./MaskShapeCanvas-CrWutXSb.mjs";
|
|
8
8
|
var te = d("settings-2", [
|
|
9
9
|
["path", {
|
|
10
10
|
d: "M14 17H5",
|
|
@@ -30,11 +30,11 @@ var te = d("settings-2", [
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region ../ui-library/src/composites/cap-settings/SceneReferenceGallery.tsx
|
|
32
32
|
e();
|
|
33
|
-
var
|
|
34
|
-
function A(e) {
|
|
35
|
-
return `${k}/m/${e}`;
|
|
36
|
-
}
|
|
33
|
+
var A = v("/addon/pipeline-analytics/event-media");
|
|
37
34
|
function j(e) {
|
|
35
|
+
return `${A}/m/${e}`;
|
|
36
|
+
}
|
|
37
|
+
function M(e) {
|
|
38
38
|
let t = /* @__PURE__ */ new Map();
|
|
39
39
|
for (let n of e.states) n.references.forEach((e, r) => {
|
|
40
40
|
let i = t.get(e.condition) ?? [];
|
|
@@ -49,12 +49,12 @@ function j(e) {
|
|
|
49
49
|
tiles: [...t].sort((e, t) => t.reference.capturedAt - e.reference.capturedAt)
|
|
50
50
|
})).sort((e, t) => e.condition.localeCompare(t.condition));
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function N(e) {
|
|
53
53
|
return e.states.reduce((e, t) => e + t.references.length, 0);
|
|
54
54
|
}
|
|
55
|
-
var
|
|
55
|
+
var P = "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";
|
|
56
56
|
function ne({ monitor: e, disabled: t, onDelete: n }) {
|
|
57
|
-
let r = l(), i =
|
|
57
|
+
let r = l(), i = M(e), a = N(e), c = x();
|
|
58
58
|
return i.length === 0 ? /* @__PURE__ */ o("p", {
|
|
59
59
|
className: `${h} leading-relaxed`,
|
|
60
60
|
children: r("uiLibrary.sceneReferenceGallery.empty", "No photographs captured yet. Press “Capture daylight” to take the one this scene will judge everything against.")
|
|
@@ -65,71 +65,70 @@ function ne({ monitor: e, disabled: t, onDelete: n }) {
|
|
|
65
65
|
children: [/* @__PURE__ */ s("p", {
|
|
66
66
|
className: "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle",
|
|
67
67
|
children: [
|
|
68
|
-
|
|
68
|
+
C(e.condition, r),
|
|
69
69
|
" · ",
|
|
70
70
|
e.tiles.length
|
|
71
71
|
]
|
|
72
72
|
}), /* @__PURE__ */ o("ul", {
|
|
73
73
|
className: "flex flex-wrap gap-1.5",
|
|
74
74
|
children: e.tiles.map((i) => {
|
|
75
|
-
let
|
|
75
|
+
let l = `${i.stateId}:${String(i.index)}`, u = a === 1;
|
|
76
76
|
return /* @__PURE__ */ s("li", {
|
|
77
77
|
className: "flex w-24 flex-col gap-1 rounded-md border border-border p-1",
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */ o(
|
|
79
|
+
/* @__PURE__ */ o(F, { reference: i.reference }),
|
|
80
80
|
/* @__PURE__ */ o("span", {
|
|
81
81
|
className: `${h} tabular-nums`,
|
|
82
|
-
children:
|
|
82
|
+
children: I(i.reference.capturedAt)
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ s("button", {
|
|
85
85
|
type: "button",
|
|
86
|
-
className:
|
|
86
|
+
className: P,
|
|
87
87
|
disabled: t,
|
|
88
88
|
"aria-label": r("uiLibrary.sceneReferenceGallery.deleteLabel", "Delete the {{variant}} photograph from {{date}}", {
|
|
89
|
-
variant:
|
|
90
|
-
date:
|
|
89
|
+
variant: C(e.condition, r).toLowerCase(),
|
|
90
|
+
date: I(i.reference.capturedAt)
|
|
91
91
|
}),
|
|
92
92
|
onClick: () => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
(async () => {
|
|
94
|
+
u && !await c({
|
|
95
|
+
title: r("uiLibrary.sceneReferenceGallery.deleteTitle", "Delete the only photograph?"),
|
|
96
|
+
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."),
|
|
97
|
+
confirmLabel: r("uiLibrary.sceneReferenceGallery.delete", "Delete"),
|
|
98
|
+
variant: "danger"
|
|
99
|
+
}) || n({
|
|
100
|
+
stateId: i.stateId,
|
|
101
|
+
index: i.index
|
|
102
|
+
});
|
|
103
|
+
})();
|
|
101
104
|
},
|
|
102
|
-
children: [/* @__PURE__ */ o(
|
|
103
|
-
}),
|
|
104
|
-
f && /* @__PURE__ */ o("p", {
|
|
105
|
-
className: "text-[10px] leading-snug text-warning",
|
|
106
|
-
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.")
|
|
105
|
+
children: [/* @__PURE__ */ o(O, { className: "mr-1 inline h-3 w-3" }), r("uiLibrary.sceneReferenceGallery.delete", "Delete")]
|
|
107
106
|
})
|
|
108
107
|
]
|
|
109
|
-
},
|
|
108
|
+
}, l);
|
|
110
109
|
})
|
|
111
110
|
})]
|
|
112
111
|
}, e.condition))
|
|
113
112
|
});
|
|
114
113
|
}
|
|
115
|
-
function
|
|
114
|
+
function F({ reference: e }) {
|
|
116
115
|
let t = l(), [n, r] = a(!1), i = e.thumbnailMediaId;
|
|
117
116
|
return i === void 0 || n ? /* @__PURE__ */ s("div", {
|
|
118
117
|
className: "flex h-16 w-full flex-col items-center justify-center gap-0.5 rounded bg-surface text-foreground-subtle",
|
|
119
118
|
title: t("uiLibrary.sceneReferenceGallery.missingPicture", "The picture for this reference is no longer stored. The reference itself is intact and still being scored against."),
|
|
120
|
-
children: [/* @__PURE__ */ o(
|
|
119
|
+
children: [/* @__PURE__ */ o(y, { className: "h-4 w-4" }), /* @__PURE__ */ o("span", {
|
|
121
120
|
className: "text-[9px]",
|
|
122
121
|
children: t("uiLibrary.sceneReferenceGallery.noPicture", "no picture")
|
|
123
122
|
})]
|
|
124
123
|
}) : /* @__PURE__ */ o("img", {
|
|
125
|
-
src:
|
|
124
|
+
src: j(i),
|
|
126
125
|
alt: "",
|
|
127
126
|
loading: "lazy",
|
|
128
127
|
className: "h-16 w-full rounded object-cover",
|
|
129
128
|
onError: () => r(!0)
|
|
130
129
|
});
|
|
131
130
|
}
|
|
132
|
-
function
|
|
131
|
+
function I(e) {
|
|
133
132
|
let t = new Date(e);
|
|
134
133
|
return `${t.toLocaleDateString()} ${t.toLocaleTimeString([], {
|
|
135
134
|
hour: "2-digit",
|
|
@@ -139,21 +138,21 @@ function F(e) {
|
|
|
139
138
|
//#endregion
|
|
140
139
|
//#region ../ui-library/src/composites/cap-settings/SceneSettingsForm.tsx
|
|
141
140
|
e();
|
|
142
|
-
var
|
|
143
|
-
function
|
|
141
|
+
var L = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50", R = "text-[10px] font-medium text-foreground-subtle", z = "flex flex-col gap-2 rounded-md border border-border bg-surface/40 p-2", B = "text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle", V = 5, H = 3600;
|
|
142
|
+
function U(e, t) {
|
|
144
143
|
switch (e) {
|
|
145
144
|
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.");
|
|
146
145
|
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.");
|
|
147
146
|
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.");
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
|
-
function
|
|
149
|
+
function W(e, t) {
|
|
151
150
|
switch (e) {
|
|
152
151
|
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.");
|
|
153
152
|
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.");
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
|
-
function
|
|
155
|
+
function G(e) {
|
|
157
156
|
return {
|
|
158
157
|
label: e.label,
|
|
159
158
|
checkIntervalSec: e.checkIntervalSec ?? 60,
|
|
@@ -164,10 +163,10 @@ function W(e) {
|
|
|
164
163
|
confirmPrompt: e.confirm?.prompt ?? ""
|
|
165
164
|
};
|
|
166
165
|
}
|
|
167
|
-
function
|
|
168
|
-
let i = l(), [d, f] = a(() =>
|
|
166
|
+
function K({ monitor: e, disabled: t, onPatch: r }) {
|
|
167
|
+
let i = l(), [d, f] = a(() => G(e)), [p, m] = a(!1);
|
|
169
168
|
n(() => {
|
|
170
|
-
p || f(
|
|
169
|
+
p || f(G(e));
|
|
171
170
|
}, [e, p]);
|
|
172
171
|
let g = (e) => {
|
|
173
172
|
m(!1), r(e);
|
|
@@ -183,22 +182,22 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
183
182
|
className: "flex flex-col gap-2",
|
|
184
183
|
children: [
|
|
185
184
|
/* @__PURE__ */ s("div", {
|
|
186
|
-
className:
|
|
185
|
+
className: z,
|
|
187
186
|
children: [
|
|
188
187
|
/* @__PURE__ */ o("p", {
|
|
189
|
-
className:
|
|
188
|
+
className: B,
|
|
190
189
|
children: i("uiLibrary.sceneSettingsForm.whatItWatches", "What it watches")
|
|
191
190
|
}),
|
|
192
191
|
/* @__PURE__ */ s("label", {
|
|
193
192
|
className: "flex flex-col gap-1",
|
|
194
193
|
children: [/* @__PURE__ */ o("span", {
|
|
195
|
-
className:
|
|
194
|
+
className: R,
|
|
196
195
|
children: i("uiLibrary.sceneSettingsForm.name", "Name")
|
|
197
196
|
}), /* @__PURE__ */ o("input", {
|
|
198
197
|
type: "text",
|
|
199
198
|
value: d.label,
|
|
200
199
|
disabled: t,
|
|
201
|
-
className:
|
|
200
|
+
className: L,
|
|
202
201
|
onFocus: () => m(!0),
|
|
203
202
|
onChange: (e) => f((t) => ({
|
|
204
203
|
...t,
|
|
@@ -218,7 +217,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
218
217
|
disabled: t,
|
|
219
218
|
onChange: (e) => g({ enabled: e.target.checked })
|
|
220
219
|
}), /* @__PURE__ */ o("span", {
|
|
221
|
-
className:
|
|
220
|
+
className: R,
|
|
222
221
|
children: i("uiLibrary.sceneSettingsForm.watching", "Watching")
|
|
223
222
|
})]
|
|
224
223
|
}),
|
|
@@ -229,12 +228,12 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
229
228
|
/* @__PURE__ */ s("label", {
|
|
230
229
|
className: "flex flex-col gap-1",
|
|
231
230
|
children: [/* @__PURE__ */ o("span", {
|
|
232
|
-
className:
|
|
231
|
+
className: R,
|
|
233
232
|
children: i("uiLibrary.sceneSettingsForm.whenToLook", "When to look")
|
|
234
233
|
}), /* @__PURE__ */ s("select", {
|
|
235
234
|
value: e.triggerMode,
|
|
236
235
|
disabled: t,
|
|
237
|
-
className:
|
|
236
|
+
className: L,
|
|
238
237
|
onChange: (e) => {
|
|
239
238
|
let t = e.target.value;
|
|
240
239
|
(t === "periodic" || t === "on-motion" || t === "both") && g({ triggerMode: t });
|
|
@@ -257,27 +256,27 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
257
256
|
}),
|
|
258
257
|
/* @__PURE__ */ o("p", {
|
|
259
258
|
className: h,
|
|
260
|
-
children:
|
|
259
|
+
children: U(e.triggerMode, i)
|
|
261
260
|
}),
|
|
262
261
|
/* @__PURE__ */ s("label", {
|
|
263
262
|
className: "flex flex-col gap-1",
|
|
264
263
|
children: [/* @__PURE__ */ o("span", {
|
|
265
|
-
className:
|
|
264
|
+
className: R,
|
|
266
265
|
children: i("uiLibrary.sceneSettingsForm.checkEvery", "Check every (seconds)")
|
|
267
266
|
}), /* @__PURE__ */ o("input", {
|
|
268
267
|
type: "number",
|
|
269
|
-
min:
|
|
270
|
-
max:
|
|
268
|
+
min: V,
|
|
269
|
+
max: H,
|
|
271
270
|
value: d.checkIntervalSec,
|
|
272
271
|
disabled: t,
|
|
273
|
-
className:
|
|
272
|
+
className: L,
|
|
274
273
|
onFocus: () => m(!0),
|
|
275
274
|
onChange: (e) => f((t) => ({
|
|
276
275
|
...t,
|
|
277
276
|
checkIntervalSec: Number(e.target.value) || 0
|
|
278
277
|
})),
|
|
279
278
|
onBlur: () => {
|
|
280
|
-
let t =
|
|
279
|
+
let t = q(d.checkIntervalSec, V, H);
|
|
281
280
|
t === e.checkIntervalSec ? m(!1) : g({ checkIntervalSec: t });
|
|
282
281
|
}
|
|
283
282
|
})]
|
|
@@ -289,16 +288,16 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
289
288
|
]
|
|
290
289
|
}),
|
|
291
290
|
/* @__PURE__ */ s("div", {
|
|
292
|
-
className:
|
|
291
|
+
className: z,
|
|
293
292
|
children: [
|
|
294
293
|
/* @__PURE__ */ o("p", {
|
|
295
|
-
className:
|
|
294
|
+
className: B,
|
|
296
295
|
children: i("uiLibrary.sceneSettingsForm.howSure", "How sure it has to be")
|
|
297
296
|
}),
|
|
298
297
|
e.check.mode === "similarity" && /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ s("label", {
|
|
299
298
|
className: "flex flex-col gap-1",
|
|
300
299
|
children: [/* @__PURE__ */ o("span", {
|
|
301
|
-
className:
|
|
300
|
+
className: R,
|
|
302
301
|
children: /* @__PURE__ */ o(u, {
|
|
303
302
|
uiKey: "uiLibrary.sceneSettingsForm.matchThreshold",
|
|
304
303
|
fallback: "Match threshold — <0>{{value}}</0>",
|
|
@@ -331,7 +330,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
331
330
|
/* @__PURE__ */ s("label", {
|
|
332
331
|
className: "flex flex-col gap-1",
|
|
333
332
|
children: [/* @__PURE__ */ o("span", {
|
|
334
|
-
className:
|
|
333
|
+
className: R,
|
|
335
334
|
children: i("uiLibrary.sceneSettingsForm.agreeingChecks", "Agreeing checks before it changes its mind")
|
|
336
335
|
}), /* @__PURE__ */ o("input", {
|
|
337
336
|
type: "number",
|
|
@@ -339,14 +338,14 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
339
338
|
max: 10,
|
|
340
339
|
value: d.hysteresisCount,
|
|
341
340
|
disabled: t,
|
|
342
|
-
className:
|
|
341
|
+
className: L,
|
|
343
342
|
onFocus: () => m(!0),
|
|
344
343
|
onChange: (e) => f((t) => ({
|
|
345
344
|
...t,
|
|
346
345
|
hysteresisCount: Number(e.target.value) || 1
|
|
347
346
|
})),
|
|
348
347
|
onBlur: () => {
|
|
349
|
-
let t =
|
|
348
|
+
let t = q(d.hysteresisCount, 1, 10);
|
|
350
349
|
t === e.check.hysteresisCount ? m(!1) : g({ check: _({ hysteresisCount: t }) });
|
|
351
350
|
}
|
|
352
351
|
})]
|
|
@@ -358,7 +357,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
358
357
|
/* @__PURE__ */ s("label", {
|
|
359
358
|
className: "flex flex-col gap-1",
|
|
360
359
|
children: [/* @__PURE__ */ o("span", {
|
|
361
|
-
className:
|
|
360
|
+
className: R,
|
|
362
361
|
children: i("uiLibrary.sceneSettingsForm.quietFor", "Quiet for (seconds) before a check counts")
|
|
363
362
|
}), /* @__PURE__ */ o("input", {
|
|
364
363
|
type: "number",
|
|
@@ -366,14 +365,14 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
366
365
|
max: 3600,
|
|
367
366
|
value: d.quietSeconds,
|
|
368
367
|
disabled: t,
|
|
369
|
-
className:
|
|
368
|
+
className: L,
|
|
370
369
|
onFocus: () => m(!0),
|
|
371
370
|
onChange: (e) => f((t) => ({
|
|
372
371
|
...t,
|
|
373
372
|
quietSeconds: Number(e.target.value) || 0
|
|
374
373
|
})),
|
|
375
374
|
onBlur: () => {
|
|
376
|
-
let t =
|
|
375
|
+
let t = q(d.quietSeconds, 0, 3600);
|
|
377
376
|
t === e.quietSeconds ? m(!1) : g({ quietSeconds: t });
|
|
378
377
|
}
|
|
379
378
|
})]
|
|
@@ -385,7 +384,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
385
384
|
/* @__PURE__ */ s("label", {
|
|
386
385
|
className: "flex flex-col gap-1",
|
|
387
386
|
children: [/* @__PURE__ */ o("span", {
|
|
388
|
-
className:
|
|
387
|
+
className: R,
|
|
389
388
|
children: i("uiLibrary.sceneSettingsForm.minGap", "Minimum gap between counted checks (seconds)")
|
|
390
389
|
}), /* @__PURE__ */ o("input", {
|
|
391
390
|
type: "number",
|
|
@@ -393,14 +392,14 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
393
392
|
max: 3600,
|
|
394
393
|
value: d.minObservationSpacingSec,
|
|
395
394
|
disabled: t,
|
|
396
|
-
className:
|
|
395
|
+
className: L,
|
|
397
396
|
onFocus: () => m(!0),
|
|
398
397
|
onChange: (e) => f((t) => ({
|
|
399
398
|
...t,
|
|
400
399
|
minObservationSpacingSec: Number(e.target.value) || 0
|
|
401
400
|
})),
|
|
402
401
|
onBlur: () => {
|
|
403
|
-
let t =
|
|
402
|
+
let t = q(d.minObservationSpacingSec, 0, 3600);
|
|
404
403
|
t === e.minObservationSpacingSec ? m(!1) : g({ minObservationSpacingSec: t });
|
|
405
404
|
}
|
|
406
405
|
})]
|
|
@@ -412,21 +411,21 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
412
411
|
]
|
|
413
412
|
}),
|
|
414
413
|
/* @__PURE__ */ s("div", {
|
|
415
|
-
className:
|
|
414
|
+
className: z,
|
|
416
415
|
children: [
|
|
417
416
|
/* @__PURE__ */ o("p", {
|
|
418
|
-
className:
|
|
417
|
+
className: B,
|
|
419
418
|
children: i("uiLibrary.sceneSettingsForm.lighting", "Lighting")
|
|
420
419
|
}),
|
|
421
420
|
/* @__PURE__ */ s("label", {
|
|
422
421
|
className: "flex flex-col gap-1",
|
|
423
422
|
children: [/* @__PURE__ */ o("span", {
|
|
424
|
-
className:
|
|
423
|
+
className: R,
|
|
425
424
|
children: i("uiLibrary.sceneSettingsForm.noReference", "When a light has no reference of its own")
|
|
426
425
|
}), /* @__PURE__ */ s("select", {
|
|
427
426
|
value: e.onUncoveredCondition,
|
|
428
427
|
disabled: t,
|
|
429
|
-
className:
|
|
428
|
+
className: L,
|
|
430
429
|
onChange: (e) => {
|
|
431
430
|
let t = e.target.value;
|
|
432
431
|
(t === "skip" || t === "judge-anyway") && g({ onUncoveredCondition: t });
|
|
@@ -442,26 +441,26 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
442
441
|
}),
|
|
443
442
|
/* @__PURE__ */ o("p", {
|
|
444
443
|
className: h,
|
|
445
|
-
children:
|
|
444
|
+
children: W(e.onUncoveredCondition, i)
|
|
446
445
|
})
|
|
447
446
|
]
|
|
448
447
|
}),
|
|
449
448
|
/* @__PURE__ */ s("div", {
|
|
450
|
-
className:
|
|
449
|
+
className: z,
|
|
451
450
|
children: [
|
|
452
451
|
/* @__PURE__ */ o("p", {
|
|
453
|
-
className:
|
|
452
|
+
className: B,
|
|
454
453
|
children: i("uiLibrary.sceneSettingsForm.whatYouGetTold", "What you get told")
|
|
455
454
|
}),
|
|
456
455
|
/* @__PURE__ */ s("label", {
|
|
457
456
|
className: "flex flex-col gap-1",
|
|
458
457
|
children: [/* @__PURE__ */ o("span", {
|
|
459
|
-
className:
|
|
458
|
+
className: R,
|
|
460
459
|
children: i("uiLibrary.sceneSettingsForm.notificationsFollow", "Notifications follow")
|
|
461
460
|
}), /* @__PURE__ */ s("select", {
|
|
462
461
|
value: e.emit,
|
|
463
462
|
disabled: t,
|
|
464
|
-
className:
|
|
463
|
+
className: L,
|
|
465
464
|
onChange: (e) => {
|
|
466
465
|
let t = e.target.value;
|
|
467
466
|
(t === "latched" || t === "live") && g({ emit: t });
|
|
@@ -487,7 +486,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
487
486
|
disabled: t,
|
|
488
487
|
onChange: (e) => g({ autoRestore: e.target.checked })
|
|
489
488
|
}), /* @__PURE__ */ o("span", {
|
|
490
|
-
className:
|
|
489
|
+
className: R,
|
|
491
490
|
children: i("uiLibrary.sceneSettingsForm.autoRestore", "Clear the flag by itself when things look normal again")
|
|
492
491
|
})]
|
|
493
492
|
}),
|
|
@@ -498,10 +497,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
498
497
|
]
|
|
499
498
|
}),
|
|
500
499
|
/* @__PURE__ */ s("div", {
|
|
501
|
-
className:
|
|
500
|
+
className: z,
|
|
502
501
|
children: [
|
|
503
502
|
/* @__PURE__ */ o("p", {
|
|
504
|
-
className:
|
|
503
|
+
className: B,
|
|
505
504
|
children: i("uiLibrary.sceneSettingsForm.aiDoubleCheck", "AI double-check")
|
|
506
505
|
}),
|
|
507
506
|
/* @__PURE__ */ s("label", {
|
|
@@ -511,25 +510,25 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
511
510
|
checked: v,
|
|
512
511
|
disabled: t || d.confirmPrompt.trim().length === 0,
|
|
513
512
|
onChange: (e) => g(e.target.checked ? { confirm: {
|
|
514
|
-
...
|
|
513
|
+
...J(d.confirmPrompt.trim()),
|
|
515
514
|
enabled: !0
|
|
516
515
|
} } : { confirm: null })
|
|
517
516
|
}), /* @__PURE__ */ o("span", {
|
|
518
|
-
className:
|
|
517
|
+
className: R,
|
|
519
518
|
children: i("uiLibrary.sceneSettingsForm.askVision", "Ask a vision model before changing the answer")
|
|
520
519
|
})]
|
|
521
520
|
}),
|
|
522
521
|
/* @__PURE__ */ s("label", {
|
|
523
522
|
className: "flex flex-col gap-1",
|
|
524
523
|
children: [/* @__PURE__ */ o("span", {
|
|
525
|
-
className:
|
|
524
|
+
className: R,
|
|
526
525
|
children: i("uiLibrary.sceneSettingsForm.question", "The question to ask")
|
|
527
526
|
}), /* @__PURE__ */ o("input", {
|
|
528
527
|
type: "text",
|
|
529
528
|
value: d.confirmPrompt,
|
|
530
529
|
placeholder: i("uiLibrary.sceneSettingsForm.questionPlaceholder", "e.g. Is the wheelie bin still there?"),
|
|
531
530
|
disabled: t,
|
|
532
|
-
className:
|
|
531
|
+
className: L,
|
|
533
532
|
onFocus: () => m(!0),
|
|
534
533
|
onChange: (e) => f((t) => ({
|
|
535
534
|
...t,
|
|
@@ -538,7 +537,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
538
537
|
onBlur: () => {
|
|
539
538
|
let t = d.confirmPrompt.trim();
|
|
540
539
|
t.length > 0 && t !== e.confirm?.prompt ? g({ confirm: {
|
|
541
|
-
...
|
|
540
|
+
...J(t),
|
|
542
541
|
enabled: v
|
|
543
542
|
} }) : m(!1);
|
|
544
543
|
}
|
|
@@ -557,10 +556,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
|
|
|
557
556
|
]
|
|
558
557
|
});
|
|
559
558
|
}
|
|
560
|
-
function
|
|
559
|
+
function q(e, t, n) {
|
|
561
560
|
return Math.min(n, Math.max(t, e));
|
|
562
561
|
}
|
|
563
|
-
function
|
|
562
|
+
function J(e) {
|
|
564
563
|
return {
|
|
565
564
|
enabled: !1,
|
|
566
565
|
prompt: e,
|
|
@@ -572,37 +571,37 @@ function q(e) {
|
|
|
572
571
|
//#endregion
|
|
573
572
|
//#region ../ui-library/src/composites/cap-settings/SceneMonitorEditor.tsx
|
|
574
573
|
e();
|
|
575
|
-
var
|
|
574
|
+
var Y = "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", X = "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 = {
|
|
576
575
|
alarm: "border-danger/50 bg-danger/15 text-danger",
|
|
577
576
|
ok: "border-success/50 bg-success/15 text-success",
|
|
578
577
|
unknown: "border-border bg-surface text-foreground-subtle"
|
|
579
578
|
}, ae = .8, oe = 3;
|
|
580
|
-
function
|
|
581
|
-
let u = l(), d = p(m().trpcClient, e), v = g(d?.state.sceneMonitor),
|
|
582
|
-
n(() => (
|
|
583
|
-
|
|
579
|
+
function Z({ deviceId: e }) {
|
|
580
|
+
let u = l(), d = p(m().trpcClient, e), v = g(d?.state.sceneMonitor), y = T(e, { width: 640 }), [x, A] = a(null), [j, M] = a(!1), [N, P] = a(null), [F, I] = a(null), [L, R] = a(null), [z, B] = a(null), [V, H] = a(!1), [U, W] = a(null), [G, q] = a(""), J = t(!0);
|
|
581
|
+
n(() => (J.current = !0, () => {
|
|
582
|
+
J.current = !1;
|
|
584
583
|
}), []);
|
|
585
584
|
let Z = i(async () => {
|
|
586
585
|
if (d) try {
|
|
587
586
|
let e = await d.sceneMonitor?.listScenes({});
|
|
588
|
-
if (!
|
|
587
|
+
if (!J.current) return;
|
|
589
588
|
e && A(e);
|
|
590
589
|
} catch (e) {
|
|
591
|
-
if (!
|
|
590
|
+
if (!J.current) return;
|
|
592
591
|
f(e) ? M(!0) : I(e instanceof Error ? e.message : String(e));
|
|
593
592
|
}
|
|
594
593
|
}, [d]);
|
|
595
594
|
n(() => {
|
|
596
595
|
A(null), M(!1), I(null), Z();
|
|
597
596
|
}, [Z]);
|
|
598
|
-
let Q = v?.monitors ??
|
|
597
|
+
let Q = v?.monitors ?? x?.monitors ?? [], se = Date.now(), $ = i(async (e, t) => {
|
|
599
598
|
P(e), I(null);
|
|
600
599
|
try {
|
|
601
600
|
await t(), await Z();
|
|
602
601
|
} catch (e) {
|
|
603
|
-
|
|
602
|
+
J.current && I(e instanceof Error ? e.message : String(e));
|
|
604
603
|
} finally {
|
|
605
|
-
|
|
604
|
+
J.current && P(null);
|
|
606
605
|
}
|
|
607
606
|
}, [Z]), ce = r(() => {
|
|
608
607
|
let e = Q.map((e) => ({
|
|
@@ -634,9 +633,9 @@ function X({ deviceId: e }) {
|
|
|
634
633
|
}, [d, $]), ue = i((e) => {
|
|
635
634
|
e.kind === "rect" && W(e);
|
|
636
635
|
}, []), de = i(async () => {
|
|
637
|
-
U === null ||
|
|
636
|
+
U === null || G.trim().length === 0 || (await $("create", async () => {
|
|
638
637
|
await d?.sceneMonitor?.createScene({
|
|
639
|
-
label:
|
|
638
|
+
label: G.trim(),
|
|
640
639
|
roi: U,
|
|
641
640
|
check: {
|
|
642
641
|
mode: "similarity",
|
|
@@ -648,7 +647,7 @@ function X({ deviceId: e }) {
|
|
|
648
647
|
}, [
|
|
649
648
|
d,
|
|
650
649
|
U,
|
|
651
|
-
|
|
650
|
+
G,
|
|
652
651
|
$
|
|
653
652
|
]);
|
|
654
653
|
return d ? /* @__PURE__ */ o("div", {
|
|
@@ -663,7 +662,7 @@ function X({ deviceId: e }) {
|
|
|
663
662
|
}),
|
|
664
663
|
/* @__PURE__ */ o("div", {
|
|
665
664
|
className: "relative overflow-hidden rounded-md border border-border",
|
|
666
|
-
children: /* @__PURE__ */ o(
|
|
665
|
+
children: /* @__PURE__ */ o(k, {
|
|
667
666
|
items: ce,
|
|
668
667
|
supportedShapes: ["rect"],
|
|
669
668
|
selectedId: L ?? (U === null ? null : "__draft__"),
|
|
@@ -671,8 +670,8 @@ function X({ deviceId: e }) {
|
|
|
671
670
|
onShapeChange: le,
|
|
672
671
|
onDrawComplete: ue,
|
|
673
672
|
drawingKind: V && U === null ? "rect" : null,
|
|
674
|
-
backdrop:
|
|
675
|
-
src:
|
|
673
|
+
backdrop: y.src === null ? null : /* @__PURE__ */ o("img", {
|
|
674
|
+
src: y.src,
|
|
676
675
|
alt: "",
|
|
677
676
|
className: "h-full w-full object-contain",
|
|
678
677
|
draggable: !1
|
|
@@ -683,7 +682,7 @@ function X({ deviceId: e }) {
|
|
|
683
682
|
className: "flex flex-wrap items-center gap-2",
|
|
684
683
|
children: [/* @__PURE__ */ o("button", {
|
|
685
684
|
type: "button",
|
|
686
|
-
className: V ?
|
|
685
|
+
className: V ? X : Y,
|
|
687
686
|
"aria-pressed": V,
|
|
688
687
|
onClick: () => {
|
|
689
688
|
H((e) => !e), W(null);
|
|
@@ -692,8 +691,8 @@ function X({ deviceId: e }) {
|
|
|
692
691
|
children: V ? u("uiLibrary.sceneMonitor.cancel", "Cancel") : u("uiLibrary.sceneMonitor.newScene", "+ New scene")
|
|
693
692
|
}), /* @__PURE__ */ o("button", {
|
|
694
693
|
type: "button",
|
|
695
|
-
className:
|
|
696
|
-
onClick:
|
|
694
|
+
className: Y,
|
|
695
|
+
onClick: y.refresh,
|
|
697
696
|
disabled: N !== null,
|
|
698
697
|
children: u("uiLibrary.sceneMonitor.refresh", "Refresh frame")
|
|
699
698
|
})]
|
|
@@ -705,7 +704,7 @@ function X({ deviceId: e }) {
|
|
|
705
704
|
className: "text-[10px] text-foreground-subtle",
|
|
706
705
|
children: U === null ? u("uiLibrary.sceneMonitor.draftHint", "Click on the frame to drop a box, then drag its corner to fit it around the thing you want watched.") : u("uiLibrary.sceneMonitor.nameHint", "Name it, then create. You capture what “normal” looks like next.")
|
|
707
706
|
}),
|
|
708
|
-
U !== null &&
|
|
707
|
+
U !== null && b(U) && /* @__PURE__ */ o("p", {
|
|
709
708
|
className: "text-[11px] leading-relaxed text-warning",
|
|
710
709
|
children: u("uiLibrary.sceneMonitor.tooLarge", "That box covers most of the frame. A scene that big is dominated by the weather, the sky and passing cars — it will quietly stop noticing the thing you actually care about. Draw it tighter.")
|
|
711
710
|
}),
|
|
@@ -713,15 +712,15 @@ function X({ deviceId: e }) {
|
|
|
713
712
|
className: "flex items-center gap-2",
|
|
714
713
|
children: [/* @__PURE__ */ o("input", {
|
|
715
714
|
type: "text",
|
|
716
|
-
value:
|
|
715
|
+
value: G,
|
|
717
716
|
onChange: (e) => q(e.target.value),
|
|
718
717
|
placeholder: u("uiLibrary.sceneMonitor.placeholder", "e.g. Immondizia prelevata"),
|
|
719
718
|
className: "flex-1 rounded-md border border-border bg-surface px-2 py-1 text-[12px] text-foreground"
|
|
720
719
|
}), /* @__PURE__ */ o("button", {
|
|
721
720
|
type: "button",
|
|
722
|
-
className:
|
|
721
|
+
className: X,
|
|
723
722
|
onClick: () => void de(),
|
|
724
|
-
disabled: U === null ||
|
|
723
|
+
disabled: U === null || G.trim().length === 0 || N !== null,
|
|
725
724
|
children: u("uiLibrary.sceneMonitor.create", "Create")
|
|
726
725
|
})]
|
|
727
726
|
})
|
|
@@ -737,7 +736,7 @@ function X({ deviceId: e }) {
|
|
|
737
736
|
}) : /* @__PURE__ */ o("ul", {
|
|
738
737
|
className: "flex flex-col gap-2",
|
|
739
738
|
children: Q.map((e) => {
|
|
740
|
-
let t =
|
|
739
|
+
let t = S(e, u);
|
|
741
740
|
return /* @__PURE__ */ s("li", {
|
|
742
741
|
className: `flex flex-col gap-1.5 rounded-md border p-2 ${L === e.id ? "border-primary/50" : "border-border"}`,
|
|
743
742
|
children: [
|
|
@@ -759,7 +758,7 @@ function X({ deviceId: e }) {
|
|
|
759
758
|
}),
|
|
760
759
|
/* @__PURE__ */ o("p", {
|
|
761
760
|
className: `${h} tabular-nums`,
|
|
762
|
-
children:
|
|
761
|
+
children: w(e, u)
|
|
763
762
|
}),
|
|
764
763
|
/* @__PURE__ */ o(ne, {
|
|
765
764
|
monitor: e,
|
|
@@ -773,20 +772,20 @@ function X({ deviceId: e }) {
|
|
|
773
772
|
/* @__PURE__ */ s("div", {
|
|
774
773
|
className: "flex flex-wrap items-center gap-1.5",
|
|
775
774
|
children: [
|
|
776
|
-
|
|
775
|
+
E.map((t) => {
|
|
777
776
|
let n = t === "ir";
|
|
778
777
|
return /* @__PURE__ */ s("button", {
|
|
779
778
|
type: "button",
|
|
780
|
-
className:
|
|
779
|
+
className: Y,
|
|
781
780
|
disabled: N !== null,
|
|
782
|
-
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:
|
|
781
|
+
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: C(t, u).toLowerCase() }),
|
|
783
782
|
onClick: () => void $(`cap-${e.id}-${t}`, async () => d.sceneMonitor?.captureReference({
|
|
784
783
|
monitorId: e.id,
|
|
785
784
|
condition: t
|
|
786
785
|
})),
|
|
787
786
|
children: [
|
|
788
|
-
/* @__PURE__ */ o(
|
|
789
|
-
u("uiLibrary.sceneMonitor.capture", "Capture {{variant}}", { variant:
|
|
787
|
+
/* @__PURE__ */ o(ee, { className: "mr-1 inline h-3 w-3" }),
|
|
788
|
+
u("uiLibrary.sceneMonitor.capture", "Capture {{variant}}", { variant: C(t, u).toLowerCase() }),
|
|
790
789
|
n && /* @__PURE__ */ o("span", {
|
|
791
790
|
className: "ml-1 text-foreground-subtle/70",
|
|
792
791
|
children: u("uiLibrary.sceneMonitor.optional", "(optional)")
|
|
@@ -796,22 +795,22 @@ function X({ deviceId: e }) {
|
|
|
796
795
|
}),
|
|
797
796
|
/* @__PURE__ */ s("button", {
|
|
798
797
|
type: "button",
|
|
799
|
-
className:
|
|
798
|
+
className: X,
|
|
800
799
|
disabled: N !== null || e.states.length === 0,
|
|
801
800
|
title: u("uiLibrary.sceneMonitor.resetTitle", "Clear the flag and re-photograph what normal looks like right now"),
|
|
802
801
|
onClick: () => void $(`reset-${e.id}`, async () => d.sceneMonitor?.resetScene({ monitorId: e.id })),
|
|
803
|
-
children: [/* @__PURE__ */ o(
|
|
802
|
+
children: [/* @__PURE__ */ o(D, { className: "mr-1 inline h-3 w-3" }), u("uiLibrary.sceneMonitor.reset", "Reset")]
|
|
804
803
|
}),
|
|
805
804
|
/* @__PURE__ */ o("button", {
|
|
806
805
|
type: "button",
|
|
807
|
-
className:
|
|
806
|
+
className: Y,
|
|
808
807
|
disabled: N !== null,
|
|
809
808
|
onClick: () => void $(`check-${e.id}`, async () => d.sceneMonitor?.recheckNow({ monitorId: e.id })),
|
|
810
809
|
children: u("uiLibrary.sceneMonitor.checkNow", "Check now")
|
|
811
810
|
}),
|
|
812
811
|
/* @__PURE__ */ s("button", {
|
|
813
812
|
type: "button",
|
|
814
|
-
className: z === e.id ?
|
|
813
|
+
className: z === e.id ? X : Y,
|
|
815
814
|
"aria-pressed": z === e.id,
|
|
816
815
|
"aria-label": u("uiLibrary.sceneMonitor.settingsFor", "Settings for {{label}}", { label: e.label }),
|
|
817
816
|
disabled: N !== null,
|
|
@@ -823,11 +822,11 @@ function X({ deviceId: e }) {
|
|
|
823
822
|
className: re,
|
|
824
823
|
disabled: N !== null,
|
|
825
824
|
onClick: () => void $(`del-${e.id}`, async () => d.sceneMonitor?.deleteScene({ monitorId: e.id })),
|
|
826
|
-
children: /* @__PURE__ */ o(
|
|
825
|
+
children: /* @__PURE__ */ o(O, { className: "h-3 w-3" })
|
|
827
826
|
})
|
|
828
827
|
]
|
|
829
828
|
}),
|
|
830
|
-
z === e.id && /* @__PURE__ */ o(
|
|
829
|
+
z === e.id && /* @__PURE__ */ o(K, {
|
|
831
830
|
monitor: e,
|
|
832
831
|
disabled: N !== null,
|
|
833
832
|
onPatch: (t) => void $(`tune-${e.id}`, async () => d.sceneMonitor?.updateScene({
|
|
@@ -843,4 +842,4 @@ function X({ deviceId: e }) {
|
|
|
843
842
|
}) : null;
|
|
844
843
|
}
|
|
845
844
|
//#endregion
|
|
846
|
-
export {
|
|
845
|
+
export { Z as SceneMonitorEditor };
|