@camstack/addon-admin-ui 1.2.664 → 1.2.666
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/assets/Addons-BbdBk9wW.js +5 -0
- package/dist/assets/{AdminPage-DjU_tnVG.js → AdminPage-CmU7TFpR.js} +1 -1
- package/dist/assets/{AdminSectionedPage-C7aZLZRh.js → AdminSectionedPage-Cm0ZjYDU.js} +1 -1
- package/dist/assets/{AiProfiles-C-ql511o.js → AiProfiles-HJoGWhcS.js} +2 -2
- package/dist/assets/{BootstrapSettingsForm-bkltsyDh.js → BootstrapSettingsForm-D6UTTbsU.js} +1 -1
- package/dist/assets/Build-CCW-kQ0l.js +42 -0
- package/dist/assets/{Calendars-CMSCqf10.js → Calendars-C5NgG8yX.js} +1 -1
- package/dist/assets/{CameraGrids-DN3Ls5A4.js → CameraGrids-B0cBy4w5.js} +1 -1
- package/dist/assets/Cluster-BCyzfBO3.js +1 -0
- package/dist/assets/{CompositionBlockEditor-Cko2VX5-.js → CompositionBlockEditor-BxZoOOq_.js} +2 -2
- package/dist/assets/{CompositionEditorPage-Cq76qdLa.js → CompositionEditorPage-BDv9rAiM.js} +1 -1
- package/dist/assets/Data-D2RM7Tt4.js +2 -0
- package/dist/assets/DeviceDetail-rMZtKYoI.js +2 -0
- package/dist/assets/Devices-BzJ3Btzd.js +1 -0
- package/dist/assets/EmbedDevicePage-8C99LXxD.js +1 -0
- package/dist/assets/{EmbedPlayerPage-Csf7kYqH.js → EmbedPlayerPage-Ca2Sw4bZ.js} +1 -1
- package/dist/assets/History-xW7LPyUG.js +1 -0
- package/dist/assets/Identity-DnwYpLFz.js +1 -0
- package/dist/assets/InstancesTable-DdCebknO.js +1 -0
- package/dist/assets/IntegrationDetail-O-kb6--D.js +1 -0
- package/dist/assets/{Integrations-Y0x6acKZ.js → Integrations-BDCfdFnN.js} +2 -2
- package/dist/assets/Integrations-DSWNrJxB.js +1 -0
- package/dist/assets/Library-LsC-lNCD.js +1 -0
- package/dist/assets/Locations-BYoWfHdo.js +3 -0
- package/dist/assets/{Logs-D3qUktnv.js → Logs-1wrdl6wt.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-DAEAeEsb.js → MaskShapeCanvas-Bq9CrmvE.js} +1 -1
- package/dist/assets/{MotionZonesSettings-Diw-iY7J.js → MotionZonesSettings-BBu1rBTV.js} +1 -1
- package/dist/assets/MyAccess-xYr4opzQ.js +2 -0
- package/dist/assets/Network-CvyVibLV.js +1 -0
- package/dist/assets/NodeAddonsSettingsPanel-BCe3XXQY.js +2 -0
- package/dist/assets/Notifications-rVhJKRmX.js +1 -0
- package/dist/assets/Pipeline-B_b10-YP.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-CHKiIcsw.js → PrivacyMaskSettings-gWcdduy-.js} +1 -1
- package/dist/assets/Recordings-BF59movC.js +1 -0
- package/dist/assets/{SceneMonitorEditor-Djp_rvEh.js → SceneMonitorEditor-Dx29RcZb.js} +1 -1
- package/dist/assets/SessionsList-DzIluTDz.js +2 -0
- package/dist/assets/{Showroom-Bq-MxPxP.js → Showroom-CUEMO_di.js} +1 -1
- package/dist/assets/{StorageLocationsTable-D1ZfEmZ0.js → StorageLocationsTable-CSQCOF91.js} +1 -1
- package/dist/assets/{System-C_sm8J4x.js → System-Bcz-yvym.js} +1 -1
- package/dist/assets/{Terminal-DRqgGpAj.js → Terminal-Ah6yfRG5.js} +4 -4
- package/dist/assets/{TrainingProviders-BT4K0RVZ.js → TrainingProviders-ClxXnXpP.js} +1 -1
- package/dist/assets/{Viewer-CKME7kGT.js → Viewer-BQrT9RT1.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-CANWs3BH.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DhQkS3-x.js} +1 -1
- package/dist/assets/{action-draft-BjuURFtz.js → action-draft-D31SL5Iv.js} +1 -1
- package/dist/assets/{ai-page.helpers-F__brMbl.js → ai-page.helpers-0GgLwuhe.js} +1 -1
- package/dist/assets/{assignment-candidates-CJqDXIFp.js → assignment-candidates-DqQ8QJRE.js} +1 -1
- package/dist/assets/{authed-media-CjjuGXR2.js → authed-media-VxlsUR-Z.js} +1 -1
- package/dist/assets/{board-model-DnTtSG-0.js → board-model-DTatxzz-.js} +1 -1
- package/dist/assets/client-CjUsH2ih.js +1119 -0
- package/dist/assets/{command-vocab-D0HVfsUo.js → command-vocab-B5lwbaVw.js} +1 -1
- package/dist/assets/device-detail-CViRsVSZ.js +1 -0
- package/dist/assets/{device-integration-icon-DTlSLQS_.js → device-integration-icon-DRNFGMwO.js} +1 -1
- package/dist/assets/device-picker-model-DZUf4A44.js +1 -0
- package/dist/assets/dist-B2iUE_dF.js +1119 -0
- package/dist/assets/{dist-Bk6tqJHT.js → dist-e7zknvUU.js} +1 -1
- package/dist/assets/{format-DVsAf4qU.js → format-DMC9AnIW.js} +1 -1
- package/dist/assets/{hostInit-DtJdIG7z.js → hostInit-qJzSnSvz.js} +1 -1
- package/dist/assets/i18n-HP_ZA8Cj.js +1 -0
- package/dist/assets/{icons-BXQ6TgE8.js → icons-LCNDFamy.js} +1 -1
- package/dist/assets/index-DYgod6XH.js +4 -0
- package/dist/assets/index-DinlcDxv.css +2 -0
- package/dist/assets/{linked-devices-model-En6xpQk8.js → linked-devices-model-BD77HUQH.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-f1ce1aba.js → mf-entry-bootstrap-0-f14661ef.js} +2 -2
- package/dist/assets/mount-DZUf4A44.js +1 -0
- package/dist/assets/{notification-rule-status-_SY1WA7F.js → notification-rule-status-DfwVGswl.js} +1 -1
- package/dist/assets/{player-overlays-D-xr6JNm.js → player-overlays-cnJlfjp-.js} +1 -1
- package/dist/assets/remoteEntry-C5wElYQv.js +1 -0
- package/dist/assets/src-Bsetma4r.js +272 -0
- package/dist/assets/{sso-popup-DyR-aOS2.js → sso-popup-zd7kZ7M8.js} +1 -1
- package/dist/assets/{step-inspector-model-BAZSRIbI.js → step-inspector-model-BwX9grtK.js} +1 -1
- package/dist/assets/{use-scenes-feed-CdhtTGlS.js → use-scenes-feed-DLdvcIp2.js} +1 -1
- package/dist/assets/{use-stationary-objects-Dkn3lZm7.js → use-stationary-objects-CHMJijgk.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-BKtAsw-I.js → useAdminDeviceRemoval-am2_G0pf.js} +1 -1
- package/dist/assets/useEventInvalidation-DZUf4A44.js +1 -0
- package/dist/assets/{useNodeUrlSelection-CH8FI53M.js → useNodeUrlSelection-CFdknlTi.js} +1 -1
- package/dist/assets/useTemplateSave-BxTzxTH2.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-C33iQh-d.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BtWTuqL9.js} +2 -2
- package/dist/index.html +9 -9
- package/dist/server/addon.js +73 -21
- package/package.json +2 -2
- package/dist/assets/Addons-DbT3ta8z.js +0 -5
- package/dist/assets/Build-CyKLuVmF.js +0 -42
- package/dist/assets/Cluster-D24Q3gsy.js +0 -1
- package/dist/assets/Data-CI6UgZZY.js +0 -2
- package/dist/assets/DeviceDetail-D2CGNOL1.js +0 -2
- package/dist/assets/Devices-BuYYfNPu.js +0 -1
- package/dist/assets/EmbedDevicePage-BQ1tRNUp.js +0 -1
- package/dist/assets/History-D9RNBn7H.js +0 -1
- package/dist/assets/Identity-Dum55imC.js +0 -1
- package/dist/assets/InstancesTable-Bza_hcOv.js +0 -1
- package/dist/assets/IntegrationDetail-DT-ZanyO.js +0 -1
- package/dist/assets/Integrations-BpkEEhcd.js +0 -1
- package/dist/assets/Library-CqniXzi0.js +0 -1
- package/dist/assets/Locations-BnLjl50_.js +0 -3
- package/dist/assets/MyAccess-tguGEp30.js +0 -2
- package/dist/assets/Network-C9GshUgl.js +0 -1
- package/dist/assets/NodeAddonsSettingsPanel-YGDDqLon.js +0 -2
- package/dist/assets/Notifications-CpQ7WD8S.js +0 -1
- package/dist/assets/Pipeline-sfp8tOti.js +0 -1
- package/dist/assets/Recordings-zL4BQ-AD.js +0 -1
- package/dist/assets/SessionsList-B8py_Z_Y.js +0 -2
- package/dist/assets/client-DbkHdobd.js +0 -1119
- package/dist/assets/device-detail-DHAwENUJ.js +0 -1
- package/dist/assets/device-picker-model-BFaT-X3C.js +0 -1
- package/dist/assets/dist-CfWnzxgg.js +0 -1119
- package/dist/assets/i18n-CThuXMc5.js +0 -1
- package/dist/assets/index-Boq6U3AD.css +0 -2
- package/dist/assets/index-DUv1kIQf.js +0 -4
- package/dist/assets/mount-BFaT-X3C.js +0 -1
- package/dist/assets/remoteEntry-CN2LBUKI.js +0 -1
- package/dist/assets/src-CxMNFQ7c.js +0 -272
- package/dist/assets/useEventInvalidation-BFaT-X3C.js +0 -1
- package/dist/assets/useTemplateSave-B9ob9RKz.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -812,7 +812,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
812
812
|
return EventCategory;
|
|
813
813
|
}({});
|
|
814
814
|
//#endregion
|
|
815
|
-
//#region ../types/dist/composed-stable-id-
|
|
815
|
+
//#region ../types/dist/composed-stable-id-COP6zOXx.mjs
|
|
816
816
|
/**
|
|
817
817
|
import { errMsg } from '@camstack/types'
|
|
818
818
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -825,8 +825,6 @@ function errMsg(err) {
|
|
|
825
825
|
}
|
|
826
826
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
827
827
|
DeviceType["Camera"] = "camera";
|
|
828
|
-
/** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
|
|
829
|
-
DeviceType["Hub"] = "hub";
|
|
830
828
|
DeviceType["Light"] = "light";
|
|
831
829
|
DeviceType["Siren"] = "siren";
|
|
832
830
|
DeviceType["Switch"] = "switch";
|
|
@@ -5930,7 +5928,7 @@ var ZodIssueCode = {
|
|
|
5930
5928
|
var ZodFirstPartyTypeKind;
|
|
5931
5929
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5932
5930
|
//#endregion
|
|
5933
|
-
//#region ../types/dist/sleep-
|
|
5931
|
+
//#region ../types/dist/sleep-B5XPl2YP.mjs
|
|
5934
5932
|
/**
|
|
5935
5933
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5936
5934
|
* window to float samples (D455).
|
|
@@ -6586,7 +6584,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
|
|
|
6586
6584
|
try {
|
|
6587
6585
|
declaration = await host.declareOwner({
|
|
6588
6586
|
owner,
|
|
6589
|
-
metas: migrations.map((m) => m.meta)
|
|
6587
|
+
metas: migrations.map((m) => m.meta),
|
|
6588
|
+
...options.retired === void 0 ? {} : { retired: [...options.retired] }
|
|
6590
6589
|
});
|
|
6591
6590
|
} catch (err) {
|
|
6592
6591
|
log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
|
|
@@ -7970,6 +7969,14 @@ var BaseAddon = class {
|
|
|
7970
7969
|
declareRegistrySwitch(spec) {
|
|
7971
7970
|
this.registrySwitchSpec = spec;
|
|
7972
7971
|
}
|
|
7972
|
+
/**
|
|
7973
|
+
* Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
|
|
7974
|
+
* every declaration so the engine does not read their applied rows as a newer database.
|
|
7975
|
+
*/
|
|
7976
|
+
retiredMigrationIds = [];
|
|
7977
|
+
declareRetiredMigrations(ids) {
|
|
7978
|
+
this.retiredMigrationIds = ids;
|
|
7979
|
+
}
|
|
7973
7980
|
registrySwitchSpec = null;
|
|
7974
7981
|
registrySwitchBound() {
|
|
7975
7982
|
const spec = this.registrySwitchSpec;
|
|
@@ -7993,10 +8000,14 @@ var BaseAddon = class {
|
|
|
7993
8000
|
async runBound(declared, options) {
|
|
7994
8001
|
const added = this.registrySwitchBound();
|
|
7995
8002
|
const migrations = [...declared, ...added];
|
|
7996
|
-
const
|
|
8003
|
+
const widened = options?.only === void 0 || added.length === 0 ? options : {
|
|
7997
8004
|
...options,
|
|
7998
8005
|
only: [...options.only, ...added.map((m) => m.meta.id)]
|
|
7999
8006
|
};
|
|
8007
|
+
const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
|
|
8008
|
+
...widened,
|
|
8009
|
+
retired: this.retiredMigrationIds
|
|
8010
|
+
};
|
|
8000
8011
|
const api = this.ctx.api.migrations;
|
|
8001
8012
|
const report = await runAddonMigrations({
|
|
8002
8013
|
declareOwner: (input) => api.declareOwner.mutate(input),
|
|
@@ -9435,6 +9446,8 @@ var READING_QUANTITIES = [
|
|
|
9435
9446
|
"information",
|
|
9436
9447
|
"sound-level",
|
|
9437
9448
|
"signal-level",
|
|
9449
|
+
"signal-ratio",
|
|
9450
|
+
"frequency",
|
|
9438
9451
|
"colour-temperature",
|
|
9439
9452
|
"angle",
|
|
9440
9453
|
"bitrate",
|
|
@@ -9478,6 +9491,8 @@ var QUANTITY_BASE = {
|
|
|
9478
9491
|
information: "B",
|
|
9479
9492
|
"sound-level": "dBFS",
|
|
9480
9493
|
"signal-level": "dBm",
|
|
9494
|
+
"signal-ratio": "dB",
|
|
9495
|
+
frequency: "Hz",
|
|
9481
9496
|
"colour-temperature": "mired",
|
|
9482
9497
|
angle: "°",
|
|
9483
9498
|
bitrate: "kbps",
|
|
@@ -19432,6 +19447,10 @@ Object.freeze({
|
|
|
19432
19447
|
{
|
|
19433
19448
|
"path": "storage.dischargedTodayKwh",
|
|
19434
19449
|
"valueType": "number"
|
|
19450
|
+
},
|
|
19451
|
+
{
|
|
19452
|
+
"path": "storage.healthPct",
|
|
19453
|
+
"valueType": "number"
|
|
19435
19454
|
}
|
|
19436
19455
|
],
|
|
19437
19456
|
"enum-sensor": [{
|
|
@@ -19812,6 +19831,10 @@ Object.freeze({
|
|
|
19812
19831
|
"path": "isMuted",
|
|
19813
19832
|
"valueType": "boolean"
|
|
19814
19833
|
},
|
|
19834
|
+
{
|
|
19835
|
+
"path": "muteReadback",
|
|
19836
|
+
"valueType": "boolean"
|
|
19837
|
+
},
|
|
19815
19838
|
{
|
|
19816
19839
|
"path": "source",
|
|
19817
19840
|
"valueType": "string"
|
|
@@ -20748,7 +20771,7 @@ Object.freeze({
|
|
|
20748
20771
|
}
|
|
20749
20772
|
});
|
|
20750
20773
|
//#endregion
|
|
20751
|
-
//#region ../types/dist/implemented-methods-
|
|
20774
|
+
//#region ../types/dist/implemented-methods-0xxMOekw.mjs
|
|
20752
20775
|
/**
|
|
20753
20776
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
20754
20777
|
*
|
|
@@ -21932,7 +21955,7 @@ var NodeColorIdSchema = _enum([
|
|
|
21932
21955
|
"node-h"
|
|
21933
21956
|
]);
|
|
21934
21957
|
//#endregion
|
|
21935
|
-
//#region ../types/dist/convert-
|
|
21958
|
+
//#region ../types/dist/convert-BwMfbk5b.mjs
|
|
21936
21959
|
/**
|
|
21937
21960
|
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
21938
21961
|
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
@@ -22265,6 +22288,21 @@ var UNIT_TABLE = {
|
|
|
22265
22288
|
factor: 1,
|
|
22266
22289
|
offset: 0
|
|
22267
22290
|
},
|
|
22291
|
+
dB: {
|
|
22292
|
+
dimension: "signal-ratio",
|
|
22293
|
+
factor: 1,
|
|
22294
|
+
offset: 0
|
|
22295
|
+
},
|
|
22296
|
+
Hz: {
|
|
22297
|
+
dimension: "frequency",
|
|
22298
|
+
factor: 1,
|
|
22299
|
+
offset: 0
|
|
22300
|
+
},
|
|
22301
|
+
kHz: {
|
|
22302
|
+
dimension: "frequency",
|
|
22303
|
+
factor: 1e3,
|
|
22304
|
+
offset: 0
|
|
22305
|
+
},
|
|
22268
22306
|
mired: {
|
|
22269
22307
|
dimension: "colour-temperature",
|
|
22270
22308
|
factor: 1,
|
|
@@ -54370,6 +54408,12 @@ var MediaPlayerStatusSchema = object({
|
|
|
54370
54408
|
/** Mute toggle distinct from volume=0. Null when no mute surface.
|
|
54371
54409
|
* Pair with `DeviceFeature.MediaPlayerMute`. */
|
|
54372
54410
|
isMuted: boolean().nullable(),
|
|
54411
|
+
/**
|
|
54412
|
+
* True only when the provider READS the mute state back from the device.
|
|
54413
|
+
* Absent or false: mute is a momentary key. A non-null `isMuted` is not a
|
|
54414
|
+
* reading on its own — an infrared send can leave a value without this flag.
|
|
54415
|
+
*/
|
|
54416
|
+
muteReadback: boolean().optional(),
|
|
54373
54417
|
/** Active source / input. Empty when no source surface. */
|
|
54374
54418
|
source: string(),
|
|
54375
54419
|
/** Selectable sources. Empty when no source surface.
|
|
@@ -54675,7 +54719,7 @@ DeviceType.MediaPlayer, optionalMethod(deviceOnly, _void(), {
|
|
|
54675
54719
|
}]
|
|
54676
54720
|
}]
|
|
54677
54721
|
});
|
|
54678
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.
|
|
54722
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, 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.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;
|
|
54679
54723
|
var NUMBER = {
|
|
54680
54724
|
kind: "fixed",
|
|
54681
54725
|
result: ["number"]
|
|
@@ -58527,7 +58571,7 @@ var TransitionsStatusSchema = object({
|
|
|
58527
58571
|
/** Refused rows since start, by reason. */
|
|
58528
58572
|
refused: record(string(), number$1())
|
|
58529
58573
|
});
|
|
58530
|
-
Object.values(DeviceType).filter((type) => type !== DeviceType.
|
|
58574
|
+
Object.values(DeviceType).filter((type) => type !== DeviceType.Container), method(object({
|
|
58531
58575
|
deviceId: number$1().int(),
|
|
58532
58576
|
capName: string().optional(),
|
|
58533
58577
|
actorKind: TransitionActorKindSchema.optional(),
|
|
@@ -59561,7 +59605,9 @@ var EnergyStorageSchema = object({
|
|
|
59561
59605
|
/** Lifetime discharged, kWh. */
|
|
59562
59606
|
dischargedKwh: number$1().nullable().meta(readingMeta("energy")),
|
|
59563
59607
|
chargedTodayKwh: number$1().nullable().meta(readingMeta("energy")),
|
|
59564
|
-
dischargedTodayKwh: number$1().nullable().meta(readingMeta("energy"))
|
|
59608
|
+
dischargedTodayKwh: number$1().nullable().meta(readingMeta("energy")),
|
|
59609
|
+
/** State of health, 0..100. Null when the system did not report it. */
|
|
59610
|
+
healthPct: number$1().nullable().meta(readingMeta("percentage"))
|
|
59565
59611
|
});
|
|
59566
59612
|
object({
|
|
59567
59613
|
solar: EnergySolarSchema.nullable(),
|
|
@@ -61564,7 +61610,7 @@ var HeroSceneSchema = object({
|
|
|
61564
61610
|
/** 0..1: volume, cover position, cycle progress. */
|
|
61565
61611
|
level: number$1().min(0).max(1).nullable()
|
|
61566
61612
|
});
|
|
61567
|
-
DeviceType.Camera, DeviceType.
|
|
61613
|
+
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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
61568
61614
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
61569
61615
|
var HeroRowIdSchema = _enum([
|
|
61570
61616
|
"progress",
|
|
@@ -61925,7 +61971,7 @@ var HeroModelSchema = object({
|
|
|
61925
61971
|
*
|
|
61926
61972
|
* - `extras` are the further inline controls of the types that carry more than one
|
|
61927
61973
|
* ({@link ROW_EXTRAS_BY_TYPE}): climate setpoint, a robot's return to base,
|
|
61928
|
-
* a player's volume and remote. Each is a control the model already has, named by id,
|
|
61974
|
+
* a player's volume and remote, an automation's enabled switch. Each is a control the model already has, named by id,
|
|
61929
61975
|
* in that order and at most {@link ROW_EXTRAS_MAX}; one the model lacks, or lists in
|
|
61930
61976
|
* `gated`, is absent, and the one `primary` already is never repeats. Empty = the
|
|
61931
61977
|
* row of an older server: `primary` alone.
|
|
@@ -61985,7 +62031,7 @@ new Set([
|
|
|
61985
62031
|
"valve"
|
|
61986
62032
|
]);
|
|
61987
62033
|
DeviceType.Climate;
|
|
61988
|
-
DeviceType.Climate, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer;
|
|
62034
|
+
DeviceType.Climate, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.Automation;
|
|
61989
62035
|
/**
|
|
61990
62036
|
* hero-layout — what a device's hero says (D1023). Read-only: the FIXED
|
|
61991
62037
|
* layouts live in `@camstack/types` and nothing here stores or edits one.
|
|
@@ -65693,7 +65739,9 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
65693
65739
|
auth: "admin"
|
|
65694
65740
|
}), method(object({
|
|
65695
65741
|
owner: string().min(1),
|
|
65696
|
-
metas: array(MigrationMetaSchema)
|
|
65742
|
+
metas: array(MigrationMetaSchema),
|
|
65743
|
+
/** Ids the owner deliberately removed: an applied row of one is fine, never "newer". */
|
|
65744
|
+
retired: array(string().min(1)).optional()
|
|
65697
65745
|
}), object({
|
|
65698
65746
|
bootId: string(),
|
|
65699
65747
|
snapshot: _enum([
|
|
@@ -85681,7 +85729,7 @@ var AccessoryKind = {
|
|
|
85681
85729
|
};
|
|
85682
85730
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
85683
85731
|
DeviceType.HeatPump;
|
|
85684
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.
|
|
85732
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
85685
85733
|
new Set(Object.values(DeviceType));
|
|
85686
85734
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
85687
85735
|
function contribution(cap, schema, build) {
|
|
@@ -87395,7 +87443,11 @@ var temperatureContribution = contribution("temperature-sensor", TemperatureSens
|
|
|
87395
87443
|
var humidityContribution = contribution("humidity-sensor", HumiditySensorStatusSchema, (slice) => measured(sensorFragment(slice?.humidity ?? null, "humidity", "droplets", "Humidity", "Umidità", `${Math.round(slice?.humidity ?? 0)}%`), slice?.humidity == null ? emptyMeasurement("humidity") : humidityMeasurement(slice.humidity, slice.lastFetchedAt)));
|
|
87396
87444
|
var pressureContribution = contribution("pressure-sensor", PressureSensorStatusSchema, (slice) => sensorFragment(slice?.pressure ?? null, "pressure", "gauge", "Pressure", "Pressione", `${Math.round(slice?.pressure ?? 0)} hPa`));
|
|
87397
87445
|
var illuminanceContribution = contribution("ambient-light-sensor", AmbientLightSensorStatusSchema, (slice) => sensorFragment(slice?.illuminance ?? null, "illuminance", "sun", "Light", "Luce", `${Math.round(slice?.illuminance ?? 0)} lx`));
|
|
87398
|
-
var numericContribution = contribution("numeric-sensor", NumericSensorStatusSchema, (slice) =>
|
|
87446
|
+
var numericContribution = contribution("numeric-sensor", NumericSensorStatusSchema, (slice, ctx) => {
|
|
87447
|
+
const unit = ctx.quantity == null ? void 0 : baseUnitOf(ctx.quantity);
|
|
87448
|
+
const text = String(Number((slice?.value ?? 0).toFixed(2)));
|
|
87449
|
+
return sensorFragment(slice?.value ?? null, "reading", "gauge", "Value", "Valore", unit === void 0 ? text : `${text} ${unit}`);
|
|
87450
|
+
});
|
|
87399
87451
|
var enumContribution = contribution("enum-sensor", EnumSensorStatusSchema, (slice) => {
|
|
87400
87452
|
if (slice === void 0 || slice.value === "") return measured({ reading: reading("sensor", "unknown") }, emptyMeasurement("text"));
|
|
87401
87453
|
if (slice.timestamp === true) return { reading: reading("sensor", "on") };
|
|
@@ -87722,7 +87774,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
|
|
|
87722
87774
|
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
87723
87775
|
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
87724
87776
|
];
|
|
87725
|
-
DeviceType.Camera, DeviceType.
|
|
87777
|
+
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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
87726
87778
|
/**
|
|
87727
87779
|
* Who looks like what (D1023). One look per {@link DeviceType}, refined by a
|
|
87728
87780
|
* {@link DeviceRole} where the role changes how the device reads (a leak
|
|
@@ -88366,7 +88418,7 @@ lookOf({
|
|
|
88366
88418
|
standby: MUTED
|
|
88367
88419
|
});
|
|
88368
88420
|
DeviceType.Climate;
|
|
88369
|
-
DeviceType.Camera, DeviceType.
|
|
88421
|
+
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.HeatPump, DeviceType.EnergySystem, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
88370
88422
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
88371
88423
|
Object.freeze({
|
|
88372
88424
|
"accessories.getStatus": {
|
|
@@ -98837,7 +98889,7 @@ function offered(received) {
|
|
|
98837
98889
|
};
|
|
98838
98890
|
}
|
|
98839
98891
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
98840
|
-
DeviceType.Camera, DeviceType.
|
|
98892
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, 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.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
98841
98893
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
98842
98894
|
new Set(Object.values(DeviceType));
|
|
98843
98895
|
new Set(Object.values(DeviceRole));
|
|
@@ -103367,7 +103419,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
103367
103419
|
capability: adminUiCapability,
|
|
103368
103420
|
provider: {
|
|
103369
103421
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
103370
|
-
getVersion: async () => ({ version: "1.2.
|
|
103422
|
+
getVersion: async () => ({ version: "1.2.666" })
|
|
103371
103423
|
}
|
|
103372
103424
|
}];
|
|
103373
103425
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-admin-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.666",
|
|
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.
|
|
53
|
+
"server": ">=1.2.865"
|
|
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{$i as d,$t as f,Cn as p,Ct as m,Hi as h,Pi as g,Pn as _,Pr as v,Q as y,Qn as b,Rn as x,Ut as S,Xi as C,Yt as w,ct as ee,fr as te,ot as ne,qn as T,ut as E,vi as re,zn as D}from"./player-overlays-D-xr6JNm.js";import{Ec as O}from"./client-DbkHdobd.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,Ai as oe,Ba as se,Ei as ce,Fa as le,Ha as ue,Hr as j,Ia as M,Ja as N,Ka as de,La as fe,Ma as pe,Na as P,Oc as me,Oi as he,Pa as F,Qa as I,Ra as L,Sl as ge,Ti as R,Ua as z,Ur as B,Va as V,Vr as _e,Wa as ve,Wr as H,Xr as U,Ya as ye,Za as be,ir as xe,ja as W,ka as Se,kf as Ce,ki as we,pt as Te,qa as Ee,qf as De,rr as Oe,rt as ke,vp as Ae,wi as G,xp as je,zf as K}from"./src-CxMNFQ7c.js";import{t as q}from"./useTranslation-BJr-n0es.js";import"./mount-BFaT-X3C.js";import{at as Me,ci as Ne,fi as Pe,mi as Fe,ot as Ie}from"./index-DUv1kIQf.js";import{t as J}from"./AdminPage-DjU_tnVG.js";import{i as Le,r as Re,t as ze}from"./addon-kind-filter-CEGKkC1O.js";import{t as Y}from"./NodeAddonsSettingsPanel-YGDDqLon.js";import{n as X,r as Be,t as Ve}from"./useNodeUrlSelection-CH8FI53M.js";function He(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 Ue={queued:{icon:g,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:v,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:T,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:k,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function Z({item:e}){let{t:n}=q(),r=Ue[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 Q=new Set([`completed`,`failed`,`partially-failed`,`cancelled`]),We=new Set([`done`,`failed`,`skipped`]);function Ge(e){return!We.has(e.phase)&&!Q.has(e.jobState)}function Ke(e,t){let n=new Map,r=[...e].sort((e,t)=>e.createdAtMs-t.createdAtMs);for(let e of r){let r=Q.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 qe(){let{data:e}=V({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=je(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 Ke([...n.values()],Date.now())},[e,t])}var Je={queued:{icon:g,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:v,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:v,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:v,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:v,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:v,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:v,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:k,cls:`bg-danger/10 text-danger`,labelKey:`addons.jobProgress.failed`},skipped:{icon:p,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function Ye({progress:e}){let{t:n}=q(),r=Je[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 Xe(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 Ze(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function Qe(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(Ze)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function $e(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}=q(),c=l(),u=ee(),d=ne(),p=se(nt,{staleTime:rt}),m=p.data?.installations??[],h=(p.data?.unreachable??[]).map(e=>e.nodeId),g=Xe(m,e),_=e=>g.find(t=>t.nodeId===e)?.nodeName??(e===r.id?r.name:e),v=I({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?s(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:n}):s(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:n}),message:tt(e,_),variant:e.success?`default`:`danger`})},b=async t=>{try{await y(await v.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`})}},x=async()=>{let e=g.filter(e=>e.nodeId!==r.id);await u({title:s(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:n,name:r.name}),message:$e(n,r.name,e),confirmLabel:s(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await b(r.isHub?{}:{nodeId:r.id})},S=async()=>{let t=(await p.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=Xe(t.installations,e);await u({title:s(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:n}),message:Qe(n,r,t.unreachable.map(e=>e.nodeId)),confirmLabel:s(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await b({everywhere:!0})},C=v.isPending||o===!0;return t(`div`,{className:`flex items-center gap-1.5`,children:[i!==!0&&t(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:C,className:it,title:s(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:r.name}),children:[a(f,{className:`h-3 w-3`}),v.isPending?s(`addons.addonUninstallControls.removing`,`Removing...`):s(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(g.length>1||i===!0||h.length>0)&&t(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),S()},disabled:C,className:it,title:s(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[a(A,{className:`h-3 w-3`}),g.length>0?s(`addons.uninstallControls.everywhereCount`,{count:g.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:f}=q(),p=r===`upload`||r===`local`,[h,g]=s(!1),{data:_,isLoading:y,isError:b}=M({name:e}),x=_?st(_,h):[],C=_?ct(_):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:f(`addons.versionPicker.versions`,`Versions`)}),a(K,{variant:`unstyled`,type:`button`,onClick:o,className:`text-foreground-subtle hover:text-foreground`,children:a(m,{className:`h-3 w-3`})})]}),p&&t(`div`,{className:`flex items-start gap-2 px-3 py-2 border-b border-border bg-cyan-500/10 text-[10px]`,children:[a(S,{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:f(`addons.versionPicker.inPlace`,{kind:r===`upload`?f(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):f(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,a(Ne,{i18nKey:`addons.versionPicker.reinstall`,values:{version:n},components:{mono:a(`span`,{className:`font-mono`})}})]})]}),y&&t(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[a(v,{className:`h-3.5 w-3.5 animate-spin`}),f(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),b&&a(`div`,{className:`px-3 py-4 text-center text-[10px] text-danger`,children:f(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),x.length>0&&a(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:x.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),p=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:f(`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:f(`common.deprecated`)}),a(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return c?t(K,{variant:`unstyled`,type:`button`,"aria-label":f(`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:[p,o?a(d,{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:[p,a(K,{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?f(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):f(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:a(re,{className:`h-3 w-3`})})]},e.version)})}),!y&&!b&&_&&_.length===0&&a(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:f(`addons.versionPicker.noVersionsFound`,`No versions found`)}),C>0&&a(K,{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:()=>g(e=>!e),children:h?f(`addons.versionPicker.hideOlder`,`Hide older versions`):f(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:C})})]})}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,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=r&&i?y(`/api/addon-assets/${r}/${i}`):null,p=!!f&&!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?``:d}`,style:u,children:p?a(`img`,{src:f,alt:r,className:`h-4 w-4`,onError:()=>l(!0)}):a(e?te:b,{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(S,{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}=q();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(v,{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(K,{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(re,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),t(K,{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(K,{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`}=pe({addonId:e}),r=N({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(K,{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:f,isUpdating:p,jobProgress:h,bundle:g,bulkItem:v,disabledByBulk:y,isSystem:b,selectedNode:x}){let{t:S}=q(),[w,ee]=s(!1),[ne,E]=s(!1),[re,O]=s(null);o(()=>{O(null)},[i]);let A=re??i,[ae,se]=s(!1),[le,ue]=s(!1),[j,M]=s(`logs`),N=l(),pe=Pe(),{manifest:P}=e,me=!g&&!P.protected&&P.removable!==!1,F=!!g,I=g?.displayName??P.name,L=g?.packageName??P.packageName,ge=g?.version??P.packageVersion??P.version,z=g?.installSource??e.installSource,B=g?g.bundle?.description??g.addons[0]?.manifest.description:P.description,V=ve({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]})}}),_e=fe({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`addonPages`]]}),N.invalidateQueries({queryKey:[[`capabilities`]]}),N.invalidateQueries({queryKey:[[`integrations`]]})}}),H=de({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`alerts`]]})}}),U=e.health,ye=U?.phase===`failed`&&!U.inGracePeriod,be=ye&&U?.nextRetryAt&&!U.retrying,W=He(e.process);return t(`div`,{className:`rounded-md border bg-surface overflow-hidden ${ye?`border-red-500/50`:`border-border`}`,children:[ye&&U&&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:S(`addons.addonCard.failedToLoad`,{attempt:U.retryCount})}),a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:U.lastError?.message??S(`addons.addonCard.unknownError`,`Unknown error`)}),be&&U.nextRetryAt&&a(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:S(`addons.addonCard.autoRetryAt`,{time:new Date(U.nextRetryAt).toLocaleTimeString()})})]}),t(K,{variant:`unstyled`,type:`button`,disabled:H.isPending||U.retrying,onClick:e=>{e.stopPropagation(),H.mutate({packageName:L})},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:S(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[a(T,{className:`h-3 w-3 ${H.isPending||U.retrying?`animate-spin`:``}`}),S(`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:S(`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:F||!!P.components&&P.components.length>1,installSource:z,addonId:F?g.addons[0]?.manifest.id:P.id,iconPath:F?g.bundle?.icon??g.addons[0]?.manifest.icon:P.icon,color:F?g.addons[0]?.manifest.color:P.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:I}),!r&&a(mt,{version:ge,availableUpdate:i,...A===void 0?{}:{selectedVersion:A},isUpdating:p,installSource:z,disabled:y,...f&&A!==void 0?{onUpdate:()=>f(A)}:{},onOpenPicker:()=>E(e=>!e),children:ne&&a(lt,{packageName:L,currentVersion:ge,...z?{installSource:z}:{},...i!==void 0&&A!==void 0?{selectedVersion:A,onSelect:e=>{O(e),E(!1)}}:{},onInstall:e=>{E(!1),_e.mutate({packageName:L,version:e})},onClose:()=>E(!1)})})]}),t(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[L!==I&&a(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:L}),F&&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`}),g.addons.length]}),b&&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:S(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[a(T,{className:`h-3 w-3`}),S(`addons.addonCard.system`,`System`)]}),v!=null&&a(Z,{item:v}),c!==void 0&&a(Ce,{variant:`warning`,title:S(`addons.addonCard.updateHeldTitle`,{defaultValue:`{{latest}} is held until the server is {{required}} or newer`,latest:c.latestVersion,required:c.requiredServer}),children:S(`addons.addonCard.requiresServer`,{defaultValue:`requires server ≥ {{version}}`,version:c.requiredServer})}),c!==void 0&&d!==void 0&&a(K,{type:`button`,size:`sm`,variant:`secondary`,onClick:d,children:S(`clusterUpdate.updateServer`,`Update server`)}),h!=null&&a(Ye,{progress:h})]}),B&&a(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:B}),!F&&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`?S(`addons.addonCard.forked`):S(`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})]})]})]}),!F&&t(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[t(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),V.mutate({addonId:P.id})},disabled:V.isPending||y,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(T,{className:`h-3 w-3 ${V.isPending?`animate-spin`:``}`}),S(`addons.addonCard.restart`,`Restart`)]}),t(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),se(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(D,{className:`h-3 w-3`}),S(`addons.addonCard.logs`,`Logs`)]}),!F&&t(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),ue(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${le?`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(_,{className:`h-3 w-3`}),S(`addons.addonCard.settings`,`Settings`)]}),a(`div`,{className:`flex-1`}),me&&a(at,{packageName:P.packageName,displayName:P.name,selectedNode:x??gt,disabled:y})]}),n&&n.nodes.length>1&&!F&&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:S(`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:S(`addons.addonCard.outdated`)}),e.status===`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:S(`common.offline`)}),e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] text-success`,children:S(`common.synced`)})]},e.nodeId))})]}),ae&&!F&&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(K,{variant:`unstyled`,type:`button`,onClick:()=>M(`logs`),className:`px-2 py-0.5 transition-colors ${j===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.logs`,`Logs`)}),a(K,{variant:`unstyled`,type:`button`,onClick:()=>M(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${j===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:S(`addons.addonCard.events`,`Events`)})]}),a(`div`,{className:`flex-1`}),a(K,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),se(!1)},className:`text-foreground-subtle hover:text-foreground`,children:a(m,{className:`h-3.5 w-3.5`})})]}),j===`logs`&&a(xe,{addonId:P.id,maxHeight:`max-h-64`,showFilters:!1}),j===`events`&&a(Oe,{addonId:P.id,category:`addon.*`,maxHeight:`max-h-64`})]}),F&&t(u,{children:[a(K,{variant:`unstyled`,type:`button`,onClick:()=>ee(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?C: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:g.addons.map(e=>a(_t,{addon:e,hideVersion:!0},e.manifest.id))})]}),le&&!F&&a(G,{open:!0,onOpenChange:e=>!e&&ue(!1),children:t(ce,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(we,{children:t(oe,{className:`flex items-center gap-2`,children:[a(_,{className:`h-4 w-4 text-primary`}),S(`addons.addonCard.settingsTitle`,{name:I})]})}),t(R,{className:`space-y-4`,children:[a(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:S(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),a(Y,{nodeId:null,addonIds:[P.id],level:`global`,fieldScope:`cluster`,emptyMessage:S(`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(P)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.deviceExport`,`Device export`)}),a(Te,{addonId:P.id,onOpenDevice:e=>pe(`/devices/${e}`)})]}),ft(z)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.autoUpdate`,`Auto-Update`)}),a(ht,{addonId:P.id})]}),P.components&&P.components.length>0&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:S(`addons.addonCard.components`,{count:P.components.length})}),a(`div`,{className:`flex flex-wrap gap-1`,children:P.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(he,{children:a(K,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>ue(!1),children:S(`common.close`,`Close`)})})]})})]})}c();var vt=`.tgz,.tar.gz,.zip`;function yt({onUploadSuccess:e}){let{t:r}=q(),[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(y(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{c(!1)}},[e]);return t(u,{children:[a(U,{ref:l,accept:vt,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),t(K,{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(v,{className:`w-3.5 h-3.5 animate-spin`}):a(S,{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}=q();return e?t(`div`,{className:`flex items-center gap-2 py-6 text-xs text-foreground-subtle`,children:[a(v,{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}=q(),[l,u]=s(e.version),[d,f]=s(!1),p=M({name:e.name}),m=le({name:e.name,version:l}),h=p.data??[],g=ct(h),_=Dt(h,l,d),y=m.data;return a(G,{open:!0,onOpenChange:e=>!e&&i(),children:t(ce,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(we,{children:a(oe,{children:c(`addons.installDialog.title`,`Install {{name}}`,{name:Et(e.name)})})}),t(R,{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(E,{"aria-label":c(`addons.installDialog.version`,`Version`),value:l,options:_.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.`)}),g>0&&a(K,{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:g})})]}),t(_e,{defaultValue:`readme`,children:[t(B,{children:[a(H,{value:`readme`,children:c(`addons.installDialog.readme`,`README`)}),a(H,{value:`changelog`,children:c(`addons.installDialog.changelog`,`CHANGELOG`)})]}),a(j,{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(j,{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(he,{children:[a(K,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:c(`common.cancel`,`Cancel`)}),a(K,{type:`button`,size:`sm`,disabled:n||l.length===0,onClick:()=>o(e.name,l),children:n?a(v,{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||Ie(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}=q(),{data:r}=se(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(w,{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}=q();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(Ce,{variant:`success`,icon:a(d,{className:`h-3 w-3`}),children:e.installedVersion??i(`system.capabilityCatalog.installed`,`Installed`)}):t(K,{size:`sm`,onClick:()=>r(e),disabled:n,className:`shrink-0`,children:[n?a(v,{className:`h-3 w-3 animate-spin`}):a(re,{className:`h-3 w-3`}),i(`system.capabilityCatalog.install`,`Install`)]})]})}function Nt({capability:e,installing:n,onInstall:r}){let{t:i}=q(),{data:o,isPending:s,isError:c}=Ee({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(v,{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}=q(),g=l(),[_,y]=s(``),[b,S]=s(!1),C=e(_),[w,te]=s(!1),ne=n(null);o(()=>{if(!w)return;let e=e=>{ne.current&&!ne.current.contains(e.target)&&te(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[w]);let{data:D}=ue({nodeId:d.id}),O=r(()=>{let e=new Map;for(let t of D??[])t.blockedBy===void 0&&e.set(t.name,t.latestVersion);return e},[D]),ie=r(()=>{let e=new Map;for(let t of D??[]){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},[D]),k=r(()=>(D??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0).length,[D]),[A,oe]=s(()=>new Set),[se,ce]=s(()=>new Map),le=i(e=>{oe(t=>new Set(t).add(e))},[]),j=i(e=>{oe(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),M=i((e,t)=>{ce(n=>new Map(n).set(e,t))},[]),N=i(e=>{ce(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),de=ae({onMutate:e=>{le(e.name),N(e.name)},onSuccess:(e,t)=>{j(t.name);let n=e;if(n&&n.success===!1){M(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)=>{j(t.name),M(t.name,e instanceof Error?e.message:String(e))}}),pe=qe(),he=n(new Set);o(()=>{let e=new Set;for(let[t,n]of pe)Ge(n)&&e.add(t);let t=[...he.current].some(t=>!e.has(t));he.current=e,t&&(g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[pe,g]);let{data:I}=P(void 0),L=Se({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),ge=ye({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:R,isFetching:z}=Ee({query:C||void 0},{enabled:w}),B=be(),{data:V}=F(void 0),_e=V?.requestedAt,[ve,H]=s(null),[U,xe]=s(!1);o(()=>{if(V?.kind===`framework-bulk-update`&&V.requestedAt!==ve){H(V.requestedAt),xe(!0);let e=window.setTimeout(()=>xe(!1),6e3);return()=>window.clearTimeout(e)}},[_e,ve,V]),ee();let W=i(async()=>{let e=(D??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0);if(e.length!==0){if(!d.isHub){for(let t of e)await de.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]})}},[D,d.id,d.isHub,B,de]),[Ce,we]=s(null),[Te,Oe]=s(null),ke=e=>{Oe(null),we(e)},Ae=fe({onSuccess:()=>{we(null),Oe(null),g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addonPages`]]}),g.invalidateQueries({queryKey:[[`capabilities`]]}),g.invalidateQueries({queryKey:[[`integrations`]]})},onError:e=>{Oe(e instanceof Error?e.message:`Install failed`)}}),[G,je]=s(`type`),[Ne,Pe]=s(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Ie=e=>{Pe(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[J,Y]=Fe(),X=J.get(`capability`),Ve=J.get(`updatable`)===`1`,Ue=J.get(`error`)===`1`,Z=Pt(J.get(`source`)),Q=Le(J.get(ze))===`integration`,{data:We}=me(void 0,{enabled:Q}),Ke=r(()=>We===void 0?null:new Set(We.map(e=>e.addonId)),[We]),Je=i(e=>{let t=new URLSearchParams(J);e?t.set(ze,`integration`):t.delete(ze),Y(t,{replace:!0})},[J,Y]),Ye=i(e=>{let t=new URLSearchParams(J);e?t.set(`updatable`,`1`):t.delete(`updatable`),Y(t,{replace:!0})},[J,Y]),Xe=i(e=>{let t=new URLSearchParams(J);e?t.set(`error`,`1`):t.delete(`error`),Y(t,{replace:!0})},[J,Y]),Ze=i(e=>{let t=new URLSearchParams(J);e===null?t.delete(`source`):t.set(`source`,e),Y(t,{replace:!0})},[J,Y]),Qe=r(()=>c.filter(e=>He(e.process)!==null).length,[c]),$e=r(()=>{let e=c.filter(e=>!Me(e.manifest.packageName));return d.isHub||(e=e.filter(e=>zt(e.placement,d.isHub))),X&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===X))),Q&&(e=[...Re(e,Ke)]),Ve&&(e=e.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&O.has(t)})),Z!==null&&(e=e.filter(e=>Bt(e.installSource)===Z)),Ue&&(e=e.filter(e=>He(e.process)!==null)),e},[c,d.isHub,X,Ve,Z,Ue,Q,Ke,O]),et=()=>{let e=new URLSearchParams(J);e.delete(`capability`),Y(e,{replace:!0})},tt=Ne===`flat`?$e:Ht($e),nt=r(()=>{let e=[...tt];switch(G){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,G]);return t(`div`,{className:`space-y-3`,children:[a(Be,{open:b,onOpenChange:S}),[...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(K,{variant:`unstyled`,type:`button`,onClick:()=>N(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(E,{wrapperClassName:`inline-block w-auto`,value:G,onChange:e=>je(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(K,{variant:`unstyled`,type:`button`,onClick:()=>Ie(e),className:`px-2 py-1 transition-colors capitalize ${Ne===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(T,{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(K,{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(E,{wrapperClassName:`inline-block w-auto`,className:`font-medium text-foreground-subtle`,value:I?.updateCheckIntervalSeconds??21600,disabled:ge.isPending||I===void 0,onChange:e=>{I!==void 0&&ge.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(K,{variant:`unstyled`,type:`button`,onClick:()=>void W(),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(v,{className:`w-3 h-3 animate-spin`}):a(re,{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:Q,toggle:()=>Je(!Q)},{id:`updatable`,label:m(`admin.system.addons.updatable`,`Updatable`),pressed:Ve,toggle:()=>Ye(!Ve)},{id:`error`,label:m(`admin.system.addons.inError`,`In error ({{count}})`,{count:Qe}),pressed:Ue,toggle:()=>Xe(!Ue)},{id:`npm`,label:`npm`,pressed:Z===`npm`,toggle:()=>Ze(Z===`npm`?null:`npm`)},{id:`dev`,label:m(`admin.system.addons.dev`,`Dev`),pressed:Z===`dev`,toggle:()=>Ze(Z===`dev`?null:`dev`)}].map(e=>a(K,{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(De,{type:`text`,searchHotkey:!0,value:_,onChange:e=>{y(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(x,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:z?a(v,{className:`h-3 w-3 animate-spin`}):void 0}),w&&R&&R.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:[R.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:R.length})}),R&&R.length>0&&a(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:R.map(e=>a(Mt,{addon:e,installing:Ae.isPending,onInstall:e=>ke({name:e.name,version:e.version,description:e.description})},e.name))})]})]}),a(yt,{onUploadSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),f()}})]}),X&&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:X}),a(K,{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`)})]}),X&&a(Nt,{capability:X,installing:Ae.isPending,onInstall:e=>ke({name:e.name,version:e.version,description:e.description})}),X&&$e.length>0&&a(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:m(`admin.system.addons.installed`,`Installed`)}),U&&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(h,{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(v,{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`&&$e.length===0&&a(`div`,{className:`text-xs text-foreground-subtle`,children:c.length===0?m(`admin.system.addons.noAddonsInstalled`,`No addons installed`):X?m(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:X}):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=>de.mutate({name:t,version:e,nodeId:d.id}):void 0,s=pe.get(t)??null,c=s!==null&&Ge(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:()=>S(!0)},isUpdating:A.has(t)||c,jobProgress:s,onUpdate:o,disabledByBulk:B.isPending,selectedNode:d},$(e)?t:e.manifest.id)})}),Ce!==null&&a(kt,{target:Ce,installing:Ae.isPending,installError:Te,onClose:()=>we(null),onInstall:(e,t)=>Ae.mutate({packageName:e,version:t})})]})}function Wt(){let{t:e}=q(),r=l(),{data:i}=ge(void 0),{nodes:s}=Ae(),{selection:c,selectNode:u,requestedNodeId:d}=Ve(s.length>0?s:[Rt]),f=c.node??Rt,p=f.id,m=s.length>0?c.staleNodeId:null,{data:h,isLoading:g,isError:_}=L({nodeId:p}),v=W(),y=z(),b=v.isPending||y.isPending,x=async()=>{await v.mutateAsync({nodeId:p}),await y.mutateAsync(),r.invalidateQueries({queryKey:[[`addons`]]})},S=n(v);S.current=v;let C=n(d??`hub`);o(()=>{S.current.mutate({nodeId:C.current})},[]);let w=(h??[]).map(Vt).filter(e=>e!==null);return t(J,{children:[t(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[a(ke,{selectedNodeId:p,onSelect:u}),t(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[!g&&!_&&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(K,{variant:`unstyled`,type:`button`,onClick:()=>void x(),disabled:b,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(T,{className:`w-3 h-3 ${b?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),a(X,{staleNodeId:m,shownNodeName:f.name}),a(jt,{selectedNode:f}),a(Ut,{addons:w,clusterStatus:i,selectedNode:f,onRefresh:()=>void x(),listPhase:g?`pending`:_?`error`:`ready`})]})}export{Wt as AddonsPage};
|