local-operator-ui 0.34.54 → 0.34.56
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/out/main/index.js +178 -9
- package/out/renderer/assets/{_basePickBy-CjlcNifv.js → _basePickBy-BZpmSLU-.js} +1 -1
- package/out/renderer/assets/{_baseUniq-o0KeBMbn.js → _baseUniq-5Fk4AsiY.js} +1 -1
- package/out/renderer/assets/{agent-details-page-B_mPfefi.js → agent-details-page-BEoctGwH.js} +2 -2
- package/out/renderer/assets/agent-hub-page-DVtEYZne.js +11 -0
- package/out/renderer/assets/{agents-page-DOt4Ktjv.js → agents-page-CqlFD0Ps.js} +3 -3
- package/out/renderer/assets/{arc-DFVKfWQu.js → arc-Cgq0RekE.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-vpPdmlx-.js → architectureDiagram-IEHRJDOE-SKpw5bNL.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-R2vBVEG1.js → blockDiagram-JOT3LUYC-jQv0ffHr.js} +1 -1
- package/out/renderer/assets/{book-open-CfuxuX-l.js → book-open--60aKTv6.js} +1 -1
- package/out/renderer/assets/browser-page-jc3r193W.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-DbKuqaik.js → browser-webauthn-prompt-PeVRs-qh.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-BdEM26t6.js → c4Diagram-VJAJSXHY-BlRyRK9C.js} +1 -1
- package/out/renderer/assets/channel-BpN7da5J.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-BoFwJNuc.js → chunk-4BMEZGHF-BBVAaHlr.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-ho2uDxLt.js → chunk-A2AXSNBT-sJR5i1wN.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-TPmT1lR6.js → chunk-AEK57VVT-C8IWMgPw.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-DLDnsndg.js → chunk-D6G4REZN-DTfUS03C.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-CogvS2RR.js → chunk-RZ5BOZE2-DiGk8o7V.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BX6k9Ig_.js → chunk-XZIHB7SX-Mamouuqj.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-IcRW-YOl.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-IcRW-YOl.js +1 -0
- package/out/renderer/assets/clone-Dri7yO5y.js +1 -0
- package/out/renderer/assets/{console-mirror-D4VUczn2.js → console-mirror-Ch4jKiRK.js} +1 -1
- package/out/renderer/assets/{consoleCapture-BZscABJW.js → consoleCapture-BYlfSgpd.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-_j7A_EDF.js → conversation-input-sync-Cs9wr7F7.js} +259 -259
- package/out/renderer/assets/{dagre-OKDRZEBW-CnWKvNVv.js → dagre-OKDRZEBW-D5TY-UFL.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-CnaQJTb1.js → diagram-SSKATNLV-BTiHJkCz.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-C0X5Htj5.js → diagram-VNBRO52H-CBxLprav.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-BlWSXVBt.js → erDiagram-Q7BY3M3F-9aF5V3AY.js} +1 -1
- package/out/renderer/assets/{error-boundary-BCQ7FGQc.js → error-boundary-B5YLbOOu.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-CSMU0Hc_.js → flowDiagram-4HSFHLVR-BXlN8K06.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-OuBtu3nI.js → ganttDiagram-APWFNJXF-1FcF-Cau.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-z8O9AgtQ.js → gitGraphDiagram-7IBYFJ6S-CjCM20j_.js} +1 -1
- package/out/renderer/assets/{graph-DE2ohxxG.js → graph-CGuSrplO.js} +1 -1
- package/out/renderer/assets/{index-BcVwaP5j.js → index-5brl9P13.js} +1 -1
- package/out/renderer/assets/{index-DxyRyuQP.css → index-BUuvY2SU.css} +1 -1
- package/out/renderer/assets/{index-QCa7n3qU.js → index-CalJ1cZq.js} +1 -1
- package/out/renderer/assets/index-DbzmFwlT.js +57 -0
- package/out/renderer/assets/{index-EI_2-v5u.js → index-rnB6EiBX.js} +197 -197
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-a0rOJyNn.js → infoDiagram-PH2N3AL5-Bqs15-nE.js} +1 -1
- package/out/renderer/assets/{installer-BRjexwGb.js → installer-DZXz4Bgj.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-BaWlQxzG.js → journeyDiagram-U35MCT3I-BkSqHNi1.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-ISbUCJsb.js → kanban-definition-NDS4AKOZ-CGnCYoin.js} +1 -1
- package/out/renderer/assets/{layout-Cq5p0Yo5.js → layout-BM7AzCJ1.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-w-ygCimA.js → legacy-agents-page-B8f2tJOf.js} +7 -7
- package/out/renderer/assets/{mermaid.core-BZ_OD6fR.js → mermaid.core-C14g_ZP7.js} +5 -5
- package/out/renderer/assets/mesh-page-DCCummN5.js +1 -0
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-CAnWrx3w.js → mindmap-definition-ALO5MXBD-D7Z-SM4X.js} +1 -1
- package/out/renderer/assets/mini-CcJI0pQs.js +1 -0
- package/out/renderer/assets/{notebook-pen-Dd0WXtBw.js → notebook-pen-Dj0km82T.js} +1 -1
- package/out/renderer/assets/{org-access-CkXCfgnJ.js → org-access-D0eAQUWQ.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-CnNhHebI.js → org-surface-gate-Bgznt94a.js} +1 -1
- package/out/renderer/assets/{page-header-Dl5IO6UP.js → page-header-B3mzM2nC.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-CrxsZY1R.js → pieDiagram-IB7DONF6-3pVvYdop.js} +1 -1
- package/out/renderer/assets/projects-page-T2Yw-kRf.js +45 -0
- package/out/renderer/assets/{publication-validation-CfKQMeAn.js → publication-validation-BIJPIOf1.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-FDR-PDld.js → quadrantDiagram-7GDLP6J5-Dttg4cdR.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BNPTl6F1.js → radar-MK3ICKWK-Bd7wnpF5.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-eShZasz1.js → radient-auth-buttons-MPoHRsQX.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DYSZWyII.js → requirementDiagram-KVF5MWMF-Jiaz4ehK.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-0ynlxxtV.js → sankeyDiagram-QLVOVGJD-C4tMl9ww.js} +1 -1
- package/out/renderer/assets/{schedules-page-5j5ANXIf.js → schedules-page-CR7bLqQt.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-Dw4Xe-1g.js → sequenceDiagram-X6HHIX6F-DncET3lE.js} +1 -1
- package/out/renderer/assets/settings-page-B_D-wGm4.js +292 -0
- package/out/renderer/assets/{stateDiagram-DGXRK772-C4hZ7GES.js → stateDiagram-DGXRK772-BI1ziKRV.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Bqeb-TkR.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-BuKwQy9m.js → timeline-definition-BDJGKUSR-DxR2rlJV.js} +1 -1
- package/out/renderer/assets/{ui-preferences-store-BSjv1eml.js → ui-preferences-store-D1IJShox.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CHYPRtS_.js → use-download-agent-mutation-C6TvAwyM.js} +4 -4
- package/out/renderer/assets/{use-memberships-query-DG-_x04X.js → use-memberships-query-AlVCuF9E.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-CdDuQ-c-.js → use-session-snapshot-XM0bTxHC.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-Da65s1FG.js → xychartDiagram-VJFVF3MP-CJW_dOUR.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +2 -2
- package/out/renderer/assets/agent-hub-page-BYHsrmlA.js +0 -11
- package/out/renderer/assets/browser-page-BpsxcPyu.js +0 -1
- package/out/renderer/assets/channel--0Jo_Ezu.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BTAknOfl.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BTAknOfl.js +0 -1
- package/out/renderer/assets/clone-AE7GdVaL.js +0 -1
- package/out/renderer/assets/index-C9huVbt8.js +0 -57
- package/out/renderer/assets/mesh-page-GPZRPR4j.js +0 -1
- package/out/renderer/assets/mini-CQ7ORVw7.js +0 -1
- package/out/renderer/assets/projects-page-ygyrTO2Y.js +0 -45
- package/out/renderer/assets/settings-page-rEYr23iA.js +0 -292
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-77mQmjut.js +0 -1
package/out/main/index.js
CHANGED
|
@@ -32466,7 +32466,22 @@ const enUiChatComposer = {
|
|
|
32466
32466
|
"ui.chat.composer.start_recording_hint": "Start recording ({shortcut} or hold {pushToTalk})",
|
|
32467
32467
|
"ui.chat.composer.processing_audio": "Processing audio",
|
|
32468
32468
|
"ui.chat.composer.welcome": "What can I help you with today?",
|
|
32469
|
-
"ui.chat.composer.delivery_remedies_hint": "The message that could not be delivered has Send again and Edit controls in the conversation above this box: press Shift+Tab to reach them."
|
|
32469
|
+
"ui.chat.composer.delivery_remedies_hint": "The message that could not be delivered has Send again and Edit controls in the conversation above this box: press Shift+Tab to reach them.",
|
|
32470
|
+
"ui.chat.composer.secret_ask_notice": "The agent is asking for a secret. Enter it in the asks panel — you can keep chatting meanwhile.",
|
|
32471
|
+
"ui.chat.composer.secret_ask_open": "Open asks",
|
|
32472
|
+
"ui.chat.composer.secret_confirm_message": "This looks like a password or key. Where should it go?",
|
|
32473
|
+
"ui.chat.composer.secret_confirm_chars": "{count, plural, one {# character} other {# characters}}",
|
|
32474
|
+
"ui.chat.composer.secret_confirm_sending": "Sending to the secret field…",
|
|
32475
|
+
"ui.chat.composer.secret_confirm_put": "Put in secret field",
|
|
32476
|
+
"ui.chat.composer.secret_confirm_put_multi": "Open asks panel",
|
|
32477
|
+
"ui.chat.composer.secret_confirm_send": "Send as message",
|
|
32478
|
+
"ui.chat.composer.secret_confirm_cancel": "Cancel",
|
|
32479
|
+
"ui.chat.composer.secret_fill_locked": "Not put in the secret field: a message is still sending. Your text is kept — try again once it lands.",
|
|
32480
|
+
"ui.chat.composer.secret_fill_changed": "Not put in the secret field: the request changed first. Your text is kept.",
|
|
32481
|
+
"ui.chat.composer.secret_fill_gone": "Not put in the secret field: that request is no longer waiting. Your text is kept.",
|
|
32482
|
+
"ui.chat.composer.secret_fill_refused": "The secret field did not take that value. Your text is kept — the asks panel shows why.",
|
|
32483
|
+
"ui.chat.composer.secret_fill_unavailable": "Could not reach the secret field. Your text is kept.",
|
|
32484
|
+
"ui.chat.composer.secret_fill_multi": "This request asks for more than one secret. Your text is kept — choose the field in the asks panel."
|
|
32470
32485
|
};
|
|
32471
32486
|
const enUiChatComposerMedia = {
|
|
32472
32487
|
"ui.chat.composer_media.recording": "Recording",
|
|
@@ -34316,7 +34331,7 @@ const enUiSettingsAppearanceWindowGlass = {
|
|
|
34316
34331
|
"ui.settings.appearance.window_glass.coverage_sidebars": "Sidebars only",
|
|
34317
34332
|
"ui.settings.appearance.window_glass.coverage_full": "Full app",
|
|
34318
34333
|
"ui.settings.appearance.window_glass.intensity_label": "Frosted to see-through",
|
|
34319
|
-
"ui.settings.appearance.window_glass.intensity_description": "Left is frosted: mostly solid with a hint of the desktop. Right is see-through, as clear as every theme's text allows. Message blocks, inputs and code stay solid
|
|
34334
|
+
"ui.settings.appearance.window_glass.intensity_description": "Left is frosted: mostly solid with a hint of the desktop. Right is see-through, as clear as every theme's text allows. Message blocks and cards become tints, inputs stay distinct from the glass, and code, documents and images stay solid.",
|
|
34320
34335
|
"ui.settings.appearance.window_glass.material_label": "Material",
|
|
34321
34336
|
"ui.settings.appearance.window_glass.material_description": "The system material behind the app. It also sets how far see-through can go.",
|
|
34322
34337
|
"ui.settings.appearance.window_glass.material_window": "Window",
|
|
@@ -34684,6 +34699,27 @@ const enUiSettings = {
|
|
|
34684
34699
|
"ui.settings.profile.retry": "Retry",
|
|
34685
34700
|
"ui.settings.profile.retrying": "Retrying"
|
|
34686
34701
|
};
|
|
34702
|
+
const enUiSettingsModelDefaultEffort = {
|
|
34703
|
+
"ui.settings.model.default_effort.label": "Default effort",
|
|
34704
|
+
"ui.settings.model.default_effort.placeholder": "Select an effort level",
|
|
34705
|
+
"ui.settings.model.default_effort.busy": "Saving the default effort",
|
|
34706
|
+
"ui.settings.model.default_effort.model_default": "Model default",
|
|
34707
|
+
"ui.settings.model.default_effort.model_default_resolves": "Runs at {level} for this model.",
|
|
34708
|
+
"ui.settings.model.default_effort.helper_ready": "Applies to new conversations. Model default lets this model choose its own level.",
|
|
34709
|
+
"ui.settings.model.default_effort.loading": "Checking this model's effort levels…",
|
|
34710
|
+
"ui.settings.model.default_effort.error": "This model's effort levels could not be read.",
|
|
34711
|
+
"ui.settings.model.default_effort.no_model": "Select a model to choose its effort levels.",
|
|
34712
|
+
"ui.settings.model.default_effort.no_home": "Your home folder is not available yet, so effort levels cannot be read.",
|
|
34713
|
+
"ui.settings.model.default_effort.settings_loading": "Checking your saved default effort…",
|
|
34714
|
+
"ui.settings.model.default_effort.settings_error": "Your saved default effort could not be read.",
|
|
34715
|
+
"ui.settings.model.default_effort.unresolved": "This model has not reported its effort levels yet.",
|
|
34716
|
+
"ui.settings.model.default_effort.empty": "Effort is not adjustable on this model.",
|
|
34717
|
+
"ui.settings.model.default_effort.one_level": "This model offers one effort level: {level}.",
|
|
34718
|
+
"ui.settings.model.default_effort.one_level_sentinel": "This model has no effort level to choose: it always runs at its own default.",
|
|
34719
|
+
"ui.settings.model.default_effort.clamped": "{level} is not available on {model}. Using {resolved}.",
|
|
34720
|
+
"ui.settings.model.default_effort.clamped_unset": "{level} is not available on {model}. Using Model default.",
|
|
34721
|
+
"ui.settings.model.default_effort.save_failed": "Your default effort was not saved."
|
|
34722
|
+
};
|
|
34687
34723
|
const enUiSettingsModel = {
|
|
34688
34724
|
"ui.settings.model.backend_setting_combos.search_providers": "Search providers",
|
|
34689
34725
|
"ui.settings.model.backend_setting_combos.search_models": "Search models",
|
|
@@ -34718,6 +34754,10 @@ const enUiSettingsModel = {
|
|
|
34718
34754
|
"ui.settings.model.model_setting_options.provider_detail": "{provider}{aggregated, select, yes {, aggregated} other {}}{credential, select, signed_in {, signed in} missing {, no credential} other {}}",
|
|
34719
34755
|
"ui.settings.model.system_prompt.load_failed": "Failed to load system prompt: {reason}"
|
|
34720
34756
|
};
|
|
34757
|
+
const enUiSettingsModelProviderCallout = {
|
|
34758
|
+
"ui.settings.model.provider_callout.sentence": "Sign in with a provider to reach more models. Your existing Claude, ChatGPT or Radient subscription works here, so you don't need an API key. Connect one in ",
|
|
34759
|
+
"ui.settings.model.provider_callout.providers_link": "Providers"
|
|
34760
|
+
};
|
|
34721
34761
|
const enUiSettingsNavigation = {
|
|
34722
34762
|
"ui.settings.navigation.settings_page.the_local_operator_server_is_taking_longer_than_usual_to_answer_i": "The Local Operator server is taking longer than usual to answer. If it does not respond, you will be able to retry from here.",
|
|
34723
34763
|
"ui.settings.navigation.settings_page.your_settings_could_not_be_loaded": "Your settings could not be loaded.",
|
|
@@ -36280,7 +36320,9 @@ const bundledEnglish = {
|
|
|
36280
36320
|
...enUiSettingsConfiguration,
|
|
36281
36321
|
...enUiSettingsIntegrations,
|
|
36282
36322
|
...enUiSettings,
|
|
36323
|
+
...enUiSettingsModelDefaultEffort,
|
|
36283
36324
|
...enUiSettingsModel,
|
|
36325
|
+
...enUiSettingsModelProviderCallout,
|
|
36284
36326
|
...enUiSettingsNavigation,
|
|
36285
36327
|
...enUiSettingsShortcuts,
|
|
36286
36328
|
...enUiSettingsSpeech,
|
|
@@ -45557,6 +45599,50 @@ function miniViewErrorSurfaceHtml() {
|
|
|
45557
45599
|
</style></head>
|
|
45558
45600
|
<body><p><strong>Quick send could not open.</strong> Try the hotkey again, or restart Local Operator if it keeps failing.</p></body></html>`;
|
|
45559
45601
|
}
|
|
45602
|
+
function miniGlassPlan(input) {
|
|
45603
|
+
const { mechanism, active, applied, launchedGlassOn, material } = input;
|
|
45604
|
+
if (mechanism === "vibrancy") {
|
|
45605
|
+
if (active)
|
|
45606
|
+
return {
|
|
45607
|
+
applied: "vibrancy",
|
|
45608
|
+
steps: [{ kind: "transparent-ground" }, { kind: "vibrancy", material }]
|
|
45609
|
+
};
|
|
45610
|
+
if (applied === "vibrancy")
|
|
45611
|
+
return {
|
|
45612
|
+
applied: "none",
|
|
45613
|
+
steps: [
|
|
45614
|
+
{ kind: "vibrancy", material: null },
|
|
45615
|
+
{ kind: "opaque-ground" }
|
|
45616
|
+
]
|
|
45617
|
+
};
|
|
45618
|
+
return { applied, steps: [] };
|
|
45619
|
+
}
|
|
45620
|
+
if (mechanism === "background-material") {
|
|
45621
|
+
if (active && launchedGlassOn)
|
|
45622
|
+
return {
|
|
45623
|
+
applied: "background-material",
|
|
45624
|
+
steps: [
|
|
45625
|
+
{ kind: "transparent-ground" },
|
|
45626
|
+
{ kind: "background-material", material }
|
|
45627
|
+
]
|
|
45628
|
+
};
|
|
45629
|
+
if (!active && applied === "background-material")
|
|
45630
|
+
return {
|
|
45631
|
+
applied: "none",
|
|
45632
|
+
steps: [
|
|
45633
|
+
{ kind: "background-material", material: null },
|
|
45634
|
+
{ kind: "opaque-ground" }
|
|
45635
|
+
]
|
|
45636
|
+
};
|
|
45637
|
+
}
|
|
45638
|
+
return { applied, steps: [] };
|
|
45639
|
+
}
|
|
45640
|
+
function miniDocumentState(state2, launchedGlassOn) {
|
|
45641
|
+
return {
|
|
45642
|
+
...state2,
|
|
45643
|
+
restartRequired: !state2.capability.liveToggle && state2.active !== launchedGlassOn
|
|
45644
|
+
};
|
|
45645
|
+
}
|
|
45560
45646
|
function createMiniView(options) {
|
|
45561
45647
|
const window = new electron.BrowserWindow({
|
|
45562
45648
|
width: MINI_VIEW_WIDTH,
|
|
@@ -45570,8 +45656,18 @@ function createMiniView(options) {
|
|
|
45570
45656
|
*/
|
|
45571
45657
|
useContentSize: true,
|
|
45572
45658
|
show: false,
|
|
45573
|
-
/*
|
|
45574
|
-
|
|
45659
|
+
/*
|
|
45660
|
+
* The ground under an as-yet-unpainted document, WITH the glass options in
|
|
45661
|
+
* the one order that keeps default-off identical: the opaque ground first,
|
|
45662
|
+
* the glass after it, so only an ACTIVE glass overrides it
|
|
45663
|
+
* (`groundWithGlass`'s contract).
|
|
45664
|
+
*/
|
|
45665
|
+
...groundWithGlass(
|
|
45666
|
+
MINI_VIEW_GROUND,
|
|
45667
|
+
options.glass.settings,
|
|
45668
|
+
options.glass.capability,
|
|
45669
|
+
process.platform
|
|
45670
|
+
),
|
|
45575
45671
|
// A composer that floats over other apps carries no frame of its own:
|
|
45576
45672
|
// the app's own rows are the entire surface, and the one sanctioned
|
|
45577
45673
|
// elevation step is the card's ground.
|
|
@@ -45612,6 +45708,12 @@ function createMiniView(options) {
|
|
|
45612
45708
|
*/
|
|
45613
45709
|
additionalArguments: [
|
|
45614
45710
|
windowChromeArgumentFor(process.platform, options.chromeMode),
|
|
45711
|
+
/*
|
|
45712
|
+
* THE FIRST-FRAME GLASS FACT, the same entry the main window carries:
|
|
45713
|
+
* without it the popout's first paint is the opaque card and the
|
|
45714
|
+
* material arrives late as a visible jump.
|
|
45715
|
+
*/
|
|
45716
|
+
windowGlassArgument(options.glass.state, options.glass.scheme),
|
|
45615
45717
|
telemetryArgument(false)
|
|
45616
45718
|
]
|
|
45617
45719
|
}
|
|
@@ -45619,6 +45721,53 @@ function createMiniView(options) {
|
|
|
45619
45721
|
if (process.platform === "darwin") {
|
|
45620
45722
|
window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
|
|
45621
45723
|
}
|
|
45724
|
+
const launchedGlassOn = glassIsActive(
|
|
45725
|
+
options.glass.settings,
|
|
45726
|
+
options.glass.capability
|
|
45727
|
+
);
|
|
45728
|
+
let appliedMechanism = launchedGlassOn ? options.glass.capability.mechanism : "none";
|
|
45729
|
+
const applyGlassState = (state2) => {
|
|
45730
|
+
if (window.isDestroyed()) return;
|
|
45731
|
+
const active = state2.active && state2.capability.mechanism !== "none";
|
|
45732
|
+
const plan = miniGlassPlan({
|
|
45733
|
+
mechanism: state2.capability.mechanism,
|
|
45734
|
+
active,
|
|
45735
|
+
applied: appliedMechanism,
|
|
45736
|
+
launchedGlassOn,
|
|
45737
|
+
material: state2.settings.material
|
|
45738
|
+
});
|
|
45739
|
+
try {
|
|
45740
|
+
for (const step of plan.steps) {
|
|
45741
|
+
switch (step.kind) {
|
|
45742
|
+
case "transparent-ground":
|
|
45743
|
+
window.setBackgroundColor(GLASS_TRANSPARENT);
|
|
45744
|
+
break;
|
|
45745
|
+
case "vibrancy":
|
|
45746
|
+
window.setVibrancy(
|
|
45747
|
+
step.material === null ? null : macVibrancyFor(step.material)
|
|
45748
|
+
);
|
|
45749
|
+
break;
|
|
45750
|
+
case "background-material":
|
|
45751
|
+
window.setBackgroundMaterial(
|
|
45752
|
+
step.material === null ? "none" : winMaterialFor(step.material)
|
|
45753
|
+
);
|
|
45754
|
+
break;
|
|
45755
|
+
case "opaque-ground":
|
|
45756
|
+
window.setBackgroundColor(MINI_VIEW_GROUND);
|
|
45757
|
+
break;
|
|
45758
|
+
}
|
|
45759
|
+
}
|
|
45760
|
+
appliedMechanism = plan.applied;
|
|
45761
|
+
} catch (error) {
|
|
45762
|
+
options.report?.(
|
|
45763
|
+
`[mini-view] applying the window glass was refused (${String(error)}) - the popout keeps its previous look`
|
|
45764
|
+
);
|
|
45765
|
+
}
|
|
45766
|
+
window.webContents.send(
|
|
45767
|
+
WINDOW_GLASS_STATE_CHANNEL,
|
|
45768
|
+
miniDocumentState(state2, launchedGlassOn)
|
|
45769
|
+
);
|
|
45770
|
+
};
|
|
45622
45771
|
let paintedForLoad = false;
|
|
45623
45772
|
let paintTimer = null;
|
|
45624
45773
|
let paintWaiters = [];
|
|
@@ -45815,7 +45964,7 @@ function createMiniView(options) {
|
|
|
45815
45964
|
}
|
|
45816
45965
|
if (!window.isDestroyed()) window.destroy();
|
|
45817
45966
|
}
|
|
45818
|
-
return { window, toggle, hide, dispose };
|
|
45967
|
+
return { window, toggle, hide, dispose, applyGlassState };
|
|
45819
45968
|
}
|
|
45820
45969
|
const PALETTE_DOOR_CHANNELS = {
|
|
45821
45970
|
everything: "toggle-command-palette",
|
|
@@ -53846,8 +53995,10 @@ function attachWindowGlass(options) {
|
|
|
53846
53995
|
);
|
|
53847
53996
|
};
|
|
53848
53997
|
const push2 = () => {
|
|
53849
|
-
|
|
53850
|
-
window.
|
|
53998
|
+
const state2 = current();
|
|
53999
|
+
if (!window.isDestroyed())
|
|
54000
|
+
window.webContents.send(WINDOW_GLASS_STATE_CHANNEL, state2);
|
|
54001
|
+
options.onState?.(state2);
|
|
53851
54002
|
};
|
|
53852
54003
|
const fromOwnWindow = (event) => event.sender === window.webContents;
|
|
53853
54004
|
electron.ipcMain.handle(
|
|
@@ -54289,7 +54440,8 @@ function attachWindowSurface(options) {
|
|
|
54289
54440
|
initial: options.glass,
|
|
54290
54441
|
userDataDir: options.userDataDir,
|
|
54291
54442
|
restoreGround: () => chromeController?.sync(),
|
|
54292
|
-
log: options.log
|
|
54443
|
+
log: options.log,
|
|
54444
|
+
onState: options.onGlassState
|
|
54293
54445
|
});
|
|
54294
54446
|
chromeController = attachWindowChrome({
|
|
54295
54447
|
...options.chrome,
|
|
@@ -54786,7 +54938,15 @@ function createWindow(initialSession = null, openCatalogue = false, request = ow
|
|
|
54786
54938
|
headless: windowLaunch.mode === "headless",
|
|
54787
54939
|
log: (line) => logger.info(line, LogFileType.BACKEND)
|
|
54788
54940
|
},
|
|
54789
|
-
log: (line) => logger.info(line, LogFileType.BACKEND)
|
|
54941
|
+
log: (line) => logger.info(line, LogFileType.BACKEND),
|
|
54942
|
+
/*
|
|
54943
|
+
* EVERY GLASS STATE THIS WINDOW PAINTS, FOR THE POPOUT: the mini view is a
|
|
54944
|
+
* second BrowserWindow on the same material and its document has no channel
|
|
54945
|
+
* of its own (it must not own the setting). Forwarded here rather than
|
|
54946
|
+
* broadcast from the controller so the popout's window, not "every window",
|
|
54947
|
+
* is the recipient.
|
|
54948
|
+
*/
|
|
54949
|
+
onGlassState: (state2) => miniView?.applyGlassState(state2)
|
|
54790
54950
|
});
|
|
54791
54951
|
mainWindow2.on("closed", () => surface.chrome.dispose());
|
|
54792
54952
|
mainWindow2.on("closed", () => surface.glass.dispose());
|
|
@@ -55358,6 +55518,15 @@ electron.app.whenReady().then(async () => {
|
|
|
55358
55518
|
url: miniViewUrlFor(rendererUrl),
|
|
55359
55519
|
preloadPath: path$1.join(__dirname, "../preload/index.js"),
|
|
55360
55520
|
show: windowLaunch.show,
|
|
55521
|
+
/*
|
|
55522
|
+
* The launch's window-glass resolution: the popout is a floating HUD
|
|
55523
|
+
* on the window's material, and it must be BUILT with it (a Windows
|
|
55524
|
+
* material cannot be added to a live window). Resolved at this point,
|
|
55525
|
+
* before the main window exists, from the same persisted file.
|
|
55526
|
+
*/
|
|
55527
|
+
glass: resolveLaunchWindowGlass({
|
|
55528
|
+
userDataDir: electron.app.getPath("userData")
|
|
55529
|
+
}),
|
|
55361
55530
|
/*
|
|
55362
55531
|
* The launch's chrome facts, resolved through the same function the
|
|
55363
55532
|
* main window called — read here rather than threaded through
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,c as b,g as v,k as O,h as P,j as p,l as w,m as A,n as x,t as c,o as N}from"./_baseUniq-
|
|
1
|
+
import{e as o,c as b,g as v,k as O,h as P,j as p,l as w,m as A,n as x,t as c,o as N}from"./_baseUniq-5Fk4AsiY.js";import{as as g,aa as y,at as E,au as F,av as M,aw as I,ax as _,ay as $,az as B,aA as T}from"./mermaid.core-C14g_ZP7.js";var S=/\s/;function z(n){for(var r=n.length;r--&&S.test(n.charAt(r)););return r}var G=/^\s+/;function H(n){return n&&n.slice(0,z(n)+1).replace(G,"")}var m=NaN,L=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,q=/^0o[0-7]+$/i,C=parseInt;function K(n){if(typeof n=="number")return n;if(o(n))return m;if(g(n)){var r=typeof n.valueOf=="function"?n.valueOf():n;n=g(r)?r+"":r}if(typeof n!="string")return n===0?n:+n;n=H(n);var t=R.test(n);return t||q.test(n)?C(n.slice(2),t?2:8):L.test(n)?m:+n}var W=1/0,X=17976931348623157e292;function Y(n){if(!n)return n===0?n:0;if(n=K(n),n===W||n===-1/0){var r=n<0?-1:1;return r*X}return n===n?n:0}function D(n){var r=Y(n),t=r%1;return r===r?t?r-t:r:0}function fn(n){var r=n==null?0:n.length;return r?b(n):[]}var l=Object.prototype,J=l.hasOwnProperty,dn=y(function(n,r){n=Object(n);var t=-1,e=r.length,a=e>2?r[2]:void 0;for(a&&E(r[0],r[1],a)&&(e=1);++t<e;)for(var f=r[t],i=F(f),s=-1,d=i.length;++s<d;){var u=i[s],h=n[u];(h===void 0||M(h,l[u])&&!J.call(n,u))&&(n[u]=f[u])}return n});function un(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}function Q(n){return function(r,t,e){var a=Object(r);if(!I(r)){var f=v(t);r=O(r),t=function(s){return f(a[s],s,a)}}var i=n(r,t,e);return i>-1?a[f?r[i]:i]:void 0}}var U=Math.max;function Z(n,r,t){var e=n==null?0:n.length;if(!e)return-1;var a=t==null?0:D(t);return a<0&&(a=U(e+a,0)),P(n,v(r),a)}var hn=Q(Z);function V(n,r){var t=-1,e=I(n)?Array(n.length):[];return p(n,function(a,f,i){e[++t]=r(a,f,i)}),e}function gn(n,r){var t=_(n)?w:V;return t(n,v(r))}var j=Object.prototype,k=j.hasOwnProperty;function nn(n,r){return n!=null&&k.call(n,r)}function vn(n,r){return n!=null&&A(n,r,nn)}function rn(n,r){return n<r}function tn(n,r,t){for(var e=-1,a=n.length;++e<a;){var f=n[e],i=r(f);if(i!=null&&(s===void 0?i===i&&!o(i):t(i,s)))var s=i,d=f}return d}function mn(n){return n&&n.length?tn(n,$,rn):void 0}function an(n,r,t,e){if(!g(n))return n;r=x(r,n);for(var a=-1,f=r.length,i=f-1,s=n;s!=null&&++a<f;){var d=c(r[a]),u=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return n;if(a!=i){var h=s[d];u=void 0,u===void 0&&(u=g(h)?h:B(r[a+1])?[]:{})}T(s,d,u),s=s[d]}return n}function on(n,r,t){for(var e=-1,a=r.length,f={};++e<a;){var i=r[e],s=N(n,i);t(s,i)&&an(f,x(i,n),s)}return f}export{rn as a,tn as b,V as c,on as d,mn as e,fn as f,hn as g,vn as h,dn as i,D as j,un as l,gn as m,Y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aH as S,aI as Rn,ax as T,aJ as w,aK as xn,aL as Mn,aw as sn,aM as mn,aN as un,aO as x,au as U,aP as Cn,aQ as on,aR as Fn,aS as E,aF as gn,aT as R,as as ln,aU as Dn,aV as D,aW as Gn,aX as Un,aY as _,aA as Nn,aZ as Bn,av as Kn,a_ as X,a$ as Hn,b0 as jn,az as Yn,ay as cn,aD as Zn,b1 as m}from"./mermaid.core-BZ_OD6fR.js";var qn="[object Symbol]";function N(n){return typeof n=="symbol"||S(n)&&Rn(n)==qn}function dn(n,r){for(var e=-1,t=n==null?0:n.length,a=Array(t);++e<t;)a[e]=r(n[e],e,n);return a}var J=w?w.prototype:void 0,Q=J?J.toString:void 0;function pn(n){if(typeof n=="string")return n;if(T(n))return dn(n,pn)+"";if(N(n))return Q?Q.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function Xn(){}function An(n,r){for(var e=-1,t=n==null?0:n.length;++e<t&&r(n[e],e,n)!==!1;);return n}function Jn(n,r,e,t){for(var a=n.length,i=e+-1;++i<a;)if(r(n[i],i,n))return i;return-1}function Qn(n){return n!==n}function Wn(n,r,e){for(var t=e-1,a=n.length;++t<a;)if(n[t]===r)return t;return-1}function zn(n,r,e){return r===r?Wn(n,r,e):Jn(n,Qn,e)}function Vn(n,r){var e=n==null?0:n.length;return!!e&&zn(n,r,0)>-1}function $(n){return sn(n)?xn(n):Mn(n)}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/;function B(n,r){if(T(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||N(n)?!0:nr.test(n)||!kn.test(n)||r!=null&&n in Object(r)}var rr=500;function er(n){var r=mn(n,function(t){return e.size===rr&&e.clear(),t}),e=r.cache;return r}var tr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,ar=er(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(tr,function(e,t,a,i){r.push(a?i.replace(ir,"$1"):t||e)}),r});function fr(n){return n==null?"":pn(n)}function yn(n,r){return T(n)?n:B(n,r)?[n]:ar(fr(n))}function M(n){if(typeof n=="string"||N(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function bn(n,r){r=yn(r,n);for(var e=0,t=r.length;n!=null&&e<t;)n=n[M(r[e++])];return e&&e==t?n:void 0}function sr(n,r,e){var t=n==null?void 0:bn(n,r);return t===void 0?e:t}function K(n,r){for(var e=-1,t=r.length,a=n.length;++e<t;)n[a+e]=r[e];return n}var W=w?w.isConcatSpreadable:void 0;function ur(n){return T(n)||un(n)||!!(W&&n&&n[W])}function Ot(n,r,e,t,a){var i=-1,f=n.length;for(e||(e=ur),a||(a=[]);++i<f;){var s=n[i];e(s)?K(a,s):t||(a[a.length]=s)}return a}function or(n,r,e,t){var a=-1,i=n==null?0:n.length;for(t&&i&&(e=n[++a]);++a<i;)e=r(e,n[a],a,n);return e}function gr(n,r){return n&&x(r,$(r),n)}function lr(n,r){return n&&x(r,U(r),n)}function Tn(n,r){for(var e=-1,t=n==null?0:n.length,a=0,i=[];++e<t;){var f=n[e];r(f,e,n)&&(i[a++]=f)}return i}function hn(){return[]}var cr=Object.prototype,dr=cr.propertyIsEnumerable,z=Object.getOwnPropertySymbols,H=z?function(n){return n==null?[]:(n=Object(n),Tn(z(n),function(r){return dr.call(n,r)}))}:hn;function pr(n,r){return x(n,H(n),r)}var Ar=Object.getOwnPropertySymbols,wn=Ar?function(n){for(var r=[];n;)K(r,H(n)),n=Cn(n);return r}:hn;function yr(n,r){return x(n,wn(n),r)}function On(n,r,e){var t=r(n);return T(n)?t:K(t,e(n))}function G(n){return On(n,$,H)}function br(n){return On(n,U,wn)}var Tr=Object.prototype,hr=Tr.hasOwnProperty;function wr(n){var r=n.length,e=new n.constructor(r);return r&&typeof n[0]=="string"&&hr.call(n,"index")&&(e.index=n.index,e.input=n.input),e}function Or(n,r){var e=r?on(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}var $r=/\w*$/;function _r(n){var r=new n.constructor(n.source,$r.exec(n));return r.lastIndex=n.lastIndex,r}var V=w?w.prototype:void 0,k=V?V.valueOf:void 0;function Sr(n){return k?Object(k.call(n)):{}}var Er="[object Boolean]",Ir="[object Date]",Pr="[object Map]",vr="[object Number]",Lr="[object RegExp]",Rr="[object Set]",xr="[object String]",Mr="[object Symbol]",mr="[object ArrayBuffer]",Cr="[object DataView]",Fr="[object Float32Array]",Dr="[object Float64Array]",Gr="[object Int8Array]",Ur="[object Int16Array]",Nr="[object Int32Array]",Br="[object Uint8Array]",Kr="[object Uint8ClampedArray]",Hr="[object Uint16Array]",jr="[object Uint32Array]";function Yr(n,r,e){var t=n.constructor;switch(r){case mr:return on(n);case Er:case Ir:return new t(+n);case Cr:return Or(n,e);case Fr:case Dr:case Gr:case Ur:case Nr:case Br:case Kr:case Hr:case jr:return Fn(n,e);case Pr:return new t;case vr:case xr:return new t(n);case Lr:return _r(n);case Rr:return new t;case Mr:return Sr(n)}}var Zr="[object Map]";function qr(n){return S(n)&&E(n)==Zr}var nn=R&&R.isMap,Xr=nn?gn(nn):qr,Jr="[object Set]";function Qr(n){return S(n)&&E(n)==Jr}var rn=R&&R.isSet,Wr=rn?gn(rn):Qr,zr=1,Vr=2,kr=4,$n="[object Arguments]",ne="[object Array]",re="[object Boolean]",ee="[object Date]",te="[object Error]",_n="[object Function]",ie="[object GeneratorFunction]",ae="[object Map]",fe="[object Number]",Sn="[object Object]",se="[object RegExp]",ue="[object Set]",oe="[object String]",ge="[object Symbol]",le="[object WeakMap]",ce="[object ArrayBuffer]",de="[object DataView]",pe="[object Float32Array]",Ae="[object Float64Array]",ye="[object Int8Array]",be="[object Int16Array]",Te="[object Int32Array]",he="[object Uint8Array]",we="[object Uint8ClampedArray]",Oe="[object Uint16Array]",$e="[object Uint32Array]",g={};g[$n]=g[ne]=g[ce]=g[de]=g[re]=g[ee]=g[pe]=g[Ae]=g[ye]=g[be]=g[Te]=g[ae]=g[fe]=g[Sn]=g[se]=g[ue]=g[oe]=g[ge]=g[he]=g[we]=g[Oe]=g[$e]=!0;g[te]=g[_n]=g[le]=!1;function C(n,r,e,t,a,i){var f,s=r&zr,u=r&Vr,d=r&kr;if(f!==void 0)return f;if(!ln(n))return n;var l=T(n);if(l){if(f=wr(n),!s)return Dn(n,f)}else{var o=E(n),c=o==_n||o==ie;if(D(n))return Gn(n,s);if(o==Sn||o==$n||c&&!a){if(f=u||c?{}:Un(n),!s)return u?yr(n,lr(f,n)):pr(n,gr(f,n))}else{if(!g[o])return a?n:{};f=Yr(n,o,s)}}i||(i=new _);var h=i.get(n);if(h)return h;i.set(n,f),Wr(n)?n.forEach(function(p){f.add(C(p,r,e,p,n,i))}):Xr(n)&&n.forEach(function(p,A){f.set(A,C(p,r,e,A,n,i))});var y=d?u?br:G:u?U:$,b=l?void 0:y(n);return An(b||n,function(p,A){b&&(A=p,p=n[A]),Nn(f,A,C(p,r,e,A,n,i))}),f}var _e="__lodash_hash_undefined__";function Se(n){return this.__data__.set(n,_e),this}function Ee(n){return this.__data__.has(n)}function I(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new Bn;++r<e;)this.add(n[r])}I.prototype.add=I.prototype.push=Se;I.prototype.has=Ee;function Ie(n,r){for(var e=-1,t=n==null?0:n.length;++e<t;)if(r(n[e],e,n))return!0;return!1}function En(n,r){return n.has(r)}var Pe=1,ve=2;function In(n,r,e,t,a,i){var f=e&Pe,s=n.length,u=r.length;if(s!=u&&!(f&&u>s))return!1;var d=i.get(n),l=i.get(r);if(d&&l)return d==r&&l==n;var o=-1,c=!0,h=e&ve?new I:void 0;for(i.set(n,r),i.set(r,n);++o<s;){var y=n[o],b=r[o];if(t)var p=f?t(b,y,o,r,n,i):t(y,b,o,n,r,i);if(p!==void 0){if(p)continue;c=!1;break}if(h){if(!Ie(r,function(A,O){if(!En(h,O)&&(y===A||a(y,A,e,t,i)))return h.push(O)})){c=!1;break}}else if(!(y===b||a(y,b,e,t,i))){c=!1;break}}return i.delete(n),i.delete(r),c}function Le(n){var r=-1,e=Array(n.size);return n.forEach(function(t,a){e[++r]=[a,t]}),e}function j(n){var r=-1,e=Array(n.size);return n.forEach(function(t){e[++r]=t}),e}var Re=1,xe=2,Me="[object Boolean]",me="[object Date]",Ce="[object Error]",Fe="[object Map]",De="[object Number]",Ge="[object RegExp]",Ue="[object Set]",Ne="[object String]",Be="[object Symbol]",Ke="[object ArrayBuffer]",He="[object DataView]",en=w?w.prototype:void 0,F=en?en.valueOf:void 0;function je(n,r,e,t,a,i,f){switch(e){case He:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case Ke:return!(n.byteLength!=r.byteLength||!i(new X(n),new X(r)));case Me:case me:case De:return Kn(+n,+r);case Ce:return n.name==r.name&&n.message==r.message;case Ge:case Ne:return n==r+"";case Fe:var s=Le;case Ue:var u=tℜif(s||(s=j),n.size!=r.size&&!u)return!1;var d=f.get(n);if(d)return d==r;t|=xe,f.set(n,r);var l=In(s(n),s(r),t,a,i,f);return f.delete(n),l;case Be:if(F)return F.call(n)==F.call(r)}return!1}var Ye=1,Ze=Object.prototype,qe=Ze.hasOwnProperty;function Xe(n,r,e,t,a,i){var f=e&Ye,s=G(n),u=s.length,d=G(r),l=d.length;if(u!=l&&!f)return!1;for(var o=u;o--;){var c=s[o];if(!(f?c in r:qe.call(r,c)))return!1}var h=i.get(n),y=i.get(r);if(h&&y)return h==r&&y==n;var b=!0;i.set(n,r),i.set(r,n);for(var p=f;++o<u;){c=s[o];var A=n[c],O=r[c];if(t)var q=f?t(O,A,c,r,n,i):t(A,O,c,n,r,i);if(!(q===void 0?A===O||a(A,O,e,t,i):q)){b=!1;break}p||(p=c=="constructor")}if(b&&!p){var P=n.constructor,v=r.constructor;P!=v&&"constructor"in n&&"constructor"in r&&!(typeof P=="function"&&P instanceof P&&typeof v=="function"&&v instanceof v)&&(b=!1)}return i.delete(n),i.delete(r),b}var Je=1,tn="[object Arguments]",an="[object Array]",L="[object Object]",Qe=Object.prototype,fn=Qe.hasOwnProperty;function We(n,r,e,t,a,i){var f=T(n),s=T(r),u=f?an:E(n),d=s?an:E(r);u=u==tn?L:u,d=d==tn?L:d;var l=u==L,o=d==L,c=u==d;if(c&&D(n)){if(!D(r))return!1;f=!0,l=!1}if(c&&!l)return i||(i=new _),f||Hn(n)?In(n,r,e,t,a,i):je(n,r,u,e,t,a,i);if(!(e&Je)){var h=l&&fn.call(n,"__wrapped__"),y=o&&fn.call(r,"__wrapped__");if(h||y){var b=h?n.value():n,p=y?r.value():r;return i||(i=new _),a(b,p,e,t,i)}}return c?(i||(i=new _),Xe(n,r,e,t,a,i)):!1}function Y(n,r,e,t,a){return n===r?!0:n==null||r==null||!S(n)&&!S(r)?n!==n&&r!==r:We(n,r,e,t,Y,a)}var ze=1,Ve=2;function ke(n,r,e,t){var a=e.length,i=a;if(n==null)return!i;for(n=Object(n);a--;){var f=e[a];if(f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++a<i;){f=e[a];var s=f[0],u=n[s],d=f[1];if(f[2]){if(u===void 0&&!(s in n))return!1}else{var l=new _,o;if(!(o===void 0?Y(d,u,ze|Ve,t,l):o))return!1}}return!0}function Pn(n){return n===n&&!ln(n)}function nt(n){for(var r=$(n),e=r.length;e--;){var t=r[e],a=n[t];r[e]=[t,a,Pn(a)]}return r}function vn(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function rt(n){var r=nt(n);return r.length==1&&r[0][2]?vn(r[0][0],r[0][1]):function(e){return e===n||ke(e,n,r)}}function et(n,r){return n!=null&&r in Object(n)}function tt(n,r,e){r=yn(r,n);for(var t=-1,a=r.length,i=!1;++t<a;){var f=M(r[t]);if(!(i=n!=null&&e(n,f)))break;n=n[f]}return i||++t!=a?i:(a=n==null?0:n.length,!!a&&jn(a)&&Yn(f,a)&&(T(n)||un(n)))}function it(n,r){return n!=null&&tt(n,r,et)}var at=1,ft=2;function st(n,r){return B(n)&&Pn(r)?vn(M(n),r):function(e){var t=sr(e,n);return t===void 0&&t===r?it(e,n):Y(r,t,at|ft)}}function ut(n){return function(r){return r?.[n]}}function ot(n){return function(r){return bn(r,n)}}function gt(n){return B(n)?ut(M(n)):ot(n)}function Ln(n){return typeof n=="function"?n:n==null?cn:typeof n=="object"?T(n)?st(n[0],n[1]):rt(n):gt(n)}function lt(n,r){return n&&Zn(n,r,$)}function ct(n,r){return function(e,t){if(e==null)return e;if(!sn(e))return n(e,t);for(var a=e.length,i=-1,f=Object(e);++i<a&&t(f[i],i,f)!==!1;);return e}}var Z=ct(lt);function dt(n){return typeof n=="function"?n:cn}function $t(n,r){var e=T(n)?An:Z;return e(n,dt(r))}function pt(n,r){var e=[];return Z(n,function(t,a,i){r(t,a,i)&&e.push(t)}),e}function _t(n,r){var e=T(n)?Tn:pt;return e(n,Ln(r))}function At(n,r){return dn(r,function(e){return n[e]})}function St(n){return n==null?[]:At(n,$(n))}function Et(n){return n===void 0}function yt(n,r,e,t,a){return a(n,function(i,f,s){e=t?(t=!1,i):r(e,i,f,s)}),e}function It(n,r,e){var t=T(n)?or:yt,a=arguments.length<3;return t(n,Ln(r),e,a,Z)}var bt=1/0,Tt=m&&1/j(new m([,-0]))[1]==bt?function(n){return new m(n)}:Xn,ht=200;function Pt(n,r,e){var t=-1,a=Vn,i=n.length,f=!0,s=[],u=s;if(i>=ht){var d=r?null:Tt(n);if(d)return j(d);f=!1,a=En,u=new I}else u=r?[]:s;n:for(;++t<i;){var l=n[t],o=r?r(l):l;if(l=l!==0?l:0,f&&o===o){for(var c=u.length;c--;)if(u[c]===o)continue n;r&&u.push(o),s.push(l)}else a(u,o,e)||(u!==s&&u.push(o),s.push(l))}return s}export{Tn as A,pt as B,Ie as C,Xn as D,I as S,Pt as a,C as b,Ot as c,$t as d,N as e,_t as f,Ln as g,Jn as h,Et as i,Z as j,$ as k,dn as l,tt as m,yn as n,bn as o,dt as p,lt as q,It as r,it as s,M as t,fr as u,St as v,Vn as w,En as x,zn as y,br as z};
|
|
1
|
+
import{aH as S,aI as Rn,ax as T,aJ as w,aK as xn,aL as Mn,aw as sn,aM as mn,aN as un,aO as x,au as U,aP as Cn,aQ as on,aR as Fn,aS as E,aF as gn,aT as R,as as ln,aU as Dn,aV as D,aW as Gn,aX as Un,aY as _,aA as Nn,aZ as Bn,av as Kn,a_ as X,a$ as Hn,b0 as jn,az as Yn,ay as cn,aD as Zn,b1 as m}from"./mermaid.core-C14g_ZP7.js";var qn="[object Symbol]";function N(n){return typeof n=="symbol"||S(n)&&Rn(n)==qn}function dn(n,r){for(var e=-1,t=n==null?0:n.length,a=Array(t);++e<t;)a[e]=r(n[e],e,n);return a}var J=w?w.prototype:void 0,Q=J?J.toString:void 0;function pn(n){if(typeof n=="string")return n;if(T(n))return dn(n,pn)+"";if(N(n))return Q?Q.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function Xn(){}function An(n,r){for(var e=-1,t=n==null?0:n.length;++e<t&&r(n[e],e,n)!==!1;);return n}function Jn(n,r,e,t){for(var a=n.length,i=e+-1;++i<a;)if(r(n[i],i,n))return i;return-1}function Qn(n){return n!==n}function Wn(n,r,e){for(var t=e-1,a=n.length;++t<a;)if(n[t]===r)return t;return-1}function zn(n,r,e){return r===r?Wn(n,r,e):Jn(n,Qn,e)}function Vn(n,r){var e=n==null?0:n.length;return!!e&&zn(n,r,0)>-1}function $(n){return sn(n)?xn(n):Mn(n)}var kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/;function B(n,r){if(T(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||N(n)?!0:nr.test(n)||!kn.test(n)||r!=null&&n in Object(r)}var rr=500;function er(n){var r=mn(n,function(t){return e.size===rr&&e.clear(),t}),e=r.cache;return r}var tr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ir=/\\(\\)?/g,ar=er(function(n){var r=[];return n.charCodeAt(0)===46&&r.push(""),n.replace(tr,function(e,t,a,i){r.push(a?i.replace(ir,"$1"):t||e)}),r});function fr(n){return n==null?"":pn(n)}function yn(n,r){return T(n)?n:B(n,r)?[n]:ar(fr(n))}function M(n){if(typeof n=="string"||N(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}function bn(n,r){r=yn(r,n);for(var e=0,t=r.length;n!=null&&e<t;)n=n[M(r[e++])];return e&&e==t?n:void 0}function sr(n,r,e){var t=n==null?void 0:bn(n,r);return t===void 0?e:t}function K(n,r){for(var e=-1,t=r.length,a=n.length;++e<t;)n[a+e]=r[e];return n}var W=w?w.isConcatSpreadable:void 0;function ur(n){return T(n)||un(n)||!!(W&&n&&n[W])}function Ot(n,r,e,t,a){var i=-1,f=n.length;for(e||(e=ur),a||(a=[]);++i<f;){var s=n[i];e(s)?K(a,s):t||(a[a.length]=s)}return a}function or(n,r,e,t){var a=-1,i=n==null?0:n.length;for(t&&i&&(e=n[++a]);++a<i;)e=r(e,n[a],a,n);return e}function gr(n,r){return n&&x(r,$(r),n)}function lr(n,r){return n&&x(r,U(r),n)}function Tn(n,r){for(var e=-1,t=n==null?0:n.length,a=0,i=[];++e<t;){var f=n[e];r(f,e,n)&&(i[a++]=f)}return i}function hn(){return[]}var cr=Object.prototype,dr=cr.propertyIsEnumerable,z=Object.getOwnPropertySymbols,H=z?function(n){return n==null?[]:(n=Object(n),Tn(z(n),function(r){return dr.call(n,r)}))}:hn;function pr(n,r){return x(n,H(n),r)}var Ar=Object.getOwnPropertySymbols,wn=Ar?function(n){for(var r=[];n;)K(r,H(n)),n=Cn(n);return r}:hn;function yr(n,r){return x(n,wn(n),r)}function On(n,r,e){var t=r(n);return T(n)?t:K(t,e(n))}function G(n){return On(n,$,H)}function br(n){return On(n,U,wn)}var Tr=Object.prototype,hr=Tr.hasOwnProperty;function wr(n){var r=n.length,e=new n.constructor(r);return r&&typeof n[0]=="string"&&hr.call(n,"index")&&(e.index=n.index,e.input=n.input),e}function Or(n,r){var e=r?on(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}var $r=/\w*$/;function _r(n){var r=new n.constructor(n.source,$r.exec(n));return r.lastIndex=n.lastIndex,r}var V=w?w.prototype:void 0,k=V?V.valueOf:void 0;function Sr(n){return k?Object(k.call(n)):{}}var Er="[object Boolean]",Ir="[object Date]",Pr="[object Map]",vr="[object Number]",Lr="[object RegExp]",Rr="[object Set]",xr="[object String]",Mr="[object Symbol]",mr="[object ArrayBuffer]",Cr="[object DataView]",Fr="[object Float32Array]",Dr="[object Float64Array]",Gr="[object Int8Array]",Ur="[object Int16Array]",Nr="[object Int32Array]",Br="[object Uint8Array]",Kr="[object Uint8ClampedArray]",Hr="[object Uint16Array]",jr="[object Uint32Array]";function Yr(n,r,e){var t=n.constructor;switch(r){case mr:return on(n);case Er:case Ir:return new t(+n);case Cr:return Or(n,e);case Fr:case Dr:case Gr:case Ur:case Nr:case Br:case Kr:case Hr:case jr:return Fn(n,e);case Pr:return new t;case vr:case xr:return new t(n);case Lr:return _r(n);case Rr:return new t;case Mr:return Sr(n)}}var Zr="[object Map]";function qr(n){return S(n)&&E(n)==Zr}var nn=R&&R.isMap,Xr=nn?gn(nn):qr,Jr="[object Set]";function Qr(n){return S(n)&&E(n)==Jr}var rn=R&&R.isSet,Wr=rn?gn(rn):Qr,zr=1,Vr=2,kr=4,$n="[object Arguments]",ne="[object Array]",re="[object Boolean]",ee="[object Date]",te="[object Error]",_n="[object Function]",ie="[object GeneratorFunction]",ae="[object Map]",fe="[object Number]",Sn="[object Object]",se="[object RegExp]",ue="[object Set]",oe="[object String]",ge="[object Symbol]",le="[object WeakMap]",ce="[object ArrayBuffer]",de="[object DataView]",pe="[object Float32Array]",Ae="[object Float64Array]",ye="[object Int8Array]",be="[object Int16Array]",Te="[object Int32Array]",he="[object Uint8Array]",we="[object Uint8ClampedArray]",Oe="[object Uint16Array]",$e="[object Uint32Array]",g={};g[$n]=g[ne]=g[ce]=g[de]=g[re]=g[ee]=g[pe]=g[Ae]=g[ye]=g[be]=g[Te]=g[ae]=g[fe]=g[Sn]=g[se]=g[ue]=g[oe]=g[ge]=g[he]=g[we]=g[Oe]=g[$e]=!0;g[te]=g[_n]=g[le]=!1;function C(n,r,e,t,a,i){var f,s=r&zr,u=r&Vr,d=r&kr;if(f!==void 0)return f;if(!ln(n))return n;var l=T(n);if(l){if(f=wr(n),!s)return Dn(n,f)}else{var o=E(n),c=o==_n||o==ie;if(D(n))return Gn(n,s);if(o==Sn||o==$n||c&&!a){if(f=u||c?{}:Un(n),!s)return u?yr(n,lr(f,n)):pr(n,gr(f,n))}else{if(!g[o])return a?n:{};f=Yr(n,o,s)}}i||(i=new _);var h=i.get(n);if(h)return h;i.set(n,f),Wr(n)?n.forEach(function(p){f.add(C(p,r,e,p,n,i))}):Xr(n)&&n.forEach(function(p,A){f.set(A,C(p,r,e,A,n,i))});var y=d?u?br:G:u?U:$,b=l?void 0:y(n);return An(b||n,function(p,A){b&&(A=p,p=n[A]),Nn(f,A,C(p,r,e,A,n,i))}),f}var _e="__lodash_hash_undefined__";function Se(n){return this.__data__.set(n,_e),this}function Ee(n){return this.__data__.has(n)}function I(n){var r=-1,e=n==null?0:n.length;for(this.__data__=new Bn;++r<e;)this.add(n[r])}I.prototype.add=I.prototype.push=Se;I.prototype.has=Ee;function Ie(n,r){for(var e=-1,t=n==null?0:n.length;++e<t;)if(r(n[e],e,n))return!0;return!1}function En(n,r){return n.has(r)}var Pe=1,ve=2;function In(n,r,e,t,a,i){var f=e&Pe,s=n.length,u=r.length;if(s!=u&&!(f&&u>s))return!1;var d=i.get(n),l=i.get(r);if(d&&l)return d==r&&l==n;var o=-1,c=!0,h=e&ve?new I:void 0;for(i.set(n,r),i.set(r,n);++o<s;){var y=n[o],b=r[o];if(t)var p=f?t(b,y,o,r,n,i):t(y,b,o,n,r,i);if(p!==void 0){if(p)continue;c=!1;break}if(h){if(!Ie(r,function(A,O){if(!En(h,O)&&(y===A||a(y,A,e,t,i)))return h.push(O)})){c=!1;break}}else if(!(y===b||a(y,b,e,t,i))){c=!1;break}}return i.delete(n),i.delete(r),c}function Le(n){var r=-1,e=Array(n.size);return n.forEach(function(t,a){e[++r]=[a,t]}),e}function j(n){var r=-1,e=Array(n.size);return n.forEach(function(t){e[++r]=t}),e}var Re=1,xe=2,Me="[object Boolean]",me="[object Date]",Ce="[object Error]",Fe="[object Map]",De="[object Number]",Ge="[object RegExp]",Ue="[object Set]",Ne="[object String]",Be="[object Symbol]",Ke="[object ArrayBuffer]",He="[object DataView]",en=w?w.prototype:void 0,F=en?en.valueOf:void 0;function je(n,r,e,t,a,i,f){switch(e){case He:if(n.byteLength!=r.byteLength||n.byteOffset!=r.byteOffset)return!1;n=n.buffer,r=r.buffer;case Ke:return!(n.byteLength!=r.byteLength||!i(new X(n),new X(r)));case Me:case me:case De:return Kn(+n,+r);case Ce:return n.name==r.name&&n.message==r.message;case Ge:case Ne:return n==r+"";case Fe:var s=Le;case Ue:var u=tℜif(s||(s=j),n.size!=r.size&&!u)return!1;var d=f.get(n);if(d)return d==r;t|=xe,f.set(n,r);var l=In(s(n),s(r),t,a,i,f);return f.delete(n),l;case Be:if(F)return F.call(n)==F.call(r)}return!1}var Ye=1,Ze=Object.prototype,qe=Ze.hasOwnProperty;function Xe(n,r,e,t,a,i){var f=e&Ye,s=G(n),u=s.length,d=G(r),l=d.length;if(u!=l&&!f)return!1;for(var o=u;o--;){var c=s[o];if(!(f?c in r:qe.call(r,c)))return!1}var h=i.get(n),y=i.get(r);if(h&&y)return h==r&&y==n;var b=!0;i.set(n,r),i.set(r,n);for(var p=f;++o<u;){c=s[o];var A=n[c],O=r[c];if(t)var q=f?t(O,A,c,r,n,i):t(A,O,c,n,r,i);if(!(q===void 0?A===O||a(A,O,e,t,i):q)){b=!1;break}p||(p=c=="constructor")}if(b&&!p){var P=n.constructor,v=r.constructor;P!=v&&"constructor"in n&&"constructor"in r&&!(typeof P=="function"&&P instanceof P&&typeof v=="function"&&v instanceof v)&&(b=!1)}return i.delete(n),i.delete(r),b}var Je=1,tn="[object Arguments]",an="[object Array]",L="[object Object]",Qe=Object.prototype,fn=Qe.hasOwnProperty;function We(n,r,e,t,a,i){var f=T(n),s=T(r),u=f?an:E(n),d=s?an:E(r);u=u==tn?L:u,d=d==tn?L:d;var l=u==L,o=d==L,c=u==d;if(c&&D(n)){if(!D(r))return!1;f=!0,l=!1}if(c&&!l)return i||(i=new _),f||Hn(n)?In(n,r,e,t,a,i):je(n,r,u,e,t,a,i);if(!(e&Je)){var h=l&&fn.call(n,"__wrapped__"),y=o&&fn.call(r,"__wrapped__");if(h||y){var b=h?n.value():n,p=y?r.value():r;return i||(i=new _),a(b,p,e,t,i)}}return c?(i||(i=new _),Xe(n,r,e,t,a,i)):!1}function Y(n,r,e,t,a){return n===r?!0:n==null||r==null||!S(n)&&!S(r)?n!==n&&r!==r:We(n,r,e,t,Y,a)}var ze=1,Ve=2;function ke(n,r,e,t){var a=e.length,i=a;if(n==null)return!i;for(n=Object(n);a--;){var f=e[a];if(f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++a<i;){f=e[a];var s=f[0],u=n[s],d=f[1];if(f[2]){if(u===void 0&&!(s in n))return!1}else{var l=new _,o;if(!(o===void 0?Y(d,u,ze|Ve,t,l):o))return!1}}return!0}function Pn(n){return n===n&&!ln(n)}function nt(n){for(var r=$(n),e=r.length;e--;){var t=r[e],a=n[t];r[e]=[t,a,Pn(a)]}return r}function vn(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function rt(n){var r=nt(n);return r.length==1&&r[0][2]?vn(r[0][0],r[0][1]):function(e){return e===n||ke(e,n,r)}}function et(n,r){return n!=null&&r in Object(n)}function tt(n,r,e){r=yn(r,n);for(var t=-1,a=r.length,i=!1;++t<a;){var f=M(r[t]);if(!(i=n!=null&&e(n,f)))break;n=n[f]}return i||++t!=a?i:(a=n==null?0:n.length,!!a&&jn(a)&&Yn(f,a)&&(T(n)||un(n)))}function it(n,r){return n!=null&&tt(n,r,et)}var at=1,ft=2;function st(n,r){return B(n)&&Pn(r)?vn(M(n),r):function(e){var t=sr(e,n);return t===void 0&&t===r?it(e,n):Y(r,t,at|ft)}}function ut(n){return function(r){return r?.[n]}}function ot(n){return function(r){return bn(r,n)}}function gt(n){return B(n)?ut(M(n)):ot(n)}function Ln(n){return typeof n=="function"?n:n==null?cn:typeof n=="object"?T(n)?st(n[0],n[1]):rt(n):gt(n)}function lt(n,r){return n&&Zn(n,r,$)}function ct(n,r){return function(e,t){if(e==null)return e;if(!sn(e))return n(e,t);for(var a=e.length,i=-1,f=Object(e);++i<a&&t(f[i],i,f)!==!1;);return e}}var Z=ct(lt);function dt(n){return typeof n=="function"?n:cn}function $t(n,r){var e=T(n)?An:Z;return e(n,dt(r))}function pt(n,r){var e=[];return Z(n,function(t,a,i){r(t,a,i)&&e.push(t)}),e}function _t(n,r){var e=T(n)?Tn:pt;return e(n,Ln(r))}function At(n,r){return dn(r,function(e){return n[e]})}function St(n){return n==null?[]:At(n,$(n))}function Et(n){return n===void 0}function yt(n,r,e,t,a){return a(n,function(i,f,s){e=t?(t=!1,i):r(e,i,f,s)}),e}function It(n,r,e){var t=T(n)?or:yt,a=arguments.length<3;return t(n,Ln(r),e,a,Z)}var bt=1/0,Tt=m&&1/j(new m([,-0]))[1]==bt?function(n){return new m(n)}:Xn,ht=200;function Pt(n,r,e){var t=-1,a=Vn,i=n.length,f=!0,s=[],u=s;if(i>=ht){var d=r?null:Tt(n);if(d)return j(d);f=!1,a=En,u=new I}else u=r?[]:s;n:for(;++t<i;){var l=n[t],o=r?r(l):l;if(l=l!==0?l:0,f&&o===o){for(var c=u.length;c--;)if(u[c]===o)continue n;r&&u.push(o),s.push(l)}else a(u,o,e)||(u!==s&&u.push(o),s.push(l))}return s}export{Tn as A,pt as B,Ie as C,Xn as D,I as S,Pt as a,C as b,Ot as c,$t as d,N as e,_t as f,Ln as g,Jn as h,Et as i,Z as j,$ as k,dn as l,tt as m,yn as n,bn as o,dt as p,lt as q,It as r,it as s,M as t,fr as u,St as v,Vn as w,En as x,zn as y,br as z};
|
package/out/renderer/assets/{agent-details-page-B_mPfefi.js → agent-details-page-BEoctGwH.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{t as a,r as E,j as e,c as
|
|
1
|
+
import{t as a,r as E,j as e,c as J}from"./index-DbzmFwlT.js";import{i as ge,a as fe}from"./publication-validation-BIJPIOf1.js";import{C as oe,u as O,B as C,aK as Q,a4 as $,aL as U,aM as le,aN as ce,aO as je,_ as be,aP as pe,aQ as ee,a3 as ye,aR as we,aS as ve}from"./conversation-input-sync-Cs9wr7F7.js";import{c as Ne,u as Ce,L as ke,T as te,B as l,S as K,h as de,i as q,j as I,k as v,X as Ae,l as N,A as se,m as ae,n as ne}from"./error-boundary-B5YLbOOu.js";import{f as De,h as Se,u as _e,i as Te,a as Ee,b as Fe,c as Pe,O as Me,H as ze,A as Le,d as ie}from"./use-download-agent-mutation-C6TvAwyM.js";import{e as re}from"./en-US-CHJkXXr4.js";import{b as qe,c as Ie,u as Ke,d as Oe,g as Qe,e as Ue,f as Be}from"./use-memberships-query-AlVCuF9E.js";import{S as Re,e as He,A as We,f as Ye,g as $e}from"./index-rnB6EiBX.js";import"./ui-preferences-store-D1IJShox.js";import"./book-open--60aKTv6.js";import"./console-mirror-Ch4jKiRK.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ge=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Je=Ne("message-circle",Ge);function Ve(t,o=Date.now()){return De(t,o,{locale:{...re,formatDistance(n,i,s){switch(n){case"xSeconds":return a("ui.hub.comments.age.seconds",{count:i});case"xMinutes":return a("ui.hub.comments.age.minutes",{count:i});case"xHours":return a("ui.hub.comments.age.hours",{count:i});case"xDays":return a("ui.hub.comments.age.days",{count:i});case"xMonths":return a("ui.hub.comments.age.months",{count:i});case"xYears":return a("ui.hub.comments.age.years",{count:i});default:return a("ui.hub.comments.age.fallback",{duration:re.formatDistance(n,i,s)})}}}})}const F={all:["agent-comments"],list:t=>[...F.all,"list",t]},Xe=({agentId:t,enabled:o=!0})=>oe({queryKey:F.list(t||"invalid"),queryFn:async()=>{if(!t)throw new Error("Agent ID is required to fetch comments.");return(await qe(t)).result},enabled:!!t&&o,staleTime:2*60*1e3,gcTime:5*60*1e3,refetchOnWindowFocus:!0}),Ze=()=>{const t=O(),{isAuthenticated:o}=C();return U({mutationFn:async n=>{const{agentId:i,data:s}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Ie(i,s)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),B(a("ui.hub.comments.mutation.posted"))},onError:n=>{$(a("ui.hub.comments.mutation.post_failed",{reason:n.message}))}})},et=()=>{const t=O(),{isAuthenticated:o}=C();return U({mutationFn:async n=>{const{agentId:i,commentId:s,data:c}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Ke(i,s,c)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),B(a("ui.hub.comments.mutation.updated"))},onError:n=>{$(a("ui.hub.comments.mutation.update_failed",{reason:n.message}))}})},tt=()=>{const t=O(),{isAuthenticated:o}=C();return U({mutationFn:async n=>{const{agentId:i,commentId:s}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Oe(i,s)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),B(a("ui.hub.comments.mutation.deleted"))},onError:n=>{$(a("ui.hub.comments.mutation.delete_failed",{reason:n.message}))}})},st=({agentId:t})=>{Ce();const{isAuthenticated:o,user:n}=C(),[i,s]=E.useState(""),[c,b]=E.useState(null),[x,k]=E.useState(""),{data:u,isLoading:p,error:A}=Xe({agentId:t}),M=u?.records??[],g=Ze(),D=et(),Q=tt(),S=async r=>{if(r.preventDefault(),!(!i.trim()||!o||!t))try{await g.mutateAsync({agentId:t,data:{text:i}}),s("")}catch(d){console.error("Submit comment error caught in component:",d)}},R=(r,d)=>{b(r),k(d)},m=()=>{b(null),k("")},y=async()=>{if(!(!c||!x.trim()||!o||!t))try{await D.mutateAsync({agentId:t,commentId:c,data:{text:x}}),m()}catch(r){console.error("Update comment error caught in component:",r)}},w=async r=>{if(!(!o||!t)&&window.confirm(a("ui.hub.comments.delete.confirm")))try{await Q.mutateAsync({agentId:t,commentId:r})}catch(d){console.error("Delete comment error caught in component:",d)}},H=r=>o&&n?.radientUser?.account?.id===r.account_id;return e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"mb-4 font-semibold text-heading text-ink",children:a("ui.hub.comments.heading")}),o?e.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[e.jsxs(ke,{htmlFor:"new-comment",children:[e.jsx(Je,{size:14,"aria-hidden":"true"}),a("ui.hub.comments.form.label")]}),e.jsxs("form",{onSubmit:S,className:"flex flex-col gap-3",children:[e.jsx(te,{id:"new-comment",placeholder:a("ui.hub.comments.form.placeholder"),rows:3,value:i,onChange:r=>s(r.target.value),required:!0}),e.jsx(l,{type:"submit",variant:"primary",disabled:g.isPending||!i.trim(),className:"self-end",children:g.isPending?e.jsx(K,{size:"sm",label:a("ui.hub.comments.form.posting")}):a("ui.hub.comments.form.submit")})]})]}):e.jsx("p",{className:"mt-6 mb-4 text-body-sm text-ink-muted",children:a("ui.hub.comments.form.sign_in")}),e.jsx(de,{className:"my-6"}),p&&e.jsx("ul",{className:"flex flex-col",children:[...Array(3)].map((r,d)=>e.jsxs("li",{className:"flex gap-3 pb-6",children:[e.jsx(q,{children:e.jsx(I,{children:e.jsx(v,{className:"size-full"})})}),e.jsxs("div",{className:"flex w-full flex-col gap-1.5",children:[e.jsx(v,{className:"h-3.5 w-24"}),e.jsx(v,{className:"h-3 w-15"}),e.jsx(v,{className:"mt-2 h-3.5 w-full"}),e.jsx(v,{className:"h-3.5 w-4/5"})]})]},`skeleton-${d}`))}),A&&e.jsx("p",{role:"alert",className:"my-6 text-body-sm text-danger",children:a("ui.hub.comments.load_error",{reason:A.message})}),!p&&!A&&e.jsx("ul",{className:"flex flex-col gap-6",children:M.length===0?e.jsx("li",{className:"text-body-sm text-ink-muted",children:a("ui.hub.comments.empty")}):M.map(r=>c===r.id?e.jsxs("li",{className:"flex gap-3",children:[e.jsx(q,{children:e.jsx(I,{children:r.account_metadata?.name?.charAt(0).toUpperCase()||"?"})}),e.jsxs("div",{className:"flex w-full flex-col gap-2",children:[e.jsx(te,{rows:3,value:x,onChange:d=>k(d.target.value),autoFocus:!0,"aria-label":a("ui.hub.comments.edit.label")}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",onClick:m,children:[e.jsx(Ae,{}),a("ui.hub.comments.edit.cancel")]}),e.jsxs(l,{variant:"primary",size:"sm",onClick:y,disabled:D.isPending||!x.trim(),children:[D.isPending?e.jsx(K,{size:"xs",label:a("ui.hub.comments.edit.saving")}):e.jsx(Re,{}),a("ui.hub.comments.edit.save")]})]})]})]},r.id):e.jsxs("li",{className:"flex gap-3",children:[e.jsx(q,{children:e.jsx(I,{children:r.account_metadata?.name?.charAt(0).toUpperCase()||"?"})}),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-body text-ink",children:r.account_metadata?.name||a("ui.hub.comments.author.unknown")}),e.jsx("p",{className:"text-ink-muted text-meta",children:Ve(new Date(r.created_at))})]}),H(r)&&e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx(N,{content:a("ui.hub.comments.edit.label"),children:e.jsx(l,{variant:"ghost",size:"icon-sm",onClick:()=>R(r.id,r.text),disabled:!!c,"aria-label":a("ui.hub.comments.edit.label"),children:e.jsx(He,{})})}),e.jsx(N,{content:a("ui.hub.comments.delete.label"),children:e.jsx(l,{variant:"ghost",size:"icon-sm",onClick:()=>w(r.id),disabled:!!c,"aria-label":a("ui.hub.comments.delete.label"),children:e.jsx(le,{})})})]})]}),e.jsx("p",{className:"mt-2 text-body-sm text-ink whitespace-pre-wrap",children:r.text})]})]},r.id))})]})},G={all:["agent-details"],detail:t=>[...G.all,t]},at=({agentId:t,enabled:o=!0})=>oe({queryKey:G.detail(t||"invalid"),queryFn:async()=>{if(!t)throw new Error("Agent ID is required to fetch details.");return await Ue(t)},select:i=>i.result,enabled:!!t&&o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1}),nt=()=>{const t=O(),o=ce(),{isAuthenticated:n}=C();return U({mutationFn:async({agentId:s})=>{if(!n)throw new Error("Authentication required to delist an agent.");if(!s)throw new Error("Agent ID is required to delist.");return Be(s)},onSuccess:(s,c)=>{B("Agent delisted"),t.invalidateQueries({queryKey:G.detail(c.agentId)}),ge(t),o("/agent-hub")},onError:s=>{console.error("Delist agent error:",s)}})},it={like:"The like did not go through",favourite:"The favourite did not go through",download:"The download did not start",delist:"The agent was not delisted"},Y=({children:t})=>e.jsx("span",{className:"inline-flex h-4 min-w-5 items-center text-meta text-ink-muted",children:t}),jt=()=>{const{agentId:t}=je(),o=ce(),{isAuthenticated:n,user:i}=C(),{data:s,isLoading:c,isFetching:b,error:x,refetch:k}=at({agentId:t??"",enabled:!!t}),u=s?.visibility==="org",p=s?Se(s.name):"",{memberships:A}=Qe({enabled:u}),M=u?A.find(xe=>xe.tenant_id===s?.tenant_id)?.tenant_name??null:null,{statuses:g,isKnown:D,isError:Q,isFetching:S,refetch:R}=_e({agentIds:t&&!u?[t]:[]}),m=Te(D,g,t),y=m&&g[t??""]?.liked===!0,w=m&&g[t??""]?.favourited===!0,H=s?.like_count??0,r=s?.favourite_count??0,d=s?.download_count??0,P=Ee(),z=Fe(),_=Me(),f=nt(),[ue,L]=E.useState(!1),[j,h]=E.useState(null),W=!!i&&!!s&&i.radientUser?.account?.id===s.account_id,J=()=>{!t||!n||P.isPending||(h(null),P.mutate({agentId:t,isCurrentlyLiked:y},{onError:()=>h("like")}))},V=()=>{!t||!n||z.isPending||(h(null),z.mutate({agentId:t,isCurrentlyFavourited:w},{onError:()=>h("favourite")}))},X=()=>{!t||!s||_.isPending||(h(null),_.mutate({agentId:s.id,agentName:s.name},{onError:()=>h("download")}))},me=()=>{!t||!W||f.isPending||(h(null),f.mutate({agentId:t},{onError:()=>h("delist")}),L(!1))},T=j?j==="like"?{action:"like",error:P.error,retry:J}:j==="favourite"?{action:"favourite",error:z.error,retry:V}:j==="download"?{action:"download",error:_.error,retry:X}:{action:"delist",error:f.error,retry:void 0}:null,he=()=>{o("/agent-hub")};return c?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(K,{label:"Loading agent details"})}):x?e.jsx("div",{className:"flex h-full items-center justify-center p-6",children:e.jsxs(se,{variant:"danger",className:"max-w-2xl",children:[e.jsx(ae,{children:"This agent could not be loaded"}),e.jsx(ne,{children:be("The Radient agent catalogue did not answer.",x)}),e.jsx("div",{className:"mt-2",children:e.jsx(l,{variant:"outline",size:"sm",onClick:()=>void k(),disabled:b,"aria-busy":b,children:b?"Trying…":"Try again"})})]})}):s?e.jsxs("div",{className:"m-6 flex flex-1 flex-col rounded-md bg-surface p-8",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[e.jsx(l,{variant:"ghost",size:"icon",onClick:he,"aria-label":"Back to Agent hub",children:e.jsx(We,{})}),e.jsx(q,{className:"size-11 shrink-0",children:e.jsx(I,{children:e.jsx(Ye,{size:22,"aria-hidden":"true"})})}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("h1",{className:"truncate text-display text-ink",children:p}),u&&e.jsx(Pe,{orgName:M})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[!u&&e.jsxs(e.Fragment,{children:[e.jsx(N,{content:"Sign in to Radient to use this feature",disabled:n,children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"sm",onClick:J,disabled:!n||P.isPending||!m,"aria-label":m?y?"Unlike agent":"Like agent":"Like state unavailable",className:Z(y&&"text-danger"),children:[e.jsx(ze,{fill:y?"currentColor":"none"}),e.jsx(Y,{children:H})]})})}),e.jsx(N,{content:"Sign in to Radient to use this feature",disabled:n,children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"sm",onClick:V,disabled:!n||z.isPending||!m,"aria-label":m?w?"Unfavourite agent":"Favourite agent":"Favourite state unavailable",className:Z(w&&"text-warning"),children:[e.jsx($e,{fill:w?"currentColor":"none"}),e.jsx(Y,{children:r})]})})})]}),e.jsx(N,{content:"Download agent to your computer",children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"icon",onClick:X,disabled:_.isPending,"aria-label":"Download agent",className:"ml-1",children:[e.jsx(pe,{}),e.jsx(Y,{children:_.isPending?e.jsx(v,{className:"h-3.5 w-5"}):d})]})})}),W&&!u&&e.jsx(N,{content:"Permanently delist this agent from Agent hub",children:e.jsx("span",{children:e.jsx(l,{variant:"ghost",size:"icon",onClick:()=>L(!0),disabled:f.isPending,"aria-label":"Delist agent",className:"ml-1 text-danger hover:bg-danger-wash hover:text-danger",children:e.jsx(le,{})})})})]})]}),n&&Q&&!j&&!u&&e.jsxs("output",{className:"mb-6 flex flex-wrap items-center gap-2 text-meta text-warning","data-testid":"agent-details-status-unknown",children:[e.jsx("span",{children:"Your likes and favourites could not be read, so this agent's viewer state is not shown."}),e.jsx(l,{variant:"ghost",size:"sm",onClick:()=>void R(),disabled:S,"aria-busy":S,children:S?"Trying…":"Try again"})]}),T&&j&&e.jsxs(se,{variant:"danger",className:"mb-6","data-testid":"agent-details-error",children:[e.jsx(ae,{children:it[j]}),e.jsx(ne,{children:fe(T.action,T.error,p)}),T.retry&&e.jsx("div",{className:"mt-2",children:e.jsx(l,{variant:"outline",size:"sm",onClick:T.retry,children:"Try again"})})]}),e.jsx(Le,{tags:s.tags,categories:s.categories}),e.jsxs("div",{className:"mt-4 mb-6 flex flex-col gap-2 text-body-sm text-ink-muted",children:[e.jsxs("p",{children:["Created by: ",s.account_metadata?.name??"Unknown",s.account_metadata?.email?` (${s.account_metadata.email})`:""]}),e.jsxs("p",{children:["Created: ",ie(new Date(s.created_at))," ago (",ee(s.created_at),")"]}),e.jsxs("p",{children:["Last modified: ",ie(new Date(s.updated_at))," ","ago (",ee(s.updated_at),")"]})]}),e.jsx("div",{className:"mt-2 mb-8 leading-relaxed text-body text-ink",children:s.description||"No description provided."}),e.jsx(de,{className:"my-6"}),!u&&e.jsx(st,{agentId:s.id}),e.jsx(ye,{open:ue,onClose:()=>L(!1),title:"Delist this agent?",maxWidth:"xs",actions:e.jsxs(e.Fragment,{children:[e.jsx(we,{onClick:()=>L(!1),children:"Cancel"}),e.jsx(ve,{onClick:()=>{!t||!W||f.isPending||me()},disabled:f.isPending,children:f.isPending?e.jsx(K,{size:"sm",label:"Delisting agent"}):"Delist"})]}),dialogProps:{"aria-describedby":"delist-dialog-description"},children:e.jsxs("div",{id:"delist-dialog-description",className:"text-body text-ink-muted",children:['This takes "',p,'" off the hub straight away, and nobody will be able to download it. You can upload it again later.']})})]}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-body text-ink",children:"Agent not found."})})};export{jt as AgentDetailsPage};
|
|
6
|
+
*/const Ve=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Xe=Ne("message-circle",Ve);function Ze(t,o=Date.now()){return De(t,o,{locale:{...re,formatDistance(n,i,s){switch(n){case"xSeconds":return a("ui.hub.comments.age.seconds",{count:i});case"xMinutes":return a("ui.hub.comments.age.minutes",{count:i});case"xHours":return a("ui.hub.comments.age.hours",{count:i});case"xDays":return a("ui.hub.comments.age.days",{count:i});case"xMonths":return a("ui.hub.comments.age.months",{count:i});case"xYears":return a("ui.hub.comments.age.years",{count:i});default:return a("ui.hub.comments.age.fallback",{duration:re.formatDistance(n,i,s)})}}}})}const F={all:["agent-comments"],list:t=>[...F.all,"list",t]},Ge=({agentId:t,enabled:o=!0})=>oe({queryKey:F.list(t||"invalid"),queryFn:async()=>{if(!t)throw new Error("Agent ID is required to fetch comments.");return(await qe(t)).result},enabled:!!t&&o,staleTime:2*60*1e3,gcTime:5*60*1e3,refetchOnWindowFocus:!0}),Je=()=>{const t=O(),{isAuthenticated:o}=C();return Q({mutationFn:async n=>{const{agentId:i,data:s}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Ie(i,s)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),U(a("ui.hub.comments.mutation.posted"))},onError:n=>{$(a("ui.hub.comments.mutation.post_failed",{reason:n.message}))}})},et=()=>{const t=O(),{isAuthenticated:o}=C();return Q({mutationFn:async n=>{const{agentId:i,commentId:s,data:c}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Ke(i,s,c)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),U(a("ui.hub.comments.mutation.updated"))},onError:n=>{$(a("ui.hub.comments.mutation.update_failed",{reason:n.message}))}})},tt=()=>{const t=O(),{isAuthenticated:o}=C();return Q({mutationFn:async n=>{const{agentId:i,commentId:s}=n;if(!o)throw new Error(a("ui.hub.comments.mutation.unauthorized"));return Oe(i,s)},onSuccess:(n,i)=>{t.invalidateQueries({queryKey:F.list(i.agentId)}),U(a("ui.hub.comments.mutation.deleted"))},onError:n=>{$(a("ui.hub.comments.mutation.delete_failed",{reason:n.message}))}})},st=({agentId:t})=>{Ce();const{isAuthenticated:o,user:n}=C(),[i,s]=E.useState(""),[c,b]=E.useState(null),[x,k]=E.useState(""),{data:u,isLoading:p,error:A}=Ge({agentId:t}),P=u?.records??[],g=Je(),D=et(),B=tt(),S=async r=>{if(r.preventDefault(),!(!i.trim()||!o||!t))try{await g.mutateAsync({agentId:t,data:{text:i}}),s("")}catch(d){console.error("Submit comment error caught in component:",d)}},R=(r,d)=>{b(r),k(d)},m=()=>{b(null),k("")},y=async()=>{if(!(!c||!x.trim()||!o||!t))try{await D.mutateAsync({agentId:t,commentId:c,data:{text:x}}),m()}catch(r){console.error("Update comment error caught in component:",r)}},w=async r=>{if(!(!o||!t)&&window.confirm(a("ui.hub.comments.delete.confirm")))try{await B.mutateAsync({agentId:t,commentId:r})}catch(d){console.error("Delete comment error caught in component:",d)}},H=r=>o&&n?.radientUser?.account?.id===r.account_id;return e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"mb-4 font-semibold text-heading text-ink",children:a("ui.hub.comments.heading")}),o?e.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[e.jsxs(ke,{htmlFor:"new-comment",children:[e.jsx(Xe,{size:14,"aria-hidden":"true"}),a("ui.hub.comments.form.label")]}),e.jsxs("form",{onSubmit:S,className:"flex flex-col gap-3",children:[e.jsx(te,{id:"new-comment",placeholder:a("ui.hub.comments.form.placeholder"),rows:3,value:i,onChange:r=>s(r.target.value),required:!0}),e.jsx(l,{type:"submit",variant:"primary",disabled:g.isPending||!i.trim(),className:"self-end",children:g.isPending?e.jsx(K,{size:"sm",label:a("ui.hub.comments.form.posting")}):a("ui.hub.comments.form.submit")})]})]}):e.jsx("p",{className:"mt-6 mb-4 text-body-sm text-ink-muted",children:a("ui.hub.comments.form.sign_in")}),e.jsx(de,{className:"my-6"}),p&&e.jsx("ul",{className:"flex flex-col",children:[...Array(3)].map((r,d)=>e.jsxs("li",{className:"flex gap-3 pb-6",children:[e.jsx(q,{children:e.jsx(I,{children:e.jsx(v,{className:"size-full"})})}),e.jsxs("div",{className:"flex w-full flex-col gap-1.5",children:[e.jsx(v,{className:"h-3.5 w-24"}),e.jsx(v,{className:"h-3 w-15"}),e.jsx(v,{className:"mt-2 h-3.5 w-full"}),e.jsx(v,{className:"h-3.5 w-4/5"})]})]},`skeleton-${d}`))}),A&&e.jsx("p",{role:"alert",className:"my-6 text-body-sm text-danger",children:a("ui.hub.comments.load_error",{reason:A.message})}),!p&&!A&&e.jsx("ul",{className:"flex flex-col gap-6",children:P.length===0?e.jsx("li",{className:"text-body-sm text-ink-muted",children:a("ui.hub.comments.empty")}):P.map(r=>c===r.id?e.jsxs("li",{className:"flex gap-3",children:[e.jsx(q,{children:e.jsx(I,{children:r.account_metadata?.name?.charAt(0).toUpperCase()||"?"})}),e.jsxs("div",{className:"flex w-full flex-col gap-2",children:[e.jsx(te,{rows:3,value:x,onChange:d=>k(d.target.value),autoFocus:!0,"aria-label":a("ui.hub.comments.edit.label")}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",onClick:m,children:[e.jsx(Ae,{}),a("ui.hub.comments.edit.cancel")]}),e.jsxs(l,{variant:"primary",size:"sm",onClick:y,disabled:D.isPending||!x.trim(),children:[D.isPending?e.jsx(K,{size:"xs",label:a("ui.hub.comments.edit.saving")}):e.jsx(Re,{}),a("ui.hub.comments.edit.save")]})]})]})]},r.id):e.jsxs("li",{className:"flex gap-3",children:[e.jsx(q,{children:e.jsx(I,{children:r.account_metadata?.name?.charAt(0).toUpperCase()||"?"})}),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-body text-ink",children:r.account_metadata?.name||a("ui.hub.comments.author.unknown")}),e.jsx("p",{className:"text-ink-muted text-meta",children:Ze(new Date(r.created_at))})]}),H(r)&&e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx(N,{content:a("ui.hub.comments.edit.label"),children:e.jsx(l,{variant:"ghost",size:"icon-sm",onClick:()=>R(r.id,r.text),disabled:!!c,"aria-label":a("ui.hub.comments.edit.label"),children:e.jsx(He,{})})}),e.jsx(N,{content:a("ui.hub.comments.delete.label"),children:e.jsx(l,{variant:"ghost",size:"icon-sm",onClick:()=>w(r.id),disabled:!!c,"aria-label":a("ui.hub.comments.delete.label"),children:e.jsx(le,{})})})]})]}),e.jsx("p",{className:"mt-2 text-body-sm text-ink whitespace-pre-wrap",children:r.text})]})]},r.id))})]})},V={all:["agent-details"],detail:t=>[...V.all,t]},at=({agentId:t,enabled:o=!0})=>oe({queryKey:V.detail(t||"invalid"),queryFn:async()=>{if(!t)throw new Error("Agent ID is required to fetch details.");return await Qe(t)},select:i=>i.result,enabled:!!t&&o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1}),nt=()=>{const t=O(),o=ce(),{isAuthenticated:n}=C();return Q({mutationFn:async({agentId:s})=>{if(!n)throw new Error("Authentication required to delist an agent.");if(!s)throw new Error("Agent ID is required to delist.");return Ue(s)},onSuccess:(s,c)=>{U("Agent delisted"),t.invalidateQueries({queryKey:V.detail(c.agentId)}),ge(t),o("/agent-hub")},onError:s=>{console.error("Delist agent error:",s)}})},it={like:"The like did not go through",favourite:"The favourite did not go through",download:"The download did not start",delist:"The agent was not delisted"},Y=({children:t})=>e.jsx("span",{className:"inline-flex h-4 min-w-5 items-center text-meta text-ink-muted",children:t}),jt=()=>{const{agentId:t}=je(),o=ce(),{isAuthenticated:n,user:i}=C(),{data:s,isLoading:c,isFetching:b,error:x,refetch:k}=at({agentId:t??"",enabled:!!t}),u=s?.visibility==="org",p=s?Se(s.name):"",{memberships:A}=Be({enabled:u}),P=u?A.find(xe=>xe.tenant_id===s?.tenant_id)?.tenant_name??null:null,{statuses:g,isKnown:D,isError:B,isFetching:S,refetch:R}=_e({agentIds:t&&!u?[t]:[]}),m=Te(D,g,t),y=m&&g[t??""]?.liked===!0,w=m&&g[t??""]?.favourited===!0,H=s?.like_count??0,r=s?.favourite_count??0,d=s?.download_count??0,M=Ee(),z=Fe(),_=Pe(),f=nt(),[ue,L]=E.useState(!1),[j,h]=E.useState(null),W=!!i&&!!s&&i.radientUser?.account?.id===s.account_id,X=()=>{!t||!n||M.isPending||(h(null),M.mutate({agentId:t,isCurrentlyLiked:y},{onError:()=>h("like")}))},Z=()=>{!t||!n||z.isPending||(h(null),z.mutate({agentId:t,isCurrentlyFavourited:w},{onError:()=>h("favourite")}))},G=()=>{!t||!s||_.isPending||(h(null),_.mutate({agentId:s.id,agentName:s.name},{onError:()=>h("download")}))},me=()=>{!t||!W||f.isPending||(h(null),f.mutate({agentId:t},{onError:()=>h("delist")}),L(!1))},T=j?j==="like"?{action:"like",error:M.error,retry:X}:j==="favourite"?{action:"favourite",error:z.error,retry:Z}:j==="download"?{action:"download",error:_.error,retry:G}:{action:"delist",error:f.error,retry:void 0}:null,he=()=>{o("/agent-hub")};return c?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(K,{label:"Loading agent details"})}):x?e.jsx("div",{className:"flex h-full items-center justify-center p-6",children:e.jsxs(se,{variant:"danger",className:"max-w-2xl",children:[e.jsx(ae,{children:"This agent could not be loaded"}),e.jsx(ne,{children:be("The Radient agent catalogue did not answer.",x)}),e.jsx("div",{className:"mt-2",children:e.jsx(l,{variant:"outline",size:"sm",onClick:()=>void k(),disabled:b,"aria-busy":b,children:b?"Trying…":"Try again"})})]})}):s?e.jsxs("div",{className:"m-6 flex flex-1 flex-col rounded-md bg-surface p-8",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-4",children:[e.jsx(l,{variant:"ghost",size:"icon",onClick:he,"aria-label":"Back to Agent hub",children:e.jsx(We,{})}),e.jsx(q,{className:"size-11 shrink-0",children:e.jsx(I,{children:e.jsx(Ye,{size:22,"aria-hidden":"true"})})}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("h1",{className:"truncate text-display text-ink",children:p}),u&&e.jsx(Me,{orgName:P})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[!u&&e.jsxs(e.Fragment,{children:[e.jsx(N,{content:"Sign in to Radient to use this feature",disabled:n,children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"sm",onClick:X,disabled:!n||M.isPending||!m,"aria-label":m?y?"Unlike agent":"Like agent":"Like state unavailable",className:J(y&&"text-danger"),children:[e.jsx(ze,{fill:y?"currentColor":"none"}),e.jsx(Y,{children:H})]})})}),e.jsx(N,{content:"Sign in to Radient to use this feature",disabled:n,children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"sm",onClick:Z,disabled:!n||z.isPending||!m,"aria-label":m?w?"Unfavourite agent":"Favourite agent":"Favourite state unavailable",className:J(w&&"text-warning"),children:[e.jsx($e,{fill:w?"currentColor":"none"}),e.jsx(Y,{children:r})]})})})]}),e.jsx(N,{content:"Download agent to your computer",children:e.jsx("span",{children:e.jsxs(l,{variant:"ghost",size:"icon",onClick:G,disabled:_.isPending,"aria-label":"Download agent",className:"ml-1",children:[e.jsx(pe,{}),e.jsx(Y,{children:_.isPending?e.jsx(v,{className:"h-3.5 w-5"}):d})]})})}),W&&!u&&e.jsx(N,{content:"Permanently delist this agent from Agent hub",children:e.jsx("span",{children:e.jsx(l,{variant:"ghost",size:"icon",onClick:()=>L(!0),disabled:f.isPending,"aria-label":"Delist agent",className:"ml-1 text-danger hover:bg-danger-wash hover:text-danger",children:e.jsx(le,{})})})})]})]}),n&&B&&!j&&!u&&e.jsxs("output",{className:"mb-6 flex flex-wrap items-center gap-2 text-meta text-warning","data-testid":"agent-details-status-unknown",children:[e.jsx("span",{children:"Your likes and favourites could not be read, so this agent's viewer state is not shown."}),e.jsx(l,{variant:"ghost",size:"sm",onClick:()=>void R(),disabled:S,"aria-busy":S,children:S?"Trying…":"Try again"})]}),T&&j&&e.jsxs(se,{variant:"danger",className:"mb-6","data-testid":"agent-details-error",children:[e.jsx(ae,{children:it[j]}),e.jsx(ne,{children:fe(T.action,T.error,p)}),T.retry&&e.jsx("div",{className:"mt-2",children:e.jsx(l,{variant:"outline",size:"sm",onClick:T.retry,children:"Try again"})})]}),e.jsx(Le,{tags:s.tags,categories:s.categories}),e.jsxs("div",{className:"mt-4 mb-6 flex flex-col gap-2 text-body-sm text-ink-muted",children:[e.jsxs("p",{children:["Created by: ",s.account_metadata?.name??"Unknown",s.account_metadata?.email?` (${s.account_metadata.email})`:""]}),e.jsxs("p",{children:["Created: ",ie(new Date(s.created_at))," ago (",ee(s.created_at),")"]}),e.jsxs("p",{children:["Last modified: ",ie(new Date(s.updated_at))," ","ago (",ee(s.updated_at),")"]})]}),e.jsx("div",{className:"mt-2 mb-8 leading-relaxed text-body text-ink",children:s.description||"No description provided."}),e.jsx(de,{className:"my-6"}),!u&&e.jsx(st,{agentId:s.id}),e.jsx(ye,{open:ue,onClose:()=>L(!1),title:"Delist this agent?",maxWidth:"xs",actions:e.jsxs(e.Fragment,{children:[e.jsx(we,{onClick:()=>L(!1),children:"Cancel"}),e.jsx(ve,{onClick:()=>{!t||!W||f.isPending||me()},disabled:f.isPending,children:f.isPending?e.jsx(K,{size:"sm",label:"Delisting agent"}):"Delist"})]}),dialogProps:{"aria-describedby":"delist-dialog-description"},children:e.jsxs("div",{id:"delist-dialog-description",className:"text-body text-ink-muted",children:['This takes "',p,'" off the hub straight away, and nobody will be able to download it. You can upload it again later.']})})]}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-body text-ink",children:"Agent not found."})})};export{jt as AgentDetailsPage};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as c,j as e,c as D,t as u}from"./index-DbzmFwlT.js";import{aN as cs,B as Ce,aP as Ve,bG as Ws,A as os,C as X,ai as K,u as ae,a as Re,D as Ae,c as me,aK as Ie,d as Ee,bH as Ye,bI as Gs,aL as Js,bJ as Xs,$ as ds,_ as $e,aT as us,bK as ce,bv as Zs,bE as et,bL as st,aX as tt,bM as at}from"./conversation-input-sync-Cs9wr7F7.js";import{P as nt}from"./page-header-B3mzM2nC.js";import{c as ms,l as J,B as C,k as _,u as he,y as it,I as te,T as hs,A as Z,m as ee,n as se,Y as lt,Z as rt,_ as ct,$ as ot,F as We,G as Ge,H as Je,J as Xe,K as Ze}from"./error-boundary-B5YLbOOu.js";import{a as dt,p as xs,P as gs,u as ut}from"./publication-validation-BIJPIOf1.js";import{h as W,O as mt,A as ht,d as xt,H as gt,a as bt,b as pt,c as ft,e as bs,C as jt,f as kt,n as yt,u as vt,i as Nt}from"./use-download-agent-mutation-C6TvAwyM.js";import{g as wt,aL as St,aK as Pt,aG as Se,aw as Tt,aq as ps,aM as _t}from"./index-rnB6EiBX.js";import{n as Pe,i as Ct,H as fs,p as es,o as js,u as Rt}from"./org-access-D0eAQUWQ.js";import{p as ks,r as ys,P as vs,h as At,i as It,j as Et,f as $t}from"./use-memberships-query-AlVCuF9E.js";import"./ui-preferences-store-D1IJShox.js";import{R as Ns}from"./radient-auth-buttons-MPoHRsQX.js";import{f as Ft}from"./format-esAOn2VS.js";import{o as Ot,a as ss}from"./org-surface-gate-Bgznt94a.js";import"./en-US-CHJkXXr4.js";import"./book-open--60aKTv6.js";import"./console-mirror-Ch4jKiRK.js";/**
|
|
2
|
+
* @license lucide-react v0.507.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Lt=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],zt=ms("building-2",Lt);/**
|
|
7
|
+
* @license lucide-react v0.507.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Mt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M7 12h.01",key:"eqddd0"}]],Dt=ms("circle-ellipsis",Mt),qt=({agent:s,isLiked:t,isFavourited:n,onLikeToggle:a,onFavouriteToggle:i,onDownload:o,isLikeActionLoading:m=!1,isFavouriteActionLoading:w=!1,isDownloading:y=!1,actionError:j=null,onRetryAction:N,showActions:x=!0,viewerStateKnown:f=!0,orgName:g=null})=>{const S=cs(),{isAuthenticated:d}=Ce(),T=s.description??"",[R,k]=c.useState(!1),b=c.useRef(null),P=c.useCallback(L=>{if(b.current?.disconnect(),b.current=null,!L)return;const $=()=>k(L.scrollHeight-L.clientHeight>1);$();const q=new ResizeObserver($);q.observe(L),b.current=q},[]),I=d?f?t?"Unlike agent":"Like agent":"Your likes could not be read, so this is not shown as unliked.":"Log in to Radient to like agents",A=d?f?n?"Unfavourite agent":"Favourite agent":"Your favourites could not be read, so this is not shown as unfavourited.":"Log in to Radient to favourite agents",h=f?t?"Unlike agent":"Like agent":"Like state unavailable",E=f?n?"Unfavourite agent":"Favourite agent":"Favourite state unavailable",l=s.visibility==="org",p=W(s.name);return e.jsxs("div",{"data-glass-block":"",className:"flex h-full flex-col overflow-hidden rounded-md bg-surface transition-colors duration-fast ease-out-quart hover:bg-elevated",children:[e.jsxs("button",{type:"button",onClick:()=>S(`/agent-hub/${s.id}`),className:"flex min-h-0 flex-1 cursor-pointer flex-col gap-2 p-4 text-left","aria-label":`View details for ${p}`,children:[e.jsx("h3",{className:"truncate font-medium text-heading text-ink",children:p}),l&&e.jsx(mt,{orgName:g}),e.jsx(J,{content:R?T:"",children:e.jsx("span",{ref:P,className:"line-clamp-3 min-h-0 text-body-sm text-ink-muted",children:T})}),e.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-2",children:[e.jsx(ht,{tags:s.tags,categories:s.categories}),e.jsxs("p",{className:"truncate text-ink-dim text-meta",children:[s.account_metadata?.name??"Unknown author",e.jsx("span",{"aria-hidden":"true",className:"mx-1.5",children:"·"}),"updated ",xt(new Date(s.updated_at))," ago"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-hairline px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-0.5","data-viewer-state":l?"org":d?f?"known":"unknown":"signed-out",children:[!l&&e.jsxs(e.Fragment,{children:[e.jsx(J,{content:I,children:e.jsx("span",{children:e.jsxs(C,{variant:"ghost",size:"sm",onClick:d&&f?()=>a(s.id):void 0,disabled:m||!d||!f,"aria-label":h,className:D(t&&"text-danger"),children:[e.jsx(gt,{fill:t?"currentColor":"none","data-testid":"agent-like-heart"}),e.jsx("span",{"data-testid":"agent-like-count",className:"inline-flex h-4 min-w-4 items-center font-mono text-mono-sm text-ink-muted",children:s.like_count??0})]})})}),e.jsx(J,{content:A,children:e.jsx("span",{children:e.jsxs(C,{variant:"ghost",size:"sm",onClick:d?()=>i(s.id):void 0,disabled:w||!d||!f,"aria-label":E,className:D(n&&"text-warning"),children:[e.jsx(wt,{fill:n?"currentColor":"none","data-testid":"agent-favourite-star"}),e.jsx("span",{"data-testid":"agent-favourite-count",className:"inline-flex h-4 min-w-4 items-center font-mono text-mono-sm text-ink-muted",children:s.favourite_count??0})]})})})]}),e.jsx(J,{content:"Downloads",children:e.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 pr-1 text-ink-dim",children:[e.jsx(Ve,{"aria-hidden":"true",className:"size-3.5"}),e.jsx("span",{className:"inline-flex h-4 min-w-6 items-center font-mono text-mono-sm",children:y?e.jsx(_,{className:"h-3 w-6"}):(s.download_count??0).toLocaleString()})]})})]}),x&&o&&e.jsx("div",{className:"ml-auto flex shrink-0 items-center",children:e.jsxs(C,{variant:"secondary",size:"sm",onClick:()=>o(s),disabled:y,"aria-label":`Download ${p}`,"data-tour-tag":"agent-hub-download-button",children:[e.jsx(Ve,{"data-testid":"agent-download"}),"Get"]})})]}),j&&e.jsxs("output",{"data-testid":"agent-card-error",className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-hairline px-3 py-2 text-body-sm text-danger",children:[e.jsx("span",{className:"min-w-0 flex-1",children:j}),N&&e.jsx(C,{variant:"ghost",size:"sm",onClick:N,children:"Try again"})]})]})},Ut=({agent:s,status:t,viewerStateKnown:n=!0,orgName:a=null})=>{const{isAuthenticated:i}=Ce(),[o,m]=c.useState(null),w=t?.liked??!1,y=t?.favourited??!1,j=bt(),N=pt(),x=ft(),f=()=>{!i||j.isPending||(m(null),j.mutate({agentId:s.id,isCurrentlyLiked:w},{onError:()=>m("like")}))},g=()=>{!i||N.isPending||(m(null),N.mutate({agentId:s.id,isCurrentlyFavourited:y},{onError:()=>m("favourite")}))},S=()=>{x.isPending||(m(null),x.mutate({agentId:s.id,agentName:s.name},{onError:()=>m("download")}))},d=o?o==="like"?{action:"like",error:j.error,retry:f}:o==="favourite"?{action:"favourite",error:N.error,retry:g}:{action:"download",error:x.error,retry:S}:null;return e.jsx(qt,{agent:s,isLiked:i&&w,isFavourited:i&&y,onLikeToggle:f,onFavouriteToggle:g,onDownload:S,isLikeActionLoading:j.isPending,isFavouriteActionLoading:N.isPending,isDownloading:x.isPending,viewerStateKnown:n,orgName:a,actionError:d?dt(d.action,d.error,W(s.name)):null,onRetryAction:d?.retry})},ts=({selected:s,onClick:t,children:n,...a})=>e.jsx("button",{type:"button",onClick:t,"aria-pressed":s,className:D("flex w-full cursor-pointer items-center gap-2.5 rounded-sm px-3 py-1.5 text-left","text-body-sm transition-colors duration-fast ease-out-quart",s?Pt:"text-ink hover:bg-row-hover"),...a,children:n}),as=Object.keys(jt),Bt=s=>[...s].sort((t,n)=>{const a=as.indexOf(t),i=as.indexOf(n);return a!==-1&&i!==-1?a-i:a!==-1?-1:i!==-1?1:t.localeCompare(n)}),Ht=({selectedCategory:s,onSelectCategory:t,categories:n})=>{he();const a=Bt(s&&!n.includes(s)?[...n,s]:n);return e.jsxs("div",{className:"flex h-full flex-col overflow-y-auto",children:[e.jsx("h2",{className:"mb-2 px-3 font-medium text-ink-dim text-meta",children:u("ui.hub.taxonomy.heading")}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs(ts,{selected:s===null,onClick:()=>t(null),"data-testid":"category-all",children:[e.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e.jsx(St,{size:16,"aria-hidden":"true"})}),u("ui.hub.taxonomy.all")]}),a.map(i=>{const o=bs(i),m=i==="other"?e.jsx(Dt,{size:16}):o.icon;return e.jsxs(ts,{selected:s===i,onClick:()=>t(i),"data-testid":`category-${i}`,children:[e.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:m}),o.label]},i)})]})]})},Fe=({page:s,count:t,onChange:n,ariaLabel:a="Agent pages"})=>{const i=c.useRef(null),o=c.useRef(null),m=c.useRef(null);return c.useEffect(()=>{const w=m.current;m.current=null,w==="previous"&&i.current?.focus(),w==="next"&&o.current?.focus()},[s]),t<=1?null:e.jsxs("nav",{"aria-label":a,className:"mt-6 flex min-h-13 items-center justify-between gap-3 border-t border-hairline","data-testid":"agent-hub-pager",children:[e.jsxs("span",{className:"select-none text-meta text-ink-dim",children:["Page ",s," of ",t]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"secondary",size:"sm",ref:i,onClick:()=>{s-1<=1&&(m.current="next"),n(s-1)},disabled:s<=1,"aria-label":"Previous page",children:[e.jsx(Ws,{"aria-hidden":"true"}),"Previous"]}),e.jsxs(C,{variant:"secondary",size:"sm",ref:o,onClick:()=>{s+1>=t&&(m.current="previous"),n(s+1)},disabled:s>=t,"aria-label":"Next page",children:["Next",e.jsx(it,{"aria-hidden":"true"})]})]})]})},ns=s=>s?.skills===1&&s.revision_cas===1;function Kt(s,t=1,n=20){const a=new URL(ks(s,"skills"));return a.searchParams.set("page",String(t)),a.searchParams.set("per_page",String(n)),ys(a.toString())}function Qt(s,t){return ys(ks(s,"skills",t))}function Vt(s){return os({operation:"org_skills.list",tenantId:s})}function Yt(s,t){return os({operation:"org_skill.get",tenantId:s,skillId:t})}const ws=12,oe={all:["public-teams"],list:(s,t)=>[...oe.all,"list",{page:s,perPage:t}],detail:s=>[...oe.all,"detail",s]},xe=(s,t)=>t instanceof vs?t.status===null?!1:t.status>=500&&s<1:s<1,Wt=({page:s=1,perPage:t=ws,enabled:n=!0}={})=>{const a=X({queryKey:oe.list(s,t),queryFn:()=>At(K.radientBaseUrl,s,t),select:i=>i.result,enabled:n,retry:xe,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1,placeholderData:i=>i});return{...a,teams:a.data?.records??[],isRefreshing:a.isFetching&&a.data!==void 0,pagination:a.data?{page:a.data.page,perPage:a.data.per_page,totalPages:a.data.total_pages,totalRecords:a.data.total_records}:void 0}},Gt=({teamId:s,enabled:t=!0})=>{const n=X({queryKey:oe.detail(s??""),queryFn:()=>It(K.radientBaseUrl,s),select:a=>a.result,enabled:t&&!!s,retry:xe,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1,retryOnMount:!1});return{...n,team:n.data}};function ge(s){if(s.getQueryState(Ye.capabilities)?.status!=="success"||!me(s.getQueryData(Ye.capabilities),"hub_skills"))throw new Error("This backend does not support the complete Hub Skills adapter.")}function Jt(s,t,n){const a=ae(),i=Re();return X({queryKey:["hub-skills",K.radientBaseUrl,s.visibility,s.tenantId,t],enabled:n&&!i.isError&&me(i.data,"hub_skills"),queryFn:async()=>{if(ge(a),s.visibility==="org"){const m=(await Vt(s.tenantId)).result;return{rows:m.skills,pages:1,contract:m.sync_contract}}const o=(await Kt(K.radientBaseUrl,t,20)).result;return{rows:o.records,pages:o.total_pages,contract:o.sync_contract}},staleTime:3e4,retry:s.visibility==="org"?Ae:xe,retryOnMount:!1,refetchOnWindowFocus:!1})}function Xt(s,t,n){const a=ae(),i=Re();return X({queryKey:["hub-skill",K.radientBaseUrl,s.visibility,s.tenantId,t],enabled:n&&t!==null&&!i.isError&&me(i.data,"hub_skills"),queryFn:async()=>(ge(a),(s.visibility==="org"?await Yt(s.tenantId,t):await Qt(K.radientBaseUrl,t)).result),staleTime:3e4,retry:s.visibility==="org"?Ae:xe,retryOnMount:!1})}function Zt(){const s=ae();return Ie({mutationFn:t=>(ge(s),Ee({op:"hub.skillPull",requestId:t.requestId,hubId:t.remoteId,hubSource:K.radientBaseUrl,visibility:t.scope.visibility,tenantId:t.scope.tenantId,localAlias:t.alias,subscribe:t.subscribe,autoPush:t.autoPush,confirmPublicEgress:t.consent})),onSuccess:t=>{s.setQueryData(Se,t.links)},onSettled:()=>{s.invalidateQueries({queryKey:Se}),s.invalidateQueries({queryKey:["desktop","skills"]})}})}function ea(){const s=ae();return Ie({mutationFn:t=>(ge(s),Ee({op:"hub.skillPublish",requestId:t.requestId,...t.draft,dryRun:t.previewReceipt===void 0,...t.previewReceipt?{previewReceipt:t.previewReceipt,confirmPublish:!0}:{}})),onSuccess:t=>{t.local_link_receipt?.state==="complete"&&(s.invalidateQueries({queryKey:Se}),s.invalidateQueries({queryKey:["desktop","skills"]}),s.invalidateQueries({queryKey:["hub-skills"]}))}})}function sa({scope:s,source:t,verifiedCas:n,enabled:a=!0}){he();const i=c.useId(),[o,m]=c.useState(""),[w,y]=c.useState(""),[j,N]=c.useState(Pe),[x,f]=c.useState(null),[g,S]=c.useState(!1),d=ea(),T=c.useRef(null),R=X({queryKey:["desktop","skills","hub-publication"],queryFn:()=>Ee({op:"skills.list"}),staleTime:3e4,retry:!1}),k=`${s.visibility}:${s.tenantId??""}`,b=c.useRef(k);c.useEffect(()=>{b.current!==k&&(b.current=k,N(h=>({...h,autoPush:!1,confirmPublicEgress:!1})),f(null),S(!0))},[k]);const P={sourceSkill:o,localAlias:w,visibility:s.visibility,tenantId:s.tenantId,...j},I=x?Ct(x,P):!1;c.useEffect(()=>{if(!x)return;const h=setTimeout(()=>{f(null),S(!0)},Math.max(0,Math.min(Date.parse(x.expires_at)-Date.now(),2147483647)));return()=>clearTimeout(h)},[x]);const A=h=>{if(!a||d.isPending||!o||!w||h&&!I)return;const E=JSON.stringify({draft:P,receipt:h?x?.preview_receipt:null}),l=T.current&&T.current.tuple===E&&(h||d.error)?T.current:{tuple:E,id:crypto.randomUUID()};T.current=l,h||(f(null),S(!1)),d.mutate({requestId:l.id,draft:P,...h&&x?{previewReceipt:x.preview_receipt}:{}},{onSuccess:p=>{p.preview?(f(p.preview),S(!1)):es(p)&&f(null)}})};return e.jsxs("section",{className:"flex min-w-0 flex-col gap-4","data-hub-skill-publication":!0,children:[e.jsx("h3",{className:"text-heading text-ink",children:u("ui.hub.skills.publish_title")}),e.jsx("label",{htmlFor:`${i}-source`,className:"text-body-sm text-ink",children:u("ui.hub.skills.select_authored")}),e.jsxs("select",{id:`${i}-source`,"data-testid":"hub-skill-publish-source",value:o,disabled:d.isPending||!a,className:"rounded-md border border-control bg-surface px-3 py-2 text-body-sm text-ink",onChange:h=>{m(h.target.value),y(h.target.value),f(null),N(E=>({...E,autoPush:!1,confirmPublicEgress:!1}))},children:[e.jsx("option",{value:"",children:u("ui.hub.skills.select_authored")}),R.data?.data.skills.map(h=>e.jsx("option",{value:h.name,children:h.name},h.name))]}),e.jsx("label",{htmlFor:`${i}-alias`,className:"text-body-sm text-ink",children:u("ui.hub.subscriptions.alias")}),e.jsx(te,{id:`${i}-alias`,"data-testid":"hub-skill-publish-alias",value:w,disabled:d.isPending||!a,onChange:h=>{y(h.target.value),N(E=>({...E,autoPush:!1,confirmPublicEgress:!1}))}}),e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.text_limits")}),e.jsx(fs,{value:j,onChange:N,source:t,item:o||w,visibility:s.visibility,organization:s.organization,destinationKey:`${k}:${o}`,canEnableAutoPush:n,disabled:d.isPending||!a}),R.isLoading&&e.jsx("output",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.loading")}),R.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:u("ui.hub.status.other_error")}),d.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:u("ui.hub.links.action_failed",{direction:u("ui.hub.links.direction_push"),item:o||w,source:t})}),(g||x&&!I&&x.can_confirm)&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:u("ui.hub.links.preview_changed")}),x&&x.visibility===s.visibility&&x.tenant_id===s.tenantId&&e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsx("h4",{className:"text-body-sm text-ink",children:u("ui.hub.links.preview_payload",{source:t})}),e.jsx(hs,{readOnly:!0,rows:12,"aria-label":u("ui.hub.links.preview_payload",{source:t}),value:JSON.stringify(x.proposal.fields,null,2),className:"max-h-96 bg-sunken text-mono-sm"}),x.warnings.map((h,E)=>e.jsx("p",{className:"break-words text-body-sm text-warning",children:h},`${E}-${h}`)),x.reason&&e.jsx("p",{className:"text-body-sm text-warning",children:Tt(x.reason)})]}),d.data?.publication===null&&d.data.local_link_receipt?.state==="pending-reconciliation"&&e.jsx("output",{className:"text-body-sm text-warning","data-testid":"hub-skill-pending-reconcile",children:u("ui.hub.links.publication_pending")}),d.data?.publication&&e.jsx("output",{className:"text-body-sm text-ink","data-testid":"hub-skill-published",children:es(d.data)?u("ui.hub.links.published",{item:d.data.link?.name??w,source:d.data.link?ps(d.data.link):t}):u("ui.hub.skills.policy_pending")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(C,{variant:"outline","data-testid":"hub-skill-publish-preview",disabled:!a||d.isPending||!o||!w,onClick:()=>A(!1),children:u("ui.hub.subscriptions.preview_publish")}),e.jsx(C,{"data-testid":"hub-skill-publish-confirm",disabled:!a||d.isPending||!I,onClick:()=>A(!0),children:u("ui.hub.links.confirm_publish")})]})]})}function ta({scope:s,signedIn:t,accessible:n=!0}){he();const a=c.useId(),[i,o]=c.useState(1),[m,w]=c.useState(""),[y,j]=c.useState(null),[N,x]=c.useState(""),[f,g]=c.useState(Pe),S=c.useRef(null),d=s.visibility==="public"?u("ui.hub.links.source_public"):s.organization?u("ui.hub.links.source_private",{organization:s.organization}):u("ui.hub.links.source_unavailable"),T=Jt(s,i,n&&(s.visibility==="public"||t)),R=ns(T.data?.contract),k=Xt(s,y,R&&n),b=Zt(),P=b.data?.link?.link_id,I=k.data?.visibility===s.visibility&&(s.visibility==="public"?!k.data.tenant_id:k.data.tenant_id===s.tenantId),A=n&&!k.error&&!T.error&&I&&ns(k.data?.sync_contract)&&!!k.data?.revision,h=(T.data?.rows??[]).filter(l=>`${l.name} ${l.description}`.toLocaleLowerCase().includes(m.toLocaleLowerCase())),E=()=>{if(!y||!A||!N||b.isPending||!t)return;const l=JSON.stringify({selected:y,scope:s,alias:N,policy:f});S.current?.tuple!==l&&(S.current={tuple:l,id:crypto.randomUUID()}),b.mutate({requestId:S.current.id,remoteId:y,scope:s,alias:N,subscribe:f.subscribe,autoPush:f.autoPush,consent:f.confirmPublicEgress})};return e.jsxs("section",{className:"flex min-w-0 flex-col gap-5","data-hub-skills-library":!0,children:[e.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-heading text-ink",children:u("ui.hub.skills.title")}),e.jsx("span",{className:"text-meta text-ink-muted","data-testid":"hub-skill-source",children:d})]}),s.visibility==="org"&&!t?e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:u("ui.hub.status.no_credential")}):e.jsxs(e.Fragment,{children:[e.jsx("label",{className:"sr-only",htmlFor:`${a}-search`,children:u("ui.hub.skills.search")}),e.jsx(te,{id:`${a}-search`,"data-testid":"hub-skill-search",value:m,placeholder:u("ui.hub.skills.search"),onChange:l=>w(l.target.value)}),e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.search_loaded")}),T.isLoading&&e.jsx("output",{className:"min-h-20 text-body-sm text-ink-muted",children:u("ui.hub.skills.loading")}),T.error&&e.jsxs("div",{role:"alert",className:"flex flex-col gap-2 text-body-sm text-warning",children:[e.jsx("p",{children:u("ui.hub.skills.catalogue_failed",{source:d})}),e.jsx(C,{variant:"outline",disabled:T.isFetching,onClick:()=>void T.refetch(),children:u("ui.hub.links.retry")})]}),T.isSuccess&&!R&&e.jsx("p",{className:"text-body-sm text-warning",children:u("ui.hub.skills.unavailable")}),R&&e.jsxs(e.Fragment,{children:[h.length===0&&e.jsx("p",{className:"text-body-sm text-ink-muted",children:u(m?"ui.hub.skills.search_empty":"ui.hub.skills.remote_empty")}),e.jsx("div",{className:"grid min-w-0 gap-3 sm:grid-cols-2",children:h.map(l=>e.jsxs("div",{className:"flex min-w-0 flex-col gap-3 rounded-md border border-hairline p-4",children:[e.jsx("h3",{className:"break-words text-body-sm font-medium text-ink",children:l.name}),e.jsx("p",{className:"break-words text-meta text-ink-muted",children:l.description}),e.jsx(C,{variant:"outline","aria-pressed":y===l.id,"data-testid":"hub-skill-open",disabled:b.isPending,onClick:()=>{j(l.id),x(l.name),g(Pe()),b.reset()},children:u("ui.hub.skills.open_detail",{item:l.name})})]},l.id))}),e.jsx(Fe,{page:i,count:T.data?.pages??1,onChange:o,ariaLabel:u("ui.hub.skills.title")})]})]}),y&&R&&e.jsxs("section",{className:"flex min-w-0 flex-col gap-3 border-t border-hairline pt-4","data-hub-skill-detail":!0,children:[k.isLoading&&e.jsx("output",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.loading")}),k.error&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:u("ui.hub.status.other_error")}),k.data&&I&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"break-words text-heading text-ink",children:k.data.name}),e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.file_count",{count:k.data.files.length})}),k.data.files.map(l=>e.jsxs("details",{className:"min-w-0",children:[e.jsx("summary",{className:"break-words text-mono-sm text-ink",children:l.path}),e.jsx(hs,{readOnly:!0,rows:12,"aria-label":l.path,value:l.content,className:"max-h-96 bg-sunken text-mono-sm"})]},l.path)),e.jsx("label",{htmlFor:`${a}-alias`,className:"text-body-sm text-ink",children:u("ui.hub.subscriptions.alias")}),e.jsx(te,{id:`${a}-alias`,"data-testid":"hub-skill-alias",value:N,disabled:b.isPending,onChange:l=>{x(l.target.value),g(p=>({...p,autoPush:!1,confirmPublicEgress:!1}))}}),e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.pull_help")}),e.jsx(fs,{value:f,onChange:g,source:d,item:N,visibility:s.visibility,organization:s.organization,destinationKey:`${s.visibility}:${s.tenantId??""}:${y}`,canEnableAutoPush:!!A,disabled:b.isPending}),e.jsx(C,{"data-testid":"hub-skill-create",disabled:!t||!A||!N||b.isPending,onClick:E,children:u("ui.hub.subscriptions.create_copy")})]}),!t&&e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.status.no_credential")}),(b.error||b.data&&!b.data.reports?.some(l=>l.applied||l.outcome==="unchanged"))&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger","data-testid":"hub-skill-pull-failed",children:u("ui.hub.skills.pull_failed")}),b.data?.link&&b.data.reports?.some(l=>l.link_id===P&&l.direction==="pull"&&l.applied)&&e.jsx("output",{className:"text-body-sm text-ink","data-testid":"hub-skill-installed",children:u("ui.hub.skills.installed_alias",{item:b.data.link.name,source:ps(b.data.link)})}),b.data?.link&&e.jsx("p",{className:"text-meta text-ink-muted",children:u("ui.hub.skills.session_selection")})]}),!n&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:u("ui.hub.status.access_lost")}),e.jsx("div",{className:"border-t border-hairline pt-5",children:e.jsx(sa,{scope:s,source:d,verifiedCas:R&&n&&t,enabled:R&&n&&t})})]})}const Ss={all:["org-teams"],list:s=>[...Ss.all,"list",s]},Ps=({tenantId:s,enabled:t=!0})=>{const n=X({queryKey:Ss.list(s??""),queryFn:async()=>(await Et(s)).result??{teams:[]},enabled:t&&!!s,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1,retryOnMount:!1,retry:Ae});return{...n,teams:n.data?.teams??[]}},aa=(s,t)=>{const n=s?.name?.trim()||t?.trim()||"Team",a=s?.renamed_from?.trim()||null;return s?.invalid_name===!0&&a?{level:"warning",message:`Pulled "${n}". The published name "${a}" is not usable locally, so the team was stored as "${n}".`}:a?{level:"success",message:`Pulled "${n}" (you already have a team called "${a}").`}:{level:"success",message:`Pulled team "${n}".`}},Ts=()=>{const s=ae();return Ie({mutationFn:async({teamId:t,tenantId:n})=>{if(!K.baseUrl)throw new Error("Local Operator API URL is not configured.");return Xs.pullOrgTeamFromRadient(K.baseUrl,t,n)},onSuccess:(t,n)=>{const a=aa(t.result,n.name);a.level==="warning"?Gs(a.message):Js(a.message),s.invalidateQueries({queryKey:["desktop","teams"]})},onError:t=>{console.error("Pulling an organization team failed:",t)}})},na=/^v/i,_s=s=>s.members.reduce((t,n)=>t+n.count,0),ia=s=>s.count>1?`${s.role} ×${s.count}`:s.role,Te=s=>s.members.map(ia).join(", "),Cs=s=>{const t=(s.version??"").trim().replace(na,"").trim();return t===""?null:t},Rs=s=>{const t=s.account_metadata?.name?.trim();return t||null},la=s=>{const t=(s.description??"").trim();return t===""?null:t},_e=240,ra=_e/2,ca=(s,t)=>{if(t||s.length<=_e)return s;const n=s.slice(0,_e),a=n.lastIndexOf(" ");return`${(a>=ra?n.slice(0,a):n).trimEnd()}…`},de=s=>Ft(s,"d MMM yyyy"),ue=s=>{if(!s)return null;const t=new Date(s);return Number.isNaN(t.getTime())?null:t},is=(s,t,n)=>{const a=n-t.getTime();let i;return a<0?i=de(t):a<6e4?i="just now":i=`${kt(t,new Date(n))} ago`,{label:s,when:i,iso:t.toISOString(),exact:de(t)}},oa=(s,t=Date.now())=>{const n=ue(s.updated_at);if(n)return is("updated",n,t);const a=ue(s.created_date);return a?is("created",a,t):null},da=s=>{const t=ue(s.created_date),n=ue(s.updated_at);return{created:t?de(t):null,updated:n?de(n):null}},ua=s=>s==="role"?"Role":s==="specialist"?"Specialist":s,ma=["refresh-hub","retry","sign-in"],ha=({tenantId:s,orgName:t})=>{const{teams:n,isLoading:a,isFetching:i,isError:o,error:m,refetch:w}=Ps({tenantId:s}),y=js(m),j=Ts(),[N,x]=c.useState(null),[f,g]=c.useState(null),S=c.useRef(new Map),d=c.useRef(null);c.useEffect(()=>{j.isPending||d.current===null||(S.current.get(d.current)?.focus(),d.current=null)},[j.isPending]);const[T,R]=c.useState(!1),[k,b]=c.useState(()=>new Set),P=(l,p)=>b(L=>{const $=new Set(L);return p?$.add(l):$.delete(l),$}),I=(l,p)=>{l.key!=="Escape"||!k.has(p)||(l.target instanceof Element?l.target:null)?.closest('[data-testid="org-team-pull-error"]')||(P(p,!1),l.currentTarget.querySelector("button[aria-expanded]")?.focus(),l.preventDefault())},A=c.useMemo(()=>{if(!ds(j.error))return null;const l=n.find(p=>p.id===N);return xs({code:j.error.code,message:j.error.message,details:j.error.details},{name:l?.name??"this team",hubAgentId:null,surface:"pull"})},[j.error,N,n]),h=(l,p)=>{switch(l){case"refresh-hub":w();break;case"retry":E(p);break;case"sign-in":R(!0);break}},E=l=>{j.isPending||(d.current=l.id,x(null),g(l.id),j.mutate({teamId:l.id,tenantId:s,name:l.name},{onSettled:()=>g(null),onError:()=>x(l.id)}))};return e.jsxs("section",{className:"mb-6 max-w-4xl rounded-md bg-surface","aria-label":`Teams shared with ${t??"this organization"}`,"data-testid":"org-teams",children:[a&&e.jsxs("div",{"aria-hidden":"true",className:"flex flex-col divide-y divide-hairline","data-testid":"org-teams-loading",children:[e.jsx(Ne,{}),e.jsx(Ne,{}),e.jsx(Ne,{})]}),!a&&o&&e.jsxs(Z,{variant:y?"warning":"danger",className:"m-4 w-auto","data-testid":"org-teams-error",children:[e.jsx(ee,{children:y==="plan"?"That organization needs an active Team plan":y==="no_access"?"You do not have access to that organization":"Teams could not be loaded"}),e.jsx(se,{children:y==="plan"?`Reading an organization's teams is part of the Team plan. An owner of ${t??"this organization"} can activate it in the Radient console, and then its teams will be listed here.`:y==="no_access"?`You are not a member of ${t??"that organization"}, so its teams are not listed here. An owner can invite you again.`:$e("The teams shared with this organization could not be read.",m)}),y!=="no_access"&&e.jsx("div",{className:"mt-2",children:e.jsx(C,{variant:"primary",size:"sm",onClick:()=>void w(),disabled:i,"aria-busy":i,children:i?"Trying…":"Try again"})})]}),!a&&!o&&n.length===0&&e.jsx("p",{className:"p-4 text-body-sm text-ink-muted","data-testid":"org-teams-empty",children:`Teams shared into ${t??"this organization"} appear here for its members.`}),!a&&!o&&n.length>0&&e.jsx("ul",{className:"flex flex-col divide-y divide-hairline",children:n.map(l=>e.jsxs("li",{className:D(As,"transition-colors duration-fast ease-out-quart hover:bg-elevated first:rounded-t-md last:rounded-b-md"),onKeyDown:p=>I(p,l.id),children:[e.jsx(us,{className:"min-w-0",open:k.has(l.id),onOpenChange:p=>P(l.id,p),summaryAlign:"firstLine",triggerClassName:"min-w-0",chevronClassName:"text-ink-dim mt-1",rowClassName:"py-0",summary:e.jsx(ba,{team:l,expanded:k.has(l.id)}),trailing:e.jsx("div",{className:"-mt-1 ml-3 shrink-0 self-start",children:e.jsx(C,{ref:p=>{p?S.current.set(l.id,p):S.current.delete(l.id)},variant:"secondary",size:"sm",onClick:()=>E(l),disabled:j.isPending,"aria-label":`Pull team ${W(l.name)}`,children:f===l.id?"Pulling…":"Pull"})}),children:e.jsx(pa,{team:l})}),N===l.id&&e.jsxs("div",{className:"mt-1 flex flex-col items-start gap-1 pl-5","data-testid":"org-team-pull-error",children:[e.jsx("output",{className:"text-meta text-danger",children:A?.body??j.error?.message??`"${W(l.name)}" could not be pulled.`}),A?.actions.filter(p=>ma.includes(p)).map(p=>e.jsx(C,{variant:"primary",size:"sm",onClick:()=>h(p,l),children:gs[p]},p)),T&&e.jsx("div",{className:"mt-1","data-testid":"org-team-pull-reauth",children:e.jsx(Ns,{titleText:"Sign in again",descriptionText:"",onSignInSuccess:()=>{R(!1),x(null),w()}})})]})]},l.id))})]})},As="px-4 py-3",Is=()=>e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:"mx-1.5",children:"·"}),e.jsx("span",{className:"sr-only",children:", "})]}),xa=({team:s})=>{const t=s.manager?.trim(),n=_s(s);return e.jsxs("span",{className:"block truncate text-meta",children:[t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-ink-dim",children:"Manager:"})," ",e.jsx("span",{className:"text-ink-muted",children:t})]}):null,t?e.jsx(Is,{}):null,s.members.length===0?e.jsx("span",{className:"text-ink-dim",children:"No members"}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-ink-dim",children:[n," ",n===1?"member":"members",":"]})," ",e.jsx("span",{className:"text-ink-muted",children:Te(s)})]})]})},ga=({team:s})=>{const t=s.project?.trim(),n=Rs(s),a=oa(s),i=[];return t&&i.push({key:"project",node:t}),n&&i.push({key:"author",node:n}),a&&i.push({key:"recency",node:e.jsxs(e.Fragment,{children:[a.label," ",e.jsx(J,{content:a.exact,children:e.jsx("time",{dateTime:a.iso,children:a.when})})]})}),i.length===0?null:e.jsx("span",{className:"block truncate text-ink-dim text-meta",children:i.map((o,m)=>e.jsxs("span",{children:[m>0?e.jsx(Is,{}):null,o.node]},o.key))})},ba=({team:s,expanded:t})=>{const n=la(s),a=Cs(s);return e.jsxs("span",{className:"flex min-w-0 flex-col",children:[e.jsxs("span",{className:"flex min-w-0 items-baseline",children:[e.jsx("span",{className:"truncate font-medium text-body text-ink",children:W(s.name)}),a?e.jsxs("span",{className:"ml-2 shrink-0 text-ink-dim text-meta",children:["v",a]}):null]}),n?e.jsxs(e.Fragment,{children:[e.jsx("span",{...ce,"aria-hidden":"true",className:D("mt-1 select-text break-words text-body-sm text-ink-muted",t?"line-clamp-[12] whitespace-pre-line":"line-clamp-2"),children:n}),e.jsx("span",{className:"sr-only",children:ca(n,t)})]}):e.jsx("span",{className:"mt-1 text-body-sm text-ink-dim",children:"No description"}),e.jsxs("span",{className:"mt-1 flex min-w-0 flex-col",children:[e.jsx(xa,{team:s}),e.jsx(ga,{team:s})]})]})},pa=({team:s})=>{const t=s.manager?.trim(),n=da(s),a=[n.created?`Created ${n.created}`:null,n.updated?`Updated ${n.updated}`:null].filter(o=>o!==null),i=!!t||s.members.length>0;return e.jsxs("div",{className:"mt-1 flex flex-col gap-2",children:[i||a.length===0?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"text-ink-dim text-meta",children:"Members"}),e.jsxs("ul",{className:"flex flex-col gap-0.5",children:[t?e.jsxs("li",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:t}),e.jsx("span",{className:"text-ink-dim text-meta",children:"Manager"})]}):null,s.members.map(o=>e.jsxs("li",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:o.role}),e.jsx("span",{className:"text-ink-dim text-meta",children:ua(o.kind)}),o.count>1?e.jsxs("span",{className:"text-ink-dim text-meta tabular-nums",children:["×",o.count]}):null]},`${o.kind}:${o.role}`)),i?null:e.jsx("li",{className:"text-ink-dim text-meta",children:"No members"})]})]}):null,a.length>0?e.jsx("p",{className:"text-ink-dim text-meta",children:a.join(" · ")}):null]})},Ne=()=>e.jsxs("div",{className:D(As,"pl-9"),"data-testid":"org-team-skeleton-row",children:[e.jsx("div",{className:"flex h-[1lh] items-center text-body",children:e.jsx(_,{className:"h-4.5 w-40"})}),e.jsxs("div",{className:"mt-1 flex h-[2lh] flex-col justify-evenly text-body-sm",children:[e.jsx(_,{className:"h-3.5 w-full"}),e.jsx(_,{className:"h-3.5 w-2/3"})]}),e.jsx("div",{className:"mt-1 flex h-[1lh] items-center text-meta",children:e.jsx(_,{className:"h-3 w-64"})}),e.jsx("div",{className:"flex h-[1lh] items-center text-meta",children:e.jsx(_,{className:"h-3 w-48"})})]}),Es=(s,t)=>t instanceof vs?t.message:$e(s,t),fa=["refresh-hub","retry","sign-in"],ja=({signedIn:s,onOpenSettings:t})=>{const[n,a]=c.useState(1),[i,o]=c.useState(""),{teams:m,isLoading:w,isFetching:y,isError:j,error:N,refetch:x,pagination:f}=Wt({page:n,perPage:ws}),g=Ts(),[S,d]=c.useState(null),[T,R]=c.useState(null),k=c.useRef(new Map),b=c.useRef(null);c.useEffect(()=>{g.isPending||b.current===null||(k.current.get(b.current)?.focus(),b.current=null)},[g.isPending]);const P=yt(i.trim()),I=c.useMemo(()=>P?m.filter(v=>W(v.name).toLowerCase().includes(P)||(v.description??"").toLowerCase().includes(P)):m,[m,P]),A=v=>{g.isPending||(d(null),R(v.id),b.current=v.id,g.mutate({teamId:v.id,name:v.name},{onSettled:()=>R(null),onError:()=>d(v.id)}))},h=c.useMemo(()=>{if(!ds(g.error))return null;const v=m.find(O=>O.id===S);return xs({code:g.error.code,message:g.error.message,details:g.error.details},{name:v?.name??"this team",hubAgentId:null,surface:"pull"})},[g.error,S,m]),E=h?.body??(Zs(g.error)==="unauthorized"?"The team could not be pulled: this machine has no Radient sign-in for the hub. Sign in on the settings page, then pull again.":"The team could not be pulled."),[l,p]=c.useState(!1),L=(v,O)=>{switch(v){case"refresh-hub":x();break;case"retry":A(O);break;case"sign-in":p(!0);break}},$=w&&m.length===0,q=f?.totalRecords??m.length,F=c.useRef(null),z=v=>{const O=i!=="";o(v),O&&v===""&&F.current?.focus()};return e.jsxs("section",{"aria-label":"Public teams",className:"flex flex-col","data-testid":"agent-hub-public-teams",children:[e.jsx("h2",{className:"sr-only",children:"Public teams"}),e.jsx("p",{className:"mb-3 max-w-3xl text-body-sm text-ink-muted",children:"Public teams are published to the hub by anyone and can be read here without signing in. Pulling one copies it into this machine's local team registry."}),s?null:e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2","data-testid":"agent-hub-public-teams-signed-out",children:[e.jsx("span",{className:"text-meta text-ink-dim",children:"Sign in to Radient to pull a team into this machine."}),e.jsx(C,{variant:"secondary",size:"sm",onClick:t,children:"Open settings to sign in"})]}),e.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:e.jsxs("div",{className:D("flex min-w-56 max-w-md flex-1 items-center rounded-sm border border-control bg-surface","transition-colors duration-fast ease-out-quart","has-[:focus-visible]:outline-solid has-[:focus-visible]:outline-2","has-[:focus-visible]:outline-accent has-[:focus-visible]:outline-offset-2"),children:[e.jsx(et,{"aria-hidden":"true",className:"ml-2 shrink-0 text-ink-dim"}),e.jsx(te,{ref:F,type:"search",value:i,onChange:v=>z(v.target.value),placeholder:"Search teams","aria-label":"Search teams",className:"h-8 min-w-0 flex-1 border-0 bg-transparent outline-none","data-testid":"agent-hub-public-teams-search"})]})}),$&&e.jsxs("div",{"aria-hidden":"true",className:"flex max-w-4xl flex-col gap-3","data-testid":"agent-hub-public-teams-loading",children:[e.jsx(we,{}),e.jsx(we,{}),e.jsx(we,{})]}),!$&&j&&e.jsxs(Z,{variant:"danger",className:"w-auto max-w-2xl","data-testid":"agent-hub-public-teams-error",children:[e.jsx(ee,{children:"Public teams could not be loaded"}),e.jsx(se,{children:Es("The public team catalogue could not be read.",N)}),e.jsx("div",{className:"mt-2",children:e.jsx(C,{variant:"primary",size:"sm",onClick:()=>void x(),disabled:y,"aria-busy":y,children:y?"Trying…":"Try again"})})]}),!$&&!j&&m.length===0&&e.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted","data-testid":"agent-hub-public-teams-empty",children:"No teams have been published to the public hub yet."}),!$&&!j&&m.length>0&&e.jsxs(e.Fragment,{children:[!P||I.length>0?e.jsxs("p",{className:"mb-3 text-meta text-ink-dim","data-testid":"agent-hub-public-teams-status",children:[P?`${I.length} of ${m.length} teams on this page match "${i.trim()}"`:`${q} ${q===1?"team":"teams"} in the public hub`,P?e.jsxs("span",{className:"text-ink-dim",children:[" ","· search covers the teams loaded here"]}):null]}):null,I.length===0?e.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted","data-testid":"agent-hub-public-teams-search-miss",children:`No team on this page matches "${i.trim()}".`}):e.jsx("ul",{className:"flex max-w-4xl flex-col gap-3",children:I.map(v=>e.jsx(ka,{team:v,pulling:T===v.id,pullPending:g.isPending,onPull:A,pullButtonRef:O=>{O?k.current.set(v.id,O):k.current.delete(v.id)},failed:S===v.id,failureBody:E,treatment:h,onTreatmentAction:L,reauthenticating:l,onReauthenticated:()=>{p(!1),d(null),x()}},v.id))}),!P&&f&&f.totalPages>1&&e.jsx(Fe,{count:f.totalPages,page:f.page,onChange:v=>{a(v),F.current?.scrollIntoView({block:"nearest"})}})]})]})},ka=({team:s,pulling:t,pullPending:n,onPull:a,failed:i,failureBody:o,treatment:m,onTreatmentAction:w,reauthenticating:y,onReauthenticated:j,pullButtonRef:N})=>{const[x,f]=c.useState(!1),g=Gt({teamId:x?s.id:void 0}),S=W(s.name),d=Cs(s),T=Rs(s),R=s.manager?.trim(),k=_s(s),b=(s.description??"").trim();return e.jsxs("li",{className:"rounded-md bg-surface p-4","data-testid":"agent-hub-public-team","data-team-name":s.name,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline",children:[e.jsx("h3",{className:"truncate font-medium text-heading text-ink",children:S}),d?e.jsxs("span",{className:"ml-2 shrink-0 text-ink-dim text-meta",children:["v",d]}):null]}),b?e.jsx("p",{...ce,className:"mt-1 line-clamp-3 max-w-3xl select-text text-body-sm text-ink-muted",children:b}):e.jsx("p",{className:"mt-1 text-body-sm text-ink-dim",children:"No description"}),e.jsxs("p",{className:"mt-2 flex flex-wrap items-baseline gap-x-2 text-meta",children:[R?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-ink-dim",children:"Manager:"}),e.jsx("span",{className:"text-ink-muted",children:R})]}):null,s.members.length===0?e.jsx("span",{className:"text-ink-dim",children:"No members"}):e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-ink-dim",children:[k," ",k===1?"member":"members",":"]}),e.jsx(J,{content:Te(s),children:e.jsx("span",{className:"truncate text-ink-muted",children:Te(s)})})]})]}),T?e.jsxs("p",{className:"mt-1 text-ink-dim text-meta",children:["Published by ",e.jsx("span",{className:"text-ink-muted",children:T})]}):null]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-2",children:[e.jsx(C,{ref:N,variant:"secondary",size:"sm",onClick:()=>a(s),disabled:n,"aria-label":`Pull team ${S}`,children:t?"Pulling…":"Pull"}),i&&e.jsxs("div",{className:"flex max-w-56 flex-col items-end gap-1","data-testid":"agent-hub-public-team-pull-error",children:[e.jsx("output",{className:"text-right text-meta text-danger",children:o}),m?.actions.filter(P=>fa.includes(P)).map(P=>e.jsx(C,{variant:"primary",size:"sm",onClick:()=>w(P,s),children:gs[P]},P)),y&&e.jsx("div",{"data-testid":"agent-hub-public-team-pull-reauth",children:e.jsx(Ns,{titleText:"Sign in again",descriptionText:"",onSignInSuccess:j})})]})]})]}),e.jsx("div",{className:"mt-2",children:e.jsx(us,{summary:"Brief",open:x,onOpenChange:f,className:"w-full",triggerClassName:"w-full",triggerLabel:`View the brief for ${S}`,chevronClassName:"text-ink-dim",children:e.jsx(ya,{detail:g})})})]})},ya=({detail:s})=>{if(s.isLoading)return e.jsxs("div",{className:"flex flex-col gap-1","data-testid":"agent-hub-public-team-brief-loading",children:[e.jsx(_,{className:"h-[1lh] w-2/3"}),e.jsx(_,{className:"h-[2lh] w-full"})]});if(s.isError)return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx("output",{className:"text-meta text-danger",children:Es("This team's brief could not be read.",s.error)}),e.jsx(C,{variant:"primary",size:"sm",onClick:()=>void s.refetch(),disabled:s.isFetching,"aria-busy":s.isFetching,children:s.isFetching?"Trying…":"Try again"})]});const t=s.team;if(!t)return null;const n=(t.instructions??"").trim(),a=(t.project??"").trim();return e.jsxs("div",{className:"flex max-w-3xl flex-col gap-3 text-body-sm","data-testid":"agent-hub-public-team-brief",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"text-ink-dim text-meta",children:"Collaboration brief"}),n?e.jsx("p",{...ce,className:"whitespace-pre-line select-text text-ink-muted",children:n}):e.jsx("p",{className:"text-ink-dim",children:"This team has no collaboration brief."})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"text-ink-dim text-meta",children:"Project brief"}),a?e.jsx("p",{...ce,className:"whitespace-pre-line select-text text-ink-muted",children:a}):e.jsx("p",{className:"text-ink-dim",children:"This team has no project brief."})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"text-ink-dim text-meta",children:"Roster"}),e.jsxs("ul",{className:"flex flex-col gap-0.5",children:[t.manager?.trim()?e.jsxs("li",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:t.manager.trim()}),e.jsx("span",{className:"text-ink-dim text-meta",children:"Manager"})]}):null,t.members.length===0?e.jsx("li",{className:"text-ink-dim",children:"No members"}):t.members.map(i=>e.jsxs("li",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-body-sm text-ink-muted",children:i.count>1?`${i.role} ×${i.count}`:i.role}),e.jsx("span",{className:"text-ink-dim text-meta",children:i.kind})]},`${i.kind}:${i.role}`))]})]})]})},we=()=>e.jsxs("div",{className:"rounded-md bg-surface p-4",children:[e.jsx(_,{className:"h-[1lh] w-1/3"}),e.jsx(_,{className:"mt-1 flex h-[3lh] w-full"}),e.jsx(_,{className:"mt-2 h-[1lh] w-2/3"})]}),va=(s,t)=>{const[n,a]=c.useState(s);return c.useEffect(()=>{const i=setTimeout(()=>a(s),t);return()=>clearTimeout(i)},[s,t]),n},re=[{value:"download_count:desc",label:"Most downloaded",sort:"download_count",order:"desc"},{value:"like_count:desc",label:"Most liked",sort:"like_count",order:"desc"},{value:"favourite_count:desc",label:"Most favourited",sort:"favourite_count",order:"desc"},{value:"created_at:desc",label:"Newest",sort:"created_at",order:"desc"},{value:"updated_at:desc",label:"Recently updated",sort:"updated_at",order:"desc"},{value:"name:asc",label:"Name (A to Z)",sort:"name",order:"asc"}],Na=[{value:"name",label:"Name"},{value:"description",label:"Description"}],wa=300,Y="public",ls={agents:"agent-hub-view-agents",teams:"agent-hub-view-teams",skills:"agent-hub-view-skills"},rs="agent-hub-view-panel",Sa=()=>e.jsxs("div",{className:"flex h-full flex-col overflow-hidden rounded-md bg-surface",children:[e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 p-4",children:[e.jsx(_,{className:"h-5.5 w-2/3"}),e.jsx(_,{className:"h-3.5 w-full"}),e.jsx(_,{className:"h-3.5 w-full"}),e.jsx(_,{className:"h-3.5 w-1/2"}),e.jsxs("div",{className:"mt-auto flex flex-col gap-2 pt-2",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(_,{className:"h-5.5 w-24"}),e.jsx(_,{className:"h-5.5 w-20"})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsx(_,{className:"h-5.5 w-24"})})]}),e.jsx(_,{className:"h-4.5 w-32"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-hairline px-3 py-2",children:[e.jsx(_,{className:"size-4"}),e.jsx(_,{className:"h-4 w-6"}),e.jsx(_,{className:"size-4"}),e.jsx(_,{className:"h-4 w-6"}),e.jsx(_,{className:"ml-auto h-7 w-16"})]})]}),Ua=()=>{const s=cs(),{isAuthenticated:t}=Ce(),[n,a]=c.useState(1),[i]=c.useState(12),[o,m]=c.useState(null),[w,y]=c.useState(""),[j,N]=c.useState("name"),[x,f]=c.useState(re[0].value),[g,S]=c.useState(Y),[d,T]=c.useState("agents");he();const[R,k]=c.useState([]),b=va(w,wa),P=re.find(r=>r.value===x)??re[0],I=Re(),A=!I.isError&&me(I.data,"hub_skills"),h=d==="skills"&&!A?"agents":d;c.useEffect(()=>{d==="skills"&&!A&&T("agents")},[d,A]);const E=st(),l=tt(I.data,"radient_org"),p=t?Ot(l,E??null):null,{memberships:L}=$t({enabled:ss(l)}),$=c.useMemo(()=>Rt(L),[L]),q=g===Y||$.some(r=>r.tenant_id===g);c.useEffect(()=>{!q&&h!=="skills"&&S(Y)},[q,h]);const F=g===Y?null:$.find(r=>r.tenant_id===g)??null,z=F?.tenant_id,v=F?.tenant_name||null,O=o!==null||b!=="",be=Ps({tenantId:z}),ne=z&&be.isSuccess&&!O?be.teams.length:null,$s=F?.role==="owner"||F?.role==="admin",Fs=c.useMemo(()=>new Map(L.map(r=>[r.tenant_id,r.tenant_name])),[L]),{data:ie,agents:Os,isLoading:Ls,isFetching:U,error:Q,refetch:Oe,pagination:B}=ut({page:n,perPage:i,categories:o?[o]:void 0,name:j==="name"&&b||void 0,description:j==="description"&&b||void 0,sort:P.sort,order:P.order,tenantId:z}),G=F?js(Q):null,le=Os??[],Le=U&&ie!==void 0,{statuses:ze,isKnown:zs,isError:Ms,isFetching:pe,refetch:Ds}=vt({agentIds:z?[]:le.map(r=>r.id)}),fe=c.useRef(null),je=c.useRef(null),[Me,qs]=c.useState(0);c.useEffect(()=>{Me!==0&&(fe.current??je.current)?.focus()},[Me]);const De=c.useRef(null),ke=c.useRef(!1),ye=c.useMemo(()=>[...new Set((ie?.records??[]).flatMap(r=>r.categories??[]))],[ie]);c.useEffect(()=>{k(r=>ye.every(V=>r.includes(V))?r:[...new Set([...r,...ye])])},[ye]);const Us=()=>{m(null),y(""),a(1),qs(r=>r+1)},M=(Ls||U)&&ie===void 0,qe=!M&&!O&&(Q!==null||le.length===0);c.useEffect(()=>{!ke.current||M||(ke.current=!1,Q?De.current?.focus():(fe.current??je.current)?.focus())},[M,Q]);const Ue=c.useRef(null),Bs=r=>{a(r),Ue.current?.scrollIntoView({block:"nearest"})},Hs=r=>{m(r),a(1)},Ks=r=>{y(r),a(1)},Qs=r=>{S(r),a(1)},Be=c.useRef(new Map),Vs=r=>{N(r),a(1)},He=B&&!O?B.totalRecords:null,ve=z?`shared with ${v??"this organization"}`:"in the public hub",Ke=(r,V)=>`${r} ${V}${r===1?"":"s"} ${ve}`;let H;return h==="skills"?H=" ":h==="teams"?z?be.isLoading?H="Loading teams…":ne!==null?H=Ke(ne,"team"):H=`Teams ${ve}`:H=" ":M?H="Loading agents…":B?H=Ke(B.totalRecords,"agent"):H=`Agents ${ve}`,e.jsxs("div",{className:"flex h-full flex-col gap-8 p-6",children:[e.jsx(nt,{title:"Agent hub",subtitle:"Discover and download community agents on Radient",icon:_t}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[p&&e.jsxs(Z,{variant:"warning",className:"max-w-2xl","data-testid":"agent-hub-org-unavailable",children:[e.jsx(ee,{children:"Organizations are unavailable"}),e.jsx(se,{children:p})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2","data-testid":"agent-hub-browse-bar",children:[e.jsx(lt,{value:h,onValueChange:r=>T(r),children:e.jsx(rt,{"aria-label":"Browse the hub by type",children:["agents","teams",...A?["skills"]:[]].map(r=>e.jsxs(ct,{value:r,id:ls[r],"aria-controls":h===r?rs:void 0,"data-testid":`agent-hub-view-${r}`,children:[r==="agents"?"Agents":r==="teams"?"Teams":u("ui.hub.skills.title"),r!=="skills"&&(r==="agents"?He:ne)!==null&&e.jsx("span",{className:"min-w-[2ch] font-normal text-ink-dim tabular-nums",children:r==="agents"?He:ne})]},r))})}),$.length>0&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-2",children:[e.jsx("span",{"aria-hidden":"true",className:"text-meta text-ink-muted",children:"Showing"}),e.jsxs("fieldset",{className:"m-0 min-w-0 border-0 p-0","data-testid":"agent-hub-scope",children:[e.jsx("legend",{className:"sr-only",children:"Show the hub of"}),e.jsx("div",{className:"flex flex-wrap gap-0.5 rounded-md bg-sunken p-0.5",children:[{value:Y,label:"Public hub",Icon:at},...$.map(r=>({value:r.tenant_id,label:r.tenant_name||"Organization",Icon:zt}))].map(({value:r,label:V,Icon:Ys})=>e.jsxs(C,{ref:Qe=>{Qe?Be.current.set(r,Qe):Be.current.delete(r)},variant:"ghost",size:"sm","aria-pressed":g===r,onClick:()=>Qs(r),title:V,"data-testid":`agent-hub-scope-${r===Y?"public":`org-${r}`}`,className:D("max-w-48",g===r&&"bg-surface text-ink hover:bg-surface"),children:[e.jsx(Ys,{"aria-hidden":"true"}),e.jsx("span",{className:"truncate",children:V})]},r))})]})]})]}),e.jsx(ot,{id:rs,labelledBy:ls[h],children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-row overflow-hidden",children:[h==="agents"&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"mr-6 hidden w-60 shrink-0 rounded-md bg-surface p-2 md:block","data-glass-region":"panel","data-tour-tag":"agent-hub-sidebar-container",children:!qe&&e.jsx(Ht,{selectedCategory:o,onSelectCategory:Hs,categories:R})})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-y-auto",children:[h==="agents"&&!qe&&e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:D("flex min-w-56 flex-1 items-center rounded-sm border border-control bg-surface","transition-colors duration-fast ease-out-quart","has-[:focus-visible]:outline-solid has-[:focus-visible]:outline-2","has-[:focus-visible]:outline-accent has-[:focus-visible]:outline-offset-2"),children:[e.jsx(te,{ref:fe,type:"search",value:w,onChange:r=>Ks(r.target.value),placeholder:"Search agents","aria-label":"Search agents",className:"h-8 min-w-0 flex-1 border-0 bg-transparent outline-none","data-testid":"agent-hub-search"}),e.jsxs(We,{value:j,onValueChange:Vs,children:[e.jsx(Ge,{className:"w-auto shrink-0 border-y-0 border-l border-hairline border-r-0 bg-transparent pl-2 outline-none","aria-label":"Search in","data-testid":"agent-hub-search-scope",children:e.jsx(Je,{})}),e.jsx(Xe,{children:Na.map(r=>e.jsx(Ze,{value:r.value,children:r.label},r.value))})]})]}),e.jsxs(We,{value:x,onValueChange:f,children:[e.jsx(Ge,{className:"w-48","aria-label":"Sort agents","data-testid":"agent-hub-sort",children:e.jsx(Je,{})}),e.jsx(Xe,{children:re.map(r=>e.jsx(Ze,{value:r.value,children:r.label},r.value))})]})]}),e.jsxs("p",{ref:Ue,"aria-live":"polite",className:"mb-3 text-meta text-ink-dim","data-testid":"agent-hub-status",children:[H,h==="agents"&&Le?e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{"data-testid":"agent-hub-updating",children:"Updating…"})]}):null]}),h==="agents"&&e.jsxs(e.Fragment,{children:[t&&Ms&&e.jsxs("output",{className:"mb-3 flex flex-wrap items-center gap-2 text-meta text-warning","data-testid":"agent-hub-status-unknown",children:[e.jsx("span",{children:"Your likes and favourites could not be read, so no card shows a viewer state."}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>void Ds(),disabled:pe,"aria-busy":pe,children:pe?"Trying…":"Try again"})]}),M&&e.jsx("div",{"data-testid":"agent-hub-loading",className:"grid grid-cols-[repeat(auto-fill,minmax(17.5rem,1fr))] gap-6",children:Array.from({length:6},(r,V)=>e.jsx(Sa,{},V))}),M&&B===void 0&&e.jsx("div",{"aria-hidden":"true",className:"mt-6 flex min-h-13 items-center justify-center","data-testid":"agent-hub-pager-placeholder",children:e.jsx(_,{className:"h-4 w-24"})}),e.jsx("output",{"aria-live":"polite","data-testid":"agent-hub-outage",className:D(!M&&Q&&!G?"block":"sr-only"),children:!M&&Q&&!G&&e.jsxs(Z,{variant:"danger",className:"max-w-2xl","aria-busy":U,"data-testid":"agent-hub-error",children:[e.jsx(ee,{children:t?"The hub could not be loaded":"Sign in to use the hub"}),e.jsx(se,{children:t?$e("The agent list could not be loaded.",Q):"You are not signed in to Radient, so the hub has no credential to read the agent list with. Sign in on the settings page, then try again."}),e.jsx("div",{className:"mt-2",children:e.jsx(C,{ref:De,variant:"outline",size:"sm",onClick:()=>{ke.current=!0,Oe()},disabled:U,"aria-busy":U,children:U?"Trying…":"Try again"})})]})}),!M&&G&&F&&e.jsxs(Z,{variant:"warning",className:"max-w-2xl","data-testid":"agent-hub-org-no-access",children:[e.jsx(ee,{children:G==="plan"?"That organization needs an active Team plan":"You do not have access to that organization"}),e.jsx(se,{children:G==="plan"?`Sharing agents inside an organization is part of the Team plan. An owner of ${F.tenant_name||"this organization"} can activate it in the Radient console, and then its agents will be listed here.`:`You are not a member of ${F.tenant_name||"that organization"}, so its agents are not listed here. An owner can invite you again.`}),G==="plan"&&e.jsx("div",{className:"mt-2",children:e.jsx(C,{variant:"primary",size:"sm",onClick:()=>void Oe(),disabled:U,"aria-busy":U,children:U?"Trying…":"Try again"})})]}),!M&&!Q&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(17.5rem,1fr))] gap-6","aria-busy":Le,children:le.length===0?e.jsxs("div",{"data-testid":"agent-hub-empty",className:D("col-span-full w-full flex flex-col items-center gap-2 rounded-md bg-surface px-6 py-10 text-center",!z&&"max-w-2xl justify-self-center"),children:[e.jsx("p",{className:"text-heading text-ink",children:z?"This organization has no shared agents yet.":o?`No agents in ${bs(o).label}.`:O?"No agents match that search.":"The hub is empty."}),e.jsx("p",{className:"max-w-md text-body-sm text-ink-muted",children:z?`Agents published into ${F?.tenant_name||"this organization"} appear here for its members.`:o?"Nothing in this category yet. Clear the filter to see the whole hub.":O?"No agent's name or description carries that. Clear it to see the whole hub.":"Nobody has published an agent yet. Yours could be the first."}),e.jsx("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:O?e.jsx(C,{variant:"secondary",onClick:Us,children:o?"Clear filter":"Clear search"}):z&&!$s?null:e.jsx(C,{ref:je,variant:"secondary",onClick:()=>s("/agents"),children:"Publish an agent"})})]}):le.map(r=>e.jsx(Ut,{agent:r,status:t?ze[r.id]:void 0,viewerStateKnown:t&&Nt(zs,ze,r.id),orgName:r.visibility==="org"?Fs.get(r.tenant_id)??null:null},r.id))}),!M&&B&&B.totalPages>1&&e.jsx(Fe,{count:B.totalPages,page:B.page,onChange:Bs})]}),h==="skills"&&(A?e.jsx(ta,{scope:g===Y?{visibility:"public",tenantId:null,organization:null}:{visibility:"org",tenantId:g,organization:v},signedIn:t,accessible:q&&(g===Y||ss(l))},`skills:${g}`):e.jsx("p",{className:"text-body-sm text-warning",children:u("ui.hub.skills.unavailable")})),h==="teams"&&(F?e.jsx(ha,{tenantId:F.tenant_id,orgName:v}):e.jsx(ja,{signedIn:t,onOpenSettings:()=>s("/settings")}))]})]})})]})]})};export{Ua as AgentHubPage};
|