@camstack/addon-pipeline 1.2.197 → 1.2.199

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/audio-analyzer/index.js +2 -2
  2. package/dist/audio-analyzer/index.mjs +2 -2
  3. package/dist/{default-detection-model-CM-8U0Bb.js → default-detection-model-CMe44Kid.js} +1 -1
  4. package/dist/{default-detection-model-CplzzTmN.mjs → default-detection-model-O1uBusV2.mjs} +1 -1
  5. package/dist/detection-pipeline/index.js +5 -5
  6. package/dist/detection-pipeline/index.mjs +4 -4
  7. package/dist/{dist-Y4BsF_EC.mjs → dist-B23u1tmN.mjs} +102 -38
  8. package/dist/{dist-CBa1j3On.js → dist-DmCrC2yx.js} +107 -37
  9. package/dist/{lazy-sharp-CS5WE9mI.js → lazy-sharp-DBHsD2lh.js} +1 -1
  10. package/dist/motion-wasm/index.js +2 -2
  11. package/dist/motion-wasm/index.mjs +1 -1
  12. package/dist/{node-B5ouEQYN.mjs → node-D1MLn6oV.mjs} +1 -1
  13. package/dist/{node-C-B8VuGi.js → node-DCSTbt6C.js} +1 -1
  14. package/dist/pipeline-runner/index.js +5 -5
  15. package/dist/pipeline-runner/index.mjs +4 -4
  16. package/dist/{retire-root-keys-Csb8z2f3.js → prebuffer-DmBYRQWg.mjs} +64 -12
  17. package/dist/{retire-root-keys-DZvlso2l.mjs → prebuffer-DqdeLSsk.js} +99 -1
  18. package/dist/{process-memory-CmeKr_MZ.js → process-memory-9lvvhHym.js} +1 -1
  19. package/dist/{process-memory-DeO2OZ3-.mjs → process-memory-P24NTDb1.mjs} +1 -1
  20. package/dist/recorder/index.js +26 -18
  21. package/dist/recorder/index.mjs +22 -14
  22. package/dist/{segment-demux-js-DXPgq2cf.mjs → segment-demux-js-Bm0woPkn.mjs} +1 -1
  23. package/dist/{segment-demux-js-DiIsywGz.js → segment-demux-js-Ck_F5bsO.js} +1 -1
  24. package/dist/session-decode/decode-worker-child.js +2 -2
  25. package/dist/session-decode/decode-worker-child.mjs +1 -1
  26. package/dist/stream-broker/_stub.js +28 -31
  27. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Q-6HzWJ0.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Sq93hI-g.mjs} +3 -3
  28. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cv5McbTI.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BcjLrxhF.mjs} +1 -1
  29. package/dist/stream-broker/demux-worker-child.js +1 -1
  30. package/dist/stream-broker/demux-worker-child.mjs +1 -1
  31. package/dist/stream-broker/{hostInit-C-2Eo_nr.mjs → hostInit-COt259tU.mjs} +3 -3
  32. package/dist/stream-broker/index.js +452 -541
  33. package/dist/stream-broker/index.mjs +448 -537
  34. package/dist/stream-broker/remoteEntry.js +1 -1
  35. package/dist/{worker-protocol-_7zrToTo.mjs → worker-protocol-BxpGZ0Dt.mjs} +1 -1
  36. package/dist/{worker-protocol-CXsdriRX.js → worker-protocol-c1r1Yddg.js} +1 -1
  37. package/package.json +1 -1
