@camstack/addon-admin-ui 1.2.676 → 1.2.678

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 (102) hide show
  1. package/CHANGELOG.md +16 -4
  2. package/dist/assets/Addons-DKOUsYsk.js +5 -0
  3. package/dist/assets/{AdminPage-BaJAzoqh.js → AdminPage-BEQJlUNo.js} +1 -1
  4. package/dist/assets/{AdminSectionedPage-Cu0bmYym.js → AdminSectionedPage-C7Nx9jJl.js} +1 -1
  5. package/dist/assets/{AiProfiles-B6F1_rVb.js → AiProfiles-D4eTx94W.js} +2 -2
  6. package/dist/assets/{BootstrapSettingsForm-BF1_NPcW.js → BootstrapSettingsForm-C8SgY-gH.js} +1 -1
  7. package/dist/assets/{Build-DTwsOE_z.js → Build-BuGJWdUz.js} +5 -5
  8. package/dist/assets/{Calendars-BLeg1xdR.js → Calendars-CngFbuGP.js} +1 -1
  9. package/dist/assets/{CameraGrids-DpxIDkg0.js → CameraGrids-BI3PYGPr.js} +1 -1
  10. package/dist/assets/{Cluster-Cl0eyWQQ.js → Cluster-DMkIzva9.js} +1 -1
  11. package/dist/assets/{CompositionBlockEditor-BToOsi5-.js → CompositionBlockEditor-BlkVIJir.js} +2 -2
  12. package/dist/assets/{CompositionEditorPage-B1a2mrCa.js → CompositionEditorPage-C56ErWVZ.js} +1 -1
  13. package/dist/assets/{Data-BQY2tkty.js → Data-D-7IMZzp.js} +2 -2
  14. package/dist/assets/DeviceDetail-CATQ56bt.js +2 -0
  15. package/dist/assets/{Devices-j7Dziuvw.js → Devices-ByKU7OhR.js} +1 -1
  16. package/dist/assets/{EmbedDevicePage-CpoCgoeo.js → EmbedDevicePage-CUljYRrr.js} +1 -1
  17. package/dist/assets/{EmbedPlayerPage-CHjPfkXF.js → EmbedPlayerPage-BM7zhcWx.js} +1 -1
  18. package/dist/assets/{History-yHdnNN8I.js → History-BCQ4IrRD.js} +1 -1
  19. package/dist/assets/Identity-D60Odj5F.js +1 -0
  20. package/dist/assets/{InstancesTable-Amm9sXN8.js → InstancesTable-CriEfrMJ.js} +1 -1
  21. package/dist/assets/IntegrationDetail-BCP8mmgO.js +1 -0
  22. package/dist/assets/{Integrations-DjSZaeyr.js → Integrations-Bqcvm_Qf.js} +2 -2
  23. package/dist/assets/Integrations-C30eE4UB.js +1 -0
  24. package/dist/assets/{Library-BmmDDed2.js → Library-BbXKoa8Z.js} +1 -1
  25. package/dist/assets/Locations-DM8nnzTd.js +3 -0
  26. package/dist/assets/{Logs-DZtO_X22.js → Logs-DKDr8AuB.js} +1 -1
  27. package/dist/assets/{MaskShapeCanvas-C2MbKEIi.js → MaskShapeCanvas-DbmWEEiO.js} +1 -1
  28. package/dist/assets/{MotionZonesSettings-69IYH561.js → MotionZonesSettings-BzScgedh.js} +1 -1
  29. package/dist/assets/MyAccess-CzfNmMJl.js +2 -0
  30. package/dist/assets/{Network-B90vmasd.js → Network-CAbg7ZpT.js} +1 -1
  31. package/dist/assets/{NodeAddonsSettingsPanel-DOISNk33.js → NodeAddonsSettingsPanel-DTkQMaBn.js} +1 -1
  32. package/dist/assets/{Notifications-BV9JqvrQ.js → Notifications-BnUmb5Cg.js} +1 -1
  33. package/dist/assets/{Pipeline-DZ1e3uK0.js → Pipeline-SaA7yA5Z.js} +1 -1
  34. package/dist/assets/{PrivacyMaskSettings-RTH1WUIx.js → PrivacyMaskSettings-DgBQuyh9.js} +1 -1
  35. package/dist/assets/{Recordings-6UP6rCit.js → Recordings-BlCEAKse.js} +1 -1
  36. package/dist/assets/{SceneMonitorEditor-C7N0jJlc.js → SceneMonitorEditor-D5OLGtBI.js} +1 -1
  37. package/dist/assets/{ServerShell-DJREqWSi.js → ServerShell-CSTjFsEJ.js} +1 -1
  38. package/dist/assets/SessionsList-C1Ao7w_G.js +2 -0
  39. package/dist/assets/{Showroom-CerBbCiW.js → Showroom-DCYRjXXW.js} +1 -1
  40. package/dist/assets/{StorageLocationsTable-34hgpxzu.js → StorageLocationsTable-BfwKi6fr.js} +1 -1
  41. package/dist/assets/System-BvNJMfpW.js +1 -0
  42. package/dist/assets/Terminal-DQ5u6n8f.js +3 -0
  43. package/dist/assets/{TerminalPanel-WZu6n4X4.js → TerminalPanel-DC4Fs74K.js} +1 -1
  44. package/dist/assets/{TrainingProviders-COEEj4Qi.js → TrainingProviders-D6bLgYi2.js} +1 -1
  45. package/dist/assets/{Viewer-B0e8QYpg.js → Viewer-BmamcoHc.js} +1 -1
  46. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BnmeOwL3.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DcrAwx-L.js} +1 -1
  47. package/dist/assets/{action-draft-D6tyxpL3.js → action-draft-Dr5Q1lmk.js} +1 -1
  48. package/dist/assets/{ai-page.helpers-BuqMwgBR.js → ai-page.helpers-AOJOCF6H.js} +1 -1
  49. package/dist/assets/{assignment-candidates-C6OBxl30.js → assignment-candidates-BYfez7Z_.js} +1 -1
  50. package/dist/assets/{authed-media-CDv_vLBq.js → authed-media-DaaHSoAj.js} +1 -1
  51. package/dist/assets/{board-model-HwBP7ORU.js → board-model-COsjkU2L.js} +1 -1
  52. package/dist/assets/client-LrzN1ATZ.js +1119 -0
  53. package/dist/assets/{command-vocab-DNpIB8Nr.js → command-vocab-wRSfGsbG.js} +1 -1
  54. package/dist/assets/{device-detail-Cu0H3ozT.js → device-detail-CT3Wq2MX.js} +1 -1
  55. package/dist/assets/{device-integration-icon-kOfOKNnr.js → device-integration-icon-CK7ULj84.js} +1 -1
  56. package/dist/assets/device-picker-model-BaM_HHUO.js +1 -0
  57. package/dist/assets/{dist-DtbrrKdn.js → dist-BnzMSUv0.js} +1 -1
  58. package/dist/assets/dist-p9ea9Hzu.js +1119 -0
  59. package/dist/assets/{format-CizKTH6z.js → format-Fw8MrMCF.js} +1 -1
  60. package/dist/assets/{hostInit-BknHnS7D.js → hostInit-BHV5j57a.js} +1 -1
  61. package/dist/assets/i18n-DWjQ9UFE.js +1 -0
  62. package/dist/assets/{icons-JCRhB2VQ.js → icons-Dfx79nBH.js} +1 -1
  63. package/dist/assets/index-BNXaxwJL.css +2 -0
  64. package/dist/assets/{index-BuvJmkAR.js → index-BsPM4J54.js} +3 -3
  65. package/dist/assets/{linked-devices-model-D5C1wQm2.js → linked-devices-model-BRVCcL_i.js} +1 -1
  66. package/dist/assets/{mf-entry-bootstrap-0-c003be9a.js → mf-entry-bootstrap-0-65134e91.js} +2 -2
  67. package/dist/assets/mount-BaM_HHUO.js +1 -0
  68. package/dist/assets/{notification-rule-status-E5rWByU9.js → notification-rule-status-tbLfUZee.js} +1 -1
  69. package/dist/assets/{player-overlays-CjpQzXKG.js → player-overlays-8aC2r-sd.js} +1 -1
  70. package/dist/assets/remoteEntry-DuqtB7i9.js +1 -0
  71. package/dist/assets/src-D5UhvHcp.js +279 -0
  72. package/dist/assets/{sso-popup-B0VjE15K.js → sso-popup-C_VTtoWT.js} +1 -1
  73. package/dist/assets/{step-inspector-model-drG01LIu.js → step-inspector-model-UadKxnLr.js} +1 -1
  74. package/dist/assets/{use-scenes-feed-DBgOtJXd.js → use-scenes-feed-D3bzrMKu.js} +1 -1
  75. package/dist/assets/{use-stationary-objects-BhSvbqtR.js → use-stationary-objects-Yw5gdlLl.js} +1 -1
  76. package/dist/assets/{useAdminDeviceRemoval-DQE7W5Oe.js → useAdminDeviceRemoval-WQ4NaouA.js} +1 -1
  77. package/dist/assets/useEventInvalidation-BaM_HHUO.js +1 -0
  78. package/dist/assets/{useNodeUrlSelection-DaKJKpuR.js → useNodeUrlSelection-BSpn8JLz.js} +1 -1
  79. package/dist/assets/{useTemplateSave-BmOv5CyX.js → useTemplateSave-CVoxjtyr.js} +1 -1
  80. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C3GOBXoz.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CTvMo-Za.js} +2 -2
  81. package/dist/index.html +9 -9
  82. package/dist/server/addon.js +245 -19
  83. package/package.json +2 -2
  84. package/dist/assets/Addons-DcNVmmUR.js +0 -5
  85. package/dist/assets/DeviceDetail-c44Qu4eg.js +0 -2
  86. package/dist/assets/Identity-Baq63kZ-.js +0 -1
  87. package/dist/assets/IntegrationDetail-Bekt_JlA.js +0 -1
  88. package/dist/assets/Integrations-DMNm8gLz.js +0 -1
  89. package/dist/assets/Locations-DyHP2BGq.js +0 -3
  90. package/dist/assets/MyAccess-2eA1Gq4e.js +0 -2
  91. package/dist/assets/SessionsList-D1tQtPF-.js +0 -2
  92. package/dist/assets/System-ACZpmfwo.js +0 -1
  93. package/dist/assets/Terminal-IaP_mkJ7.js +0 -3
  94. package/dist/assets/client-Bk9Disrh.js +0 -1119
  95. package/dist/assets/device-picker-model-CXUWwDVG.js +0 -1
  96. package/dist/assets/dist-gaWo_Ay5.js +0 -1119
  97. package/dist/assets/i18n-Bn3MPEP0.js +0 -1
  98. package/dist/assets/index-CWyWRkhx.css +0 -2
  99. package/dist/assets/mount-CXUWwDVG.js +0 -1
  100. package/dist/assets/remoteEntry-BDpV9VBa.js +0 -1
  101. package/dist/assets/src-D_XI9WFM.js +0 -279
  102. package/dist/assets/useEventInvalidation-CXUWwDVG.js +0 -1
