@camstack/addon-training 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/MaskShapeCanvas-Kfg9dl6B.mjs +686 -0
  2. package/dist/{MotionZonesSettings-DPtcv80q.mjs → MotionZonesSettings-DKtYdHUO.mjs} +101 -119
  3. package/dist/{PrivacyMaskSettings-Wsn5QL0_.mjs → PrivacyMaskSettings-BvLUVz86.mjs} +45 -70
  4. package/dist/ReactKonva-DGuYUN0L.mjs +5416 -0
  5. package/dist/{SceneMonitorEditor-BlMwyiH8.mjs → SceneMonitorEditor-rFYGkGHV.mjs} +82 -82
  6. package/dist/_stub.js +28225 -12866
  7. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Cbrdn9ib.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-B3xXUcaU.mjs} +3 -3
  8. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C7dks3FG.mjs +26 -0
  9. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DpjirGmB.mjs +89 -0
  10. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-CFCVuRAs.mjs +58 -0
  11. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-BkvDudqY.mjs +62 -0
  12. package/dist/{_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-BT_wL8s3.mjs → _virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs} +1 -1
  13. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs +34 -0
  14. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-DAZkHxxU.mjs +45 -0
  15. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CHqN9NLt.mjs +34 -0
  16. package/dist/addon-training.css +1 -1
  17. package/dist/{dist-BhCRZEE4.js → dist-DVDBSrjw.js} +270 -146
  18. package/dist/{dist-Cqa2fHNk.mjs → dist-Phot2UwD.mjs} +271 -141
  19. package/dist/grid-2x2-Bl3xw1w7.mjs +21 -0
  20. package/dist/{hostInit-BI98RYIm.mjs → hostInit-BAGO4XYA.mjs} +2 -2
  21. package/dist/index.js +100 -39
  22. package/dist/index.mjs +99 -38
  23. package/dist/lib-CVGFTwe0.mjs +7770 -0
  24. package/dist/orchestrator/training.addon.js +376 -222
  25. package/dist/orchestrator/training.addon.mjs +376 -222
  26. package/dist/{player-overlays-BX3obOMu.mjs → player-overlays-BT-6fK9N.mjs} +26 -7
  27. package/dist/providers/modal/training-modal.addon.js +361 -155
  28. package/dist/providers/modal/training-modal.addon.mjs +364 -158
  29. package/dist/remoteEntry.js +1 -1
  30. package/dist/{responsive-CdDIJCpI.mjs → responsive-Dy5RAD1s.mjs} +42 -38
  31. package/dist/{scene-monitor-copy-5u5w3K-Y.mjs → scene-monitor-copy-7HImRbA5.mjs} +4 -4
  32. package/dist/{square-C-P1-89Q.mjs → square-DoPBhbZN.mjs} +29 -4
  33. package/dist/{trash-2-BikGYiWf.mjs → trash-2-BwunNgLf.mjs} +1 -1
  34. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-DGLUs0o6.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-gU49KvnZ.mjs} +399 -390
  35. package/package.json +1 -1
  36. package/dist/MaskShapeCanvas-BokARvOj.mjs +0 -13806
  37. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BkKuzhOJ.mjs +0 -26
  38. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CaB1jnkt.mjs +0 -25
  39. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-B3rryujf.mjs +0 -25
  40. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-nL4MGFRP.mjs +0 -26
  41. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DDBEvLdo.mjs +0 -26
  42. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom__loadShare__.js-i_pnGDxd.mjs +0 -25
  43. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-gTIQrhKs.mjs +0 -25
