@camstack/addon-benchmark 1.2.119 → 1.2.120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MotionZonesSettings-Bx-G7x1P.mjs → MotionZonesSettings-Cm_Dvpz5.mjs} +129 -147
- package/dist/{SceneMonitorEditor-BB9ER6u6.mjs → SceneMonitorEditor-CteqhKoH.mjs} +135 -135
- package/dist/_stub.js +4655 -4189
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-CCHt4d63.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_benchmark_page-Djy8wQOo.mjs} +4 -4
- package/dist/addon-benchmark.css +1 -1
- package/dist/grid-2x2-DAxEj9uR.mjs +21 -0
- package/dist/{hostInit-DUsS2QiP.mjs → hostInit-DImjZQfo.mjs} +3 -3
- package/dist/remoteEntry.js +1 -1
- package/dist/{use-device-snapshot-DWVeIvA3.mjs → scene-monitor-copy-Dm15cpj1.mjs} +45 -45
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-7mYMB1_q.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_benchmark_page__remoteEntry_js-DnKwDDwd.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,22 @@
|
|
|
1
1
|
import { c as e, g as t, h as n, p as r, u as i, x as a } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react__loadShare__.js-GeuxDuzQ.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
["path", {
|
|
8
|
-
d: "M12 3v18",
|
|
9
|
-
key: "108xh3"
|
|
10
|
-
}],
|
|
11
|
-
["path", {
|
|
12
|
-
d: "M3 12h18",
|
|
13
|
-
key: "1i2n21"
|
|
14
|
-
}],
|
|
15
|
-
["rect", {
|
|
16
|
-
x: "3",
|
|
17
|
-
y: "3",
|
|
18
|
-
width: "18",
|
|
19
|
-
height: "18",
|
|
20
|
-
rx: "2",
|
|
21
|
-
key: "h1oib"
|
|
22
|
-
}]
|
|
23
|
-
]);
|
|
24
|
-
//#endregion
|
|
2
|
+
import { n as o, o as s, r as c, t as l } from "./responsive-CIPaE71n.mjs";
|
|
3
|
+
import { i as u, t as ee } from "./player-overlays-DuBK7_sR.mjs";
|
|
4
|
+
import { t as d } from "./grid-2x2-DAxEj9uR.mjs";
|
|
5
|
+
import { n as f, r as p, t as m } from "./_virtual_mf___mfe_internal__addon_benchmark_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-SOU_VnTj.mjs";
|
|
6
|
+
import { MaskShapeCanvas as h } from "./MaskShapeCanvas-BDvrLf-K.mjs";
|
|
25
7
|
//#region ../ui-library/src/composites/cap-settings/MotionZonesSettings.tsx
|
|
26
8
|
a();
|
|
27
|
-
var
|
|
9
|
+
var g = 110, te = "motion-zones", _ = 0, v = [
|
|
28
10
|
1,
|
|
29
11
|
2,
|
|
30
12
|
3
|
|
31
|
-
],
|
|
32
|
-
function
|
|
13
|
+
], y = 1, b = "rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors", x = "rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors";
|
|
14
|
+
function S(e, t, n) {
|
|
33
15
|
let r = t * n, i = Array.from({ length: r });
|
|
34
16
|
for (let t = 0; t < r; t += 1) i[t] = e[t] === !0;
|
|
35
17
|
return i;
|
|
36
18
|
}
|
|
37
|
-
function
|
|
19
|
+
function ne(e, t) {
|
|
38
20
|
if (e.length !== t.length) return !1;
|
|
39
21
|
for (let n = 0; n < e.length; n += 1) if (e[n] !== t[n]) return !1;
|
|
40
22
|
return !0;
|
|
@@ -62,244 +44,244 @@ function E(e, t, n, r) {
|
|
|
62
44
|
return o;
|
|
63
45
|
}
|
|
64
46
|
function D({ deviceId: a }) {
|
|
65
|
-
let
|
|
47
|
+
let w = c(s().trpcClient, a), [D, O] = t(null), [k, A] = t(!1), [j, M] = t(null), [N, P] = t(null), [F, I] = t(y), [L, R] = t(!1), [z, B] = t(!1), V = n(!1);
|
|
66
48
|
i(() => {
|
|
67
|
-
if (!
|
|
49
|
+
if (!w) return;
|
|
68
50
|
let e = !1;
|
|
69
|
-
return
|
|
51
|
+
return V.current = !1, O(null), A(!1), M(null), P(null), I(y), B(!1), (async () => {
|
|
70
52
|
try {
|
|
71
|
-
let t = await
|
|
53
|
+
let t = await w.motionZones?.getOptions({});
|
|
72
54
|
if (e) return;
|
|
73
55
|
if (!t) throw Error("device proxy not ready");
|
|
74
|
-
if (
|
|
75
|
-
let n = await
|
|
56
|
+
if (O(t), V.current) return;
|
|
57
|
+
let n = await w.motionZones?.getStatus({});
|
|
76
58
|
if (e) return;
|
|
77
59
|
if (!n) throw Error("device proxy not ready");
|
|
78
|
-
|
|
79
|
-
let r = n.regions.find((e) => e.shape.kind === "grid"), i =
|
|
80
|
-
|
|
60
|
+
V.current = !0;
|
|
61
|
+
let r = n.regions.find((e) => e.shape.kind === "grid"), i = S(r ? r.shape.cells : [], t.grid.width, t.grid.height);
|
|
62
|
+
P(i), M(T(i, t.grid.width, t.grid.height, y));
|
|
81
63
|
} catch (t) {
|
|
82
64
|
if (e) return;
|
|
83
|
-
|
|
65
|
+
o(t) ? A(!0) : console.error("Motion Zones load failed", t);
|
|
84
66
|
}
|
|
85
67
|
})(), () => {
|
|
86
68
|
e = !0;
|
|
87
69
|
};
|
|
88
|
-
}, [
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
V,
|
|
70
|
+
}, [w]);
|
|
71
|
+
let H = D ? D.grid.width : 0, U = D ? D.grid.height : 0, W = C(H, F), G = C(U, F), K = r(() => j && D ? E(j, H, U, F) : null, [
|
|
72
|
+
j,
|
|
73
|
+
D,
|
|
93
74
|
H,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
U,
|
|
76
|
+
F
|
|
77
|
+
]), q = r(() => K !== null && N !== null && !ne(K, N), [K, N]), J = r(() => K ? K.reduce((e, t) => t ? e + 1 : e, 0) : 0, [K]), Y = H * U, X = W * G, Z = e((e) => {
|
|
78
|
+
X > 0 && M(Array.from({ length: X }, () => e));
|
|
79
|
+
}, [X]), re = e(() => {
|
|
80
|
+
M((e) => e && e.map((e) => !e));
|
|
99
81
|
}, []), ie = e(() => {
|
|
100
|
-
|
|
82
|
+
N && D && M(T(N, H, U, F));
|
|
101
83
|
}, [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
V,
|
|
84
|
+
N,
|
|
85
|
+
D,
|
|
105
86
|
H,
|
|
106
|
-
|
|
87
|
+
U,
|
|
88
|
+
F
|
|
107
89
|
]), ae = e((e) => {
|
|
108
|
-
e ===
|
|
109
|
-
if (!t) return
|
|
110
|
-
let n = T(E(t,
|
|
111
|
-
return
|
|
90
|
+
e === F || !D || M((t) => {
|
|
91
|
+
if (!t) return I(e), t;
|
|
92
|
+
let n = T(E(t, H, U, F), H, U, e);
|
|
93
|
+
return I(e), n;
|
|
112
94
|
});
|
|
113
95
|
}, [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]), Q = r(() =>
|
|
119
|
-
id:
|
|
96
|
+
F,
|
|
97
|
+
D,
|
|
98
|
+
H,
|
|
99
|
+
U
|
|
100
|
+
]), Q = r(() => D && j ? [{
|
|
101
|
+
id: _,
|
|
120
102
|
shape: {
|
|
121
103
|
kind: "grid",
|
|
122
|
-
gridWidth:
|
|
123
|
-
gridHeight:
|
|
124
|
-
cells: [...
|
|
104
|
+
gridWidth: W,
|
|
105
|
+
gridHeight: G,
|
|
106
|
+
cells: [...j]
|
|
125
107
|
}
|
|
126
108
|
}] : [], [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
109
|
+
D,
|
|
110
|
+
j,
|
|
111
|
+
W,
|
|
112
|
+
G
|
|
131
113
|
]), $ = e((e, t) => {
|
|
132
|
-
t.kind === "grid" &&
|
|
114
|
+
t.kind === "grid" && M(t.cells);
|
|
133
115
|
}, []), oe = e(async () => {
|
|
134
|
-
if (!(!
|
|
135
|
-
|
|
116
|
+
if (!(!w || !j || !D)) {
|
|
117
|
+
R(!0);
|
|
136
118
|
try {
|
|
137
|
-
let e = E(
|
|
119
|
+
let e = E(j, D.grid.width, D.grid.height, F), t = {
|
|
138
120
|
kind: "grid",
|
|
139
|
-
gridWidth:
|
|
140
|
-
gridHeight:
|
|
121
|
+
gridWidth: D.grid.width,
|
|
122
|
+
gridHeight: D.grid.height,
|
|
141
123
|
cells: e
|
|
142
124
|
};
|
|
143
|
-
await
|
|
144
|
-
id:
|
|
125
|
+
await w.motionZones?.setZone({ patch: { regions: [{
|
|
126
|
+
id: _,
|
|
145
127
|
enabled: !0,
|
|
146
128
|
shape: t
|
|
147
129
|
}] } });
|
|
148
|
-
let n = await
|
|
130
|
+
let n = await w.motionZones?.getStatus({});
|
|
149
131
|
if (n) {
|
|
150
|
-
let e = n.regions.find((e) => e.shape.kind === "grid"), t =
|
|
151
|
-
|
|
132
|
+
let e = n.regions.find((e) => e.shape.kind === "grid"), t = S(e ? e.shape.cells : [], D.grid.width, D.grid.height);
|
|
133
|
+
P(t), M(T(t, D.grid.width, D.grid.height, F));
|
|
152
134
|
}
|
|
153
135
|
} catch (e) {
|
|
154
136
|
console.error("Motion Zones save failed", e);
|
|
155
137
|
} finally {
|
|
156
|
-
|
|
138
|
+
R(!1);
|
|
157
139
|
}
|
|
158
140
|
}
|
|
159
141
|
}, [
|
|
160
|
-
o,
|
|
161
|
-
A,
|
|
162
142
|
w,
|
|
163
|
-
|
|
143
|
+
j,
|
|
144
|
+
D,
|
|
145
|
+
F
|
|
164
146
|
]);
|
|
165
|
-
return
|
|
166
|
-
id:
|
|
167
|
-
order:
|
|
168
|
-
node: /* @__PURE__ */
|
|
147
|
+
return ee(r(() => z && !k && D && j ? {
|
|
148
|
+
id: te,
|
|
149
|
+
order: g,
|
|
150
|
+
node: /* @__PURE__ */ f(h, {
|
|
169
151
|
transparent: !0,
|
|
170
152
|
items: Q,
|
|
171
153
|
supportedShapes: ["grid"],
|
|
172
154
|
grid: {
|
|
173
|
-
width:
|
|
174
|
-
height:
|
|
155
|
+
width: W,
|
|
156
|
+
height: G
|
|
175
157
|
},
|
|
176
|
-
selectedId:
|
|
158
|
+
selectedId: _,
|
|
177
159
|
onSelect: () => {},
|
|
178
160
|
onShapeChange: $,
|
|
179
161
|
onDrawComplete: () => {},
|
|
180
162
|
drawingKind: null
|
|
181
163
|
})
|
|
182
164
|
} : null, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
165
|
+
z,
|
|
166
|
+
k,
|
|
167
|
+
D,
|
|
168
|
+
j,
|
|
187
169
|
Q,
|
|
188
170
|
$,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
])),
|
|
171
|
+
W,
|
|
172
|
+
G
|
|
173
|
+
])), w ? /* @__PURE__ */ f(u, {
|
|
192
174
|
title: "Motion Zones",
|
|
193
|
-
icon: /* @__PURE__ */ d
|
|
194
|
-
children: /* @__PURE__ */
|
|
175
|
+
icon: /* @__PURE__ */ f(d, { className: "h-3.5 w-3.5 text-foreground-subtle" }),
|
|
176
|
+
children: /* @__PURE__ */ f("div", {
|
|
195
177
|
className: "flex flex-col gap-3",
|
|
196
|
-
children:
|
|
178
|
+
children: k ? /* @__PURE__ */ f("p", {
|
|
197
179
|
className: `${l} leading-relaxed`,
|
|
198
180
|
children: "This camera doesn't expose an on-board motion zones grid."
|
|
199
|
-
}) : !
|
|
181
|
+
}) : !k && D !== null && j !== null ? /* @__PURE__ */ p(m, { children: [/* @__PURE__ */ p("p", {
|
|
200
182
|
className: `${l} leading-relaxed`,
|
|
201
183
|
children: [
|
|
202
184
|
"Toggle ",
|
|
203
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ f("strong", {
|
|
204
186
|
className: "text-foreground",
|
|
205
187
|
children: "Edit grid"
|
|
206
188
|
}),
|
|
207
189
|
" to paint the region directly on the live frame, then ",
|
|
208
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ f("strong", {
|
|
209
191
|
className: "text-foreground",
|
|
210
192
|
children: "Save"
|
|
211
193
|
}),
|
|
212
194
|
" to push the mask to the camera. Pick a bigger",
|
|
213
195
|
" ",
|
|
214
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ f("strong", {
|
|
215
197
|
className: "text-foreground",
|
|
216
198
|
children: "Cell size"
|
|
217
199
|
}),
|
|
218
200
|
" for quicker, broad-stroke painting — it's resampled to the camera's native ",
|
|
219
|
-
|
|
201
|
+
D.grid.width,
|
|
220
202
|
"×",
|
|
221
|
-
|
|
203
|
+
D.grid.height,
|
|
222
204
|
" grid on save (×1 is the finest)."
|
|
223
205
|
]
|
|
224
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ p("div", {
|
|
225
207
|
className: "flex items-center gap-2 flex-wrap",
|
|
226
208
|
children: [
|
|
227
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ f("button", {
|
|
228
210
|
type: "button",
|
|
229
|
-
onClick: () =>
|
|
230
|
-
disabled:
|
|
231
|
-
"aria-pressed":
|
|
232
|
-
className:
|
|
233
|
-
children:
|
|
211
|
+
onClick: () => B((e) => !e),
|
|
212
|
+
disabled: L,
|
|
213
|
+
"aria-pressed": z,
|
|
214
|
+
className: z ? x : b,
|
|
215
|
+
children: z ? "Done editing" : "Edit grid"
|
|
234
216
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ f("button", {
|
|
236
218
|
type: "button",
|
|
237
|
-
onClick: () =>
|
|
238
|
-
disabled:
|
|
239
|
-
className:
|
|
219
|
+
onClick: () => Z(!0),
|
|
220
|
+
disabled: L,
|
|
221
|
+
className: b,
|
|
240
222
|
children: "All on"
|
|
241
223
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ f("button", {
|
|
243
225
|
type: "button",
|
|
244
|
-
onClick: () =>
|
|
245
|
-
disabled:
|
|
246
|
-
className:
|
|
226
|
+
onClick: () => Z(!1),
|
|
227
|
+
disabled: L,
|
|
228
|
+
className: b,
|
|
247
229
|
children: "All off"
|
|
248
230
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ f("button", {
|
|
250
232
|
type: "button",
|
|
251
|
-
onClick:
|
|
252
|
-
disabled:
|
|
253
|
-
className:
|
|
233
|
+
onClick: re,
|
|
234
|
+
disabled: L,
|
|
235
|
+
className: b,
|
|
254
236
|
children: "Invert"
|
|
255
237
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ p("div", {
|
|
257
239
|
className: "flex items-center gap-1 ml-1",
|
|
258
240
|
role: "group",
|
|
259
241
|
"aria-label": "Cell size",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ f("span", {
|
|
261
243
|
className: `${l} mr-0.5`,
|
|
262
244
|
children: "Cell size"
|
|
263
|
-
}),
|
|
245
|
+
}), v.map((e) => /* @__PURE__ */ p("button", {
|
|
264
246
|
type: "button",
|
|
265
247
|
onClick: () => ae(e),
|
|
266
|
-
disabled:
|
|
267
|
-
"aria-pressed":
|
|
268
|
-
title: e === 1 ? `Camera grid ${
|
|
269
|
-
className:
|
|
248
|
+
disabled: L,
|
|
249
|
+
"aria-pressed": F === e,
|
|
250
|
+
title: e === 1 ? `Camera grid ${H}×${U} (finest)` : `${C(H, e)}×${C(U, e)} painting grid · cells ×${e} bigger`,
|
|
251
|
+
className: F === e ? x : b,
|
|
270
252
|
children: ["×", e]
|
|
271
253
|
}, e))]
|
|
272
254
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ p("span", {
|
|
274
256
|
className: `${l} ml-1 tabular-nums`,
|
|
275
257
|
children: [
|
|
276
|
-
q,
|
|
277
|
-
" / ",
|
|
278
258
|
J,
|
|
259
|
+
" / ",
|
|
260
|
+
Y,
|
|
279
261
|
" cells · ",
|
|
280
|
-
|
|
262
|
+
D.grid.width,
|
|
281
263
|
"×",
|
|
282
|
-
|
|
283
|
-
|
|
264
|
+
D.grid.height,
|
|
265
|
+
F === 1 ? "" : ` · paint ${W}×${G}`
|
|
284
266
|
]
|
|
285
267
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ f("span", { className: "flex-1" }),
|
|
269
|
+
/* @__PURE__ */ f("button", {
|
|
288
270
|
type: "button",
|
|
289
271
|
onClick: ie,
|
|
290
|
-
disabled:
|
|
272
|
+
disabled: L || !q,
|
|
291
273
|
className: "rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",
|
|
292
274
|
children: "Revert"
|
|
293
275
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ f("button", {
|
|
295
277
|
type: "button",
|
|
296
278
|
onClick: () => void oe(),
|
|
297
|
-
disabled:
|
|
298
|
-
className:
|
|
299
|
-
children:
|
|
279
|
+
disabled: L || !q,
|
|
280
|
+
className: x,
|
|
281
|
+
children: L ? "Saving…" : "Save"
|
|
300
282
|
})
|
|
301
283
|
]
|
|
302
|
-
})] }) : /* @__PURE__ */
|
|
284
|
+
})] }) : /* @__PURE__ */ f("p", {
|
|
303
285
|
className: `${l} leading-relaxed`,
|
|
304
286
|
children: "Loading the camera's grid…"
|
|
305
287
|
})
|