@@ -5943,7 +5943,7 @@ var ZodIssueCode = {
5943
5943
  var ZodFirstPartyTypeKind;
5944
5944
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5945
5945
  //#endregion
5946
- //#region ../types/dist/sleep-BnR9qGOv.mjs
5946
+ //#region ../types/dist/sleep-CLDVTB5R.mjs
5947
5947
  /**
5948
5948
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5949
5949
  * window to float samples (D455).
@@ -17909,6 +17909,118 @@ var CAP_VOCABULARY_BY_NAME = {
17909
17909
  },
17910
17910
  unit: "°C",
17911
17911
  icon: "thermometer"
17912
+ },
17913
+ {
17914
+ kind: "numeric",
17915
+ field: "feelsLike",
17916
+ quantity: {
17917
+ en: "the feels-like temperature",
17918
+ it: "la temperatura percepita"
17919
+ },
17920
+ label: {
17921
+ en: "Feels like",
17922
+ it: "Percepita"
17923
+ },
17924
+ unit: "°C",
17925
+ icon: "thermometer"
17926
+ },
17927
+ {
17928
+ kind: "numeric",
17929
+ field: "vpd",
17930
+ quantity: {
17931
+ en: "the vapour-pressure deficit",
17932
+ it: "il deficit di pressione di vapore"
17933
+ },
17934
+ label: {
17935
+ en: "VPD",
17936
+ it: "VPD"
17937
+ },
17938
+ unit: "kPa",
17939
+ icon: "gauge"
17940
+ },
17941
+ {
17942
+ kind: "numeric",
17943
+ field: "windGustMax",
17944
+ quantity: {
17945
+ en: "the highest gust today",
17946
+ it: "la raffica massima di oggi"
17947
+ },
17948
+ label: {
17949
+ en: "Max gust",
17950
+ it: "Raffica max"
17951
+ },
17952
+ unit: "m/s",
17953
+ icon: "wind"
17954
+ },
17955
+ {
17956
+ kind: "numeric",
17957
+ field: "windBearingAvg",
17958
+ quantity: {
17959
+ en: "the average wind bearing",
17960
+ it: "la direzione media del vento"
17961
+ },
17962
+ label: {
17963
+ en: "Avg bearing",
17964
+ it: "Direzione media"
17965
+ },
17966
+ unit: "°",
17967
+ icon: "wind"
17968
+ },
17969
+ {
17970
+ kind: "numeric",
17971
+ field: "rain24h",
17972
+ quantity: {
17973
+ en: "the rain in the last 24 hours",
17974
+ it: "la pioggia delle ultime 24 ore"
17975
+ },
17976
+ label: {
17977
+ en: "Rain 24 h",
17978
+ it: "Pioggia 24 h"
17979
+ },
17980
+ unit: "mm",
17981
+ icon: "droplets"
17982
+ },
17983
+ {
17984
+ kind: "numeric",
17985
+ field: "rainWeekly",
17986
+ quantity: {
17987
+ en: "the rain this week",
17988
+ it: "la pioggia di questa settimana"
17989
+ },
17990
+ label: {
17991
+ en: "Rain week",
17992
+ it: "Pioggia settimana"
17993
+ },
17994
+ unit: "mm",
17995
+ icon: "droplets"
17996
+ },
17997
+ {
17998
+ kind: "numeric",
17999
+ field: "rainMonthly",
18000
+ quantity: {
18001
+ en: "the rain this month",
18002
+ it: "la pioggia di questo mese"
18003
+ },
18004
+ label: {
18005
+ en: "Rain month",
18006
+ it: "Pioggia mese"
18007
+ },
18008
+ unit: "mm",
18009
+ icon: "droplets"
18010
+ },
18011
+ {
18012
+ kind: "numeric",
18013
+ field: "rainYearly",
18014
+ quantity: {
18015
+ en: "the rain this year",
18016
+ it: "la pioggia di quest’anno"
18017
+ },
18018
+ label: {
18019
+ en: "Rain year",
18020
+ it: "Pioggia anno"
18021
+ },
18022
+ unit: "mm",
18023
+ icon: "droplets"
17912
18024
  }
17913
18025
  ]
17914
18026
  },
@@ -21050,6 +21162,38 @@ Object.freeze({
21050
21162
  {
21051
21163
  "path": "dewPoint",
21052
21164
  "valueType": "number"
21165
+ },
21166
+ {
21167
+ "path": "feelsLike",
21168
+ "valueType": "number"
21169
+ },
21170
+ {
21171
+ "path": "vpd",
21172
+ "valueType": "number"
21173
+ },
21174
+ {
21175
+ "path": "windGustMax",
21176
+ "valueType": "number"
21177
+ },
21178
+ {
21179
+ "path": "windBearingAvg",
21180
+ "valueType": "number"
21181
+ },
21182
+ {
21183
+ "path": "rain24h",
21184
+ "valueType": "number"
21185
+ },
21186
+ {
21187
+ "path": "rainWeekly",
21188
+ "valueType": "number"
21189
+ },
21190
+ {
21191
+ "path": "rainMonthly",
21192
+ "valueType": "number"
21193
+ },
21194
+ {
21195
+ "path": "rainYearly",
21196
+ "valueType": "number"
21053
21197
  }
21054
21198
  ],
21055
21199
  "zone-analytics": [
@@ -54159,13 +54303,14 @@ DeviceType.Sensor;
54159
54303
  * its device tracks consumables registers it; the provider names each item
54160
54304
  * verbatim and says which `kind` it is.
54161
54305
  *
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).
54306
+ * The admin UI shows it in the device card's consumables chip and popover
54307
+ * (kind-aware level, remaining time, "Reset"), for every device bound to this
54308
+ * cap (D1023). It no longer has a section of its own under the hero card
54309
+ * (D915 on that point).
54165
54310
  *
54166
54311
  * Like `childLayout`, the cap is INERT until a provider sets items: no
54167
54312
  * provider populates it by guessing (no HA inference). The UI renders a
54168
- * "No consumables reported" placeholder when `items` is empty.
54313
+ * "No consumables reported" line when `items` is empty.
54169
54314
  */
54170
54315
  /**
54171
54316
  * What an item IS, which decides which direction is bad:
@@ -55209,7 +55354,7 @@ DeviceType.MediaPlayer, optionalMethod(deviceOnly, _void(), {
55209
55354
  }]
55210
55355
  }]
55211
55356
  });
55212
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
55357
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
55213
55358
  var NUMBER = {
55214
55359
  kind: "fixed",
55215
55360
  result: ["number"]
@@ -60043,6 +60188,10 @@ method(object({
60043
60188
  * system did not report is `null`, never `0` (D393).
60044
60189
  *
60045
60190
  * Signs, all in watts:
60191
+ * - The branches are DISJOINT: `house` is the consumption EXCLUDING the heat pump
60192
+ * whenever `heatPump` is reported, so solar + grid import + storage discharge =
60193
+ * house + heatPump + grid export + storage charge. A provider whose meter totals
60194
+ * include the pump subtracts it; when it cannot, `house` is null (D393).
60046
60195
  * - `solar.powerW`, `house.powerW`, `heatPump.powerW` are magnitudes (≥ 0);
60047
60196
  * - `grid.powerW` is + importing, − exporting;
60048
60197
  * - `storage.powerW` is + charging, − discharging.
@@ -85423,21 +85572,98 @@ var WeatherStatusSchema = object({
85423
85572
  });
85424
85573
  DeviceType.Weather;
85425
85574
  var WeatherStationStatusSchema = object({
85426
- temperature: number$1().nullable().meta(readingMeta("temperature", { precision: 1 })),
85427
- humidity: number$1().min(0).max(100).nullable().meta(readingMeta("humidity")),
85428
- pressure: number$1().nullable().meta(readingMeta("pressure")),
85429
- windSpeed: number$1().nullable().meta(readingMeta("speed")),
85430
- windGust: number$1().nullable().meta(readingMeta("speed")),
85431
- windBearing: number$1().nullable().meta(readingMeta("angle")),
85432
- rainRate: number$1().nullable().meta(readingMeta("precipitation-rate", { precision: 1 })),
85433
- rainDaily: number$1().nullable().meta(readingMeta("precipitation", { precision: 1 })),
85434
- rainEvent: number$1().nullable().meta(readingMeta("precipitation", { precision: 1 })),
85435
- uv: number$1().nullable().meta(readingMeta("index", { precision: 1 })),
85436
- solarRadiation: number$1().nullable().meta(readingMeta("irradiance")),
85437
- dewPoint: number$1().nullable().meta(readingMeta("temperature", { precision: 1 }))
85575
+ temperature: number$1().nullable().default(null).meta(readingMeta("temperature", { precision: 1 })),
85576
+ humidity: number$1().min(0).max(100).nullable().default(null).meta(readingMeta("humidity")),
85577
+ pressure: number$1().nullable().default(null).meta(readingMeta("pressure")),
85578
+ windSpeed: number$1().nullable().default(null).meta(readingMeta("speed")),
85579
+ windGust: number$1().nullable().default(null).meta(readingMeta("speed")),
85580
+ windBearing: number$1().nullable().default(null).meta(readingMeta("angle")),
85581
+ rainRate: number$1().nullable().default(null).meta(readingMeta("precipitation-rate", { precision: 1 })),
85582
+ rainDaily: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 })),
85583
+ rainEvent: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 })),
85584
+ uv: number$1().nullable().default(null).meta(readingMeta("index", { precision: 1 })),
85585
+ solarRadiation: number$1().nullable().default(null).meta(readingMeta("irradiance")),
85586
+ dewPoint: number$1().nullable().default(null).meta(readingMeta("temperature", { precision: 1 })),
85587
+ /** Apparent ("feels like") temperature. */
85588
+ feelsLike: number$1().nullable().default(null).meta(readingMeta("temperature", { precision: 1 })),
85589
+ /** Vapour-pressure deficit, stored in kPa (the unit stations and growers read it in). */
85590
+ vpd: number$1().nullable().default(null).meta(readingMeta("none", { precision: 2 })),
85591
+ /** Highest wind gust since local midnight. */
85592
+ windGustMax: number$1().nullable().default(null).meta(readingMeta("speed")),
85593
+ /** Wind bearing averaged over the station's own window. */
85594
+ windBearingAvg: number$1().nullable().default(null).meta(readingMeta("angle")),
85595
+ rain24h: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 })),
85596
+ rainWeekly: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 })),
85597
+ rainMonthly: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 })),
85598
+ rainYearly: number$1().nullable().default(null).meta(readingMeta("precipitation", { precision: 1 }))
85438
85599
  }).extend({
85439
85600
  /** Ms epoch of the poll that produced this slice. 0 before the first one. */
85440
85601
  lastFetchedAt: number$1() });
