@camstack/addon-admin-ui 1.2.46 → 1.2.48

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 (106) hide show
  1. package/dist/assets/AddLocationWizard-Bfrn_7zf.js +1 -0
  2. package/dist/assets/{AddonCollectionPage-C61Ba_jl.js → AddonCollectionPage-Bk8FZDEN.js} +1 -1
  3. package/dist/assets/Addons-BfHWsfyk.js +1 -0
  4. package/dist/assets/{AdminTabs-D9PvjiYm.js → AdminTabs-CzInazOO.js} +1 -1
  5. package/dist/assets/{AiProfiles-BI5AXKgn.js → AiProfiles-CRPdUeLN.js} +1 -1
  6. package/dist/assets/{BrokerForm-DrER3lQQ.js → BrokerForm-DSMFucJp.js} +1 -1
  7. package/dist/assets/{Build-CTIT9BGb.js → Build-CvrBMwld.js} +4 -4
  8. package/dist/assets/{Capabilities-CSob3jHL.js → Capabilities-5wXsNPM8.js} +1 -1
  9. package/dist/assets/{CapabilityBadges-DA5xGzac.js → CapabilityBadges-DPV_LKz0.js} +1 -1
  10. package/dist/assets/Cluster-D_P4r2ZJ.js +1 -0
  11. package/dist/assets/Data-BDoTBy_I.js +1 -0
  12. package/dist/assets/DetectionIntelligence-BzBKqvVc.js +1 -0
  13. package/dist/assets/{DeviceAggregateSection-BjrIcNw5.js → DeviceAggregateSection-bQigCGJu.js} +1 -1
  14. package/dist/assets/DeviceDetail-BESIwk7j.js +2 -0
  15. package/dist/assets/{Devices-DNRW-8PQ.js → Devices-BpzlS-Cp.js} +1 -1
  16. package/dist/assets/{EmbedPlayerPage-DLVxEE8V.js → EmbedPlayerPage-B2geI7HH.js} +1 -1
  17. package/dist/assets/Events-CCcj_Opy.js +1 -0
  18. package/dist/assets/{FormBuilder-CaOtuJSH.js → FormBuilder-jX3PepDY.js} +1 -1
  19. package/dist/assets/Identity-BOzpTdY2.js +1 -0
  20. package/dist/assets/{IntegrationDetail-B9tT_bEN.js → IntegrationDetail-DXUAnV3M.js} +1 -1
  21. package/dist/assets/{Integrations-BaAY-YyW.js → Integrations-BCuaiRay.js} +1 -1
  22. package/dist/assets/{Integrations-Chux0qyd.js → Integrations-DjXG1qMr.js} +1 -1
  23. package/dist/assets/{Logs-DCNSzdru.js → Logs-Cr3usRtb.js} +1 -1
  24. package/dist/assets/{MotionZonesSettings-DrBBWPoz.js → MotionZonesSettings-BgF0ipHJ.js} +1 -1
  25. package/dist/assets/{MyAccess-QP2TUc-A.js → MyAccess-CaSDJQ80.js} +1 -1
  26. package/dist/assets/{Network-D64kmZrd.js → Network-DwoxEsFQ.js} +1 -1
  27. package/dist/assets/{NodeAddonsSettingsPanel-BQ5YizD8.js → NodeAddonsSettingsPanel-CGyXoCjJ.js} +1 -1
  28. package/dist/assets/{NodeInferenceDevices-B1Q3HPcp.js → NodeInferenceDevices-2XXKCRAg.js} +1 -1
  29. package/dist/assets/{Notifications-Bp-wIyj-.js → Notifications-C1Ab4f2h.js} +1 -1
  30. package/dist/assets/Pipeline-AU3nS8OA.js +1 -0
  31. package/dist/assets/{Plates-prSedkIB.js → Plates-BsD5NKWH.js} +1 -1
  32. package/dist/assets/{PrivacyMaskSettings-BftWrajB.js → PrivacyMaskSettings-yOIEXwrU.js} +1 -1
  33. package/dist/assets/{ProviderIcon-BvSrSHNr.js → ProviderIcon-vQIq6K1F.js} +1 -1
  34. package/dist/assets/Recordings-BABdaff-.js +1 -0
  35. package/dist/assets/{ScanNetworkModal-DvfWoDmr.js → ScanNetworkModal-B85m5JHQ.js} +1 -1
  36. package/dist/assets/{Settings-CERfXjAi.js → Settings-DZH2IAdK.js} +1 -1
  37. package/dist/assets/{Showroom-Ddvb8Jd_.js → Showroom-DqYm1QAX.js} +1 -1
  38. package/dist/assets/{Terminal-DniNTjLQ.js → Terminal-BZeJjZTx.js} +2 -2
  39. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DDeAxTIu.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DD9SArM5.js} +1 -1
  40. package/dist/assets/{boxes-s5PDMY2A.js → boxes-BwCcOZWT.js} +1 -1
  41. package/dist/assets/{build-cluster-graph-BytpMQQU.js → build-cluster-graph-Bheuv-z_.js} +2 -2
  42. package/dist/assets/circle-check-big-CqAH3uyw.js +1 -0
  43. package/dist/assets/{circle-x-B04aLzqg.js → circle-x-Ti01vTwi.js} +1 -1
  44. package/dist/assets/clock-uev4T2p0.js +1 -0
  45. package/dist/assets/{copy-B4xsDuLU.js → copy-COepYmu8.js} +1 -1
  46. package/dist/assets/{debounced-invalidate-p5oNNGBJ.js → debounced-invalidate-BEBP_tLV.js} +1 -1
  47. package/dist/assets/{dist-BrD5LzQi.js → dist-5MqZUHpg.js} +1 -1
  48. package/dist/assets/dist-Bayrm69X.js +345 -0
  49. package/dist/assets/{download-CkwHHo3N.js → download-jqwqTnlV.js} +1 -1
  50. package/dist/assets/{face-bbox-CvH_zToL.js → face-bbox-B_B2cY0e.js} +1 -1
  51. package/dist/assets/hard-drive-DqeFolGE.js +1 -0
  52. package/dist/assets/{hostInit-4NWTvHjq.js → hostInit-DQHnlGm4.js} +1 -1
  53. package/dist/assets/index-DfbxOmzG.css +2 -0
  54. package/dist/assets/index-cdpRPXAL.js +4 -0
  55. package/dist/assets/{key-round-C3DZqNmk.js → key-round-B4JL6hFC.js} +1 -1
  56. package/dist/assets/{mf-entry-bootstrap-0-4bae07af.js → mf-entry-bootstrap-0-404b9dba.js} +2 -2
  57. package/dist/assets/{pencil-DxgsOdJ_.js → pencil-BGJfKfiA.js} +1 -1
  58. package/dist/assets/play-Cu4IpFDR.js +1 -0
  59. package/dist/assets/{player-overlays-BfbNCp8v.js → player-overlays-BzwYRH08.js} +1 -1
  60. package/dist/assets/plus-CvVvTXPq.js +1 -0
  61. package/dist/assets/power-C9eNJ7JE.js +1 -0
  62. package/dist/assets/{radio-BlLvi9V1.js → radio-Pqfpkqzz.js} +1 -1
  63. package/dist/assets/{refresh-cw-BPInWufq.js → refresh-cw-DpwLI0M-.js} +1 -1
  64. package/dist/assets/remoteEntry-BAJ0ezfD.js +1 -0
  65. package/dist/assets/rotate-ccw-BVLe3GZu.js +1 -0
  66. package/dist/assets/rotate-cw-DUU0kRy_.js +1 -0
  67. package/dist/assets/search-CZXe9Pbq.js +1 -0
  68. package/dist/assets/{send-C2cA2Q14.js → send-SWhHO8Tt.js} +1 -1
  69. package/dist/assets/{server-BirjNPM2.js → server-DZgk2oO0.js} +1 -1
  70. package/dist/assets/square-D8vqWv1j.js +1 -0
  71. package/dist/assets/{square-check-big-B6ik3PVg.js → square-check-big-BQQq4jdo.js} +1 -1
  72. package/dist/assets/{src-C0ryWGb4.js → src-BoczRE1G.js} +10 -10
  73. package/dist/assets/src-Bok3PEiz.js +345 -0
  74. package/dist/assets/{undo-2-Di2YLM4r.js → undo-2-PrNys8wR.js} +1 -1
  75. package/dist/assets/{upload-TBTRaU-e.js → upload-eZM4jyb6.js} +1 -1
  76. package/dist/assets/{useEventInvalidation-BGgWKSKY.js → useEventInvalidation-XgGxFYwt.js} +1 -1
  77. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BT5icCYa.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-Cl2xnNlc.js} +2 -2
  78. package/dist/assets/{wifi-B5JFrHzB.js → wifi-ClLErVQN.js} +1 -1
  79. package/dist/assets/{zap-n9Ifudx7.js → zap-BmoeLWyx.js} +1 -1
  80. package/dist/index.html +6 -6
  81. package/dist/server/addon.js +295 -32
  82. package/package.json +1 -1
  83. package/dist/assets/AddLocationWizard-DjfJYSAe.js +0 -1
  84. package/dist/assets/Addons-B4-dAnTQ.js +0 -1
  85. package/dist/assets/Cluster-C963n9uC.js +0 -1
  86. package/dist/assets/ClusterRecordingTab-ColxtGy-.js +0 -1
  87. package/dist/assets/Data-AxuhT9pH.js +0 -1
  88. package/dist/assets/DetectionIntelligence-DQ6ulYLd.js +0 -1
  89. package/dist/assets/DeviceDetail-BVNUGmo4.js +0 -2
  90. package/dist/assets/Events-CkzWtqso.js +0 -1
  91. package/dist/assets/Identity-BsPwdwu7.js +0 -1
  92. package/dist/assets/Pipeline-DgmPtFWh.js +0 -1
  93. package/dist/assets/Recordings-C7FQ4l7_.js +0 -1
  94. package/dist/assets/circle-check-big-DFEJsytm.js +0 -1
  95. package/dist/assets/clock-Cxmlo9g4.js +0 -1
  96. package/dist/assets/dist-CLRQNGYv.js +0 -345
  97. package/dist/assets/index-BpMOZW4i.js +0 -4
  98. package/dist/assets/index-De-QPGLo.css +0 -2
  99. package/dist/assets/play-D8WA4Wcj.js +0 -1
  100. package/dist/assets/plus-CRlbDvh8.js +0 -1
  101. package/dist/assets/remoteEntry-CtynHQrW.js +0 -1
  102. package/dist/assets/rotate-ccw-BNBM91kv.js +0 -1
  103. package/dist/assets/rotate-cw-kVxZiDR4.js +0 -1
  104. package/dist/assets/search-D29mAFs2.js +0 -1
  105. package/dist/assets/square-DvCXYnil.js +0 -1
  106. package/dist/assets/src-B0nZ9rxd.js +0 -345
