@nextclaw/ui 0.26.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/.vite/manifest.json +1143 -1133
- package/dist/assets/{abnfDiagram-VRR7QNED-Bjrmb5-o.js → abnfDiagram-VRR7QNED-Dcw10Yt1.js} +1 -1
- package/dist/assets/{account-panel-C1S3xtUB.js → account-panel-ZM2qzKF4.js} +1 -1
- package/dist/assets/{aiden0z-pptx-renderer.es-DO4DCX3e.js → aiden0z-pptx-renderer.es--oNqetPA.js} +1 -1
- package/dist/assets/api-Cjq-o1VN.js +20 -0
- package/dist/assets/app-presenter-provider-C02YPoMr.js +124 -0
- package/dist/assets/{appearance-settings-page-BljTr6nB.js → appearance-settings-page-B4zouKzg.js} +1 -1
- package/dist/assets/{arc-g4XaP3S4.js → arc-DBRedCax.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-CvnC-LeA.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-CAP7YDux.js → architectureDiagram-ZJ3FMSHR-Dufhtuv-.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-DhaP0zUG.js → blockDiagram-677ZJIJ3-BUk0vtJ7.js} +1 -1
- package/dist/assets/{book-open-vxpV2eSM.js → book-open-AteA89HX.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-DHCQJJkD.js → c4Diagram-LMCZKHZV-CxDcVE9p.js} +1 -1
- package/dist/assets/{card-D9NYhSdf.js → card-BLXvBstA.js} +1 -1
- package/dist/assets/channel-CpMstUPF.js +1 -0
- package/dist/assets/{channels-list-page-BiHA1zZd.js → channels-list-page-fj8kMo-T.js} +1 -1
- package/dist/assets/chunk-2Q5K7J3B-Djp3VF0s.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-BcQlxl4v.js → chunk-32BRIVSS-DSF3KElA.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-ClPpG-2S.js → chunk-52WLFC77-Costxzr3.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-B_qmYOdX.js → chunk-5FCAYU7R-rhqzGGZo.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-DTO-V56q.js → chunk-5HE753X5-BsEsmIao.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-CU1SOaaG.js → chunk-5JV3BV7I-Dqw_DCoN.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-CzSDkWNa.js → chunk-5TONJI2A-Cft82fp8.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-ChkfqIRE.js → chunk-5VM5RSS4-DqNHn9Dl.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-Du3Ozi62.js → chunk-7BUUIJ7U-A5SBEMYY.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-C-HVafHB.js → chunk-BIQX33UG-1Ng3mTrH.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-BSjZ86D0.js → chunk-C7G6YPKG-DRJEy8ZI.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-1D1W2lF6.js → chunk-CQNSW5MT-Bydv_J3J.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-ISpyj_lK.js → chunk-CYSBUYHQ-HkMIg12u.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-Cp8iUBt2.js → chunk-EMLP6XTP-C5ndDvm3.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-BN5RzF5j.js → chunk-EX3LRPZG-DzeloZRo.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-DecJDW4r.js → chunk-FWX5IMBZ-n_2_CLTQ.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-BE_XNgGk.js → chunk-HOUHSVGY-kx_slvu3.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-BFOKMkWV.js → chunk-ICXQ74PX-sQLMURqL.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-DL-pl8VB.js → chunk-JG7HCLWE-CMUn5Elc.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-B-bcwfmh.js → chunk-JWPE2WC7-Cra3s-Uk.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-BC0taFro.js → chunk-MOJQB5TN-umcrg5Bi.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-RrhfU6MO.js → chunk-MOZMSUNE-BnljD1ig.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-TuI7SR7i.js → chunk-OGEWGWER-BXx5pQjU.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-C5jMBKlU.js → chunk-OSBZ3O6U-D-1qfdWu.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-C5lMBn0K.js → chunk-PUDLZKDR-DLzX78LC.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-B-kzUbwT.js → chunk-Q4XR5HBZ-DTK-rtW6.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-CRb_WAEj.js → chunk-QBLGF6JB-CsFeIGfr.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-De6Y7ozO.js → chunk-R7FJI6CG-4xNYUeng.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-Igv92q8k.js → chunk-RYQCIY6F-DJiHiTE5.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-bCjRshkT.js → chunk-U6XO7XAA-BVYkauHz.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-0J1s_Kgq.js → chunk-V7JOEXUC-BsazE8cS.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-BrbiIC1Q.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-DX6lXnNx.js → chunk-VR4S4FIN-7RoZQffO.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-DLqMXfFC.js → chunk-WYO6CB5R-DEuS6N1R.js} +1 -1
- package/dist/assets/chunk-XXDRQBXY-Cx9N40wF.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-CY4obsV0.js → chunk-YOTPTUD7-9KBrosZL.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-BleImZKe.js → chunk-ZGVPDNZ5-IYgN9f5A.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-C1TfdjpX.js → chunk-ZIRB5QZD-BUo0-zcp.js} +1 -1
- package/dist/assets/{circle-dashed-CEEssYIw.js → circle-dashed-LSYZTzM7.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DFN1v3PQ.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-DRvglADa.js +1 -0
- package/dist/assets/{client-C6YQx7A-.js → client-DudCRJw4.js} +1 -1
- package/dist/assets/{config-split-page-DKPelvjR.js → config-split-page-G7Kt2BnV.js} +1 -1
- package/dist/assets/confirm-dialog-DShT64F6.js +1 -0
- package/dist/assets/context-menu-rd7b_kVD.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-CVgUHXkj.js → cose-bilkent-JH36ORCC-DhqbC1fR.js} +1 -1
- package/dist/assets/{createLucideIcon-CF8U9dh7.js → createLucideIcon-D7hvIHV-.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-DXUGnpJH.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-cdfImbfI.js → cynefinDiagram-TSTJHNR4-C-TBRi5V.js} +1 -1
- package/dist/assets/{dagre-CHNN9L9I.js → dagre-CrgsRasE.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-PscaENwr.js → dagre-VKFMJZFB-BmafJymp.js} +1 -1
- package/dist/assets/{desktop-capabilities-page-BENHdKfk.js → desktop-capabilities-page-CzqzFZUY.js} +1 -1
- package/dist/assets/desktop-update-config-CgeQ0Ffo.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-CH_wye41.js → diagram-FQU43EPY-BoOMwa6D.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-Dtjpmi6D.js → diagram-G47NLZAW-Le7N6Uym.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-UdjLHyaz.js → diagram-NH7WQ7WH-Fbpj3-MO.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-DYsToEaL.js → diagram-OA4YK3LP-D3QuGGuu.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-CA7kuIer.js → diagram-WEI45ONY-Cxu1uiN6.js} +1 -1
- package/dist/assets/dialog-C7glmAQJ.js +5 -0
- package/dist/assets/{doc-browser-context-CPLWVFLd.js → doc-browser-context-BlhBAOLH.js} +1 -1
- package/dist/assets/doc-browser-dBiR9Qi0.js +1 -0
- package/dist/assets/{docx-preview-D--EsUWi.js → docx-preview-CkU2psnd.js} +1 -1
- package/dist/assets/download-BYgECE0n.js +1 -0
- package/dist/assets/{ebnfDiagram-CCIWWBDH-BrjaoOuq.js → ebnfDiagram-CCIWWBDH-CCAjuQM6.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-nZQa2kCM.js → erDiagram-Q63AITRT-BuzUAq-d.js} +1 -1
- package/dist/assets/es2015-CsjAAQ6X.js +41 -0
- package/dist/assets/eventmodeling-45OFAUF4-ZBfVS3ZC.js +1 -0
- package/dist/assets/{extensions-CsWT7x3v.js → extensions-qYL-NpL3.js} +1 -1
- package/dist/assets/{eye-DJtw5KJ5.js → eye-BBuTzJ53.js} +1 -1
- package/dist/assets/flowDiagram-23GEKE2U-CqdsKk6x.js +1 -0
- package/dist/assets/{form-actions-DDQk0END.js → form-actions-CLGWO52v.js} +1 -1
- package/dist/assets/{ganttDiagram-NO4QXBWP-CyFZHIHN.js → ganttDiagram-NO4QXBWP-cJmWVY8F.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-fHYFd9Es.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-Dfpq3z2M.js → gitGraphDiagram-IHSO6WYX-F58o-vtP.js} +1 -1
- package/dist/assets/{i18n-BjPkAKMQ.js → i18n-qBGEbcW6.js} +2 -2
- package/dist/assets/info-DKCQHKI2-CSaOL_bb.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-Diiz0k1E.js → infoDiagram-FWYZ7A6U-Gt59b83C.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-B3R3SN4M.js → ishikawaDiagram-FXEZZL3T-1u4IAj1I.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-DFOLKiNv.js → journeyDiagram-5HDEW3XC-CCQsfV-5.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-BMXpDp3g.js → kanban-definition-HUTT4EX6-vlB6O_Zn.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-settings-page-hqTP7akj.js → keyboard-shortcuts-settings-page-B-wK_6zG.js} +1 -1
- package/dist/assets/{line-64_FhCoJ.js → line-D_bHubTL.js} +1 -1
- package/dist/assets/{linear-aF1fg7bK.js → linear-ChlwuS5y.js} +1 -1
- package/dist/assets/loader-circle-BA7EMkih.js +1 -0
- package/dist/assets/{login-page-BUwshAq4.js → login-page-Cd84lpVV.js} +1 -1
- package/dist/assets/login-page-VdMyNkFf.js +1 -0
- package/dist/assets/main-CR0SrTBf.js +2 -0
- package/dist/assets/main-DXH6EdXI.css +1 -0
- package/dist/assets/main-i18n-catalog.config-Btp_OowF.js +1 -0
- package/dist/assets/{map-BC3Amra3.js → map-oGHTsIu8.js} +1 -1
- package/dist/assets/mcp-marketplace-page-jacRwiI-.js +1 -0
- package/dist/assets/{mermaid-parser.core-DdMcZwnE.js → mermaid-parser.core-CuRe1ZG4.js} +2 -2
- package/dist/assets/{mermaid.core-BHdiEBbI.js → mermaid.core-u4YCFKRf.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-CtHVaZyV.js → mindmap-definition-LN4V7U3C-DeJAQYTu.js} +1 -1
- package/dist/assets/{model-config-page-BSsHOhV7.js → model-config-page-D0DQlSDa.js} +1 -1
- package/dist/assets/{navigation-link-D-fxdv0i.js → navigation-link-32iM1-e6.js} +1 -1
- package/dist/assets/{ordinal-6b3jw4cz.js → ordinal-C6JFfkKN.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-D-YFTczs.js +1 -0
- package/dist/assets/panel-app-CC0bVSu4.js +1 -0
- package/dist/assets/panel-app-i18n-catalog.config-LUSBp5Ce.js +1 -0
- package/dist/assets/{panelStandalone-BeI0Ndsx.js → panelStandalone-C9EKaApN.js} +2 -2
- package/dist/assets/{pegDiagram-2B236MQR-BtbG3Bgu.js → pegDiagram-2B236MQR-nVMkxShH.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-VEnYu9s5.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-FmLl2hzN.js → pieDiagram-ENE6RG2P-8aUH44QZ.js} +1 -1
- package/dist/assets/{privacy-settings-page-pW_1naDz.js → privacy-settings-page-Bxxx12OO.js} +1 -1
- package/dist/assets/projects-D56yAPNT.js +1 -0
- package/dist/assets/provider-models-C3frdXeW.js +1 -0
- package/dist/assets/{provider-scoped-model-input-CVbtT8L9.js → provider-scoped-model-input-CYetrPYZ.js} +1 -1
- package/dist/assets/providers-config-page-DESB1h8g.js +1 -0
- package/dist/assets/{puzzle-kKiVft9-.js → puzzle-CWHfFyYN.js} +1 -1
- package/dist/assets/pwa-CiGUjpcd.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-7-OzMNpF.js → quadrantDiagram-ABIIQ3AL-EY8hpFv8.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-BFNIekC1.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-lVqJ3Hak.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-DYaefdFC.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-CTAk6lVq.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Cob294tg.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-B_UVtLJO.js → railroadDiagram-RFXS5EU6-CNhcIeji.js} +1 -1
- package/dist/assets/{refresh-cw-BeG0y6yZ.js → refresh-cw-y3L6PyLt.js} +1 -1
- package/dist/assets/remote-DiGFV8nP.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-D8TO2YeZ.js → requirementDiagram-TGXJPOKE-D8Dcs-Rt.js} +1 -1
- package/dist/assets/{rotate-cw-Ci2dcTO5.js → rotate-cw-CNE9qSHi.js} +1 -1
- package/dist/assets/{runtime-config-page-DCXN0nkS.js → runtime-config-page-5o98T-TD.js} +1 -1
- package/dist/assets/{sankeyDiagram-HTMAVEWB-CUzIcq0B.js → sankeyDiagram-HTMAVEWB-HTrb6aa-.js} +1 -1
- package/dist/assets/{save-Cr895abt.js → save-B0p5a0ET.js} +1 -1
- package/dist/assets/{search-config-page-CNQd481d.js → search-config-page-CpGcnIzi.js} +1 -1
- package/dist/assets/{secrets-config-page--q7M58L8.js → secrets-config-page-C4VTiW3r.js} +1 -1
- package/dist/assets/security-config-C5-RQVpS.js +1 -0
- package/dist/assets/select-CctTN205.js +1 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-kqJzXbwu.js → sequenceDiagram-DBY2YBRQ-6f_4X16Y.js} +1 -1
- package/dist/assets/service-apps-panel-CKE5HKNY.js +1 -0
- package/dist/assets/{settings-2-IodCcaXd.js → settings-2-EPflrNk6.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-D9ISogq1.js → sizeCapture-X5ZJPWSS-Ck9rsuwL.js} +1 -1
- package/dist/assets/{src-Bc0PoUJ1.js → src-C8AUg09O.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-CqH5xc9W.js → stateDiagram-2N3HPSRC-Cm33MLHu.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BrNv-raG.js +1 -0
- package/dist/assets/{status-dot-DUYSKRCU.js → status-dot-CensgJZC.js} +1 -1
- package/dist/assets/{swimlanes-5IMT3BWC-mwejV-rW.js → swimlanes-5IMT3BWC-B107vmvM.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-ntcxaPXp.js +8 -0
- package/dist/assets/{tag-chip-CQU51ST3.js → tag-chip-Bjzb4-qW.js} +1 -1
- package/dist/assets/{theme-provider-D-zZkXxS.js → theme-provider-hlle7Skk.js} +1 -1
- package/dist/assets/{timeline-definition-FHXFAJF6-CuikIDlX.js → timeline-definition-FHXFAJF6-CJEoAj33.js} +1 -1
- package/dist/assets/{trash-2-BDdqDh6E.js → trash-2-C5KH5Rw9.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-DbFmr-gw.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-C8aY96pi.js +1 -0
- package/dist/assets/{use-config-Bxx7DdaL.js → use-config-CPl_F79t.js} +1 -1
- package/dist/assets/use-desktop-capabilities-CEg9-DrQ.js +1 -0
- package/dist/assets/{use-viewport-layout-CDcca0YL.js → use-viewport-layout-CPZUmTPi.js} +1 -1
- package/dist/assets/{vennDiagram-L72KCM5P-BD0P0qHh.js → vennDiagram-L72KCM5P-DzsUHk5I.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-D8d6DbbJ.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-C6ma3t5D.js → wardleyDiagram-EHGQE667-1NfFs5ua.js} +1 -1
- package/dist/assets/x--xxUvHKW.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-D7E40NBk.js → xychartDiagram-FW5EYKEG-Ci8AI3Qo.js} +1 -1
- package/dist/index.html +37 -36
- package/dist/panel-standalone.html +11 -11
- package/package.json +8 -8
- package/src/app/components/layout/__tests__/app-layout.test.tsx +0 -1
- package/src/app/components/layout/__tests__/sidebar.layout.test.tsx +36 -16
- package/src/app/components/layout/sidebar-items.tsx +27 -18
- package/src/app/components/layout/sidebar-rail.styles.ts +11 -2
- package/src/app/components/layout/sidebar.tsx +3 -2
- package/src/app/configs/app-navigation.config.ts +39 -86
- package/src/features/agents/components/agent-details-dialog.tsx +3 -3
- package/src/features/agents/components/agents-page.tsx +5 -4
- package/src/features/chat/components/layout/__tests__/chat-page-shell.test.tsx +0 -2
- package/src/features/chat/components/layout/chat-page-shell.tsx +0 -2
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +0 -1
- package/src/features/chat/features/conversation/components/chat-voice-input-panel.tsx +3 -2
- package/src/features/chat/features/conversation/hooks/__tests__/use-chat-voice-input.test.tsx +4 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +32 -47
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +6 -10
- package/src/features/chat/features/message/utils/__tests__/chat-message-process-summary.utils.test.ts +52 -6
- package/src/features/chat/features/message/utils/chat-message-process-summary.utils.ts +22 -37
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-project-groups.test.tsx +1 -1
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +2 -1
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +4 -2
- package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +9 -6
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +2 -2
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +17 -17
- package/src/features/chat/features/session/components/session-header/chat-session-header-menu-item.tsx +4 -4
- package/src/features/chat/features/session/components/session-header/chat-session-more-actions-menu.tsx +13 -6
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +1 -1
- package/src/features/chat/managers/chat-voice-input.manager.ts +5 -3
- package/src/features/chat/utils/chat-voice-permissions.utils.test.ts +12 -1
- package/src/features/chat/utils/chat-voice-permissions.utils.ts +6 -1
- package/src/features/cron/components/cron-job-row.tsx +11 -9
- package/src/features/inbox/components/inbox-reader-dialog.tsx +4 -2
- package/src/features/inbox/pages/inbox-page.tsx +10 -5
- package/src/features/marketplace/components/mcp/mcp-marketplace-card.tsx +1 -1
- package/src/features/panel-apps/components/__tests__/panel-app-list-item.test.tsx +6 -4
- package/src/features/panel-apps/components/__tests__/panel-app-toolbar.test.tsx +6 -4
- package/src/features/panel-apps/components/panel-app-list-item.tsx +1 -1
- package/src/features/panel-apps/components/panel-app-toolbar.tsx +7 -7
- package/src/features/projects/components/project-skills.tsx +2 -2
- package/src/features/right-panel-resources/components/__tests__/page-resource-sidebar-nav.test.tsx +27 -2
- package/src/features/right-panel-resources/components/page-resource-actions-menu.tsx +4 -22
- package/src/features/right-panel-resources/components/page-resource-sidebar-nav.tsx +10 -13
- package/src/features/right-panel-resources/hooks/use-page-resource-actions.ts +56 -3
- package/src/features/right-panel-resources/index.ts +0 -1
- package/src/features/service-apps/components/service-app-list-item.tsx +3 -2
- package/src/features/system-status/components/__tests__/desktop-update-config.test.tsx +40 -0
- package/src/features/system-status/components/desktop-update-config.tsx +19 -1
- package/src/platforms/desktop/components/__tests__/desktop-app-shell.test.tsx +0 -1
- package/src/platforms/desktop/components/desktop-app-shell.tsx +0 -2
- package/src/platforms/mobile/components/mobile-app-shell.tsx +0 -2
- package/src/platforms/mobile/components/mobile-settings-shell.tsx +8 -3
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +83 -1
- package/src/shared/components/ui/context-menu/context-menu-items.tsx +173 -0
- package/src/shared/components/ui/context-menu/context-menu.tsx +93 -114
- package/src/shared/components/ui/dialog.tsx +4 -0
- package/src/shared/components/ui/overlays/sheet.tsx +4 -0
- package/src/shared/components/ui/popover.tsx +10 -4
- package/src/shared/lib/i18n/locales/en-US/chat.json +8 -1
- package/src/shared/lib/i18n/locales/en-US/core.json +3 -1
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +8 -1
- package/src/shared/lib/i18n/locales/zh-CN/core.json +11 -9
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +1 -0
- package/src/shared/lib/transport/__tests__/browser-realtime-recovery.service.test.ts +27 -2
- package/src/shared/lib/transport/__tests__/local-transport.service.test.ts +20 -0
- package/src/shared/lib/transport/__tests__/remote.transport.test.ts +26 -0
- package/src/shared/lib/transport/browser-realtime-recovery.service.ts +32 -5
- package/src/shared/lib/transport/local-transport.service.ts +1 -6
- package/src/shared/lib/transport/remote-transport.service.ts +22 -1
- package/dist/assets/api-D9e9cHtW.js +0 -20
- package/dist/assets/app-presenter-provider-J9IgTbc9.js +0 -124
- package/dist/assets/architecture-TIHT7OUA-BWywYH_m.js +0 -1
- package/dist/assets/channel-1nKIAEXr.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-CAwv72v4.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-DnaryNw2.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-BToo1uqb.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-D_TusZGx.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-B1NFZTmS.js +0 -1
- package/dist/assets/confirm-dialog-BCGeh61X.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-CJZSs5s_.js +0 -1
- package/dist/assets/desktop-update-config-BJMTQMRS.js +0 -1
- package/dist/assets/dialog-DQXou6pg.js +0 -5
- package/dist/assets/dist-CiC9Fd9J.js +0 -1
- package/dist/assets/doc-browser-CCYS_csH.js +0 -1
- package/dist/assets/es2015-DHRpDU-q.js +0 -41
- package/dist/assets/eventmodeling-45OFAUF4-rc7kUq4V.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-DAjaeGO8.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-Ce0gf6ps.js +0 -1
- package/dist/assets/info-DKCQHKI2-Cp-Tr78m.js +0 -1
- package/dist/assets/loader-circle-B-4WwzBj.js +0 -1
- package/dist/assets/login-page-CdlI6B8e.js +0 -1
- package/dist/assets/main-BVYdyT60.css +0 -1
- package/dist/assets/main-DYEALeoQ.js +0 -2
- package/dist/assets/main-i18n-catalog.config-1o2hjZ0m.js +0 -1
- package/dist/assets/mcp-marketplace-page-CRRQT6SP.js +0 -1
- package/dist/assets/packet-7NZHBO7P-BOJuCraS.js +0 -1
- package/dist/assets/panel-app-2EACRB8p.js +0 -1
- package/dist/assets/panel-app-i18n-catalog.config-kQO7QAwH.js +0 -1
- package/dist/assets/pie-RZYD4A2V-D-FEO81x.js +0 -1
- package/dist/assets/projects-k6SLda_A.js +0 -1
- package/dist/assets/provider-models-mVzuEQBS.js +0 -1
- package/dist/assets/providers-config-page-rBlVrHkb.js +0 -1
- package/dist/assets/pwa-BgGM4kkY.js +0 -1
- package/dist/assets/radar-I7S5WNFK-Bq3eK1vK.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-C3uZ1esg.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-D3iZd1KT.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-Dl0FWqZu.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-B51SbzGp.js +0 -1
- package/dist/assets/remote-wYWqir2w.js +0 -1
- package/dist/assets/security-config-CJb2pK2O.js +0 -1
- package/dist/assets/select-Bq-UmfCK.js +0 -1
- package/dist/assets/service-apps-panel-iLLEByRF.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-CcOGfDdx.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-BMI2k8RZ.js +0 -8
- package/dist/assets/treeView-QDETBFTQ-C0_07QI1.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-Djpx6ccG.js +0 -1
- package/dist/assets/use-desktop-capabilities-BTgdFgJy.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-DZVFxu81.js +0 -1
- package/dist/assets/x-LUUwl8rK.js +0 -1
- package/src/features/right-panel-resources/components/current-page-actions.tsx +0 -36
- /package/dist/assets/{array-B0sEvCP9.js → array-BV9OtnO8.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-BeO7fxDQ.js → chunk-KEIR6QF5-Cx-8EJ4_.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-JQfgEV36.js → chunk-Y2CYZVJY-Dy1ufvjf.js} +0 -0
- /package/dist/assets/{config-hints-D3OuwoEY.js → config-hints-DbmiyTKg.js} +0 -0
- /package/dist/assets/{cytoscape.esm-CzJ9uXgi.js → cytoscape.esm-CSCjuT4Z.js} +0 -0
- /package/dist/assets/{defaultLocale-USmzX3VG.js → defaultLocale-DWTiNsbT.js} +0 -0
- /package/dist/assets/{dist-BYF6XVna.js → dist-BVCSkfWY.js} +0 -0
- /package/dist/assets/{graphlib-DEFMkHdW.js → graphlib-B1yb1Wl8.js} +0 -0
- /package/dist/assets/{host-capabilities-C0MmWd3M.js → host-capabilities-DuIFVsvM.js} +0 -0
- /package/dist/assets/{init-04ErALoz.js → init-BF6GH5oe.js} +0 -0
- /package/dist/assets/{jszip.min-BnQ5NRy2.js → jszip.min-D12teKzP.js} +0 -0
- /package/dist/assets/{middleware-CAXxl-af.js → middleware-B--6mAUM.js} +0 -0
- /package/dist/assets/{navigation-history-CyawyVz0.js → navigation-history-CzErJuPG.js} +0 -0
- /package/dist/assets/{path-CzxQ9n2G.js → path-C56XkznJ.js} +0 -0
- /package/dist/assets/{rough.esm-pT9fdsW3.js → rough.esm-CGfeEbtE.js} +0 -0
- /package/dist/assets/{xlsx-BRpCSiE4.js → xlsx-sds5nUpL.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gn as t,Gt as n,Jn as r,Lt as i,Xn as a,Yn as o,Yt as s,cr as c,sr as l,yr as u}from"./api-Cjq-o1VN.js";import{f as d,n as f,p}from"./navigation-link-32iM1-e6.js";import{$ as m,Bt as h,Ft as g,H as _,Lt as v,Q as y,X as b,Y as ee,Z as x,et as te,f as ne,m as re,pt as S,tt as ie,yt as C}from"./app-presenter-provider-C02YPoMr.js";import{t as w}from"./createLucideIcon-D7hvIHV-.js";import{t as ae}from"./use-viewport-layout-CPZUmTPi.js";import{C as T,a as E,i as D,n as O,r as k,t as A,w as j}from"./select-CctTN205.js";import{f as oe}from"./context-menu-rd7b_kVD.js";import{t as se}from"./confirm-dialog-DShT64F6.js";import{t as M}from"./circle-dashed-LSYZTzM7.js";import{a as ce,i as le,n as ue,r as N}from"./tag-chip-Bjzb4-qW.js";import{n as P,t as F}from"./trash-2-C5KH5Rw9.js";import{t as de}from"./settings-2-EPflrNk6.js";import{n as I,r as fe,s as L,t as pe}from"./i18n-qBGEbcW6.js";import{a as me,i as he,n as ge,o as _e,r as ve,t as R}from"./dialog-C7glmAQJ.js";import{a as ye,i as be,n as xe,t as Se}from"./card-BLXvBstA.js";var Ce=w(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),we=w(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Te=w(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ee=w(`List`,[[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 18h.01`,key:`1tta3j`}],[`path`,{d:`M3 6h.01`,key:`1rqtza`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 18h13`,key:`1lx6n3`}],[`path`,{d:`M8 6h13`,key:`ik3vkj`}]]),De=w(`Unlink`,[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]),z=e(u(),1),B=c();function V({title:e,children:t,className:n=``}){return(0,B.jsxs)(Se,{hover:!1,surface:`flat`,className:n,children:[(0,B.jsx)(be,{className:`p-4 pb-3`,children:(0,B.jsx)(ye,{children:e})}),(0,B.jsx)(xe,{className:`p-4 pt-0`,children:t})]})}function H({children:e}){return(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:e})}function U({available:e,children:t,className:n,label:r,onOpen:i,path:a}){return e?(0,B.jsx)(`button`,{type:`button`,className:n,title:a,onClick:()=>i(a,r),children:t}):(0,B.jsx)(`div`,{className:n,children:t})}function Oe({agreement:e,isLoading:t,isError:n,onOpenFile:r}){return(0,B.jsxs)(V,{title:L(`projectsAgreementFile`),children:[(0,B.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:L(`projectsAgreementDescription`)}),t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):e?.available?(0,B.jsxs)(U,{available:!0,path:e.path,label:e.path,onOpen:r,className:`block w-full rounded-xl bg-muted/45 p-3 text-left transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium`,children:e.path}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:L(`projectsAgreementOpen`)})]}):(0,B.jsx)(H,{children:L(`projectsNoAgreement`)})]})}var W=e=>[`project-work`,e],G=e=>[`project-work-summary`,e],K=e=>[`project-work-states`,e],q=e=>[`project-work-artifacts`,e],J=(e,t)=>[`project-work-item`,e,t],Y=(e,t)=>[`project-work-activity`,e,t];function ke(e,t={}){return h({queryKey:[...W(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listWork(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ae(e){return a({queryKey:G(e??``),enabled:!!e,queryFn:async()=>await i.projects.getWorkSummary(e)})}function je(e){return a({queryKey:K(e??``),enabled:!!e,queryFn:async()=>await i.projects.listWorkStates(e)})}function Me(e,t={}){return h({queryKey:[...q(e??``),t],enabled:!!e,initialPageParam:null,queryFn:async({pageParam:n})=>await i.projects.listRecentWorkArtifacts(e,{...t,...n?{cursor:n}:{}}),getNextPageParam:e=>e.nextCursor})}function Ne(e,t){return a({queryKey:J(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.getWorkItem(e,t)})}function Pe(e,t){return a({queryKey:Y(e??``,t??``),enabled:!!(e&&t),queryFn:async()=>await i.projects.listWorkItemActivities(e,t,{limit:100})})}function X(e){let t=l(),n=async n=>{await Promise.all([t.invalidateQueries({queryKey:W(e)}),t.invalidateQueries({queryKey:G(e)}),t.invalidateQueries({queryKey:K(e)}),t.invalidateQueries({queryKey:q(e)}),...n?[t.invalidateQueries({queryKey:J(e,n)}),t.invalidateQueries({queryKey:Y(e,n)})]:[]])};return{createItem:o({mutationFn:async t=>await i.projects.createWorkItem(e,t),onSuccess:async e=>await n(e.id)}),updateItem:o({mutationFn:async t=>await i.projects.updateWorkItem(e,t.workItemId,t.patch),onSuccess:async e=>await n(e.id)}),deleteItem:o({mutationFn:async t=>await i.projects.deleteWorkItem(e,t),onSuccess:async e=>await n(e.id)}),restoreItem:o({mutationFn:async t=>await i.projects.restoreWorkItem(e,t),onSuccess:async e=>await n(e.id)}),linkArtifact:o({mutationFn:async t=>await i.projects.linkWorkItemArtifact(e,t.workItemId,{path:t.path,...t.label?{label:t.label}:{}}),onSuccess:async(e,t)=>await n(t.workItemId)}),unlinkArtifact:o({mutationFn:async t=>await i.projects.unlinkWorkItemArtifact(e,t.workItemId,t.artifactLinkId),onSuccess:async(e,t)=>await n(t.workItemId)}),createState:o({mutationFn:async t=>await i.projects.createWorkState(e,t),onSuccess:async()=>await n()}),updateState:o({mutationFn:async t=>await i.projects.updateWorkState(e,t.stateId,t.patch),onSuccess:async()=>await n()}),deleteState:o({mutationFn:async t=>await i.projects.deleteWorkState(e,t.stateId,t.migrateToStateId),onSuccess:async()=>await n()})}}function Z(e){let n=l();(0,z.useEffect)(()=>{if(e)return i.eventBus.on(t.projectWorkChanged,t=>{t.projectId===e&&(n.invalidateQueries({queryKey:W(e)}),n.invalidateQueries({queryKey:G(e)}),n.invalidateQueries({queryKey:K(e)}),n.invalidateQueries({queryKey:q(e)}),t.workItemId&&(n.invalidateQueries({queryKey:J(e,t.workItemId)}),n.invalidateQueries({queryKey:Y(e,t.workItemId)})))})},[e,n])}function Fe(e){return[...e].sort((e,t)=>e.position-t.position||e.name.localeCompare(t.name))}var Ie={started:0,unstarted:1,backlog:2,completed:3,canceled:4};function Le(e){return[...e].sort((e,t)=>{let n=Ie[e.category]-Ie[t.category];return n===0?e.category===`completed`||e.category===`canceled`?e.position-t.position||e.name.localeCompare(t.name):t.position-e.position||e.name.localeCompare(t.name):n})}function Q(e,t){return`${e}${e.endsWith(`/`)||e.endsWith(`\\`)?``:`/`}${t}`}function Re(e,t=new Date){if(!e)return`-`;let n=new Date(e),r=t.getTime()-n.getTime();if(Number.isNaN(n.getTime()))return e;if(r<6e4)return L(`projectsTimeJustNow`);let i=Math.floor(r/6e4);if(i<60)return L(`projectsTimeMinutesAgo`).replace(`{count}`,String(i));let a=Math.floor(i/60);if(a<24)return L(`projectsTimeHoursAgo`).replace(`{count}`,String(a));let o=Math.floor(a/24);return o===1?L(`projectsTimeYesterday`):o<7?L(`projectsTimeDaysAgo`).replace(`{count}`,String(o)):pe(e)}var ze=20;function Be({projectId:e,onOpenFile:t}){let[n,r]=(0,z.useState)(``),i=Me(e,{limit:ze,...n.trim()?{query:n.trim()}:{}}),a=i.data?.pages??[],o=a.flatMap(e=>e.artifacts),s=a[0]?.total??0;return i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsArtifacts`),children:[(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[fe(s),` `,L(`projectsArtifactsCountSuffix`)]}),(0,B.jsx)(`input`,{type:`search`,value:n,className:`h-8 w-full min-w-0 rounded-lg border border-border/60 bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground sm:w-60`,placeholder:L(`projectsArtifactsSearchPlaceholder`),onChange:e=>r(e.target.value)})]}),o.length?(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/60`,children:[(0,B.jsx)(`div`,{className:`divide-y divide-border/60`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`flex w-full min-w-0 items-center gap-3 px-3 py-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.path,` · `,e.workItemTitle]})]}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground`,dateTime:e.createdAt,title:I(e.createdAt),children:Re(e.createdAt)}),e.exists?null:(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-destructive`,children:L(`projectsUnavailable`)})]},e.id))}),i.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`w-full border-t border-border/60 px-3 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?L(`projectsLoading`):L(`projectsArtifactsShowMore`)}):null]}):(0,B.jsx)(H,{children:n.trim()?L(`projectsArtifactsNoMatches`):L(`projectsNoArtifacts`)})]})}var Ve={Backlog:`projectsWorkState_backlog`,Planned:`projectsWorkState_planned`,"In Progress":`projectsWorkState_inProgress`,"In Review":`projectsWorkState_inReview`,"Awaiting Acceptance":`projectsWorkState_awaitingAcceptance`,Completed:`projectsWorkState_completed`,Canceled:`projectsWorkState_canceled`};function $(e,t){let n=Ve[e];return n?t?L(n,t):L(n):e}function He({projectId:e,onOpenArtifact:t,onOpenWorkItem:n}){Z(e);let r=Ae(e),i=ke(e,{limit:5}),a=Me(e,{limit:5}),o=a.data?.pages[0]?.artifacts??[],s=i.data?.pages.flatMap(e=>e.items).slice(0,5)??[];return(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsx)(`section`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-label":L(`projectsWorkSummary`),children:r.data?[[`projectsWorkTotal`,r.data.total],[`projectsWorkActive`,r.data.active],[`projectsWorkNeedsAttention`,r.data.attention],[`projectsWorkCompleted`,r.data.completed]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card p-4`,children:[(0,B.jsx)(`div`,{className:`text-2xl font-semibold`,children:t}),(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:L(e)})]},e)):(0,B.jsx)(`div`,{className:`col-span-full rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:r.isError?L(`projectsLoadFailed`):L(`projectsLoading`)})}),(0,B.jsxs)(`div`,{className:`grid min-w-0 gap-4 lg:grid-cols-2`,children:[(0,B.jsx)(V,{title:L(`projectsWorkRecentlyUpdated`),children:i.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):i.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):s.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:s.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 rounded-xl bg-muted/45 px-3 py-3 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.id),children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.title}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:$(e.state.name)})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsWorkEmpty`)})}),(0,B.jsx)(V,{title:L(`projectsRecentArtifacts`),children:a.isLoading?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):a.isError?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):o.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>(0,B.jsxs)(U,{available:e.exists,path:e.path,label:e.label??e.path,onOpen:t,className:`block w-full rounded-xl bg-muted/45 p-3 text-left text-sm transition-colors enabled:hover:bg-[var(--interaction-hover)] enabled:focus-visible:outline-none enabled:focus-visible:ring-1 enabled:focus-visible:ring-border`,children:[(0,B.jsx)(`span`,{className:`block truncate font-medium`,children:e.label??e.path}),(0,B.jsxs)(`span`,{className:`mt-1 block truncate text-xs text-muted-foreground`,children:[e.workItemTitle,(0,B.jsx)(`time`,{dateTime:e.createdAt,title:I(e.createdAt),children:` · ${Re(e.createdAt)}`}),e.exists?``:` · ${L(`projectsUnavailable`)}`]})]},e.id))}):(0,B.jsx)(H,{children:L(`projectsNoRecentArtifacts`)})})]})]})}function Ue({skills:e,isLoading:t,isError:n,onOpen:r}){return t?(0,B.jsx)(`p`,{className:`py-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):n?(0,B.jsx)(`p`,{className:`py-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(`section`,{className:`min-w-0`,"aria-label":L(`projectsSkills`),children:[(0,B.jsxs)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:[fe(e.length),` `,L(`projectsSkillsCountSuffix`)]}),e.length?(0,B.jsx)(`div`,{className:`grid min-w-0 gap-3 md:grid-cols-2`,children:e.map(e=>(0,B.jsxs)(`div`,{className:`relative group/page-row rounded-xl border border-border/60 transition-colors hover:border-border hover:bg-[var(--interaction-hover)] focus-within:bg-[var(--interaction-hover)] has-[[data-context-menu-open]]:bg-[var(--interaction-hover)]`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`w-full min-w-0 rounded-xl p-3 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>r(e),children:[(0,B.jsx)(`h3`,{className:`pr-7 text-sm font-medium`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,title:e.path,children:e.path}),(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs text-muted-foreground`,title:e.description??e.ref,children:e.description??e.ref})]}),(0,B.jsx)(`span`,{className:`absolute right-2 top-2`,children:(0,B.jsx)(ne,{revealOnHover:!0,page:re(`skill`,e.ref,e.name)})})]},e.ref))}):(0,B.jsx)(H,{children:L(`projectsNoSkills`)})]})}function We({onOpenArtifact:e,onOpenChange:t,projectId:n,projectRoot:r,workItemId:i}){let a=Ne(n,i),o=Pe(n,i);Z(n);let s=je(n);return(0,B.jsx)(b,{open:!!i,onOpenChange:t,children:(0,B.jsxs)(x,{side:`right`,closeLabel:L(`projectsCloseDetails`),className:`flex h-full w-full flex-col overflow-hidden p-0 sm:max-w-[680px]`,children:[a.isLoading?(0,B.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)}):null,a.isError?(0,B.jsx)(`div`,{className:`p-6 text-sm text-destructive`,children:L(`projectsWorkItemLoadFailed`)}):null,a.data?(0,B.jsx)(Ge,{item:a.data,states:s.data??[],activities:o.data?.activities??[],onOpenArtifact:(t,n)=>e(Q(r,t),n),onClose:()=>t(!1)},`${a.data.id}:${a.data.version}`):null]})})}function Ge({activities:e,item:t,onClose:i,onOpenArtifact:a,states:o}){let c=X(t.projectId),[l,u]=(0,z.useState)(t.title),[d,p]=(0,z.useState)(t.description),[h,_]=(0,z.useState)(t.stateId),[v,b]=(0,z.useState)(t.attention),[x,S]=(0,z.useState)(``),[C,w]=(0,z.useState)(``),[ae,T]=(0,z.useState)(!1),j=async(e,t)=>{try{await e(),t?.()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},oe=async()=>{try{await c.updateItem.mutateAsync({workItemId:t.id,patch:{title:l,description:d,stateId:h,attention:v,expectedVersion:t.version}}),r.success(L(`projectsWorkItemSaved`))}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemSaveFailed`))}},M=async()=>{if(x.trim())try{await c.linkArtifact.mutateAsync({workItemId:t.id,path:x.trim(),...C.trim()?{label:C.trim()}:{}}),S(``),w(``)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkArtifactLinkFailed`))}};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(te,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(ie,{children:L(`projectsWorkDetails`)}),(0,B.jsx)(ne,{page:re(`project-work`,JSON.stringify([t.projectId,t.id]),t.title)})]}),(0,B.jsxs)(y,{children:[t.id,` · `,L(`projectsWorkVersion`),` `,t.version]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,B.jsxs)(`section`,{className:`space-y-3`,children:[(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkTitle`)}),(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value)}),(0,B.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkDescription`)}),(0,B.jsx)(ee,{className:`min-h-28`,value:d,onChange:e=>p(e.target.value)}),(0,B.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsStatus`)}),(0,B.jsxs)(A,{value:h,onValueChange:_,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:o.map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:L(`projectsWorkAttention`)}),(0,B.jsxs)(A,{value:v,onValueChange:e=>b(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsxs)(O,{children:[(0,B.jsx)(k,{value:`none`,children:L(`projectsWorkAttention_none`)}),(0,B.jsx)(k,{value:`blocked`,children:L(`projectsWorkAttention_blocked`)}),(0,B.jsx)(k,{value:`awaiting-user`,children:L(`projectsWorkAttention_awaiting-user`)})]})]})]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsWorkArtifacts`)}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[t.artifacts.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border border-border/60 p-2`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-lg px-2 py-1 text-left hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a(e.path,e.label??e.path),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 truncate text-sm font-medium`,children:[(0,B.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),e.label??e.path]}),(0,B.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.path})]}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsWorkUnlinkArtifact`),onClick:()=>void j(()=>c.unlinkArtifact.mutateAsync({workItemId:t.id,artifactLinkId:e.id})),children:(0,B.jsx)(De,{className:`h-4 w-4`})})]},e.id)),t.artifacts.length?null:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:L(`projectsWorkNoArtifacts`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-[1fr_12rem_auto]`,children:[(0,B.jsx)(n,{value:x,onChange:e=>S(e.target.value),placeholder:L(`projectsWorkArtifactPath`)}),(0,B.jsx)(n,{value:C,onChange:e=>w(e.target.value),placeholder:L(`projectsWorkArtifactLabel`)}),(0,B.jsxs)(s,{variant:`outline`,onClick:()=>void M(),disabled:!x.trim()||c.linkArtifact.isPending,children:[(0,B.jsx)(g,{className:`mr-2 h-4 w-4`}),L(`projectsWorkLinkArtifact`)]})]})]}),(0,B.jsxs)(`section`,{children:[(0,B.jsx)(`h3`,{className:`mb-3 text-sm font-semibold`,children:L(`projectsActivity`)}),(0,B.jsx)(`ol`,{className:`space-y-2`,children:e.map(e=>(0,B.jsxs)(`li`,{className:`rounded-xl bg-muted/35 px-3 py-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium`,children:L(`projectsWorkActivity_${e.type}`)}),(0,B.jsxs)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:[e.actor.kind,` ·`,` `,new Date(e.createdAt).toLocaleString()]})]},e.id))})]})]}),(0,B.jsxs)(m,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[t.deletedAt?(0,B.jsx)(s,{variant:`outline`,onClick:()=>void j(()=>c.restoreItem.mutateAsync(t.id)),children:L(`projectsRestore`)}):(0,B.jsxs)(s,{variant:`destructive`,onClick:()=>T(!0),children:[(0,B.jsx)(F,{className:`mr-2 h-4 w-4`}),L(`projectsDelete`)]}),(0,B.jsx)(s,{onClick:()=>void oe(),disabled:!l.trim()||c.updateItem.isPending,children:L(`save`)})]}),(0,B.jsx)(se,{open:ae,onOpenChange:T,title:L(`projectsDeleteWorkItem`),description:L(`projectsDeleteWorkItemDescription`),confirmLabel:L(`projectsDelete`),variant:`destructive`,onCancel:()=>T(!1),onConfirm:()=>void j(()=>c.deleteItem.mutateAsync(t.id),i)})]})}var Ke=[`backlog`,`unstarted`,`started`,`completed`,`canceled`];function qe({open:e,onOpenChange:t,projectId:i,states:a}){let o=X(i),c=Fe(a),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(`unstarted`),[p,m]=(0,z.useState)(null),[h,g]=(0,z.useState)(``),_=async e=>{try{await e()}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkActionFailed`))}},v=async()=>{l.trim()&&await _(async()=>{await o.createState.mutateAsync({name:l.trim(),category:d}),u(``)})},y=async(e,t)=>{let n=c[e],r=c[e+t];!n||!r||await _(async()=>{await o.updateState.mutateAsync({stateId:n.id,patch:{position:r.position}}),await o.updateState.mutateAsync({stateId:r.id,patch:{position:n.position}})})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(R,{open:e,onOpenChange:t,children:(0,B.jsxs)(ge,{className:`max-h-[85vh] overflow-y-auto sm:max-w-2xl`,children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsWorkStateSettings`)}),(0,B.jsx)(ve,{children:L(`projectsWorkStateSettingsDescription`)})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid gap-2 rounded-xl border border-border/60 p-3 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{"aria-label":L(`projectsWorkStateName`),defaultValue:$(e.name),onBlur:t=>{let n=t.currentTarget.value.trim();n&&n!==$(e.name)&&_(()=>o.updateState.mutateAsync({stateId:e.id,patch:{name:n}}))}}),(0,B.jsxs)(A,{value:e.category,onValueChange:t=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{category:t}})),children:[(0,B.jsx)(D,{"aria-label":L(`projectsWorkStateCategory`),children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveUp`),disabled:t===0,onClick:()=>void y(t,-1),children:(0,B.jsx)(T,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsMoveDown`),disabled:t===c.length-1,onClick:()=>void y(t,1),children:(0,B.jsx)(j,{className:`h-4 w-4`})}),(0,B.jsx)(s,{size:`icon`,variant:`ghost`,"aria-label":L(`projectsDeleteState`),disabled:c.length<=1,onClick:()=>{m(e),g(``)},children:(0,B.jsx)(F,{className:`h-4 w-4`})})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-muted-foreground sm:col-span-3`,children:[(0,B.jsx)(`input`,{type:`radio`,name:`default-state`,checked:e.isDefault,onChange:()=>void _(()=>o.updateState.mutateAsync({stateId:e.id,patch:{isDefault:!0}}))}),L(`projectsWorkDefaultState`)]})]},e.id))}),(0,B.jsxs)(`div`,{className:`grid gap-2 border-t border-border/60 pt-4 sm:grid-cols-[1fr_11rem_auto]`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),placeholder:L(`projectsWorkNewState`)}),(0,B.jsxs)(A,{value:d,onValueChange:e=>f(e),children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{})}),(0,B.jsx)(O,{children:Ke.map(e=>(0,B.jsx)(k,{value:e,children:L(`projectsWorkCategory_${e}`)},e))})]}),(0,B.jsxs)(s,{onClick:()=>void v(),disabled:!l.trim()||o.createState.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsAdd`)]})]})]})}),(0,B.jsx)(R,{open:!!p,onOpenChange:e=>{e||m(null)},children:(0,B.jsxs)(ge,{children:[(0,B.jsxs)(me,{children:[(0,B.jsx)(_e,{children:L(`projectsDeleteState`)}),(0,B.jsx)(ve,{children:L(`projectsDeleteStateDescription`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:L(`projectsWorkStateMigration`)}),(0,B.jsxs)(A,{value:h,onValueChange:g,children:[(0,B.jsx)(D,{children:(0,B.jsx)(E,{placeholder:L(`projectsWorkStateMigrationOptional`)})}),(0,B.jsx)(O,{children:c.filter(e=>e.id!==p?.id).map(e=>(0,B.jsx)(k,{value:e.id,children:$(e.name)},e.id))})]})]}),(0,B.jsxs)(he,{children:[(0,B.jsx)(s,{variant:`outline`,onClick:()=>m(null),children:L(`cancel`)}),(0,B.jsx)(s,{variant:`destructive`,onClick:()=>{p&&_(async()=>{await o.deleteState.mutateAsync({stateId:p.id,migrateToStateId:h||null}),m(null)})},children:L(`projectsDelete`)})]})]})})]})}function Je({startedProgress:e,state:t}){if(t.category===`backlog`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`backlog`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(M,{className:`h-4 w-4`})});if(t.category===`unstarted`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`unstarted`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,B.jsx)(we,{className:`h-4 w-4`,strokeWidth:2})});if(t.category===`completed`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`completed`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-emerald-600 dark:text-emerald-400`,children:(0,B.jsx)(v,{className:`h-4 w-4`,strokeWidth:2.25})});if(t.category===`canceled`)return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`canceled`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/65`,children:(0,B.jsx)(Ce,{className:`h-4 w-4`})});let n=Math.round((e??.5)*100),r=n>=67?`text-emerald-600 dark:text-emerald-400`:n>=40?`text-orange-500 dark:text-orange-400`:`text-amber-500 dark:text-amber-400`;return(0,B.jsx)(`span`,{"aria-hidden":`true`,"data-state-visual":`started`,className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${r}`,children:(0,B.jsxs)(`svg`,{className:`h-4 w-4`,viewBox:`0 0 16 16`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,stroke:`currentColor`,strokeWidth:`1.75`,opacity:`0.22`}),(0,B.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.5`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${n} ${100-n}`,transform:`rotate(-90 8 8)`})]})})}function Ye({item:e,onOpen:t}){return(0,B.jsxs)(`button`,{type:`button`,className:`w-full rounded-xl border border-border/50 bg-card p-3 text-left text-sm shadow-sm transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:t,children:[(0,B.jsx)(`span`,{className:`block font-medium`,children:e.title}),(0,B.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:$(e.state.name)}),e.attention===`none`?null:(0,B.jsx)(`span`,{className:`rounded-full bg-amber-500/15 px-2 py-0.5 text-amber-700 dark:text-amber-300`,children:L(`projectsWorkAttention_${e.attention}`)}),e.deletedAt?(0,B.jsx)(`span`,{children:L(`projectsDeleted`)}):null]})]})}function Xe({hasNextPage:e,isError:t,isFetchingNextPage:n,isLoading:r,items:i,onLoadMore:a,onOpenWorkItem:o}){return r?(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsLoading`)}):t?(0,B.jsx)(`p`,{className:`py-3 text-xs text-destructive`,children:L(`projectsLoadFailed`)}):(0,B.jsxs)(B.Fragment,{children:[i.length?i.map(e=>(0,B.jsx)(Ye,{item:e,onOpen:()=>o(e.id)},e.id)):(0,B.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:L(`projectsNoData`)}),e?(0,B.jsx)(s,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,disabled:n,onClick:a,children:L(n?`projectsLoading`:`projectsWorkLoadMore`)}):null]})}function Ze({includeDeleted:e,onOpenWorkItem:t,state:n,startedProgress:r,view:i}){let[a,o]=(0,z.useState)(!1),s=ke(n.projectId,{stateId:n.id,includeDeleted:e,limit:20}),c=s.data?.pages.flatMap(e=>e.items)??[],l=s.data?.pages[0]?.total;return(0,B.jsxs)(`section`,{className:i===`board`?`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`:`min-w-0`,"aria-label":$(n.name),children:[(0,B.jsxs)(`button`,{type:`button`,className:`flex w-full shrink-0 items-center gap-2 rounded-lg px-1 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[a?(0,B.jsx)(oe,{className:`h-4 w-4 shrink-0`}):(0,B.jsx)(j,{className:`h-4 w-4 shrink-0`}),(0,B.jsx)(Je,{state:n,startedProgress:r}),(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,children:$(n.name)}),(0,B.jsx)(`span`,{className:`ml-0.5 shrink-0 text-xs font-medium tabular-nums text-muted-foreground`,children:l??`…`})]}),a?null:(0,B.jsx)(`div`,{className:i===`board`?`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain px-1 pb-3`:`space-y-2 px-1 pb-3`,children:(0,B.jsx)(Xe,{hasNextPage:s.hasNextPage,isError:s.isError,isFetchingNextPage:s.isFetchingNextPage,isLoading:s.isLoading,items:c,onLoadMore:()=>void s.fetchNextPage(),onOpenWorkItem:t})})]})}function Qe({onOpenWorkItem:e,projectId:t}){let[i,a]=(0,z.useState)(`list`),[o,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1);Z(t);let p=je(t),m=X(t),h=async()=>{if(l.trim())try{let t=await m.createItem.mutateAsync({title:l.trim()});u(``),e(t.id)}catch(e){r.error(e instanceof Error?e.message:L(`projectsWorkItemCreateFailed`))}};if(p.isLoading)return(0,B.jsx)(`div`,{className:`rounded-xl border border-border/60 p-5 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(p.isError)return(0,B.jsx)(`div`,{className:`rounded-xl border border-destructive/40 p-5 text-sm text-destructive`,children:L(`projectsLoadFailed`)});let g=Fe(p.data??[]),_=Le(p.data??[]),v=g.filter(e=>e.category===`started`),y=new Map(v.map((e,t)=>[e.id,(t+1)/(v.length+1)]));return(0,B.jsxs)(`section`,{"aria-label":L(`projectsWork`),className:`min-w-0 space-y-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-[16rem] flex-1 gap-2`,children:[(0,B.jsx)(n,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},placeholder:L(`projectsWorkNewItem`)}),(0,B.jsxs)(s,{onClick:()=>void h(),disabled:!l.trim()||m.createItem.isPending,children:[(0,B.jsx)(P,{className:`mr-2 h-4 w-4`}),L(`projectsCreate`)]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1 rounded-xl bg-muted/40 p-1`,role:`group`,"aria-label":L(`projectsWorkViews`),children:[(0,B.jsxs)(s,{size:`sm`,variant:i===`list`?`secondary`:`ghost`,"aria-pressed":i===`list`,onClick:()=>a(`list`),children:[(0,B.jsx)(Ee,{className:`mr-2 h-4 w-4`}),L(`projectsWorkList`)]}),(0,B.jsxs)(s,{size:`sm`,variant:i===`board`?`secondary`:`ghost`,"aria-pressed":i===`board`,onClick:()=>a(`board`),children:[(0,B.jsx)(Te,{className:`mr-2 h-4 w-4`}),L(`projectsWorkBoard`)]})]}),(0,B.jsxs)(s,{variant:`outline`,size:`sm`,onClick:()=>f(!0),children:[(0,B.jsx)(de,{className:`mr-2 h-4 w-4`}),L(`projectsWorkStateSettings`)]})]}),(0,B.jsxs)(`label`,{className:`flex w-fit items-center gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>c(e.target.checked)}),L(`projectsWorkShowDeleted`)]}),i===`list`?(0,B.jsx)(`div`,{className:`space-y-3`,children:_.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,i===`board`?(0,B.jsx)(`div`,{className:`grid h-[calc(100dvh-17rem)] min-h-[28rem] max-h-[52rem] min-w-0 auto-cols-[minmax(18rem,1fr)] grid-flow-col items-stretch gap-3 overflow-x-auto overflow-y-hidden pb-2`,children:g.map(t=>(0,B.jsx)(Ze,{state:t,startedProgress:y.get(t.id)??null,view:i,includeDeleted:o,onOpenWorkItem:e},t.id))}):null,(0,B.jsx)(qe,{open:d,onOpenChange:f,projectId:t,states:g})]})}var $e=e=>[`project-agreement`,e],et=e=>[`project-skills`,e];function tt(e){return a({queryKey:$e(e??``),enabled:!!e,queryFn:async()=>await i.projects.getAgreement(e)})}function nt(e){return a({queryKey:et(e??``),enabled:!!e,queryFn:async()=>await i.projects.listProjectSkills(e)})}function rt(e){return e===`overview`||e===`work`||e===`artifacts`||e===`skills`||e===`agreement`}var it=[`overview`,`work`,`artifacts`,`skills`,`agreement`];function at(){let{projectId:e,tab:t}=p(),n=d(),r=C(),{isMobile:i}=ae(),a=S(),[o,s]=(0,z.useState)(null),c=a.data?.projects??[],l=c.find(t=>t.id===e)??null,u=rt(t)?t:null,f=tt(u===`agreement`?l?.id??null:null),m=nt(u===`skills`?l?.id??null:null);if(a.isLoading)return(0,B.jsx)(`main`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:L(`projectsLoading`)});if(a.isError)return(0,B.jsxs)(`main`,{className:`p-6 text-sm text-destructive`,children:[L(`projectsLoadFailed`),`: `,a.error.message]});if(!c.length)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsEmpty`)});if(!l||!u)return(0,B.jsx)(`main`,{className:`p-6 text-sm text-muted-foreground`,children:L(`projectsChoose`)});let h=(e,t)=>r.chatThreadManager.openFilePreview({path:e,label:t,viewMode:`preview`,previewViewer:`rendered`});return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`main`,{className:`h-full min-w-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-6xl space-y-4`,children:[(0,B.jsxs)(`header`,{className:`rounded-2xl border border-border/60 bg-card p-3 sm:p-4`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:l.name}),(0,B.jsx)(`p`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:l.rootPath})]}),(0,B.jsxs)(ue,{value:u,onValueChange:e=>n(`/projects/${encodeURIComponent(l.id)}/${e}`),children:[(0,B.jsx)(`div`,{className:`min-w-0 overflow-x-auto pb-1`,children:(0,B.jsx)(le,{className:`w-max`,children:it.map(e=>(0,B.jsx)(ce,{value:e,children:L(`projects${e[0].toUpperCase()}${e.slice(1)}`)},e))})}),(0,B.jsx)(N,{value:`overview`,className:`mt-4`,children:(0,B.jsx)(He,{projectId:l.id,onOpenArtifact:(e,t)=>h(Q(l.rootPath,e),t),onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`work`,className:`mt-4`,children:(0,B.jsx)(Qe,{projectId:l.id,onOpenWorkItem:s})}),(0,B.jsx)(N,{value:`artifacts`,className:`mt-4`,children:(0,B.jsx)(Be,{projectId:l.id,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})}),(0,B.jsx)(N,{value:`skills`,className:`mt-4`,children:(0,B.jsx)(Ue,{skills:m.data??[],isLoading:m.isLoading,isError:m.isError,onOpen:e=>h(Q(l.rootPath,e.path),e.name)})}),(0,B.jsx)(N,{value:`agreement`,className:`mt-4`,children:(0,B.jsx)(Oe,{agreement:f.data,isLoading:f.isLoading,isError:f.isError,onOpenFile:(e,t)=>h(Q(l.rootPath,e),t)})})]})]})}),(0,B.jsx)(We,{projectId:l.id,projectRoot:l.rootPath,workItemId:o,onOpenChange:e=>{e||s(null)},onOpenArtifact:h}),(0,B.jsx)(_,{layoutMode:i?`mobile`:`desktop`,sessionKey:null,projectRoot:l.rootPath})]})}export{at as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{_n as t,cr as n,yr as r}from"./api-Cjq-o1VN.js";import{c as i,l as a,o,r as s,s as c,u as l}from"./context-menu-rd7b_kVD.js";var u=e(r(),1),d=n(),f=`2rem`;function p(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${f})))`}var m=p(`24rem`),h=a,g=l,_=o,v=u.forwardRef(({className:e,variant:n=`default`,sideOffset:r=8,align:a=`start`,collisionPadding:o=12,style:l,...u},f)=>(0,d.jsx)(i,{children:(0,d.jsx)(c,{ref:f,"data-theme-overlay":n===`menu`?`menu`:`popover`,sideOffset:r,align:a,collisionPadding:o,className:t(`z-[var(--z-popover,10100)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e,n===`menu`&&`w-max min-w-52 max-w-[min(18rem,calc(100vw-16px))] overflow-y-auto rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-[0_18px_48px_-20px_rgba(15,23,42,0.42)] outline-none`),style:{maxHeight:m,...l},...u,onEscapeKeyDown:e=>{s(e)||u.onEscapeKeyDown?.(e)}})}));v.displayName=c.displayName;var y=[`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`],b=new Set(y);function x(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function S(e,t){let n=e.trim(),r=t.trim();if(!n||!r)return n;let i=`${r}/`;return n.startsWith(i)?n.slice(i.length):n}function C(e,t){let n=e.trim();if(!n)return``;for(let e of t)n=S(n,e);return n.trim()}function w(e,t){let n=t.trim(),r=e.trim();return n?r?`${r}/${n}`:n:``}function T(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return t&&b.has(t)?t:null}function E(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=T(n);!e||t.includes(e)||t.push(e)}return t}function D(e){return e.includes(`off`)?[...e]:[`off`,...e]}function O(e,t){if(!e)return{};let n={};for(let[r,i]of Object.entries(e)){let e=C(r,t);if(!e)continue;let a={},o=E(i?.thinking?.supported);if(o.length>0){let e=T(i?.thinking?.default);a.thinking=e&&o.includes(e)?{supported:o,default:e}:{supported:o}}i?.vision===!0&&(a.vision=!0),(a.thinking||a.vision===!0)&&(n[e]=a)}return n}function k(e){return Object.fromEntries(Object.entries(e).filter(e=>!!e[1].thinking).map(([e,t])=>[e,t.thinking]))}function A(e,t,n){let r=C(t,n);return r?e[r]??null:null}function j(e,t){let n=e.trim();if(!n)return null;let r=null;for(let e of t)for(let t of e.aliases){let i=t.trim();i&&(n===i||n.startsWith(`${i}/`))&&(!r||i.length>r.score)&&(r={name:e.name,score:i.length})}if(r)return r.name;for(let e of t){let t=C(n,e.aliases);if(t&&x(e.models??[]).some(e=>e===t))return e.name}return null}function M(e){return e?e.enabled!==!1&&(e.apiKeyRequired===!1||e.apiKeySet===!0):!1}function N(e){let{providersView:t,templatesView:n,config:r,onlyConfigured:i=!1}=e,a=new Map((n?.providerTemplates??[]).map(e=>[e.providerType,e])),o=Object.values(t?.providers??r?.providers??{}).map(e=>{let{providerId:t}=e,n=e.providerType?a.get(e.providerType):void 0,r=t.trim(),i=x([t,n?.modelPrefix||``,n?.providerType||``]),o=x((e?.models??[]).map(e=>C(e,i))),s={...O(n?.modelConfig,i),...O(e?.modelConfig,i)},c=k(s),l=e?.displayName?.trim(),u=M(e);return{name:t,displayName:l||n?.displayName||t,prefix:r,aliases:i,models:o,modelConfig:s,modelThinking:c,configured:u}});return i?o.filter(e=>e.configured&&e.models.length>0):o}export{p as _,M as a,E as c,D as d,C as f,g,v as h,j as i,T as l,_ as m,N as n,O as o,h as p,w as r,x as s,y as t,A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,_n as n,cr as r,yr as i}from"./api-
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,_n as n,cr as r,yr as i}from"./api-Cjq-o1VN.js";import{t as a}from"./createLucideIcon-D7hvIHV-.js";import{T as o,a as s,i as c,n as l,r as u,t as d}from"./select-CctTN205.js";import{s as f}from"./i18n-qBGEbcW6.js";import{_ as p,f as m,h,i as g,m as _,p as v,r as y}from"./provider-models-C3frdXeW.js";var b=a(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),x=e(i(),1),S=r(),C=p(`15rem`);function w(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function T({id:e,value:r,onChange:i,options:a,disabled:s=!1,placeholder:c,className:l,inputClassName:u,emptyText:d,createText:f,toggleLabel:p,maxItems:m=1/0,onEnter:g}){let[y,T]=(0,x.useState)(!1),E=(0,x.useRef)(null);(0,x.useEffect)(()=>{s&&y&&T(!1)},[s,y]);let D=(0,x.useMemo)(()=>w(a),[a]),O=r.trim().toLowerCase(),k=(0,x.useMemo)(()=>{let e=D.map((e,t)=>({option:e,index:t}));O.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===O?0:n.startsWith(O)?1:n.includes(O)?2:3,a=r===O?0:r.startsWith(O)?1:r.includes(O)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(m)?t.slice(0,Math.max(1,m)):t},[D,O,m]),A=r.trim().length>0&&D.some(e=>e===r.trim()),j=()=>T(!1);return(0,S.jsxs)(v,{open:y&&!s,onOpenChange:e=>T(!s&&e),children:[(0,S.jsx)(_,{asChild:!0,children:(0,S.jsxs)(`div`,{ref:E,className:n(`relative`,l),children:[(0,S.jsx)(t,{id:e,value:r,disabled:s,onFocus:()=>{s||T(!0)},onChange:e=>{i(e.target.value),!y&&!s&&T(!0)},onKeyDown:e=>{e.key===`Enter`&&(g&&(e.preventDefault(),g()),j())},placeholder:c,className:n(`pr-10`,u)}),(0,S.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>T(e=>!e),disabled:s,className:n(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,s?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":p,children:(0,S.jsx)(b,{className:`h-4 w-4`})})]})}),(0,S.jsx)(h,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&E.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:C},children:(0,S.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!A&&r.trim().length>0&&(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{i(r.trim()),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(o,{className:`h-4 w-4 text-transparent`}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:f.replace(`{value}`,r.trim())})]}),k.map(e=>(0,S.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{i(e),j()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,S.jsx)(o,{className:n(`h-4 w-4`,e===r.trim()?`text-primary`:`text-transparent`)}),(0,S.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),k.length===0&&r.trim().length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:d})]})})]})}var E=`provider/model`;function D(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function O({id:e,value:n,onChange:r,providerCatalog:i,disabled:a=!1,providerPlaceholder:o,modelPlaceholder:p,className:h}){let[_,v]=(0,x.useState)(``),[b,C]=(0,x.useState)(``),w=i.length>0,O=p??E,k=(0,x.useMemo)(()=>new Map(i.map(e=>[e.name,e])),[i]),A=k.get(_),j=(0,x.useMemo)(()=>A?.aliases??[],[A]),M=(0,x.useMemo)(()=>D(A?.models??[]),[A]);return(0,x.useEffect)(()=>{let e=n.trim();if(!w){v(``),C(e);return}if(!e){C(``),v(e=>k.has(e)?e:``);return}let t=g(e,i)??``,r=k.get(t)?.aliases??[];v(t),C(t?m(e,r):e)},[w,i,k,n]),w?(0,S.jsxs)(`div`,{className:h,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,S.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,S.jsxs)(d,{value:_,onValueChange:e=>{let t=D(k.get(e)?.models??[])[0]??``;if(v(e),C(t),!t){r(``);return}r(y(k.get(e)?.prefix??e,t))},disabled:a,children:[(0,S.jsx)(c,{className:`h-10 w-full rounded-xl`,children:(0,S.jsx)(s,{placeholder:o??f(`providersSelectPlaceholder`)})}),(0,S.jsx)(l,{children:i.map(e=>(0,S.jsx)(u,{value:e.name,children:e.displayName},e.name))})]})}),(0,S.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,S.jsx)(T,{id:e,value:b,onChange:e=>{if(!A){let t=e.trim();C(t),r(t);return}let t=m(e,j);C(t),r(t?y(A.prefix,t):``)},options:M,disabled:a||!_,placeholder:O,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:f(`modelPickerNoOptions`),createText:f(`modelPickerUseCustom`),toggleLabel:f(`modelPickerToggleOptions`)},_)]}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:f(`modelInputCustomHint`)})]}):(0,S.jsxs)(`div`,{className:h,children:[(0,S.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:f(`providersEmptyTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:f(`providersEmptyDescription`)})]}),(0,S.jsx)(t,{id:e,value:n,disabled:a,onChange:e=>r(e.target.value),placeholder:O,className:`mt-3 h-10 rounded-xl`}),(0,S.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:f(`modelInputCustomHint`)})]})}export{O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,Jn as n,Qt as r,Ut as i,Wt as a,Yt as o,_n as s,cr as c,gn as l,sr as u,yr as d}from"./api-Cjq-o1VN.js";import{t as f}from"./createLucideIcon-D7hvIHV-.js";import{a as p,i as m,t as h}from"./use-viewport-layout-CPZUmTPi.js";import{a as g,i as _,n as v,r as y,t as b,w as x}from"./select-CctTN205.js";import{f as S}from"./context-menu-rd7b_kVD.js";import{i as C,n as w,r as T,t as E}from"./confirm-dialog-DShT64F6.js";import{t as D}from"./eye-BBuTzJ53.js";import{t as O}from"./loader-circle-BA7EMkih.js";import{n as k,t as A}from"./trash-2-C5KH5Rw9.js";import{t as j}from"./refresh-cw-y3L6PyLt.js";import{t as M}from"./settings-2-EPflrNk6.js";import{t as N}from"./x--xxUvHKW.js";import{l as P,s as F}from"./i18n-qBGEbcW6.js";import{a as I,c as L,g as R,h as z,l as B,o as V,p as H,t as ee}from"./provider-models-C3frdXeW.js";import{n as U,t as W}from"./status-dot-CensgJZC.js";import{t as te}from"./host-capabilities-DuIFVsvM.js";import{a as ne,c as G,d as K,f as q,h as re,i as ie,l as ae,m as oe,o as se,p as ce,r as le,y as ue}from"./use-config-CPl_F79t.js";import{t as de}from"./form-actions-CLGWO52v.js";import{t as J}from"./config-hints-DbmiyTKg.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,s as ye}from"./config-split-page-G7Kt2BnV.js";var be=f(`CircleDotDashed`,[[`path`,{d:`M10.1 2.18a9.93 9.93 0 0 1 3.8 0`,key:`1qdqn0`}],[`path`,{d:`M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7`,key:`1bq7p6`}],[`path`,{d:`M21.82 10.1a9.93 9.93 0 0 1 0 3.8`,key:`1rlaqf`}],[`path`,{d:`M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69`,key:`1xk03u`}],[`path`,{d:`M13.9 21.82a9.94 9.94 0 0 1-3.8 0`,key:`l7re25`}],[`path`,{d:`M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7`,key:`1v18p6`}],[`path`,{d:`M2.18 13.9a9.93 9.93 0 0 1 0-3.8`,key:`xdo6bj`}],[`path`,{d:`M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69`,key:`1jjmaz`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xe=f(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Y=e(d(),1),Se={providerId:``,providerType:null,isBuiltInType:!1,isCustom:!0,enabled:!0,displayName:``,apiKeySet:!1,apiKeyMasked:void 0,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelConfig:{}};function X(e){if(!e)return null;let t=Object.entries(e).map(([e,t])=>[e.trim(),t]).filter(([e])=>e.length>0);return t.length===0?null:Object.fromEntries(t)}function Ce(e,t){let n=X(e),r=X(t);if(n===null&&r===null)return!0;if(!n||!r)return!1;let i=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)),a=Object.entries(r).sort(([e],[t])=>e.localeCompare(t));return i.length===a.length?i.every(([e,t],n)=>e===a[n][0]&&t===a[n][1]):!1}function Z(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function we(e,t){let n=e.trim();if(!n||!t.trim())return n;let r=`${t.trim()}/`;return n.startsWith(r)?n.slice(r.length):n}function Q(e,t){let n=e.trim();if(!n)return``;for(let e of t){let t=e.trim();t&&(n=we(n,t))}return n.trim()}function Te(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function Ee(e,t){return Z(t)}function De(e,t){return Z(e).map(e=>{let n=e.trim();return!n||n.startsWith(`${t}/`)?n:`${t}/${n}`})}function Oe(e,t){let n=new Set(t.map(e=>e.trim()).filter(Boolean)),r={};for(let[t,i]of Object.entries(e)){if(!n.has(t))continue;let e={},a=L(i.thinking?.supported);if(a.length>0){let t=B(i.thinking?.default);e.thinking=t&&a.includes(t)?{supported:a,default:t}:{supported:a}}i.vision===!0&&(e.vision=!0),(e.thinking||e.vision===!0)&&(r[t]=e)}return r}function ke(e,t,n){return{...V(e,n),...V(t,n)}}function Ae(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1){let a=n[i];if(a!==r[i])return!1;let o=e[a],s=t[a];if(!o||!s||!Te([...o.thinking?.supported??[]].sort(),[...s.thinking?.supported??[]].sort())||(o.thinking?.default??null)!==(s.thinking?.default??null)||(o.vision??!1)!==(s.vision??!1))return!1}return!0}function je(e){return e.providerName?e.apiKey.trim().length>0||e.apiBase.trim()!==e.currentApiBase.trim()||!Ce(e.extraHeaders,e.currentHeaders)||e.supportsWireApi&&e.wireApi!==e.currentWireApi||!Te(e.models,e.currentEditableModels)||!Ae(e.modelConfig,e.currentModelConfig)||e.providerDisplayName.trim()!==e.effectiveDisplayName:!1}function Me(e){let t={},n=e.apiKey.trim(),r=e.apiBase.trim(),i=X(e.extraHeaders),a=e.providerDisplayName.trim();return a!==e.effectiveDisplayName&&(t.displayName=a.length>0?a:null),n.length>0&&(t.apiKey=n),r!==e.currentApiBase.trim()&&(t.apiBase=r.length>0&&r!==e.defaultApiBase?r:null),Ce(i,e.currentHeaders)||(t.extraHeaders=i),e.supportsWireApi&&e.wireApi!==e.currentWireApi&&(t.wireApi=e.wireApi),Te(e.models,e.currentEditableModels)||(t.models=De(e.models,e.providerName??``)),Ae(e.modelConfig,e.currentModelConfig)||(t.modelConfig=Oe(e.modelConfig,e.models)),t}function Ne(e){let t=Q(e.models.find(e=>e.trim().length>0)??``,e.providerModelAliases),n={...Pe(e),model:t||null};return e.supportsWireApi&&(n.wireApi=e.wireApi),n}function Pe(e){let t={apiBase:e.apiBase.trim(),extraHeaders:X(e.extraHeaders)};return e.apiKey.trim().length>0&&(t.apiKey=e.apiKey.trim()),t}function Fe(e){return F(e===`off`?`chatThinkingLevelOff`:e===`minimal`?`chatThinkingLevelMinimal`:e===`low`?`chatThinkingLevelLow`:e===`medium`?`chatThinkingLevelMedium`:e===`high`?`chatThinkingLevelHigh`:e===`adaptive`?`chatThinkingLevelAdaptive`:`chatThinkingLevelXhigh`)}function Ie(e){let{providerName:t,methods:n,defaultMethodId:r,language:i}=e;if(n.length===0)return``;let a=new Map;for(let e of n){let t=e.id.trim();t&&a.set(t.toLowerCase(),t)}let o=(...e)=>{for(let t of e){let e=a.get(t.toLowerCase());if(e)return e}},s=r?.trim();if(t===`minimax-portal`){if(i===`zh`)return o(`cn`,`china-mainland`)??o(s??``)??n[0]?.id??``;if(i===`en`)return o(`global`,`intl`,`international`)??o(s??``)??n[0]?.id??``}if(s){let e=o(s);if(e)return e}return i===`zh`?o(`cn`)??n[0]?.id??``:i===`en`?o(`global`)??n[0]?.id??``:n[0]?.id??``}function Le(e){let{required:t,hasDefault:n,optionCount:r}=e;return t&&n&&r>1&&r<=3}function Re(e,t,n){let r=Q(t,n);return r?e.includes(r)?{models:e,draft:``}:{models:[...e,r],draft:``}:{models:e,draft:t}}function ze(e,t,n){let r=[...e],i=new Set(e);for(let e of t){let t=Q(e,n);t&&!i.has(t)&&(i.add(t),r.push(t))}return{models:r,addedCount:r.length-e.length}}function Be(e,t,n){return ze(e,t,n).models.slice(e.length)}function Ve(e,t,n){let r={...t};return delete r[n],{models:e.filter(e=>e!==n),modelConfig:r}}function He(e,t,n){let r=e[t],i=r?.thinking?.supported??[],a=i.includes(n)?i.filter(e=>e!==n):ee.filter(e=>e===n||i.includes(e)),o=r?.thinking?.default&&a.includes(r.thinking.default)?r.thinking.default:void 0,s={...r,thinking:a.length>0?o?{supported:a,default:o}:{supported:a}:void 0},c={...e};return s.thinking||s.vision===!0?c[t]=s:delete c[t],c}function Ue(e,t,n){let r=e[t],i=r?.thinking;return!i||i.supported.length===0||n&&!i.supported.includes(n)?e:{...e,[t]:{...r,thinking:n?{supported:i.supported,default:n}:{supported:i.supported}}}}function We(e,t,n){let r={...e[t],vision:n?!0:void 0},i={...e};return r.thinking||r.vision===!0?i[t]=r:delete i[t],i}function Ge(e){let{providerName:t,providerSpec:n,language:r}=e,i=n?.auth,a=i?.methods??[];return{providerAuth:i,providerAuthMethodOptions:a.map(e=>({value:e.id,label:e.label?.[r]||e.label?.en||e.id})),providerAuthMethods:a,preferredAuthMethodId:Ie({providerName:n?.providerType??t,methods:a,defaultMethodId:i?.defaultMethodId,language:r}),shouldUseAuthMethodPills:Le({required:i?.kind===`device_code`,hasDefault:!!i?.defaultMethodId?.trim(),optionCount:a.length})}}function Ke(e,t){let n=!!e?.supportsWireApi||t,r=(e?.wireApiOptions||[`auto`,`chat`,`responses`]).map(e=>({value:e,label:F(e===`chat`?`wireApiChat`:e===`responses`?`wireApiResponses`:`wireApiAuto`)}));return{shouldUseWireApiPills:Le({required:n,hasDefault:typeof e?.defaultWireApi==`string`&&e.defaultWireApi.length>0,optionCount:r.length}),supportsWireApi:n,wireApiSelectOptions:r}}function qe(e){let{providerName:t,providersView:n,templatesView:r,schema:i,language:a}=e,o=t?n?.providers[t]:null,s=r?.providerTemplates.find(e=>e.providerType===o?.providerType),c=o??Se,l=i?.uiHints,u=!!o?.isCustom,d=t?J(`providers.${t}.apiKey`,l):void 0,f=t?J(`providers.${t}.apiBase`,l):void 0,p=t?J(`providers.${t}.extraHeaders`,l):void 0,m=t?J(`providers.${t}.wireApi`,l):void 0,h=s?.displayName||o?.displayName||t||``,g=(c.displayName||``).trim()||h,_=c.enabled!==!1,v=u||s?.supportsModelDiscovery===!0,y=Z([s?.modelPrefix||s?.providerType||``,t||``]),b=s?.defaultApiBase||``,x=c.apiBase||b,S=X(c.extraHeaders||null),C=c.wireApi||s?.defaultWireApi||`auto`,w=Ee(Z((s?.defaultModels??[]).map(e=>Q(e,y))),Z((c.models??[]).map(e=>Q(e,y)))),T=Oe(ke(s?.modelConfig,c.modelConfig,y),w),E=s?.apiBaseHelp?.[a]||s?.apiBaseHelp?.en||f?.help||F(`providerApiBaseHelp`),D=Ge({providerName:t,providerSpec:s,language:a}),O=Ke(s,u);return{apiBaseHelpText:E,apiBaseHint:f,apiKeyHint:d,currentApiBase:x,currentEditableModels:w,currentEnabled:_,currentHeaders:S,currentModelConfig:T,currentWireApi:C,defaultApiBase:b,defaultDisplayName:h,effectiveDisplayName:g,extraHeadersHint:p,...D,providerConfig:o,providerModelAliases:y,resolvedProviderConfig:c,supportsModelDiscovery:v,wireApiHint:m,...O}}function Je(e){let{providerName:t,providerAuth:r,resolvedAuthMethodId:i}=e,a=u(),o=oe(),s=ae(),c=G(),[l,d]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(``),g=(0,Y.useRef)(null),_=(0,Y.useCallback)(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),v=(0,Y.useCallback)((e,r)=>{_(),g.current=window.setTimeout(()=>{(async()=>{if(t)try{let i=await s.mutateAsync({provider:t,data:{sessionId:e}});if(i.status===`pending`){h(F(`providerAuthWaitingBrowser`)),v(e,i.nextPollMs??r);return}if(i.status===`authorized`){p(null),_(),h(F(`providerAuthCompleted`)),n.success(F(`providerAuthCompleted`)),a.invalidateQueries({queryKey:[`config`]}),a.invalidateQueries({queryKey:[`providers`]});return}p(null),_(),h(i.message||`Authorization ${i.status}.`),n.error(i.message||`Authorization ${i.status}.`)}catch(e){p(null),_();let t=e instanceof Error?e.message:String(e);h(t),n.error(`Authorization failed: ${t}`)}})()},Math.max(1e3,r))},[_,s,t,a]),y=(0,Y.useCallback)(async()=>{if(!(!t||r?.kind!==`device_code`))try{d(t),h(``);let e=await o.mutateAsync({provider:t,data:i?{methodId:i}:{}});if(!e.sessionId||!e.verificationUri)throw Error(F(`providerAuthStartFailed`));p(e.sessionId),h(`${F(`providerAuthOpenPrompt`)}${e.userCode}${F(`providerAuthOpenPromptSuffix`)}`),await te.openExternalUrl(e.verificationUri),v(e.sessionId,e.intervalMs)}catch(e){let t=e instanceof Error?e.message:String(e);p(null),_(),h(t),n.error(`${F(`providerAuthStartFailed`)}: ${t}`)}},[_,r?.kind,t,i,v,o]),b=(0,Y.useCallback)(async()=>{if(!(!t||r?.kind!==`device_code`))try{d(t),_(),p(null);let e=await c.mutateAsync({provider:t});h(`${F(`providerAuthImportStatusPrefix`)}${e.expiresAt?` (expires: ${e.expiresAt})`:``}`),n.success(F(`providerAuthImportSuccess`)),a.invalidateQueries({queryKey:[`config`]}),a.invalidateQueries({queryKey:[`providers`]})}catch(e){let t=e instanceof Error?e.message:String(e);h(t),n.error(`${F(`providerAuthImportFailed`)}: ${t}`)}},[_,c,r?.kind,t,a]);return(0,Y.useEffect)(()=>{_()},[_,t]),(0,Y.useEffect)(()=>()=>_(),[_]),{authSessionId:l===t?f:null,authStatusMessage:l===t?m:``,importAuthFromCli:b,importPending:c.isPending,startAuth:y,startPending:o.isPending}}function Ye(e){let{providerName:t,apiKey:r,apiKeyRequired:i,apiKeySet:a,apiBase:o,extraHeaders:s,supportsWireApi:c,wireApi:u,models:d,providerModelAliases:f}=e,p=re(),m=se(),h=(0,Y.useMemo)(()=>JSON.stringify({providerName:t,apiKey:r,apiBase:o,extraHeaders:s}),[o,r,s,t]),[g,_]=(0,Y.useState)(null),v=(0,Y.useCallback)(async()=>{if(t)try{let e=await p.mutateAsync({provider:t,data:Ne({apiKey:r,apiBase:o,extraHeaders:s,supportsWireApi:c,wireApi:u,models:d,providerModelAliases:f})});if(e.success){n.success(`${F(`providerTestConnectionSuccess`)} (${e.latencyMs}ms)`);return}let i=[`provider=${e.provider}`,`latency=${e.latencyMs}ms`];e.model&&i.push(`model=${e.model}`),n.error(`${F(`providerTestConnectionFailed`)}: ${e.message} | ${i.join(` | `)}`)}catch(e){let t=e instanceof Error?e.message:String(e);n.error(`${F(`providerTestConnectionFailed`)}: ${t}`)}},[o,r,s,d,f,t,c,p,u]);return{discoverModels:(0,Y.useCallback)(async()=>{if(!t)return null;if(i&&!r.trim()&&!a)return n.error(F(`providerModelsApiKeyRequired`)),null;try{let e=await m.mutateAsync({provider:t,data:Pe({apiKey:r,apiBase:o,extraHeaders:s})});return _({key:h,models:e.models}),n.success(F(`providerModelsFetchSuccess`)),e.models}catch(e){if(e instanceof l&&(e.details?.upstreamStatus===401||e.details?.upstreamStatus===403))return n.error(F(`providerModelsAuthorizationFailed`)),null;let t=e instanceof Error?e.message:String(e);return n.error(`${F(`providerModelsFetchFailed`)}: ${t}`),null}},[o,r,i,a,m,h,s,t]),fetchedModels:g?.key===h?g.models:[],isDiscoveringModels:m.isPending,isTestPending:p.isPending,testConnection:v}}var $=c();function Xe({value:e,onChange:n,className:r}){let i=e?Object.entries(e):[],a=(e,t,r)=>{let a=[...i];a[e]=[t,r],n(Object.fromEntries(a))},c=()=>{n({...e,"":``})},l=e=>{let t=i.filter((t,n)=>n!==e);n(Object.fromEntries(t))};return(0,$.jsxs)(`div`,{className:s(`space-y-2`,r),children:[i.map(([e,n],r)=>(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(t,{type:`text`,value:e,onChange:e=>a(r,e.target.value,n),placeholder:F(`headerName`),className:`flex-1`}),(0,$.jsx)(t,{type:`text`,value:n,onChange:t=>a(r,e,t.target.value),placeholder:F(`headerValue`),className:`flex-1`}),(0,$.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>l(r),children:(0,$.jsx)(A,{className:`h-4 w-4 text-red-500`})})]},r)),(0,$.jsxs)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:[(0,$.jsx)(k,{className:`h-4 w-4 mr-2`}),F(`add`)]})]})}function Ze(e){let{value:t,onChange:n,options:r}=e;return(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let r=e.value===t;return(0,$.jsx)(`button`,{type:`button`,onClick:()=>n(e.value),"aria-pressed":r,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${r?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:e.label},e.value)})})}function Qe(e){let{showAdvanced:t,onShowAdvancedChange:n,supportsWireApi:r,wireApiLabel:i,wireApi:o,onWireApiChange:s,shouldUseWireApiPills:c,wireApiSelectOptions:l,extraHeadersLabel:u,extraHeaders:d,onExtraHeadersChange:f}=e;return(0,$.jsxs)(`div`,{className:`border-t border-border/70 pt-4`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center justify-between text-sm text-muted-foreground transition-colors hover:text-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(M,{className:`h-3.5 w-3.5`}),F(`providerAdvancedSettings`)]}),(0,$.jsx)(x,{className:`h-4 w-4 transition-transform ${t?`rotate-180`:``}`})]}),t?(0,$.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[r?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`wireApi`,className:`text-sm font-medium text-foreground`,children:i}),c?(0,$.jsx)(Ze,{value:o,onChange:e=>s(e),options:l}):(0,$.jsxs)(b,{value:o,onValueChange:e=>s(e),children:[(0,$.jsx)(_,{className:`rounded-xl`,children:(0,$.jsx)(g,{})}),(0,$.jsx)(v,{children:l.map(e=>(0,$.jsx)(y,{value:e.value,children:e.label},e.value))})]})]}):null,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:u}),(0,$.jsx)(Xe,{value:d,onChange:f}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerExtraHeadersHelpShort`)})]})]}):null]})}function $e({isSet:e,className:n,value:r,onChange:i,placeholder:a,...c}){let[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),p=typeof r==`string`&&r.length>0;return(0,$.jsxs)(`div`,{className:`relative`,children:[e&&!p&&!d?(0,$.jsx)(`div`,{onClick:()=>f(!0),className:s(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12`,n),children:`••••••••••••`}):(0,$.jsx)(t,{type:l?`text`:`password`,className:s(`pr-12`,n),value:r,onChange:i,onBlur:()=>{p||f(!1)},placeholder:a,autoFocus:d,...c}),(0,$.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex gap-1`,children:(e||p)&&(0,$.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>u(!l),children:l?(0,$.jsx)(xe,{className:`h-4 w-4`}):(0,$.jsx)(D,{className:`h-4 w-4`})})})]})}function et(e){let{apiKey:t,apiKeyRequired:n,apiKeySet:r,apiKeyPlaceholder:i,providerAuth:s,providerAuthNote:c,providerAuthMethodOptions:l,providerAuthMethodsCount:u,selectedAuthMethodHint:d,shouldUseAuthMethodPills:f,resolvedAuthMethodId:p,onAuthMethodChange:m,onStartProviderAuth:h,onImportProviderAuthFromCli:x,startPending:S,importPending:C,authSessionId:w,authStatusMessage:T,onApiKeyChange:E}=e,D=n?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`apiKey`,className:`text-sm font-medium text-foreground`,children:F(`apiKey`)}),(0,$.jsx)($e,{id:`apiKey`,value:t,isSet:r,onChange:e=>E(e.target.value),placeholder:i,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`leaveBlankToKeepUnchanged`)})]}):null;return s?.kind===`device_code`?(0,$.jsxs)($.Fragment,{children:[D,(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/45 p-3`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:s.displayName||F(`providerAuthSectionTitle`)}),c?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null,u>1?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{className:`text-xs font-medium text-foreground`,children:F(`providerAuthMethodLabel`)}),f?(0,$.jsx)(Ze,{value:p,onChange:m,options:l}):(0,$.jsxs)(b,{value:p,onValueChange:m,children:[(0,$.jsx)(_,{className:`h-8 rounded-lg`,children:(0,$.jsx)(g,{placeholder:F(`providerAuthMethodPlaceholder`)})}),(0,$.jsx)(v,{children:l.map(e=>(0,$.jsx)(y,{value:e.value,children:e.label},e.value))})]}),d?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d}):null]}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:h,disabled:S||!!w,children:F(S?`providerAuthStarting`:w?`providerAuthAuthorizing`:`providerAuthAuthorizeInBrowser`)}),s.supportsCliImport?(0,$.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:x,disabled:C,children:F(C?`providerAuthImporting`:`providerAuthImportFromCli`)}):null,w?(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[F(`providerAuthSessionLabel`),`: `,w.slice(0,8),`…`]}):null]}),T?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}):null]})]}):D}function tt(e){let{providerName:t,models:n,aliases:r,fetchedModels:i=[],onModelsChange:a}=e,o=K({pollWhileRefreshing:!0,refreshOnMount:!0}),s=t?o.data?.providers[t]:void 0,c=i.length>0?`fetched`:`background`,l=(0,Y.useMemo)(()=>Be(n,c===`fetched`?i:s?.models??[],r),[r,s?.models,i,n,c]);return{addSuggestedModels:(0,Y.useCallback)(e=>{let t=ze(n,e,r);t.addedCount>0&&a(t.models)},[r,n,a]),hasSuggestionError:!!(s?.lastError&&!s.fetchedAt),isCheckingSuggestions:!!(t&&(o.isLoading||o.data?.refreshing&&!s)),suggestedModels:l,suggestionSource:c}}function nt(e){let{models:t,modelConfig:n,onModelsChange:r,onRemoveModel:o,onToggleModelThinkingLevel:s,onSetModelThinkingDefault:c,onSetModelVision:l,thinkingLevels:u,formatThinkingLevelLabel:d}=e,[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(()=>new Set),x=(0,Y.useMemo)(()=>t.filter(e=>m.has(e)),[t,m]),S=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},C=()=>{p(!1),h(new Set)};return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`div`,{className:`flex min-h-7 flex-wrap items-center justify-end gap-2`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`mr-auto text-xs text-muted-foreground`,children:F(`providerModelsSuggestionsSelected`).replace(`{count}`,String(x.length))}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-primary hover:text-primary/80`,onClick:()=>h(x.length===t.length?new Set:new Set(t)),children:F(x.length===t.length?`providerModelsClearSelection`:`providerModelsSelectAll`)}),(0,$.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:C,children:F(`cancel`)}),(0,$.jsxs)(`button`,{type:`button`,disabled:x.length===0,className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>{x.length!==0&&(r(t.filter(e=>!m.has(e))),C())},children:[(0,$.jsx)(A,{className:`h-3 w-3`}),F(`providerModelsRemoveSelected`)]})]}):(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-xs font-medium text-muted-foreground hover:text-foreground`,onClick:()=>p(!0),children:[(0,$.jsx)(A,{className:`h-3 w-3`}),F(`providerModelsBulkRemove`)]})}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>{if(f)return(0,$.jsxs)(`label`,{className:`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:m.has(e),onChange:()=>S(e),"aria-label":F(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e})]},e);let t=n[e],r=t?.thinking,p=r?.supported??[],h=r?.default??null,x=t?.vision===!0;return(0,$.jsxs)(`div`,{className:`group inline-flex max-w-full items-center gap-1 rounded-full border border-border/55 bg-muted/45 px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`max-w-[140px] truncate text-sm text-foreground sm:max-w-[220px]`,children:e}),(0,$.jsxs)(H,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":F(`providerModelThinkingTitle`),title:F(`providerModelThinkingTitle`),children:(0,$.jsx)(M,{className:`h-3 w-3`})})}),(0,$.jsxs)(z,{className:`w-80 space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg bg-muted/50 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:F(`providerModelVisionTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelVisionHint`)})]}),(0,$.jsx)(i,{checked:x,onCheckedChange:t=>l(e,t)})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:F(`providerModelThinkingTitle`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelThinkingHint`)})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:u.map(t=>(0,$.jsx)(`button`,{type:`button`,onClick:()=>s(e,t),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${p.includes(t)?`border-foreground/15 bg-foreground text-background`:`border-border/55 bg-muted/50 text-muted-foreground hover:border-border hover:bg-muted hover:text-foreground`}`,children:d(t)},t))}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(a,{className:`text-xs font-medium text-foreground`,children:F(`providerModelThinkingDefault`)}),(0,$.jsxs)(b,{value:h??`__none__`,onValueChange:t=>c(e,t===`__none__`?null:t),disabled:p.length===0,children:[(0,$.jsx)(_,{className:`h-8 rounded-lg text-xs`,children:(0,$.jsx)(g,{})}),(0,$.jsxs)(v,{children:[(0,$.jsx)(y,{value:`__none__`,children:F(`providerModelThinkingDefaultNone`)}),p.map(e=>(0,$.jsx)(y,{value:e,children:d(e)},e))]})]}),p.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelThinkingNoSupported`)}):null]})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground/70 opacity-100 transition-opacity hover:bg-muted hover:text-foreground md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,"aria-label":F(`remove`),children:(0,$.jsx)(N,{className:`h-3 w-3`})})]},e)})}),f?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerModelsRemoveSaveHint`)}):null]})}var rt=20,it=50,at=50;function ot(e){let{expanded:n,fetchedTotal:r,models:i,source:a,onExpandedChange:o,onAddModels:s}=e,[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(()=>new Set),f=(0,Y.useMemo)(()=>{let e=c.trim().toLowerCase();return e?i.filter(t=>t.toLowerCase().includes(e)):i},[i,c]),p=f.slice(0,at),h=(0,Y.useMemo)(()=>i.filter(e=>u.has(e)),[i,u]),g=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},_=e=>{e.length!==0&&(s(e),l(``),d(new Set))},v=a===`fetched`?`providerModelsFetchedSuggestionsSummary`:`providerModelsSuggestionsSummary`;return a===`fetched`&&i.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,role:`status`,children:[(0,$.jsx)(w,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{children:F(`providerModelsFetchedAllConfigured`).replace(`{count}`,String(r))})]}):(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 p-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":n,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground`,onClick:()=>o(!n),children:[(0,$.jsx)(w,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:F(v).replace(`{count}`,String(i.length))}),(0,$.jsx)(S,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${n?`rotate-90`:``}`})]}),i.length<=it?(0,$.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-lg px-2 py-1.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10`,onClick:()=>_(i),children:F(`providerModelsSuggestionsAddAll`)}):null]}),n?(0,$.jsxs)(`div`,{className:`px-1 pb-1`,children:[i.length>rt?(0,$.jsxs)(`div`,{className:`relative px-2 pb-1 pt-1.5`,children:[(0,$.jsx)(m,{className:`pointer-events-none absolute left-4 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(t,{value:c,onChange:e=>l(e.target.value),placeholder:F(`providerModelsSuggestionsSearchPlaceholder`),className:`h-8 rounded-lg pl-8 text-xs`})]}):null,(0,$.jsxs)(`div`,{className:`custom-scrollbar max-h-44 overflow-y-auto overscroll-contain`,children:[p.map(e=>(0,$.jsxs)(`label`,{className:`grid min-w-0 cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-muted/70`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:u.has(e),onChange:()=>g(e),"aria-label":F(`providerModelsSuggestionSelect`).replace(`{model}`,e),className:`h-3.5 w-3.5 shrink-0 accent-primary`}),(0,$.jsx)(`span`,{className:`block min-w-0 truncate text-xs text-foreground`,title:e,children:e})]},e)),f.length===0?(0,$.jsx)(`p`,{className:`px-2 py-4 text-center text-xs text-muted-foreground`,children:F(`providerModelsSuggestionsSearchEmpty`)}):null]}),f.length>p.length?(0,$.jsx)(`p`,{className:`px-2 pt-1 text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsShowing`).replace(`{visible}`,String(p.length)).replace(`{count}`,String(f.length))}):null,(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pt-1.5`,children:[(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsSelected`).replace(`{count}`,String(h.length))}),(0,$.jsx)(`button`,{type:`button`,disabled:h.length===0,className:`shrink-0 rounded-md bg-primary/10 px-2 py-1 text-[11px] font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-not-allowed disabled:opacity-45`,onClick:()=>_(h),children:F(`providerModelsSuggestionsAddSelected`)})]}),(0,$.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[11px] text-muted-foreground`,children:F(`providerModelsSuggestionsSaveHint`)})]}):null]})}function st({hasFetchedCatalog:e,hasSuggestionError:t,supportsModelDiscovery:n}){return!n||!t||e?null:(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[(0,$.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),F(`providerModelsSuggestionsFailed`)]})}function ct(e){let{providerName:n,providerModelAliases:r,models:i,modelConfig:s,modelDraft:c,showModelInput:l,onModelDraftChange:u,onShowModelInputChange:d,onAddModel:f,onModelsChange:p,supportsModelDiscovery:m,onDiscoverModels:h,isDiscoveringModels:g,fetchedModels:_,onRemoveModel:v,onToggleModelThinkingLevel:y,onSetModelThinkingDefault:b,onSetModelVision:x,thinkingLevels:S,formatThinkingLevelLabel:C}=e,[w,T]=(0,Y.useState)(!1),E=(0,Y.useRef)(null),{addSuggestedModels:D,hasSuggestionError:A,isCheckingSuggestions:M,suggestedModels:P,suggestionSource:I}=tt({providerName:n,models:i,aliases:r,fetchedModels:_,onModelsChange:p}),L=async()=>{await h()&&(T(!0),window.requestAnimationFrame(()=>{let e=E.current;e?.scrollIntoView?.({behavior:`smooth`,block:`center`}),e?.focus({preventScroll:!0})}))},R=_.length>0;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(a,{className:`text-sm font-medium text-foreground`,children:F(`providerModelsTitle`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m?(0,$.jsxs)(`button`,{type:`button`,onClick:L,disabled:g,className:`flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:text-primary/80 disabled:cursor-wait disabled:opacity-60`,children:[(0,$.jsx)(j,{className:`h-3 w-3 ${g?`animate-spin`:``}`}),F(g?`providerModelsFetching`:`providerModelsFetch`)]}):null,l?null:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80`,children:[(0,$.jsx)(k,{className:`h-3 w-3`}),F(`providerAddModel`)]})]})]}),l?(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(t,{value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f()),e.key===`Escape`&&(d(!1),u(``))},placeholder:F(`providerModelInputPlaceholder`),className:`flex-1 rounded-xl`,autoFocus:!0}),(0,$.jsx)(o,{type:`button`,size:`sm`,onClick:f,disabled:c.trim().length===0,children:F(`add`)}),(0,$.jsx)(o,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{d(!1),u(``)},children:(0,$.jsx)(N,{className:`h-4 w-4`})})]}):null,(0,$.jsx)(st,{hasFetchedCatalog:R,hasSuggestionError:A,supportsModelDiscovery:m}),m&&M&&!R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-muted/35 px-3 py-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(O,{className:`h-3.5 w-3.5 animate-spin`}),F(`providerModelsSuggestionsChecking`)]}):m&&(P.length>0||R)?(0,$.jsx)(`div`,{ref:E,tabIndex:-1,"aria-live":`polite`,className:`scroll-m-4 outline-none`,children:(0,$.jsx)(ot,{expanded:w,fetchedTotal:_.length,models:P,source:I,onExpandedChange:T,onAddModels:D})}):null,i.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-muted/35 px-4 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:F(`providerModelsEmptyShort`)}),l?null:(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(!0),className:`mt-2 text-sm font-medium text-primary hover:text-primary/80`,children:F(`providerAddFirstModel`)})]}):(0,$.jsx)(nt,{models:i,modelConfig:s,onModelsChange:p,onRemoveModel:v,onToggleModelThinkingLevel:y,onSetModelThinkingDefault:b,onSetModelVision:x,thinkingLevels:S,formatThinkingLevelLabel:C})]})}function lt({apiKeyRequired:e=!0,apiKeySet:t,className:n,enabled:r}){if(!r)return(0,$.jsx)(W,{status:`inactive`,label:F(`disabled`),className:n});let i=!e||t;return(0,$.jsx)(W,{status:i?`ready`:`setup`,label:F(i?`statusReady`:`statusSetup`),className:n})}function ut(e){let{context:n,language:r,providerTitle:i,providerDisplayName:s,apiKey:c,apiBase:l,extraHeaders:u,wireApi:d,models:f,modelConfig:p,modelDraft:m,showAdvanced:h,showModelInput:g,resolvedAuthMethodId:_,authSessionId:v,authStatusMessage:y,hasChanges:b,isDeletePending:x,isUpdatePending:S,connectivity:C,startPending:w,importPending:T,onProviderDisplayNameChange:E,onApiKeyChange:D,onApiBaseChange:O,onAuthMethodChange:k,onStartProviderAuth:j,onImportProviderAuthFromCli:M,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:I,onModelsChange:L,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,onShowAdvancedChange:H,onWireApiChange:U,onExtraHeadersChange:W,onDeleteProvider:te,onSubmit:ne,onTestConnection:G}=e,K=n.providerAuthMethods.find(e=>e.id===_);return(0,$.jsxs)(ge,{children:[(0,$.jsx)(pe,{className:`px-5 py-4`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`truncate text-lg font-semibold text-foreground`,children:i}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:te,disabled:x,className:`text-muted-foreground/70 transition-colors hover:text-red-500`,title:F(`providerDelete`),children:(0,$.jsx)(A,{className:`h-4 w-4`})}),(0,$.jsx)(lt,{enabled:n.currentEnabled,apiKeyRequired:n.resolvedProviderConfig.apiKeyRequired,apiKeySet:n.resolvedProviderConfig.apiKeySet})]})]})}),(0,$.jsxs)(`form`,{onSubmit:ne,className:`flex min-h-0 flex-1 flex-col`,children:[(0,$.jsxs)(_e,{className:`space-y-4 px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`providerDisplayName`,className:`text-sm font-medium text-foreground`,children:F(`providerDisplayName`)}),(0,$.jsx)(t,{id:`providerDisplayName`,type:`text`,value:s,onChange:e=>E(e.target.value),placeholder:n.defaultDisplayName||F(`providerDisplayNamePlaceholder`),className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F(`providerDisplayNameHelpShort`)})]}),(0,$.jsx)(et,{apiKey:c,apiKeyRequired:n.resolvedProviderConfig.apiKeyRequired!==!1,apiKeySet:n.resolvedProviderConfig.apiKeySet,apiKeyPlaceholder:n.apiKeyHint?.placeholder??F(`enterApiKey`),providerAuth:n.providerAuth,providerAuthNote:n.providerAuth?.note?.[r]||n.providerAuth?.note?.en||n.providerAuth?.displayName||``,providerAuthMethodOptions:n.providerAuthMethodOptions,providerAuthMethodsCount:n.providerAuthMethods.length,selectedAuthMethodHint:K?.hint?.[r]||K?.hint?.en||``,shouldUseAuthMethodPills:n.shouldUseAuthMethodPills,resolvedAuthMethodId:_,onAuthMethodChange:k,onStartProviderAuth:j,onImportProviderAuthFromCli:M,startPending:w,importPending:T,authSessionId:v,authStatusMessage:y,onApiKeyChange:D}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(a,{htmlFor:`apiBase`,className:`text-sm font-medium text-foreground`,children:F(`apiBase`)}),(0,$.jsx)(t,{id:`apiBase`,type:`text`,value:l,onChange:e=>O(e.target.value),placeholder:n.defaultApiBase||n.apiBaseHint?.placeholder||`https://api.example.com`,className:`rounded-xl`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.apiBaseHelpText})]}),(0,$.jsx)(ct,{providerName:n.providerConfig?.providerId??``,providerModelAliases:n.providerModelAliases,models:f,modelConfig:p,modelDraft:m,showModelInput:g,onModelDraftChange:N,onShowModelInputChange:P,onAddModel:I,onModelsChange:L,supportsModelDiscovery:n.supportsModelDiscovery,onDiscoverModels:C.discoverModels,isDiscoveringModels:C.isDiscoveringModels,fetchedModels:C.fetchedModels,onRemoveModel:R,onToggleModelThinkingLevel:z,onSetModelThinkingDefault:B,onSetModelVision:V,thinkingLevels:ee,formatThinkingLevelLabel:Fe},n.providerConfig?.providerId),(0,$.jsx)(Qe,{showAdvanced:h,onShowAdvancedChange:H,supportsWireApi:n.supportsWireApi,wireApiLabel:F(`wireApi`),wireApi:d,onWireApiChange:U,shouldUseWireApiPills:n.shouldUseWireApiPills,wireApiSelectOptions:n.wireApiSelectOptions,extraHeadersLabel:F(`extraHeaders`),extraHeaders:u,onExtraHeadersChange:W})]}),(0,$.jsx)(ye,{children:(0,$.jsxs)(de,{align:`between`,children:[(0,$.jsxs)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:G,disabled:C.isTestPending,children:[(0,$.jsx)(be,{className:`mr-1.5 h-3.5 w-3.5`}),C.isTestPending?F(`providerTestingConnection`):F(`providerTestConnection`)]}),(0,$.jsx)(o,{type:`submit`,size:`sm`,disabled:S||!b,children:F(S?`saving`:b?`save`:`unchanged`)})]})})]})]})}function dt({providerName:e,onProviderDeleted:t}){let{data:n}=ce(),{data:r}=q(),{data:i}=le(),a=P(),o=(0,Y.useMemo)(()=>qe({providerName:e,providersView:n,templatesView:r,schema:i,language:a}),[a,e,n,i,r]);if(!e||!o.providerConfig)return(0,$.jsx)(ve,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-base font-semibold text-foreground`,children:F(`providersSelectTitle`)}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:F(`providersSelectDescription`)})]})});let s=JSON.stringify({providerConfig:o.providerConfig,currentApiBase:o.currentApiBase,currentEditableModels:o.currentEditableModels,currentModelConfig:o.currentModelConfig,currentWireApi:o.currentWireApi,effectiveDisplayName:o.effectiveDisplayName,preferredAuthMethodId:o.preferredAuthMethodId});return(0,$.jsx)(ft,{providerName:e,onProviderDeleted:t,context:o,language:a},s)}function ft({providerName:e,onProviderDeleted:t,context:n,language:r}){let i=ue(),a=ne(),{currentApiBase:o,currentEditableModels:s,currentHeaders:c,currentModelConfig:l,currentWireApi:u,defaultApiBase:d,effectiveDisplayName:f,providerAuth:p,providerAuthMethods:m,providerModelAliases:h,resolvedProviderConfig:g,preferredAuthMethodId:_,supportsWireApi:v}=n,[y,b]=(0,Y.useState)(``),[x,S]=(0,Y.useState)(o),[C,w]=(0,Y.useState)(g.extraHeaders||null),[T,E]=(0,Y.useState)(u),[D,O]=(0,Y.useState)(s),[k,A]=(0,Y.useState)(l),[j,M]=(0,Y.useState)(``),[N,P]=(0,Y.useState)(f),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(_),H=Ye({providerName:e,apiKey:y,apiKeyRequired:g.apiKeyRequired!==!1,apiKeySet:g.apiKeySet,apiBase:x,extraHeaders:C,supportsWireApi:v,wireApi:T,models:D,providerModelAliases:h}),ee=N.trim()||f||e||F(`providersSelectPlaceholder`),U=(0,Y.useMemo)(()=>{if(!m.length)return``;let e=B.trim();return e&&m.some(t=>t.id===e)?e:_||m[0]?.id||``},[B,_,m]),{authSessionId:W,authStatusMessage:te,importAuthFromCli:G,importPending:K,startAuth:q,startPending:re}=Je({providerName:e,providerAuth:p,resolvedAuthMethodId:U}),ie=(0,Y.useMemo)(()=>je({providerName:e,apiKey:y,apiBase:x,currentApiBase:o,extraHeaders:C,currentHeaders:c,supportsWireApi:v,wireApi:T,currentWireApi:u,models:D,currentEditableModels:s,modelConfig:k,currentModelConfig:l,providerDisplayName:N,effectiveDisplayName:f}),[e,y,x,o,C,c,v,T,u,D,s,k,l,N,f]),ae=e=>{O(e),A(t=>Oe(t,e))};return(0,$.jsx)(ut,{context:n,language:r,providerTitle:ee,providerDisplayName:N,apiKey:y,apiBase:x,extraHeaders:C,wireApi:T,models:D,modelConfig:k,modelDraft:j,showAdvanced:I,showModelInput:R,resolvedAuthMethodId:U,authSessionId:W,authStatusMessage:te,hasChanges:ie,isDeletePending:a.isPending,isUpdatePending:i.isPending,connectivity:H,startPending:re,importPending:K,onProviderDisplayNameChange:P,onApiKeyChange:b,onApiBaseChange:S,onAuthMethodChange:V,onStartProviderAuth:q,onImportProviderAuthFromCli:G,onModelDraftChange:M,onShowModelInputChange:z,onAddModel:()=>{let e=Re(D,j,h);ae(e.models),M(e.draft)},onModelsChange:ae,onRemoveModel:e=>{let t=Ve(D,k,e);O(t.models),A(t.modelConfig)},onToggleModelThinkingLevel:(e,t)=>{A(n=>He(n,e,t))},onSetModelThinkingDefault:(e,t)=>{A(n=>Ue(n,e,t))},onSetModelVision:(e,t)=>{A(n=>We(n,e,t))},onShowAdvancedChange:L,onWireApiChange:E,onExtraHeadersChange:w,onDeleteProvider:async()=>{if(e&&window.confirm(F(`providerDeleteConfirm`)))try{await a.mutateAsync({provider:e}),t?.(e)}catch{}},onSubmit:t=>{t.preventDefault(),e&&i.mutate({provider:e,data:Me({providerName:e,apiKey:y,apiBase:x,currentApiBase:o,defaultApiBase:d,extraHeaders:C,currentHeaders:c,supportsWireApi:v,wireApi:T,currentWireApi:u,models:D,currentEditableModels:s,modelConfig:k,currentModelConfig:l,providerDisplayName:N,effectiveDisplayName:f})})},onTestConnection:H.testConnection})}function pt(e){if(!e)return null;try{let t=new URL(e);return`${t.host}${t.pathname&&t.pathname!==`/`?t.pathname:``}`}catch{return e.replace(/^https?:\/\//,``)}}function mt(e,t=[]){let n=new Map(t.map((e,t)=>[e,t]));return e.map((e,t)=>({provider:e,index:t})).sort((e,t)=>{let r=n.get(e.provider.providerId),i=n.get(t.provider.providerId);if(r!==void 0||i!==void 0)return(r??2**53-1)-(i??2**53-1);let a=e.provider.providerType===`nextclaw`?1:0,o=t.provider.providerType===`nextclaw`?1:0;return a===o?e.index-t.index:a-o}).map(({provider:e})=>e)}function ht(e){let t=e.findIndex(e=>e.providerType===`zhipu`),n=e.findIndex(e=>e.providerType===`dashscope-coding-plan`);return e.map((e,t)=>({template:e,index:t})).sort((e,r)=>{let i=({template:e,index:r})=>e.providerType===`nextclaw`?2**53-1:e.providerType===`deepseek`&&n>=0?n-.5:e.providerType===`mimo`&&t>=0?t+.5:r;return i(e)-i(r)}).map(({template:e})=>e)}function gt(){let{isMobile:e}=h(),{data:n}=ce(),{data:a}=q(),c=ie(),l=ne(),u=ue(),[d,f]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)([]),[S,C]=(0,Y.useState)(``),w=(0,Y.useMemo)(()=>mt(Object.values(n?.providers??{}),b),[n?.providers,b]),D=(0,Y.useMemo)(()=>a?.providerTemplates??[],[a?.providerTemplates]),O=(0,Y.useMemo)(()=>ht(D),[D]),j=(0,Y.useMemo)(()=>new Map(D.map(e=>[e.providerType,e])),[D]),M=(0,Y.useMemo)(()=>{let e=S.trim().toLowerCase();return w.filter(t=>{if(!e)return!0;let n=t.providerType?j.get(t.providerType):null;return(t.displayName?.trim()||n?.displayName||t.providerId).toLowerCase().includes(e)||t.providerId.toLowerCase().includes(e)})},[w,S,j]),N=(0,Y.useMemo)(()=>d&&M.some(e=>e.providerId===d)?d:e?null:M[0]?.providerId??null,[M,e,d]);return!n||!a?(0,$.jsx)(r,{title:F(`providersPageTitle`),description:F(`providersPageDescription`),layout:`split`,children:(0,$.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:F(`providersLoading`)})}):(0,$.jsxs)(r,{title:F(`providersPageTitle`),description:F(`providersPageDescription`),layout:`split`,children:[(0,$.jsxs)(fe,{className:`md:min-h-0`,compactView:d?`detail`:`list`,onMobileBack:()=>f(null),mobileListLabel:F(`providersPageTitle`),children:[(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{className:`space-y-3 px-4 pb-3 pt-4`,children:(0,$.jsxs)(H,{open:v,onOpenChange:y,children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsxs)(o,{type:`button`,variant:`outline`,className:`w-full justify-center`,disabled:c.isPending,children:[(0,$.jsx)(k,{className:`mr-2 h-4 w-4`}),c.isPending?F(`saving`):F(`providerAdd`)]})}),(0,$.jsxs)(z,{className:`w-[42rem] max-w-[calc(100vw-2rem)] p-3`,align:`start`,children:[(0,$.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold text-muted-foreground`,children:F(`providerTemplatePickerTitle`)}),(0,$.jsxs)(`div`,{className:`grid max-h-[24rem] grid-cols-2 gap-2 overflow-y-auto sm:grid-cols-3`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-left transition-colors hover:border-border hover:bg-muted/45`,onClick:async()=>{try{let e=await c.mutateAsync({data:{providerType:null}});C(``),f(e.providerId),x(t=>[e.providerId,...t.filter(t=>t!==e.providerId)]),y(!1)}catch{}},children:[(0,$.jsx)(U,{name:`custom`,className:`h-8 w-8 rounded-lg border border-border/60 bg-muted/50`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:F(`providerAddCustom`)})]}),O.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full flex-col items-start gap-2 rounded-lg border border-border/55 bg-muted/15 px-3 py-2 text-left transition-colors hover:border-border/80 hover:bg-muted/40`,onClick:async()=>{try{let t=await c.mutateAsync({data:{providerType:e.providerType}});C(``),f(t.providerId),x(e=>[t.providerId,...e.filter(e=>e!==t.providerId)]),y(!1)}catch{}},children:[(0,$.jsx)(U,{name:e.providerType,src:e.logo?`/logos/${e.logo}`:null,className:`h-8 w-8 rounded-lg border border-border/55 bg-background`,imgClassName:`h-4 w-4 object-contain`}),(0,$.jsx)(`span`,{className:`line-clamp-2 min-w-0 text-xs font-semibold leading-4 text-foreground`,children:e.displayName||e.providerType})]},e.providerType))]})]})]})}),(0,$.jsx)(`div`,{className:`border-b border-border/70 px-4 py-3`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(m,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,$.jsx)(t,{value:S,onChange:e=>C(e.target.value),placeholder:F(`providersFilterPlaceholder`),className:`h-10 rounded-xl pl-9`})]})}),(0,$.jsxs)(_e,{className:`space-y-2 p-3`,children:[M.map(e=>{let t=e.providerType?j.get(e.providerType):null,n=e.enabled!==!1,r=I(e),a=e.displayName?.trim()||t?.displayName||e.providerId,o=pt(e.apiBase||t?.defaultApiBase||``)||F(`providersDefaultDescription`);return(0,$.jsx)(`div`,{onClick:()=>f(e.providerId),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e.providerId))},role:`button`,tabIndex:0,className:s(`group w-full rounded-xl p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,N===e.providerId?`bg-background/95 text-foreground shadow-sm`:`bg-transparent text-muted-foreground hover:bg-background/65 hover:text-foreground`),children:(0,$.jsxs)(`div`,{className:`relative min-h-10`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 pr-20`,children:[(0,$.jsx)(U,{name:e.providerType??e.providerId,src:t?.logo?`/logos/${t.logo}`:null,className:`h-10 w-10 rounded-lg bg-background/80`,imgClassName:`h-5 w-5 object-contain`,fallback:(0,$.jsx)(`span`,{className:`text-sm font-semibold uppercase text-muted-foreground`,children:e.providerId[0]})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:a}),(0,$.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground/65`,children:e.providerId}),(0,$.jsxs)(`p`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:[o,` · `,e.models?.length??0]})]})]}),(0,$.jsxs)(`div`,{className:`absolute right-0 top-0 flex items-center gap-1.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,$.jsx)(i,{checked:n,disabled:u.isPending,title:F(n?`disabled`:`enabled`),className:`h-[18px] w-8`,thumbClassName:`h-4 w-4 data-[state=checked]:translate-x-4`,onCheckedChange:t=>{u.mutateAsync({provider:e.providerId,data:{enabled:t},silentSuccess:!0})}})}),(0,$.jsxs)(H,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground/70 hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),title:F(`more`),children:(0,$.jsx)(T,{className:`h-4 w-4`})})}),(0,$.jsx)(z,{className:`w-40 p-1`,align:`end`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm text-red-600 hover:bg-red-50`,onClick:()=>_(e.providerId),children:[(0,$.jsx)(A,{className:`h-4 w-4`}),F(`providerDelete`)]})})]})]}),(0,$.jsx)(W,{status:n?r?`ready`:`setup`:`inactive`,label:F(n?r?`statusReady`:`statusSetup`:`disabled`),className:`absolute bottom-0 right-0 justify-end`})]})},e.providerId)}),M.length===0?(0,$.jsx)(me,{icon:p,title:F(`providersNoMatch`)}):null]})]}),(0,$.jsx)(dt,{providerName:N??void 0,onProviderDeleted:e=>{x(t=>t.filter(t=>t!==e)),e===N&&f(null)}})]}),(0,$.jsx)(E,{open:!!g,onOpenChange:e=>{e||_(null)},title:F(`providerDelete`),description:g??void 0,confirmLabel:F(`delete`),variant:`destructive`,onCancel:()=>_(null),onConfirm:()=>{g&&l.mutateAsync({provider:g}).then(()=>{x(e=>e.filter(e=>e!==g)),g===N&&f(null),_(null)})}})]})}export{gt as ProvidersConfigPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D7hvIHV-.js";var t=e(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),n=e(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),r=e(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]);export{n,t as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Jn as e,Jt as t,Yt as n,_n as r,cr as i,pn as a,qt as o}from"./api-Cjq-o1VN.js";import{t as s}from"./createLucideIcon-D7hvIHV-.js";import{a as c,o as l}from"./theme-provider-hlle7Skk.js";import{t as u}from"./download-BYgECE0n.js";import{t as d}from"./x--xxUvHKW.js";import{s as f}from"./i18n-qBGEbcW6.js";var p=s(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),m=`nextclaw-pwa-install-banner-dismissed`,h=`nextclaw-pwa-install-banner-dismissed-until`;function g(){let e=y();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:b(e):!1}function _(){let e=y();e?.setItem(m,`1`),e?.removeItem(h)}function v(){let e=y();e?.removeItem(m),e?.removeItem(h)}function y(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function b(e){let t=e.getItem(h);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(h),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(m,`1`),!0)}function x(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:g()}}var S=a(()=>x()),C=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),S.setState(x())},this.refreshState=()=>{let e=this.resolveInstallability();S.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:g()}))},this.dismissInstallPrompt=()=>{_(),S.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let t=this.resolveInstallability();if(t.installability!==`available`)return`unavailable`;if(t.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let n=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,n.outcome===`accepted`?(v(),this.refreshState(),e.success(f(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,v(),S.setState({dismissedInstallPrompt:!0}),e.success(f(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}},w=i();function T(){let e=S(e=>e.installability);return(0,w.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:E(e)})}function E(e){return f(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function D(e,t,n){return f(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function O(){let e=S(e=>e.installability),r=S(e=>e.installMethod),i=S(e=>e.blockedReason);return(0,w.jsx)(t,{title:f(`pwaInstallTitle`),description:f(`pwaInstallDescription`),actions:(0,w.jsx)(T,{}),children:(0,w.jsx)(o,{children:(0,w.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:D(e,r,i)}),e===`available`&&r===`prompt`?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,className:`gap-2`,onClick:()=>void C.promptInstall(),children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f(`pwaInstallPromptHint`)})]}):null,e===`available`&&r===`manual`?(0,w.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,w.jsx)(p,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:f(`pwaInstallManualHint`)})]}):null]})})})}function k(){let e=S(e=>e.installability),t=S(e=>e.installMethod),r=S(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||r?null:(0,w.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:f(`pwaInstallBannerTitle`)}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:f(`pwaInstallBannerDescription`)})]}),(0,w.jsx)(`button`,{type:`button`,"aria-label":f(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{C.dismissInstallPrompt()},children:(0,w.jsx)(d,{className:`h-4 w-4`})})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,w.jsxs)(n,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{C.promptInstall()},children:[(0,w.jsx)(u,{className:`h-4 w-4`}),f(`pwaInstallAction`)]}),(0,w.jsx)(n,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{C.dismissInstallPrompt()},children:f(`pwaInstallDismiss`)})]})]})}var A=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},j=!1;function M(){j||typeof window>`u`||(j=!0,C.start(),A.start())}var N={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,island:`#FBF8ED`,probe:`#FEFCF6`},P=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=N[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=c(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(l(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}};export{O as i,M as n,k as r,P as t};
|
package/dist/assets/{quadrantDiagram-ABIIQ3AL-7-OzMNpF.js → quadrantDiagram-ABIIQ3AL-EY8hpFv8.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-Dy1ufvjf.js";import{m as t,p as n}from"./src-C8AUg09O.js";import{D as r,H as i,K as a,U as o,a as s,c,f as l,v as u,w as d,x as f,y as p,z as m}from"./chunk-WYO6CB5R-DEuS6N1R.js";import{t as h}from"./linear-ChlwuS5y.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[1,7],s=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],c=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],p=[1,38],m=[1,35],h=[1,43],g=[1,41],_=[1,45],v=[1,14],y=[1,23],b=[1,18],x=[1,19],S=[1,20],C=[1,21],w=[1,22],T=[1,24],E=[1,25],D=[1,26],O=[1,27],k=[1,28],A=[1,29],j=[1,32],M=[1,33],N=[1,34],P=[1,39],F=[1,40],I=[1,42],L=[1,44],R=[1,63],z=[1,62],B=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],ee=[1,66],te=[1,67],ne=[1,68],re=[1,69],ie=[1,70],ae=[1,71],oe=[1,72],se=[1,73],ce=[1,74],le=[1,75],ue=[1,76],de=[1,77],V=[4,5,6,7,8,9,10,11,12,13,14,15,18],H=[1,91],U=[1,92],W=[1,93],G=[1,100],K=[1,94],q=[1,97],J=[1,95],Y=[1,96],X=[1,98],Z=[1,99],fe=[1,103],pe=[10,55,56,57],Q=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],me={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:`error`,4:`ALPHA`,5:`NUM`,6:`NODE_STRING`,7:`DOWN`,8:`MINUS`,9:`DEFAULT`,10:`COMMA`,11:`COLON`,12:`AMP`,13:`BRKT`,14:`MULT`,15:`UNICODE_TEXT`,17:`UNIT`,18:`SPACE`,19:`STYLE`,20:`PCT`,25:`CLASSDEF`,28:`QUADRANT`,35:`title`,36:`title_value`,37:`acc_title`,38:`acc_title_value`,39:`acc_descr`,40:`acc_descr_value`,41:`acc_descr_multiline_value`,42:`section`,44:`point_start`,45:`point_x`,46:`point_y`,47:`class_name`,48:`X-AXIS`,49:`AXIS-TEXT-DELIMITER`,50:`Y-AXIS`,51:`QUADRANT_1`,52:`QUADRANT_2`,53:`QUADRANT_3`,54:`QUADRANT_4`,55:`NEWLINE`,56:`SEMI`,57:`EOF`,60:`STR`,61:`MD_STR`,63:`PUNCTUATION`,64:`PLUS`,65:`EQUALS`,66:`DOT`,67:`UNDERSCORE`},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 23:this.$=a[s];break;case 24:this.$=a[s-1]+``+a[s];break;case 26:this.$=a[s-1]+a[s];break;case 27:this.$=[a[s].trim()];break;case 28:a[s-2].push(a[s].trim()),this.$=a[s-2];break;case 29:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 37:this.$=[];break;case 42:this.$=a[s].trim(),r.setDiagramTitle(this.$);break;case 43:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 44:case 45:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 46:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 47:r.addPoint(a[s-3],``,a[s-1],a[s],[]);break;case 48:r.addPoint(a[s-4],a[s-3],a[s-1],a[s],[]);break;case 49:r.addPoint(a[s-4],``,a[s-2],a[s-1],a[s]);break;case 50:r.addPoint(a[s-5],a[s-4],a[s-2],a[s-1],a[s]);break;case 51:r.setXAxisLeftText(a[s-2]),r.setXAxisRightText(a[s]);break;case 52:a[s-1].text+=` ⟶ `,r.setXAxisLeftText(a[s-1]);break;case 53:r.setXAxisLeftText(a[s]);break;case 54:r.setYAxisBottomText(a[s-2]),r.setYAxisTopText(a[s]);break;case 55:a[s-1].text+=` ⟶ `,r.setYAxisBottomText(a[s-1]);break;case 56:r.setYAxisBottomText(a[s]);break;case 57:r.setQuadrant1Text(a[s]);break;case 58:r.setQuadrant2Text(a[s]);break;case 59:r.setQuadrant3Text(a[s]);break;case 60:r.setQuadrant4Text(a[s]);break;case 64:this.$={text:a[s],type:`text`};break;case 65:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 66:this.$={text:a[s],type:`text`};break;case 67:this.$={text:a[s],type:`markdown`};break;case 68:this.$=a[s];break;case 69:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[{18:n,26:1,27:2,28:r,55:i,56:a,57:o},{1:[3]},{18:n,26:8,27:2,28:r,55:i,56:a,57:o},{18:n,26:9,27:2,28:r,55:i,56:a,57:o},t(s,[2,33],{29:10}),t(c,[2,61]),t(c,[2,62]),t(c,[2,63]),{1:[2,30]},{1:[2,31]},t(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(s,[2,34]),{27:46,55:i,56:a,57:o},t(l,[2,37]),t(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:p,12:m,13:h,14:g,15:_,18:v,25:y,35:b,37:x,39:S,41:C,42:w,48:T,50:E,51:D,52:O,53:k,54:A,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,39]),t(l,[2,40]),t(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(l,[2,45]),t(l,[2,46]),{18:[1,51]},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:52,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:53,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:54,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:55,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:56,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,10:p,12:m,13:h,14:g,15:_,43:57,58:31,60:j,61:M,63:N,64:P,65:F,66:I,67:L},{4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,44:[1,58],47:[1,59],58:61,59:60,63:N,64:P,65:F,66:I,67:L},t(B,[2,64]),t(B,[2,66]),t(B,[2,67]),t(B,[2,70]),t(B,[2,71]),t(B,[2,72]),t(B,[2,73]),t(B,[2,74]),t(B,[2,75]),t(B,[2,76]),t(B,[2,77]),t(B,[2,78]),t(B,[2,79]),t(B,[2,80]),t(B,[2,81]),t(s,[2,35]),t(l,[2,38]),t(l,[2,42]),t(l,[2,43]),t(l,[2,44]),{3:65,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,21:64},t(l,[2,53],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,78],63:N,64:P,65:F,66:I,67:L}),t(l,[2,56],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,49:[1,79],63:N,64:P,65:F,66:I,67:L}),t(l,[2,57],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,58],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,59],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,60],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),{45:[1,80]},{44:[1,81]},t(B,[2,65]),t(B,[2,82]),t(B,[2,83]),t(B,[2,84]),{3:83,4:ee,5:te,6:ne,7:re,8:ie,9:ae,10:oe,11:se,12:ce,13:le,14:ue,15:de,18:[1,82]},t(V,[2,23]),t(V,[2,1]),t(V,[2,2]),t(V,[2,3]),t(V,[2,4]),t(V,[2,5]),t(V,[2,6]),t(V,[2,7]),t(V,[2,8]),t(V,[2,9]),t(V,[2,10]),t(V,[2,11]),t(V,[2,12]),t(l,[2,52],{58:31,43:84,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),t(l,[2,55],{58:31,43:85,4:d,5:f,10:p,12:m,13:h,14:g,15:_,60:j,61:M,63:N,64:P,65:F,66:I,67:L}),{46:[1,86]},{45:[1,87]},{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:89,23:88},t(V,[2,24]),t(l,[2,51],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,54],{59:60,58:61,4:d,5:f,8:R,10:p,12:m,13:h,14:g,15:_,18:z,63:N,64:P,65:F,66:I,67:L}),t(l,[2,47],{22:89,16:90,23:101,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{46:[1,102]},t(l,[2,29],{10:fe}),t(pe,[2,27],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),t(Q,[2,25]),t(Q,[2,13]),t(Q,[2,14]),t(Q,[2,15]),t(Q,[2,16]),t(Q,[2,17]),t(Q,[2,18]),t(Q,[2,19]),t(Q,[2,20]),t(Q,[2,21]),t(Q,[2,22]),t(l,[2,49],{10:fe}),t(l,[2,48],{22:89,16:90,23:105,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z}),{4:H,5:U,6:W,8:G,11:K,13:q,16:90,17:J,18:Y,19:X,20:Z,22:106},t(Q,[2,26]),t(l,[2,50],{10:fe}),t(pe,[2,28],{16:104,4:H,5:U,6:W,8:G,11:K,13:q,17:J,18:Y,19:X,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};me.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cx-8EJ4_.js";import{n as e}from"./chunk-QBLGF6JB-CsFeIGfr.js";export{e as createRadarServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cx-8EJ4_.js";import{n as e}from"./chunk-5TONJI2A-Cft82fp8.js";export{e as createRailroadServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cx-8EJ4_.js";import{n as e}from"./chunk-5HE753X5-BsEsmIao.js";export{e as createRailroadAbnfServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cx-8EJ4_.js";import{n as e}from"./chunk-U6XO7XAA-BVYkauHz.js";export{e as createRailroadEbnfServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cx-8EJ4_.js";import{n as e}from"./chunk-JG7HCLWE-CMUn5Elc.js";export{e as createRailroadPegServices};
|
package/dist/assets/{railroadDiagram-RFXS5EU6-B_UVtLJO.js → railroadDiagram-RFXS5EU6-CNhcIeji.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-5TONJI2A-
|
|
1
|
+
import{n as e}from"./chunk-5TONJI2A-Cft82fp8.js";import{n as t}from"./chunk-Y2CYZVJY-Dy1ufvjf.js";import{m as n}from"./src-C8AUg09O.js";import"./chunk-WYO6CB5R-DEuS6N1R.js";import"./chunk-VAUOI2AC-BrbiIC1Q.js";import{n as r,r as i,t as a}from"./chunk-MOJQB5TN-umcrg5Bi.js";import{t as o}from"./chunk-JWPE2WC7-Cra3s-Uk.js";import{t as s}from"./mermaid-parser.core-CuRe1ZG4.js";var c=e().Railroad.parser.LangiumParser,l=t(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(u(e)))},`populateDb`),f={parser:{parse:t(e=>{a.clear(),n.debug(`[Railroad Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[Railroad Parser] Parsed rules:`,r.rules.length),d(r),n.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{f as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D7hvIHV-.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./app-presenter-provider-C02YPoMr.js";export{e as RemoteAccessPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./chunk-Y2CYZVJY-JQfgEV36.js";import{m as n}from"./src-Bc0PoUJ1.js";import{H as r,K as i,U as a,a as o,b as s,v as c,w as l,x as u,y as d}from"./chunk-WYO6CB5R-DLqMXfFC.js";import{g as f}from"./chunk-ICXQ74PX-BFOKMkWV.js";import"./chunk-HOUHSVGY-BE_XNgGk.js";import"./chunk-Q4XR5HBZ-B-kzUbwT.js";import"./chunk-7BUUIJ7U-Du3Ozi62.js";import"./chunk-OGEWGWER-TuI7SR7i.js";import{t as p}from"./chunk-XXDRQBXY-BToo1uqb.js";import{t as m}from"./chunk-VR4S4FIN-DX6lXnNx.js";import"./chunk-C7G6YPKG-BSjZ86D0.js";import"./chunk-ZGVPDNZ5-BleImZKe.js";import"./chunk-52WLFC77-ClPpG-2S.js";import{r as h,t as g}from"./chunk-FWX5IMBZ-DecJDW4r.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s];break}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
1
|
+
import{n as e,t}from"./chunk-Y2CYZVJY-Dy1ufvjf.js";import{m as n}from"./src-C8AUg09O.js";import{H as r,K as i,U as a,a as o,b as s,v as c,w as l,x as u,y as d}from"./chunk-WYO6CB5R-DEuS6N1R.js";import{g as f}from"./chunk-ICXQ74PX-sQLMURqL.js";import"./chunk-HOUHSVGY-kx_slvu3.js";import"./chunk-Q4XR5HBZ-DTK-rtW6.js";import"./chunk-7BUUIJ7U-A5SBEMYY.js";import"./chunk-OGEWGWER-BXx5pQjU.js";import{t as p}from"./chunk-XXDRQBXY-Cx9N40wF.js";import{t as m}from"./chunk-VR4S4FIN-7RoZQffO.js";import"./chunk-C7G6YPKG-DRJEy8ZI.js";import"./chunk-ZGVPDNZ5-IYgN9f5A.js";import"./chunk-52WLFC77-Costxzr3.js";import{r as h,t as g}from"./chunk-FWX5IMBZ-n_2_CLTQ.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s];break}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D7hvIHV-.js";var t=e(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,Jn as n,Jt as r,Kt as i,Qt as a,Ut as o,Yt as s,cn as c,cr as l,fn as u,mn as d,qt as f,un as p,yr as m}from"./api-D9e9cHtW.js";import{At as h,B as g,Pt as _,X as v,z as y}from"./app-presenter-provider-J9IgTbc9.js";import{a as b,i as x,n as S,r as C,t as w}from"./select-Bq-UmfCK.js";import{t as T}from"./loader-circle-B-4WwzBj.js";import{n as E,t as D}from"./trash-2-BDdqDh6E.js";import{t as O}from"./rotate-cw-Ci2dcTO5.js";import{t as k}from"./save-Cr895abt.js";import{i as A}from"./pwa-BgGM4kkY.js";import{s as j}from"./i18n-BjPkAKMQ.js";import{b as M,t as ee}from"./use-config-Bxx7DdaL.js";import{t as N}from"./form-actions-DDQk0END.js";var P=e(m(),1),F=l(),I={healthy:`runtimeControlHealthy`,"starting-service":`runtimeControlStartingService`,"restarting-service":`runtimeControlRestartingService`,"stopping-service":`runtimeControlStoppingService`,"restarting-app":`runtimeControlRestartingApp`,recovering:`runtimeControlRecovering`,failed:`runtimeControlFailed`},L={running:`runtimeControlServiceRunning`,stopped:`runtimeControlServiceStopped`,starting:`runtimeControlServiceStarting`,stopping:`runtimeControlServiceStopping`,restarting:`runtimeControlServiceRestarting`},R={"desktop-embedded":`runtimeControlEnvironmentDesktop`,"managed-local-service":`runtimeControlEnvironmentManagedService`,"self-hosted-web":`runtimeControlEnvironmentSelfHosted`,"shared-web":`runtimeControlEnvironmentSharedWeb`};function z(e){return j(I[e]??`runtimeControlUnavailable`)}function B(e){return j(L[e]??`runtimeControlServiceUnknown`)}function V(e){return j(R[e.environment])}function H(e,t){return t===`start-service`?e?.canStartService:t===`stop-service`?e?.canStopService:e?.canRestartService}function U(e){return e?[{action:`start-service`,capability:e.canStartService,label:j(`runtimeControlStartService`),icon:`play`},{action:`restart-service`,capability:e.canRestartService,label:j(`runtimeControlRestartService`),icon:`rotate`},{action:`stop-service`,capability:e.canStopService,label:j(`runtimeControlStopService`),icon:`square`,variant:`destructive`},{action:`restart-app`,capability:e.canRestartApp,label:j(`runtimeControlRestartApp`),icon:`rotate`,variant:`secondary`}].filter(e=>e.capability.available||!!e.capability.reasonIfUnavailable):[]}function W(e){let{busy:t,icon:n}=e;return t?(0,F.jsx)(T,{className:`mr-2 h-4 w-4 animate-spin`}):n===`play`?(0,F.jsx)(_,{className:`mr-2 h-4 w-4`}):n===`square`?(0,F.jsx)(h,{className:`mr-2 h-4 w-4`}):(0,F.jsx)(O,{className:`mr-2 h-4 w-4`})}function G(){let{busy:e,busyAction:t,controlView:i,errorMessage:a,pendingRestart:o,visibleLifecycle:l,visibleMessage:p,visibleServiceState:m}=c(),h=U(i??void 0),g=async e=>{let t=H(i,e);if(!t?.available){n.error(d(t?.reasonIfUnavailable)??j(`runtimeControlLoadFailed`));return}if(!(e===`stop-service`&&t.requiresConfirmation&&!window.confirm(j(`runtimeControlStopServiceConfirm`))))try{let t=await u.runRuntimeControlAction(e);n.success(d(t.message)??t.message)}catch(e){let t=e instanceof Error?e.message:j(`runtimeControlActionFailed`);n.error(`${j(`runtimeControlActionFailed`)}: ${t}`)}},_=async()=>{if(!i?.canRestartApp.available){n.error(d(i?.canRestartApp.reasonIfUnavailable)??j(`runtimeRestartAppUnavailable`));return}if(window.confirm(j(`runtimeControlRestartAppConfirm`)))try{let e=await u.runRuntimeControlAction(`restart-app`);n.success(d(e.message)??e.message)}catch(e){let t=e instanceof Error?e.message:j(`runtimeControlActionFailed`);n.error(`${j(`runtimeControlActionFailed`)}: ${t}`)}};return(0,F.jsx)(r,{title:j(`runtimeControlTitle`),description:j(`runtimeControlDescription`),children:(0,F.jsxs)(f,{children:[(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-center md:justify-between`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:B(m)}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i?V(i):j(`runtimeControlLoading`)})]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:z(l)}),i?.managementHint?(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(i.managementHint)}):null,a&&!e?(0,F.jsx)(`p`,{className:`text-sm text-amber-700`,children:a}):null]}),o?(0,F.jsxs)(`div`,{className:`space-y-3 bg-amber-50/75 p-4 dark:bg-amber-950/20`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-amber-900`,children:j(`runtimeControlPendingRestartTitle`)}),(0,F.jsx)(`p`,{className:`text-sm text-amber-800`,children:j(`runtimeControlPendingRestartDescription`)}),o.changedPaths.length>0?(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-amber-700`,children:j(`runtimeControlPendingRestartPaths`)}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.changedPaths.map(e=>(0,F.jsx)(`span`,{className:`rounded-full bg-background/80 px-2.5 py-1 text-xs text-amber-800 dark:text-amber-300`,children:e},e))})]}):null]}):null,(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:flex-wrap`,children:h.map(n=>(0,F.jsxs)(s,{type:`button`,variant:n.variant??`default`,onClick:()=>{if(n.action===`restart-app`){_();return}g(n.action)},disabled:!n.capability.available||e,children:[(0,F.jsx)(W,{icon:n.icon,busy:t===n.action}),n.label]},n.action))}),h.filter(e=>!e.capability.available&&e.capability.reasonIfUnavailable).map(e=>(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(e.capability.reasonIfUnavailable)},`${e.action}-reason`))]})]})})}function K(e){let{description:t,title:n}=e;return(0,F.jsx)(v,{tone:`neutral`,title:n,description:t})}function q(e){let{children:t}=e;return(0,F.jsx)(r,{title:j(`runtimePresenceTitle`),description:j(`runtimePresenceDescription`),children:(0,F.jsx)(f,{children:t})})}function J(){let e=p().runtimeControlView?.environment,t=g(e=>e.supported),n=g(e=>e.initialized),r=g(e=>e.busyAction),a=g(e=>e.snapshot);return(0,P.useEffect)(()=>{if(e===`desktop-embedded`){y.start();return}y.markUnsupported()},[e]),e===`desktop-embedded`?(0,F.jsxs)(q,{children:[(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(v,{tone:`neutral`,title:j(`runtimePresenceBehaviorLabel`),description:a?.closeToBackground?j(`runtimePresenceBehaviorBackground`):j(`runtimePresenceBehaviorQuit`),className:`rounded-xl`})}),!n||t&&!a?(0,F.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:j(`runtimePresenceLoading`)}):null,a?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(i,{title:j(`runtimePresenceCloseToBackground`),description:j(`runtimePresenceCloseToBackgroundHelp`),control:(0,F.jsx)(o,{id:`runtime-presence-close-background`,"aria-label":j(`runtimePresenceCloseToBackground`),checked:a.closeToBackground,disabled:r===`saving-preferences`,onCheckedChange:e=>{y.updatePreferences({closeToBackground:e})}})}),(0,F.jsx)(i,{title:j(`runtimePresenceLaunchAtLogin`),description:a.supportsLaunchAtLogin?j(`runtimePresenceLaunchAtLoginHelp`):a.launchAtLoginReason??j(`runtimePresenceLaunchAtLoginUnavailable`),control:(0,F.jsx)(o,{id:`runtime-presence-launch-login`,"aria-label":j(`runtimePresenceLaunchAtLogin`),checked:a.launchAtLogin,disabled:!a.supportsLaunchAtLogin||r===`saving-preferences`,onCheckedChange:e=>{y.updatePreferences({launchAtLogin:e})}})})]}):null]}):e===`managed-local-service`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceManagedLocalTitle`),description:j(`runtimePresenceManagedLocalDescription`)})})}):e===`self-hosted-web`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceSelfHostedTitle`),description:j(`runtimePresenceSelfHostedDescription`)})})}):e===`shared-web`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceSharedTitle`),description:j(`runtimePresenceSharedDescription`)})})}):(0,F.jsx)(q,{children:(0,F.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:j(`runtimePresenceLoading`)})})}function te(){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{}),(0,F.jsx)(J,{}),(0,F.jsx)(A,{})]})}var Y={wireDialect:`acp`,processScope:`per-session`,command:``,args:[`acp`],env:{},cwd:``,startupTimeoutMs:8e3,probeTimeoutMs:3e3,requestTimeoutMs:12e4};function X(){return{id:``,default:!1,workspace:``,model:``,runtime:``,contextTokens:void 0}}function Z(){return{agentId:``,match:{channel:``,accountId:``}}}function Q(){return{id:``,enabled:!0,label:``,type:`narp-stdio`,config:Y,configText:JSON.stringify(Y,null,2)}}function ne(e){return{id:e.id??``,default:!!e.default,displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,workspace:e.workspace??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:e.contextTokens}}function re(e){return{agentId:e.agentId??``,match:{channel:e.match?.channel??``,accountId:e.match?.accountId??``,peer:e.match?.peer?{kind:e.match.peer.kind,id:e.match.peer.id}:void 0}}}function ie(e){let t=e.trim();if(!t)return;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function ae(e){return{companionEnabled:e.companion?.enabled===!0,agents:(e.agents.list??[]).map(ne),bindings:(e.bindings??[]).map(re),runtimeEntries:Object.entries(e.agents.runtimes?.entries??{}).map(([e,t])=>({id:e,enabled:t.enabled!==!1,label:t.label??``,type:t.type,config:t.config??{},configText:JSON.stringify(t.config??{},null,2)})),dmScope:e.session?.dmScope??`per-channel-peer`,defaultContextTokens:e.agents.defaults.contextTokens??2e5,defaultEngine:e.agents.defaults.engine??`native`}}function oe(e){let t={id:e.id.trim()};e.default&&(t.default=!0),e.displayName?.trim()&&(t.displayName=e.displayName.trim()),e.description?.trim()&&(t.description=e.description.trim()),e.avatar?.trim()&&(t.avatar=e.avatar.trim()),e.workspace?.trim()&&(t.workspace=e.workspace.trim()),e.model?.trim()&&(t.model=e.model.trim());let n=e.runtime?.trim()??e.engine?.trim();return n&&(t.engine=n),typeof e.contextTokens==`number`&&(t.contextTokens=Math.max(1e3,e.contextTokens)),t}function $(e){let t=e.agents.map((e,t)=>{if(!e.id.trim())throw Error(j(`agentIdRequiredError`).replace(`{index}`,String(t)));return oe(e)}),n=t.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)!==t);if(n.length>0)throw Error(`${j(`duplicateAgentId`)}: ${n[0]}`);let r=e.bindings.map((t,n)=>{let r=t.agentId.trim(),i=t.match.channel.trim(),a=t.match.accountId?.trim()??``,o=t.match.peer?.kind,s=t.match.peer?.id?.trim()??``;if(!r)throw Error(j(`bindingAgentIdRequired`).replace(`{index}`,String(n)));if(!e.knownAgentIds.has(r))throw Error(`${j(`bindingAgentIdNotFound`).replace(`{index}`,String(n))}: ${r}`);if(!i)throw Error(j(`bindingChannelRequired`).replace(`{index}`,String(n)));let c={agentId:r,match:{channel:i}};if(a&&(c.match.accountId=a),o){if(!s)throw Error(j(`bindingPeerIdRequired`).replace(`{index}`,String(n)));c.match.peer={kind:o,id:s}}return c}),i=e.runtimeEntries.reduce((e,t,n)=>{let r=t.id.trim(),i=t.type.trim();if(!r)throw Error(j(`runtimeEntryIdRequired`).replace(`{index}`,String(n)));if(!i)throw Error(j(`runtimeEntryTypeRequired`).replace(`{id}`,r));if(e[r])throw Error(`${j(`runtimeEntryDuplicate`)}: ${r}`);let a=t.configText.trim()?JSON.parse(t.configText):{};if(a&&(typeof a!=`object`||Array.isArray(a)))throw Error(j(`runtimeEntryConfigObjectRequired`).replace(`{id}`,r));return e[r]={enabled:t.enabled!==!1,...t.label?.trim()?{label:t.label.trim()}:{},type:i,config:a??{}},e},{});return{companion:{enabled:e.companionEnabled},agents:{defaults:{contextTokens:Math.max(1e3,e.defaultContextTokens),engine:e.defaultEngine.trim()||`native`},list:t,runtimes:{entries:i}},bindings:r,session:{dmScope:e.dmScope}}}function se({agents:e,onAddAgent:n,onRemoveAgent:i,onSetDefaultAgent:a,onUpdateAgent:c}){return(0,F.jsx)(r,{title:j(`agentList`),description:j(`agentListHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addAgent`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,F.jsx)(t,{value:e.id,onChange:e=>c(n,{id:e.target.value}),placeholder:j(`agentIdPlaceholder`)}),(0,F.jsx)(t,{value:e.workspace??``,onChange:e=>c(n,{workspace:e.target.value}),placeholder:j(`workspaceOverridePlaceholder`)}),(0,F.jsx)(t,{value:e.model??``,onChange:e=>c(n,{model:e.target.value}),placeholder:j(`modelOverridePlaceholder`)}),(0,F.jsx)(t,{value:e.runtime??e.engine??``,onChange:e=>c(n,{runtime:e.target.value}),placeholder:j(`engineOverridePlaceholder`)}),(0,F.jsx)(t,{type:`number`,min:1e3,step:1e3,value:e.contextTokens??``,onChange:e=>c(n,{contextTokens:ie(e.target.value)}),placeholder:j(`contextTokensPlaceholder`)})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(o,{checked:!!e.default,onCheckedChange:e=>a(n,e)}),(0,F.jsx)(`span`,{children:j(`defaultAgent`)})]}),(0,F.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`h-4 w-4 mr-1`}),j(`remove`)]})]})]},`${n}-${e.id}`))})})}function ce({bindings:e,onAddBinding:n,onRemoveBinding:i,onUpdateBinding:a}){return(0,F.jsx)(r,{title:j(`bindings`),description:j(`bindingsHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addBinding`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>{let r=e.match.peer?.kind??``;return(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,F.jsx)(t,{value:e.agentId,onChange:t=>a(n,{...e,agentId:t.target.value}),placeholder:j(`targetAgentIdPlaceholder`)}),(0,F.jsx)(t,{value:e.match.channel,onChange:t=>a(n,{...e,match:{...e.match,channel:t.target.value}}),placeholder:j(`channelPlaceholder`)}),(0,F.jsx)(t,{value:e.match.accountId??``,onChange:t=>a(n,{...e,match:{...e.match,accountId:t.target.value}}),placeholder:j(`accountIdOptionalPlaceholder`)}),(0,F.jsxs)(w,{value:r||`__none__`,onValueChange:t=>{let r=t===`__none__`?``:t;a(n,r?{...e,match:{...e.match,peer:{kind:r,id:e.match.peer?.id??``}}}:{...e,match:{...e.match,peer:void 0}})},children:[(0,F.jsx)(x,{children:(0,F.jsx)(b,{})}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{value:`__none__`,children:j(`peerKindOptional`)}),(0,F.jsx)(C,{value:`direct`,children:j(`peerKindDirect`)}),(0,F.jsx)(C,{value:`group`,children:j(`peerKindGroup`)}),(0,F.jsx)(C,{value:`channel`,children:j(`peerKindChannel`)})]})]}),(0,F.jsx)(t,{value:e.match.peer?.id??``,onChange:t=>a(n,{...e,match:{...e.match,peer:r?{kind:r,id:t.target.value}:void 0}}),placeholder:j(`peerIdPlaceholder`)})]}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`h-4 w-4 mr-1`}),j(`remove`)]})})]},`${n}-${e.agentId}`)})})})}function le({entries:e,onAddEntry:n,onRemoveEntry:i,onUpdateEntry:a}){return(0,F.jsx)(r,{title:j(`runtimeEntries`),description:j(`runtimeEntriesHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addRuntimeEntry`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,F.jsx)(t,{value:e.id,onChange:e=>a(n,{id:e.target.value}),placeholder:j(`runtimeEntryIdPlaceholder`)}),(0,F.jsx)(t,{value:e.label??``,onChange:e=>a(n,{label:e.target.value}),placeholder:j(`runtimeEntryLabelPlaceholder`)}),(0,F.jsx)(t,{value:e.type,onChange:e=>a(n,{type:e.target.value}),placeholder:j(`runtimeEntryTypePlaceholder`)}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-background/65 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-sm text-foreground`,children:j(`enabled`)}),(0,F.jsx)(o,{checked:e.enabled!==!1,onCheckedChange:e=>a(n,{enabled:e})})]})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`label`,{className:`text-sm font-medium text-foreground`,children:j(`runtimeEntryConfigJson`)}),(0,F.jsx)(`textarea`,{className:`min-h-32 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm`,value:e.configText,onChange:e=>a(n,{configText:e.target.value}),spellCheck:!1})]}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsxs)(s,{type:`button`,variant:`outline`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`mr-2 h-4 w-4`}),j(`delete`)]})})]},`${n}-${e.id||`runtime-entry`}`))})})}var ue=[{value:`main`,labelKey:`dmScopeMain`},{value:`per-peer`,labelKey:`dmScopePerPeer`},{value:`per-channel-peer`,labelKey:`dmScopePerChannelPeer`},{value:`per-account-channel-peer`,labelKey:`dmScopePerAccountChannelPeer`}];function de({companionEnabled:e,defaultContextTokens:n,defaultEngine:a,dmScope:s,onCompanionEnabledChange:c,onDefaultContextTokensChange:l,onDefaultEngineChange:u,onDmScopeChange:d}){return(0,F.jsx)(r,{title:j(`dmScope`),description:j(`dmScopeHelp`),children:(0,F.jsxs)(f,{children:[(0,F.jsx)(i,{title:j(`runtimeCompanionEnabled`),description:j(`runtimeCompanionEnabledHelp`),control:(0,F.jsx)(o,{checked:e,onCheckedChange:c})}),(0,F.jsx)(i,{title:j(`defaultContextTokens`),description:j(`defaultContextTokensHelp`),control:(0,F.jsx)(t,{type:`number`,min:1e3,step:1e3,value:n,onChange:e=>l(Math.max(1e3,Number.parseInt(e.target.value,10)||1e3)),className:`w-36`})}),(0,F.jsx)(i,{title:j(`defaultEngine`),description:j(`defaultEngineHelp`),control:(0,F.jsx)(t,{value:a,onChange:e=>u(e.target.value),placeholder:j(`defaultEnginePlaceholder`),className:`w-56`})}),(0,F.jsx)(i,{title:j(`dmScope`),control:(0,F.jsxs)(w,{value:s,onValueChange:e=>d(e),children:[(0,F.jsx)(x,{className:`w-56`,children:(0,F.jsx)(b,{})}),(0,F.jsx)(S,{children:ue.map(e=>(0,F.jsx)(C,{value:e.value,children:j(e.labelKey)},e.value))})]})})]})})}function fe({config:e,updateRuntime:t}){let r=(0,P.useMemo)(()=>ae(e),[e]),[i,o]=(0,P.useState)(r.agents),[c,l]=(0,P.useState)(r.bindings),[u,d]=(0,P.useState)(r.runtimeEntries),[f,p]=(0,P.useState)(r.dmScope),[m,h]=(0,P.useState)(r.companionEnabled),[g,_]=(0,P.useState)(r.defaultContextTokens),[v,y]=(0,P.useState)(r.defaultEngine),b=(0,P.useMemo)(()=>{let e=new Set([`main`]);return i.forEach(t=>{let n=t.id.trim();n&&e.add(n)}),e},[i]);return(0,F.jsxs)(a,{title:j(`runtimePageTitle`),description:j(`runtimePageDescription`),children:[(0,F.jsx)(te,{}),(0,F.jsx)(de,{companionEnabled:m,dmScope:f,defaultContextTokens:g,defaultEngine:v,onCompanionEnabledChange:h,onDmScopeChange:p,onDefaultContextTokensChange:_,onDefaultEngineChange:y}),(0,F.jsx)(le,{entries:u,onUpdateEntry:(e,t)=>d(n=>n.map((n,r)=>r===e?{...n,...t}:n)),onRemoveEntry:e=>d(t=>t.filter((t,n)=>n!==e)),onAddEntry:()=>d(e=>[...e,Q()])}),(0,F.jsx)(se,{agents:i,onUpdateAgent:(e,t)=>{o(n=>n.map((n,r)=>r===e?{...n,...t}:n))},onRemoveAgent:e=>o(t=>t.filter((t,n)=>n!==e)),onAddAgent:()=>o(e=>[...e,X()]),onSetDefaultAgent:(e,t)=>o(n=>t?n.map((t,n)=>({...t,default:n===e})):n.map((t,n)=>n===e?{...t,default:!1}:t))}),(0,F.jsx)(ce,{bindings:c,onUpdateBinding:(e,t)=>{l(n=>n.map((n,r)=>r===e?t:n))},onRemoveBinding:e=>l(t=>t.filter((t,n)=>n!==e)),onAddBinding:()=>l(e=>[...e,Z()])}),(0,F.jsx)(N,{children:(0,F.jsxs)(s,{type:`button`,size:`sm`,onClick:()=>{try{let e=$({companionEnabled:m,agents:i,bindings:c,runtimeEntries:u,dmScope:f,defaultContextTokens:g,defaultEngine:v,knownAgentIds:b});t.mutate({data:e})}catch(e){n.error(e instanceof Error?e.message:String(e))}},disabled:t.isPending,children:[(0,F.jsx)(k,{className:`mr-1.5 h-3.5 w-3.5`}),t.isPending?j(`saving`):j(`saveRuntimeSettings`)]})})]})}function pe(){let{data:e,isLoading:t}=ee(),n=M();return t||!e?(0,F.jsx)(a,{title:j(`runtimePageTitle`),description:j(`runtimePageDescription`),children:(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:j(`runtimeLoading`)})}):(0,F.jsx)(fe,{config:e,updateRuntime:n})}export{pe as RuntimeConfig};
|
|
1
|
+
import{i as e}from"./chunk-DF37yw5_.js";import{Gt as t,Jn as n,Jt as r,Kt as i,Qt as a,Ut as o,Yt as s,cn as c,cr as l,fn as u,mn as d,qt as f,un as p,yr as m}from"./api-Cjq-o1VN.js";import{J as h,L as g,Mt as _,Ot as v,R as y}from"./app-presenter-provider-C02YPoMr.js";import{a as b,i as x,n as S,r as C,t as w}from"./select-CctTN205.js";import{t as T}from"./loader-circle-BA7EMkih.js";import{n as E,t as D}from"./trash-2-C5KH5Rw9.js";import{t as O}from"./rotate-cw-CNE9qSHi.js";import{t as k}from"./save-B0p5a0ET.js";import{i as A}from"./pwa-CiGUjpcd.js";import{s as j}from"./i18n-qBGEbcW6.js";import{b as M,t as ee}from"./use-config-CPl_F79t.js";import{t as N}from"./form-actions-CLGWO52v.js";var P=e(m(),1),F=l(),I={healthy:`runtimeControlHealthy`,"starting-service":`runtimeControlStartingService`,"restarting-service":`runtimeControlRestartingService`,"stopping-service":`runtimeControlStoppingService`,"restarting-app":`runtimeControlRestartingApp`,recovering:`runtimeControlRecovering`,failed:`runtimeControlFailed`},L={running:`runtimeControlServiceRunning`,stopped:`runtimeControlServiceStopped`,starting:`runtimeControlServiceStarting`,stopping:`runtimeControlServiceStopping`,restarting:`runtimeControlServiceRestarting`},R={"desktop-embedded":`runtimeControlEnvironmentDesktop`,"managed-local-service":`runtimeControlEnvironmentManagedService`,"self-hosted-web":`runtimeControlEnvironmentSelfHosted`,"shared-web":`runtimeControlEnvironmentSharedWeb`};function z(e){return j(I[e]??`runtimeControlUnavailable`)}function B(e){return j(L[e]??`runtimeControlServiceUnknown`)}function V(e){return j(R[e.environment])}function H(e,t){return t===`start-service`?e?.canStartService:t===`stop-service`?e?.canStopService:e?.canRestartService}function U(e){return e?[{action:`start-service`,capability:e.canStartService,label:j(`runtimeControlStartService`),icon:`play`},{action:`restart-service`,capability:e.canRestartService,label:j(`runtimeControlRestartService`),icon:`rotate`},{action:`stop-service`,capability:e.canStopService,label:j(`runtimeControlStopService`),icon:`square`,variant:`destructive`},{action:`restart-app`,capability:e.canRestartApp,label:j(`runtimeControlRestartApp`),icon:`rotate`,variant:`secondary`}].filter(e=>e.capability.available||!!e.capability.reasonIfUnavailable):[]}function W(e){let{busy:t,icon:n}=e;return t?(0,F.jsx)(T,{className:`mr-2 h-4 w-4 animate-spin`}):n===`play`?(0,F.jsx)(_,{className:`mr-2 h-4 w-4`}):n===`square`?(0,F.jsx)(v,{className:`mr-2 h-4 w-4`}):(0,F.jsx)(O,{className:`mr-2 h-4 w-4`})}function G(){let{busy:e,busyAction:t,controlView:i,errorMessage:a,pendingRestart:o,visibleLifecycle:l,visibleMessage:p,visibleServiceState:m}=c(),h=U(i??void 0),g=async e=>{let t=H(i,e);if(!t?.available){n.error(d(t?.reasonIfUnavailable)??j(`runtimeControlLoadFailed`));return}if(!(e===`stop-service`&&t.requiresConfirmation&&!window.confirm(j(`runtimeControlStopServiceConfirm`))))try{let t=await u.runRuntimeControlAction(e);n.success(d(t.message)??t.message)}catch(e){let t=e instanceof Error?e.message:j(`runtimeControlActionFailed`);n.error(`${j(`runtimeControlActionFailed`)}: ${t}`)}},_=async()=>{if(!i?.canRestartApp.available){n.error(d(i?.canRestartApp.reasonIfUnavailable)??j(`runtimeRestartAppUnavailable`));return}if(window.confirm(j(`runtimeControlRestartAppConfirm`)))try{let e=await u.runRuntimeControlAction(`restart-app`);n.success(d(e.message)??e.message)}catch(e){let t=e instanceof Error?e.message:j(`runtimeControlActionFailed`);n.error(`${j(`runtimeControlActionFailed`)}: ${t}`)}};return(0,F.jsx)(r,{title:j(`runtimeControlTitle`),description:j(`runtimeControlDescription`),children:(0,F.jsxs)(f,{children:[(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-center md:justify-between`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:B(m)}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i?V(i):j(`runtimeControlLoading`)})]}),(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:p}),(0,F.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:z(l)}),i?.managementHint?(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(i.managementHint)}):null,a&&!e?(0,F.jsx)(`p`,{className:`text-sm text-amber-700`,children:a}):null]}),o?(0,F.jsxs)(`div`,{className:`space-y-3 bg-amber-50/75 p-4 dark:bg-amber-950/20`,children:[(0,F.jsx)(`div`,{className:`text-sm font-medium text-amber-900`,children:j(`runtimeControlPendingRestartTitle`)}),(0,F.jsx)(`p`,{className:`text-sm text-amber-800`,children:j(`runtimeControlPendingRestartDescription`)}),o.changedPaths.length>0?(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`div`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-amber-700`,children:j(`runtimeControlPendingRestartPaths`)}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o.changedPaths.map(e=>(0,F.jsx)(`span`,{className:`rounded-full bg-background/80 px-2.5 py-1 text-xs text-amber-800 dark:text-amber-300`,children:e},e))})]}):null]}):null,(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsx)(`div`,{className:`flex flex-col gap-3 md:flex-row md:flex-wrap`,children:h.map(n=>(0,F.jsxs)(s,{type:`button`,variant:n.variant??`default`,onClick:()=>{if(n.action===`restart-app`){_();return}g(n.action)},disabled:!n.capability.available||e,children:[(0,F.jsx)(W,{icon:n.icon,busy:t===n.action}),n.label]},n.action))}),h.filter(e=>!e.capability.available&&e.capability.reasonIfUnavailable).map(e=>(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(e.capability.reasonIfUnavailable)},`${e.action}-reason`))]})]})})}function K(e){let{description:t,title:n}=e;return(0,F.jsx)(h,{tone:`neutral`,title:n,description:t})}function q(e){let{children:t}=e;return(0,F.jsx)(r,{title:j(`runtimePresenceTitle`),description:j(`runtimePresenceDescription`),children:(0,F.jsx)(f,{children:t})})}function J(){let e=p().runtimeControlView?.environment,t=y(e=>e.supported),n=y(e=>e.initialized),r=y(e=>e.busyAction),a=y(e=>e.snapshot);return(0,P.useEffect)(()=>{if(e===`desktop-embedded`){g.start();return}g.markUnsupported()},[e]),e===`desktop-embedded`?(0,F.jsxs)(q,{children:[(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(h,{tone:`neutral`,title:j(`runtimePresenceBehaviorLabel`),description:a?.closeToBackground?j(`runtimePresenceBehaviorBackground`):j(`runtimePresenceBehaviorQuit`),className:`rounded-xl`})}),!n||t&&!a?(0,F.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:j(`runtimePresenceLoading`)}):null,a?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(i,{title:j(`runtimePresenceCloseToBackground`),description:j(`runtimePresenceCloseToBackgroundHelp`),control:(0,F.jsx)(o,{id:`runtime-presence-close-background`,"aria-label":j(`runtimePresenceCloseToBackground`),checked:a.closeToBackground,disabled:r===`saving-preferences`,onCheckedChange:e=>{g.updatePreferences({closeToBackground:e})}})}),(0,F.jsx)(i,{title:j(`runtimePresenceLaunchAtLogin`),description:a.supportsLaunchAtLogin?j(`runtimePresenceLaunchAtLoginHelp`):a.launchAtLoginReason??j(`runtimePresenceLaunchAtLoginUnavailable`),control:(0,F.jsx)(o,{id:`runtime-presence-launch-login`,"aria-label":j(`runtimePresenceLaunchAtLogin`),checked:a.launchAtLogin,disabled:!a.supportsLaunchAtLogin||r===`saving-preferences`,onCheckedChange:e=>{g.updatePreferences({launchAtLogin:e})}})})]}):null]}):e===`managed-local-service`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceManagedLocalTitle`),description:j(`runtimePresenceManagedLocalDescription`)})})}):e===`self-hosted-web`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceSelfHostedTitle`),description:j(`runtimePresenceSelfHostedDescription`)})})}):e===`shared-web`?(0,F.jsx)(q,{children:(0,F.jsx)(`div`,{className:`p-4`,children:(0,F.jsx)(K,{title:j(`runtimePresenceSharedTitle`),description:j(`runtimePresenceSharedDescription`)})})}):(0,F.jsx)(q,{children:(0,F.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:j(`runtimePresenceLoading`)})})}function te(){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{}),(0,F.jsx)(J,{}),(0,F.jsx)(A,{})]})}var Y={wireDialect:`acp`,processScope:`per-session`,command:``,args:[`acp`],env:{},cwd:``,startupTimeoutMs:8e3,probeTimeoutMs:3e3,requestTimeoutMs:12e4};function X(){return{id:``,default:!1,workspace:``,model:``,runtime:``,contextTokens:void 0}}function Z(){return{agentId:``,match:{channel:``,accountId:``}}}function Q(){return{id:``,enabled:!0,label:``,type:`narp-stdio`,config:Y,configText:JSON.stringify(Y,null,2)}}function ne(e){return{id:e.id??``,default:!!e.default,displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,workspace:e.workspace??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:e.contextTokens}}function re(e){return{agentId:e.agentId??``,match:{channel:e.match?.channel??``,accountId:e.match?.accountId??``,peer:e.match?.peer?{kind:e.match.peer.kind,id:e.match.peer.id}:void 0}}}function ie(e){let t=e.trim();if(!t)return;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function ae(e){return{companionEnabled:e.companion?.enabled===!0,agents:(e.agents.list??[]).map(ne),bindings:(e.bindings??[]).map(re),runtimeEntries:Object.entries(e.agents.runtimes?.entries??{}).map(([e,t])=>({id:e,enabled:t.enabled!==!1,label:t.label??``,type:t.type,config:t.config??{},configText:JSON.stringify(t.config??{},null,2)})),dmScope:e.session?.dmScope??`per-channel-peer`,defaultContextTokens:e.agents.defaults.contextTokens??2e5,defaultEngine:e.agents.defaults.engine??`native`}}function oe(e){let t={id:e.id.trim()};e.default&&(t.default=!0),e.displayName?.trim()&&(t.displayName=e.displayName.trim()),e.description?.trim()&&(t.description=e.description.trim()),e.avatar?.trim()&&(t.avatar=e.avatar.trim()),e.workspace?.trim()&&(t.workspace=e.workspace.trim()),e.model?.trim()&&(t.model=e.model.trim());let n=e.runtime?.trim()??e.engine?.trim();return n&&(t.engine=n),typeof e.contextTokens==`number`&&(t.contextTokens=Math.max(1e3,e.contextTokens)),t}function $(e){let t=e.agents.map((e,t)=>{if(!e.id.trim())throw Error(j(`agentIdRequiredError`).replace(`{index}`,String(t)));return oe(e)}),n=t.map(e=>e.id).filter((e,t,n)=>n.indexOf(e)!==t);if(n.length>0)throw Error(`${j(`duplicateAgentId`)}: ${n[0]}`);let r=e.bindings.map((t,n)=>{let r=t.agentId.trim(),i=t.match.channel.trim(),a=t.match.accountId?.trim()??``,o=t.match.peer?.kind,s=t.match.peer?.id?.trim()??``;if(!r)throw Error(j(`bindingAgentIdRequired`).replace(`{index}`,String(n)));if(!e.knownAgentIds.has(r))throw Error(`${j(`bindingAgentIdNotFound`).replace(`{index}`,String(n))}: ${r}`);if(!i)throw Error(j(`bindingChannelRequired`).replace(`{index}`,String(n)));let c={agentId:r,match:{channel:i}};if(a&&(c.match.accountId=a),o){if(!s)throw Error(j(`bindingPeerIdRequired`).replace(`{index}`,String(n)));c.match.peer={kind:o,id:s}}return c}),i=e.runtimeEntries.reduce((e,t,n)=>{let r=t.id.trim(),i=t.type.trim();if(!r)throw Error(j(`runtimeEntryIdRequired`).replace(`{index}`,String(n)));if(!i)throw Error(j(`runtimeEntryTypeRequired`).replace(`{id}`,r));if(e[r])throw Error(`${j(`runtimeEntryDuplicate`)}: ${r}`);let a=t.configText.trim()?JSON.parse(t.configText):{};if(a&&(typeof a!=`object`||Array.isArray(a)))throw Error(j(`runtimeEntryConfigObjectRequired`).replace(`{id}`,r));return e[r]={enabled:t.enabled!==!1,...t.label?.trim()?{label:t.label.trim()}:{},type:i,config:a??{}},e},{});return{companion:{enabled:e.companionEnabled},agents:{defaults:{contextTokens:Math.max(1e3,e.defaultContextTokens),engine:e.defaultEngine.trim()||`native`},list:t,runtimes:{entries:i}},bindings:r,session:{dmScope:e.dmScope}}}function se({agents:e,onAddAgent:n,onRemoveAgent:i,onSetDefaultAgent:a,onUpdateAgent:c}){return(0,F.jsx)(r,{title:j(`agentList`),description:j(`agentListHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addAgent`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,F.jsx)(t,{value:e.id,onChange:e=>c(n,{id:e.target.value}),placeholder:j(`agentIdPlaceholder`)}),(0,F.jsx)(t,{value:e.workspace??``,onChange:e=>c(n,{workspace:e.target.value}),placeholder:j(`workspaceOverridePlaceholder`)}),(0,F.jsx)(t,{value:e.model??``,onChange:e=>c(n,{model:e.target.value}),placeholder:j(`modelOverridePlaceholder`)}),(0,F.jsx)(t,{value:e.runtime??e.engine??``,onChange:e=>c(n,{runtime:e.target.value}),placeholder:j(`engineOverridePlaceholder`)}),(0,F.jsx)(t,{type:`number`,min:1e3,step:1e3,value:e.contextTokens??``,onChange:e=>c(n,{contextTokens:ie(e.target.value)}),placeholder:j(`contextTokensPlaceholder`)})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,F.jsx)(o,{checked:!!e.default,onCheckedChange:e=>a(n,e)}),(0,F.jsx)(`span`,{children:j(`defaultAgent`)})]}),(0,F.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`h-4 w-4 mr-1`}),j(`remove`)]})]})]},`${n}-${e.id}`))})})}function ce({bindings:e,onAddBinding:n,onRemoveBinding:i,onUpdateBinding:a}){return(0,F.jsx)(r,{title:j(`bindings`),description:j(`bindingsHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addBinding`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>{let r=e.match.peer?.kind??``;return(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:[(0,F.jsx)(t,{value:e.agentId,onChange:t=>a(n,{...e,agentId:t.target.value}),placeholder:j(`targetAgentIdPlaceholder`)}),(0,F.jsx)(t,{value:e.match.channel,onChange:t=>a(n,{...e,match:{...e.match,channel:t.target.value}}),placeholder:j(`channelPlaceholder`)}),(0,F.jsx)(t,{value:e.match.accountId??``,onChange:t=>a(n,{...e,match:{...e.match,accountId:t.target.value}}),placeholder:j(`accountIdOptionalPlaceholder`)}),(0,F.jsxs)(w,{value:r||`__none__`,onValueChange:t=>{let r=t===`__none__`?``:t;a(n,r?{...e,match:{...e.match,peer:{kind:r,id:e.match.peer?.id??``}}}:{...e,match:{...e.match,peer:void 0}})},children:[(0,F.jsx)(x,{children:(0,F.jsx)(b,{})}),(0,F.jsxs)(S,{children:[(0,F.jsx)(C,{value:`__none__`,children:j(`peerKindOptional`)}),(0,F.jsx)(C,{value:`direct`,children:j(`peerKindDirect`)}),(0,F.jsx)(C,{value:`group`,children:j(`peerKindGroup`)}),(0,F.jsx)(C,{value:`channel`,children:j(`peerKindChannel`)})]})]}),(0,F.jsx)(t,{value:e.match.peer?.id??``,onChange:t=>a(n,{...e,match:{...e.match,peer:r?{kind:r,id:t.target.value}:void 0}}),placeholder:j(`peerIdPlaceholder`)})]}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`h-4 w-4 mr-1`}),j(`remove`)]})})]},`${n}-${e.agentId}`)})})})}function le({entries:e,onAddEntry:n,onRemoveEntry:i,onUpdateEntry:a}){return(0,F.jsx)(r,{title:j(`runtimeEntries`),description:j(`runtimeEntriesHelp`),actions:(0,F.jsxs)(s,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:[(0,F.jsx)(E,{className:`mr-2 h-4 w-4`}),j(`addRuntimeEntry`)]}),children:(0,F.jsx)(f,{children:e.map((e,n)=>(0,F.jsxs)(`div`,{className:`space-y-3 p-4`,children:[(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,F.jsx)(t,{value:e.id,onChange:e=>a(n,{id:e.target.value}),placeholder:j(`runtimeEntryIdPlaceholder`)}),(0,F.jsx)(t,{value:e.label??``,onChange:e=>a(n,{label:e.target.value}),placeholder:j(`runtimeEntryLabelPlaceholder`)}),(0,F.jsx)(t,{value:e.type,onChange:e=>a(n,{type:e.target.value}),placeholder:j(`runtimeEntryTypePlaceholder`)}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg bg-background/65 px-3 py-2`,children:[(0,F.jsx)(`span`,{className:`text-sm text-foreground`,children:j(`enabled`)}),(0,F.jsx)(o,{checked:e.enabled!==!1,onCheckedChange:e=>a(n,{enabled:e})})]})]}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsx)(`label`,{className:`text-sm font-medium text-foreground`,children:j(`runtimeEntryConfigJson`)}),(0,F.jsx)(`textarea`,{className:`min-h-32 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm`,value:e.configText,onChange:e=>a(n,{configText:e.target.value}),spellCheck:!1})]}),(0,F.jsx)(`div`,{className:`flex justify-end`,children:(0,F.jsxs)(s,{type:`button`,variant:`outline`,onClick:()=>i(n),children:[(0,F.jsx)(D,{className:`mr-2 h-4 w-4`}),j(`delete`)]})})]},`${n}-${e.id||`runtime-entry`}`))})})}var ue=[{value:`main`,labelKey:`dmScopeMain`},{value:`per-peer`,labelKey:`dmScopePerPeer`},{value:`per-channel-peer`,labelKey:`dmScopePerChannelPeer`},{value:`per-account-channel-peer`,labelKey:`dmScopePerAccountChannelPeer`}];function de({companionEnabled:e,defaultContextTokens:n,defaultEngine:a,dmScope:s,onCompanionEnabledChange:c,onDefaultContextTokensChange:l,onDefaultEngineChange:u,onDmScopeChange:d}){return(0,F.jsx)(r,{title:j(`dmScope`),description:j(`dmScopeHelp`),children:(0,F.jsxs)(f,{children:[(0,F.jsx)(i,{title:j(`runtimeCompanionEnabled`),description:j(`runtimeCompanionEnabledHelp`),control:(0,F.jsx)(o,{checked:e,onCheckedChange:c})}),(0,F.jsx)(i,{title:j(`defaultContextTokens`),description:j(`defaultContextTokensHelp`),control:(0,F.jsx)(t,{type:`number`,min:1e3,step:1e3,value:n,onChange:e=>l(Math.max(1e3,Number.parseInt(e.target.value,10)||1e3)),className:`w-36`})}),(0,F.jsx)(i,{title:j(`defaultEngine`),description:j(`defaultEngineHelp`),control:(0,F.jsx)(t,{value:a,onChange:e=>u(e.target.value),placeholder:j(`defaultEnginePlaceholder`),className:`w-56`})}),(0,F.jsx)(i,{title:j(`dmScope`),control:(0,F.jsxs)(w,{value:s,onValueChange:e=>d(e),children:[(0,F.jsx)(x,{className:`w-56`,children:(0,F.jsx)(b,{})}),(0,F.jsx)(S,{children:ue.map(e=>(0,F.jsx)(C,{value:e.value,children:j(e.labelKey)},e.value))})]})})]})})}function fe({config:e,updateRuntime:t}){let r=(0,P.useMemo)(()=>ae(e),[e]),[i,o]=(0,P.useState)(r.agents),[c,l]=(0,P.useState)(r.bindings),[u,d]=(0,P.useState)(r.runtimeEntries),[f,p]=(0,P.useState)(r.dmScope),[m,h]=(0,P.useState)(r.companionEnabled),[g,_]=(0,P.useState)(r.defaultContextTokens),[v,y]=(0,P.useState)(r.defaultEngine),b=(0,P.useMemo)(()=>{let e=new Set([`main`]);return i.forEach(t=>{let n=t.id.trim();n&&e.add(n)}),e},[i]);return(0,F.jsxs)(a,{title:j(`runtimePageTitle`),description:j(`runtimePageDescription`),children:[(0,F.jsx)(te,{}),(0,F.jsx)(de,{companionEnabled:m,dmScope:f,defaultContextTokens:g,defaultEngine:v,onCompanionEnabledChange:h,onDmScopeChange:p,onDefaultContextTokensChange:_,onDefaultEngineChange:y}),(0,F.jsx)(le,{entries:u,onUpdateEntry:(e,t)=>d(n=>n.map((n,r)=>r===e?{...n,...t}:n)),onRemoveEntry:e=>d(t=>t.filter((t,n)=>n!==e)),onAddEntry:()=>d(e=>[...e,Q()])}),(0,F.jsx)(se,{agents:i,onUpdateAgent:(e,t)=>{o(n=>n.map((n,r)=>r===e?{...n,...t}:n))},onRemoveAgent:e=>o(t=>t.filter((t,n)=>n!==e)),onAddAgent:()=>o(e=>[...e,X()]),onSetDefaultAgent:(e,t)=>o(n=>t?n.map((t,n)=>({...t,default:n===e})):n.map((t,n)=>n===e?{...t,default:!1}:t))}),(0,F.jsx)(ce,{bindings:c,onUpdateBinding:(e,t)=>{l(n=>n.map((n,r)=>r===e?t:n))},onRemoveBinding:e=>l(t=>t.filter((t,n)=>n!==e)),onAddBinding:()=>l(e=>[...e,Z()])}),(0,F.jsx)(N,{children:(0,F.jsxs)(s,{type:`button`,size:`sm`,onClick:()=>{try{let e=$({companionEnabled:m,agents:i,bindings:c,runtimeEntries:u,dmScope:f,defaultContextTokens:g,defaultEngine:v,knownAgentIds:b});t.mutate({data:e})}catch(e){n.error(e instanceof Error?e.message:String(e))}},disabled:t.isPending,children:[(0,F.jsx)(k,{className:`mr-1.5 h-3.5 w-3.5`}),t.isPending?j(`saving`):j(`saveRuntimeSettings`)]})})]})}function pe(){let{data:e,isLoading:t}=ee(),n=M();return t||!e?(0,F.jsx)(a,{title:j(`runtimePageTitle`),description:j(`runtimePageDescription`),children:(0,F.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:j(`runtimeLoading`)})}):(0,F.jsx)(fe,{config:e,updateRuntime:n})}export{pe as RuntimeConfig};
|