@@ -1,10 +1,10 @@
1
- import { b as e, c as t, g as n, h as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-BT_wL8s3.mjs";
2
- import { c as o, d as s, i as c, l, o as u, s as d } from "./responsive-CdDIJCpI.mjs";
3
- import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x, u as S } from "./scene-monitor-copy-5u5w3K-Y.mjs";
4
- import { t as C } from "./trash-2-BikGYiWf.mjs";
5
- import { n as w, r as T, t as E } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DDBEvLdo.mjs";
6
- import { MaskShapeCanvas as D } from "./MaskShapeCanvas-BokARvOj.mjs";
7
- var O = s("settings-2", [
1
+ import { S as e, _ as t, c as n, g as r, m as i, u as a } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
2
+ import { c as o, d as s, g as c, m as l, p as u, u as d } from "./responsive-Dy5RAD1s.mjs";
3
+ import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x, u as S } from "./scene-monitor-copy-7HImRbA5.mjs";
4
+ import { t as C } from "./trash-2-BwunNgLf.mjs";
5
+ import { n as w, r as T, t as E } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
6
+ import { MaskShapeCanvas as D } from "./MaskShapeCanvas-Kfg9dl6B.mjs";
7
+ var O = c("settings-2", [
8
8
  ["path", {
9
9
  d: "M14 17H5",
10
10
  key: "gfn3mx"
@@ -52,10 +52,10 @@ function M(e) {
52
52
  return e.states.reduce((e, t) => e + t.references.length, 0);
53
53
  }
54
54
  var N = "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 ee({ monitor: e, disabled: t, onDelete: r }) {
56
- let i = j(e), a = M(e), [o, s] = n(null);
55
+ function ee({ monitor: e, disabled: n, onDelete: r }) {
56
+ let i = j(e), a = M(e), [s, c] = t(null);
57
57
  return i.length === 0 ? /* @__PURE__ */ w("p", {
58
- className: `${c} leading-relaxed`,
58
+ className: `${o} leading-relaxed`,
59
59
  children: "No photographs captured yet. Press “Capture daylight” to take the one this scene will judge everything against."
60
60
  }) : /* @__PURE__ */ w("div", {
61
61
  className: "flex flex-col gap-2",
@@ -70,29 +70,29 @@ function ee({ monitor: e, disabled: t, onDelete: r }) {
70
70
  ]
71
71
  }), /* @__PURE__ */ w("ul", {
72
72
  className: "flex flex-wrap gap-1.5",
73
- children: e.tiles.map((n) => {
74
- let i = `${n.stateId}:${String(n.index)}`, l = a === 1, u = o === i;
73
+ children: e.tiles.map((t) => {
74
+ let i = `${t.stateId}:${String(t.index)}`, l = a === 1, u = s === i;
75
75
  return /* @__PURE__ */ T("li", {
76
76
  className: "flex w-24 flex-col gap-1 rounded-md border border-border p-1",
77
77
  children: [
78
- /* @__PURE__ */ w(P, { reference: n.reference }),
78
+ /* @__PURE__ */ w(P, { reference: t.reference }),
79
79
  /* @__PURE__ */ w("span", {
80
- className: `${c} tabular-nums`,
81
- children: F(n.reference.capturedAt)
80
+ className: `${o} tabular-nums`,
81
+ children: F(t.reference.capturedAt)
82
82
  }),
83
83
  /* @__PURE__ */ T("button", {
84
84
  type: "button",
85
85
  className: N,
86
- disabled: t,
87
- "aria-label": `Delete the ${v(e.condition).toLowerCase()} photograph from ${F(n.reference.capturedAt)}`,
86
+ disabled: n,
87
+ "aria-label": `Delete the ${v(e.condition).toLowerCase()} photograph from ${F(t.reference.capturedAt)}`,
88
88
  onClick: () => {
89
89
  if (l && !u) {
90
- s(i);
90
+ c(i);
91
91
  return;
92
92
  }
93
- s(null), r({
94
- stateId: n.stateId,
95
- index: n.index
93
+ c(null), r({
94
+ stateId: t.stateId,
95
+ index: t.index
96
96
  });
97
97
  },
98
98
  children: [/* @__PURE__ */ w(C, { className: "mr-1 inline h-3 w-3" }), u ? "Confirm" : "Delete"]
@@ -109,8 +109,8 @@ function ee({ monitor: e, disabled: t, onDelete: r }) {
109
109
  });
110
110
  }
111
111
  function P({ reference: e }) {
112
- let [t, r] = n(!1), i = e.thumbnailMediaId;
113
- return i === void 0 || t ? /* @__PURE__ */ T("div", {
112
+ let [n, r] = t(!1), i = e.thumbnailMediaId;
113
+ return i === void 0 || n ? /* @__PURE__ */ T("div", {
114
114
  className: "flex h-16 w-full flex-col items-center justify-center gap-0.5 rounded bg-surface text-foreground-subtle",
115
115
  title: "The picture for this reference is no longer stored. The reference itself is intact and still being scored against.",
116
116
  children: [/* @__PURE__ */ w(S, { className: "h-4 w-4" }), /* @__PURE__ */ w("span", {
@@ -154,11 +154,11 @@ function W(e) {
154
154
  confirmPrompt: e.confirm?.prompt ?? ""
155
155
  };
156
156
  }
157
- function G({ monitor: e, disabled: t, onPatch: r }) {
158
- let [i, o] = n(() => W(e)), [s, l] = n(!1);
157
+ function G({ monitor: e, disabled: n, onPatch: r }) {
158
+ let [i, s] = t(() => W(e)), [c, l] = t(!1);
159
159
  a(() => {
160
- s || o(W(e));
161
- }, [e, s]);
160
+ c || s(W(e));
161
+ }, [e, c]);
162
162
  let u = (e) => {
163
163
  l(!1), r(e);
164
164
  }, d = (t) => e.check.mode === "similarity" ? {
@@ -187,10 +187,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
187
187
  }), /* @__PURE__ */ w("input", {
188
188
  type: "text",
189
189
  value: i.label,
190
- disabled: t,
190
+ disabled: n,
191
191
  className: I,
192
192
  onFocus: () => l(!0),
193
- onChange: (e) => o((t) => ({
193
+ onChange: (e) => s((t) => ({
194
194
  ...t,
195
195
  label: e.target.value
196
196
  })),
@@ -205,7 +205,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
205
205
  children: [/* @__PURE__ */ w("input", {
206
206
  type: "checkbox",
207
207
  checked: e.enabled,
208
- disabled: t,
208
+ disabled: n,
209
209
  onChange: (e) => u({ enabled: e.target.checked })
210
210
  }), /* @__PURE__ */ w("span", {
211
211
  className: L,
@@ -213,7 +213,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
213
213
  })]
214
214
  }),
215
215
  /* @__PURE__ */ w("p", {
216
- className: c,
216
+ className: o,
217
217
  children: "Turned off, the scene keeps its region, its references and its flag — it simply stops checking. Nothing is lost by pausing one for a while."
218
218
  }),
219
219
  /* @__PURE__ */ T("label", {
@@ -223,7 +223,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
223
223
  children: "When to look"
224
224
  }), /* @__PURE__ */ T("select", {
225
225
  value: e.triggerMode,
226
- disabled: t,
226
+ disabled: n,
227
227
  className: I,
228
228
  onChange: (e) => {
229
229
  let t = e.target.value;
@@ -246,7 +246,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
246
246
  })]
247
247
  }),
248
248
  /* @__PURE__ */ w("p", {
249
- className: c,
249
+ className: o,
250
250
  children: H[e.triggerMode]
251
251
  }),
252
252
  /* @__PURE__ */ T("label", {
@@ -259,10 +259,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
259
259
  min: B,
260
260
  max: V,
261
261
  value: i.checkIntervalSec,
262
- disabled: t,
262
+ disabled: n,
263
263
  className: I,
264
264
  onFocus: () => l(!0),
265
- onChange: (e) => o((t) => ({
265
+ onChange: (e) => s((t) => ({
266
266
  ...t,
267
267
  checkIntervalSec: Number(e.target.value) || 0
268
268
  })),
@@ -273,7 +273,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
273
273
  })]
274
274
  }),
275
275
  /* @__PURE__ */ w("p", {
276
- className: c,
276
+ className: o,
277
277
  children: "60 s suits “is the bin still out”. Every check costs one photograph and one encode, so going below about 30 s buys latency you almost never need and multiplies the cost by the number of scenes you own."
278
278
  })
279
279
  ]
@@ -299,9 +299,9 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
299
299
  max: .99,
300
300
  step: .01,
301
301
  value: i.threshold,
302
- disabled: t,
302
+ disabled: n,
303
303
  onFocus: () => l(!0),
304
- onChange: (e) => o((t) => ({
304
+ onChange: (e) => s((t) => ({
305
305
  ...t,
306
306
  threshold: Number(e.target.value)
307
307
  })),
@@ -326,10 +326,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
326
326
  min: 1,
327
327
  max: 10,
328
328
  value: i.hysteresisCount,
329
- disabled: t,
329
+ disabled: n,
330
330
  className: I,
331
331
  onFocus: () => l(!0),
332
- onChange: (e) => o((t) => ({
332
+ onChange: (e) => s((t) => ({
333
333
  ...t,
334
334
  hysteresisCount: Number(e.target.value) || 1
335
335
  })),
@@ -340,7 +340,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
340
340
  })]
341
341
  }),
342
342
  /* @__PURE__ */ w("p", {
343
- className: c,
343
+ className: o,
344
344
  children: "One bad photograph must never be able to flip a scene. 3 agreeing checks at 60 s is about four minutes of latency and is what makes the answer trustworthy — leaving a state costs exactly the same as entering one."
345
345
  }),
346
346
  /* @__PURE__ */ T("label", {
@@ -353,10 +353,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
353
353
  min: 0,
354
354
  max: 3600,
355
355
  value: i.quietSeconds,
356
- disabled: t,
356
+ disabled: n,
357
357
  className: I,
358
358
  onFocus: () => l(!0),
359
- onChange: (e) => o((t) => ({
359
+ onChange: (e) => s((t) => ({
360
360
  ...t,
361
361
  quietSeconds: Number(e.target.value) || 0
362
362
  })),
@@ -367,7 +367,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
367
367
  })]
368
368
  }),
369
369
  /* @__PURE__ */ w("p", {
370
- className: c,
370
+ className: o,
371
371
  children: "A check taken while something is moving is a photograph of the van parked in front of the bin, so it is discarded rather than merely delayed. 0 disables the gate."
372
372
  }),
373
373
  /* @__PURE__ */ T("label", {
@@ -380,10 +380,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
380
380
  min: 0,
381
381
  max: 3600,
382
382
  value: i.minObservationSpacingSec,
383
- disabled: t,
383
+ disabled: n,
384
384
  className: I,
385
385
  onFocus: () => l(!0),
386
- onChange: (e) => o((t) => ({
386
+ onChange: (e) => s((t) => ({
387
387
  ...t,
388
388
  minObservationSpacingSec: Number(e.target.value) || 0
389
389
  })),
@@ -394,7 +394,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
394
394
  })]
395
395
  }),
396
396
  /* @__PURE__ */ w("p", {
397
- className: c,
397
+ className: o,
398
398
  children: "Spreads the agreeing checks over real time instead of letting three adjacent polls inside one long occlusion be mistaken for three independent opinions."
399
399
  })
400
400
  ]
@@ -413,7 +413,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
413
413
  children: "When a light has no reference of its own"
414
414
  }), /* @__PURE__ */ T("select", {
415
415
  value: e.onUncoveredCondition,
416
- disabled: t,
416
+ disabled: n,
417
417
  className: I,
418
418
  onChange: (e) => {
419
419
  let t = e.target.value;
@@ -429,7 +429,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
429
429
  })]
430
430
  }),
431
431
  /* @__PURE__ */ w("p", {
432
- className: c,
432
+ className: o,
433
433
  children: U[e.onUncoveredCondition]
434
434
  })
435
435
  ]
@@ -448,7 +448,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
448
448
  children: "Notifications follow"
449
449
  }), /* @__PURE__ */ T("select", {
450
450
  value: e.emit,
451
- disabled: t,
451
+ disabled: n,
452
452
  className: I,
453
453
  onChange: (e) => {
454
454
  let t = e.target.value;
@@ -464,7 +464,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
464
464
  })]
465
465
  }),
466
466
  /* @__PURE__ */ w("p", {
467
- className: c,
467
+ className: o,
468
468
  children: "“Is the bin gone” is a flag: you want to be told once and still see it later. “Is the gate open” is a live state."
469
469
  }),
470
470
  /* @__PURE__ */ T("label", {
@@ -472,7 +472,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
472
472
  children: [/* @__PURE__ */ w("input", {
473
473
  type: "checkbox",
474
474
  checked: e.autoRestore,
475
- disabled: t,
475
+ disabled: n,
476
476
  onChange: (e) => u({ autoRestore: e.target.checked })
477
477
  }), /* @__PURE__ */ w("span", {
478
478
  className: L,
@@ -480,7 +480,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
480
480
  })]
481
481
  }),
482
482
  /* @__PURE__ */ w("p", {
483
- className: c,
483
+ className: o,
484
484
  children: "Off by default, so an alarm never silently clears itself. The “back to normal” moment is recorded either way, so an automation can still react to it."
485
485
  })
486
486
  ]
@@ -497,7 +497,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
497
497
  children: [/* @__PURE__ */ w("input", {
498
498
  type: "checkbox",
499
499
  checked: f,
500
- disabled: t || i.confirmPrompt.trim().length === 0,
500
+ disabled: n || i.confirmPrompt.trim().length === 0,
501
501
  onChange: (e) => u(e.target.checked ? { confirm: {
502
502
  ...q(i.confirmPrompt.trim()),
503
503
  enabled: !0
@@ -516,10 +516,10 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
516
516
  type: "text",
517
517
  value: i.confirmPrompt,
518
518
  placeholder: "e.g. Is the wheelie bin still there?",
519
- disabled: t,
519
+ disabled: n,
520
520
  className: I,
521
521
  onFocus: () => l(!0),
522
- onChange: (e) => o((t) => ({
522
+ onChange: (e) => s((t) => ({
523
523
  ...t,
524
524
  confirmPrompt: e.target.value
525
525
  })),
@@ -533,7 +533,7 @@ function G({ monitor: e, disabled: t, onPatch: r }) {
533
533
  })]
534
534
  }),
535
535
  /* @__PURE__ */ T("p", {
536
- className: c,
536
+ className: o,
537
537
  children: [
538
538
  "The model is asked ",
539
539
  /* @__PURE__ */ w("strong", { children: "only" }),
@@ -566,24 +566,24 @@ var J = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-m
566
566
  unknown: "border-border bg-surface text-foreground-subtle"
567
567
  }, re = .8, ie = 3;
568
568
  function X({ deviceId: e }) {
569
- let s = d(l().trpcClient, e), p = o(s?.state.sceneMonitor), S = b(e, { width: 640 }), [k, A] = n(null), [j, M] = n(!1), [N, P] = n(null), [F, I] = n(null), [L, R] = n(null), [z, B] = n(null), [V, H] = n(!1), [U, W] = n(null), [K, q] = n(""), X = r(!0);
569
+ let c = s(l().trpcClient, e), p = u(c?.state.sceneMonitor), S = b(e, { width: 640 }), [k, A] = t(null), [j, M] = t(!1), [N, P] = t(null), [F, I] = t(null), [L, R] = t(null), [z, B] = t(null), [V, H] = t(!1), [U, W] = t(null), [K, q] = t(""), X = r(!0);
570
570
  a(() => (X.current = !0, () => {
571
571
  X.current = !1;
572
572
  }), []);
573
- let Z = t(async () => {
574
- if (s) try {
575
- let e = await s.sceneMonitor?.listScenes({});
573
+ let Z = n(async () => {
574
+ if (c) try {
575
+ let e = await c.sceneMonitor?.listScenes({});
576
576
  if (!X.current) return;
577
577
  e && A(e);
578
578
  } catch (e) {
579
579
  if (!X.current) return;
580
- u(e) ? M(!0) : I(e instanceof Error ? e.message : String(e));
580
+ d(e) ? M(!0) : I(e instanceof Error ? e.message : String(e));
581
581
  }
582
- }, [s]);
582
+ }, [c]);
583
583
  a(() => {
584
584
  A(null), M(!1), I(null), Z();
585
585
  }, [Z]);
586
- let Q = p?.monitors ?? k?.monitors ?? [], ae = Date.now(), $ = t(async (e, t) => {
586
+ let Q = p?.monitors ?? k?.monitors ?? [], ae = Date.now(), $ = n(async (e, t) => {
587
587
  P(e), I(null);
588
588
  try {
589
589
  await t(), await Z();
@@ -604,22 +604,22 @@ function X({ deviceId: e }) {
604
604
  shape: U,
605
605
  label: "New scene"
606
606
  }];
607
- }, [Q, U]), se = t((e, t) => {
607
+ }, [Q, U]), se = n((e, t) => {
608
608
  if (t.kind === "rect") {
609
609
  if (e === "__draft__") {
610
610
  W(t);
611
611
  return;
612
612
  }
613
- $(`roi-${String(e)}`, async () => s?.sceneMonitor?.updateScene({
613
+ $(`roi-${String(e)}`, async () => c?.sceneMonitor?.updateScene({
614
614
  monitorId: String(e),
615
615
  patch: { roi: t }
616
616
  }));
617
617
  }
618
- }, [s, $]), ce = t((e) => {
618
+ }, [c, $]), ce = n((e) => {
619
619
  e.kind === "rect" && W(e);
620
- }, []), le = t(async () => {
620
+ }, []), le = n(async () => {
621
621
  U === null || K.trim().length === 0 || (await $("create", async () => {
622
- await s?.sceneMonitor?.createScene({
622
+ await c?.sceneMonitor?.createScene({
623
623
  label: K.trim(),
624
624
  roi: U,
625
625
  check: {
@@ -630,19 +630,19 @@ function X({ deviceId: e }) {
630
630
  });
631
631
  }), W(null), q(""), H(!1));
632
632
  }, [
633
- s,
633
+ c,
634
634
  U,
635
635
  K,
636
636
  $
637
637
  ]);
638
- return s ? /* @__PURE__ */ w("div", {
638
+ return c ? /* @__PURE__ */ w("div", {
639
639
  className: "flex flex-col gap-3",
640
640
  children: j ? /* @__PURE__ */ w("p", {
641
- className: `${c} leading-relaxed`,
641
+ className: `${o} leading-relaxed`,
642
642
  children: "Scene monitoring is not available for this camera."
643
643
  }) : /* @__PURE__ */ T(E, { children: [
644
644
  /* @__PURE__ */ w("p", {
645
- className: `${c} leading-relaxed`,
645
+ className: `${o} leading-relaxed`,
646
646
  children: "A scene watches one region of this camera and tells you when it stops looking like the picture you captured. Draw a box around the thing you care about — a wheelie bin, a gate, a parking space — then capture what “normal” looks like. Daylight is enough to start: the night reference is optional, and without it the scene simply sits the infrared hours out instead of reporting a problem."
647
647
  }),
648
648
  /* @__PURE__ */ w("div", {
@@ -716,7 +716,7 @@ function X({ deviceId: e }) {
716
716
  children: F
717
717
  }),
718
718
  Q.length === 0 ? /* @__PURE__ */ w("p", {
719
- className: `${c} leading-relaxed`,
719
+ className: `${o} leading-relaxed`,
720
720
  children: "No scenes on this camera yet."
721
721
  }) : /* @__PURE__ */ w("ul", {
722
722
  className: "flex flex-col gap-2",
@@ -738,17 +738,17 @@ function X({ deviceId: e }) {
738
738
  })]
739
739
  }),
740
740
  /* @__PURE__ */ w("p", {
741
- className: `${c} leading-relaxed`,
741
+ className: `${o} leading-relaxed`,
742
742
  children: f(e, ae)
743
743
  }),
744
744
  /* @__PURE__ */ w("p", {
745
- className: `${c} tabular-nums`,
745
+ className: `${o} tabular-nums`,
746
746
  children: y(e)
747
747
  }),
748
748
  /* @__PURE__ */ w(ee, {
749
749
  monitor: e,
750
750
  disabled: N !== null,
751
- onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () => s.sceneMonitor?.deleteReference({
751
+ onDelete: ({ stateId: t, index: n }) => void $(`refdel-${e.id}-${t}-${String(n)}`, async () => c.sceneMonitor?.deleteReference({
752
752
  monitorId: e.id,
753
753
  stateId: t,
754
754
  index: n
@@ -764,7 +764,7 @@ function X({ deviceId: e }) {
764
764
  className: J,
765
765
  disabled: N !== null,
766
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 ${v(t).toLowerCase()} reference`,
767
- onClick: () => void $(`cap-${e.id}-${t}`, async () => s.sceneMonitor?.captureReference({
767
+ onClick: () => void $(`cap-${e.id}-${t}`, async () => c.sceneMonitor?.captureReference({
768
768
  monitorId: e.id,
769
769
  condition: t
770
770
  })),
@@ -784,14 +784,14 @@ function X({ deviceId: e }) {
784
784
  className: Y,
785
785
  disabled: N !== null || e.states.length === 0,
786
786
  title: "Clear the flag and re-photograph what normal looks like right now",
787
- onClick: () => void $(`reset-${e.id}`, async () => s.sceneMonitor?.resetScene({ monitorId: e.id })),
787
+ onClick: () => void $(`reset-${e.id}`, async () => c.sceneMonitor?.resetScene({ monitorId: e.id })),
788
788
  children: [/* @__PURE__ */ w(g, { className: "mr-1 inline h-3 w-3" }), "Reset"]
789
789
  }),
790
790
  /* @__PURE__ */ w("button", {
791
791
  type: "button",
792
792
  className: J,
793
793
  disabled: N !== null,
794
- onClick: () => void $(`check-${e.id}`, async () => s.sceneMonitor?.recheckNow({ monitorId: e.id })),
794
+ onClick: () => void $(`check-${e.id}`, async () => c.sceneMonitor?.recheckNow({ monitorId: e.id })),
795
795
  children: "Check now"
796
796
  }),
797
797
  /* @__PURE__ */ T("button", {
@@ -807,7 +807,7 @@ function X({ deviceId: e }) {
807
807
  type: "button",
808
808
  className: te,
809
809
  disabled: N !== null,
810
- onClick: () => void $(`del-${e.id}`, async () => s.sceneMonitor?.deleteScene({ monitorId: e.id })),
810
+ onClick: () => void $(`del-${e.id}`, async () => c.sceneMonitor?.deleteScene({ monitorId: e.id })),
811
811
  children: /* @__PURE__ */ w(C, { className: "h-3 w-3" })
812
812
  })
813
813
  ]
@@ -815,7 +815,7 @@ function X({ deviceId: e }) {
815
815
  z === e.id && /* @__PURE__ */ w(G, {
816
816
  monitor: e,
817
817
  disabled: N !== null,
818
- onPatch: (t) => void $(`tune-${e.id}`, async () => s.sceneMonitor?.updateScene({
818
+ onPatch: (t) => void $(`tune-${e.id}`, async () => c.sceneMonitor?.updateScene({
819
819
  monitorId: e.id,
820
820
  patch: t
821
821
  }))