@camstack/addon-pipeline-orchestrator 1.1.16 → 1.1.18

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/_stub.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { t as e } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BiLBDmU5.mjs";
2
2
  import { a as t, c as n, i as r, n as i, o as a, r as o, s, t as c } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.js-a8tvh93M.mjs";
3
- import { C as l, S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-sANx-U6O.mjs";
3
+ import { C as l, S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CImHCYiW.mjs";
4
4
  import { n as N, r as P, t as F } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-yD-rMaFX.mjs";
5
- import { t as I } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CEVTusPn.mjs";
5
+ import { t as I } from "./_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BD6i2VnA.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
7
- var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), L = (e) => {
8
- let t = te(e);
7
+ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), L = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), R = (e) => {
8
+ let t = L(e);
9
9
  return t.charAt(0).toUpperCase() + t.slice(1);
10
- }, R = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ne = (e) => {
10
+ }, z = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), te = (e) => {
11
11
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
12
- }, re = {
12
+ }, ne = {
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  width: 24,
15
15
  height: 24,
@@ -19,31 +19,31 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
19
19
  strokeWidth: 2,
20
20
  strokeLinecap: "round",
21
21
  strokeLinejoin: "round"
22
- }, ie = i(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, l) => c("svg", {
22
+ }, re = i(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: i = "", children: a, iconNode: o, ...s }, l) => c("svg", {
23
23
  ref: l,
24
- ...re,
24
+ ...ne,
25
25
  width: t,
26
26
  height: t,
27
27
  stroke: e,
28
28
  strokeWidth: r ? Number(n) * 24 / Number(t) : n,
29
- className: R("lucide", i),
30
- ...!a && !ne(s) && { "aria-hidden": "true" },
29
+ className: z("lucide", i),
30
+ ...!a && !te(s) && { "aria-hidden": "true" },
31
31
  ...s
32
- }, [...o.map(([e, t]) => c(e, t)), ...Array.isArray(a) ? a : [a]])), z = (e, t) => {
33
- let n = i(({ className: n, ...r }, i) => c(ie, {
32
+ }, [...o.map(([e, t]) => c(e, t)), ...Array.isArray(a) ? a : [a]])), B = (e, t) => {
33
+ let n = i(({ className: n, ...r }, i) => c(re, {
34
34
  ref: i,
35
35
  iconNode: t,
36
- className: R(`lucide-${ee(L(e))}`, `lucide-${e}`, n),
36
+ className: z(`lucide-${ee(R(e))}`, `lucide-${e}`, n),
37
37
  ...r
38
38
  }));
39
- return n.displayName = L(e), n;
40
- }, ae = z("activity", [["path", {
39
+ return n.displayName = R(e), n;
40
+ }, ie = B("activity", [["path", {
41
41
  d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
42
42
  key: "169zse"
43
- }]]), oe = z("check", [["path", {
43
+ }]]), ae = B("check", [["path", {
44
44
  d: "M20 6 9 17l-5-5",
45
45
  key: "1gmf2c"
46
- }]]), B = z("cpu", [
46
+ }]]), oe = B("cpu", [
47
47
  ["path", {
48
48
  d: "M12 20v2",
49
49
  key: "1lh1kg"
@@ -108,7 +108,7 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
108
108
  rx: "1",
109
109
  key: "z9xiuo"
110
110
  }]
111
- ]), V = z("eye", [["path", {
111
+ ]), V = B("eye", [["path", {
112
112
  d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
113
113
  key: "1nclc0"
114
114
  }], ["circle", {
@@ -116,25 +116,25 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
116
116
  cy: "12",
117
117
  r: "3",
118
118
  key: "1v7zrd"
119
- }]]), H = z("gauge", [["path", {
119
+ }]]), H = B("gauge", [["path", {
120
120
  d: "m12 14 4-4",
121
121
  key: "9kzdfg"
122
122
  }], ["path", {
123
123
  d: "M3.34 19a10 10 0 1 1 17.32 0",
124
124
  key: "19p75a"
125
- }]]), U = z("hexagon", [["path", {
125
+ }]]), U = B("hexagon", [["path", {
126
126
  d: "M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",
127
127
  key: "yt0hxn"
128
- }]]), W = z("minus", [["path", {
128
+ }]]), W = B("minus", [["path", {
129
129
  d: "M5 12h14",
130
130
  key: "1ays0h"
131
- }]]), G = z("plus", [["path", {
131
+ }]]), G = B("plus", [["path", {
132
132
  d: "M5 12h14",
133
133
  key: "1ays0h"
134
134
  }], ["path", {
135
135
  d: "M12 5v14",
136
136
  key: "s699le"
137
- }]]), K = z("save", [
137
+ }]]), K = B("save", [
138
138
  ["path", {
139
139
  d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
140
140
  key: "1c8476"
@@ -147,7 +147,7 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
147
147
  d: "M7 3v4a1 1 0 0 0 1 1h7",
148
148
  key: "t51u73"
149
149
  }]
150
- ]), q = z("trash-2", [
150
+ ]), q = B("trash-2", [
151
151
  ["path", {
152
152
  d: "M3 6h18",
153
153
  key: "d0wm0j"
@@ -174,7 +174,7 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
174
174
  y2: "17",
175
175
  key: "xtxkd"
176
176
  }]
177
- ]), se = z("video", [["path", {
177
+ ]), se = B("video", [["path", {
178
178
  d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
179
179
  key: "ftymec"
180
180
  }], ["rect", {
@@ -184,7 +184,7 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
184
184
  height: "12",
185
185
  rx: "2",
186
186
  key: "158x01"
187
- }]]), ce = z("volume-2", [
187
+ }]]), ce = B("volume-2", [
188
188
  ["path", {
189
189
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
190
190
  key: "uqj9uw"
@@ -197,7 +197,7 @@ var ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), te = (e)
197
197
  d: "M19.364 18.364a9 9 0 0 0 0-12.728",
198
198
  key: "ijwkga"
199
199
  }]
200
- ]), J = z("x", [["path", {
200
+ ]), J = B("x", [["path", {
201
201
  d: "M18 6 6 18",
202
202
  key: "1bl5f8"
203
203
  }], ["path", {
@@ -213,18 +213,18 @@ function le(e) {
213
213
  }) : /* @__PURE__ */ N(ue, { deviceId: e.deviceId });
214
214
  }
215
215
  function ue({ deviceId: t }) {
216
- p(["pipelineOrchestrator", "getPipelineAssignment"], [
216
+ j(["pipelineOrchestrator", "getPipelineAssignment"], [
217
217
  "pipeline.camera-assigned",
218
218
  "pipeline.camera-unassigned",
219
219
  "pipeline.camera-updated"
220
- ]), p(["pipelineRunner", "getCameraMetrics"], ["pipeline.camera-metrics-snapshot"]);
221
- let { data: n } = j({ deviceId: t }, { staleTime: 3e4 }), r = n?.agentNodeId ?? null, i = typeof r == "string" && r.length > 0 && !r.startsWith("addon:") ? r : void 0, { data: a } = u({
220
+ ]), j(["pipelineRunner", "getCameraMetrics"], ["pipeline.camera-metrics-snapshot"]);
221
+ let { data: n } = u({ deviceId: t }, { staleTime: 3e4 }), r = n?.agentNodeId ?? null, i = typeof r == "string" && r.length > 0 && !r.startsWith("addon:") ? r : void 0, { data: a } = l({
222
222
  deviceId: t,
223
223
  ...i ? { nodeId: i } : {}
224
224
  }, {
225
225
  staleTime: 2e3,
226
226
  retry: !1
227
- }), o = A(), s = k(o.trpcClient, t), { data: c } = e({
227
+ }), o = S(), s = M(o.trpcClient, t), { data: c } = e({
228
228
  queryKey: [
229
229
  "device",
230
230
  t,
@@ -234,7 +234,7 @@ function ue({ deviceId: t }) {
234
234
  enabled: !!s,
235
235
  refetchInterval: 5e3,
236
236
  retry: !1
237
- }), { data: l } = e({
237
+ }), { data: d } = e({
238
238
  queryKey: [
239
239
  "device",
240
240
  t,
@@ -249,39 +249,39 @@ function ue({ deviceId: t }) {
249
249
  queryFn: async () => await o.trpcClient.recording.getStatus.query({ deviceId: t }),
250
250
  refetchInterval: 5e3,
251
251
  retry: !1
252
- }), { data: m } = e({
252
+ }), { data: p } = e({
253
253
  queryKey: ["recording.getDeviceConfig", t],
254
254
  queryFn: async () => await o.trpcClient.recording.getDeviceConfig.query({ deviceId: t }),
255
255
  staleTime: 3e4,
256
256
  retry: !1
257
- }), h = a?.phase ?? null, g = a?.detectionMode ?? null, _ = Number(a?.actualFps ?? 0), v = Number(a?.configuredFps ?? 0), y = Number(a?.avgInferenceTimeMs ?? 0), b = Number(a?.queueDepth ?? 0), x = Number(a?.droppedFrames ?? 0), S = d(h ?? "watching"), C = c?.length ?? 0, w = l?.level.dbfs ?? null, T = typeof w == "number" ? `${w.toFixed(1)} dBFS` : "—", E = f?.enabled ?? !1, D = f?.activeMode ?? "off", O = E && D !== "off", M = E ? D === "off" ? "Idle" : D === "continuous" ? "Continuous" : D === "onMotion" ? "On motion" : D === "onAudioThreshold" ? "On audio" : D : "Disabled", F = (m?.profiles ?? []).join(", "), I = f ? `${de(f.storageBytes ?? 0)}${F ? ` · ${F}` : ""}` : void 0;
257
+ }), m = a?.phase ?? null, h = a?.detectionMode ?? null, g = Number(a?.actualFps ?? 0), _ = Number(a?.configuredFps ?? 0), v = Number(a?.avgInferenceTimeMs ?? 0), y = Number(a?.queueDepth ?? 0), b = Number(a?.droppedFrames ?? 0), x = k(m ?? "watching"), C = c?.length ?? 0, w = d?.level.dbfs ?? null, T = typeof w == "number" ? `${w.toFixed(1)} dBFS` : "—", E = f?.enabled ?? !1, D = f?.activeMode ?? "off", O = E && D !== "off", A = E ? D === "off" ? "Idle" : D === "continuous" ? "Continuous" : D === "onMotion" ? "On motion" : D === "onAudioThreshold" ? "On audio" : D : "Disabled", F = (p?.profiles ?? []).join(", "), I = f ? `${de(f.storageBytes ?? 0)}${F ? ` · ${F}` : ""}` : void 0;
258
258
  return /* @__PURE__ */ P("div", {
259
259
  className: "grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-3",
260
260
  children: [
261
261
  /* @__PURE__ */ N(Y, {
262
- icon: ae,
262
+ icon: ie,
263
263
  label: "Phase",
264
- value: S.label,
265
- color: S.textColor,
266
- subtext: g ?? void 0
264
+ value: x.label,
265
+ color: x.textColor,
266
+ subtext: h ?? void 0
267
267
  }),
268
268
  /* @__PURE__ */ N(Y, {
269
269
  icon: H,
270
270
  label: "Detection FPS",
271
- value: `${_.toFixed(1)}`,
272
- subtext: v > 0 ? `target: ${v}` : void 0
271
+ value: `${g.toFixed(1)}`,
272
+ subtext: _ > 0 ? `target: ${_}` : void 0
273
273
  }),
274
274
  /* @__PURE__ */ N(Y, {
275
- icon: B,
275
+ icon: oe,
276
276
  label: "Inference",
277
- value: `${y.toFixed(1)} ms`,
278
- subtext: b > 0 ? `queue: ${b}` : void 0
277
+ value: `${v.toFixed(1)} ms`,
278
+ subtext: y > 0 ? `queue: ${y}` : void 0
279
279
  }),
280
280
  /* @__PURE__ */ N(Y, {
281
281
  icon: V,
282
282
  label: "Active Tracks",
283
283
  value: String(C),
284
- subtext: x > 0 ? `dropped: ${x}` : void 0
284
+ subtext: b > 0 ? `dropped: ${b}` : void 0
285
285
  }),
286
286
  /* @__PURE__ */ N(Y, {
287
287
  icon: ce,
@@ -291,7 +291,7 @@ function ue({ deviceId: t }) {
291
291
  /* @__PURE__ */ N(Y, {
292
292
  icon: se,
293
293
  label: "Recording",
294
- value: M,
294
+ value: A,
295
295
  color: O ? "text-success" : void 0,
296
296
  subtext: I
297
297
  })
@@ -420,7 +420,7 @@ var he = [
420
420
  "#ec4899"
421
421
  ];
422
422
  function ge({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
423
- let i = T(), a = (e) => i?.updateDraft({ name: e }), o = (e) => i?.updateDraft({ color: e });
423
+ let i = y(), a = (e) => i?.updateDraft({ name: e }), o = (e) => i?.updateDraft({ color: e });
424
424
  return /* @__PURE__ */ P("div", {
425
425
  className: "flex flex-col gap-2",
426
426
  children: [
@@ -436,7 +436,7 @@ function ge({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
436
436
  }),
437
437
  /* @__PURE__ */ N("input", {
438
438
  type: "text",
439
- className: f,
439
+ className: C,
440
440
  value: e.name,
441
441
  autoFocus: !0,
442
442
  onChange: (e) => a(e.target.value),
@@ -464,7 +464,7 @@ function ge({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
464
464
  onChange: (e) => o(e.target.value)
465
465
  }), /* @__PURE__ */ N("input", {
466
466
  type: "text",
467
- className: `${f} font-mono`,
467
+ className: `${C} font-mono`,
468
468
  value: e.color,
469
469
  placeholder: "#000000",
470
470
  onChange: (e) => o(e.target.value)
@@ -481,7 +481,7 @@ function ge({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
481
481
  onClick: t,
482
482
  className: "inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/10 text-primary hover:bg-primary/20 transition-colors h-7 flex-1 text-[11px] font-medium",
483
483
  title: "Save changes (Enter)",
484
- children: [/* @__PURE__ */ N(oe, { className: "h-3 w-3" }), "Save"]
484
+ children: [/* @__PURE__ */ N(ae, { className: "h-3 w-3" }), "Save"]
485
485
  }), /* @__PURE__ */ P("button", {
486
486
  type: "button",
487
487
  onClick: n,
@@ -493,7 +493,7 @@ function ge({ zone: e, onSave: t, onDiscard: n, onDelete: r }) {
493
493
  /* @__PURE__ */ P("button", {
494
494
  type: "button",
495
495
  onClick: r,
496
- className: `${y} w-full`,
496
+ className: `${f} w-full`,
497
497
  children: [/* @__PURE__ */ N(q, { className: "h-3 w-3" }), "Delete"]
498
498
  })
499
499
  ]
@@ -525,11 +525,11 @@ function ye(e) {
525
525
  return e.name && (t.name = e.name), e.classFilter.length > 0 && (t.classFilter = e.classFilter), t;
526
526
  }
527
527
  function X({ dev: e, stage: n, zones: r, title: i }) {
528
- let o = M(e?.state.zoneRules), c = a(() => o?.[n] ?? [], [o, n]), [l, u] = s([]), [d, p] = s(!1), [m, h] = s(!1), [g, y] = s(null);
528
+ let o = p(e?.state.zoneRules), c = a(() => o?.[n] ?? [], [o, n]), [l, u] = s([]), [f, m] = s(!1), [h, g] = s(!1), [y, b] = s(null);
529
529
  t(() => {
530
- d || u(c.map(ve));
531
- }, [c, d]);
532
- let b = () => {
530
+ f || u(c.map(ve));
531
+ }, [c, f]);
532
+ let S = () => {
533
533
  u((e) => [...e, {
534
534
  id: crypto.randomUUID(),
535
535
  name: "",
@@ -537,8 +537,8 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
537
537
  mode: "exclude",
538
538
  classFilter: [],
539
539
  enabled: !0
540
- }]), p(!0);
541
- }, S = (e, t) => {
540
+ }]), m(!0);
541
+ }, w = (e, t) => {
542
542
  u((n) => n.map((n, r) => {
543
543
  if (r !== e) return n;
544
544
  let i = n.classFilter.includes(t) ? n.classFilter.filter((e) => e !== t) : [...n.classFilter, t];
@@ -546,7 +546,7 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
546
546
  ...n,
547
547
  classFilter: i
548
548
  };
549
- })), p(!0);
549
+ })), m(!0);
550
550
  }, T = (e, t) => {
551
551
  u((n) => n.map((n, r) => {
552
552
  if (r !== e) return n;
@@ -555,42 +555,42 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
555
555
  ...n,
556
556
  zoneIds: i
557
557
  };
558
- })), p(!0);
559
- }, E = (e) => {
560
- u((t) => t.filter((t, n) => n !== e)), p(!0);
561
- }, O = (e, t) => {
558
+ })), m(!0);
559
+ }, O = (e) => {
560
+ u((t) => t.filter((t, n) => n !== e)), m(!0);
561
+ }, k = (e, t) => {
562
562
  u((n) => n.map((n, r) => r === e ? {
563
563
  ...n,
564
564
  ...t
565
- } : n)), p(!0);
566
- }, k = async () => {
565
+ } : n)), m(!0);
566
+ }, A = async () => {
567
567
  if (e?.zoneRules) {
568
- h(!0), y(null);
568
+ g(!0), b(null);
569
569
  try {
570
570
  await e.zoneRules.setRules({
571
571
  stage: n,
572
572
  rules: l.map(ye)
573
- }), p(!1);
573
+ }), m(!1);
574
574
  } catch (e) {
575
- y(e instanceof Error ? e.message : String(e));
575
+ b(e instanceof Error ? e.message : String(e));
576
576
  } finally {
577
- h(!1);
577
+ g(!1);
578
578
  }
579
579
  }
580
- }, A = d && !!e?.zoneRules && !m;
580
+ }, j = f && !!e?.zoneRules && !h;
581
581
  return /* @__PURE__ */ P("div", {
582
582
  className: "rounded-md border border-border bg-surface/40 p-2.5",
583
583
  children: [
584
584
  /* @__PURE__ */ P("div", {
585
585
  className: "flex items-center justify-between mb-2 gap-2",
586
586
  children: [/* @__PURE__ */ N("h3", {
587
- className: `${w} truncate`,
587
+ className: `${x} truncate`,
588
588
  children: i ?? `${n === "motion" ? "Motion" : "Detection"} Rules`
589
589
  }), /* @__PURE__ */ P("div", {
590
590
  className: "flex items-center gap-1 flex-shrink-0",
591
591
  children: [/* @__PURE__ */ P("button", {
592
592
  type: "button",
593
- onClick: b,
593
+ onClick: S,
594
594
  disabled: r.length === 0 || !e,
595
595
  className: D,
596
596
  title: "Add rule",
@@ -598,11 +598,11 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
598
598
  }), /* @__PURE__ */ P("button", {
599
599
  type: "button",
600
600
  onClick: () => {
601
- k();
601
+ A();
602
602
  },
603
- disabled: !A,
604
- className: C,
605
- children: [/* @__PURE__ */ N(K, { className: "h-2.5 w-2.5" }), m ? "…" : "Save"]
603
+ disabled: !j,
604
+ className: E,
605
+ children: [/* @__PURE__ */ N(K, { className: "h-2.5 w-2.5" }), h ? "…" : "Save"]
606
606
  })]
607
607
  })]
608
608
  }),
@@ -623,21 +623,21 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
623
623
  "aria-checked": e.enabled,
624
624
  "aria-label": e.enabled ? "Disable rule" : "Enable rule",
625
625
  title: e.enabled ? "Rule is active — click to disable" : "Rule is disabled — click to enable",
626
- onClick: () => O(t, { enabled: !e.enabled }),
626
+ onClick: () => k(t, { enabled: !e.enabled }),
627
627
  className: ["inline-flex items-center justify-center h-5 w-9 rounded-full border transition-colors flex-shrink-0", e.enabled ? "border-primary/50 bg-primary/20 text-primary" : "border-border bg-surface text-foreground-subtle"].join(" "),
628
628
  children: /* @__PURE__ */ N("span", { className: ["h-3 w-3 rounded-full transition-transform", e.enabled ? "translate-x-1.5 bg-primary" : "-translate-x-1.5 bg-foreground-subtle"].join(" ") })
629
629
  }),
630
630
  /* @__PURE__ */ N("input", {
631
- className: `${f} min-w-0`,
631
+ className: `${C} min-w-0`,
632
632
  placeholder: "Rule name (optional)",
633
633
  value: e.name,
634
- onChange: (e) => O(t, { name: e.target.value })
634
+ onChange: (e) => k(t, { name: e.target.value })
635
635
  }),
636
636
  /* @__PURE__ */ N("button", {
637
637
  type: "button",
638
638
  title: "Remove rule",
639
639
  "aria-label": "Remove rule",
640
- onClick: () => E(t),
640
+ onClick: () => O(t),
641
641
  className: "flex items-center justify-center h-6 w-6 rounded text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors flex-shrink-0",
642
642
  children: /* @__PURE__ */ N(q, { className: "h-3.5 w-3.5" })
643
643
  })
@@ -652,14 +652,14 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
652
652
  }),
653
653
  /* @__PURE__ */ N("button", {
654
654
  type: "button",
655
- onClick: () => O(t, { mode: "include" }),
656
- className: `${v} ${e.mode === "include" ? x : _}`,
655
+ onClick: () => k(t, { mode: "include" }),
656
+ className: `${_} ${e.mode === "include" ? v : d}`,
657
657
  children: "Include"
658
658
  }),
659
659
  /* @__PURE__ */ N("button", {
660
660
  type: "button",
661
- onClick: () => O(t, { mode: "exclude" }),
662
- className: `${v} ${e.mode === "exclude" ? x : _}`,
661
+ onClick: () => k(t, { mode: "exclude" }),
662
+ className: `${_} ${e.mode === "exclude" ? v : d}`,
663
663
  children: "Exclude"
664
664
  })
665
665
  ]
@@ -675,7 +675,7 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
675
675
  }) : r.map((n) => /* @__PURE__ */ P("button", {
676
676
  type: "button",
677
677
  onClick: () => T(t, n.id),
678
- className: `${v} ${e.zoneIds.includes(n.id) ? x : _}`,
678
+ className: `${_} ${e.zoneIds.includes(n.id) ? v : d}`,
679
679
  children: [/* @__PURE__ */ N("span", {
680
680
  className: "h-2 w-2 rounded-sm",
681
681
  style: { backgroundColor: n.color || "#3b82f6" }
@@ -694,8 +694,8 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
694
694
  }),
695
695
  _e.map((n) => /* @__PURE__ */ N("button", {
696
696
  type: "button",
697
- onClick: () => S(t, n.id),
698
- className: `${v} ${e.classFilter.includes(n.id) ? x : _}`,
697
+ onClick: () => w(t, n.id),
698
+ className: `${_} ${e.classFilter.includes(n.id) ? v : d}`,
699
699
  children: n.label
700
700
  }, n.id)),
701
701
  e.classFilter.length === 0 && /* @__PURE__ */ N("span", {
@@ -707,9 +707,9 @@ function X({ dev: e, stage: n, zones: r, title: i }) {
707
707
  ]
708
708
  }, e.id))
709
709
  }),
710
- g && /* @__PURE__ */ N("p", {
710
+ y && /* @__PURE__ */ N("p", {
711
711
  className: "mt-2 text-[10px] text-danger",
712
- children: g
712
+ children: y
713
713
  })
714
714
  ]
715
715
  });
@@ -775,13 +775,13 @@ function Q(e) {
775
775
  };
776
776
  }
777
777
  function De({ deviceId: e }) {
778
- let t = k(A().trpcClient, e), i = M(t?.state.zones), o = a(() => i?.zones ?? [], [i]), s = T(), c = s?.drawingKind ?? null, l = s?.selectedZoneId ?? null, u = s?.editingDraft ?? null, d = a(() => o.map((e) => u && u.id === e.id ? {
778
+ let t = M(S().trpcClient, e), i = p(t?.state.zones), o = a(() => i?.zones ?? [], [i]), s = y(), c = s?.drawingKind ?? null, l = s?.selectedZoneId ?? null, u = s?.editingDraft ?? null, d = a(() => o.map((e) => u && u.id === e.id ? {
779
779
  id: u.id,
780
780
  name: u.name,
781
781
  kind: u.kind,
782
782
  color: u.color,
783
783
  points: [...u.points]
784
- } : Ee(e)), [o, u]), f = a(() => d.map(be), [d]), p = r(async (e) => {
784
+ } : Ee(e)), [o, u]), f = a(() => d.map(be), [d]), h = r(async (e) => {
785
785
  if (e.kind !== "polygon" && e.kind !== "line") return;
786
786
  let n = {
787
787
  id: crypto.randomUUID(),
@@ -800,7 +800,7 @@ function De({ deviceId: e }) {
800
800
  t,
801
801
  d,
802
802
  s
803
- ]), m = r(async (e, n) => {
803
+ ]), g = r(async (e, n) => {
804
804
  let r = n.map((e) => ({
805
805
  x: e.x,
806
806
  y: e.y
@@ -823,9 +823,9 @@ function De({ deviceId: e }) {
823
823
  d,
824
824
  u,
825
825
  s
826
- ]), h = r((e, t) => {
827
- typeof e == "string" && (t.kind !== "polygon" && t.kind !== "line" || m(e, t.points));
828
- }, [m]), g = r((e) => {
826
+ ]), _ = r((e, t) => {
827
+ typeof e == "string" && (t.kind !== "polygon" && t.kind !== "line" || g(e, t.points));
828
+ }, [g]), v = r((e) => {
829
829
  if (e === null) {
830
830
  s?.discardDraft(), s?.setSelectedZoneId(null);
831
831
  return;
@@ -846,15 +846,15 @@ function De({ deviceId: e }) {
846
846
  }, [d, s]);
847
847
  return d.length === 0 && c === null ? null : /* @__PURE__ */ N(n, {
848
848
  fallback: null,
849
- children: /* @__PURE__ */ N(E, {
849
+ children: /* @__PURE__ */ N(m, {
850
850
  transparent: !0,
851
851
  items: f,
852
852
  supportedShapes: we,
853
853
  selectedId: l,
854
- onSelect: g,
855
- onShapeChange: h,
854
+ onSelect: v,
855
+ onShapeChange: _,
856
856
  onDrawComplete: (e) => {
857
- p(e);
857
+ h(e);
858
858
  },
859
859
  drawingKind: c === null ? null : Se(c)
860
860
  })
@@ -880,13 +880,13 @@ function Ae(e) {
880
880
  };
881
881
  }
882
882
  function je({ deviceId: e }) {
883
- let t = k(A().trpcClient, e), n = M(t?.state.zones), i = a(() => n?.zones ?? [], [n]), o = a(() => i.map(ke), [i]), s = T(), c = s?.drawingKind ?? null, u = s?.selectedZoneId ?? null, d = s?.editingDraft ?? null;
884
- l(a(() => ({
883
+ let t = M(S().trpcClient, e), n = p(t?.state.zones), i = a(() => n?.zones ?? [], [n]), o = a(() => i.map(ke), [i]), s = y(), c = s?.drawingKind ?? null, l = s?.selectedZoneId ?? null, u = s?.editingDraft ?? null;
884
+ A(a(() => ({
885
885
  id: "zones",
886
886
  order: 100,
887
887
  node: /* @__PURE__ */ N($, { deviceId: e })
888
888
  }), [e]));
889
- let f = r((e) => {
889
+ let d = r((e) => {
890
890
  if (e === null) {
891
891
  s?.discardDraft(), s?.setSelectedZoneId(null);
892
892
  return;
@@ -899,7 +899,7 @@ function je({ deviceId: e }) {
899
899
  color: t.color,
900
900
  points: t.points
901
901
  });
902
- }, [o, s]), p = r(async () => {
902
+ }, [o, s]), f = r(async () => {
903
903
  let e = s?.editingDraft;
904
904
  if (e) {
905
905
  try {
@@ -915,39 +915,39 @@ function je({ deviceId: e }) {
915
915
  }
916
916
  s?.discardDraft(), s?.setSelectedZoneId(null);
917
917
  }
918
- }, [t, s]), _ = r(() => {
918
+ }, [t, s]), m = r(() => {
919
919
  s?.discardDraft(), s?.setSelectedZoneId(null);
920
- }, [s]), v = r(async (e) => {
920
+ }, [s]), _ = r(async (e) => {
921
921
  try {
922
922
  await t?.zones?.removeZone({ zoneId: e });
923
923
  } catch (e) {
924
924
  console.error("zones.removeZone failed", e);
925
925
  }
926
926
  s?.selectedZoneId === e && s.setSelectedZoneId(null), s?.editingDraft?.id === e && s.discardDraft();
927
- }, [t, s]), y = r((e) => {
927
+ }, [t, s]), v = r((e) => {
928
928
  s?.startDrawing(e);
929
- }, [s]), x = r(() => {
929
+ }, [s]), C = r(() => {
930
930
  s?.setDrawingKind(null);
931
- }, [s]), C = a(() => !d || !o.find((e) => e.id === d.id) ? null : {
932
- id: d.id,
933
- kind: d.kind,
934
- name: d.name,
935
- color: d.color,
936
- points: [...d.points]
937
- }, [o, d]);
931
+ }, [s]), E = a(() => !u || !o.find((e) => e.id === u.id) ? null : {
932
+ id: u.id,
933
+ kind: u.kind,
934
+ name: u.name,
935
+ color: u.color,
936
+ points: [...u.points]
937
+ }, [o, u]);
938
938
  return /* @__PURE__ */ P("div", {
939
- className: h,
939
+ className: g,
940
940
  children: [/* @__PURE__ */ P("div", {
941
- className: b,
941
+ className: O,
942
942
  children: [/* @__PURE__ */ N("div", {
943
- className: O,
943
+ className: h,
944
944
  children: /* @__PURE__ */ P("div", {
945
945
  className: "min-w-0",
946
946
  children: [/* @__PURE__ */ N("h2", {
947
- className: w,
947
+ className: x,
948
948
  children: "Detection Zones"
949
949
  }), /* @__PURE__ */ P("p", {
950
- className: `${g} mt-0.5 leading-tight`,
950
+ className: `${w} mt-0.5 leading-tight`,
951
951
  children: [
952
952
  "Pick a shape below or use the ",
953
953
  /* @__PURE__ */ N("strong", {
@@ -960,24 +960,24 @@ function je({ deviceId: e }) {
960
960
  })]
961
961
  })
962
962
  }), /* @__PURE__ */ P("div", {
963
- className: `${m} flex flex-col gap-3`,
963
+ className: `${b} flex flex-col gap-3`,
964
964
  children: [/* @__PURE__ */ N(me, {
965
965
  zones: o,
966
- selectedZoneId: u,
966
+ selectedZoneId: l,
967
967
  drawingKind: c,
968
- onSelectZone: f,
969
- onDeleteZone: v,
970
- onStartDraw: y,
971
- onCancelDraw: x
972
- }), C && /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("div", { className: "border-t border-border" }), /* @__PURE__ */ N(ge, {
973
- zone: C,
974
- onSave: p,
975
- onDiscard: _,
976
- onDelete: () => v(C.id)
968
+ onSelectZone: d,
969
+ onDeleteZone: _,
970
+ onStartDraw: v,
971
+ onCancelDraw: C
972
+ }), E && /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("div", { className: "border-t border-border" }), /* @__PURE__ */ N(ge, {
973
+ zone: E,
974
+ onSave: f,
975
+ onDiscard: m,
976
+ onDelete: () => _(E.id)
977
977
  })] })]
978
978
  })]
979
979
  }), /* @__PURE__ */ P("div", {
980
- className: `grid grid-cols-1 2xl:grid-cols-2 ${S}`,
980
+ className: `grid grid-cols-1 2xl:grid-cols-2 ${T}`,
981
981
  children: [/* @__PURE__ */ N(X, {
982
982
  dev: t,
983
983
  stage: "motion",
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.1.18",
21
+ version: "1.1.20",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_pipeline_orchestrator_widgets",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.1.16",
36
+ version: "1.1.17",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_pipeline_orchestrator_widgets",