@p4code/cli 0.8.11 → 0.8.13
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.mjs +1 -1
- package/dist/{binCli-DY9l0jFs.mjs → binCli-B9aQxlIK.mjs} +1865 -1492
- package/dist/client/.vite/manifest.json +2144 -2145
- package/dist/client/assets/AlertDialogRoot-DvQNG7Nt.js +2 -0
- package/dist/client/assets/{AnimatedHeight-D-OJUoBJ.js → AnimatedHeight-CH-N3JTc.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-B_P0_qZ6.js → AuthSurfaceShell-CJdXkxyH.js} +2 -2
- package/dist/client/assets/{CSPContext-D8hlJ4eS.js → CSPContext-4VAD2_gc.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-fMcoYEDa.js → ChatGptUsageButton-7u9uPgbK.js} +2 -2
- package/dist/client/assets/ChatMarkdown-C22JFyYa.js +65 -0
- package/dist/client/assets/CheckboxIndicator-ClY0P0ol.js +2 -0
- package/dist/client/assets/CodexSetupSection.logic-CEAT7YdZ.js +2 -0
- package/dist/client/assets/{CollapsiblePanel-kfl4yLKn.js → CollapsiblePanel-Cubscn-a.js} +2 -2
- package/dist/client/assets/ComboboxClear-qTthzuJh.js +2 -0
- package/dist/client/assets/{CommandBlock-BI3ZCXsB.js → CommandBlock-CWt29kmi.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-BkRvKIiZ.js → ComposerPromptEditor-Bt_L4smq.js} +44 -44
- package/dist/client/assets/{CompositeRoot-B9Xvst63.js → CompositeRoot-DUqf78yV.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-DtKQQSMi.js → ConnectionStatusDot-cdpNRZhA.js} +2 -2
- package/dist/client/assets/{DevicePanel-B_jOvmeL.js → DevicePanel-CZm-f5TC.js} +2 -2
- package/dist/client/assets/{DeviceSetup-BXjqCO_9.js → DeviceSetup-BdrkGme6.js} +2 -2
- package/dist/client/assets/{DialogTitle-BzKEBo4W.js → DialogTitle-CQU6s1Wy.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-D_1Iw0oL.js → DiffCommentAnnotation-B-XoYYxb.js} +2 -2
- package/dist/client/assets/{DiffFileTree-D6386u9x.js → DiffFileTree-CwTkSU3R.js} +2 -2
- package/dist/client/assets/DiffPanel-BCI9XXpF.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-Cw5WeG1t.js → DiffWorkerPoolProvider-OPZsOibX.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-Drkomo9K.js → EmbeddedDesign-DwRAPHYl.js} +4 -4
- package/dist/client/assets/{EnvironmentMachineIcon-COX4G5YJ.js → EnvironmentMachineIcon-DCdlTSYU.js} +2 -2
- package/dist/client/assets/{ExpandableText-BHihVj6x.js → ExpandableText-BtdwzlFy.js} +3 -3
- package/dist/client/assets/{FieldControl-CIaYJhnp.js → FieldControl-BI2gK4Z0.js} +2 -2
- package/dist/client/assets/{FileDiff-FK4mtyx3.js → FileDiff-BkJG5QAe.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-ncsuf7iX.js → FilePreviewPanel-CURtQAD1.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-CRlh3-BO.js → FoldedSettingsSection-B9B8i8Gg.js} +2 -2
- package/dist/client/assets/{FormContext-DTtr4Y3v.js → FormContext-Bgwez2tv.js} +2 -2
- package/dist/client/assets/{Icons-BFyKltvl.js → Icons-B5JVkp3z.js} +2 -2
- package/dist/client/assets/Input-BQRZG5rU.js +2 -0
- package/dist/client/assets/{KeybindingsSettings.logic-_oQM9Dzv.js → KeybindingsSettings.logic-6lVDnd1N.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-8d3l2unf.js → NoProjectsHero-CkhVaJk9.js} +2 -2
- package/dist/client/assets/PanelLayoutControls-CxuV0JO3.js +216 -0
- package/dist/client/assets/{PierreEntryIcon-DtlkLdir.js → PierreEntryIcon-CPG-jnaN.js} +2 -2
- package/dist/client/assets/PopoverHandle-CBT8hFut.js +2 -0
- package/dist/client/assets/PreviewPanel-Doh1peEu.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-DfhAk0_Y.js +2 -0
- package/dist/client/assets/{ProjectFavicon-YdOZ4g5-.js → ProjectFavicon-DUW6Bo66.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-C23nnU1a.js → ProjectIconPickerDialog-C613hnVY.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-BMGWdmjv.js → ProjectMonogram-B9iJhcVp.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-YztsMr2F.js → ProviderAuthTerminal-eq346NX_.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-S_tiGeLH.js → ProviderModelPicker-DPb-88ui.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-C3nbCFfS.js → ProviderSettingsForm-DTYqzs8W.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-BBz0FfLD.js +6 -0
- package/dist/client/assets/{ReadOnlySourcePreview-BNe8pyVf.js → ReadOnlySourcePreview-CkeeLVAm.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-DEgVmtJL.js → RenderErrorBoundary-mfAvIiFU.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-CISo4C7r.js → ScheduledTasksSettings-BMUE9M9Z.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-eWB5GlaA.js → ScopedSwitch-BKOdsllO.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-SeZ1sx-t.js → ScrollAreaCorner-CoeXGFSL.js} +2 -2
- package/dist/client/assets/{SecretInput-D0DyMDSw.js → SecretInput-CROqj1gF.js} +2 -2
- package/dist/client/assets/SelectScrollUpArrow-SDOpV3nj.js +2 -0
- package/dist/client/assets/{SettingsPanels-DA7lXl0N.js → SettingsPanels-BHhMJaVc.js} +6 -6
- package/dist/client/assets/{SettingsPanels.logic-lCZaJhKM.js → SettingsPanels.logic-BwmY39Sq.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-BAtVWG0d.js → SettingsScopeNotice-DAPsshab.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-nabxuL18.js → T3ConnectAccountPages-CDuVbE2z.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-CSVR5Zot.js → T3ConnectSidebarSignIn-BSQHp-Xq.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BMtL4rIt.js → ThemeEditorPanel-BiuI7Uiy.js} +3 -3
- package/dist/client/assets/ThreadTerminalDrawer-B8n6TAqv.js +5 -0
- package/dist/client/assets/TooltipViewport-BKD6QABG.js +2 -0
- package/dist/client/assets/{Virtualizer-Bi8p4Z6E.js → Virtualizer-CTnacEby.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-B0Ap9wKu.js → WorkspaceBreadcrumb-BmVcurpi.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-COKQZB3N.js → WorkspacePageContainer-BSjVd7h4.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-BDzzcsWQ.js → WorkspacePageHeader-BLYOcS9Z.js} +2 -2
- package/dist/client/assets/_chat-z348gvgF.js +45 -0
- package/dist/client/assets/{_chat.index-k4jctzPr.js → _chat.index-CBbUzaK7.js} +2 -2
- package/dist/client/assets/{_chat.new-BlFtqZqt.js → _chat.new-7TTfcDf1.js} +2 -2
- package/dist/client/assets/_chat.pull-requests-BE7Q2lUu.js +2 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-BVKlsgtX.js → abnfDiagram-VCTEODGH-HaXM7twL.js} +2 -2
- package/dist/client/assets/{alert-B2wk0CaO.js → alert-5swcxUBm.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-CiMEl2LX.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-zBJWGViu.js → architectureDiagram-5GKGNRK7-BhWXFsXS.js} +2 -2
- package/dist/client/assets/assets-DXnV2oRj.js +2 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BdiAAtHi.js → blockDiagram-I7D4REHJ-D213N9iF.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CqGVWa5a.js → browserHistoryStore-DURO3U2L.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CINrbcxi.js → browserLinkTarget-DcGx3A8F.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-CqnmSo8f.js → c4Diagram-7LVT6UL2-58POuQV-.js} +2 -2
- package/dist/client/assets/channel-CDbYAV2D.js +2 -0
- package/dist/client/assets/{checkbox-DU_a7ZnJ.js → checkbox-1tz9neVf.js} +2 -2
- package/dist/client/assets/{chunk-4HAMMTFA-BpyojyCk.js → chunk-4HAMMTFA-Bcwcw8Wz.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-LBmwoUvq.js → chunk-75Z2AOVW-BaYdZ0Fq.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-zhv2Vnfx.js → chunk-DU6HZSFF-B6TRgw4-.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-K5uPeDhv.js → chunk-F27PBJKO-B5arSwg6.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CAAu3Cn5.js → chunk-GMAD6QVW-XeNCd3gb.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-Br_UAx49.js → chunk-GVQU2GXP-CWVbbWh7.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-Kqfxrrdn.js → chunk-IMKFNOWR-Cb-yxIAE.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-D1cWO7rm.js → chunk-L3NEJ4N5-Di7nZhzu.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-BiMJbcHf.js → chunk-OSK3NFVY-DcqBXKUK.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-BuGzzo3g.js → chunk-P2QGCYS3-DJ1kMiTY.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-C_w0mNLk.js → chunk-POPQ4Y6H-Ba9RYr-b.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-CJFd7LKC.js → chunk-PWAF6VOD-D4Ch07S8.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-Beev3ZeU.js → chunk-SHT3W25Y-BafMUZgc.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-BqpBEmtK.js → chunk-SVP7TREG-CsEVe0s3.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-B0vIU1Au.js → chunk-TICWLB2K-D3tgdZlp.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cdtwlmxc.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cdtwlmxc.js +2 -0
- package/dist/client/assets/{color-picker-CYOS1hwQ.js → color-picker-N6f_Hu7P.js} +2 -2
- package/dist/client/assets/{combobox-CZradSHe.js → combobox-B07cVaQY.js} +2 -2
- package/dist/client/assets/{command-BB0IyhBc.js → command-B70eQIps.js} +2 -2
- package/dist/client/assets/{connect-DGwXUKTk.js → connect-Vt7wlrih.js} +2 -2
- package/dist/client/assets/{connect-agent-DFwOzcLG.js → connect-agent-CX70rAkF.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-BjcFswd0.js → cynefin-OW5HDTMX-CU8HnD4F.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BDWLg5Tt.js → cynefinDiagram-5FMLGOSQ-Cvc6_oYZ.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-DZpVjkDw.js → dagre-GXQ25YYZ-Bx5buWLS.js} +2 -2
- package/dist/client/assets/device-BgvBRE7C.js +2 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-BpVs-kYJ.js → diagram-S7CK7UJ4-CPZrAy0P.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-EN7yKI08.js → diagram-UQ7AKVKN-kBtSnHpL.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-B2oljv94.js → diagram-VSXAHHWV-DQP2q1tS.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-BIl0lJ6d.js → diagram-VX7I27RA-DRUN0yEk.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-B8uoK-O5.js → diagram-Z3DM3KII-D4WMsQZZ.js} +2 -2
- package/dist/client/assets/{dialog-x5a5g_fa.js → dialog-DmneyTGi.js} +2 -2
- package/dist/client/assets/{diffRendering-DeZLcalP.js → diffRendering-iR2meoVj.js} +2 -2
- package/dist/client/assets/{discovery-list-Bn1UyUNL.js → discovery-list-ZGkddsst.js} +2 -2
- package/dist/client/assets/{dist-Bd1WIVAz.js → dist-vr51zfzA.js} +3 -3
- package/dist/client/assets/{draft-input-CwXvLRjL.js → draft-input-DHZ1J7B_.js} +2 -2
- package/dist/client/assets/{duoViewer-BZ7rNqkx.js → duoViewer-DTVry3xd.js} +2 -2
- package/dist/client/assets/{dynamic-BMz3CcWG.js → dynamic-CuoX2JEO.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-BQcQotuk.js → ebnfDiagram-PWID7BFC-BNUtunQw.js} +2 -2
- package/dist/client/assets/{embeddedScripts-Cek5ppgQ.js → embeddedScripts-BMvBWRz_.js} +2 -2
- package/dist/client/assets/{empty-C-FrtXzi.js → empty-hFNkAHps.js} +2 -2
- package/dist/client/assets/entities-7B8nzlQw.js +2 -0
- package/dist/client/assets/{environments-Dm2_6Uan.js → environments-DYIXXf7q.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-Y5XhNz9b.js → erDiagram-RLTQ6QDP-DHjjowZq.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-DNKqiuCf.js +1 -0
- package/dist/client/assets/{fileLinks-1xYacDKI.js → fileLinks-BYi-XNUG.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-B24BhRqA.js → fileTreeExpansion-DIOxQqDo.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-CbOoDtR7.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DqWb0OUJ.js → ganttDiagram-EL5Y4UJY-DEPOqoj0.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CCYVAWRm.js → getDiffFileInput-DMj15wpy.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-5lcY1dZk.js → gitGraph-4MIJSDKK-BGKW_zhb.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BJKz_rGI.js → gitGraphDiagram-WWUBYQGX-7UhsI5zi.js} +2 -2
- package/dist/client/assets/{guideRunStore-BhlldU3q.js → guideRunStore-BEkwZ9H7.js} +2 -2
- package/dist/client/assets/{htmlRender-Egw4Y-80.js → htmlRender-BxVc1PlI.js} +2 -2
- package/dist/client/assets/{index-Dc7GC03y.js → index-C_MVyH59.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-BWnMlmF7.js → info-A6RAGUB7-jvyzx_4e.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-DKW68xDy.js → infoDiagram-27XIBGKW-lTTpu3as.js} +2 -2
- package/dist/client/assets/{input-DhWmPSxf.js → input-RqvQJ9gh.js} +2 -2
- package/dist/client/assets/{input-group-D4qHaxH8.js → input-group-BFtrsedw.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-dRMCvDN0.js → ishikawaDiagram-5VMMS53U-DlrQNGG9.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-CAxCpgF5.js → journeyDiagram-3NMN7TZE-Buy9e-fU.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-BaSkJW47.js → kanban-definition-UXKFOSKX-1KgAXH0g.js} +2 -2
- package/dist/client/assets/{kbd-I5TavBvc.js → kbd-BnsXAHsc.js} +2 -2
- package/dist/client/assets/{keybindings-B3kvDAJC.js → keybindings-BtHOXkP-.js} +2 -2
- package/dist/client/assets/{lazyRouteComponent-ZmKiS4iU.js → lazyRouteComponent-T0YE6Rn9.js} +2 -2
- package/dist/client/assets/{line-B59oA22i.js → line-DUV1hs6X.js} +2 -2
- package/dist/client/assets/{link-DQB3a7WC.js → link-gKYnbTYT.js} +2 -2
- package/dist/client/assets/{linkedPrompt-Cqfqh2Aq.js → linkedPrompt-Da8rJho3.js} +2 -2
- package/dist/client/assets/main-Bh6Hj0_-.js +30 -0
- package/dist/client/assets/{main-Ch-SjebX.css → main-CoSpTpWL.css} +1 -1
- package/dist/client/assets/{mediaReference-DRC-8GdL.js → mediaReference-CLlAiRVc.js} +2 -2
- package/dist/client/assets/{mediaSource-DWSwwPfV.js → mediaSource-BTCWn94E.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-DcamukpZ.js → mermaid-parser.core-CsBuWV4-.js} +4 -4
- package/dist/client/assets/{mermaid.core-C6GXL70P.js → mermaid.core-BcICv5EB.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-CEVz3xGI.js → mindmap-definition-YA3MSWOX-BqCqe4io.js} +2 -2
- package/dist/client/assets/number-field-DIYUxout.js +2 -0
- package/dist/client/assets/{observeResize-Cpph8C0G.js → observeResize-D9ECzP-D.js} +2 -2
- package/dist/client/assets/{onboarding-CLIRA2Sa.js → onboarding-COQ6KgRG.js} +2 -2
- package/dist/client/assets/{openFileInPreview-uS9Qgrru.js → openFileInPreview-BhRAqg63.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-CIYnqKbl.js → p4ProjectFile-z5Hlq99W.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-B9XAEihD.js → packet-AYTQ26CC-BYCaPqFA.js} +1 -1
- package/dist/client/assets/{pair-DTfs9_4K.js → pair-BDKjGij-.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-tcLsMhrs.js → pegDiagram-XKGWAZYB-CqCw5Z-L.js} +2 -2
- package/dist/client/assets/{phoneViewer-wYjPQP4U.js → phoneViewer-DLSM0QXE.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-B3ig0TFp.js → pie-WAS4IAKB-BfOlqQx1.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-uaJgfQOp.js → pieDiagram-E7YTZNPT-DZpCrUQF.js} +2 -2
- package/dist/client/assets/{pierre-icons-Dav7jMBk.js → pierre-icons-BG7vd34x.js} +2 -2
- package/dist/client/assets/{popover-Bc0WvoPP.js → popover-DE9WCm99.js} +2 -2
- package/dist/client/assets/{preview-IWIgXHdy.js → preview-Cl-7ojv-.js} +2 -2
- package/dist/client/assets/{preview-C4lGbDhm.js → preview-bd-MGMMz.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-CTOOyQLc.js → previewMiniPlayerStore-Bz1T9oVV.js} +2 -2
- package/dist/client/assets/primary-BwHoAoya.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-DtOYGRkF.js +2 -0
- package/dist/client/assets/projectFilesQueryState-BP_JvI7-.js +2 -0
- package/dist/client/assets/projectScriptEditor-BGLshibY.js +2 -0
- package/dist/client/assets/{providerSkills-C7CtJefh.js → providerSkills-DxYtwoxJ.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-DGX-Sd8d.js → pullRequestDetail.logic-C_aVDAY_.js} +4 -4
- package/dist/client/assets/{pullRequestIcons-BaQbmCBu.js → pullRequestIcons-D5Yo5Zsn.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-wpVYihKr.js → pullRequestReviewStore-DaEzt1m1.js} +2 -2
- package/dist/client/assets/{pullRequests-BbD7hNlR.js → pullRequests-D0no1PZS.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BOFUpnyi.js → quadrantDiagram-AXDQQJYC-BTtuOXlL.js} +2 -2
- package/dist/client/assets/queries-DkmaXOL-.js +2 -0
- package/dist/client/assets/query-Bd5_Y_Vy.js +2 -0
- package/dist/client/assets/{radar-RG4KPBEZ--djmIj49.js → radar-RG4KPBEZ-BiJgnIUY.js} +1 -1
- package/dist/client/assets/radio-group-CBunNtTU.js +2 -0
- package/dist/client/assets/{railroad-74A4TZTK-DMMw049f.js → railroad-74A4TZTK-C0CA0mcr.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BtC_0p6z.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-IeTBC6cs.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DLoLKYq3.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-Df9rhhFk.js → railroadDiagram-O6MQD6OU-WczOSoF4.js} +2 -2
- package/dist/client/assets/{renderScheduler-b0pOdWwc.js → renderScheduler-BLjFSKnt.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-BtGYMd7U.js → requirementDiagram-BXWQKSXE-B3qCIQP5.js} +2 -2
- package/dist/client/assets/{rightPanelStore-37-59X44.js → rightPanelStore-6-YhsfkE.js} +2 -2
- package/dist/client/assets/runtime-Bni_zt6P.js +2 -0
- package/dist/client/assets/runtime-D8mKjOP-.js +6 -0
- package/dist/client/assets/{runtimeModeConfig-DF8wod3s.js → runtimeModeConfig-C3q8YqVA.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D7_y-s_u.js → sankeyDiagram-P5KCCOFB-e2-j7ERe.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-CvvQA-b7.js → scheduledTasksSettings.logic-BNC897-_.js} +3 -3
- package/dist/client/assets/{scroll-area-BDT5qfX2.js → scroll-area-Davaj52_.js} +2 -2
- package/dist/client/assets/{select-BQxcmO_1.js → select-B47XfaxQ.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-AuXrX-b5.js → sequenceDiagram-WJ2MYXX4-DG7-8UJk.js} +2 -2
- package/dist/client/assets/server-CaLEm3Wt.js +2 -0
- package/dist/client/assets/{session-Bc1P10r_.js → session-2CRBJwS7.js} +2 -2
- package/dist/client/assets/{session-logic-BNtU33qU.js → session-logic-BLOBsHEA.js} +4 -4
- package/dist/client/assets/{settings-CZSrxmjf.js → settings-BIwaDm1N.js} +2 -2
- package/dist/client/assets/settings.appearance-ToUM8fHh.js +2 -0
- package/dist/client/assets/settings.archived-Cq_qclay.js +2 -0
- package/dist/client/assets/{settings.computer-use-BAzpb53_.js → settings.computer-use-BEghs16L.js} +2 -2
- package/dist/client/assets/settings.connections-C_LVk0gJ.js +2 -0
- package/dist/client/assets/{settings.data-controls-DIkcwUy1.js → settings.data-controls-BaTil8NB.js} +2 -2
- package/dist/client/assets/{settings.decisions-BN9ozN_A.js → settings.decisions-JTbMt08J.js} +2 -2
- package/dist/client/assets/settings.diagnostics-ByG62ZGs.js +2 -0
- package/dist/client/assets/settings.general-BT78z_Cn.js +2 -0
- package/dist/client/assets/{settings.integrations-CT3opViE.js → settings.integrations-C3jj2T1d.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BBTkicWk.js → settings.keybindings-CeqZWQEi.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-C_hoYTwe.js → settings.open-source-licenses-BAFwkfI8.js} +2 -2
- package/dist/client/assets/settings.plugins-D5l1ZPSB.js +5 -0
- package/dist/client/assets/settings.projects-Cqx1zAvs.js +4 -0
- package/dist/client/assets/settings.providers-CS55UrI1.js +3 -0
- package/dist/client/assets/settings.scheduled-tasks-CFJTEOb1.js +2 -0
- package/dist/client/assets/{settings.snap-shot-D-zJVnjT.js → settings.snap-shot-E3AITJyC.js} +2 -2
- package/dist/client/assets/{settings.source-control-DIU1xRUy.js → settings.source-control-CWWy9E3b.js} +2 -2
- package/dist/client/assets/{settings.storage-DRxTKEjG.js → settings.storage-BnUI1rFT.js} +2 -2
- package/dist/client/assets/{settingsLayout-Cbpy7Mfz.js → settingsLayout-DHc6oKfL.js} +3 -3
- package/dist/client/assets/{sidebar-D5nBG54l.js → sidebar-BkujXU9U.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DXnDcqLY.js → sidebarProjectGrouping-DD4nu9RX.js} +2 -2
- package/dist/client/assets/{skeleton-oZHFXSZp.js → skeleton-C6_D5JUu.js} +2 -2
- package/dist/client/assets/{sortable.esm-Boen_E7K.js → sortable.esm-BAEGChD3.js} +2 -2
- package/dist/client/assets/{sourceControl-DE9QO1yg.js → sourceControl-BAghu6LN.js} +2 -2
- package/dist/client/assets/{spinner-Bnjv_L8F.js → spinner-CpLstN6u.js} +2 -2
- package/dist/client/assets/{standalone-page-Davc_MrS.js → standalone-page-7vaVYOp-.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-EwB2WAAm.js → stateDiagram-D77RDMKH-CpZF58eW.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DewOo-MV.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-RngRFsjR.js → swimlanes-42K2YHIH-D1b49puG.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-d9EGwk-5.js +9 -0
- package/dist/client/assets/{terminal-links-BT70vIBN.js → terminal-links-CjmSI9gV.js} +2 -2
- package/dist/client/assets/{terminalSessions-Cj-MqjH8.js → terminalSessions-Q2t1JYPS.js} +2 -2
- package/dist/client/assets/{textarea-B8WPFAr0.js → textarea-DKdxwZZC.js} +2 -2
- package/dist/client/assets/{themePalette-CdoksNDx.js → themePalette-7p_LOU3J.js} +3 -3
- package/dist/client/assets/{threadSort-DD61dseb.js → threadSort-C5oCCRfj.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-BfIggpP3.js → timeline-definition-24CTP7MA-89AJY6KO.js} +2 -2
- package/dist/client/assets/toast-DhMYg_gN.js +2 -0
- package/dist/client/assets/{toggle-DLuCM2ny.js → toggle-BshAsXT6.js} +2 -2
- package/dist/client/assets/{toggle-group-RZD18_sD.js → toggle-group-ZNzhUvHt.js} +2 -2
- package/dist/client/assets/tooltip-Cq9yz15d.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-BjKaOr9u.js → treeView-Q6P3EWNA-CqNF2YcW.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-ffFPsmk1.js → treemap-WGGIJYW6-LJa3ZEYA.js} +1 -1
- package/dist/client/assets/usage-CJVyABbK.js +2 -0
- package/dist/client/assets/{usageAccess-CGcVLBtI.js → usageAccess-CieOJbVm.js} +2 -2
- package/dist/client/assets/{usageFormat-B-HlJYM5.js → usageFormat-BEGhDYfU.js} +2 -2
- package/dist/client/assets/{usageShortcuts-CUsmDt-0.js → usageShortcuts-DxuByyhD.js} +2 -2
- package/dist/client/assets/{use-atom-command-Dz_yqN35.js → use-atom-command-x4GQBtio.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-DZIzyiAY.js → useAriaLabelledBy-u5efXUxw.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-DjevdE0U.js → useHandleNewThread-CReGBX6y.js} +2 -2
- package/dist/client/assets/{useLocation-UcmQE5FC.js → useLocation-B3ir4ben.js} +2 -2
- package/dist/client/assets/useNavigate-DRqH9NhA.js +2 -0
- package/dist/client/assets/{useNavigateBack-B0y76gBs.js → useNavigateBack-XQd0WINI.js} +2 -2
- package/dist/client/assets/{useParams-DdYFF9g9.js → useParams-Cil-ZIwd.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-C01enB4u.js → usePermissionStatus-C4aMrLLP.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BKpChcp1.js → usePullRequestActions-BL4mjngC.js} +3 -3
- package/dist/client/assets/{useRegisterFieldControl-Bmw-33lq.js → useRegisterFieldControl-75QESVfk.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-mUid6EfJ.js → useScopedModelAvailability-CBOIiaXC.js} +2 -2
- package/dist/client/assets/useSettings-Dx076NWT.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-C7Dm8xCm.js → useT3ConnectAuthPrompt-1zTdZLsH.js} +2 -2
- package/dist/client/assets/utils-BEVyjoxo.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-46AnO9mr.js +2 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-Bw5_1h9Y.js → vennDiagram-4TSXK5OY-CvvE7gMp.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-BzzHb86M.js → wardley-WFR3VGLG-Ca8Qzkpo.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-RCSx0hV5.js → wardleyDiagram-VM6X3IG4-BBSNgSMI.js} +2 -2
- package/dist/client/assets/{welcome-RXSMyzlx.js → welcome-B3wsq5wK.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CcISZM46.js → xychartDiagram-S5SC5T6Z-D8OhWe48.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-C4obs87z.mjs → renderer-C4CdFj__.mjs} +2 -2
- package/dist/{runtime-2Dbe0RYi.mjs → runtime-CCVFqL3Y.mjs} +78 -4
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-Bb5-VhZe.js +0 -2
- package/dist/client/assets/ChatMarkdown-B7b91JUl.js +0 -65
- package/dist/client/assets/CheckboxIndicator-BzFOZwIv.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-CeUTTu-x.js +0 -2
- package/dist/client/assets/ComboboxClear-Di7TLMMS.js +0 -2
- package/dist/client/assets/DiffPanel-D6VVj6BF.js +0 -2
- package/dist/client/assets/Input-DoZ73vNO.js +0 -2
- package/dist/client/assets/PanelLayoutControls-3fTyX_SN.js +0 -216
- package/dist/client/assets/PopoverHandle-D2swQJBt.js +0 -2
- package/dist/client/assets/PreviewPanel-Ca3_DPh_.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-B--7QlKN.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-BdP3_tNe.js +0 -6
- package/dist/client/assets/SelectScrollUpArrow-CAd5YEsi.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-CLfVfvoq.js +0 -5
- package/dist/client/assets/TooltipViewport-Wc_QpRGI.js +0 -2
- package/dist/client/assets/_chat-D-Gcj0-9.js +0 -45
- package/dist/client/assets/_chat.pull-requests-DrLHGpqx.js +0 -2
- package/dist/client/assets/architecture-7GRP2DOG-BNBr3Sao.js +0 -1
- package/dist/client/assets/assets-BhchpDuq.js +0 -2
- package/dist/client/assets/channel-CfHDq-fp.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Cm99q1tS.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cm99q1tS.js +0 -2
- package/dist/client/assets/device-BEgZIK7u.js +0 -2
- package/dist/client/assets/entities-DPIZFvN7.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-B7plRWX7.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-BEpQPBfI.js +0 -1
- package/dist/client/assets/main-CxOeqlhD.js +0 -30
- package/dist/client/assets/number-field-N4gbrhyd.js +0 -2
- package/dist/client/assets/primary-CRkgnOCY.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-B_VNTJYL.js +0 -2
- package/dist/client/assets/projectFilesQueryState-U08pztRu.js +0 -2
- package/dist/client/assets/projectScriptEditor-D8mxKLOb.js +0 -2
- package/dist/client/assets/queries-BVPZtaQA.js +0 -2
- package/dist/client/assets/query-CpOQgkic.js +0 -2
- package/dist/client/assets/radio-group-CfHe3q1m.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BJdCwb3O.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-a9vhoAEG.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-Cyo-vXW_.js +0 -1
- package/dist/client/assets/runtime-Bc4kgQim.js +0 -2
- package/dist/client/assets/runtime-DZfpb67Q.js +0 -6
- package/dist/client/assets/server-LJ0-FVGH.js +0 -2
- package/dist/client/assets/settings.appearance-B_LipS5_.js +0 -2
- package/dist/client/assets/settings.archived-B_h3CK_T.js +0 -2
- package/dist/client/assets/settings.connections-Bv37N8Tm.js +0 -2
- package/dist/client/assets/settings.diagnostics-DuoGRNGf.js +0 -2
- package/dist/client/assets/settings.general-B-Bt2-nG.js +0 -2
- package/dist/client/assets/settings.plugins-DafKnC5Q.js +0 -5
- package/dist/client/assets/settings.projects-r2ZcxKud.js +0 -4
- package/dist/client/assets/settings.providers-jbZijXPV.js +0 -3
- package/dist/client/assets/settings.scheduled-tasks-C0d4wkYE.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CcnJHQ4a.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CrkPrysy.js +0 -9
- package/dist/client/assets/toast-DYfY2t_z.js +0 -2
- package/dist/client/assets/tooltip-924Ikq0L.js +0 -2
- package/dist/client/assets/usage-CRK5JZJm.js +0 -2
- package/dist/client/assets/useNavigate-Dvl9uiuL.js +0 -2
- package/dist/client/assets/useSettings-DCI8Hv09.js +0 -3
- package/dist/client/assets/utils-CRwA5SKO.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-3pHpDJC2.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-Dd_uD5pT.js";import{r as n}from"./Icon-l19w4AjM.js";import{$i as r,Ap as i,Bi as a,Cd as o,Cm as s,Co as c,D as l,Ea as u,Em as d,Eo as f,Fa as p,Fy as m,Ia as h,Ii as g,Ks as _,ME as v,Md as y,Mf as b,Na as x,Or as S,Qi as C,Ra as w,Sa as T,So as E,Sy as D,Td as O,Ti as k,To as A,Tr as ee,Um as j,Uu as M,_o as N,ai as te,bt as ne,cE as re,ca as P,ga as ie,ia as F,jr as ae,ku as I,la as L,lr as oe,ma as se,oa as R,pa as z,ra as ce,rb as le,sa as ue,sl as de,sr as fe,t as B,ta as V,va as H,vi as pe,vo as U,za as me,zi as he,zy as ge}from"./utils-CRwA5SKO.js";import{jn as _e}from"./runtime-DZfpb67Q.js";import{l as ve}from"./TooltipViewport-Wc_QpRGI.js";import{t as ye}from"./spinner-Bnjv_L8F.js";import{t as be}from"./useParams-DdYFF9g9.js";import{c as xe,f as W,l as Se,u as Ce,y as we}from"./tooltip-924Ikq0L.js";var Te=le(de);function Ee(e){return Te(e)&&e.bootstrapThreadDisposition===`deleted`}function De(e){return Te(e)&&e.bootstrapThreadDisposition===`not-created`}var Oe=[/\bSocketCloseError\b/i,/\bSocketOpenError\b/i,/\bSocket is not connected\b/i,/Unable to connect to the T3 server WebSocket\./i,RegExp(`\\b(?:is not connected|disconnected|stopped responding|could not establish a WebSocket connection)\\.(?: ${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))(_e)})?$`,`i`),/\bClientProtocolError\b/i,/\bRpcClientError\b/i,/\bping timeout\b/i];function ke(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length!==0&&Oe.some(e=>e.test(t))}function Ae(e){return ke(e)?null:e??null}var G=e(n()),je=G.createContext(void 0);function Me(){let e=G.useContext(je);if(!e)throw Error(f(73));return e}var Ne=0;function Pe(e){return Ne+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Ne}`}function Fe(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Ie(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}var Le=e=>e.toastMetadata,K={toasts:k(e=>e.toasts),isEmpty:k(e=>e.toasts.length===0),toast:k(Le,(e,t)=>e.get(t)?.value),toastIndex:k(Le,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:k(Le,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:k(Le,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:k(e=>e.hovering),focused:k(e=>e.focused),expanded:k(e=>e.hovering||e.focused),expandedOrOutOfFocus:k(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:k(e=>e.prevFocusElement)},Re=class extends pe{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Ie(e.toasts)},{},K)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t={}){let n=K.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t.skipOnRemove||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Pe(`toast`);if(e.id){let t=K.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,{skipOnRemove:!0});else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,{resetTimer:!0,markUpdated:!0}),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts],o=a.filter(e=>e.transitionStatus!==`ending`);if(o.length>n){let e=o.length-n,t=o.slice(-e),r=new Set(t.map(e=>e.id));this.setToasts(a.map(e=>{let t=r.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(a.map(e=>e.limited?{...e,limited:!1}:e));let s=i.timeout??t;return i.type!==`loading`&&s>0&&this.scheduleTimer(r,s,()=>this.closeToast(r)),K.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,{markUpdated:!0})};updateToastInternal=(e,t,n={})=>{let{timeout:r,toasts:i}=this.state,a=K.toast(this.state,e)??null;if(!a||a.transitionStatus===`ending`)return;let o={...a,...t,...n.markUpdated&&{updateKey:(a.updateKey??0)+1}};this.setToasts(i.map(t=>t.id===e?o:t));let s=o.timeout??r,c=a?.timeout??r,l=Object.hasOwn(t,`timeout`),u=o.transitionStatus!==`ending`&&o.type!==`loading`&&s>0,d=this.timers.has(e),f=c!==s,p=a?.type===`loading`;if(!u&&d){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(u&&(!d||f||l||p||n.resetTimer)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,s,()=>this.closeToast(e)),K.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear();else{let t=K.toast(this.state,e);if(!t)return;i=[t];let n=this.timers.get(e);n?.timeout&&(n.timeout.clear(),this.timers.delete(e))}let a=0,o=r.map(r=>{if(t||r.id===e)return{...r,transitionStatus:`ending`,height:0};if(r.transitionStatus===`ending`)return r;let i=a>=n;return a+=1,r.limited===i?r:{...r,limited:i}}),s={toasts:o,toastMetadata:Ie(o)};(t||r.length===1)&&(s.hovering=!1,s.focused=!1),this.update(s),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Fe(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Fe(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Fe(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=z.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=L(e);P(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!K.expandedOrOutOfFocus(this.state),a=i?z.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e,toastMetadata:Ie(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=ue(V(this.state.viewport));if(!this.state.viewport||!P(this.state.viewport,t)||!R(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=K.toasts(this.state),r=K.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},q=e(re()),ze=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=A(()=>new Re({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return T(a.disposeEffect),G.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),a.useSyncedValues({timeout:n,limit:r}),(0,q.jsx)(je.Provider,{value:a,children:t})},Be=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),Ve=G.forwardRef(function(e,t){let{render:n,className:i,style:a,children:o,...s}=e,c=Me(),l=se(),u=G.useRef(!1),d=G.useRef(!1),f=G.useRef(!1),p=c.useState(`isEmpty`),m=c.useState(`toasts`),h=c.useState(`focused`),g=c.useState(`expanded`),_=c.useState(`prevFocusElement`),v=m[0]?.height??0,y=G.useMemo(()=>m.some(e=>e.transitionStatus===`ending`),[m]),b=G.useMemo(()=>m.filter(e=>e.priority===`high`),[m]);G.useEffect(()=>{let e=c.state.viewport;if(!e)return;function t(t){p||t.key===`F6`&&L(t)!==e&&(t.preventDefault(),c.setPrevFocusElement(ue(V(e))),e?.focus({preventScroll:!0}),c.pauseTimers(),c.setFocused(!0))}let n=w(e);return F(n,`keydown`,t)},[c,p]),G.useEffect(()=>{let e=c.state.viewport;if(!e||p)return;let t=w(e);function n(e){L(e)===t&&(c.setIsWindowFocused(!1),c.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=L(n),i=ue(V(e));(r===t||!P(e,r)||!R(i))&&c.resumeTimers(),l.start(0,()=>c.setIsWindowFocused(!0))}return ce(F(t,`blur`,n,!0),F(t,`focus`,r,!0))},[c,l,p]),G.useEffect(()=>{let e=c.state.viewport;if(!e||p)return;let t=V(e);return F(t,`pointerdown`,c.handleDocumentPointerDown,!0)},[p,c]);function x(e){let t=c.state.viewport;t&&(u.current=!0,e.relatedTarget===t?m[0]?.ref?.current?.focus():c.restoreFocusToPrevElement())}function S(e){e.key===`Tab`&&e.shiftKey&&L(e.nativeEvent)===c.state.viewport&&(e.preventDefault(),c.restoreFocusToPrevElement(),c.resumeTimers())}function T(){let e=c.state.toasts.some(e=>e.transitionStatus===`ending`);c.state.isWindowFocused&&!e&&!f.current&&d.current&&(c.resumeTimers(),c.setHovering(!1),d.current=!1)}G.useEffect(T,[y,c]);function E(){c.pauseTimers(),c.setHovering(!0),d.current=!1}function D(){y||f.current?d.current=!0:(c.resumeTimers(),c.setHovering(!1))}function O(e){e.pointerType===`touch`&&(f.current=!0)}function k(e){e.pointerType===`touch`&&(f.current=!1,T())}function A(){if(u.current){u.current=!1;return}h||R(ue(V(c.state.viewport)))&&(c.setFocused(!0),c.pauseTimers())}function ee(e){h&&!P(c.state.viewport,e.relatedTarget)&&(c.setFocused(!1),c.resumeTimers())}let j={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:E,onMouseMove:E,onMouseLeave:D,onFocus:A,onBlur:ee,onKeyDown:S,onClick:A,onPointerDown:O,onPointerUp:k,onPointerCancel:k},M={expanded:g},N=U(`div`,e,{ref:[t,c.setViewport],state:M,props:[j,{style:{[Be.frontmostHeight]:v?`${v}px`:void 0}},s,{children:(0,q.jsxs)(G.Fragment,{children:[!p&&_&&(0,q.jsx)(C,{onFocus:x}),o,!p&&_&&(0,q.jsx)(C,{onFocus:x})]})}]});return(0,q.jsxs)(G.Fragment,{children:[!p&&_&&(0,q.jsx)(C,{onFocus:x}),N,!h&&b.length>0&&(0,q.jsx)(`div`,{style:r,children:b.map(e=>(0,q.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,q.jsx)(`div`,{children:e.title}),(0,q.jsx)(`div`,{children:e.description})]},e.id))})]})}),He=e(H()),Ue=G.createContext(void 0);function J(){let e=G.useContext(Ue);if(!e)throw Error(f(66));return e}var Y=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});function We(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function Ge(e){let t=w(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var Ke={...N,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},qe=40,Je=10,X=.5,Ye=1,Xe=`${g},${he}`,Ze=G.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=Me(),[f,m]=G.useState(void 0),[g,_]=G.useState(!1),[v,y]=G.useState(!1),[b,x]=G.useState(!1),[S,C]=G.useState({x:0,y:0}),[w,T]=G.useState({x:0,y:0,scale:1}),[E,D]=G.useState(),[O,k]=G.useState(),[A,ee]=G.useState(null),j=G.useRef(null),M=G.useRef({x:0,y:0}),N=G.useRef({x:0,y:0,scale:1}),te=G.useRef(void 0),ne=G.useRef(0),re=G.useRef(!1),I=G.useRef({x:0,y:0}),oe=G.useRef(!1),se=G.useRef({x:0,y:0}),R=G.useRef(null),z=G.useRef(null),ce=d.useState(`toastIndex`,n.id),le=d.useState(`toastVisibleIndex`,n.id),de=d.useState(`toastOffsetY`,n.id),fe=d.useState(`focused`),B=d.useState(`expanded`);ie({open:n.transitionStatus!==`ending`,ref:j,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let H=h((e=!1)=>{let t=j.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:j,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?He.flushSync(a):a()});p(H,[H]);function pe(e){se.current=e,C(e)}p(()=>()=>{z.current?.abort()},[]);function me(e,t){let n=e,r=t;return!l.includes(`left`)&&!l.includes(`right`)?n=e>0?e**X:-(Math.abs(e)**X):(!l.includes(`right`)&&e>0&&(n=e**X),!l.includes(`left`)&&e<0&&(n=-(Math.abs(e)**X))),!l.includes(`up`)&&!l.includes(`down`)?r=t>0?t**X:-(Math.abs(t)**X):(!l.includes(`down`)&&t>0&&(r=t**X),!l.includes(`up`)&&t<0&&(r=-(Math.abs(t)**X))),{x:n,y:r}}let he=h(e=>{if(e.pointerId!==R.current)return;R.current=null,z.current?.abort(),z.current=null,_(!1),y(!1),ee(null);let t=N.current;if(e.type===`pointercancel`||re.current){pe({x:t.x,y:t.y}),m(void 0);return}let r=!1,i=se.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of l){switch(e){case`right`:a>qe&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>qe&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`)}if(r)break}r?(m(s),x(!0),d.closeToast(n.id)):(pe({x:t.x,y:t.y}),m(void 0))});function ge(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=L(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${Xe}`))return;if(re.current=!1,te.current=void 0,ne.current=0,R.current=e.pointerId,M.current={x:e.clientX,y:e.clientY},I.current=M.current,j.current){let e=Ge(j.current);N.current=e,T(e),pe({x:e.x,y:e.y})}d.setHovering(!0),_(!0),y(!1),ee(null),oe.current=!0;let n=j.current;if(n){z.current?.abort();let t=new AbortController;z.current=t;let r=V(n);r.addEventListener(`pointerup`,he,{signal:t.signal}),r.addEventListener(`pointercancel`,he,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function _e(e){if(e.pointerId!==R.current)return;e.preventDefault(),oe.current&&=(M.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-M.current.x,o=t-M.current.y,s=t-I.current.y,c=n-I.current.x;if(!v&&Math.sqrt(a*a+o*o)>=Ye&&(y(!0),A===null)){let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&ee(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!te.current)A===`vertical`?o>0?u=`down`:o<0&&(u=`up`):A===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&l.includes(u)&&(te.current=u,ne.current=We(u,a,o),m(u));else{let e=te.current,t=We(e,c,s);t>qe?(re.current=!1,m(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&ne.current-t>=Je&&(re.current=!0)}let d=me(a,o),f=N.current.x,p=N.current.y;A===`horizontal`?(l.includes(`left`)||l.includes(`right`))&&(f+=d.x):(A===`vertical`||(l.includes(`left`)||l.includes(`right`))&&(f+=d.x),(l.includes(`up`)||l.includes(`down`))&&(p+=d.y)),pe({x:f,y:p})}function ve(e){if(e.key===`Escape`){if(!j.current||!P(j.current,ue(V(j.current))))return;d.closeToast(n.id)}}G.useEffect(()=>{if(!u)return;let e=j.current;if(!e)return;function t(t){P(e,L(t))&&t.preventDefault()}return F(e,`touchmove`,t,{passive:!1})},[u]);function ye(){if(!g&&S.x===w.x&&S.y===w.y&&!b)return{[Y.swipeMovementX]:`0px`,[Y.swipeMovementY]:`0px`};let e=S.x-w.x,t=S.y-w.y;return{transition:g?`none`:void 0,transform:g?`translateX(${S.x}px) translateY(${S.y}px) scale(${w.scale})`:void 0,[Y.swipeMovementX]:`${e}px`,[Y.swipeMovementY]:`${t}px`}}let be=n.priority===`high`,xe={role:be?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":E,"aria-describedby":O,"aria-hidden":be&&!fe?!0:void 0,onPointerDown:u?ge:void 0,onPointerMove:u?_e:void 0,onPointerUp:u?he:void 0,onPointerCancel:u?he:void 0,onKeyDown:ve,inert:ae(n.limited),style:{...ye(),[Y.index]:n.transitionStatus===`ending`?ce:le,[Y.offsetY]:`${de}px`,[Y.height]:n.height?`${n.height}px`:void 0}},W=G.useMemo(()=>({rootRef:j,toast:n,titleId:E,setTitleId:D,descriptionId:O,setDescriptionId:k,swiping:g,swipeDirection:f,recalculateHeight:H,index:ce,visibleIndex:le,expanded:B}),[n,E,O,g,f,H,ce,le,B]),Se={transitionStatus:n.transitionStatus,expanded:B,limited:n.limited||!1,type:n.type,swiping:W.swiping,swipeDirection:W.swipeDirection},Ce=U(`div`,e,{ref:[t,W.rootRef],state:Se,stateAttributesMapping:Ke,props:[xe,s]});return(0,q.jsx)(Ue.Provider,{value:W,children:Ce})}),Qe=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=J(),l=G.useRef(null);return p(()=>{let e=l.current;if(!e||(c(),typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`))return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),U(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),$e=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setDescriptionId:l}=J(),d=o??c.description,f=!!d,m=u(a);p(()=>{if(f)return l(m),()=>{l(void 0)}},[f,m,l]);let h={type:c.type},g=U(`p`,e,{ref:t,state:h,props:{...s,id:m,children:d}});return f?g:null}),et=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setTitleId:l}=J(),d=o??c.title,f=!!d,m=u(a);p(()=>{if(f)return l(m),()=>{l(void 0)}},[f,m,l]);let h={type:c.type},g=U(`h2`,e,{ref:t,state:h,props:{...s,id:m,children:d}});return f?g:null}),tt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=Me(),{toast:l}=J(),u=c.useState(`expanded`),[d,f]=G.useState(!1),{getButtonProps:p,buttonRef:m}=x({disabled:a,native:o}),h={type:l.type};return U(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),nt=G.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=J(),l=c.actionProps?.children??s.children,u=!!l,{getButtonProps:d,buttonRef:f}=x({disabled:a,native:o}),p={type:c.type},m=U(`button`,e,{ref:[t,f],state:p,props:[s,c.actionProps,d,{children:l}]});return u?m:null}),rt=ve,it=G.createContext(void 0);function at(){let e=G.useContext(it);if(e===void 0)throw Error(f(84));return e}var ot=G.forwardRef(function(e,t){let{toast:n,...r}=e,i=Me(),o=n.positionerProps??E,{render:s,className:l,anchor:u=o.anchor,positionMethod:d=o.positionMethod??`absolute`,side:f=o.side??`top`,align:p=o.align??`center`,sideOffset:m=o.sideOffset??0,alignOffset:h=o.alignOffset??0,collisionBoundary:g=o.collisionBoundary??`clipping-ancestors`,collisionPadding:_=o.collisionPadding??5,arrowPadding:v=o.arrowPadding??5,sticky:y=o.sticky??!1,disableAnchorTracking:b=o.disableAnchorTracking??!1,collisionAvoidance:x=o.collisionAvoidance??a,style:C,...w}=r,[T,D]=G.useState(null),O=i.useState(`toastIndex`,n.id),k=i.useState(`toastVisibleIndex`,n.id),A=me(u)?u:null,j=te({open:!0,onOpenChange:c,elements:{floating:T,reference:A}}),M=S({anchor:A,positionMethod:d,floatingRootContext:j,mounted:!0,side:f,sideOffset:m,align:p,alignOffset:h,collisionBoundary:g,collisionPadding:_,sticky:y,arrowPadding:v,disableAnchorTracking:b,keepMounted:!0,collisionAvoidance:x}),N=G.useMemo(()=>({side:M.side,align:M.align,anchorHidden:M.anchorHidden}),[M.side,M.align,M.anchorHidden]),ne=ee(e,N,{styles:{...M.positionerStyles,[Y.index]:n.transitionStatus===`ending`?O:k},transitionStatus:n.transitionStatus,props:w,refs:[t,D]});return(0,q.jsx)(it.Provider,{value:M,children:ne})}),st=G.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{arrowRef:o,side:s,align:c,arrowUncentered:l,arrowStyles:u}=at();return U(`div`,e,{state:{side:s,align:c,uncentered:l},ref:[t,o],props:[{style:u,"aria-hidden":!0},a]})});function ct(){let e=G.useContext(je);if(!e)throw Error(f(73));let t=e.useState(`toasts`);return G.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function lt(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Pe(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var ut=t({Action:()=>nt,Arrow:()=>st,Close:()=>tt,Content:()=>Qe,Description:()=>$e,Portal:()=>rt,Positioner:()=>ot,Provider:()=>ze,Root:()=>Ze,Title:()=>et,Viewport:()=>Ve,createToastManager:()=>lt,useToastManager:()=>ct});function dt(){let e=[],t=0,n=new Set,r=new Map,i=new Map,a=new Map,o=new Map,s=new Set,c=()=>n.forEach(e=>e()),l=e=>{clearTimeout(r.get(e)),r.delete(e);let t=a.get(e);t!==void 0&&(i.set(e,Math.max(0,(i.get(e)??0)-(Date.now()-t))),a.delete(e))},u=t=>{let n=e.find(e=>e.id===t);n&&(l(t),i.delete(t),o.delete(t),e=e.filter(e=>e.id!==t),c(),n.onDismiss?.())},d=e=>{s.size||o.get(e)?.size||r.has(e)||!i.has(e)||(a.set(e,Date.now()),r.set(e,setTimeout(()=>u(e),i.get(e))))},f=n=>{let r=n.id??`notification-${++t}`;l(r);let a={...n,id:r};e=[...e.filter(e=>e.id!==r),a];let o=n.durationMs??8e3;return o>0?i.set(r,o):i.delete(r),d(r),c(),r},p=(e,t)=>{let n=o.get(e)??new Set;n.add(t),o.set(e,n),l(e)},m=(e,t)=>{o.get(e)?.delete(t),d(e)};return{show:f,dismiss:u,pause:p,resume:m,getSnapshot:()=>e,subscribe:e=>(n.add(e),()=>{n.delete(e)}),setPaused:(t,n)=>{n?s.add(t):s.delete(t);for(let t of e)s.size?l(t.id):d(t.id)},performAction:async(t,n)=>{let r=e.find(e=>e.id===t),i=r?.actions?.find(e=>e.id===n);if(!r||!i||r.pendingActionId)return;let a={...r,pendingActionId:n};p(t,`action`),e=e.map(e=>e===r?a:e),c();try{await i.run(),e.includes(a)&&u(t)}catch(t){e.includes(a)&&f({...r,title:i.failureTitle??`Could not complete action`,description:t instanceof Error?t.message:`Please try again.`,tone:`error`})}finally{m(t,`action`)}}}}var Z=dt(),Q=v(),ft={archive:M,clock:y,pin:i,trash:s};function pt(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,G.useEffect)(mt,t),null}function mt(){let e=!0,t=new Set,n=()=>{let n=Z.getSnapshot();for(let e of t)n.some(t=>t.id===e)||(t.delete(e),$.close(`shared:${e}`));for(let r of n){let n=r.icon&&r.tone!==`error`?ft[r.icon]:null,i=r.actions??[],a=i.find(gt),o=e=>({children:e.label,disabled:!!r.pendingActionId,onClick:()=>{Z.performAction(r.id,e.id)}}),s={title:r.title,description:r.description??null,type:r.tone??`info`,timeout:0,onClose:()=>{e&&Z.getSnapshot().includes(r)&&Z.dismiss(r.id)},actionProps:{children:null},data:{sharedToastId:r.id,leadingIcon:n?(0,q.jsx)(n,{className:`size-4`}):void 0,additionalActions:i.filter(e=>e!==a).map(e=>({id:e.id,props:o(e)})),...a?{secondaryActionProps:o(a)}:{},secondaryActionVariant:`soft`,hideCopyButton:!0}};t.has(r.id)?$.update(`shared:${r.id}`,s):(t.add(r.id),$.add({...s,id:`shared:${r.id}`}))}},r=Z.subscribe(n),i=ht;return document.addEventListener(`visibilitychange`,i),i(),n(),()=>{e=!1,r(),document.removeEventListener(`visibilitychange`,i),Z.setPaused(`web-hidden`,!1);for(let e of t)$.close(`shared:${e}`)}}function ht(){return Z.setPaused(`web-hidden`,document.hidden)}function gt(e){return e.primary}var _t=class extends ge()(`ClipboardApiUnavailableError`,{target:m}){get message(){return`Clipboard API is unavailable while copying ${this.target}.`}},vt=class extends ge()(`ClipboardWriteError`,{target:m,cause:D()}){get message(){return`Failed to copy ${this.target} to the clipboard.`}},yt=class extends ge()(`ClipboardReadUnavailableError`,{target:m}){get message(){return`Clipboard API is unavailable while reading ${this.target}.`}},bt=class extends ge()(`ClipboardReadError`,{target:m,cause:D()}){get message(){return`Failed to read ${this.target} from the clipboard.`}};function xt(e,t){if(typeof document>`u`||typeof document.execCommand!=`function`)return!1;let n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.top=`0`,n.style.left=`0`,n.style.opacity=`0`,n.style.fontSize=`16px`;let r=document.activeElement,i=n=>{if(t&&n.clipboardData){n.clipboardData.setData(`text/plain`,e);for(let[e,r]of Object.entries(t))n.clipboardData.setData(e,r);n.preventDefault()}};document.body.appendChild(n),n.addEventListener(`copy`,i);try{return n.focus({preventScroll:!0}),n.select(),n.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{n.removeEventListener(`copy`,i),n.remove();let e=r?.focus;typeof e==`function`&&e.call(r)}}async function St(e,t=`text`,n){if(typeof window>`u`)throw new _t({target:t});if(!e)return!1;n&&=Object.fromEntries(Object.entries(n).filter(([e])=>e!==`text/plain`));let r=n?.[I];if(r&&(n={...n,"text/html":ne(e,r,n?.[`text/html`])}),typeof navigator>`u`||!navigator.clipboard?.writeText){if(xt(e,n))return!0;throw new _t({target:t})}try{if(n&&typeof ClipboardItem<`u`&&navigator.clipboard.write)try{return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),...Object.fromEntries(Object.entries(n).map(([e,t])=>[e,new Blob([t],{type:e})]))})]),!0}catch{let t=n[`text/html`];if(t)try{return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0}catch{}}return await navigator.clipboard.writeText(e),!0}catch(e){throw new vt({target:t,cause:e})}}async function Ct(e=`text`){if(typeof window>`u`||typeof navigator>`u`||!navigator.clipboard?.readText)throw new yt({target:e});try{return await navigator.clipboard.readText()}catch(t){throw new bt({target:e,cause:t})}}function wt({timeout:e=2e3,target:t=`text`,onCopy:n,onError:r,extraFlavors:i}={}){let[a,o]=G.useState(!1),s=G.useRef(null),c=G.useRef(n),l=G.useRef(r),u=G.useRef(t),d=G.useRef(e);c.current=n,l.current=r;let f=G.useRef(i);u.current=t,d.current=e,f.current=i;let p=G.useCallback((e,t)=>{St(e,u.current,f.current).then(e=>{e&&(s.current&&clearTimeout(s.current),o(!0),c.current?.(t),d.current!==0&&(s.current=setTimeout(()=>{o(!1),s.current=null},d.current)))},e=>{console.error(e),l.current?.(e,t)})},[]);return G.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:a}}function Tt(e){return e===`live`}function Et(e){return e.draftThreadExists||e.serverThreadExists&&!e.serverThreadDeleted?`ready`:e.bootstrapComplete?`missing`:`loading`}function Dt(e){return{environmentId:e.environmentId,threadId:e.threadId}}function Ot(e){return{draftId:e}}function kt(e){return!e.environmentId||!e.threadId?null:_(e.environmentId,e.threadId)}function At(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:_(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function jt(e,t){return e?.kind===`server`?e.threadRef:e?.kind!==`draft`||!t?.promotedTo?null:t.promotedTo}function Mt(e){if(typeof e!=`object`||!e||!(`children`in e))return!1;let t=e.children;return t!=null&&t!==!1&&t!==``}function Nt(e,t){return t<=1?!1:e>0}function Pt(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Ft(e.height);if(e.transitionStatus===`ending`){let r={toast:e,visibleIndex:t,offsetY:n};return n+=a,t+=1,r}let o={toast:e,visibleIndex:r,offsetY:i};return n+=a,t+=1,i+=a,r+=1,o});return{frontmostHeight:Ft(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Ft(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function It(e,t){if(e?.threadRef)return t!==null&&e.threadRef.environmentId===t.environmentId&&e.threadRef.threadId===t.threadId;let n=e?.threadId;return!n||t?.threadId===n}var $=lt(),Lt=lt(),Rt=new Map,zt={error:o,info:b,loading:ye,success:O,warning:d},Bt=180;function Vt(e,t){if(e===`error`&&typeof t==`string`&&!(t.length<Bt))return`line-clamp-4`}var Ht=`absolute z-20 -top-1.5 -right-1.5`,Ut=B(`inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-popover/92 text-muted-foreground shadow-sm outline-none backdrop-blur-sm`,`transition-[color,background-color,box-shadow] hover:bg-popover hover:text-foreground`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`);function Wt(e,t,n){n?.(),e.close(t)}function Gt(e){let t=(0,Q.c)(13),{text:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`error-message`},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:a}=wt(r),o=a?`Copied error`:`Copy error`,s;t[1]!==i||t[2]!==n?(s=()=>i(n),t[1]=i,t[2]=n,t[3]=s):s=t[3];let c=a&&`text-success`,l;t[4]===c?l=t[5]:(l=B(`size-3`,c),t[4]=c,t[5]=l);let u=a?Se:we,d;t[6]!==l||t[7]!==u?(d=(0,q.jsx)(xe,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==o||t[10]!==s||t[11]!==d?(f=(0,q.jsx)(fe,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":o,className:`[--control-icon-color:currentColor] rounded-md text-muted-foreground/80 hover:bg-transparent hover:text-muted-foreground`,onClick:s,children:d}),t[9]=o,t[10]=s,t[11]=d,t[12]=f):f=t[12],f}var Kt=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function qt(e){let t=(0,Q.c)(13),{children:n,labels:r}=e,[i,a]=(0,G.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Jt),t[0]=c):c=t[0];let l=i?W:Ce,u;t[1]===l?u=t[2]:(u=(0,q.jsx)(xe,{className:`size-3.5 shrink-0 opacity-80`,icon:l,strokeWidth:2.25}),t[1]=l,t[2]=u);let d=i?s:o,f;t[3]!==i||t[4]!==u||t[5]!==d?(f=(0,q.jsxs)(`button`,{"aria-expanded":i,className:`inline-flex cursor-pointer items-center gap-1 rounded-md py-0.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,onClick:c,type:`button`,children:[u,d]}),t[3]=i,t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==i?(p=i?(0,q.jsx)(`div`,{className:Kt,children:n}):null,t[7]=n,t[8]=i,t[9]=p):p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,q.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}function Jt(e){return!e}function Yt(e){let t=(0,Q.c)(36),{toastData:n,toastDescription:r,toastType:i}=e,a=n?.expandableContent,o;t[0]===n?.expandableLabels?o=t[1]:(o=n?.expandableLabels??{},t[0]=n?.expandableLabels,t[1]=o);let s=o,c=n?.expandableDescriptionTrigger??!1,l;t[2]!==r||t[3]!==i?(l=B(`min-w-0 select-text wrap-break-word text-muted-foreground`,Vt(i,r)),t[2]=r,t[3]=i,t[4]=l):l=t[4];let u=l,[d,f]=(0,G.useState)(!1);if(!a){let e;return t[5]===u?e=t[6]:(e=(0,q.jsx)($e,{className:u,"data-slot":`toast-description`}),t[5]=u,t[6]=e),e}if(!c){let e;t[7]===u?e=t[8]:(e=(0,q.jsx)($e,{className:u,"data-slot":`toast-description`}),t[7]=u,t[8]=e);let n;t[9]!==a||t[10]!==s?(n=(0,q.jsx)(qt,{labels:s,children:a}),t[9]=a,t[10]=s,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,q.jsxs)(q.Fragment,{children:[e,n]}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let p=s.expand??`Show details`,m=s.collapse??`Hide details`,h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>f(Xt),t[15]=h):h=t[15];let g=h,_;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g())},t[16]=_):_=t[16];let v=_,y=d?m:p,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=B(`group flex min-w-0 w-full cursor-pointer select-none items-start gap-1.5 rounded-sm text-left outline-none ring-offset-background`,`transition-colors hover:bg-muted/40`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`),t[17]=b):b=t[17];let x;t[18]!==r||t[19]!==i?(x=B(`min-w-0 select-none wrap-break-word text-muted-foreground`,Vt(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[18]=r,t[19]=i,t[20]=x):x=t[20];let S;t[21]===x?S=t[22]:(S=(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)($e,{className:x,"data-slot":`toast-description`})}),t[21]=x,t[22]=S);let C=d?W:Ce,w;t[23]===C?w=t[24]:(w=(0,q.jsx)(xe,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,icon:C,strokeWidth:2.25}),t[23]=C,t[24]=w);let T;t[25]!==d||t[26]!==w||t[27]!==y||t[28]!==S?(T=(0,q.jsxs)(`div`,{"aria-label":y,"aria-expanded":d,className:b,onClick:g,onKeyDown:v,role:`button`,tabIndex:0,children:[S,w]}),t[25]=d,t[26]=w,t[27]=y,t[28]=S,t[29]=T):T=t[29];let E;t[30]!==a||t[31]!==d?(E=d?(0,q.jsx)(`div`,{className:Kt,children:a}):null,t[30]=a,t[31]=d,t[32]=E):E=t[32];let D;return t[33]!==T||t[34]!==E?(D=(0,q.jsxs)(q.Fragment,{children:[T,E]}),t[33]=T,t[34]=E,t[35]=D):D=t[35],D}function Xt(e){return!e}function Zt(e){let t=e.type?zt[e.type]:null,n=Mt(e.actionProps)&&e.data?.actionLayout===`stacked-end`,r=e.data?.actionVariant??`default`,i=e.data?.secondaryActionVariant??`outline`,a=e.type===`error`&&typeof e.description==`string`&&!e.data?.hideCopyButton?e.description:null,o=(e.data?.additionalActions?.length??0)>0,s=e.data?.secondaryActionProps!==void 0,c=a!==null||Mt(e.actionProps)||o||s;return{Icon:t,stackedActionLayout:n,actionVariant:r,secondaryActionVariant:i,copyErrorText:a,hasTrailingControls:c,inlineContentEndPad:c?`pr-6`:`pr-10`}}function Qt(e){let t=(0,Q.c)(38),{stackedActionLayout:n,Icon:r,copyErrorText:i,actionProps:a,actionVariant:o,secondaryActionVariant:s,hasTrailingControls:c,toastData:l,toastDescription:u,toastType:d}=e,f;t[0]===l?.additionalActions?f=t[1]:(f=l?.additionalActions??[],t[0]=l?.additionalActions,t[1]=f);let p=f,m=l?.secondaryActionProps,h=l?.leadingIcon,g;t[2]===m?g=t[3]:(g=m??{},t[2]=m,t[3]=g);let _,v;t[4]===g?(_=t[5],v=t[6]):({className:_,...v}=g,t[4]=g,t[5]=_,t[6]=v);let y=n?`pr-5`:`flex-1`,b;t[7]===y?b=t[8]:(b=B(`flex min-h-0 min-w-0 flex-col gap-0.5`,y),t[7]=y,t[8]=b);let x;t[9]!==r||t[10]!==h?(x=h?(0,q.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:h}):r?(0,q.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,q.jsx)(r,{className:`in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80`})}):null,t[9]=r,t[10]=h,t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(et,{className:`min-w-0 wrap-break-word font-medium`,"data-slot":`toast-title`}),t[12]=S):S=t[12];let C;t[13]===x?C=t[14]:(C=(0,q.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[x,S]}),t[13]=x,t[14]=C);let w;t[15]!==l||t[16]!==u||t[17]!==d?(w=(0,q.jsx)(Yt,{toastData:l,toastDescription:u,toastType:d}),t[15]=l,t[16]=u,t[17]=d,t[18]=w):w=t[18];let T;t[19]!==b||t[20]!==C||t[21]!==w?(T=(0,q.jsxs)(`div`,{className:b,children:[C,w]}),t[19]=b,t[20]=C,t[21]=w,t[22]=T):T=t[22];let E;t[23]!==a||t[24]!==o||t[25]!==p||t[26]!==i||t[27]!==c||t[28]!==_||t[29]!==m||t[30]!==v||t[31]!==s||t[32]!==n||t[33]!==l?.sharedToastId?(E=c?(0,q.jsxs)(`div`,{className:B(`flex items-center gap-1.5`,n?`w-full justify-end`:`shrink-0`),children:[i===null?null:(0,q.jsx)(Gt,{text:i}),p.map(e=>{let{id:t,props:n}=e,{className:r,...i}=n;return(0,G.createElement)(fe,{...i,className:r,key:t,size:`xs`,type:`button`,variant:s})}),m?(0,q.jsx)(fe,{...v,className:_,size:`xs`,type:`button`,variant:l?.sharedToastId?`solid-neutral`:s}):null,Mt(a)?(0,q.jsx)(nt,{className:B(oe({size:`xs`,variant:o}),`shrink-0`),"data-slot":`toast-action`,children:a?.children}):null]}):null,t[23]=a,t[24]=o,t[25]=p,t[26]=i,t[27]=c,t[28]=_,t[29]=m,t[30]=v,t[31]=s,t[32]=n,t[33]=l?.sharedToastId,t[34]=E):E=t[34];let D;return t[35]!==E||t[36]!==T?(D=(0,q.jsxs)(q.Fragment,{children:[T,E]}),t[35]=E,t[36]=T,t[37]=D):D=t[37],D}function $t(){let e=(0,Q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:en},e[0]=t):t=e[0];let n=be(t),r;e[1]===n?r=e[2]:(r=e=>n?.kind===`draft`?e.getDraftSession(n.draftId):null,e[1]=n,e[2]=r);let i=l(r),a;bb0:{if(n?.kind===`server`){a=n.threadRef;break bb0}if(n?.kind===`draft`&&i){let t;e[3]!==i.environmentId||e[4]!==i.threadId?(t={environmentId:i.environmentId,threadId:i.threadId},e[3]=i.environmentId,e[4]=i.threadId,e[5]=t):t=e[5],a=t;break bb0}a=null}return a}function en(e){return At(e)}function tn(e){let t=(0,Q.c)(4),{toastId:n,dismissAfterVisibleMs:r}=e,i,a;return t[0]!==r||t[1]!==n?(i=()=>{if(!r||r<=0||typeof window>`u`||typeof document>`u`)return;let e=Rt.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,Rt.delete(n),$.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),Rt.set(n,e))},l=()=>{if(!(a||t!==null)){if(e<=0){s();return}t=Date.now(),o(),i=window.setTimeout(()=>{e=0,t=null,s()},e)}},u=()=>{if(document.visibilityState===`visible`&&document.hasFocus()){l();return}c()};return u(),document.addEventListener(`visibilitychange`,u),window.addEventListener(`focus`,u),window.addEventListener(`blur`,u),()=>{document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`focus`,u),window.removeEventListener(`blur`,u),c(),o()}},a=[r,n],t[0]=r,t[1]=n,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,G.useEffect)(i,a),null}function nn(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,position:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`top-center`:i,o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(pt,{}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,q.jsx)(rn,{position:a}),t[5]=a,t[6]=s);let c;return t[7]!==n||t[8]!==r||t[9]!==s?(c=(0,q.jsxs)(ze,{toastManager:$,...r,children:[o,n,s]}),t[7]=n,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function rn(e){let t=(0,Q.c)(19),{position:n}=e,{toasts:r}=ct(),i=$t(),a;t[0]===n?a=t[1]:(a=n.startsWith(`top`),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=e=>It(e.data,i),t[2]=i,t[3]=s);let c=Pt(r.filter(s)),l,u;t[4]===r?(l=t[5],u=t[6]):(l=()=>{let e=new Set(r.map(an));for(let t of Rt.keys())e.has(t)||Rt.delete(t)},u=[r],t[4]=r,t[5]=l,t[6]=u),(0,G.useEffect)(l,u);let d=ut,f=ut,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=B(`fixed z-100 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-header-offset:var(--workspace-topbar-height)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]`,`data-[position*=top]:top-[calc(var(--toast-inset)+var(--toast-header-offset))]`,`data-[position*=bottom]:bottom-(--toast-inset)`,`data-[position*=left]:left-(--toast-inset)`,`data-[position*=right]:right-(--toast-inset)`,`data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2`),t[7]=p):p=t[7];let m=`${c.frontmostHeight}px`,h;t[8]===m?h=t[9]:(h={"--toast-frontmost-height":m},t[8]=m,t[9]=h);let g=h,_=c.items.map(e=>{let{toast:t,visibleIndex:r,offsetY:i}=e,a=Nt(r,c.items.length),s=Zt(t),{stackedActionLayout:l,inlineContentEndPad:u}=s;return(0,q.jsxs)(Ze,{className:B(`dropdown-glass absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-xl text-popover-foreground shadow-lg shadow-black/10 [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] motion-reduce:transition-none`,`data-[position*=right]:right-0 data-[position*=right]:left-auto`,`data-[position*=left]:right-auto data-[position*=left]:left-0`,`data-[position*=center]:right-0 data-[position*=center]:left-0`,`data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top`,`data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom`,`after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full`,`data-[position*=top]:after:top-full`,`data-[position*=bottom]:after:bottom-full`,r>0?`not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`:`[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`,`[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]`,r>0?`not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto`:`h-auto`,`data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]`,`data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]`,`data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-limited:opacity-0`,`data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]`,`data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]`,`data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-starting-style:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:opacity-0`,`data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(var(--toast-calc-offset-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`),"data-position":n,onPointerEnter:()=>{t.data?.sharedToastId&&Z.pause(t.data.sharedToastId,`pointer`)},onPointerLeave:()=>{t.data?.sharedToastId&&Z.resume(t.data.sharedToastId,`pointer`)},onFocusCapture:()=>{t.data?.sharedToastId&&Z.pause(t.data.sharedToastId,`focus`)},onBlurCapture:e=>{t.data?.sharedToastId&&!e.currentTarget.contains(e.relatedTarget)&&Z.resume(t.data.sharedToastId,`focus`)},style:{"--toast-index":r,"--toast-offset-y":`${i}px`},swipeDirection:n.includes(`center`)?[o?`up`:`down`]:n.includes(`left`)?[`left`,o?`up`:`down`]:[`right`,o?`up`:`down`],toast:t,children:[(0,q.jsx)(tn,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),!t.data?.sharedToastId&&(0,q.jsx)(`div`,{className:Ht,children:(0,q.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Ut,"data-slot":`toast-close`,onClick:()=>Wt($,t.id,t.data?.onClose),type:`button`,children:(0,q.jsx)(j,{className:`size-3`,strokeWidth:2.25})})}),(0,q.jsxs)(Qe,{className:B(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm transition-opacity duration-250 [overflow-x:clip] data-expanded:opacity-100`,l?`flex flex-col gap-2 py-2.5 pr-3.5`:B(`py-3`,`flex items-center justify-between gap-2`,t.data?.sharedToastId?`pr-2`:u),a&&`not-data-expanded:pointer-events-none not-data-expanded:opacity-0`),children:[(0,q.jsx)(Qt,{...s,actionProps:t.actionProps,toastData:t.data,toastDescription:t.description,toastType:t.type}),t.data?.sharedToastId&&(0,q.jsx)(fe,{size:`icon-xs`,variant:`ghost`,"aria-label":`Dismiss notification`,onClick:()=>Z.dismiss(t.data.sharedToastId),children:(0,q.jsx)(j,{})})]})]},t.id)}),v;t[10]!==n||t[11]!==g||t[12]!==_||t[13]!==f.Viewport||t[14]!==p?(v=(0,q.jsx)(f.Viewport,{className:p,"data-position":n,"data-slot":`toast-viewport`,style:g,children:_}),t[10]=n,t[11]=g,t[12]=_,t[13]=f.Viewport,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==d.Portal?(y=(0,q.jsx)(d.Portal,{"data-slot":`toast-portal`,children:v}),t[16]=v,t[17]=d.Portal,t[18]=y):y=t[18],y}function an(e){return e.id}function on(e){let t=(0,Q.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,q.jsx)(sn,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,q.jsxs)(ze,{toastManager:Lt,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function sn(){let e=(0,Q.c)(7),{toasts:t}=ct(),n=$t(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>It(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(cn),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,q.jsx)(rt,{"data-slot":`toast-portal-anchored`,children:(0,q.jsx)(Ve,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function cn(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=Zt(e),{stackedActionLayout:i,inlineContentEndPad:a}=r;return n?.anchor?(0,q.jsx)(ot,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,q.jsx)(Ze,{className:B(`dropdown-glass relative overflow-visible text-balance text-popover-foreground text-xs shadow-xl shadow-black/25 transition-[scale,opacity] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0`,t?`rounded-md`:`rounded-lg`),"data-slot":`toast-popup`,toast:e,children:t?(0,q.jsx)(Qe,{className:`pointer-events-auto px-2 py-1`,children:(0,q.jsx)(et,{"data-slot":`toast-title`})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:Ht,children:(0,q.jsx)(`button`,{"aria-label":`Dismiss notification`,className:Ut,"data-slot":`toast-close`,onClick:()=>Wt(Lt,e.id,e.data?.onClose),type:`button`,children:(0,q.jsx)(j,{className:`size-3`,strokeWidth:2.25})})}),(0,q.jsx)(Qe,{className:B(`pointer-events-auto min-h-0 overflow-y-visible pl-3.5 text-sm [overflow-x:clip]`,i?`flex flex-col gap-2 py-2.5 pr-3.5`:B(`py-3`,`flex items-center justify-between gap-1.5`,a)),children:(0,q.jsx)(Qt,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type})})]})})},e.id):null}export{Ee as _,Ot as a,jt as c,At as d,Ct as f,Ae as g,Z as h,$ as i,kt as l,St as m,nn as n,Dt as o,wt as p,Lt as r,Tt as s,on as t,Et as u,De as v};
|
|
2
|
-
//# sourceMappingURL=toast-DYfY2t_z.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{r as n}from"./Icon-l19w4AjM.js";import{AE as r,CE as i,DE as a,Dc as o,EE as s,Km as c,ME as l,OE as u,SE as d,TE as f,Ym as p,_E as m,bE as h,cE as g,dE as _,fE as v,gE as y,hE as b,jE as x,kE as S,lE as C,mE as w,pE as T,qm as E,r as D,t as ee,uE as O,vE as k,wE as te,xE as ne,yE as A}from"./utils-CRwA5SKO.js";import{a as j,i as M,n as re,o as N,r as ie,s as ae,t as oe}from"./TooltipViewport-Wc_QpRGI.js";import{t as se}from"./env-wK1YYxA8.js";var P=e(t((e=>{e.Check=[[`path`,{d:`M20 6 9 17l-5-5`}]],e.ChevronDown=[[`path`,{d:`m6 9 6 6 6-6`}]],e.ChevronRight=[[`path`,{d:`m9 18 6-6-6-6`}]],e.ChevronUp=[[`path`,{d:`m18 15-6-6-6 6`}]],e.ChevronsDownUp=[[`path`,{d:`m7 20 5-5 5 5`}],[`path`,{d:`m7 4 5 5 5-5`}]],e.ChevronsUpDown=[[`path`,{d:`m7 15 5 5 5-5`}],[`path`,{d:`m7 9 5-5 5 5`}]],e.Circle=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]],e.CircleAlert=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]],e.CircleCheck=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m9 12 2 2 4-4`}]],e.Code2=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]],e.Copy=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],e.CornerUpRight=[[`path`,{d:`m15 14 5-5-5-5`}],[`path`,{d:`M4 20v-7a4 4 0 0 1 4-4h12`}]],e.Eye=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]],e.FoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]],e.Folder=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]],e.FolderClosed=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}],[`path`,{d:`M2 10h20`}]],e.FolderOpen=[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]],e.Image=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}]],e.Link=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]],e.ListPlus=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]],e.Lock=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]],e.LockOpen=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}]],e.Maximize2=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]],e.Minimize2=[[`path`,{d:`m14 10 7-7`}],[`path`,{d:`M20 10h-6V4`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M4 14h6v6`}]],e.Minus=[[`path`,{d:`M5 12h14`}]],e.Moon=[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`}]],e.PanelLeft=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]],e.PanelLeftClose=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]],e.Plus=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]],e.Sun=[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`m4.93 4.93 1.41 1.41`}],[`path`,{d:`m17.66 17.66 1.41 1.41`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`m6.34 17.66-1.41 1.41`}],[`path`,{d:`m19.07 4.93-1.41 1.41`}]],e.Table2=[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`}]],e.Text=[[`path`,{d:`M21 5H3`}],[`path`,{d:`M15 12H3`}],[`path`,{d:`M17 19H3`}]],e.UnfoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]],e.Volume2=[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`}]],e.VolumeOff=[[`path`,{d:`M16 9a5 5 0 0 1 .95 2.293`}],[`path`,{d:`M19.364 5.636a9 9 0 0 1 1.889 9.96`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11`}],[`path`,{d:`M9.828 4.172A.686.686 0 0 1 11 4.657v.686`}]]}))(),1),F=c(P.Check,_),I=c(P.ChevronDown,v),ce=c(P.ChevronRight,T),le=c(P.ChevronUp,w),ue=c(P.ChevronsDownUp,null),de=c(P.ChevronsUpDown,null),fe=c(P.Circle,b),pe=c(P.CircleAlert,O),me=c(P.CircleCheck,S),he=c(P.Code2,y),ge=c(P.Copy,m),_e=c(P.CornerUpRight,null),ve=c(P.Eye,null),ye=c(P.FoldVertical,null),be=c(P.Folder,k),xe=c(P.FolderClosed,k),Se=c(P.FolderOpen,A),Ce=c(P.Image,h),we=c(P.Link,ne),Te=c(P.ListPlus,null),Ee=c(P.Lock,null),De=c(P.LockOpen,null),Oe=c(P.Maximize2,d),ke=c(P.Minimize2,null),Ae=c(P.Minus,i),je=c(P.Moon,te),Me=c(P.PanelLeft,f),Ne=c(P.PanelLeftClose,null),Pe=c(P.Plus,C),Fe=c(P.Sun,s),Ie=c(P.Table2,a),Le=c(P.Text,u),Re=c(P.UnfoldVertical,null),ze=c(P.Volume2,r),Be=c(P.VolumeOff,x),L=l(),Ve=`MmLlHhVvCcSsQqTtAaZz`;function He(e){let t=[],n=e.length,r=0,i=0,a=0,o=0,s=0,c=null,l=``,u=0,d=0,f=``,p=!1,m=e=>{throw Error(`morphicons: ${e} at d[${r}]`)},h=e=>e>=48&&e<=57,g=()=>{for(;r<n;){let t=e.charCodeAt(r);if(t===32||t===9||t===10||t===13||t===12||t===44)r++;else break}},_=()=>{g();let t=r;r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(r<n&&e[r]===`.`)for(r++;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(i||m(`expected number`),r<n&&(e[r]===`e`||e[r]===`E`)){let t=r;r++,r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;i||(r=t)}return Number(e.slice(t,r))},v=()=>{g();let t=e[r];return t===`0`||t===`1`?(r++,+(t===`1`)):m(`expected arc flag (0|1)`)},y=()=>(p||m(`path must start with M/m`),c||(c={x0:i,y0:a,segs:[],closed:!1},t.push(c)),c),b=!1,x=()=>_()+(b?i:0),S=()=>_()+(b?a:0);for(;g(),!(r>=n);){let n=e[r];switch(Ve.includes(n)?(l=n,r++):l===``?m(`path must start with M/m`):l===`M`?l=`L`:l===`m`?l=`l`:(l===`Z`||l===`z`)&&m(`stray data after Z`),b=l>=`a`,b?l.toUpperCase():l){case`M`:{p=!0;let e=x(),n=S();i=e,a=n,o=e,s=n,c={x0:e,y0:n,segs:[],closed:!1},t.push(c),f=``;break}case`L`:{let e=x(),t=S();y().segs.push([`L`,e,t]),i=e,a=t,f=``;break}case`H`:{let e=x();y().segs.push([`L`,e,a]),i=e,f=``;break}case`V`:{let e=S();y().segs.push([`L`,i,e]),a=e,f=``;break}case`C`:case`S`:{let e,t;l===`C`||l===`c`?(e=x(),t=S()):(e=f===`C`?2*i-u:i,t=f===`C`?2*a-d:a);let n=x(),r=S(),o=x(),s=S();y().segs.push([`C`,e,t,n,r,o,s]),u=n,d=r,i=o,a=s,f=`C`;break}case`Q`:case`T`:{let e,t;l===`Q`||l===`q`?(e=x(),t=S()):(e=f===`Q`?2*i-u:i,t=f===`Q`?2*a-d:a);let n=x(),r=S();y().segs.push([`Q`,e,t,n,r]),u=e,d=t,i=n,a=r,f=`Q`;break}case`A`:{let e=_(),t=_(),n=_(),r=v(),o=v(),s=x(),c=S();y().segs.push([`A`,e,t,n,r,o,s,c]),i=s,a=c,f=``;break}case`Z`:c&&=(c.closed=!0,null),i=o,a=s,f=``;break;default:m(`unsupported command "${l}"`)}}return t.filter(e=>e.segs.length>0)}function R(e){return String(Math.round(e*100)/100)}function Ue(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=i.length/2;n+=`M${R(i[0])} ${R(i[1])}`;for(let e=1;e<a;e++)n+=`L${R(i[2*e])} ${R(i[2*e+1])}`;t?.[r]&&(n+=`Z`)}return n}function z(e){return String(Math.round(e*1e4)/1e4)}function We(e){let t=``;for(let{pts:n,closed:r}of e){t+=`M${z(n[0])} ${z(n[1])}`;for(let e=2;e<n.length;e+=6)t+=`C${z(n[e])} ${z(n[e+1])} ${z(n[e+2])} ${z(n[e+3])} ${z(n[e+4])} ${z(n[e+5])}`;r&&(t+=`Z`)}return t}var B=4/3*Math.tan(Math.PI/8),Ge=2*Math.PI;function V(e,t){let n=[e,t],r=e,i=t,a=(e,t,a,o,s,c)=>{n.push(e,t,a,o,s,c),r=s,i=c},o=(e,t)=>{Math.abs(e-r)<1e-12&&Math.abs(t-i)<1e-12||a(r+(e-r)/3,i+(t-i)/3,r+2*(e-r)/3,i+2*(t-i)/3,e,t)};return[a,o,(e,t,n,o)=>{a(r+2/3*(e-r),i+2/3*(t-i),n+2/3*(e-n),o+2/3*(t-o),n,o)},(e,t,n,s,c,l,u)=>{let d=r,f=i;if(Math.abs(l-d)<1e-12&&Math.abs(u-f)<1e-12)return;let p=Math.abs(e),m=Math.abs(t);if(p<1e-12||m<1e-12){o(l,u);return}let h=n*Math.PI/180,g=Math.cos(h),_=Math.sin(h),v=(d-l)/2,y=(f-u)/2,b=g*v+_*y,x=-_*v+g*y,S=b*b/(p*p)+x*x/(m*m);if(S>1){let e=Math.sqrt(S);p*=e,m*=e}let C=p*p,w=m*m,T=b*b,E=x*x,D=(C*w-C*E-w*T)/(C*E+w*T);D<0&&(D=0);let ee=(s===c?-1:1)*Math.sqrt(D),O=ee*p*x/m,k=-ee*m*b/p,te=g*O-_*k+(d+l)/2,ne=_*O+g*k+(f+u)/2,A=Math.atan2((x-k)/m,(b-O)/p),j=Math.atan2((-x-k)/m,(-b-O)/p)-A;c===0&&j>0?j-=Ge:c===1&&j<0&&(j+=Ge);let M=Math.max(1,Math.ceil(Math.abs(j)/(Math.PI/2)-1e-9)),re=j/M,N=4/3*Math.tan(re/4),ie=e=>te+p*Math.cos(e)*g-m*Math.sin(e)*_,ae=e=>ne+p*Math.cos(e)*_+m*Math.sin(e)*g,oe=e=>-p*Math.sin(e)*g-m*Math.cos(e)*_,se=e=>-p*Math.sin(e)*_+m*Math.cos(e)*g,P=A,F=d,I=f;for(let e=1;e<=M;e++){let t=A+re*e,n=e===M?l:ie(t),r=e===M?u:ae(t);a(F+N*oe(P),I+N*se(P),n-N*oe(t),r-N*se(t),n,r),P=t,F=n,I=r}},e=>(e&&o(n[0],n[1]),n.length<8?null:{pts:Float64Array.from(n),closed:e})]}function Ke(e){let[t,n,r,i,a]=V(e.x0,e.y0);for(let a of e.segs)switch(a[0]){case`L`:n(a[1],a[2]);break;case`C`:t(a[1],a[2],a[3],a[4],a[5],a[6]);break;case`Q`:r(a[1],a[2],a[3],a[4]);break;case`A`:i(a[1],a[2],a[3],a[4],a[5],a[6],a[7])}return a(e.closed)}function H(e,t,n=0){let r=e[t];if(r===void 0)return n;let i=typeof r==`number`?r:Number(r);return Number.isFinite(i)?i:n}function qe(e){let t=String(e??``).trim();if(!t)return[];let n=t.split(/[\s,]+/).map(Number);if(n.some(e=>!Number.isFinite(e)))throw Error(`morphicons: invalid points: "${t}"`);return n}function Je(e,t){if(e.length<4)return null;let[,n,,,r]=V(e[0],e[1]);for(let t=2;t+1<e.length;t+=2)n(e[t],e[t+1]);return r(t)}function Ye(e,t,n,r){if(n<1e-12||r<1e-12)return null;let i=B*n,a=B*r,o=e+n,s=e-n,c=t+r,l=t-r,[u,,,,d]=V(o,t);return u(o,t+a,e+i,c,e,c),u(e-i,c,s,t+a,s,t),u(s,t-a,e-i,l,e,l),u(e+i,l,o,t-a,o,t),d(!0)}function Xe(e){let t=H(e,`x`),n=H(e,`y`),r=H(e,`width`),i=H(e,`height`);if(r<1e-12||i<1e-12)return null;let a=H(e,`rx`,NaN),o=H(e,`ry`,NaN);if(Number.isNaN(a)&&(a=Number.isNaN(o)?0:o),Number.isNaN(o)&&(o=a),a=Math.min(Math.max(a,0),r/2),o=Math.min(Math.max(o,0),i/2),a<1e-12||o<1e-12)return Je([t,n,t+r,n,t+r,n+i,t,n+i],!0);let s=t+a,c=t+r-a,l=t+r,u=n+o,d=n+i-o,f=n+i,p=B*a,m=B*o,[h,g,,,_]=V(s,n);return g(c,n),h(c+p,n,l,u-m,l,u),g(l,d),h(l,d+m,c+p,f,c,f),g(s,f),h(s-p,f,t,d+m,t,d),g(t,u),h(t,u-m,s-p,n,s,n),_(!0)}function Ze(e){let t=[],n=e=>{e&&t.push(e)};if(typeof e==`string`){for(let t of He(e))n(Ke(t));return t}for(let[t,r]of e)switch(t){case`path`:for(let e of He(String(r.d??``)))n(Ke(e));break;case`line`:{let[,e,,,t]=V(H(r,`x1`),H(r,`y1`));e(H(r,`x2`),H(r,`y2`)),n(t(!1));break}case`circle`:{let e=H(r,`r`);n(Ye(H(r,`cx`),H(r,`cy`),e,e));break}case`ellipse`:n(Ye(H(r,`cx`),H(r,`cy`),H(r,`rx`),H(r,`ry`)));break;case`rect`:n(Xe(r));break;case`polyline`:n(Je(qe(r.points),!1));break;case`polygon`:n(Je(qe(r.points),!0));break;default:throw Error(`morphicons: unsupported tag <${t}>`)}return t}function Qe(e){return e.items.map(()=>new Float64Array(2*e.n))}function $e(e,t,n){for(let r=0;r<e.items.length;r++){let i=e.items[r],a=n[r],o=e.n,s=Math.exp(i.lnSigma*t),c=i.theta*t,l=Math.cos(c)*s,u=Math.sin(c)*s,d,f;if(i.block){let[e,n]=i.block.off,[r,a]=i.block.drift;d=i.ca[0]+r*t+(e*l-n*u-e),f=i.ca[1]+a*t+(e*u+n*l-n)}else d=i.ca[0]+(i.cb[0]-i.ca[0])*t,f=i.ca[1]+(i.cb[1]-i.ca[1])*t;for(let e=0;e<o;e++){let n=i.aC[2*e]+(i.bT[2*e]-i.aC[2*e])*t,r=i.aC[2*e+1]+(i.bT[2*e+1]-i.aC[2*e+1])*t;a[2*e]=d+n*l-r*u,a[2*e+1]=f+n*u+r*l}}}var et=.35,tt=.05,nt=.005,rt=8,it=1e5;function U(e){let t=e.length/2,n=0,r=0;for(let i=0;i<t;i++)n+=e[2*i],r+=e[2*i+1];return[n/t,r/t]}function at(e){let t=e.length/2,n=0;for(let r=1;r<t;r++)n+=Math.hypot(e[2*r]-e[2*r-2],e[2*r+1]-e[2*r-1]);return n}function ot(e){let t=e.length/2,n=new Float64Array(2*t);for(let r=0;r<t;r++)n[2*r]=e[2*(t-1-r)],n[2*r+1]=e[2*(t-1-r)+1];return n}function st(e,t){let n=e.length/2,r=new Float64Array(2*n);for(let i=0;i<n;i++){let a=(i+t)%n;r[2*i]=e[2*a],r[2*i+1]=e[2*a+1]}return r}function ct(e,t,n,r){let i=e.length/2,a=0,o=0,s=0,c=0,l=0,u=0;for(let d=0;d<i;d++){let i=e[2*d]-n[0],f=e[2*d+1]-n[1],p=t[2*d]-r[0],m=t[2*d+1]-r[1];a+=i*p,c+=f*m,o+=i*m,s+=f*p,l+=i*i+f*f,u+=p*p+m*m}let d=Math.atan2(o-s,a+c),f=Math.cos(d)*(a+c)+Math.sin(d)*(o-s),p=l>1e-12?f/l:1;p>1e-6||(p=1e-6);let m=Math.max(0,p*p*l-2*p*f+u),h=u>1e-12?Math.sqrt(m/u):0;return{theta:d,sigma:p,res:h}}function lt(e,t,n=!1,r=!1){let i=U(e),a=U(t),o=n&&!r,s=o?e:t,c=n||r?s.length/2:1,l=1/0,u=s,d={theta:0,sigma:1,res:0};for(let n=0;n<2;n++){let r=n?ot(s):s;for(let n=0;n<c;n++){let s=n?st(r,n):r,c=o?ct(s,t,i,a):ct(e,s,i,a),f=c.res+tt*Math.abs(c.theta)/Math.PI;f<l&&(l=f,u=s,d=c)}}return o?{ca:i,cb:a,a:u,b:t,...d}:{ca:i,cb:a,a:e,b:u,...d}}function ut(e,t){let n=t.map(U),r=t.map(at);return e.map(e=>{let t=U(e),i=at(e);return n.map((e,n)=>Math.hypot(t[0]-e[0],t[1]-e[1])+et*Math.abs(i-r[n]))})}function dt(e){let t=e.length;if(t>rt){let n=[];for(let r=0;r<t;r++)for(let i=0;i<t;i++)n.push([e[r][i],r,i]);n.sort((e,t)=>e[0]-t[0]);let r=Array(t).fill(-1),i=Array(t).fill(!1);for(let[,e,t]of n)r[e]<0&&!i[t]&&(r[e]=t,i[t]=!0);return r}let n=Array.from({length:t},(e,t)=>t),r=n.slice(),i=1/0,a=(n,o,s)=>{if(!(s>=i)){if(o===t){i=s,r=n.slice();return}for(let r=o;r<t;r++)[n[o],n[r]]=[n[r],n[o]],a(n,o+1,s+e[o][n[o]]),[n[o],n[r]]=[n[r],n[o]]}};return a(n,0,0),r}function ft(e){let t=e.length,n=e[0].length;if(n**t>it){let r=e.map(e=>{let t=0;for(let n=1;n<e.length;n++)e[n]<e[t]&&(t=n);return t}),i=Array(n).fill(0);for(let e of r)i[e]++;for(let a=0;a<n;a++){if(i[a]>0)continue;let n=-1,o=1/0;for(let s=0;s<t;s++){if(i[r[s]]<2)continue;let t=e[s][a]-e[s][r[s]];t<o&&(o=t,n=s)}i[r[n]]--,r[n]=a,i[a]++}return r}let r=null,i=1/0,a=Array(t),o=Array(n).fill(0),s=(c,l,u)=>{if(!(l>=i||n-u>t-c)){if(c===t){i=l,r=a.slice();return}for(let t=0;t<n;t++)a[c]=t,o[t]++,s(c+1,l+e[c][t],u+ +(o[t]===1)),o[t]--}};if(s(0,0,0),!r)throw Error(`morphicons: no valid surjection (B < S)`);return r}function pt(e,t){let n=e.length*t,r=new Float64Array(2*n),i=new Float64Array(2*n);e.forEach((e,n)=>{r.set(e.a,2*t*n),i.set(e.bO,2*t*n)});let a=U(r),o=ct(r,i,a,U(i));if(o.res>=nt)return;let s=Math.cos(-o.theta),c=Math.sin(-o.theta),l=Math.cos(o.theta),u=Math.sin(o.theta);for(let n of e){let e=0,r=0;for(let i=0;i<t;i++){let t=n.bO[2*i]-n.cb[0],a=n.bO[2*i+1]-n.cb[1];n.bT[2*i]=(t*s-a*c)/o.sigma,n.bT[2*i+1]=(t*c+a*s)/o.sigma;let d=o.sigma*(l*n.aC[2*i]-u*n.aC[2*i+1])-t,f=o.sigma*(u*n.aC[2*i]+l*n.aC[2*i+1])-a;e+=d*d+f*f,r+=t*t+a*a}n.theta=o.theta,n.lnSigma=Math.log(o.sigma),n.res=r>1e-12?Math.sqrt(e/r):0;let i=Math.exp(n.lnSigma),d=Math.cos(n.theta)*i,f=Math.sin(n.theta)*i,p=n.ca[0]-a[0],m=n.ca[1]-a[1],h=p*d-m*f-p,g=p*f+m*d-m;n.block={off:[p,m],drift:[n.cb[0]-n.ca[0]-h,n.cb[1]-n.ca[1]-g]}}}function W(e,t){let n=e.length,r=t.length;if(n===0||r===0)throw Error(`morphicons: icon has no subpaths`);let i=e.map(e=>e.pts),a=t.map(e=>e.pts),o=[];if(n===r){let e=dt(ut(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}else if(n<r){let e=ft(ut(a,i));for(let t=0;t<r;t++)o.push([e[t],t])}else{let e=ft(ut(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}let s=i[0].length/2,c=o.map(([n,r])=>{let o=lt(i[n],a[r],e[n].closed,t[r].closed),c=o.a,l=new Float64Array(2*s),u=new Float64Array(2*s),d=new Float64Array(2*s),f=Math.cos(-o.theta),p=Math.sin(-o.theta);for(let e=0;e<s;e++){l[2*e]=c[2*e]-o.ca[0],l[2*e+1]=c[2*e+1]-o.ca[1];let t=o.b[2*e]-o.cb[0],n=o.b[2*e+1]-o.cb[1];u[2*e]=(t*f-n*p)/o.sigma,u[2*e+1]=(t*p+n*f)/o.sigma,d[2*e]=o.b[2*e],d[2*e+1]=o.b[2*e+1]}return{a:c,aC:l,bT:u,bO:d,ca:o.ca,cb:o.cb,theta:o.theta,lnSigma:Math.log(o.sigma),res:o.res,closed:e[n].closed&&t[r].closed,block:null}});return c.length>1&&pt(c,s),{items:c,n:s}}var mt=Math.PI/8,ht=[.18343464249564978,.525532409916329,.7966664774136267,.9602898564975363],gt=[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626];function _t(e,t,n){let r=6*t,i=1-n,a=3*i*i,o=6*i*n,s=3*n*n,c=a*(e[r+2]-e[r])+o*(e[r+4]-e[r+2])+s*(e[r+6]-e[r+4]),l=a*(e[r+3]-e[r+1])+o*(e[r+5]-e[r+3])+s*(e[r+7]-e[r+5]);return Math.hypot(c,l)}function vt(e,t,n=1){let r=n/2,i=0;for(let n=0;n<4;n++)i+=gt[n]*(_t(e,t,r+r*ht[n])+_t(e,t,r-r*ht[n]));return i*r}function yt(e,t,n,r,i){let a=6*t,o=1-n,s=o*o*o,c=3*o*o*n,l=3*o*n*n,u=n*n*n;r[i]=s*e[a]+c*e[a+2]+l*e[a+4]+u*e[a+6],r[i+1]=s*e[a+1]+c*e[a+3]+l*e[a+5]+u*e[a+7]}function bt(e,t,n){let r=6*t,i=n?r+6:r,a=n?-1:1;for(let t of n?[4,2,0]:[2,4,6]){let n=a*(e[r+t]-e[i]),o=a*(e[r+t+1]-e[i+1]);if(n*n+o*o>1e-18)return[n,o]}return null}function xt(e,t=mt){let n=e.pts,r=(n.length/2-1)/3,i=[];for(let e=0;e<r;e++)vt(n,e)>1e-9&&i.push(e);if(i.length===0)return[];let a=new Set,o=(e,r)=>{let i=bt(n,e,!0),o=bt(n,r,!1);i&&o&&Math.abs(Math.atan2(i[0]*o[1]-i[1]*o[0],i[0]*o[0]+i[1]*o[1]))>t&&a.add(r)};for(let e=0;e+1<i.length;e++)o(i[e],i[e+1]);return e.closed&&i.length>1&&o(i[i.length-1],i[0]),[...a].sort((e,t)=>e-t)}function St(e,t,n,r){if(n<=0)return 0;if(n>=r)return 1;let i=0,a=1,o=n/r;for(let s=0;s<12;s++){let s=vt(e,t,o)-n;if(Math.abs(s)<1e-10*r+1e-14)break;s>0?a=o:i=o;let c=_t(e,t,o),l=c>1e-12?o-s/c:(i+a)/2;l>i&&l<a||(l=(i+a)/2),o=l}return o}function Ct(e,t=64,n=mt){let r=e.pts,i=(r.length/2-1)/3,a=new Float64Array(2*t),o=()=>{for(let e=0;e<t;e++)a[2*e]=r[0],a[2*e+1]=r[1];return a};if(i<1)return o();let s=Array(i),c=0;for(let e=0;e<i;e++)s[e]=vt(r,e),c+=s[e];if(c<1e-12)return o();let l=xt(e,n),u=e.closed?l.length>0?l:[0]:[...new Set([0,...l,i])].sort((e,t)=>e-t),d=[];if(e.closed)for(let e=0;e<u.length;e++){let t=u[e],n=e+1<u.length?u[e+1]:u[0]+i;d.push([t,n])}else for(let e=0;e+1<u.length;e++)d.push([u[e],u[e+1]]);let f=d.map(([e,t])=>{let n=0;for(let r=e;r<t;r++)n+=s[r%i];return n}),p=e.closed?t:t-1;if(d.length>p)throw Error(`morphicons: N=${t} too small (${d.length} runs)`);let m=f.reduce((e,t)=>e+t,0)||1,h=f.map(e=>p*e/m),g=h.map(e=>Math.max(1,Math.floor(e))),_=p-g.reduce((e,t)=>e+t,0);if(_>0){let e=h.map((e,t)=>[Math.round((e-Math.floor(e))*1e9),t]).sort((e,t)=>t[0]-e[0]||e[1]-t[1]);for(let t=0;t<_;t++)g[e[t%g.length][1]]++}for(;_<0;){let e=0;for(let t=1;t<g.length;t++)g[t]>g[e]&&(e=t);if(g[e]<=1)break;g[e]--,_++}let v=0;for(let e=0;e<d.length;e++){let[t,n]=d[e],o=g[e],c=f[e],l=t%i*6;a[2*v]=r[l],a[2*v+1]=r[l+1],v++;let u=t,p=0;for(let e=1;e<o;e++){let t=c*e/o;for(;u<n-1&&p+s[u%i]<t;)p+=s[u%i],u++;let l=u%i,d=s[l];yt(r,l,d>1e-12?St(r,l,t-p,d):0,a,2*v),v++}}if(!e.closed){let e=6*i;a[2*v]=r[e],a[2*v+1]=r[e+1]}return a}function G(e,t=64){return Ze(e).map(e=>({pts:Ct(e,t),closed:e.closed}))}var wt=class{x=1;v=0;k=250;c=24;config(e,t){this.k=e,this.c=t}start(){this.x=0,this.v>14&&(this.v=14),this.v<-14&&(this.v=-14)}step(e){let t=Math.max(1,Math.min(16,Math.ceil(e/(1/240)))),n=e/t;for(let e=0;e<t;e++){let e=this.k*(1-this.x)-this.c*this.v;this.v+=e*n,this.x+=this.v*n}return Math.abs(1-this.x)<.001&&Math.abs(this.v)<.02}},Tt={smooth:{k:170,c:26},snappy:{k:420,c:30},bouncy:{k:300,c:14}},K=new Set,q=0,J=-1;function Et(e){let t=J<0?0:Math.min(Math.max((e-J)/1e3,0),.1);J=e;for(let e of[...K])e(t);K.size>0?q=requestAnimationFrame(Et):(q=0,J=-1)}function Dt(e){K.add(e),q===0&&(J=-1,q=requestAnimationFrame(Et))}function Ot(e){K.delete(e),K.size===0&&q!==0&&(cancelAnimationFrame(q),q=0,J=-1)}var kt=new WeakMap,At=new WeakMap,jt=new WeakMap;function Y(e){if(typeof e==`string`)return G(e);let t=kt.get(e);return t||(t=G(e),kt.set(e,t)),t}function X(e){if(typeof e==`string`)return e;let t=At.get(e);return t||(t=We(Ze(e)),At.set(e,t)),t}function Mt(e,t){if(typeof e==`string`||typeof t==`string`)return W(Y(e),Y(t));let n=jt.get(e);n||(n=new WeakMap,jt.set(e,n));let r=n.get(t);return r||(r=W(Y(e),Y(t)),n.set(t,r)),r}function Nt(e){if(typeof e==`string`)return Tt[e];let t=Tt.snappy;return{k:e?.stiffness??t.k,c:e?.damping??t.c}}function Pt(e,t,n){let r=new wt,i=n?.reducedMotion??`never`,a=t,o=!0,s=null,c=null,l=null,u=1,d=!1,f=!1;e.setAttribute(`d`,X(t));let p=t=>{let n=s,r=c,i=l;n&&r&&i&&(u=t,$e(n,t,r),e.setAttribute(`d`,Ue(r,i)))},m=()=>{d&&(d=!1,Ot(h))},h=e=>{let t=r.step(e);p(r.x),t&&(m(),g())},g=()=>{o=!0,s=null,c=null,l=null,u=1,r.x=1,r.v=0,e.setAttribute(`d`,X(a))},_=()=>{let e=s,t=c;return o||!e||!t?Y(a):t.map((t,n)=>({pts:Float64Array.from(t),closed:e.items[n].closed}))},v=e=>{s=o?Mt(a,e):W(_(),Y(e)),c=Qe(s),l=s.items.map(e=>e.closed),a=e,o=!1},y=e=>{m(),a=e,g()},b=()=>i===`always`?!0:i!==`user`||typeof matchMedia>`u`?!1:matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,x=(e,t)=>{if(f)return;let n=!o&&s!==null&&e===a;m(),r.v=0,n||v(e),p(t)};return{morphTo(e,t){if(f||e===a&&(o||d))return;if(b()){y(e);return}let{k:n,c:i}=Nt(t);r.config(n,i),v(e),r.start(),d||(d=!0,Dt(h))},set(e){f||y(e)},seek:x,get progress(){return o?1:u},set progress(e){f||x(a,e)},get reducedMotion(){return i},set reducedMotion(e){i=e},destroy(){m(),f=!0,s=null,c=null,l=null}}}var Z=e(n(),1),Q=e(g(),1),Ft=typeof document>`u`?Z.useEffect:Z.useLayoutEffect;function It(e,t,n){if(n<=0)return X(e);if(n>=1)return X(t);let r=W(G(e),G(t)),i=Qe(r);return $e(r,n,i),Ue(i,r.items.map(e=>e.closed))}var Lt=(0,Z.forwardRef)(function(e,t){let{icon:n,from:r,to:i,progress:a,spring:o,reducedMotion:s,size:c=24,color:l=`currentColor`,strokeWidth:u=2,absoluteStrokeWidth:d,label:f,...p}=e,m=r!==void 0&&i!==void 0,h=n??r??i,[g]=(0,Z.useState)(()=>m?It(r,i,a??0):h===void 0?``:X(h)),_=(0,Z.useRef)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(o);y.current=o;let b=(0,Z.useRef)(s);b.current=s;let x=(0,Z.useRef)(n),S=(0,Z.useRef)(m),C=(0,Z.useRef)(!1),w=(0,Z.useRef)(!1),T=(0,Z.useRef)(null),E=(0,Z.useCallback)(e=>{if(v.current)return v.current;let t=_.current;return C.current||!t?null:(v.current=Pt(t,e,{reducedMotion:b.current}),v.current)},[]);Ft(()=>{C.current=!1;let e=_.current;if(e&&h!==void 0){let t=Pt(e,m?r:h,{reducedMotion:b.current});if(v.current=t,m){T.current=[r,i];let e=a??0;e<=0?t.set(r):e>=1?t.set(i):(t.seek(i,e),w.current=!0)}}return()=>{C.current=!0,v.current?.destroy(),v.current=null,w.current=!1,T.current=null}},[]),(0,Z.useEffect)(()=>{let e=v.current;e&&(e.reducedMotion=s??`never`)},[s]),(0,Z.useEffect)(()=>{let e=S.current&&!m;S.current=m;let t=n!==x.current;if(x.current=n,m||n===void 0||!t&&!e)return;T.current=null,w.current=!1;let r=v.current;r?r.morphTo(n,y.current):E(n)},[n,m,E]),(0,Z.useEffect)(()=>{if(!m)return;let e=v.current??E(r);if(!e)return;let t=a??0;(!T.current||T.current[0]!==r||T.current[1]!==i)&&(T.current=[r,i],w.current=!1),t<=0?(e.set(r),w.current=!1):t>=1?(e.set(i),w.current=!1):(w.current||=(e.set(r),!0),e.seek(i,t))},[m,r,i,a,E]),(0,Z.useImperativeHandle)(t,()=>({morphTo:(e,t)=>{T.current=null,w.current=!1;let n=v.current;n?n.morphTo(e,t??y.current):E(e)},set:e=>{T.current=null,w.current=!1;let t=v.current;t?t.set(e):E(e)}}),[E]);let D=d?Number(u)*24/Number(c):u;return(0,Q.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:c,height:c,viewBox:`0 0 24 24`,fill:`none`,stroke:l,strokeWidth:D,strokeLinecap:`round`,strokeLinejoin:`round`,role:f?`img`:void 0,"aria-hidden":!f||void 0,...p,children:[f?(0,Q.jsx)(`title`,{children:f}):null,(0,Q.jsx)(`path`,{ref:_,d:g})]})});function Rt(e){return typeof e==`object`&&!!e&&`lucide`in e}function zt(e){let t=(0,L.c)(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({reducedMotion:a,icon:n,strokeWidth:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`user`:a,s=p(),c=Rt(n)?s===`p4`?n.p4??n.lucide:n.lucide:n,l;t[5]!==s||t[6]!==i?(l=s===`p4`?E(i):i,t[5]=s,t[6]=i,t[7]=l):l=t[7];let u=l,d;t[8]===c?d=t[9]:(d=c===void 0?{}:{icon:c},t[8]=c,t[9]=d);let f;t[10]===u?f=t[11]:(f=u===void 0?{}:{strokeWidth:u},t[10]=u,t[11]=f);let m;return t[12]!==r||t[13]!==o||t[14]!==d||t[15]!==f?(m=(0,Q.jsx)(Lt,{reducedMotion:o,...d,...f,...r}),t[12]=r,t[13]=o,t[14]=d,t[15]=f,t[16]=m):m=t[16],m}var Bt=`wco`,Vt=`electron`,Ht=`electron-windows`,Ut=52;function Wt(){return typeof navigator>`u`?null:navigator.windowControlsOverlay??null}function Gt(){if(typeof document>`u`)return()=>{};let e=Wt(),t=()=>{document.documentElement.classList.toggle(Bt,e!==null&&e.visible)};return t(),e?(e.addEventListener(`geometrychange`,t),()=>{e.removeEventListener(`geometrychange`,t)}):()=>{}}function Kt(e){let t=Wt();return t?.addEventListener(`geometrychange`,e),()=>t?.removeEventListener(`geometrychange`,e)}function qt(){if(se&&o(navigator.platform))return Ut;let e=Wt();return e?.visible?e.getTitlebarAreaRect().bottom:0}function Jt(){return(0,Z.useSyncExternalStore)(Kt,qt,Yt)}function Yt(){return 0}function Xt(e){return D(e)?[Vt,Ht]:[Vt]}function Zt(e){if(typeof document>`u`)return()=>{};let t=Xt(e);return document.documentElement.classList.add(...t),()=>{document.documentElement.classList.remove(...t)}}var $=5,Qt=re,$t=(0,Z.createContext)(null),en=(0,Z.createContext)(null);function tn(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({onScrollCapture:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=(0,Z.useRef)(null),a;t[3]===n?a=t[4]:(a=e=>{n?.(e);let t=i.current;t&&!t.trigger.contains(t.trigger.ownerDocument.activeElement)&&(i.current=null,t.actionsRef.current?.close())},t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,Q.jsx)(en,{value:i,children:(0,Q.jsx)(`div`,{...r,onScrollCapture:a})}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function nn(e){let t=(0,Z.use)(en),n=(0,Z.useRef)(null),r=e.actionsRef??n;return(0,Z.useEffect)(()=>()=>{t?.current?.actionsRef===r&&(t.current=null)},[r,t]),t?(0,Q.jsx)($t,{value:r,children:(0,Q.jsx)(ae,{...e,actionsRef:r,onOpenChange:(n,i)=>{e.onOpenChange?.(n,i),!n&&!i.isCanceled&&t.current?.actionsRef===r&&(t.current=null)}})}):(0,Q.jsx)(ae,{...e})}function rn(e){let t=(0,Z.use)(en),n=(0,Z.use)($t);return!t||!n?(0,Q.jsx)(N,{"data-slot":`tooltip-trigger`,...e}):(0,Q.jsx)(N,{"data-slot":`tooltip-trigger`,...e,onMouseEnter:r=>{e.onMouseEnter?.(r),t.current={trigger:r.currentTarget,actionsRef:n}}})}function an(e){let t=(0,L.c)(5),n=$+Jt(),r;t[0]===n?r=t[1]:(r={top:n,right:$,bottom:$,left:$},t[0]=n,t[1]=r);let i;return t[2]!==e||t[3]!==r?(i=(0,Q.jsx)(M,{className:`pointer-events-none z-[140] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,collisionPadding:r,"data-slot":`tooltip-positioner`,...e}),t[2]=e,t[3]=r,t[4]=i):i=t[4],i}function on(e){let t=(0,L.c)(25),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:i,align:o,sideOffset:s,side:c,variant:l,anchor:n,children:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=o===void 0?`center`:o,d=s===void 0?4:s,f=c===void 0?`top`:c,p=l===void 0?`default`:l,m=p===`glass`?`dropdown-glass shadow-xl shadow-black/25 before:hidden`:p===`inverse`?`rounded-xl border border-foreground bg-foreground text-background shadow-md/10 before:hidden`:`border bg-popover not-dark:bg-clip-padding shadow-md/5`,h=p===`code`?`max-w-120 wrap-anywhere text-left font-mono text-[11px] leading-relaxed`:`max-w-80 wrap-anywhere whitespace-normal leading-snug`,g;t[9]!==i||t[10]!==m||t[11]!==h?(g=ee(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md text-popover-foreground text-xs transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,m,h,i),t[9]=i,t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===r?_=t[14]:(_=(0,Q.jsx)(oe,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[13]=r,t[14]=_);let v;t[15]!==a||t[16]!==g||t[17]!==_?(v=(0,Q.jsx)(ie,{className:g,"data-slot":`tooltip-popup`,...a,children:_}),t[15]=a,t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;return t[19]!==u||t[20]!==n||t[21]!==f||t[22]!==d||t[23]!==v?(y=(0,Q.jsx)(j,{children:(0,Q.jsx)(an,{align:u,anchor:n,side:f,sideOffset:d,children:v})}),t[19]=u,t[20]=n,t[21]=f,t[22]=d,t[23]=v,t[24]=y):y=t[24],y}export{De as A,Le as B,be as C,we as D,Ce as E,Me as F,ze as H,Ne as I,Pe as L,ke as M,Ae as N,Te as O,je as P,Fe as R,ye as S,Se as T,Be as U,Re as V,me as _,rn as a,_e as b,zt as c,ce as d,le as f,pe as g,fe as h,tn as i,Oe as j,Ee as k,F as l,de as m,on as n,Zt as o,ue as p,Qt as r,Gt as s,nn as t,I as u,he as v,xe as w,ve as x,ge as y,Ie as z};
|
|
2
|
-
//# sourceMappingURL=tooltip-924Ikq0L.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,A_ as r,Cd as i,Cs as a,Dy as o,Gn as s,Go as c,Kn as l,Ly as u,ME as d,MT as f,Mf as p,Pp as m,Ss as h,Ts as g,Um as _,Up as v,Xc as y,Yn as b,Yo as x,Zn as S,Zo as C,cE as w,cr as T,gd as E,nm as D,or as ee,rb as O,sr as k,ss as A,t as j,t_ as M,tr as te,ub as N,yy as P}from"./utils-CRwA5SKO.js";import{B as F,L as I,W as L,q as R}from"./runtime-DZfpb67Q.js";import{a as z,c as B,o as ne,s as re,t as ie}from"./select-BQxcmO_1.js";import{t as ae}from"./useNavigateBack-B0y76gBs.js";import{a as V,n as oe,t as se}from"./tooltip-924Ikq0L.js";import{d as ce}from"./environments-Dm2_6Uan.js";import{f as H,s as le}from"./server-LJ0-FVGH.js";import{n as ue,t as U}from"./session-Bc1P10r_.js";import{t as de}from"./use-atom-command-Dz_yqN35.js";import{a as fe,c as pe,d as W,f as G,i as me,l as K,n as he,o as ge,r as q,s as J,t as Y,u as _e}from"./usageFormat-B-HlJYM5.js";import{t as ve}from"./env-wK1YYxA8.js";import{t as X}from"./skeleton-oZHFXSZp.js";import{n as ye,t as be}from"./toggle-group-RZD18_sD.js";import{t as xe}from"./input-DhWmPSxf.js";import{t as Se}from"./scroll-area-BDT5qfX2.js";import{a as Ce,c as we,i as Te,o as Ee,r as De,s as Oe,t as ke}from"./dialog-x5a5g_fa.js";import{o as Ae}from"./sidebar-D5nBG54l.js";import{t as je}from"./observeResize-Cpph8C0G.js";import{y as Me}from"./keybindings-B3kvDAJC.js";import{i as Ne,o as Pe,t as Fe}from"./popover-Bc0WvoPP.js";import{S as Ie,n as Le,t as Re}from"./ChatGptUsageButton-fMcoYEDa.js";import{t as ze}from"./WorkspacePageContainer-COKQZB3N.js";import{n as Be,r as Ve,t as He}from"./usageShortcuts-CUsmDt-0.js";import{Ni as Ue,Wi as We,cr as Ge,dr as Ke,lr as qe,qa as Je,qr as Ye,ur as Xe}from"./main-CxOeqlhD.js";import{t as Ze}from"./WorkspacePageHeader-BDzzcsWQ.js";import{i as Qe,n as $e,r as et,t as tt}from"./WorkspaceBreadcrumb-B0Ap9wKu.js";import{t as nt}from"./usageAccess-CGcVLBtI.js";var Z=e(t(),1),Q=d(),rt=O(R);function it(e,t){return e?.sources.some(e=>e.action===`enableCursorKeychain`)===!0&&t?.some(e=>e.driver===`cursor`&&e.status===`ready`)===!0}function at(e){return e.some(e=>e.summary?.sources.some(e=>e.fingerprint.provider===`cursor`&&e.fingerprint.hostId===`cursor.com`))?[]:e.filter(e=>e.needsCursorKeychainAccess)}var ot=new Map,st=new Map;async function ct(e,t,n=!1,r=!1){let i=st.get(e);if(i!==void 0){if(r){try{await i}catch{}return ct(e,t,!1,!0)}return n?void 0:await i}let a=ot.get(e)??0;if(n&&Date.now()<a)return;let o=Promise.resolve().then(t).finally(()=>{st.delete(e),ot.set(e,Date.now()+3e5)});return st.set(e,o),await o}async function lt({registry:e,server:t,presentations:n,environmentIds:r,input:i}){await Promise.all(r.map(async r=>{let a=t.usageSummary({environmentId:r,input:i}),o=n.presentationAtom(r),s=new AbortController,c=()=>{e.get(o)?.connection.phase!==`connected`&&s.abort()},l=e.subscribe(o,c);c();try{let n=await F(e,t.refreshUsageRates,{environmentId:r,input:{}},{reportFailure:!1}),i=n._tag===`Failure`&&rt(L(n));if(e.refresh(a),i||s.signal.aborted)return;await I(e,a,{reportFailure:!1,signal:s.signal})}finally{l()}}))}function ut(e,t=!1){let{summary:n}=e;if(!e.isConnected||e.error!==null)return{phase:`inactive`};if(n===null)return{phase:`loading`};if(t)return{phase:`stale`};if(!e.isPending)return{phase:`ready`};let r=[...new Set(n.sources.flatMap(e=>e.refreshing?[e.fingerprint.provider]:[]))];return r.length>0?{phase:`partway`,providers:r}:{phase:`stale`}}function dt(e,t){return e.length===1?`Updating ${t(e[0])}…`:`Updating ${e.length} providers…`}function ft(e,t=!1){let n=new Set,r=!1;for(let i of e){let e=ut(i,t);if((e.phase===`loading`||e.phase===`stale`)&&(r=!0),e.phase===`partway`)for(let t of e.providers)n.add(t)}return{partial:r||n.size>0,everyProvider:r,providers:n}}function pt(e){return e.records>0&&e.unpricedRecords>=e.records}function mt(e){return[e.hostId,e.provider,e.resolvedHomePath,e.volumeId].join(` `)}function ht(e,t){let n=e.sources.filter(e=>e.fingerprint.provider===t.fingerprint.provider);return e.buckets.filter(e=>e.provider===t.fingerprint.provider&&(e.sourcePath===t.fingerprint.resolvedHomePath||e.sourcePath===void 0&&n.length===1))}function gt(e){return JSON.stringify([e.day,e.hourStart??null,e.provider,e.model])}function _t(e){let t=new Map,n=new Map,r=new Map,i=new Map,a=new Map,o=[],s=[...e].sort((e,t)=>(Date.parse(t.summary.readAt)||0)-(Date.parse(e.summary.readAt)||0)||e.environmentId.localeCompare(t.environmentId));for(let e of[`ok`,`partial`,`failed`])for(let r of s)for(let i of r.summary.sources){if(i.status!==e)continue;let s=mt(i.fingerprint);if(t.has(s)){o.push(`${r.label}: ${i.fingerprint.resolvedHomePath}`);continue}t.set(s,r.environmentId),n.set(s,{environment:r,source:i}),a.set(s,i.distinctSessions)}for(let e of s)for(let t of e.summary.sources){if(t.status!==`partial`)continue;let o=mt(t.fingerprint),s=n.get(o);if(s?.source.status!==`ok`||Date.parse(e.summary.readAt)<=Date.parse(s.environment.summary.readAt))continue;let c=r.get(o);c===void 0&&(c=new Set(ht(s.environment.summary,s.source).map(gt)),r.set(o,c));let l=i.get(e.environmentId)??new Set,u=!1;for(let n of ht(e.summary,t)){let e=gt(n);c.has(e)||(c.add(e),l.add(n),u=!0)}u&&(i.set(e.environmentId,l),a.set(o,Math.max(a.get(o)??0,t.distinctSessions)))}return{ownerByFingerprint:t,supplementalBucketsByEnvironment:i,sessionsByFingerprint:a,duplicates:o}}function vt(e,t,n,r){let i=new Set,a=new Set,o=new Map;for(let n of e.summary.sources){if(n.status===`missing`)continue;let s=mt(n.fingerprint);if(t.get(s)===e.environmentId){let e=n.fingerprint.provider;i.add(e),a.add(`${e}\u0000${n.fingerprint.resolvedHomePath}`),o.set(e,(o.get(e)??0)+(r.get(s)??n.distinctSessions))}}return{buckets:e.summary.buckets.filter(e=>n.has(e)||(e.sourcePath===void 0?i.has(e.provider):a.has(`${e.provider}\u0000${e.sourcePath}`))),sessionsByProvider:o}}function yt(e){return e.totals.uncachedInputTokens+e.totals.cachedInputTokens+e.totals.cacheCreationTokens+e.totals.outputTokens}function bt(e,t){return e>=4&&e<=t}var xt={costUsd:0,uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,records:0,sessions:0,providers:[],models:[],daily:[],hourly:[],costQuality:{providerReportedShare:0,modelPricedShare:0,unpricedShare:0,cacheSavingsUsd:0},categoryCost:{input:0,cacheRead:0,cacheWrite:0,output:0,unsplit:0},speedCost:{standard:0,fast:0,ultrafast:0,premium:0},duplicateSources:[],contributingEnvironments:[],contractMismatches:[]};function St(e,t){if(e.length===0)return xt;let n=[],r=[];for(let i of e)bt(i.summary.contractVersion,t)?n.push(i):r.push({environmentId:i.environmentId,direction:i.summary.contractVersion<t?`serverBehind`:`clientBehind`,contractVersion:i.summary.contractVersion});let{ownerByFingerprint:i,supplementalBucketsByEnvironment:a,sessionsByFingerprint:o,duplicates:s}=_t(n),c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y={input:0,cacheRead:0,cacheWrite:0,output:0},b={fast:0,ultrafast:0,premium:0},x=new Map,S=new Map,C=new Map,w=new Map,T=[];for(let e of n){let{buckets:t,sessionsByProvider:n}=vt(e,i,a.get(e.environmentId)??new Set,o);t.length>0&&T.push(e.environmentId);for(let[e,t]of n){if(h+=t,t===0)continue;let n=x.get(e)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.sessions+=t,x.set(e,n)}for(let e of t){let t=yt(e);c+=e.costUsd,g+=e.cacheSavingsUsd,l+=e.totals.uncachedInputTokens,u+=e.totals.cachedInputTokens,d+=e.totals.cacheCreationTokens,f+=e.totals.outputTokens,p+=e.totals.reasoningTokens,m+=e.records,v+=e.unpricedRecords,e.costSource===`providerReported`&&(_+=e.records),e.categoryCostUsd!==void 0&&(y.input+=e.categoryCostUsd.input,y.cacheRead+=e.categoryCostUsd.cacheRead,y.cacheWrite+=e.categoryCostUsd.cacheWrite,y.output+=e.categoryCostUsd.output),b.fast+=e.fastCostUsd??0,b.ultrafast+=e.ultrafastCostUsd??0,b.premium+=e.speedPremiumUsd??0;let n=x.get(e.provider)??{costUsd:0,totalTokens:0,records:0,sessions:0};n.costUsd+=e.costUsd,n.totalTokens+=t,n.records+=e.records,x.set(e.provider,n);let r=`${e.provider} ${e.model}`,i=S.get(r)??{provider:e.provider,costUsd:0,totalTokens:0,tokens:{uncachedInputTokens:0,cachedInputTokens:0,cacheCreationTokens:0,outputTokens:0,reasoningTokens:0},records:0,unpricedRecords:0,unpricedTokens:0};i.costUsd+=e.costUsd,i.totalTokens+=t,i.tokens={uncachedInputTokens:i.tokens.uncachedInputTokens+e.totals.uncachedInputTokens,cachedInputTokens:i.tokens.cachedInputTokens+e.totals.cachedInputTokens,cacheCreationTokens:i.tokens.cacheCreationTokens+e.totals.cacheCreationTokens,outputTokens:i.tokens.outputTokens+e.totals.outputTokens,reasoningTokens:i.tokens.reasoningTokens+e.totals.reasoningTokens},i.records+=e.records,i.unpricedRecords+=e.unpricedRecords,e.records>0&&(i.unpricedTokens+=t*e.unpricedRecords/e.records),S.set(r,i);let a=C.get(e.day)??{costUsd:0,totalTokens:0,byProvider:new Map};a.costUsd+=e.costUsd,a.totalTokens+=t;let o=a.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};if(o.costUsd+=e.costUsd,o.totalTokens+=t,a.byProvider.set(e.provider,o),C.set(e.day,a),e.hourStart!==void 0){let n=w.get(e.hourStart)??{day:e.day,hourStart:e.hourStart,costUsd:0,totalTokens:0,byProvider:new Map};n.costUsd+=e.costUsd,n.totalTokens+=t;let r=n.byProvider.get(e.provider)??{costUsd:0,totalTokens:0};r.costUsd+=e.costUsd,r.totalTokens+=t,n.byProvider.set(e.provider,r),w.set(e.hourStart,n)}}}let E=l+u+d+f,D=[...x.entries()].map(([e,t])=>({provider:e,costUsd:t.costUsd,totalTokens:t.totalTokens,records:t.records,sessions:t.sessions,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd),ee=[...S.entries()].map(([e,t])=>({model:e.slice(e.indexOf(` `)+1),provider:t.provider,costUsd:t.costUsd,totalTokens:t.totalTokens,tokens:t.tokens,records:t.records,unpricedRecords:t.unpricedRecords,unpricedTokens:t.unpricedTokens,costShare:c===0?0:t.costUsd/c,tokenShare:E===0?0:t.totalTokens/E})).sort((e,t)=>t.costUsd-e.costUsd||t.totalTokens-e.totalTokens),O=[...C.entries()].map(([e,t])=>({day:e,costUsd:t.costUsd,totalTokens:t.totalTokens,byProvider:t.byProvider})).sort((e,t)=>e.day.localeCompare(t.day)),k=[...w.values()].sort((e,t)=>e.hourStart.localeCompare(t.hourStart));return{costUsd:c,uncachedInputTokens:l,cachedInputTokens:u,cacheCreationTokens:d,outputTokens:f,reasoningTokens:p,totalTokens:E,records:m,sessions:h,providers:D,models:ee,daily:O,hourly:k,costQuality:{providerReportedShare:m===0?0:_/m,unpricedShare:m===0?0:v/m,modelPricedShare:m===0?0:(m-_-v)/m,cacheSavingsUsd:g},categoryCost:{...y,unsplit:Math.max(0,c-y.input-y.cacheRead-y.cacheWrite-y.output)},speedCost:{...b,standard:Math.max(0,c-b.fast-b.ultrafast)},duplicateSources:s,contributingEnvironments:T,contractMismatches:r}}var Ct=C(e=>n(t=>{let n=JSON.parse(e),r=t(ce.presentationsAtom),i=[];for(let[e,a]of r){let r=a.connection.phase===`connected`,o=t(U.sessionStateAtom(e)),s=nt({connectionPhase:a.connection.phase,session:f(h(o)),hasSessionError:o._tag===`Failure`});if(!s.canReadDiagnostics){i.push({environmentId:e,label:a.entry.target.label,isConnected:r,...s,summary:null,needsCursorKeychainAccess:!1});continue}let c=t(H.usageSummary({environmentId:e,input:n})),l=f(h(c));i.push({environmentId:e,label:a.entry.target.label,isPending:c.waiting,canReadDiagnostics:!0,isConnected:r,error:c._tag===`Failure`?`This environment could not report usage.`:null,summary:l,needsCursorKeychainAccess:it(l,t(H.providersValueAtom(e)))})}return i}).pipe(A(`web-usage:window:${e}`)));function wt(e,t){return St(e.flatMap(({environmentId:e,label:n,summary:r})=>r===null?[]:[{environmentId:e,label:n,summary:t===void 0?r:{...r,buckets:r.buckets.filter(t)}}]),6)}var Tt=new Set;function Et(e,t){return t.size===0?e:e.map(e=>e.summary===null?e:{...e,summary:{...e.summary,buckets:e.summary.buckets.filter(e=>!t.has(e.provider)),sources:e.summary.sources.filter(e=>!t.has(e.fingerprint.provider))}})}function Dt(e,t,n){let r=(0,Q.c)(36),i=t===void 0?null:t,a=n===void 0?Tt:n,o;r[0]!==e.resolution||r[1]!==e.sinceDay||r[2]!==e.sinceTime||r[3]!==e.timeZone||r[4]!==e.untilDay||r[5]!==e.untilTime?(o=JSON.stringify({sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}),r[0]=e.resolution,r[1]=e.sinceDay,r[2]=e.sinceTime,r[3]=e.timeZone,r[4]=e.untilDay,r[5]=e.untilTime,r[6]=o):o=r[6];let s=o,l;r[7]===s?l=r[8]:(l=Ct(s),r[7]=s,r[8]=l);let u=x(l),d;r[9]!==u||r[10]!==i?(d=i===null?u:u.filter(e=>i.has(e.environmentId)),r[9]=u,r[10]=i,r[11]=d):d=r[11];let f=d,p;r[12]!==f||r[13]!==s?(p=e=>lt({registry:c,server:H,presentations:ce,environmentIds:f.filter(jt).map(At),input:e??JSON.parse(s)}),r[12]=f,r[13]=s,r[14]=p):p=r[14];let m=p,h;r[15]!==a||r[16]!==f?(h=wt(Et(f,a)),r[15]=a,r[16]=f,r[17]=h):h=r[17];let g=h,_;r[18]===f?_=r[19]:(_=f.filter(kt),r[18]=f,r[19]=_);let v=_.length,y;r[20]===f?y=r[21]:(y=f.filter(Ot),r[20]=f,r[21]=y);let b=y.length,S=v===0&&b>0,[C,w]=(0,Z.useState)(null);v>0&&(C?.merged!==g||C.window!==e||C.selection!==i||C.hidden!==a)&&w({window:e,merged:g,selection:i,hidden:a});let T=C?.selection===i&&C.hidden===a?C:null,E;r[22]!==v||r[23]!==e||r[24]!==S||r[25]!==T||r[26]!==g?(E=v>0?{window:e,merged:g}:T??(S?null:{window:e,merged:g}),r[22]=v,r[23]=e,r[24]=S,r[25]=T,r[26]=g,r[27]=E):E=r[27];let D=E,ee=v>0&&b>0,O;return r[28]!==u||r[29]!==S||r[30]!==g||r[31]!==m||r[32]!==f||r[33]!==D||r[34]!==ee?(O={merged:g,environments:u,selectedEnvironments:f,isPending:S,shown:D,isPartial:ee,refresh:m},r[28]=u,r[29]=S,r[30]=g,r[31]=m,r[32]=f,r[33]=D,r[34]=ee,r[35]=O):O=r[35],O}function Ot(e){return e.summary===null&&e.error===null}function kt(e){return e.summary!==null}function At(e){let{environmentId:t}=e;return t}function jt(e){return e.canReadDiagnostics&&ue(e.environmentId,`diagnostics:read`)}var $=e(w(),1);function Mt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`w-full caption-bottom text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,$.jsx)(`table`,{"data-slot":`table`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ft(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`tr`,{"data-slot":`table-row`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function It(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`th`,{"data-slot":`table-head`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Lt(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=j(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Rt=[{key:`inputCostPerMillionTokens`,label:`Input`,optional:!1},{key:`outputCostPerMillionTokens`,label:`Output`,optional:!1},{key:`cacheReadCostPerMillionTokens`,label:`Cache read`,optional:!0},{key:`cacheWriteCostPerMillionTokens`,label:`Cache write`,optional:!0}];function zt(e=``,t){return{model:e,inputCostPerMillionTokens:t?.inputCostPerMillionTokens.toString()??``,outputCostPerMillionTokens:t?.outputCostPerMillionTokens.toString()??``,cacheReadCostPerMillionTokens:t?.cacheReadCostPerMillionTokens?.toString()??``,cacheWriteCostPerMillionTokens:t?.cacheWriteCostPerMillionTokens?.toString()??``}}function Bt(e){let t=e.model.trim();if(t.length===0)return null;let n={};for(let t of Rt){let r=e[t.key].trim();if(r===``){if(t.optional)continue;return null}if(!/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(r))return null;let i=Number(r);if(!Number.isFinite(i)||i<0)return null;n[t.key]=i}return n.inputCostPerMillionTokens===void 0||n.outputCostPerMillionTokens===void 0?null:{model:t,price:{inputCostPerMillionTokens:n.inputCostPerMillionTokens,outputCostPerMillionTokens:n.outputCostPerMillionTokens,...n.cacheReadCostPerMillionTokens===void 0?{}:{cacheReadCostPerMillionTokens:n.cacheReadCostPerMillionTokens},...n.cacheWriteCostPerMillionTokens===void 0?{}:{cacheWriteCostPerMillionTokens:n.cacheWriteCostPerMillionTokens}}}}function Vt(e){return e.isNew&&e.model.trim()===``&&(e.alias??``).trim()===``&&Object.values(e.values).every(e=>e.trim()===``)}function Ht(e,t){return e.prices&&Object.hasOwn(e.prices,t)?e.prices[t]:void 0}function Ut(e,t){return e.aliases&&Object.hasOwn(e.aliases,t)?e.aliases[t]:void 0}function Wt(e,t){if(e.some(e=>e.aliases===null))return{value:``,placeholder:`Unavailable`};let n=e.map(e=>Ut(e,t)??``);return n.some(e=>e!==n[0])?{value:``,placeholder:`Mixed`}:{value:n[0]??``,placeholder:`None`}}function Gt(e,t,n){let r=Rt.find(e=>e.key===n).optional,i=e.map(e=>Ht(e,t)?zt(t,Ht(e,t))[n]:null);return e.some(e=>e.prices===null)?{value:``,placeholder:`Unavailable`}:i.some(e=>e!==i[0])?{value:``,placeholder:`Mixed`}:{value:i[0]??``,placeholder:i[0]===null?`Automatic`:r?`Input rate`:`0.00`}}function Kt(e,t){let n=[],r=new Map;for(let i of t){if(Vt(i))continue;let t=i.model.trim(),a=Ut(e,t);if(i.removed){Ht(e,t)&&n.push({model:t,price:null}),a!==void 0&&n.push({model:t,alias:null});continue}let o=(i.alias??a??``).trim();if(o!==``){t===``?r.set(i.id,`Enter a model ID.`):o===t?r.set(i.id,`Map to a different model.`):(o!==a&&n.push({model:t,alias:o}),Ht(e,t)&&n.push({model:t,price:null}));continue}if(a!==void 0&&(n.push({model:t,alias:null}),!Ht(e,t)&&Object.values(i.values).every(e=>e.trim()===``)))continue;let s=zt(t,Ht(e,t)),c={...s,...i.values},l=Bt(c);if(l===null){let n=Rt.find(e=>!e.optional&&c[e.key].trim()===``);r.set(i.id,t===``?`Enter a model ID.`:n?`${n.label} is required on ${e.label}.`:`Use non-negative numbers for prices.`);continue}let u=zt(t,l.price);Rt.some(e=>s[e.key]!==u[e.key])&&n.push(l)}return{changes:n,errors:r}}function qt(e,t){return new Map(e.filter(e=>e.unavailable===null&&e.prices!==null).flatMap(e=>[...Kt(e,t).errors]))}async function Jt(e){await Promise.all(e.targets.map(async t=>{let n,r=e.changes.get(t.environmentId)??[],i=r.flatMap(e=>`price`in e?[[e.model,e.price]]:[]),a=r.flatMap(e=>`alias`in e?[[e.model,e.alias]]:[]);if(t.unavailable!==null)n={status:`failed`,error:t.unavailable};else if(a.length>0&&t.aliases===null)n={status:`failed`,error:`Update server to map models`};else try{n=(r.length===0?{_tag:`Success`}:await e.write({environmentId:t.environmentId,input:{patch:{...i.length>0?{usagePriceOverrides:Object.fromEntries(i)}:{},...a.length>0?{usageModelAliases:Object.fromEntries(a)}:{}}}}))._tag===`Success`?{status:`saved`}:{status:`failed`,error:`Could not save. Try again.`}}catch{n={status:`failed`,error:`Could not save. Try again.`}}e.onResult(t.environmentId,n)}))}var Yt=n(e=>[...e(ce.presentationsAtom)].map(([t,n])=>{let i=e(H.settingsValueAtom(t)),a=e(U.sessionStateAtom(t)),o=f(h(a)),s=a._tag===`Failure`?`denied`:o===null?a.waiting?`pending`:`denied`:r(o,`settings:write`)?`granted`:`denied`;return{environmentId:t,label:n.entry.target.label,prices:i?.usagePriceOverrides??null,aliases:n.serverConfig?.environment.capabilities.usageModelAliases===!0?i?.usageModelAliases??null:null,unavailable:n.connection.phase===`connected`?i===null?`Prices not loaded`:n.serverConfig?.environment.capabilities.usagePriceOverrides===!0?s===`pending`?`Checking permissions…`:s===`denied`?`Read-only access`:null:`Update server to edit prices`:`Offline`}}));function Xt(e){let t=(0,Q.c)(119),{usage:n,initialSelectedEnvironmentIds:r,initialModel:i,onOpenChange:a}=e,o=x(Yt),[c,u]=(0,Z.useState)(r),d;if(t[0]!==o||t[1]!==c){let e;t[3]===c?e=t[4]:(e=e=>c===null||c.has(e.environmentId),t[3]=c,t[4]=e),d=o.filter(e),t[0]=o,t[1]=c,t[2]=d}else d=t[2];let f=d,p;t[5]!==i||t[6]!==f?(p=()=>i===void 0||f.some(e=>Object.hasOwn(e.prices??{},i)||Object.hasOwn(e.aliases??{},i))?[]:[{id:`new:initial`,model:i,isNew:!0,values:{}}],t[5]=i,t[6]=f,t[7]=p):p=t[7];let[h,g]=(0,Z.useState)(p),[y,b]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),D=(0,Z.useRef)(0),O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O={reportFailure:!1},t[8]=O):O=t[8];let A=de(H.updateSettings,O),M,N,P,F,I,L,R,z,B,ne,re,ie,ae,ce,le;if(t[9]!==C||t[10]!==h||t[11]!==o||t[12]!==a||t[13]!==y||t[14]!==f||t[15]!==c||t[16]!==A||t[17]!==n){let e=[...new Set(f.flatMap(mn))].sort(),r;t[33]===f?r=t[34]:(r=e=>f.some(t=>t.environmentId===e.environmentId),t[33]=f,t[34]=r);let i=[...new Set([...e,...n.filter(r).flatMap(fn)])].sort(),d;t[35]===h?d=t[36]:(d=new Set(h.filter(dn).map(un)),t[35]=h,t[36]=d);let p=d,x;t[37]!==C||t[38]!==p?(x=e=>C===null||!p.has(e),t[37]=C,t[38]=p,t[39]=x):x=t[39];let O=[...e.filter(x).map(e=>h.find(t=>t.id===`model:${e}`)??{id:`model:${e}`,model:e,isNew:!1,values:{}}),...h.filter(ln)],H=h.filter(cn);L=qt(f,H);for(let t of H)t.isNew&&(t.model.trim()===``?L.set(t.id,`Enter a model ID.`):C===null&&(e.includes(t.model.trim())||h.some(e=>e.id!==t.id&&e.model.trim()===t.model.trim()))&&L.set(t.id,`This model already has a row. Edit its prices there.`));R=C?.destinations.filter(e=>C.results.get(e.environmentId)?.status===`failed`)??[];let U=y||R.length>0;z=H.length>0,F=f.length===1?f[0].label:`${f.length} environments`;let de=c===null?`All environments`:F,fe;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>{g([]),w(null)},t[40]=fe):fe=t[40],I=fe;let pe;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{u(e),w(null)},t[41]=pe):pe=t[41];let W=pe,G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{g(t=>t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[...t,e]),w(null)},t[42]=G):G=t[42];let me=G,K=sn,he;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{!e.isNew&&Object.keys(e.values).length===0&&e.alias===void 0?g(t=>t.filter(t=>t.id!==e.id)):me(e)},t[43]=he):he=t[43];let ge=he,q;t[44]===f?q=t[45]:(q=(e,t,n)=>{let r={...e.values,[t]:n},i=Gt(f,e.model,t);K(e,i,n)&&delete r[t],ge({...e,values:r})},t[44]=f,t[45]=q);let J=q,Y;t[46]===f?Y=t[47]:(Y=(e,t)=>{let{alias:n,...r}=e,i=Wt(f,e.model);ge(K(e,i,t)?r:{...r,alias:t})},t[46]=f,t[47]=Y);let _e=Y;B=async e=>{let t=e!==void 0&&e;if(y)return;let n=t?R:f,r=t&&C?C.drafts:H;if(n.length===0||r.length===0)return;let i=n.map(e=>o.find(t=>t.environmentId===e.environmentId)??{...e,prices:null,aliases:null,unavailable:`Environment removed`}),a=new Map(i.map(e=>[e.environmentId,Kt(e,r)]));b(!0),w(e=>({drafts:r,destinations:t&&e?e.destinations:i,results:new Map([...t&&e?e.results:[],...i.map(on)])}));let s=!1;await Jt({targets:i.map(e=>({...e,unavailable:e.unavailable??[...a.get(e.environmentId).errors.values()][0]??null})),changes:new Map([...a].map(an)),write:async e=>ue(e.environmentId,`settings:write`)?A(e):{_tag:`Failure`},onResult:(e,t)=>{t.status===`failed`&&(s=!0),w(n=>n===null?null:{...n,results:new Map(n.results).set(e,t)})}}),b(!1),s||g([])},P=ke,ce=!0,t[48]!==a||t[49]!==y?(le=e=>{y||a(e)},t[48]=a,t[49]=y,t[50]=le):le=t[50],N=Oe,ie=`max-w-4xl`,t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsxs)(Ce,{children:[(0,$.jsx)(we,{children:`Custom model prices`}),(0,$.jsx)(De,{children:`Prices and mappings apply to all past and future usage on the environments you select.`})]}),t[51]=ae):ae=t[51],M=Ee;let ve;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,$.jsx)(Ue,{id:`usage-prices-apply-label`,className:`shrink-0`,children:`Apply to`}),t[52]=ve):ve=t[52];let X;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(k,{variant:`outline`,size:`sm`,className:`min-w-0`}),t[53]=X):X=t[53];let ye=y||z,be;t[54]===de?be=t[55]:(be=(0,$.jsx)(`span`,{id:`usage-prices-selection`,className:`truncate`,children:de}),t[54]=de,t[55]=be);let Se;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,$.jsx)(E,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[56]=Se):Se=t[56];let Te;t[57]!==ye||t[58]!==be?(Te=(0,$.jsxs)(ee,{render:X,"aria-labelledby":`usage-prices-apply-label usage-prices-selection`,disabled:ye,children:[be,Se]}),t[57]=ye,t[58]=be,t[59]=Te):Te=t[59];let Ae=c===null,je;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(je=e=>W(e?null:new Set),t[60]=je):je=t[60];let Me;t[61]===Ae?Me=t[62]:(Me=(0,$.jsx)(l,{checked:Ae,closeOnClick:!1,onCheckedChange:je,children:`All environments`}),t[61]=Ae,t[62]=Me);let Ne;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,$.jsx)(te,{}),t[63]=Ne):Ne=t[63];let Pe;if(t[64]!==o||t[65]!==f||t[66]!==c){let e;t[68]!==o.length||t[69]!==f||t[70]!==c?(e=e=>(0,$.jsx)(l,{checked:c===null||c.has(e.environmentId),closeOnClick:!1,onCheckedChange:t=>{let n=new Set(f.map(rn));t?n.add(e.environmentId):n.delete(e.environmentId),W(n.size===o.length?null:n)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.unavailable?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unavailable}):null]})},e.environmentId),t[68]=o.length,t[69]=f,t[70]=c,t[71]=e):e=t[71],Pe=o.map(e),t[64]=o,t[65]=f,t[66]=c,t[67]=Pe}else Pe=t[67];let Fe;t[72]!==Me||t[73]!==Pe?(Fe=(0,$.jsxs)(S,{align:`start`,children:[Me,Ne,Pe]}),t[72]=Me,t[73]=Pe,t[74]=Fe):Fe=t[74];let Ie;t[75]!==Te||t[76]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ve,(0,$.jsxs)(s,{children:[Te,Fe]})]}),t[75]=Te,t[76]=Fe,t[77]=Ie):Ie=t[77];let Le;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`USD / million tokens`}),t[78]=Le):Le=t[78],t[79]===Ie?ne=t[80]:(ne=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Ie,Le]}),t[79]=Ie,t[80]=ne),re=f.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o.length===0?`Connect an environment to set model prices.`:`Select an environment to see and change its model prices.`}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`min-w-0 overflow-hidden rounded-lg border border-border`,children:(0,$.jsxs)(Mt,{className:`min-w-180 table-fixed`,"aria-label":`Custom model prices`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-[22%]`}),(0,$.jsx)(`col`,{className:`w-[18%]`}),Rt.map(nn),(0,$.jsx)(`col`,{className:`w-10`})]}),(0,$.jsx)(Nt,{children:(0,$.jsxs)(Ft,{children:[(0,$.jsx)(It,{children:`Model ID`}),(0,$.jsx)(It,{children:`Map to`}),Rt.map(tn),(0,$.jsx)(It,{children:(0,$.jsx)(k,{size:`icon-xs`,variant:`ghost`,"aria-label":`Add model price`,disabled:U,onClick:()=>{D.current+=1;let e=`new:${D.current}`;T.current=e,me({id:e,model:``,isNew:!0,values:{}})},children:(0,$.jsx)(m,{"aria-hidden":!0})})})]})}),(0,$.jsx)(Pt,{children:O.length===0?(0,$.jsx)(Ft,{children:(0,$.jsx)(Lt,{colSpan:7,className:`text-center whitespace-normal`,children:(0,$.jsx)(`p`,{className:`py-6 text-muted-foreground`,children:f.some(en)?`Some environment prices are unavailable.`:`No custom prices or mappings. Add a row to set one.`})})}):O.map(e=>{let t=Wt(f,e.model),n=(e.alias??t.value).trim();return(0,$.jsxs)(Ft,{"data-row-id":e.id,children:[(0,$.jsxs)(Lt,{className:`whitespace-normal`,children:[e.isNew?(0,$.jsx)(xe,{size:`compact`,value:e.model,ref:t=>{t&&T.current===e.id&&(t.focus(),T.current=null)},"aria-label":`New model ID`,"aria-invalid":e.model.trim()!==``&&L.has(e.id)||void 0,list:`usage-price-models`,placeholder:`Model ID`,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>me({...e,model:t.target.value})}):(0,$.jsx)(`span`,{className:j(`block break-all`,e.removed&&`text-muted-foreground line-through`),children:e.model}),L.has(e.id)&&(e.model.trim()!==``||Object.values(e.values).some($t))?(0,$.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-destructive`,children:L.get(e.id)}):null]}),e.removed?(0,$.jsx)(Lt,{colSpan:5,children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Automatic pricing after saving`})}):(0,$.jsx)(Lt,{children:(0,$.jsx)(xe,{size:`compact`,value:e.alias??t.value,"aria-label":`Map ${e.model||`new model`} to model`,list:`usage-alias-models`,placeholder:e.isNew?`Optional`:t.placeholder,autoComplete:`off`,spellCheck:!1,disabled:U,onChange:t=>_e(e,t.target.value)})}),e.removed?null:n===``?Rt.map(t=>{let n=Gt(f,e.model,t.key);return(0,$.jsx)(Lt,{children:(0,$.jsx)(xe,{size:`compact`,inputMode:`decimal`,"aria-label":`${t.label} price for ${e.model||`new model`}`,value:e.values[t.key]??(e.isNew?``:n.value),placeholder:e.isNew?t.optional?`Input rate`:`0.00`:n.placeholder,autoComplete:`off`,disabled:U,font:`mono`,onChange:n=>J(e,t.key,n.target.value)})},t.key)}):(0,$.jsx)(Lt,{colSpan:4,className:`whitespace-normal`,children:(0,$.jsxs)(`span`,{className:`break-all text-muted-foreground`,children:[`Counted as `,n]})}),(0,$.jsx)(Lt,{children:(0,$.jsxs)(se,{children:[(0,$.jsx)(V,{render:(0,$.jsx)(k,{size:`icon-xs`,variant:`ghost`}),disabled:U,"aria-label":e.removed?`Undo reset for ${e.model}`:e.isNew?`Remove new model`:`Reset price for ${e.model} to automatic`,onClick:()=>{e.isNew?g(t=>t.filter(t=>t.id!==e.id)):e.removed?ge({...e,removed:!1}):me({...e,removed:!0})},children:e.isNew?(0,$.jsx)(_,{"aria-hidden":!0}):(0,$.jsx)(v,{"aria-hidden":!0})}),(0,$.jsx)(oe,{children:e.removed?`Undo reset`:e.isNew?`Remove row`:`Reset to automatic`})]})})]},e.id)})})]})}),(0,$.jsx)(`datalist`,{id:`usage-price-models`,children:i.filter(t=>!e.includes(t)).map(Qt)}),(0,$.jsx)(`datalist`,{id:`usage-alias-models`,children:i.filter(e=>f.every(t=>!Object.hasOwn(t.aliases??{},e))).map(Zt)}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Blank cache rates use the input price. Enter 0 for free tokens. A mapped model’s usage counts as the model it maps to.`,f.length>1?` Mixed cells keep each environment’s rate until you edit them.`:``]})]}),t[9]=C,t[10]=h,t[11]=o,t[12]=a,t[13]=y,t[14]=f,t[15]=c,t[16]=A,t[17]=n,t[18]=M,t[19]=N,t[20]=P,t[21]=F,t[22]=I,t[23]=L,t[24]=R,t[25]=z,t[26]=B,t[27]=ne,t[28]=re,t[29]=ie,t[30]=ae,t[31]=ce,t[32]=le}else M=t[18],N=t[19],P=t[20],F=t[21],I=t[22],L=t[23],R=t[24],z=t[25],B=t[26],ne=t[27],re=t[28],ie=t[29],ae=t[30],ce=t[31],le=t[32];let U;t[81]===C?U=t[82]:(U=C?(0,$.jsx)(`div`,{role:`status`,className:`grid gap-1 text-xs`,children:C.destinations.map(e=>{let t=C.results.get(e.environmentId);return(0,$.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,$.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:t?.status===`failed`?`text-right text-destructive`:`text-muted-foreground`,children:t?.status===`failed`?`Not saved · ${t.error}`:t?.status===`saved`?`Saved`:`Saving…`})]},e.environmentId)})}):null,t[81]=C,t[82]=U);let fe;t[83]!==M||t[84]!==U||t[85]!==ne||t[86]!==re?(fe=(0,$.jsxs)(M,{children:[ne,re,U]}),t[83]=M,t[84]=U,t[85]=ne,t[86]=re,t[87]=fe):fe=t[87];let pe=z?`Changes apply to ${F}`:``,W;t[88]===pe?W=t[89]:(W=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:pe}),t[88]=pe,t[89]=W);let G;t[90]!==I||t[91]!==R.length||t[92]!==z||t[93]!==y?(G=z?(0,$.jsx)(k,{variant:`ghost`,disabled:y,onClick:I,children:R.length>0?`Discard pending changes`:`Discard changes`}):null,t[90]=I,t[91]=R.length,t[92]=z,t[93]=y,t[94]=G):G=t[94];let me=y||!z&&R.length===0||R.length===0&&(L.size>0||f.length===0),K;t[95]!==R.length||t[96]!==B?(K=()=>void B(R.length>0),t[95]=R.length,t[96]=B,t[97]=K):K=t[97];let he=y?`Saving…`:R.length>0?`Retry failed saves`:`Save changes`,ge;t[98]!==me||t[99]!==K||t[100]!==he?(ge=(0,$.jsx)(k,{disabled:me,onClick:K,children:he}),t[98]=me,t[99]=K,t[100]=he,t[101]=ge):ge=t[101];let q;t[102]!==G||t[103]!==ge?(q=(0,$.jsxs)(`div`,{className:`flex w-full flex-wrap justify-end gap-2 sm:w-auto`,children:[G,ge]}),t[102]=G,t[103]=ge,t[104]=q):q=t[104];let J;t[105]!==W||t[106]!==q?(J=(0,$.jsxs)(Te,{variant:`bare`,className:`items-center sm:justify-between`,children:[W,q]}),t[105]=W,t[106]=q,t[107]=J):J=t[107];let Y;t[108]!==N||t[109]!==fe||t[110]!==J||t[111]!==ie||t[112]!==ae?(Y=(0,$.jsxs)(N,{className:ie,children:[ae,fe,J]}),t[108]=N,t[109]=fe,t[110]=J,t[111]=ie,t[112]=ae,t[113]=Y):Y=t[113];let _e;return t[114]!==P||t[115]!==Y||t[116]!==ce||t[117]!==le?(_e=(0,$.jsx)(P,{open:ce,onOpenChange:le,children:Y}),t[114]=P,t[115]=Y,t[116]=ce,t[117]=le,t[118]=_e):_e=t[118],_e}function Zt(e){return(0,$.jsx)(`option`,{value:e},e)}function Qt(e){return(0,$.jsx)(`option`,{value:e},e)}function $t(e){return e!==``}function en(e){return e.prices===null}function tn(e){return(0,$.jsx)(It,{children:e.label},e.key)}function nn(e){return(0,$.jsx)(`col`,{},e.key)}function rn(e){return e.environmentId}function an(e){let[t,n]=e;return[t,n.changes]}function on(e){return[e.environmentId,{status:`saving`}]}function sn(e,t,n){return!e.isNew&&t.placeholder!==`Mixed`&&t.placeholder!==`Unavailable`&&n===t.value}function cn(e){return!Vt(e)}function ln(e){return e.isNew}function un(e){return e.model.trim()}function dn(e){return e.isNew}function fn(e){return e.summary?.buckets.map(pn)??[]}function pn(e){return e.model}function mn(e){return[...Object.keys(e.prices??{}),...Object.keys(e.aliases??{})]}var hn=960,gn=260,_n=4,vn=8,yn=new Set;function bn(e,t,n){let r=e?.byProvider.get(t);return r===void 0?0:n===`tokens`?r.totalTokens:r.costUsd}function xn(e,t,n){return e.map(e=>{let r=t.get(e),i=qe.map(e=>({provider:e,value:bn(r,e,n)}));return{bands:i,total:i.reduce((e,t)=>e+t.value,0)}})}function Sn(e){let t=e.length;if(t<2)return[0];let n=[];for(let r=0;r<t-1;r+=1){let t=(e[r+1]?.x??0)-(e[r]?.x??0),i=(e[r+1]?.y??0)-(e[r]?.y??0);n.push(t===0?0:i/t)}let r=Array.from({length:t},()=>0);r[0]=n[0]??0,r[t-1]=n[t-2]??0;for(let e=1;e<t-1;e+=1){let t=n[e-1]??0,i=n[e]??0;r[e]=t*i<=0?0:(t+i)/2}for(let e=0;e<t-1;e+=1){let t=n[e]??0;if(t===0){r[e]=0,r[e+1]=0;continue}let i=(r[e]??0)/t,a=(r[e+1]??0)/t,o=i*i+a*a;if(o>9){let n=3/Math.sqrt(o);r[e]=n*i*t,r[e+1]=n*a*t}}return r}function Cn(e){if(e.length<2)return[];let t=Sn(e),n=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1];if(i===void 0||a===void 0)continue;let o=a.x-i.x;n.push({from:i,c1:{x:i.x+o/3,y:i.y+(t[r]??0)*o/3},c2:{x:a.x-o/3,y:a.y-(t[r+1]??0)*o/3},to:a})}return n}function wn(e){let t=e[0];if(t===void 0)return``;let n=`M${t.from.x.toFixed(2)},${t.from.y.toFixed(2)}`;for(let t of e)n+=` C${t.c1.x.toFixed(2)},${t.c1.y.toFixed(2)} ${t.c2.x.toFixed(2)},${t.c2.y.toFixed(2)} ${t.to.x.toFixed(2)},${t.to.y.toFixed(2)}`;return n}function Tn(e){return e===``?``:`${e} L${hn},${gn} L0,${gn} Z`}function En(e,t){if(e<=0)return{max:0,ticks:[0]};let n=e/t,r=10**Math.floor(Math.log10(n)),i=n/r,a=(i>5?10:i>2?5:i>1?2:1)*r,o=Math.ceil(e/a)*a,s=[];for(let e=0;e<=o+a*1e-6;e+=a)s.push(e);return{max:o,ticks:s}}var Dn=Array.from({length:5},(e,t)=>t);function On(e,t){let n=e.reduce((e,t)=>t.bands.reduce((e,t)=>Math.max(e,t.value),e),0);return n===0&&t.size>0?{max:_n,ticks:Dn,labeled:!1}:{...En(n,_n),labeled:!0}}function kn(e,t){return t===0?gn:gn-e/t*252}function An(e,t,n,r,i){let a=xn(e,t,n),o=On(a,i),s=e.length<2?0:hn/(e.length-1);return{columns:a,scale:o,stepX:s,paths:r.map(e=>{let t=qe.indexOf(e),n=wn(Cn(a.map((e,n)=>({x:n*s,y:kn(e.bands[t]?.value??0,o.max)}))));return{provider:e,loading:i.has(e),total:a.reduce((e,n)=>e+(n.bands[t]?.value??0),0),line:n,area:Tn(n)}}).toSorted((e,t)=>t.total-e.total)}}function jn(e){let t=(0,Q.c)(97),{providers:n,loadingProviders:r,days:i,daily:a,hours:o,hourly:s,metric:c,referenceTime:l,resolution:u,timeZone:d}=e,f=r===void 0?yn:r,p=u===`hour`?o:i,m;t[0]!==a||t[1]!==s||t[2]!==u?(m=u===`hour`?new Map(s.map(Pn)):new Map(a.map(Nn)),t[0]=a,t[1]=s,t[2]=u,t[3]=m):m=t[3];let h=m,[g,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=(0,Z.useRef)(null),x;t[4]!==h||t[5]!==f||t[6]!==c||t[7]!==p||t[8]!==n?(x=An(p,h,c,n,f),t[4]=h,t[5]=f,t[6]=c,t[7]=p,t[8]=n,t[9]=x):x=t[9];let{columns:S,scale:C,paths:w,stepX:T}=x,E;t[10]===C.max?E=t[11]:(E=e=>kn(e,C.max),t[10]=C.max,t[11]=E);let D=E,ee=Mn,O=c===`tokens`?K:W,k;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{let e=v.current,t=y.current,n=b.current;if(e===null||t===null||n===null)return;let r=t.offsetWidth,i=t.offsetHeight,a=e.clientWidth,o=e.clientHeight,s=n.x+12+r<=a?n.x+12:n.x-12-r,c=n.y+12+i<=o?n.y+12:n.y-12-i,l=Math.min(Math.max(0,s),Math.max(0,a-r)),u=Math.min(Math.max(0,c),Math.max(0,o-i));e.style.setProperty(`--usage-tooltip-left`,`${l}px`),e.style.setProperty(`--usage-tooltip-top`,`${u}px`)},t[12]=k):k=t[12];let A=k,M,te;t[13]===g?(M=t[14],te=t[15]):(M=()=>{if(g===null)return;A();let e=v.current,t=y.current;if(e!==null&&t!==null)return je([e,t],A)},te=[g,A],t[13]=g,t[14]=M,t[15]=te),(0,Z.useLayoutEffect)(M,te);let N;t[16]===p.length?N=t[17]:(N=e=>{let t=v.current;if(t===null||p.length===0)return;let n=t.getBoundingClientRect();if(n.width===0)return;let r=Math.min(n.width,Math.max(0,e.clientX-n.left)),i=Math.min(n.height,Math.max(0,e.clientY-n.top)),a=r/n.width,o=Math.round(a*(p.length-1));b.current={x:r,y:i},A(),_(Math.min(p.length-1,Math.max(0,o)))},t[16]=p.length,t[17]=N);let P=N,F=g===null?void 0:p[g],I=g===null?void 0:S[g],L;if(t[18]!==f||t[19]!==n){let e;t[21]===f?e=t[22]:(e=e=>f.has(e),t[21]=f,t[22]=e),L=n.some(e),t[18]=f,t[19]=n,t[20]=L}else L=t[20];let R=L,z;t[23]!==u||t[24]!==d?(z=e=>u===`hour`?ge(e,d):fe(e),t[23]=u,t[24]=d,t[25]=z):z=t[25];let B=z,ne;t[26]!==B||t[27]!==l||t[28]!==u||t[29]!==d?(ne=e=>u===`hour`&&l!==void 0?pe(e,l,d):B(e),t[26]=B,t[27]=l,t[28]=u,t[29]=d,t[30]=ne):ne=t[30];let re=ne,ie;t[31]!==O||t[32]!==C.labeled||t[33]!==C.ticks||t[34]!==D?(ie=C.labeled?C.ticks.map(e=>(0,$.jsx)(`span`,{className:`absolute right-0 -translate-y-1/2 text-3xs text-muted-foreground tabular-nums`,style:{top:`${D(e)/gn*100}%`},children:e===0?`0`:O(e)},e)):null,t[31]=O,t[32]=C.labeled,t[33]=C.ticks,t[34]=D,t[35]=ie):ie=t[35];let ae;t[36]===ie?ae=t[37]:(ae=(0,$.jsx)(`div`,{className:`relative h-56 w-14 shrink-0`,children:ie}),t[36]=ie,t[37]=ae);let V;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{b.current=null,_(null)},t[38]=V):V=t[38];let oe=`${u===`hour`?`Hourly`:`Daily`} ${c===`tokens`?`processed tokens`:`cost`} by provider`,se;if(t[39]!==C.ticks||t[40]!==D){let e;t[42]===D?e=t[43]:(e=e=>{let t=D(e);return(0,$.jsx)(`line`,{x1:0,x2:hn,y1:t,y2:t,stroke:`currentColor`,strokeWidth:1,className:`text-border`,vectorEffect:`non-scaling-stroke`},e)},t[42]=D,t[43]=e),se=C.ticks.map(e),t[39]=C.ticks,t[40]=D,t[41]=se}else se=t[41];let ce;if(t[44]!==w){let e;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,area:r}=e;return(0,$.jsx)(`path`,{d:r,className:ee(n),fill:Xe[t].color,fillOpacity:.12},t)},t[46]=e):e=t[46],ce=w.map(e),t[44]=w,t[45]=ce}else ce=t[45];let H;if(t[47]!==w){let e;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{let{provider:t,loading:n,line:r}=e;return(0,$.jsx)(`path`,{d:r,className:ee(n),fill:`none`,stroke:Xe[t].color,strokeWidth:2,vectorEffect:`non-scaling-stroke`},t)},t[49]=e):e=t[49],H=w.map(e),t[47]=w,t[48]=H}else H=t[48];let le;t[50]!==g||t[51]!==T?(le=g===null?null:(0,$.jsx)(`line`,{x1:g*T,x2:g*T,y1:vn,y2:gn,stroke:`currentColor`,strokeWidth:1,className:`text-muted-foreground`,vectorEffect:`non-scaling-stroke`}),t[50]=g,t[51]=T,t[52]=le):le=t[52];let ue;t[53]!==oe||t[54]!==se||t[55]!==ce||t[56]!==H||t[57]!==le?(ue=(0,$.jsxs)(`svg`,{className:`h-full w-full`,viewBox:`0 0 ${hn} ${gn}`,preserveAspectRatio:`none`,role:`img`,"aria-label":oe,children:[se,ce,H,le]}),t[53]=oe,t[54]=se,t[55]=ce,t[56]=H,t[57]=le,t[58]=ue):ue=t[58];let U;t[59]!==O||t[60]!==re||t[61]!==I?.bands||t[62]!==I?.total||t[63]!==F||t[64]!==f||t[65]!==R||t[66]!==n?(U=F===void 0?null:(0,$.jsxs)(`div`,{ref:y,className:`surface-glass pointer-events-none absolute z-10 min-w-36 max-w-full rounded-xl border border-border/50 px-2.5 py-2 text-xs shadow-lg`,style:{left:`var(--usage-tooltip-left, 0px)`,top:`var(--usage-tooltip-top, 0px)`},children:[(0,$.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:re(F)}),n.map(e=>{let{label:t,driverKind:n}=Xe[e];return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(Le,{driverKind:n,displayName:t,iconClassName:`size-3`}),t]}),(0,$.jsx)(`span`,{className:j(`tabular-nums`,f.has(e)?`text-muted-foreground`:`text-foreground`),children:O(I?.bands.find(t=>t.provider===e)?.value??0)})]},e)}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-3 border-t border-border pt-1`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Total`}),(0,$.jsx)(`span`,{className:j(`tabular-nums`,R?`text-muted-foreground`:`text-foreground`),children:O(I?.total??0)})]})]}),t[59]=O,t[60]=re,t[61]=I?.bands,t[62]=I?.total,t[63]=F,t[64]=f,t[65]=R,t[66]=n,t[67]=U):U=t[67];let de;t[68]!==P||t[69]!==ue||t[70]!==U?(de=(0,$.jsxs)(`div`,{ref:v,className:`relative h-56 flex-1`,onMouseMove:P,onMouseLeave:V,children:[ue,U]}),t[68]=P,t[69]=ue,t[70]=U,t[71]=de):de=t[71];let G;t[72]!==ae||t[73]!==de?(G=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[ae,de]}),t[72]=ae,t[73]=de,t[74]=G):G=t[74];let me;t[75]!==B||t[76]!==p[0]?(me=p[0]===void 0?``:B(p[0]),t[75]=B,t[76]=p[0],t[77]=me):me=t[77];let he;t[78]===me?he=t[79]:(he=(0,$.jsx)(`span`,{children:me}),t[78]=me,t[79]=he);let q;t[80]!==B||t[81]!==p?(q=p[Math.floor(p.length/2)]===void 0?``:B(p[Math.floor(p.length/2)]??``),t[80]=B,t[81]=p,t[82]=q):q=t[82];let J;t[83]===q?J=t[84]:(J=(0,$.jsx)(`span`,{children:q}),t[83]=q,t[84]=J);let Y;t[85]!==B||t[86]!==p?(Y=p[p.length-1]===void 0?``:B(p[p.length-1]??``),t[85]=B,t[86]=p,t[87]=Y):Y=t[87];let _e;t[88]===Y?_e=t[89]:(_e=(0,$.jsx)(`span`,{children:Y}),t[88]=Y,t[89]=_e);let ve;t[90]!==he||t[91]!==J||t[92]!==_e?(ve=(0,$.jsxs)(`div`,{className:`flex justify-between pl-16 text-3xs text-muted-foreground uppercase`,children:[he,J,_e]}),t[90]=he,t[91]=J,t[92]=_e,t[93]=ve):ve=t[93];let X;return t[94]!==G||t[95]!==ve?(X=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[G,ve]}),t[94]=G,t[95]=ve,t[96]=X):X=t[96],X}function Mn(e){return j(`transition-opacity`,e&&`opacity-40 delay-150`)}function Nn(e){return[e.day,e]}function Pn(e){return[e.hourStart,e]}function Fn(e){let t=(0,Q.c)(30),{label:n,segments:r,format:i,aside:a}=e,o,s,c,l,u,d;if(t[0]!==a||t[1]!==i||t[2]!==n||t[3]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.filter(Ln),f=e.reduce(In,0);if(f<=0){d=null;break bb0}c=`flex min-w-0 flex-col gap-2.5`;let p;t[10]===n?p=t[11]:(p=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:n}),t[10]=n,t[11]=p),t[12]!==a||t[13]!==p?(l=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[p,a]}),t[12]=a,t[13]=p,t[14]=l):l=t[14];let m;t[15]===i?m=t[16]:(m=e=>`${e.label} ${i(e.value)}`,t[15]=i,t[16]=m);let h;t[17]!==i||t[18]!==f?(h=e=>(0,$.jsxs)(se,{children:[(0,$.jsx)(V,{render:(0,$.jsx)(`div`,{className:`h-full min-w-1 rounded-xs first:rounded-l-full last:rounded-r-full`,style:{flex:`${e.value} 1 0`,backgroundColor:e.color}})}),(0,$.jsxs)(oe,{children:[e.label,` · `,i(e.value),` · `,J(e.value/f)]})]},e.label),t[17]=i,t[18]=f,t[19]=h):h=t[19],u=(0,$.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(m).join(`, `)}`,className:`flex h-2 gap-0.5`,children:e.map(h)}),o=`flex flex-wrap gap-x-4 gap-y-1 text-xs`;let g;t[20]===i?g=t[21]:(g=e=>(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-xs`,style:{backgroundColor:e.color}}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:i(e.value)})]},e.label),t[20]=i,t[21]=g),s=e.map(g)}t[0]=a,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;t[22]!==o||t[23]!==s?(f=(0,$.jsx)(`div`,{className:o,children:s}),t[22]=o,t[23]=s,t[24]=f):f=t[24];let p;return t[25]!==c||t[26]!==l||t[27]!==u||t[28]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[25]=c,t[26]=l,t[27]=u,t[28]=f,t[29]=p):p=t[29],p}function In(e,t){return e+t.value}function Ln(e){return e.value>0}function Rn(e){return e.toSorted((e,t)=>t.totalTokens-e.totalTokens||t.costUsd-e.costUsd)}function zn(e,t){return t===`tokens`?e.tokenShare:pt(e)?null:e.costShare}function Bn({tokens:e}){let t=e.uncachedInputTokens+e.cachedInputTokens+e.cacheCreationTokens;return t===0?null:e.cachedInputTokens/t}function Vn(e){let t=e.totalTokens-e.unpricedTokens;return t<=0||pt(e)?null:e.costUsd/t*1e6}var Hn=e=>`color-mix(in oklab, var(--foreground) ${e}%, var(--background))`,Un={input:Hn(60),cacheRead:Hn(30),cacheWrite:Hn(72),output:Hn(100),other:Hn(44)};function Wn(e){return[{label:`Input`,value:e.input,color:Un.input},{label:`Cache read`,value:e.cacheRead,color:Un.cacheRead},{label:`Cache write`,value:e.cacheWrite,color:Un.cacheWrite},{label:`Output`,value:e.output,color:Un.output},{label:`Other`,value:e.unsplit>=.005?e.unsplit:0,color:Un.other}]}function Gn(e){return[{label:`Input`,value:e.uncachedInputTokens,color:Un.input},{label:`Cache read`,value:e.cachedInputTokens,color:Un.cacheRead},{label:`Cache write`,value:e.cacheCreationTokens,color:Un.cacheWrite},{label:`Output`,value:e.outputTokens,color:Un.output}]}function Kn(e){return[{label:`Standard`,value:e.standard,color:Hn(34)},{label:`Fast`,value:e.fast,color:Hn(66)},{label:`Ultrafast`,value:e.ultrafast,color:Hn(100)}]}function qn(e){let t=(0,Q.c)(80),{model:n,environments:r,metric:i,chartWindow:a,onSetPrice:o,onClose:s}=e,c;t[0]!==n.model||t[1]!==n.provider?(c=e=>e.provider===n.provider&&e.model===n.model,t[0]=n.model,t[1]=n.provider,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==c?(l=wt(r,c),t[3]=r,t[4]=c,t[5]=l):l=t[5];let u=l,d;t[6]===n.provider?d=t[7]:(d=[n.provider],t[6]=n.provider,t[7]=d);let f=d,p=Xe[n.provider],m;t[8]===n?m=t[9]:(m=pt(n),t[8]=n,t[9]=m);let h=m,g;if(t[10]!==h||t[11]!==n){let e=Bn(n),r=Vn(n),i;t[13]!==h||t[14]!==n.costUsd?(i=h?`Unpriced`:W(n.costUsd),t[13]=h,t[14]=n.costUsd,t[15]=i):i=t[15];let a;t[16]===i?a=t[17]:(a={label:`Cost`,value:i},t[16]=i,t[17]=a);let o;t[18]===n.totalTokens?o=t[19]:(o=K(n.totalTokens),t[18]=n.totalTokens,t[19]=o);let s;t[20]===o?s=t[21]:(s={label:`Tokens`,value:o},t[20]=o,t[21]=s),g=[a,s,r===null?null:{label:`Per 1M tokens`,value:W(r)},e===null?null:{label:`Cache hit`,value:J(e)}].filter(Yn),t[10]=h,t[11]=n,t[12]=g}else g=t[12];let _=g,v;t[22]===s?v=t[23]:(v=e=>{e||s()},t[22]=s,t[23]=v);let y;t[24]!==p.driverKind||t[25]!==p.label?(y=(0,$.jsx)(Le,{driverKind:p.driverKind,displayName:p.label,iconClassName:`size-5`}),t[24]=p.driverKind,t[25]=p.label,t[26]=y):y=t[26];let b;t[27]===n.model?b=t[28]:(b=(0,$.jsx)(we,{children:n.model}),t[27]=n.model,t[28]=b);let x;t[29]!==y||t[30]!==b?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,b]}),t[29]=y,t[30]=b,t[31]=x):x=t[31];let S;t[32]!==h||t[33]!==n.costShare?(S=h?``:` · ${J(n.costShare)} of cost`,t[32]=h,t[33]=n.costShare,t[34]=S):S=t[34];let C;t[35]!==p.label||t[36]!==S?(C=(0,$.jsxs)(De,{children:[p.label,S]}),t[35]=p.label,t[36]=S,t[37]=C):C=t[37];let w;t[38]!==C||t[39]!==x?(w=(0,$.jsxs)(Ce,{children:[x,C]}),t[38]=C,t[39]=x,t[40]=w):w=t[40];let T;t[41]===_?T=t[42]:(T=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-4`,children:_.map(Jn)}),t[41]=_,t[42]=T);let E=h?`tokens`:i,D;t[43]!==a.days||t[44]!==a.hours||t[45]!==a.referenceTime||t[46]!==a.resolution||t[47]!==a.timeZone||t[48]!==f||t[49]!==E||t[50]!==u.daily||t[51]!==u.hourly?(D=(0,$.jsx)(jn,{providers:f,days:a.days,daily:u.daily,hours:a.hours,hourly:u.hourly,metric:E,referenceTime:a.referenceTime,resolution:a.resolution,timeZone:a.timeZone}),t[43]=a.days,t[44]=a.hours,t[45]=a.referenceTime,t[46]=a.resolution,t[47]=a.timeZone,t[48]=f,t[49]=E,t[50]=u.daily,t[51]=u.hourly,t[52]=D):D=t[52];let ee;t[53]!==h||t[54]!==u.categoryCost?(ee=h?null:(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(u.categoryCost),format:W}),t[53]=h,t[54]=u.categoryCost,t[55]=ee):ee=t[55];let O;t[56]===n.tokens?O=t[57]:(O=Gn(n.tokens),t[56]=n.tokens,t[57]=O);let A;t[58]===O?A=t[59]:(A=(0,$.jsx)(Fn,{label:`Tokens by type`,segments:O,format:K}),t[58]=O,t[59]=A);let j;t[60]===u.speedCost?j=t[61]:(j=u.speedCost.fast+u.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(u.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:u.speedCost.premium})}):null,t[60]=u.speedCost,t[61]=j);let M;t[62]!==ee||t[63]!==A||t[64]!==j?(M=(0,$.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 sm:grid-cols-2`,children:[ee,A,j]}),t[62]=ee,t[63]=A,t[64]=j,t[65]=M):M=t[65];let te;t[66]!==T||t[67]!==D||t[68]!==M?(te=(0,$.jsx)(Ee,{children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[T,D,M]})}),t[66]=T,t[67]=D,t[68]=M,t[69]=te):te=t[69];let N;t[70]!==n.unpricedTokens||t[71]!==o?(N=n.unpricedTokens>0?(0,$.jsxs)(Te,{variant:`bare`,className:`items-center sm:justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[K(n.unpricedTokens),` tokens have no known price`]}),(0,$.jsx)(k,{onClick:o,children:`Set price`})]}):null,t[70]=n.unpricedTokens,t[71]=o,t[72]=N):N=t[72];let P;t[73]!==w||t[74]!==te||t[75]!==N?(P=(0,$.jsxs)(Oe,{className:`max-w-3xl`,children:[w,te,N]}),t[73]=w,t[74]=te,t[75]=N,t[76]=P):P=t[76];let F;return t[77]!==P||t[78]!==v?(F=(0,$.jsx)(ke,{open:!0,onOpenChange:v,children:P}),t[77]=P,t[78]=v,t[79]=F):F=t[79],F}function Jn(e){return(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-2xl font-semibold text-foreground`,children:e.value})]},e.label)}function Yn(e){return e!==null}function Xn(e){let t=(0,Q.c)(4),{premiumUsd:n}=e,r;t[0]===n?r=t[1]:(r=W(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Premium `,(0,$.jsx)(`span`,{className:`text-foreground tabular-nums`,children:r})]}),t[2]=r,t[3]=i),i}var Zn=`t3code:usage-page-preferences:v1`,Qn=u({metric:o([`cost`,`tokens`,`limits`]),windowDays:o([1,7,30,90]),hiddenProviders:N(P(y))}),$n={metric:`limits`,windowDays:30};function er(){try{return a(Zn,Qn)??$n}catch(e){return console.error(`Could not read Usage page preferences.`,e),$n}}function tr(e){try{g(Zn,e,Qn)}catch(e){console.error(`Could not save Usage page preferences.`,e)}}function nr(e){return He.some(t=>t.value===e)}function rr(e){return Be.some(t=>t.days===e)}var ir=e=>Xe[e].label;function ar(){let[e,t]=(0,Z.useState)(er);ae();let n=x(le),r=e=>{let t=Me(n,e.command,{context:{usagePageOpen:!0}});return t?`${e.label} (${t})`:e.label},[i,a]=(0,Z.useState)(()=>({days:e.windowDays,window:G(e.windowDays,void 0,e.windowDays===1?`hour`:`day`)})),o=e.metric,s=o===`limits`,[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>Date.now()),f=(0,Z.useRef)(!1),[m,h]=(0,Z.useState)(`model`),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),[b,S]=(0,Z.useState)(null),C=(0,Z.useMemo)(()=>new Set(e.hiddenProviders),[e.hiddenProviders]),{days:w,window:E}=i,D=w===1,{merged:ee,environments:O,selectedEnvironments:A,shown:M,isPartial:te,refresh:N}=Dt(E,b,C),P=M?.merged??ee,F=M?.window??E,I=F.resolution===`hour`,L=c&&!s,R=M!==null&&M.window!==E,V=(0,Z.useMemo)(()=>{if(R)return{partial:!0,everyProvider:!0,providers:new Set};let e=ft(A,L),t=new Set([...e.providers].filter(e=>!C.has(e)));return{partial:e.everyProvider||t.size>0,everyProvider:e.everyProvider,providers:t}},[R,L,A,C]),oe=e=>V.everyProvider||V.providers.has(e),se=x(ce.presentationsAtom),ue=C.has(`cursor`)?[]:at(A),U=[...new Set(A.flatMap(e=>e.summary?.sources.flatMap(e=>e.message&&!e.action&&!C.has(e.fingerprint.provider)&&(e.status===`partial`||e.status===`failed`||e.fingerprint.provider===`cursor`)?[e.message]:[])??[]))],pe=de(H.refreshProviders,{reportFailure:!1}),_e=A.some(e=>e.canReadDiagnostics),X=(0,Z.useMemo)(()=>Y(F.sinceDay,F.untilDay),[F.sinceDay,F.untilDay]),xe=(0,Z.useMemo)(()=>F.sinceTime===void 0||F.untilTime===void 0?[]:he(F.sinceTime,F.untilTime),[F.sinceTime,F.untilTime]),Ce=(0,Z.useMemo)(()=>(I?P.hourly:P.daily).toReversed(),[I,P.daily,P.hourly]),we=(0,Z.useMemo)(()=>m===`model`&&o===`tokens`?Rn(P.models):P.models,[m,P.models,o]),Te=(0,Z.useMemo)(()=>Ke(P.providers),[P.providers]),Ee=(0,Z.useMemo)(()=>qe.filter(e=>Te.includes(e)||V.providers.has(e)),[V.providers,Te]),De=(0,Z.useMemo)(()=>new Set(Ee.filter(e=>V.everyProvider||V.providers.has(e))),[Ee,V.everyProvider,V.providers]),Oe=v===null?void 0:P.models.find(e=>`${e.provider}:${e.model}`===v),ke=we.reduce((e,t)=>Math.max(e,o===`tokens`?t.totalTokens:t.costUsd),0),je=Ee.map(e=>({kind:`usage`,provider:e})),Le=Math.max(Ee.indexOf(`codex`),Ee.indexOf(`claude`))+1;je.splice(Le,0,...ue.map(e=>({kind:`enable`,environment:e})));let Ue=`${60/(Ee.length+2)}%`,Qe=n=>{let r={...e,...n};t(r),tr(r)},nt=e=>{rr(e)&&(Qe({windowDays:e}),a({days:e,window:G(e,void 0,e===1?`hour`:`day`)}))},Q=e=>{e===`limits`&&d(Date.now()),Qe({metric:e})},rt=async(e=!1,t=!1)=>{try{await Promise.all(Array.from(se,([n,r])=>{if((b===null||b.has(n))&&r.connection.phase===`connected`&&r.serverConfig!==null)return ct(n,()=>pe({environmentId:n,input:{}}),e,t)}))}finally{d(Date.now())}},it=(0,Z.useEffectEvent)(e=>{if(e.defaultPrevented||e.repeat||e.isComposing||Ye()||We())return;let t=Ve(e,n),r=He.find(e=>e.command===t),i=Be.find(e=>e.command===t);(r||i)&&(e.preventDefault(),e.stopPropagation(),r&&Q(r.value),i&&!s&&nt(i.days))});(0,Z.useEffect)(()=>(globalThis.window.addEventListener(`keydown`,it,!0),()=>globalThis.window.removeEventListener(`keydown`,it,!0)),[]);let ot=()=>{if(f.current)return;if(s){f.current=!0,l(!0),rt().finally(()=>{f.current=!1,l(!1)});return}let e=G(w,void 0,D?`hour`:`day`);(e.sinceDay!==E.sinceDay||e.untilDay!==E.untilDay||e.sinceTime!==E.sinceTime||e.untilTime!==E.untilTime)&&a({days:w,window:e}),f.current=!0,l(!0),N(e).finally(()=>{f.current=!1,l(!1)})},st=[...se].filter(([e,t])=>t.connection.phase===`connected`&&t.serverConfig!==null&&(b===null||b.has(e))).map(([e])=>e).sort().join(`,`),lt=(0,Z.useEffectEvent)(()=>{rt(!0)});(0,Z.useEffect)(()=>{s&&st&<()},[s,st]);let ut=I&&F.sinceTime!==void 0&&F.untilTime!==void 0?`${me(F.sinceTime,F.timeZone)} to ${me(F.untilTime,F.timeZone)}`:`${fe(F.sinceDay)} to ${fe(F.untilDay)}`,dt=(0,$.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 py-2 xl:flex`,children:[(0,$.jsxs)(tt,{ariaLabel:`Usage breadcrumb`,className:`min-w-0`,children:[(0,$.jsx)($e,{children:(0,$.jsx)(`h1`,{children:`Usage`})}),(0,$.jsx)(et,{}),(0,$.jsx)($e,{className:`min-w-10 shrink`,children:(0,$.jsx)(vr,{environments:O,selectedEnvironments:A,selectedEnvironmentIds:b,onSelectionChange:S,showUsageStatus:!s,refreshing:L,isPartial:te,duplicateSources:P.duplicateSources,contractMismatches:P.contractMismatches,onOpenModelPrices:()=>_({})})}),(0,$.jsx)(et,{}),(0,$.jsx)($e,{current:!0,className:`min-w-10`,children:(0,$.jsx)(xr,{hiddenProviders:C,onChange:e=>Qe({hiddenProviders:e})})})]}),s?null:(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate text-xs text-muted-foreground 2xl:block`,children:ut}),(0,$.jsxs)(`div`,{className:`ms-auto hidden min-w-0 items-center justify-end gap-2 xl:flex`,children:[(0,$.jsx)(ye,{"aria-label":`Usage metric`,variant:`segmented`,value:[o],onValueChange:e=>{let t=e[0];nr(t)&&Q(t)},children:He.map(e=>(0,$.jsx)(be,{value:e.value,title:r(e),children:e.label},e.value))}),(0,$.jsx)(ye,{"aria-label":`Usage period`,variant:`segmented`,value:[String(w)],disabled:s,onValueChange:e=>{let t=e[0];t&&nt(Number(t))},children:Be.map(e=>(0,$.jsx)(be,{value:String(e.days),title:r(e),children:e.label},e.days))}),(0,$.jsx)(k,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!_e,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(Je,{size:`sm`,refreshing:c})})]}),(0,$.jsxs)(`div`,{className:`ms-auto flex min-w-0 items-center justify-end gap-1 xl:hidden`,children:[(0,$.jsxs)(ie,{value:o,onValueChange:e=>{nr(e)&&Q(e)},children:[(0,$.jsx)(re,{"aria-label":`Usage metric`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(B,{children:He.find(e=>e.value===o)?.label})}),(0,$.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,children:He.map(e=>(0,$.jsx)(z,{value:e.value,title:r(e),children:e.label},e.value))})]}),(0,$.jsxs)(ie,{value:String(w),disabled:s,onValueChange:e=>nt(Number(e)),children:[(0,$.jsx)(re,{"aria-label":`Usage period`,size:`compact`,variant:`ghost`,className:`w-auto min-w-0`,children:(0,$.jsx)(B,{children:Be.find(e=>e.days===w)?.label})}),(0,$.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,children:Be.map(e=>(0,$.jsx)(z,{value:String(e.days),title:r(e),children:e.label},e.days))})]}),(0,$.jsx)(k,{onClick:ot,"aria-label":s?`Refresh limits`:`Refresh usage`,"aria-busy":c,disabled:c||!s&&!_e,size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(Je,{size:`sm`,refreshing:c})})]})]});return(0,$.jsxs)(Ae,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none isolate`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground`,children:[(0,$.jsx)(Ze,{electron:ve,children:dt}),(0,$.jsx)(Se,{className:`min-h-0 flex-1`,children:(0,$.jsx)(ze,{width:`wide`,children:A.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:O.length===0?`Connect an environment to see ${s?`limits`:`usage`}.`:`Select an environment to see ${s?`limits`:`usage`}.`}):s?(0,$.jsx)(Ge,{selectedEnvironmentIds:b,hiddenProviders:C,now:u,cursorPrompt:ue.length>0?(0,$.jsx)(lr,{environments:ue,onEnabled:()=>{N(),rt(!1,!0)}}):null}):M===null?(0,$.jsx)(Sr,{}):_e?(0,$.jsxs)(`div`,{"aria-busy":V.partial,className:`flex flex-col gap-6`,children:[U.map(e=>(0,$.jsx)(`p`,{className:`mb-4 text-sm text-muted-foreground`,children:e},e)),(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{className:j(`text-4xl font-semibold text-foreground tabular-nums`,dr(V.partial)),children:o===`cost`?W(P.costUsd):K(P.totalTokens)}),(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsxs)(`span`,{className:dr(V.partial),children:[q(P.sessions),` sessions`]}),o===`cost`&&` · API estimate`]}),o===`cost`&&P.costQuality.unpricedShare>0&&(0,$.jsxs)(Fe,{children:[(0,$.jsx)(Pe,{openOnHover:!0,render:(0,$.jsx)(T,{tone:`muted`}),"aria-label":`Unpriced usage details`,children:(0,$.jsx)(p,{className:`size-3`,"aria-hidden":!0})}),(0,$.jsxs)(Ne,{side:`top`,tooltipStyle:!0,children:[`API estimate excludes`,` `,J(P.costQuality.unpricedShare),` unpriced records.`]})]})]})]}),!C.has(`codex`)&&[...se].some(([e,t])=>(b===null||b.has(e))&&t.serverConfig?.providers.some(Ie))?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:`ChatGPT shared usage`}),(0,$.jsx)(Re,{size:`xs`})]}):null,je.map(e=>{if(e.kind===`enable`)return(0,$.jsx)(cr,{environmentId:e.environment.environmentId,label:e.environment.label,showEnvironment:A.length>1,onEnabled:()=>{N(),rt(!1,!0)}},`enable:${e.environment.environmentId}`);let t=e.provider,n=P.providers.find(e=>e.provider===t),r=o===`cost`?n?.costShare??0:n?.tokenShare??0,i=n?.sessions??0,a=`${q(i)} ${i===1?`session`:`sessions`}`,s=oe(t),c=s&&!Te.includes(t);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Xe[t].color}}),(0,$.jsx)(ur,{provider:t,className:`size-4`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:Xe[t].label}),(0,$.jsx)(`span`,{className:j(`shrink-0 whitespace-nowrap text-2xs text-muted-foreground tabular-nums`,dr(s),c&&`invisible`),children:a})]})]}),(0,$.jsx)(`span`,{className:j(`shrink-0 text-sm font-medium text-foreground tabular-nums`,dr(s)),children:c?`—`:o===`cost`?W(n?.costUsd??0):K(n?.totalTokens??0)})]}),(0,$.jsx)(`span`,{className:j(`text-xs text-muted-foreground`,dr(s),c&&`invisible`),children:o===`cost`?`${J(r)} of cost · ${K(n?.totalTokens??0)} tokens`:`${J(r)} of tokens · ${W(n?.costUsd??0)}`})]},t)})]}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(`h2`,{className:`text-sm font-medium text-foreground`,children:[I?`Hourly`:`Daily`,` `,o===`tokens`?`processed tokens`:`cost`]}),(0,$.jsx)(jn,{providers:Ee,loadingProviders:De,days:X,daily:P.daily,hours:xe,hourly:P.hourly,metric:o,referenceTime:F.untilTime,resolution:I?`hour`:`day`,timeZone:F.timeZone})]})]}),(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:[(0,$.jsx)(fr,{loading:V.partial,label:`Processed tokens`,value:K(P.totalTokens)}),(0,$.jsx)(fr,{loading:V.partial,label:`Cached input`,value:K(P.cachedInputTokens)}),(0,$.jsx)(fr,{loading:V.partial,label:`Uncached input`,value:K(P.uncachedInputTokens)}),(0,$.jsx)(fr,{loading:V.partial,label:`Output`,value:K(P.outputTokens)}),(0,$.jsx)(fr,{loading:V.partial,label:`Cache savings`,value:W(P.costQuality.cacheSavingsUsd)})]})]}),P.totalTokens>0?(0,$.jsx)(`section`,{className:j(`grid gap-x-12 gap-y-8 lg:grid-cols-2`,dr(V.partial)),children:o===`tokens`?(0,$.jsx)(Fn,{label:`Tokens by type`,segments:Gn(P),format:K}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fn,{label:`Cost by type`,segments:Wn(P.categoryCost),format:W}),P.speedCost.fast+P.speedCost.ultrafast>0?(0,$.jsx)(Fn,{label:`Cost by speed`,segments:Kn(P.speedCost),format:W,aside:(0,$.jsx)(Xn,{premiumUsd:P.speedCost.premium})}):null]})}):null,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(ye,{"aria-label":`Usage breakdown`,variant:`segmented`,value:[m],onValueChange:e=>{let t=e[0];(t===`model`||t===`time`)&&h(t)},children:[{value:`model`,label:`Model`},{value:`time`,label:I?`Hour`:`Day`}].map(e=>(0,$.jsx)(be,{value:e.value,children:e.label},e.value))})]}),m===`model`?(0,$.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-right text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 pr-3 text-left font-normal`,children:`#`}),(0,$.jsx)(`th`,{className:`w-full py-2 text-left font-normal`,children:`Model`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Cost`}),(0,$.jsx)(`th`,{className:`hidden py-2 pl-6 font-normal sm:table-cell`,children:`Share`}),(0,$.jsx)(`th`,{className:`py-2 pl-6 font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:we.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:5,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):we.map((e,t)=>{let n=`${e.provider}:${e.model}`,r=o===`tokens`?e.totalTokens:e.costUsd,i=zn(e,o===`tokens`?`tokens`:`cost`),a=dr(oe(e.provider));return(0,$.jsxs)(`tr`,{className:`relative border-b border-border/50 text-right whitespace-nowrap text-muted-foreground tabular-nums transition-colors hover:bg-muted/50 has-focus-visible:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2.5 pr-3 text-left text-xs`,children:t+1}),(0,$.jsxs)(`td`,{className:`py-2.5 text-left whitespace-normal`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>y(n),className:`flex items-center gap-2 text-left text-foreground outline-none after:absolute after:inset-0`,children:[(0,$.jsx)(ur,{provider:e.provider,className:`size-3.5`}),e.model]}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:j(`mt-1.5 h-0.5 max-w-48`,a),children:(0,$.jsx)(`div`,{className:`h-full rounded-full`,style:{width:r>0&&ke>0?`max(0.5rem, ${r/ke*100}%)`:0,backgroundColor:Xe[e.provider].color}})})]}),(0,$.jsx)(`td`,{className:j(`py-2.5 pl-6 text-foreground`,a),children:pt(e)?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Unpriced`}):W(e.costUsd)}),(0,$.jsx)(`td`,{className:j(`hidden py-2.5 pl-6 sm:table-cell`,a),children:i===null?``:J(i)}),(0,$.jsx)(`td`,{className:j(`py-2.5 pl-6`,a),children:K(e.totalTokens)})]},n)})})]}):(0,$.jsxs)(`table`,{className:`w-full table-fixed text-sm`,children:[(0,$.jsxs)(`colgroup`,{children:[(0,$.jsx)(`col`,{className:`w-2/5`}),Ee.map(e=>(0,$.jsx)(`col`,{style:{width:Ue}},e)),(0,$.jsx)(`col`,{style:{width:Ue}}),(0,$.jsx)(`col`,{style:{width:Ue}})]}),(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-border text-left text-xs text-muted-foreground`,children:[(0,$.jsx)(`th`,{className:`py-2 font-normal`,children:I?`Hour`:`Day`}),Ee.map(e=>(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:Xe[e].label},e)),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Total`}),(0,$.jsx)(`th`,{className:`py-2 text-right font-normal`,children:`Tokens`})]})}),(0,$.jsx)(`tbody`,{children:Ce.length===0?(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{colSpan:Ee.length+3,className:`py-6 text-center text-muted-foreground`,children:`No activity in this window.`})}):Ce.map(e=>(0,$.jsxs)(`tr`,{className:`border-b border-border/50 transition-colors hover:bg-muted/50`,children:[(0,$.jsx)(`td`,{className:`py-2 text-foreground`,children:`hourStart`in e?ge(e.hourStart,F.timeZone):fe(e.day)}),Ee.map(t=>(0,$.jsx)(`td`,{className:j(`py-2 text-right text-muted-foreground tabular-nums`,dr(oe(t))),children:W(e.byProvider.get(t)?.costUsd??0)},t)),(0,$.jsx)(`td`,{className:j(`py-2 text-right text-foreground tabular-nums`,dr(V.partial)),children:W(e.costUsd)}),(0,$.jsx)(`td`,{className:j(`py-2 text-right text-muted-foreground tabular-nums`,dr(V.partial)),children:K(e.totalTokens)})]},`hourStart`in e?e.hourStart:e.day))})]})]})]}):(0,$.jsx)(`div`,{className:`space-y-2 py-12 text-center text-sm text-muted-foreground`,children:A.map(e=>(0,$.jsxs)(`p`,{children:[A.length>1?`${e.label}: `:null,e.error]},e.environmentId))})})})]}),Oe!==void 0&&!s?(0,$.jsx)(qn,{model:Oe,environments:A,metric:o===`tokens`?`tokens`:`cost`,chartWindow:{days:X,hours:xe,resolution:I?`hour`:`day`,timeZone:F.timeZone,referenceTime:F.untilTime},onSetPrice:()=>{y(null),_({model:Oe.model})},onClose:()=>y(null)}):null,g?(0,$.jsx)(Xt,{usage:O,initialSelectedEnvironmentIds:b,initialModel:g.model,onOpenChange:e=>{e||_(null)}}):null]})}var or=`Requires access to your Cursor login in macOS Keychain.`;function sr({environmentId:e,label:t,onEnabled:n,tooltip:r,buttonText:i=`Enable`}){let a=de(H.updateSettings,{label:`enable Cursor account usage`}),[o,s]=(0,Z.useState)(!1),c=async()=>{s(!0);try{(await a({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:!0}}}))._tag===`Success`&&n()}finally{s(!1)}},l=r?(0,$.jsx)(T,{disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i}):(0,$.jsx)(k,{size:`sm`,variant:`outline`,disabled:o,"aria-busy":o,"aria-label":`Enable Cursor usage from ${t}`,onClick:()=>void c(),children:i});return r?(0,$.jsxs)(se,{children:[(0,$.jsx)(V,{render:l}),(0,$.jsx)(oe,{children:or})]}):l}function cr(e){let t=(0,Q.c)(11),{environmentId:n,label:r,showEnvironment:i,onEnabled:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full`,style:{backgroundColor:Xe.cursor.color}}),s=(0,$.jsx)(ur,{provider:`cursor`,className:`size-4`}),t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c=i?` · ${r}`:``,l;t[2]===c?l=t[3]:(l=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm text-foreground`,children:[o,s,(0,$.jsxs)(`span`,{className:`truncate`,children:[`Cursor`,c]})]}),t[2]=c,t[3]=l);let u;t[4]!==n||t[5]!==r||t[6]!==a?(u=(0,$.jsx)(sr,{environmentId:n,label:r,onEnabled:a,tooltip:!0}),t[4]=n,t[5]=r,t[6]=a,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==u?(d=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-4 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10],d}function lr(e){let t=(0,Q.c)(10),{environments:n,onEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,$.jsx)(Le,{driverKind:M.make(`cursor`),displayName:`Cursor`,indicatorBackground:`var(--background)`,className:`size-5`,iconClassName:`size-4 text-foreground/80`}),`Cursor`]}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:or}),t[1]=a):a=t[1];let o;if(t[2]!==n||t[3]!==r){let e;t[5]!==n.length||t[6]!==r?(e=e=>(0,$.jsx)(sr,{environmentId:e.environmentId,label:e.label,buttonText:n.length>1?`Enable on ${e.label}`:`Enable`,onEnabled:r,tooltip:!1},e.environmentId),t[5]=n.length,t[6]=r,t[7]=e):e=t[7],o=n.map(e),t[2]=n,t[3]=r,t[4]=o}else o=t[4];let s;return t[8]===o?s=t[9]:(s=(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[i,(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-3 rounded-lg border border-border/60 p-4`,children:[a,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o})]})]}),t[8]=o,t[9]=s),s}function ur(e){let t=(0,Q.c)(4),{provider:n,className:r}=e,i=Xe[n],a;return t[0]!==r||t[1]!==i.driverKind||t[2]!==i.label?(a=(0,$.jsx)(Le,{driverKind:i.driverKind,displayName:i.label,iconClassName:r}),t[0]=r,t[1]=i.driverKind,t[2]=i.label,t[3]=a):a=t[3],a}function dr(e){return j(`transition-opacity`,e&&`opacity-40 delay-150`)}function fr(e){let t=(0,Q.c)(10),{label:n,value:r,loading:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=j(`text-base font-medium text-foreground tabular-nums`,dr(i)),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,$.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function pr(e){let t=(0,Q.c)(14),{environments:n,duplicateSources:r,contractMismatches:i}=e,a,o,s,c;if(t[0]!==i||t[1]!==r||t[2]!==n){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=n.filter(_r),t=new Map(i.map(gr)),l=n.flatMap(e=>{let n=t.get(e.environmentId);return n===void 0?[]:[{environment:e,mismatch:n}]});if(e.length===0&&l.length===0&&r.length===0){c=null;break bb0}a=`flex flex-col gap-1 border-t border-border px-2 py-2 text-xs text-muted-foreground`,o=e.map(hr),s=l.map(mr)}t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c}else a=t[3],o=t[4],s=t[5],c=t[6];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let l;t[7]===r?l=t[8]:(l=r.length>0?(0,$.jsxs)(`span`,{children:[`Counted once across environments sharing a transcript directory:`,` `,r.join(`, `)]}):null,t[7]=r,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==l?(u=(0,$.jsxs)(`div`,{className:a,children:[o,s,l]}),t[9]=a,t[10]=o,t[11]=s,t[12]=l,t[13]=u):u=t[13],u}function mr(e){let{environment:t,mismatch:n}=e;return(0,$.jsx)(`span`,{children:_e(t.label,n)},t.environmentId)}function hr(e){return(0,$.jsxs)(`span`,{children:[e.label,`: `,e.error]},e.label)}function gr(e){return[e.environmentId,e]}function _r(e){return e.error!==null}function vr(e){let t=(0,Q.c)(56),{environments:n,selectedEnvironments:r,selectedEnvironmentIds:a,onSelectionChange:o,showUsageStatus:c,refreshing:u,isPartial:d,duplicateSources:f,contractMismatches:p,onOpenModelPrices:m}=e,h=a===null,g=h?`All environments`:r.length===1?r[0].label:`${r.length} environments`,_;t[0]!==p||t[1]!==r?(_=r.some(br)||p.length>0,t[0]=p,t[1]=r,t[2]=_):_=t[2];let v=_,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(T,{}),t[3]=y):y=t[3];let x;t[4]===g?x=t[5]:(x=(0,$.jsx)(Qe,{children:g}),t[4]=g,t[5]=x);let C;t[6]!==v||t[7]!==c?(C=(0,$.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center text-muted-foreground`,children:c&&v?(0,$.jsx)(i,{className:`size-3.5 text-warning-foreground`,"aria-label":`Some environments could not report usage`}):(0,$.jsx)(E,{className:`size-3.5 opacity-0 transition-opacity group-hover/usage-environment:opacity-100 group-focus-visible/usage-environment:opacity-100 group-data-popup-open/usage-environment:opacity-100`,"aria-hidden":!0})}),t[6]=v,t[7]=c,t[8]=C):C=t[8];let w;t[9]!==x||t[10]!==C?(w=(0,$.jsxs)(ee,{render:y,className:`group/usage-environment min-w-0 max-w-full`,children:[x,C]}),t[9]=x,t[10]=C,t[11]=w):w=t[11];let O;t[12]===o?O=t[13]:(O=e=>o(e?null:new Set),t[12]=o,t[13]=O);let k;t[14]!==h||t[15]!==O?(k=(0,$.jsx)(l,{checked:h,closeOnClick:!1,onCheckedChange:O,children:`All environments`}),t[14]=h,t[15]=O,t[16]=k):k=t[16];let A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(te,{}),t[17]=A):A=t[17];let M;if(t[18]!==n||t[19]!==o||t[20]!==u||t[21]!==a||t[22]!==r||t[23]!==c){let e;t[25]!==n.length||t[26]!==o||t[27]!==u||t[28]!==a||t[29]!==r||t[30]!==c?(e=e=>{let t=a===null||a.has(e.environmentId),i=ut(e,u),s=e.error===null?e.summary!==null&&!bt(e.summary.contractVersion,6)?`Update required`:e.isConnected?i.phase===`loading`?`Scanning…`:i.phase===`stale`?`Refreshing…`:i.phase===`partway`?dt(i.providers,ir):`Ready`:`Connecting…`:`Unavailable`;return(0,$.jsx)(l,{checked:t,closeOnClick:!1,onCheckedChange:t=>{let i=new Set(r.map(yr));t?i.add(e.environmentId):i.delete(e.environmentId),o(i.size===n.length?null:i)},children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),c?(0,$.jsx)(`span`,{className:j(`shrink-0 text-xs text-muted-foreground`,e.error!==null&&`text-destructive`),children:s}):null]})},e.environmentId)},t[25]=n.length,t[26]=o,t[27]=u,t[28]=a,t[29]=r,t[30]=c,t[31]=e):e=t[31],M=n.map(e),t[18]=n,t[19]=o,t[20]=u,t[21]=a,t[22]=r,t[23]=c,t[24]=M}else M=t[24];let N;t[32]===n.length?N=t[33]:(N=n.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No environments connected.`}):null,t[32]=n.length,t[33]=N);let P;t[34]!==d||t[35]!==c?(P=c&&d?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`Totals are partial while selected environments scan.`}):null,t[34]=d,t[35]=c,t[36]=P):P=t[36];let F;t[37]!==p||t[38]!==f||t[39]!==r||t[40]!==c?(F=c?(0,$.jsx)(pr,{environments:r,duplicateSources:f,contractMismatches:p}):null,t[37]=p,t[38]=f,t[39]=r,t[40]=c,t[41]=F):F=t[41];let I;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(te,{}),t[42]=I):I=t[42];let L;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(D,{"aria-hidden":!0}),t[43]=L):L=t[43];let R;t[44]===m?R=t[45]:(R=(0,$.jsxs)(b,{onClick:m,children:[L,`Model prices`]}),t[44]=m,t[45]=R);let z;t[46]!==N||t[47]!==P||t[48]!==F||t[49]!==R||t[50]!==k||t[51]!==M?(z=(0,$.jsxs)(S,{align:`start`,children:[k,A,M,N,P,F,I,R]}),t[46]=N,t[47]=P,t[48]=F,t[49]=R,t[50]=k,t[51]=M,t[52]=z):z=t[52];let B;return t[53]!==z||t[54]!==w?(B=(0,$.jsxs)(s,{children:[w,z]}),t[53]=z,t[54]=w,t[55]=B):B=t[55],B}function yr(e){return e.environmentId}function br(e){return e.error!==null}function xr(e){let t=(0,Q.c)(23),{hiddenProviders:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=qe.filter(e=>!n.has(e)),t[0]=n,t[1]=i);let a=i,o=a.length===qe.length?`All providers`:a.length===0?`No providers`:a.length===1?Xe[a[0]].label:`${a.length} providers`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(T,{}),t[2]=c):c=t[2];let u;t[3]===o?u=t[4]:(u=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:o}),t[3]=o,t[4]=u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(E,{className:`size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/usage-provider:opacity-100 group-focus-visible/usage-provider:opacity-100 group-data-popup-open/usage-provider:opacity-100`,"aria-hidden":!0}),t[5]=d):d=t[5];let f;t[6]===u?f=t[7]:(f=(0,$.jsxs)(ee,{render:c,className:`group/usage-provider min-w-0 max-w-full`,children:[u,d]}),t[6]=u,t[7]=f);let p=n.size===0,m;t[8]===r?m=t[9]:(m=e=>r(e?[]:qe),t[8]=r,t[9]=m);let h;t[10]!==p||t[11]!==m?(h=(0,$.jsx)(l,{checked:p,closeOnClick:!1,onCheckedChange:m,children:`All providers`}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(te,{}),t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==r?(_=qe.map(e=>(0,$.jsx)(l,{checked:!n.has(e),closeOnClick:!1,onCheckedChange:t=>r(qe.filter(r=>r===e?!t:n.has(r))),children:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(ur,{provider:e,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`truncate`,children:Xe[e].label})]})},e)),t[14]=n,t[15]=r,t[16]=_):_=t[16];let v;t[17]!==_||t[18]!==h?(v=(0,$.jsxs)(S,{align:`start`,children:[h,g,_]}),t[17]=_,t[18]=h,t[19]=v):v=t[19];let y;return t[20]!==v||t[21]!==f?(y=(0,$.jsxs)(s,{children:[f,v]}),t[20]=v,t[21]=f,t[22]=y):y=t[22],y}function Sr(){let e=(0,Q.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`h-10 w-36`}),(0,$.jsx)(X,{className:`h-4 w-32`})]}),qe.map(Cr)]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(X,{className:`h-5 w-24`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`section`,{className:`grid gap-6 lg:grid-cols-[minmax(0,18rem)_minmax(0,1fr)]`,children:[t,(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[n,(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(X,{className:`ml-16 h-56`}),(0,$.jsx)(X,{className:`ml-16 h-4`})]})]})]}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Totals`}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[i,(0,$.jsx)(wr,{labels:[`Processed tokens`,`Cached input`,`Uncached input`,`Output`,`Cache savings`]})]}),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`section`,{className:`grid gap-x-12 gap-y-8 lg:grid-cols-2`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsx)(X,{className:`h-5 w-28`}),(0,$.jsx)(X,{className:`h-2`}),(0,$.jsx)(X,{className:`h-4 w-72`})]})}),e[5]=o):o=e[5];let s;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)($.Fragment,{children:[r,a,o,(0,$.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsx)(`h2`,{className:`text-sm font-medium text-foreground`,children:`Breakdown`}),(0,$.jsx)(X,{shape:`card`,className:`h-7 w-28`})]}),(0,$.jsx)(X,{className:`h-44`})]})]}),e[6]=s):s=e[6],s}function Cr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center justify-between gap-4`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(X,{shape:`pill`,className:`size-2 shrink-0`}),(0,$.jsx)(X,{shape:`pill`,className:`size-4 shrink-0`}),(0,$.jsx)(X,{className:`h-3.5 w-20`})]}),(0,$.jsx)(X,{className:`h-3.5 w-14`})]}),(0,$.jsx)(X,{className:`h-4 w-36`})]},e)}function wr(e){let t=(0,Q.c)(4),{labels:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tr),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-4 py-1 md:grid-cols-5`,children:r}),t[2]=r,t[3]=i),i}function Tr(e){return(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,$.jsx)(X,{className:`h-6 w-16`})]},e)}var Er=ar;export{Er as component};
|
|
2
|
-
//# sourceMappingURL=usage-CRK5JZJm.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{a as n}from"./useParams-DdYFF9g9.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
|
|
2
|
-
//# sourceMappingURL=useNavigate-Dvl9uiuL.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,A_ as r,Ab as i,Ch as a,Cs as o,Dc as s,Dy as c,Fg as l,Fy as u,Go as d,Jw as f,Ky as ee,ME as te,MT as ne,Nb as re,Ng as ie,Ob as ae,Pb as oe,Qw as p,Qy as se,Rs as ce,S_ as le,Ss as ue,Sy as de,Th as fe,Ts as pe,Wy as me,Xo as he,Xw as m,Xy as ge,Yo as h,_l as _e,ah as ve,bb as ye,bh as be,ch as xe,dh as Se,eS as Ce,gl as we,hh as Te,ih as Ee,jb as De,n_ as Oe,nb as ke,r_ as Ae,rb as je,t_ as Me,th as Ne,ub as Pe,uh as Fe,wh as Ie,xb as Le,ys as Re,zy as ze}from"./utils-CRwA5SKO.js";import{R as Be,W as Ve,_t as g}from"./runtime-DZfpb67Q.js";import{T as He}from"./runtime-Bc4kgQim.js";import{i as _}from"./toast-DYfY2t_z.js";import{a as Ue,o as We}from"./environments-Dm2_6Uan.js";import{f as v,u as Ge}from"./server-LJ0-FVGH.js";import{i as Ke,n as qe,t as Je}from"./session-Bc1P10r_.js";import{t as y}from"./use-atom-command-Dz_yqN35.js";import{B as Ye,C as Xe,F as Ze,N as Qe,P as $e,V as et,b as tt,c as nt,i as b,k as rt,l as it,n as x,o as at,r as ot,v as st,w as ct,x as lt}from"./themePalette-CdoksNDx.js";var S=e(t(),1),C=te(),ut={status:`idle`},w=ut,T=null,E=[],D=0,dt=new Set;function O(e){w=e;for(let e of dt)e()}function ft(e){T?.resolve(e);for(let t of E)t.resolve(e);T=null,E=[]}function pt(){return w}function mt(e){return dt.add(e),()=>{dt.delete(e)}}function ht(){D+=1;let e=!0;return()=>{e&&(e=!1,D=Math.max(0,D-1),D===0&&(ft(!1),O(ut)))}}function gt(e,t){if(D!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(T||w.status===`closing`){E.push(r);return}T=r,O({status:`confirming`,message:e,variant:r.variant})})}function _t(){return w.status!==`idle`||T!==null||E.length>0}function vt(e){if(w.status!==`confirming`||!T)return;let t=T;T=null,t.resolve(e),O({status:`closing`,message:w.message,variant:w.variant})}function yt(){if(w.status!==`closing`)return;let e=E.shift();if(!e){O(ut);return}T=e,O({status:`confirming`,message:e.message,variant:e.variant})}var bt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function xt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return s(t)?`${n.map(e=>bt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var St=`http://www.w3.org/2000/svg`,Ct={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function wt(e,t){let n=Ct[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(St,`svg`);r.setAttribute(`xmlns`,St),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(St,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Tt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Et(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var k=null;function Dt(){return k!==null}function Ot(){k?.(),k=null}function kt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,c=!1,l=()=>u(null),u=e=>{if(o)return;o=!0,k===l&&(k=null),document.removeEventListener(`keydown`,d),document.removeEventListener(`pointerdown`,f,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Et(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},d=e=>{e.key===`Escape`&&(e.preventDefault(),u(null))},f=e=>{c&&!Et(e.target,i)&&u(null)},ee=e=>{c&&!Et(e.target,i)&&(e.preventDefault(),u(null))},te=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ne=(e,t,n,r,o)=>{te(r);let l=document.createElement(`div`);l.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,l.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,l.style.left=`${t}px`,l.style.top=`${n}px`,l.dataset.level=String(r);let d=document.createElement(`div`);d.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,d.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&d.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),d.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,d.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let l=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${l} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${l} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${l} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?wt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=wt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,a.appendChild(f),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=xt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,s(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=wt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,s=!1,l=()=>{let e=o||s;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,l()}),a.addEventListener(`mouseleave`,()=>{o=!1,l()}),a.addEventListener(`focus`,()=>{s=!0,l()}),a.addEventListener(`blur`,()=>{s=!1,l()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Tt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{te(r+1)}),a.addEventListener(`click`,()=>{c&&u(t.id)})}d.appendChild(a)}l.appendChild(d),l.addEventListener(`mouseenter`,()=>{te(r+1)}),document.body.appendChild(l),i[r]=l,a[r]=o,requestAnimationFrame(()=>{Tt(l,t,n)})};document.addEventListener(`keydown`,d),document.addEventListener(`pointerdown`,f,!0),document.addEventListener(`contextmenu`,ee,!0),ne(e,t?.x??0,t?.y??0,0),k&&k(),k=l,requestAnimationFrame(()=>{c=!0})})}var At=`t3code:client-settings:v1`;function jt(){return typeof window<`u`}function Mt(){return jt()?o(At,Ne):null}function Nt(e){jt()&&pe(At,e,Ne)}var Pt;function Ft(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>gt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):kt(e,t),close:async()=>{window.desktopBridge||Ot()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Mt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Nt(e)}}}}function It(){return Ft()}function Lt(){if(typeof window<`u`)return Pt||(Pt=It(),Pt)}function Rt(){let e=Lt();if(!e)throw Error(`Local API not found`);return e}var A=`t3code:theme`,zt=`(prefers-color-scheme: dark)`,j={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function Bt(){return M()}function Vt(){return typeof window>`u`?{}:Ht()}function M(){if(typeof window>`u`)return null;try{return rt(window.localStorage.getItem(b))}catch{return null}}function Ht(){try{let e=JSON.parse(window.localStorage.getItem(`t3code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function N(e){return`${e?.light??``}|${e?.dark??``}`}var Ut=`theme-color`,Wt=`meta[name="${Ut}"][data-dynamic-theme-color="true"]`,P=class extends ze()(`ThemeStorageError`,{operation:c([`read`,`write`]),storageKey:u,theme:Pe(at),cause:de()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},Gt=je(P),Kt=class extends ze()(`DesktopThemeSyncError`,{theme:at,cause:de()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},qt=je(Kt),F=[],I=null,Jt=!0,L=null,R=null,z=null;function B(){Jt=!0;for(let e of F)e()}function Yt(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(zt).matches}function Xt(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(ot);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function Zt(e){return e===`light`||e===`dark`||e===`system`}function V(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(x);if(Zt(e))return e}catch{}return Xt(e)?`system`:tt(e)??`light`}function Qt(e){if(typeof window<`u`)try{window.localStorage.setItem(x,e)}catch(e){throw new P({operation:`write`,storageKey:x,cause:e})}}function $t(){if(typeof window>`u`)return j.theme;let e;try{e=window.localStorage.getItem(A)}catch(e){throw new P({operation:`read`,storageKey:A,cause:e})}return e!==null&&ct(e)?it(e):j.theme}function en(e){if(typeof window<`u`)try{window.localStorage.setItem(A,e),z=null}catch(t){throw new P({operation:`write`,storageKey:A,theme:e,cause:t})}}function H(){if(z!==null)return j.theme;try{return $t()}catch(e){let t=Gt(e)?e:new P({operation:`read`,storageKey:A,cause:e});return z=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),j.theme}}function tn(){let e=document.querySelector(Wt);return e||(e=document.createElement(`meta`),e.name=Ut,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function nn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function rn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function an(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?nn(e.getPropertyValue(`--app-chrome-background`)):null,n=nn(getComputedStyle(rn()).backgroundColor),r=nn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${Ut}"]`);if(a.length===0){tn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function U(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=V(e),i=r===`system`,a=i?Yt():!1,o=M();if(R?.theme===e&&R.systemDark===a&&R.followSystem===i&&R.appearanceMode===r&&N(R.themeHalves)===N(o)){sn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=$e(e,a,i,r,o);nt(Ze(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),R={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},an(),sn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function on(e,t,n,r,i=M()){try{await e.setTheme(Qe(t,n,r,i))}catch(e){throw new Kt({theme:t,cause:e})}}function sn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=M(),a=Qe(e,t,n,i);r&&typeof r.setTheme==`function`&&L!==a&&(L=a,on(r,e,t,n,i).catch(t=>{let n=qt(t)?t:new Kt({theme:e,cause:t});console.error(n.message,{theme:n.theme,...g(n)}),L===a&&(L=null)}))}typeof document<`u`&&typeof window<`u`&&U(H());function cn(){if(typeof window>`u`)return j;if(!Jt&&I)return I;Jt=!1;let e=H(),t=V(e),n=t===`system`,r=n?Yt():!1,i=M(),a=$e(e,r,n,t,i);return I&&I.theme===e&&I.resolvedTheme===a&&I.systemDark===r&&I.followSystem===n&&I.appearanceMode===t&&N(I.themeHalves)===N(i)||(I={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),I}function ln(){return j}function un(){let e=H();V(e)===`system`&&U(e,{suppressTransitions:!0}),B()}function dn(e){e.key===A?(z=null,U(H(),{suppressTransitions:!0}),B()):e.key===`t3code:theme-follow-system`||e.key===`t3code:theme-appearance-mode`||e.key===`t3code:theme-halves:v1`?(U(H(),{suppressTransitions:!0}),B()):(e.key===`t3code:themes:v1`||e.key===null)&&(e.key===null&&(z=null),Xe(),R=null,U(H(),{suppressTransitions:!0}),B())}var W=null;function fn(e){if(typeof window>`u`)return()=>{};if(F.push(e),!W){let e=typeof window.matchMedia==`function`?window.matchMedia(zt):null;e?.addEventListener(`change`,un),window.addEventListener(`storage`,dn),W=()=>{e?.removeEventListener(`change`,un),window.removeEventListener(`storage`,dn)}}return()=>{F=F.filter(t=>t!==e),F.length===0&&(W?.(),W=null)}}function pn(){let e=(0,S.useSyncExternalStore)(fn,cn,ln),{theme:t,resolvedTheme:n}=e,r=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(V(H()));let t=window.localStorage.getItem(b);window.localStorage.removeItem(b);try{en(e)}catch(e){if(t!==null)try{window.localStorage.setItem(b,t)}catch{}throw e}}catch(t){let n=Gt(t)?t:new P({operation:`write`,storageKey:A,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...g(n)}),!1}return U(e,{suppressTransitions:!0}),B(),!0},[]),i=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(e)}catch(e){let t=Gt(e)?e:new P({operation:`write`,storageKey:x,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return z=null,U(H(),{suppressTransitions:!0}),B(),!0},[]),a=(0,S.useCallback)(e=>{let n=V(t),r=e?`system`:n===`system`?tt(t)??`light`:n;return i(r)},[i,t]),o=(0,S.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...Ht()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(b):window.localStorage.setItem(b,JSON.stringify(n))}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),s=(0,S.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(b)}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),c=(0,S.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(R=null,U(H(),{suppressTransitions:!0,preservePreview:e}),B())},[]);return(0,S.useEffect)(()=>{U(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var mn=ee(ke(me)),hn=oe(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),mn(t).pipe(Ce(e=>e.issue))}),gn=new ae(hn,re());De().pipe(i(re({space:2})));var _n=e=>u.pipe(ge(e,gn)),G={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:f(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:Ee,providerHealthRefreshInterval:Fe,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:f(15),hostPowerMonitorActiveInterval:f(1),hostPowerMonitorIdleInterval:f(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function K(e){return G[e]}function q(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function vn(e){let t=q(e),n=G[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return p(e)===p(t)}function yn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=vn(e),n=[q(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(yn(t,G[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=q(e),i=G[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function xn(e){let t={schemaVersion:1,profile:ve,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||p(e.automaticGitFetchInterval)!==p(Ee)||p(e.providerHealthRefreshInterval)!==p(Fe);return vn(n&&i?{schemaVersion:1,profile:p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)&&p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Sn(e){let t=xn(e);return bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Cn=_n(Te);se(Cn);function wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?be(t.instanceId):fe(n)}var Tn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>Me.make(e));function En(e,t,n){let r=[...Tn.map(e=>[Ae(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Tn.includes(t.driver)?[[Oe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ce(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:l[a]??ie[a]??`gpt-6-luna`}}function Dn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ie(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&we(i)&&_e(i)?r:e.textGenerationModelSelection}function On(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ie(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&we(e)&&_e(e))return r}return Dn(e,t,n)}function kn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function An(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var jn=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Mn(e){let t={},n={};for(let[r,i]of Object.entries(e))jn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function Nn(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Le(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Le(e,[`continueThreadsAfterServerUpdate`])}function Pn(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}var Fn=`[CLIENT_SETTINGS]`,In=new Set,Ln=new Set,Rn=xe,Y=`pending`,X=null,zn=0,Bn=Promise.resolve(),Vn=0;function Hn(){for(let e of In)e()}function Un(){for(let e of Ln)e()}function Z(){return Rn}function Wn(e){Rn=e,Hn()}function Gn(e){Y!==e&&(Y=e,Un())}function Kn(e){return In.add(e),Q().catch(()=>void 0),()=>{In.delete(e)}}function qn(){return Y===`ready`}function Jn(){return Y}function Yn(e){return Ln.add(e),Q().catch(()=>void 0),()=>{Ln.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=zn;Gn(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await Rt().persistence.getClientSettings();if(e!==zn)return;t&&Wn({...xe,...t}),Gn(`ready`)}catch(t){throw e===zn&&Gn(`failed`),console.error(`${Fn} hydrate failed`,{operation:`hydrate`,...g(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Xn=e=>Rt().persistence.setClientSettings(e);function Zn(e){let t=Bn.then(e);return Bn=t.then(()=>void 0,()=>void 0),t}function Qn(e,t=Xn){let n=Y!==`ready`||Vn>0;return n?Vn+=1:Wn({...Z(),...e}),Zn(async()=>{if(n)try{Y!==`ready`&&await Q(),Wn({...Z(),...e})}finally{--Vn}await t(Z())}).catch(e=>{console.error(`${Fn} persist failed`,{operation:`persist`,...g(e)})})}async function $n(e,t=Xn){return Zn(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Wn(r),r}})}var er=new Set(ye(Te.fields));function tr(e){let t={},n={};for(let[r,i]of Object.entries(e))er.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function nr(){return Z()}function rr(){return Q()}function ir(){return(0,S.useSyncExternalStore)(Yn,qn,ar)}function ar(){return!1}function or(){return(0,S.useSyncExternalStore)(Yn,Jn,sr)}function sr(){return`pending`}function $(){return(0,S.useSyncExternalStore)(Kn,Z,cr)}function cr(){return xe}function lr(e,t){return{...t,...e,...kn(e,t)}}var ur=new Set;function dr(e,t){let n=(0,C.c)(8),r=$(),i=ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=y(v.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||ur.has(e))return;let n=An(t,r);n&&(ur.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>ur.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,S.useEffect)(s,c)}function fr(e,t){let n=(0,C.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=lr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function pr(e){let t=(0,C.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function mr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function hr(){let e=(0,C.c)(7),t=ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=pn(),o=(0,S.useSyncExternalStore)(Ye,lt,gr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=Ze(i,a,r),l=st(c);s=mr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??et(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function gr(){return null}async function _r(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await rr(),{...An(e,nr()),...t}}function vr(e){let t=(0,C.c)(6),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=y(v.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await _r(r,t)}catch{_.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function yr(e){let t=(0,S.use)(he),n=(0,S.useRef)(new Map),r=vr(e);return(0,S.useCallback)(async(i,a)=>{if(!e)return;let o=v.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await rr()}catch{_.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=kn(c,nr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&Re(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var br=n(null);function xr(e){let t=(0,C.c)(5),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=$();dr(e,r);let a=r??Se,o;return t[2]!==i||t[3]!==a?(o=kn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function Sr(e,t){let n=(0,C.c)(2),r;n[0]===e?r=n[1]:(r=v.settingsValueAtom(e),n[0]=e,n[1]=r);let i=h(r);return dr(e,i),fr(i??Se,t)}function Cr(e){let t=(0,C.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=y(v.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function wr(e){let t=We(),n=h(Ge);return dr(t?.environmentId??null,t?.serverConfig?.settings??null),fr(n,e)}var Tr=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function Er(){let e=(0,C.c)(2),t=We(),n;return e[0]===t?n=e[1]:(n=t!==null||!He(),e[0]=t,e[1]=n),n}function Dr(e){let t=(0,C.c)(3),i=e!==void 0&&e,{environments:a}=Ue(),o;return t[0]!==a||t[1]!==i?(o=n(e=>a.filter(Pn).flatMap(t=>{let n=e(Je.sessionStateAtom(t.environmentId));if(i&&n._tag===`Initial`)return[t.environmentId];let a=n._tag===`Failure`?null:ne(ue(n));return a!==null&&r(a,`settings:write`)?[t.environmentId]:[]})),t[0]=a,t[1]=i,t[2]=o):o=t[2],h(o)}function Or(e){let t=(0,C.c)(10);Ke(e,le);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=y(v.updateSettings,n),{environments:i}=Ue(),o;t[1]!==i||t[2]!==r?(o=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Be(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ve(t);_.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=o):o=t[3];let s=o,c=Dr(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==s||t[8]!==c?(l=t=>{let{serverPatch:n,clientPatch:o}=tr(t),l=e===null||a(n).every(t=>qe(e,t));if(Object.keys(n).length>0&&!l&&_.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&l){let{sharedPatch:t,localPatch:o}=Mn(n),l=Nr;if(Object.keys(o).length>0&&(e?s({environmentId:e,input:{patch:o}}):l()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(c);e&&o.add(e);let s=[],u=[];for(let r of o){let o=i.find(e=>e.environmentId===r),c=Nn(t,o?.serverConfig?.environment.capabilities,o?.serverConfig?.settings,n,r===e);if(Object.keys(c).length!==0){if(d.get(Je.sessionStateAtom(r))._tag!==`Initial`&&!a(t).every(e=>qe(r,e))){u.push(o?.label??r);continue}s.push({environmentId:r,input:{patch:c}})}}s.length===0?l(u.length>0?`This connection lacks permission to change settings on ${u.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(s.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(kr)}}Object.keys(o).length>0&&Qn(o)},t[4]=e,t[5]=i,t[6]=r,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function kr(e){let t=e.flatMap(Mr);if(t.length===0)return;let n=e.filter(jr).map(Ar);_.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
|
|
2
|
-
`)})}function Ar(e){let{label:t}=e;return t}function jr(e){let{result:t}=e;return t._tag===`Success`}function Mr(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Be(n))return[];let r=Ve(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function Nr(e){let t=e===void 0?Tr:e;return _.add({type:`warning`,title:`Setting not saved`,description:t})}function Pr(e){return Or(e)}function Fr(){return Or(We()?.environmentId??null)}function Ir(){return Lr}function Lr(e){return Qn(e)}export{_n as A,yt as B,On as C,bn as D,K as E,an as F,vt as G,pt as H,pn as I,mt as K,Rt as L,Bt as M,Vt as N,Sn as O,$t as P,Lt as R,En as S,q as T,ht as U,_t as V,gt as W,yr as _,Qn as a,Pr as b,ir as c,xr as d,Sr as f,Er as g,wr as h,lr as i,V as j,xn as k,or as l,Cr as m,rr as n,$n as o,dr as p,nr as r,pr as s,Tr as t,hr as u,Ir as v,Dn as w,Fr as x,vr as y,Dt as z};
|
|
3
|
-
//# sourceMappingURL=useSettings-DCI8Hv09.js.map
|