@camstack/addon-admin-ui 1.2.703 → 1.2.704
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 +6 -0
- package/dist/assets/{AccessSection-BGohJFsQ.js → AccessSection-Bbp4vCnK.js} +1 -1
- package/dist/assets/Addons-BfskS1ar.js +5 -0
- package/dist/assets/{AdminPage-fCxxHmc-.js → AdminPage-Dyd6hYl8.js} +1 -1
- package/dist/assets/{AdminSectionedPage-DDqDbMM3.js → AdminSectionedPage-DvahmWYI.js} +1 -1
- package/dist/assets/{AiProfiles-BFi1Kn6N.js → AiProfiles-Di4CMSTf.js} +2 -2
- package/dist/assets/Archive-B10-SsQm.js +1 -0
- package/dist/assets/{BootstrapSettingsForm-BLWj6csX.js → BootstrapSettingsForm-Cm4-eDgP.js} +1 -1
- package/dist/assets/Build-CG3kxG-Q.js +40 -0
- package/dist/assets/{Calendars-Cxw9P8Uq.js → Calendars-BDDqqhdh.js} +1 -1
- package/dist/assets/{Cluster-BwIvlnpz.js → Cluster-BQ_N__Tz.js} +1 -1
- package/dist/assets/CompositionBlockEditor-CAYxLM7D.js +2 -0
- package/dist/assets/{CompositionEditorPage-DRISSQzb.js → CompositionEditorPage-DX3tmg77.js} +1 -1
- package/dist/assets/Data-DdKvcS20.js +2 -0
- package/dist/assets/{DeviceDetail-BzGdZ7Q_.js → DeviceDetail-DHBkE6sd.js} +1 -1
- package/dist/assets/{Devices-CdmWPr7S.js → Devices-BzdO_WfX.js} +1 -1
- package/dist/assets/{EmbedDevicePage-CfSj9caC.js → EmbedDevicePage-Cyos8BBm.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-DEP8gdti.js → EmbedPlayerPage-Cl2Qja7R.js} +1 -1
- package/dist/assets/{History-Bg9tQAqJ.js → History-CDCxEudX.js} +1 -1
- package/dist/assets/{Identity-Oyg78Wgg.js → Identity-C-NUjzGa.js} +1 -1
- package/dist/assets/InstancesTable-CLf8XbQo.js +1 -0
- package/dist/assets/IntegrationDetail-BLtGoHv4.js +1 -0
- package/dist/assets/{Integrations-wpQtKhSO.js → Integrations-D0p7b6sg.js} +1 -1
- package/dist/assets/{Integrations-Bpw7S0et.js → Integrations-DKh9soI8.js} +2 -2
- package/dist/assets/Library-C5NOjKCt.js +1 -0
- package/dist/assets/Locations-CIm3Q3i3.js +3 -0
- package/dist/assets/Logs-BdYjeDAx.js +1 -0
- package/dist/assets/{MaskShapeCanvas-DATKwWoi.js → MaskShapeCanvas-drW0ZeaQ.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BrUyigty.js → MotionZonesSettings-VF9WJZWR.js} +1 -1
- package/dist/assets/{MyAccess-DTWeghN4.js → MyAccess-bBE9o8UP.js} +1 -1
- package/dist/assets/{Network-CzBJb8Ro.js → Network-CgYpqnsc.js} +1 -1
- package/dist/assets/{NewExportModal-DC6qeg0K.js → NewExportModal-CsSL-XDz.js} +1 -1
- package/dist/assets/NodeAddonsSettingsPanel-DNmMoeS5.js +1 -0
- package/dist/assets/Notifications-CAl9PqU3.js +1 -0
- package/dist/assets/{PanelContent-Cqel4gq_.js → PanelContent-Cg1LPl_m.js} +2 -2
- package/dist/assets/Pipeline-ffZklufq.js +1 -0
- package/dist/assets/{PrivacyMaskSettings-jcKOGH_r.js → PrivacyMaskSettings-D-43rQlu.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-HfoxsYJf.js → SceneMonitorEditor-CIMZOhg6.js} +1 -1
- package/dist/assets/SessionsList-BPJsMXCC.js +2 -0
- package/dist/assets/{Showroom-BgfY_eRn.js → Showroom-DrnOtUc4.js} +1 -1
- package/dist/assets/{StorageLocationsTable-CbwL3VQY.js → StorageLocationsTable-CBvJJKcK.js} +1 -1
- package/dist/assets/{System-DXC-3shW.js → System-CiNhZGIk.js} +2 -2
- package/dist/assets/TemplateEditorDialog-CPEjtVgr.js +1 -0
- package/dist/assets/{Terminal-Di7l31qa.js → Terminal-CVqdDb0A.js} +5 -5
- package/dist/assets/{TrainingProviders-aXqehRmF.js → TrainingProviders-dcBFMHwS.js} +1 -1
- package/dist/assets/{Viewer-C71XpHjW.js → Viewer-D5ct12iH.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DRUBvLQE.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DO_LtV7q.js} +1 -1
- package/dist/assets/{action-draft-qcGhRMv4.js → action-draft-C0aEYbbJ.js} +1 -1
- package/dist/assets/{ai-page.helpers-CEBa_im9.js → ai-page.helpers-5EBfVv-0.js} +1 -1
- package/dist/assets/{assignment-candidates-DdSU1Zo6.js → assignment-candidates-Cu7cpUBu.js} +1 -1
- package/dist/assets/{authed-media-BZy-JJ_o.js → authed-media-CU1WIjD1.js} +1 -1
- package/dist/assets/{board-model-DIWwdMST.js → board-model-Cwi5O7EF.js} +1 -1
- package/dist/assets/{camera-block-model-Bq_R4oG5.js → camera-block-model-Dll1DsHk.js} +1 -1
- package/dist/assets/client-BDuXx1QP.js +1122 -0
- package/dist/assets/{command-vocab-CvGdlD2o.js → command-vocab-BvTOW30-.js} +1 -1
- package/dist/assets/{device-integration-icon-Dd9uw4UF.js → device-integration-icon-DyN7a2xu.js} +1 -1
- package/dist/assets/device-picker-model-CB3W-Dnv.js +1 -0
- package/dist/assets/{dist-CDyYOITf.js → dist-UoOeKkgf.js} +1 -1
- package/dist/assets/dist-i_V6azZ-.js +1122 -0
- package/dist/assets/{format-CrKdqqCK.js → format-BkE2SPtY.js} +1 -1
- package/dist/assets/{hostInit-CYHcdoYA.js → hostInit-Bl-sNtRa.js} +1 -1
- package/dist/assets/i18n-CjRpxC0U.js +1 -0
- package/dist/assets/{icons-BLtyw4fH.js → icons-BLYFUXaZ.js} +1 -1
- package/dist/assets/{index-4KLN9ueQ.css → index-BHfNOQzs.css} +1 -1
- package/dist/assets/{index-CFJEFXwr.js → index-Dx4xn5Ud.js} +4 -4
- package/dist/assets/{linked-devices-model-BPZYWQoj.js → linked-devices-model-BheLRl2H.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-129d9964.js → mf-entry-bootstrap-0-4f6c0152.js} +2 -2
- package/dist/assets/mount-CB3W-Dnv.js +1 -0
- package/dist/assets/{notification-rule-status-DeN2cEgy.js → notification-rule-status-CqF6M-em.js} +1 -1
- package/dist/assets/{player-overlays-CgADEsQt.js → player-overlays-BKR7fWEx.js} +1 -1
- package/dist/assets/remoteEntry-DDpSLsem.js +1 -0
- package/dist/assets/{src-CA2_9YJD.js → src-BnZKlAAn.js} +18 -18
- package/dist/assets/{sso-popup-BXELI2t0.js → sso-popup-CZ9VM6-3.js} +1 -1
- package/dist/assets/{step-inspector-model-BFq40l6S.js → step-inspector-model-42AP-SPE.js} +1 -1
- package/dist/assets/{use-scenes-feed-DyQPnSjQ.js → use-scenes-feed-Ch3TUt2m.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-CKwvXhAP.js → useAdminDeviceRemoval-CJytKQAy.js} +1 -1
- package/dist/assets/useEventInvalidation-CB3W-Dnv.js +1 -0
- package/dist/assets/{useNodeUrlSelection-cFOr6zMH.js → useNodeUrlSelection-D6xWhfvx.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-HQVwzuiB.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-QyglrCCc.js} +2 -2
- package/dist/index.html +9 -9
- package/dist/server/addon.js +148 -17
- package/package.json +2 -2
- package/dist/assets/Addons-BDlFntTI.js +0 -5
- package/dist/assets/Archive-ChqpFwH8.js +0 -1
- package/dist/assets/Build-DfHu8hDx.js +0 -40
- package/dist/assets/CompositionBlockEditor-DyGQ4aIz.js +0 -2
- package/dist/assets/Data-B1NgedRI.js +0 -2
- package/dist/assets/InstancesTable-CItURWVx.js +0 -1
- package/dist/assets/IntegrationDetail-B05HfycS.js +0 -1
- package/dist/assets/Library-afeuqgc6.js +0 -1
- package/dist/assets/Locations-DPd9tJpI.js +0 -3
- package/dist/assets/Logs-DSnFwEPX.js +0 -1
- package/dist/assets/NodeAddonsSettingsPanel-DwR6THxT.js +0 -1
- package/dist/assets/Notifications-8WkrgioY.js +0 -1
- package/dist/assets/Pipeline-Dlg9wnRY.js +0 -1
- package/dist/assets/SessionsList-CIOmkBhu.js +0 -2
- package/dist/assets/TemplateEditorDialog-DXIGdBCR.js +0 -1
- package/dist/assets/client-DLuByuRa.js +0 -1122
- package/dist/assets/device-picker-model-PIGdnO_G.js +0 -1
- package/dist/assets/dist-CFXBYJXQ.js +0 -1122
- package/dist/assets/i18n-CLov6T90.js +0 -1
- package/dist/assets/mount-PIGdnO_G.js +0 -1
- package/dist/assets/remoteEntry-Cc7yyabb.js +0 -1
- package/dist/assets/useEventInvalidation-PIGdnO_G.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -5990,7 +5990,7 @@ var ZodIssueCode = {
|
|
|
5990
5990
|
var ZodFirstPartyTypeKind;
|
|
5991
5991
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5992
5992
|
//#endregion
|
|
5993
|
-
//#region ../types/dist/runtime-capabilities-
|
|
5993
|
+
//#region ../types/dist/runtime-capabilities-B36VcCR6.mjs
|
|
5994
5994
|
/**
|
|
5995
5995
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5996
5996
|
* window to float samples (D455).
|
|
@@ -9817,14 +9817,104 @@ var SubscribeAudioChunksInputSchema = object({
|
|
|
9817
9817
|
var SubscribeAudioChunksResultSchema = object({
|
|
9818
9818
|
/** Opaque id passed to `pullAudioChunks` / `unsubscribeAudioChunks`. */
|
|
9819
9819
|
subscriptionId: string() });
|
|
9820
|
-
var
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9820
|
+
var BrokerStatusSchema = _enum([
|
|
9821
|
+
"idle",
|
|
9822
|
+
"connecting",
|
|
9823
|
+
"streaming",
|
|
9824
|
+
"error",
|
|
9825
|
+
"stopped"
|
|
9826
|
+
]);
|
|
9827
|
+
/**
|
|
9828
|
+
* The encode a derived stream's feeder was last spawned with — the read-only
|
|
9829
|
+
* "effective encode". Read off the ffmpeg argv that runs, so it cannot drift
|
|
9830
|
+
* from what the operator's profile and the carrier's rules resolved to.
|
|
9831
|
+
*/
|
|
9832
|
+
var DerivedEffectiveEncodeSchema = object({
|
|
9833
|
+
/** `-c:v` of the argv (`libx264`, a hardware encoder, `copy`); null when absent. */
|
|
9834
|
+
encoder: string().nullable(),
|
|
9835
|
+
/** Output frame rate; null when the source cadence passes through unmeasured. */
|
|
9836
|
+
fps: number$1().nullable(),
|
|
9837
|
+
gopFrames: number$1(),
|
|
9838
|
+
/** ABR target (`-b:v`), kbps. */
|
|
9839
|
+
targetKbps: number$1().nullable(),
|
|
9840
|
+
/** Ceiling (`-maxrate`), kbps. */
|
|
9841
|
+
capKbps: number$1().nullable(),
|
|
9842
|
+
bufsizeKbps: number$1().nullable(),
|
|
9843
|
+
/**
|
|
9844
|
+
* `copy` = source audio untouched, `aac` = re-encoded, `profile` = operator's
|
|
9845
|
+
* encode, `none` = the operator dropped the track.
|
|
9846
|
+
*/
|
|
9847
|
+
audio: _enum([
|
|
9848
|
+
"copy",
|
|
9849
|
+
"aac",
|
|
9850
|
+
"profile",
|
|
9851
|
+
"none"
|
|
9852
|
+
])
|
|
9853
|
+
});
|
|
9854
|
+
/**
|
|
9855
|
+
* A derived stream's source: a **profile** slot (follows whatever physical
|
|
9856
|
+
* stream that profile is assigned to) or a **camStream** (pinned to one
|
|
9857
|
+
* physical stream regardless of assignment).
|
|
9858
|
+
*/
|
|
9859
|
+
var DerivedSourceRefSchema = union([object({
|
|
9860
|
+
kind: literal("profile"),
|
|
9861
|
+
profile: _enum([
|
|
9862
|
+
"high",
|
|
9863
|
+
"mid",
|
|
9864
|
+
"low"
|
|
9865
|
+
])
|
|
9866
|
+
}), object({
|
|
9867
|
+
kind: literal("camStream"),
|
|
9868
|
+
camStreamId: string()
|
|
9869
|
+
})]);
|
|
9870
|
+
object({
|
|
9871
|
+
width: number$1().nullable(),
|
|
9872
|
+
height: number$1().nullable(),
|
|
9873
|
+
fps: number$1().nullable(),
|
|
9874
|
+
idrIntervalMs: number$1().nullable(),
|
|
9875
|
+
/** `h264` / `h265` when observed. */
|
|
9876
|
+
videoCodec: _enum(["h264", "h265"]).nullable(),
|
|
9877
|
+
/** Upper-cased SDP name (`AAC`, `PCMU`) when the source has an audio track. */
|
|
9878
|
+
audioCodec: string().nullable()
|
|
9879
|
+
});
|
|
9880
|
+
/**
|
|
9881
|
+
* The full effective encode of a derived-stream profile: the stats the broker
|
|
9882
|
+
* publishes in `getBrokerStats.derivedEncode` plus the resolved geometry, the
|
|
9883
|
+
* flags that say WHY a number differs from the request, and the ffmpeg output
|
|
9884
|
+
* argv. One function (`computeDerivedEncode`) produces it for both the
|
|
9885
|
+
* broker's start path and `previewDerivedEncode`.
|
|
9886
|
+
*/
|
|
9887
|
+
var DerivedEncodePreviewSchema = DerivedEffectiveEncodeSchema.extend({
|
|
9888
|
+
/** Final picture size; `null` when neither the profile nor the source names it. */
|
|
9889
|
+
width: number$1().nullable(),
|
|
9890
|
+
height: number$1().nullable(),
|
|
9891
|
+
/** `h264` / `h265` re-encode, `copy` remux; `null` is never returned (the encoder always resolves). */
|
|
9892
|
+
videoCodec: _enum([
|
|
9893
|
+
"h264",
|
|
9894
|
+
"h265",
|
|
9895
|
+
"copy"
|
|
9827
9896
|
]),
|
|
9897
|
+
requestedFps: number$1().nullable(),
|
|
9898
|
+
/** The requested fps exceeded the source and the source cadence won. */
|
|
9899
|
+
fpsClampedToSource: boolean(),
|
|
9900
|
+
/** Lowest bitrate accepted for this geometry x fps; `null` when unknown. */
|
|
9901
|
+
floorKbps: number$1().nullable(),
|
|
9902
|
+
/** The explicit bitrate was below the floor and was raised to it. */
|
|
9903
|
+
raisedToFloor: boolean(),
|
|
9904
|
+
/** What the profile asked for when it was raised; `null` otherwise. */
|
|
9905
|
+
requestedKbps: number$1().nullable(),
|
|
9906
|
+
/** Seconds between keyframes; `null` when the output cadence is unknown. */
|
|
9907
|
+
keyframeIntervalSec: number$1().nullable(),
|
|
9908
|
+
/** The ffmpeg argv, with the source loopback URL in `-i`. */
|
|
9909
|
+
args: array(string())
|
|
9910
|
+
});
|
|
9911
|
+
/** Result of `previewDerivedEncode`: a plan, or the reason there is none. */
|
|
9912
|
+
var PreviewDerivedEncodeResultSchema = discriminatedUnion("kind", [object({
|
|
9913
|
+
kind: literal("preview"),
|
|
9914
|
+
preview: DerivedEncodePreviewSchema
|
|
9915
|
+
}), object({ kind: literal("no-source") })]);
|
|
9916
|
+
var BrokerStatsSchema = object({
|
|
9917
|
+
status: BrokerStatusSchema,
|
|
9828
9918
|
inputFps: number$1(),
|
|
9829
9919
|
encodedSubscribers: number$1(),
|
|
9830
9920
|
uptimeMs: number$1(),
|
|
@@ -9864,7 +9954,9 @@ var BrokerStatsSchema = object({
|
|
|
9864
9954
|
* alone that the mute is on the packet path and not merely persisted.
|
|
9865
9955
|
*/
|
|
9866
9956
|
audioMuted: boolean().optional(),
|
|
9867
|
-
audioMutedDropped: number$1().optional()
|
|
9957
|
+
audioMutedDropped: number$1().optional(),
|
|
9958
|
+
/** Present for a derived broker once its feeder has spawned at least once. */
|
|
9959
|
+
derivedEncode: DerivedEffectiveEncodeSchema.optional()
|
|
9868
9960
|
});
|
|
9869
9961
|
/**
|
|
9870
9962
|
* Exporter-facing "profile restream" entry. Returned by
|
|
@@ -22278,7 +22370,7 @@ Object.freeze({
|
|
|
22278
22370
|
}
|
|
22279
22371
|
});
|
|
22280
22372
|
//#endregion
|
|
22281
|
-
//#region ../types/dist/implemented-methods-
|
|
22373
|
+
//#region ../types/dist/implemented-methods-BUBqZ2a0.mjs
|
|
22282
22374
|
/**
|
|
22283
22375
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
22284
22376
|
*
|
|
@@ -24882,10 +24974,16 @@ looseObject({
|
|
|
24882
24974
|
TargetSchema.omit({ id: true });
|
|
24883
24975
|
var EncodeProfileSchema = object({
|
|
24884
24976
|
video: object({
|
|
24977
|
+
/**
|
|
24978
|
+
* `h264` / `h265` re-encode into that codec; `source` re-encodes in whatever
|
|
24979
|
+
* codec the source speaks (a resize that keeps the codec); `copy` remuxes
|
|
24980
|
+
* with no encode at all (so no resize either).
|
|
24981
|
+
*/
|
|
24885
24982
|
codec: _enum([
|
|
24886
24983
|
"h264",
|
|
24887
24984
|
"h265",
|
|
24888
|
-
"copy"
|
|
24985
|
+
"copy",
|
|
24986
|
+
"source"
|
|
24889
24987
|
]),
|
|
24890
24988
|
profile: _enum([
|
|
24891
24989
|
"baseline",
|
|
@@ -24937,12 +25035,14 @@ var EncodeProfileSchema = object({
|
|
|
24937
25035
|
singleSlicePerFrame: boolean().optional()
|
|
24938
25036
|
}),
|
|
24939
25037
|
audio: union([literal("passthrough"), object({
|
|
25038
|
+
/** `none` drops the audio track (`-an`); `copy` carries the source's. */
|
|
24940
25039
|
codec: _enum([
|
|
24941
25040
|
"opus",
|
|
24942
25041
|
"aac",
|
|
24943
25042
|
"pcmu",
|
|
24944
25043
|
"pcma",
|
|
24945
|
-
"copy"
|
|
25044
|
+
"copy",
|
|
25045
|
+
"none"
|
|
24946
25046
|
]),
|
|
24947
25047
|
bitrateKbps: number$1().int().positive().optional(),
|
|
24948
25048
|
sampleRateHz: number$1().int().positive().optional(),
|
|
@@ -54608,7 +54708,11 @@ method(object({
|
|
|
54608
54708
|
}).nullable(), {
|
|
54609
54709
|
kind: "mutation",
|
|
54610
54710
|
auth: "admin"
|
|
54611
|
-
}), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({
|
|
54711
|
+
}), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({
|
|
54712
|
+
deviceId: number$1().int().nonnegative(),
|
|
54713
|
+
profile: EncodeProfileSchema,
|
|
54714
|
+
source: DerivedSourceRefSchema.optional()
|
|
54715
|
+
}), PreviewDerivedEncodeResultSchema), method(object({ brokerId: string() }), object({
|
|
54612
54716
|
probed: boolean(),
|
|
54613
54717
|
summary: string()
|
|
54614
54718
|
}), {
|
|
@@ -72706,7 +72810,8 @@ var StatelessStepRefusalSchema = _enum([
|
|
|
72706
72810
|
"unknown-step",
|
|
72707
72811
|
"model-not-servable",
|
|
72708
72812
|
"unreadable-frame",
|
|
72709
|
-
"execution-failed"
|
|
72813
|
+
"execution-failed",
|
|
72814
|
+
"no-eligible-device"
|
|
72710
72815
|
]);
|
|
72711
72816
|
/**
|
|
72712
72817
|
* Answer to `runStatelessStep` — a discriminated union rather than a nullable
|
|
@@ -79352,7 +79457,13 @@ var NodeInferenceDeviceSchema = object({
|
|
|
79352
79457
|
enabled: boolean(),
|
|
79353
79458
|
/** Relative balancer weight for the enabled device (default 1). */
|
|
79354
79459
|
weight: number$1(),
|
|
79355
|
-
/**
|
|
79460
|
+
/**
|
|
79461
|
+
* Per-device concurrent-session cap; null = unlimited (multi-device C4). A
|
|
79462
|
+
* limit: a camera no device can take within its cap stays on the node's
|
|
79463
|
+
* default pool — EXCEPT when that default pool is an excluded device
|
|
79464
|
+
* (`defaultPoolExcluded`), where it goes over the cap on the least-loaded
|
|
79465
|
+
* eligible device instead (#610).
|
|
79466
|
+
*/
|
|
79356
79467
|
maxSessions: number$1().nullable(),
|
|
79357
79468
|
/** Object-detection model the executor defaults to for this deviceKey. */
|
|
79358
79469
|
defaultModelId: string(),
|
|
@@ -79402,7 +79513,15 @@ var NodeInferenceDevicesSchema = object({
|
|
|
79402
79513
|
nodeId: string(),
|
|
79403
79514
|
/** False when the node's platform-probe was unreachable (no live device set). */
|
|
79404
79515
|
reachable: boolean(),
|
|
79405
|
-
devices: array(NodeInferenceDeviceSchema).readonly()
|
|
79516
|
+
devices: array(NodeInferenceDeviceSchema).readonly(),
|
|
79517
|
+
/**
|
|
79518
|
+
* The election left NO device and one was excluded because the operator
|
|
79519
|
+
* turned it off or it is not functional (#610): the runner's default pool is
|
|
79520
|
+
* that device, so work with no explicit device (a stateless step, a bench with
|
|
79521
|
+
* no `deviceKey`) is refused rather than run there. Absent = an orchestrator
|
|
79522
|
+
* older than the field, or an unreachable node: nothing is claimed (D315).
|
|
79523
|
+
*/
|
|
79524
|
+
defaultPoolExcluded: boolean().optional()
|
|
79406
79525
|
});
|
|
79407
79526
|
/**
|
|
79408
79527
|
* The CLUSTER switch of one pipeline step (D1065):
|
|
@@ -101699,6 +101818,13 @@ Object.freeze({
|
|
|
101699
101818
|
access: "view",
|
|
101700
101819
|
role: "admin"
|
|
101701
101820
|
},
|
|
101821
|
+
"streamBroker.previewDerivedEncode": {
|
|
101822
|
+
capName: "stream-broker",
|
|
101823
|
+
capScope: "system",
|
|
101824
|
+
addonId: null,
|
|
101825
|
+
access: "view",
|
|
101826
|
+
role: "admin"
|
|
101827
|
+
},
|
|
101702
101828
|
"streamBroker.probeStream": {
|
|
101703
101829
|
capName: "stream-broker",
|
|
101704
101830
|
capScope: "system",
|
|
@@ -106002,6 +106128,11 @@ Object.freeze({
|
|
|
106002
106128
|
form: "single",
|
|
106003
106129
|
optional: false
|
|
106004
106130
|
}],
|
|
106131
|
+
"streamBroker.previewDerivedEncode": [{
|
|
106132
|
+
name: "deviceId",
|
|
106133
|
+
form: "single",
|
|
106134
|
+
optional: false
|
|
106135
|
+
}],
|
|
106005
106136
|
"streamBroker.produceEventMedia": [{
|
|
106006
106137
|
name: "deviceId",
|
|
106007
106138
|
form: "single",
|
|
@@ -107853,7 +107984,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
107853
107984
|
capability: adminUiCapability,
|
|
107854
107985
|
provider: {
|
|
107855
107986
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
107856
|
-
getVersion: async () => ({ version: "1.2.
|
|
107987
|
+
getVersion: async () => ({ version: "1.2.704" })
|
|
107857
107988
|
}
|
|
107858
107989
|
}];
|
|
107859
107990
|
}
|
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.704",
|
|
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.906"
|
|
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{Bn as d,Gt as f,Hi as p,In as m,Q as h,Tn as g,Tt as _,Vn as v,Xi as y,Yn as b,Zt as x,ct as ee,er as S,ft as C,hr as te,ia as ne,ot as w,sa as T,tn as E,wi as D,zr as O}from"./player-overlays-CgADEsQt.js";import{ul as re}from"./client-DLuByuRa.js";import{t as ie}from"./chevron-down-CBb-F8DT.js";import{i as k,u as A}from"./terminal-DZ5OZpgC.js";import{Co as ae,Hi as oe,Ji as se,Ki as ce,Kp as le,Oa as ue,To as de,Ui as fe,Wi as pe,Yp as j,ai as M,ao as me,bo as N,co as P,ct as F,fo as he,fr as I,go as ge,ho as L,ii as R,io as z,lo as _e,mo as ve,oi as B,oo as ye,pi as be,po as xe,pp as V,pr as Se,qi as Ce,ro as H,si as U,sl as we,so as Te,to as W,tu as Ee,uo as De,vo as Oe,vt as ke,wo as Ae,xo as je,xp as Me,yo as Ne}from"./src-CA2_9YJD.js";import{t as G}from"./useTranslation-BJr-n0es.js";import"./mount-PIGdnO_G.js";import{Si as Pe,gt as Fe,ht as Ie,vi as Le,wi as Re}from"./index-CFJEFXwr.js";import{t as K}from"./NodeAddonsSettingsPanel-DwR6THxT.js";import{t as q}from"./AdminPage-fCxxHmc-.js";import{i as ze,r as Be,t as Ve}from"./addon-kind-filter-CEGKkC1O.js";import{n as J,r as He,t as Ue}from"./useNodeUrlSelection-cFOr6zMH.js";function We(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 Y=`a singleton role: Roles & nodes is the one picker for it`,X=[{cap:`pipeline-orchestrator`,addonId:`pipeline-orchestrator`,surface:`pipeline`,sectionIds:[`cluster-step-models`,`face-rescore`,`detail-crop`,`native-lease`,`load`,`failover`]},{cap:`pipeline-orchestrator`,addonId:`pipeline-orchestrator`,surface:`pipeline-roles`,fieldKeys:[`ingestNode`,`audioNode`,`motionNode`],reason:Y},{cap:`face-gallery`,addonId:`pipeline-analytics`,surface:`pipeline`},{cap:`stream-broker`,addonId:`stream-broker`,surface:`pipeline`},{cap:`snapshot`,addonId:`snapshot`,surface:`pipeline`},{cap:`recording`,addonId:`recorder`,surface:`pipeline`},{cap:`recording`,addonId:`recorder`,surface:`pipeline-roles`,fieldKeys:[`recordingNodeId`],reason:Y},{cap:`embedding-encoder`,addonId:`embedding-encoder`,surface:`pipeline`},{cap:`device-history`,addonId:`device-history`,surface:`history`},{cap:`alerts`,addonId:`alert-center`,surface:`notifications`},{cap:`metrics-provider`,addonId:`metrics-native`,surface:`nodes`},{cap:`login-method`,addonId:`auth-webauthn`,surface:`provider-page`},{cap:`llm`,addonId:`ai`,surface:`provider-page`},{cap:`log-destination`,addonId:`console-logging`,surface:`provider-page`},{cap:`core-blocks`,addonId:`core-blocks`,surface:`provider-page`},{cap:`custom-model-registry`,addonId:`model-studio`,surface:`addon-card`},{cap:`osd-manager`,addonId:`osd-manager`,surface:`addon-card`},{cap:`pipeline-analytics`,addonId:`pipeline-analytics`,surface:`addon-card`},{cap:`pipeline-analytics`,addonId:`pipeline-analytics`,surface:`pipeline-roles`,fieldKeys:[`postProcessingNodeId`],reason:Y},{cap:`detection-pipeline`,addonId:`detection-pipeline`,surface:`addon-card`}],Z={pipeline:`/system/pipeline?view=nodes&node=__cluster__&ctab=settings`,"pipeline-roles":`/system/pipeline?view=nodes&node=__cluster__&ctab=roles-nodes`,history:`/system/history`,notifications:`/system/notifications?tab=settings`,nodes:`/system/nodes`};function Ge(e){return e.sectionIds===void 0&&e.fieldKeys===void 0}function Ke(e){return X.filter(t=>t.addonId===e&&Z[t.surface]!==void 0)}function qe(e){let t=X.filter(t=>t.addonId===e),n=new Set(t.filter(e=>e.surface===`addon-card`&&Ge(e)).map(e=>e.cap));return{capabilities:[...new Set(t.map(e=>e.cap))].filter(e=>!n.has(e)),fieldKeys:t.filter(e=>n.has(e.cap)&&e.surface!==`addon-card`).flatMap(e=>e.fieldKeys??[])}}function Je({addonId:e,onOpen:n}){let{t:r}=G(),i=qe(e),o=Ke(e).length>0;return t(u,{children:[a(Ye,{addonId:e,onOpen:n}),a(K,{nodeId:null,addonIds:[e],level:`global`,fieldScope:`cluster`,omitCapabilities:i.capabilities,omitFieldKeys:i.fieldKeys,emptyMessage:o?r(`addons.addonCard.allClusterSettingsElsewhere`,`Its cluster-wide settings are on the page linked above.`):r(`addons.addonCard.thisAddonExposesNoCluster`,`This addon exposes no cluster-wide settings. Anything it can configure is per-node — open it from Cluster → the node → Settings.`)})]})}function Ye({addonId:e,onOpen:n}){let{t:r}=G(),i=[...new Set(Ke(e).map(e=>e.surface))];if(i.length===0)return null;let o=e=>{switch(e){case`pipeline`:return r(`addons.addonCard.surface.pipeline`,`Pipeline → Settings`);case`pipeline-roles`:return r(`addons.addonCard.surface.pipelineRoles`,`Pipeline → Roles & nodes`);case`history`:return r(`addons.addonCard.surface.history`,`History`);case`notifications`:return r(`addons.addonCard.surface.notifications`,`Notifications → Settings`);case`nodes`:return r(`addons.addonCard.surface.nodes`,`Nodes`);default:return e}};return t(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[10px] text-foreground-subtle`,children:[a(`span`,{children:r(`addons.addonCard.settingsElsewhere`,`More of this addon's settings are on:`)}),i.map(e=>{let t=Z[e];return t===void 0?null:a(V,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>n(t),children:o(e)},e)})]})}var Xe={queued:{icon:p,bg:`bg-muted text-foreground-subtle`,labelKey:`addons.addonRowBadge.queued`},updating:{icon:O,bg:`bg-primary/10 text-primary`,labelKey:`addons.addonRowBadge.updating`,spin:!0},"done-pending-restart":{icon:b,bg:`bg-amber-500/10 text-amber-700`,labelKey:`addons.addonRowBadge.pendingRestart`},done:{icon:T,bg:`bg-success/10 text-success`,labelKey:`addons.addonRowBadge.done`},failed:{icon:k,bg:`bg-danger/10 text-danger`,labelKey:`addons.addonRowBadge.failed`}};function Ze({item:e}){let{t:n}=G(),r=Xe[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`]),Qe=new Set([`done`,`failed`,`skipped`]);function $e(e){return!Qe.has(e.phase)&&!Q.has(e.jobState)}function et(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 tt(){let{data:e}=xe({activeOnly:!0},{refetchOnWindowFocus:!1,refetchInterval:e=>(e.state.data?.length??0)>0?3e3:!1}),{map:t}=j(re.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 et([...n.values()],Date.now())},[e,t])}var nt={queued:{icon:p,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.queued`},fetching:{icon:O,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.fetching`,spin:!0},staged:{icon:O,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.staged`,spin:!0},validating:{icon:O,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.validating`,spin:!0},applying:{icon:O,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.applying`,spin:!0},restarting:{icon:O,cls:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,labelKey:`addons.jobProgress.restarting`,spin:!0},applied:{icon:O,cls:`bg-primary/10 text-primary`,labelKey:`addons.jobProgress.finalizing`,spin:!0},done:{icon:T,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:g,cls:`bg-muted text-foreground-subtle`,labelKey:`addons.jobProgress.skipped`}};function rt({progress:e}){let{t:n}=G(),r=nt[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 it(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 at(e){let t=e.version===null?``:` ${e.version}`,n=e.isOnline?``:` (offline: removed when it reconnects)`;return`- ${e.nodeName}${t}${n}`}function ot(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(at)];return n.length>0&&r.push(`Could not ask: ${n.join(`, `)} — not included.`),r.push(`This cannot be undone.`),r.join(`
|
|
2
|
-
`)}function st(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 ct={uninstalled:`uninstalled`,"not-installed":`was not installed`,refused:`REFUSED`,failed:`FAILED`,"pending-reconnect":`offline — removed when it reconnects`};function lt(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)}: ${ct[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 ut={},dt=3e4,ft=`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 pt({packageName:e,displayName:n,selectedNode:r,hideNodeAction:i,disabled:o}){let{t:s}=G(),c=l(),u=ee(),d=w(),f=he(ut,{staleTime:dt}),p=f.data?.installations??[],m=(f.data?.unreachable??[]).map(e=>e.nodeId),h=it(p,e),g=e=>h.find(t=>t.nodeId===e)?.nodeName??(e===r.id?r.name:e),_=Ae({onSettled:()=>{c.invalidateQueries({queryKey:[[`addons`]]}),c.invalidateQueries({queryKey:[[`addonPages`]]}),c.invalidateQueries({queryKey:[[`capabilities`]]}),c.invalidateQueries({queryKey:[[`nodes`]]})}}),v=async e=>{await d({title:e.success?s(`addons.addonUninstallControls.uninstalled`,`{{displayName}} uninstalled`,{displayName:n}):s(`addons.addonUninstallControls.notEveryNodeWasCleaned`,`{{displayName}}: not every node was cleaned`,{displayName:n}),message:lt(e,g),variant:e.success?`default`:`danger`})},y=async t=>{try{await v(await _.mutateAsync({packageName:e,...t}))}catch(e){await d({title:s(`addons.addonUninstallControls.uninstallFailed`,`Uninstall {{displayName}} failed`,{displayName:n}),message:e instanceof Error?e.message:String(e),variant:`danger`})}},b=async()=>{let e=h.filter(e=>e.nodeId!==r.id);await u({title:s(`addons.addonUninstallControls.uninstallFrom`,`Uninstall {{displayName}} from {{name}}?`,{displayName:n,name:r.name}),message:st(n,r.name,e),confirmLabel:s(`addons.addonUninstallControls.uninstall`,`Uninstall`),variant:`danger`})&&await y(r.isHub?{}:{nodeId:r.id})},x=async()=>{let t=(await f.refetch()).data;if(t===void 0){await d({title:s(`addons.addonUninstallControls.cannotListTheNodes`,`Cannot list the nodes`),message:s(`addons.addonUninstallControls.theHubDidNotAnswer`,`The hub did not answer which nodes have this package — nothing was removed.`),variant:`danger`});return}let r=it(t.installations,e);await u({title:s(`addons.addonUninstallControls.uninstallEverywhere`,`Uninstall {{displayName}} everywhere?`,{displayName:n}),message:ot(n,r,t.unreachable.map(e=>e.nodeId)),confirmLabel:s(`addons.addonUninstallControls.uninstallFromNodeS`,`Uninstall from {{length}} node(s)`,{length:r.length}),variant:`danger`})&&await y({everywhere:!0})},S=_.isPending||o===!0;return t(`div`,{className:`flex items-center gap-1.5`,children:[i!==!0&&t(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),b()},disabled:S,className:ft,title:s(`addons.addonUninstallControls.uninstallFrom2`,`Uninstall from {{name}}`,{name:r.name}),children:[a(E,{className:`h-3 w-3`}),_.isPending?s(`addons.addonUninstallControls.removing`,`Removing...`):s(`addons.addonUninstallControls.uninstall`,`Uninstall`)]}),(h.length>1||i===!0||m.length>0)&&t(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),x()},disabled:S,className:ft,title:s(`addons.addonUninstallControls.uninstallFromEveryNodeThat`,`Uninstall from every node that has it`),children:[a(A,{className:`h-3 w-3`}),h.length>0?s(`addons.uninstallControls.everywhereCount`,{count:h.length}):s(`addons.uninstallControls.everywhere`)]})]})}function mt(e){return typeof e.deprecated==`string`&&e.deprecated.length>0}function ht(e,t){return t?e:e.filter(e=>e.distTags.includes(`latest`)||!mt(e))}function gt(e){return e.length-ht(e,!1).length}c();function _t({packageName:e,currentVersion:n,installSource:r,onInstall:i,onClose:o,onSelect:c,selectedVersion:l}){let{t:d}=G(),p=r===`upload`||r===`local`,[m,h]=s(!1),{data:g,isLoading:v,isError:y}=P({name:e}),b=g?ht(g,m):[],x=g?gt(g):0;return t(`div`,{className:`fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden`,style:{top:`auto`,bottom:`auto`},ref:e=>{if(!e)return;let t=e.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerHeight-t.bottom,r=t.top;n<280&&r>n?(e.style.bottom=`${window.innerHeight-t.top+4}px`,e.style.top=`auto`):(e.style.top=`${t.bottom+4}px`,e.style.bottom=`auto`),e.style.right=`${window.innerWidth-t.right}px`},onClick:e=>e.stopPropagation(),children:[t(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[a(`span`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle font-medium`,children:d(`addons.versionPicker.versions`,`Versions`)}),a(V,{variant:`unstyled`,type:`button`,onClick:o,className:`text-foreground-subtle hover:text-foreground`,children:a(_,{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(f,{className:`h-3 w-3 mt-0.5 text-cyan-500 shrink-0`}),t(`div`,{className:`text-cyan-700 dark:text-cyan-200`,children:[a(`span`,{className:`font-semibold`,children:d(`addons.versionPicker.inPlace`,{kind:r===`upload`?d(`addons.versionPicker.uploadedCopy`,`Uploaded copy`):d(`addons.versionPicker.localCopy`,`Local copy`)})}),` `,a(Le,{i18nKey:`addons.versionPicker.reinstall`,values:{version:n},components:{mono:a(`span`,{className:`font-mono`})}})]})]}),v&&t(`div`,{className:`flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle`,children:[a(O,{className:`h-3.5 w-3.5 animate-spin`}),d(`addons.versionPicker.loadingVersions`,`Loading versions...`)]}),y&&a(`div`,{className:`px-3 py-4 text-center text-[10px] text-danger`,children:d(`addons.versionPicker.registryError`,`Could not load versions from the registry.`)}),b.length>0&&a(`div`,{className:`max-h-64 overflow-auto divide-y divide-border`,children:b.map(e=>{let r=e.version===n,o=c!==void 0&&e.version===l,s=/-(alpha|beta|rc|dev|canary|next)/i.test(e.version),f=t(u,{children:[a(`span`,{className:`font-mono flex-1 text-left ${r?`text-primary font-semibold`:s?`text-amber-400`:`text-foreground`}`,children:e.version}),r&&a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium bg-primary/10 text-primary`,children:d(`common.current`)}),e.distTags.map(e=>a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e===`latest`?`bg-emerald-500/15 text-emerald-400`:e===`beta`?`bg-amber-500/15 text-amber-400`:`bg-gray-500/15 text-gray-400`}`,children:e},e)),mt(e)&&a(`span`,{className:`text-[9px] text-red-400 line-through`,children:d(`common.deprecated`)}),a(`span`,{className:`text-[9px] text-foreground-subtle shrink-0`,children:new Date(e.publishedAt).toLocaleDateString()})]});return c?t(V,{variant:`unstyled`,type:`button`,"aria-label":d(`addons.versionPicker.select`,`Select {{version}}`,{version:e.version}),onClick:()=>c(e.version),className:`w-full flex items-center gap-2 px-3 py-2 text-[11px] ${o?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,o?a(T,{className:`h-3 w-3 text-primary shrink-0`}):a(`span`,{className:`w-3 shrink-0`})]},e.version):t(`div`,{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${r?`bg-primary/5`:`hover:bg-surface-hover`} transition-colors`,children:[f,a(V,{variant:`unstyled`,type:`button`,onClick:()=>i(e.version),className:`shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors`,title:r?d(`addons.versionPicker.reInstallFromNpm`,`Re-install {{version}} from npm`,{version:e.version}):d(`addons.versionPicker.install`,`Install {{version}}`,{version:e.version}),children:a(D,{className:`h-3 w-3`})})]},e.version)})}),!v&&!y&&g&&g.length===0&&a(`div`,{className:`py-4 text-center text-[10px] text-foreground-subtle`,children:d(`addons.versionPicker.noVersionsFound`,`No versions found`)}),x>0&&a(V,{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:()=>h(e=>!e),children:m?d(`addons.versionPicker.hideOlder`,`Hide older versions`):d(`addons.versionPicker.showOlder`,`Show older versions ({{count}})`,{count:x})})]})}c();var vt=`device-export`;function yt(e){return e.capabilities.some(e=>(typeof e==`string`?e:e.name)===vt)}function bt(e){return e!==`local`&&e!==`upload`}function xt({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`,p=r&&i?h(`/api/addon-assets/${r}/${i}`):null,m=!!p&&!c;return t(`div`,{className:`relative flex-shrink-0`,children:[a(`div`,{className:`h-8 w-8 rounded-md flex items-center justify-center ${u?``:d}`,style:u,children:m?a(`img`,{src:p,alt:r,className:`h-4 w-4`,onError:()=>l(!0)}):a(e?te:S,{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`}),bt(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(f,{className:`h-2.5 w-2.5 text-white`})})]})}function St({version:e,availableUpdate:n,selectedVersion:r,isUpdating:i,installSource:o,disabled:s,onUpdate:c,onOpenPicker:l,children:u}){let{t:d}=G();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(O,{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(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),c()},disabled:s,className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-semibold border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,title:d(`addons.addonCard.updateTo`,`Update to {{target}}`,{target:i}),children:[a(D,{className:`h-3 w-3`}),d(`addons.addonCard.update`,`Update`)]}),t(V,{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(V,{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 Ct({addonId:e}){let t=l(),{data:n=`inherit`}=z({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(V,{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 wt={id:`hub`,name:`Hub`,isHub:!0};function Tt({addon:e,clusterStatus:n,hideVersion:r,availableUpdate:i,blockedUpdate:c,onUpdateServer:d,onUpdate:f,isUpdating:p,jobProgress:h,bundle:g,bulkItem:y,disabledByBulk:x,isSystem:ee,selectedNode:S}){let{t:C}=G(),[w,T]=s(!1),[E,D]=s(!1),[O,re]=s(null);o(()=>{re(null)},[i]);let A=O??i,[ae,le]=s(!1),[de,j]=s(!1),[M,me]=s(`logs`),N=l(),P=Pe(),{manifest:F}=e,he=!g&&!F.protected&&F.removable!==!1,L=!!g,R=g?.displayName??F.name,z=g?.packageName??F.packageName,ve=g?.version??F.packageVersion??F.version,B=g?.installSource??e.installSource,ye=g?g.bundle?.description??g.addons[0]?.manifest.description:F.description,be=ge({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]})}}),xe=_e({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`addonPages`]]}),N.invalidateQueries({queryKey:[[`capabilities`]]}),N.invalidateQueries({queryKey:[[`integrations`]]})}}),H=Oe({onSuccess:()=>{N.invalidateQueries({queryKey:[[`addons`]]}),N.invalidateQueries({queryKey:[[`alerts`]]})}}),U=e.health,we=U?.phase===`failed`&&!U.inGracePeriod,Te=we&&U?.nextRetryAt&&!U.retrying,W=We(e.process);return t(`div`,{className:`rounded-md border bg-surface overflow-hidden ${we?`border-red-500/50`:`border-border`}`,children:[we&&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:C(`addons.addonCard.failedToLoad`,{attempt:U.retryCount})}),a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:U.lastError?.message??C(`addons.addonCard.unknownError`,`Unknown error`)}),Te&&U.nextRetryAt&&a(`div`,{className:`text-[10px] text-foreground-subtle mt-1`,children:C(`addons.addonCard.autoRetryAt`,{time:new Date(U.nextRetryAt).toLocaleTimeString()})})]}),t(V,{variant:`unstyled`,type:`button`,disabled:H.isPending||U.retrying,onClick:e=>{e.stopPropagation(),H.mutate({packageName:z})},className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-semibold border border-red-400/40 bg-red-400/10 text-red-700 dark:text-red-300 hover:bg-red-400/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors shrink-0`,title:C(`addons.addonCard.resetRetryCounterAndForce`,`Reset retry counter and force immediate reload`),children:[a(b,{className:`h-3 w-3 ${H.isPending||U.retrying?`animate-spin`:``}`}),C(`addons.addonCard.retryNow`,`Retry now`)]})]}),W!==null&&t(`div`,{className:`bg-danger/10 border-b border-danger/30 px-3 py-2 flex items-start gap-2`,children:[a(k,{className:`h-4 w-4 text-danger shrink-0 mt-0.5`}),t(`div`,{className:`flex-1 min-w-0`,children:[a(`div`,{className:`text-xs font-semibold text-danger`,children:C(`addons.addonCard.processProblem.${W.kind}`)}),W.reason!==void 0&&a(`div`,{className:`text-[11px] text-foreground mt-0.5 break-words font-mono`,children:W.reason})]})]}),t(`div`,{className:`flex items-start gap-2.5 px-3 py-2`,children:[a(xt,{isBundle:L||!!F.components&&F.components.length>1,installSource:B,addonId:L?g.addons[0]?.manifest.id:F.id,iconPath:L?g.bundle?.icon??g.addons[0]?.manifest.icon:F.icon,color:L?g.addons[0]?.manifest.color:F.color}),t(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:`flex items-start justify-between gap-2`,children:[a(`span`,{className:`text-xs font-semibold text-foreground truncate min-w-0`,children:R}),!r&&a(St,{version:ve,availableUpdate:i,...A===void 0?{}:{selectedVersion:A},isUpdating:p,installSource:B,disabled:x,...f&&A!==void 0?{onUpdate:()=>f(A)}:{},onOpenPicker:()=>D(e=>!e),children:E&&a(_t,{packageName:z,currentVersion:ve,...B?{installSource:B}:{},...i!==void 0&&A!==void 0?{selectedVersion:A,onSelect:e=>{re(e),D(!1)}}:{},onInstall:e=>{D(!1),xe.mutate({packageName:z,version:e})},onClose:()=>D(!1)})})]}),t(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 mt-0.5`,children:[z!==R&&a(`span`,{className:`text-[10px] text-foreground-subtle font-mono truncate max-w-full`,children:z}),L&&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]}),ee&&t(`span`,{className:`text-[10px] rounded-full bg-amber-500/15 text-amber-700 dark:text-amber-300 px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1`,title:C(`addons.addonCard.systemPackageUpdatingRestartsThe`,`System package — updating restarts the hub`),children:[a(b,{className:`h-3 w-3`}),C(`addons.addonCard.system`,`System`)]}),y!=null&&a(Ze,{item:y}),c!==void 0&&a(ue,{variant:`warning`,title:C(`addons.addonCard.updateHeldTitle`,{defaultValue:`{{latest}} is held until the server is {{required}} or newer`,latest:c.latestVersion,required:c.requiredServer}),children:C(`addons.addonCard.requiresServer`,{defaultValue:`requires server ≥ {{version}}`,version:c.requiredServer})}),c!==void 0&&d!==void 0&&a(V,{type:`button`,size:`sm`,variant:`secondary`,onClick:d,children:C(`clusterUpdate.updateServer`,`Update server`)}),h!=null&&a(rt,{progress:h})]}),ye&&a(`p`,{className:`text-[10px] text-foreground-subtle mt-1 line-clamp-1`,children:ye}),!L&&e.process&&t(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.mode===`forked`?`bg-blue-500/15 text-blue-400`:`bg-gray-500/15 text-gray-400`}`,children:e.process.mode===`forked`?C(`addons.addonCard.forked`):C(`addons.addonCard.inProcess`)}),e.process.pid!=null&&t(`span`,{className:`text-[9px] font-mono text-foreground-subtle`,children:[`PID `,e.process.pid]}),a(`span`,{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${e.process.state===`running`?`bg-emerald-500/15 text-emerald-400`:W===null?`bg-gray-500/15 text-gray-400`:`bg-red-500/15 text-red-400`}`,children:e.process.state})]})]})]}),!L&&t(`div`,{className:`flex items-center gap-1 px-3 py-1 border-t border-border/50 bg-surface-hover/20`,children:[t(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),be.mutate({addonId:F.id})},disabled:be.isPending||x,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(b,{className:`h-3 w-3 ${be.isPending?`animate-spin`:``}`}),C(`addons.addonCard.restart`,`Restart`)]}),t(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),le(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(v,{className:`h-3 w-3`}),C(`addons.addonCard.logs`,`Logs`)]}),!L&&t(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),j(!0)},className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[10px] font-medium border transition-colors ${de?`border-primary/30 bg-primary/10 text-primary`:`border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10`}`,children:[a(m,{className:`h-3 w-3`}),C(`addons.addonCard.settings`,`Settings`)]}),a(`div`,{className:`flex-1`}),he&&a(pt,{packageName:F.packageName,displayName:F.name,selectedNode:S??wt,disabled:x})]}),n&&n.nodes.length>1&&!L&&t(`div`,{className:`border-t border-border px-3 py-1.5 bg-muted/10`,children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle mb-1.5`,children:C(`addons.addonCard.clusterDeployment`,`Cluster Deployment`)}),a(`div`,{className:`space-y-1`,children:n.nodes.map(e=>t(`div`,{className:`flex items-center gap-2 text-[10px]`,children:[a(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`offline`?`bg-muted-foreground/30`:e.synced?`bg-success`:`bg-amber-500`}`}),a(`span`,{className:`font-medium text-foreground min-w-[60px]`,children:e.name}),a(`span`,{className:`font-mono text-foreground-subtle`,children:e.version}),!e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20`,children:C(`addons.addonCard.outdated`)}),e.status===`offline`&&a(`span`,{className:`text-[9px] px-1 py-0.5 rounded bg-muted text-muted-foreground`,children:C(`common.offline`)}),e.synced&&e.status!==`offline`&&a(`span`,{className:`text-[9px] text-success`,children:C(`common.synced`)})]},e.nodeId))})]}),ae&&!L&&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(V,{variant:`unstyled`,type:`button`,onClick:()=>me(`logs`),className:`px-2 py-0.5 transition-colors ${M===`logs`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:C(`addons.addonCard.logs`,`Logs`)}),a(V,{variant:`unstyled`,type:`button`,onClick:()=>me(`events`),className:`px-2 py-0.5 border-l border-border transition-colors ${M===`events`?`bg-primary/10 text-primary`:`text-foreground-subtle hover:bg-surface-hover`}`,children:C(`addons.addonCard.events`,`Events`)})]}),a(`div`,{className:`flex-1`}),a(V,{variant:`unstyled`,type:`button`,onClick:e=>{e.stopPropagation(),le(!1)},className:`text-foreground-subtle hover:text-foreground`,children:a(_,{className:`h-3.5 w-3.5`})})]}),M===`logs`&&a(Se,{addonId:F.id,maxHeight:`max-h-64`,showFilters:!1}),M===`events`&&a(I,{addonId:F.id,category:`addon.*`,maxHeight:`max-h-64`})]}),L&&t(u,{children:[a(V,{variant:`unstyled`,type:`button`,onClick:()=>T(e=>!e),className:`w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors`,children:a(w?ne: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(Tt,{addon:e,hideVersion:!0},e.manifest.id))})]}),de&&!L&&a(oe,{open:!0,onOpenChange:e=>!e&&j(!1),children:t(pe,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(Ce,{children:t(se,{className:`flex items-center gap-2`,children:[a(m,{className:`h-4 w-4 text-primary`}),C(`addons.addonCard.settingsTitle`,{name:R})]})}),t(fe,{className:`space-y-4`,children:[a(`div`,{className:`text-[10px] text-foreground-subtle mb-2`,children:C(`addons.addonCard.clusterWideSettingsOneValue`,`Cluster-wide settings — one value for every node. Per-node settings live under Cluster → the node → Settings.`)}),a(Je,{addonId:F.id,onOpen:e=>P(e)}),yt(F)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.deviceExport`,`Device export`)}),a(ke,{addonId:F.id,onOpenDevice:e=>P(`/devices/${e}`)})]}),bt(B)&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.autoUpdate`,`Auto-Update`)}),a(Ct,{addonId:F.id})]}),F.components&&F.components.length>0&&t(`div`,{children:[a(`div`,{className:`text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2`,children:C(`addons.addonCard.components`,{count:F.components.length})}),a(`div`,{className:`flex flex-wrap gap-1`,children:F.components.map(e=>a(`span`,{className:`text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono`,children:e},e))})]})]}),a(ce,{children:a(V,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>j(!1),children:C(`common.close`,`Close`)})})]})})]})}c();var Et=`.tgz,.tar.gz,.zip`;function Dt({onUploadSuccess:e}){let{t:r}=G(),[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(h(`/api/addons/upload`),{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:n})).json()).success&&e()}finally{c(!1)}},[e]);return t(u,{children:[a(be,{ref:l,accept:Et,onChange:i(e=>{let t=e.target.files?.[0];t&&d(t),e.target.value=``},[d]),className:`hidden`}),t(V,{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(O,{className:`w-3.5 h-3.5 animate-spin`}):a(f,{className:`w-3.5 h-3.5`}),o?r(`addons.addonUploadZone.uploading`,`Uploading...`):r(`addons.addonUploadZone.upload`,`Upload`)]})]})}var Ot=/```[^\n]*\n([\s\S]*?)```/g;function kt(e){let t=[],n=0;for(let r of e.matchAll(Ot)){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 At(e){let t=e.trim();return t.startsWith(`https://`)||t.startsWith(`http://`)?t:null}function jt(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?At(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 Mt(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:jt(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:jt(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=jt(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 Nt({markdown:e}){return a(`div`,{className:`text-xs text-foreground leading-relaxed`,children:kt(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:Mt(e.body,`b${t}`)},`text-${t}`))})}c();function Pt(e){return e.replace(/^@camstack\/(addon-)?/,``)}function Ft(e,t,n){let r=ht(e,n);return r.some(e=>e.version===t)?r:[{version:t,distTags:[],deprecated:void 0},...r]}function It({pending:e,failed:n,body:r,missing:i}){let{t:o}=G();return e?t(`div`,{className:`flex items-center gap-2 py-6 text-xs text-foreground-subtle`,children:[a(O,{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(Nt,{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 Lt({target:e,installing:n,installError:r,onClose:i,onInstall:o}){let{t:c}=G(),[l,u]=s(e.version),[d,f]=s(!1),p=P({name:e.name}),m=Te({name:e.name,version:l}),h=p.data??[],g=gt(h),_=Ft(h,l,d),v=m.data;return a(oe,{open:!0,onOpenChange:e=>!e&&i(),children:t(pe,{width:`lg`,placement:`sheet-on-mobile`,scroll:`body`,children:[a(Ce,{children:a(se,{children:c(`addons.installDialog.title`,`Install {{name}}`,{name:Pt(e.name)})})}),t(fe,{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(C,{"aria-label":c(`addons.installDialog.version`,`Version`),value:l,options:_.map(e=>({value:e.version,label:mt(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(V,{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(R,{defaultValue:`readme`,children:[t(B,{children:[a(U,{value:`readme`,children:c(`addons.installDialog.readme`,`README`)}),a(U,{value:`changelog`,children:c(`addons.installDialog.changelog`,`CHANGELOG`)})]}),a(M,{value:`readme`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(It,{pending:m.isPending,failed:m.isError,body:v?.readme,missing:c(`addons.installDialog.missingReadme`,`This package has no README.`)})})}),a(M,{value:`changelog`,children:a(`div`,{className:`max-h-80 overflow-auto rounded-md border border-border bg-background p-3`,children:a(It,{pending:m.isPending,failed:m.isError,body:v?.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(ce,{children:[a(V,{type:`button`,variant:`outline`,size:`sm`,onClick:i,children:c(`common.cancel`,`Cancel`)}),a(V,{type:`button`,size:`sm`,disabled:n||l.length===0,onClick:()=>o(e.name,l),children:n?a(O,{className:`h-3.5 w-3.5 animate-spin`}):c(`addons.installDialog.install`,`Install`)})]})]})})}function Rt(e,t){let n=new Map;for(let r of e){if(r.isHub||r.onHub||Fe(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 zt({selectedNode:e}){let{t:n}=G(),{data:r}=he(ut,{staleTime:dt});if(r===void 0)return null;let i=Rt(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(x,{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(pt,{packageName:n.packageName,displayName:n.packageName,selectedNode:e,hideNodeAction:e.isHub})]},n.packageName))]})}function Bt({addon:e,installing:n,onInstall:r}){let{t:i}=G();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(ue,{variant:`success`,icon:a(T,{className:`h-3 w-3`}),children:e.installedVersion??i(`system.capabilityCatalog.installed`,`Installed`)}):t(V,{size:`sm`,onClick:()=>r(e),disabled:n,className:`shrink-0`,children:[n?a(O,{className:`h-3 w-3 animate-spin`}):a(D,{className:`h-3 w-3`}),i(`system.capabilityCatalog.install`,`Install`)]})]})}function Vt({capability:e,installing:n,onInstall:r}){let{t:i}=G(),{data:o,isPending:s,isError:c}=Ne({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(O,{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(Bt,{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 Ht(e){return e===`npm`||e===`dev`?e:null}var Ut=`rounded-full border border-primary bg-primary/10 px-2 py-0.5 text-[10px] text-foreground`,Wt=`rounded-full border border-border px-2 py-0.5 text-[10px] text-foreground-muted hover:bg-surface-hover`,Gt=[{seconds:900,label:`15m`},{seconds:3600,label:`1h`},{seconds:21600,label:`6h`},{seconds:43200,label:`12h`},{seconds:86400,label:`24h`}],Kt={id:`hub`,name:`Hub`,isHub:!0,isOnline:!0};function qt(e,t){let n=e??`hub-only`;return n===`any-node`?!0:n===`hub-only`?t:!t}function Jt(e){return e===`local`?`dev`:`npm`}function Yt(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 Xt(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 Zt({addons:c,clusterStatus:u,selectedNode:f,onRefresh:p,listPhase:m}){let{t:h}=G(),g=l(),[_,v]=s(``),[x,S]=s(!1),te=e(_),[ne,w]=s(!1),T=n(null);o(()=>{if(!ne)return;let e=e=>{T.current&&!T.current.contains(e.target)&&w(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[ne]);let{data:E}=ve({nodeId:f.id}),re=r(()=>{let e=new Map;for(let t of E??[])t.blockedBy===void 0&&e.set(t.name,t.latestVersion);return e},[E]),ie=r(()=>{let e=new Map;for(let t of E??[]){let n=t.blockedBy?.find(e=>e.kind===`server-too-old`);n!==void 0&&e.set(t.name,{latestVersion:t.latestVersion,requiredServer:n.required})}return e},[E]),k=r(()=>(E??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0).length,[E]),[A,oe]=s(()=>new Set),[se,ce]=s(()=>new Map),le=i(e=>{oe(t=>new Set(t).add(e))},[]),ue=i(e=>{oe(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),fe=i((e,t)=>{ce(n=>new Map(n).set(e,t))},[]),pe=i(e=>{ce(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),j=de({onMutate:e=>{le(e.name),pe(e.name)},onSuccess:(e,t)=>{ue(t.name);let n=e;if(n&&n.success===!1){fe(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)=>{ue(t.name),fe(t.name,e instanceof Error?e.message:String(e))}}),M=tt(),N=n(new Set);o(()=>{let e=new Set;for(let[t,n]of M)$e(n)&&e.add(t);let t=[...N.current].some(t=>!e.has(t));N.current=e,t&&(g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addons`,`listUpdates`]]}))},[M,g]);let{data:P}=me(void 0),F=W({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),he=je({onSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`,`getAutoUpdateSettings`]]})}}),{data:I,isFetching:ge}=Ne({query:te||void 0},{enabled:ne}),L=ae(),{data:R}=ye(void 0),z=R?.requestedAt,[B,be]=s(null),[xe,Se]=s(!1);o(()=>{if(R?.kind===`framework-bulk-update`&&R.requestedAt!==B){be(R.requestedAt),Se(!0);let e=window.setTimeout(()=>Se(!1),6e3);return()=>window.clearTimeout(e)}},[z,B,R]),ee();let Ce=i(async()=>{let e=(E??[]).filter(e=>!e.isSystem&&e.blockedBy===void 0);if(e.length!==0){if(!f.isHub){for(let t of e)await j.mutateAsync({name:t.name,version:t.latestVersion,nodeId:f.id});return}await L.mutateAsync({kind:`update`,targets:e.map(e=>({name:e.name,version:e.latestVersion})),nodeIds:[f.id]})}},[E,f.id,f.isHub,L,j]),[H,U]=s(null),[Te,Ee]=s(null),De=e=>{Ee(null),U(e)},Oe=_e({onSuccess:()=>{U(null),Ee(null),g.invalidateQueries({queryKey:[[`addons`]]}),g.invalidateQueries({queryKey:[[`addonPages`]]}),g.invalidateQueries({queryKey:[[`capabilities`]]}),g.invalidateQueries({queryKey:[[`integrations`]]})},onError:e=>{Ee(e instanceof Error?e.message:`Install failed`)}}),[ke,Ae]=s(`type`),[Pe,Fe]=s(()=>typeof window>`u`?`grouped`:window.localStorage.getItem(`camstack.addons.viewMode`)===`flat`?`flat`:`grouped`),Le=e=>{Fe(e),typeof window<`u`&&window.localStorage.setItem(`camstack.addons.viewMode`,e)},[K,q]=Re(),J=K.get(`capability`),Ue=K.get(`updatable`)===`1`,Y=K.get(`error`)===`1`,X=Ht(K.get(`source`)),Z=ze(K.get(Ve))===`integration`,{data:Ge}=we(void 0,{enabled:Z}),Ke=r(()=>Ge===void 0?null:new Set(Ge.map(e=>e.addonId)),[Ge]),qe=i(e=>{let t=new URLSearchParams(K);e?t.set(Ve,`integration`):t.delete(Ve),q(t,{replace:!0})},[K,q]),Je=i(e=>{let t=new URLSearchParams(K);e?t.set(`updatable`,`1`):t.delete(`updatable`),q(t,{replace:!0})},[K,q]),Ye=i(e=>{let t=new URLSearchParams(K);e?t.set(`error`,`1`):t.delete(`error`),q(t,{replace:!0})},[K,q]),Xe=i(e=>{let t=new URLSearchParams(K);e===null?t.delete(`source`):t.set(`source`,e),q(t,{replace:!0})},[K,q]),Ze=r(()=>c.filter(e=>We(e.process)!==null).length,[c]),Q=r(()=>{let e=c.filter(e=>!Ie(e.manifest.packageName));return f.isHub||(e=e.filter(e=>qt(e.placement,f.isHub))),J&&(e=e.filter(e=>(e.manifest.capabilities??[]).some(e=>(typeof e==`string`?e:e.name)===J))),Z&&(e=[...Be(e,Ke)]),Ue&&(e=e.filter(e=>{let t=e.manifest.packageName;return t!==void 0&&re.has(t)})),X!==null&&(e=e.filter(e=>Jt(e.installSource)===X)),Y&&(e=e.filter(e=>We(e.process)!==null)),e},[c,f.isHub,J,Ue,X,Y,Z,Ke,re]),Qe=()=>{let e=new URLSearchParams(K);e.delete(`capability`),q(e,{replace:!0})},et=Pe===`flat`?Q:Xt(Q),nt=r(()=>{let e=[...et];switch(ke){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},[et,ke]);return t(`div`,{className:`space-y-3`,children:[a(He,{open:x,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:h(`systemPage.addons.updateFailed`,{name:e})}),a(`div`,{className:`text-foreground-subtle font-mono`,children:n})]}),a(V,{variant:`unstyled`,type:`button`,onClick:()=>pe(e),className:`text-foreground-subtle hover:text-foreground text-[10px]`,children:h(`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:h(`admin.system.addons.sort`,`Sort:`)}),t(C,{wrapperClassName:`inline-block w-auto`,value:ke,onChange:e=>Ae(e.target.value),children:[a(`option`,{value:`type`,children:h(`admin.system.addons.bundlesFirst`,`Bundles first`)}),a(`option`,{value:`name`,children:h(`admin.system.addons.name`,`Name`)}),a(`option`,{value:`source`,children:h(`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:h(`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(V,{variant:`unstyled`,type:`button`,onClick:()=>Le(e),className:`px-2 py-1 transition-colors capitalize ${Pe===e?`bg-primary/10 text-primary`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`}`,title:e===`grouped`?h(`admin.system.addons.groupMultiAddonPackagesInto`,`Group multi-addon packages into a bundle card`):h(`admin.system.addons.showEveryAddonAsIts`,`Show every addon as its own card`),children:e},e))})]}),f.isHub&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(b,{className:`h-3 w-3 text-foreground-subtle`}),a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`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(V,{variant:`unstyled`,type:`button`,onClick:()=>F.mutate({channel:e}),disabled:F.isPending,className:`px-2 py-1 transition-colors capitalize ${P?.channel===e?e===`off`?`bg-gray-700 text-gray-200`:e===`latest`?`bg-blue-500/20 text-blue-400`:`bg-amber-500/20 text-amber-400`:`bg-transparent text-foreground-subtle hover:bg-surface-hover`} ${e===`off`?``:`border-l border-border`}`,children:e},e))})]}),f.isHub&&t(`div`,{className:`flex items-center gap-1.5`,children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.checkEvery`,`Check every:`)}),a(C,{wrapperClassName:`inline-block w-auto`,className:`font-medium text-foreground-subtle`,value:P?.updateCheckIntervalSeconds??21600,disabled:he.isPending||P===void 0,onChange:e=>{P!==void 0&&he.mutate({channel:P.channel,updateCheckIntervalSeconds:Number(e.target.value)})},children:Gt.map(e=>a(`option`,{value:e.seconds,children:e.label},e.seconds))})]}),k>0&&t(V,{variant:`unstyled`,type:`button`,onClick:()=>void Ce(),disabled:L.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:[L.isPending?a(O,{className:`w-3 h-3 animate-spin`}):a(D,{className:`w-3 h-3`}),L.isPending?h(`admin.system.addons.updating`,`Updating…`):h(`admin.system.addons.updateAll`,`Update All ({{nonSystemUpdateCount}})`,{nonSystemUpdateCount:k})]})]}),t(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`group`,"aria-label":h(`admin.system.addons.filterInstalledAddons`,`Filter installed addons`),children:[a(`span`,{className:`text-[10px] text-foreground-subtle`,children:h(`admin.system.addons.filter`,`Filter:`)}),[{id:`integrations`,label:h(`admin.system.addons.integrations`,`Integrations`),pressed:Z,toggle:()=>qe(!Z)},{id:`updatable`,label:h(`admin.system.addons.updatable`,`Updatable`),pressed:Ue,toggle:()=>Je(!Ue)},{id:`error`,label:h(`admin.system.addons.inError`,`In error ({{count}})`,{count:Ze}),pressed:Y,toggle:()=>Ye(!Y)},{id:`npm`,label:`npm`,pressed:X===`npm`,toggle:()=>Xe(X===`npm`?null:`npm`)},{id:`dev`,label:h(`admin.system.addons.dev`,`Dev`),pressed:X===`dev`,toggle:()=>Xe(X===`dev`?null:`dev`)}].map(e=>a(V,{variant:`unstyled`,type:`button`,"aria-pressed":e.pressed,onClick:e.toggle,className:e.pressed?Ut:Wt,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:T,children:[a(Me,{type:`text`,searchHotkey:!0,value:_,onChange:e=>{v(e.target.value),w(!0)},onFocus:()=>w(!0),placeholder:h(`admin.system.addons.searchAddonsOnNpm`,`Search addons on npm...`),"aria-label":h(`admin.system.addons.searchAddonsOnNpm2`,`Search addons on npm`),disabled:L.isPending,leftSlot:a(d,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),rightSlot:ge?a(O,{className:`h-3 w-3 animate-spin`}):void 0}),ne&&I&&I.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:[I.length>0&&a(`div`,{className:`px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border`,children:h(`systemPage.addons.npmResults`,{count:I.length})}),I&&I.length>0&&a(`div`,{className:`max-h-72 overflow-auto divide-y divide-border`,children:I.map(e=>a(Bt,{addon:e,installing:Oe.isPending,onInstall:e=>De({name:e.name,version:e.version,description:e.description})},e.name))})]})]}),a(Dt,{onUploadSuccess:()=>{g.invalidateQueries({queryKey:[[`addons`]]}),p()}})]}),J&&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:h(`admin.system.addons.filteringByCapability`,`Filtering by capability:`)}),a(`span`,{className:`font-mono text-primary font-semibold`,children:J}),a(V,{variant:`unstyled`,type:`button`,onClick:Qe,className:`ml-auto text-xs text-foreground-subtle hover:text-foreground underline`,children:h(`admin.system.addons.clear`,`Clear`)})]}),J&&a(Vt,{capability:J,installing:Oe.isPending,onInstall:e=>De({name:e.name,version:e.version,description:e.description})}),J&&Q.length>0&&a(`h2`,{className:`text-[10px] uppercase tracking-wide text-foreground-subtle`,children:h(`admin.system.addons.installed`,`Installed`)}),xe&&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(y,{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:h(`admin.system.addons.bulkUpdateCompleted`,`Bulk update completed`)}),a(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:h(`admin.system.addons.systemPackagesUpdatedHubRestarted`,`System packages updated — hub restarted successfully.`)})]})]}),m===`pending`&&t(`div`,{className:`flex items-center gap-2 text-xs text-foreground-subtle`,children:[a(O,{className:`h-3 w-3 animate-spin`}),h(`admin.system.addons.loadingInstalled`,`Loading installed addons…`)]}),m===`error`&&a(`div`,{className:`text-xs text-danger`,children:h(`admin.system.addons.failedToLoadAddons`,`Failed to load addons`)}),m===`ready`&&Q.length===0&&a(`div`,{className:`text-xs text-foreground-subtle`,children:c.length===0?h(`admin.system.addons.noAddonsInstalled`,`No addons installed`):J?h(`admin.system.addons.noInstalledAddonDeclaresThe`,`No installed addon declares the "{{capabilityFilter}}" capability. Any addon you can install appears under "Available to install" above.`,{capabilityFilter:J}):h(`admin.system.addons.noAddonsCompatibleWithPlacement`,`No addons compatible with {{name}} (placement filter active)`,{name:f.name})}),a(`div`,{className:`space-y-1.5`,children:m===`ready`&&nt.map(e=>{let t=$(e)?e.bundle.packageName:e.manifest.packageName,n=re.get(t),r=ie.get(t),i=$(e)?e.representative:e,o=n?e=>j.mutate({name:t,version:e,nodeId:f.id}):void 0,s=M.get(t)??null,c=s!==null&&$e(s);return a(Tt,{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:L.isPending,selectedNode:f},$(e)?t:e.manifest.id)})}),H!==null&&a(Lt,{target:H,installing:Oe.isPending,installError:Te,onClose:()=>U(null),onInstall:(e,t)=>Oe.mutate({packageName:e,version:t})})]})}function Qt(){let{t:e}=G(),r=l(),{data:i}=Ee(void 0),{nodes:s}=le(),{selection:c,selectNode:u,requestedNodeId:d}=Ue(s.length>0?s:[Kt]),f=c.node??Kt,p=f.id,m=s.length>0?c.staleNodeId:null,{data:h,isLoading:g,isError:_}=De({nodeId:p}),v=H(),y=L(),x=v.isPending||y.isPending,ee=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 te=(h??[]).map(Yt).filter(e=>e!==null);return t(q,{children:[t(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[a(F,{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:te.length})}),t(V,{variant:`unstyled`,type:`button`,onClick:()=>void ee(),disabled:x,className:`inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors`,title:e(`admin.system.addons.reFetchAddonsCheckNpm`,`Re-fetch addons + check npm for new versions`),children:[a(b,{className:`w-3 h-3 ${x?`animate-spin`:``}`}),e(`admin.system.addons.checkForUpdates`,`Check for updates`)]})]})]}),a(J,{staleNodeId:m,shownNodeName:f.name}),a(zt,{selectedNode:f}),a(Zt,{addons:te,clusterStatus:i,selectedNode:f,onRefresh:()=>void ee(),listPhase:g?`pending`:_?`error`:`ready`})]})}export{Qt as AddonsPage};
|