@camstack/addon-admin-ui 1.2.454 → 1.2.456

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 (134) hide show
  1. package/dist/assets/{AddonAssetIcon-VkmH6Hi0.js → AddonAssetIcon-DKGFFkU1.js} +1 -1
  2. package/dist/assets/Addons-f6INIGNk.js +4 -0
  3. package/dist/assets/{AdminPage-C1yHKZaW.js → AdminPage-DRcphXBk.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-D0_xxfLz.js → AdminSectionedPage-DSgwWy9V.js} +1 -1
  5. package/dist/assets/AiProfiles-B6Wxjm7J.js +3 -0
  6. package/dist/assets/{BrokerForm-BbnQbIkC.js → BrokerForm-DQh-oQXM.js} +1 -1
  7. package/dist/assets/Build-C1E3G4Li.js +40 -0
  8. package/dist/assets/{Calendars-DvFtzKfD.js → Calendars-BVNS3qJH.js} +1 -1
  9. package/dist/assets/{Cluster-BnnXXwaD.js → Cluster-Bb3ssLVf.js} +1 -1
  10. package/dist/assets/ClusterStepModel-BTonEQ8Q.js +1 -0
  11. package/dist/assets/{CompositionEditor-BnbCJaZ7.js → CompositionEditor-ClnrKef1.js} +1 -1
  12. package/dist/assets/{CompositionEditorPage-h_j5gfRK.js → CompositionEditorPage-UPZOCUTw.js} +1 -1
  13. package/dist/assets/Data-CMmaSXTq.js +2 -0
  14. package/dist/assets/DeviceDetail-r7xGh0V5.js +2 -0
  15. package/dist/assets/{DeviceDoActionFields-7tLqYUgk.js → DeviceDoActionFields-CK_hotUV.js} +1 -1
  16. package/dist/assets/{Devices-qnVgYCvV.js → Devices-D9qIPy3j.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-DO_Fhf86.js → EmbedPlayerPage-CnyoNW1O.js} +1 -1
  18. package/dist/assets/{History-CB37gQPG.js → History-Bu-xlBT6.js} +1 -1
  19. package/dist/assets/Identity-uOmwWcOV.js +1 -0
  20. package/dist/assets/IntegrationDetail-0gsMfR07.js +1 -0
  21. package/dist/assets/{IntegrationHub-CuRmiVZu.js → IntegrationHub-PQzIoW-z.js} +1 -1
  22. package/dist/assets/{Integrations-CsILpkwz.js → Integrations-97rH5eud.js} +1 -1
  23. package/dist/assets/Integrations-CjQ8VMPF.js +1 -0
  24. package/dist/assets/Library-DlZO8qd2.js +1 -0
  25. package/dist/assets/Locations-C5D3OkBO.js +3 -0
  26. package/dist/assets/{Logs-DGH37xdv.js → Logs-CKiP2BRT.js} +1 -1
  27. package/dist/assets/{MaskShapeCanvas-B7UfzO2p.js → MaskShapeCanvas-DWXNtDDM.js} +1 -1
  28. package/dist/assets/{MotionZonesSettings-F9pLpX9L.js → MotionZonesSettings-DJd0Y31u.js} +1 -1
  29. package/dist/assets/MyAccess-B_R_Psa6.js +2 -0
  30. package/dist/assets/{Network-B18hOLCN.js → Network-T6uv6aRS.js} +1 -1
  31. package/dist/assets/{NodeAddonsSettingsPanel-CjiY8FoY.js → NodeAddonsSettingsPanel-UU1LJcnK.js} +1 -1
  32. package/dist/assets/Notifications-BW3LX1UG.js +1 -0
  33. package/dist/assets/{PrivacyMaskSettings-DZxZnlFp.js → PrivacyMaskSettings-DxMOo9HB.js} +1 -1
  34. package/dist/assets/{Recordings-RrXxP3Gw.js → Recordings-Clc8K8NN.js} +1 -1
  35. package/dist/assets/{ScanNetworkModal-1aqy8mwU.js → ScanNetworkModal-Cf68s1om.js} +1 -1
  36. package/dist/assets/SceneMonitorEditor-BiawWZG0.js +1 -0
  37. package/dist/assets/{SessionsList-sIr7qR9a.js → SessionsList-Dt8jP4yn.js} +2 -2
  38. package/dist/assets/{Showroom-B3fWQqgz.js → Showroom-qUHeS3m7.js} +1 -1
  39. package/dist/assets/{System-CVcSFxSx.js → System-CdmK8YJa.js} +1 -1
  40. package/dist/assets/{Terminal-BUB985tf.js → Terminal-Cju5rV2v.js} +5 -5
  41. package/dist/assets/{Viewer-D8p0DNRV.js → Viewer-YynlXnis.js} +1 -1
  42. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BgowCzl0.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-03dAXb2d.js} +1 -1
  43. package/dist/assets/{addon-icons-context-CCY4Chy6.js → addon-icons-context-BRjz6lXp.js} +1 -1
  44. package/dist/assets/{archive-B4ueXwpP.js → archive-C86NKLhj.js} +1 -1
  45. package/dist/assets/{authed-media-DUfWwazN.js → authed-media-DNvCU5gQ.js} +1 -1
  46. package/dist/assets/{bell-off-DbPWzq76.js → bell-off-CLM0BeeE.js} +1 -1
  47. package/dist/assets/{board-model-ga5zbyzL.js → board-model-CGfpWX1e.js} +1 -1
  48. package/dist/assets/{boxes-ccKerYXy.js → boxes-D5kVpHYR.js} +1 -1
  49. package/dist/assets/circle-slash-D3Ys-mWm.js +1 -0
  50. package/dist/assets/client-Cif6ZNXf.js +358 -0
  51. package/dist/assets/{cloud-upload-D4-a84pV.js → cloud-upload-BzujuqId.js} +1 -1
  52. package/dist/assets/crop-BhaNBRht.js +1 -0
  53. package/dist/assets/{device-integration-icon-Ca0UOYQM.js → device-integration-icon-FcBNNpTA.js} +1 -1
  54. package/dist/assets/device-picker-model-BeeSEnbH.js +1 -0
  55. package/dist/assets/dist-D34XdNk-.js +358 -0
  56. package/dist/assets/{dist-D3Oyyulk.js → dist-DfKbyUlI.js} +1 -1
  57. package/dist/assets/{eraser-2bHwZZED.js → eraser-DbfQdK9E.js} +1 -1
  58. package/dist/assets/{hard-drive-download-k8QfLKwC.js → hard-drive-download-BZLuYqC1.js} +1 -1
  59. package/dist/assets/{hostInit-CjRmtJRT.js → hostInit-CkedGVrn.js} +1 -1
  60. package/dist/assets/i18n-D4s8z86g.js +1 -0
  61. package/dist/assets/icons-CR-DXZNQ.js +1 -0
  62. package/dist/assets/index-DLqV2Uxg.css +2 -0
  63. package/dist/assets/index-DbU7nBkH.js +4 -0
  64. package/dist/assets/{key-CuDbVCUz.js → key-Dlm_jdT1.js} +1 -1
  65. package/dist/assets/{key-round-BRMEeWsN.js → key-round-HqP_LM9P.js} +1 -1
  66. package/dist/assets/{layers-KbUH66aS.js → layers-73PWVjHZ.js} +1 -1
  67. package/dist/assets/{linked-devices-model-B-rB-33X.js → linked-devices-model-CtpdAdgc.js} +1 -1
  68. package/dist/assets/{list-ordered-CotkuA82.js → list-ordered-DuUItJBm.js} +1 -1
  69. package/dist/assets/{location-owned-usage-DELXtdR2.js → location-owned-usage-ej64Ij_c.js} +1 -1
  70. package/dist/assets/{log-in-DQUe4FJi.js → log-in-BnTC3lpA.js} +1 -1
  71. package/dist/assets/{memory-stick-AnM8qw0B.js → memory-stick-CFvegwjZ.js} +1 -1
  72. package/dist/assets/{message-square-plus-B2uBa5gT.js → message-square-plus-D19WKqRB.js} +1 -1
  73. package/dist/assets/{mf-entry-bootstrap-0-3d758e9e.js → mf-entry-bootstrap-0-8e777e33.js} +2 -2
  74. package/dist/assets/{mic-off-Bo_efaf4.js → mic-off-BikPboNB.js} +1 -1
  75. package/dist/assets/{monitor-off-YwnAi8NO.js → monitor-off-Bg-VBYZ_.js} +1 -1
  76. package/dist/assets/{monitor-smartphone-ClZC1HD7.js → monitor-smartphone-C--c1kfN.js} +1 -1
  77. package/dist/assets/mount-BeeSEnbH.js +1 -0
  78. package/dist/assets/notification-schedule-field-CqjG-5hF.js +1 -0
  79. package/dist/assets/player-overlays-CRBEyRbr.js +1 -0
  80. package/dist/assets/{recycle-XTjg34_V.js → recycle-DOHVzhvg.js} +1 -1
  81. package/dist/assets/remoteEntry--AbYLxqH.js +1 -0
  82. package/dist/assets/{scan-eye-C1jKyDsQ.js → scan-eye-m2aAerVb.js} +1 -1
  83. package/dist/assets/{scissors-DBqUzGr0.js → scissors-C0kFwmt4.js} +1 -1
  84. package/dist/assets/{search-x-ByO3juBN.js → search-x-C1Zu06fo.js} +1 -1
  85. package/dist/assets/send-DGFOkxsu.js +1 -0
  86. package/dist/assets/{settings-2-BWkb0c2G.js → settings-2-B9EvM-5F.js} +1 -1
  87. package/dist/assets/{speaker-DDQPjvAX.js → speaker-lMBay1CD.js} +1 -1
  88. package/dist/assets/src-X6CKvVYm.js +67 -0
  89. package/dist/assets/{timer-reset-Blxx3dok.js → timer-reset-DQlkGcOB.js} +1 -1
  90. package/dist/assets/{ungroup-CN4S5mRY.js → ungroup-CiuolLZx.js} +1 -1
  91. package/dist/assets/{unlink-BgL0l8MY.js → unlink-S1qKy8_1.js} +1 -1
  92. package/dist/assets/{usb-DNm--xkA.js → usb-BrpBB1_Y.js} +1 -1
  93. package/dist/assets/{use-scenes-feed-Dndpwsum.js → use-scenes-feed-91m9645S.js} +1 -1
  94. package/dist/assets/{use-stationary-objects-BcpvHHPa.js → use-stationary-objects-fCdo-oR4.js} +1 -1
  95. package/dist/assets/useEventInvalidation-BeeSEnbH.js +1 -0
  96. package/dist/assets/{useNodeUrlSelection-CR9zcBjj.js → useNodeUrlSelection-CDosE56A.js} +1 -1
  97. package/dist/assets/user-round-DegbdwtA.js +1 -0
  98. package/dist/assets/{user-x-Vbui2QYl.js → user-x-DLZWkjil.js} +1 -1
  99. package/dist/assets/{video-DMQEqtGc.js → video-Bu3o7z_A.js} +1 -1
  100. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BmveVMIp.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DXKYo8xB.js} +2 -2
  101. package/dist/index.html +30 -11
  102. package/dist/server/addon.js +214 -87
  103. package/package.json +1 -1
  104. package/dist/assets/Addons-DRLALt6u.js +0 -4
  105. package/dist/assets/AiProfiles-8S2VFA-t.js +0 -3
  106. package/dist/assets/Build-gRxa3Am-.js +0 -40
  107. package/dist/assets/ClusterStepModel-Bx54TJ8Z.js +0 -1
  108. package/dist/assets/Data-Dyacsbbw.js +0 -2
  109. package/dist/assets/DeviceDetail-D4wiUlmd.js +0 -2
  110. package/dist/assets/Identity-D0h4AKuZ.js +0 -1
  111. package/dist/assets/IntegrationDetail-C0uWfHWe.js +0 -1
  112. package/dist/assets/Integrations-BfqMDw4g.js +0 -1
  113. package/dist/assets/Library-CukX1gOT.js +0 -1
  114. package/dist/assets/Locations-Diau62ND.js +0 -3
  115. package/dist/assets/MyAccess-6GGbgvIO.js +0 -2
  116. package/dist/assets/Notifications-Cq0iZxjO.js +0 -1
  117. package/dist/assets/SceneMonitorEditor-DPS2Z8Ui.js +0 -1
  118. package/dist/assets/circle-slash-DUGhipJv.js +0 -1
  119. package/dist/assets/client-Bl6RqxzK.js +0 -358
  120. package/dist/assets/crop-CB38y2k9.js +0 -1
  121. package/dist/assets/device-picker-model-CeEZ5g38.js +0 -1
  122. package/dist/assets/dist-BwV3R-hW.js +0 -358
  123. package/dist/assets/i18n-CmR-U0YE.js +0 -1
  124. package/dist/assets/icons-Cm_4MOYg.js +0 -1
  125. package/dist/assets/index-BLk4KKso.js +0 -4
  126. package/dist/assets/index-CcCgJ28N.css +0 -2
  127. package/dist/assets/mount-CeEZ5g38.js +0 -1
  128. package/dist/assets/notification-schedule-field-Bk-u12rY.js +0 -1
  129. package/dist/assets/player-overlays-Bkc1DjP3.js +0 -1
  130. package/dist/assets/remoteEntry-CIwwlTQg.js +0 -1
  131. package/dist/assets/send-xq-hxIyY.js +0 -1
  132. package/dist/assets/src-DFUaqwAi.js +0 -67
  133. package/dist/assets/useEventInvalidation-CeEZ5g38.js +0 -1
  134. package/dist/assets/user-round-BM0S4xMQ.js +0 -1
