@camstack/addon-post-analysis 1.2.618 → 1.2.620
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/{clip-model-registry-D6yfX_Xq.mjs → clip-model-registry-BBzoIoKO.mjs} +221 -42
- package/dist/{clip-model-registry-CYWuH4Rx.js → clip-model-registry-CcgzpELQ.js} +250 -59
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +2 -2
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-B0Kz5Uye.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-BWQTWUYq.mjs} +3 -3
- package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CSQBGkvs.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BSMSev-b.mjs} +1 -1
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CssYIiFD.mjs +26 -0
- package/dist/pipeline-analytics/{hostInit-DjzBKo20.mjs → hostInit-WiCYRDId.mjs} +3 -3
- package/dist/pipeline-analytics/index.js +12989 -16177
- package/dist/pipeline-analytics/index.mjs +12960 -16147
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BB2kgLY1.mjs +0 -26
|
@@ -5612,7 +5612,7 @@ var ZodIssueCode = {
|
|
|
5612
5612
|
var ZodFirstPartyTypeKind;
|
|
5613
5613
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5614
5614
|
//#endregion
|
|
5615
|
-
//#region ../types/dist/sleep-
|
|
5615
|
+
//#region ../types/dist/sleep-_sV1BE2f.mjs
|
|
5616
5616
|
/**
|
|
5617
5617
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5618
5618
|
* window to float samples (D455).
|
|
@@ -5729,7 +5729,7 @@ function isKeychainStoredField(field) {
|
|
|
5729
5729
|
var SECRET_CLEAR = { $secretClear: true };
|
|
5730
5730
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
5731
5731
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
5732
|
-
function isRecord$
|
|
5732
|
+
function isRecord$6(value) {
|
|
5733
5733
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5734
5734
|
}
|
|
5735
5735
|
function makeSecretMarker(ref) {
|
|
@@ -5740,12 +5740,12 @@ function makeSecretMarker(ref) {
|
|
|
5740
5740
|
}
|
|
5741
5741
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
5742
5742
|
function isSecretMarker(value) {
|
|
5743
|
-
if (!isRecord$
|
|
5743
|
+
if (!isRecord$6(value)) return false;
|
|
5744
5744
|
const ref = value["$secret"];
|
|
5745
5745
|
return typeof ref === "string" && ref.length > 0;
|
|
5746
5746
|
}
|
|
5747
5747
|
function isSecretClear(value) {
|
|
5748
|
-
return isRecord$
|
|
5748
|
+
return isRecord$6(value) && value["$secretClear"] === true;
|
|
5749
5749
|
}
|
|
5750
5750
|
/**
|
|
5751
5751
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6355,7 +6355,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6355
6355
|
}
|
|
6356
6356
|
};
|
|
6357
6357
|
var KEEP = { kind: "keep" };
|
|
6358
|
-
function isRecord$
|
|
6358
|
+
function isRecord$5(value) {
|
|
6359
6359
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6360
6360
|
}
|
|
6361
6361
|
function defaultMintId() {
|
|
@@ -6368,7 +6368,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6368
6368
|
return out;
|
|
6369
6369
|
}
|
|
6370
6370
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6371
|
-
else if (isRecord$
|
|
6371
|
+
else if (isRecord$5(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6372
6372
|
return out;
|
|
6373
6373
|
}
|
|
6374
6374
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6423,7 +6423,7 @@ function rowId(row, idKey) {
|
|
|
6423
6423
|
return null;
|
|
6424
6424
|
}
|
|
6425
6425
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6426
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6426
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$5) : [];
|
|
6427
6427
|
if (!Array.isArray(incoming)) {
|
|
6428
6428
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6429
6429
|
return {
|
|
@@ -6439,7 +6439,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6439
6439
|
const kept = /* @__PURE__ */ new Set();
|
|
6440
6440
|
const rows = [];
|
|
6441
6441
|
for (const row of incoming) {
|
|
6442
|
-
if (!isRecord$
|
|
6442
|
+
if (!isRecord$5(row)) {
|
|
6443
6443
|
rows.push(row);
|
|
6444
6444
|
continue;
|
|
6445
6445
|
}
|
|
@@ -6464,7 +6464,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6464
6464
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6465
6465
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6466
6466
|
case "object": {
|
|
6467
|
-
if (!isRecord$
|
|
6467
|
+
if (!isRecord$5(incoming)) {
|
|
6468
6468
|
if (incoming === void 0) return KEEP;
|
|
6469
6469
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6470
6470
|
return {
|
|
@@ -6472,7 +6472,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6472
6472
|
value: incoming
|
|
6473
6473
|
};
|
|
6474
6474
|
}
|
|
6475
|
-
const storedObj = isRecord$
|
|
6475
|
+
const storedObj = isRecord$5(stored) ? stored : {};
|
|
6476
6476
|
return {
|
|
6477
6477
|
kind: "value",
|
|
6478
6478
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -6595,7 +6595,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
6595
6595
|
value: items
|
|
6596
6596
|
};
|
|
6597
6597
|
}
|
|
6598
|
-
if (isRecord$
|
|
6598
|
+
if (isRecord$5(v)) {
|
|
6599
6599
|
const out = {};
|
|
6600
6600
|
for (const [k, child] of Object.entries(v)) {
|
|
6601
6601
|
const s = substitute(child);
|
|
@@ -6627,7 +6627,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
6627
6627
|
this.name = "SecretOverwriteRefusedError";
|
|
6628
6628
|
}
|
|
6629
6629
|
};
|
|
6630
|
-
function isRecord$
|
|
6630
|
+
function isRecord$4(value) {
|
|
6631
6631
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6632
6632
|
}
|
|
6633
6633
|
function resolvedValue(pass, marker) {
|
|
@@ -6656,7 +6656,7 @@ function inArray(pass, incoming, stored) {
|
|
|
6656
6656
|
return incoming.map((item, index) => {
|
|
6657
6657
|
const twin = stored[index];
|
|
6658
6658
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
6659
|
-
if (isRecord$
|
|
6659
|
+
if (isRecord$4(item) && isRecord$4(twin)) return inArrayRow(pass, item, twin);
|
|
6660
6660
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
6661
6661
|
return item;
|
|
6662
6662
|
});
|
|
@@ -6667,7 +6667,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6667
6667
|
const twin = stored[key];
|
|
6668
6668
|
if (isSecretMarker(twin)) {
|
|
6669
6669
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
6670
|
-
} else if (isRecord$
|
|
6670
|
+
} else if (isRecord$4(value) && isRecord$4(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
6671
6671
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
6672
6672
|
}
|
|
6673
6673
|
return out;
|
|
@@ -6675,7 +6675,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
6675
6675
|
async function walk(pass, incoming, stored) {
|
|
6676
6676
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
6677
6677
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
6678
|
-
if (!isRecord$
|
|
6678
|
+
if (!isRecord$4(incoming) || !isRecord$4(stored)) return incoming;
|
|
6679
6679
|
const out = { ...incoming };
|
|
6680
6680
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
6681
6681
|
return out;
|
|
@@ -6706,7 +6706,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
6706
6706
|
function isJsonEqual(a, b) {
|
|
6707
6707
|
if (Object.is(a, b)) return true;
|
|
6708
6708
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
6709
|
-
if (isRecord$
|
|
6709
|
+
if (isRecord$4(a) && isRecord$4(b)) {
|
|
6710
6710
|
const keys = Object.keys(a);
|
|
6711
6711
|
if (keys.length !== Object.keys(b).length) return false;
|
|
6712
6712
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -6730,7 +6730,7 @@ function markerKeysOf(blob, owner) {
|
|
|
6730
6730
|
}
|
|
6731
6731
|
function nodeFromStored(value, owner) {
|
|
6732
6732
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
6733
|
-
if (!isRecord$
|
|
6733
|
+
if (!isRecord$4(value)) return null;
|
|
6734
6734
|
const children = /* @__PURE__ */ new Map();
|
|
6735
6735
|
for (const [key, child] of Object.entries(value)) {
|
|
6736
6736
|
const node = nodeFromStored(child, owner);
|
|
@@ -18318,15 +18318,6 @@ var StorageKindSchema = object({
|
|
|
18318
18318
|
declaration: RecordKindDeclarationSchema
|
|
18319
18319
|
});
|
|
18320
18320
|
method(object({ ownerPrefix: string().min(1).optional() }), object({ tables: array(StorageTableSchema) }), { auth: "admin" }), method(object({
|
|
18321
|
-
collection: string().min(1),
|
|
18322
|
-
expectRows: number().int().nonnegative()
|
|
18323
|
-
}), object({
|
|
18324
|
-
dropped: literal(true),
|
|
18325
|
-
rows: number().int().nonnegative()
|
|
18326
|
-
}), {
|
|
18327
|
-
kind: "mutation",
|
|
18328
|
-
auth: "admin"
|
|
18329
|
-
}), method(object({
|
|
18330
18321
|
owner: string().min(1).optional(),
|
|
18331
18322
|
/** `false` skips the per-kind row count (a catalog read only). Default true. */
|
|
18332
18323
|
counts: boolean().optional()
|
|
@@ -44482,12 +44473,7 @@ var NcRuleActionsSchema = object({
|
|
|
44482
44473
|
*/
|
|
44483
44474
|
buttons: array(NcRuleNotificationButtonSchema).max(8).optional()
|
|
44484
44475
|
});
|
|
44485
|
-
|
|
44486
|
-
* @deprecated Legacy inline sequence shape (pre shared-sequence store). Kept
|
|
44487
|
-
* only so boot migration / tests can recognise and rewrite persisted rows.
|
|
44488
|
-
* New code must use {@link NcSharedSequence} + {@link NcActionBinding}.
|
|
44489
|
-
*/
|
|
44490
|
-
var NcLegacyRuleActionSequenceSchema = object({
|
|
44476
|
+
object({
|
|
44491
44477
|
name: string().min(1).max(120),
|
|
44492
44478
|
enabled: boolean(),
|
|
44493
44479
|
minDelaySec: number().int().min(0).max(86400).optional(),
|
|
@@ -44893,6 +44879,15 @@ var NcMediaPolicySchema = object({
|
|
|
44893
44879
|
* Replaces `zoneCrop`.
|
|
44894
44880
|
*/
|
|
44895
44881
|
showTriggerZone: boolean().optional(),
|
|
44882
|
+
/**
|
|
44883
|
+
* Draw the SUBJECT'S PATH on the picture — a line in the subject's colour
|
|
44884
|
+
* through the track's positions up to the frame shown, the same path the
|
|
44885
|
+
* debug views draw (`buildSubjectPath`, D903). Every picture mode a subject
|
|
44886
|
+
* is drawn on: a `crop` maps the path into the crop and clips it. Valid only
|
|
44887
|
+
* on a rule whose subject is a tracked object (refused on a sound rule);
|
|
44888
|
+
* dropped on `image: 'none'`. Absent = off.
|
|
44889
|
+
*/
|
|
44890
|
+
showSubjectPath: boolean().optional(),
|
|
44896
44891
|
/** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
|
|
44897
44892
|
attach: _enum([
|
|
44898
44893
|
"best",
|
|
@@ -77590,12 +77585,6 @@ Object.freeze({
|
|
|
77590
77585
|
addonId: null,
|
|
77591
77586
|
access: "create"
|
|
77592
77587
|
},
|
|
77593
|
-
"storageAdmin.dropCollection": {
|
|
77594
|
-
capName: "storage-admin",
|
|
77595
|
-
capScope: "system",
|
|
77596
|
-
addonId: null,
|
|
77597
|
-
access: "delete"
|
|
77598
|
-
},
|
|
77599
77588
|
"storageAdmin.listKinds": {
|
|
77600
77589
|
capName: "storage-admin",
|
|
77601
77590
|
capScope: "system",
|
|
@@ -82656,22 +82645,35 @@ function resolveNcMediaImage(media, kind) {
|
|
|
82656
82645
|
}
|
|
82657
82646
|
/**
|
|
82658
82647
|
* The stored shape of a media policy: `image` set, the legacy triple gone.
|
|
82648
|
+
* `showSubjectPath` survives on a kind with a tracked subject and a picture.
|
|
82659
82649
|
* `showTriggerZone` survives only where it can be drawn — a zone trigger and a
|
|
82660
82650
|
* mode other than `crop`/`none`; a legacy `zoneCrop` on a zone rule becomes it.
|
|
82661
82651
|
* Every other field (gif, clip, rolls, speed, profile, linked cameras) is
|
|
82662
82652
|
* carried through untouched. Pure; never throws.
|
|
82663
82653
|
*/
|
|
82664
82654
|
function normalizeNcMediaPolicy(media, rule) {
|
|
82665
|
-
const
|
|
82666
|
-
const
|
|
82655
|
+
const kind = ruleKindOf(rule);
|
|
82656
|
+
const image = resolveNcMediaImage(media, kind);
|
|
82657
|
+
const { attach: _attach, frame: _frame, zoneCrop, showTriggerZone, showSubjectPath, image: _image, ...rest } = media;
|
|
82667
82658
|
const drawable = (showTriggerZone === true || media.image === void 0 && zoneCrop === true) && image !== "crop" && image !== "none" && ruleTriggerZoneIds(rule.conditions).length > 0;
|
|
82659
|
+
const pathDrawable = showSubjectPath === true && image !== "none" && subjectHasPath(kind);
|
|
82668
82660
|
return {
|
|
82669
82661
|
...rest,
|
|
82670
82662
|
image,
|
|
82671
|
-
...drawable ? { showTriggerZone: true } : {}
|
|
82663
|
+
...drawable ? { showTriggerZone: true } : {},
|
|
82664
|
+
...pathDrawable ? { showSubjectPath: true } : {}
|
|
82672
82665
|
};
|
|
82673
82666
|
}
|
|
82674
82667
|
/**
|
|
82668
|
+
* True when a rule of this kind has a TRACKED subject whose path can be drawn
|
|
82669
|
+
* (`showSubjectPath`): the kinds whose subject owns a region of the frame. A
|
|
82670
|
+
* sound owns none, and a kind that carries no media has no picture.
|
|
82671
|
+
*/
|
|
82672
|
+
function subjectHasPath(kind) {
|
|
82673
|
+
const spec = ruleKindSpec(kind);
|
|
82674
|
+
return spec.carriesMedia && spec.carriesSubjectCrop;
|
|
82675
|
+
}
|
|
82676
|
+
/**
|
|
82675
82677
|
* Why a media policy cannot be SAVED on this rule, or null. Server-side and
|
|
82676
82678
|
* editor alike: `showTriggerZone` on a rule whose trigger is not a zone, and a
|
|
82677
82679
|
* mode the rule's kind cannot honour.
|
|
@@ -82683,6 +82685,7 @@ function ncMediaPolicyError(media, rule) {
|
|
|
82683
82685
|
if (offered.length > 0 && !offered.includes(media.image)) return `media.image '${media.image}' is not available for a ${kind} rule (offered: ${offered.join(", ")})`;
|
|
82684
82686
|
}
|
|
82685
82687
|
if (media.showTriggerZone === true && ruleTriggerZoneIds(rule.conditions).length === 0) return "media.showTriggerZone needs a rule triggered by a zone (a zones condition or an occupancy zone)";
|
|
82688
|
+
if (media.showSubjectPath === true && !subjectHasPath(kind)) return `media.showSubjectPath needs a rule whose subject is a tracked object (not a ${kind} rule)`;
|
|
82686
82689
|
return null;
|
|
82687
82690
|
}
|
|
82688
82691
|
var WEEKDAY_TO_DAY = {
|
|
@@ -82765,6 +82768,182 @@ function isScheduleActive(schedule, atMs) {
|
|
|
82765
82768
|
}
|
|
82766
82769
|
return schedule.invert === true ? !inside : inside;
|
|
82767
82770
|
}
|
|
82771
|
+
var clamp01 = (n) => n < 0 ? 0 : n > 1 ? 1 : n;
|
|
82772
|
+
/** The sample of a normalised box: its centre, its extent. */
|
|
82773
|
+
function subjectPathSampleFromBox(bbox, timestamp) {
|
|
82774
|
+
return {
|
|
82775
|
+
x: bbox.x + bbox.w / 2,
|
|
82776
|
+
y: bbox.y + bbox.h / 2,
|
|
82777
|
+
w: bbox.w,
|
|
82778
|
+
h: bbox.h,
|
|
82779
|
+
...timestamp !== void 0 ? { timestamp } : {}
|
|
82780
|
+
};
|
|
82781
|
+
}
|
|
82782
|
+
function isPlaceholder(s) {
|
|
82783
|
+
return s.w !== void 0 && s.h !== void 0 && s.w >= .85 && s.h >= .85;
|
|
82784
|
+
}
|
|
82785
|
+
function downsample(xs, max) {
|
|
82786
|
+
if (xs.length <= max || max < 2) return xs;
|
|
82787
|
+
const step = (xs.length - 1) / (max - 1);
|
|
82788
|
+
const out = [];
|
|
82789
|
+
for (let i = 0; i < max - 1; i++) {
|
|
82790
|
+
const x = xs[Math.round(i * step)];
|
|
82791
|
+
if (x !== void 0) out.push(x);
|
|
82792
|
+
}
|
|
82793
|
+
const last = xs[xs.length - 1];
|
|
82794
|
+
if (last !== void 0) out.push(last);
|
|
82795
|
+
return out;
|
|
82796
|
+
}
|
|
82797
|
+
function isFiniteSample(s) {
|
|
82798
|
+
return Number.isFinite(s.x) && Number.isFinite(s.y);
|
|
82799
|
+
}
|
|
82800
|
+
/**
|
|
82801
|
+
* The path of one track from its samples (normalised, oldest → newest).
|
|
82802
|
+
* Pure; never throws; malformed samples are skipped.
|
|
82803
|
+
*/
|
|
82804
|
+
function buildSubjectPath(samples, opts) {
|
|
82805
|
+
const until = opts?.untilTimestamp;
|
|
82806
|
+
const nodes = [];
|
|
82807
|
+
let unlocalized = 0;
|
|
82808
|
+
let tail = null;
|
|
82809
|
+
for (let index = 0; index < samples.length; index++) {
|
|
82810
|
+
const s = samples[index];
|
|
82811
|
+
if (s === void 0 || !isFiniteSample(s)) continue;
|
|
82812
|
+
if (until !== void 0 && s.timestamp !== void 0 && s.timestamp > until) continue;
|
|
82813
|
+
if (isPlaceholder(s)) {
|
|
82814
|
+
unlocalized += 1;
|
|
82815
|
+
continue;
|
|
82816
|
+
}
|
|
82817
|
+
const ts = s.timestamp !== void 0 && Number.isFinite(s.timestamp) ? s.timestamp : index;
|
|
82818
|
+
const x = clamp01(s.x);
|
|
82819
|
+
const y = clamp01(s.y);
|
|
82820
|
+
const prev = nodes[nodes.length - 1];
|
|
82821
|
+
if (prev !== void 0 && Math.hypot(x - prev.x, y - prev.y) < .005) {
|
|
82822
|
+
nodes[nodes.length - 1] = {
|
|
82823
|
+
...prev,
|
|
82824
|
+
samples: prev.samples + 1,
|
|
82825
|
+
lastTs: Math.max(prev.lastTs, ts)
|
|
82826
|
+
};
|
|
82827
|
+
tail = {
|
|
82828
|
+
x,
|
|
82829
|
+
y,
|
|
82830
|
+
samples: 1,
|
|
82831
|
+
firstTs: ts,
|
|
82832
|
+
lastTs: ts
|
|
82833
|
+
};
|
|
82834
|
+
continue;
|
|
82835
|
+
}
|
|
82836
|
+
tail = null;
|
|
82837
|
+
nodes.push({
|
|
82838
|
+
x,
|
|
82839
|
+
y,
|
|
82840
|
+
samples: 1,
|
|
82841
|
+
firstTs: ts,
|
|
82842
|
+
lastTs: ts
|
|
82843
|
+
});
|
|
82844
|
+
}
|
|
82845
|
+
const end = nodes[nodes.length - 1];
|
|
82846
|
+
if (tail !== null && end !== void 0 && end.samples > 1 && (tail.x !== end.x || tail.y !== end.y)) {
|
|
82847
|
+
nodes[nodes.length - 1] = {
|
|
82848
|
+
...end,
|
|
82849
|
+
samples: end.samples - 1
|
|
82850
|
+
};
|
|
82851
|
+
nodes.push(tail);
|
|
82852
|
+
}
|
|
82853
|
+
return {
|
|
82854
|
+
nodes: downsample(nodes, opts?.maxPoints ?? 120),
|
|
82855
|
+
unlocalized
|
|
82856
|
+
};
|
|
82857
|
+
}
|
|
82858
|
+
/** True when the path has something to draw (two nodes or more). */
|
|
82859
|
+
function isDrawableSubjectPath(path) {
|
|
82860
|
+
return path.nodes.length >= 2;
|
|
82861
|
+
}
|
|
82862
|
+
function inside(p) {
|
|
82863
|
+
return p.x >= 0 && p.x <= 1 && p.y >= 0 && p.y <= 1;
|
|
82864
|
+
}
|
|
82865
|
+
/** Liang–Barsky: the part of segment a→b inside the unit square, or null. */
|
|
82866
|
+
function clipSegment(a, b) {
|
|
82867
|
+
const dx = b.x - a.x;
|
|
82868
|
+
const dy = b.y - a.y;
|
|
82869
|
+
let t0 = 0;
|
|
82870
|
+
let t1 = 1;
|
|
82871
|
+
const edges = [
|
|
82872
|
+
[-dx, a.x],
|
|
82873
|
+
[dx, 1 - a.x],
|
|
82874
|
+
[-dy, a.y],
|
|
82875
|
+
[dy, 1 - a.y]
|
|
82876
|
+
];
|
|
82877
|
+
for (const [p, q] of edges) {
|
|
82878
|
+
if (p === 0) {
|
|
82879
|
+
if (q < 0) return null;
|
|
82880
|
+
continue;
|
|
82881
|
+
}
|
|
82882
|
+
const r = q / p;
|
|
82883
|
+
if (p < 0) {
|
|
82884
|
+
if (r > t1) return null;
|
|
82885
|
+
if (r > t0) t0 = r;
|
|
82886
|
+
} else {
|
|
82887
|
+
if (r < t0) return null;
|
|
82888
|
+
if (r < t1) t1 = r;
|
|
82889
|
+
}
|
|
82890
|
+
}
|
|
82891
|
+
return [{
|
|
82892
|
+
x: a.x + t0 * dx,
|
|
82893
|
+
y: a.y + t0 * dy
|
|
82894
|
+
}, {
|
|
82895
|
+
x: a.x + t1 * dx,
|
|
82896
|
+
y: a.y + t1 * dy
|
|
82897
|
+
}];
|
|
82898
|
+
}
|
|
82899
|
+
function samePoint(a, b) {
|
|
82900
|
+
return Math.abs(a.x - b.x) < 1e-9 && Math.abs(a.y - b.y) < 1e-9;
|
|
82901
|
+
}
|
|
82902
|
+
/**
|
|
82903
|
+
* The path as seen through `view` — a normalised rectangle of the frame (the
|
|
82904
|
+
* whole frame `{0,0,1,1}`, or the rectangle a crop cut). Points are re-mapped
|
|
82905
|
+
* into the view's own 0..1 space and the line is CLIPPED to it: a path that
|
|
82906
|
+
* leaves the crop and comes back is two runs. Runs of fewer than two points
|
|
82907
|
+
* are dropped, so an empty result means "nothing to draw".
|
|
82908
|
+
*/
|
|
82909
|
+
function projectSubjectPath(points, view) {
|
|
82910
|
+
if (points.length < 2 || !(view.w > 0) || !(view.h > 0)) return [];
|
|
82911
|
+
const local = points.map((p) => ({
|
|
82912
|
+
x: (p.x - view.x) / view.w,
|
|
82913
|
+
y: (p.y - view.y) / view.h
|
|
82914
|
+
}));
|
|
82915
|
+
const runs = [];
|
|
82916
|
+
let run = [];
|
|
82917
|
+
for (let i = 1; i < local.length; i++) {
|
|
82918
|
+
const a = local[i - 1];
|
|
82919
|
+
const b = local[i];
|
|
82920
|
+
if (a === void 0 || b === void 0) continue;
|
|
82921
|
+
const seg = clipSegment(a, b);
|
|
82922
|
+
if (seg === null) {
|
|
82923
|
+
if (run.length >= 2) runs.push(run);
|
|
82924
|
+
run = [];
|
|
82925
|
+
continue;
|
|
82926
|
+
}
|
|
82927
|
+
const [from, to] = seg;
|
|
82928
|
+
const last = run[run.length - 1];
|
|
82929
|
+
if (last === void 0 || !samePoint(last, from)) {
|
|
82930
|
+
if (run.length >= 2) runs.push(run);
|
|
82931
|
+
run = [from];
|
|
82932
|
+
}
|
|
82933
|
+
run.push(to);
|
|
82934
|
+
if (!inside(b)) {
|
|
82935
|
+
if (run.length >= 2) runs.push(run);
|
|
82936
|
+
run = [];
|
|
82937
|
+
}
|
|
82938
|
+
}
|
|
82939
|
+
if (run.length >= 2) runs.push(run);
|
|
82940
|
+
return runs;
|
|
82941
|
+
}
|
|
82942
|
+
/** An SVG `points` attribute for a run in a `width` × `height` drawing ("x,y x,y …"). */
|
|
82943
|
+
function subjectPathSvgPoints(run, width, height) {
|
|
82944
|
+
const fmt = (v) => String(Math.round(v * 100) / 100);
|
|
82945
|
+
return run.map((p) => `${fmt(p.x * width)},${fmt(p.y * height)}`).join(" ");
|
|
82946
|
+
}
|
|
82768
82947
|
var ARMED_WORD_PREFIX = "armed_";
|
|
82769
82948
|
var ALARM_PANEL_CAP = "alarm-panel";
|
|
82770
82949
|
var ALARM_PANEL_TRIGGER_METHOD = "trigger";
|
|
@@ -86358,4 +86537,4 @@ function buildClipModelRegistry(entries) {
|
|
|
86358
86537
|
/** The built-in catalog's registry. */
|
|
86359
86538
|
var BUILTIN_CLIP_MODELS = buildClipModelRegistry(CLIP_IMAGE_MODELS);
|
|
86360
86539
|
//#endregion
|
|
86361
|
-
export { MediaFileKindEnum as $,
|
|
86540
|
+
export { MediaFileKindEnum as $, isDeviceScopedCap as $i, cosineSimilarity as $n, projectSubjectPath as $r, OpsLogEntrySchema as $t, DeclaredDevices as A, systemEventFilterApplies as Ai, activateAlarmProfile as An, isEventOwnerType as Ar, NcAlarmSensorsInputSchema as At, FULL_IMAGE_BBOX as B, evaluateSensorEdge as Bi, applySecureOnArmEdit as Bn, kebabToCamel as Br, NcRuleUpdateInputSchema as Bt, ClearTrackRelationResultSchema as C, subKindsOf as Ci, TimelapseRulePatchSchema as Cn, isAlertEpisodeSeverity as Cr, NC_SNOOZE_MAX_MINUTES as Ct, DEFAULT_TIMELAPSE_PREVIEW_TEXT as D, syncActiveAlarmProfileSettings as Di, TrackRelationSchema as Dn, isDetectionMacroClass as Dr, NC_TEMPLATE_VARS as Dt, DEFAULT_EVENT_COLOR as E, summarizeReview as Ei, TrackRelationKindSchema as En, isDefaultAlarmProfileId as Er, NC_TAXONOMY as Et, EVENT_DENSITY_BATCH_MAX as F, vectorDimFromBase64 as Fi, alertEpisodeKind as Fn, isRootSuppliableStepId as Fr, NcRuleActionSchema as Ft, ListTrackRelationsResultSchema as G, CamProfileSchema as Gi, buildEventKindDescriptor as Gn, normalizeNcMediaPolicy as Gr, NcSnoozeSuppressedSchema as Gt, LABEL_SUPPLY_MACRO as H, DeviceType as Hi, assertTimelapseCadences as Hn, mayWriteToLocation as Hr, NcSharedSequenceSchema as Ht, EVENT_KIND_BY_CAP as I, viewerLinkBaseOf as Ii, alertEpisodePayload as In, isScheduleActive as Ir, NcRuleInputSchema as It, MAX_BIRTH_DECISION_RECORDS as J, createEvent as Ji, calendarEventLocalSpan as Jn, parseAlertEpisodePayload as Jr, NcTaxonomySchema as Jt, LockStateSchema as K, RECORD_MAX_DATA_BYTES as Ki, buildSubjectPath as Kn, notificationRulesCapability as Kr, NcStateSummarySectionIdSchema as Kt, EVENT_OWNER_TYPES as L, zoneAnalyticsCapability as Li, applyBlockingEdit as Ln, isSystemDelivery as Lr, NcRulePatchSchema as Lt, EMBEDDING_MODEL_FAILED as M, systemEventSummarySplitOf as Mi, alarmDeviceSecureOnArm as Mn, isLabelSupplyStepId as Mr, NcAlarmSettingsPatchSchema as Mt, EMBEDDING_REQUIREMENTS_FAILED as N, templateCarriesSummary as Ni, alarmPanelCapability as Nn, isMediaOwnerType as Nr, NcConditionDescriptorSchema as Nt, DETECTION_MACRO_CLASSES as O, systemEventDeliveryProblems as Oi, TrackSideSchema as On, isDrawableSubjectPath as Or, NcAlarmConfigSchema as Ot, EMBEDDING_REQUIREMENTS_UNAVAILABLE as P, templateVarsFor as Pi, alertEpisodeId as Pn, isRetiredClearKey as Pr, NcConditionsSchema as Pt, MOTION_CLOSE_AFTER_MS as Q, hydrateSchema as Qi, coreBlockIdFromAddonId as Qn, plateGalleryCapability as Qr, OPS_LOG_DEFAULT_LIMIT as Qt, EXPORT_DENSE_MAX_RANGES as R, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Ri, applyModeDelaysEdits as Rn, isSystemEventSummaryRule as Rr, NcRuleSchema as Rt, ClearTrackRelationInputSchema as S, storageOccupancyCapability as Si, TimelapseRuleInputSchema as Sn, isAlertEpisodeOpen as Sr, NC_SENSOR_TRANSITION_KINDS as St, DEFAULT_DETAIL_CROP_CONVENTION as T, subjectPathSvgPoints as Ti, TrackPuritySchema as Tn, isAudioClassName as Tr, NC_TANK_SYSTEM_EVENT_KINDS as Tt, LabelAttributionSchema as U, errMsg as Ui, audioMetricsCapability as Un, memoizePinnedFfmpeg as Ur, NcSnoozeInputSchema as Ut, FailureCounters as V, isSourceCap as Vi, armRemovalReconcile as Vn, linkedStepOf as Vr, NcScheduleSchema as Vt, ListTrackRelationsInputSchema as W, BaseAddon as Wi, audioModeOf as Wn, ncMediaPolicyError as Wr, NcSnoozeSchema as Wt, MAX_TRACK_PURITIES as X, defineCustomActions as Xi, cloneAlarmSettings as Xn, pickFaceRescoreIntervalMinutes as Xr, NcTemplatePreviewSchema as Xt, MAX_BIRTH_LATENCY_PROXY_MS as Y, customAction as Yi, classifyRetrainReview as Yn, parseProcStatus as Yr, NcTemplatePreviewInputSchema as Yt, MAX_TRACK_RELATIONS as Z, defineRecordKinds as Zi, consumableLowPercentOf as Zn, pipelineAnalyticsCapability as Zr, NcTemplateVarDescriptorSchema as Zt, BIRTH_DECISION_DEFAULT_LIMIT as _, tuple as _a, sceneMonitorCapability as _i, SetTrackPurityInputSchema as _n, faceGalleryCapability as _r, NC_CONSUMABLE_SYSTEM_EVENT_KINDS as _t, CLIP_EMBEDDING_STEP_ID as a, array as aa, resolveLocationMode as ai, RetrainOriginSchema as an, describeSystemEventDeliveryProblem as ar, NC_ALARM_NOTIFY_FIELDS as at, BucketAccumulator as b, EventCategory as ba, servedTemplateVars as bi, TIMELAPSE_DENSE_FLOOR_SEC as bn, gifFromMp4Args as br, NC_GROUPING_MAX_SEC as bt, readClusterModelPinStrict as c, literal as ca, resolveNcMediaImage as ci, SCENE_CONFIRM_DEFAULT_TIMEOUT_MS as cn, embeddingEncoderCapability as cr, NC_AUDIO_CONFIRM_HITS_DEFAULT as ct, APPEARANCE_BLOCKS as d, object as da, rootSupplyServes as di, SCENE_DEFAULT_OBSERVATION_SPACING_SEC as dn, embeddingRequirementsFailedError as dr, NC_CLIP_PRE_ROLL_DEFAULT_SEC as dt, nodePin as ea, readDeviceStateFrom as ei, PoolMemoryWatchdog as en, createAlarmProfile as er, MotionTriggeredBySchema as et, APPEARANCE_RESOLVES_AMBIGUITY_DEFAULT as f, partialRecord as fa, ruleAutoTriggersAlarm as fi, SCENE_DEFAULT_QUIET_SECONDS as fn, embeddingRequirementsUnavailableError as fr, NC_CLIP_RETENTION_MAX_SEC as ft, ArchivedDebugNoteSchema as g, templateLiteral as ga, ruleKindOf as gi, SceneMonitorSchema as gn, evictionPolicyOfLocation as gr, NC_CONSUMABLE_LOW_PERCENT_DEFAULT as gt, AlarmArmModeSchema as h, string as ha, ruleGroupingApplies as hi, SCENE_RESET_RECAPTURES as hn, eventKindLabel as hr, NC_CONFIRM_DEFAULT_TIMEOUT_MS as ht, CLIP_TEXT_MODELS as i, _enum as ia, resolveClipSearchMinScore as ii, RetrainDismissedSchema as in, deriveRecordingMode as ir, NC_ALARM_DELAY_MAX_SEC as it, DetectionSourceSchema as j, systemEventSummaryScheduleOf as ji, addonWidgetsSourceCapability as jn, isKnownTemplateVar as jr, NcAlarmSensorsSchema as jt, DETECTION_PIPELINE_CAP_NAME as k, systemEventFamilyProblems as ki, TrackSourceSchema as kn, isEventKindLabelKey as kr, NcAlarmPostTriggeredActionSchema as kt, resolveClusterModelPin as l, looseObject as la, resolvePoolMemoryPolicy as li, SCENE_DEFAULT_ANCHOR_THRESHOLD as ln, embeddingModelFailedError as lr, NC_AUDIO_CONFIRM_WINDOW_SEC_DEFAULT as lt, AUDIO_MACRO_LABELS as m, strictObject as ma, ruleDeviceCompatCapQueries as mi, SCENE_DIVERGED as mn, ensureAlarmProfiles as mr, NC_CONFIRM_DEFAULT_MAX_IMAGE_PX as mt, DEFAULT_CLIP_MODEL as n, sleep as na, readTimelapseGeneratedAt as ni, RECORDING_SOURCE_CAMSTACK_ADDON as nn, deriveDetailCropRect as nr, NC_ALARM_DEFAULT_TRIGGERED_DURATION_SEC as nt, CLUSTER_MODEL_OWNER_ADDON_ID as o, boolean as oa, resolveModeDelays as oi, RetrainStatusSchema as on, describeSystemEventFamilyProblem as or, NC_ALARM_SYSTEM_EVENT_KINDS as ot, ARCHIVED_DEBUG_NOTES_DEFAULT_LIMIT as p, record as pa, ruleBelongsToAlarm as pi, SCENE_DEFAULT_UNCOVERED_POLICY as pn, encodeVectorBase64 as pr, NC_CONDITION_CATALOG as pt, MAX_ARCHIVED_DEBUG_NOTES as q, RECORD_QUERY_MAX as qi, buildViewerLink as qn, occupancyScope as qr, NcSystemEventKindSchema as qt, CLIP_IMAGE_MODELS as r, ZodObject as ra, renameAlarmProfile as ri, RebuildObjectEmbeddingsRefusalSchema as rn, derivePostTriggeredAction as rr, NC_ALARM_DELAY_FIELDS as rt, FACE_EMBEDDING_STEP_ID as s, discriminatedUnion as sa, resolveModeNotifyPolicy as si, SCENE_CONFIRM_DEFAULT_MAX_IMAGE_PX as sn, deviceRemovalHookCapability as sr, NC_ALARM_TRIGGERED_MAX_SEC as st, BUILTIN_CLIP_MODELS as t, normalizeNodeId as ta, readMotionTriggeredBy as ti, RECORDING_EXPORT_MAX_READ_BYTES as tn, deleteAlarmProfile as tr, NC_ALARM_DEFAULT_PROFILE_ID as tt, APPEARANCE_BIN_COUNT as u, number as ua, retrainRevisionConflictMessage as ui, SCENE_DEFAULT_CHECK_INTERVAL_SEC as un, embeddingRefusalOf as ur, NC_CLIP_POST_ROLL_DEFAULT_SEC as ut, BaseDevice as v, union as va, secureActuationFor as vi, SetTrackPurityResultSchema as vn, failureContributionCapability as vr, NC_DEFAULT_SNOOZE_MINUTES as vt, CoverStateSchema as w, subjectPathSampleFromBox as wi, TimelapseRuleSchema as wn, isAppLinkBase as wr, NC_SYSTEM_EVENT_KIND_GROUP_SPECS as wt, COCO_TO_MACRO as x, startMoverUnderClearance as xi, TRACK_RELATIONS_DEFAULT_LIMIT as xn, isAlarmControllableCap as xr, NC_GROUPING_MIN_SEC as xt, BirthDecisionRecordSchema as y, unknown as ya, sensorRaisedOf as yi, SetTrackRelationInputSchema as yn, gifDeriveSpeed as yr, NC_GROUPING_DEFAULT_SEC as yt, FIRST_LEVEL_MACRO_CLASSES as z, canonicalHash as zi, applyNonBlockingEdit as zn, isVectorIndexDimConflict as zr, NcRuleTargetSchema as zt };
|