@@ -323,5 +323,103 @@ function isRecord(value) {
323
323
  function errText(err) {
324
324
  return err instanceof Error ? err.message : String(err);
325
325
  }
326
+ /** {@link PREBUFFER_MAX_SEC} in ms — the widest window any consumer can be served. */
327
+ var PREBUFFER_MAX_MS = 15 * 1e3;
328
+ /** Clamp an enabled window's seconds into `[MIN, MAX]`; `0`/invalid means off. */
329
+ function clampSeconds(value) {
330
+ if (value === void 0) return 5;
331
+ if (!Number.isFinite(value) || value <= 0) return 0;
332
+ return Math.min(15, Math.max(1, value));
333
+ }
334
+ /** `enabled: false` is the only representation of off — never `seconds: 0` alone. */
335
+ var OFF = {
336
+ enabled: false,
337
+ seconds: 0
338
+ };
339
+ /**
340
+ * The ONE prebuffer decision.
341
+ *
342
+ * Precedence: explicit per-stream override -> battery / terminal relay (off) ->
343
+ * the profile's warm default -> off. Every layer that used to make this
344
+ * decision somewhere else — `isDefaultWarm`, `applyPreBufferConfig`,
345
+ * `getEffectivePreBufferSec`, `resolvePreRollMs`, `resolveRecordingPreRollMs` —
346
+ * is this function now, so the four of them cannot disagree about one camera.
347
+ */
348
+ function resolvePrebuffer(input) {
349
+ const override = input.overrides?.[input.camStreamId];
350
+ if (override !== void 0) {
351
+ if (!override.enabled) return OFF;
352
+ const seconds = clampSeconds(override.seconds);
353
+ return seconds > 0 ? {
354
+ enabled: true,
355
+ seconds
356
+ } : OFF;
357
+ }
358
+ if (input.batteryOperated === true) return OFF;
359
+ if (input.terminalRelay === true) return OFF;
360
+ if (input.defaultWarm !== true) return OFF;
361
+ const seconds = clampSeconds(input.clusterSeconds);
362
+ return seconds > 0 ? {
363
+ enabled: true,
364
+ seconds
365
+ } : OFF;
366
+ }
367
+ /** The retention, in ms — the single number the ring is trimmed to. */
368
+ function prebufferRetentionMs(config) {
369
+ return config.enabled ? config.seconds * 1e3 : 0;
370
+ }
371
+ /**
372
+ * What a consumer asking for `requestedMs` of history is actually served.
373
+ *
374
+ * The cap is the point of the record: a consumer states a WISH and the ring
375
+ * states the truth. `undefined` means "whatever you have", which is what a
376
+ * consumer that configures nothing asks for — and is why the recorder no
377
+ * longer carries a duration of its own.
378
+ *
379
+ * A nonsense request resolves to `0`, never to the whole window: an
380
+ * unparseable number arriving on a dial path must not be able to widen a burst.
381
+ */
382
+ function capPreRollRequestMs(requestedMs, retainedMs) {
383
+ const retained = Number.isFinite(retainedMs) && retainedMs > 0 ? retainedMs : 0;
384
+ if (retained === 0) return 0;
385
+ if (requestedMs === void 0) return retained;
386
+ if (!Number.isFinite(requestedMs) || requestedMs <= 0) return 0;
387
+ return Math.min(requestedMs, retained);
388
+ }
326
389
  //#endregion
327
- export { RowMapStore as n, retireRootKeys as t };
390
+ Object.defineProperty(exports, "PREBUFFER_MAX_MS", {
391
+ enumerable: true,
392
+ get: function() {
393
+ return PREBUFFER_MAX_MS;
394
+ }
395
+ });
396
+ Object.defineProperty(exports, "RowMapStore", {
397
+ enumerable: true,
398
+ get: function() {
399
+ return RowMapStore;
400
+ }
401
+ });
402
+ Object.defineProperty(exports, "capPreRollRequestMs", {
403
+ enumerable: true,
404
+ get: function() {
405
+ return capPreRollRequestMs;
406
+ }
407
+ });
408
+ Object.defineProperty(exports, "prebufferRetentionMs", {
409
+ enumerable: true,
410
+ get: function() {
411
+ return prebufferRetentionMs;
412
+ }
413
+ });
414
+ Object.defineProperty(exports, "resolvePrebuffer", {
415
+ enumerable: true,
416
+ get: function() {
417
+ return resolvePrebuffer;
418
+ }
419
+ });
420
+ Object.defineProperty(exports, "retireRootKeys", {
421
+ enumerable: true,
422
+ get: function() {
423
+ return retireRootKeys;
424
+ }
425
+ });
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CBa1j3On.js");
1
+ const require_dist = require("./dist-DmCrC2yx.js");
2
2
  let node_fs = require("node:fs");
3
3
  node_fs = require_dist.__toESM(node_fs);
4
4
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { ct as parseProcStatus } from "./dist-Y4BsF_EC.mjs";
1
+ import { ct as parseProcStatus } from "./dist-B23u1tmN.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import { execFile } from "node:child_process";
4
4
  //#region src/shared/node-topology-platform.ts
@@ -2,12 +2,12 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-CBa1j3On.js");
6
- const require_node = require("../node-C-B8VuGi.js");
5
+ const require_dist = require("../dist-DmCrC2yx.js");
6
+ const require_node = require("../node-DCSTbt6C.js");
7
7
  const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
8
8
  const require_restream_intent = require("../restream-intent-Cv9x3jmu.js");
9
9
  const require_event_loop_stall_monitor = require("../event-loop-stall-monitor-DaUBcb13.js");
10
- const require_retire_root_keys = require("../retire-root-keys-Csb8z2f3.js");
10
+ const require_prebuffer = require("../prebuffer-DqdeLSsk.js");
11
11
  let node_crypto = require("node:crypto");
12
12
  let node_fs = require("node:fs");
13
13
  let node_path = require("node:path");
@@ -3918,7 +3918,7 @@ var CalendarIndex = class {
3918
3918
  var RECORDING_CONFIGS_COLLECTION = "recorder:recording-configs";
3919
3919
  var RECORDING_CONFIGS_SPEC = {
3920
3920
  collection: RECORDING_CONFIGS_COLLECTION,
3921
- schema: require_dist.preprocess((raw) => require_dist.migrateLegacyDeviceSignalConfig(raw).value, require_dist.RecordingConfigSchema.strip()),
3921
+ schema: require_dist.preprocess((raw) => require_dist.migrateLegacyDeviceSignalConfig(raw).value, require_dist.RecordingConfigSchema.strip()).transform((config) => require_dist.stripRetiredBandPreBufferSec(config).config),
3922
3922
  columns: [
3923
3923
  {
3924
3924
  name: "deviceId",
@@ -3950,7 +3950,7 @@ var DEFAULT_DEVICE_CONFIG = {
3950
3950
  };
3951
3951
  /** Build the handle. `declare()` MUST run once at boot before any read/write. */
3952
3952
  function recordingConfigsState(store, logger) {
3953
- return new require_retire_root_keys.RowMapStore({
3953
+ return new require_prebuffer.RowMapStore({
3954
3954
  spec: RECORDING_CONFIGS_SPEC,
3955
3955
  store,
3956
3956
  logger
@@ -5241,7 +5241,7 @@ var RECORDING_EXPORTS_SPEC = {
5241
5241
  };
5242
5242
  /** Build the handle. `declare()` MUST run once at boot before any read/write. */
5243
5243
  function recordingExportsState(store, logger) {
5244
- return new require_retire_root_keys.RowMapStore({
5244
+ return new require_prebuffer.RowMapStore({
5245
5245
  spec: RECORDING_EXPORTS_SPEC,
5246
5246
  store,
5247
5247
  logger
@@ -11084,7 +11084,7 @@ var RECORDING_OPS_LOG_SPEC = {
11084
11084
  };
11085
11085
  /** Build the handle. `declare()` MUST run once at boot before any read/write. */
11086
11086
  function recordingOpsLogState(store, logger) {
11087
- return new require_retire_root_keys.RowMapStore({
11087
+ return new require_prebuffer.RowMapStore({
11088
11088
  spec: RECORDING_OPS_LOG_SPEC,
11089
11089
  store,
11090
11090
  logger
@@ -12578,7 +12578,6 @@ var DEVICE_DECISION_BAND = Object.freeze({
12578
12578
  end: "00:00",
12579
12579
  mode: "events",
12580
12580
  deviceSignal: true,
12581
- preBufferSec: require_dist.DEFAULT_EVENTS_BAND_BUFFER_SEC.preBufferSec,
12582
12581
  postBufferSec: require_dist.DEFAULT_EVENTS_BAND_BUFFER_SEC.postBufferSec
12583
12582
  });
12584
12583
  /**
@@ -12594,18 +12593,27 @@ function effectiveBands(config) {
12594
12593
  return config.bands ?? [];
12595
12594
  }
12596
12595
  /**
12597
- * THE one place a band's pre/post buffers are read. An ABSENT field takes
12598
- * {@link DEFAULT_EVENTS_BAND_BUFFER_SEC}; an explicit value — including `0` —
12599
- * is honoured verbatim.
12600
- *
12601
- * Both callers below used to inline `?? 0`, which read "the operator omitted the
12602
- * field" as "the operator asked for a zero-length window". For the live gate
12603
- * that is not a policy, it is an impossibility: nothing can ever be recorded.
12604
- * Two cameras sat in exactly that state.
12596
+ * THE one place a band's buffers are read.
12597
+ *
12598
+ * `postMs` is the LIVE demand window and stays a per-band setting: it decides
12599
+ * how long a writer keeps running, which is a policy about this camera at this
12600
+ * hour. An ABSENT field takes {@link DEFAULT_EVENTS_BAND_BUFFER_SEC}; an
12601
+ * explicit value — including `0` — is honoured verbatim, because both callers
12602
+ * used to inline `?? 0` and read "the operator omitted the field" as "the
12603
+ * operator asked for a zero-length window", which for the live gate is not a
12604
+ * policy but an impossibility. Two cameras sat in exactly that state.
12605
+ *
12606
+ * `preMs` is NOT a setting any more (D381). It is the retroactive KEEP bound —
12607
+ * which already-written segments survive a trigger — and its only correct
12608
+ * value was ever "at least as wide as the widest history the broker can hand
12609
+ * the writer". So it IS that ceiling, read from the one place that defines it:
12610
+ * a keep gate can no longer be configured narrower than the media it is
12611
+ * supposed to keep, which is the disagreement D191 was written against and
12612
+ * which a per-band number could only ever warn about.
12605
12613
  */
12606
12614
  function resolveBandBufferMs(band) {
12607
12615
  return {
12608
- preMs: (band.preBufferSec ?? require_dist.DEFAULT_EVENTS_BAND_BUFFER_SEC.preBufferSec) * 1e3,
12616
+ preMs: require_prebuffer.PREBUFFER_MAX_MS,
12609
12617
  postMs: (band.postBufferSec ?? require_dist.DEFAULT_EVENTS_BAND_BUFFER_SEC.postBufferSec) * 1e3
12610
12618
  };
12611
12619
  }
@@ -18402,7 +18410,7 @@ var RecorderV2Addon = class extends require_dist.BaseAddon {
18402
18410
  */
18403
18411
  async purgeFlattenedSettingsKeys() {
18404
18412
  try {
18405
- await require_retire_root_keys.retireRootKeys({
18413
+ await require_prebuffer.retireRootKeys({
18406
18414
  store: this.ctx.api.settingsStore,
18407
18415
  addonId: RECORDER_ADDON_ID,
18408
18416
  logger: this.ctx.logger,
@@ -1,9 +1,9 @@
1
- import { Ct as storageEvictableCapability, D as RecordingSignalStatusSchema, Dt as errMsg, E as RecordingConfigSchema, H as deriveBatteryPresence, It as DeviceFeature, Jt as _enum, Kt as selectAssignedProfileSlots, Lt as DeviceType, P as batteryCapability, Pt as BaseAddon, R as customAction, T as RECORDING_EXPORT_MAX_READ_BYTES, Ut as nodePin, V as defineCustomActions, W as deriveRecordingMode, Xt as boolean, Y as evaluateSensorEdge, Yt as array, _t as recordingSignalCapability, at as migrateLegacyDeviceSignalConfig, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, en as number, et as isFirstLevelMacroClass, g as ExportRecordSchema, gt as recordingExportCapability, ht as recordingCapability, i as BatteryStatusSchema, in as string, nn as preprocess, on as EventCategory, qt as sleep$1, rn as record, tn as object, tt as loadContributionCapability, x as OpsLogEntrySchema, xt as resolveRecordingProfiles, zt as hydrateSchema } from "../dist-Y4BsF_EC.mjs";
2
- import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-B5ouEQYN.mjs";
1
+ import { Bt as hydrateSchema, Ct as storageEvictableCapability, D as RecordingSignalStatusSchema, E as RecordingConfigSchema, Ft as BaseAddon, H as deriveBatteryPresence, Jt as sleep$1, Lt as DeviceFeature, Ot as errMsg, P as batteryCapability, R as customAction, Rt as DeviceType, T as RECORDING_EXPORT_MAX_READ_BYTES, Tt as stripRetiredBandPreBufferSec, V as defineCustomActions, W as deriveRecordingMode, Wt as nodePin, Xt as array, Y as evaluateSensorEdge, Yt as _enum, Zt as boolean, _t as recordingSignalCapability, an as string, at as migrateLegacyDeviceSignalConfig, d as DEFAULT_EVENTS_BAND_BUFFER_SEC, et as isFirstLevelMacroClass, g as ExportRecordSchema, gt as recordingExportCapability, ht as recordingCapability, i as BatteryStatusSchema, in as record, nn as object, qt as selectAssignedProfileSlots, rn as preprocess, sn as EventCategory, tn as number, tt as loadContributionCapability, x as OpsLogEntrySchema, xt as resolveRecordingProfiles } from "../dist-B23u1tmN.mjs";
2
+ import { i as NO_COST_CLAIM, t as ChildCostRegistry } from "../node-D1MLn6oV.mjs";
3
3
  import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
4
4
  import { r as withRecordingIntent } from "../restream-intent-B4BXZra7.mjs";
5
5
  import { n as startEventLoopStallMonitor } from "../event-loop-stall-monitor-DXLNBMkY.mjs";
6
- import { n as RowMapStore, t as retireRootKeys } from "../retire-root-keys-DZvlso2l.mjs";
6
+ import { a as retireRootKeys, o as RowMapStore, t as PREBUFFER_MAX_MS } from "../prebuffer-DmBYRQWg.mjs";
7
7
  import { randomUUID } from "node:crypto";
8
8
  import { createReadStream, promises, realpathSync } from "node:fs";
9
9
  import path from "node:path";
@@ -3913,7 +3913,7 @@ var CalendarIndex = class {
3913
3913
  var RECORDING_CONFIGS_COLLECTION = "recorder:recording-configs";
3914
3914
  var RECORDING_CONFIGS_SPEC = {
3915
3915
  collection: RECORDING_CONFIGS_COLLECTION,
3916
- schema: preprocess((raw) => migrateLegacyDeviceSignalConfig(raw).value, RecordingConfigSchema.strip()),
3916
+ schema: preprocess((raw) => migrateLegacyDeviceSignalConfig(raw).value, RecordingConfigSchema.strip()).transform((config) => stripRetiredBandPreBufferSec(config).config),
3917
3917
  columns: [
3918
3918
  {
3919
3919
  name: "deviceId",
@@ -12572,7 +12572,6 @@ var DEVICE_DECISION_BAND = Object.freeze({
12572
12572
  end: "00:00",
12573
12573
  mode: "events",
12574
12574
  deviceSignal: true,
12575
- preBufferSec: DEFAULT_EVENTS_BAND_BUFFER_SEC.preBufferSec,
12576
12575
  postBufferSec: DEFAULT_EVENTS_BAND_BUFFER_SEC.postBufferSec
12577
12576
  });
12578
12577
  /**
@@ -12588,18 +12587,27 @@ function effectiveBands(config) {
12588
12587
  return config.bands ?? [];
12589
12588
  }
12590
12589
  /**
12591
- * THE one place a band's pre/post buffers are read. An ABSENT field takes
12592
- * {@link DEFAULT_EVENTS_BAND_BUFFER_SEC}; an explicit value — including `0` —
12593
- * is honoured verbatim.
12594
- *
12595
- * Both callers below used to inline `?? 0`, which read "the operator omitted the
12596
- * field" as "the operator asked for a zero-length window". For the live gate
12597
- * that is not a policy, it is an impossibility: nothing can ever be recorded.
12598
- * Two cameras sat in exactly that state.
12590
+ * THE one place a band's buffers are read.
12591
+ *
12592
+ * `postMs` is the LIVE demand window and stays a per-band setting: it decides
12593
+ * how long a writer keeps running, which is a policy about this camera at this
12594
+ * hour. An ABSENT field takes {@link DEFAULT_EVENTS_BAND_BUFFER_SEC}; an
12595
+ * explicit value — including `0` — is honoured verbatim, because both callers
12596
+ * used to inline `?? 0` and read "the operator omitted the field" as "the
12597
+ * operator asked for a zero-length window", which for the live gate is not a
12598
+ * policy but an impossibility. Two cameras sat in exactly that state.
12599
+ *
12600
+ * `preMs` is NOT a setting any more (D381). It is the retroactive KEEP bound —
12601
+ * which already-written segments survive a trigger — and its only correct
12602
+ * value was ever "at least as wide as the widest history the broker can hand
12603
+ * the writer". So it IS that ceiling, read from the one place that defines it:
12604
+ * a keep gate can no longer be configured narrower than the media it is
12605
+ * supposed to keep, which is the disagreement D191 was written against and
12606
+ * which a per-band number could only ever warn about.
12599
12607
  */
12600
12608
  function resolveBandBufferMs(band) {
12601
12609
  return {
12602
- preMs: (band.preBufferSec ?? DEFAULT_EVENTS_BAND_BUFFER_SEC.preBufferSec) * 1e3,
12610
+ preMs: PREBUFFER_MAX_MS,
12603
12611
  postMs: (band.postBufferSec ?? DEFAULT_EVENTS_BAND_BUFFER_SEC.postBufferSec) * 1e3
12604
12612
  };
12605
12613
  }
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-DnnnRqeS.mjs";
2
- import { Dt as errMsg } from "./dist-Y4BsF_EC.mjs";
2
+ import { Ot as errMsg } from "./dist-B23u1tmN.mjs";
3
3
  import { spawn } from "node:child_process";
4
4
  //#region ../../node_modules/mp4box/dist/mp4box.all.js
5
5
  var require_mp4box_all = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CBa1j3On.js");
1
+ const require_dist = require("./dist-DmCrC2yx.js");
2
2
  let node_child_process = require("node:child_process");
3
3
  //#region ../../node_modules/mp4box/dist/mp4box.all.js
4
4
  var require_mp4box_all = /* @__PURE__ */ require_dist.__commonJSMin(((exports) => {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_worker_protocol = require("../worker-protocol-CXsdriRX.js");
3
- const require_lazy_sharp = require("../lazy-sharp-CS5WE9mI.js");
2
+ const require_worker_protocol = require("../worker-protocol-c1r1Yddg.js");
3
+ const require_lazy_sharp = require("../lazy-sharp-DBHsD2lh.js");
4
4
  //#region src/session-decode/color-conversion.ts
5
5
  /**
6
6
  * Explicit YUV→RGB colorspace/range resolution for the session-decode worker.
@@ -1,4 +1,4 @@
1
- import { i as formatNativeLeaseKnobs, n as isWorkerRequest, o as resolveNativeLeaseKnobs, r as logLevelForLine } from "../worker-protocol-_7zrToTo.mjs";
1
+ import { i as formatNativeLeaseKnobs, n as isWorkerRequest, o as resolveNativeLeaseKnobs, r as logLevelForLine } from "../worker-protocol-BxpGZ0Dt.mjs";
2
2
  import { n as setSharpWarnSink, r as hostExternalEntryUrls, t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
3
3
  //#region src/session-decode/color-conversion.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dj_qoc1e.mjs";
2
2
  import { a as p, i as m, n as h, o as g, r as _, t as v } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react__loadShare__.js-C9j-2lBe.mjs";
3
3
  import { n as y, r as b, t as x } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-XO0-Pyu6.mjs";
4
- import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-Cv5McbTI.mjs";
4
+ import { t as S } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BcjLrxhF.mjs";
5
5
  import { n as C, t as w } from "./_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-BO7TIbJV.mjs";
6
6
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
7
7
  var T = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), D = (e) => {
@@ -1446,21 +1446,21 @@ function je({ slot: t, camStreams: n, compact: a }) {
1446
1446
  let { data: d } = u({ brokerId: t.brokerId }, {
1447
1447
  enabled: l?.status === "streaming",
1448
1448
  staleTime: 2e3
1449
- }), { data: f } = i({ deviceId: t.deviceId }, { staleTime: 15e3 }), p = t.sourceCamStreamId ?? t.profile, m = !!(X(f, `preBufferEnabled:${p}`) ?? !0), h = X(f, `preBufferSec:${p}`), g = o({ onSuccess: () => {
1449
+ }), { data: f, isPending: p } = i({ deviceId: t.deviceId }, { staleTime: 15e3 }), m = t.sourceCamStreamId ?? t.profile, h = X(f, `preBufferEnabled:${m}`), g = typeof h == "boolean", v = h === !0, S = X(f, `preBufferSec:${m}`), w = typeof S == "number" ? S : void 0, T = o({ onSuccess: () => {
1450
1450
  s.invalidateQueries({ queryKey: [["streamBroker", "getDeviceSettingsContribution"]] });
1451
- } }), v = (e) => {
1452
- g.mutate({
1451
+ } }), E = (e) => {
1452
+ T.mutate({
1453
1453
  deviceId: t.deviceId,
1454
- patch: { [`preBufferEnabled:${p}`]: e }
1454
+ patch: { [`preBufferEnabled:${m}`]: e }
1455
1455
  });
1456
- }, S = e({ onSuccess: () => {
1456
+ }, D = e({ onSuccess: () => {
1457
1457
  s.invalidateQueries({ queryKey: [["streamBroker", "listClients"]] });
1458
- } }), w = _((e) => {
1459
- S.mutate({
1458
+ } }), O = _((e) => {
1459
+ D.mutate({
1460
1460
  brokerId: t.brokerId,
1461
1461
  ...e
1462
1462
  });
1463
- }, [S, t.brokerId]), T = (t.sourceCamStreamId ? n.get(t.sourceCamStreamId) : void 0)?.resolution ?? t.resolution, E = l?.status === "streaming", D = T ? `${q[t.profile]} (${T.width}×${T.height})` : q[t.profile], O = l ? l.encodedSubscribers + l.decodedSubscribers + (l.rtspClients ?? 0) + (l.pipeClients ?? 0) : 0;
1463
+ }, [D, t.brokerId]), k = (t.sourceCamStreamId ? n.get(t.sourceCamStreamId) : void 0)?.resolution ?? t.resolution, A = l?.status === "streaming", j = k ? `${q[t.profile]} (${k.width}×${k.height})` : q[t.profile], M = l ? l.encodedSubscribers + l.decodedSubscribers + (l.rtspClients ?? 0) + (l.pipeClients ?? 0) : 0;
1464
1464
  return /* @__PURE__ */ b("div", {
1465
1465
  className: `@container ${a ? "px-3 py-1.5" : "px-4 py-2"}`,
1466
1466
  style: { containerType: "inline-size" },
@@ -1470,13 +1470,13 @@ function je({ slot: t, camStreams: n, compact: a }) {
1470
1470
  children: [/* @__PURE__ */ b("div", {
1471
1471
  className: "flex items-center gap-1.5 min-w-0",
1472
1472
  children: [
1473
- /* @__PURE__ */ y("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${E ? t.profile === "high" ? "bg-success" : t.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1473
+ /* @__PURE__ */ y("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${A ? t.profile === "high" ? "bg-success" : t.profile === "mid" ? "bg-warning" : "bg-foreground-subtle" : "bg-foreground-subtle/40"}` }),
1474
1474
  /* @__PURE__ */ y("span", {
1475
1475
  className: "text-[11px] font-medium text-foreground whitespace-nowrap shrink-0",
1476
- children: D
1476
+ children: j
1477
1477
  }),
1478
1478
  /* @__PURE__ */ y("span", {
1479
- className: `text-[10px] shrink-0 ${E ? "text-success" : "text-foreground-subtle"}`,
1479
+ className: `text-[10px] shrink-0 ${A ? "text-success" : "text-foreground-subtle"}`,
1480
1480
  children: l?.status ?? "loading"
1481
1481
  }),
1482
1482
  t.sourceCamStreamId && /* @__PURE__ */ b("span", {
@@ -1490,7 +1490,7 @@ function je({ slot: t, camStreams: n, compact: a }) {
1490
1490
  children: l && l.uptimeMs > 0 ? Ce(l.uptimeMs) : "—"
1491
1491
  })]
1492
1492
  }),
1493
- l && E ? a ? /* @__PURE__ */ b("div", {
1493
+ l && A ? a ? /* @__PURE__ */ b("div", {
1494
1494
  className: "flex flex-wrap gap-x-3 gap-y-0.5 text-[10px]",
1495
1495
  children: [
1496
1496
  /* @__PURE__ */ b("span", {
@@ -1536,7 +1536,7 @@ function je({ slot: t, camStreams: n, compact: a }) {
1536
1536
  }),
1537
1537
  /* @__PURE__ */ y("span", {
1538
1538
  className: "text-foreground font-semibold",
1539
- children: O
1539
+ children: M
1540
1540
  }),
1541
1541
  /* @__PURE__ */ y("span", {
1542
1542
  className: "text-foreground-subtle/70",
@@ -1545,7 +1545,7 @@ function je({ slot: t, camStreams: n, compact: a }) {
1545
1545
  /* @__PURE__ */ y(Le, {
1546
1546
  count: l.encodedSubscribers + l.decodedSubscribers,
1547
1547
  clients: d,
1548
- onKill: w
1548
+ onKill: O
1549
1549
  }),
1550
1550
  /* @__PURE__ */ y("span", {
1551
1551
  className: "text-foreground-subtle/70",
@@ -1554,7 +1554,7 @@ function je({ slot: t, camStreams: n, compact: a }) {
1554
1554
  /* @__PURE__ */ y(ze, {
1555
1555
  count: l.rtspClients ?? 0,
1556
1556
  clients: d,
1557
- onKill: w
1557
+ onKill: O
1558
1558
  }),
1559
1559
  /* @__PURE__ */ b("span", {
1560
1560
  className: "text-foreground-subtle/70",
@@ -1705,7 +1705,7 @@ function je({ slot: t, camStreams: n, compact: a }) {
1705
1705
  }), /* @__PURE__ */ y(Ie, {
1706
1706
  clients: d,
1707
1707
  encodedCount: l.encodedSubscribers,
1708
- onKill: w
1708
+ onKill: O
1709
1709
  })] }) : /* @__PURE__ */ y("p", {
1710
1710
  className: "text-[10px] text-foreground-subtle italic",
1711
1711
  children: "No demand — stream suspended"
@@ -1718,17 +1718,14 @@ function je({ slot: t, camStreams: n, compact: a }) {
1718
1718
  children: "Buffer:"
1719
1719
  }),
1720
1720
  /* @__PURE__ */ y(Re, {
1721
- enabled: m,
1722
- onToggle: (e) => v(e),
1723
- disabled: g.isPending
1721
+ enabled: v,
1722
+ known: g,
1723
+ onToggle: (e) => E(e),
1724
+ disabled: p || !g || T.isPending
1724
1725
  }),
1725
1726
  /* @__PURE__ */ b("span", {
1726
1727
  className: "text-foreground",
1727
- children: [
1728
- h ?? l?.preBufferSec ?? 0,
1729
- "s",
1730
- l && E ? ` (${l.preBufferPackets}p)` : ""
1731
- ]
1728
+ children: [g ? `${w ?? l?.preBufferSec ?? 0}s` : "…", g && l && A ? ` (${l.preBufferPackets}p)` : ""]
1732
1729
  })
1733
1730
  ]
1734
1731
  })
@@ -1998,15 +1995,15 @@ function Le({ count: e, clients: t, onKill: n }) {
1998
1995
  widthClass: "min-w-[260px] max-w-[360px]"
1999
1996
  }) : s;
2000
1997
  }
2001
- function Re({ enabled: e, onToggle: t, disabled: n }) {
1998
+ function Re({ enabled: e, known: t, onToggle: n, disabled: r }) {
2002
1999
  return /* @__PURE__ */ y("button", {
2003
2000
  type: "button",
2004
2001
  role: "switch",
2005
- "aria-checked": e,
2006
- disabled: n,
2007
- onClick: () => t(!e),
2008
- className: `relative inline-flex h-3 w-6 shrink-0 items-center rounded-full transition-colors ${e ? "bg-success/60" : "bg-foreground-subtle/30"} ${n ? "opacity-50 cursor-wait" : "cursor-pointer"}`,
2009
- title: e ? "Pre-buffer enabled — click to disable" : "Pre-buffer disabled — click to enable",
2002
+ "aria-checked": t ? e : "mixed",
2003
+ disabled: r,
2004
+ onClick: () => n(!e),
2005
+ className: `relative inline-flex h-3 w-6 shrink-0 items-center rounded-full transition-colors ${t ? e ? "bg-success/60" : "bg-foreground-subtle/30" : "bg-foreground-subtle/20"} ${r ? "opacity-50 cursor-wait" : "cursor-pointer"}`,
2006
+ title: t ? e ? "Pre-buffer enabled — click to disable" : "Pre-buffer disabled — click to enable" : "Pre-buffer — loading",
2010
2007
  children: /* @__PURE__ */ y("span", { className: `inline-block h-2.5 w-2.5 rounded-full bg-white shadow transition-transform ${e ? "translate-x-3" : "translate-x-0.5"}` })
2011
2008
  });
2012
2009
  }
@@ -3,7 +3,7 @@ import "./dist-CYZr2fwk.mjs";
3
3
  var e = {
4
4
  "@camstack/sdk": {
5
5
  name: "@camstack/sdk",
6
- version: "1.2.79",
6
+ version: "1.2.81",
7
7
  scope: ["default"],
8
8
  loaded: !1,
9
9
  from: "addon_stream_broker_widgets",
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.159",
21
+ version: "1.2.161",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_stream_broker_widgets",
@@ -33,7 +33,7 @@ var e = {
33
33
  },
34
34
  "@camstack/ui-library": {
35
35
  name: "@camstack/ui-library",
36
- version: "1.2.127",
36
+ version: "1.2.129",
37
37
  scope: ["default"],
38
38
  loaded: !1,
39
39
  from: "addon_stream_broker_widgets",