85602
+ /** Every reading of the station with the unit a Customize source must carry ('' = dimensionless). */
85603
+ var STATION_FIELD_UNITS = {
85604
+ temperature: "°C",
85605
+ humidity: "%",
85606
+ pressure: "hPa",
85607
+ windSpeed: "m/s",
85608
+ windGust: "m/s",
85609
+ windBearing: "°",
85610
+ rainRate: "mm/h",
85611
+ rainDaily: "mm",
85612
+ rainEvent: "mm",
85613
+ uv: "",
85614
+ solarRadiation: "W/m²",
85615
+ dewPoint: "°C",
85616
+ feelsLike: "°C",
85617
+ vpd: "kPa",
85618
+ windGustMax: "m/s",
85619
+ windBearingAvg: "°",
85620
+ rain24h: "mm",
85621
+ rainWeekly: "mm",
85622
+ rainMonthly: "mm",
85623
+ rainYearly: "mm"
85624
+ };
85625
+ function isStationField(key) {
85626
+ return Object.prototype.hasOwnProperty.call(STATION_FIELD_UNITS, key);
85627
+ }
85628
+ var STATION_FIELDS = Object.keys(STATION_FIELD_UNITS).filter(isStationField);
85629
+ /**
85630
+ * One scalar target per reading, `apply: 'add'` and listed in `overridable` by its own id
85631
+ * (the running-state / climate-control mechanism, D984 / D990): a station that reports a
85632
+ * reading natively keeps it until the operator assigns another device to that ONE field,
85633
+ * and a device with no `weather-station` slice becomes one from the sources picked. On an
85634
+ * add, every other reading is absent from the claim and the schema defaults it to null
85635
+ * (a missing sensor is never 0, D393) — the fan-control precedent, never a cross-field companion
85636
+ * (the scalar merge treats a companion as owned by its target).
85637
+ */
85638
+ function stationTarget(field) {
85639
+ const unit = STATION_FIELD_UNITS[field];
85640
+ return {
85641
+ id: field,
85642
+ cardinality: "scalar",
85643
+ vocabulary: {
85644
+ cap: "weather-station",
85645
+ stateField: field
85646
+ },
85647
+ deviceTypes: [DeviceType.WeatherStation],
85648
+ apply: "add",
85649
+ path: field,
85650
+ sources: [{
85651
+ kind: "numeric",
85652
+ ...unit.length > 0 ? { requiredUnit: unit } : {},
85653
+ transforms: [{ kind: "identity" }]
85654
+ }],
85655
+ companions: [{
85656
+ kind: "clock",
85657
+ path: "lastFetchedAt",
85658
+ when: "add"
85659
+ }],
85660
+ sourceReport: { status: "assignment-status" }
85661
+ };
85662
+ }
85663
+ STATION_FIELDS.map((field) => ({
85664
+ path: field,
85665
+ by: field
85666
+ })), STATION_FIELDS.map(stationTarget);
85441
85667
  DeviceType.WeatherStation;