@@ -5432,7 +5432,7 @@ var ZodIssueCode = {
5432
5432
  var ZodFirstPartyTypeKind;
5433
5433
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5434
5434
  //#endregion
5435
- //#region ../types/dist/sleep-DJFUfKvA.mjs
5435
+ //#region ../types/dist/sleep-CUp20JkO.mjs
5436
5436
  /**
5437
5437
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5438
5438
  * window to float samples (D455).
@@ -8257,7 +8257,11 @@ var ContributionSectionSchema = object({
8257
8257
  literal(4)
8258
8258
  ]).optional(),
8259
8259
  tab: string().optional(),
8260
- location: _enum(["settings", "top-tab"]).optional(),
8260
+ location: _enum([
8261
+ "settings",
8262
+ "top-tab",
8263
+ "hero"
8264
+ ]).optional(),
8261
8265
  order: number().optional(),
8262
8266
  fields: array(any())
8263
8267
  });
@@ -13194,7 +13198,11 @@ var ConfigSectionWithValuesSchema = object({
13194
13198
  literal(4)
13195
13199
  ]).optional(),
13196
13200
  tab: string().optional(),
13197
- location: _enum(["settings", "top-tab"]).optional(),
13201
+ location: _enum([
13202
+ "settings",
13203
+ "top-tab",
13204
+ "hero"
13205
+ ]).optional(),
13198
13206
  order: number().optional(),
13199
13207
  fields: array(any())
13200
13208
  });
@@ -16968,6 +16976,52 @@ var TierStatusSchema = object({
16968
16976
  countedAt: number().nullable()
16969
16977
  });
16970
16978
  /** Operator/diagnostic view: rows per tier, last runs, refusals and drops since boot. */
16979
+ /**
16980
+ * Why a series is orphan. `device-gone`: its device is absent from the
16981
+ * successful device listings (the departure clock). `undeclared`: its `cap:`
16982
+ * key is declared by no capability any more (a field a cap removed).
16983
+ */
16984
+ var DeviceHistoryOrphanReasonSchema = _enum(["device-gone", "undeclared"]);
16985
+ /** Rows held per stored tier. */
16986
+ var TierRowsSchema = object({
16987
+ raw: number().int(),
16988
+ "5m": number().int(),
16989
+ "1h": number().int(),
16990
+ "1d": number().int()
16991
+ });
16992
+ var OrphanSeriesSchema = object({
16993
+ seriesId: number().int(),
16994
+ deviceId: number().int(),
16995
+ key: string(),
16996
+ scope: string(),
16997
+ /** The metric's display name; `null` when its metric row is gone too. */
16998
+ displayName: string().nullable(),
16999
+ reason: DeviceHistoryOrphanReasonSchema,
17000
+ /** `device-gone`: since when the device has been absent; `null` otherwise. */
17001
+ missingSince: number().nullable(),
17002
+ firstTs: number(),
17003
+ lastTs: number(),
17004
+ rows: TierRowsSchema
17005
+ });
17006
+ var DeviceHistoryOrphanDeleteRefusalSchema = _enum([
17007
+ "not-found",
17008
+ "not-orphan",
17009
+ "failed"
17010
+ ]);
17011
+ var OrphanDeleteEntrySchema = discriminatedUnion("ok", [object({
17012
+ seriesId: number().int(),
17013
+ ok: literal(true),
17014
+ deleted: TierRowsSchema
17015
+ }), object({
17016
+ seriesId: number().int(),
17017
+ ok: literal(false),
17018
+ reason: DeviceHistoryOrphanDeleteRefusalSchema
17019
+ })]);
17020
+ var OrphanListSchema = object({
17021
+ series: array(OrphanSeriesSchema).readonly(),
17022
+ /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
17023
+ truncated: boolean()
17024
+ });
16971
17025
  var DeviceHistoryStatusSchema = object({
16972
17026
  startedAt: number(),
16973
17027
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -17065,7 +17119,10 @@ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly())
17065
17119
  }), object({ enabled: boolean() }), {
17066
17120
  kind: "mutation",
17067
17121
  auth: "admin"
17068
- }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" });
17122
+ }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
17123
+ kind: "mutation",
17124
+ auth: "admin"
17125
+ });
17069
17126
  var DeviceCaStatusSchema = discriminatedUnion("state", [
17070
17127
  object({ state: literal("absent") }),
17071
17128
  object({
@@ -49739,6 +49796,19 @@ var NodeInferenceDeviceSchema = object({
49739
49796
  /** Whether the node's live probe reports the device as usable right now. */
49740
49797
  available: boolean(),
49741
49798
  /**
49799
+ * Is the device on the node at all (D919)? `present` — the live probe
49800
+ * reported it; `absent` — the probe ANSWERED and did not report it, so only
49801
+ * its stored settings remain (unplugged, moved to another node): never
49802
+ * eligible, whatever its stored `enabled`, and forgettable with
49803
+ * `forgetInferenceDevice`; `unknown` — the probe did not answer, nothing is
49804
+ * claimed (D315). Optional only for an orchestrator older than the field.
49805
+ */
49806
+ presence: _enum([
49807
+ "present",
49808
+ "absent",
49809
+ "unknown"
49810
+ ]).optional(),
49811
+ /**
49742
49812
  * Whether this device participates in dispatch. AUTO default (spec C2):
49743
49813
  * accelerators are opt-OUT (a discovered NPU/iGPU/Coral/ANE with no stored
49744
49814
  * entry is `true`); CPU is opt-IN (`false` by default — the fallback pool,
@@ -49964,7 +50034,13 @@ method(object({
49964
50034
  }), object({ success: literal(true) }), {
49965
50035
  kind: "mutation",
49966
50036
  auth: "admin"
49967
- }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({ agentNodeId: string() }), object({
50037
+ }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({
50038
+ agentNodeId: string(),
50039
+ deviceKey: string()
50040
+ }), object({ success: literal(true) }), {
50041
+ kind: "mutation",
50042
+ auth: "admin"
50043
+ }), method(object({ agentNodeId: string() }), object({
49968
50044
  success: literal(true),
49969
50045
  /** Hardware-aware default detection model now in effect on the node (null when unresolvable). */
49970
50046
  effectiveModelId: string().nullable(),
@@ -54074,17 +54150,69 @@ object({
54074
54150
  });
54075
54151
  DeviceType.Sensor;
54076
54152
  /**
54077
- * Generic device-consumables capability — surfaces a device's
54078
- * maintenance items (vacuum filters/brushes, replaceable cartridges,
54079
- * descaling cycles, …) with their remaining life and an optional
54080
- * "Replaced" reset action. Device-agnostic: any provider that knows its
54081
- * device tracks consumables can register it; the cap declares no
54082
- * vocabulary of its own — the provider names each item verbatim.
54153
+ * Generic device-consumables capability — the ONE place a device reports what
54154
+ * it uses up or fills: wear parts (vacuum filters/brushes, cartridges,
54155
+ * descaling cycles), supplies it draws from (a vacuum's clean-water tank and
54156
+ * detergent, a dishwasher's salt and rinse aid) and waste it collects (a dirty
54157
+ * water tank, a dust bin). Each item carries its remaining life or fill and an
54158
+ * optional "Replaced" reset action. Device-agnostic: any provider that knows
54159
+ * its device tracks consumables registers it; the provider names each item
54160
+ * verbatim and says which `kind` it is.
54161
+ *
54162
+ * The admin UI renders it as ONE collapsible section directly under the
54163
+ * device page's hero card (`placement: 'hero'`), for every device bound to
54164
+ * this cap — never drawn by a device type's hero card itself (D915).
54083
54165
  *
54084
54166
  * Like `childLayout`, the cap is INERT until a provider sets items: no
54085
54167
  * provider populates it by guessing (no HA inference). The UI renders a
54086
54168
  * "No consumables reported" placeholder when `items` is empty.
54087
54169
  */
54170
+ /**
54171
+ * What an item IS, which decides which direction is bad:
54172
+ * - `wear` — a part that wears out (a brush, a filter); low life is bad.
54173
+ * - `supply` — something the device draws from (clean water, detergent,
54174
+ * salt, rinse aid); low or empty is bad.
54175
+ * - `waste` — something the device fills (dirty water, a dust bin); full is
54176
+ * bad.
54177
+ * Absent = `wear`.
54178
+ */
54179
+ var ConsumableKindSchema = _enum([
54180
+ "wear",
54181
+ "supply",
54182
+ "waste"
54183
+ ]);
54184
+ /**
54185
+ * What an item LOOKS like, which decides how a client draws it — independent
54186
+ * of `kind`, which decides which direction is bad:
54187
+ * - `part` — a part that wears (a brush, a filter, a mop pad): a wear bar,
54188
+ * remaining time and a reset.
54189
+ * - `tank` — a container of liquid (clean water, dirty water): a fill gauge.
54190
+ * - `product` — something bought and refilled (detergent, salt, rinse aid):
54191
+ * a stepped level and "refill".
54192
+ * - `bin` — a container that collects waste (a dust bin): a fill gauge
54193
+ * that warns when full.
54194
+ * Absent = derived from the kind ({@link consumableFormOf}).
54195
+ */
54196
+ var ConsumableFormSchema = _enum([
54197
+ "part",
54198
+ "tank",
54199
+ "product",
54200
+ "bin"
54201
+ ]);
54202
+ /** The provider's own discrete verdict on an item. */
54203
+ var ConsumableStatusSchema = _enum([
54204
+ "ok",
54205
+ "low",
54206
+ "empty",
54207
+ "full",
54208
+ "replace"
54209
+ ]);
54210
+ _enum([
54211
+ "ok",
54212
+ "low",
54213
+ "empty",
54214
+ "full"
54215
+ ]);
54088
54216
  /** Units a remaining-life counter is reported in. Closed: the panel renders
54089
54217
  * each. */
54090
54218
  var ConsumableRemainingUnitSchema = _enum([
@@ -54104,10 +54232,14 @@ var ConsumablesStatusSchema = object({
54104
54232
  key: string().min(1),
54105
54233
  /** Display name. */
54106
54234
  label: string().min(1),
54107
- /** Remaining life % when known (0..100). */
54235
+ /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
54108
54236
  level: number().min(0).max(100).nullable(),
54109
- /** Discrete state when known (binary mode). */
54110
- status: _enum(["ok", "replace"]).nullable(),
54237
+ /** The provider's discrete verdict when known (binary mode). */
54238
+ status: ConsumableStatusSchema.nullable(),
54239
+ /** What the item is — decides whether low or full is bad. Absent = `wear`. */
54240
+ kind: ConsumableKindSchema.optional(),
54241
+ /** How the item is drawn (part, tank, product, bin). Absent = derived from `kind`. */
54242
+ form: ConsumableFormSchema.optional(),
54111
54243
  /** Ms epoch of the last replace, when known. */
54112
54244
  lastResetAt: number().nullable(),
54113
54245
  /** Whether `reset()` is meaningful for this item. */
@@ -54342,8 +54474,9 @@ object({
54342
54474
  status: DeviceStatusSchema
54343
54475
  });
54344
54476
  /**
54345
- * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
54346
- * consumable levels (salt, rinse aid) and common program options.
54477
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates and
54478
+ * common program options. Salt and rinse aid are NOT here: they are items of
54479
+ * the device's `consumables` cap, like every other device's (D915).
54347
54480
  *
54348
54481
  * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
54349
54482
  * by any integration that exposes the same program / option surface.
@@ -54391,11 +54524,6 @@ var DishwasherAvailabilitySchema = _enum([
54391
54524
  "offline",
54392
54525
  "description-missing"
54393
54526
  ]);
54394
- var DishwasherConsumableLevelSchema = _enum([
54395
- "ok",
54396
- "low",
54397
- "empty"
54398
- ]);
54399
54527
  object({
54400
54528
  availability: DishwasherAvailabilitySchema,
54401
54529
  /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
@@ -54428,8 +54556,6 @@ object({
54428
54556
  powerOn: boolean().nullable(),
54429
54557
  /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
54430
54558
  powerState: string().nullable(),
54431
- saltLevel: DishwasherConsumableLevelSchema.nullable(),
54432
- rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
54433
54559
  /**
54434
54560
  * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
54435
54561
  * combined care-and-filter reminder raised); false when every such reminder reads clear; null
@@ -56469,7 +56595,7 @@ DeviceType.Light, DeviceType.Siren, DeviceType.Switch, method(object({
56469
56595
  enabled: boolean()
56470
56596
  }), _void(), {
56471
56597
  kind: "mutation",
56472
- auth: "admin"
56598
+ auth: "protected"
56473
56599
  }), object({
56474
56600
  deviceId: number(),
56475
56601
  enabled: boolean(),
@@ -56959,6 +57085,13 @@ var TopologyNodeSchema = object({
56959
57085
  cpuModel: string().nullable(),
56960
57086
  cpuCores: number(),
56961
57087
  memoryMB: number(),
57088
+ /**
57089
+ * The inference RUNTIMES installed on the node (`pythonRuntimes`: onnx,
57090
+ * openvino, edgetpu …) — not its devices. An installed runtime says nothing
57091
+ * about whether its hardware is there (a Coral delegate stays installed
57092
+ * after the stick leaves, D919); the live device set is
57093
+ * `pipelineOrchestrator.getNodeInferenceDevices`.
57094
+ */
56962
57095
  engines: array(string()).readonly(),
56963
57096
  isHub: boolean(),
56964
57097
  isOnline: boolean(),
@@ -57923,7 +58056,28 @@ var ResolvedInferenceConfigSchema = object({
57923
58056
  format: ModelFormatSchema,
57924
58057
  reason: string()
57925
58058
  });
57926
- method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema), method(object({ requirements: array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(object({ prefer: HwAccelBackendInputSchema }), HwAccelResolutionSchema);
58059
+ /**
58060
+ * The answer of an accelerator rescan (D919): the node's device list after
58061
+ * the re-probe, what changed, and the evidence that decided the Coral answer
58062
+ * (`usbBus` — could the USB bus be read at all; `decidedBy` — USB ids, the PCI
58063
+ * bus, the installed-delegate fallback, or nothing).
58064
+ */
58065
+ var AcceleratorRescanSchema = object({
58066
+ devices: array(InferenceDeviceDescriptorSchema).readonly(),
58067
+ appeared: array(string()).readonly(),
58068
+ disappeared: array(string()).readonly(),
58069
+ usbBus: _enum(["observed", "unobservable"]),
58070
+ decidedBy: _enum([
58071
+ "usb-ids",
58072
+ "pci",
58073
+ "delegate-fallback",
58074
+ "none"
58075
+ ])
58076
+ });
58077
+ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema), method(object({ requirements: array(ModelRequirementSchema).readonly() }), ResolvedInferenceConfigSchema), method(object({ prefer: HwAccelBackendInputSchema }), HwAccelResolutionSchema), method(_void(), AcceleratorRescanSchema, {
58078
+ kind: "mutation",
58079
+ auth: "admin"
58080
+ });
57927
58081
  object({
57928
58082
  /** Instantaneous power draw in watts. */
57929
58083
  watts: number().optional(),
@@ -61212,60 +61366,17 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61212
61366
  auth: "admin",
61213
61367
  access: "delete"
61214
61368
  });
61215
- /**
61216
- * Robot-vacuum cap. Models HA `vacuum.*` entities — anything with a
61217
- * cleaning lifecycle plus a return-to-base / locate surface and an
61218
- * optional fan-speed selector.
61219
- *
61220
- * State follows HA's canonical vacuum lifecycle: `idle` / `cleaning` /
61221
- * `paused` / `returning` / `docked` / `error`. `batteryLevel`
61222
- * (0..100) is nullable — some vacuums don't report a battery
61223
- * percentage. `fanSpeed` is the current speed token (provider-verbatim,
61224
- * e.g. `'standard'` / `'turbo'`) and `availableFanSpeeds` lists the
61225
- * tokens the hardware accepts so the UI renders only supported choices.
61226
- *
61227
- * The `setFanSpeed` method takes the bare `speed` token — the provider
61228
- * validates it against the vacuum's own list. `locate` triggers the
61229
- * find-me chirp; `returnToBase` sends it home.
61230
- *
61231
- * Consumable / waste tanks: `cleanWater` / `dirtyWater` / `detergent` /
61232
- * `dustBin` each carry a nullable `{ level (0..100 %), status ('ok' |
61233
- * 'low' | 'full') }` reading. Native providers (e.g. Dreame, Roborock)
61234
- * SHOULD populate whichever tanks the hardware has — leave a field `null`
61235
- * only when the device has no such tank at all, and use a `TankStatus`
61236
- * with both inner fields `null` when the tank exists but its level is
61237
- * currently unknown. HA `vacuum.*` entities expose no per-tank telemetry,
61238
- * so the HA provider leaves all four `null`.
61239
- */
61240
- var VacuumStateSchema = _enum([
61241
- "idle",
61242
- "cleaning",
61243
- "paused",
61244
- "returning",
61245
- "docked",
61246
- "drying",
61247
- "error"
61248
- ]);
61249
- /**
61250
- * One consumable / waste tank on a robot vacuum (clean-water, dirty-water,
61251
- * detergent or dust-bin). A tank can report a numeric fill `level` (0..100),
61252
- * a discrete `status` (binary-style hardware), or both. Both `null` means the
61253
- * level is currently unknown; the OWNING field being `null` means the
61254
- * hardware has no such tank at all.
61255
- */
61256
- var TankStatusSchema = object({
61257
- /** Numeric fill 0..100 when the hardware reports a percentage; null otherwise. */
61258
- level: number().min(0).max(100).nullable(),
61259
- /** Discrete state when the hardware is binary-mode; null otherwise. */
61260
- status: _enum([
61261
- "ok",
61262
- "low",
61263
- "full"
61264
- ]).nullable()
61265
- });
61266
61369
  object({
61267
61370
  /** Lifecycle state of the vacuum. */
61268
- state: VacuumStateSchema,
61371
+ state: _enum([
61372
+ "idle",
61373
+ "cleaning",
61374
+ "paused",
61375
+ "returning",
61376
+ "docked",
61377
+ "drying",
61378
+ "error"
61379
+ ]),
61269
61380
  /** 0..100 battery percentage. Null when the device has no battery
61270
61381
  * reading. */
61271
61382
  batteryLevel: number().min(0).max(100).nullable(),
@@ -61274,14 +61385,6 @@ object({
61274
61385
  fanSpeed: string().nullable(),
61275
61386
  /** Speed tokens the hardware accepts — drives the UI selector. */
61276
61387
  availableFanSpeeds: array(string()),
61277
- /** Clean-water (mop) tank. Null when the hardware has no clean-water tank. */
61278
- cleanWater: TankStatusSchema.nullable(),
61279
- /** Dirty-water (recovery) tank. Null when the hardware has no dirty-water tank. */
61280
- dirtyWater: TankStatusSchema.nullable(),
61281
- /** Detergent tank. Null when the hardware has no detergent tank. */
61282
- detergent: TankStatusSchema.nullable(),
61283
- /** Dust bin. Null when the hardware has no dust bin. */
61284
- dustBin: TankStatusSchema.nullable(),
61285
61388
  /** 0..100 cleaning-completion percentage of the current task, or null. */
61286
61389
  progressPercent: number().min(0).max(100).nullable(),
61287
61390
  /** Current error code (0 / null = no error). */
@@ -63822,6 +63925,12 @@ Object.freeze({
63822
63925
  addonId: null,
63823
63926
  access: "create"
63824
63927
  },
63928
+ "deviceHistory.deleteOrphanSeries": {
63929
+ capName: "device-history",
63930
+ capScope: "system",
63931
+ addonId: null,
63932
+ access: "delete"
63933
+ },
63825
63934
  "deviceHistory.getDeviceEnabled": {
63826
63935
  capName: "device-history",
63827
63936
  capScope: "system",
@@ -63840,6 +63949,12 @@ Object.freeze({
63840
63949
  addonId: null,
63841
63950
  access: "view"
63842
63951
  },
63952
+ "deviceHistory.listOrphanSeries": {
63953
+ capName: "device-history",
63954
+ capScope: "system",
63955
+ addonId: null,
63956
+ access: "view"
63957
+ },
63843
63958
  "deviceHistory.listSeries": {
63844
63959
  capName: "device-history",
63845
63960
  capScope: "system",
@@ -67464,6 +67579,12 @@ Object.freeze({
67464
67579
  addonId: null,
67465
67580
  access: "delete"
67466
67581
  },
67582
+ "pipelineOrchestrator.forgetInferenceDevice": {
67583
+ capName: "pipeline-orchestrator",
67584
+ capScope: "system",
67585
+ addonId: null,
67586
+ access: "delete"
67587
+ },
67467
67588
  "pipelineOrchestrator.getAgentLoad": {
67468
67589
  capName: "pipeline-orchestrator",
67469
67590
  capScope: "system",
@@ -68040,6 +68161,12 @@ Object.freeze({
68040
68161
  addonId: null,
68041
68162
  access: "view"
68042
68163
  },
68164
+ "platformProbe.rescanAccelerators": {
68165
+ capName: "platform-probe",
68166
+ capScope: "system",
68167
+ addonId: null,
68168
+ access: "create"
68169
+ },
68043
68170
  "platformProbe.resolveHwAccel": {
68044
68171
  capName: "platform-probe",
68045
68172
  capScope: "system",
@@ -73845,7 +73972,7 @@ var STATE_SUMMARY_VARS = [
73845
73972
  ([...RULE_TEXT], [...COMBINED_ALARM]),
73846
73973
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
73847
73974
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
73848
- ([...RULE_TEXT], [...CONSUMABLE]),
73975
+ ([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
73849
73976
  ([...RULE_TEXT], [...TANK]),
73850
73977
  [...RULE_TEXT],
73851
73978
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
@@ -74561,7 +74688,7 @@ var AdminUIAddon = class extends BaseAddon {
74561
74688
  capability: adminUiCapability,
74562
74689
  provider: {
74563
74690
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
74564
- getVersion: async () => ({ version: "1.2.454" })
74691
+ getVersion: async () => ({ version: "1.2.456" })
74565
74692
  }
74566
74693
  }];
74567
74694
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.454",
3
+ "version": "1.2.456",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -1,4 +0,0 @@
1
- import{$ as e,B as t,G as n,J as r,L as i,S as a,b as o,o as s,q as c,x as l,z as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEHpkaJP.js";import{Ci as d,Gr as f,It as p,Nt as m,Ot as h,Q as g,Rn as _,Si as v,Tn as y,bn as b,dt as x,fn as S,kn as C,mi as w,oi as T,or as E,pn as D,tn as O,un as ee,yi as te}from"./player-overlays-Bkc1DjP3.js";import{Xi as k}from"./client-Bl6RqxzK.js";import{i as ne,l as re}from"./video-DMQEqtGc.js";import{$n as ie,Ar as A,Au as ae,Gu as oe,Ju as j,Ms as M,Qn as se,Qr as ce,Rr as N,Tt as le,Xt as P,Zt as ue,_i as de,ai as fe,bi as F,ci as I,di as L,ei as R,er as z,fi as pe,gi as B,hi as V,hr as me,ht as he,ii as H,ir as ge,kr as U,li as W,mi as _e,ni as ve,nr as ye,oi as G,ri as be,rr as xe,ti as K,ui as Se,xi as Ce,yi as q}from"./src-DFUaqwAi.js";import{t as J}from"./useTranslation-D3Is_4B6.js";import"./mount-CeEZ5g38.js";import{Z as Y,et as X,nt as we}from"./index-BLk4KKso.js";import{t as Z}from"./AdminPage-C1yHKZaW.js";import{t as Te}from"./NodeAddonsSettingsPanel-CjiY8FoY.js";import{n as Q,t as Ee}from"./useNodeUrlSelection-CR9zcBjj.js";function De(e){if(e===void 0)return null;switch(e.state){case`failed`:case`refused`:case`missing`:case`crashed`:return{kind:e.state,...e.reason===void 0?{}:{reason:e.reason}};default:return null}}e();var Oe={queued:{icon:T,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:E,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:b,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:d,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:ne,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function ke({item:e}){let{t}=J(),n=Oe[e.status],r=n.icon;return a(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${n.bg}`,title:e.error,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey)]})}var Ae=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),je=new Set([`done`,`failed`,`skipped`]);function Me(e){return!je.has(e.phase)&&!Ae.has(e.jobState)}function Ne(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Ae.has(e.state);for(let i of e.tasks)r&&i.finishedAtMs!==null&&t-i.finishedAtMs>6e4||n.set(i.packageName,{jobId:e.jobId,packageName:i.packageName,phase:i.phase,fromVersion:i.fromVersion,toVersion:i.toVersion,error:i.error,jobState:e.state,finishedAtMs:i.finishedAtMs})}return n}function Pe(){let{data:e}=W({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=j(k.AddonsJobProgress,e=>e.job.jobId);return n(()=>{let n=new Map;for(let t of e??[])n.set(t.jobId,t);for(let[e,r]of t)n.set(e,r.job);return Ne([...n.values()],Date.now())},[e,t])}var Fe={queued:{icon:T,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:E,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:E,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:d,cls:`bg-success/10 text-success`,labelKey:`addons.jobProgress.updated`},failed:{icon:ne,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:O,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Ie({progress:e}){let{t}=J(),n=Fe[e.phase],r=n.icon,i=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return a(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${n.cls}`,title:i,children:[l(r,{className:`w-2.5 h-2.5 ${n.spin?`animate-spin`:``}`}),t(n.labelKey),a(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Le(e,t){return e.filter(e=>e.packageName===t).slice().sort((e,t)=>e.isHub===t.isHub?e.nodeName.localeCompare(t.nodeName):e.isHub?-1:1)}function Re(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function ze(e,t,n){let r=[`${e} will be uninstalled from ${t.length} node(s). Its runners stop, its capabilities are deregistered and its code is deleted:`,...t.map(Re)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
2
- `)}function Be(e,t,n){let r=[`${e} will be uninstalled from ${t}: its runners stop and its code is deleted.`];return n.length>0&&r.push(`It stays installed on: ${n.map(e=>e.nodeName).join(`, `)}. Use "Everywhere" to remove it from every node.`),r.push(`This cannot be undone.`),r.join(`
3
- `)}var Ve={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function He(e,t){let n=[];for(let r of e.results){let e=r.runnersStopped.length>0?` (stopped ${r.runnersStopped.join(`, `)})`:``;n.push(`${t(r.nodeId)}: ${Ve[r.outcome]}${e}`),r.error!==void 0&&n.push(` ${r.error}`);for(let e of r.warnings)n.push(` ${e}`)}return n.join(`
4
- `)}var Ue={},We=3e4,Ge=`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors`;function Ke({packageName:e,displayName:t,selectedNode:n,hideNodeAction:r,disabled:i}){let{t:o}=J(),c=s(),u=A(),d=U(),f=I(Ue,{staleTime:We}),m=f.data?.installations??[],h=(f.data?.unreachable??[]).map(e=>e.nodeId),g=Le(m,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===n.id?n.name:e),v=F({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),y=async e=>{await d({title:e.success?o(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:t}):o(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:t}),message:He(e,_),variant:e.success?`default`:`danger`})},b=async n=>{try{await y(await v.mutateAsync({packageName:e,...n}))}catch(e){await d({title:o(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:t}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==n.id);await u({title:o(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:t,name:n.name}),message:Be(t,n.name,e),confirmLabel:o(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(n.isHub?{}:{nodeId:n.id})},S=async()=>{let n=(await f.refetch()).data;if(n===void 0){await d({title:o(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:o(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Le(n.installations,e);await u({title:o(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:t}),message:ze(t,r,n.unreachable.map(e=>e.nodeId)),confirmLabel:o(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||i===!0;return a(`div`,{className:`flex items-center gap-1.5`,children:[r!==!0&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:n.name}),children:[l(p,{className:`h-3 w-3`}),v.isPending?o(`addons.addonUninstallControls.removing`,`Removing...`):o(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||r===!0||h.length>0)&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:Ge,title:o(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[l(re,{className:`h-3 w-3`}),g.length>0?o(`addons.uninstallControls.everywhereCount`,{count:g.length}):o(`addons.uninstallControls.everywhere`)]})]})}function qe({packageName:e,currentVersion:t,installSource:n,onInstall:r,onClose:i,onSelect:s,selectedVersion:c}){let{t:u}=J(),p=n===`upload`||n===`local`,{data:m,isLoading:g}=H({name:e});return a(`div`,{className:`fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,style:{top:`auto`,bottom:`auto`},ref:e=>{if(!e)return;let t=e.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerHeight-t.bottom,r=t.top;n<280&&r>n?(e.style.bottom=`${window.innerHeight-t.top+4}px`,e.style.top=`auto`):(e.style.top=`${t.bottom+4}px`,e.style.bottom=`auto`),e.style.right=`${window.innerWidth-t.right}px`},onClick:e=>e.stopPropagation(),children:[a(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[l(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:u(`addons.versionPicker.versions`,`Versions`)}),l(`button`,{type:`button`,onClick:i,className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3 w-3`})})]}),p&&a(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[l(h,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),a(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[l(`span`,{className:`font-semibold`,children:u(`addons.versionPicker.inPlace`,{kind:n===`upload`?u(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):u(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,l(Y,{i18nKey:`addons.versionPicker.reinstall`,values:{version:t},components:{mono:l(`span`,{className:`font-mono`})}})]})]}),g&&a(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[l(E,{className:`h-3.5 w-3.5 animate-spin`}),u(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),m&&l(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:m.map(e=>{let n=e.version===t,i=s!==void 0&&e.version===c,p=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),m=a(o,{children:[l(`span`,{className:`font-mono flex-1 text-left ${n?`text-primary font-semibold`:p?`text-amber-400`:`text-foreground`}`,children:e.version}),n&&l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:u(`common.current`)}),e.distTags.map(e=>l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e===`latest`?`bg-emerald-500/15 text-emerald-400`:e===`beta`?`bg-amber-500/15 text-amber-400`:`bg-gray-500/15 text-gray-400`}`,children:e},e)),e.deprecated&&l(`span`,{className:`text-[9px] text-red-400 line-through`,children:u(`common.deprecated`)}),l(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return s?a(`button`,{type:`button`,"aria-label":u(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>s(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${i?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[m,i?l(d,{className:`h-3 w-3 text-primary shrink-0`}):l(`span`,{className:`w-3 shrink-0`})]},e.version):a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${n?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[m,l(`button`,{type:`button`,onClick:()=>r(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:n?u(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):u(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:l(f,{className:`h-3 w-3`})})]},e.version)})}),m&&m.length===0&&l(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:u(`addons.versionPicker.noVersionsFound`,`No versions found`)})]})}e();var Je=`device-export`;function Ye(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===Je)}function Xe(e){return e!==`local`&&e!==`upload`}function Ze({isBundle:e,installSource:t,addonId:n,iconPath:i,color:o}){let[s,c]=r(!1),u=o?{backgroundColor:`${o.startsWith(`#`)?o:`#${o}`}26`}:void 0,d=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,f=n&&i?g(`/api/addon-assets/${n}/${i}`):null,p=!!f&&!s;return a(`div`,{className:`relative flex-shrink-0`,children:[l(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:p?l(`img`,{src:f,alt:n,className:`h-4 w-4`,onError:()=>c(!0)}):l(e?_:y,{className:`h-3.5 w-3.5`})}),t===`local`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm`,children:`DEV`}),Xe(t)&&l(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:l(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:l(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),t===`upload`&&l(`span`,{className:`absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm`,children:l(h,{className:`h-2.5 w-2.5 text-white`})})]})}function Qe({version:e,availableUpdate:t,selectedVersion:n,isUpdating:r,installSource:i,disabled:o,onUpdate:s,onOpenPicker:c,children:u}){let{t:d}=J();if(r)return a(`span`,{className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 shrink-0`,children:[l(E,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(t){let r=n??t;return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[s&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s()},disabled:o,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-semibold border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,title:d(`addons.addonCard.updateTo`,`Update to {{target}}`,{target:r}),children:[l(f,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,"aria-label":d(`addons.addonCard.selectVersionToInstall`,`Select version to install`),title:d(`addons.addonCard.installedUpdateAvailableSelectedTap`,`Installed {{version}} — update available. Selected {{target}}; tap to choose another version.`,{version:e,target:r}),className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border border-amber-500/40 bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 animate-pulse disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[l(`span`,{className:`font-normal opacity-70`,children:e}),l(`span`,{className:`font-normal opacity-70`,children:`→`}),r,l(v,{className:`h-3 w-3`})]}),u]})}return a(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:o,className:[`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-bold font-mono border transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,i===`local`?`border-orange-500/30 bg-orange-500/10 text-orange-400 hover:bg-orange-500/20`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20`].join(` `),title:d(`addons.addonCard.versionTapToViewAll`,`Version {{version}} — tap to view all versions`,{version:e}),children:[e,l(v,{className:`h-3 w-3 opacity-50`})]}),u]})}function $e({addonId:e}){let t=s(),{data:n=`inherit`}=K({addonId:e}),r=B({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return l(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>l(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),r.mutate({addonId:e,channel:t})},disabled:r.isPending,className:`px-2.5 py-1 transition-colors capitalize ${n===t?t===`inherit`?`bg-gray-700/50 text-gray-700 dark:text-gray-300`:t===`off`?`bg-gray-700 text-gray-700 dark:text-gray-300`:t===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${t===`inherit`?``:`border-l border-border`}`,children:t},t))})}var et={id:`hub`,name:`Hub`,isHub:!0};function tt({addon:e,agents:n=[],clusterStatus:i,hideVersion:c,availableUpdate:u,onUpdate:d,isUpdating:f,jobProgress:p,bundle:m,bulkItem:h,disabledByBulk:g,isSystem:y,selectedNode:S}){let{t:w}=J(),[T,E]=r(!1),[O,k]=r(!1),[re,A]=r(!1),[ae,oe]=r(null);t(()=>{oe(null)},[u]);let j=ae??u,[M,ce]=r(!1),[N,de]=r(!1),[F,I]=r(`logs`),L=s(),R=X(),{manifest:B}=e,V=e.installedOn??[],he=!m&&!B.protected&&B.removable!==!1,H=!!m,U=m?.displayName??B.name,W=m?.packageName??B.packageName,ve=m?.version??B.packageVersion??B.version,G=m?.installSource??e.installSource,be=m?m.bundle?.description??m.addons[0]?.manifest.description:B.description,K=pe({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]})}}),Se=fe({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]}),L.invalidateQueries({queryKey:[[`addonPages`]]}),L.invalidateQueries({queryKey:[[`capabilities`]]}),L.invalidateQueries({queryKey:[[`integrations`]]})}}),Ce=_e({onSuccess:()=>{L.invalidateQueries({queryKey:[[`addons`]]}),L.invalidateQueries({queryKey:[[`alerts`]]})}}),q=e.health,Y=q?.phase===`failed`&&!q.inGracePeriod,we=Y&&q?.nextRetryAt&&!q.retrying,Z=De(e.process);return a(`div`,{className:`rounded-md border bg-surface overflow-hidden ${Y?`border-red-500/50`:`border-border`}`,children:[Y&&q&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ne,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.failedToLoad`,{attempt:q.retryCount})}),l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:q.lastError?.message??w(`addons.addonCard.unknownError`,`Unknown error`)}),we&&q.nextRetryAt&&l(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:w(`addons.addonCard.autoRetryAt`,{time:new Date(q.nextRetryAt).toLocaleTimeString()})})]}),a(`button`,{type:`button`,disabled:Ce.isPending||q.retrying,onClick:e=>{e.stopPropagation(),Ce.mutate({packageName:W})},className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-semibold border border-red-400/40 bg-red-400/10 text-red-700 dark:text-red-300 hover:bg-red-400/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0`,title:w(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[l(b,{className:`h-3 w-3 ${Ce.isPending||q.retrying?`animate-spin`:``}`}),w(`addons.addonCard.retryNow`,`Retry now`)]})]}),Z!==null&&a(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[l(ne,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),a(`div`,{className:`flex-1 min-w-0`,children:[l(`div`,{className:`text-xs font-semibold text-danger`,children:w(`addons.addonCard.processProblem.${Z.kind}`)}),Z.reason!==void 0&&l(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:Z.reason})]})]}),a(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[l(Ze,{isBundle:H||!!B.components&&B.components.length>1,installSource:G,addonId:H?m.addons[0]?.manifest.id:B.id,iconPath:H?m.bundle?.icon??m.addons[0]?.manifest.icon:B.icon,color:H?m.addons[0]?.manifest.color:B.color}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-start justify-between gap-2`,children:[l(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:U}),!c&&l(Qe,{version:ve,availableUpdate:u,...j===void 0?{}:{selectedVersion:j},isUpdating:f,installSource:G,disabled:g,...d&&j!==void 0?{onUpdate:()=>d(j)}:{},onOpenPicker:()=>A(e=>!e),children:re&&l(qe,{packageName:W,currentVersion:ve,...G?{installSource:G}:{},...u!==void 0&&j!==void 0?{selectedVersion:j,onSelect:e=>{oe(e),A(!1)}}:{},onInstall:e=>{A(!1),Se.mutate({packageName:W,version:e})},onClose:()=>A(!1)})})]}),a(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[W!==U&&l(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:W}),H&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,children:[l(_,{className:`h-3 w-3`}),m.addons.length]}),y&&a(`span`,{className:`text-[10px] rounded-full bg-amber-500/15 text-amber-700 dark:text-amber-300 px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,title:w(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[l(b,{className:`h-3 w-3`}),w(`addons.addonCard.system`,`System`)]}),h!=null&&l(ke,{item:h}),p!=null&&l(Ie,{progress:p})]}),be&&l(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:be}),!H&&e.process&&a(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.mode===`forked`?`bg-blue-500/15 text-blue-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.mode===`forked`?w(`addons.addonCard.forked`):w(`addons.addonCard.inProcess`)}),e.process.pid!=null&&a(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),l(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.state===`running`?`bg-emerald-500/15 text-emerald-400`:Z===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!H&&a(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),K.mutate({addonId:B.id})},disabled:K.isPending||g,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors`,children:[l(b,{className:`h-3 w-3 ${K.isPending?`animate-spin`:``}`}),w(`addons.addonCard.restart`,`Restart`)]}),a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),ce(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${M?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(D,{className:`h-3 w-3`}),w(`addons.addonCard.logs`,`Logs`)]}),!H&&a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),de(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${N?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[l(ee,{className:`h-3 w-3`}),w(`addons.addonCard.settings`,`Settings`)]}),l(`div`,{className:`flex-1`}),he&&l(Ke,{packageName:B.packageName,displayName:B.name,selectedNode:S??et,disabled:g})]}),i&&i.nodes.length>1&&!H&&a(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:w(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),l(`div`,{className:`space-y-1`,children:i.nodes.map(e=>a(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[l(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`offline`?`bg-muted-foreground/30`:e.synced?`bg-success`:`bg-amber-500`}`}),l(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),l(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:w(`addons.addonCard.outdated`)}),e.status===`offline`&&l(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:w(`common.offline`)}),e.synced&&e.status!==`offline`&&l(`span`,{className:`text-[9px] text-success`,children:w(`common.synced`)})]},e.nodeId))})]}),M&&!H&&a(`div`,{className:`border-t border-border`,children:[a(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[a(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[l(`button`,{type:`button`,onClick:()=>I(`logs`),className:`px-2 py-0.5 transition-colors ${F===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.logs`,`Logs`)}),l(`button`,{type:`button`,onClick:()=>I(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${F===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:w(`addons.addonCard.events`,`Events`)})]}),l(`div`,{className:`flex-1`}),l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),ce(!1)},className:`text-foreground-subtle hover:text-foreground`,children:l(x,{className:`h-3.5 w-3.5`})})]}),F===`logs`&&l(ue,{addonId:B.id,maxHeight:`max-h-64`,showFilters:!1}),F===`events`&&l(P,{addonId:B.id,category:`addon.*`,maxHeight:`max-h-64`})]}),H&&a(o,{children:[l(`button`,{type:`button`,onClick:()=>E(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:l(T?te:v,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),T&&l(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:m.addons.map(e=>l(tt,{addon:e,agents:n,hideVersion:!0},e.manifest.id))})]}),N&&!H&&l(se,{open:!0,onOpenChange:e=>!e&&de(!1),children:a(z,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[l(xe,{children:a(ge,{className:`flex items-center gap-2`,children:[l(ee,{className:`h-4 w-4 text-primary`}),w(`addons.addonCard.settingsTitle`,{name:U})]})}),a(ie,{className:`space-y-4`,children:[l(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:w(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),l(Te,{nodeId:null,addonIds:[B.id],level:`global`,fieldScope:`cluster`,emptyMessage:w(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),Ye(B)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.deviceExport`,`Device export`)}),l(le,{addonId:B.id,onOpenDevice:e=>R(`/devices/${e}`)})]}),Xe(G)&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.autoUpdate`,`Auto-Update`)}),l($e,{addonId:B.id})]}),B.components&&B.components.length>0&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.components`,{count:B.components.length})}),l(`div`,{className:`flex flex-wrap gap-1`,children:B.components.map(e=>l(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]}),n.length>=2&&a(`div`,{children:[l(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:w(`addons.addonCard.installedOn`,`Installed on`)}),a(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[V.length===0&&l(`span`,{className:`text-[10px] text-foreground-subtle`,children:w(`addons.addonCard.hubLocal`,`Hub (local)`)}),V.map(e=>l(`span`,{className:`rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle`,children:e},e)),a(`div`,{className:`relative`,children:[a(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),k(e=>!e)},className:`inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors`,title:w(`addons.addonCard.installOnMoreAgents`,`Install on more agents`),children:[l(C,{className:`h-3 w-3`}),w(`addons.addonCard.addAgent`,`Add agent`)]}),O&&a(`div`,{className:`absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden`,children:[n.filter(e=>!e.isHub&&!V.includes(e.name)).map(e=>l(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),k(!1)},className:`w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors`,children:e.name},e.id)),n.filter(e=>!e.isHub&&!V.includes(e.name)).length===0&&l(`div`,{className:`px-3 py-1.5 text-[10px] text-foreground-subtle`,children:w(`addons.addonCard.noAvailableAgents`,`No available agents`)})]})]})]})]})]}),l(ye,{children:l(me,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>de(!1),children:w(`common.close`,`Close`)})})]})})]})}e();var nt=`.tgz,.tar.gz,.zip`;function rt({onUploadSuccess:e}){let{t}=J(),[n,s]=r(!1),u=c(null),d=i(async t=>{s(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(g(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{s(!1)}},[e]);return a(o,{children:[l(`input`,{ref:u,type:`file`,accept:nt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),a(`button`,{type:`button`,onClick:()=>u.current?.click(),disabled:n,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[n?l(E,{className:`w-3.5 h-3.5 animate-spin`}):l(h,{className:`w-3.5 h-3.5`}),n?t(`addons.addonUploadZone.uploading`,`Uploading...`):t(`addons.addonUploadZone.upload`,`Upload`)]})]})}var it=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/ui-library`,`@camstack/addon-agent-ui`]);function at(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||it.has(r.packageName)||!t.isHub&&r.nodeId!==t.id)continue;let e=n.get(r.packageName)??[];e.push(r),n.set(r.packageName,e)}return[...n].map(([e,t])=>({packageName:e,rows:t})).sort((e,t)=>e.packageName.localeCompare(t.packageName))}function ot({selectedNode:e}){let{t}=J(),{data:n}=I(Ue,{staleTime:We});if(n===void 0)return null;let r=at(n.installations,e),i=n.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return r.length===0&&i.length===0?null:a(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[a(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[l(m,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?t(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):t(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),i.length>0&&l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:i.map(e=>e.nodeId).join(`, `)})}),r.map(t=>a(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[a(`div`,{className:`min-w-0`,children:[l(`div`,{className:`text-xs font-mono text-foreground break-all`,children:t.packageName}),l(`div`,{className:`text-[10px] text-foreground-subtle`,children:t.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),l(Ke,{packageName:t.packageName,displayName:t.packageName,selectedNode:e,hideNodeAction:e.isHub})]},t.packageName))]})}function st({addon:e,installing:t,onInstall:n}){let{t:r}=J();return a(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[l(`div`,{className:`w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0`,children:e.name.replace(`@camstack/addon-`,``).charAt(0).toUpperCase()}),a(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[l(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),a(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),l(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&l(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?l(N,{variant:`success`,icon:l(d,{className:`h-3 w-3`}),children:e.installedVersion??r(`system.capabilityCatalog.installed`,`Installed`)}):a(me,{size:`sm`,onClick:()=>n(e.name),disabled:t,className:`shrink-0`,children:[t?l(E,{className:`h-3 w-3 animate-spin`}):l(f,{className:`h-3 w-3`}),r(`system.capabilityCatalog.install`,`Install`)]})]})}function ct({capability:e,installing:t,onInstall:n}){let{t:r}=J(),{data:i,isPending:o,isError:s}=V({capability:e}),c;if(s)c=l(`div`,{className:`px-3 py-2 text-xs text-danger`,children:r(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(o||i===void 0)c=a(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[l(E,{className:`h-3 w-3 animate-spin`}),r(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let a=i.filter(e=>!e.installed);c=a.length===0?l(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:i.length===0?r(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):r(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):l(`div`,{className:`divide-y divide-border`,children:a.map(e=>l(st,{addon:e,installing:t,onInstall:n},e.name))})}return a(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":r(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[l(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:r(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),c]})}e();function lt(e){return e===`npm`||e===`dev`?e:null}var ut=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,dt=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,ft=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],pt=new Set([`@camstack/system`,`@camstack/types`,`@camstack/sdk`,`@camstack/shm-ring`,`@camstack/ui-library`]);function mt(e){return e!==void 0&&pt.has(e)}var ht={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function gt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function _t(e){return e===`local`?`dev`:`npm`}function vt(e){let t=e;if(!t?.manifest)return null;let n={...t.manifest,name:t.manifest.name??t.manifest.id,version:t.manifest.version??`0.0.0`,capabilities:t.manifest.capabilities??[]},r=t.process,i=r?{pid:r.pid,mode:r.mode===`forked`?`forked`:`in-process`,state:r.state??`unknown`,...r.reason===void 0?{}:{reason:r.reason}}:void 0,a=t.health,o=t.declaration?.execution,s=t.manifest.execution,c=o?.placement??s?.placement;return{manifest:n,enabled:!0,source:t.source,installSource:t.installSource,installedOn:[],...i?{process:i}:{},hasBackup:t.hasBackup,...a?{health:a}:{},...c?{placement:c}:{}}}function yt(e){let t=new Map,n=[];for(let r of e){let e=r.manifest.packageName;if(!e){n.push(r);continue}let i=t.get(e);if(i)i.addons.push(r);else{let n=r.manifest.bundle,i={packageName:e,displayName:n?.displayName??r.manifest.packageDisplayName??r.manifest.name,version:r.manifest.packageVersion,addons:[r],...r.installSource===void 0?{}:{installSource:r.installSource},...n===void 0?{}:{bundle:n}};t.set(e,i)}}let r=[];for(let e of t.values())e.bundle!==void 0||e.addons.length>=2?r.push({bundle:e,representative:e.addons[0]}):r.push(e.addons[0]);return r.push(...n),r}function $(e){return`bundle`in e}function bt({addons:e,clusterStatus:o,selectedNode:d,onRefresh:p,isRefreshing:m}){let{t:h}=J(),g=s(),[_,v]=r(``),y=u(_),[x,C]=r(!1),T=c(null);t(()=>{if(!x)return;let e=e=>{T.current&&!T.current.contains(e.target)&&C(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[x]);let{data:D}=Se({nodeId:d.id}),O=n(()=>{let e=new Map;for(let t of D??[])e.set(t.name,t.latestVersion);return e},[D]),ee=n(()=>(D??[]).filter(e=>!e.isSystem).length,[D]),[te,k]=r(()=>new Set),[ne,re]=r(()=>new Map),ie=i(e=>{k(t=>new Set(t).add(e))},[]),oe=i(e=>{k(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),j=i((e,t)=>{re(n=>new Map(n).set(e,t))},[]),M=i(e=>{re(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),se=Ce({onMutate:e=>{ie(e.name),M(e.name)},onSuccess:(e,t)=>{oe(t.name);let n=e;if(n&&n.success===!1){j(t.name,n.error??`Update failed (no error message returned by server)`);return}g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{oe(t.name),j(t.name,e instanceof Error?e.message:String(e))}}),N=Pe(),le=c(new Set);t(()=>{let e=new Set;for(let[t,n]of N)Me(n)&&e.add(t);let t=[...le.current].some(t=>!e.has(t));le.current=e,t&&(g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[N,g]);let{data:P}=ve(void 0),ue=ce({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),F=de({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:I,isFetching:L}=V({query:y||void 0},{enabled:x}),R=q(),{data:z}=be(void 0),pe=z?.requestedAt,[B,me]=r(null),[he,H]=r(!1);t(()=>{if(z?.kind===`framework-bulk-update`&&z.requestedAt!==B){me(z.requestedAt),H(!0);let e=window.setTimeout(()=>H(!1),6e3);return()=>window.clearTimeout(e)}},[pe,B,z]),A();let ge=i(async()=>{let e=(D??[]).filter(e=>!e.isSystem);if(e.length!==0){if(!d.isHub){for(let t of e)await se.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await R.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[D,d.id,d.isHub,R,se]),U=fe({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addonPages`]]}),g.invalidateQueries({queryKey:[[`capabilities`]]}),g.invalidateQueries({queryKey:[[`integrations`]]})}}),[W,_e]=r(`type`),[ye,G]=r(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),xe=e=>{G(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[K,Y]=we(),X=K.get(`capability`),Z=K.get(`updatable`)===`1`,Te=K.get(`error`)===`1`,Q=lt(K.get(`source`)),Ee=i(e=>{let t=new URLSearchParams(K);e?t.set(`updatable`,`1`):t.delete(`updatable`),Y(t,{replace:!0})},[K,Y]),Oe=i(e=>{let t=new URLSearchParams(K);e?t.set(`error`,`1`):t.delete(`error`),Y(t,{replace:!0})},[K,Y]),ke=i(e=>{let t=new URLSearchParams(K);e===null?t.delete(`source`):t.set(`source`,e),Y(t,{replace:!0})},[K,Y]),Ae=n(()=>e.filter(e=>De(e.process)!==null).length,[e]),je=n(()=>{let t=e.filter(e=>!mt(e.manifest.packageName));return d.isHub||(t=t.filter(e=>gt(e.placement,d.isHub))),X&&(t=t.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),Z&&(t=t.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&O.has(t)})),Q!==null&&(t=t.filter(e=>_t(e.installSource)===Q)),Te&&(t=t.filter(e=>De(e.process)!==null)),t},[e,d.isHub,X,Z,Q,Te,O]),Ne=()=>{let e=new URLSearchParams(K);e.delete(`capability`),Y(e,{replace:!0})},Fe=ye===`flat`?je:yt(je),Ie=n(()=>{let e=[...Fe];switch(W){case`type`:e.sort((e,t)=>{let n=+!$(e),r=+!$(t);if(n!==r)return n-r;let i=$(e)?e.bundle.displayName:e.manifest.name,a=$(t)?t.bundle.displayName:t.manifest.name;return i.localeCompare(a)});break;case`name`:e.sort((e,t)=>{let n=$(e)?e.bundle.displayName:e.manifest.name,r=$(t)?t.bundle.displayName:t.manifest.name;return n.localeCompare(r)});break;case`source`:e.sort((e,t)=>{let n=$(e)?e.bundle.installSource??``:e.installSource??``,r=$(t)?t.bundle.installSource??``:t.installSource??``;return n.localeCompare(r)});break}return e},[Fe,W]);return a(`div`,{className:`space-y-3`,children:[[...ne.entries()].map(([e,t])=>l(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:a(`div`,{className:`flex items-start justify-between gap-3`,children:[a(`div`,{className:`space-y-0.5`,children:[l(`div`,{className:`font-medium text-danger`,children:h(`systemPage.addons.updateFailed`,{name:e})}),l(`div`,{className:`text-foreground-subtle font-mono`,children:t})]}),l(`button`,{type:`button`,onClick:()=>M(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:h(`common.dismiss`)})]})},e)),a(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.sort`,`Sort:`)}),a(`select`,{value:W,onChange:e=>_e(e.target.value),className:`rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50`,children:[l(`option`,{value:`type`,children:h(`admin.system.addons.bundlesFirst`,`Bundles first`)}),l(`option`,{value:`name`,children:h(`admin.system.addons.name`,`Name`)}),l(`option`,{value:`source`,children:h(`admin.system.addons.installSource`,`Install source`)})]})]}),a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.view`,`View:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>l(`button`,{type:`button`,onClick:()=>xe(e),className:`px-2 py-1 transition-colors capitalize ${ye===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?h(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):h(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(b,{className:`h-3 w-3 text-foreground-subtle`}),l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),l(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>l(`button`,{type:`button`,onClick:()=>ue.mutate({channel:e}),disabled:ue.isPending,className:`px-2 py-1 transition-colors capitalize ${P?.channel===e?e===`off`?`bg-gray-700 text-gray-200`:e===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${e===`off`?``:`border-l border-border`}`,children:e},e))})]}),d.isHub&&a(`div`,{className:`flex items-center gap-1.5`,children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.checkEvery`,`Check every:`)}),l(`select`,{className:`rounded-md border border-border bg-transparent px-1.5 py-1 text-[10px] font-medium text-foreground-subtle`,value:P?.updateCheckIntervalSeconds??21600,disabled:F.isPending||P===void 0,onChange:e=>{P!==void 0&&F.mutate({channel:P.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:ft.map(e=>l(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),ee>0&&a(`button`,{type:`button`,onClick:()=>void ge(),disabled:R.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 border border-blue-500/30 disabled:opacity-50 transition-colors font-medium`,children:[R.isPending?l(E,{className:`w-3 h-3 animate-spin`}):l(f,{className:`w-3 h-3`}),R.isPending?h(`admin.system.addons.updating`,`Updating…`):h(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:ee})]}),a(`button`,{type:`button`,onClick:p,disabled:m||R.isPending,className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,children:[l(b,{className:`w-3 h-3 ${m?`animate-spin`:``}`}),h(`common.refresh`,`Refresh`)]})]}),a(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":h(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[l(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.filter`,`Filter:`)}),[{id:`updatable`,label:h(`admin.system.addons.updatable`,`Updatable`),pressed:Z,toggle:()=>Ee(!Z)},{id:`error`,label:h(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ae}),pressed:Te,toggle:()=>Oe(!Te)},{id:`npm`,label:`npm`,pressed:Q===`npm`,toggle:()=>ke(Q===`npm`?null:`npm`)},{id:`dev`,label:h(`admin.system.addons.dev`,`Dev`),pressed:Q===`dev`,toggle:()=>ke(Q===`dev`?null:`dev`)}].map(e=>l(`button`,{type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?ut:dt,children:e.label},e.id))]}),a(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[a(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:T,children:[l(ae,{type:`text`,value:_,onChange:e=>{v(e.target.value),C(!0)},onFocus:()=>C(!0),placeholder:h(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":h(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:R.isPending,leftSlot:l(S,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:L?l(E,{className:`h-3 w-3 animate-spin`}):void 0}),x&&I&&I.length>0&&a(`div`,{className:`absolute left-0 right-0 top-full mt-1 z-40 rounded-md border border-border bg-surface shadow-xl overflow-hidden`,children:[I.length>0&&l(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:h(`systemPage.addons.npmResults`,{count:I.length})}),I&&I.length>0&&l(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:I.map(e=>l(st,{addon:e,installing:U.isPending,onInstall:e=>U.mutate({packageName:e})},e.name))})]})]}),l(rt,{onUploadSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),p()}})]}),X&&a(`div`,{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-primary/10 border border-primary/30 text-xs`,children:[l(`span`,{className:`text-foreground-subtle`,children:h(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),l(`span`,{className:`font-mono text-primary font-semibold`,children:X}),l(`button`,{type:`button`,onClick:Ne,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:h(`admin.system.addons.clear`,`Clear`)})]}),X&&l(ct,{capability:X,installing:U.isPending,onInstall:e=>U.mutate({packageName:e})}),X&&je.length>0&&l(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:h(`admin.system.addons.installed`,`Installed`)}),he&&a(`div`,{className:`fixed top-[calc(env(safe-area-inset-top)+1rem)] right-[calc(env(safe-area-inset-right)+1rem)] z-50 flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm max-w-sm pointer-events-auto`,children:[l(w,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),a(`div`,{children:[l(`div`,{className:`text-[11px] font-semibold text-foreground`,children:h(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),l(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:h(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),je.length===0&&l(`div`,{className:`text-xs text-foreground-subtle`,children:e.length===0?h(`admin.system.addons.noAddonsInstalled`,`No addons installed`):X?h(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:X}):h(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),l(`div`,{className:`space-y-1.5`,children:Ie.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=O.get(t),r=$(e)?e.representative:e,i=n?e=>se.mutate({name:t,version:e,nodeId:d.id}):void 0,a=N.get(t)??null,s=a!==null&&Me(a);return l(tt,{addon:r,clusterStatus:o?.[r.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,isUpdating:te.has(t)||s,jobProgress:a,onUpdate:i,disabledByBulk:R.isPending,selectedNode:d},$(e)?t:e.manifest.id)})})]})}function xt(){let{t:e}=J(),n=s(),{data:r}=M(void 0),{nodes:i}=oe(),{selection:o,selectNode:u,requestedNodeId:d}=Ee(i.length>0?i:[ht]),f=o.node??ht,p=f.id,m=i.length>0?o.staleNodeId:null,{data:h,isLoading:g,isError:_}=G({nodeId:p}),v=R(),y=L(),x=v.isPending||y.isPending,S=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),n.invalidateQueries({queryKey:[[`addons`]]})},C=c(v);C.current=v;let w=c(d??`hub`);t(()=>{C.current.mutate({nodeId:w.current})},[]);let T=(h??[]).map(vt).filter(e=>e!==null);return a(Z,{children:[a(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[l(he,{selectedNodeId:p,onSelect:u}),a(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&l(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:T.length})}),a(`button`,{type:`button`,onClick:()=>void S(),disabled:x,className:`inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:e(`admin.system.addons.reFetchAddonsCheckNpm`,`Re-fetch addons + check npm for new versions`),children:[l(b,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),l(Q,{staleNodeId:m,shownNodeName:f.name}),l(ot,{selectedNode:f}),g&&l(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:e(`common.loading`,`Loading…`)}),_&&l(`div`,{className:`text-xs text-danger`,children:e(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),!g&&!_&&l(bt,{addons:T,clusterStatus:r,selectedNode:f,onRefresh:()=>void S(),isRefreshing:x})]})}export{xt as AddonsPage};