dorkos 0.131.0 → 0.133.0
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/dist/bin/cli.js +499 -314
- package/dist/browser/fresh-verifier.mjs +13 -13
- package/dist/browser/native/darwin-supervisor-worker.mjs +3 -3
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-BZ2LLJ0k.js → AboutPage-D-EHHVPa.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-BnqAwUiy.js → ActivityErrorState-BTHnE1vP.js} +1 -1
- package/dist/client/assets/{ActivityPage-BlZKrSVo.js → ActivityPage-BfSLPIdR.js} +1 -1
- package/dist/client/assets/{ActivityRow-Ch8HxQ2m.js → ActivityRow-PwUBjQw8.js} +1 -1
- package/dist/client/assets/{AdapterIcon-CfocFMw-.js → AdapterIcon-DgkNN6bi.js} +1 -1
- package/dist/client/assets/{AdapterSetupWizard-Dtjx1Oad.js → AdapterSetupWizard-DX0dzp7q.js} +2 -2
- package/dist/client/assets/{AgentOptionRow-BGRvUeF7.js → AgentOptionRow-ApuDEKqq.js} +1 -1
- package/dist/client/assets/{AgentPicker-BcURPZQp.js → AgentPicker-BDci-9aL.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-kNq5A_IN.js → AgentRequestCard-B2gxCMGi.js} +3 -3
- package/dist/client/assets/{AppearancePage-Cd-k7dcc.js → AppearancePage-8SVnFe0k.js} +1 -1
- package/dist/client/assets/ApplyToOverridesDialog-CnL1ubxL.js +1 -0
- package/dist/client/assets/{AttentionSignalRow-QY8AIjf9.js → AttentionSignalRow-CCKhUtil.js} +1 -1
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cgkvajbw.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js} +3 -3
- package/dist/client/assets/BindingDialog-C4BHVXno.js +1 -0
- package/dist/client/assets/{BlintzCanvas-CMzZnmWK.js → BlintzCanvas-7E5uwVms.js} +3 -3
- package/dist/client/assets/{CanvasCsvContent-uxMaHePf.js → CanvasCsvContent-l7lfyDGn.js} +4 -4
- package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +2 -0
- package/dist/client/assets/{ChannelComposer-BAg0a29Q.js → ChannelComposer-CAYvz_ZB.js} +12 -17
- package/dist/client/assets/{ChatAppsOff-DD28V0vX.js → ChatAppsOff-CNeKBVNz.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-CyoduBgM.js → CodeMirrorDiff-BZRcNFsS.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-DGccoZ8Q.js → CodeMirrorEditor-DD5tArRn.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Dk98shko.js → ComputerResourceView-BUmsVssG.js} +1 -1
- package/dist/client/assets/{ComputerViewer-Broprz4q.js → ComputerViewer-BKMR5LkF.js} +1 -1
- package/dist/client/assets/{ConnectionAccessLists-C_qLz8GJ.js → ConnectionAccessLists-DYUiFmPY.js} +1 -1
- package/dist/client/assets/{ConnectionsPage-CmGgGmDO.js → ConnectionsPage-DR2Kfm9Q.js} +2 -2
- package/dist/client/assets/{ConventionPage-BxWLIUUC.js → ConventionPage-Do6q8873.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-CyfIRaGs.js → ExtensionPageRoute-CP7NM7fw.js} +2 -2
- package/dist/client/assets/{FeatureDisabledState-By2dhVpu.js → FeatureDisabledState-Bi23k3rg.js} +1 -1
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-B6wKQpLR.js → FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-kDdpyBgA.js → ForwardConsentHost-DSR1pEEK.js} +1 -1
- package/dist/client/assets/HandlePage-aHId3bYX.js +1 -0
- package/dist/client/assets/HeartbeatPage-BTNVcHOI.js +1 -0
- package/dist/client/assets/{KeyEntry-Ctc1zp2J.js → KeyEntry-67acsEG2.js} +1 -1
- package/dist/client/assets/{LexicalField-7zd4B8f1.js → LexicalField-Cb68LIar.js} +2 -2
- package/dist/client/assets/{ManagesPage-BG1TIMP3.js → ManagesPage-ChPlBF42.js} +1 -1
- package/dist/client/assets/{Marketplace-C9r4jRJf.js → Marketplace-CzPhJEE1.js} +4 -4
- package/dist/client/assets/{MarketplaceSourcesView-C01Cdrge.js → MarketplaceSourcesView-CmQgxQmU.js} +1 -1
- package/dist/client/assets/{McpAppFrame-Dm7MqOhc.js → McpAppFrame-z5JUaCSA.js} +2 -2
- package/dist/client/assets/{McpSigninBody-CsXP_7lE.js → McpSigninBody-ZrnzwrOH.js} +1 -1
- package/dist/client/assets/{Model3dViewer-DOl8ZkrU.js → Model3dViewer-HJpWK-JI.js} +1 -1
- package/dist/client/assets/NamePage-C7F-SotG.js +1 -0
- package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js} +1 -1
- package/dist/client/assets/{NotificationsPage-UExs4YE2.js → NotificationsPage-DwNUI0Z3.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-Dx3M3wwS.js → OpenMeshSwitch-RNAZY1vn.js} +2 -2
- package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js} +1 -1
- package/dist/client/assets/PermissionHistory-D0chstxf.js +1 -0
- package/dist/client/assets/PermissionsPage-ToK0DZVV.js +1 -0
- package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.js} +1 -1
- package/dist/client/assets/PhotoPage-Cqo3PNO_.js +1 -0
- package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js} +1 -1
- package/dist/client/assets/{ProfileFields-DiarOK2y.js → ProfileFields-DU8dTGHT.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-BI6T4hj8.js → ProfileRolePicker-DrOtV-0N.js} +1 -1
- package/dist/client/assets/{PromptSuggestionChips-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js} +1 -1
- package/dist/client/assets/{ReportsToPopover-BALADuTO.js → ReportsToPopover-CwjpR1Tw.js} +1 -1
- package/dist/client/assets/{RoomSurface-BatV7gf5.js → RoomSurface-CChzNJKw.js} +1 -1
- package/dist/client/assets/{RoomsPage-DCCC3Dst.js → RoomsPage-Dbf6ijKr.js} +1 -1
- package/dist/client/assets/{RunsOnPopover-C7hMPyrb.js → RunsOnPopover-Bh5sSsSC.js} +1 -1
- package/dist/client/assets/{RuntimeConnectFlow-Dc5a8dlJ.js → RuntimeConnectFlow-BYQnY5vv.js} +1 -1
- package/dist/client/assets/{RuntimeSetupDialog-w90VGjJ4.js → RuntimeSetupDialog-DTO5v0dP.js} +1 -1
- package/dist/client/assets/{SeenDevices-BIMmbMWC.js → SeenDevices-cuY7ASEy.js} +3 -3
- package/dist/client/assets/{SessionsPage-0lwvSYHB.js → SessionsPage-BrqpVx-t.js} +1 -1
- package/dist/client/assets/{SettingsDialog-CrP6JzPg.js → SettingsDialog-DCAZX_1d.js} +4 -4
- package/dist/client/assets/{SkillsPage-BDgKWTfe.js → SkillsPage-D5who_ZH.js} +1 -1
- package/dist/client/assets/TaskDialogWrapper-BJ6XtOC5.js +1 -0
- package/dist/client/assets/TasksEmptyState-B3SjsxQa.js +3 -0
- package/dist/client/assets/{TasksPage-DjGbMGvn.js → TasksPage-B72w7J87.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-B_sM9Fik.js → TeamComputerEntry-B9ma5j-X.js} +1 -1
- package/dist/client/assets/TodoPromiseList-DDKWAfmv.js +1 -0
- package/dist/client/assets/TodoPromisesPage-BNXpvXzS.js +1 -0
- package/dist/client/assets/{ToolsPage-CeETRCd8.js → ToolsPage-DbJykCG3.js} +2 -2
- package/dist/client/assets/{TopologyGraph-CnpH2NjE.js → TopologyGraph-DKZS3nlr.js} +3 -3
- package/dist/client/assets/{TourHost-BQHrS47S.js → TourHost-Bw3Uoea5.js} +1 -1
- package/dist/client/assets/{UnlinkDialog-DOQLeNx4.js → UnlinkDialog-B-XCFNSd.js} +1 -1
- package/dist/client/assets/{UnreadDivider-DhyK6uGG.js → UnreadDivider-1aPVzwd7.js} +1 -1
- package/dist/client/assets/{WidgetErrorCard-Bwlfu514.js → WidgetErrorCard-C5ieVv_9.js} +6 -6
- package/dist/client/assets/{WithheldExtensionsNotice-BDc-CM2t.js → WithheldExtensionsNotice-CCO4ClRZ.js} +1 -1
- package/dist/client/assets/{WorkQueuePage-iO_DO1YK.js → WorkQueuePage-BbPKNwDg.js} +1 -1
- package/dist/client/assets/WorkView-BRcytACJ.js +51 -0
- package/dist/client/assets/_shell-EwFeSIGp.js +80 -0
- package/dist/client/assets/{_shell._home-BWi5YPaR.js → _shell._home-DD2mg-iK.js} +1 -1
- package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js} +1 -1
- package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +3 -0
- package/dist/client/assets/_shell._home.tasks-BtC85Iut.js +1 -0
- package/dist/client/assets/{_shell._home.workspaces-wbnqJ58w.js → _shell._home.workspaces-qMG5OJYR.js} +1 -1
- package/dist/client/assets/{_shell.channels-D1KdvWZF.js → _shell.channels-BE4EK-iM.js} +2 -2
- package/dist/client/assets/_shell.connections-CBx0ogzx.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DzHWC1fJ.js → _shell.feedback-requests-CwKSkkuD.js} +2 -2
- package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +1 -0
- package/dist/client/assets/_shell.session-D6HcVbnm.js +1 -0
- package/dist/client/assets/{_shell.team-BMNSUpQQ.js → _shell.team-Dm5a4f8_.js} +4 -4
- package/dist/client/assets/_shell.threads-BavVtQOE.js +1 -0
- package/dist/client/assets/_shell.todos-B6uWr0zA.js +6 -0
- package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-Co2k29JX.js → abnfDiagram-WEYOIA3C-Bu2T3jVw.js} +1 -1
- package/dist/client/assets/{access-copy-D6BUySpp.js → access-copy-tkiFMhRf.js} +1 -1
- package/dist/client/assets/{arc-DLZZpkuJ.js → arc-5q4SfXO9.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-ClS9xqK5.js → architectureDiagram-ZHVYKT53-BnDMOBhV.js} +1 -1
- package/dist/client/assets/{banner-B8iMuXCP.js → banner-CSKUrrI0.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DheoOELu.js → blockDiagram-RJAE7QA3-CtushlEs.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-VWWZJ5x4.js → c4Diagram-XDPPPE54-7L-qYwKH.js} +1 -1
- package/dist/client/assets/channel-A3XT7_2L.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-BqPLJVkv.js → chunk-2E7WHVMD-ksBVyqQ3.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-DZn6OnKe.js → chunk-2Q5K7J3B-Bfqdkihb.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-Dl9Poajp.js → chunk-4EMNKR2T-Brf2dH9x.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-RoKuZPUc.js → chunk-55XCU76K-BlE7Cq40.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-DV_1XHtU.js → chunk-5VM5RSS4-Bkgg3j7L.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-B_IuS45y.js → chunk-JWPE2WC7-B9TRpN4O.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-DkLNi45x.js → chunk-VQ5W62QI-ZoILnIYi.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-ISM-1Dpw.js → chunk-XXDRQBXY-r2xNhaKz.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-MKaLMW8o.js → chunk-ZCHMQSOR-DfV3cF7d.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CIWuu4ht.js → classDiagram-v2-4MYWR3UA-VOVqMNNP.js} +1 -1
- package/dist/client/assets/{command-CxGYZKco.js → command-CaUEAy3b.js} +1 -1
- package/dist/client/assets/{copy-button-DjAoGwds.js → copy-button-BOznikwM.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-HiCifRyi.js → cose-bilkent-JH36ORCC-CAdBvyLz.js} +1 -1
- package/dist/client/assets/{cpu-DHHTTvp_.js → cpu-j9vX9Wfk.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-DjJGZrPz.js → cynefin-EF2NZ3EQ-DcH1A9Oo.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-DE2NdiJ2.js → cynefinDiagram-WF24UDRP-DJuKBXHi.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-C6gDOD26.js → dagre-NK4GIZVX-D099H_0S.js} +1 -1
- package/dist/client/assets/{detail-row-CjwI1iuc.js → detail-row-Crl89jnh.js} +1 -1
- package/dist/client/assets/{diagram-CBK3MWTC-38LckcsL.js → diagram-CBK3MWTC-Cd_4W9XO.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D--8L6D9Ra.js → diagram-I5XIIV2D-Bc7aQKt3.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-DGC2Inhd.js → diagram-ODIL2UCW-awVJZ4Bg.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BDHp0AyR.js → diagram-PFBEJUXE-dhsj9aeU.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-uBatJYPi.js → diagram-RJA3I4VV-Dm59CbiV.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C8e1EH9X.js → diagram-TYUNFSNR-BhvcIjA9.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DimRzU5B.js → ebnfDiagram-V4P3TTPT-C4wT_MTC.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-Dz6_Y2-G.js → elk-QONTBCTQ-CPI0zjmW.js} +1 -1
- package/dist/client/assets/{empty-state-saV209Il.js → empty-state-BHcmkSzu.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-JeuTF8w6.js → erDiagram-KYQIGQAA-C_vGcbOB.js} +1 -1
- package/dist/client/assets/{execution-config-ClQZyDs9.js → execution-config-BS5rtvTZ.js} +1 -1
- package/dist/client/assets/{file-BIF-4ARS.js → file-CQGljfDT.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-DxadH2b-.js → file-exclamation-point-B0a55VME.js} +1 -1
- package/dist/client/assets/{file-text-C_NPIQr4.js → file-text-Cycq_S0e.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-CXai_zs0.js → find-latest-widget-fence-B6sJdG3Q.js} +4 -4
- package/dist/client/assets/{flowDiagram-IUGLLWBU-9FHDdK4j.js → flowDiagram-IUGLLWBU-_VNfmnxx.js} +1 -1
- package/dist/client/assets/{form-D3VdAYl4.js → form-BL14vwyB.js} +1 -1
- package/dist/client/assets/{format-cron-BqRDcFZM.js → format-cron-meJMgYNe.js} +1 -1
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CLMuXlHt.js → ganttDiagram-R7GPNTJY-o0gGU7X_.js} +1 -1
- package/dist/client/assets/{git-branch-Df7a5_fb.js → git-branch-CsLE6G0Y.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-sE7Rlpr6.js → gitGraphDiagram-PDYL7XHY-DjXjUpJo.js} +1 -1
- package/dist/client/assets/{graph-iNVyFhBQ.js → graph-BMYee_VK.js} +1 -1
- package/dist/client/assets/{heart-BHMhDZ0K.js → heart-Cn3a-UQI.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-VvvsrJbu.js → highlighted-body-KPVGNVTW-DsX5yCC0.js} +1 -1
- package/dist/client/assets/{image-lightbox-CGEIRguA.js → image-lightbox-BZ_eBZgA.js} +1 -1
- package/dist/client/assets/{image-off-C5-TmSq8.js → image-off-DjR7LI5G.js} +1 -1
- package/dist/client/assets/{index-C3zS0ghJ.js → index-1MwES_vb.js} +1 -1
- package/dist/client/assets/{index-ClyRhxV_.js → index-47--OGKJ.js} +1 -1
- package/dist/client/assets/{index-CTgUh4p3.js → index-4rSR8lau.js} +1 -1
- package/dist/client/assets/{index-D9bEy8X-.js → index-B4TxpTKD.js} +1 -1
- package/dist/client/assets/{index-Dw-4S640.js → index-B8LqLhq7.js} +1 -1
- package/dist/client/assets/index-BJRgbiEd.js +1 -0
- package/dist/client/assets/{index-DWZ5M321.js → index-BOCclWF3.js} +1 -1
- package/dist/client/assets/index-BR1m9FON.js +1066 -0
- package/dist/client/assets/index-BcFn_S6b.js +1 -0
- package/dist/client/assets/{index-DRtg_sGG.js → index-BcnwvTnt.js} +1 -1
- package/dist/client/assets/index-BdVQOlVQ.css +1 -0
- package/dist/client/assets/{index-DEvpdTo6.js → index-BmKHO-FD.js} +1 -1
- package/dist/client/assets/{index-Bd0PAkxf.js → index-BsZkXHsH.js} +1 -1
- package/dist/client/assets/{index-Cudi8rs6.js → index-BxWr8Mrf.js} +1 -1
- package/dist/client/assets/index-C5EvpXcq.js +1 -0
- package/dist/client/assets/{index-CExh9cKN.js → index-Cb_p_ynP.js} +1 -1
- package/dist/client/assets/{index-YZbu9tke.js → index-CczLBUKI.js} +1 -1
- package/dist/client/assets/{index-264YDu-W.js → index-Cf4Gtxf9.js} +1 -1
- package/dist/client/assets/{index-Dpu2CORc.js → index-CfKSlYjb.js} +1 -1
- package/dist/client/assets/{index-Bzm9YMbr.js → index-Cgjq7a-8.js} +1 -1
- package/dist/client/assets/{index-Ci_J5Q-6.js → index-CpWxcN5D.js} +1 -1
- package/dist/client/assets/{index-BK5QrGfQ.js → index-Cv67OXfk.js} +1 -1
- package/dist/client/assets/{index-Di-MIFQG.js → index-D5Qmx1JR.js} +3 -3
- package/dist/client/assets/{index-LPrq0pOA.js → index-DARchye_.js} +1 -1
- package/dist/client/assets/{index-DMwivStD.js → index-DFb4kOjm.js} +2 -2
- package/dist/client/assets/{index-WeLoaNzW.js → index-DLN0kcME.js} +1 -1
- package/dist/client/assets/{index-BMLCfTba.js → index-DMSSN08i.js} +1 -1
- package/dist/client/assets/{index-Y6BDhuGt.js → index-DQ8uADJF.js} +1 -1
- package/dist/client/assets/index-DZhMvc9m.js +1 -0
- package/dist/client/assets/{index-CLsoFUml.js → index-Dfko0tSp.js} +1 -1
- package/dist/client/assets/{index-BgdYXP8E.js → index-DiM3QX-4.js} +3 -3
- package/dist/client/assets/{index-BxFLHNLg.js → index-DlvUENo4.js} +1 -1
- package/dist/client/assets/{index-BLUUshO9.js → index-DqZmnJED.js} +1 -1
- package/dist/client/assets/{index-D_bAtIJZ.js → index-DrlB9RSk.js} +1 -1
- package/dist/client/assets/{index-CgWzzIbx.js → index-H4e5Wpmi.js} +1 -1
- package/dist/client/assets/{index-k67dvyau.js → index-Joav7LQU.js} +1 -1
- package/dist/client/assets/{index-B0FHRkHM.js → index-KganLhU1.js} +2 -2
- package/dist/client/assets/{index-DFkofTx1.js → index-Kt6r3DQg.js} +1 -1
- package/dist/client/assets/{index-B8I1k-z9.js → index-Z2ApBQt4.js} +1 -1
- package/dist/client/assets/index-dY7IFpet.js +1 -0
- package/dist/client/assets/{index-DYVNSRDk.js → index-faSyUc2q.js} +1 -1
- package/dist/client/assets/{index-BgRYuqWs.js → index-gmyiXkmr.js} +1 -1
- package/dist/client/assets/{index-BZTLFzJp.js → index-o6kGmVGx.js} +1 -1
- package/dist/client/assets/{index-C_0JoCV6.js → index-vHKVYcH7.js} +1 -1
- package/dist/client/assets/{index.esm-CYmalBux.js → index.esm-CJIDYBqd.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-0aR9wjgO.js → infoDiagram-MVDRKAX5-B1mMyUlp.js} +1 -1
- package/dist/client/assets/{inline-code-DyTKSC5b.js → inline-code-mh48Uhbi.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D1lN8x2t.js → ishikawaDiagram-HPEHV2GE-efEMQ0_X.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-CkXITXiJ.js → journeyDiagram-BOSHW7O7-DSAywiVk.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-ge33IiSq.js → kanban-definition-FNSA4HC5-B9pbU4zK.js} +1 -1
- package/dist/client/assets/{layers-Bx3K7OUm.js → layers-B0Z5Od3N.js} +1 -1
- package/dist/client/assets/{lightbulb-C5LvXkvM.js → lightbulb-Cfb5ecEd.js} +1 -1
- package/dist/client/assets/{link-2-Bj0_Zkvr.js → link-2-Dzy5BUL3.js} +1 -1
- package/dist/client/assets/{list-runtime-types-VNj1C8TB.js → list-runtime-types-DLmjtBMq.js} +1 -1
- package/dist/client/assets/{markdown-content-BRaPEOC7.js → markdown-content-DhAtZOfj.js} +1 -1
- package/dist/client/assets/{mention-pill-B_MiJWfo.js → mention-pill-DmA8FxL4.js} +1 -1
- package/dist/client/assets/{mermaid.core-B2hil_4a.js → mermaid.core-DUIkdbeL.js} +4 -4
- package/dist/client/assets/{message-square-off-T33FHpr7.js → message-square-off-BowIzJUV.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-Bu_Ia4Xz.js → mindmap-definition-6OY57UG3-Dz7ZOR4C.js} +1 -1
- package/dist/client/assets/{more-details-oDazWBxm.js → more-details-DV7LmY0E.js} +1 -1
- package/dist/client/assets/{owner-notice-VepbAQhj.js → owner-notice-DdFc2P8z.js} +1 -1
- package/dist/client/assets/{package-DBsl3ao5.js → package-BhKXbvU_.js} +1 -1
- package/dist/client/assets/{page-container-Bkarym6m.js → page-container-0sWZ3xh9.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-gBlb5k1v.js → pane-resize-handle-Bjy4udre.js} +1 -1
- package/dist/client/assets/{paperclip-BeFttiUK.js → paperclip-C-7LhBfl.js} +1 -1
- package/dist/client/assets/{path-input-NY_yCBHb.js → path-input-BPVyI72G.js} +1 -1
- package/dist/client/assets/{pegDiagram-ECIUJNBX-0KmJlW0E.js → pegDiagram-ECIUJNBX-C4EOP-Fa.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-IjeZXicv.js → pieDiagram-GNMPY74T-CQ1OxRkv.js} +1 -1
- package/dist/client/assets/{plug-CTqOZ7cA.js → plug-CIZ-wWL8.js} +1 -1
- package/dist/client/assets/{primer-trigger-CjaGrT2u.js → primer-trigger-XA5fLzR5.js} +2 -2
- package/dist/client/assets/{profile-errors-B8XkL2Rp.js → profile-errors-C1XACbc9.js} +1 -1
- package/dist/client/assets/{progress-Cr-4myw6.js → progress-BA2JPtb6.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-CP6kLJKa.js → quadrantDiagram-D57K4MC3-Cw4BdkpS.js} +1 -1
- package/dist/client/assets/{query-error-state-DvhY-YKM.js → query-error-state-Cm-Lozlb.js} +1 -1
- package/dist/client/assets/{radio-CmDmmJy6.js → radio-DQ29H26H.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bcto__oE.js → railroadDiagram-Y72NRBL7-CSKtYLmm.js} +1 -1
- package/dist/client/assets/registry-Tbt9pcZl.js +39 -0
- package/dist/client/assets/registry-jD9zw538.js +1 -0
- package/dist/client/assets/{relay-trace-schemas-ZLR1S8ft.js → relay-trace-schemas-4AAUf-Zl.js} +2 -2
- package/dist/client/assets/{repeat-DVTM8et8.js → repeat-B8g-x-Sc.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-DNJrds3m.js → requirementDiagram-EQYSW5RA-BPSBZr7X.js} +1 -1
- package/dist/client/assets/{room-files-source-9Wdtc-bG.js → room-files-source-BkiK4-ZI.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-qJSWqifh.js → rotate-ccw-clock-DRtL-2nr.js} +1 -1
- package/dist/client/assets/{rotate-cw-uoeBxIeM.js → rotate-cw-BbHkWN-J.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-DNlU7xGI.js → sankeyDiagram-SY24JHO5-DVlHablQ.js} +1 -1
- package/dist/client/assets/{scroll-area-B1d3NfEn.js → scroll-area-DAC7NrVU.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CRk71coF.js → sequenceDiagram-BLEHNHQU--wZkN8xk.js} +1 -1
- package/dist/client/assets/{shield-x-BpQmg1qz.js → shield-x-CEWfkzDN.js} +1 -1
- package/dist/client/assets/{signed-in-CTmJ3OqM.js → signed-in-CMhCR-m8.js} +1 -1
- package/dist/client/assets/{sizeCapture-INFHLROL-cihX3QNq.js → sizeCapture-INFHLROL-CLXc7d3S.js} +1 -1
- package/dist/client/assets/{soul-file-BwiyiI5v.js → soul-file-CbX7rNqz.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BAwwRsnH.js → stateDiagram-v2-A6IESKWZ-5xa1FM_X.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-CpDB6CUC.js → swimlanes-B3ENRKFQ-DKgxJxjE.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +8 -0
- package/dist/client/assets/{table-dWrfPeX-.js → table-D0EJT0uP.js} +1 -1
- package/dist/client/assets/{tabs-D4txthOi.js → tabs-Ctjzrm8t.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-RDrKgCoU.js → timeline-definition-JXYKGLGB-B9P7ituI.js} +1 -1
- package/dist/client/assets/trust-dial-D__tIhzt.js +11 -0
- package/dist/client/assets/{trust-posture-atZIh8tf.js → trust-posture-DaHHtOZn.js} +1 -1
- package/dist/client/assets/{unplug-CnevV4yX.js → unplug-B-ipHefz.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-BQwT36FA.js → unverified-catalog-notice-C8swqaTn.js} +1 -1
- package/dist/client/assets/{use-bindings-CltfjAWW.js → use-bindings-gLHRNAFU.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-D-Zlt6z2.js → use-composer-prefs-CjpxcBIe.js} +1 -1
- package/dist/client/assets/{use-connector-management-C3CLnOOt.js → use-connector-management-BLiCJMgU.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DQlz-scx.js → use-deep-link-scroll-r2nKjzA-.js} +1 -1
- package/dist/client/assets/{use-delete-binding-D73CLm_7.js → use-delete-binding-BSiOik_K.js} +1 -1
- package/dist/client/assets/{use-dev-links-BqVFsMKU.js → use-dev-links-DXcIlMf-.js} +1 -1
- package/dist/client/assets/use-direct-message-panel-BbH8N4mE.js +1 -0
- package/dist/client/assets/{use-external-adapter-catalog-DrnksH0t.js → use-external-adapter-catalog-mmKni5ui.js} +1 -1
- package/dist/client/assets/{use-filter-state-D4i-hDOk.js → use-filter-state-CiPZ0AIH.js} +2 -2
- package/dist/client/assets/{use-full-activity-feed-DdDsRg8s.js → use-full-activity-feed-DXroUzfN.js} +1 -1
- package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +1 -0
- package/dist/client/assets/{use-mesh-topology-B7aLtPkZ.js → use-mesh-topology-upehQ5Cv.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-DSSTCJfY.js → use-mounted-ref-IHwyriaF.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-DaF3kwmq.js → use-notification-prefs-BHOK2P2l.js} +1 -1
- package/dist/client/assets/use-pending-read-mVsOBTzn.js +1 -0
- package/dist/client/assets/{use-personality-commit-D5b90JPX.js → use-personality-commit-Chf3UX8P.js} +1 -1
- package/dist/client/assets/{use-promo-activation-CPAOQpfe.js → use-promo-activation-Dlw6bg7G.js} +2 -2
- package/dist/client/assets/{use-promo-dismissals-Bx1gz1R1.js → use-promo-dismissals-Dx_fli7I.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-DeulB37O.js → use-pulse-freshness-CG_I6a-O.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-Dwke6RFQ.js → use-room-follow-claim-Bgrpr3bO.js} +1 -1
- package/dist/client/assets/{use-room-sessions-iepVrIMm.js → use-room-sessions-DecGrP3E.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-pCPKNQKv.js → use-roving-tab-list-CDkh-Ujm.js} +1 -1
- package/dist/client/assets/{use-session-canvas-BvvO-_V1.js → use-session-canvas-tvLLPQcm.js} +6 -6
- package/dist/client/assets/{use-status-budget-Bs7MMriS.js → use-status-budget-BBl2yxLR.js} +2 -2
- package/dist/client/assets/{use-todos-C-eREuDS.js → use-todos-BzRauzdQ.js} +1 -1
- package/dist/client/assets/{use-transform-lj3TkjYO.js → use-transform-DzJeHpxm.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js} +1 -1
- package/dist/client/assets/use-update-config-DjL7-nUR.js +1 -0
- package/dist/client/assets/{useMutationState-B_x_4f2K.js → useMutationState-DIywUTDG.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DBsRYa4J.js → usecaseDiagram-WPOLBNNX-C9aLJ03F.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-bI0JZkO3.js → wardleyDiagram-IVAIDKWA-DvQDOaTm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-DZUd8iln.js → xychartDiagram-4URNHDU4-8FxLPP2c.js} +1 -1
- package/dist/client/assets/zap-DSllMMHe.js +6 -0
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261104060919_package_approval_request.sql +1 -0
- package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
- package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
- package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
- package/dist/drizzle/meta/20261104060919_snapshot.json +14889 -0
- package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
- package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
- package/dist/drizzle/meta/_journal.json +28 -0
- package/dist/server/index.js +24875 -21931
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ApplyToOverridesDialog-DE9VVQCA.js +0 -1
- package/dist/client/assets/BindingDialog-C_yflKOE.js +0 -1
- package/dist/client/assets/CanvasFileContent-C3ZKszxn.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-CsNUuaj6.js +0 -2
- package/dist/client/assets/CommitmentList-DOvfnyDA.js +0 -1
- package/dist/client/assets/CommitmentsPage-D81vxHUk.js +0 -1
- package/dist/client/assets/HandlePage-vsG04kBg.js +0 -1
- package/dist/client/assets/HeartbeatPage-CMj1SS30.js +0 -1
- package/dist/client/assets/NamePage-DdX2yQ5f.js +0 -1
- package/dist/client/assets/PermissionHistory-Bhl2kr1R.js +0 -1
- package/dist/client/assets/PermissionsPage-DUbenFkt.js +0 -1
- package/dist/client/assets/PhotoPage-CExABoHA.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-BVb8gAr0.js +0 -1
- package/dist/client/assets/TasksEmptyState-RkUEEU2r.js +0 -3
- package/dist/client/assets/WorkView-BDk_vwu3.js +0 -51
- package/dist/client/assets/_shell-CMNFxZKJ.js +0 -80
- package/dist/client/assets/_shell._home.index-BjR-d3_s.js +0 -3
- package/dist/client/assets/_shell._home.tasks-CqURPMQD.js +0 -1
- package/dist/client/assets/_shell.connections-D3gJrBTQ.js +0 -1
- package/dist/client/assets/_shell.marketplace-HdefWdN_.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-wAZKfDQF.js +0 -1
- package/dist/client/assets/_shell.session-C0utZeSI.js +0 -1
- package/dist/client/assets/_shell.threads-TvzYRNMt.js +0 -1
- package/dist/client/assets/_shell.todos-sOFmsIPE.js +0 -6
- package/dist/client/assets/_shell.x._extensionId-DiEQZIvl.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-DiEQZIvl.js +0 -1
- package/dist/client/assets/channel-B0WiEIVe.js +0 -1
- package/dist/client/assets/index-BwTGkJbK.js +0 -1071
- package/dist/client/assets/index-CCHGVclj.js +0 -1
- package/dist/client/assets/index-CiUmx-i3.js +0 -1
- package/dist/client/assets/index-Dd4JoHFP.js +0 -1
- package/dist/client/assets/index-DlmGvYpy.js +0 -1
- package/dist/client/assets/index-EXJsA5kw.js +0 -1
- package/dist/client/assets/index-MpS13vhQ.css +0 -1
- package/dist/client/assets/registry-BQTcAm5U.js +0 -39
- package/dist/client/assets/registry-HencHRXy.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-nJfOIWYW.js +0 -8
- package/dist/client/assets/use-direct-message-panel-B3qfpDjY.js +0 -1
- package/dist/client/assets/use-is-below-desktop-BXHT3oPL.js +0 -1
- package/dist/client/assets/use-local-browser-DDWknHZE.js +0 -1
- package/dist/client/assets/use-pending-read-uvmEJ7H9.js +0 -1
- package/dist/client/assets/use-update-config-D-OGlXGR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{O as Y,aO as $e,a5 as fs,a7 as Be,a8 as gs,aI as js,aJ as O,r as h,
|
|
1
|
+
import{O as Y,aO as $e,a5 as fs,a7 as Be,a8 as gs,aI as js,aJ as O,r as h,mG as Ns,j as s,G as g,Z as le,_ as ce,eB as bs,mH as ne,mI as ys,cP as vs,mJ as ks,kb as Fe,dA as Ts,dB as Ss,c0 as de,y as We,aZ as Cs,j5 as Ge,cV as $,eJ as ws,eG as Es,mK as F,dn as _,dp as A,dq as R,by as ue,bz as me,bA as pe,bC as he,aR as He,h2 as Is,mL as be,mM as _s,mN as As,gn as Qe,go as Rs,gp as Xe,ep as qe,mO as Ds,mP as ie,eF as Ms,fY as Os,bb as Ps,B as P,mQ as Us,mR as zs,ab as Ls,fd as $s,es as Bs,mS as ye,mT as Fs,kM as Ws,kN as Gs,kO as Hs,kP as Qs,mU as Xs,mV as qs,kQ as ve,mW as Vs,f as Ks,eu as ee,kA as Ys,hr as xe,mX as Js,mY as Zs,mZ as Ve,m_ as Ke,m$ as et,bO as st,bP as tt,bQ as nt,bR as it,a2 as q,bS as rt,bT as at,bU as ot,bW as lt,e as H,ff as Ye,l$ as ke,e8 as ct,I as dt,m0 as ut,kz as mt,er as pt,aW as Je,cC as ht,n0 as xt,eo as U,n1 as re,n2 as fe,n3 as Ze,n4 as ft,cQ as gt,n5 as es,n6 as V,n7 as jt,cD as ss,n8 as Nt,n9 as bt,na as yt,mA as vt,bD as Q,cF as ts,nb as kt,kW as Tt,as as St,gd as Ct,eE as wt,nc as Et,nd as It,j0 as _t,Y as At,J as Rt,X as Dt,af as Mt,hi as Ot,gg as Pt,ip as Ut,eW as zt,i2 as Lt,kJ as $t,a3 as Bt,hv as Ft}from"./index-BR1m9FON.js";import{G as X}from"./git-branch-CsLE6G0Y.js";import{s as Wt,b as Gt,T as Ht,a as Qt,c as ns}from"./trust-dial-D__tIhzt.js";import{u as Xt}from"./use-update-config-DjL7-nUR.js";import{s as qt}from"./settings-for-runtime-BoOa-ZFG.js";import{R as Vt,H as Kt,a as Yt,b as Jt}from"./RuntimeSetupDialog-DTO5v0dP.js";import{r as Zt}from"./RuntimeConnectFlow-BYQnY5vv.js";import{U as Te}from"./unverified-catalog-notice-C8swqaTn.js";import{Z as ge}from"./zap-DSllMMHe.js";import{f as se,a as en}from"./format-tokens-DymkROvy.js";import{L as sn}from"./layers-B0Z5Od3N.js";import{D as L}from"./detail-row-Crl89jnh.js";import{C as tn,a as nn}from"./cpu-j9vX9Wfk.js";/**
|
|
2
2
|
* @license lucide-react v1.48.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -18,4 +18,4 @@ import{O as Y,aO as $e,a5 as fs,a7 as Be,a8 as gs,aI as js,aJ as O,r as h,mD as
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const os={name:"wifi",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]};os.node;const B=Y(os);function on(e){var t;return((t=e==null?void 0:e.ui)==null?void 0:t.statusBar)??Ns}function ln(){const{data:e}=$e();return on(e)}function cn(){const e=fs(),t=Be(),n=gs({mutationKey:js,mutationFn:r=>e.updateConfig({ui:{statusBar:{pins:[...r]}}}),onMutate:async r=>{await t.cancelQueries({queryKey:O.current()});const a=t.getQueryData(O.current());return t.setQueryData(O.current(),o=>o!=null&&o.ui?{...o,ui:{...o.ui,statusBar:{pins:[...r]}}}:o),{previous:a}},onError:(r,a,o)=>{o&&o.previous!==void 0&&t.setQueryData(O.current(),o.previous)},onSettled:()=>{t.invalidateQueries({queryKey:O.current()})}});return{setPins:h.useCallback(r=>n.mutate(r),[n]),isPending:n.isPending}}const dn={duration:.2,ease:[.4,0,.2,1]},un="pointer-coarse:[&_button]:py-3",mn=1e3;function Fi({items:e,trailing:t,nameFirst:n}){const i=e.filter(a=>a.cluster==="left"),r=e.filter(a=>a.cluster==="right");return s.jsxs("div",{role:"toolbar","aria-label":"Chat status","aria-live":"polite","data-testid":"status-line",className:"text-muted-foreground flex items-center gap-2 overflow-hidden px-1 text-xs whitespace-nowrap pointer-coarse:min-h-11",children:[s.jsx(Ce,{items:i,className:g("flex-auto",n&&i.length>0?"min-w-10":"min-w-0"),style:n?{flexShrink:mn}:void 0}),s.jsx(Ce,{items:r,className:"min-w-0 shrink"}),t!==void 0&&s.jsx("span",{className:"flex shrink-0 items-center",children:t})]})}const pn=8;function hn(e,t){return pn**Math.max(0,t.indexOf(e.key))}function Ce({items:e,className:t,style:n}){const i=[...e].sort((r,a)=>a.severity-r.severity).map(r=>r.key);return s.jsx("div",{className:g("flex items-center gap-2",t),style:n,children:s.jsx(le,{initial:!1,mode:"popLayout",children:e.map((r,a)=>s.jsxs(ce.div,{"data-testid":`status-item-${r.key}`,"data-rigid":r.rigid?"true":void 0,"data-held":r.held?"true":void 0,"data-snug":r.snug?"true":void 0,layout:"position",initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:dn,style:r.rigid||r.held||r.snug?void 0:{flexShrink:hn(r,i)},className:g("inline-flex items-center gap-2",r.rigid||r.held||r.snug?"shrink-0":"min-w-10",un),children:[a>0&&s.jsx(xn,{}),r.node]},r.key))})})}function xn(){return s.jsx("span",{className:"text-muted-foreground/30 shrink-0","aria-hidden":"true",children:"·"})}function Gi({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:e,children:[s.jsx(bs,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:t})]})}function V(e){const t=e.trim(),n=Array.from(t);return n.length<=ne?t:`${n.slice(0,ne-1).join("").trimEnd()}…`}function fn(e){return e.replace(/\s*\([^()]*\)\s*$/,"").split("·")[0].trim()}function gn(e,t){return V(jn(e,t))}function jn(e,t){const n=t.find(r=>r.value===e);if(n)return fn(n.displayName);const i=/claude-(\w+)-/.exec(e);return i?`${i[1].charAt(0).toUpperCase()}${i[1].slice(1)}`:e==="default"?"Default":ys(e)??e}function Wi({data:e,workspace:t,compact:n}){if(!e)return null;if(!vs(e))return s.jsxs("span",{className:"text-muted-foreground/50 inline-flex min-w-0 items-center gap-1",title:"Not a git repository",children:[s.jsx(q,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:"No repo"})]});const i=e.modified+e.staged+e.untracked,r=i===1?"1 change":`${i} changes`,a=[];if(e.modified>0&&a.push(`${e.modified} modified`),e.staged>0&&a.push(`${e.staged} staged`),e.untracked>0&&a.push(`${e.untracked} untracked`),e.conflicted>0&&a.push(`${e.conflicted} conflicted`),t){const u=ks(t.portBase),c=[`${t.key} · ${t.projectKey}`,`${t.branch??e.branch} · ${t.provider}`,e.ahead>0?`↑${e.ahead}`:"",e.behind>0?`↓${e.behind}`:"",a.length>0?a.join(", "):"clean",`ports ${u.DORKOS_PORT} / ${u.VITE_PORT} / ${u.SITE_PORT}`,t.pinned?"pinned":""].filter(Boolean);return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:c.join(" · "),children:[s.jsx(q,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[20ch] truncate font-medium",children:n?V(t.key):t.key}),!n&&s.jsxs("span",{className:"text-muted-foreground truncate",children:["· ",t.projectKey]}),t.pinned&&s.jsx(Fe,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),i>0&&(n?s.jsx(we,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}const o=a.length>0?`${e.branch} · ${a.join(", ")}`:`${e.branch} · clean`;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:o,children:[s.jsx(q,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[25ch] truncate",children:n?V(e.branch):e.branch}),e.ahead>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Ts,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Ss,{className:"size-(--size-icon-xs)"}),e.behind]}),i>0&&(n?s.jsx(we,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}function we({label:e}){return s.jsx("span",{role:"img","aria-label":e,title:e,className:"bg-muted-foreground/70 size-1 shrink-0 rounded-full"})}function Nn({stop:e,onMakeDefault:t,onDismiss:n,pending:i,error:r,placement:a="inline"}){const o=a==="overlay";return o&&!e?null:s.jsx("div",{className:g("flex items-center px-1",o?"bg-background/95 pointer-events-auto absolute right-0 bottom-full left-0 z-20 mb-1 rounded-md py-0.5 backdrop-blur-sm":"min-h-5"),"data-testid":o?"make-default-slot-overlay":"make-default-slot",children:e&&s.jsxs("p",{role:"status","data-testid":"make-default-offer",className:g("animate-in fade-in-0 flex min-w-0 items-center gap-1.5 text-xs duration-200 motion-reduce:animate-none",r?"text-destructive":"text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:r?s.jsxs(s.Fragment,{children:[s.jsx(de,{className:"mr-1 inline size-3 shrink-0 align-[-2px]","aria-hidden":!0}),r]}):s.jsxs(s.Fragment,{children:["Start every new chat in ",Cs(e),"?"]})})," ",s.jsxs("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[r?s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-retry",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Try again"}):s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-confirm",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Make default"}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("button",{type:"button",onClick:n,"data-testid":"make-default-dismiss",className:"focus-ring hover:text-foreground rounded-sm underline underline-offset-2",children:"Dismiss"})]})]})})}function bn(e,t,n){const i=be(e,t),r=be(e,n);return!i||!r?!1:Ms(r,i)?i.auto===!0&&r.auto!==!0&&r.asks!=="never":!0}const yn="Auto mode needs Opus 4.6+ or Sonnet 4.6";function Hi({mode:e,onChangeMode:t,disabled:n,pending:i,runtime:r,modelSupportsAutoMode:a,planActive:o,compact:u,makeDefault:c,onOpenChange:m}){var w;const l=Ge(r),p=ws(f=>f.setControlCenterOpen),d=We(),v=$(f=>f.open),b=$(f=>f.setOpen),k=$(f=>f.setAvailable),N=!(l&&!l.permissionModes.supported)&&n!==!0&&i!==!0;h.useEffect(()=>(k(N),()=>k(!1)),[N,k]);const y=h.useRef(m);if(h.useEffect(()=>{y.current=m},[m]),h.useEffect(()=>()=>{var f;b(!1),(f=y.current)==null||f.call(y,!1)},[b]),l&&!l.permissionModes.supported)return null;const S=(l==null?void 0:l.permissionModes.values)??[],M=!a&&S.some(f=>f.id==="auto"),D=M?S.filter(f=>f.id!=="auto"):S,E=D.find(f=>f.id===e),C=d?S.find(f=>f.id===(l==null?void 0:l.permissionModes.default)):void 0,T=C!==void 0&&E!==void 0&&l!==void 0&&bn(l.permissionModes,E.id,C.id),x=T?C:E,I=T?`${C.label} (Wi-Fi)`:(x==null?void 0:x.label)??Es(e),J=u?V(T?C.label:I):I,Z=Is(x),G=(w=_s(D).find(f=>f.mode.id===e))==null?void 0:w.stop,W=M&&(G==="act"||e==="auto"),z=s.jsxs("button",{disabled:n,"data-testid":"permission-mode-trigger","aria-label":`Permissions: ${I}`,className:g(F,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40",Z),children:[s.jsx(Rs,{descriptor:x,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:J})]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:z})}),s.jsx(A,{side:"top",children:"Send a message first"})]}):i?s.jsxs("span",{"data-testid":"permission-mode-pending","aria-busy":"true","aria-label":"Permissions: still loading",className:g(F,"items-center gap-1 opacity-40"),children:[s.jsx("span",{className:"bg-muted-foreground/30 size-(--size-icon-xs) shrink-0 animate-pulse rounded-full"}),s.jsx("span",{className:"bg-muted-foreground/30 h-2 w-10 animate-pulse rounded"})]}):s.jsxs(ue,{open:v,onOpenChange:f=>{b(f),m==null||m(f)},children:[s.jsx(me,{asChild:!0,children:z}),s.jsxs(pe,{side:"top",align:"start",className:"w-80 p-3","aria-label":"Permissions",children:[s.jsx(he,{children:"Permissions"}),s.jsx(As,{mode:e,descriptors:D,onChangeMode:t,planActive:o,onUnlock:()=>p(!0)}),c&&s.jsx(Nn,{...c}),W&&s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("p",{"data-testid":"auto-unsupported-hint",className:"text-muted-foreground text-3xs mt-2 flex items-center gap-1.5 px-1",children:[s.jsx(He,{className:"size-(--size-icon-xs) shrink-0"}),"Auto unavailable on this model"]})}),s.jsx(A,{side:"top",children:yn})]}),s.jsx(Ds,{mode:e,descriptor:E,className:"mt-2 px-1"})]})]})}const Ee="On Wi-Fi · agents ask or only read",te="Over Wi-Fi, every file or shell step needs your OK, or agents only read.",vn="relative after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']";function Xi({compact:e}){const t=We(),n=Os();if(!t)return null;const i=s.jsxs("button",{type:"button","data-testid":"wifi-turn-cap","aria-label":`${Ee}. ${te}`,className:g("border-border text-muted-foreground inline-flex items-center gap-1 rounded-full border py-0.5",vn,n?"cursor-pointer":"cursor-default",e?"mx-1.5 px-1":"px-2","focus-visible:ring-ring outline-none focus-visible:ring-[3px]"),children:[s.jsx(B,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}),!e&&s.jsx("span",{children:Ee})]});return n?s.jsxs(Xe,{children:[s.jsx(Ps,{asChild:!0,children:i}),s.jsx(qe,{side:"top",collisionPadding:8,"data-testid":"wifi-turn-cap-detail",className:"w-auto max-w-70 p-3 text-xs",children:te})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:i}),s.jsx(A,{side:"top",children:te})]})}const kn=6e3;function Tn(e){return e instanceof Error&&e.message||"Couldn’t save that. Try again."}function qi(e){var G,W,z;const{sessionId:t,runtime:n,declaredModes:i,runtimeDefaultMode:r}=e,{data:a}=$e(),{data:o}=Qe(),u=qt(),c=Be(),m=Us(t),l=ie(w=>w.dismissDefaultStopOffer),[p,d]=h.useState(null),[v,b]=h.useState(null),[k,N]=h.useState(t);k!==t&&(N(t),d(null),b(null));const y=a==null?void 0:a.executionDefaults,S=n??(y==null?void 0:y.runtime),M=(G=y==null?void 0:y.perRuntime.find(w=>w.runtime===S))==null?void 0:G.trustStop,D=M??(y==null?void 0:y.trustStop)??null,E=(W=i.find(w=>w.id===r))==null?void 0:W.stop,C=D??E,T=M!=null?(z=Qt(o,S))==null?void 0:z.configSection:void 0,x=a!==void 0;h.useEffect(()=>{if(!p)return;const w=setTimeout(()=>d(null),kn);return()=>clearTimeout(w)},[p]);const I=h.useCallback(w=>{const f=i.find(xs=>xs.id===w);!f||zs(f)||!x||m||f.stop!==C&&(b(null),d(f.stop))},[i,x,m,C,d,b]),J=h.useCallback(()=>{if(!p)return;const w=p;b(null),u.mutate({runtimes:T?{[T]:{defaultTrustStop:w}}:{defaultTrustStop:w}},{onSuccess:()=>{c.invalidateQueries({queryKey:O.all}),d(null)},onError:f=>b(Tn(f))})},[p,u,c,T,d,b]),Z=h.useCallback(()=>{l(t),d(null)},[l,t,d]);return{line:x?{stop:p,onMakeDefault:J,onDismiss:Z,pending:u.isPending,error:v}:null,offerFor:I}}function Qi({runtimeLabel:e,onShown:t,onDismiss:n}){const i=$(a=>a.available),r=$(a=>a.setOpen);return h.useEffect(()=>{t==null||t()},[t]),s.jsxs(Ls,{"data-slot":"read-only-mode-notice","data-testid":"read-only-mode-notice",gap:"none",className:"flex-row flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",children:[s.jsx($s,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:["In this mode, ",e," reads files but won’t change them. Asking won’t help."]}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1.5 sm:w-auto",children:[s.jsx(P,{variant:"ghost",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:n,children:"Dismiss"}),i&&s.jsx(P,{variant:"outline",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:()=>r(!0),children:"Change permissions"})]})]})}function Ki(e,t,n){const i=Ge(t??void 0),r=ie(p=>p.recordReadOnlyHintShown),a=ie(p=>p.spendReadOnlyHint),o=Bs(e??""),u=i==null?void 0:i.permissionModes.values.find(p=>p.id===n),c=u!==void 0&&Fs(u);h.useEffect(()=>{c||!e||o!=="shown"||a(e)},[c,e,o,a]);const m=h.useCallback(()=>{e&&r(e)},[e,r]),l=h.useCallback(()=>{e&&a(e)},[e,a]);return h.useMemo(()=>({eligible:!!e&&c&&o!=="spent",runtimeLabel:t?Gs(t):"This agent",markShown:m,dismiss:l}),[e,c,o,t,m,l])}function Vi({descriptor:e,active:t,onToggle:n,disabled:i}){return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","aria-pressed":t,disabled:i,onClick:()=>n(!t),className:g(F,"items-center gap-1","disabled:cursor-not-allowed disabled:opacity-40",t&&"text-foreground"),children:[s.jsx(Ke,{className:"size-(--size-icon-xs) shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label})]})}),s.jsx(A,{side:"top",children:i?"Send a message first":e.promise})]})}function Yi({runtime:e,model:t,onChangeRuntime:n,canSelect:i,compact:r,iconOnly:a,account:o}){const{data:u}=Qe(),{data:c}=Ws(),{nameFor:m}=Hs(),[l,p]=h.useState({open:!1}),d=Object.keys((u==null?void 0:u.capabilities)??{}),v=d.filter(x=>ye(c,x)),b=d.filter(x=>!ye(c,x)),k=u!==void 0&&Object.values(Xs).some(x=>x.setup&&!d.includes(x.type)),N=!!n&&(d.length>1||b.length>0||k),y=r?null:t,S=ee(e),M=S.icon,D=a?s.jsx(M,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}):s.jsx(st,{runtime:e,model:y,iconClassName:"size-(--size-icon-xs)"}),E=a?s.jsx("span",{className:"block",children:S.label}):null,C=a?s.jsx("span",{role:"img","aria-label":S.label,"data-testid":"runtime-item-icon",className:"inline-flex items-center",children:D}):D,T=o?`Account: ${m(o)}`:null;return i?N?s.jsxs(s.Fragment,{children:[s.jsxs(qs,{children:[s.jsx(Qs,{asChild:!0,children:s.jsx("button",{className:F,"aria-label":a?`Runs on: ${S.label}`:void 0,title:a?S.label:void 0,children:D})}),s.jsxs(Ks,{side:"top",align:"start",className:"w-56",children:[s.jsx(Vs,{children:"Runs on"}),s.jsx(Ys,{value:e,onValueChange:x=>n==null?void 0:n(x),children:v.map(x=>{const I=ee(x);return s.jsx(Js,{value:x,icon:I.icon,children:I.label},x)})}),b.map(x=>{const I=ee(x);return s.jsx(ve,{icon:I.icon,description:"Connect",onSelect:()=>p({open:!0,runtime:x}),children:I.label},x)}),k&&s.jsxs(s.Fragment,{children:[s.jsx(Zs,{}),s.jsx(ve,{icon:et,onSelect:()=>p({open:!0}),children:"Add a runtime"})]})]})]}),s.jsx(Kt,{runtime:l.runtime,open:l.open,onOpenChange:x=>p(I=>({...I,open:x})),renderConnect:Zt,showConnectSuccess:!0,onRuntimeReady:x=>{n==null||n(x)}})]}):!T&&!E?C:s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(A,{side:"top",children:[E,T&&s.jsx("span",{className:"block",children:T})]})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:C}),s.jsxs(A,{side:"top",children:[E,s.jsx("span",{className:"block",children:"Set when the chat starts. It can’t change after."}),T&&s.jsx("span",{className:"block",children:T})]})]})}function Ji(e,t,n){const i=xe(),r=tt(e),a=new Date(i),o=t.pending?null:t.usage;return{...nt({liveTurnUsage:n,liveTurnAt:r,accountStatus:it(o,a),accountObservedAt:Ve(Ye(o))}),accountUsage:o}}function Zi({open:e,onOpenChange:t,onConfirm:n}){return s.jsx(rt,{open:e,onOpenChange:t,children:s.jsxs(at,{children:[s.jsxs(ot,{children:[s.jsxs(lt,{className:"flex items-center gap-2",children:[s.jsx(He,{className:"text-muted-foreground size-4"}),"Turn on Auto mode?",s.jsx(Q,{size:"xs",variant:"secondary",className:"tracking-wide uppercase",children:"Preview"})]}),s.jsx(ct,{children:"Asks only before risky steps, like deleting files. Switch back anytime."})]}),s.jsxs(dt,{children:[s.jsx(ut,{children:"Cancel"}),s.jsx(mt,{onClick:n,children:"Turn on Auto mode"})]})]})})}const Ie=[{slug:"frontier",label:"Frontier"},{slug:"solid-coders",label:"Solid coders"},{slug:"quick-helpers",label:"Quick helpers"},{slug:"more-models",label:"More models"},{slug:"no-tools",label:"Can’t do agent work"}],Sn=10,Cn="Can’t use tools, so it can’t read files or run commands.",wn="Makes images DorkOS can’t show yet.",En=["openrouter/openrouter/auto","openrouter/auto"];function In(e){return En.some(t=>e.value===t||e.value.startsWith(`${t}-`))}function ls(e){return e.supportsToolUse!==!1}function _n(e){return e.supportsImageOutput===!0&&!In(e)?wn:ls(e)?null:Cn}function Rn(e){if(!ls(e))return"no-tools";switch(e.tier){case"frontier":return"frontier";case"solid-coder":return"solid-coders";case"quick-helper":return"quick-helpers";default:return"more-models"}}function An(e){return e.some(t=>t.tier!=null)||e.length>Sn}function Dn(e,t){const n=t.trim().toLowerCase();return n?e.value.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n):!0}function Mn(e){const t=new Map(Ie.map(n=>[n.slug,[]]));for(const n of e)t.get(Rn(n)).push(n);return Ie.map(n=>({...n,models:t.get(n.slug)})).filter(n=>n.models.length>0)}function On(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function Pn(){return s.jsx("div",{className:"space-y-2","data-testid":"model-cards-skeleton",children:Array.from({length:3}).map((e,t)=>s.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-3",children:[s.jsx(H,{className:"size-4 rounded-full"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(H,{className:"h-3.5 w-24"}),s.jsx(H,{className:"h-2.5 w-32"})]}),s.jsx(H,{className:"h-5 w-10 rounded-md"})]},t))})}function Un({onRetry:e,message:t}){return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center","data-testid":"model-load-error",children:[s.jsx(de,{className:"text-muted-foreground size-5"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t??"Couldn’t load the model list."}),s.jsxs("button",{onClick:e,className:"text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",children:[s.jsx(Je,{className:"size-3"}),"Retry"]})]})}function zn(e){const t=e.slice(e.lastIndexOf(" ")+1);return t.includes("/")||t.includes(":")}function cs({text:e,className:t}){return zn(e)?s.jsx("div",{dir:"rtl",className:g("truncate text-left",t),title:e,children:s.jsx("bdi",{dir:"ltr",children:e})}):s.jsx("div",{className:g("truncate",t),title:e,children:e})}function _e({model:e,isSelected:t}){const n=_n(e);return s.jsxs("label",{className:g("flex w-full cursor-pointer items-center gap-3 rounded-xl border p-3 transition-colors duration-150",t?"bg-secondary border-foreground/15":"border-border hover:border-muted-foreground/30 hover:bg-muted/50 opacity-70"),children:[s.jsx(xt,{value:e.value,className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-foreground line-clamp-2 text-sm font-medium break-words",children:[e.displayName,e.local&&s.jsxs("span",{className:"text-muted-foreground text-3xs ml-1.5 font-normal",children:[ft()," · private"]})]}),s.jsx(cs,{text:e.description,className:"text-muted-foreground text-2xs leading-tight"}),n&&s.jsx("div",{className:"text-2xs text-status-warning-fg mt-0.5 leading-tight","data-testid":`model-limitation-${e.value}`,children:n})]}),e.contextWindow&&s.jsx(Q,{size:"xs",variant:"secondary",className:"shrink-0",children:On(e.contextWindow)})]})}function Ln({value:e}){return s.jsxs("div",{className:"space-y-1.5","data-testid":"model-unavailable-saved",children:[s.jsxs("div",{className:"border-border flex w-full items-center gap-3 rounded-xl border border-dashed p-3 opacity-80",children:[s.jsx(de,{className:"text-status-warning-fg size-4 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[s.jsx(cs,{text:e,className:"text-foreground min-w-0 text-sm font-medium"}),s.jsx("span",{className:"text-muted-foreground text-2xs shrink-0 font-normal",children:"(not available)"})]})]}),s.jsx("p",{className:"text-muted-foreground text-2xs leading-snug",children:"This model isn’t available anymore. Pick another."})]})}function $n({slug:e,label:t}){return s.jsx("div",{className:"text-muted-foreground text-2xs mt-2 mb-1 font-medium tracking-wide uppercase first:mt-0","data-testid":`model-group-${e}`,children:t})}function Bn({models:e,selectedModel:t,onChangeModel:n,emptyMessage:i}){const[r,a]=h.useState(""),o=An(e),c=e.length>0&&t.length>0&&!e.some(d=>d.value===t)?s.jsx(Ln,{value:t}):null,m=e.some(d=>d.unverified),l=h.useMemo(()=>o?e.filter(d=>Dn(d,r)):e,[e,r,o]),p=h.useMemo(()=>o?Mn(l):[],[l,o]);return e.length===0?s.jsx("div",{className:"border-border text-muted-foreground text-2xs rounded-xl border border-dashed p-3 leading-snug","data-testid":"model-catalog-unavailable",children:i??"Couldn’t load models. Check Settings, then try again."}):o?s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(Te,{}),s.jsxs("div",{className:"relative",children:[s.jsx(pt,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),s.jsx(ht,{type:"text",value:r,onChange:d=>a(d.target.value),placeholder:"Search models…","aria-label":"Search models","data-testid":"model-search",className:"h-8 pl-8 text-xs"})]}),p.length===0?s.jsx("p",{className:"text-muted-foreground py-4 text-center text-xs","data-testid":"model-search-empty",children:m?"No match in this short list. Connect a provider to see more.":"No models match"}):s.jsx(ke,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:p.map(d=>s.jsxs(h.Fragment,{children:[s.jsx($n,{slug:d.slug,label:d.label}),d.models.map(v=>s.jsx(_e,{model:v,isSelected:v.value===t},v.value))]},d.slug))})]}):s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(Te,{}),s.jsx(ke,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:e.map(d=>s.jsx(_e,{model:d,isSelected:d.value===t},d.value))})]})}const ae={none:{label:"None",description:"No reasoning"},minimal:{label:"Minimal",description:"Near-zero thinking"},low:{label:"Low",description:"Fastest responses"},medium:{label:"Medium",description:"Moderate thinking"},high:{label:"High",description:"Deep reasoning"},max:{label:"Max",description:"Maximum thinking"},xhigh:{label:"XHigh",description:"Beyond maximum"}},Fn={duration:.15,ease:"easeOut"};function Gn({effortLevels:e,effort:t,onChangeEffort:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Effort"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Effort level",children:[s.jsx(oe,{role:"radio",label:"Default",isSelected:t===null,onClick:()=>n(null)}),e.map(i=>s.jsx(oe,{role:"radio",label:ae[i].label,description:ae[i].description,isSelected:t===i,onClick:()=>n(i)},i))]})]})}function Wn({supportsFastMode:e,fastMode:t,onChangeFastMode:n}){return e?s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Mode"}),s.jsx("div",{className:"flex gap-1.5",children:s.jsx(oe,{role:"switch",label:"Fast",icon:s.jsx(fe,{className:"size-3"}),isSelected:t,onClick:()=>n(!t)})})]}):null}function oe({role:e,label:t,description:n,icon:i,isSelected:r,onClick:a}){const o=s.jsxs("button",{role:e,"aria-checked":r,onClick:a,className:g("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),children:[i,t]});return n?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:o}),s.jsx(A,{side:"top",className:"text-xs",children:n})]}):o}function er({model:e,onChangeModel:t,effort:n,onChangeEffort:i,fastMode:r,onChangeFastMode:a,disabled:o,sessionId:u,runtime:c,onCredits:m,compact:l}){var C;const{data:p,isLoading:d,isError:v,refetch:b}=gt({sessionId:u,runtime:c??void 0}),k=p??[],N=k.find(T=>T.value===e),y=!!(N!=null&&N.supportsEffort&&(((C=N.supportedEffortLevels)==null?void 0:C.length)??0)>0),S=(N==null?void 0:N.supportsFastMode)??!1,M=!l&&y&&n?ae[n].label:null,D=!l&&r,E=s.jsxs("button",{disabled:o,className:g(F,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40"),"data-testid":"model-config-trigger",children:[s.jsx(Ze,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:gn(e,k)}),M&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsx(Q,{size:"xs",variant:"secondary",children:M})]}),D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsxs(Q,{size:"xs",variant:"secondary",children:[s.jsx(fe,{className:"mr-0.5 inline size-2.5"}),"Fast"]})]})]});return o?s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:E})}),s.jsx(A,{side:"top",children:"Send a message first"})]}):s.jsxs(ue,{children:[s.jsx(me,{asChild:!0,children:E}),s.jsxs(pe,{side:"top",align:"start",className:"w-120 max-w-[calc(100vw-1.5rem)] p-3","data-testid":"model-config-popover",children:[s.jsx(he,{children:"Model"}),k.some(T=>T.paidFromCredits)&&s.jsx("p",{className:"text-muted-foreground text-2xs mb-2","data-testid":"model-credits-note",children:k.some(T=>T.creditsListOutOfDate)?"Models your DorkOS credits cover. This list may be out of date.":"Models your DorkOS credits cover"}),d&&s.jsx(Pn,{}),v&&s.jsx(Un,{onRetry:()=>b(),message:m?"Couldn’t load the models DorkOS credits cover. Your model stays as it is.":void 0}),!d&&!v&&s.jsx(Bn,{models:k,selectedModel:e,onChangeModel:t,emptyMessage:m?"DorkOS credits don’t cover a model for this runtime yet.":void 0}),s.jsx(le,{children:!d&&!v&&(y||S)&&s.jsxs(ce.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:Fn,children:[s.jsx(jt,{className:"my-3"}),s.jsx("div",{className:"text-muted-foreground text-2xs mb-3 font-medium tracking-wide uppercase",children:"Configuration"}),s.jsxs("div",{className:"space-y-3",children:[y&&s.jsx(Gn,{effortLevels:N.supportedEffortLevels,effort:n,onChangeEffort:i}),S&&s.jsx(Wn,{supportsFastMode:(N==null?void 0:N.supportsFastMode)??!1,fastMode:r,onChangeFastMode:a})]})]},"config")})]})]})}function sr({percent:e,contextUsage:t,compact:n,reading:i,now:r}){const a=Nt(e,t)??e,o=bt(a),u=o==="critical"?U.error:o==="warning"?U.warning:"",c=n!=null&&a>=es,m=t?{total:t.totalTokens,max:t.maxTokens}:i&&i.maxTokens>0?{total:i.totalTokens,max:i.maxTokens}:null,l=(i==null?void 0:i.observedAt)??null,p=m!==null,d=s.jsxs("span",{"aria-label":p?"Context window usage":void 0,className:g("inline-flex shrink-0 items-center gap-1",p&&"cursor-default",u),children:[s.jsx(sn,{className:"size-(--size-icon-xs) shrink-0"}),s.jsxs("span",{children:[a,"%"]})]});return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[m?s.jsx(Hn,{totals:m,categories:(t==null?void 0:t.categories)??[],observedAt:l,now:r,children:d}):d,s.jsx(le,{initial:!1,children:c&&s.jsxs(ce.button,{type:"button",onClick:n.onCompact,disabled:n.pending,"aria-label":n.pending?"Compacting chat…":`Context ${a}% full. Compact now`,"aria-busy":n.pending,"data-testid":"compaction-chip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",children:[s.jsx(Je,{"aria-hidden":"true",className:g("size-(--size-icon-xs) shrink-0",n.pending&&"animate-spin")}),s.jsx("span",{className:"truncate",children:"Compact"})]},"compact")})]})}function Hn({totals:e,categories:t,observedAt:n,now:i,children:r}){const a=t.filter(o=>o.tokens>0).sort((o,u)=>u.tokens-o.tokens);return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:r}),s.jsx(A,{side:"top",className:"max-w-64",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-xs font-medium",children:[se(e.total)," / ",se(e.max)," tokens"]}),a.length>0&&s.jsx("div",{className:"space-y-0.5",children:a.map(o=>s.jsxs("div",{className:"text-3xs flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx("span",{className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:o.color}}),o.name]}),s.jsx("span",{className:g(re,"shrink-0"),children:se(o.tokens)})]},o.name))}),n!==null&&s.jsx(ge,{observedAt:n,now:i,surface:"tooltip"})]})})]})}const Xn={panel:{warning:U.warning,error:U.error},tooltip:{warning:"",error:""}};function je(e){if(e.costUsd==null)return null;switch(e.costBasis){case"unknown":return"Estimated. This model has no listed price.";case"managed":return"Charged at your organization’s own rates.";default:return null}}function Ne(e){return e.costBasis==="unknown"?"Estimated chat cost":"Chat cost"}function ds({usage:e,surface:t="panel"}){const n=je(e),i=Xn[t],r=K[t];return s.jsxs(s.Fragment,{children:[e.costUsd!=null&&s.jsx(L,{label:Ne(e),labelClassName:r,children:`$${e.costUsd.toFixed(2)}`}),n&&s.jsx("div",{className:r,children:n}),e.detail&&s.jsx("div",{"data-slot":"usage-detail-note",className:i.warning||void 0,children:e.detail}),e.state==="exhausted"&&s.jsx("div",{"data-slot":"usage-limit-note",className:i.error||void 0,children:"Rate limit reached"})]})}function us({usage:e,surface:t="panel"}){const n=je(e),i=K[t];if(e.kind==="subscription"&&e.utilization!=null){const r=Math.round(e.utilization*100),a=e.resetsAt?new Date(e.resetsAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null;return s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsxs("div",{className:"text-3xs space-y-0.5",children:[s.jsx(L,{label:"Utilization",labelClassName:i,children:`${r}%`}),e.windowLabel&&s.jsx(L,{label:"Window",labelClassName:i,children:e.windowLabel}),a&&s.jsx(L,{label:"Resets at",labelClassName:i,children:a}),s.jsx(ds,{usage:e,surface:t})]})]})}return s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:Ne(e)}),s.jsxs("div",{className:"text-3xs space-y-0.5",children:[e.costUsd!=null&&s.jsx(L,{label:"Cost",labelClassName:i,children:`$${e.costUsd.toFixed(2)}`}),n&&s.jsx("div",{className:i,children:n}),e.detail&&s.jsx("div",{className:i,children:e.detail})]})]})}function tr({usage:e,observedAt:t=null,now:n}){const i=xe(),r=n??new Date(i);if(e.kind==="subscription"&&e.utilization!=null){const m=Math.round(e.utilization*100),l=e.state==="exhausted",p=e.state==="warning"||m>=80,d=l?"text-destructive":p?"text-status-warning-fg":"",v=yt(e,t,r),b=vt(v);return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("span",{className:g("inline-flex shrink-0 cursor-default items-center gap-1",d),"aria-label":"Subscription usage","data-stale":v||void 0,children:[s.jsx(ss,{className:"size-(--size-icon-xs)"}),s.jsxs("span",{className:b,children:[m,"%"]}),v&&s.jsx("span",{className:b,children:"· old"})]})}),s.jsx(A,{side:"top",className:"max-w-56",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(us,{usage:e,surface:"tooltip"}),t!==null&&s.jsx(ge,{observedAt:t,now:r,surface:"tooltip"})]})})]})}if(e.costUsd==null)return null;const o=en(e.costUsd),u=je(e),c=Ne(e);return!e.detail&&!u?s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1","aria-label":c,children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),s.jsx("span",{children:o})]}):s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("span",{className:"inline-flex shrink-0 cursor-default items-center gap-1","aria-label":c,children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),s.jsx("span",{children:o})]})}),s.jsx(A,{side:"top",className:"max-w-56",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:c}),u&&s.jsx("div",{className:g(K.tooltip,"text-3xs"),children:u}),e.detail&&s.jsx("div",{className:g(K.tooltip,"text-3xs"),children:e.detail})]})})]})}function nr({usage:e,accountUsage:t=null,observedAt:n=null,open:i,onOpenChange:r,now:a}){const o=xe(),u=a??new Date(o),c=Ye(t),m=c.length>0?Ve(c):n,l=e!=null&&ts(e);let p;return c.length>0?p=s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsx("div",{className:"flex flex-col gap-2.5",children:c.map(d=>s.jsx(kt,{window:d,label:Tt(d.key,d.label),now:u},d.key))}),e&&s.jsx("div",{className:"text-3xs space-y-0.5",children:s.jsx(ds,{usage:e})})]}):l?p=s.jsx(us,{usage:e}):p=s.jsx("p",{className:"text-muted-foreground text-xs",children:"No usage yet."}),s.jsxs(Xe,{open:i,onOpenChange:r,children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{"aria-hidden":!0,className:"inline-block h-0 w-0"})}),s.jsx(qe,{side:"top",align:"end",className:"w-72 max-w-[calc(100vw-1.5rem)]","aria-label":"Usage and cost",children:s.jsxs("div",{className:"space-y-2",children:[p,m!==null&&(c.length>0||l)&&s.jsx(ge,{observedAt:m,now:u})]})})]})}const qn={connecting:{color:X.warning,label:"Connecting",shortLabel:"Connecting",icon:B,tasks:!0},connected:{color:X.success,label:"Connected",shortLabel:"Connected",icon:B,tasks:!1},reconnecting:{color:X.warning,label:"Reconnecting",shortLabel:"Reconnecting",icon:B,tasks:!0},disconnected:{color:X.error,label:"Live updates lost",shortLabel:"Offline",icon:Ct,tasks:!1}};function ir({connectionState:e,compact:t}){const n=qn[e],i=n.icon;return s.jsxs(Vt,{openDelay:200,children:[s.jsx(Yt,{asChild:!0,children:s.jsxs("span",{className:"flex min-w-0 cursor-default items-center gap-1.5 text-xs",children:[s.jsx("span",{className:g("size-1.5 shrink-0 rounded-full",n.color,n.tasks&&"animate-breath")}),s.jsx("span",{className:"text-muted-foreground truncate",children:t?n.shortLabel:n.label})]})}),s.jsx(Jt,{side:"top",align:"center",className:"w-72 p-3",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx(i,{className:g("mt-0.5 size-4 shrink-0",e==="disconnected"?U.error:U.warning)}),s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx(Qn,{connectionState:e})]})]})})]})}function Qn({connectionState:e}){const t="text-muted-foreground text-xs leading-relaxed";return e==="connecting"?s.jsx("p",{className:t,children:"Connecting to live updates. New messages appear once connected."}):e==="reconnecting"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Live updates dropped and are reconnecting. Nothing is lost."}),s.jsx("p",{className:g(t,"text-muted-foreground/70"),children:"No action needed."})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Can’t reach live updates. New messages appear once they’re back."}),s.jsx("p",{className:g(t,"text-muted-foreground/70"),children:"Still trying. If this lasts, check that DorkOS is running."})]})}function rr({count:e,running:t,waiting:n}){const i=e===1?"":"s",r=e-t.length,a=`${e} subagent${i} running`;return s.jsxs(_,{children:[s.jsx(R,{asChild:!0,children:s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1","aria-label":a,children:[s.jsx(ns,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"shrink-0 tabular-nums",children:e})]})}),s.jsxs(A,{side:"top",className:"max-w-64",children:[n&&s.jsx("p",{className:"mb-1 font-medium",children:"Still working. The agent continues when they finish."}),s.jsx("ul",{className:"space-y-1",children:t.map(o=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:o.description??"Working…"}),s.jsxs("p",{className:g(re,"text-3xs leading-tight"),children:[o.toolUses??0," tool",o.toolUses===1?"":"s",o.lastToolName?` · last ${o.lastToolName}`:""]})]},o.taskId))}),r>0&&s.jsx("p",{className:g(re,"text-3xs leading-tight"),children:t.length>0?`and ${r} more`:`${r} task${i} from earlier`})]})]})}const Re=648,Kn=440,Vn=340,Yn=3,Jn=3,Zn=2,ei=4,si=8,ti=20,ni=ne*si+ti,ii=Number.POSITIVE_INFINITY,Ae=[],ri=["cwd"],De=["cwd","git"];function ai(e){if(e===null||e<=0)return{density:"full",rightBudget:ii,dropped:Ae};if(e>=Re){const t=Math.floor((e-Re)/ni);return{density:"full",rightBudget:ei+t,dropped:Ae}}return e>=Kn?{density:"compact",rightBudget:Yn,dropped:ri}:e>=Vn?{density:"identity",rightBudget:Jn,dropped:De}:{density:"avatar",rightBudget:Zn,dropped:De}}function oi(e){return e==="identity"||e==="avatar"}function li(e,t){return t.severity!==e.severity?t.severity-e.severity:Number(t.pinned)-Number(e.pinned)}const ci=2,di=2;function ar(e,t){const n=new Set(t.dropped),i=t.density!=="full",r=l=>i&&l.held,a=e.filter(l=>l.cluster==="right"),o=new Set;let u=0,c=0;const m=[...a].sort((l,p)=>Number(r(p))-Number(r(l))||li(l,p));for(const l of m){if(c>=t.rightBudget)break;const p=l.rigid||r(l);p&&u>=ci||(p&&(u+=1),o.add(l.key),c+=l.wide?Math.min(di,t.rightBudget-c):1)}return{items:e.filter(l=>l.cluster==="right"?o.has(l.key):!n.has(l.key)).map(l=>l.held===r(l)?l:{...l,held:r(l)}),overflow:a.length-o.size}}const ui=new Set(["main","master"]);function or(e,t,n){return{dirty:!t,onDefaultBranch:!n&&ui.has(e)}}const j={AGENT_ANCHOR:1e3,CONNECTION_LOST:100,CONTEXT_CRITICAL:90,ACCOUNT_ATTENTION:85,USAGE_EXHAUSTED:80,PERMISSION_BYPASS:70,CONTEXT_WARNING:50,USAGE_WARNING:50,PERMISSION_ELEVATED:40,PLAN_ACTIVE:40,SUBAGENTS_RUNNING:35,EXTENSION_ITEM:35,RUNTIME_NON_DEFAULT:30,GIT_DIRTY:20,MODEL:10,CWD:5,QUIET:0},mi={session:"Session",diagnostics:"Diagnostics"};function Me(e){return e.runtime&&!e.runtime.isDefault?j.RUNTIME_NON_DEFAULT:j.QUIET}function pi(e){return e.account!==null}const hi=new Set(["near","model-out","out"]);function Oe(e){return e.permissionDescriptor?e.permissionDescriptor.stop!=="ask":e.permissionMode!=="default"}const ms=[{key:"agent",label:"Agent",description:"Who you are talking to",cluster:"left",group:null,icon:Et,promote:()=>!0,severity:()=>j.AGENT_ANCHOR},{key:"cwd",label:"Directory",description:"The folder this chat can touch",cluster:"left",group:"session",icon:It,promote:e=>e.cwd!==null,severity:()=>j.CWD},{key:"git",label:"Git",description:"Branch and uncommitted changes",cluster:"left",group:"session",icon:q,promote:e=>e.git!==null&&(e.git.dirty||!e.git.onDefaultBranch),severity:e=>{var t;return(t=e.git)!=null&&t.dirty?j.GIT_DIRTY:j.QUIET}},{key:"runtime",label:"Runs on",description:"What runs this chat",cluster:"right",group:"session",icon:tn,promote:e=>e.runtime!==null&&e.runtime.type!=="doe"&&(!e.runtime.isDefault||e.runtime.canSelect),severity:Me,snug:oi},{key:"account",label:"Account",description:"Which Claude account this uses, and what’s left",cluster:"right",group:null,icon:nn,promote:e=>e.account!==null,severity:e=>e.account&&hi.has(e.account.chipState)?j.ACCOUNT_ATTENTION:Me(e)},{key:"extensions",label:"Add-ons",description:"What your extensions show here",cluster:"right",group:null,icon:_t,promote:e=>e.extensionItems.some(t=>t.visible),severity:e=>e.extensionItems.some(t=>t.visible&&t.urgent)?j.ACCOUNT_ATTENTION:j.EXTENSION_ITEM},{key:"model",label:"Model",description:"The model answering you",cluster:"right",group:"session",icon:Ze,promote:()=>!1,severity:()=>j.MODEL},{key:"cache",label:"Cache",description:"How much came from cache",cluster:"right",group:"session",icon:fe,promote:()=>!1,severity:()=>j.QUIET,neverInLine:!0},{key:"context",label:"Context",description:"How full the context window is",cluster:"right",group:"session",icon:rn,rigid:!0,promote:e=>e.contextPercent!==null,severity:e=>e.contextPercent===null?j.QUIET:e.contextPercent>=es?j.CONTEXT_CRITICAL:e.contextPercent>=At?j.CONTEXT_WARNING:j.QUIET},{key:"usage",label:"Usage & cost",description:"Plan limits or chat cost",cluster:"right",group:"session",icon:ss,rigid:!0,promote:e=>e.usage!==null&&ts(e.usage)&&!pi(e),wide:e=>e.usageStale,severity:e=>{var t,n;return((t=e.usage)==null?void 0:t.state)==="exhausted"?j.USAGE_EXHAUSTED:((n=e.usage)==null?void 0:n.state)==="warning"?j.USAGE_WARNING:j.QUIET}},{key:"permission",label:"Permissions",description:"How freely the agent acts",cluster:"right",group:"session",icon:Rt,held:!0,promote:e=>Oe(e)||e.permissionPickerOpen===!0||e.onWifi===!0,severity:e=>(e.permissionDescriptor?Dt(e.permissionDescriptor):Mt(e.permissionMode))?j.PERMISSION_BYPASS:Oe(e)||e.permissionPickerOpen===!0||e.onWifi===!0?j.PERMISSION_ELEVATED:j.QUIET},{key:"plan",label:"Plan",description:"Plan first, change nothing until approved",cluster:"right",group:"session",icon:Ke,promote:e=>e.plan!==null,severity:e=>{var t;return(t=e.plan)!=null&&t.active?j.PLAN_ACTIVE:j.QUIET},snug:()=>!0},{key:"subagents",label:"Subagents",description:"Subagents working on this turn",cluster:"right",group:"diagnostics",icon:ns,rigid:!0,promote:e=>e.subagentsInFlight>0,severity:e=>e.subagentsInFlight>0?j.SUBAGENTS_RUNNING:j.QUIET},{key:"connection",label:"Live updates",description:"The live link that delivers messages",cluster:"right",group:"diagnostics",icon:B,promote:e=>e.connectionState!=="connected",severity:e=>e.connectionState==="connected"?j.QUIET:j.CONNECTION_LOST}];function ps(e){return e.group==="session"&&e.neverInLine!==!0}function xi(){const{pins:e}=ln(),{setPins:t}=cn(),n=h.useCallback(r=>{const a=wt.find(o=>o===r);a&&t(e.includes(a)?e.filter(o=>o!==a):[...e,a])},[e,t]),i=h.useCallback(()=>t([]),[t]);return{pins:e,toggle:n,reset:i}}function fi(){return["session","diagnostics"].map(t=>({group:t,label:mi[t],items:ms.filter(n=>n.group===t)})).filter(t=>t.items.length>0)}function hs(e){const t=e.contextTokens??e.readTokens+e.creationTokens;return t<=0?0:Math.round(e.readTokens/t*100)}function gi(e){return e?e.kind==="subscription"&&e.utilization!=null?`${Math.round(e.utilization*100)}% of ${e.windowLabel??"your plan"}`:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:null:null}function ji(e){return e.split("/").filter(Boolean).pop()??e}function Ni(e,t){switch(e){case"cwd":return t.cwd?ji(t.cwd):null;case"git":return t.git.state==="unknown"?null:t.git.state==="no-repo"?"No repo":t.git.dirty?`${t.git.branch} · changed`:t.git.branch;case"runtime":return t.runtime;case"model":return t.model;case"context":return t.contextPercent===null?null:`${t.contextPercent}% full`;case"cache":return t.cache===null?null:`${hs(t.cache)}% from cache`;case"usage":return gi(t.usage);case"permission":return t.permissionMode;case"connection":return`${t.connectionState} · event ${t.lastEventSeq}`;default:return null}}function bi(e){return JSON.stringify({sessionId:e.sessionId,cwd:e.cwd,git:e.git,runtime:e.runtime,model:e.model,selectedModel:e.selectedModel,effort:e.effort,fastMode:e.fastMode,permissionMode:e.permissionMode,contextPercent:e.contextPercent,contextUsage:e.contextUsage,cache:e.cache===null?null:{readTokens:e.cache.readTokens,creationTokens:e.cache.creationTokens,contextTokens:e.cache.contextTokens??null,hitPercent:hs(e.cache)},usage:e.usage,connectionState:e.connectionState,streaming:e.streaming,lifecycle:e.lifecycle,triggerPending:e.triggerPending,lastEventSeq:e.lastEventSeq,snapshotCursor:e.snapshotCursor,lastEventAt:e.lastEventAt===null?null:new Date(e.lastEventAt).toISOString(),queueDepth:e.queueDepth,subagents:e.subagents.map(t=>t.name),activeSubagents:e.activeSubagents,runningSubagentCount:e.runningSubagentCount,clientVersion:e.clientVersion,capturedAt:new Date().toISOString()},null,2)}function yi({copied:e,failed:t}){return e?s.jsx(Pt,{className:"text-status-success size-3.5","aria-hidden":!0}):t?s.jsx(Ut,{className:"text-destructive size-3.5","aria-hidden":!0}):s.jsx(an,{className:"size-3.5","aria-hidden":!0})}function vi(e,t){return e?"Copied":t?"Couldn’t copy":"Copy diagnostics"}function ki({diagnostics:e,className:t}){const{copied:n,failed:i,copy:r}=Ot(),a=()=>void r(bi(e));return s.jsxs(P,{variant:"ghost",size:"sm",className:g("gap-1.5 text-xs",t),onClick:a,children:[s.jsx(yi,{copied:n,failed:i}),vi(n,i)]})}function lr({open:e,onOpenChange:t,diagnostics:n,controls:i,promotionContext:r,urgentAction:a,overflowCount:o=0,addOns:u}){const c=zt(),{pins:m,toggle:l,reset:p}=xi(),d=fi(),v=new Set(m),b=o>0;return s.jsxs(ue,{open:e,onOpenChange:t,children:[s.jsx(Lt,{children:s.jsxs(_,{children:[s.jsx(me,{asChild:!0,children:s.jsx(R,{asChild:!0,children:s.jsxs("button",{type:"button","data-testid":"status-reveal","aria-label":b?`Chat details, ${o} more`:"Chat details",className:"text-muted-foreground/50 hover:text-muted-foreground inline-flex shrink-0 items-center justify-center gap-0.5 transition-colors duration-150 pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:[s.jsx($t,{className:"size-4"}),b&&s.jsxs("span",{className:"tabular-nums",children:["+",o]})]})})}),s.jsx(A,{side:"top",children:b?`Chat details, ${o} more`:"Chat details"})]})}),s.jsxs(pe,{side:"top",align:"end",className:"w-80 p-3","aria-label":"Chat",children:[s.jsx(he,{children:"Chat"}),a&&s.jsx(P,{variant:"secondary",className:"mb-3 w-full",disabled:a.pending,onClick:()=>{a.onAction(),t(!1)},children:a.label}),s.jsxs("div",{className:"flex flex-col gap-4",children:[u&&s.jsxs("section",{className:"space-y-1","data-testid":"session-add-ons",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:"Add-ons"}),u]}),d.map(k=>s.jsxs("section",{className:"space-y-1",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:k.label}),Ti(Si(k.items,i),c?r:null).map(N=>s.jsx(wi,{item:N,value:Ni(N.key,n),pinned:v.has(N.key),onTogglePin:ps(N)?()=>l(N.key):null,control:Ci(N.key,i)},N.key)),k.group==="diagnostics"&&s.jsxs(s.Fragment,{children:[s.jsx(Pe,{label:"Queued messages",value:String(n.queueDepth)}),s.jsx(Pe,{label:"Chat ID",value:n.sessionId||"—"})]})]},k.group))]}),n.sessionId!==""&&s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground mt-3 h-7 w-full justify-start gap-1.5 text-xs",onClick:()=>{t(!1),Ft({sessionId:n.sessionId})},children:[s.jsx(Bt,{className:"size-3.5","aria-hidden":!0}),"View notifications"]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[s.jsx(ki,{diagnostics:n}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 text-xs",disabled:m.length===0,onClick:p,children:[s.jsx(Gt,{className:"size-3.5","aria-hidden":!0}),"Reset pins"]})]})]})]})}function Ti(e,t){return t?[...e].sort((n,i)=>i.severity(t)-n.severity(t)):e}function Si(e,t){return e.filter(n=>n.key!=="plan"||t.plan!==null)}function Ci(e,t){return e==="plan"&&t.plan?s.jsx(Ht,{checked:t.plan.active,onCheckedChange:t.plan.onToggle,"aria-label":"Plan first, change nothing until approved"}):null}function wi({item:e,value:t,pinned:n,onTogglePin:i,control:r}){const a=e.icon;return s.jsxs("div",{"data-testid":`session-row-${e.key}`,className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx(a,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t??void 0,children:t??"—"}),r,i&&s.jsx("button",{type:"button",onClick:i,"aria-pressed":n,"aria-label":n?`Stop keeping ${e.label} in the status bar`:`Keep ${e.label} in the status bar`,className:g("hover:text-foreground inline-flex size-6 shrink-0 items-center justify-center rounded-md transition-colors duration-150",n?"text-foreground":"text-muted-foreground/50"),children:n?s.jsx(Fe,{className:"size-3.5"}):s.jsx(Wt,{className:"size-3.5"})})]})}function Pe({label:e,value:t}){return s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx("span",{className:"w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t,children:t})]})}function cr(e){const t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]),h.useEffect(()=>{const n=i=>{const r=i.key==="."||i.key===">";(i.metaKey||i.ctrlKey)&&i.shiftKey&&r&&(i.preventDefault(),t.current())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[])}const Ue=new WeakMap;function ze(e,t,n){let i=Ue.get(e);i||(i=new Set,Ue.set(e,i)),!i.has(t)&&(i.add(t),n())}function Le(e,t,n){let i;try{i=n()}catch(r){return ze(e,`${t}:throw`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}" threw in ${t}(); it is hidden until it stops throwing.`,r)),!1}return typeof i!="boolean"?(ze(e,`${t}:type`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}": ${t}() must return true or false, synchronously, reading only its ctx; it returned ${Ei(i)}, read as false.`)),!1):i}function Ei(e){return e instanceof Promise?"a Promise":e===null?"null":typeof e=="object"?"an object":`a ${typeof e}`}function Ii(e,t){const n=[],i=[];for(const r of e){const a=r.when?Le(r,"when",()=>r.when(t)):!0,o=a&&r.urgent?Le(r,"urgent",()=>r.urgent(t)):!1;n.push({id:r.id,visible:a,urgent:o}),a&&i.push(r)}return i.sort((r,a)=>(r.priority??0)-(a.priority??0)),{promotion:n,visible:i}}function dr(e){const t=Xt("status-bar");return h.useMemo(()=>Ii(t,e),[t,e])}function _i(e){return e!=null&&e!==!1}function ur({ctx:e,pins:t,nodes:n,density:i="full"}){var o,u;const r=new Set(t),a=[];for(const c of ms){if(c.neverInLine)continue;const m=n[c.key];if(!_i(m))continue;const l=r.has(c.key)&&ps(c);!l&&!c.promote(e)||a.push({key:c.key,cluster:c.cluster,severity:c.severity(e),pinned:l,rigid:c.rigid===!0,wide:((o=c.wide)==null?void 0:o.call(c,e))===!0,held:c.held===!0,snug:((u=c.snug)==null?void 0:u.call(c,i))===!0,node:m})}return a}function mr(){const e=h.useRef(null),[t,n]=h.useState(null);h.useLayoutEffect(()=>{const r=e.current;if(!r)return;n(r.getBoundingClientRect().width);const a=new ResizeObserver(o=>{var m,l;const u=o.at(0);if(!u)return;const c=((l=(m=u.contentBoxSize)==null?void 0:m.at(0))==null?void 0:l.inlineSize)??u.contentRect.width;n(c)});return a.observe(r),()=>a.disconnect()},[]);const i=h.useMemo(()=>ai(t),[t]);return{ref:e,budget:i}}export{Zi as A,mr as B,ki as C,Ji as D,Wi as G,Nn as M,Hi as P,Qi as R,lr as S,us as U,Xi as W,qn as a,ir as b,hs as c,sr as d,Gi as e,er as f,Vi as g,Yi as h,Fi as i,rr as j,nr as k,tr as l,ar as m,Ii as n,bi as o,or as p,oi as q,pi as r,ai as s,ur as t,gn as u,dr as v,qi as w,Ki as x,cr as y,xi as z};
|
|
21
|
+
*/const os={name:"wifi",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]};os.node;const B=Y(os);function on(e){var t;return((t=e==null?void 0:e.ui)==null?void 0:t.statusBar)??Ns}function ln(){const{data:e}=$e();return on(e)}function cn(){const e=fs(),t=Be(),n=gs({mutationKey:js,mutationFn:r=>e.updateConfig({ui:{statusBar:{pins:[...r]}}}),onMutate:async r=>{await t.cancelQueries({queryKey:O.current()});const a=t.getQueryData(O.current());return t.setQueryData(O.current(),o=>o!=null&&o.ui?{...o,ui:{...o.ui,statusBar:{pins:[...r]}}}:o),{previous:a}},onError:(r,a,o)=>{o&&o.previous!==void 0&&t.setQueryData(O.current(),o.previous)},onSettled:()=>{t.invalidateQueries({queryKey:O.current()})}});return{setPins:h.useCallback(r=>n.mutate(r),[n]),isPending:n.isPending}}const dn={duration:.2,ease:[.4,0,.2,1]},un="pointer-coarse:[&_button]:py-3",mn=1e3;function Gi({items:e,trailing:t,nameFirst:n}){const i=e.filter(a=>a.cluster==="left"),r=e.filter(a=>a.cluster==="right");return s.jsxs("div",{role:"toolbar","aria-label":"Chat status","aria-live":"polite","data-testid":"status-line",className:"text-muted-foreground flex items-center gap-2 overflow-hidden px-1 text-xs whitespace-nowrap pointer-coarse:min-h-11",children:[s.jsx(Ce,{items:i,className:g("flex-auto",n&&i.length>0?"min-w-10":"min-w-0"),style:n?{flexShrink:mn}:void 0}),s.jsx(Ce,{items:r,className:"min-w-0 shrink"}),t!==void 0&&s.jsx("span",{className:"flex shrink-0 items-center",children:t})]})}const pn=8;function hn(e,t){return pn**Math.max(0,t.indexOf(e.key))}function Ce({items:e,className:t,style:n}){const i=[...e].sort((r,a)=>a.severity-r.severity).map(r=>r.key);return s.jsx("div",{className:g("flex items-center gap-2",t),style:n,children:s.jsx(le,{initial:!1,mode:"popLayout",children:e.map((r,a)=>s.jsxs(ce.div,{"data-testid":`status-item-${r.key}`,"data-rigid":r.rigid?"true":void 0,"data-held":r.held?"true":void 0,"data-snug":r.snug?"true":void 0,layout:"position",initial:{opacity:0,scale:.8,filter:"blur(4px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},exit:{opacity:0,scale:.8,filter:"blur(4px)"},transition:dn,style:r.rigid||r.held||r.snug?void 0:{flexShrink:hn(r,i)},className:g("inline-flex items-center gap-2",r.rigid||r.held||r.snug?"shrink-0":"min-w-10",un),children:[a>0&&s.jsx(xn,{}),r.node]},r.key))})})}function xn(){return s.jsx("span",{className:"text-muted-foreground/30 shrink-0","aria-hidden":"true",children:"·"})}function Hi({cwd:e}){const t=e.split("/").filter(Boolean).pop()??e;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:e,children:[s.jsx(bs,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:t})]})}function K(e){const t=e.trim(),n=Array.from(t);return n.length<=ne?t:`${n.slice(0,ne-1).join("").trimEnd()}…`}function fn(e){return e.replace(/\s*\([^()]*\)\s*$/,"").split("·")[0].trim()}function gn(e,t){return K(jn(e,t))}function jn(e,t){const n=t.find(r=>r.value===e);if(n)return fn(n.displayName);const i=/claude-(\w+)-/.exec(e);return i?`${i[1].charAt(0).toUpperCase()}${i[1].slice(1)}`:e==="default"?"Default":ys(e)??e}function Qi({data:e,workspace:t,compact:n}){if(!e)return null;if(!vs(e))return s.jsxs("span",{className:"text-muted-foreground/50 inline-flex min-w-0 items-center gap-1",title:"Not a git repository",children:[s.jsx(X,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:"No repo"})]});const i=e.modified+e.staged+e.untracked,r=i===1?"1 change":`${i} changes`,a=[];if(e.modified>0&&a.push(`${e.modified} modified`),e.staged>0&&a.push(`${e.staged} staged`),e.untracked>0&&a.push(`${e.untracked} untracked`),e.conflicted>0&&a.push(`${e.conflicted} conflicted`),t){const u=ks(t.portBase),c=[`${t.key} · ${t.projectKey}`,`${t.branch??e.branch} · ${t.provider}`,e.ahead>0?`↑${e.ahead}`:"",e.behind>0?`↓${e.behind}`:"",a.length>0?a.join(", "):"clean",`ports ${u.DORKOS_PORT} / ${u.VITE_PORT} / ${u.SITE_PORT}`,t.pinned?"pinned":""].filter(Boolean);return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:c.join(" · "),children:[s.jsx(X,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[20ch] truncate font-medium",children:n?K(t.key):t.key}),!n&&s.jsxs("span",{className:"text-muted-foreground truncate",children:["· ",t.projectKey]}),t.pinned&&s.jsx(Fe,{className:"text-muted-foreground size-(--size-icon-xs) shrink-0"}),i>0&&(n?s.jsx(we,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}const o=a.length>0?`${e.branch} · ${a.join(", ")}`:`${e.branch} · clean`;return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",title:o,children:[s.jsx(X,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"max-w-[25ch] truncate",children:n?K(e.branch):e.branch}),e.ahead>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Ts,{className:"size-(--size-icon-xs)"}),e.ahead]}),e.behind>0&&s.jsxs("span",{className:"text-muted-foreground inline-flex shrink-0 items-center gap-0.5",children:[s.jsx(Ss,{className:"size-(--size-icon-xs)"}),e.behind]}),i>0&&(n?s.jsx(we,{label:r}):s.jsxs("span",{className:"text-muted-foreground shrink-0",children:["· ",r]}))]})}function we({label:e}){return s.jsx("span",{role:"img","aria-label":e,title:e,className:"bg-muted-foreground/70 size-1 shrink-0 rounded-full"})}function Nn({stop:e,onMakeDefault:t,onDismiss:n,pending:i,error:r,placement:a="inline"}){const o=a==="overlay";return o&&!e?null:s.jsx("div",{className:g("flex items-center px-1",o?"bg-background/95 pointer-events-auto absolute right-0 bottom-full left-0 z-20 mb-1 rounded-md py-0.5 backdrop-blur-sm":"min-h-5"),"data-testid":o?"make-default-slot-overlay":"make-default-slot",children:e&&s.jsxs("p",{role:"status","data-testid":"make-default-offer",className:g("animate-in fade-in-0 flex min-w-0 items-center gap-1.5 text-xs duration-200 motion-reduce:animate-none",r?"text-destructive":"text-muted-foreground"),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:r?s.jsxs(s.Fragment,{children:[s.jsx(de,{className:"mr-1 inline size-3 shrink-0 align-[-2px]","aria-hidden":!0}),r]}):s.jsxs(s.Fragment,{children:["Start every new chat in ",Wt(e),"?"]})})," ",s.jsxs("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[r?s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-retry",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Try again"}):s.jsx("button",{type:"button",disabled:i,onClick:t,"data-testid":"make-default-confirm",className:"focus-ring text-foreground rounded-sm underline underline-offset-2 disabled:opacity-50",children:"Make default"}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("button",{type:"button",onClick:n,"data-testid":"make-default-dismiss",className:"focus-ring hover:text-foreground rounded-sm underline underline-offset-2",children:"Dismiss"})]})]})})}function bn(e,t,n){const i=be(e,t),r=be(e,n);return!i||!r?!1:_s(r,i)?i.auto===!0&&r.auto!==!0&&r.asks!=="never":!0}const yn="Auto mode needs Opus 4.6+ or Sonnet 4.6";function Xi({mode:e,onChangeMode:t,disabled:n,pending:i,runtime:r,modelSupportsAutoMode:a,planActive:o,compact:u,makeDefault:c,onOpenChange:m}){var w;const l=We(r),p=Cs(f=>f.setControlCenterOpen),d=Ge(),v=$(f=>f.open),b=$(f=>f.setOpen),k=$(f=>f.setAvailable),N=!(l&&!l.permissionModes.supported)&&n!==!0&&i!==!0;h.useEffect(()=>(k(N),()=>k(!1)),[N,k]);const y=h.useRef(m);if(h.useEffect(()=>{y.current=m},[m]),h.useEffect(()=>()=>{var f;b(!1),(f=y.current)==null||f.call(y,!1)},[b]),l&&!l.permissionModes.supported)return null;const S=(l==null?void 0:l.permissionModes.values)??[],M=!a&&S.some(f=>f.id==="auto"),D=M?S.filter(f=>f.id!=="auto"):S,E=D.find(f=>f.id===e),C=d?S.find(f=>f.id===(l==null?void 0:l.permissionModes.default)):void 0,T=C!==void 0&&E!==void 0&&l!==void 0&&bn(l.permissionModes,E.id,C.id),x=T?C:E,I=T?`${C.label} (Wi-Fi)`:(x==null?void 0:x.label)??ws(e),J=u?K(T?C.label:I):I,Z=Gt(x),W=(w=Es(D).find(f=>f.mode.id===e))==null?void 0:w.stop,G=M&&(W==="act"||e==="auto"),z=s.jsxs("button",{disabled:n,"data-testid":"permission-mode-trigger","aria-label":`Permissions: ${I}`,className:g(F,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40",Z),children:[s.jsx(Ht,{descriptor:x,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:J})]});return n?s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:z})}),s.jsx(R,{side:"top",children:"Send a message first"})]}):i?s.jsxs("span",{"data-testid":"permission-mode-pending","aria-busy":"true","aria-label":"Permissions: still loading",className:g(F,"items-center gap-1 opacity-40"),children:[s.jsx("span",{className:"bg-muted-foreground/30 size-(--size-icon-xs) shrink-0 animate-pulse rounded-full"}),s.jsx("span",{className:"bg-muted-foreground/30 h-2 w-10 animate-pulse rounded"})]}):s.jsxs(ue,{open:v,onOpenChange:f=>{b(f),m==null||m(f)},children:[s.jsx(me,{asChild:!0,children:z}),s.jsxs(pe,{side:"top",align:"start",className:"w-80 p-3","aria-label":"Permissions",children:[s.jsx(he,{children:"Permissions"}),s.jsx(Qt,{mode:e,descriptors:D,onChangeMode:t,planActive:o,onUnlock:()=>p(!0)}),c&&s.jsx(Nn,{...c}),G&&s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsxs("p",{"data-testid":"auto-unsupported-hint",className:"text-muted-foreground text-3xs mt-2 flex items-center gap-1.5 px-1",children:[s.jsx(He,{className:"size-(--size-icon-xs) shrink-0"}),"Auto unavailable on this model"]})}),s.jsx(R,{side:"top",children:yn})]}),s.jsx(Is,{mode:e,descriptor:E,className:"mt-2 px-1"})]})]})}const Ee="On Wi-Fi · agents ask or only read",te="Over Wi-Fi, every file or shell step needs your OK, or agents only read.",vn="relative after:absolute after:top-1/2 after:left-1/2 after:size-11 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']";function qi({compact:e}){const t=Ge(),n=As();if(!t)return null;const i=s.jsxs("button",{type:"button","data-testid":"wifi-turn-cap","aria-label":`${Ee}. ${te}`,className:g("border-border text-muted-foreground inline-flex items-center gap-1 rounded-full border py-0.5",vn,n?"cursor-pointer":"cursor-default",e?"mx-1.5 px-1":"px-2","focus-visible:ring-ring outline-none focus-visible:ring-[3px]"),children:[s.jsx(B,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}),!e&&s.jsx("span",{children:Ee})]});return n?s.jsxs(Qe,{children:[s.jsx(Rs,{asChild:!0,children:i}),s.jsx(Xe,{side:"top",collisionPadding:8,"data-testid":"wifi-turn-cap-detail",className:"w-auto max-w-70 p-3 text-xs",children:te})]}):s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:i}),s.jsx(R,{side:"top",children:te})]})}const kn=6e3;function Tn(e){return e instanceof Error&&e.message||"Couldn’t save that. Try again."}function Vi(e){var W,G,z;const{sessionId:t,runtime:n,declaredModes:i,runtimeDefaultMode:r}=e,{data:a}=$e(),{data:o}=qe(),u=Xt(),c=Be(),m=Ds(t),l=ie(w=>w.dismissDefaultStopOffer),[p,d]=h.useState(null),[v,b]=h.useState(null),[k,N]=h.useState(t);k!==t&&(N(t),d(null),b(null));const y=a==null?void 0:a.executionDefaults,S=n??(y==null?void 0:y.runtime),M=(W=y==null?void 0:y.perRuntime.find(w=>w.runtime===S))==null?void 0:W.trustStop,D=M??(y==null?void 0:y.trustStop)??null,E=(G=i.find(w=>w.id===r))==null?void 0:G.stop,C=D??E,T=M!=null?(z=qt(o,S))==null?void 0:z.configSection:void 0,x=a!==void 0;h.useEffect(()=>{if(!p)return;const w=setTimeout(()=>d(null),kn);return()=>clearTimeout(w)},[p]);const I=h.useCallback(w=>{const f=i.find(xs=>xs.id===w);!f||Ms(f)||!x||m||f.stop!==C&&(b(null),d(f.stop))},[i,x,m,C,d,b]),J=h.useCallback(()=>{if(!p)return;const w=p;b(null),u.mutate({runtimes:T?{[T]:{defaultTrustStop:w}}:{defaultTrustStop:w}},{onSuccess:()=>{c.invalidateQueries({queryKey:O.all}),d(null)},onError:f=>b(Tn(f))})},[p,u,c,T,d,b]),Z=h.useCallback(()=>{l(t),d(null)},[l,t,d]);return{line:x?{stop:p,onMakeDefault:J,onDismiss:Z,pending:u.isPending,error:v}:null,offerFor:I}}function Ki({runtimeLabel:e,onShown:t,onDismiss:n}){const i=$(a=>a.available),r=$(a=>a.setOpen);return h.useEffect(()=>{t==null||t()},[t]),s.jsxs(Os,{"data-slot":"read-only-mode-notice","data-testid":"read-only-mode-notice",gap:"none",className:"flex-row flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",children:[s.jsx(Ps,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":!0}),s.jsxs("p",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:["In this mode, ",e," reads files but won’t change them. Asking won’t help."]}),s.jsxs("div",{className:"flex w-full shrink-0 flex-wrap items-center justify-end gap-1.5 sm:w-auto",children:[s.jsx(P,{variant:"ghost",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:n,children:"Dismiss"}),i&&s.jsx(P,{variant:"outline",size:"sm",responsive:!1,className:"h-7 px-2 text-xs",onClick:()=>r(!0),children:"Change permissions"})]})]})}function Yi(e,t,n){const i=We(t??void 0),r=ie(p=>p.recordReadOnlyHintShown),a=ie(p=>p.spendReadOnlyHint),o=Us(e??""),u=i==null?void 0:i.permissionModes.values.find(p=>p.id===n),c=u!==void 0&&zs(u);h.useEffect(()=>{c||!e||o!=="shown"||a(e)},[c,e,o,a]);const m=h.useCallback(()=>{e&&r(e)},[e,r]),l=h.useCallback(()=>{e&&a(e)},[e,a]);return h.useMemo(()=>({eligible:!!e&&c&&o!=="spent",runtimeLabel:t?Ls(t):"This agent",markShown:m,dismiss:l}),[e,c,o,t,m,l])}function Ji({descriptor:e,active:t,onToggle:n,disabled:i}){return s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsxs("button",{type:"button","aria-pressed":t,disabled:i,onClick:()=>n(!t),className:g(F,"items-center gap-1","disabled:cursor-not-allowed disabled:opacity-40",t&&"text-foreground"),children:[s.jsx(ns,{className:"size-(--size-icon-xs) shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label})]})}),s.jsx(R,{side:"top",children:i?"Send a message first":e.promise})]})}function Zi({runtime:e,model:t,onChangeRuntime:n,canSelect:i,compact:r,iconOnly:a,account:o}){const{data:u}=qe(),{data:c}=$s(),{nameFor:m}=Bs(),[l,p]=h.useState({open:!1}),d=Object.keys((u==null?void 0:u.capabilities)??{}),v=d.filter(x=>ye(c,x)),b=d.filter(x=>!ye(c,x)),k=u!==void 0&&Object.values(Fs).some(x=>x.setup&&!d.includes(x.type)),N=!!n&&(d.length>1||b.length>0||k),y=r?null:t,S=ee(e),M=S.icon,D=a?s.jsx(M,{"aria-hidden":!0,className:"size-(--size-icon-xs) shrink-0"}):s.jsx(Ys,{runtime:e,model:y,iconClassName:"size-(--size-icon-xs)"}),E=a?s.jsx("span",{className:"block",children:S.label}):null,C=a?s.jsx("span",{role:"img","aria-label":S.label,"data-testid":"runtime-item-icon",className:"inline-flex items-center",children:D}):D,T=o?`Account: ${m(o)}`:null;return i?N?s.jsxs(s.Fragment,{children:[s.jsxs(Ws,{children:[s.jsx(Gs,{asChild:!0,children:s.jsx("button",{className:F,"aria-label":a?`Runs on: ${S.label}`:void 0,title:a?S.label:void 0,children:D})}),s.jsxs(Hs,{side:"top",align:"start",className:"w-56",children:[s.jsx(Qs,{children:"Runs on"}),s.jsx(Xs,{value:e,onValueChange:x=>n==null?void 0:n(x),children:v.map(x=>{const I=ee(x);return s.jsx(qs,{value:x,icon:I.icon,children:I.label},x)})}),b.map(x=>{const I=ee(x);return s.jsx(ve,{icon:I.icon,description:"Connect",onSelect:()=>p({open:!0,runtime:x}),children:I.label},x)}),k&&s.jsxs(s.Fragment,{children:[s.jsx(Vs,{}),s.jsx(ve,{icon:Ks,onSelect:()=>p({open:!0}),children:"Add a runtime"})]})]})]}),s.jsx(Vt,{runtime:l.runtime,open:l.open,onOpenChange:x=>p(I=>({...I,open:x})),renderConnect:Zt,showConnectSuccess:!0,onRuntimeReady:x=>{n==null||n(x)}})]}):!T&&!E?C:s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:C}),s.jsxs(R,{side:"top",children:[E,T&&s.jsx("span",{className:"block",children:T})]})]}):s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:C}),s.jsxs(R,{side:"top",children:[E,s.jsx("span",{className:"block",children:"Set when the chat starts. It can’t change after."}),T&&s.jsx("span",{className:"block",children:T})]})]})}function er(e,t,n){const i=xe(),r=Js(e),a=new Date(i),o=t.pending?null:t.usage;return{...Zs({liveTurnUsage:n,liveTurnAt:r,accountStatus:et(o,a),accountObservedAt:Ve(Ke(o))}),accountUsage:o}}function sr({open:e,onOpenChange:t,onConfirm:n}){return s.jsx(st,{open:e,onOpenChange:t,children:s.jsxs(tt,{children:[s.jsxs(nt,{children:[s.jsxs(it,{className:"flex items-center gap-2",children:[s.jsx(He,{className:"text-muted-foreground size-4"}),"Turn on Auto mode?",s.jsx(q,{size:"xs",variant:"secondary",className:"tracking-wide uppercase",children:"Preview"})]}),s.jsx(rt,{children:"Asks only before risky steps, like deleting files. Switch back anytime."})]}),s.jsxs(at,{children:[s.jsx(ot,{children:"Cancel"}),s.jsx(lt,{onClick:n,children:"Turn on Auto mode"})]})]})})}const Ie=[{slug:"frontier",label:"Frontier"},{slug:"solid-coders",label:"Solid coders"},{slug:"quick-helpers",label:"Quick helpers"},{slug:"more-models",label:"More models"},{slug:"no-tools",label:"Can’t do agent work"}],Sn=10,Cn="Can’t use tools, so it can’t read files or run commands.",wn="Makes images DorkOS can’t show yet.",En=["openrouter/openrouter/auto","openrouter/auto"];function In(e){return En.some(t=>e.value===t||e.value.startsWith(`${t}-`))}function ls(e){return e.supportsToolUse!==!1}function _n(e){return e.supportsImageOutput===!0&&!In(e)?wn:ls(e)?null:Cn}function An(e){if(!ls(e))return"no-tools";switch(e.tier){case"frontier":return"frontier";case"solid-coder":return"solid-coders";case"quick-helper":return"quick-helpers";default:return"more-models"}}function Rn(e){return e.some(t=>t.tier!=null)||e.length>Sn}function Dn(e,t){const n=t.trim().toLowerCase();return n?e.value.toLowerCase().includes(n)||e.displayName.toLowerCase().includes(n):!0}function Mn(e){const t=new Map(Ie.map(n=>[n.slug,[]]));for(const n of e)t.get(An(n)).push(n);return Ie.map(n=>({...n,models:t.get(n.slug)})).filter(n=>n.models.length>0)}function On(e){return e>=1e6?`${Math.round(e/1e6)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function Pn(){return s.jsx("div",{className:"space-y-2","data-testid":"model-cards-skeleton",children:Array.from({length:3}).map((e,t)=>s.jsxs("div",{className:"flex items-center gap-3 rounded-xl p-3",children:[s.jsx(H,{className:"size-4 rounded-full"}),s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx(H,{className:"h-3.5 w-24"}),s.jsx(H,{className:"h-2.5 w-32"})]}),s.jsx(H,{className:"h-5 w-10 rounded-md"})]},t))})}function Un({onRetry:e,message:t}){return s.jsxs("div",{className:"flex flex-col items-center gap-3 py-6 text-center","data-testid":"model-load-error",children:[s.jsx(de,{className:"text-muted-foreground size-5"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t??"Couldn’t load the model list."}),s.jsxs("button",{onClick:e,className:"text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",children:[s.jsx(Ye,{className:"size-3"}),"Retry"]})]})}function zn(e){const t=e.slice(e.lastIndexOf(" ")+1);return t.includes("/")||t.includes(":")}function cs({text:e,className:t}){return zn(e)?s.jsx("div",{dir:"rtl",className:g("truncate text-left",t),title:e,children:s.jsx("bdi",{dir:"ltr",children:e})}):s.jsx("div",{className:g("truncate",t),title:e,children:e})}function _e({model:e,isSelected:t}){const n=_n(e);return s.jsxs("label",{className:g("flex w-full cursor-pointer items-center gap-3 rounded-xl border p-3 transition-colors duration-150",t?"bg-secondary border-foreground/15":"border-border hover:border-muted-foreground/30 hover:bg-muted/50 opacity-70"),children:[s.jsx(ut,{value:e.value,className:"shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"text-foreground line-clamp-2 text-sm font-medium break-words",children:[e.displayName,e.local&&s.jsxs("span",{className:"text-muted-foreground text-3xs ml-1.5 font-normal",children:[mt()," · private"]})]}),s.jsx(cs,{text:e.description,className:"text-muted-foreground text-2xs leading-tight"}),n&&s.jsx("div",{className:"text-2xs text-status-warning-fg mt-0.5 leading-tight","data-testid":`model-limitation-${e.value}`,children:n})]}),e.contextWindow&&s.jsx(q,{size:"xs",variant:"secondary",className:"shrink-0",children:On(e.contextWindow)})]})}function Ln({value:e}){return s.jsxs("div",{className:"space-y-1.5","data-testid":"model-unavailable-saved",children:[s.jsxs("div",{className:"border-border flex w-full items-center gap-3 rounded-xl border border-dashed p-3 opacity-80",children:[s.jsx(de,{className:"text-status-warning-fg size-4 shrink-0"}),s.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[s.jsx(cs,{text:e,className:"text-foreground min-w-0 text-sm font-medium"}),s.jsx("span",{className:"text-muted-foreground text-2xs shrink-0 font-normal",children:"(not available)"})]})]}),s.jsx("p",{className:"text-muted-foreground text-2xs leading-snug",children:"This model isn’t available anymore. Pick another."})]})}function $n({slug:e,label:t}){return s.jsx("div",{className:"text-muted-foreground text-2xs mt-2 mb-1 font-medium tracking-wide uppercase first:mt-0","data-testid":`model-group-${e}`,children:t})}function Bn({models:e,selectedModel:t,onChangeModel:n,emptyMessage:i}){const[r,a]=h.useState(""),o=Rn(e),c=e.length>0&&t.length>0&&!e.some(d=>d.value===t)?s.jsx(Ln,{value:t}):null,m=e.some(d=>d.unverified),l=h.useMemo(()=>o?e.filter(d=>Dn(d,r)):e,[e,r,o]),p=h.useMemo(()=>o?Mn(l):[],[l,o]);return e.length===0?s.jsx("div",{className:"border-border text-muted-foreground text-2xs rounded-xl border border-dashed p-3 leading-snug","data-testid":"model-catalog-unavailable",children:i??"Couldn’t load models. Check Settings, then try again."}):o?s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(Te,{}),s.jsxs("div",{className:"relative",children:[s.jsx(ct,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),s.jsx(dt,{type:"text",value:r,onChange:d=>a(d.target.value),placeholder:"Search models…","aria-label":"Search models","data-testid":"model-search",className:"h-8 pl-8 text-xs"})]}),p.length===0?s.jsx("p",{className:"text-muted-foreground py-4 text-center text-xs","data-testid":"model-search-empty",children:m?"No match in this short list. Connect a provider to see more.":"No models match"}):s.jsx(ke,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:p.map(d=>s.jsxs(h.Fragment,{children:[s.jsx($n,{slug:d.slug,label:d.label}),d.models.map(v=>s.jsx(_e,{model:v,isSelected:v.value===t},v.value))]},d.slug))})]}):s.jsxs("div",{className:"space-y-2",children:[c,m&&s.jsx(Te,{}),s.jsx(ke,{value:t,onValueChange:n,className:"grid-cols-1 gap-1.5","aria-label":"Model selection","data-testid":"model-card-list",children:e.map(d=>s.jsx(_e,{model:d,isSelected:d.value===t},d.value))})]})}const ae={none:{label:"None",description:"No reasoning"},minimal:{label:"Minimal",description:"Near-zero thinking"},low:{label:"Low",description:"Fastest responses"},medium:{label:"Medium",description:"Moderate thinking"},high:{label:"High",description:"Deep reasoning"},max:{label:"Max",description:"Maximum thinking"},xhigh:{label:"XHigh",description:"Beyond maximum"}},Fn={duration:.15,ease:"easeOut"};function Wn({effortLevels:e,effort:t,onChangeEffort:n}){return s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Effort"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Effort level",children:[s.jsx(oe,{role:"radio",label:"Default",isSelected:t===null,onClick:()=>n(null)}),e.map(i=>s.jsx(oe,{role:"radio",label:ae[i].label,description:ae[i].description,isSelected:t===i,onClick:()=>n(i)},i))]})]})}function Gn({supportsFastMode:e,fastMode:t,onChangeFastMode:n}){return e?s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-2xs mb-2 font-medium tracking-wide uppercase",children:"Mode"}),s.jsx("div",{className:"flex gap-1.5",children:s.jsx(oe,{role:"switch",label:"Fast",icon:s.jsx(ge,{className:"size-3"}),isSelected:t,onClick:()=>n(!t)})})]}):null}function oe({role:e,label:t,description:n,icon:i,isSelected:r,onClick:a}){const o=s.jsxs("button",{role:e,"aria-checked":r,onClick:a,className:g("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"),children:[i,t]});return n?s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:o}),s.jsx(R,{side:"top",className:"text-xs",children:n})]}):o}function tr({model:e,onChangeModel:t,effort:n,onChangeEffort:i,fastMode:r,onChangeFastMode:a,disabled:o,sessionId:u,runtime:c,onCredits:m,compact:l}){var C;const{data:p,isLoading:d,isError:v,refetch:b}=pt({sessionId:u,runtime:c??void 0}),k=p??[],N=k.find(T=>T.value===e),y=!!(N!=null&&N.supportsEffort&&(((C=N.supportedEffortLevels)==null?void 0:C.length)??0)>0),S=(N==null?void 0:N.supportsFastMode)??!1,M=!l&&y&&n?ae[n].label:null,D=!l&&r,E=s.jsxs("button",{disabled:o,className:g(F,"items-center gap-1 disabled:cursor-not-allowed disabled:opacity-40"),"data-testid":"model-config-trigger",children:[s.jsx(Je,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:gn(e,k)}),M&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsx(q,{size:"xs",variant:"secondary",children:M})]}),D&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground text-2xs",children:"·"}),s.jsxs(q,{size:"xs",variant:"secondary",children:[s.jsx(ge,{className:"mr-0.5 inline size-2.5"}),"Fast"]})]})]});return o?s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsx("span",{className:"inline-flex",children:E})}),s.jsx(R,{side:"top",children:"Send a message first"})]}):s.jsxs(ue,{children:[s.jsx(me,{asChild:!0,children:E}),s.jsxs(pe,{side:"top",align:"start",className:"w-120 max-w-[calc(100vw-1.5rem)] p-3","data-testid":"model-config-popover",children:[s.jsx(he,{children:"Model"}),k.some(T=>T.paidFromCredits)&&s.jsx("p",{className:"text-muted-foreground text-2xs mb-2","data-testid":"model-credits-note",children:k.some(T=>T.creditsListOutOfDate)?"Models your DorkOS credits cover. This list may be out of date.":"Models your DorkOS credits cover"}),d&&s.jsx(Pn,{}),v&&s.jsx(Un,{onRetry:()=>b(),message:m?"Couldn’t load the models DorkOS credits cover. Your model stays as it is.":void 0}),!d&&!v&&s.jsx(Bn,{models:k,selectedModel:e,onChangeModel:t,emptyMessage:m?"DorkOS credits don’t cover a model for this runtime yet.":void 0}),s.jsx(le,{children:!d&&!v&&(y||S)&&s.jsxs(ce.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:Fn,children:[s.jsx(ht,{className:"my-3"}),s.jsx("div",{className:"text-muted-foreground text-2xs mb-3 font-medium tracking-wide uppercase",children:"Configuration"}),s.jsxs("div",{className:"space-y-3",children:[y&&s.jsx(Wn,{effortLevels:N.supportedEffortLevels,effort:n,onChangeEffort:i}),S&&s.jsx(Gn,{supportsFastMode:(N==null?void 0:N.supportsFastMode)??!1,fastMode:r,onChangeFastMode:a})]})]},"config")})]})]})}function nr({percent:e,contextUsage:t,compact:n,reading:i,now:r}){const a=xt(e,t)??e,o=ft(a),u=o==="critical"?U.error:o==="warning"?U.warning:"",c=n!=null&&a>=Ze,m=t?{total:t.totalTokens,max:t.maxTokens}:i&&i.maxTokens>0?{total:i.totalTokens,max:i.maxTokens}:null,l=(i==null?void 0:i.observedAt)??null,p=m!==null,d=s.jsxs("span",{"aria-label":p?"Context window usage":void 0,className:g("inline-flex shrink-0 items-center gap-1",p&&"cursor-default",u),children:[s.jsx(sn,{className:"size-(--size-icon-xs) shrink-0"}),s.jsxs("span",{children:[a,"%"]})]});return s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[m?s.jsx(Hn,{totals:m,categories:(t==null?void 0:t.categories)??[],observedAt:l,now:r,children:d}):d,s.jsx(le,{initial:!1,children:c&&s.jsxs(ce.button,{type:"button",onClick:n.onCompact,disabled:n.pending,"aria-label":n.pending?"Compacting chat…":`Context ${a}% full. Compact now`,"aria-busy":n.pending,"data-testid":"compaction-chip",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-60",children:[s.jsx(Ye,{"aria-hidden":"true",className:g("size-(--size-icon-xs) shrink-0",n.pending&&"animate-spin")}),s.jsx("span",{className:"truncate",children:"Compact"})]},"compact")})]})}function Hn({totals:e,categories:t,observedAt:n,now:i,children:r}){const a=t.filter(o=>o.tokens>0).sort((o,u)=>u.tokens-o.tokens);return s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:r}),s.jsx(R,{side:"top",className:"max-w-64",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"text-xs font-medium",children:[se(e.total)," / ",se(e.max)," tokens"]}),a.length>0&&s.jsx("div",{className:"space-y-0.5",children:a.map(o=>s.jsxs("div",{className:"text-3xs flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx("span",{className:"inline-block size-1.5 shrink-0 rounded-full",style:{backgroundColor:o.color}}),o.name]}),s.jsx("span",{className:g(re,"shrink-0"),children:se(o.tokens)})]},o.name))}),n!==null&&s.jsx(fe,{observedAt:n,now:i,surface:"tooltip"})]})})]})}const Qn={panel:{warning:U.warning,error:U.error},tooltip:{warning:"",error:""}};function je(e){if(e.costUsd==null)return null;switch(e.costBasis){case"unknown":return"Estimated. This model has no listed price.";case"managed":return"Charged at your organization’s own rates.";default:return null}}function Ne(e){return e.costBasis==="unknown"?"Estimated chat cost":"Chat cost"}function ds({usage:e,surface:t="panel"}){const n=je(e),i=Qn[t],r=V[t];return s.jsxs(s.Fragment,{children:[e.costUsd!=null&&s.jsx(L,{label:Ne(e),labelClassName:r,children:`$${e.costUsd.toFixed(2)}`}),n&&s.jsx("div",{className:r,children:n}),e.detail&&s.jsx("div",{"data-slot":"usage-detail-note",className:i.warning||void 0,children:e.detail}),e.state==="exhausted"&&s.jsx("div",{"data-slot":"usage-limit-note",className:i.error||void 0,children:"Rate limit reached"})]})}function us({usage:e,surface:t="panel"}){const n=je(e),i=V[t];if(e.kind==="subscription"&&e.utilization!=null){const r=Math.round(e.utilization*100),a=e.resetsAt?new Date(e.resetsAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):null;return s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsxs("div",{className:"text-3xs space-y-0.5",children:[s.jsx(L,{label:"Utilization",labelClassName:i,children:`${r}%`}),e.windowLabel&&s.jsx(L,{label:"Window",labelClassName:i,children:e.windowLabel}),a&&s.jsx(L,{label:"Resets at",labelClassName:i,children:a}),s.jsx(ds,{usage:e,surface:t})]})]})}return s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:Ne(e)}),s.jsxs("div",{className:"text-3xs space-y-0.5",children:[e.costUsd!=null&&s.jsx(L,{label:"Cost",labelClassName:i,children:`$${e.costUsd.toFixed(2)}`}),n&&s.jsx("div",{className:i,children:n}),e.detail&&s.jsx("div",{className:i,children:e.detail})]})]})}function ir({usage:e,observedAt:t=null,now:n}){const i=xe(),r=n??new Date(i);if(e.kind==="subscription"&&e.utilization!=null){const m=Math.round(e.utilization*100),l=e.state==="exhausted",p=e.state==="warning"||m>=80,d=l?"text-destructive":p?"text-status-warning-fg":"",v=gt(e,t,r),b=jt(v);return s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsxs("span",{className:g("inline-flex shrink-0 cursor-default items-center gap-1",d),"aria-label":"Subscription usage","data-stale":v||void 0,children:[s.jsx(es,{className:"size-(--size-icon-xs)"}),s.jsxs("span",{className:b,children:[m,"%"]}),v&&s.jsx("span",{className:b,children:"· old"})]})}),s.jsx(R,{side:"top",className:"max-w-56",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(us,{usage:e,surface:"tooltip"}),t!==null&&s.jsx(fe,{observedAt:t,now:r,surface:"tooltip"})]})})]})}if(e.costUsd==null)return null;const o=en(e.costUsd),u=je(e),c=Ne(e);return!e.detail&&!u?s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1","aria-label":c,children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),s.jsx("span",{children:o})]}):s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsxs("span",{className:"inline-flex shrink-0 cursor-default items-center gap-1","aria-label":c,children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),s.jsx("span",{children:o})]})}),s.jsx(R,{side:"top",className:"max-w-56",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:c}),u&&s.jsx("div",{className:g(V.tooltip,"text-3xs"),children:u}),e.detail&&s.jsx("div",{className:g(V.tooltip,"text-3xs"),children:e.detail})]})})]})}function rr({usage:e,accountUsage:t=null,observedAt:n=null,open:i,onOpenChange:r,now:a}){const o=xe(),u=a??new Date(o),c=Ke(t),m=c.length>0?Ve(c):n,l=e!=null&&ss(e);let p;return c.length>0?p=s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-medium",children:"Subscription usage"}),s.jsx("div",{className:"flex flex-col gap-2.5",children:c.map(d=>s.jsx(Nt,{window:d,label:bt(d.key,d.label),now:u},d.key))}),e&&s.jsx("div",{className:"text-3xs space-y-0.5",children:s.jsx(ds,{usage:e})})]}):l?p=s.jsx(us,{usage:e}):p=s.jsx("p",{className:"text-muted-foreground text-xs",children:"No usage yet."}),s.jsxs(Qe,{open:i,onOpenChange:r,children:[s.jsx(yt,{asChild:!0,children:s.jsx("span",{"aria-hidden":!0,className:"inline-block h-0 w-0"})}),s.jsx(Xe,{side:"top",align:"end",className:"w-72 max-w-[calc(100vw-1.5rem)]","aria-label":"Usage and cost",children:s.jsxs("div",{className:"space-y-2",children:[p,m!==null&&(c.length>0||l)&&s.jsx(fe,{observedAt:m,now:u})]})})]})}const Xn={connecting:{color:Q.warning,label:"Connecting",shortLabel:"Connecting",icon:B,tasks:!0},connected:{color:Q.success,label:"Connected",shortLabel:"Connected",icon:B,tasks:!1},reconnecting:{color:Q.warning,label:"Reconnecting",shortLabel:"Reconnecting",icon:B,tasks:!0},disconnected:{color:Q.error,label:"Live updates lost",shortLabel:"Offline",icon:vt,tasks:!1}};function ar({connectionState:e,compact:t}){const n=Xn[e],i=n.icon;return s.jsxs(Kt,{openDelay:200,children:[s.jsx(Yt,{asChild:!0,children:s.jsxs("span",{className:"flex min-w-0 cursor-default items-center gap-1.5 text-xs",children:[s.jsx("span",{className:g("size-1.5 shrink-0 rounded-full",n.color,n.tasks&&"animate-breath")}),s.jsx("span",{className:"text-muted-foreground truncate",children:t?n.shortLabel:n.label})]})}),s.jsx(Jt,{side:"top",align:"center",className:"w-72 p-3",children:s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx(i,{className:g("mt-0.5 size-4 shrink-0",e==="disconnected"?U.error:U.warning)}),s.jsxs("div",{className:"min-w-0 space-y-1.5",children:[s.jsx("p",{className:"text-sm font-medium",children:n.label}),s.jsx(qn,{connectionState:e})]})]})})]})}function qn({connectionState:e}){const t="text-muted-foreground text-xs leading-relaxed";return e==="connecting"?s.jsx("p",{className:t,children:"Connecting to live updates. New messages appear once connected."}):e==="reconnecting"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Live updates dropped and are reconnecting. Nothing is lost."}),s.jsx("p",{className:g(t,"text-muted-foreground/70"),children:"No action needed."})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("p",{className:t,children:"Can’t reach live updates. New messages appear once they’re back."}),s.jsx("p",{className:g(t,"text-muted-foreground/70"),children:"Still trying. If this lasts, check that DorkOS is running."})]})}function or({count:e,running:t,waiting:n}){const i=e===1?"":"s",r=e-t.length,a=`${e} subagent${i} running`;return s.jsxs(_,{children:[s.jsx(A,{asChild:!0,children:s.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1","aria-label":a,children:[s.jsx(ts,{className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"shrink-0 tabular-nums",children:e})]})}),s.jsxs(R,{side:"top",className:"max-w-64",children:[n&&s.jsx("p",{className:"mb-1 font-medium",children:"Still working. The agent continues when they finish."}),s.jsx("ul",{className:"space-y-1",children:t.map(o=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:o.description??"Working…"}),s.jsxs("p",{className:g(re,"text-3xs leading-tight"),children:[o.toolUses??0," tool",o.toolUses===1?"":"s",o.lastToolName?` · last ${o.lastToolName}`:""]})]},o.taskId))}),r>0&&s.jsx("p",{className:g(re,"text-3xs leading-tight"),children:t.length>0?`and ${r} more`:`${r} task${i} from earlier`})]})]})}const Ae=648,Vn=440,Kn=340,Yn=3,Jn=3,Zn=2,ei=4,si=8,ti=20,ni=ne*si+ti,ii=Number.POSITIVE_INFINITY,Re=[],ri=["cwd"],De=["cwd","git"];function ai(e){if(e===null||e<=0)return{density:"full",rightBudget:ii,dropped:Re};if(e>=Ae){const t=Math.floor((e-Ae)/ni);return{density:"full",rightBudget:ei+t,dropped:Re}}return e>=Vn?{density:"compact",rightBudget:Yn,dropped:ri}:e>=Kn?{density:"identity",rightBudget:Jn,dropped:De}:{density:"avatar",rightBudget:Zn,dropped:De}}function oi(e){return e==="identity"||e==="avatar"}function li(e,t){return t.severity!==e.severity?t.severity-e.severity:Number(t.pinned)-Number(e.pinned)}const ci=2,di=2;function lr(e,t){const n=new Set(t.dropped),i=t.density!=="full",r=l=>i&&l.held,a=e.filter(l=>l.cluster==="right"),o=new Set;let u=0,c=0;const m=[...a].sort((l,p)=>Number(r(p))-Number(r(l))||li(l,p));for(const l of m){if(c>=t.rightBudget)break;const p=l.rigid||r(l);p&&u>=ci||(p&&(u+=1),o.add(l.key),c+=l.wide?Math.min(di,t.rightBudget-c):1)}return{items:e.filter(l=>l.cluster==="right"?o.has(l.key):!n.has(l.key)).map(l=>l.held===r(l)?l:{...l,held:r(l)}),overflow:a.length-o.size}}const ui=new Set(["main","master"]);function cr(e,t,n){return{dirty:!t,onDefaultBranch:!n&&ui.has(e)}}const j={AGENT_ANCHOR:1e3,CONNECTION_LOST:100,CONTEXT_CRITICAL:90,ACCOUNT_ATTENTION:85,USAGE_EXHAUSTED:80,PERMISSION_BYPASS:70,CONTEXT_WARNING:50,USAGE_WARNING:50,PERMISSION_ELEVATED:40,PLAN_ACTIVE:40,SUBAGENTS_RUNNING:35,EXTENSION_ITEM:35,RUNTIME_NON_DEFAULT:30,GIT_DIRTY:20,MODEL:10,CWD:5,QUIET:0},mi={session:"Session",diagnostics:"Diagnostics"};function Me(e){return e.runtime&&!e.runtime.isDefault?j.RUNTIME_NON_DEFAULT:j.QUIET}function pi(e){return e.account!==null}const hi=new Set(["near","model-out","out"]);function Oe(e){return e.permissionDescriptor?e.permissionDescriptor.stop!=="ask":e.permissionMode!=="default"}const ms=[{key:"agent",label:"Agent",description:"Who you are talking to",cluster:"left",group:null,icon:Tt,promote:()=>!0,severity:()=>j.AGENT_ANCHOR},{key:"cwd",label:"Directory",description:"The folder this chat can touch",cluster:"left",group:"session",icon:St,promote:e=>e.cwd!==null,severity:()=>j.CWD},{key:"git",label:"Git",description:"Branch and uncommitted changes",cluster:"left",group:"session",icon:X,promote:e=>e.git!==null&&(e.git.dirty||!e.git.onDefaultBranch),severity:e=>{var t;return(t=e.git)!=null&&t.dirty?j.GIT_DIRTY:j.QUIET}},{key:"runtime",label:"Runs on",description:"What runs this chat",cluster:"right",group:"session",icon:tn,promote:e=>e.runtime!==null&&e.runtime.type!=="doe"&&(!e.runtime.isDefault||e.runtime.canSelect),severity:Me,snug:oi},{key:"account",label:"Account",description:"Which Claude account this uses, and what’s left",cluster:"right",group:null,icon:nn,promote:e=>e.account!==null,severity:e=>e.account&&hi.has(e.account.chipState)?j.ACCOUNT_ATTENTION:Me(e)},{key:"extensions",label:"Add-ons",description:"What your extensions show here",cluster:"right",group:null,icon:Ct,promote:e=>e.extensionItems.some(t=>t.visible),severity:e=>e.extensionItems.some(t=>t.visible&&t.urgent)?j.ACCOUNT_ATTENTION:j.EXTENSION_ITEM},{key:"model",label:"Model",description:"The model answering you",cluster:"right",group:"session",icon:Je,promote:()=>!1,severity:()=>j.MODEL},{key:"cache",label:"Cache",description:"How much came from cache",cluster:"right",group:"session",icon:ge,promote:()=>!1,severity:()=>j.QUIET,neverInLine:!0},{key:"context",label:"Context",description:"How full the context window is",cluster:"right",group:"session",icon:rn,rigid:!0,promote:e=>e.contextPercent!==null,severity:e=>e.contextPercent===null?j.QUIET:e.contextPercent>=Ze?j.CONTEXT_CRITICAL:e.contextPercent>=Et?j.CONTEXT_WARNING:j.QUIET},{key:"usage",label:"Usage & cost",description:"Plan limits or chat cost",cluster:"right",group:"session",icon:es,rigid:!0,promote:e=>e.usage!==null&&ss(e.usage)&&!pi(e),wide:e=>e.usageStale,severity:e=>{var t,n;return((t=e.usage)==null?void 0:t.state)==="exhausted"?j.USAGE_EXHAUSTED:((n=e.usage)==null?void 0:n.state)==="warning"?j.USAGE_WARNING:j.QUIET}},{key:"permission",label:"Permissions",description:"How freely the agent acts",cluster:"right",group:"session",icon:wt,held:!0,promote:e=>Oe(e)||e.permissionPickerOpen===!0||e.onWifi===!0,severity:e=>(e.permissionDescriptor?It(e.permissionDescriptor):_t(e.permissionMode))?j.PERMISSION_BYPASS:Oe(e)||e.permissionPickerOpen===!0||e.onWifi===!0?j.PERMISSION_ELEVATED:j.QUIET},{key:"plan",label:"Plan",description:"Plan first, change nothing until approved",cluster:"right",group:"session",icon:ns,promote:e=>e.plan!==null,severity:e=>{var t;return(t=e.plan)!=null&&t.active?j.PLAN_ACTIVE:j.QUIET},snug:()=>!0},{key:"subagents",label:"Subagents",description:"Subagents working on this turn",cluster:"right",group:"diagnostics",icon:ts,rigid:!0,promote:e=>e.subagentsInFlight>0,severity:e=>e.subagentsInFlight>0?j.SUBAGENTS_RUNNING:j.QUIET},{key:"connection",label:"Live updates",description:"The live link that delivers messages",cluster:"right",group:"diagnostics",icon:B,promote:e=>e.connectionState!=="connected",severity:e=>e.connectionState==="connected"?j.QUIET:j.CONNECTION_LOST}];function ps(e){return e.group==="session"&&e.neverInLine!==!0}function xi(){const{pins:e}=ln(),{setPins:t}=cn(),n=h.useCallback(r=>{const a=kt.find(o=>o===r);a&&t(e.includes(a)?e.filter(o=>o!==a):[...e,a])},[e,t]),i=h.useCallback(()=>t([]),[t]);return{pins:e,toggle:n,reset:i}}function fi(){return["session","diagnostics"].map(t=>({group:t,label:mi[t],items:ms.filter(n=>n.group===t)})).filter(t=>t.items.length>0)}function hs(e){const t=e.contextTokens??e.readTokens+e.creationTokens;return t<=0?0:Math.round(e.readTokens/t*100)}function gi(e){return e?e.kind==="subscription"&&e.utilization!=null?`${Math.round(e.utilization*100)}% of ${e.windowLabel??"your plan"}`:e.costUsd!=null?`$${e.costUsd.toFixed(2)}`:null:null}function ji(e){return e.split("/").filter(Boolean).pop()??e}function Ni(e,t){switch(e){case"cwd":return t.cwd?ji(t.cwd):null;case"git":return t.git.state==="unknown"?null:t.git.state==="no-repo"?"No repo":t.git.dirty?`${t.git.branch} · changed`:t.git.branch;case"runtime":return t.runtime;case"model":return t.model;case"context":return t.contextPercent===null?null:`${t.contextPercent}% full`;case"cache":return t.cache===null?null:`${hs(t.cache)}% from cache`;case"usage":return gi(t.usage);case"permission":return t.permissionMode;case"connection":return`${t.connectionState} · event ${t.lastEventSeq}`;default:return null}}function bi(e){return JSON.stringify({sessionId:e.sessionId,cwd:e.cwd,git:e.git,runtime:e.runtime,model:e.model,selectedModel:e.selectedModel,effort:e.effort,fastMode:e.fastMode,permissionMode:e.permissionMode,contextPercent:e.contextPercent,contextUsage:e.contextUsage,cache:e.cache===null?null:{readTokens:e.cache.readTokens,creationTokens:e.cache.creationTokens,contextTokens:e.cache.contextTokens??null,hitPercent:hs(e.cache)},usage:e.usage,connectionState:e.connectionState,streaming:e.streaming,lifecycle:e.lifecycle,triggerPending:e.triggerPending,lastEventSeq:e.lastEventSeq,snapshotCursor:e.snapshotCursor,lastEventAt:e.lastEventAt===null?null:new Date(e.lastEventAt).toISOString(),queueDepth:e.queueDepth,subagents:e.subagents.map(t=>t.name),activeSubagents:e.activeSubagents,runningSubagentCount:e.runningSubagentCount,clientVersion:e.clientVersion,capturedAt:new Date().toISOString()},null,2)}function yi({copied:e,failed:t}){return e?s.jsx(Rt,{className:"text-status-success size-3.5","aria-hidden":!0}):t?s.jsx(Dt,{className:"text-destructive size-3.5","aria-hidden":!0}):s.jsx(an,{className:"size-3.5","aria-hidden":!0})}function vi(e,t){return e?"Copied":t?"Couldn’t copy":"Copy diagnostics"}function ki({diagnostics:e,className:t}){const{copied:n,failed:i,copy:r}=At(),a=()=>void r(bi(e));return s.jsxs(P,{variant:"ghost",size:"sm",className:g("gap-1.5 text-xs",t),onClick:a,children:[s.jsx(yi,{copied:n,failed:i}),vi(n,i)]})}function dr({open:e,onOpenChange:t,diagnostics:n,controls:i,promotionContext:r,urgentAction:a,overflowCount:o=0,addOns:u}){const c=Mt(),{pins:m,toggle:l,reset:p}=xi(),d=fi(),v=new Set(m),b=o>0;return s.jsxs(ue,{open:e,onOpenChange:t,children:[s.jsx(Ot,{children:s.jsxs(_,{children:[s.jsx(me,{asChild:!0,children:s.jsx(A,{asChild:!0,children:s.jsxs("button",{type:"button","data-testid":"status-reveal","aria-label":b?`Chat details, ${o} more`:"Chat details",className:"text-muted-foreground/50 hover:text-muted-foreground inline-flex shrink-0 items-center justify-center gap-0.5 transition-colors duration-150 pointer-coarse:min-h-11 pointer-coarse:min-w-11",children:[s.jsx(Pt,{className:"size-4"}),b&&s.jsxs("span",{className:"tabular-nums",children:["+",o]})]})})}),s.jsx(R,{side:"top",children:b?`Chat details, ${o} more`:"Chat details"})]})}),s.jsxs(pe,{side:"top",align:"end",className:"w-80 p-3","aria-label":"Chat",children:[s.jsx(he,{children:"Chat"}),a&&s.jsx(P,{variant:"secondary",className:"mb-3 w-full",disabled:a.pending,onClick:()=>{a.onAction(),t(!1)},children:a.label}),s.jsxs("div",{className:"flex flex-col gap-4",children:[u&&s.jsxs("section",{className:"space-y-1","data-testid":"session-add-ons",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:"Add-ons"}),u]}),d.map(k=>s.jsxs("section",{className:"space-y-1",children:[s.jsx("h3",{className:"text-muted-foreground px-1 text-xs font-medium tracking-wide uppercase",children:k.label}),Ti(Si(k.items,i),c?r:null).map(N=>s.jsx(wi,{item:N,value:Ni(N.key,n),pinned:v.has(N.key),onTogglePin:ps(N)?()=>l(N.key):null,control:Ci(N.key,i)},N.key)),k.group==="diagnostics"&&s.jsxs(s.Fragment,{children:[s.jsx(Pe,{label:"Queued messages",value:String(n.queueDepth)}),s.jsx(Pe,{label:"Chat ID",value:n.sessionId||"—"})]})]},k.group))]}),n.sessionId!==""&&s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground mt-3 h-7 w-full justify-start gap-1.5 text-xs",onClick:()=>{t(!1),zt({sessionId:n.sessionId})},children:[s.jsx(Ut,{className:"size-3.5","aria-hidden":!0}),"View notifications"]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[s.jsx(ki,{diagnostics:n}),s.jsxs(P,{variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 text-xs",disabled:m.length===0,onClick:p,children:[s.jsx(Lt,{className:"size-3.5","aria-hidden":!0}),"Reset pins"]})]})]})]})}function Ti(e,t){return t?[...e].sort((n,i)=>i.severity(t)-n.severity(t)):e}function Si(e,t){return e.filter(n=>n.key!=="plan"||t.plan!==null)}function Ci(e,t){return e==="plan"&&t.plan?s.jsx(Bt,{checked:t.plan.active,onCheckedChange:t.plan.onToggle,"aria-label":"Plan first, change nothing until approved"}):null}function wi({item:e,value:t,pinned:n,onTogglePin:i,control:r}){const a=e.icon;return s.jsxs("div",{"data-testid":`session-row-${e.key}`,className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx(a,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e.label}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t??void 0,children:t??"—"}),r,i&&s.jsx("button",{type:"button",onClick:i,"aria-pressed":n,"aria-label":n?`Stop keeping ${e.label} in the status bar`:`Keep ${e.label} in the status bar`,className:g("hover:text-foreground inline-flex size-6 shrink-0 items-center justify-center rounded-md transition-colors duration-150",n?"text-foreground":"text-muted-foreground/50"),children:n?s.jsx(Fe,{className:"size-3.5"}):s.jsx($t,{className:"size-3.5"})})]})}function Pe({label:e,value:t}){return s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-sm",children:[s.jsx("span",{className:"w-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"shrink-0",children:e}),s.jsx("span",{className:"min-w-0 flex-1"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",title:t,children:t})]})}function ur(e){const t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]),h.useEffect(()=>{const n=i=>{const r=i.key==="."||i.key===">";(i.metaKey||i.ctrlKey)&&i.shiftKey&&r&&(i.preventDefault(),t.current())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[])}const Ue=new WeakMap;function ze(e,t,n){let i=Ue.get(e);i||(i=new Set,Ue.set(e,i)),!i.has(t)&&(i.add(t),n())}function Le(e,t,n){let i;try{i=n()}catch(r){return ze(e,`${t}:throw`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}" threw in ${t}(); it is hidden until it stops throwing.`,r)),!1}return typeof i!="boolean"?(ze(e,`${t}:type`,()=>console.warn(`[extensions] ${e.extensionId}'s status-bar item "${e.id}": ${t}() must return true or false, synchronously, reading only its ctx; it returned ${Ei(i)}, read as false.`)),!1):i}function Ei(e){return e instanceof Promise?"a Promise":e===null?"null":typeof e=="object"?"an object":`a ${typeof e}`}function Ii(e,t){const n=[],i=[];for(const r of e){const a=r.when?Le(r,"when",()=>r.when(t)):!0,o=a&&r.urgent?Le(r,"urgent",()=>r.urgent(t)):!1;n.push({id:r.id,visible:a,urgent:o}),a&&i.push(r)}return i.sort((r,a)=>(r.priority??0)-(a.priority??0)),{promotion:n,visible:i}}function mr(e){const t=Ft("status-bar");return h.useMemo(()=>Ii(t,e),[t,e])}function _i(e){return e!=null&&e!==!1}function pr({ctx:e,pins:t,nodes:n,density:i="full"}){var o,u;const r=new Set(t),a=[];for(const c of ms){if(c.neverInLine)continue;const m=n[c.key];if(!_i(m))continue;const l=r.has(c.key)&&ps(c);!l&&!c.promote(e)||a.push({key:c.key,cluster:c.cluster,severity:c.severity(e),pinned:l,rigid:c.rigid===!0,wide:((o=c.wide)==null?void 0:o.call(c,e))===!0,held:c.held===!0,snug:((u=c.snug)==null?void 0:u.call(c,i))===!0,node:m})}return a}function hr(){const e=h.useRef(null),[t,n]=h.useState(null);h.useLayoutEffect(()=>{const r=e.current;if(!r)return;n(r.getBoundingClientRect().width);const a=new ResizeObserver(o=>{var m,l;const u=o.at(0);if(!u)return;const c=((l=(m=u.contentBoxSize)==null?void 0:m.at(0))==null?void 0:l.inlineSize)??u.contentRect.width;n(c)});return a.observe(r),()=>a.disconnect()},[]);const i=h.useMemo(()=>ai(t),[t]);return{ref:e,budget:i}}export{sr as A,hr as B,ki as C,er as D,Qi as G,Nn as M,Xi as P,Ki as R,dr as S,us as U,qi as W,Xn as a,ar as b,hs as c,nr as d,Hi as e,tr as f,Ji as g,Zi as h,Gi as i,or as j,rr as k,ir as l,lr as m,Ii as n,bi as o,cr as p,oi as q,pi as r,ai as s,pr as t,gn as u,mr as v,Vi as w,Yi as x,ur as y,xi as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as o,a6 as s,aS as a}from"./index-
|
|
1
|
+
import{a5 as o,a6 as s,aS as a}from"./index-BR1m9FON.js";const c=6e4,u={view:"mine"};function l(e={},t={}){const r=o();return s({queryKey:a.list(e),queryFn:()=>r.listTodos(e),refetchInterval:c,enabled:t.enabled??!0})}function y(e={}){const t=o(),{data:r}=s({queryKey:a.list(u),queryFn:()=>t.listTodos(u),select:n=>n.badge,refetchInterval:c,enabled:e.enabled??!0});return r??0}function i(e,t={}){const r=o();return s({queryKey:a.one(e),queryFn:async()=>{try{return await r.getTodo(e)}catch(n){if(n.status===404)return null;throw n}},enabled:t.enabled??!0})}export{i as a,y as b,l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{fw as A,fx as u,fy as h,r as i,fz as C,fA as V,fB as x,fC as k,fD as l}from"./index-BR1m9FON.js";function E(...t){const s=!Array.isArray(t[0]),e=s?0:-1,n=t[0+e],o=t[1+e],r=t[2+e],c=t[3+e],f=A(o,r,c);return s?f(n):f}function L(t){const s=u(()=>h(t)),{isStatic:e}=i.useContext(C);if(e){const[,n]=i.useState(t);i.useEffect(()=>s.on("change",n),[])}return s}function d(t,s){const e=L(s()),n=()=>e.set(s());return n(),V(()=>{const o=()=>k.preRender(n,!1,!0),r=t.map(c=>c.on("change",o));return()=>{r.forEach(c=>c()),x(n)}}),e}function b(t){l.current=[],t();const s=d(l.current,t);return l.current=void 0,s}function I(t,s,e,n){if(typeof t=="function")return b(t);if(e!==void 0&&!Array.isArray(e)&&typeof s!="function")return S(t,s,e,n);const c=typeof s=="function"?s:E(s,e,n),f=Array.isArray(t)?y(t,c):y([t],([m])=>c(m)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof s!="function"&&Array.isArray(e)&&(n==null?void 0:n.clamp)!==!1&&(f.accelerate={...a,times:s,keyframes:e,isTransformed:!0}),f}function y(t,s){const e=u(()=>[]);return d(t,()=>{e.length=0;const n=t.length;for(let o=0;o<n;o++)e[o]=t[o].get();return s(e)})}function S(t,s,e,n){const o=u(()=>Object.keys(e)),r=u(()=>({}));for(const c of o)r[c]=I(t,s,e[c],n);return r}export{I as a,L as u};
|
package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a5 as a,a6 as l,a7 as r,ar as o,a8 as s}from"./index-
|
|
1
|
+
import{a5 as a,a6 as l,a7 as r,ar as o,a8 as s}from"./index-BR1m9FON.js";import{B as d}from"./use-bindings-gLHRNAFU.js";const u=["relay","unclaimed-chats"];function m(e){return[...u,e]}function y(e="pending",t=!0){const n=a();return l({queryKey:m(e),queryFn:()=>n.listUnclaimedChats(e),enabled:t})}function U(){const e=r(),t=()=>{e.invalidateQueries({queryKey:[...u]})};o("relay_chat_unclaimed",t),o("relay_chat_unclaimed_burst",t)}function i(e){e.invalidateQueries({queryKey:[...u]})}function p(){const e=a(),t=r();return s({mutationFn:({id:n,input:c})=>e.claimUnclaimedChat(n,c),meta:{suppressErrorToast:!0},onSuccess:()=>{i(t),t.invalidateQueries({queryKey:[...d]})}})}function v(){const e=a(),t=r();return s({mutationFn:n=>e.ignoreUnclaimedChat(n),meta:{errorLabel:"Couldn’t ignore this chat"},onSuccess:()=>i(t)})}function f(){const e=a(),t=r();return s({mutationFn:n=>e.blockUnclaimedChat(n),meta:{errorLabel:"Couldn’t block this chat"},onSuccess:()=>i(t)})}function q(){const e=a(),t=r();return s({mutationFn:n=>e.leaveUnclaimedChat(n),meta:{errorLabel:"Couldn’t leave this chat"},onSuccess:()=>i(t)})}export{u as U,U as a,p as b,v as c,f as d,q as e,y as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a5 as n,a7 as s,a8 as u,aI as o,aJ as r}from"./index-BR1m9FON.js";function c(){const e=n(),t=s();return u({mutationKey:o,mutationFn:a=>e.updateConfig(a),onSuccess:()=>{t.invalidateQueries({queryKey:r.current()})}})}export{c as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a7 as f,r as n,ap as i,aq as o}from"./index-
|
|
1
|
+
import{a7 as f,r as n,ap as i,aq as o}from"./index-BR1m9FON.js";function a(r,u){return r.findAll(u.filters).map(e=>u.select?u.select(e):e.state)}function p(r={},u){const e=f(u).getMutationCache(),c=n.useRef(r),t=n.useRef(null);return t.current===null&&(t.current=a(e,r)),n.useEffect(()=>{c.current=r}),n.useSyncExternalStore(n.useCallback(l=>e.subscribe(()=>{const s=i(t.current,a(e,c.current));t.current!==s&&(t.current=s,o.schedule(l))}),[e]),()=>t.current,()=>t.current)}export{p as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ni}from"./chunk-XXDRQBXY-
|
|
1
|
+
import{g as Ni}from"./chunk-XXDRQBXY-r2xNhaKz.js";import{s as Ci}from"./chunk-VQ5W62QI-ZoILnIYi.js";import{g as Zs,s as jt,a as Qs,b as Gt,v as bi,t as vi,_ as u,E as je,l as _i,c as en,q as Mi,r as xi,u as wi,j as Ui,A as Pi,P as Di,D as Fi,M as Bi,F as $i,K as ji,bj as Gi}from"./mermaid.core-DUIkdbeL.js";import{s as Wi}from"./transform-BqqRT-Iy.js";import"./index-BR1m9FON.js";import"./BlintzCanvas-7E5uwVms.js";import"./index-CfKSlYjb.js";import"./index-D5Qmx1JR.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class x extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class J extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof J)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof x)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class Me{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case J:return this.visitRepetitionWithSeparator(t);case x:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof x||s instanceof se||s instanceof ne||s instanceof J||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof x||s instanceof J?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof J)return"MANY_SEP";if(s instanceof x)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof J)this.walkManySep(n,a,t);else if(n instanceof x)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function qe(s){if(s instanceof K)return qe(s.referencedRule);if(s instanceof k)return Ji(s);if(Hi(s))return Yi(s);if(Xi(s))return qi(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(qe(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function qi(s){const e=s.definition.map(t=>qe(t));return[...new Set(e.flat())]}function Ji(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),o=qe(r);this.follows[i]=o}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function y(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=y("0");s<=y("9");s++)gt.push(s);const At=[y("_")].concat(gt);for(let s=y("a");s<=y("z");s++)At.push(s);for(let s=y("A");s<=y("Z");s++)At.push(s);const Os=[y(" "),y("\f"),y(`
|
|
2
2
|
`),y("\r"),y(" "),y("\v"),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y(" "),y("\u2028"),y("\u2029"),y(" "),y(" "),y(" "),y("\uFEFF")],sa=/[0-9a-fA-F]/,tt=/[0-9]/,na=/[1-9]/;class ia{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Fe(n,"global");break;case"i":Fe(n,"ignoreCase");break;case"m":Fe(n,"multiLine");break;case"u":Fe(n,"unicode");break;case"y":Fe(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Se(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return ta()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Se(t);break}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[y(`
|
|
3
3
|
`),y("\r"),y("\u2028"),y("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=gt;break;case"D":e=gt,t=!0;break;case"s":e=Os;break;case"S":e=Os,t=!0;break;case"w":e=At;break;case"W":e=At,t=!0;break}if(Se(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=y("\f");break;case"n":e=y(`
|
|
4
4
|
`);break;case"r":e=y("\r");break;case"t":e=y(" ");break;case"v":e=y("\v");break}if(Se(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:y("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:y(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b8 as Wt,s as Kt,g as Ht,v as Yt,t as Xt,a as Zt,b as Jt,_ as S,M as St,R as Qt,ar as $t,ag as te,ah as ee,ai as ne,d as se,A as ie,O as re,P as oe}from"./mermaid.core-B2hil_4a.js";import{s as rt}from"./transform-BqqRT-Iy.js";import"./index-BwTGkJbK.js";import"./BlintzCanvas-CMzZnmWK.js";import"./index-Dpu2CORc.js";import"./index-Di-MIFQG.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},D={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Ot(I,s,e,i,h),D=Lt(k,f,M)}const X={};f.forEach(I=>{I.label&&(X[I.sets]=I.label)});function G(I){if(I.sets in X)return X[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const H=I.sets.map(Q=>{let W=V[Q],Y=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+Y.x*C,y:W.y*(1-C)+Y.y*C,radius:W.radius*(1-C)+Y.radius*C}});return wt(H,y)}}const R=B.selectAll(".venn-area").data(f,I=>I.sets),N=R.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=N.append("path"),L=N.append("text").attr("class","label").text(I=>G(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const F=_.selectAll("text").filter(I=>I.sets in D).text(I=>G(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(z?"on"in F?F.on("end",ot(k,G)):F.each("end",ot(k,G)):F.each(ot(k,G)));const A=P(R.exit()).remove();typeof R.transition=="function"&&A.selectAll("path").attrTween("d",q);const Z=A.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),F.style("font-size",p),Z.style("font-size","0px")),{circles:k,textCentres:D,nodes:R,enter:N,update:_,exit:A}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{b8 as Wt,s as Kt,g as Ht,v as Yt,t as Xt,a as Zt,b as Jt,_ as S,M as St,R as Qt,ar as $t,ag as te,ah as ee,ai as ne,d as se,A as ie,O as re,P as oe}from"./mermaid.core-DUIkdbeL.js";import{s as rt}from"./transform-BqqRT-Iy.js";import"./index-BR1m9FON.js";import"./BlintzCanvas-7E5uwVms.js";import"./index-CfKSlYjb.js";import"./index-D5Qmx1JR.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,r=0;const o=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];r+=(h.x+a.x)*(a.y-h.y);const p={x:(a.x+h.x)/2,y:(a.y+h.y)/2};let d=null;for(let m=0;m<a.parentIndex.length;++m)if(h.parentIndex.includes(a.parentIndex[m])){const y=t[a.parentIndex[m]],M=Math.atan2(a.x-y.x,a.y-y.y),E=Math.atan2(h.x-y.x,h.y-y.y);let T=E-M;T<0&&(T+=2*Math.PI);const w=E-T/2;let g=K(p,{x:y.x+y.radius*Math.sin(w),y:y.y+y.radius*Math.cos(w)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:a,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(o.push(d),i+=lt(d.circle.radius,d.width),h=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(K(t[u],l)>Math.abs(l.radius-t[u].radius)){h=!0;break}h?i=r=0:(i=l.radius*l.radius*Math.PI,o.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=o,n.innerPoints=e,n.intersectionPoints=s),i+r}function ae(t,n){return n.every(s=>K(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function K(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=K(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),o=Math.sqrt(e*e-r*r),l=t.x+r*(n.x-t.x)/s,h=t.y+r*(n.y-t.y)/s,u=-(n.y-t.y)*(o/s),a=-(n.x-t.x)*(o/s);return[{x:l+u,y:h-a},{x:l-u,y:h+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,o=t(n),l=t(s);let h=s-n;if(o*l>0)throw"Initial bisect points must have opposite signs";if(o===0)return n;if(l===0)return s;for(let u=0;u<i;++u){h/=2;const a=n+h,p=t(a);if(p*o>=0&&(n=a),Math.abs(h)<r||p===0)return a}return n+h}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt(tt(t,t))}function ht(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,o=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,p=s.sigma!==void 0?s.sigma:.5;let d;const m=n.length,y=new Array(m+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let v=0;v<m;++v){const c=n.slice();c[v]=c[v]?c[v]*i:r,y[v+1]=c,y[v+1].fx=t(c),y[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)y[m][c]=v[c];y[m].fx=v.fx}const E=(v,c)=>v.fx-c.fx,T=n.slice(),w=n.slice(),g=n.slice(),b=n.slice();for(let v=0;v<e;++v){if(y.sort(E),s.history){const x=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});x.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:x})}d=0;for(let x=0;x<m;++x)d=Math.max(d,Math.abs(y[0][x]-y[1][x]));if(Math.abs(y[0].fx-y[m].fx)<o&&d<l)break;for(let x=0;x<m;++x){T[x]=0;for(let f=0;f<m;++f)T[x]+=y[f][x];T[x]/=m}const c=y[m];if(J(w,1+h,T,-h,c),w.fx=t(w),w.fx<y[0].fx)J(b,1+u,T,-u,c),b.fx=t(b),b.fx<w.fx?M(b):M(w);else if(w.fx>=y[m-1].fx){let x=!1;if(w.fx>c.fx?(J(g,1+a,T,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*h,T,a*h,c),g.fx=t(g),g.fx<w.fx?M(g):x=!0),x){if(p>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-p,y[0],p,y[f]),y[f].fx=t(y[f])}}else M(w)}return y.sort(E),{fx:y[0].fx,x:y[0]}}function ue(t,n,s,e,i,r,o){const l=s.fx,h=tt(s.fxprime,n);let u=l,a=l,p=h,d=0;i=i||1,r=r||1e-6,o=o||.1;function m(y,M,E){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||u>=E)M=i;else{if(Math.abs(p)<=-o*h)return i;p*(M-y)>=0&&(M=y),y=i,E=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),p=tt(e.fxprime,n),u>l+r*i*h||y&&u>=a)return m(d,i,a);if(Math.abs(p)<=-o*h)return i;if(p>=0)return m(i,d,u);a=u,d=i,i*=2}return i}function he(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let o,l,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),o=e.fxprime.slice(),ht(o,e.fxprime,-1);for(let a=0;a<u;++a){if(h=ue(t,o,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ht(o,e.fxprime,-1);else{J(r,1,i.fxprime,-1,e.fxprime);const p=tt(e.fxprime,e.fxprime),d=Math.max(0,tt(r,i.fxprime)/p);J(o,d,o,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||et,i=fe(t,n),r=s(i,n),o=Object.keys(r),l=[];for(const a of o)l.push(r[a].x),l.push(r[a].y);const u=zt(a=>{const p={};for(let d=0;d<o.length;++d){const m=o[d];p[m]={x:a[2*d],y:a[2*d+1],radius:r[m].radius}}return e(p,i)},l,n).x;for(let a=0;a<o.length;++a){const p=o[a];r[p].x=u[2*a],r[p].y=u[2*a+1]}return r}const Rt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function fe(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const a=String(h.sets[u]);l.set(a,h.size+(l.get(a)||0));for(let p=u+1;p<h.sets.length;p++){const d=String(h.sets[p]),m=`${a};${d}`,y=`${d};${a}`;l.set(m,h.size+(l.get(m)||0)),l.set(y,h.size+(l.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=l.get(i(h.sets)))}const r=[],o=new Set;for(const l of e)if(l.sets.length===1)r.push(l.sets[0]);else if(l.sets.length===2){const h=l.sets[0],u=l.sets[1];o.add(i(l.sets)),o.add(i([u,h]))}r.sort((l,h)=>l===h?0:l<h?-1:1);for(let l=0;l<r.length;++l){const h=r[l];for(let u=l+1;u<r.length;++u){const a=r[u];o.has(i([h,a]))||e.push({sets:[h,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const o=s[r.sets[0]],l=s[r.sets[1]],h=Math.sqrt(n[o].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ft(h,u,r.size);e[o][l]=e[l][o]=a;let p=0;r.size+1e-10>=Math.min(n[o].size,n[l].size)?p=1:r.size<=1e-10&&(p=-1),i[o][l]=i[l][o]=p}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const o=t[2*r],l=t[2*r+1];for(let h=r+1;h<s.length;++h){const u=t[2*h],a=t[2*h+1],p=s[r][h],d=e[r][h],m=(u-o)*(u-o)+(a-l)*(a-l),y=Math.sqrt(m),M=m-p*p;d>0&&y<=p||d<0&&y>=p||(i+=2*M*M,n[2*r]+=4*M*(o-u),n[2*r+1]+=4*M*(l-a),n[2*h]+=4*M*(u-o),n[2*h+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=ye(t,n),r=e(i,t),o=e(s,t);r+1e-8<o&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:r,constraints:o}=de(t,e,i);const l=ut(r.map(ut))/r.length;r=r.map(d=>d.map(m=>m/l));const h=(d,m)=>ge(d,m,r,o);let u=null;for(let d=0;d<s;++d){const m=ct(r.length*2).map(Math.random),y=he(h,m,n);(!u||y.fx<u.fx)&&(u=y)}const a=u.x,p={};for(let d=0;d<e.length;++d){const m=e[d];p[m.sets[0]]={x:a[2*d]*l,y:a[2*d+1]*l,radius:Math.sqrt(m.size/Math.PI)}}if(n.history)for(const d of n.history)ht(d.x,l);return p}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const p of t)if(p.sets.length===1){const d=p.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:p.size,radius:Math.sqrt(p.size/Math.PI)},i[d]=[]}t=t.filter(p=>p.sets.length===2);for(const p of t){let d=p.weight!=null?p.weight:1;const m=p.sets[0],y=p.sets[1];p.size+Rt>=Math.min(e[m].size,e[y].size)&&(d=0),i[m].push({set:y,size:p.size,weight:d}),i[y].push({set:m,size:p.size,weight:d})}const r=[];Object.keys(i).forEach(p=>{let d=0;for(let m=0;m<i[p].length;++m)d+=i[p][m].size*i[p][m].weight;r.push({set:p,size:d})});function o(p,d){return d.size-p.size}r.sort(o);const l={};function h(p){return p.set in l}function u(p,d){e[d].x=p.x,e[d].y=p.y,l[d]=!0}u({x:0,y:0},r[0].set);for(let p=1;p<r.length;++p){const d=r[p].set,m=i[d].filter(h),y=e[d];if(m.sort(o),m.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<m.length;++a){const w=e[m[a].set],g=ft(y.radius,w.radius,m[a].size);M.push({x:w.x+g,y:w.y}),M.push({x:w.x-g,y:w.y}),M.push({y:w.y+g,x:w.x}),M.push({y:w.y-g,x:w.x});for(let b=a+1;b<m.length;++b){const v=e[m[b].set],c=ft(y.radius,v.radius,m[b].size),x=Tt({x:w.x,y:w.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,T=M[0];for(const w of M){e[d].x=w.x,e[d].y=w.y;const g=s(e,t);g<E&&(E=g,T=w)}u(T,d)}return e}function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const o=t[e.sets[0]],l=t[e.sets[1]];i=xt(o.radius,l.radius,K(o,l))}else i=st(e.sets.map(o=>t[o]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],h=t[e.sets[1]];i=xt(l.radius,h.radius,K(l,h))}else i=st(e.sets.map(l=>t[l]));const r=e.weight!=null?e.weight:1,o=Math.log((i+1)/(e.size+1));s+=r*o*o}return s}function me(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const o of t)o.x-=i,o.y-=r}if(t.length===2&&K(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),o=Math.sin(i);for(const l of t){const h=l.x,u=l.y;l.x=r*h-o*u,l.y=o*h+r*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const o of t){var e=(o.x+r*o.y)/(1+r*r);o.x=2*e-o.x,o.y=2*e*r-o.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,r){const o=n(i),l=n(r);o.parent=l}for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const o=t[i].radius+t[r].radius;K(t[i],t[r])+1e-10<o&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((r,o)=>Math.max(r,o[s]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((r,o)=>Math.min(r,o[s]-o.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let r=e.bounds;const o=(r.xRange.max-r.xRange.min)/50;function l(u,a,p){if(!u)return;const d=u.bounds;let m,y;if(a)m=r.xRange.max-d.xRange.min+o;else{m=r.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;M<0&&(m+=M)}if(p)y=r.yRange.max-d.yRange.min+o;else{y=r.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=m,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)l(i[h],!0,!1),l(i[h+1],!1,!0),l(i[h+2],!0,!0),h+=3,r=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const r=Ft(t);n-=2*e,s-=2*e;const{xRange:o,yRange:l}=dt(r);if(o.max===o.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const m=Math.sqrt(i/Math.PI)*2;h=n/m,u=s/m}else h=n/(o.max-o.min),u=s/(l.max-l.min);const a=Math.min(u,h),p=(n-(o.max-o.min)*a)/2,d=(s-(l.max-l.min)*a)/2;return Nt(r.map(m=>({radius:a*m.radius,x:e+p+(m.x-o.min)*a,y:e+d+(m.y-l.min)*a,setid:m.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,r=1e3,o=Math.PI/2,l=!0,h=null,u=!0,a=!0,p=null,d=null,m=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],w=0,g=function(x){if(x in E)return E[x];var f=E[x]=T[w];return w+=1,w>=T.length&&(w=0),f},b=At,v=et;function c(x){let f=x.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(C=>O.has(C)));let k={},D={};if(f.length>0){let I=b(f,{lossFunction:v,distinct:m});l&&(I=Dt(I,o,d)),k=Ot(I,s,e,i,h),D=Lt(k,f,M)}const X={};f.forEach(I=>{I.label&&(X[I.sets]=I.label)});function G(I){if(I.sets in X)return X[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const B=x.select("svg");n?B.attr("viewBox",`0 0 ${s} ${e}`):B.attr("width",s).attr("height",e);const V={};let z=!1;B.selectAll(".venn-area path").each(function(I){const C=this.getAttribute("d");I.sets.length==1&&C&&!m&&(z=!0,V[I.sets[0]]=Me(C))});function q(I){return C=>{const H=I.sets.map(Q=>{let W=V[Q],Y=k[Q];return W||(W={x:s/2,y:e/2,radius:1}),Y||(Y={x:s/2,y:e/2,radius:1}),{x:W.x*(1-C)+Y.x*C,y:W.y*(1-C)+Y.y*C,radius:W.radius*(1-C)+Y.radius*C}});return wt(H,y)}}const R=B.selectAll(".venn-area").data(f,I=>I.sets),N=R.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),j=N.append("path"),L=N.append("text").attr("class","label").text(I=>G(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(j.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function P(I){return typeof I.transition=="function"?I.transition("venn").duration(r):I}let _=x;z&&typeof _.transition=="function"?(_=P(x),_.selectAll("path").attrTween("d",q)):_.selectAll("path").attr("d",I=>wt(I.sets.map(C=>k[C])),y);const F=_.selectAll("text").filter(I=>I.sets in D).text(I=>G(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(z?"on"in F?F.on("end",ot(k,G)):F.each("end",ot(k,G)):F.each(ot(k,G)));const A=P(R.exit()).remove();typeof R.transition=="function"&&A.selectAll("path").attrTween("d",q);const Z=A.selectAll("text").attr("x",s/2).attr("y",e/2);return p!==null&&(L.style("font-size","0px"),F.style("font-size",p),Z.style("font-size","0px")),{circles:k,textCentres:D,nodes:R,enter:N,update:_,exit:A}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(m=x,c):m},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(p=x,c):p},c.round=function(x){return arguments.length?(y=x,c):y},c.duration=function(x){return arguments.length?(r=x,c):r},c.layoutFunction=function(x){return arguments.length?(b=x,c):b},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(h=x,c):h},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(o=x,c):o},c.orientationOrder=function(x){return arguments.length?(d=x,c):d},c.lossFunction=function(x){return arguments.length?(v=x==="default"?et:x==="logRatio"?Ct:x,c):v},c}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",o=r.split(/\s+/).reverse(),h=(r.length+o.length)/3;let u=o.pop(),a=[u],p=0;const d=1.1;e.textContent=null;const m=[];function y(g){const b=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return b.textContent=g,m.push(b),e.append(b),b}let M=y(u);for(;u=o.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=y(u),p++)}const E=.35-p*d/2,T=e.getAttribute("x"),w=e.getAttribute("y");m.forEach((g,b)=>{g.setAttribute("x",T),g.setAttribute("y",w),g.setAttribute("dy",`${E+b*d}em`)})}}function at(t,n,s){let e=n[0].radius-K(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-K(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=K(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],r=at(e[0],t,n);for(let a=1;a<e.length;++a){const p=at(e[a],t,n);p>=r&&(i=e[a],r=p)}const o=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:o[0],y:o[1]};let h=!0;for(const a of t)if(K(l,a)>a.radius){h=!1;break}for(const a of n)if(K(l,a)<a.radius){h=!1;break}if(h)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let o=e+1;o<s.length;++o){const l=s[o],h=t[l],u=K(r,h);u+h.radius<=r.radius+1e-10?n[l].push(i):u+r.radius<=h.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let r=0;r<n.length;++r){const o=n[r].sets,l={},h={};for(let d=0;d<o.length;++d){l[o[d]]=!0;const m=i[o[d]];for(let y=0;y<m.length;++y)h[m[y]]=!0}const u=[],a=[];for(let d in t)d in l?u.push(t[d]):d in h||a.push(t[d]);const p=jt(u,a,s);e[o]=p,p.disjoint&&n[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|