@camstack/addon-training 0.1.19 → 0.1.21

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,5 +1,5 @@
1
1
  import "./virtualExposes-0m8NqEDE.mjs";
2
- import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-XuupllaQ.mjs";
2
+ import { a as e, i as t, o as n, r } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-C-uqIKLg.mjs";
3
3
  import { S as i, _ as a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, p as g, r as _, t as v, u as y, v as b, x, y as S } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-DeDbF7NI.mjs";
4
4
  import { _ as C, a as w, b as T, c as E, d as D, f as O, g as k, h as A, i as j, l as M, m as N, n as P, o as F, p as I, r as ee, s as te, t as ne, u as re, v as ie, y as L } from "./responsive-emJo3EdF.mjs";
5
5
  import { c as ae, d as oe, l as se, s as ce, u as le } from "./scene-monitor-copy-CcQxbRXa.mjs";
@@ -16222,37 +16222,39 @@ function bg() {
16222
16222
  if (!e) throw Error("Tabs compound components must be used within <Tabs>");
16223
16223
  return e;
16224
16224
  }
16225
- function xg({ value: e, onValueChange: t, defaultValue: n = "", className: r, ...i }) {
16226
- let [o, c] = a(n), l = e ?? o, u = s((n) => {
16227
- t?.(n), e === void 0 && c(n);
16225
+ function xg({ value: e, onValueChange: t, defaultValue: n = "", appearance: r = "underline", className: i, ...o }) {
16226
+ let [c, l] = a(n), u = e ?? c, d = s((n) => {
16227
+ t?.(n), e === void 0 && l(n);
16228
16228
  }, [e, t]);
16229
16229
  return /* @__PURE__ */ V(yg.Provider, {
16230
16230
  value: {
16231
- value: l,
16232
- setValue: u
16231
+ value: u,
16232
+ setValue: d,
16233
+ appearance: r
16233
16234
  },
16234
16235
  children: /* @__PURE__ */ V("div", {
16235
- className: r,
16236
- ...i
16236
+ className: i,
16237
+ ...o
16237
16238
  })
16238
16239
  });
16239
16240
  }
16240
16241
  function Sg({ className: e, ...t }) {
16242
+ let { appearance: n } = bg();
16241
16243
  return /* @__PURE__ */ V("div", {
16242
16244
  role: "tablist",
16243
- className: J("flex flex-row overflow-x-auto overflow-y-hidden border-b border-border-subtle", e),
16245
+ className: J("flex flex-row overflow-x-auto overflow-y-hidden", n === "pills" ? "gap-1 border-b border-border-subtle py-1" : "border-b border-border-subtle", e),
16244
16246
  ...t
16245
16247
  });
16246
16248
  }
16247
16249
  function Cg({ value: e, className: t, ...n }) {
16248
- let { value: r, setValue: i } = bg(), a = e === r;
16250
+ let { value: r, setValue: i, appearance: a } = bg(), o = e === r;
16249
16251
  return /* @__PURE__ */ V("button", {
16250
16252
  type: "button",
16251
16253
  role: "tab",
16252
- "aria-selected": a,
16254
+ "aria-selected": o,
16253
16255
  "aria-controls": `tabpanel-${e}`,
16254
- tabIndex: a ? 0 : -1,
16255
- className: J("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", a ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", t),
16256
+ tabIndex: o ? 0 : -1,
16257
+ className: J("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", a === "pills" ? o ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : o ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", t),
16256
16258
  onClick: () => i(e),
16257
16259
  ...n
16258
16260
  });
@@ -28156,29 +28158,47 @@ function NA({ open: e, onClose: t, title: n, icon: r, error: i, width: a = "lg",
28156
28158
  //#endregion
28157
28159
  //#region ../ui-library/src/hooks/use-url-query.ts
28158
28160
  i();
28159
- function PA(e) {
28161
+ var PA = "camstack:url-query";
28162
+ function FA(e) {
28160
28163
  return new URLSearchParams(window.location.search).get(e);
28161
28164
  }
28162
- function FA(e, t) {
28165
+ function IA() {
28166
+ window.dispatchEvent(new Event(PA));
28167
+ }
28168
+ function LA(e, t) {
28163
28169
  let n = new URLSearchParams(window.location.search);
28164
28170
  t === null || t === "" ? n.delete(e) : n.set(e, t);
28165
28171
  let r = n.toString(), i = r ? `${window.location.pathname}?${r}` : window.location.pathname;
28166
28172
  window.history.replaceState(null, "", i);
28167
28173
  }
28168
- function IA(e) {
28169
- let [t, n] = a(() => PA(e));
28174
+ var RA = !1;
28175
+ function zA() {
28176
+ if (RA || typeof window > "u") return;
28177
+ RA = !0;
28178
+ let e = window.history.replaceState.bind(window.history), t = window.history.pushState.bind(window.history);
28179
+ window.history.replaceState = (...t) => {
28180
+ e(...t), IA();
28181
+ }, window.history.pushState = (...e) => {
28182
+ t(...e), IA();
28183
+ };
28184
+ }
28185
+ function BA(e) {
28186
+ zA();
28187
+ let [t, n] = a(() => FA(e));
28170
28188
  return y(() => {
28171
- let t = () => n(PA(e));
28172
- return window.addEventListener("popstate", t), () => window.removeEventListener("popstate", t);
28189
+ let t = () => n(FA(e));
28190
+ return window.addEventListener("popstate", t), window.addEventListener(PA, t), () => {
28191
+ window.removeEventListener("popstate", t), window.removeEventListener(PA, t);
28192
+ };
28173
28193
  }, [e]), [t, s((t) => {
28174
- FA(e, t), n(t);
28194
+ LA(e, t), n(t);
28175
28195
  }, [e])];
28176
28196
  }
28177
28197
  //#endregion
28178
28198
  //#region ../ui-library/src/composites/use-item-form-url.ts
28179
28199
  i();
28180
- function LA(e = {}) {
28181
- let t = e.newKey ?? "new", n = e.editKey ?? "edit", [r, i] = IA(t), [a, o] = IA(n);
28200
+ function VA(e = {}) {
28201
+ let t = e.newKey ?? "new", n = e.editKey ?? "edit", [r, i] = BA(t), [a, o] = BA(n);
28182
28202
  return {
28183
28203
  state: m(() => a !== null && a !== "" ? {
28184
28204
  mode: "edit",
@@ -28200,7 +28220,7 @@ function LA(e = {}) {
28200
28220
  i(), i(), J(P, "min-w-0 max-w-full gap-1.5 py-1 pl-1 pr-2.5 text-xs font-normal", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40"), J(ne, "font-medium"), i(), i(), i();
28201
28221
  //#endregion
28202
28222
  //#region ../ui-library/src/composites/stat-card.tsx
28203
- function RA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend: a, className: o }) {
28223
+ function HA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend: a, className: o }) {
28204
28224
  return /* @__PURE__ */ H("div", {
28205
28225
  className: J("rounded-lg border border-border bg-surface p-2 sm:p-2.5 min-w-0", o),
28206
28226
  children: [
@@ -28238,7 +28258,7 @@ function RA({ value: e, label: t, icon: n, subtext: r, valueClassName: i, trend:
28238
28258
  //#endregion
28239
28259
  //#region ../ui-library/src/composites/step-inspector/step-inspector-panel.tsx
28240
28260
  i(), i();
28241
- function zA({ dirtyCount: e, saving: t, status: n, error: r, onSave: i, onDiscard: a, scope: o }) {
28261
+ function UA({ dirtyCount: e, saving: t, status: n, error: r, onSave: i, onDiscard: a, scope: o }) {
28242
28262
  let s = e > 0, c = t ? "Saving…" : s ? `${e} unsaved change${e === 1 ? "" : "s"}` : n === "saved" ? "Saved" : n === "error" ? r ?? "Save failed" : "No unsaved changes";
28243
28263
  return /* @__PURE__ */ H("footer", {
28244
28264
  className: "shrink-0 space-y-2 border-t border-border bg-surface px-4 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] md:pb-2",
@@ -28311,16 +28331,16 @@ _(function({ title: e, subtitle: t, headerActions: n, headerExtra: r, leading: i
28311
28331
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-3",
28312
28332
  children: s
28313
28333
  }),
28314
- a !== void 0 && /* @__PURE__ */ V(zA, { ...a })
28334
+ a !== void 0 && /* @__PURE__ */ V(UA, { ...a })
28315
28335
  ]
28316
28336
  });
28317
28337
  }), i(), i(), i();
28318
28338
  //#endregion
28319
28339
  //#region ../ui-library/src/composites/device-picker/device-picker-model.ts
28320
- function BA(e, t) {
28340
+ function WA(e, t) {
28321
28341
  return typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
28322
28342
  }
28323
- function VA(e) {
28343
+ function GA(e) {
28324
28344
  return `${[
28325
28345
  e.name,
28326
28346
  e.location ?? "",
@@ -28328,29 +28348,29 @@ function VA(e) {
28328
28348
  e.detail ?? ""
28329
28349
  ].join(" ")} ${String(e.id)}`.toLowerCase();
28330
28350
  }
28331
- function HA(e) {
28351
+ function KA(e) {
28332
28352
  return e.trim().toLowerCase().split(/\s+/).filter((e) => e.length > 0);
28333
28353
  }
28334
- function UA(e, t) {
28335
- let n = HA(t);
28354
+ function qA(e, t) {
28355
+ let n = KA(t);
28336
28356
  return n.length === 0 ? e : e.filter((e) => {
28337
- let t = VA(e);
28357
+ let t = GA(e);
28338
28358
  return n.every((e) => t.includes(e));
28339
28359
  });
28340
28360
  }
28341
- function WA(e, t) {
28361
+ function JA(e, t) {
28342
28362
  return e === t ? 0 : e === null ? 1 : t === null ? -1 : e.localeCompare(t);
28343
28363
  }
28344
- function GA(e) {
28364
+ function YA(e) {
28345
28365
  return e == null || e.trim() === "" ? null : e;
28346
28366
  }
28347
- function KA(e, t) {
28367
+ function XA(e, t) {
28348
28368
  return `${e ?? ""}|${t ?? ""}`;
28349
28369
  }
28350
- function qA(e, t) {
28370
+ function ZA(e, t) {
28351
28371
  let n = new Set(t), r = /* @__PURE__ */ new Map();
28352
28372
  for (let t of e) {
28353
- let e = GA(t.type), n = GA(t.location), i = KA(e, n), a = r.get(i);
28373
+ let e = YA(t.type), n = YA(t.location), i = XA(e, n), a = r.get(i);
28354
28374
  a === void 0 ? r.set(i, {
28355
28375
  type: e,
28356
28376
  location: n,
@@ -28359,7 +28379,7 @@ function qA(e, t) {
28359
28379
  }
28360
28380
  let i = [];
28361
28381
  for (let [e, t] of r) {
28362
- let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) || BA(e.id, t.id));
28382
+ let r = [...t.devices].sort((e, t) => e.name.localeCompare(t.name) || WA(e.id, t.id));
28363
28383
  i.push({
28364
28384
  key: e,
28365
28385
  type: t.type,
@@ -28368,16 +28388,16 @@ function qA(e, t) {
28368
28388
  selectedCount: r.filter((e) => n.has(e.id)).length
28369
28389
  });
28370
28390
  }
28371
- return i.sort((e, t) => WA(e.type, t.type) || WA(e.location, t.location));
28391
+ return i.sort((e, t) => JA(e.type, t.type) || JA(e.location, t.location));
28372
28392
  }
28373
- function JA(e, t, n) {
28393
+ function QA(e, t, n) {
28374
28394
  let r = t.get(e.key);
28375
28395
  return r === void 0 ? n || e.selectedCount > 0 ? !0 : e.devices.length <= 8 : r;
28376
28396
  }
28377
- function YA(e, t, n, r) {
28397
+ function $A(e, t, n, r) {
28378
28398
  let i = new Set(t), a = [];
28379
28399
  for (let t of e) {
28380
- let e = JA(t, n, r);
28400
+ let e = QA(t, n, r);
28381
28401
  if (a.push({
28382
28402
  kind: "header",
28383
28403
  key: `h:${t.key}`,
@@ -28393,19 +28413,19 @@ function YA(e, t, n, r) {
28393
28413
  }
28394
28414
  return a;
28395
28415
  }
28396
- function XA(e, t) {
28416
+ function ej(e, t) {
28397
28417
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
28398
28418
  }
28399
- function ZA(e, t) {
28419
+ function tj(e, t) {
28400
28420
  let n = [...e], r = new Set(e);
28401
28421
  for (let e of t.devices) r.has(e.id) || n.push(e.id);
28402
28422
  return n;
28403
28423
  }
28404
- function QA(e, t) {
28424
+ function nj(e, t) {
28405
28425
  let n = new Set(t.devices.map((e) => e.id));
28406
28426
  return e.filter((e) => !n.has(e));
28407
28427
  }
28408
- function $A(e, t) {
28428
+ function rj(e, t) {
28409
28429
  return t || e.length <= 6 ? {
28410
28430
  shown: e,
28411
28431
  hidden: 0
@@ -28414,51 +28434,51 @@ function $A(e, t) {
28414
28434
  hidden: e.length - 6
28415
28435
  };
28416
28436
  }
28417
- function ej(e, t) {
28437
+ function ij(e, t) {
28418
28438
  let n = Math.max(0, Math.min(e.length, t));
28419
28439
  return {
28420
28440
  rows: e.slice(0, n),
28421
28441
  remaining: e.length - n
28422
28442
  };
28423
28443
  }
28424
- var tj = [
28444
+ var aj = [
28425
28445
  "zone",
28426
28446
  "location",
28427
28447
  "none"
28428
- ], nj = "zone";
28429
- function rj(e) {
28430
- return e === "zone" || e === "location" || e === "none" ? e : nj;
28448
+ ], oj = "zone";
28449
+ function sj(e) {
28450
+ return e === "zone" || e === "location" || e === "none" ? e : oj;
28431
28451
  }
28432
- function ij(e) {
28452
+ function cj(e) {
28433
28453
  return e.trim().toLowerCase();
28434
28454
  }
28435
- var aj = 1, oj = 2;
28436
- function sj(e, t) {
28437
- return e.name.localeCompare(t.name) || BA(e.id, t.id);
28455
+ var lj = 1, uj = 2;
28456
+ function dj(e, t) {
28457
+ return e.name.localeCompare(t.name) || WA(e.id, t.id);
28438
28458
  }
28439
- function cj(e) {
28459
+ function fj(e) {
28440
28460
  return e.kind === "zone" || e.kind === "location" ? e.label : "";
28441
28461
  }
28442
- var lj = {
28462
+ var pj = {
28443
28463
  key: "-location",
28444
28464
  heading: { kind: "no-location" },
28445
- rank: oj
28446
- }, uj = {
28465
+ rank: uj
28466
+ }, mj = {
28447
28467
  key: "-zone",
28448
28468
  heading: { kind: "no-zone" },
28449
- rank: aj
28469
+ rank: lj
28450
28470
  };
28451
- function dj(e) {
28471
+ function hj(e) {
28452
28472
  let t = /* @__PURE__ */ new Map();
28453
28473
  for (let n of e) for (let e of n.locationKeys) {
28454
- let r = ij(e);
28474
+ let r = cj(e);
28455
28475
  t.has(r) || t.set(r, n);
28456
28476
  }
28457
28477
  return t;
28458
28478
  }
28459
- function fj(e) {
28460
- return e === null ? lj : {
28461
- key: `l:${ij(e)}`,
28479
+ function gj(e) {
28480
+ return e === null ? pj : {
28481
+ key: `l:${cj(e)}`,
28462
28482
  heading: {
28463
28483
  kind: "location",
28464
28484
  label: e.trim()
@@ -28466,10 +28486,10 @@ function fj(e) {
28466
28486
  rank: 0
28467
28487
  };
28468
28488
  }
28469
- function pj(e, t) {
28470
- if (e === null) return lj;
28471
- let n = t.get(ij(e));
28472
- return n === void 0 ? uj : {
28489
+ function _j(e, t) {
28490
+ if (e === null) return pj;
28491
+ let n = t.get(cj(e));
28492
+ return n === void 0 ? mj : {
28473
28493
  key: `z:${n.zoneKey}`,
28474
28494
  heading: {
28475
28495
  kind: "zone",
@@ -28478,8 +28498,8 @@ function pj(e, t) {
28478
28498
  rank: 0
28479
28499
  };
28480
28500
  }
28481
- function mj(e, t, n, r) {
28482
- let i = new Set(t), a = [...e].sort(sj), o = (e) => e.filter((e) => i.has(e.id)).length;
28501
+ function vj(e, t, n, r) {
28502
+ let i = new Set(t), a = [...e].sort(dj), o = (e) => e.filter((e) => i.has(e.id)).length;
28483
28503
  if (n === "none") return {
28484
28504
  groupBy: n,
28485
28505
  fallback: null,
@@ -28492,9 +28512,9 @@ function mj(e, t, n, r) {
28492
28512
  selectedCount: o(a)
28493
28513
  }]
28494
28514
  };
28495
- let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ? dj(r.zones) : /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
28515
+ let s = n === "zone" && r.state !== "answered" ? r.state : null, c = s === null ? n : "location", l = r.state === "answered" ? hj(r.zones) : /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
28496
28516
  for (let e of a) {
28497
- let t = GA(e.location), n = c === "zone" ? pj(t, l) : fj(t), r = u.get(n.key);
28517
+ let t = YA(e.location), n = c === "zone" ? _j(t, l) : gj(t), r = u.get(n.key);
28498
28518
  r === void 0 ? u.set(n.key, {
28499
28519
  heading: n.heading,
28500
28520
  rank: n.rank,
@@ -28505,7 +28525,7 @@ function mj(e, t, n, r) {
28505
28525
  groupBy: c,
28506
28526
  fallback: s,
28507
28527
  flat: !1,
28508
- groups: [...u].sort(([, e], [, t]) => e.rank - t.rank || cj(e.heading).localeCompare(cj(t.heading))).map(([e, t]) => ({
28528
+ groups: [...u].sort(([, e], [, t]) => e.rank - t.rank || fj(e.heading).localeCompare(fj(t.heading))).map(([e, t]) => ({
28509
28529
  key: e,
28510
28530
  type: null,
28511
28531
  location: t.heading.kind === "location" ? t.heading.label : null,
@@ -28515,8 +28535,8 @@ function mj(e, t, n, r) {
28515
28535
  }))
28516
28536
  };
28517
28537
  }
28518
- function hj(e, t, n, r) {
28519
- if (!e.flat) return YA(e.groups, t, n, r);
28538
+ function yj(e, t, n, r) {
28539
+ if (!e.flat) return $A(e.groups, t, n, r);
28520
28540
  let i = new Set(t), a = [];
28521
28541
  for (let t of e.groups) for (let e of t.devices) a.push({
28522
28542
  kind: "device",
@@ -28527,53 +28547,53 @@ function hj(e, t, n, r) {
28527
28547
  });
28528
28548
  return a;
28529
28549
  }
28530
- function gj(e, t) {
28550
+ function bj(e, t) {
28531
28551
  return {
28532
- location: t === "location" ? null : GA(e.location),
28533
- type: GA(e.type)
28552
+ location: t === "location" ? null : YA(e.location),
28553
+ type: YA(e.type)
28534
28554
  };
28535
28555
  }
28536
- var _j = "(none)", vj = {
28556
+ var xj = "(none)", Sj = {
28537
28557
  query: "",
28538
28558
  types: [],
28539
28559
  zones: [],
28540
28560
  locations: []
28541
- }, yj = {
28542
- key: _j,
28561
+ }, Cj = {
28562
+ key: xj,
28543
28563
  label: null
28544
28564
  };
28545
- function bj(e, t, n) {
28565
+ function wj(e, t, n) {
28546
28566
  if (t === "type") {
28547
- let t = GA(e.type);
28548
- return t === null ? yj : {
28567
+ let t = YA(e.type);
28568
+ return t === null ? Cj : {
28549
28569
  key: t,
28550
28570
  label: t
28551
28571
  };
28552
28572
  }
28553
- let r = GA(e.location);
28554
- if (r === null) return yj;
28573
+ let r = YA(e.location);
28574
+ if (r === null) return Cj;
28555
28575
  if (t === "location") return {
28556
- key: ij(r),
28576
+ key: cj(r),
28557
28577
  label: r.trim()
28558
28578
  };
28559
- if (n.state !== "answered") return yj;
28560
- let i = dj(n.zones).get(ij(r));
28561
- return i === void 0 ? yj : {
28579
+ if (n.state !== "answered") return Cj;
28580
+ let i = hj(n.zones).get(cj(r));
28581
+ return i === void 0 ? Cj : {
28562
28582
  key: i.zoneKey,
28563
28583
  label: i.label
28564
28584
  };
28565
28585
  }
28566
- function xj(e, t, n) {
28567
- return bj(e, t, n).key;
28586
+ function Tj(e, t, n) {
28587
+ return wj(e, t, n).key;
28568
28588
  }
28569
- function Sj(e, t) {
28589
+ function Ej(e, t) {
28570
28590
  return e.key === "(none)" || t.key === "(none)" ? e.key === t.key ? 0 : e.key === "(none)" ? 1 : -1 : (e.label ?? "").localeCompare(t.label ?? "");
28571
28591
  }
28572
- function Cj(e, t, n, r) {
28592
+ function Dj(e, t, n, r) {
28573
28593
  if (t === "zone" && r.state !== "answered") return [];
28574
28594
  let i = /* @__PURE__ */ new Map();
28575
28595
  for (let n of e) {
28576
- let e = bj(n, t, r), a = i.get(e.key);
28596
+ let e = wj(n, t, r), a = i.get(e.key);
28577
28597
  a === void 0 ? i.set(e.key, {
28578
28598
  label: e.label,
28579
28599
  count: 1
@@ -28589,59 +28609,59 @@ function Cj(e, t, n, r) {
28589
28609
  label: t.label,
28590
28610
  count: t.count
28591
28611
  });
28592
- return a.sort(Sj);
28612
+ return a.sort(Ej);
28593
28613
  }
28594
- function wj(e, t) {
28614
+ function Oj(e, t) {
28595
28615
  return e.zones.length > 0 && t.state !== "answered";
28596
28616
  }
28597
- function Tj(e, t, n, r) {
28598
- return n.length === 0 ? e : e.filter((e) => n.includes(xj(e, t, r)));
28617
+ function kj(e, t, n, r) {
28618
+ return n.length === 0 ? e : e.filter((e) => n.includes(Tj(e, t, r)));
28599
28619
  }
28600
- function Ej(e, t, n) {
28601
- let r = Tj(UA(e, t.query), "type", t.types, n);
28602
- return Tj(n.state === "answered" ? Tj(r, "zone", t.zones, n) : r, "location", t.locations, n);
28620
+ function Aj(e, t, n) {
28621
+ let r = kj(qA(e, t.query), "type", t.types, n);
28622
+ return kj(n.state === "answered" ? kj(r, "zone", t.zones, n) : r, "location", t.locations, n);
28603
28623
  }
28604
- function Dj(e, t) {
28624
+ function jj(e, t) {
28605
28625
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
28606
28626
  }
28607
- function Oj(e) {
28627
+ function Mj(e) {
28608
28628
  return e.query.trim() !== "" || e.types.length > 0 || e.zones.length > 0 || e.locations.length > 0;
28609
28629
  }
28610
- function kj() {
28611
- return vj;
28630
+ function Nj() {
28631
+ return Sj;
28612
28632
  }
28613
- function Aj(e, t, n) {
28633
+ function Pj(e, t, n) {
28614
28634
  let r = new Set(t.map((e) => e.id)), i = new Set(n.map((e) => e.id));
28615
28635
  return e.filter((e) => r.has(e) && !i.has(e)).length;
28616
28636
  }
28617
- function jj(e, t) {
28637
+ function Fj(e, t) {
28618
28638
  return e.length >= 2 || t.length > 0;
28619
28639
  }
28620
28640
  //#endregion
28621
28641
  //#region ../ui-library/src/composites/device-picker/device-filter-bar.tsx
28622
28642
  i();
28623
- function Mj(e) {
28643
+ function Ij(e) {
28624
28644
  if (e === null) return "No type";
28625
28645
  let t = e.replaceAll("-", " ");
28626
28646
  return t.charAt(0).toUpperCase() + t.slice(1);
28627
28647
  }
28628
- var Nj = {
28648
+ var Lj = {
28629
28649
  zone: "Zone",
28630
28650
  location: "Location",
28631
28651
  none: "None"
28632
- }, Pj = {
28652
+ }, Rj = {
28633
28653
  type: "Type",
28634
28654
  zone: "Zone",
28635
28655
  location: "Location"
28636
- }, Fj = {
28656
+ }, zj = {
28637
28657
  type: "No type",
28638
28658
  zone: "No zone",
28639
28659
  location: "No location"
28640
28660
  };
28641
- function Ij(e, t) {
28642
- return t.key === "(none)" || t.label === null ? Fj[e] : e === "type" ? Mj(t.label) : t.label;
28661
+ function Bj(e, t) {
28662
+ return t.key === "(none)" || t.label === null ? zj[e] : e === "type" ? Ij(t.label) : t.label;
28643
28663
  }
28644
- function Lj({ grouping: e }) {
28664
+ function Vj({ grouping: e }) {
28645
28665
  return /* @__PURE__ */ H("div", {
28646
28666
  className: "mb-1.5",
28647
28667
  children: [/* @__PURE__ */ H("div", {
@@ -28651,7 +28671,7 @@ function Lj({ grouping: e }) {
28651
28671
  children: [/* @__PURE__ */ V("span", {
28652
28672
  className: "mr-1 font-semibold uppercase tracking-wide",
28653
28673
  children: "Group by"
28654
- }), tj.map((t) => {
28674
+ }), aj.map((t) => {
28655
28675
  let n = t === e.groupBy;
28656
28676
  return /* @__PURE__ */ V("button", {
28657
28677
  type: "button",
@@ -28659,7 +28679,7 @@ function Lj({ grouping: e }) {
28659
28679
  "aria-checked": n,
28660
28680
  onClick: () => e.onGroupByChange(t),
28661
28681
  className: n ? "rounded-md border border-primary bg-primary/10 px-1.5 py-0.5 text-[11px] text-primary" : "rounded-md border border-border px-1.5 py-0.5 text-[11px] text-foreground-subtle hover:bg-surface-hover",
28662
- children: Nj[t]
28682
+ children: Lj[t]
28663
28683
  }, t);
28664
28684
  })]
28665
28685
  }), e.fallback !== null && /* @__PURE__ */ V("p", {
@@ -28669,8 +28689,8 @@ function Lj({ grouping: e }) {
28669
28689
  })]
28670
28690
  });
28671
28691
  }
28672
- function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disabled: a }) {
28673
- let o = Pj[e], s = i === void 0 ? n.length === 0 ? "All" : `${String(n.length)} selected` : i;
28692
+ function Hj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disabled: a }) {
28693
+ let o = Rj[e], s = i === void 0 ? n.length === 0 ? "All" : `${String(n.length)} selected` : i;
28674
28694
  return /* @__PURE__ */ V("div", {
28675
28695
  "data-testid": `picker-filter-${e}`,
28676
28696
  children: /* @__PURE__ */ H(gg, { children: [/* @__PURE__ */ H(_g, {
@@ -28684,13 +28704,13 @@ function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
28684
28704
  }), /* @__PURE__ */ V(vg, {
28685
28705
  className: "min-w-[200px] max-h-[40vh] overflow-y-auto p-1",
28686
28706
  children: t.map((t) => {
28687
- let i = Ij(e, t);
28707
+ let i = Bj(e, t);
28688
28708
  return /* @__PURE__ */ H("label", {
28689
28709
  className: "flex cursor-pointer items-center gap-2 px-2 py-1 text-xs text-foreground hover:bg-surface-hover",
28690
28710
  children: [
28691
28711
  /* @__PURE__ */ V(ag, {
28692
28712
  checked: n.includes(t.key),
28693
- onChange: () => r(Dj(n, t.key)),
28713
+ onChange: () => r(jj(n, t.key)),
28694
28714
  "aria-label": i
28695
28715
  }),
28696
28716
  /* @__PURE__ */ V("span", {
@@ -28711,11 +28731,11 @@ function Rj({ facet: e, options: t, chosen: n, onChange: r, unavailable: i, disa
28711
28731
  })] })
28712
28732
  });
28713
28733
  }
28714
- function zj(e) {
28734
+ function Uj(e) {
28715
28735
  if (e.state === "pending") return "loading zones…";
28716
28736
  if (e.state === "failed") return "zones unavailable";
28717
28737
  }
28718
- function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, locationOptions: i, zones: o, grouping: s, searchPlaceholder: c, searchLabel: l, disabled: d = !1 }) {
28738
+ function Wj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, locationOptions: i, zones: o, grouping: s, searchPlaceholder: c, searchLabel: l, disabled: d = !1 }) {
28719
28739
  let [f, p] = a(e.query), m = u({
28720
28740
  filters: e,
28721
28741
  onFiltersChange: t
@@ -28731,12 +28751,12 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28731
28751
  }), 200);
28732
28752
  return () => clearTimeout(e);
28733
28753
  }, [f]);
28734
- let h = zj(o), g = h !== void 0 || jj(r, e.zones), _ = Oj(e) || f.trim() !== "";
28754
+ let h = Uj(o), g = h !== void 0 || Fj(r, e.zones), _ = Mj(e) || f.trim() !== "";
28735
28755
  return /* @__PURE__ */ H("div", {
28736
28756
  className: "space-y-1.5",
28737
28757
  "data-testid": "device-filter-bar",
28738
28758
  children: [
28739
- s !== void 0 && /* @__PURE__ */ V(Lj, { grouping: s }),
28759
+ s !== void 0 && /* @__PURE__ */ V(Vj, { grouping: s }),
28740
28760
  /* @__PURE__ */ H("div", {
28741
28761
  className: pl,
28742
28762
  children: [/* @__PURE__ */ V(pi, { className: "h-3.5 w-3.5 shrink-0 text-foreground-subtle" }), /* @__PURE__ */ V("input", {
@@ -28751,7 +28771,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28751
28771
  /* @__PURE__ */ H("div", {
28752
28772
  className: "flex flex-wrap items-center gap-1",
28753
28773
  children: [
28754
- jj(n, e.types) && /* @__PURE__ */ V(Rj, {
28774
+ Fj(n, e.types) && /* @__PURE__ */ V(Hj, {
28755
28775
  facet: "type",
28756
28776
  options: n,
28757
28777
  chosen: e.types,
@@ -28761,7 +28781,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28761
28781
  }),
28762
28782
  disabled: d
28763
28783
  }),
28764
- g && /* @__PURE__ */ V(Rj, {
28784
+ g && /* @__PURE__ */ V(Hj, {
28765
28785
  facet: "zone",
28766
28786
  options: r,
28767
28787
  chosen: e.zones,
@@ -28772,7 +28792,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28772
28792
  ...h === void 0 ? {} : { unavailable: h },
28773
28793
  disabled: d
28774
28794
  }),
28775
- jj(i, e.locations) && /* @__PURE__ */ V(Rj, {
28795
+ Fj(i, e.locations) && /* @__PURE__ */ V(Hj, {
28776
28796
  facet: "location",
28777
28797
  options: i,
28778
28798
  chosen: e.locations,
@@ -28786,13 +28806,13 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28786
28806
  variant: "ghost",
28787
28807
  "data-testid": "picker-reset-filters",
28788
28808
  onClick: () => {
28789
- p(""), t(kj());
28809
+ p(""), t(Nj());
28790
28810
  },
28791
28811
  children: "Reset filters"
28792
28812
  })
28793
28813
  ]
28794
28814
  }),
28795
- wj(e, o) && /* @__PURE__ */ V("p", {
28815
+ Oj(e, o) && /* @__PURE__ */ V("p", {
28796
28816
  className: "text-[10px] text-foreground-subtle",
28797
28817
  "data-testid": "picker-zone-filter-paused",
28798
28818
  children: "Zone filter paused — zones not loaded"
@@ -28802,7 +28822,7 @@ function Bj({ filters: e, onFiltersChange: t, typeOptions: n, zoneOptions: r, lo
28802
28822
  }
28803
28823
  //#endregion
28804
28824
  //#region ../ui-library/src/composites/device-picker/device-parent.ts
28805
- function Vj(e) {
28825
+ function Gj(e) {
28806
28826
  let t = /* @__PURE__ */ new Map();
28807
28827
  for (let n of e) t.set(n.id, n.name);
28808
28828
  let n = /* @__PURE__ */ new Map();
@@ -28812,19 +28832,19 @@ function Vj(e) {
28812
28832
  }
28813
28833
  return n;
28814
28834
  }
28815
- function Hj(e) {
28835
+ function Kj(e) {
28816
28836
  if (!(e === void 0 || e.length === 0)) return `in ${e}`;
28817
28837
  }
28818
- function Uj(e) {
28838
+ function qj(e) {
28819
28839
  let t = e.filter((e) => typeof e.id == "number");
28820
28840
  if (t.length === 0) return e;
28821
- let n = Vj(t.map((e) => ({
28841
+ let n = Gj(t.map((e) => ({
28822
28842
  id: e.id,
28823
28843
  name: e.name,
28824
28844
  parentDeviceId: e.parentDeviceId ?? null
28825
28845
  }))), r = !1, i = e.map((e) => {
28826
28846
  if (e.detail !== void 0 || typeof e.id != "number") return e;
28827
- let t = Hj(n.get(e.id));
28847
+ let t = Kj(n.get(e.id));
28828
28848
  return t === void 0 ? e : (r = !0, {
28829
28849
  ...e,
28830
28850
  detail: t
@@ -28835,34 +28855,34 @@ function Uj(e) {
28835
28855
  //#endregion
28836
28856
  //#region ../ui-library/src/composites/device-picker/device-picker-grouping.ts
28837
28857
  i();
28838
- var Wj = "camstack.admin.device-picker.group-by", Gj = [["deviceManager", "listSiteZones"], "device-picker"], Kj = 6e4;
28839
- function qj() {
28858
+ var Jj = "camstack.admin.device-picker.group-by", Yj = [["deviceManager", "listSiteZones"], "device-picker"], Xj = 6e4;
28859
+ function Zj() {
28840
28860
  try {
28841
28861
  let e = globalThis.localStorage?.getItem("camstack.admin.device-picker.group-by") ?? null;
28842
- return e === null ? nj : rj(e);
28862
+ return e === null ? oj : sj(e);
28843
28863
  } catch {
28844
- return nj;
28864
+ return oj;
28845
28865
  }
28846
28866
  }
28847
- function Jj(e) {
28867
+ function Qj(e) {
28848
28868
  try {
28849
- globalThis.localStorage?.setItem(Wj, e);
28869
+ globalThis.localStorage?.setItem(Jj, e);
28850
28870
  } catch {}
28851
28871
  }
28852
- function Yj() {
28853
- let [e, t] = a(qj);
28872
+ function $j() {
28873
+ let [e, t] = a(Zj);
28854
28874
  return {
28855
28875
  groupBy: e,
28856
28876
  setGroupBy: (e) => {
28857
- t(e), Jj(e);
28877
+ t(e), Qj(e);
28858
28878
  }
28859
28879
  };
28860
28880
  }
28861
- function Xj(e) {
28881
+ function eM(e) {
28862
28882
  let t = ie().trpcClient, { data: n, isError: r } = ft({
28863
- queryKey: Gj,
28883
+ queryKey: Yj,
28864
28884
  enabled: e,
28865
- staleTime: Kj,
28885
+ staleTime: Xj,
28866
28886
  queryFn: () => t.deviceManager.listSiteZones.query()
28867
28887
  });
28868
28888
  return m(() => n === void 0 ? r ? { state: "failed" } : { state: "pending" } : {
@@ -28872,10 +28892,10 @@ function Xj(e) {
28872
28892
  }
28873
28893
  //#endregion
28874
28894
  //#region ../ui-library/src/composites/device-picker/device-selection.ts
28875
- function Zj(e) {
28895
+ function tM(e) {
28876
28896
  return e.data === void 0 ? e.isError ? "failed" : "pending" : "answered";
28877
28897
  }
28878
- function Qj(e, t, n) {
28898
+ function nM(e, t, n) {
28879
28899
  if (n !== "answered" || t === void 0) return e.map((e) => ({
28880
28900
  id: e,
28881
28901
  removed: !1
@@ -28893,19 +28913,19 @@ function Qj(e, t, n) {
28893
28913
  };
28894
28914
  });
28895
28915
  }
28896
- function $j(e, t, n, r) {
28916
+ function rM(e, t, n, r) {
28897
28917
  let i = new Set((t ?? []).map((e) => e.id));
28898
- return Qj(e.filter((e) => !i.has(e)), n, r);
28918
+ return nM(e.filter((e) => !i.has(e)), n, r);
28899
28919
  }
28900
- function eM(e, t, n) {
28920
+ function iM(e, t, n) {
28901
28921
  return e === "answered" && t === 0 && n === 0;
28902
28922
  }
28903
- function tM(e, t, n) {
28923
+ function aM(e, t, n) {
28904
28924
  return e && t === 0 && n;
28905
28925
  }
28906
28926
  //#endregion
28907
28927
  //#region ../ui-library/src/composites/device-picker/device-selection-rows.tsx
28908
- var nM = {
28928
+ var oM = {
28909
28929
  camera: "cameras",
28910
28930
  device: "devices",
28911
28931
  node: "nodes",
@@ -28915,7 +28935,7 @@ var nM = {
28915
28935
  face: "faces",
28916
28936
  calendar: "calendars"
28917
28937
  };
28918
- function rM(e, t = "device") {
28938
+ function sM(e, t = "device") {
28919
28939
  let n = String(e.id);
28920
28940
  switch (t) {
28921
28941
  case "node": return e.removed ? `Node ${n} — unknown to the hub` : e.name ?? `Node ${n}`;
@@ -28928,7 +28948,7 @@ function rM(e, t = "device") {
28928
28948
  case "device": return e.removed ? `Device #${n} — removed` : e.name ?? `Device #${n}`;
28929
28949
  }
28930
28950
  }
28931
- function iM({ noun: e = "camera" }) {
28951
+ function cM({ noun: e = "camera" }) {
28932
28952
  return /* @__PURE__ */ H("p", {
28933
28953
  className: "mt-1 text-[11px] text-warning",
28934
28954
  "data-testid": "devices-widen-warning",
@@ -28936,12 +28956,12 @@ function iM({ noun: e = "camera" }) {
28936
28956
  "No ",
28937
28957
  e,
28938
28958
  " selected: the rule will apply to ALL ",
28939
- nM[e],
28959
+ oM[e],
28940
28960
  "."
28941
28961
  ]
28942
28962
  });
28943
28963
  }
28944
- function aM({ noun: e = "cameras" }) {
28964
+ function lM({ noun: e = "cameras" }) {
28945
28965
  return /* @__PURE__ */ H("p", {
28946
28966
  className: "text-[11px] text-foreground-subtle",
28947
28967
  children: [
@@ -28951,7 +28971,7 @@ function aM({ noun: e = "cameras" }) {
28951
28971
  ]
28952
28972
  });
28953
28973
  }
28954
- function oM({ noun: e = "devices" }) {
28974
+ function uM({ noun: e = "devices" }) {
28955
28975
  return /* @__PURE__ */ H("p", {
28956
28976
  className: "text-[11px] text-warning",
28957
28977
  children: [
@@ -28964,7 +28984,7 @@ function oM({ noun: e = "devices" }) {
28964
28984
  //#endregion
28965
28985
  //#region ../ui-library/src/composites/device-picker/DevicePicker.tsx
28966
28986
  i();
28967
- function sM(e) {
28987
+ function dM(e) {
28968
28988
  switch (e.kind) {
28969
28989
  case "zone":
28970
28990
  case "location": return e.label;
@@ -28972,14 +28992,14 @@ function sM(e) {
28972
28992
  case "no-location": return "No location";
28973
28993
  }
28974
28994
  }
28975
- function cM(e) {
28976
- return e.heading === void 0 ? `${Mj(e.type)} · ${e.location ?? "No room"}` : sM(e.heading);
28995
+ function fM(e) {
28996
+ return e.heading === void 0 ? `${Ij(e.type)} · ${e.location ?? "No room"}` : dM(e.heading);
28977
28997
  }
28978
- function lM(e) {
28998
+ function pM(e) {
28979
28999
  return e === "camera" || e === "device";
28980
29000
  }
28981
- function uM(e, t, n, r) {
28982
- let i = new Map(t.map((e) => [e.id, e.name])), a = new Map($j(e, t, n.devices, n.state).map((e) => [e.id, e]));
29001
+ function mM(e, t, n, r) {
29002
+ let i = new Map(t.map((e) => [e.id, e.name])), a = new Map(rM(e, t, n.devices, n.state).map((e) => [e.id, e]));
28983
29003
  return e.map((e) => {
28984
29004
  let t = i.get(e);
28985
29005
  if (t !== void 0) return {
@@ -28993,34 +29013,34 @@ function uM(e, t, n, r) {
28993
29013
  };
28994
29014
  return {
28995
29015
  id: e,
28996
- label: rM(n, r),
29016
+ label: sM(n, r),
28997
29017
  removed: n.removed
28998
29018
  };
28999
29019
  });
29000
29020
  }
29001
- function dM(e, t) {
29002
- let n = nM[e];
29021
+ function hM(e, t) {
29022
+ let n = oM[e];
29003
29023
  return t ? e === "camera" || e === "device" ? "No cameras available — the rule applies to all devices." : `No ${n} available — the rule applies to every ${e}.` : `No ${n} available.`;
29004
29024
  }
29005
- function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMeansAll: o = !1, savedHadDevices: s = !1, noun: c = "camera", groupTitle: l = cM, emptyLabel: u, annotate: d, disabled: f = !1, testId: p, showAll: h = !1 }) {
29006
- let g = m(() => Uj(e), [e]), _ = n ?? {
29025
+ function gM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMeansAll: o = !1, savedHadDevices: s = !1, noun: c = "camera", groupTitle: l = fM, emptyLabel: u, annotate: d, disabled: f = !1, testId: p, showAll: h = !1 }) {
29026
+ let g = m(() => qj(e), [e]), _ = n ?? {
29007
29027
  state: t,
29008
29028
  devices: t === "answered" ? g : void 0
29009
29029
  }, [v, y] = a(!1), [b, x] = a(!1), [S, C] = a(s || r.length > 0);
29010
29030
  r.length > 0 && !S && C(!0);
29011
- let w = uM(r, g, _, c), T = $A(w, b || h), E = v || h, D = tM(o, r.length, S), O = nM[c];
29012
- return t === "answered" && eM(t, g.length, r.length) ? /* @__PURE__ */ H("div", {
29031
+ let w = mM(r, g, _, c), T = rj(w, b || h), E = v || h, D = aM(o, r.length, S), O = oM[c];
29032
+ return t === "answered" && iM(t, g.length, r.length) ? /* @__PURE__ */ H("div", {
29013
29033
  "data-testid": p,
29014
29034
  children: [/* @__PURE__ */ V("p", {
29015
29035
  className: "text-[10px] text-foreground-subtle mt-0.5",
29016
- children: dM(c, o)
29017
- }), D && /* @__PURE__ */ V(iM, { noun: c })]
29036
+ children: hM(c, o)
29037
+ }), D && /* @__PURE__ */ V(cM, { noun: c })]
29018
29038
  }) : /* @__PURE__ */ H("div", {
29019
29039
  className: "mt-1 space-y-1.5",
29020
29040
  "data-testid": p,
29021
29041
  children: [
29022
- t === "pending" && /* @__PURE__ */ V(aM, { noun: O }),
29023
- t === "failed" && /* @__PURE__ */ V(oM, { noun: c === "camera" ? "devices" : O }),
29042
+ t === "pending" && /* @__PURE__ */ V(lM, { noun: O }),
29043
+ t === "failed" && /* @__PURE__ */ V(uM, { noun: c === "camera" ? "devices" : O }),
29024
29044
  /* @__PURE__ */ H("div", {
29025
29045
  className: "flex flex-wrap items-center gap-1",
29026
29046
  children: [
@@ -29059,7 +29079,7 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29059
29079
  })
29060
29080
  ]
29061
29081
  }),
29062
- E && t === "answered" && (lM(c) ? /* @__PURE__ */ V(pM, {
29082
+ E && t === "answered" && (pM(c) ? /* @__PURE__ */ V(_M, {
29063
29083
  devices: g,
29064
29084
  value: r,
29065
29085
  onChange: i,
@@ -29068,7 +29088,7 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29068
29088
  noun: c,
29069
29089
  disabled: f,
29070
29090
  showAll: h
29071
- }) : /* @__PURE__ */ V(gM, {
29091
+ }) : /* @__PURE__ */ V(bM, {
29072
29092
  devices: g,
29073
29093
  value: r,
29074
29094
  onChange: i,
@@ -29078,13 +29098,13 @@ function fM({ devices: e, listState: t, fleet: n, value: r, onChange: i, emptyMe
29078
29098
  disabled: f,
29079
29099
  showAll: h
29080
29100
  })),
29081
- D && /* @__PURE__ */ V(iM, { noun: c })
29101
+ D && /* @__PURE__ */ V(cM, { noun: c })
29082
29102
  ]
29083
29103
  });
29084
29104
  }
29085
- function pM(e) {
29086
- let { groupBy: t, setGroupBy: n } = Yj(), r = Xj(!0);
29087
- return /* @__PURE__ */ V(gM, {
29105
+ function _M(e) {
29106
+ let { groupBy: t, setGroupBy: n } = $j(), r = eM(!0);
29107
+ return /* @__PURE__ */ V(bM, {
29088
29108
  ...e,
29089
29109
  grouping: {
29090
29110
  groupBy: t,
@@ -29093,52 +29113,52 @@ function pM(e) {
29093
29113
  }
29094
29114
  });
29095
29115
  }
29096
- function mM(e) {
29116
+ function vM(e) {
29097
29117
  return e === "camera" || e === "device" ? "Search by name, room or type…" : e === "class" ? "Search by class or category…" : e === "zone" ? "Search by camera or zone…" : "Search by name or id…";
29098
29118
  }
29099
- var hM = {
29119
+ var yM = {
29100
29120
  state: "answered",
29101
29121
  zones: []
29102
29122
  };
29103
- function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, noun: o, disabled: s, showAll: c, grouping: l }) {
29104
- let [u, d] = a(vj), [f, p] = a(/* @__PURE__ */ new Map()), [h, g] = a(60), _ = c || HA(u.query).length > 0, v = l?.groupBy, y = l?.zones ?? hM, b = m(() => Ej(e, u, y), [
29123
+ function bM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, noun: o, disabled: s, showAll: c, grouping: l }) {
29124
+ let [u, d] = a(Sj), [f, p] = a(/* @__PURE__ */ new Map()), [h, g] = a(60), _ = c || KA(u.query).length > 0, v = l?.groupBy, y = l?.zones ?? yM, b = m(() => Aj(e, u, y), [
29105
29125
  e,
29106
29126
  u,
29107
29127
  y
29108
- ]), x = m(() => v === void 0 ? null : mj(b, t, v, y), [
29128
+ ]), x = m(() => v === void 0 ? null : vj(b, t, v, y), [
29109
29129
  b,
29110
29130
  t,
29111
29131
  v,
29112
29132
  y
29113
- ]), S = m(() => x === null ? YA(qA(b, t), t, f, _) : hj(x, t, f, _), [
29133
+ ]), S = m(() => x === null ? $A(ZA(b, t), t, f, _) : yj(x, t, f, _), [
29114
29134
  x,
29115
29135
  b,
29116
29136
  t,
29117
29137
  f,
29118
29138
  _
29119
- ]), C = x?.groupBy ?? null, w = m(() => Cj(e, "type", u.types, y), [
29139
+ ]), C = x?.groupBy ?? null, w = m(() => Dj(e, "type", u.types, y), [
29120
29140
  e,
29121
29141
  u.types,
29122
29142
  y
29123
- ]), T = m(() => Cj(e, "zone", u.zones, y), [
29143
+ ]), T = m(() => Dj(e, "zone", u.zones, y), [
29124
29144
  e,
29125
29145
  u.zones,
29126
29146
  y
29127
- ]), E = m(() => l === void 0 ? [] : Cj(e, "location", u.locations, y), [
29147
+ ]), E = m(() => l === void 0 ? [] : Dj(e, "location", u.locations, y), [
29128
29148
  e,
29129
29149
  u.locations,
29130
29150
  y,
29131
29151
  l
29132
- ]), D = m(() => Aj(t, e, b), [
29152
+ ]), D = m(() => Pj(t, e, b), [
29133
29153
  e,
29134
29154
  t,
29135
29155
  b
29136
- ]), O = ej(S, c ? S.length : h), k = (e, t) => p((n) => new Map([...n, [e.key, !t]]));
29156
+ ]), O = ij(S, c ? S.length : h), k = (e, t) => p((n) => new Map([...n, [e.key, !t]]));
29137
29157
  return /* @__PURE__ */ H("div", {
29138
29158
  className: "rounded-md border border-border bg-surface p-2",
29139
29159
  "data-testid": "device-picker-panel",
29140
29160
  children: [
29141
- /* @__PURE__ */ V(Bj, {
29161
+ /* @__PURE__ */ V(Wj, {
29142
29162
  filters: u,
29143
29163
  onFiltersChange: (e) => {
29144
29164
  d(e), g(60);
@@ -29152,8 +29172,8 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29152
29172
  onGroupByChange: l.onGroupByChange,
29153
29173
  fallback: x?.fallback ?? null
29154
29174
  } },
29155
- searchPlaceholder: mM(o),
29156
- searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${nM[o]}`,
29175
+ searchPlaceholder: vM(o),
29176
+ searchLabel: o === "camera" || o === "device" ? "Search devices" : `Search ${oM[o]}`,
29157
29177
  disabled: s
29158
29178
  }),
29159
29179
  /* @__PURE__ */ H("p", {
@@ -29173,7 +29193,7 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29173
29193
  }) : /* @__PURE__ */ H("div", {
29174
29194
  className: c ? "mt-1" : "mt-1 max-h-72 overflow-y-auto",
29175
29195
  "data-testid": "device-picker-rows",
29176
- children: [O.rows.map((e) => /* @__PURE__ */ V(vM, {
29196
+ children: [O.rows.map((e) => /* @__PURE__ */ V(SM, {
29177
29197
  row: e,
29178
29198
  value: t,
29179
29199
  onChange: n,
@@ -29203,16 +29223,16 @@ function gM({ devices: e, value: t, onChange: n, annotate: r, groupTitle: i, nou
29203
29223
  ]
29204
29224
  });
29205
29225
  }
29206
- function _M(e, t) {
29226
+ function xM(e, t) {
29207
29227
  if (t === null) return e.detail;
29208
- let n = gj(e, t), r = [
29228
+ let n = bj(e, t), r = [
29209
29229
  n.location,
29210
- n.type === null ? null : Mj(n.type),
29230
+ n.type === null ? null : Ij(n.type),
29211
29231
  e.detail ?? null
29212
29232
  ].filter((e) => e !== null);
29213
29233
  return r.length > 0 ? r.join(" · ") : void 0;
29214
29234
  }
29215
- function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, groupTitle: a, groupBy: o, disabled: s }) {
29235
+ function SM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, groupTitle: a, groupBy: o, disabled: s }) {
29216
29236
  if (e.kind === "header") {
29217
29237
  let { group: i, expanded: o } = e;
29218
29238
  return /* @__PURE__ */ H("div", {
@@ -29246,20 +29266,20 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29246
29266
  type: "button",
29247
29267
  disabled: s,
29248
29268
  className: "text-[10px] text-primary hover:underline disabled:opacity-50",
29249
- onClick: () => n(ZA(t, i)),
29269
+ onClick: () => n(tj(t, i)),
29250
29270
  children: "All"
29251
29271
  }),
29252
29272
  /* @__PURE__ */ V("button", {
29253
29273
  type: "button",
29254
29274
  disabled: s,
29255
29275
  className: "text-[10px] text-foreground-subtle hover:underline disabled:opacity-50",
29256
- onClick: () => n(QA(t, i)),
29276
+ onClick: () => n(nj(t, i)),
29257
29277
  children: "Clear"
29258
29278
  })
29259
29279
  ]
29260
29280
  });
29261
29281
  }
29262
- let c = i?.(e.device.id), l = _M(e.device, o);
29282
+ let c = i?.(e.device.id), l = xM(e.device, o);
29263
29283
  return /* @__PURE__ */ H("label", {
29264
29284
  className: "flex cursor-pointer items-center gap-2.5 px-3 py-1 text-xs text-foreground hover:bg-surface-hover",
29265
29285
  "data-testid": "device-picker-row",
@@ -29267,7 +29287,7 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29267
29287
  type: "checkbox",
29268
29288
  checked: e.selected,
29269
29289
  disabled: s,
29270
- onChange: () => n(XA(t, e.device.id)),
29290
+ onChange: () => n(ej(t, e.device.id)),
29271
29291
  className: "accent-primary",
29272
29292
  "data-device-id": String(e.device.id)
29273
29293
  }), /* @__PURE__ */ H("span", {
@@ -29292,21 +29312,21 @@ function vM({ row: e, value: t, onChange: n, onToggleGroup: r, annotate: i, grou
29292
29312
  i(), i(), L("camstack:zone-editing", null), i(), i(), i(), i(), i(), f(() => import("./MaskShapeCanvas-Kfg9dl6B.mjs").then((e) => ({ default: e.MaskShapeCanvas }))), f(() => import("./MotionZonesSettings-DflIL9ss.mjs").then((e) => ({ default: e.MotionZonesSettings }))), f(() => import("./SceneMonitorEditor-DnQJ7Hx3.mjs").then((e) => ({ default: e.SceneMonitorEditor }))), f(() => import("./PrivacyMaskSettings-Bo1S23wt.mjs").then((e) => ({ default: e.PrivacyMaskSettings })));
29293
29313
  //#endregion
29294
29314
  //#region src/page/frames/lib/retrain-assist-defaults.ts
29295
- var yM = "object-detection";
29296
- function bM(e, t) {
29315
+ var CM = "object-detection";
29316
+ function wM(e, t) {
29297
29317
  for (let n of e) {
29298
29318
  if (n.addonId === t) return n;
29299
- let e = n.children === void 0 ? void 0 : bM(n.children, t);
29319
+ let e = n.children === void 0 ? void 0 : wM(n.children, t);
29300
29320
  if (e !== void 0) return e;
29301
29321
  }
29302
29322
  }
29303
- function xM(e, t) {
29323
+ function TM(e, t) {
29304
29324
  for (let n of e.slots) {
29305
29325
  let e = n.addons.find((e) => e.id === t);
29306
29326
  if (e !== void 0) return e;
29307
29327
  }
29308
29328
  }
29309
- function SM(e) {
29329
+ function EM(e) {
29310
29330
  let { status: t, nodeDevices: n, schema: r, resolvedSteps: i } = e;
29311
29331
  if (t === void 0) return {
29312
29332
  kind: "unknown",
@@ -29330,7 +29350,7 @@ function SM(e) {
29330
29350
  kind: "unknown",
29331
29351
  gap: "device-unknown"
29332
29352
  };
29333
- let s = xM(r, yM);
29353
+ let s = TM(r, CM);
29334
29354
  if (s === void 0) return {
29335
29355
  kind: "unknown",
29336
29356
  gap: "step-unknown"
@@ -29338,8 +29358,8 @@ function SM(e) {
29338
29358
  let c = tg({
29339
29359
  catalog: s,
29340
29360
  device: o,
29341
- override: bM(i, yM)?.modelId,
29342
- base: o.steps?.[yM]?.modelId
29361
+ override: wM(i, CM)?.modelId,
29362
+ base: o.steps?.[CM]?.modelId
29343
29363
  });
29344
29364
  return c === void 0 ? {
29345
29365
  kind: "unknown",
@@ -29351,11 +29371,11 @@ function SM(e) {
29351
29371
  minScore: s.models.find((e) => e.id === c)?.defaultConfidence ?? s.defaultConfidence
29352
29372
  };
29353
29373
  }
29354
- function CM(e, t) {
29374
+ function DM(e, t) {
29355
29375
  let n = Math.max(0, Math.min(e.x + e.w, t.x + t.w) - Math.max(e.x, t.x)) * Math.max(0, Math.min(e.y + e.h, t.y + t.h) - Math.max(e.y, t.y)), r = e.w * e.h + t.w * t.h - n;
29356
29376
  return r > 0 ? n / r : 0;
29357
29377
  }
29358
- function wM(e, t) {
29378
+ function OM(e, t) {
29359
29379
  let n = e.nextKey;
29360
29380
  return {
29361
29381
  boxes: t.map((e) => {
@@ -29368,7 +29388,7 @@ function wM(e, t) {
29368
29388
  nextKey: n
29369
29389
  };
29370
29390
  }
29371
- function TM(e) {
29391
+ function kM(e) {
29372
29392
  return {
29373
29393
  bbox: e.bbox,
29374
29394
  macroClass: e.macroClass,
@@ -29381,7 +29401,7 @@ function TM(e) {
29381
29401
  draft: !1
29382
29402
  };
29383
29403
  }
29384
- function EM(e) {
29404
+ function AM(e) {
29385
29405
  return e.map((e) => ({
29386
29406
  bbox: e.bbox,
29387
29407
  macroClass: e.macroClass,
@@ -29395,23 +29415,23 @@ function EM(e) {
29395
29415
  note: e.basis === "subject-box" ? "The box the pipeline recorded on this very frame." : `The pipeline's track position ${String(Math.round(e.deltaMs))} ms from this frame.`
29396
29416
  }));
29397
29417
  }
29398
- var DM = {
29418
+ var jM = {
29399
29419
  boxes: [],
29400
29420
  selectedKey: null,
29401
29421
  nextKey: 0
29402
29422
  };
29403
- function OM(e, t) {
29404
- let n = wM(DM, e.map(TM));
29405
- return kM({
29423
+ function MM(e, t) {
29424
+ let n = OM(jM, e.map(kM));
29425
+ return NM({
29406
29426
  boxes: n.boxes,
29407
29427
  selectedKey: null,
29408
29428
  nextKey: n.nextKey
29409
- }, EM(t)).state;
29429
+ }, AM(t)).state;
29410
29430
  }
29411
- function kM(e, t) {
29431
+ function NM(e, t) {
29412
29432
  let n = [], r = 0;
29413
29433
  for (let i of t) {
29414
- if ([...e.boxes, ...n].some((e) => CM(e.bbox, i.bbox) >= .8)) {
29434
+ if ([...e.boxes, ...n].some((e) => DM(e.bbox, i.bbox) >= .8)) {
29415
29435
  r += 1;
29416
29436
  continue;
29417
29437
  }
@@ -29420,7 +29440,7 @@ function kM(e, t) {
29420
29440
  draft: !0
29421
29441
  });
29422
29442
  }
29423
- let i = wM(e, n);
29443
+ let i = OM(e, n);
29424
29444
  return {
29425
29445
  state: {
29426
29446
  ...e,
@@ -29430,8 +29450,8 @@ function kM(e, t) {
29430
29450
  skipped: r
29431
29451
  };
29432
29452
  }
29433
- function AM(e, t, n) {
29434
- let r = wM(e, [{
29453
+ function PM(e, t, n) {
29454
+ let r = OM(e, [{
29435
29455
  bbox: t,
29436
29456
  macroClass: n,
29437
29457
  kind: "subject",
@@ -29444,26 +29464,26 @@ function AM(e, t, n) {
29444
29464
  nextKey: r.nextKey
29445
29465
  };
29446
29466
  }
29447
- function jM(e, t, n) {
29467
+ function FM(e, t, n) {
29448
29468
  return {
29449
29469
  ...e,
29450
29470
  boxes: e.boxes.map((e) => e.key === t ? n(e) : e)
29451
29471
  };
29452
29472
  }
29453
- function MM(e, t, n) {
29454
- return jM(e, t, (e) => ({
29473
+ function IM(e, t, n) {
29474
+ return FM(e, t, (e) => ({
29455
29475
  ...e,
29456
29476
  ...n,
29457
29477
  draft: !1
29458
29478
  }));
29459
29479
  }
29460
- function NM(e, t) {
29461
- return jM(e, t, (e) => ({
29480
+ function LM(e, t) {
29481
+ return FM(e, t, (e) => ({
29462
29482
  ...e,
29463
29483
  draft: !1
29464
29484
  }));
29465
29485
  }
29466
- function PM(e) {
29486
+ function RM(e) {
29467
29487
  return {
29468
29488
  ...e,
29469
29489
  boxes: e.boxes.map((e) => e.draft ? {
@@ -29472,27 +29492,27 @@ function PM(e) {
29472
29492
  } : e)
29473
29493
  };
29474
29494
  }
29475
- function FM(e, t) {
29476
- return jM(e, t, (e) => ({
29495
+ function zM(e, t) {
29496
+ return FM(e, t, (e) => ({
29477
29497
  ...e,
29478
29498
  kind: e.kind === "model_error" ? "subject" : "model_error",
29479
29499
  draft: !1
29480
29500
  }));
29481
29501
  }
29482
- function IM(e, t) {
29502
+ function BM(e, t) {
29483
29503
  return {
29484
29504
  ...e,
29485
29505
  boxes: e.boxes.filter((e) => e.key !== t),
29486
29506
  selectedKey: e.selectedKey === t ? null : e.selectedKey
29487
29507
  };
29488
29508
  }
29489
- function LM(e, t) {
29509
+ function VM(e, t) {
29490
29510
  return {
29491
29511
  ...e,
29492
29512
  selectedKey: t
29493
29513
  };
29494
29514
  }
29495
- function RM(e, t) {
29515
+ function HM(e, t) {
29496
29516
  return {
29497
29517
  ...e,
29498
29518
  boxes: e.boxes.map((e) => {
@@ -29504,7 +29524,7 @@ function RM(e, t) {
29504
29524
  })
29505
29525
  };
29506
29526
  }
29507
- function zM(e, t) {
29527
+ function UM(e, t) {
29508
29528
  return new Map(e.map((e) => [e.ref, {
29509
29529
  verdict: e.verdict,
29510
29530
  reason: e.reason,
@@ -29512,16 +29532,16 @@ function zM(e, t) {
29512
29532
  ...e.suggestedClass === void 0 ? {} : { suggestedClass: e.suggestedClass }
29513
29533
  }]));
29514
29534
  }
29515
- function BM(e) {
29535
+ function WM(e) {
29516
29536
  return e.boxes.filter((e) => e.draft).length;
29517
29537
  }
29518
- function VM(e) {
29538
+ function GM(e) {
29519
29539
  let t = e?.trim();
29520
29540
  return t === void 0 || t === "" ? void 0 : t;
29521
29541
  }
29522
- function HM(e) {
29542
+ function KM(e) {
29523
29543
  return e.boxes.filter((e) => !e.draft).map((e) => {
29524
- let t = VM(e.label), n = VM(e.subLabel);
29544
+ let t = GM(e.label), n = GM(e.subLabel);
29525
29545
  return {
29526
29546
  bbox: e.bbox,
29527
29547
  macroClass: e.macroClass,
@@ -29536,29 +29556,29 @@ function HM(e) {
29536
29556
  }
29537
29557
  //#endregion
29538
29558
  //#region src/page/frames/RetrainAnnotationEditor.tsx
29539
- var UM = [
29559
+ var qM = [
29540
29560
  "person",
29541
29561
  "vehicle",
29542
29562
  "animal",
29543
29563
  "package",
29544
29564
  "face",
29545
29565
  "plate"
29546
- ], WM = new Set(UM), GM = {
29566
+ ], JM = new Set(qM), YM = {
29547
29567
  operator: "drawn",
29548
29568
  pipeline: "pipeline",
29549
29569
  assist: "detector",
29550
29570
  llm: "AI vision"
29551
29571
  };
29552
- function KM(e) {
29572
+ function XM(e) {
29553
29573
  let t = e?.trim().toLowerCase();
29554
- return t === void 0 || t === "" ? null : WM.has(t) ? `"${t}" is a macro class, not a label — person / postman / Marco are three different tiers` : null;
29574
+ return t === void 0 || t === "" ? null : JM.has(t) ? `"${t}" is a macro class, not a label — person / postman / Marco are three different tiers` : null;
29555
29575
  }
29556
- function qM(e) {
29576
+ function ZM(e) {
29557
29577
  if (e.source === "operator") return null;
29558
- let t = [GM[e.source]];
29578
+ let t = [YM[e.source]];
29559
29579
  return e.assistModelId !== void 0 && t.push(e.assistModelId), e.assistScore !== void 0 && t.push(e.assistScore.toFixed(2)), t.join(" · ");
29560
29580
  }
29561
- function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, onToggleModelError: a, onDelete: o }) {
29581
+ function QM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, onToggleModelError: a, onDelete: o }) {
29562
29582
  return e.length === 0 ? /* @__PURE__ */ H("p", {
29563
29583
  className: "text-[11px] text-foreground-subtle p-3",
29564
29584
  children: [
@@ -29570,7 +29590,7 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29570
29590
  }) : /* @__PURE__ */ V("ul", {
29571
29591
  className: "divide-y divide-border",
29572
29592
  children: e.map((e) => {
29573
- let s = e.key === t, c = KM(e.label), l = KM(e.subLabel), u = qM(e);
29593
+ let s = e.key === t, c = XM(e.label), l = XM(e.subLabel), u = ZM(e);
29574
29594
  return /* @__PURE__ */ H("li", {
29575
29595
  "data-testid": `retrain-row-${e.key}`,
29576
29596
  className: `p-2.5 space-y-1.5 ${s ? "bg-surface-hover" : ""}`,
@@ -29588,12 +29608,12 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29588
29608
  className: "w-28",
29589
29609
  "aria-label": "Class",
29590
29610
  value: e.macroClass,
29591
- options: UM.map((e) => ({
29611
+ options: qM.map((e) => ({
29592
29612
  value: e,
29593
29613
  label: e
29594
29614
  })),
29595
29615
  onChange: (t) => {
29596
- let n = UM.find((e) => e === t.target.value);
29616
+ let n = qM.find((e) => e === t.target.value);
29597
29617
  n !== void 0 && r(e.key, { macroClass: n });
29598
29618
  }
29599
29619
  }),
@@ -29685,15 +29705,15 @@ function JM({ boxes: e, selectedKey: t, onSelect: n, onChange: r, onAccept: i, o
29685
29705
  })
29686
29706
  });
29687
29707
  }
29688
- function YM(e) {
29689
- return e.filter((e) => !e.draft).every((e) => KM(e.label) === null && KM(e.subLabel) === null && WM.has(e.macroClass));
29708
+ function $M(e) {
29709
+ return e.filter((e) => !e.draft).every((e) => XM(e.label) === null && XM(e.subLabel) === null && JM.has(e.macroClass));
29690
29710
  }
29691
29711
  //#endregion
29692
29712
  //#region src/page/frames/lib/retrain-teacher.ts
29693
- var XM = .25;
29694
- function ZM(e, t) {
29713
+ var eN = .25;
29714
+ function tN(e, t) {
29695
29715
  if (e === void 0) return [];
29696
- let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id === yM);
29716
+ let n = e.selectedEngine.format, r = e.slots.flatMap((e) => e.addons).find((e) => e.id === CM);
29697
29717
  if (r === void 0) return [];
29698
29718
  let i = r.models.filter((e) => e.legacy !== !0 && e.provider === void 0).flatMap((e) => {
29699
29719
  let t = e.formats[n];
@@ -29707,7 +29727,7 @@ function ZM(e, t) {
29707
29727
  }
29708
29728
  //#endregion
29709
29729
  //#region src/page/frames/frame-address.ts
29710
- function QM(e) {
29730
+ function nN(e) {
29711
29731
  return {
29712
29732
  deviceId: e.deviceId,
29713
29733
  ...e.trackId === void 0 ? {} : { trackId: e.trackId },
@@ -29717,7 +29737,7 @@ function QM(e) {
29717
29737
  //#endregion
29718
29738
  //#region src/page/frames/RetrainAssistPanel.tsx
29719
29739
  i();
29720
- var $M = [
29740
+ var rN = [
29721
29741
  {
29722
29742
  value: "teacher",
29723
29743
  label: "Bigger detector"
@@ -29730,19 +29750,19 @@ var $M = [
29730
29750
  value: "both",
29731
29751
  label: "Both"
29732
29752
  }
29733
- ], eN = [
29753
+ ], iN = [
29734
29754
  "person",
29735
29755
  "vehicle",
29736
29756
  "animal",
29737
29757
  "package"
29738
- ], tN = [
29758
+ ], aN = [
29739
29759
  "person",
29740
29760
  "vehicle",
29741
29761
  "animal",
29742
29762
  "package",
29743
29763
  "face",
29744
29764
  "plate"
29745
- ], nN = {
29765
+ ], oN = {
29746
29766
  "unknown-frame": "The frame is no longer in the dataset.",
29747
29767
  "unreadable-frame": "The frame copy could not be read.",
29748
29768
  "unknown-profile": "That AI profile no longer exists.",
@@ -29752,13 +29772,13 @@ var $M = [
29752
29772
  "llm-error": "The AI model call failed.",
29753
29773
  "malformed-answer": "The AI answered in a shape that cannot be trusted, so nothing was drawn."
29754
29774
  };
29755
- function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29756
- let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() => ZM(r, n.kind === "resolved" ? n.modelId : void 0), [r, n]), [p, h] = a(null), g = f.find((e) => e.modelId === p) ?? f[0], [_, v] = a(XM), [y, b] = a(null), x = (o.data ?? []).find((e) => e.id === y) ?? o.data?.[0], [S, C] = a(eN), [w, T] = a(!1), [E, D] = a(!1), O = u(t.editor);
29775
+ function sN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29776
+ let o = sc({}, { retry: !1 }), s = nc(), c = cc(), [l, d] = a("teacher"), f = m(() => tN(r, n.kind === "resolved" ? n.modelId : void 0), [r, n]), [p, h] = a(null), g = f.find((e) => e.modelId === p) ?? f[0], [_, v] = a(eN), [y, b] = a(null), x = (o.data ?? []).find((e) => e.id === y) ?? o.data?.[0], [S, C] = a(iN), [w, T] = a(!1), [E, D] = a(!1), O = u(t.editor);
29757
29777
  O.current = t.editor;
29758
29778
  let k = l !== "llm", A = l !== "teacher", j = n.kind === "resolved" && g !== void 0, M = x !== void 0 && S.length > 0, N = (!k || j) && (!A || M), P = async () => {
29759
29779
  if (n.kind !== "resolved" || g === void 0) return "";
29760
29780
  let r = await s.mutateAsync({
29761
- ...QM(e),
29781
+ ...nN(e),
29762
29782
  subject: {
29763
29783
  kind: "objects",
29764
29784
  modelId: g.modelId,
@@ -29767,7 +29787,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29767
29787
  nodeId: n.nodeId
29768
29788
  });
29769
29789
  if (r.kind === "refused") return `${g.name} refused: ${r.reason}${r.detail === void 0 ? "" : ` — ${r.detail}`}.`;
29770
- let i = kM(O.current, r.proposals.map((e) => ({
29790
+ let i = NM(O.current, r.proposals.map((e) => ({
29771
29791
  bbox: e.bbox,
29772
29792
  macroClass: e.macroClass,
29773
29793
  ...e.label === void 0 ? {} : { label: e.label },
@@ -29784,7 +29804,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29784
29804
  }, F = async (n) => {
29785
29805
  if (x === void 0) return "";
29786
29806
  let r = O.current, i = await c.mutateAsync({
29787
- ...QM(e),
29807
+ ...nN(e),
29788
29808
  profileId: x.id,
29789
29809
  classes: [...S],
29790
29810
  boxes: r.boxes.slice(0, 50).map((e) => ({
@@ -29795,7 +29815,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29795
29815
  })),
29796
29816
  allowCloud: n
29797
29817
  });
29798
- if (i.kind === "refused") return `${nN[i.reason] ?? i.reason}${i.detail === void 0 ? "" : ` (${i.detail})`}`;
29818
+ if (i.kind === "refused") return `${oN[i.reason] ?? i.reason}${i.detail === void 0 ? "" : ` (${i.detail})`}`;
29799
29819
  let a = i.proposals.map((e) => ({
29800
29820
  bbox: e.bbox,
29801
29821
  macroClass: e.macroClass,
@@ -29806,8 +29826,8 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29806
29826
  ...e.assistScore === void 0 ? {} : { assistScore: e.assistScore },
29807
29827
  draft: !0,
29808
29828
  note: `${i.model}: ${e.reason}`
29809
- })), o = zM(i.reviews, i.model), s = kM(O.current, a);
29810
- t.setEditor((e) => RM(kM(e, a).state, o));
29829
+ })), o = UM(i.reviews, i.model), s = NM(O.current, a);
29830
+ t.setEditor((e) => HM(NM(e, a).state, o));
29811
29831
  let l = i.proposals.length - s.skipped, u = i.reviews.filter((e) => e.verdict !== "confirmed").length;
29812
29832
  return `${x.name}: ${String(l)} new draft${l === 1 ? "" : "s"}, ${String(u)} box${u === 1 ? "" : "es"} questioned${i.rejected > 0 ? `, ${String(i.rejected)} unusable item${i.rejected === 1 ? "" : "s"} dropped` : ""}.`;
29813
29833
  }, I = async (e) => {
@@ -29836,12 +29856,12 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29836
29856
  className: "w-36",
29837
29857
  "aria-label": "Assist engine",
29838
29858
  value: l,
29839
- options: $M.map((e) => ({
29859
+ options: rN.map((e) => ({
29840
29860
  value: e.value,
29841
29861
  label: e.label
29842
29862
  })),
29843
29863
  onChange: (e) => {
29844
- let t = $M.find((t) => t.value === e.target.value);
29864
+ let t = rN.find((t) => t.value === e.target.value);
29845
29865
  t !== void 0 && d(t.value);
29846
29866
  }
29847
29867
  }),
@@ -29927,7 +29947,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29927
29947
  children: [/* @__PURE__ */ V("span", {
29928
29948
  className: "text-foreground-subtle",
29929
29949
  children: "Look for:"
29930
- }), tN.map((e) => {
29950
+ }), aN.map((e) => {
29931
29951
  let t = S.includes(e);
29932
29952
  return /* @__PURE__ */ V("button", {
29933
29953
  type: "button",
@@ -29963,7 +29983,7 @@ function rN({ frame: e, history: t, detector: n, schema: r, setNotice: i }) {
29963
29983
  }
29964
29984
  //#endregion
29965
29985
  //#region src/page/frames/lib/retrain-boxes.ts
29966
- function iN(e, t, n, r) {
29986
+ function cN(e, t, n, r) {
29967
29987
  if (!(e > 0) || !(t > 0) || !(n > 0) || !(r > 0)) return null;
29968
29988
  let i = Math.min(e / n, t / r), a = n * i, o = r * i;
29969
29989
  return {
@@ -29973,7 +29993,7 @@ function iN(e, t, n, r) {
29973
29993
  height: o
29974
29994
  };
29975
29995
  }
29976
- function aN(e, t) {
29996
+ function lN(e, t) {
29977
29997
  return {
29978
29998
  x: Math.min(e.x, t.x),
29979
29999
  y: Math.min(e.y, t.y),
@@ -29981,11 +30001,11 @@ function aN(e, t) {
29981
30001
  h: Math.abs(t.y - e.y)
29982
30002
  };
29983
30003
  }
29984
- var oN = .01;
29985
- function sN(e) {
30004
+ var uN = .01;
30005
+ function dN(e) {
29986
30006
  return e.w >= .01 && e.h >= .01;
29987
30007
  }
29988
- function cN(e, t) {
30008
+ function fN(e, t) {
29989
30009
  let n = -1, r = Infinity;
29990
30010
  return e.forEach((e, i) => {
29991
30011
  if (!(t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h)) return;
@@ -29993,7 +30013,7 @@ function cN(e, t) {
29993
30013
  a < r && (n = i, r = a);
29994
30014
  }), n;
29995
30015
  }
29996
- var lN = [
30016
+ var pN = [
29997
30017
  "nw",
29998
30018
  "n",
29999
30019
  "ne",
@@ -30003,7 +30023,7 @@ var lN = [
30003
30023
  "sw",
30004
30024
  "w"
30005
30025
  ];
30006
- function uN(e, t, n) {
30026
+ function mN(e, t, n) {
30007
30027
  return {
30008
30028
  x: Math.min(Math.max(0, e.x + t), Math.max(0, 1 - e.w)),
30009
30029
  y: Math.min(Math.max(0, e.y + n), Math.max(0, 1 - e.h)),
@@ -30011,9 +30031,9 @@ function uN(e, t, n) {
30011
30031
  h: e.h
30012
30032
  };
30013
30033
  }
30014
- function dN(e, t, n, r) {
30034
+ function hN(e, t, n, r) {
30015
30035
  if (n) {
30016
- let e = Math.min(Math.max(0, r), t - oN);
30036
+ let e = Math.min(Math.max(0, r), t - uN);
30017
30037
  return {
30018
30038
  start: e,
30019
30039
  size: t - e
@@ -30021,14 +30041,14 @@ function dN(e, t, n, r) {
30021
30041
  }
30022
30042
  return {
30023
30043
  start: e,
30024
- size: Math.max(Math.min(1, r), e + oN) - e
30044
+ size: Math.max(Math.min(1, r), e + uN) - e
30025
30045
  };
30026
30046
  }
30027
- function fN(e, t, n) {
30028
- let r = t.includes("w") || t.includes("e") ? dN(e.x, e.x + e.w, t.includes("w"), n.x) : {
30047
+ function gN(e, t, n) {
30048
+ let r = t.includes("w") || t.includes("e") ? hN(e.x, e.x + e.w, t.includes("w"), n.x) : {
30029
30049
  start: e.x,
30030
30050
  size: e.w
30031
- }, i = t.includes("n") || t.includes("s") ? dN(e.y, e.y + e.h, t.includes("n"), n.y) : {
30051
+ }, i = t.includes("n") || t.includes("s") ? hN(e.y, e.y + e.h, t.includes("n"), n.y) : {
30032
30052
  start: e.y,
30033
30053
  size: e.h
30034
30054
  };
@@ -30039,44 +30059,44 @@ function fN(e, t, n) {
30039
30059
  h: i.size
30040
30060
  };
30041
30061
  }
30042
- function pN(e, t) {
30062
+ function _N(e, t) {
30043
30063
  return {
30044
30064
  x: t.includes("w") ? e.x : t.includes("e") ? e.x + e.w : e.x + e.w / 2,
30045
30065
  y: t.includes("n") ? e.y : t.includes("s") ? e.y + e.h : e.y + e.h / 2
30046
30066
  };
30047
30067
  }
30048
- function mN(e, t, n) {
30068
+ function vN(e, t, n) {
30049
30069
  let r = (e, t, n) => Math.abs(e - t) <= n, i = r(t.x, e.x, n.x), a = r(t.x, e.x + e.w, n.x), o = r(t.y, e.y, n.y), s = r(t.y, e.y + e.h, n.y), c = t.x >= e.x - n.x && t.x <= e.x + e.w + n.x, l = t.y >= e.y - n.y && t.y <= e.y + e.h + n.y;
30050
30070
  return !c || !l ? null : o && i ? "nw" : o && a ? "ne" : s && i ? "sw" : s && a ? "se" : o ? "n" : s ? "s" : i ? "w" : a ? "e" : t.x >= e.x && t.x <= e.x + e.w && t.y >= e.y && t.y <= e.y + e.h ? "body" : null;
30051
30071
  }
30052
30072
  //#endregion
30053
30073
  //#region src/page/frames/lib/retrain-zoom.ts
30054
- var hN = {
30074
+ var yN = {
30055
30075
  x: 0,
30056
30076
  y: 0,
30057
30077
  w: 1,
30058
30078
  h: 1
30059
- }, gN = 1.5;
30060
- function _N(e, t, n) {
30079
+ }, bN = 1.5;
30080
+ function xN(e, t, n) {
30061
30081
  return e < t ? t : e > n ? n : e;
30062
30082
  }
30063
- function vN(e) {
30083
+ function SN(e) {
30064
30084
  return 1 / e.w;
30065
30085
  }
30066
- function yN(e, t, n, r) {
30086
+ function CN(e, t, n, r) {
30067
30087
  return {
30068
- x: _N(r.x + (e - n.left) / n.width * r.w, 0, 1),
30069
- y: _N(r.y + (t - n.top) / n.height * r.h, 0, 1)
30088
+ x: xN(r.x + (e - n.left) / n.width * r.w, 0, 1),
30089
+ y: xN(r.y + (t - n.top) / n.height * r.h, 0, 1)
30070
30090
  };
30071
30091
  }
30072
- function bN(e, t, n) {
30092
+ function wN(e, t, n) {
30073
30093
  return {
30074
30094
  x: t.left + (e.x - n.x) / n.w * t.width,
30075
30095
  y: t.top + (e.y - n.y) / n.h * t.height
30076
30096
  };
30077
30097
  }
30078
- function xN(e, t, n) {
30079
- let r = bN(e, t, n);
30098
+ function TN(e, t, n) {
30099
+ let r = wN(e, t, n);
30080
30100
  return {
30081
30101
  left: r.x,
30082
30102
  top: r.y,
@@ -30084,7 +30104,7 @@ function xN(e, t, n) {
30084
30104
  height: e.h / n.h * t.height
30085
30105
  };
30086
30106
  }
30087
- function SN(e, t) {
30107
+ function EN(e, t) {
30088
30108
  return {
30089
30109
  left: e.left - t.x / t.w * e.width,
30090
30110
  top: e.top - t.y / t.h * e.height,
@@ -30092,24 +30112,24 @@ function SN(e, t) {
30092
30112
  height: e.height / t.h
30093
30113
  };
30094
30114
  }
30095
- function CN(e, t, n) {
30096
- let r = _N(e.w / n, 1 / 16, 1), i = r / e.w;
30115
+ function DN(e, t, n) {
30116
+ let r = xN(e.w / n, 1 / 16, 1), i = r / e.w;
30097
30117
  return {
30098
- x: _N(t.x - (t.x - e.x) * i, 0, 1 - r),
30099
- y: _N(t.y - (t.y - e.y) * i, 0, 1 - r),
30118
+ x: xN(t.x - (t.x - e.x) * i, 0, 1 - r),
30119
+ y: xN(t.y - (t.y - e.y) * i, 0, 1 - r),
30100
30120
  w: r,
30101
30121
  h: r
30102
30122
  };
30103
30123
  }
30104
- function wN(e, t, n) {
30124
+ function ON(e, t, n) {
30105
30125
  return {
30106
- x: _N(e.x + t, 0, 1 - e.w),
30107
- y: _N(e.y + n, 0, 1 - e.h),
30126
+ x: xN(e.x + t, 0, 1 - e.w),
30127
+ y: xN(e.y + n, 0, 1 - e.h),
30108
30128
  w: e.w,
30109
30129
  h: e.h
30110
30130
  };
30111
30131
  }
30112
- function TN(e) {
30132
+ function kN(e) {
30113
30133
  return {
30114
30134
  x: e.x + e.w / 2,
30115
30135
  y: e.y + e.h / 2
@@ -30117,7 +30137,7 @@ function TN(e) {
30117
30137
  }
30118
30138
  //#endregion
30119
30139
  //#region src/page/frames/lib/retrain-shortcuts.ts
30120
- var EN = [
30140
+ var AN = [
30121
30141
  "person",
30122
30142
  "vehicle",
30123
30143
  "animal",
@@ -30125,12 +30145,12 @@ var EN = [
30125
30145
  "face",
30126
30146
  "plate"
30127
30147
  ];
30128
- function DN(e) {
30148
+ function jN(e) {
30129
30149
  if (typeof e != "object" || !e || !("tagName" in e)) return !1;
30130
30150
  let t = String(e.tagName).toUpperCase();
30131
30151
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? !0 : "isContentEditable" in e && e.isContentEditable === !0;
30132
30152
  }
30133
- function ON(e) {
30153
+ function MN(e) {
30134
30154
  let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
30135
30155
  if (t && !e.altKey) return n === "s" && !e.shiftKey ? { kind: "save" } : e.typing ? null : n === "z" ? e.shiftKey ? { kind: "redo" } : { kind: "undo" } : n === "y" && !e.shiftKey ? { kind: "redo" } : null;
30136
30156
  if (e.typing || t || e.altKey) return null;
@@ -30149,8 +30169,8 @@ function ON(e) {
30149
30169
  default: break;
30150
30170
  }
30151
30171
  let r = Number.parseInt(e.key, 10);
30152
- if (Number.isInteger(r) && r >= 1 && r <= EN.length) {
30153
- let e = EN[r - 1];
30172
+ if (Number.isInteger(r) && r >= 1 && r <= AN.length) {
30173
+ let e = AN[r - 1];
30154
30174
  return e === void 0 ? null : {
30155
30175
  kind: "set-class",
30156
30176
  macroClass: e
@@ -30158,7 +30178,7 @@ function ON(e) {
30158
30178
  }
30159
30179
  return n === "a" ? e.shiftKey ? { kind: "accept-all" } : { kind: "accept" } : n === "e" && !e.shiftKey ? { kind: "toggle-model-error" } : n === "c" && !e.shiftKey ? { kind: "toggle-complete" } : null;
30160
30180
  }
30161
- var kN = [
30181
+ var NN = [
30162
30182
  {
30163
30183
  keys: "← / →",
30164
30184
  does: "Previous / next frame"
@@ -30227,13 +30247,13 @@ var kN = [
30227
30247
  //#endregion
30228
30248
  //#region src/page/frames/RetrainCanvas.tsx
30229
30249
  i();
30230
- var AN = .0015, jN = {
30250
+ var PN = .0015, FN = {
30231
30251
  pipeline: "var(--color-foreground-muted)",
30232
30252
  assist: "var(--color-info)",
30233
30253
  llm: "var(--color-warning)",
30234
30254
  operator: "var(--color-success)"
30235
30255
  };
30236
- function MN(e, t) {
30256
+ function IN(e, t) {
30237
30257
  return e.kind === "model_error" ? {
30238
30258
  color: "var(--color-danger)",
30239
30259
  dashed: !0,
@@ -30243,7 +30263,7 @@ function MN(e, t) {
30243
30263
  dashed: e.draft,
30244
30264
  opacity: 1
30245
30265
  } : e.draft ? {
30246
- color: jN[e.source],
30266
+ color: FN[e.source],
30247
30267
  dashed: !0,
30248
30268
  opacity: .8
30249
30269
  } : {
@@ -30252,16 +30272,16 @@ function MN(e, t) {
30252
30272
  opacity: 1
30253
30273
  };
30254
30274
  }
30255
- function NN(e, t) {
30275
+ function LN(e, t) {
30256
30276
  return Math.hypot(e.x - t.x, e.y - t.y);
30257
30277
  }
30258
- function PN(e, t) {
30278
+ function RN(e, t) {
30259
30279
  return {
30260
30280
  x: (e.x + t.x) / 2,
30261
30281
  y: (e.y + t.y) / 2
30262
30282
  };
30263
30283
  }
30264
- function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h }) {
30284
+ function zN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey: i, viewport: o, onViewportChange: c, panMode: l, onSelect: d, onDraw: f, onGestureStart: p, onGestureBox: m, onGestureEnd: h }) {
30265
30285
  let _ = u(null), [v, b] = a({
30266
30286
  w: 0,
30267
30287
  h: 0
@@ -30279,10 +30299,10 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30279
30299
  n.disconnect();
30280
30300
  };
30281
30301
  }, []);
30282
- let D = iN(v.w, v.h, t, n);
30302
+ let D = cN(v.w, v.h, t, n);
30283
30303
  y(() => {
30284
30304
  let e = (e) => {
30285
- e.key !== " " || DN(e.target) || (e.preventDefault(), w(!0));
30305
+ e.key !== " " || jN(e.target) || (e.preventDefault(), w(!0));
30286
30306
  }, t = (e) => {
30287
30307
  e.key === " " && w(!1);
30288
30308
  };
@@ -30307,7 +30327,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30307
30327
  if (n === null) return;
30308
30328
  t.preventDefault();
30309
30329
  let a = e.getBoundingClientRect();
30310
- i(CN(r, yN(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * AN)));
30330
+ i(DN(r, CN(t.clientX - a.left, t.clientY - a.top, n, r), Math.exp(-t.deltaY * PN)));
30311
30331
  };
30312
30332
  return e.addEventListener("wheel", t, { passive: !1 }), () => {
30313
30333
  e.removeEventListener("wheel", t);
@@ -30319,7 +30339,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30319
30339
  x: e.clientX - (t?.left ?? 0),
30320
30340
  y: e.clientY - (t?.top ?? 0)
30321
30341
  };
30322
- }, []), A = s((e) => D === null ? null : yN(e.x, e.y, D, o), [D, o]), j = s(() => {
30342
+ }, []), A = s((e) => D === null ? null : CN(e.x, e.y, D, o), [D, o]), j = s(() => {
30323
30343
  let e = E.current;
30324
30344
  (e.mode === "move" || e.mode === "resize") && h(), e.mode === "draw" && S(null), E.current = { mode: "none" };
30325
30345
  }, [h]), M = (e) => {
@@ -30329,11 +30349,11 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30329
30349
  j();
30330
30350
  let [e, t] = [...T.current.values()];
30331
30351
  if (e === void 0 || t === void 0) return;
30332
- let n = PN(e, t);
30352
+ let n = RN(e, t);
30333
30353
  E.current = {
30334
30354
  mode: "pinch",
30335
- startDistance: Math.max(1, NN(e, t)),
30336
- anchor: yN(n.x, n.y, D, o),
30355
+ startDistance: Math.max(1, LN(e, t)),
30356
+ anchor: CN(n.x, n.y, D, o),
30337
30357
  from: o
30338
30358
  };
30339
30359
  return;
@@ -30348,12 +30368,12 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30348
30368
  return;
30349
30369
  }
30350
30370
  if (e.button !== 0) return;
30351
- let n = yN(t.x, t.y, D, o), a = {
30371
+ let n = CN(t.x, t.y, D, o), a = {
30352
30372
  x: 12 / D.width * o.w,
30353
30373
  y: 12 / D.height * o.h
30354
30374
  }, s = r.find((e) => e.key === i);
30355
30375
  if (s !== void 0) {
30356
- let e = mN(s.bbox, n, a);
30376
+ let e = vN(s.bbox, n, a);
30357
30377
  if (e !== null && e !== "body") {
30358
30378
  p(), E.current = {
30359
30379
  mode: "resize",
@@ -30364,7 +30384,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30364
30384
  return;
30365
30385
  }
30366
30386
  }
30367
- let c = r[cN(r.map((e) => e.bbox), n)];
30387
+ let c = r[fN(r.map((e) => e.bbox), n)];
30368
30388
  if (c !== void 0) {
30369
30389
  c.key !== i && d(c.key), p(), E.current = {
30370
30390
  mode: "move",
@@ -30377,7 +30397,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30377
30397
  E.current = {
30378
30398
  mode: "draw",
30379
30399
  start: n
30380
- }, S(aN(n, n));
30400
+ }, S(lN(n, n));
30381
30401
  }, N = (e) => {
30382
30402
  if (!T.current.has(e.pointerId) || D === null) return;
30383
30403
  let t = k(e);
@@ -30387,28 +30407,28 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30387
30407
  case "pinch": {
30388
30408
  let [e, t] = [...T.current.values()];
30389
30409
  if (e === void 0 || t === void 0) return;
30390
- let r = CN(n.from, n.anchor, NN(e, t) / n.startDistance), i = PN(e, t), a = yN(i.x, i.y, D, r);
30391
- c(wN(r, n.anchor.x - a.x, n.anchor.y - a.y));
30410
+ let r = DN(n.from, n.anchor, LN(e, t) / n.startDistance), i = RN(e, t), a = CN(i.x, i.y, D, r);
30411
+ c(ON(r, n.anchor.x - a.x, n.anchor.y - a.y));
30392
30412
  return;
30393
30413
  }
30394
30414
  case "pan": {
30395
30415
  let e = (t.x - n.startPx.x) / D.width * n.from.w, r = (t.y - n.startPx.y) / D.height * n.from.h;
30396
- c(wN(n.from, -e, -r));
30416
+ c(ON(n.from, -e, -r));
30397
30417
  return;
30398
30418
  }
30399
30419
  case "move": {
30400
- let e = yN(t.x, t.y, D, o);
30401
- m(n.key, uN(n.from, e.x - n.start.x, e.y - n.start.y));
30420
+ let e = CN(t.x, t.y, D, o);
30421
+ m(n.key, mN(n.from, e.x - n.start.x, e.y - n.start.y));
30402
30422
  return;
30403
30423
  }
30404
30424
  case "resize": {
30405
- let e = yN(t.x, t.y, D, o);
30406
- m(n.key, fN(n.from, n.handle, e));
30425
+ let e = CN(t.x, t.y, D, o);
30426
+ m(n.key, gN(n.from, n.handle, e));
30407
30427
  return;
30408
30428
  }
30409
30429
  case "draw": {
30410
- let e = yN(t.x, t.y, D, o);
30411
- S(aN(n.start, e));
30430
+ let e = CN(t.x, t.y, D, o);
30431
+ S(lN(n.start, e));
30412
30432
  return;
30413
30433
  }
30414
30434
  default: return;
@@ -30422,12 +30442,12 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30422
30442
  return;
30423
30443
  }
30424
30444
  if (t.mode === "draw") {
30425
- let n = A(k(e)), r = n === null ? null : aN(t.start, n);
30426
- S(null), E.current = { mode: "none" }, r !== null && sN(r) ? f(r) : d(null);
30445
+ let n = A(k(e)), r = n === null ? null : lN(t.start, n);
30446
+ S(null), E.current = { mode: "none" }, r !== null && dN(r) ? f(r) : d(null);
30427
30447
  return;
30428
30448
  }
30429
30449
  j();
30430
- }, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null : SN(D, o);
30450
+ }, F = r.find((e) => e.key === i), I = C || l, ee = D === null ? null : EN(D, o);
30431
30451
  return /* @__PURE__ */ H("div", {
30432
30452
  ref: _,
30433
30453
  "data-testid": "retrain-canvas",
@@ -30446,7 +30466,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30446
30466
  style: ee
30447
30467
  }),
30448
30468
  D !== null && r.map((e) => {
30449
- let t = xN(e.bbox, D, o), n = e.key === i, r = MN(e, n);
30469
+ let t = TN(e.bbox, D, o), n = e.key === i, r = IN(e, n);
30450
30470
  return /* @__PURE__ */ V("div", {
30451
30471
  "data-testid": `retrain-box-${e.key}`,
30452
30472
  "data-draft": e.draft ? "true" : "false",
@@ -30472,8 +30492,8 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30472
30492
  })
30473
30493
  }, e.key);
30474
30494
  }),
30475
- D !== null && F !== void 0 && lN.map((e) => {
30476
- let t = bN(pN(F.bbox, e), D, o);
30495
+ D !== null && F !== void 0 && pN.map((e) => {
30496
+ let t = wN(_N(F.bbox, e), D, o);
30477
30497
  return /* @__PURE__ */ V("div", {
30478
30498
  "data-testid": `retrain-handle-${e}`,
30479
30499
  className: "absolute h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-sm border border-background bg-primary pointer-events-none",
@@ -30485,7 +30505,7 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30485
30505
  }),
30486
30506
  x !== null && D !== null && /* @__PURE__ */ V("div", {
30487
30507
  className: "absolute border border-dashed border-primary pointer-events-none",
30488
- style: xN(x, D, o)
30508
+ style: TN(x, D, o)
30489
30509
  })
30490
30510
  ]
30491
30511
  });
@@ -30493,19 +30513,19 @@ function FN({ imageSrc: e, imageWidth: t, imageHeight: n, boxes: r, selectedKey:
30493
30513
  //#endregion
30494
30514
  //#region src/page/frames/RetrainCanvasToolbar.tsx
30495
30515
  i();
30496
- function IN() {
30497
- let [e, t] = a(hN), [n, r] = a(!1);
30516
+ function BN() {
30517
+ let [e, t] = a(yN), [n, r] = a(!1);
30498
30518
  return {
30499
30519
  viewport: e,
30500
30520
  setViewport: t,
30501
30521
  zoomIn: s(() => {
30502
- t((e) => CN(e, TN(e), gN));
30522
+ t((e) => DN(e, kN(e), bN));
30503
30523
  }, []),
30504
30524
  zoomOut: s(() => {
30505
- t((e) => CN(e, TN(e), 1 / gN));
30525
+ t((e) => DN(e, kN(e), 1 / bN));
30506
30526
  }, []),
30507
30527
  fit: s(() => {
30508
- t(hN);
30528
+ t(yN);
30509
30529
  }, []),
30510
30530
  panMode: n,
30511
30531
  togglePan: s(() => {
@@ -30513,8 +30533,8 @@ function IN() {
30513
30533
  }, [])
30514
30534
  };
30515
30535
  }
30516
- function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30517
- let a = vN(e.viewport);
30536
+ function VN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30537
+ let a = SN(e.viewport);
30518
30538
  return /* @__PURE__ */ H("div", {
30519
30539
  className: "flex items-center gap-1 px-2 py-1 border-b border-border bg-surface",
30520
30540
  children: [
@@ -30580,7 +30600,7 @@ function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30580
30600
  children: "Keyboard and gestures"
30581
30601
  }), /* @__PURE__ */ V("table", {
30582
30602
  className: "w-full text-[11px]",
30583
- children: /* @__PURE__ */ V("tbody", { children: kN.map((e) => /* @__PURE__ */ H("tr", {
30603
+ children: /* @__PURE__ */ V("tbody", { children: NN.map((e) => /* @__PURE__ */ H("tr", {
30584
30604
  className: "align-top",
30585
30605
  children: [/* @__PURE__ */ V("td", {
30586
30606
  className: "py-0.5 pr-2 font-mono whitespace-nowrap text-foreground",
@@ -30595,7 +30615,7 @@ function LN({ view: e, canUndo: t, canRedo: n, onUndo: r, onRedo: i }) {
30595
30615
  ]
30596
30616
  });
30597
30617
  }
30598
- function RN(e) {
30618
+ function HN(e) {
30599
30619
  return {
30600
30620
  past: [],
30601
30621
  present: e,
@@ -30603,25 +30623,25 @@ function RN(e) {
30603
30623
  gestureBase: null
30604
30624
  };
30605
30625
  }
30606
- function zN(e, t) {
30626
+ function UN(e, t) {
30607
30627
  let n = [...e, t];
30608
30628
  return n.length > 100 ? n.slice(n.length - 100) : n;
30609
30629
  }
30610
- function BN(e, t) {
30630
+ function WN(e, t) {
30611
30631
  return t === e.present ? e : {
30612
- past: zN(e.past, e.present),
30632
+ past: UN(e.past, e.present),
30613
30633
  present: t,
30614
30634
  future: [],
30615
30635
  gestureBase: null
30616
30636
  };
30617
30637
  }
30618
- function VN(e, t) {
30638
+ function GN(e, t) {
30619
30639
  return {
30620
30640
  ...e,
30621
30641
  present: t
30622
30642
  };
30623
30643
  }
30624
- function HN(e) {
30644
+ function KN(e) {
30625
30645
  let t = e.past[e.past.length - 1];
30626
30646
  return t === void 0 ? e : {
30627
30647
  past: e.past.slice(0, -1),
@@ -30630,68 +30650,68 @@ function HN(e) {
30630
30650
  gestureBase: null
30631
30651
  };
30632
30652
  }
30633
- function UN(e) {
30653
+ function qN(e) {
30634
30654
  let [t, ...n] = e.future;
30635
30655
  return t === void 0 ? e : {
30636
- past: zN(e.past, e.present),
30656
+ past: UN(e.past, e.present),
30637
30657
  present: t,
30638
30658
  future: n,
30639
30659
  gestureBase: null
30640
30660
  };
30641
30661
  }
30642
- function WN(e) {
30662
+ function JN(e) {
30643
30663
  return {
30644
30664
  ...e,
30645
30665
  gestureBase: e.present
30646
30666
  };
30647
30667
  }
30648
- function GN(e, t) {
30668
+ function YN(e, t) {
30649
30669
  return {
30650
30670
  ...e,
30651
30671
  present: t
30652
30672
  };
30653
30673
  }
30654
- function KN(e) {
30674
+ function XN(e) {
30655
30675
  let t = e.gestureBase;
30656
30676
  return t === null ? e : t === e.present ? {
30657
30677
  ...e,
30658
30678
  gestureBase: null
30659
30679
  } : {
30660
- past: zN(e.past, t),
30680
+ past: UN(e.past, t),
30661
30681
  present: e.present,
30662
30682
  future: [],
30663
30683
  gestureBase: null
30664
30684
  };
30665
30685
  }
30666
- function qN(e) {
30686
+ function ZN(e) {
30667
30687
  return e.past.length > 0;
30668
30688
  }
30669
- function JN(e) {
30689
+ function QN(e) {
30670
30690
  return e.future.length > 0;
30671
30691
  }
30672
30692
  //#endregion
30673
30693
  //#region src/page/frames/use-retrain-editor-history.ts
30674
30694
  i();
30675
- function YN(e, t) {
30695
+ function $N(e, t) {
30676
30696
  return typeof e == "function" ? e(t) : e;
30677
30697
  }
30678
- function XN(e) {
30679
- let [t, n] = a(() => RN(e())), r = s((e) => {
30680
- n((t) => BN(t, YN(e, t.present)));
30698
+ function eP(e) {
30699
+ let [t, n] = a(() => HN(e())), r = s((e) => {
30700
+ n((t) => WN(t, $N(e, t.present)));
30681
30701
  }, []), i = s((e) => {
30682
- n(RN(e));
30702
+ n(HN(e));
30683
30703
  }, []), o = s((e) => {
30684
- n((t) => VN(t, YN(e, t.present)));
30704
+ n((t) => GN(t, $N(e, t.present)));
30685
30705
  }, []), c = s(() => {
30686
- n((e) => WN(e));
30706
+ n((e) => JN(e));
30687
30707
  }, []), l = s((e) => {
30688
- n((t) => GN(t, YN(e, t.present)));
30708
+ n((t) => YN(t, $N(e, t.present)));
30689
30709
  }, []), u = s(() => {
30690
- n((e) => KN(e));
30710
+ n((e) => XN(e));
30691
30711
  }, []), d = s(() => {
30692
- n((e) => HN(e));
30712
+ n((e) => KN(e));
30693
30713
  }, []), f = s(() => {
30694
- n((e) => UN(e));
30714
+ n((e) => qN(e));
30695
30715
  }, []);
30696
30716
  return {
30697
30717
  editor: t.present,
@@ -30703,20 +30723,20 @@ function XN(e) {
30703
30723
  endGesture: u,
30704
30724
  undo: d,
30705
30725
  redo: f,
30706
- canUndo: qN(t),
30707
- canRedo: JN(t)
30726
+ canUndo: ZN(t),
30727
+ canRedo: QN(t)
30708
30728
  };
30709
30729
  }
30710
30730
  //#endregion
30711
30731
  //#region src/page/frames/use-retrain-shortcuts.ts
30712
30732
  i();
30713
- function ZN(e, t) {
30733
+ function tP(e, t) {
30714
30734
  let n = e.boxes.length;
30715
30735
  if (n === 0) return null;
30716
30736
  let r = e.boxes.findIndex((t) => t.key === e.selectedKey), i = r < 0 ? t === 1 ? 0 : n - 1 : (r + t + n) % n;
30717
30737
  return e.boxes[i]?.key ?? null;
30718
30738
  }
30719
- function QN(e, t) {
30739
+ function nP(e, t) {
30720
30740
  let { history: n } = t, r = n.editor.selectedKey;
30721
30741
  switch (e.kind) {
30722
30742
  case "next-frame": return t.onNextFrame();
@@ -30728,39 +30748,39 @@ function QN(e, t) {
30728
30748
  case "zoom-in": return t.onZoomIn(), !0;
30729
30749
  case "zoom-out": return t.onZoomOut(), !0;
30730
30750
  case "zoom-fit": return t.onZoomFit(), !0;
30731
- case "accept-all": return n.setEditor((e) => PM(e)), !0;
30751
+ case "accept-all": return n.setEditor((e) => RM(e)), !0;
30732
30752
  case "select-next":
30733
30753
  case "select-prev": {
30734
- let t = ZN(n.editor, e.kind === "select-next" ? 1 : -1);
30735
- return t === null ? !1 : (n.selectOnly((e) => LM(e, t)), !0);
30754
+ let t = tP(n.editor, e.kind === "select-next" ? 1 : -1);
30755
+ return t === null ? !1 : (n.selectOnly((e) => VM(e, t)), !0);
30736
30756
  }
30737
- case "deselect": return r === null ? !1 : (n.selectOnly((e) => LM(e, null)), !0);
30757
+ case "deselect": return r === null ? !1 : (n.selectOnly((e) => VM(e, null)), !0);
30738
30758
  default: break;
30739
30759
  }
30740
30760
  if (r === null) return !1;
30741
30761
  switch (e.kind) {
30742
- case "delete": return n.setEditor((e) => IM(e, r)), !0;
30743
- case "set-class": return n.setEditor((t) => MM(t, r, { macroClass: e.macroClass })), !0;
30744
- case "accept": return n.setEditor((e) => NM(e, r)), !0;
30745
- case "toggle-model-error": return n.setEditor((e) => FM(e, r)), !0;
30762
+ case "delete": return n.setEditor((e) => BM(e, r)), !0;
30763
+ case "set-class": return n.setEditor((t) => IM(t, r, { macroClass: e.macroClass })), !0;
30764
+ case "accept": return n.setEditor((e) => LM(e, r)), !0;
30765
+ case "toggle-model-error": return n.setEditor((e) => zM(e, r)), !0;
30746
30766
  default: return !1;
30747
30767
  }
30748
30768
  }
30749
- function $N(e, t) {
30769
+ function rP(e, t) {
30750
30770
  let n = u(t);
30751
30771
  n.current = t, y(() => {
30752
30772
  if (!e) return;
30753
30773
  let t = (e) => {
30754
30774
  if (e.defaultPrevented || e.isComposing) return;
30755
- let t = ON({
30775
+ let t = MN({
30756
30776
  key: e.key,
30757
30777
  ctrlKey: e.ctrlKey,
30758
30778
  metaKey: e.metaKey,
30759
30779
  shiftKey: e.shiftKey,
30760
30780
  altKey: e.altKey,
30761
- typing: DN(e.target)
30781
+ typing: jN(e.target)
30762
30782
  });
30763
- t !== null && QN(t, n.current) && e.preventDefault();
30783
+ t !== null && nP(t, n.current) && e.preventDefault();
30764
30784
  };
30765
30785
  return window.addEventListener("keydown", t), () => {
30766
30786
  window.removeEventListener("keydown", t);
@@ -30770,7 +30790,7 @@ function $N(e, t) {
30770
30790
  //#endregion
30771
30791
  //#region src/page/frames/RetrainWorkbench.tsx
30772
30792
  i();
30773
- var eP = "person", tP = {
30793
+ var iP = "person", aP = {
30774
30794
  pending: "Reading which detector this camera runs…",
30775
30795
  "placement-unreadable": "The detection stage of this camera could not be read, so the model it runs is unknown — not absent.",
30776
30796
  "detection-off": "This camera runs no object detector, so there is no proposal to mirror.",
@@ -30779,8 +30799,8 @@ var eP = "person", tP = {
30779
30799
  "step-unknown": "That node carries no object-detection step in its catalog.",
30780
30800
  "no-model": "No object-detection model on that accelerator can be resolved for this camera."
30781
30801
  };
30782
- function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r, onSaved: i, setNotice: o }) {
30783
- let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d = XN(() => OM([], [])), { editor: f, setEditor: p, resetEditor: h, selectOnly: g } = d, _ = IN(), v = rc({ frameIds: [t] }), b = tc({ frameId: t }), x = nc(), S = ic(), C = oc(), w = _c({ deviceIds: l === null ? [] : [l] }, {
30802
+ function oP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r, onSaved: i, setNotice: o }) {
30803
+ let c = e.find((e) => e.frameId === t), l = c?.deviceId ?? null, d = eP(() => MM([], [])), { editor: f, setEditor: p, resetEditor: h, selectOnly: g } = d, _ = BN(), v = rc({ frameIds: [t] }), b = tc({ frameId: t }), x = nc(), S = ic(), C = oc(), w = _c({ deviceIds: l === null ? [] : [l] }, {
30784
30804
  enabled: l !== null,
30785
30805
  staleTime: 3e4
30786
30806
  }), T = w.data?.[0]?.detection?.nodeId ?? null, E = hc({ nodeId: T ?? "" }, {
@@ -30792,7 +30812,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30792
30812
  }), O = gc({ deviceId: l ?? 0 }, {
30793
30813
  enabled: l !== null,
30794
30814
  staleTime: 3e4
30795
- }), k = m(() => SM({
30815
+ }), k = m(() => EM({
30796
30816
  status: w.data?.[0],
30797
30817
  nodeDevices: E.data,
30798
30818
  schema: D.data,
@@ -30814,7 +30834,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30814
30834
  y(() => {
30815
30835
  _.fit();
30816
30836
  let { stored: e, copy: n } = A.current;
30817
- h(OM((e ?? []).filter((e) => e.mediaKey === t), n?.pipelineBoxes ?? []));
30837
+ h(MM((e ?? []).filter((e) => e.mediaKey === t), n?.pipelineBoxes ?? []));
30818
30838
  }, [
30819
30839
  t,
30820
30840
  v.dataUpdatedAt,
@@ -30824,7 +30844,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30824
30844
  ]);
30825
30845
  let M = s(async (e) => {
30826
30846
  c !== void 0 && (await C.mutateAsync({
30827
- ...QM(c),
30847
+ ...nN(c),
30828
30848
  complete: e
30829
30849
  }), await r());
30830
30850
  }, [
@@ -30834,11 +30854,11 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30834
30854
  ]), N = s(async (e) => {
30835
30855
  if (c === void 0) return;
30836
30856
  if (o(null), k.kind !== "resolved") {
30837
- o(tP[k.gap]);
30857
+ o(aP[k.gap]);
30838
30858
  return;
30839
30859
  }
30840
30860
  let t = await x.mutateAsync({
30841
- ...QM(c),
30861
+ ...nN(c),
30842
30862
  subject: e === "package" ? { kind: "package" } : {
30843
30863
  kind: "objects",
30844
30864
  modelId: k.modelId,
@@ -30850,7 +30870,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30850
30870
  o(t.reason === "no-zone" ? "A package proposal runs on the zone crop only — this camera has no zone, and running the detector on the whole frame at 0.35 proposes furniture." : `The pipeline refused: ${t.reason}${t.detail === void 0 ? "" : ` — ${t.detail}`}`);
30851
30871
  return;
30852
30872
  }
30853
- let n = kM(f, t.proposals.map((e) => ({
30873
+ let n = NM(f, t.proposals.map((e) => ({
30854
30874
  bbox: e.bbox,
30855
30875
  macroClass: e.macroClass,
30856
30876
  ...e.label === void 0 ? {} : { label: e.label },
@@ -30869,15 +30889,15 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30869
30889
  p,
30870
30890
  o
30871
30891
  ]), P = s((e) => {
30872
- p((t) => AM(t, e, eP));
30892
+ p((t) => PM(t, e, iP));
30873
30893
  }, [p]), [F, I] = a(!1), ee = s(async () => {
30874
30894
  if (c === void 0) return;
30875
- let e = BM(f);
30895
+ let e = WM(f);
30876
30896
  I(!0);
30877
30897
  try {
30878
30898
  await S.mutateAsync({
30879
- ...QM(c),
30880
- annotations: [...HM(f)]
30899
+ ...nN(c),
30900
+ annotations: [...KM(f)]
30881
30901
  }), await v.refetch();
30882
30902
  } finally {
30883
30903
  I(!1);
@@ -30890,11 +30910,11 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30890
30910
  v,
30891
30911
  i,
30892
30912
  o
30893
- ]), te = b.data, ne = YM(f.boxes) && c !== void 0, re = BM(f), ie = e.map((e) => e.frameId), L = (e) => {
30913
+ ]), te = b.data, ne = $M(f.boxes) && c !== void 0, re = WM(f), ie = e.map((e) => e.frameId), L = (e) => {
30894
30914
  let r = ie.indexOf(t), i = ie[r + e];
30895
30915
  return r < 0 || i === void 0 ? !1 : (n(i), !0);
30896
30916
  };
30897
- return $N(!F, {
30917
+ return rP(!F, {
30898
30918
  history: d,
30899
30919
  onNextFrame: () => L(1),
30900
30920
  onPrevFrame: () => L(-1),
@@ -30908,7 +30928,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30908
30928
  "aria-busy": F,
30909
30929
  children: [/* @__PURE__ */ H("div", {
30910
30930
  className: "rounded-md border border-border overflow-hidden flex flex-col",
30911
- children: [/* @__PURE__ */ V(LN, {
30931
+ children: [/* @__PURE__ */ V(VN, {
30912
30932
  view: _,
30913
30933
  canUndo: d.canUndo,
30914
30934
  canRedo: d.canRedo,
@@ -30917,7 +30937,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30917
30937
  }), te === void 0 ? /* @__PURE__ */ H("div", {
30918
30938
  className: "flex items-center gap-2 p-6 text-xs text-foreground-subtle",
30919
30939
  children: [/* @__PURE__ */ V(hr, { className: "h-3.5 w-3.5 animate-spin" }), "Loading the frame…"]
30920
- }) : /* @__PURE__ */ V(FN, {
30940
+ }) : /* @__PURE__ */ V(zN, {
30921
30941
  imageSrc: `data:image/jpeg;base64,${te.base64}`,
30922
30942
  imageWidth: te.width,
30923
30943
  imageHeight: te.height,
@@ -30927,12 +30947,12 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30927
30947
  onViewportChange: _.setViewport,
30928
30948
  panMode: _.panMode,
30929
30949
  onSelect: (e) => {
30930
- g((t) => LM(t, e));
30950
+ g((t) => VM(t, e));
30931
30951
  },
30932
30952
  onDraw: P,
30933
30953
  onGestureStart: d.beginGesture,
30934
30954
  onGestureBox: (e, t) => {
30935
- d.updateGesture((n) => MM(n, e, { bbox: t }));
30955
+ d.updateGesture((n) => IM(n, e, { bbox: t }));
30936
30956
  },
30937
30957
  onGestureEnd: d.endGesture
30938
30958
  })]
@@ -30974,9 +30994,9 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30974
30994
  }),
30975
30995
  /* @__PURE__ */ V("div", {
30976
30996
  className: "px-3 py-1 border-b border-border text-[11px] text-foreground-subtle",
30977
- children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` : tP[k.gap]
30997
+ children: k.kind === "resolved" ? `Proposals come from ${k.modelId} at ${k.minScore.toFixed(2)}, on ${k.nodeId} — what this camera really runs.` : aP[k.gap]
30978
30998
  }),
30979
- c !== void 0 && /* @__PURE__ */ V(rN, {
30999
+ c !== void 0 && /* @__PURE__ */ V(sN, {
30980
31000
  frame: c,
30981
31001
  history: d,
30982
31002
  detector: k,
@@ -30985,23 +31005,23 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
30985
31005
  }),
30986
31006
  /* @__PURE__ */ V("div", {
30987
31007
  className: "flex-1 overflow-y-auto",
30988
- children: /* @__PURE__ */ V(JM, {
31008
+ children: /* @__PURE__ */ V(QM, {
30989
31009
  boxes: f.boxes,
30990
31010
  selectedKey: f.selectedKey,
30991
31011
  onSelect: (e) => {
30992
- g((t) => LM(t, e));
31012
+ g((t) => VM(t, e));
30993
31013
  },
30994
31014
  onChange: (e, t) => {
30995
- p((n) => MM(n, e, t));
31015
+ p((n) => IM(n, e, t));
30996
31016
  },
30997
31017
  onAccept: (e) => {
30998
- p((t) => NM(t, e));
31018
+ p((t) => LM(t, e));
30999
31019
  },
31000
31020
  onToggleModelError: (e) => {
31001
- p((t) => FM(t, e));
31021
+ p((t) => zM(t, e));
31002
31022
  },
31003
31023
  onDelete: (e) => {
31004
- p((t) => IM(t, e));
31024
+ p((t) => BM(t, e));
31005
31025
  }
31006
31026
  })
31007
31027
  }),
@@ -31034,7 +31054,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
31034
31054
  variant: "secondary",
31035
31055
  size: "sm",
31036
31056
  onClick: () => {
31037
- p((e) => PM(e));
31057
+ p((e) => RM(e));
31038
31058
  },
31039
31059
  children: [/* @__PURE__ */ V(Zt, { className: "h-3 w-3" }), /* @__PURE__ */ V("span", {
31040
31060
  className: "ml-1",
@@ -31061,7 +31081,7 @@ function nP({ frames: e, activeFrameId: t, onActiveFrame: n, onFramesChanged: r,
31061
31081
  //#endregion
31062
31082
  //#region src/page/frames/CorpusAnnotateOverlay.tsx
31063
31083
  i();
31064
- function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i, onFramesChanged: o, onSaved: s }) {
31084
+ function sP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i, onFramesChanged: o, onSaved: s }) {
31065
31085
  let [c, l] = a(null);
31066
31086
  return y(() => {
31067
31087
  l(null);
@@ -31089,7 +31109,7 @@ function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
31089
31109
  })
31090
31110
  }), /* @__PURE__ */ V(Fp, {
31091
31111
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto p-3 sm:p-4",
31092
- children: /* @__PURE__ */ V(nP, {
31112
+ children: /* @__PURE__ */ V(oP, {
31093
31113
  frames: t,
31094
31114
  activeFrameId: n,
31095
31115
  onActiveFrame: r,
@@ -31104,7 +31124,7 @@ function rP({ open: e, frames: t, activeFrameId: n, onActiveFrame: r, onClose: i
31104
31124
  //#endregion
31105
31125
  //#region src/page/frames/RetrainCollectionsList.tsx
31106
31126
  i();
31107
- function iP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
31127
+ function cP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: o, onDelete: s }) {
31108
31128
  let [c, l] = a(""), [u, d] = a(null), [f, p] = a(null), m = async () => {
31109
31129
  let e = await i(c);
31110
31130
  d(e), e === null && l("");
@@ -31212,19 +31232,19 @@ function iP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
31212
31232
  }
31213
31233
  //#endregion
31214
31234
  //#region src/page/frames/CorpusCollectionsSection.tsx
31215
- var aP = {
31235
+ var lP = {
31216
31236
  "empty-name": "Give the collection a name.",
31217
31237
  "duplicate-name": "A collection with that name already exists.",
31218
31238
  "unknown-collection": "That collection no longer exists."
31219
31239
  };
31220
- function oP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
31240
+ function uP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate: i, onRename: a, onDelete: o }) {
31221
31241
  return /* @__PURE__ */ V(Wg, {
31222
31242
  headingId: "corpus-collections-heading",
31223
31243
  title: "Collections",
31224
31244
  testId: "corpus-collections",
31225
31245
  children: /* @__PURE__ */ V("div", {
31226
31246
  className: w,
31227
- children: /* @__PURE__ */ V(iP, {
31247
+ children: /* @__PURE__ */ V(cP, {
31228
31248
  collections: e ?? [],
31229
31249
  isLoading: t,
31230
31250
  selectedId: n,
@@ -31238,8 +31258,8 @@ function oP({ collections: e, isLoading: t, selectedId: n, onSelect: r, onCreate
31238
31258
  }
31239
31259
  //#endregion
31240
31260
  //#region src/page/frames/lib/authed-download.ts
31241
- var sP = "camstack_admin_token", cP = 6e4;
31242
- function lP(e) {
31261
+ var dP = "camstack_admin_token", fP = 6e4;
31262
+ function pP(e) {
31243
31263
  if (e === null) return null;
31244
31264
  let t = /filename\*=UTF-8''([^;]+)/i.exec(e);
31245
31265
  if (t?.[1] !== void 0) try {
@@ -31247,20 +31267,20 @@ function lP(e) {
31247
31267
  } catch {}
31248
31268
  return /filename="?([^";]+)"?/i.exec(e)?.[1]?.trim() ?? null;
31249
31269
  }
31250
- async function uP(e, t) {
31251
- let n = localStorage.getItem(sP), r = {};
31270
+ async function mP(e, t) {
31271
+ let n = localStorage.getItem(dP), r = {};
31252
31272
  n !== null && (r.Authorization = `Bearer ${n}`);
31253
31273
  let i = await fetch(e, { headers: r });
31254
31274
  if (!i.ok) throw Error(`download failed: ${String(i.status)}`);
31255
- let a = await i.blob(), o = lP(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
31275
+ let a = await i.blob(), o = pP(i.headers.get("content-disposition")) ?? t, s = URL.createObjectURL(a), c = document.createElement("a");
31256
31276
  c.href = s, c.download = o, c.click(), setTimeout(() => {
31257
31277
  URL.revokeObjectURL(s);
31258
- }, cP);
31278
+ }, fP);
31259
31279
  }
31260
31280
  //#endregion
31261
31281
  //#region src/page/frames/CorpusFilterBar.tsx
31262
31282
  i();
31263
- var dP = [
31283
+ var hP = [
31264
31284
  {
31265
31285
  value: void 0,
31266
31286
  label: "All"
@@ -31277,7 +31297,7 @@ var dP = [
31277
31297
  value: "complete",
31278
31298
  label: "Complete"
31279
31299
  }
31280
- ], fP = [
31300
+ ], gP = [
31281
31301
  "person",
31282
31302
  "vehicle",
31283
31303
  "animal",
@@ -31285,10 +31305,10 @@ var dP = [
31285
31305
  "face",
31286
31306
  "plate"
31287
31307
  ];
31288
- function pP(e) {
31308
+ function _P(e) {
31289
31309
  return e ?? "all";
31290
31310
  }
31291
- function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
31311
+ function vP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, collections: i, collectionsPending: o }) {
31292
31312
  let s = ac(m(() => ({
31293
31313
  ...e.workState === void 0 ? {} : { workState: e.workState },
31294
31314
  ...e.deviceIds.length > 0 ? { deviceIds: [...e.deviceIds] } : {},
@@ -31312,7 +31332,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31312
31332
  if (s.data !== void 0) {
31313
31333
  l(!0), d(null);
31314
31334
  try {
31315
- await uP(ae(s.data.url), "camstack-retrain-export.tar");
31335
+ await mP(ae(s.data.url), "camstack-retrain-export.tar");
31316
31336
  } catch (e) {
31317
31337
  d(e instanceof Error ? e.message : String(e));
31318
31338
  } finally {
@@ -31332,8 +31352,8 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31332
31352
  role: "group",
31333
31353
  "aria-label": "Work state",
31334
31354
  "data-testid": "corpus-work-state-filter",
31335
- children: dP.map((t) => {
31336
- let n = pP(e.workState) === pP(t.value);
31355
+ children: hP.map((t) => {
31356
+ let n = _P(e.workState) === _P(t.value);
31337
31357
  return /* @__PURE__ */ V("button", {
31338
31358
  type: "button",
31339
31359
  "aria-pressed": n,
@@ -31342,12 +31362,12 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31342
31362
  },
31343
31363
  className: J(P, "px-2", n ? ne : ee),
31344
31364
  children: t.label
31345
- }, pP(t.value));
31365
+ }, _P(t.value));
31346
31366
  })
31347
31367
  }),
31348
31368
  /* @__PURE__ */ V("div", {
31349
31369
  className: "min-w-0 flex-1 basis-full sm:basis-64",
31350
- children: /* @__PURE__ */ V(fM, {
31370
+ children: /* @__PURE__ */ V(gM, {
31351
31371
  devices: n,
31352
31372
  listState: r,
31353
31373
  value: e.deviceIds,
@@ -31393,7 +31413,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31393
31413
  role: "group",
31394
31414
  "aria-label": "Annotated classes",
31395
31415
  "data-testid": "corpus-class-filter",
31396
- children: fP.map((t) => {
31416
+ children: gP.map((t) => {
31397
31417
  let n = e.classes.includes(t);
31398
31418
  return /* @__PURE__ */ V("button", {
31399
31419
  type: "button",
@@ -31416,7 +31436,7 @@ function mP({ filter: e, onChange: t, cameraItems: n, camerasListState: r, colle
31416
31436
  }
31417
31437
  //#endregion
31418
31438
  //#region src/page/frames/corpus-frame-badge.ts
31419
- function hP(e) {
31439
+ function yP(e) {
31420
31440
  switch (e) {
31421
31441
  case "unannotated": return {
31422
31442
  label: "To do",
@@ -31434,13 +31454,13 @@ function hP(e) {
31434
31454
  }
31435
31455
  //#endregion
31436
31456
  //#region src/page/frames/CorpusFrameGrid.tsx
31437
- var gP = [
31457
+ var bP = [
31438
31458
  25,
31439
31459
  50,
31440
31460
  100
31441
31461
  ];
31442
- function _P({ frame: e, cameraName: t, onOpen: n }) {
31443
- let r = tc({ frameId: e.frameId }), i = hP(e.workState), a = r.data === void 0 ? void 0 : `data:image/jpeg;base64,${r.data.base64}`;
31462
+ function xP({ frame: e, cameraName: t, onOpen: n }) {
31463
+ let r = tc({ frameId: e.frameId }), i = yP(e.workState), a = r.data === void 0 ? void 0 : `data:image/jpeg;base64,${r.data.base64}`;
31444
31464
  return /* @__PURE__ */ H("button", {
31445
31465
  type: "button",
31446
31466
  className: "group flex min-w-0 flex-col overflow-hidden rounded-md border border-border bg-surface text-left hover:border-primary/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/40",
@@ -31468,7 +31488,7 @@ function _P({ frame: e, cameraName: t, onOpen: n }) {
31468
31488
  })]
31469
31489
  });
31470
31490
  }
31471
- function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
31491
+ function SP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError: a, deviceNames: o, onPageChange: s, onPageSizeChange: c, onOpenFrame: l }) {
31472
31492
  let u = e !== void 0 && t !== void 0;
31473
31493
  return /* @__PURE__ */ H("div", {
31474
31494
  className: "space-y-3",
@@ -31490,7 +31510,7 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31490
31510
  }) : null,
31491
31511
  u && e.length > 0 ? /* @__PURE__ */ V("div", {
31492
31512
  className: "grid grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",
31493
- children: e.map((e) => /* @__PURE__ */ V(_P, {
31513
+ children: e.map((e) => /* @__PURE__ */ V(xP, {
31494
31514
  frame: e,
31495
31515
  cameraName: o.get(e.deviceId) ?? `Camera ${String(e.deviceId)}`,
31496
31516
  onOpen: () => {
@@ -31502,7 +31522,7 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31502
31522
  className: "flex flex-wrap items-center justify-between gap-2",
31503
31523
  children: [/* @__PURE__ */ V(dA, {
31504
31524
  value: r,
31505
- options: gP,
31525
+ options: bP,
31506
31526
  onChange: c,
31507
31527
  ariaLabel: "Frames per page"
31508
31528
  }), /* @__PURE__ */ V(vd, {
@@ -31519,18 +31539,18 @@ function vP({ frames: e, total: t, page: n, pageSize: r, isLoading: i, isError:
31519
31539
  //#endregion
31520
31540
  //#region src/page/frames/CorpusKpiBar.tsx
31521
31541
  i();
31522
- var yP = 8;
31523
- function bP(e, t) {
31542
+ var CP = 8;
31543
+ function wP(e, t) {
31524
31544
  return t.get(e) ?? `Camera ${String(e)}`;
31525
31545
  }
31526
- function xP(e) {
31546
+ function TP(e) {
31527
31547
  return e === null ? "—" : `${(e * 100).toFixed(0)}%`;
31528
31548
  }
31529
- function SP(e) {
31549
+ function EP(e) {
31530
31550
  return [...e].toSorted((e, t) => t.unannotated === e.unannotated ? e.deviceId - t.deviceId : t.unannotated - e.unannotated);
31531
31551
  }
31532
- function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
31533
- let [o, s] = a(!1), c = m(() => e === void 0 ? [] : SP(e.cameras), [e]), l = o ? c : c.slice(0, yP);
31552
+ function DP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera: i }) {
31553
+ let [o, s] = a(!1), c = m(() => e === void 0 ? [] : EP(e.cameras), [e]), l = o ? c : c.slice(0, CP);
31534
31554
  return /* @__PURE__ */ H("div", {
31535
31555
  className: "space-y-3",
31536
31556
  "data-testid": "corpus-kpi-bar",
@@ -31552,22 +31572,22 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31552
31572
  e === void 0 ? null : /* @__PURE__ */ H("div", {
31553
31573
  className: j,
31554
31574
  children: [
31555
- /* @__PURE__ */ V(RA, {
31575
+ /* @__PURE__ */ V(HA, {
31556
31576
  icon: $n,
31557
31577
  label: "Total frames",
31558
31578
  value: e.total
31559
31579
  }),
31560
- /* @__PURE__ */ V(RA, {
31580
+ /* @__PURE__ */ V(HA, {
31561
31581
  icon: an,
31562
31582
  label: "Unannotated",
31563
31583
  value: e.unannotated
31564
31584
  }),
31565
- /* @__PURE__ */ V(RA, {
31585
+ /* @__PURE__ */ V(HA, {
31566
31586
  icon: Vr,
31567
31587
  label: "Annotated",
31568
31588
  value: e.annotated
31569
31589
  }),
31570
- /* @__PURE__ */ V(RA, {
31590
+ /* @__PURE__ */ V(HA, {
31571
31591
  icon: rn,
31572
31592
  label: "Complete",
31573
31593
  value: e.complete
@@ -31601,10 +31621,10 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31601
31621
  className: "flex items-center justify-between gap-2",
31602
31622
  children: [/* @__PURE__ */ V("span", {
31603
31623
  className: "min-w-0 truncate font-medium text-foreground",
31604
- children: bP(e.deviceId, r)
31624
+ children: wP(e.deviceId, r)
31605
31625
  }), /* @__PURE__ */ V("span", {
31606
31626
  className: "shrink-0 text-foreground-muted",
31607
- children: xP(e.pctOfCorpus)
31627
+ children: TP(e.pctOfCorpus)
31608
31628
  })]
31609
31629
  }),
31610
31630
  /* @__PURE__ */ H("div", {
@@ -31627,7 +31647,7 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31627
31647
  }) }, e.deviceId);
31628
31648
  })
31629
31649
  }),
31630
- !o && c.length > yP ? /* @__PURE__ */ H(X, {
31650
+ !o && c.length > CP ? /* @__PURE__ */ H(X, {
31631
31651
  type: "button",
31632
31652
  variant: "ghost",
31633
31653
  size: "sm",
@@ -31648,11 +31668,11 @@ function CP({ kpi: e, isLoading: t, isError: n, deviceNames: r, onSelectCamera:
31648
31668
  }
31649
31669
  //#endregion
31650
31670
  //#region src/page/frames/corpus-filter-url.ts
31651
- var wP = new Set([
31671
+ var OP = new Set([
31652
31672
  "unannotated",
31653
31673
  "annotated",
31654
31674
  "complete"
31655
- ]), TP = new Set([
31675
+ ]), kP = new Set([
31656
31676
  "person",
31657
31677
  "vehicle",
31658
31678
  "animal",
@@ -31660,72 +31680,72 @@ var wP = new Set([
31660
31680
  "face",
31661
31681
  "plate"
31662
31682
  ]);
31663
- function EP(e) {
31683
+ function AP(e) {
31664
31684
  return e === null || e.trim() === "" ? [] : e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
31665
31685
  }
31666
- function DP(e) {
31686
+ function jP(e) {
31667
31687
  let t = [];
31668
- for (let n of EP(e)) {
31688
+ for (let n of AP(e)) {
31669
31689
  let e = Number.parseInt(n, 10);
31670
31690
  Number.isInteger(e) && e > 0 && !t.includes(e) && t.push(e);
31671
31691
  }
31672
31692
  return t;
31673
31693
  }
31674
- function OP(e) {
31675
- return TP.has(e);
31694
+ function MP(e) {
31695
+ return kP.has(e);
31676
31696
  }
31677
- function kP(e) {
31678
- return wP.has(e);
31697
+ function NP(e) {
31698
+ return OP.has(e);
31679
31699
  }
31680
- function AP(e) {
31700
+ function PP(e) {
31681
31701
  let t = [];
31682
- for (let n of EP(e)) !OP(n) || t.includes(n) || t.push(n);
31702
+ for (let n of AP(e)) !MP(n) || t.includes(n) || t.push(n);
31683
31703
  return t;
31684
31704
  }
31685
- function jP(e) {
31686
- if (!(e === null || e === "")) return kP(e) ? e : void 0;
31705
+ function FP(e) {
31706
+ if (!(e === null || e === "")) return NP(e) ? e : void 0;
31687
31707
  }
31688
- function MP(e) {
31708
+ function IP(e) {
31689
31709
  if (e === null || e === "") return 1;
31690
31710
  let t = Number.parseInt(e, 10);
31691
31711
  return Number.isInteger(t) && t >= 1 ? t : 1;
31692
31712
  }
31693
- function NP(e) {
31713
+ function LP(e) {
31694
31714
  let t = e.get("collection")?.trim() ?? "";
31695
31715
  return {
31696
- workState: jP(e.get("workState")),
31697
- deviceIds: DP(e.get("camera")),
31716
+ workState: FP(e.get("workState")),
31717
+ deviceIds: jP(e.get("camera")),
31698
31718
  collectionId: t.length > 0 ? t : void 0,
31699
- classes: AP(e.get("class")),
31700
- page: MP(e.get("page"))
31719
+ classes: PP(e.get("class")),
31720
+ page: IP(e.get("page"))
31701
31721
  };
31702
31722
  }
31703
- function PP(e, t) {
31723
+ function RP(e, t) {
31704
31724
  t.workState === void 0 ? e.delete("workState") : e.set("workState", t.workState), t.deviceIds.length === 0 ? e.delete("camera") : e.set("camera", t.deviceIds.join(",")), t.collectionId === void 0 || t.collectionId === "" ? e.delete("collection") : e.set("collection", t.collectionId), t.classes.length === 0 ? e.delete("class") : e.set("class", t.classes.join(",")), t.page <= 1 ? e.delete("page") : e.set("page", String(t.page));
31705
31725
  }
31706
- function FP(e) {
31726
+ function zP(e) {
31707
31727
  if (typeof window > "u") return;
31708
31728
  let t = new URL(window.location.href);
31709
- PP(t.searchParams, e), window.history.replaceState({}, "", t.toString());
31729
+ RP(t.searchParams, e), window.history.replaceState({}, "", t.toString());
31710
31730
  }
31711
31731
  //#endregion
31712
31732
  //#region src/page/frames/FramesSection.tsx
31713
31733
  i();
31714
- var IP = [
31734
+ var BP = [
31715
31735
  25,
31716
31736
  50,
31717
31737
  100
31718
31738
  ];
31719
- function LP() {
31739
+ function VP() {
31720
31740
  return typeof window > "u" ? {
31721
31741
  workState: void 0,
31722
31742
  deviceIds: [],
31723
31743
  collectionId: void 0,
31724
31744
  classes: [],
31725
31745
  page: 1
31726
- } : NP(new URLSearchParams(window.location.search));
31746
+ } : LP(new URLSearchParams(window.location.search));
31727
31747
  }
31728
- function RP(e, t) {
31748
+ function HP(e, t) {
31729
31749
  return {
31730
31750
  page: e.page,
31731
31751
  pageSize: t,
@@ -31735,13 +31755,13 @@ function RP(e, t) {
31735
31755
  ...e.classes.length > 0 ? { classes: [...e.classes] } : {}
31736
31756
  };
31737
31757
  }
31738
- function zP() {
31739
- let [e, t] = a(LP), [n, r] = lA({
31758
+ function UP() {
31759
+ let [e, t] = a(VP), [n, r] = lA({
31740
31760
  storageKey: "training-corpus-page-size",
31741
- options: IP,
31761
+ options: BP,
31742
31762
  defaultSize: 50
31743
31763
  }), [i, o] = a(null), c = s((e) => {
31744
- t(e), FP(e);
31764
+ t(e), zP(e);
31745
31765
  }, []), l = Ws({
31746
31766
  projection: "slim",
31747
31767
  isCamera: !0
@@ -31754,7 +31774,7 @@ function zP() {
31754
31774
  name: e.name,
31755
31775
  type: e.type,
31756
31776
  location: typeof e.location == "string" ? e.location : null
31757
- })), [l.data]), f = Zj(l), p = ec({}), h = $s(RP(e, n)), g = uc({}), _ = lc(), v = dc(), b = fc();
31777
+ })), [l.data]), f = tM(l), p = ec({}), h = $s(HP(e, n)), g = uc({}), _ = lc(), v = dc(), b = fc();
31758
31778
  y(() => {
31759
31779
  let t = h.data?.total;
31760
31780
  if (t === void 0) return;
@@ -31777,7 +31797,7 @@ function zP() {
31777
31797
  });
31778
31798
  }, [e, c]), S = s(async (t) => {
31779
31799
  let n = await _.mutateAsync({ name: t });
31780
- return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : (c({
31800
+ return await g.refetch(), n.kind === "refused" ? lP[n.reason] ?? n.reason : (c({
31781
31801
  ...e,
31782
31802
  collectionId: n.collection.id,
31783
31803
  page: 1
@@ -31792,7 +31812,7 @@ function zP() {
31792
31812
  id: e,
31793
31813
  name: t
31794
31814
  });
31795
- return await g.refetch(), n.kind === "refused" ? aP[n.reason] ?? n.reason : null;
31815
+ return await g.refetch(), n.kind === "refused" ? lP[n.reason] ?? n.reason : null;
31796
31816
  }, [v, g]), w = s(async (t) => {
31797
31817
  await b.mutateAsync({ id: t }), e.collectionId === t && c({
31798
31818
  ...e,
@@ -31815,14 +31835,14 @@ function zP() {
31815
31835
  className: "space-y-4",
31816
31836
  "data-testid": "frames-section",
31817
31837
  children: [
31818
- /* @__PURE__ */ V(CP, {
31838
+ /* @__PURE__ */ V(DP, {
31819
31839
  kpi: p.data,
31820
31840
  isLoading: p.isLoading,
31821
31841
  isError: p.isError,
31822
31842
  deviceNames: u,
31823
31843
  onSelectCamera: x
31824
31844
  }),
31825
- /* @__PURE__ */ V(oP, {
31845
+ /* @__PURE__ */ V(uP, {
31826
31846
  collections: g.data,
31827
31847
  isLoading: g.isLoading,
31828
31848
  selectedId: e.collectionId ?? null,
@@ -31837,7 +31857,7 @@ function zP() {
31837
31857
  onRename: C,
31838
31858
  onDelete: w
31839
31859
  }),
31840
- /* @__PURE__ */ V(mP, {
31860
+ /* @__PURE__ */ V(vP, {
31841
31861
  filter: e,
31842
31862
  onChange: c,
31843
31863
  cameraItems: d,
@@ -31845,7 +31865,7 @@ function zP() {
31845
31865
  collections: g.data,
31846
31866
  collectionsPending: g.isLoading && g.data === void 0
31847
31867
  }),
31848
- /* @__PURE__ */ V(vP, {
31868
+ /* @__PURE__ */ V(SP, {
31849
31869
  frames: h.data?.frames,
31850
31870
  total: h.data?.total,
31851
31871
  page: e.page,
@@ -31867,7 +31887,7 @@ function zP() {
31867
31887
  },
31868
31888
  onOpenFrame: T
31869
31889
  }),
31870
- i === null ? null : /* @__PURE__ */ V(rP, {
31890
+ i === null ? null : /* @__PURE__ */ V(sP, {
31871
31891
  open: !0,
31872
31892
  frames: D,
31873
31893
  activeFrameId: i,
@@ -31881,7 +31901,7 @@ function zP() {
31881
31901
  }
31882
31902
  //#endregion
31883
31903
  //#region src/page/view-model.ts
31884
- var BP = [
31904
+ var WP = [
31885
31905
  "uploading",
31886
31906
  "submitted",
31887
31907
  "starting",
@@ -31890,7 +31910,7 @@ var BP = [
31890
31910
  "ready",
31891
31911
  "registered",
31892
31912
  "canary"
31893
- ], VP = {
31913
+ ], GP = {
31894
31914
  queued: "Queued",
31895
31915
  uploading: "Uploading",
31896
31916
  submitted: "Submitted",
@@ -31906,7 +31926,7 @@ var BP = [
31906
31926
  lost: "Lost",
31907
31927
  expired: "Expired",
31908
31928
  discarded: "Discarded"
31909
- }, HP = new Set([
31929
+ }, KP = new Set([
31910
31930
  "ready",
31911
31931
  "registered",
31912
31932
  "canary",
@@ -31916,64 +31936,64 @@ var BP = [
31916
31936
  "expired",
31917
31937
  "discarded"
31918
31938
  ]);
31919
- function UP(e) {
31920
- return HP.has(e);
31939
+ function qP(e) {
31940
+ return KP.has(e);
31921
31941
  }
31922
- function WP(e) {
31923
- return e.some((e) => !UP(e.state));
31942
+ function JP(e) {
31943
+ return e.some((e) => !qP(e.state));
31924
31944
  }
31925
- function GP(e) {
31926
- let t = BP.indexOf(e.state);
31945
+ function YP(e) {
31946
+ let t = WP.indexOf(e.state);
31927
31947
  if (t >= 0) return t;
31928
- if (e.artifacts !== null || e.registeredModelIds.length > 0) return BP.indexOf("ready");
31948
+ if (e.artifacts !== null || e.registeredModelIds.length > 0) return WP.indexOf("ready");
31929
31949
  switch (e.provider.state) {
31930
- case "succeeded": return BP.indexOf("collecting");
31950
+ case "succeeded": return WP.indexOf("collecting");
31931
31951
  case "running":
31932
31952
  case "failed":
31933
- case "cancelled": return BP.indexOf("running");
31934
- case "starting": return BP.indexOf("starting");
31935
- case "pending": return BP.indexOf("submitted");
31953
+ case "cancelled": return WP.indexOf("running");
31954
+ case "starting": return WP.indexOf("starting");
31955
+ case "pending": return WP.indexOf("submitted");
31936
31956
  default: return 0;
31937
31957
  }
31938
31958
  }
31939
- function KP(e) {
31940
- if (e.state === "queued") return BP.map((e) => ({
31959
+ function XP(e) {
31960
+ if (e.state === "queued") return WP.map((e) => ({
31941
31961
  state: e,
31942
- label: VP[e],
31962
+ label: GP[e],
31943
31963
  status: "todo"
31944
31964
  }));
31945
- let t = !BP.includes(e.state), n = GP(e);
31946
- return BP.map((r, i) => {
31965
+ let t = !WP.includes(e.state), n = YP(e);
31966
+ return WP.map((r, i) => {
31947
31967
  let a = "todo";
31948
31968
  return i < n ? a = "done" : i === n && (a = t && e.state !== "expired" ? "failed" : "current"), {
31949
31969
  state: r,
31950
- label: VP[r],
31970
+ label: GP[r],
31951
31971
  status: a
31952
31972
  };
31953
31973
  });
31954
31974
  }
31955
- function qP(e, t) {
31975
+ function ZP(e, t) {
31956
31976
  let n = `$${e.toFixed(2)}`;
31957
31977
  return t ? `≈ ${n}` : n;
31958
31978
  }
31959
- function JP(e) {
31979
+ function QP(e) {
31960
31980
  let t = Math.max(0, Math.round(e));
31961
31981
  return t < 60 ? `${String(t)} s` : t < 3600 ? `${String(Math.floor(t / 60))} min ${String(t % 60)} s` : `${String(Math.floor(t / 3600))} h ${String(Math.floor(t % 3600 / 60))} min`;
31962
31982
  }
31963
- function YP(e) {
31983
+ function $P(e) {
31964
31984
  return e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : e < 1024 ** 3 ? `${(e / 1024 ** 2).toFixed(1)} MB` : `${(e / 1024 ** 3).toFixed(2)} GB`;
31965
31985
  }
31966
- function XP(e) {
31986
+ function eF(e) {
31967
31987
  return e == null ? "—" : `${(e * 100).toFixed(1)}%`;
31968
31988
  }
31969
- function ZP(e, t) {
31989
+ function tF(e, t) {
31970
31990
  let n = e.provider.startedAt;
31971
31991
  return n === null ? null : ((e.provider.endedAt ?? t) - n) / 1e3;
31972
31992
  }
31973
- function QP(e, t) {
31993
+ function nF(e, t) {
31974
31994
  return e?.classes[t] ?? null;
31975
31995
  }
31976
- function $P(e) {
31996
+ function rF(e) {
31977
31997
  let t = e.evaluation;
31978
31998
  return t === void 0 ? [] : [...new Set([
31979
31999
  ...Object.keys(t.baseline?.classes ?? {}),
@@ -31981,12 +32001,12 @@ function $P(e) {
31981
32001
  ...Object.keys(t.candidateInt8?.classes ?? {})
31982
32002
  ])].toSorted().map((e) => ({
31983
32003
  cls: e,
31984
- baseline: QP(t.baseline, e),
31985
- candidate: QP(t.candidate, e),
31986
- int8: QP(t.candidateInt8, e)
32004
+ baseline: nF(t.baseline, e),
32005
+ candidate: nF(t.candidate, e),
32006
+ int8: nF(t.candidateInt8, e)
31987
32007
  }));
31988
32008
  }
31989
- function eF(e) {
32009
+ function iF(e) {
31990
32010
  let t = e.evaluation?.recallDeltaByCamera ?? {}, n = [];
31991
32011
  for (let [e, r] of Object.entries(t)) for (let [t, i] of Object.entries(r)) {
31992
32012
  let r = i < -.01 ? "worse" : i > .01 ? "better" : "same";
@@ -31999,17 +32019,17 @@ function eF(e) {
31999
32019
  }
32000
32020
  return n.toSorted((e, t) => e.cls.localeCompare(t.cls) || e.deviceId - t.deviceId);
32001
32021
  }
32002
- function tF(e) {
32022
+ function aF(e) {
32003
32023
  return e === "ready" || e === "registered" || e === "canary" ? "success" : e === "failed" || e === "lost" ? "danger" : e === "cancelling" || e === "cancelled" || e === "expired" || e === "discarded" ? "default" : "info";
32004
32024
  }
32005
32025
  //#endregion
32006
32026
  //#region src/page/ComparisonTable.tsx
32007
- var nF = {
32027
+ var oF = {
32008
32028
  better: "text-success",
32009
32029
  worse: "text-danger",
32010
32030
  same: "text-foreground-muted"
32011
32031
  };
32012
- function rF({ c: e }) {
32032
+ function sF({ c: e }) {
32013
32033
  if (e === null) return /* @__PURE__ */ V("td", {
32014
32034
  className: "px-2 py-1 text-foreground-subtle",
32015
32035
  children: "—"
@@ -32019,26 +32039,26 @@ function rF({ c: e }) {
32019
32039
  className: "px-2 py-1 text-foreground",
32020
32040
  children: [
32021
32041
  "P ",
32022
- XP(e.precision),
32042
+ eF(e.precision),
32023
32043
  " · R ",
32024
- XP(e.recall),
32044
+ eF(e.recall),
32025
32045
  " · AP50 ",
32026
- XP(e.ap50),
32046
+ eF(e.ap50),
32027
32047
  /* @__PURE__ */ H("span", {
32028
32048
  className: "block text-xs text-foreground-subtle",
32029
32049
  children: [
32030
32050
  "floor ",
32031
32051
  e.floor === null ? "—" : e.floor.toFixed(2),
32032
32052
  " · night R ",
32033
- XP(t),
32053
+ eF(t),
32034
32054
  n
32035
32055
  ]
32036
32056
  })
32037
32057
  ]
32038
32058
  });
32039
32059
  }
32040
- function iF({ result: e, cameraName: t }) {
32041
- let n = $P(e), r = eF(e), i = n.some((e) => e.int8 !== null);
32060
+ function cF({ result: e, cameraName: t }) {
32061
+ let n = rF(e), r = iF(e), i = n.some((e) => e.int8 !== null);
32042
32062
  return n.length === 0 ? /* @__PURE__ */ V("p", {
32043
32063
  className: "text-sm text-foreground-muted",
32044
32064
  children: "No held-out evaluation in this result."
@@ -32079,16 +32099,16 @@ function iF({ result: e, cameraName: t }) {
32079
32099
  ")"
32080
32100
  ]
32081
32101
  }),
32082
- /* @__PURE__ */ V(rF, { c: e.baseline }),
32083
- /* @__PURE__ */ V(rF, { c: e.candidate }),
32084
- i && /* @__PURE__ */ V(rF, { c: e.int8 })
32102
+ /* @__PURE__ */ V(sF, { c: e.baseline }),
32103
+ /* @__PURE__ */ V(sF, { c: e.candidate }),
32104
+ i && /* @__PURE__ */ V(sF, { c: e.int8 })
32085
32105
  ]
32086
32106
  }, e.cls)) })]
32087
32107
  }), r.length > 0 && /* @__PURE__ */ V("ul", {
32088
32108
  className: "flex flex-wrap gap-x-4 gap-y-1 text-xs",
32089
32109
  "aria-label": "Recall change per camera",
32090
32110
  children: r.map((e) => /* @__PURE__ */ H("li", {
32091
- className: nF[e.tone],
32111
+ className: oF[e.tone],
32092
32112
  children: [
32093
32113
  t(e.deviceId),
32094
32114
  " ",
@@ -32105,10 +32125,10 @@ function iF({ result: e, cameraName: t }) {
32105
32125
  //#endregion
32106
32126
  //#region src/page/use-async.ts
32107
32127
  i();
32108
- function aF(e) {
32128
+ function lF(e) {
32109
32129
  return e instanceof Error ? e.message : String(e);
32110
32130
  }
32111
- function oF(e, t, n = {}) {
32131
+ function uF(e, t, n = {}) {
32112
32132
  let [r, i] = a({ status: "pending" }), [o, c] = a(0), l = u(e);
32113
32133
  l.current = e;
32114
32134
  let d = s(() => c((e) => e + 1), []);
@@ -32122,7 +32142,7 @@ function oF(e, t, n = {}) {
32122
32142
  }).catch((t) => {
32123
32143
  e && i({
32124
32144
  status: "error",
32125
- error: aF(t)
32145
+ error: lF(t)
32126
32146
  });
32127
32147
  }), () => {
32128
32148
  e = !1;
@@ -32146,13 +32166,13 @@ function oF(e, t, n = {}) {
32146
32166
  //#endregion
32147
32167
  //#region src/page/ResultPanel.tsx
32148
32168
  i();
32149
- function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32150
- let i = Wl(), o = oF(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = oF(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
32169
+ function dF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32170
+ let i = Wl(), o = uF(() => t.training.getJobResult.query({ id: e.id }), [e.id, e.state]), s = uF(async () => (await t.deviceManager.listAll.query({ slim: !0 })).filter((e) => e.type === "camera"), []), [c, l] = a([]), [u, d] = a(!1), [f, p] = a(null), m = async (e) => {
32151
32171
  d(!0), p(null);
32152
32172
  try {
32153
32173
  await e(), n();
32154
32174
  } catch (e) {
32155
- p(aF(e));
32175
+ p(lF(e));
32156
32176
  } finally {
32157
32177
  d(!1);
32158
32178
  }
@@ -32194,7 +32214,7 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32194
32214
  className: "space-y-3 border-t border-border pt-3",
32195
32215
  "data-testid": "result-panel",
32196
32216
  children: [
32197
- /* @__PURE__ */ V(iF, {
32217
+ /* @__PURE__ */ V(cF, {
32198
32218
  result: y,
32199
32219
  cameraName: r
32200
32220
  }),
@@ -32221,7 +32241,7 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32221
32241
  children: [
32222
32242
  b.length,
32223
32243
  " files, ",
32224
- YP(b.reduce((e, t) => e + t.bytes, 0)),
32244
+ $P(b.reduce((e, t) => e + t.bytes, 0)),
32225
32245
  " · ",
32226
32246
  y.licence
32227
32247
  ]
@@ -32329,12 +32349,12 @@ function sF({ job: e, trpc: t, onChanged: n, cameraName: r }) {
32329
32349
  }
32330
32350
  //#endregion
32331
32351
  //#region src/page/Sparkline.tsx
32332
- function cF(e, t, n) {
32352
+ function fF(e, t, n) {
32333
32353
  if (e.length === 0) return "";
32334
32354
  let r = Math.max(...e, 1e-4), i = e.length > 1 ? t / (e.length - 1) : 0;
32335
32355
  return e.map((e, t) => `${t === 0 ? "M" : "L"}${(t * i).toFixed(1)},${(n - e / r * n).toFixed(1)}`).join(" ");
32336
32356
  }
32337
- function lF({ series: e, width: t = 160, height: n = 32 }) {
32357
+ function pF({ series: e, width: t = 160, height: n = 32 }) {
32338
32358
  let r = e.map((e) => e.map50 ?? 0);
32339
32359
  if (r.length < 2) return /* @__PURE__ */ V("span", {
32340
32360
  className: "text-xs text-foreground-subtle",
@@ -32350,7 +32370,7 @@ function lF({ series: e, width: t = 160, height: n = 32 }) {
32350
32370
  viewBox: `0 0 ${String(t)} ${String(n)}`,
32351
32371
  "aria-label": "mAP50 per epoch",
32352
32372
  children: /* @__PURE__ */ V("path", {
32353
- d: cF(r, t, n),
32373
+ d: fF(r, t, n),
32354
32374
  fill: "none",
32355
32375
  stroke: "currentColor",
32356
32376
  strokeWidth: 1.5
@@ -32364,13 +32384,13 @@ function lF({ series: e, width: t = 160, height: n = 32 }) {
32364
32384
  //#endregion
32365
32385
  //#region src/page/JobDetail.tsx
32366
32386
  i();
32367
- var uF = {
32387
+ var mF = {
32368
32388
  done: "bg-primary/15 text-primary",
32369
32389
  current: "bg-primary text-primary-foreground",
32370
32390
  failed: "bg-danger text-white",
32371
32391
  todo: "bg-surface-hover text-foreground-subtle"
32372
32392
  };
32373
- function dF({ lines: e }) {
32393
+ function hF({ lines: e }) {
32374
32394
  let t = u(null);
32375
32395
  return y(() => {
32376
32396
  t.current !== null && (t.current.scrollTop = t.current.scrollHeight);
@@ -32381,8 +32401,8 @@ function dF({ lines: e }) {
32381
32401
  children: e.join("\n")
32382
32402
  });
32383
32403
  }
32384
- function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32385
- let a = ZP(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
32404
+ function gF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32405
+ let a = tF(e, Date.now()), { epoch: o, epochs: s, etaSec: c, series: l } = e.progress, u = e.state === "ready" || e.state === "registered" || e.state === "canary", d = e.request.selection.collectionIds.map((e) => i(e));
32386
32406
  return /* @__PURE__ */ H("section", {
32387
32407
  className: "space-y-3 rounded-lg border border-border bg-surface p-3 sm:p-4",
32388
32408
  "data-testid": `job-detail-${e.id}`,
@@ -32396,10 +32416,10 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32396
32416
  children: e.name
32397
32417
  }),
32398
32418
  /* @__PURE__ */ V(ll, {
32399
- variant: tF(e.state),
32400
- children: VP[e.state]
32419
+ variant: aF(e.state),
32420
+ children: GP[e.state]
32401
32421
  }),
32402
- e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
32422
+ e.stage !== null && !qP(e.state) && /* @__PURE__ */ V(ll, {
32403
32423
  variant: "info",
32404
32424
  children: e.stage
32405
32425
  }),
@@ -32424,10 +32444,10 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32424
32444
  /* @__PURE__ */ V("ol", {
32425
32445
  className: "flex flex-wrap gap-1",
32426
32446
  "aria-label": "Job progress",
32427
- children: KP(e).map((t) => /* @__PURE__ */ V("li", {
32428
- className: `rounded-full px-2 py-0.5 text-xs ${uF[t.status]}`,
32447
+ children: XP(e).map((t) => /* @__PURE__ */ V("li", {
32448
+ className: `rounded-full px-2 py-0.5 text-xs ${mF[t.status]}`,
32429
32449
  "aria-current": t.status === "current" ? "step" : void 0,
32430
- children: t.status === "failed" ? `${t.label} — ${VP[e.state]}` : t.label
32450
+ children: t.status === "failed" ? `${t.label} — ${GP[e.state]}` : t.label
32431
32451
  }, t.state))
32432
32452
  }),
32433
32453
  e.failure !== null && /* @__PURE__ */ H("p", {
@@ -32459,17 +32479,17 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32459
32479
  o,
32460
32480
  " / ",
32461
32481
  s,
32462
- c !== null && !UP(e.state) ? ` · about ${JP(c)} left` : ""
32482
+ c !== null && !qP(e.state) ? ` · about ${QP(c)} left` : ""
32463
32483
  ]
32464
32484
  })]
32465
32485
  }),
32466
- /* @__PURE__ */ V(lF, { series: l }),
32486
+ /* @__PURE__ */ V(pF, { series: l }),
32467
32487
  /* @__PURE__ */ H("p", {
32468
32488
  className: "text-xs text-foreground-muted",
32469
32489
  children: [
32470
- a !== null && `Ran ${JP(a)} · `,
32490
+ a !== null && `Ran ${QP(a)} · `,
32471
32491
  "Cost ",
32472
- qP(e.provider.costUsd, e.provider.costIsEstimate),
32492
+ ZP(e.provider.costUsd, e.provider.costIsEstimate),
32473
32493
  " of $",
32474
32494
  e.maxCostUsd.toFixed(2),
32475
32495
  " cap",
@@ -32477,8 +32497,8 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32477
32497
  e.artifacts !== null && ` · result kept on the hub until ${new Date(e.artifacts.expiresAt).toLocaleDateString()}`
32478
32498
  ]
32479
32499
  }),
32480
- /* @__PURE__ */ V(dF, { lines: e.logTail }),
32481
- u && /* @__PURE__ */ V(sF, {
32500
+ /* @__PURE__ */ V(hF, { lines: e.logTail }),
32501
+ u && /* @__PURE__ */ V(dF, {
32482
32502
  job: e,
32483
32503
  trpc: t,
32484
32504
  onChanged: n,
@@ -32490,18 +32510,18 @@ function fF({ job: e, trpc: t, onChanged: n, cameraName: r, collectionName: i })
32490
32510
  //#endregion
32491
32511
  //#region src/page/JobsTable.tsx
32492
32512
  i();
32493
- var pF = {
32513
+ var _F = {
32494
32514
  searchText: (e) => [
32495
32515
  e.name,
32496
32516
  e.id,
32497
32517
  e.request.baseModelId,
32498
32518
  e.request.gpuType,
32499
- VP[e.state],
32519
+ GP[e.state],
32500
32520
  e.stage ?? ""
32501
32521
  ],
32502
32522
  facetValue: (e) => e.state
32503
32523
  };
32504
- function mF({ job: e }) {
32524
+ function vF({ job: e }) {
32505
32525
  let { epoch: t, epochs: n } = e.progress;
32506
32526
  return t === null || n === null ? /* @__PURE__ */ V("span", {
32507
32527
  className: "text-foreground-subtle",
@@ -32515,9 +32535,9 @@ function mF({ job: e }) {
32515
32535
  ]
32516
32536
  });
32517
32537
  }
32518
- function hF({ job: e, trpc: t, onChanged: n }) {
32538
+ function yF({ job: e, trpc: t, onChanged: n }) {
32519
32539
  let r = Wl(), [i, o] = a(null);
32520
- if (UP(e.state) || e.state === "cancelling") return null;
32540
+ if (qP(e.state) || e.state === "cancelling") return null;
32521
32541
  let s = async () => {
32522
32542
  if (await r({
32523
32543
  title: "Cancel this job?",
@@ -32527,7 +32547,7 @@ function hF({ job: e, trpc: t, onChanged: n }) {
32527
32547
  })) try {
32528
32548
  await t.training.cancelJob.mutate({ id: e.id }), n();
32529
32549
  } catch (e) {
32530
- o(aF(e));
32550
+ o(lF(e));
32531
32551
  }
32532
32552
  };
32533
32553
  return /* @__PURE__ */ H("div", {
@@ -32543,8 +32563,8 @@ function hF({ job: e, trpc: t, onChanged: n }) {
32543
32563
  })]
32544
32564
  });
32545
32565
  }
32546
- function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32547
- let o = y_(e, pF), [s, c] = a(null);
32566
+ function bF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }) {
32567
+ let o = y_(e, _F), [s, c] = a(null);
32548
32568
  y(() => {
32549
32569
  if (o.rows.length === 0) {
32550
32570
  c(null);
@@ -32581,9 +32601,9 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32581
32601
  render: (e) => /* @__PURE__ */ H("span", {
32582
32602
  className: "inline-flex flex-wrap items-center gap-1",
32583
32603
  children: [/* @__PURE__ */ V(ll, {
32584
- variant: tF(e.state),
32585
- children: VP[e.state]
32586
- }), e.stage !== null && !UP(e.state) && /* @__PURE__ */ V(ll, {
32604
+ variant: aF(e.state),
32605
+ children: GP[e.state]
32606
+ }), e.stage !== null && !qP(e.state) && /* @__PURE__ */ V(ll, {
32587
32607
  variant: "info",
32588
32608
  children: e.stage
32589
32609
  })]
@@ -32607,7 +32627,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32607
32627
  key: "progress",
32608
32628
  header: "Progress",
32609
32629
  sortValue: (e) => e.progress.epoch ?? -1,
32610
- render: (e) => /* @__PURE__ */ V(mF, { job: e })
32630
+ render: (e) => /* @__PURE__ */ V(vF, { job: e })
32611
32631
  },
32612
32632
  {
32613
32633
  key: "cost",
@@ -32617,7 +32637,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32617
32637
  render: (e) => /* @__PURE__ */ H("span", {
32618
32638
  className: "font-mono text-[11px] tabular-nums",
32619
32639
  children: [
32620
- qP(e.provider.costUsd, e.provider.costIsEstimate),
32640
+ ZP(e.provider.costUsd, e.provider.costIsEstimate),
32621
32641
  " / $",
32622
32642
  e.maxCostUsd.toFixed(2)
32623
32643
  ]
@@ -32635,7 +32655,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32635
32655
  {
32636
32656
  key: "actions",
32637
32657
  align: "right",
32638
- render: (e) => /* @__PURE__ */ V(hF, {
32658
+ render: (e) => /* @__PURE__ */ V(yF, {
32639
32659
  job: e,
32640
32660
  trpc: t,
32641
32661
  onChanged: n
@@ -32652,7 +32672,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32652
32672
  /* @__PURE__ */ V(v_, {
32653
32673
  state: o.state,
32654
32674
  facets: o.facets,
32655
- facetLabel: (e) => VP[e] ?? e,
32675
+ facetLabel: (e) => GP[e] ?? e,
32656
32676
  labels: {
32657
32677
  searchPlaceholder: "Search jobs…",
32658
32678
  searchLabel: "Search jobs",
@@ -32678,7 +32698,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32678
32698
  onRowClick: (e) => c(e.id),
32679
32699
  rowClassName: (e) => e.id === s ? "bg-primary/[0.04]" : void 0
32680
32700
  }),
32681
- l !== null && /* @__PURE__ */ V(fF, {
32701
+ l !== null && /* @__PURE__ */ V(gF, {
32682
32702
  job: l,
32683
32703
  trpc: t,
32684
32704
  onChanged: n,
@@ -32690,7 +32710,7 @@ function gF({ jobs: e, trpc: t, onChanged: n, cameraName: r, collectionName: i }
32690
32710
  }
32691
32711
  //#endregion
32692
32712
  //#region src/page/cluster-root-model-rows.ts
32693
- function _F(e) {
32713
+ function xF(e) {
32694
32714
  for (let t of e.slots) for (let e of t.addons) if (e.id === "object-detection") return typeof e.defaultModelId != "string" || e.defaultModelId.length === 0 ? null : {
32695
32715
  defaultModelId: e.defaultModelId,
32696
32716
  ...e.defaultModelIdByFormat === void 0 ? {} : { defaultModelIdByFormat: e.defaultModelIdByFormat },
@@ -32703,10 +32723,10 @@ function _F(e) {
32703
32723
  };
32704
32724
  return null;
32705
32725
  }
32706
- function vF(e) {
32726
+ function SF(e) {
32707
32727
  let t = [];
32708
32728
  for (let n of e) {
32709
- let e = _F(n.schema);
32729
+ let e = xF(n.schema);
32710
32730
  e !== null && t.push({
32711
32731
  nodeId: n.nodeId,
32712
32732
  devices: n.devices,
@@ -32715,8 +32735,8 @@ function vF(e) {
32715
32735
  }
32716
32736
  return t;
32717
32737
  }
32718
- function yF(e, t) {
32719
- let n = $g(vF(t)), r = e_(n);
32738
+ function CF(e, t) {
32739
+ let n = $g(SF(t)), r = e_(n);
32720
32740
  return {
32721
32741
  models: e.map((e) => ({
32722
32742
  modelId: e.modelId,
@@ -32729,7 +32749,7 @@ function yF(e, t) {
32729
32749
  }
32730
32750
  //#endregion
32731
32751
  //#region src/page/PlanSummary.tsx
32732
- function bF({ plan: e, cameraName: t }) {
32752
+ function wF({ plan: e, cameraName: t }) {
32733
32753
  let { split: n, estimate: r } = e;
32734
32754
  return /* @__PURE__ */ H("div", {
32735
32755
  className: "space-y-2 text-sm",
@@ -32775,14 +32795,14 @@ function bF({ plan: e, cameraName: t }) {
32775
32795
  ] }),
32776
32796
  /* @__PURE__ */ H("span", { children: [
32777
32797
  "GPU time: ",
32778
- JP(r.gpuSecondsLow),
32798
+ QP(r.gpuSecondsLow),
32779
32799
  " –",
32780
32800
  " ",
32781
- JP(r.gpuSecondsHigh)
32801
+ QP(r.gpuSecondsHigh)
32782
32802
  ] }),
32783
32803
  /* @__PURE__ */ H("span", { children: [
32784
32804
  "Upload: about ",
32785
- YP(r.datasetBytes),
32805
+ $P(r.datasetBytes),
32786
32806
  ", ",
32787
32807
  r.uploadMinutesAt20Mbps,
32788
32808
  " min at 20 Mbit/s"
@@ -32802,16 +32822,16 @@ function bF({ plan: e, cameraName: t }) {
32802
32822
  }
32803
32823
  //#endregion
32804
32824
  //#region src/page/plan-form.ts
32805
- var xF = {
32825
+ var TF = {
32806
32826
  quick: "Quick — 15 epochs",
32807
32827
  standard: "Standard — 40 epochs",
32808
32828
  thorough: "Thorough — 80 epochs, nothing frozen"
32809
- }, SF = {
32829
+ }, EF = {
32810
32830
  complete: "Complete frames only",
32811
32831
  annotated_or_complete: "Annotated or complete",
32812
32832
  any_annotated: "Any annotated (incl. hard negatives)"
32813
32833
  };
32814
- function CF(e) {
32834
+ function DF(e) {
32815
32835
  let t = e.baseModelIds[0];
32816
32836
  if (e.collectionIds.length === 0 || e.entryId === "" || e.gpuType === "" || t === void 0) return null;
32817
32837
  let n = e.freeze.trim() === "" ? null : Number(e.freeze);
@@ -32829,7 +32849,7 @@ function CF(e) {
32829
32849
  holdoutCameras: e.holdoutCameras.length > 0 ? [...e.holdoutCameras] : null
32830
32850
  };
32831
32851
  }
32832
- function wF(e, t) {
32852
+ function OF(e, t) {
32833
32853
  return {
32834
32854
  ...e,
32835
32855
  entryId: t.entryId,
@@ -32837,7 +32857,7 @@ function wF(e, t) {
32837
32857
  region: t.defaults.region
32838
32858
  };
32839
32859
  }
32840
- var TF = {
32860
+ var kF = {
32841
32861
  collectionIds: [],
32842
32862
  workState: "complete",
32843
32863
  entryId: "",
@@ -32851,24 +32871,24 @@ var TF = {
32851
32871
  //#endregion
32852
32872
  //#region src/page/NewJobSection.tsx
32853
32873
  i();
32854
- function EF(e) {
32874
+ function AF(e) {
32855
32875
  if (typeof e != "object" || !e) return !1;
32856
32876
  let t = Reflect.get(e, "slots");
32857
32877
  return Array.isArray(t);
32858
32878
  }
32859
- function DF(e) {
32879
+ function jF(e) {
32860
32880
  if (typeof e != "object" || !e) return [];
32861
32881
  let t = Reflect.get(e, "devices");
32862
32882
  return Array.isArray(t) ? t.flatMap((e) => {
32863
- let t = OF(e);
32883
+ let t = MF(e);
32864
32884
  return t === null ? [] : [t];
32865
32885
  }) : [];
32866
32886
  }
32867
- function OF(e) {
32887
+ function MF(e) {
32868
32888
  if (typeof e != "object" || !e) return null;
32869
32889
  let t = Reflect.get(e, "key"), n = Reflect.get(e, "backend"), r = Reflect.get(e, "device"), i = Reflect.get(e, "enabled"), a = Reflect.get(e, "format");
32870
32890
  if (typeof t != "string" || typeof n != "string" || typeof r != "string" || typeof i != "boolean" || typeof a != "string") return null;
32871
- let o = Reflect.get(e, "defaultModelId"), s = kF(Reflect.get(e, "steps"));
32891
+ let o = Reflect.get(e, "defaultModelId"), s = NF(Reflect.get(e, "steps"));
32872
32892
  return {
32873
32893
  key: t,
32874
32894
  backend: n,
@@ -32879,7 +32899,7 @@ function OF(e) {
32879
32899
  ...s === void 0 ? {} : { steps: s }
32880
32900
  };
32881
32901
  }
32882
- function kF(e) {
32902
+ function NF(e) {
32883
32903
  if (typeof e != "object" || !e) return;
32884
32904
  let t = {};
32885
32905
  for (let [n, r] of Object.entries(e)) {
@@ -32889,8 +32909,8 @@ function kF(e) {
32889
32909
  }
32890
32910
  return t;
32891
32911
  }
32892
- function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o }) {
32893
- let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(TF), [p, h] = a(""), [g, _] = a(""), [v, b] = a(""), [x, S] = a(null), [C, T] = a(!1), [E, D] = a(!1), O = oF(async () => {
32912
+ function PF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName: i, onStarted: o }) {
32913
+ let s = Wl(), { nodes: c } = ja(), l = m(() => c.filter((e) => e.isOnline).map((e) => e.id), [c]), u = l.join("\0"), [d, f] = a(kF), [p, h] = a(""), [g, _] = a(""), [v, b] = a(""), [x, S] = a(null), [C, T] = a(!1), [E, D] = a(!1), O = uF(async () => {
32894
32914
  if (n.length === 0) return {
32895
32915
  models: [],
32896
32916
  clusterRootModelIds: []
@@ -32899,14 +32919,14 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32899
32919
  return await Promise.all(l.map(async (n) => {
32900
32920
  try {
32901
32921
  let [r, i] = await Promise.all([e.pipelineOrchestrator.getNodeInferenceDevices.query({ nodeId: n }), e.pipelineExecutor.getSchema.query({ nodeId: n })]);
32902
- if (!EF(i)) return;
32922
+ if (!AF(i)) return;
32903
32923
  t.push({
32904
32924
  nodeId: n,
32905
- devices: DF(r),
32925
+ devices: jF(r),
32906
32926
  schema: i
32907
32927
  });
32908
32928
  } catch {}
32909
- })), yF(n, t);
32929
+ })), CF(n, t);
32910
32930
  }, [u, n.map((e) => e.modelId).join("\0")]), k = O.state.status === "ok" ? O.state.data.models : n.map((e) => ({
32911
32931
  modelId: e.modelId,
32912
32932
  label: e.label,
@@ -32919,7 +32939,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32919
32939
  ...e,
32920
32940
  holdoutCameras: []
32921
32941
  }, r = t.find((e) => e.configured) ?? t[0];
32922
- return n.entryId === "" && r !== void 0 && (n = wF(n, r)), n;
32942
+ return n.entryId === "" && r !== void 0 && (n = OF(n, r)), n;
32923
32943
  });
32924
32944
  }, [t]), y(() => {
32925
32945
  if (E || O.state.status !== "ok") return;
@@ -32933,7 +32953,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32933
32953
  k,
32934
32954
  E
32935
32955
  ]);
32936
- let j = CF(d), M = oF(async () => j === null ? null : e.training.planJob.query(j), [JSON.stringify(j)]), N = M.state.status === "ok" ? M.state.data : null;
32956
+ let j = DF(d), M = uF(async () => j === null ? null : e.training.planJob.query(j), [JSON.stringify(j)]), N = M.state.status === "ok" ? M.state.data : null;
32937
32957
  y(() => {
32938
32958
  N?.defaults != null && (_(N.defaults.maxCostUsd.toFixed(2)), b((N.defaults.maxRuntimeSec / 3600).toFixed(1)));
32939
32959
  }, [N?.defaults?.maxCostUsd, N?.defaults?.maxRuntimeSec]);
@@ -32964,7 +32984,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32964
32984
  });
32965
32985
  t.kind === "refused" ? S(`Refused (${t.reason}): ${t.detail}`) : o();
32966
32986
  } catch (e) {
32967
- S(aF(e));
32987
+ S(lF(e));
32968
32988
  } finally {
32969
32989
  T(!1);
32970
32990
  }
@@ -32991,7 +33011,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
32991
33011
  value: d.entryId,
32992
33012
  onChange: (e) => {
32993
33013
  let n = t.find((t) => t.entryId === e.target.value);
32994
- n !== void 0 && f((e) => wF(e, n));
33014
+ n !== void 0 && f((e) => OF(e, n));
32995
33015
  },
32996
33016
  options: t.map((e) => ({
32997
33017
  value: e.entryId,
@@ -33035,9 +33055,9 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33035
33055
  let t = e.target.value;
33036
33056
  (t === "complete" || t === "annotated_or_complete" || t === "any_annotated") && ne({ workState: t });
33037
33057
  },
33038
- options: Object.keys(SF).map((e) => ({
33058
+ options: Object.keys(EF).map((e) => ({
33039
33059
  value: e,
33040
- label: SF[e]
33060
+ label: EF[e]
33041
33061
  }))
33042
33062
  })]
33043
33063
  }),
@@ -33062,7 +33082,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33062
33082
  children: [/* @__PURE__ */ V("span", { children: "Preset" }), /* @__PURE__ */ V(nd, {
33063
33083
  value: d.preset,
33064
33084
  onChange: (e) => ne({ preset: e.target.value === "quick" ? "quick" : e.target.value === "thorough" ? "thorough" : "standard" }),
33065
- options: Object.entries(xF).map(([e, t]) => ({
33085
+ options: Object.entries(TF).map(([e, t]) => ({
33066
33086
  value: e,
33067
33087
  label: t
33068
33088
  }))
@@ -33117,7 +33137,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33117
33137
  className: "text-sm text-danger",
33118
33138
  children: ["Could not plan: ", M.state.error]
33119
33139
  }),
33120
- N !== null && /* @__PURE__ */ V(bF, {
33140
+ N !== null && /* @__PURE__ */ V(wF, {
33121
33141
  plan: N,
33122
33142
  cameraName: i
33123
33143
  }),
@@ -33167,7 +33187,7 @@ function AF({ trpc: e, providers: t, baseModels: n, collections: r, cameraName:
33167
33187
  }
33168
33188
  //#endregion
33169
33189
  //#region src/page/SectionState.tsx
33170
- function jF({ state: e, empty: t, emptyAction: n, children: r }) {
33190
+ function FF({ state: e, empty: t, emptyAction: n, children: r }) {
33171
33191
  return e.status === "pending" ? /* @__PURE__ */ V(rd, { className: "h-16 w-full" }) : e.status === "error" ? /* @__PURE__ */ H("p", {
33172
33192
  className: "text-sm text-danger",
33173
33193
  children: ["Could not load: ", e.error]
@@ -33183,12 +33203,12 @@ function jF({ state: e, empty: t, emptyAction: n, children: r }) {
33183
33203
  //#endregion
33184
33204
  //#region src/page/JobsSection.tsx
33185
33205
  i();
33186
- function MF(e) {
33206
+ function IF(e) {
33187
33207
  let t = new Map((e ?? []).map((e) => [e.id, e.name]));
33188
33208
  return (e) => t.get(e) ?? e;
33189
33209
  }
33190
- function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: a, cameraName: o, depsPending: s, depsError: c }) {
33191
- let l = m(() => MF(r), [r]);
33210
+ function LF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJobsReload: a, cameraName: o, depsPending: s, depsError: c }) {
33211
+ let l = m(() => IF(r), [r]);
33192
33212
  return /* @__PURE__ */ H("div", {
33193
33213
  className: "space-y-4",
33194
33214
  children: [s ? /* @__PURE__ */ V(Wg, {
@@ -33211,7 +33231,7 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33211
33231
  message: c ?? "Providers, base models, or collections are unavailable."
33212
33232
  })
33213
33233
  })
33214
- }) : /* @__PURE__ */ V(AF, {
33234
+ }) : /* @__PURE__ */ V(PF, {
33215
33235
  trpc: e,
33216
33236
  providers: t,
33217
33237
  baseModels: n,
@@ -33223,10 +33243,10 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33223
33243
  title: "Jobs",
33224
33244
  children: /* @__PURE__ */ V("div", {
33225
33245
  className: `${w} space-y-3`,
33226
- children: /* @__PURE__ */ V(jF, {
33246
+ children: /* @__PURE__ */ V(FF, {
33227
33247
  state: i,
33228
33248
  empty: "No training job yet.",
33229
- children: (t) => /* @__PURE__ */ V(gF, {
33249
+ children: (t) => /* @__PURE__ */ V(bF, {
33230
33250
  jobs: t,
33231
33251
  trpc: e,
33232
33252
  onChanged: a,
@@ -33240,17 +33260,17 @@ function NF({ trpc: e, providers: t, baseModels: n, collections: r, jobs: i, onJ
33240
33260
  }
33241
33261
  //#endregion
33242
33262
  //#region src/page/provider-icon-url.ts
33243
- function PF(e, t) {
33263
+ function RF(e, t) {
33244
33264
  let n = t.trim();
33245
33265
  return n.length === 0 || n.includes("..") ? null : ae(`/api/addon-assets/${encodeURIComponent(e)}/${n}`);
33246
33266
  }
33247
33267
  //#endregion
33248
33268
  //#region src/page/ProviderSection.tsx
33249
33269
  i();
33250
- function FF(e) {
33270
+ function zF(e) {
33251
33271
  return e.map((e) => `${e.typeId}\0${e.label}\0${e.addonId}\0${e.iconAsset}`).join("\n");
33252
33272
  }
33253
- function IF({ state: e }) {
33273
+ function BF({ state: e }) {
33254
33274
  if (e.kind === "idle") return null;
33255
33275
  if (e.kind === "running") return /* @__PURE__ */ V("span", {
33256
33276
  className: "text-xs text-foreground-subtle",
@@ -33269,7 +33289,7 @@ function IF({ state: e }) {
33269
33289
  children: [t.reason ?? "refused", t.detail === void 0 ? "" : `: ${t.detail}`]
33270
33290
  });
33271
33291
  }
33272
- function LF({ entry: e, trpc: t }) {
33292
+ function VF({ entry: e, trpc: t }) {
33273
33293
  let [n, r] = a({ kind: "idle" }), i = e.defaults, o = async () => {
33274
33294
  r({ kind: "running" });
33275
33295
  try {
@@ -33283,7 +33303,7 @@ function LF({ entry: e, trpc: t }) {
33283
33303
  } catch (e) {
33284
33304
  r({
33285
33305
  kind: "error",
33286
- message: aF(e)
33306
+ message: lF(e)
33287
33307
  });
33288
33308
  }
33289
33309
  };
@@ -33331,7 +33351,7 @@ function LF({ entry: e, trpc: t }) {
33331
33351
  disabled: !e.configured || n.kind === "running",
33332
33352
  onClick: () => void o(),
33333
33353
  children: "Test credentials"
33334
- }), /* @__PURE__ */ V(IF, { state: n })]
33354
+ }), /* @__PURE__ */ V(BF, { state: n })]
33335
33355
  })
33336
33356
  ]
33337
33357
  }), /* @__PURE__ */ H("section", {
@@ -33355,11 +33375,11 @@ function LF({ entry: e, trpc: t }) {
33355
33375
  ]
33356
33376
  })] });
33357
33377
  }
33358
- function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
33359
- let i = ed("training-provider"), o = Wl(), c = LA({
33378
+ function HF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r }) {
33379
+ let i = ed("training-provider"), o = Wl(), c = VA({
33360
33380
  editKey: "edit",
33361
33381
  newKey: "new"
33362
- }), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), b = oF(() => e.trainingProvider.describe.query({}), []), x = oF(() => e.trainingProvider.describeTypes.query({}), []), S = x.state.status === "ok" ? x.state.data : null, C = S === null ? "" : FF(S), w = u(S);
33382
+ }), [l, d] = a(!1), [f, p] = a(null), [h, g] = a(""), [_, v] = a(""), b = uF(() => e.trainingProvider.describe.query({}), []), x = uF(() => e.trainingProvider.describeTypes.query({}), []), S = x.state.status === "ok" ? x.state.data : null, C = S === null ? "" : zF(S), w = u(S);
33363
33383
  w.current = S;
33364
33384
  let T = m(() => {
33365
33385
  let e = /* @__PURE__ */ new Map(), t = w.current;
@@ -33394,7 +33414,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33394
33414
  });
33395
33415
  b.reload(), x.reload(), c.openEdit(n.entryId);
33396
33416
  } catch (e) {
33397
- p(aF(e));
33417
+ p(lF(e));
33398
33418
  } finally {
33399
33419
  d(!1);
33400
33420
  }
@@ -33430,7 +33450,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33430
33450
  render: (e) => /* @__PURE__ */ H("div", {
33431
33451
  className: "flex min-w-0 items-center gap-2",
33432
33452
  children: [/* @__PURE__ */ V("img", {
33433
- src: PF(e.addonId, e.iconAsset),
33453
+ src: RF(e.addonId, e.iconAsset),
33434
33454
  alt: "",
33435
33455
  className: "h-4 w-4 shrink-0"
33436
33456
  }), /* @__PURE__ */ V("span", {
@@ -33581,7 +33601,7 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33581
33601
  className: "text-xs text-foreground-muted",
33582
33602
  children: "Create stores the entry; settings and credentials open next."
33583
33603
  })
33584
- ] }) : O === null ? null : /* @__PURE__ */ V(LF, {
33604
+ ] }) : O === null ? null : /* @__PURE__ */ V(VF, {
33585
33605
  entry: O,
33586
33606
  trpc: e
33587
33607
  })
@@ -33591,24 +33611,24 @@ function RF({ trpc: e, navigate: t, createRequested: n = !1, onCreateConsumed: r
33591
33611
  }
33592
33612
  //#endregion
33593
33613
  //#region src/page/training-tab.ts
33594
- function zF(e) {
33614
+ function UF(e) {
33595
33615
  let t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get("tab");
33596
33616
  return t === "jobs" || t === "providers" || t === "frames" ? t : "frames";
33597
33617
  }
33598
33618
  //#endregion
33599
33619
  //#region src/page.tsx
33600
33620
  i();
33601
- var BF = 5e3;
33602
- function VF(e) {
33621
+ var WF = 5e3;
33622
+ function GF(e) {
33603
33623
  let t = new URL(window.location.href);
33604
33624
  t.searchParams.set("tab", e), window.history.replaceState({}, "", t.toString());
33605
33625
  }
33606
- function HF({ trpc: e, navigate: t }) {
33607
- let [n, r] = a(() => typeof window > "u" ? "frames" : zF(window.location.search)), [i, o] = a(!1), c = s((e) => {
33608
- r(e), VF(e);
33609
- }, []), l = oF(() => e.trainingProvider.describe.query({}), []), u = oF(() => e.training.listBaseModels.query({}), []), d = oF(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = oF(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = oF(() => e.training.listJobs.query({}), [], {
33610
- pollMs: BF,
33611
- poll: WP
33626
+ function KF({ trpc: e, navigate: t }) {
33627
+ let [n, r] = a(() => typeof window > "u" ? "frames" : UF(window.location.search)), [i, o] = a(!1), c = s((e) => {
33628
+ r(e), GF(e);
33629
+ }, []), l = uF(() => e.trainingProvider.describe.query({}), []), u = uF(() => e.training.listBaseModels.query({}), []), d = uF(() => e.pipelineAnalytics.listRetrainCollections.query({}), []), f = uF(() => e.deviceManager.listAll.query({ projection: "slim" }), []), p = uF(() => e.training.listJobs.query({}), [], {
33630
+ pollMs: WF,
33631
+ poll: JP
33612
33632
  }), h = m(() => new Map(f.state.status === "ok" ? f.state.data.map((e) => [e.id, e.name]) : []), [f.state]), g = s((e) => h.get(e) ?? `#${String(e)}`, [h]), _ = l.state.status === "pending" || u.state.status === "pending" || d.state.status === "pending", v = (() => {
33613
33633
  let e = [];
33614
33634
  return l.state.status === "error" && e.push(`providers: ${l.state.error}`), u.state.status === "error" && e.push(`base models: ${u.state.error}`), d.state.status === "error" && e.push(`collections: ${d.state.error}`), e.length > 0 ? e.join("; ") : null;
@@ -33644,14 +33664,14 @@ function HF({ trpc: e, navigate: t }) {
33644
33664
  })
33645
33665
  ] })
33646
33666
  }),
33647
- n === "frames" ? /* @__PURE__ */ V(zP, {}) : null,
33648
- n === "providers" ? /* @__PURE__ */ V(RF, {
33667
+ n === "frames" ? /* @__PURE__ */ V(UP, {}) : null,
33668
+ n === "providers" ? /* @__PURE__ */ V(HF, {
33649
33669
  trpc: e,
33650
33670
  navigate: t,
33651
33671
  createRequested: i,
33652
33672
  onCreateConsumed: () => o(!1)
33653
33673
  }) : null,
33654
- n === "jobs" ? /* @__PURE__ */ V(NF, {
33674
+ n === "jobs" ? /* @__PURE__ */ V(LF, {
33655
33675
  trpc: e,
33656
33676
  providers: l.state.status === "ok" ? l.state.data : null,
33657
33677
  baseModels: u.state.status === "ok" ? u.state.data : null,
@@ -33666,4 +33686,4 @@ function HF({ trpc: e, navigate: t }) {
33666
33686
  });
33667
33687
  }
33668
33688
  //#endregion
33669
- export { BF as JOB_POLL_MS, HF as default, zF as readTrainingTab };
33689
+ export { WF as JOB_POLL_MS, KF as default, UF as readTrainingTab };