@@ -7545,12 +7545,11 @@ var RecordingConfigSchema = object({
7545
7545
  /**
7546
7546
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7547
7547
  *
7548
- * One shape shared by the recorder's `relocateFootage` (segments) and
7549
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7550
- * page renders both movers with one component. Jobs are in-RAM (a restart
7551
- * forgets them re-running is safe by construction: copy-if-absent, delete
7552
- * after verify) and each completed/failed run also lands one durable ops-log
7553
- * row on the owning addon's surface.
7548
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7549
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7550
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7551
+ * Each completed/failed run also lands one durable ops-log row on its owning
7552
+ * addon surface.
7554
7553
  */
7555
7554
  var RelocateJobStateSchema = _enum([
7556
7555
  "running",
@@ -7577,19 +7576,100 @@ var RelocateJobSchema = object({
7577
7576
  finishedAt: number().nullable(),
7578
7577
  error: string().nullable()
7579
7578
  });
7579
+ /** Profile-derived footage selection used only by the migration coordinator:
7580
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7581
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7580
7582
  var RelocateFootageInputSchema = object({
7581
- deviceId: number().optional(),
7582
7583
  fromLocationId: string(),
7583
7584
  toLocationId: string(),
7584
7585
  entities: array(_enum(["segments"])).optional(),
7586
+ /** Limits relocation to the logical profile class. Omit only for the
7587
+ * pre-orchestration compatibility path. */
7588
+ footageClass: RelocateFootageClassSchema.optional(),
7585
7589
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7586
7590
  * never allowed to starve live writers. */
7587
7591
  throttleMbps: number().min(1).max(1e3).optional()
7588
7592
  });
7589
- var RelocateMediaInputSchema = object({
7590
- deviceId: number().optional(),
7593
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7594
+ * from persistent recording settings: a migration never changes
7595
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7596
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7597
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7598
+ var StorageMigrationMediaMoveInputSchema = object({
7591
7599
  toLocationId: string(),
7592
7600
  throttleMbps: number().min(1).max(1e3).optional()
7601
+ }).extend({ leaseId: string().min(1) });
7602
+ /** The independently selectable logical storage classes. `recordings`
7603
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7604
+ * segments; `eventMedia` is post-analysis blobs. */
7605
+ var StorageMigrationClassSchema = _enum([
7606
+ "recordings",
7607
+ "recordingsLow",
7608
+ "eventMedia"
7609
+ ]);
7610
+ /** A destination is always an existing, fully-qualified location id. The
7611
+ * migration API intentionally never changes a source location's `basePath`:
7612
+ * callers create a new `<type>:<slug>` location, then select it here. */
7613
+ var StorageMigrationDestinationsSchema = object({
7614
+ recordings: string().min(1).optional(),
7615
+ recordingsLow: string().min(1).optional(),
7616
+ eventMedia: string().min(1).optional()
7617
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7618
+ /** Shared input for planning and starting an orchestrated storage migration. */
7619
+ var StorageMigrationInputSchema = object({
7620
+ destinations: StorageMigrationDestinationsSchema,
7621
+ throttleMbps: number().min(1).max(1e3).optional()
7622
+ });
7623
+ /** The durable coordinator state machine. The only phase that changes default
7624
+ * locations is `repointing`, after every selected mover has completed and been
7625
+ * verified. */
7626
+ var StorageMigrationPhaseSchema = _enum([
7627
+ "planning",
7628
+ "pausing",
7629
+ "moving",
7630
+ "verifying",
7631
+ "repointing",
7632
+ "refreshing",
7633
+ "resuming",
7634
+ "done",
7635
+ "failed",
7636
+ "cancelled"
7637
+ ]);
7638
+ var StorageMigrationParticipantSchema = _enum([
7639
+ "pipeline",
7640
+ "recorder",
7641
+ "analytics"
7642
+ ]);
7643
+ var StorageMigrationMoveSchema = object({
7644
+ storageClass: StorageMigrationClassSchema,
7645
+ fromLocationId: string(),
7646
+ toLocationId: string(),
7647
+ moverJobId: string().nullable(),
7648
+ state: RelocateJobStateSchema.nullable(),
7649
+ error: string().nullable()
7650
+ });
7651
+ var StorageMigrationJobSchema = object({
7652
+ jobId: string(),
7653
+ phase: StorageMigrationPhaseSchema,
7654
+ destinations: StorageMigrationDestinationsSchema,
7655
+ throttleMbps: number(),
7656
+ moves: array(StorageMigrationMoveSchema),
7657
+ pauseLeaseId: string().nullable(),
7658
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7659
+ repointed: boolean(),
7660
+ cancelRequested: boolean(),
7661
+ startedAt: number(),
7662
+ updatedAt: number(),
7663
+ finishedAt: number().nullable(),
7664
+ error: string().nullable()
7665
+ });
7666
+ var StorageMigrationPlanSchema = object({
7667
+ destinations: StorageMigrationDestinationsSchema,
7668
+ moves: array(object({
7669
+ storageClass: StorageMigrationClassSchema,
7670
+ fromLocationId: string(),
7671
+ toLocationId: string()
7672
+ }))
7593
7673
  });
7594
7674
  /**
7595
7675
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -15965,13 +16045,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
15965
16045
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
15966
16046
  kind: "mutation",
15967
16047
  auth: "admin"
15968
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16048
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
15969
16049
  kind: "mutation",
15970
16050
  auth: "admin"
15971
- }), method(object({}), array(RelocateJobSchema).readonly(), {
15972
- kind: "query",
16051
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16052
+ kind: "mutation",
16053
+ auth: "admin"
16054
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16055
+ kind: "mutation",
15973
16056
  auth: "admin"
15974
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16057
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16058
+ kind: "mutation",
16059
+ auth: "admin"
16060
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
15975
16061
  kind: "mutation",
15976
16062
  auth: "admin"
15977
16063
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17468,7 +17554,13 @@ var NodeInferenceDevicesSchema = object({
17468
17554
  reachable: boolean(),
17469
17555
  devices: array(NodeInferenceDeviceSchema).readonly()
17470
17556
  });
17471
- method(object({
17557
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17558
+ kind: "mutation",
17559
+ auth: "admin"
17560
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17561
+ kind: "mutation",
17562
+ auth: "admin"
17563
+ }), method(object({
17472
17564
  deviceId: number(),
17473
17565
  agentNodeId: string()
17474
17566
  }), object({ success: literal(true) }), {
@@ -18142,6 +18234,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18142
18234
  locationId: string(),
18143
18235
  targetBytes: number().int().positive()
18144
18236
  }), EvictResultSchema, { kind: "mutation" });
18237
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18238
+ kind: "mutation",
18239
+ auth: "admin"
18240
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18241
+ kind: "mutation",
18242
+ auth: "admin"
18243
+ });
18145
18244
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18146
18245
  providerId: string().min(1),
18147
18246
  displayName: string().min(1),
@@ -18245,6 +18344,28 @@ var TerminalProfileInfoSchema = object({
18245
18344
  label: string(),
18246
18345
  description: string().optional()
18247
18346
  });
18347
+ /**
18348
+ * A durable operator-created Terminal instance. Profiles are templates; only
18349
+ * an instance declares a camera.
18350
+ */
18351
+ var TerminalInstanceInfoSchema = object({
18352
+ instanceId: string(),
18353
+ cameraStableId: string(),
18354
+ nodeId: string(),
18355
+ profileId: string(),
18356
+ profileLabel: string(),
18357
+ name: string(),
18358
+ enabled: boolean()
18359
+ });
18360
+ var TerminalLegacyCameraSchema = object({
18361
+ stableId: string(),
18362
+ nodeId: string(),
18363
+ profileId: string(),
18364
+ profileLabel: string(),
18365
+ name: string(),
18366
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18367
+ adoptable: boolean()
18368
+ });
18248
18369
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18249
18370
  seq: number().int().positive(),
18250
18371
  kind: literal("data"),
@@ -18261,7 +18382,29 @@ var TerminalOutputBatchSchema = object({
18261
18382
  snapshot: string().optional(),
18262
18383
  events: array(TerminalOutputEventSchema).readonly()
18263
18384
  });
18264
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18385
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18386
+ targetNodeId: string().min(1),
18387
+ profileId: string().min(1),
18388
+ name: string().trim().min(1).max(160).optional()
18389
+ }), TerminalInstanceInfoSchema, {
18390
+ kind: "mutation",
18391
+ auth: "admin"
18392
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18393
+ kind: "mutation",
18394
+ auth: "admin"
18395
+ }), method(object({
18396
+ instanceId: string().min(1),
18397
+ enabled: boolean()
18398
+ }), TerminalInstanceInfoSchema, {
18399
+ kind: "mutation",
18400
+ auth: "admin"
18401
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18402
+ stableId: string().min(1),
18403
+ name: string().trim().min(1).max(160).optional()
18404
+ }), TerminalInstanceInfoSchema, {
18405
+ kind: "mutation",
18406
+ auth: "admin"
18407
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18265
18408
  profileId: string(),
18266
18409
  cols: number().int().positive(),
18267
18410
  rows: number().int().positive()
@@ -18278,7 +18421,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18278
18421
  }), method(object({
18279
18422
  sessionId: string(),
18280
18423
  afterSeq: number().int().nonnegative(),
18281
- waitMs: number().int().min(0).max(2e3).default(0)
18424
+ waitMs: number().int().min(0).max(2e3).default(0),
18425
+ /**
18426
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18427
+ * browser's initial repaint remains immediate; the camera snapshot
18428
+ * relay uses it to avoid encoding a blank startup frame.
18429
+ */
18430
+ waitForOutput: boolean().optional()
18282
18431
  }), TerminalOutputBatchSchema, {
18283
18432
  kind: "mutation",
18284
18433
  auth: "admin",
@@ -23018,13 +23167,19 @@ method(object({
23018
23167
  }), {
23019
23168
  kind: "mutation",
23020
23169
  auth: "admin"
23021
- }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23170
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23022
23171
  kind: "mutation",
23023
23172
  auth: "admin"
23024
- }), method(object({}), array(RelocateJobSchema).readonly(), {
23025
- kind: "query",
23173
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23174
+ kind: "mutation",
23175
+ auth: "admin"
23176
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23177
+ kind: "mutation",
23026
23178
  auth: "admin"
23027
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23179
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23180
+ kind: "mutation",
23181
+ auth: "admin"
23182
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23028
23183
  kind: "mutation",
23029
23184
  auth: "admin"
23030
23185
  });
@@ -27248,7 +27403,7 @@ Object.freeze({
27248
27403
  addonId: null,
27249
27404
  access: "create"
27250
27405
  },
27251
- "pipelineAnalytics.cancelMediaRelocate": {
27406
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27252
27407
  capName: "pipeline-analytics",
27253
27408
  capScope: "device",
27254
27409
  addonId: null,
@@ -27320,12 +27475,6 @@ Object.freeze({
27320
27475
  addonId: null,
27321
27476
  access: "view"
27322
27477
  },
27323
- "pipelineAnalytics.getMediaRelocateStatus": {
27324
- capName: "pipeline-analytics",
27325
- capScope: "device",
27326
- addonId: null,
27327
- access: "view"
27328
- },
27329
27478
  "pipelineAnalytics.getMotionEvents": {
27330
27479
  capName: "pipeline-analytics",
27331
27480
  capScope: "device",
@@ -27362,6 +27511,12 @@ Object.freeze({
27362
27511
  addonId: null,
27363
27512
  access: "view"
27364
27513
  },
27514
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
27515
+ capName: "pipeline-analytics",
27516
+ capScope: "device",
27517
+ addonId: null,
27518
+ access: "view"
27519
+ },
27365
27520
  "pipelineAnalytics.getTrack": {
27366
27521
  capName: "pipeline-analytics",
27367
27522
  capScope: "device",
@@ -27440,6 +27595,12 @@ Object.freeze({
27440
27595
  addonId: null,
27441
27596
  access: "view"
27442
27597
  },
27598
+ "pipelineAnalytics.pauseForStorageMigration": {
27599
+ capName: "pipeline-analytics",
27600
+ capScope: "device",
27601
+ addonId: null,
27602
+ access: "create"
27603
+ },
27443
27604
  "pipelineAnalytics.proposeRetrainAnnotations": {
27444
27605
  capName: "pipeline-analytics",
27445
27606
  capScope: "device",
@@ -27470,7 +27631,7 @@ Object.freeze({
27470
27631
  addonId: null,
27471
27632
  access: "create"
27472
27633
  },
27473
- "pipelineAnalytics.relocateMedia": {
27634
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27474
27635
  capName: "pipeline-analytics",
27475
27636
  capScope: "device",
27476
27637
  addonId: null,
@@ -27482,6 +27643,12 @@ Object.freeze({
27482
27643
  addonId: null,
27483
27644
  access: "create"
27484
27645
  },
27646
+ "pipelineAnalytics.resumeForStorageMigration": {
27647
+ capName: "pipeline-analytics",
27648
+ capScope: "device",
27649
+ addonId: null,
27650
+ access: "create"
27651
+ },
27485
27652
  "pipelineAnalytics.saveRetrainAnnotations": {
27486
27653
  capName: "pipeline-analytics",
27487
27654
  capScope: "device",
@@ -27506,6 +27673,12 @@ Object.freeze({
27506
27673
  addonId: null,
27507
27674
  access: "create"
27508
27675
  },
27676
+ "pipelineAnalytics.startStorageMigrationMove": {
27677
+ capName: "pipeline-analytics",
27678
+ capScope: "device",
27679
+ addonId: null,
27680
+ access: "create"
27681
+ },
27509
27682
  "pipelineAnalytics.wipeAllAnalytics": {
27510
27683
  capName: "pipeline-analytics",
27511
27684
  capScope: "device",
@@ -27872,6 +28045,12 @@ Object.freeze({
27872
28045
  addonId: null,
27873
28046
  access: "view"
27874
28047
  },
28048
+ "pipelineOrchestrator.pauseForStorageMigration": {
28049
+ capName: "pipeline-orchestrator",
28050
+ capScope: "system",
28051
+ addonId: null,
28052
+ access: "create"
28053
+ },
27875
28054
  "pipelineOrchestrator.rebalance": {
27876
28055
  capName: "pipeline-orchestrator",
27877
28056
  capScope: "system",
@@ -27896,6 +28075,12 @@ Object.freeze({
27896
28075
  addonId: null,
27897
28076
  access: "view"
27898
28077
  },
28078
+ "pipelineOrchestrator.resumeForStorageMigration": {
28079
+ capName: "pipeline-orchestrator",
28080
+ capScope: "system",
28081
+ addonId: null,
28082
+ access: "create"
28083
+ },
27899
28084
  "pipelineOrchestrator.saveTemplate": {
27900
28085
  capName: "pipeline-orchestrator",
27901
28086
  capScope: "system",
@@ -28292,7 +28477,7 @@ Object.freeze({
28292
28477
  addonId: null,
28293
28478
  access: "create"
28294
28479
  },
28295
- "recording.cancelRelocate": {
28480
+ "recording.cancelStorageMigrationMove": {
28296
28481
  capName: "recording",
28297
28482
  capScope: "system",
28298
28483
  addonId: null,
@@ -28328,7 +28513,7 @@ Object.freeze({
28328
28513
  addonId: null,
28329
28514
  access: "view"
28330
28515
  },
28331
- "recording.getRelocateStatus": {
28516
+ "recording.getStorageMigrationMoveStatus": {
28332
28517
  capName: "recording",
28333
28518
  capScope: "system",
28334
28519
  addonId: null,
@@ -28352,6 +28537,12 @@ Object.freeze({
28352
28537
  addonId: null,
28353
28538
  access: "view"
28354
28539
  },
28540
+ "recording.pauseForStorageMigration": {
28541
+ capName: "recording",
28542
+ capScope: "system",
28543
+ addonId: null,
28544
+ access: "create"
28545
+ },
28355
28546
  "recording.pruneFootage": {
28356
28547
  capName: "recording",
28357
28548
  capScope: "system",
@@ -28370,7 +28561,7 @@ Object.freeze({
28370
28561
  addonId: null,
28371
28562
  access: "view"
28372
28563
  },
28373
- "recording.relocateFootage": {
28564
+ "recording.refreshStorageLocationsForMigration": {
28374
28565
  capName: "recording",
28375
28566
  capScope: "system",
28376
28567
  addonId: null,
@@ -28394,12 +28585,24 @@ Object.freeze({
28394
28585
  addonId: null,
28395
28586
  access: "create"
28396
28587
  },
28588
+ "recording.resumeForStorageMigration": {
28589
+ capName: "recording",
28590
+ capScope: "system",
28591
+ addonId: null,
28592
+ access: "create"
28593
+ },
28397
28594
  "recording.setDeviceConfig": {
28398
28595
  capName: "recording",
28399
28596
  capScope: "system",
28400
28597
  addonId: null,
28401
28598
  access: "create"
28402
28599
  },
28600
+ "recording.startStorageMigrationMove": {
28601
+ capName: "recording",
28602
+ capScope: "system",
28603
+ addonId: null,
28604
+ access: "create"
28605
+ },
28403
28606
  "recordingExport.cancelExport": {
28404
28607
  capName: "recordingExport",
28405
28608
  capScope: "system",
@@ -28790,6 +28993,30 @@ Object.freeze({
28790
28993
  addonId: null,
28791
28994
  access: "view"
28792
28995
  },
28996
+ "storageMigration.cancel": {
28997
+ capName: "storage-migration",
28998
+ capScope: "system",
28999
+ addonId: null,
29000
+ access: "create"
29001
+ },
29002
+ "storageMigration.plan": {
29003
+ capName: "storage-migration",
29004
+ capScope: "system",
29005
+ addonId: null,
29006
+ access: "view"
29007
+ },
29008
+ "storageMigration.start": {
29009
+ capName: "storage-migration",
29010
+ capScope: "system",
29011
+ addonId: null,
29012
+ access: "create"
29013
+ },
29014
+ "storageMigration.status": {
29015
+ capName: "storage-migration",
29016
+ capScope: "system",
29017
+ addonId: null,
29018
+ access: "view"
29019
+ },
28793
29020
  "storageProvider.abortUpload": {
28794
29021
  capName: "storage-provider",
28795
29022
  capScope: "system",
@@ -29168,12 +29395,42 @@ Object.freeze({
29168
29395
  addonId: null,
29169
29396
  access: "create"
29170
29397
  },
29398
+ "terminalSession.adoptLegacyMonitor": {
29399
+ capName: "terminal-session",
29400
+ capScope: "system",
29401
+ addonId: null,
29402
+ access: "create"
29403
+ },
29171
29404
  "terminalSession.close": {
29172
29405
  capName: "terminal-session",
29173
29406
  capScope: "system",
29174
29407
  addonId: null,
29175
29408
  access: "create"
29176
29409
  },
29410
+ "terminalSession.createInstance": {
29411
+ capName: "terminal-session",
29412
+ capScope: "system",
29413
+ addonId: null,
29414
+ access: "create"
29415
+ },
29416
+ "terminalSession.deleteInstance": {
29417
+ capName: "terminal-session",
29418
+ capScope: "system",
29419
+ addonId: null,
29420
+ access: "delete"
29421
+ },
29422
+ "terminalSession.listInstances": {
29423
+ capName: "terminal-session",
29424
+ capScope: "system",
29425
+ addonId: null,
29426
+ access: "view"
29427
+ },
29428
+ "terminalSession.listLegacyCameras": {
29429
+ capName: "terminal-session",
29430
+ capScope: "system",
29431
+ addonId: null,
29432
+ access: "view"
29433
+ },
29177
29434
  "terminalSession.listProfiles": {
29178
29435
  capName: "terminal-session",
29179
29436
  capScope: "system",
@@ -29204,6 +29461,12 @@ Object.freeze({
29204
29461
  addonId: null,
29205
29462
  access: "create"
29206
29463
  },
29464
+ "terminalSession.setInstanceEnabled": {
29465
+ capName: "terminal-session",
29466
+ capScope: "system",
29467
+ addonId: null,
29468
+ access: "create"
29469
+ },
29207
29470
  "terminalSession.writeInput": {
29208
29471
  capName: "terminal-session",
29209
29472
  capScope: "system",
@@ -29927,7 +30190,7 @@ var AdminUIAddon = class extends BaseAddon {
29927
30190
  capability: adminUiCapability,
29928
30191
  provider: {
29929
30192
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
29930
- getVersion: async () => ({ version: "1.2.46" })
30193
+ getVersion: async () => ({ version: "1.2.48" })
29931
30194
  }
29932
30195
  }];
29933
30196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.46",
3
+ "version": "1.2.48",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -1 +0,0 @@
1
- import{Oa as e,ka as t,uo as n}from"./src-C0ryWGb4.js";import{I as r,O as i,Q as a,S as o,W as s,a as c,o as l,q as u,x as d,z as f}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{p}from"./player-overlays-BfbNCp8v.js";import{t as m}from"./FormBuilder-CaOtuJSH.js";import{t as h}from"./pencil-DxgsOdJ_.js";import{t as g}from"./plus-CRlbDvh8.js";import{P as _,S as v,W as y,i as b,s as x}from"./index-BpMOZW4i.js";var S=y(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),C=y(`hard-drive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),w=y(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);a();function T(e){return`${(e/1024**3).toFixed(e>=100*1024**3?0:1)} GB`}function E({location:e}){let t=e.capacity;return t==null?null:o(`span`,{className:`text-[10px] text-foreground-subtle tabular-nums`,children:[T(t.availableBytes),` free of `,T(t.totalBytes)]})}function D(e){let t=e.basePath;if(typeof t==`string`&&t.length>0)return t;let n=Object.keys(e);return n.length===0?``:n.join(`, `)}function O({location:e,cardinality:t,onEdit:n,onDelete:r,onSetDefault:i,onRelocate:a}){let s=D(e.config);return o(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2 border-t border-border first:border-t-0 hover:bg-primary/5`,children:[o(`div`,{className:`flex flex-wrap items-center gap-2 min-w-0 flex-1 basis-64`,children:[d(`div`,{className:`w-[88px] shrink-0`,children:e.isDefault?o(`span`,{className:`inline-flex items-center gap-0.5 rounded bg-primary/10 border border-primary/20 px-1.5 py-0.5 text-[10px] font-semibold text-primary uppercase tracking-wide`,title:`Default location for this type`,children:[d(w,{className:`h-2.5 w-2.5 fill-primary`}),`Default`]}):o(`button`,{onClick:()=>i(e),className:`inline-flex items-center gap-0.5 rounded border border-border px-1.5 py-0.5 text-[10px] font-medium text-foreground-subtle hover:text-foreground hover:bg-primary/10 hover:border-primary/30 uppercase tracking-wide`,title:`Promote to default for this type`,children:[d(w,{className:`h-2.5 w-2.5`}),`Set default`]})}),d(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e.providerId}),e.isSystem&&d(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5`,title:`System-managed location — cannot be deleted; edit config to relocate`,children:`system`}),e.config.readOnly===!0&&d(`span`,{className:`text-[10px] uppercase tracking-wide text-warning bg-warning/10 border border-warning/30 rounded px-1.5 py-0.5`,title:`Drain mode — reads and age retention continue; nothing new is written here and disk-pressure eviction skips it`,children:`read-only`}),o(`div`,{className:`min-w-0`,children:[d(`div`,{className:`text-xs font-medium text-foreground truncate`,children:e.displayName}),o(`div`,{className:`flex flex-wrap items-center gap-x-2`,children:[s&&d(`span`,{className:`text-[10px] text-foreground-subtle truncate font-mono`,children:s}),d(E,{location:e})]})]})]}),o(`div`,{className:`flex flex-wrap items-center gap-1 shrink-0`,children:[!e.isDefault&&o(`button`,{onClick:()=>i(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/10`,title:`Set as default for this type`,children:[d(w,{className:`h-3 w-3`}),`Set default`]}),a&&o(`button`,{onClick:()=>a(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/10`,title:`Move this location's footage/media to another location (drain)`,children:[d(S,{className:`h-3 w-3`}),`Relocate`]}),o(`button`,{onClick:()=>n(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/10`,children:[d(h,{className:`h-3 w-3`}),`Edit`]}),!e.isSystem&&t!==`single`&&d(`button`,{onClick:()=>r(e),className:`inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium text-danger hover:bg-danger/10`,title:`Delete location`,children:d(x,{className:`h-3 w-3`})})]})]})}function k({type:e,displayName:t,description:n,cardinality:r,locations:a,onAdd:c,onEdit:l,onDelete:u,onSetDefault:f,onRelocate:p}){let m=s(()=>{let e=[...a];return e.sort((e,t)=>e.isDefault===t.isDefault?e.displayName.localeCompare(t.displayName):e.isDefault?-1:1),e},[a]);return o(`div`,{className:`rounded-lg border border-border bg-surface`,children:[o(`div`,{className:`flex items-start justify-between border-b border-border px-3 py-2`,children:[o(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`flex items-center gap-2`,children:[d(`span`,{className:`text-sm font-semibold text-foreground capitalize`,children:t}),d(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle bg-background border border-border rounded px-1.5 py-0.5 font-mono`,children:e})]}),n&&d(`p`,{className:`text-[11px] text-foreground-subtle`,children:n}),r===`single`&&d(`p`,{className:`text-[10px] text-foreground-subtle italic`,children:`Single — one location per type. Edit the existing entry; it can't be split.`})]}),r===`multi`&&o(`button`,{onClick:()=>c(e),className:`inline-flex items-center gap-1 rounded bg-primary px-2 py-1 text-[11px] font-medium text-primary-foreground hover:bg-primary/90`,children:[d(g,{className:`h-3 w-3`}),`Add`]})]}),m.length===0?d(`div`,{className:`px-3 py-4 text-center text-[11px] text-foreground-subtle italic`,children:r===`multi`?`No location registered. Click "Add" to register one.`:`No location registered yet — should be auto-seeded at next boot.`}):d(`div`,{children:m.map(e=>i(O,{...p?{onRelocate:p}:{},key:e.id,location:e,cardinality:r,onEdit:l,onDelete:u,onSetDefault:f}))})]})}a();function A({nodeId:e,value:t,onChange:n}){let i=p().trpcClient,[a,s]=u([]),[c,l]=u(t),[m,h]=u(null),[g,_]=u(null),[v,y]=u(``),b=r(async(t,r)=>{_(null);try{let a=await i.filesystemBrowse.browse.query({nodeId:e,path:t});h(a),l(a.path),r&&n(a.path)}catch(e){_(e instanceof Error?e.message:`browse failed`)}},[i,e,n]);f(()=>{l(t),(async()=>{try{let n=await i.filesystemBrowse.listAllowedRoots.query({nodeId:e});s(n),await b(t&&n.some(e=>t.startsWith(e))?t:n[0]??``,!1)}catch(e){s([]),h(null),_(e instanceof Error&&/not available on node/i.test(e.message)?`This node can't be browsed remotely. Enter the path manually.`:e instanceof Error?e.message:`browse unavailable`)}})()},[e]);let x=async()=>{if(!(!v.trim()||!m)){_(null);try{let t=`${m.path.replace(/\/+$/,``)}/${v.trim()}`;await i.filesystemBrowse.createDir.mutate({nodeId:e,path:t}),y(``),await b(m.path,!0)}catch(e){_(e instanceof Error?e.message:`create failed`)}}},S=e=>`${(e/1e9).toFixed(1)} GB`;return o(`div`,{className:`space-y-2 rounded border border-border p-2`,children:[d(`div`,{className:`flex flex-wrap gap-1`,children:a.map(e=>d(`button`,{onClick:()=>void b(e,!0),className:`rounded border border-border px-2 py-0.5 text-[10px] font-mono hover:border-primary/40`,children:e},e))}),d(`input`,{value:c,onChange:e=>{l(e.target.value),n(e.target.value)},placeholder:`/absolute/path`,className:`w-full rounded border border-border bg-background px-2 py-1 text-[11px] font-mono`}),m&&o(`div`,{className:`text-[10px] text-foreground-subtle`,children:[S(m.freeBytes),` free / `,S(m.totalBytes)]}),d(`div`,{className:`max-h-40 space-y-0.5 overflow-y-auto`,children:m?.entries.map(e=>o(`button`,{onClick:()=>void b(e.path,!0),className:`block w-full truncate rounded px-2 py-1 text-left text-xs hover:bg-primary/5`,children:[`📁 `,e.name]},e.path))}),o(`div`,{className:`flex gap-1`,children:[d(`input`,{value:v,onChange:e=>y(e.target.value),placeholder:`new folder`,className:`flex-1 rounded border border-border bg-background px-2 py-1 text-xs`}),d(`button`,{onClick:()=>void x(),className:`rounded border border-border px-2 py-1 text-xs hover:border-primary/40`,children:`Create`})]}),g&&d(`div`,{className:`text-[10px] text-red-400`,children:g})]})}a();function j({location:r,onClose:i,onSaved:a}){let f=l(),h=p().trpcClient,[g,_]=u({...r.config}),[y,x]=u(r.displayName),[S,C]=u(null),[w,T]=u(!1),E=e(),D=s(()=>{let e=E.data;return Array.isArray(e)?e.find(e=>e.providerId===r.providerId)??null:null},[E.data,r.providerId]),O=t({onSuccess:()=>{f.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),a()}}),k=D?.shouldSaveDiskSpace===!0,j=D?.nodeLocal===!0,[M,N]=u(typeof r.nodeId==`string`?r.nodeId:`hub`),P=typeof g.basePath==`string`?g.basePath:``,F=e=>_(t=>({...t,basePath:e})),I=g.readOnly===!0,L=c({queryKey:[`storage`,`listLocations`,`ro-guard`],queryFn:()=>h.storage.listLocations.query({})}),R=(L.data??[]).filter(e=>e.type===r.type&&e.id!==r.id&&e.config.readOnly!==!0).length,z=!I&&L.data!==void 0&&R===0,B=e=>_(t=>{let n={...t};return delete n.readOnly,e?{...n,readOnly:!0}:n}),V=typeof g.maxUsedGb==`number`?g.maxUsedGb:``,H=e=>{let t=e.trim(),n=t===``?void 0:Number(t);_(e=>{let t={...e};return n===void 0||!Number.isFinite(n)||n<=0?delete t.maxUsedGb:t.maxUsedGb=n,t})},U=typeof g.minFreePercent==`number`?g.minFreePercent:``,W=e=>{let t=e.trim(),n=t===``?void 0:Number(t);_(e=>{let t={...e};return n===void 0||!Number.isFinite(n)?delete t.minFreePercent:t.minFreePercent=Math.min(100,Math.max(0,n)),t})},G=async()=>{T(!0),C(null);try{C(await(e=>h.storage.testConfig.query(e))({providerId:r.providerId,config:g}))}catch(e){C({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{T(!1)}};return d(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:i,children:o(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[o(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[o(`div`,{className:`space-y-0.5`,children:[o(`h2`,{className:`text-sm font-semibold text-foreground`,children:[`Edit `,r.displayName]}),o(`p`,{className:`text-xs text-foreground-subtle`,children:[d(`span`,{className:`font-mono`,children:r.id}),` ·`,` `,D?.displayName??r.providerId]})]}),d(`button`,{onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:d(b,{className:`h-4 w-4`})})]}),o(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[o(`div`,{className:`space-y-1`,children:[d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),d(`input`,{type:`text`,value:y,onChange:e=>x(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),D&&d(m,{schema:D.configSchema,values:g,onChange:_}),o(`div`,{className:`space-y-1`,children:[o(`label`,{className:`flex items-center gap-2 text-xs ${z?`text-foreground-subtle cursor-not-allowed`:`text-foreground cursor-pointer`}`,children:[d(`input`,{type:`checkbox`,checked:I,disabled:z,onChange:e=>B(e.target.checked),className:`accent-primary`}),`Read-only (drain mode)`]}),d(`p`,{className:`text-[10px] text-foreground-subtle`,children:z?`Blocked: this is the last writable location of its type — new footage would have nowhere to go.`:`Reads and age-based retention continue; nothing new is written here and disk-pressure eviction skips it. Use it to slowly decommission a disk.`})]}),j&&o(`div`,{className:`space-y-2`,children:[d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),d(n,{selectedNodeId:M,onSelect:N,alwaysShow:!0}),d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),d(A,{nodeId:M,value:P,onChange:F})]}),k&&o(`div`,{className:`space-y-1`,children:[d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Min free disk %`}),d(`input`,{type:`number`,min:0,max:100,value:U,placeholder:D?.minFreePercent==null?``:String(D.minFreePercent),onChange:e=>W(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),o(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`When free space on this volume drops below this %, the oldest data stored here is evicted to reclaim space.`,D?.minFreePercent==null?` Empty = use the default.`:` Empty = use the default (${D.minFreePercent}%).`]}),d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Max used (GB)`}),d(`input`,{type:`number`,min:1,value:V,placeholder:`unlimited`,onChange:e=>H(e.target.value),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),d(`p`,{className:`text-[10px] text-foreground-subtle`,children:`Hard cap on the TOTAL bytes evictable data (recordings) may occupy on this location, independent of disk free space — oldest footage is evicted past it. Empty = unlimited.`})]}),!D&&!E.isLoading&&o(`div`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-700 dark:text-amber-300`,children:[`Provider `,d(`code`,{className:`font-mono`,children:r.providerId}),` is no longer registered. Field schema unavailable; raw config is preserved on save.`]}),S&&d(`div`,{className:`rounded border px-3 py-2 text-[11px] ${S.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:S.ok?`Connection OK.`:`Test failed: ${S.error??`unknown error`}`}),O.isError&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:O.error instanceof Error?O.error.message:String(O.error)})]}),o(`div`,{className:`flex items-center justify-between gap-2 border-t border-border px-4 py-3`,children:[d(`button`,{onClick:i,className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Cancel`}),o(`div`,{className:`flex items-center gap-2`,children:[d(`button`,{onClick:()=>{G()},disabled:w||!D,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:w?`Testing…`:`Test connection`}),o(`button`,{onClick:()=>{O.mutate({id:r.id,type:r.type,providerId:r.providerId,isDefault:r.isDefault,displayName:y.trim(),config:g,nodeId:j?M:void 0})},disabled:O.isPending||y.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[O.isPending?d(v,{className:`h-3.5 w-3.5 animate-spin`}):null,O.isPending?`Saving…`:`Save`]})]})]})]})})}function M(e){let t=e.trim().toLowerCase();return t.length===0?``:t.replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function N(e,t){let n=M(t);return`${e}:${n.length>0?n:`default`}`}a();function P({initialType:r,onClose:i,onCreated:a}){let c=l(),f=p().trpcClient,[h,g]=u(`picker`),[y,x]=u(r),[S,C]=u(null),[w,T]=u({}),[E,D]=u(``),[O,k]=u(null),[j,M]=u(!1),[P,F]=u(`hub`),[I,L]=u(null),[R,z]=u(!1),B=e=>T(t=>({...t,basePath:e})),V=typeof w.basePath==`string`?w.basePath:``,H=e(),U=s(()=>{let e=H.data;return Array.isArray(e)?e:[]},[H.data]),W=H.isLoading,G=t({onSuccess:()=>{c.invalidateQueries({queryKey:[[`storage`,`listLocations`]]}),a()}}),K=s(()=>O!==null&&O.length>0?O:N(y,E),[y,E,O]),q=async()=>{if(S){z(!0),L(null);try{L(await(e=>f.storage.testConfig.query(e))({providerId:S.providerId,config:w}))}catch(e){L({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{z(!1)}}};return d(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm`,onClick:i,children:o(`div`,{className:`w-full max-w-md rounded-xl border border-border bg-surface shadow-2xl`,onClick:e=>e.stopPropagation(),children:[o(`div`,{className:`flex items-start justify-between border-b border-border px-4 py-3`,children:[o(`div`,{className:`space-y-0.5`,children:[d(`h2`,{className:`text-sm font-semibold text-foreground`,children:{picker:`Add Location — Pick provider`,config:`Add Location — ${S?.displayName??``}`,naming:`Add Location — Name & defaults`}[h]}),o(`p`,{className:`text-xs text-foreground-subtle`,children:[`Type: `,d(`span`,{className:`font-mono`,children:y})]})]}),d(`button`,{onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:d(b,{className:`h-4 w-4`})})]}),h===`picker`&&o(`div`,{className:`p-4 space-y-2`,children:[W&&d(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:`Loading providers…`}),!W&&U.length===0&&o(`div`,{className:`rounded border border-border bg-background px-3 py-4 text-center text-xs text-foreground-subtle`,children:[`No storage-provider supports type "`,y,`". Install a compatible addon (e.g.`,` `,d(`code`,{className:`font-mono`,children:`remote-storage`}),`) to enable it.`]}),U.map(e=>o(`button`,{onClick:()=>{C(e),g(`config`)},className:`flex w-full items-center gap-3 rounded-lg border border-border bg-background p-3 text-left hover:border-primary/40 hover:bg-primary/5 transition-colors`,children:[o(`div`,{className:`flex-1 min-w-0`,children:[d(`p`,{className:`text-xs font-semibold text-foreground`,children:e.displayName}),d(`p`,{className:`text-[10px] text-foreground-subtle font-mono mt-0.5 truncate`,children:e.providerId})]}),d(_,{className:`h-4 w-4 text-foreground-subtle flex-shrink-0`})]},e.providerId))]}),h===`config`&&S&&o(`div`,{className:`p-4 space-y-3 max-h-[60vh] overflow-y-auto`,children:[d(m,{schema:S.configSchema,values:w,onChange:T}),S.nodeLocal&&o(`div`,{className:`space-y-2`,children:[d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Node`}),d(n,{selectedNodeId:P,onSelect:F,alwaysShow:!0}),d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Path`}),d(A,{nodeId:P,value:V,onChange:B})]}),I&&d(`div`,{className:`rounded border px-3 py-2 text-[11px] ${I.ok?`border-success/30 bg-success/5 text-success`:`border-danger/30 bg-danger/5 text-danger`}`,children:I.ok?`Connection OK.`:`Test failed: ${I.error??`unknown error`}`}),o(`div`,{className:`flex items-center justify-between pt-1`,children:[d(`button`,{onClick:()=>g(`picker`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),o(`div`,{className:`flex items-center gap-2`,children:[d(`button`,{onClick:()=>{q()},disabled:R,className:`rounded border border-border px-3 py-1.5 text-xs text-foreground hover:bg-primary/10 disabled:opacity-50`,children:R?`Testing…`:`Test connection`}),d(`button`,{onClick:()=>g(`naming`),className:`rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90`,children:`Next`})]})]})]}),h===`naming`&&S&&o(`div`,{className:`p-4 space-y-3`,children:[o(`div`,{className:`space-y-1`,children:[d(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:`Display name`}),d(`input`,{type:`text`,value:E,onChange:e=>D(e.target.value),placeholder:`${y} on ${S.displayName}`,className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]}),o(`div`,{className:`space-y-1`,children:[o(`label`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:[`Id`,` `,d(`span`,{className:`lowercase tracking-normal text-foreground-subtle`,children:`— auto-derived; override if needed`})]}),d(`input`,{type:`text`,value:K,onChange:e=>k(e.target.value),placeholder:N(y,E),className:`w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-1 focus:ring-primary`}),o(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Format: `,d(`code`,{className:`font-mono`,children:`<type>:<slug>`}),`. Lowercase letters, digits, and hyphens only.`]})]}),o(`label`,{className:`flex items-start gap-2 rounded border border-border bg-background px-3 py-2 cursor-pointer hover:bg-primary/5`,children:[d(`input`,{type:`checkbox`,checked:j,onChange:e=>M(e.target.checked),className:`accent-primary mt-0.5`}),o(`div`,{className:`space-y-0.5`,children:[o(`div`,{className:`text-xs font-medium text-foreground`,children:[`Mark as default for type "`,y,`"`]}),o(`div`,{className:`text-[10px] text-foreground-subtle`,children:[`Setting this as default will demote the current default for this type. References like `,o(`code`,{className:`font-mono`,children:[`"`,y,`"`]}),` resolve to whichever location is the default.`]})]})]}),G.isError&&d(`div`,{className:`rounded border border-danger/30 bg-danger/5 text-danger px-3 py-2 text-[11px]`,children:G.error instanceof Error?G.error.message:String(G.error)}),o(`div`,{className:`flex items-center justify-between pt-1`,children:[d(`button`,{onClick:()=>g(`config`),className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Back`}),o(`div`,{className:`flex items-center gap-2`,children:[d(`button`,{onClick:()=>{x(r),C(null),T({}),D(``),k(null),M(!1),L(null),g(`picker`)},className:`rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground`,children:`Reset`}),o(`button`,{onClick:()=>{S&&G.mutate({id:K,type:y,displayName:E.trim(),providerId:S.providerId,config:w,isDefault:j,nodeId:S.nodeLocal?P:void 0})},disabled:G.isPending||E.trim().length===0,className:`inline-flex items-center gap-1.5 rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50`,children:[G.isPending?d(v,{className:`h-3.5 w-3.5 animate-spin`}):null,G.isPending?`Saving…`:`Save`]})]})]})]})]})})}export{S as a,C as i,j as n,k as r,P as t};