85442
85668
  /**
85443
85669
  * Optional client-side hints sent at session creation to help the provider
@@ -104291,7 +104517,7 @@ var AdminUIAddon = class extends BaseAddon {
104291
104517
  capability: adminUiCapability,
104292
104518
  provider: {
104293
104519
  getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
104294
- getVersion: async () => ({ version: "1.2.676" })
104520
+ getVersion: async () => ({ version: "1.2.678" })
104295
104521
  }
104296
104522
  }];
104297
104523
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-admin-ui",
3
- "version": "1.2.676",
3
+ "version": "1.2.678",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin UI — Vite frontend build and server-side addon",
@@ -50,7 +50,7 @@
50
50
  }
51
51
  ],
52
52
  "requires": {
53
- "server": ">=1.2.875"
53
+ "server": ">=1.2.877"
54
54
  }
55
55
  },
56
56
  "scripts": {
@@ -1,5 +0,0 @@
1
- import{B as e,C as t,J as n,K as r,R as i,S as a,V as o,Y as s,et as c,o as l,x as u}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{$n as d,Bn as f,Fi as p,Fn as m,Fr as h,Jn as g,Q as _,Ui as v,Wt as y,Xt as b,Zi as x,ct as ee,dt as S,ea as C,en as w,ot as T,pr as te,wn as ne,wt as E,yi as D,zn as re}from"./player-overlays-CjpQzXKG.js";import{Mc as O}from"./client-Bk9Disrh.js";import{t as ie}from"./chevron-down-CBb-F8DT.js";import{i as k,u as A}from"./terminal-DU-tvcEm.js";import{$a as ae,$f as oe,Ai as se,Bc as ce,Dp as j,Fi as le,Ga as ue,Gf as M,Ja as N,Jr as P,Ka as de,Kr as F,Ni as fe,Pi as pe,Pl as me,Qa as I,Ua as L,Va as R,Wa as he,Xa as z,Ya as ge,Yr as _e,ao as ve,cr as B,do as ye,eo as be,gt as V,io as xe,ji as Se,ki as Ce,lo as H,lr as we,ma as Te,no as Ee,oo as U,ot as De,qa as W,qr as Oe,so as ke,ti as Ae,to as G,uo as je,wp as Me}from"./src-D_XI9WFM.js";import{t as K}from"./useTranslation-BJr-n0es.js";import"./mount-CXUWwDVG.js";import{hi as Ne,li as Pe,ot as Fe,pi as Ie,st as Le}from"./index-BuvJmkAR.js";import{t as q}from"./AdminPage-BaJAzoqh.js";import{i as Re,r as ze,t as Be}from"./addon-kind-filter-CEGKkC1O.js";import{t as J}from"./NodeAddonsSettingsPanel-DOISNk33.js";import{n as Y,r as Ve,t as He}from"./useNodeUrlSelection-DaKJKpuR.js";function Ue(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}}c();var We={queued:{icon:p,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:h,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:g,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:C,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:k,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function X({item:e}){let{t:n}=K(),r=We[e.status],i=r.icon;return t(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded ${r.bg}`,title:e.error,children:[a(i,{className:`w-2.5 h-2.5 ${r.spin?`animate-spin`:``}`}),n(r.labelKey)]})}var Z=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),Ge=new Set([`done`,`failed`,`skipped`]);function Ke(e){return!Ge.has(e.phase)&&!Z.has(e.jobState)}function qe(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Z.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 Je(){let{data:e}=ae({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=j(O.AddonsJobProgress,e=>e.job.jobId);return r(()=>{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 qe([...n.values()],Date.now())},[e,t])}var Ye={queued:{icon:p,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:h,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:h,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:h,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:h,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:h,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:h,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:C,cls:`bg-success/10 text-success`,labelKey:`addons.jobProgress.updated`},failed:{icon:k,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:ne,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Xe({progress:e}){let{t:n}=K(),r=Ye[e.phase],i=r.icon,o=e.error??`${e.packageName}: ${e.fromVersion??`?`} → ${e.toVersion}`;return t(`span`,{"data-testid":`addon-job-progress`,className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded shrink-0 ${r.cls}`,title:o,children:[a(i,{className:`w-2.5 h-2.5 ${r.spin?`animate-spin`:``}`}),n(r.labelKey),t(`span`,{className:`font-mono`,children:[`→ `,e.toVersion]})]})}function Ze(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 Qe(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function $e(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(Qe)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
2
- `)}function Q(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 et={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function tt(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)}: ${et[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 nt={},rt=3e4,it=`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 at({packageName:e,displayName:n,selectedNode:r,hideNodeAction:i,disabled:o}){let{t:s}=K(),c=l(),u=ee(),d=T(),f=I(nt,{staleTime:rt}),p=f.data?.installations??[],m=(f.data?.unreachable??[]).map(e=>e.nodeId),h=Ze(p,e),g=e=>h.find(t=>t.nodeId===e)?.nodeName??(e===r.id?r.name:e),_=je({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),v=async e=>{await d({title:e.success?s(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:n}):s(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:n}),message:tt(e,g),variant:e.success?`default`:`danger`})},y=async t=>{try{await v(await _.mutateAsync({packageName:e,...t}))}catch(e){await d({title:s(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:n}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},b=async()=>{let e=h.filter(e=>e.nodeId!==r.id);await u({title:s(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:n,name:r.name}),message:Q(n,r.name,e),confirmLabel:s(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await y(r.isHub?{}:{nodeId:r.id})},x=async()=>{let t=(await f.refetch()).data;if(t===void 0){await d({title:s(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:s(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=Ze(t.installations,e);await u({title:s(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:n}),message:$e(n,r,t.unreachable.map(e=>e.nodeId)),confirmLabel:s(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await y({everywhere:!0})},S=_.isPending||o===!0;return t(`div`,{className:`flex items-center gap-1.5`,children:[i!==!0&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),b()},disabled:S,className:it,title:s(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:r.name}),children:[a(w,{className:`h-3 w-3`}),_.isPending?s(`addons.addonUninstallControls.removing`,`Removing...`):s(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(h.length>1||i===!0||m.length>0)&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:S,className:it,title:s(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[a(A,{className:`h-3 w-3`}),h.length>0?s(`addons.uninstallControls.everywhereCount`,{count:h.length}):s(`addons.uninstallControls.everywhere`)]})]})}function ot(e){return typeof e.deprecated==`string`&&e.deprecated.length>0}function st(e,t){return t?e:e.filter(e=>e.distTags.includes(`latest`)||!ot(e))}function ct(e){return e.length-st(e,!1).length}c();function lt({packageName:e,currentVersion:n,installSource:r,onInstall:i,onClose:o,onSelect:c,selectedVersion:l}){let{t:d}=K(),f=r===`upload`||r===`local`,[p,m]=s(!1),{data:g,isLoading:_,isError:v}=N({name:e}),b=g?st(g,p):[],x=g?ct(g):0;return t(`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:[t(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[a(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:d(`addons.versionPicker.versions`,`Versions`)}),a(M,{variant:`unstyled`,type:`button`,onClick:o,className:`text-foreground-subtle hover:text-foreground`,children:a(E,{className:`h-3 w-3`})})]}),f&&t(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[a(y,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),t(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[a(`span`,{className:`font-semibold`,children:d(`addons.versionPicker.inPlace`,{kind:r===`upload`?d(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):d(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,a(Pe,{i18nKey:`addons.versionPicker.reinstall`,values:{version:n},components:{mono:a(`span`,{className:`font-mono`})}})]})]}),_&&t(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[a(h,{className:`h-3.5 w-3.5 animate-spin`}),d(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),v&&a(`div`,{className:`px-3 py-4 text-center text-[10px] text-danger`,children:d(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),b.length>0&&a(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:b.map(e=>{let r=e.version===n,o=c!==void 0&&e.version===l,s=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),f=t(u,{children:[a(`span`,{className:`font-mono flex-1 text-left ${r?`text-primary font-semibold`:s?`text-amber-400`:`text-foreground`}`,children:e.version}),r&&a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:d(`common.current`)}),e.distTags.map(e=>a(`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)),ot(e)&&a(`span`,{className:`text-[9px] text-red-400 line-through`,children:d(`common.deprecated`)}),a(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return c?t(M,{variant:`unstyled`,type:`button`,"aria-label":d(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>c(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${o?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,o?a(C,{className:`h-3 w-3 text-primary shrink-0`}):a(`span`,{className:`w-3 shrink-0`})]},e.version):t(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${r?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,a(M,{variant:`unstyled`,type:`button`,onClick:()=>i(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:r?d(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):d(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:a(D,{className:`h-3 w-3`})})]},e.version)})}),!_&&!v&&g&&g.length===0&&a(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:d(`addons.versionPicker.noVersionsFound`,`No versions found`)}),x>0&&a(M,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto w-full justify-start rounded-none border-t border-border px-3 py-2 text-left text-[10px] font-normal text-foreground-subtle`,onClick:()=>m(e=>!e),children:p?d(`addons.versionPicker.hideOlder`,`Hide older versions`):d(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:x})})]})}c();var ut=`device-export`;function dt(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===ut)}function ft(e){return e!==`local`&&e!==`upload`}function pt({isBundle:e,installSource:n,addonId:r,iconPath:i,color:o}){let[c,l]=s(!1),u=o?{backgroundColor:`${o.startsWith(`#`)?o:`#${o}`}26`}:void 0,f=e?`bg-indigo-500/20 text-indigo-700 dark:text-indigo-300`:`bg-purple-500/20 text-purple-700 dark:text-purple-300`,p=r&&i?_(`/api/addon-assets/${r}/${i}`):null,m=!!p&&!c;return t(`div`,{className:`relative flex-shrink-0`,children:[a(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:f}`,style:u,children:m?a(`img`,{src:p,alt:r,className:`h-4 w-4`,onError:()=>l(!0)}):a(e?te:d,{className:`h-3.5 w-3.5`})}),n===`local`&&a(`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`}),ft(n)&&a(`span`,{className:`absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm`,children:a(`svg`,{viewBox:`0 0 780 250`,className:`w-[11px] h-[11px]`,children:a(`path`,{fill:`#fff`,d:`M240 250h100V50h100v200h340V0H0v250z`})})}),n===`upload`&&a(`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:a(y,{className:`h-2.5 w-2.5 text-white`})})]})}function mt({version:e,availableUpdate:n,selectedVersion:r,isUpdating:i,installSource:o,disabled:s,onUpdate:c,onOpenPicker:l,children:u}){let{t:d}=K();if(i)return t(`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:[a(h,{className:`h-3 w-3 animate-spin`}),d(`addons.addonCard.updating`,`Updating…`)]});if(n){let i=r??n;return t(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[c&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:s,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:i}),children:[a(D,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),l()},disabled:s,"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:i}),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:[a(`span`,{className:`font-normal opacity-70`,children:e}),a(`span`,{className:`font-normal opacity-70`,children:`→`}),i,a(ie,{className:`h-3 w-3`})]}),u]})}return t(`div`,{className:`relative inline-flex items-center gap-1 shrink-0`,children:[t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),l()},disabled:s,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`,o===`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,a(ie,{className:`h-3 w-3 opacity-50`})]}),u]})}function ht({addonId:e}){let t=l(),{data:n=`inherit`}=he({addonId:e}),r=U({onSuccess:()=>{t.invalidateQueries({queryKey:[[`addons`,`getAddonAutoUpdate`]]})}});return a(`div`,{className:`flex rounded-lg border border-border overflow-hidden text-[10px] font-medium`,children:[`inherit`,`off`,`latest`,`beta`].map(t=>a(M,{variant:`unstyled`,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 gt={id:`hub`,name:`Hub`,isHub:!0};function _t({addon:e,clusterStatus:n,hideVersion:r,availableUpdate:i,blockedUpdate:c,onUpdateServer:d,onUpdate:p,isUpdating:h,jobProgress:_,bundle:v,bulkItem:y,disabledByBulk:b,isSystem:ee,selectedNode:S}){let{t:C}=K(),[w,T]=s(!1),[ne,D]=s(!1),[re,O]=s(null);o(()=>{O(null)},[i]);let A=re??i,[ae,oe]=s(!1),[ce,j]=s(!1),[ue,N]=s(`logs`),P=l(),de=Ie(),{manifest:F}=e,me=!v&&!F.protected&&F.removable!==!1,I=!!v,L=v?.displayName??F.name,R=v?.packageName??F.packageName,he=v?.version??F.packageVersion??F.version,z=v?.installSource??e.installSource,_e=v?v.bundle?.description??v.addons[0]?.manifest.description:F.description,ve=Ee({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]})}}),ye=ge({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]}),P.invalidateQueries({queryKey:[[`addonPages`]]}),P.invalidateQueries({queryKey:[[`capabilities`]]}),P.invalidateQueries({queryKey:[[`integrations`]]})}}),be=xe({onSuccess:()=>{P.invalidateQueries({queryKey:[[`addons`]]}),P.invalidateQueries({queryKey:[[`alerts`]]})}}),H=e.health,U=H?.phase===`failed`&&!H.inGracePeriod,De=U&&H?.nextRetryAt&&!H.retrying,W=Ue(e.process);return t(`div`,{className:`rounded-md border bg-surface overflow-hidden ${U?`border-red-500/50`:`border-border`}`,children:[U&&H&&t(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[a(k,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),t(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-xs font-semibold text-danger`,children:C(`addons.addonCard.failedToLoad`,{attempt:H.retryCount})}),a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:H.lastError?.message??C(`addons.addonCard.unknownError`,`Unknown error`)}),De&&H.nextRetryAt&&a(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:C(`addons.addonCard.autoRetryAt`,{time:new Date(H.nextRetryAt).toLocaleTimeString()})})]}),t(M,{variant:`unstyled`,type:`button`,disabled:be.isPending||H.retrying,onClick:e=>{e.stopPropagation(),be.mutate({packageName:R})},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:C(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[a(g,{className:`h-3 w-3 ${be.isPending||H.retrying?`animate-spin`:``}`}),C(`addons.addonCard.retryNow`,`Retry now`)]})]}),W!==null&&t(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[a(k,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),t(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-xs font-semibold text-danger`,children:C(`addons.addonCard.processProblem.${W.kind}`)}),W.reason!==void 0&&a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:W.reason})]})]}),t(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[a(pt,{isBundle:I||!!F.components&&F.components.length>1,installSource:z,addonId:I?v.addons[0]?.manifest.id:F.id,iconPath:I?v.bundle?.icon??v.addons[0]?.manifest.icon:F.icon,color:I?v.addons[0]?.manifest.color:F.color}),t(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:`flex items-start justify-between gap-2`,children:[a(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:L}),!r&&a(mt,{version:he,availableUpdate:i,...A===void 0?{}:{selectedVersion:A},isUpdating:h,installSource:z,disabled:b,...p&&A!==void 0?{onUpdate:()=>p(A)}:{},onOpenPicker:()=>D(e=>!e),children:ne&&a(lt,{packageName:R,currentVersion:he,...z?{installSource:z}:{},...i!==void 0&&A!==void 0?{selectedVersion:A,onSelect:e=>{O(e),D(!1)}}:{},onInstall:e=>{D(!1),ye.mutate({packageName:R,version:e})},onClose:()=>D(!1)})})]}),t(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[R!==L&&a(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:R}),I&&t(`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:[a(te,{className:`h-3 w-3`}),v.addons.length]}),ee&&t(`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:C(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[a(g,{className:`h-3 w-3`}),C(`addons.addonCard.system`,`System`)]}),y!=null&&a(X,{item:y}),c!==void 0&&a(Te,{variant:`warning`,title:C(`addons.addonCard.updateHeldTitle`,{defaultValue:`{{latest}} is held until the server is {{required}} or newer`,latest:c.latestVersion,required:c.requiredServer}),children:C(`addons.addonCard.requiresServer`,{defaultValue:`requires server ≥ {{version}}`,version:c.requiredServer})}),c!==void 0&&d!==void 0&&a(M,{type:`button`,size:`sm`,variant:`secondary`,onClick:d,children:C(`clusterUpdate.updateServer`,`Update server`)}),_!=null&&a(Xe,{progress:_})]}),_e&&a(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:_e}),!I&&e.process&&t(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[a(`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`?C(`addons.addonCard.forked`):C(`addons.addonCard.inProcess`)}),e.process.pid!=null&&t(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),a(`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`:W===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!I&&t(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),ve.mutate({addonId:F.id})},disabled:ve.isPending||b,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:[a(g,{className:`h-3 w-3 ${ve.isPending?`animate-spin`:``}`}),C(`addons.addonCard.restart`,`Restart`)]}),t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),oe(e=>!e)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${ae?`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:[a(f,{className:`h-3 w-3`}),C(`addons.addonCard.logs`,`Logs`)]}),!I&&t(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),j(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${ce?`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:[a(m,{className:`h-3 w-3`}),C(`addons.addonCard.settings`,`Settings`)]}),a(`div`,{className:`flex-1`}),me&&a(at,{packageName:F.packageName,displayName:F.name,selectedNode:S??gt,disabled:b})]}),n&&n.nodes.length>1&&!I&&t(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:C(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),a(`div`,{className:`space-y-1`,children:n.nodes.map(e=>t(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[a(`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`}`}),a(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),a(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:C(`addons.addonCard.outdated`)}),e.status===`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:C(`common.offline`)}),e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] text-success`,children:C(`common.synced`)})]},e.nodeId))})]}),ae&&!I&&t(`div`,{className:`border-t border-border`,children:[t(`div`,{className:`flex items-center px-3 py-0.5 bg-surface-hover/20 border-b border-border/50`,children:[t(`div`,{className:`flex rounded border border-border overflow-hidden text-[9px]`,children:[a(M,{variant:`unstyled`,type:`button`,onClick:()=>N(`logs`),className:`px-2 py-0.5 transition-colors ${ue===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:C(`addons.addonCard.logs`,`Logs`)}),a(M,{variant:`unstyled`,type:`button`,onClick:()=>N(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${ue===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:C(`addons.addonCard.events`,`Events`)})]}),a(`div`,{className:`flex-1`}),a(M,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),oe(!1)},className:`text-foreground-subtle hover:text-foreground`,children:a(E,{className:`h-3.5 w-3.5`})})]}),ue===`logs`&&a(we,{addonId:F.id,maxHeight:`max-h-64`,showFilters:!1}),ue===`events`&&a(B,{addonId:F.id,category:`addon.*`,maxHeight:`max-h-64`})]}),I&&t(u,{children:[a(M,{variant:`unstyled`,type:`button`,onClick:()=>T(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:a(w?x:ie,{className:`h-3.5 w-3.5 text-foreground-subtle`})}),w&&a(`div`,{className:`border-t border-border px-2.5 py-1.5 space-y-1.5`,children:v.addons.map(e=>a(_t,{addon:e,hideVersion:!0},e.manifest.id))})]}),ce&&!I&&a(Ce,{open:!0,onOpenChange:e=>!e&&j(!1),children:t(Se,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(pe,{children:t(le,{className:`flex items-center gap-2`,children:[a(m,{className:`h-4 w-4 text-primary`}),C(`addons.addonCard.settingsTitle`,{name:L})]})}),t(se,{className:`space-y-4`,children:[a(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:C(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),a(J,{nodeId:null,addonIds:[F.id],level:`global`,fieldScope:`cluster`,emptyMessage:C(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)}),dt(F)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.deviceExport`,`Device export`)}),a(V,{addonId:F.id,onOpenDevice:e=>de(`/devices/${e}`)})]}),ft(z)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.autoUpdate`,`Auto-Update`)}),a(ht,{addonId:F.id})]}),F.components&&F.components.length>0&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.components`,{count:F.components.length})}),a(`div`,{className:`flex flex-wrap gap-1`,children:F.components.map(e=>a(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]})]}),a(fe,{children:a(M,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>j(!1),children:C(`common.close`,`Close`)})})]})})]})}c();var vt=`.tgz,.tar.gz,.zip`;function yt({onUploadSuccess:e}){let{t:r}=K(),[o,c]=s(!1),l=n(null),d=i(async t=>{c(!0);let n=new FormData;n.append(`file`,t);let r=localStorage.getItem(`camstack_admin_token`)??``;try{(await(await fetch(_(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{c(!1)}},[e]);return t(u,{children:[a(Ae,{ref:l,accept:vt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),t(M,{variant:`unstyled`,type:`button`,onClick:()=>l.current?.click(),disabled:o,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:[o?a(h,{className:`w-3.5 h-3.5 animate-spin`}):a(y,{className:`w-3.5 h-3.5`}),o?r(`addons.addonUploadZone.uploading`,`Uploading...`):r(`addons.addonUploadZone.upload`,`Upload`)]})]})}var bt=/```[^\n]*\n([\s\S]*?)```/g;function xt(e){let t=[],n=0;for(let r of e.matchAll(bt)){let i=r.index??0;i>n&&t.push({kind:`text`,body:e.slice(n,i)}),t.push({kind:`code`,body:r[1]??``}),n=i+r[0].length}return n<e.length&&t.push({kind:`text`,body:e.slice(n)}),t}function St(e){let t=e.trim();return t.startsWith(`https://`)||t.startsWith(`http://`)?t:null}function Ct(e,t){let n=[],r=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g,i=0,o=0;for(let s of e.matchAll(r)){let r=s.index??0;r>i&&n.push(e.slice(i,r));let c=s[0],l=`${t}-${o}`;if(o+=1,c.startsWith(`**`))n.push(a(`strong`,{children:c.slice(2,-2)},l));else if(c.startsWith("`"))n.push(a(`code`,{className:`font-mono text-[0.9em]`,children:c.slice(1,-1)},l));else{let e=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(c),t=e?.[1]??c,r=e?St(e[2]??``):null;n.push(r?a(`a`,{href:r,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline`,children:t},l):a(`span`,{children:t},l))}i=r+c.length}return i<e.length&&n.push(e.slice(i)),n}function wt(e,t){let n=e.split(`
5
- `),r=[],i=[],o=[],s=0,c=()=>{if(i.length===0)return;let e=i.join(` `).trim();i=[],e.length!==0&&(r.push(a(`p`,{className:`mb-2 last:mb-0`,children:Ct(e,`${t}-p-${s}`)},`${t}-p-${s}`)),s+=1)},l=()=>{if(o.length===0)return;let e=o;o=[],r.push(a(`ul`,{className:`mb-2 list-disc pl-4 last:mb-0`,children:e.map((e,n)=>a(`li`,{children:Ct(e,`${t}-li-${s}-${n}`)},`${t}-li-${s}-${n}`))},`${t}-ul-${s}`)),s+=1};for(let e of n){let n=/^(#{1,3})\s+(.*)$/.exec(e),u=/^\s*[-*]\s+(.*)$/.exec(e);if(n){c(),l();let e=n[1]?.length??1,i=Ct(n[2]??``,`${t}-h-${s}`),o=e===1?`text-sm font-semibold mb-2`:`text-xs font-semibold mb-1.5 mt-2`;r.push(a(e===1?`h3`:`h4`,{className:o,children:i},`${t}-h-${s}`)),s+=1;continue}if(u){c(),o=[...o,u[1]??``];continue}if(e.trim().length===0){c(),l();continue}l(),i=[...i,e.trim()]}return c(),l(),r}function Tt({markdown:e}){return a(`div`,{className:`text-xs text-foreground leading-relaxed`,children:xt(e).map((e,t)=>e.kind===`code`?a(`pre`,{className:`mb-2 overflow-auto rounded-md bg-surface-hover p-2 font-mono text-[10px] last:mb-0`,children:e.body.replace(/\n$/,``)},`code-${t}`):a(`div`,{children:wt(e.body,`b${t}`)},`text-${t}`))})}c();function Et(e){return e.replace(/^@camstack\/(addon-)?/,``)}function Dt(e,t,n){let r=st(e,n);return r.some(e=>e.version===t)?r:[{version:t,distTags:[],deprecated:void 0},...r]}function Ot({pending:e,failed:n,body:r,missing:i}){let{t:o}=K();return e?t(`div`,{className:`flex items-center gap-2 py-6 text-xs text-foreground-subtle`,children:[a(h,{className:`h-3.5 w-3.5 animate-spin`}),o(`addons.installDialog.loadingDocument`,`Loading…`)]}):n||r===void 0?a(`p`,{className:`py-4 text-xs text-danger`,children:o(`addons.installDialog.couldNotLoadDocument`,`Could not load this file from the registry.`)}):r.status===`ok`&&r.markdown!==void 0?a(Tt,{markdown:r.markdown}):r.status===`error`?a(`p`,{className:`py-4 text-xs text-danger`,children:o(`addons.installDialog.documentError`,`Could not load this file. {{message}}`,{message:r.message??``})}):a(`p`,{className:`py-4 text-xs text-foreground-subtle`,children:i})}function kt({target:e,installing:n,installError:r,onClose:i,onInstall:o}){let{t:c}=K(),[l,u]=s(e.version),[d,f]=s(!1),p=N({name:e.name}),m=W({name:e.name,version:l}),g=p.data??[],_=ct(g),v=Dt(g,l,d),y=m.data;return a(Ce,{open:!0,onOpenChange:e=>!e&&i(),children:t(Se,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(pe,{children:a(le,{children:c(`addons.installDialog.title`,`Install {{name}}`,{name:Et(e.name)})})}),t(se,{className:`space-y-3`,children:[a(`p`,{className:`font-mono text-[10px] text-foreground-subtle`,children:e.name}),e.description.length>0&&a(`p`,{className:`text-xs text-foreground`,children:e.description}),t(`div`,{className:`space-y-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:c(`addons.installDialog.version`,`Version`)}),a(S,{"aria-label":c(`addons.installDialog.version`,`Version`),value:l,options:v.map(e=>({value:e.version,label:ot(e)?c(`addons.installDialog.deprecatedVersion`,`{{version}} (deprecated)`,{version:e.version}):e.version})),onChange:e=>u(e.target.value)}),p.isError&&a(`p`,{className:`text-[10px] text-danger`,children:c(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),_>0&&a(M,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto justify-start px-0 text-[10px] font-normal text-foreground-subtle underline`,onClick:()=>f(e=>!e),children:d?c(`addons.versionPicker.hideOlder`,`Hide older versions`):c(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:_})})]}),t(F,{defaultValue:`readme`,children:[t(P,{children:[a(_e,{value:`readme`,children:c(`addons.installDialog.readme`,`README`)}),a(_e,{value:`changelog`,children:c(`addons.installDialog.changelog`,`CHANGELOG`)})]}),a(Oe,{value:`readme`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(Ot,{pending:m.isPending,failed:m.isError,body:y?.readme,missing:c(`addons.installDialog.missingReadme`,`This package has no README.`)})})}),a(Oe,{value:`changelog`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(Ot,{pending:m.isPending,failed:m.isError,body:y?.changelog,missing:c(`addons.installDialog.missingChangelog`,`This package has no CHANGELOG.`)})})})]}),r!=null&&r.length>0&&a(`p`,{className:`text-xs text-danger`,children:r})]}),t(fe,{children:[a(M,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:c(`common.cancel`,`Cancel`)}),a(M,{type:`button`,size:`sm`,disabled:n||l.length===0,onClick:()=>o(e.name,l),children:n?a(h,{className:`h-3.5 w-3.5 animate-spin`}):c(`addons.installDialog.install`,`Install`)})]})]})})}function At(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||Le(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 jt({selectedNode:e}){let{t:n}=K(),{data:r}=I(nt,{staleTime:rt});if(r===void 0)return null;let i=At(r.installations,e),o=r.unreachable.filter(t=>e.isHub||t.nodeId===e.id);return i.length===0&&o.length===0?null:t(`div`,{className:`rounded-lg border border-warning/30 bg-warning/5 px-3 py-2.5 space-y-2`,children:[t(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold text-foreground`,children:[a(b,{className:`h-3.5 w-3.5 text-warning`}),e.isHub?n(`addons.nodeOnlyPackagesPanel.installedOnAgentsButNot`,`Installed on agents but not on the hub`):n(`addons.nodeOnlyPackagesPanel.installedOnButNotOn`,`Installed on {{name}} but not on the hub`,{name:e.name})]}),o.length>0&&a(`div`,{className:`text-[10px] text-foreground-subtle`,children:n(`addons.nodeOnlyPackagesPanel.unreachable`,{nodes:o.map(e=>e.nodeId).join(`, `)})}),i.map(n=>t(`div`,{className:`flex items-center justify-between gap-3 flex-wrap rounded-md border border-border bg-surface px-3 py-2`,children:[t(`div`,{className:`min-w-0`,children:[a(`div`,{className:`text-xs font-mono text-foreground break-all`,children:n.packageName}),a(`div`,{className:`text-[10px] text-foreground-subtle`,children:n.rows.map(e=>`${e.nodeName}${e.version===null?``:` ${e.version}`}${e.isOnline?``:` (offline)`}`).join(` · `)})]}),a(at,{packageName:n.packageName,displayName:n.packageName,selectedNode:e,hideNodeAction:e.isHub})]},n.packageName))]})}function Mt({addon:e,installing:n,onInstall:r}){let{t:i}=K();return t(`div`,{className:`flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors`,children:[a(`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()}),t(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[a(`span`,{className:`text-[11px] font-semibold break-words`,children:e.name.replace(/^@camstack\/(addon-)?/,``)}),t(`span`,{className:`text-[10px] text-foreground-subtle shrink-0`,children:[`v`,e.version]})]}),a(`div`,{className:`font-mono text-[9px] text-foreground-subtle/80 truncate`,children:e.name}),e.description&&a(`div`,{className:`text-[10px] text-foreground-subtle truncate`,children:e.description})]}),e.installed?a(Te,{variant:`success`,icon:a(C,{className:`h-3 w-3`}),children:e.installedVersion??i(`system.capabilityCatalog.installed`,`Installed`)}):t(M,{size:`sm`,onClick:()=>r(e),disabled:n,className:`shrink-0`,children:[n?a(h,{className:`h-3 w-3 animate-spin`}):a(D,{className:`h-3 w-3`}),i(`system.capabilityCatalog.install`,`Install`)]})]})}function Nt({capability:e,installing:n,onInstall:r}){let{t:i}=K(),{data:o,isPending:s,isError:c}=ve({capability:e}),l;if(c)l=a(`div`,{className:`px-3 py-2 text-xs text-danger`,children:i(`system.capabilityCatalog.couldNotSearchTheNpm`,`Could not search the npm catalog right now. Try again in a moment.`)});else if(s||o===void 0)l=t(`div`,{className:`flex items-center gap-2 px-3 py-2 text-xs text-foreground-subtle`,children:[a(h,{className:`h-3 w-3 animate-spin`}),i(`system.capabilityCatalog.searchingTheNpmCatalog`,`Searching the npm catalog…`)]});else{let t=o.filter(e=>!e.installed);l=t.length===0?a(`div`,{className:`px-3 py-2 text-xs text-foreground-subtle`,children:o.length===0?i(`system.capabilityCatalog.noPublishedAddonDeclaresThe`,`No published addon declares the "{{capability}}" capability.`,{capability:e}):i(`system.capabilityCatalog.everyPublishedAddonThatDeclares`,`Every published addon that declares "{{capability}}" is already installed.`,{capability:e})}):a(`div`,{className:`divide-y divide-border`,children:t.map(e=>a(Mt,{addon:e,installing:n,onInstall:r},e.name))})}return t(`section`,{className:`rounded-md border border-border bg-surface overflow-hidden`,"aria-label":i(`system.capabilityCatalog.availableToInstall`,`Available to install`),children:[a(`h2`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:i(`system.capabilityCatalog.availableToInstall`,`Available to install`)}),l]})}c();function Pt(e){return e===`npm`||e===`dev`?e:null}var Ft=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,It=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,Lt=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],Rt={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function zt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function Bt(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 Ht(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 Ut({addons:c,clusterStatus:u,selectedNode:d,onRefresh:f,listPhase:p}){let{t:m}=K(),_=l(),[y,b]=s(``),[x,C]=s(!1),w=e(y),[T,te]=s(!1),ne=n(null);o(()=>{if(!T)return;let e=e=>{ne.current&&!ne.current.contains(e.target)&&te(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[T]);let{data:E}=be({nodeId:d.id}),O=r(()=>{let e=new Map;for(let t of E??[])t.blockedBy===void 0&&e.set(t.name,t.latestVersion);return e},[E]),ie=r(()=>{let e=new Map;for(let t of E??[]){let n=t.blockedBy?.find(e=>e.kind===`server-too-old`);n!==void 0&&e.set(t.name,{latestVersion:t.latestVersion,requiredServer:n.required})}return e},[E]),k=r(()=>(E??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0).length,[E]),[A,ae]=s(()=>new Set),[se,j]=s(()=>new Map),le=i(e=>{ae(t=>new Set(t).add(e))},[]),N=i(e=>{ae(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),P=i((e,t)=>{j(n=>new Map(n).set(e,t))},[]),F=i(e=>{j(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),fe=ye({onMutate:e=>{le(e.name),F(e.name)},onSuccess:(e,t)=>{N(t.name);let n=e;if(n&&n.success===!1){P(t.name,n.error??`Update failed (no error message returned by server)`);return}_.invalidateQueries({queryKey:[[`addons`]]}),_.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]})},onError:(e,t)=>{N(t.name),P(t.name,e instanceof Error?e.message:String(e))}}),pe=Je(),me=n(new Set);o(()=>{let e=new Set;for(let[t,n]of pe)Ke(n)&&e.add(t);let t=[...me.current].some(t=>!e.has(t));me.current=e,t&&(_.invalidateQueries({queryKey:[[`addons`]]}),_.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[pe,_]);let{data:I}=ue(void 0),L=R({onSuccess:()=>{_.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),he=ke({onSuccess:()=>{_.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:z,isFetching:_e}=ve({query:w||void 0},{enabled:T}),B=H(),{data:V}=de(void 0),xe=V?.requestedAt,[Se,Ce]=s(null),[we,Te]=s(!1);o(()=>{if(V?.kind===`framework-bulk-update`&&V.requestedAt!==Se){Ce(V.requestedAt),Te(!0);let e=window.setTimeout(()=>Te(!1),6e3);return()=>window.clearTimeout(e)}},[xe,Se,V]),ee();let Ee=i(async()=>{let e=(E??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0);if(e.length!==0){if(!d.isHub){for(let t of e)await fe.mutateAsync({name:t.name,version:t.latestVersion,nodeId:d.id});return}await B.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[d.id]})}},[E,d.id,d.isHub,B,fe]),[U,De]=s(null),[W,Oe]=s(null),Ae=e=>{Oe(null),De(e)},G=ge({onSuccess:()=>{De(null),Oe(null),_.invalidateQueries({queryKey:[[`addons`]]}),_.invalidateQueries({queryKey:[[`addonPages`]]}),_.invalidateQueries({queryKey:[[`capabilities`]]}),_.invalidateQueries({queryKey:[[`integrations`]]})},onError:e=>{Oe(e instanceof Error?e.message:`Install failed`)}}),[je,Me]=s(`type`),[Pe,Ie]=s(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Le=e=>{Ie(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[q,J]=Ne(),Y=q.get(`capability`),He=q.get(`updatable`)===`1`,We=q.get(`error`)===`1`,X=Pt(q.get(`source`)),Z=Re(q.get(Be))===`integration`,{data:Ge}=ce(void 0,{enabled:Z}),qe=r(()=>Ge===void 0?null:new Set(Ge.map(e=>e.addonId)),[Ge]),Ye=i(e=>{let t=new URLSearchParams(q);e?t.set(Be,`integration`):t.delete(Be),J(t,{replace:!0})},[q,J]),Xe=i(e=>{let t=new URLSearchParams(q);e?t.set(`updatable`,`1`):t.delete(`updatable`),J(t,{replace:!0})},[q,J]),Ze=i(e=>{let t=new URLSearchParams(q);e?t.set(`error`,`1`):t.delete(`error`),J(t,{replace:!0})},[q,J]),Qe=i(e=>{let t=new URLSearchParams(q);e===null?t.delete(`source`):t.set(`source`,e),J(t,{replace:!0})},[q,J]),$e=r(()=>c.filter(e=>Ue(e.process)!==null).length,[c]),Q=r(()=>{let e=c.filter(e=>!Fe(e.manifest.packageName));return d.isHub||(e=e.filter(e=>zt(e.placement,d.isHub))),Y&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===Y))),Z&&(e=[...ze(e,qe)]),He&&(e=e.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&O.has(t)})),X!==null&&(e=e.filter(e=>Bt(e.installSource)===X)),We&&(e=e.filter(e=>Ue(e.process)!==null)),e},[c,d.isHub,Y,He,X,We,Z,qe,O]),et=()=>{let e=new URLSearchParams(q);e.delete(`capability`),J(e,{replace:!0})},tt=Pe===`flat`?Q:Ht(Q),nt=r(()=>{let e=[...tt];switch(je){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},[tt,je]);return t(`div`,{className:`space-y-3`,children:[a(Ve,{open:x,onOpenChange:C}),[...se.entries()].map(([e,n])=>a(`div`,{className:`rounded-md border border-danger/30 bg-danger/5 px-2.5 py-1.5 text-[11px]`,children:t(`div`,{className:`flex items-start justify-between gap-3`,children:[t(`div`,{className:`space-y-0.5`,children:[a(`div`,{className:`font-medium text-danger`,children:m(`systemPage.addons.updateFailed`,{name:e})}),a(`div`,{className:`text-foreground-subtle font-mono`,children:n})]}),a(M,{variant:`unstyled`,type:`button`,onClick:()=>F(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:m(`common.dismiss`)})]})},e)),t(`div`,{className:`flex items-center gap-x-2 gap-y-1.5 flex-wrap`,children:[t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.sort`,`Sort:`)}),t(S,{wrapperClassName:`inline-block w-auto`,value:je,onChange:e=>Me(e.target.value),children:[a(`option`,{value:`type`,children:m(`admin.system.addons.bundlesFirst`,`Bundles first`)}),a(`option`,{value:`name`,children:m(`admin.system.addons.name`,`Name`)}),a(`option`,{value:`source`,children:m(`admin.system.addons.installSource`,`Install source`)})]})]}),t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.view`,`View:`)}),a(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`grouped`,`flat`].map(e=>a(M,{variant:`unstyled`,type:`button`,onClick:()=>Le(e),className:`px-2 py-1 transition-colors capitalize ${Pe===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?m(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):m(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),d.isHub&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(g,{className:`h-3 w-3 text-foreground-subtle`}),a(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.autoUpdate`,`Auto-Update:`)}),a(`div`,{className:`flex rounded-md border border-border overflow-hidden text-[10px] font-medium`,children:[`off`,`latest`,`beta`].map(e=>a(M,{variant:`unstyled`,type:`button`,onClick:()=>L.mutate({channel:e}),disabled:L.isPending,className:`px-2 py-1 transition-colors capitalize ${I?.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&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.checkEvery`,`Check every:`)}),a(S,{wrapperClassName:`inline-block w-auto`,className:`font-medium text-foreground-subtle`,value:I?.updateCheckIntervalSeconds??21600,disabled:he.isPending||I===void 0,onChange:e=>{I!==void 0&&he.mutate({channel:I.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:Lt.map(e=>a(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),k>0&&t(M,{variant:`unstyled`,type:`button`,onClick:()=>void Ee(),disabled:B.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:[B.isPending?a(h,{className:`w-3 h-3 animate-spin`}):a(D,{className:`w-3 h-3`}),B.isPending?m(`admin.system.addons.updating`,`Updating…`):m(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:k})]})]}),t(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":m(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:m(`admin.system.addons.filter`,`Filter:`)}),[{id:`integrations`,label:m(`admin.system.addons.integrations`,`Integrations`),pressed:Z,toggle:()=>Ye(!Z)},{id:`updatable`,label:m(`admin.system.addons.updatable`,`Updatable`),pressed:He,toggle:()=>Xe(!He)},{id:`error`,label:m(`admin.system.addons.inError`,`In error ({{count}})`,{count:$e}),pressed:We,toggle:()=>Ze(!We)},{id:`npm`,label:`npm`,pressed:X===`npm`,toggle:()=>Qe(X===`npm`?null:`npm`)},{id:`dev`,label:m(`admin.system.addons.dev`,`Dev`),pressed:X===`dev`,toggle:()=>Qe(X===`dev`?null:`dev`)}].map(e=>a(M,{variant:`unstyled`,type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?Ft:It,children:e.label},e.id))]}),t(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2`,children:[t(`div`,{className:`relative flex-1 min-w-0 sm:min-w-[200px]`,ref:ne,children:[a(oe,{type:`text`,searchHotkey:!0,value:y,onChange:e=>{b(e.target.value),te(!0)},onFocus:()=>te(!0),placeholder:m(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":m(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:B.isPending,leftSlot:a(re,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:_e?a(h,{className:`h-3 w-3 animate-spin`}):void 0}),T&&z&&z.length>0&&t(`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:[z.length>0&&a(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:m(`systemPage.addons.npmResults`,{count:z.length})}),z&&z.length>0&&a(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:z.map(e=>a(Mt,{addon:e,installing:G.isPending,onInstall:e=>Ae({name:e.name,version:e.version,description:e.description})},e.name))})]})]}),a(yt,{onUploadSuccess:()=>{_.invalidateQueries({queryKey:[[`addons`]]}),f()}})]}),Y&&t(`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:[a(`span`,{className:`text-foreground-subtle`,children:m(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),a(`span`,{className:`font-mono text-primary font-semibold`,children:Y}),a(M,{variant:`unstyled`,type:`button`,onClick:et,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:m(`admin.system.addons.clear`,`Clear`)})]}),Y&&a(Nt,{capability:Y,installing:G.isPending,onInstall:e=>Ae({name:e.name,version:e.version,description:e.description})}),Y&&Q.length>0&&a(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:m(`admin.system.addons.installed`,`Installed`)}),we&&t(`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 max-w-sm pointer-events-auto`,children:[a(v,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),t(`div`,{children:[a(`div`,{className:`text-[11px] font-semibold text-foreground`,children:m(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),a(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:m(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),p===`pending`&&t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[a(h,{className:`h-3 w-3 animate-spin`}),m(`admin.system.addons.loadingInstalled`,`Loading installed addons…`)]}),p===`error`&&a(`div`,{className:`text-xs text-danger`,children:m(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),p===`ready`&&Q.length===0&&a(`div`,{className:`text-xs text-foreground-subtle`,children:c.length===0?m(`admin.system.addons.noAddonsInstalled`,`No addons installed`):Y?m(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:Y}):m(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:d.name})}),a(`div`,{className:`space-y-1.5`,children:p===`ready`&&nt.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=O.get(t),r=ie.get(t),i=$(e)?e.representative:e,o=n?e=>fe.mutate({name:t,version:e,nodeId:d.id}):void 0,s=pe.get(t)??null,c=s!==null&&Ke(s);return a(_t,{addon:i,clusterStatus:u?.[i.manifest.id],bundle:$(e)?e.bundle:void 0,availableUpdate:n,...r===void 0?{}:{blockedUpdate:r},...r===void 0?{}:{onUpdateServer:()=>C(!0)},isUpdating:A.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:B.isPending,selectedNode:d},$(e)?t:e.manifest.id)})}),U!==null&&a(kt,{target:U,installing:G.isPending,installError:W,onClose:()=>De(null),onInstall:(e,t)=>G.mutate({packageName:e,version:t})})]})}function Wt(){let{t:e}=K(),r=l(),{data:i}=me(void 0),{nodes:s}=Me(),{selection:c,selectNode:u,requestedNodeId:d}=He(s.length>0?s:[Rt]),f=c.node??Rt,p=f.id,m=s.length>0?c.staleNodeId:null,{data:h,isLoading:_,isError:v}=z({nodeId:p}),y=L(),b=G(),x=y.isPending||b.isPending,ee=async()=>{await y.mutateAsync({nodeId:p}),await b.mutateAsync(),r.invalidateQueries({queryKey:[[`addons`]]})},S=n(y);S.current=y;let C=n(d??`hub`);o(()=>{S.current.mutate({nodeId:C.current})},[]);let w=(h??[]).map(Vt).filter(e=>e!==null);return t(q,{children:[t(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[a(De,{selectedNodeId:p,onSelect:u}),t(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!_&&!v&&a(`span`,{className:`text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium`,children:e(`systemPage.addons.installedCount`,{count:w.length})}),t(M,{variant:`unstyled`,type:`button`,onClick:()=>void ee(),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:[a(g,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),a(Y,{staleNodeId:m,shownNodeName:f.name}),a(jt,{selectedNode:f}),a(Ut,{addons:w,clusterStatus:i,selectedNode:f,onRefresh:()=>void ee(),listPhase:_?`pending`:v?`error`:`ready`})]})}export{Wt as AddonsPage};