@p4code/cli 0.8.1 → 0.8.2
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-mL63pmet.mjs → binCli-C1tFongj.mjs} +12 -36
- package/dist/client/.vite/manifest.json +2139 -2133
- package/dist/client/assets/{AnimatedHeight-CcLJhBdM.js → AnimatedHeight-PJxVEp27.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DV9IfxfT.js → AuthSurfaceShell-BrPHaco9.js} +2 -2
- package/dist/client/assets/{CSPContext-5fUBIm56.js → CSPContext-C7uwFl6f.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-BjxGhmRJ.js → ChatGptUsageButton-7IZqWaQq.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-S_dLZdsH.js → ChatMarkdown-D3ITm4U-.js} +7 -7
- package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +2 -0
- package/dist/client/assets/{ComboboxClear-DCanpiKf.js → ComboboxClear-BXGqqvsR.js} +2 -2
- package/dist/client/assets/{CommandBlock-CCY3uLti.js → CommandBlock-JrUX9e8E.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-CTei4iV_.js → ComposerPromptEditor-Ba1dvqDN.js} +54 -54
- package/dist/client/assets/{CompositeRoot-Dz15SC7i.js → CompositeRoot-CW06ANMY.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-BXxnqJgm.js → ConnectionStatusDot-Cjh57o6i.js} +2 -2
- package/dist/client/assets/{DevicePanel-hMvCLVG0.js → DevicePanel-zG3feCFw.js} +2 -2
- package/dist/client/assets/{DeviceSetup--U2_cth3.js → DeviceSetup-DccRVnjb.js} +2 -2
- package/dist/client/assets/{DialogTitle-CdRWiE23.js → DialogTitle-7tvQYVxE.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-BO9ZEof3.js → DiffCommentAnnotation-DDBZcMFv.js} +2 -2
- package/dist/client/assets/{DiffFileTree-DOh6vP89.js → DiffFileTree-BhSPT6m_.js} +2 -2
- package/dist/client/assets/{DiffPanel-BdHAXHTV.js → DiffPanel-D7QMWq_A.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-HxohyeGq.js → DiffWorkerPoolProvider-RcplgHGv.js} +3 -3
- package/dist/client/assets/{EnvironmentMachineIcon-DYqBsAxl.js → EnvironmentMachineIcon-DMZGa766.js} +2 -2
- package/dist/client/assets/{ExpandableText-B9MQs34j.js → ExpandableText-DfY-qqRW.js} +2 -2
- package/dist/client/assets/{FieldControl-DuWupdaP.js → FieldControl-C9UnFGZn.js} +2 -2
- package/dist/client/assets/{FileDiff-XdtrigfB.js → FileDiff-BXlBWSxx.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-Dj_tLsu8.js → FilePreviewPanel-CSKeM-xZ.js} +5 -5
- package/dist/client/assets/{FoldedSettingsSection-CJhrFR0_.js → FoldedSettingsSection-BJm8ZaTy.js} +2 -2
- package/dist/client/assets/{FormContext-DzMW0viI.js → FormContext-haYZgWIK.js} +2 -2
- package/dist/client/assets/{Icons-DJ824_3l.js → Icons-C12feMOO.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-DBks3HZy.js → KeybindingsSettings.logic-DhXMdk5O.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-DyYs0dvZ.js → NoProjectsHero-CDoSxJVV.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-DmAKKHlt.js → PanelLayoutControls-CCKUTh1H.js} +6 -6
- package/dist/client/assets/{PierreEntryIcon-uqPwKknu.js → PierreEntryIcon-7x50Pz_C.js} +2 -2
- package/dist/client/assets/{PreviewPanel-BQkFJlas.js → PreviewPanel-BEWZuH6o.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-DglkVzkM.js → ProjectDefaultsSettings-BRRQlvgR.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-CDpXbAhP.js → ProjectFavicon-ExMHrN16.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-yxBKY_6V.js → ProjectIconPickerDialog-DXSyEGg8.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Dd6xeLhS.js → ProjectMonogram-um8sYqIi.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-DgUIYMm9.js → ProviderAuthTerminal-Tw3kH5vc.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-DGMc_kKy.js → ProviderSettingsForm-CaNO8FYK.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-CXrKDJ3m.js → PullRequestCodeTab-DwqL4aAJ.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DkXxXiTJ.js → ReadOnlySourcePreview-Cw6lfMjA.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-DtYR94zZ.js → RedactedSensitiveText-citJBx4E.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-Dla4qj6V.js → RenderErrorBoundary-D21mPr47.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-2vzTutJz.js → ScheduledTasksSettings-BXOG7dPV.js} +4 -4
- package/dist/client/assets/{ScopedSwitch-BdMg8rKM.js → ScopedSwitch-2MBm4Srn.js} +2 -2
- package/dist/client/assets/{SettingsPanels-XjjE56Xl.js → SettingsPanels-DjzXV7Dm.js} +7 -7
- package/dist/client/assets/{SettingsPanels.logic-DSOfF88n.js → SettingsPanels.logic-DpdMN_lX.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-um2bOG_J.js → SettingsScopeNotice-CdNfxmW3.js} +2 -2
- package/dist/client/assets/{T3ConnectAccountPages-Dx0LK6U5.js → T3ConnectAccountPages-C6qHq26m.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-2r05ubXZ.js → T3ConnectSidebarSignIn-DewmE1PI.js} +2 -2
- package/dist/client/assets/ThemeEditorPanel-aEsLfkYx.js +5 -0
- package/dist/client/assets/{ThreadTerminalDrawer-BzElqolI.js → ThreadTerminalDrawer-C1NDkTSs.js} +4 -4
- package/dist/client/assets/{UsageLimits-B_IIjpyx.js → UsageLimits-BUS51Bjr.js} +2 -2
- package/dist/client/assets/{Virtualizer-DItXd38b.js → Virtualizer-B2BG0GB9.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Y41aNu4D.js → WorkspaceBreadcrumb-DX3xH6tC.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-D3YV5jc4.js → WorkspacePageContainer-BFo6qTGJ.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-Dduxade-.js → WorkspacePageHeader-BCZXPSxj.js} +2 -2
- package/dist/client/assets/_chat-B3j3XTUJ.js +58 -0
- package/dist/client/assets/{_chat.index-BGOR58rk.js → _chat.index-7o1_qjfU.js} +2 -2
- package/dist/client/assets/{_chat.new-CioC4l4P.js → _chat.new-W2E0MZ4y.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-Cs7eiOH6.js → _chat.pull-requests-DnQ-MKRG.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-l9yoycqs.js → abnfDiagram-VCTEODGH-DJY5x2uS.js} +2 -2
- package/dist/client/assets/{alert-B49R80NU.js → alert-yllEf0yh.js} +2 -2
- package/dist/client/assets/app-window-D2LBv8RE.js +2 -0
- package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-BQwAkSAo.js → architectureDiagram-5GKGNRK7-6YiKazHv.js} +2 -2
- package/dist/client/assets/arrow-left-yEW5WFYj.js +1 -0
- package/dist/client/assets/arrow-right-BzVZfSb7.js +1 -0
- package/dist/client/assets/arrow-up-down-DjL7trCL.js +1 -0
- package/dist/client/assets/{assets-CLIqG-m-.js → assets-BxSVuao2.js} +2 -2
- package/dist/client/assets/bell-ue7A6JFg.js +1 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-C1YTuxst.js → blockDiagram-I7D4REHJ-D_EURhbV.js} +2 -2
- package/dist/client/assets/blocks-De0WwZYY.js +1 -0
- package/dist/client/assets/bot-_T9E-nkd.js +1 -0
- package/dist/client/assets/brain-CQYem3Oz.js +2 -0
- package/dist/client/assets/{browserHistoryStore-D6dhsqE8.js → browserHistoryStore-B-t3Vc_Z.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-D0HujxdB.js → browserLinkTarget-CiQS1wUg.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-DpPcyaba.js → c4Diagram-7LVT6UL2-CmfPrrIj.js} +2 -2
- package/dist/client/assets/calendar-clock-DXFNSdXM.js +1 -0
- package/dist/client/assets/channel-BE0ymtNV.js +2 -0
- package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +1 -0
- package/dist/client/assets/{checkbox-WRJ0D_10.js → checkbox-CIeee0-J.js} +2 -2
- package/dist/client/assets/chromium-BusoCgri.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-C0t_GKFv.js → chunk-4HAMMTFA-BdvKUuii.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-B6rgeqZP.js → chunk-75Z2AOVW-DXz8BlJz.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-BuYM0Cu8.js → chunk-DU6HZSFF-ebFBoLTT.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-CvPd3lcw.js → chunk-F27PBJKO-B1MlVcaX.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-DbBkxyCE.js → chunk-GMAD6QVW-CEXqem_-.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-CVZeJiG5.js → chunk-GVQU2GXP-wsgr7T0u.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-CbY3DGV3.js → chunk-IMKFNOWR-Daxc_3WP.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-Bhkym4YW.js → chunk-L3NEJ4N5-C4NnipZ0.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-B89_sN-h.js → chunk-OSK3NFVY-DDd2Ay5_.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-zeIYnZbd.js → chunk-P2QGCYS3-I9iEYMEJ.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-Bv7ZWEJI.js → chunk-POPQ4Y6H-Cgwl0wkZ.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-BnsKTwi6.js → chunk-PWAF6VOD-kBB0Jquc.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-Daoidttm.js → chunk-SHT3W25Y-gtUoMWd0.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-BK4Qxtm6.js → chunk-SVP7TREG-CbL5vJ0z.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-CihSBYRG.js → chunk-TICWLB2K-CMgrptzc.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +2 -0
- package/dist/client/assets/{collapsible-DyaDJVJ5.js → collapsible-C3qenpEI.js} +2 -2
- package/dist/client/assets/{color-picker-BWffD8SG.js → color-picker-Cj2frYnP.js} +2 -2
- package/dist/client/assets/{combobox-zg5NNJOT.js → combobox-DixSlhgy.js} +2 -2
- package/dist/client/assets/{command-CBIpuXFt.js → command-B45LRbFT.js} +2 -2
- package/dist/client/assets/{connect-BVveo2H6.js → connect-CYM5DIkv.js} +2 -2
- package/dist/client/assets/{connect-agent-Rlpt-C4T.js → connect-agent-nn3QLMb4.js} +2 -2
- package/dist/client/assets/corner-left-up-DohBMTTI.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-BTvkQvHj.js → cynefin-OW5HDTMX-CmLjrFzm.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-glf_yMKF.js → cynefinDiagram-5FMLGOSQ-xQBevUIj.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-XUkjXaQW.js → dagre-GXQ25YYZ-Ck8BwJaT.js} +2 -2
- package/dist/client/assets/{device-Bu2mO4gL.js → device-BRhRKysY.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-CiNxlSJZ.js → diagram-S7CK7UJ4-Bl0e661x.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-C4_9QuDF.js → diagram-UQ7AKVKN-TO9a3uQI.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BoRcnfst.js → diagram-VSXAHHWV-BZ7xQ8wz.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-g5AlZjEL.js → diagram-VX7I27RA-C4cA30qa.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-Crw_yJrX.js → diagram-Z3DM3KII-Hl3MmqeP.js} +2 -2
- package/dist/client/assets/{dialog-C5PVc2Dc.js → dialog-DhJeevKt.js} +2 -2
- package/dist/client/assets/{diffRendering-DVfiIxj4.js → diffRendering-QVeYVRDU.js} +2 -2
- package/dist/client/assets/{discovery-list-Bb2RP3-9.js → discovery-list-VoilmsP7.js} +2 -2
- package/dist/client/assets/{dist-BTyn8sKm.js → dist-CxgL3edJ.js} +3 -3
- package/dist/client/assets/download-B587khDU.js +1 -0
- package/dist/client/assets/{draft-input-CwdApNsc.js → draft-input-BrEXLyuj.js} +2 -2
- package/dist/client/assets/{duoViewer-BsAzTMk3.js → duoViewer-D-_bD3-L.js} +2 -2
- package/dist/client/assets/dynamic-R3OtJZHK.js +3 -0
- package/dist/client/assets/earth-26IFbzWm.js +1 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-Co02q3t2.js → ebnfDiagram-PWID7BFC-Bo_ALmgV.js} +2 -2
- package/dist/client/assets/ellipsis-BScTTB_n.js +1 -0
- package/dist/client/assets/{embeddedScripts-cxUGD6UP.js → embeddedScripts-DKKE5k7D.js} +2 -2
- package/dist/client/assets/{empty-B9cgefGv.js → empty-uoiaKPHo.js} +2 -2
- package/dist/client/assets/{entities-B0tFBQjY.js → entities-DNKDCsf2.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-BuoWr1gw.js → erDiagram-RLTQ6QDP-B38FLl2U.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +1 -0
- package/dist/client/assets/eye-DTlv8Vet.js +1 -0
- package/dist/client/assets/file-search-gFHOfI6S.js +1 -0
- package/dist/client/assets/{fileLinks-BBnShh-N.js → fileLinks-VfyxNu8P.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-DaFd8SRp.js → fileTreeExpansion-BfMZMaRV.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +1 -0
- package/dist/client/assets/fold-vertical-BNQMJ6gu.js +1 -0
- package/dist/client/assets/folder-git-2-6ON-nxul.js +1 -0
- package/dist/client/assets/folder-open-Rja0vZjv.js +1 -0
- package/dist/client/assets/folder-plus-CfJ5c8wa.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CMAUkeMs.js → ganttDiagram-EL5Y4UJY-Cj0Kstgh.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-D0WCXPuc.js → getDiffFileInput-XUe1xsym.js} +2 -2
- package/dist/client/assets/git-branch-BuWXMpmq.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-B22BskFD.js → gitGraph-4MIJSDKK-C84uaaYZ.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-D9yz6pSR.js → gitGraphDiagram-WWUBYQGX-CvyimLfZ.js} +2 -2
- package/dist/client/assets/grip-vertical-qjSy6wXX.js +1 -0
- package/dist/client/assets/{guideRunStore-CPFfk-BJ.js → guideRunStore-DwmmS8D0.js} +2 -2
- package/dist/client/assets/hard-drive-DAxFba08.js +1 -0
- package/dist/client/assets/history-CrY611k2.js +1 -0
- package/dist/client/assets/house-CKS51Vx8.js +1 -0
- package/dist/client/assets/{htmlRender-Cdm053qU.js → htmlRender-DRfZ8nFp.js} +2 -2
- package/dist/client/assets/{index-TkyxWt2Q.js → index-G0rP4C-v.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-CicHHROU.js → info-A6RAGUB7-AXJa674d.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-DAFhUj2V.js → infoDiagram-27XIBGKW-CgaIIar7.js} +2 -2
- package/dist/client/assets/{input-group-CV0ZpOg5.js → input-group-DIOgVvbV.js} +2 -2
- package/dist/client/assets/{input-CN9xdIYL.js → input-u5qjnfMr.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CBEywTMi.js → ishikawaDiagram-5VMMS53U-DSDzMD_t.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-BIKjvqRL.js → journeyDiagram-3NMN7TZE-Be6o5a7O.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-XOFfprGt.js → kanban-definition-UXKFOSKX-Fpr0ne16.js} +2 -2
- package/dist/client/assets/{kbd-Fa27fInv.js → kbd-D4mDfHPa.js} +2 -2
- package/dist/client/assets/{keybindings-C81QSEVL.js → keybindings-CzL-fWkh.js} +2 -2
- package/dist/client/assets/keyboard-Y7zJXIRo.js +1 -0
- package/dist/client/assets/{lazyRouteComponent-BTBK1UDq.js → lazyRouteComponent-dLOOuQ-r.js} +2 -2
- package/dist/client/assets/{line-CEyB3WPo.js → line-BXhbrPh0.js} +2 -2
- package/dist/client/assets/link-CbhoiCa8.js +1 -0
- package/dist/client/assets/{link-C1pmqztR.js → link-YLDgrmSN.js} +2 -2
- package/dist/client/assets/{linkedPrompt-B6Q0Cmi6.js → linkedPrompt-E32o3H76.js} +2 -2
- package/dist/client/assets/list-Cq4wtMwR.js +1 -0
- package/dist/client/assets/main-D9nJEeym.css +2 -0
- package/dist/client/assets/main-D9z9rMK1.js +27 -0
- package/dist/client/assets/{mediaReference-o1DLUGKI.js → mediaReference-C-grVzJf.js} +2 -2
- package/dist/client/assets/{mediaSource-Cfv5uiFj.js → mediaSource-CxVHZYDj.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-BT2QN4a3.js → mermaid-parser.core-BFPy42Wg.js} +4 -4
- package/dist/client/assets/{mermaid.core-EPDLhovC.js → mermaid.core-zK2u82e-.js} +5 -5
- package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +1 -0
- package/dist/client/assets/message-square-DcSgYDZ6.js +1 -0
- package/dist/client/assets/message-square-dashed-Cu56tC0F.js +1 -0
- package/dist/client/assets/messages-square-BNeF2306.js +2 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-aqL3ALYK.js → mindmap-definition-YA3MSWOX-RzkTvFrT.js} +2 -2
- package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +1 -0
- package/dist/client/assets/{number-field-BiWh0ioY.js → number-field-BLz8W5SU.js} +2 -2
- package/dist/client/assets/{observeResize-DBJpB0Hu.js → observeResize-WQaFQjbx.js} +2 -2
- package/dist/client/assets/{onboarding-gue-HaiI.js → onboarding-DNafmm6s.js} +2 -2
- package/dist/client/assets/{openFileInPreview-BuKYchiT.js → openFileInPreview-l6IXWIxV.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-DH7qoFHx.js → p4ProjectFile-BzCYJ8I-.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-BkyzJMIf.js → packet-AYTQ26CC-rDYSbNWh.js} +1 -1
- package/dist/client/assets/{pair-DESVHftX.js → pair-nG9A6oxp.js} +2 -2
- package/dist/client/assets/palette-B79srcx1.js +1 -0
- package/dist/client/assets/panel-left-Bp59PK2R.js +1 -0
- package/dist/client/assets/{panel-tab-close-button-DKugpobT.js → panel-tab-close-button-B2GW1bDy.js} +2 -2
- package/dist/client/assets/panels-top-left-CC3HCiIs.js +1 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-DilAu2aa.js → pegDiagram-XKGWAZYB-8wodyYDi.js} +2 -2
- package/dist/client/assets/{phoneViewer-xqyGZwKn.js → phoneViewer-Bei8FsYJ.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-DgPx2D64.js → pie-WAS4IAKB-Ce0_zpeP.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-D9PFl5qt.js → pieDiagram-E7YTZNPT-C3QJYWCY.js} +2 -2
- package/dist/client/assets/{pierre-icons-BVuUNHGs.js → pierre-icons-CsjmRq9p.js} +2 -2
- package/dist/client/assets/{popover-aTTlR6NX.js → popover-6BYEGLLK.js} +2 -2
- package/dist/client/assets/{preview-DgLUnqIn.js → preview-BpTu6A2K.js} +2 -2
- package/dist/client/assets/{preview-8KYmxrad.js → preview-DFDpDpup.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-CZUX4gpf.js → previewMiniPlayerStore-BfMwexwO.js} +2 -2
- package/dist/client/assets/{primary-GHQewxsn.js → primary-Cc8Am8Ju.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BS4O3v7M.js → primaryCloudLinkState-N7pLty-_.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DmDFr3yJ.js → projectFilesQueryState-CrGsc81w.js} +2 -2
- package/dist/client/assets/projectScriptEditor-RR3KkKhh.js +2 -0
- package/dist/client/assets/{pullRequestDetail.logic-C6mxjZFd.js → pullRequestDetail.logic-CE7fVOsp.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-VIPIhGsh.js → pullRequestReviewStore-BHEIYvsP.js} +2 -2
- package/dist/client/assets/{pullRequests-DEHxyBeZ.js → pullRequests-KhjrMCa0.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-36GcvWjt.js → quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js} +2 -2
- package/dist/client/assets/{queries-BAbZ6wRj.js → queries-Cn1FJB1_.js} +2 -2
- package/dist/client/assets/{query-gfas_Faw.js → query-CK8MOmXr.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-B_1p1XBS.js → radar-RG4KPBEZ-DsccxBWq.js} +1 -1
- package/dist/client/assets/{radio-group-BcuemB8E.js → radio-group-CM6Ra-QS.js} +2 -2
- package/dist/client/assets/{railroad-74A4TZTK-DjaD7aBa.js → railroad-74A4TZTK-B-UN2mSQ.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-BfFU3IUU.js → railroadDiagram-O6MQD6OU-B_PdDy5r.js} +2 -2
- package/dist/client/assets/{renderScheduler-DE6WzqZi.js → renderScheduler-D1ml_j--.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-WVgmezGx.js → requirementDiagram-BXWQKSXE-CKZ6HpQu.js} +2 -2
- package/dist/client/assets/{rightPanelStore-CsSGBQ8t.js → rightPanelStore-6LLb3GY0.js} +2 -2
- package/dist/client/assets/rotate-ccw-dcahmZQ2.js +1 -0
- package/dist/client/assets/rotate-cw-CIep6yNT.js +1 -0
- package/dist/client/assets/{runtime-C9evwoB9.js → runtime-BVgeNXTV.js} +2 -2
- package/dist/client/assets/{runtime-CxeCZPZ3.js → runtime-CCr9UADV.js} +3 -3
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BsCi2aYb.js → sankeyDiagram-P5KCCOFB-BLF-VPcj.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-Bin7R9R3.js → scheduledTasksSettings.logic-ozIaTRfT.js} +2 -2
- package/dist/client/assets/{scroll-area-CRoS-lxP.js → scroll-area-CsrtHuL8.js} +2 -2
- package/dist/client/assets/{select-BXOHHCMJ.js → select-BiARKKgd.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-C_qj_Szb.js → sequenceDiagram-WJ2MYXX4-BpJGkNAx.js} +2 -2
- package/dist/client/assets/{server-BBIVfjrf.js → server-B26doYv6.js} +2 -2
- package/dist/client/assets/{session-DZH3pyoG.js → session-CQXL-cTI.js} +2 -2
- package/dist/client/assets/{session-logic-RDMPhilH.js → session-logic-C0mrkZ0j.js} +2 -2
- package/dist/client/assets/settings-2-C2dIdVBr.js +1 -0
- package/dist/client/assets/{settings-0qbtr9oy.js → settings-B5Dj0jhP.js} +2 -2
- package/dist/client/assets/settings-DiBtchmK.js +1 -0
- package/dist/client/assets/{settings.appearance-CtG85Hzv.js → settings.appearance-Di8HZa2Q.js} +2 -2
- package/dist/client/assets/settings.archived-By34XjbG.js +2 -0
- package/dist/client/assets/settings.computer-use-DuW-mXPO.js +2 -0
- package/dist/client/assets/settings.connections-BJuKrJhl.js +2 -0
- package/dist/client/assets/settings.decisions-BO8hfyYm.js +2 -0
- package/dist/client/assets/{settings.diagnostics-Ct39tZgQ.js → settings.diagnostics-DSw1QN-I.js} +2 -2
- package/dist/client/assets/{settings.general-YgAeT2ec.js → settings.general-RyWWgxqp.js} +2 -2
- package/dist/client/assets/{settings.integrations-DIuNSxXg.js → settings.integrations--N8SMmw7.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BHpTOm8T.js → settings.keybindings-BeQmUtKv.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-Dlp4u1NR.js → settings.open-source-licenses-BmgFSigO.js} +2 -2
- package/dist/client/assets/{settings.projects-BZP8BJZK.js → settings.projects--jLA2A5b.js} +4 -4
- package/dist/client/assets/{settings.providers-Dad6hRGg.js → settings.providers-Cvt1-bmr.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-B1Q7wnRI.js → settings.scheduled-tasks-D5IG4nj_.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-ZBGDHF90.js → settings.snap-shot-CUZNOX9M.js} +2 -2
- package/dist/client/assets/settings.source-control-R63Z9kEM.js +2 -0
- package/dist/client/assets/{settings.storage-Dl3cI_3U.js → settings.storage-J1kthey9.js} +2 -2
- package/dist/client/assets/{settingsLayout-DKjAOwp4.js → settingsLayout-BzyY4qHt.js} +2 -2
- package/dist/client/assets/shield-question-mark-l31p7uuJ.js +1 -0
- package/dist/client/assets/{sidebar-D6V5N0ZC.js → sidebar-Dj0htG-5.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DVAIOuq4.js → sidebarProjectGrouping-DxzT7QCQ.js} +2 -2
- package/dist/client/assets/{skeleton-DuFqUDDw.js → skeleton-CtSxs1y1.js} +2 -2
- package/dist/client/assets/{sortable.esm-DdMawn0Y.js → sortable.esm-n8ce5zjO.js} +2 -2
- package/dist/client/assets/{sourceControl-U8x7jR8g.js → sourceControl-C3RSledt.js} +2 -2
- package/dist/client/assets/{spinner-C6X42yHv.js → spinner-BXr4m38K.js} +2 -2
- package/dist/client/assets/square-pen-CxvvUOOt.js +1 -0
- package/dist/client/assets/{standalone-page-hDUmjFb0.js → standalone-page-DSQDdNcR.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-FdsqVfsR.js → stateDiagram-D77RDMKH-DFGb4Fx3.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-D65Z1Od_.js → swimlanes-42K2YHIH-D0z9osG6.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +9 -0
- package/dist/client/assets/{terminalSessions-DhPFaHUr.js → terminalSessions-3aynRXX1.js} +2 -2
- package/dist/client/assets/text-search-DsadxNJw.js +1 -0
- package/dist/client/assets/{textarea-CCFZJhy-.js → textarea-DZLyhzuZ.js} +2 -2
- package/dist/client/assets/{themePalette-CxbxrCEH.js → themePalette-BZeqG2Hu.js} +2 -2
- package/dist/client/assets/{threadSort-TlzPAte9.js → threadSort-BvhI6zOp.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-DrXF0NCa.js → timeline-definition-24CTP7MA-oHM5IS4i.js} +2 -2
- package/dist/client/assets/{toast-B-l3XS_F.js → toast-Bm36EaG6.js} +2 -2
- package/dist/client/assets/{toggle-DOFhC9C7.js → toggle-BzIEPTf7.js} +2 -2
- package/dist/client/assets/{toggle-group-B1ghB_yR.js → toggle-group-_C7nJPTT.js} +2 -2
- package/dist/client/assets/{tooltip-CYNXW1Ow.js → tooltip-Df-4YKs5.js} +2 -2
- package/dist/client/assets/{treeView-Q6P3EWNA-D6bZIPSq.js → treeView-Q6P3EWNA-ONHv8oqx.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-CJr_vK1t.js → treemap-WGGIJYW6-Go2hwkyn.js} +1 -1
- package/dist/client/assets/unfold-vertical--twzQtvn.js +1 -0
- package/dist/client/assets/{usage-1aJeDf79.js → usage-B26GT0RK.js} +2 -2
- package/dist/client/assets/{usageAccess-9ld15_dP.js → usageAccess-BNLOTFbF.js} +2 -2
- package/dist/client/assets/{usageFormat-D7uBkeaA.js → usageFormat-DKCO_wk0.js} +2 -2
- package/dist/client/assets/{usageShortcuts--2waLBa-.js → usageShortcuts-DxLRXv0W.js} +2 -2
- package/dist/client/assets/{use-atom-command-DdGPgtPS.js → use-atom-command-CiEeUGsC.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-Bp_qmGgf.js → useAriaLabelledBy-CJjXf8Fd.js} +2 -2
- package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +2 -0
- package/dist/client/assets/{useLocation-yjRHv-GS.js → useLocation-9axGTsrg.js} +2 -2
- package/dist/client/assets/useNavigate-BK_XZ1It.js +2 -0
- package/dist/client/assets/{useNavigateBack-NMRi6phK.js → useNavigateBack-AIHPN0Oo.js} +2 -2
- package/dist/client/assets/{useParams-OFLEf5Ub.js → useParams-CCV3vN4E.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-D4K04nHy.js → usePermissionStatus-BnBF7CdE.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-DyXuVFpA.js → usePullRequestActions-aKrHzIiJ.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-QWoLGfik.js → useRegisterFieldControl-Daf1iBkI.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-udJ9IYpQ.js → useScopedModelAvailability-IKTxpeQL.js} +2 -2
- package/dist/client/assets/{useSettings-C1hmCYRR.js → useSettings-CckatJFa.js} +2 -2
- package/dist/client/assets/{useT3ConnectAuthPrompt-NQ5SmnTg.js → useT3ConnectAuthPrompt-CK8il-7e.js} +2 -2
- package/dist/client/assets/{utils-Nv21__t3.js → utils-DmS758az.js} +5 -5
- package/dist/client/assets/{vcsRefInvalidation-CEbBuVCf.js → vcsRefInvalidation-lkYjTxah.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BJt3j1aO.js → vennDiagram-4TSXK5OY-BwVRZPOj.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-D_UZZZRB.js → wardley-WFR3VGLG-CYl4h3U-.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-gZMVt8-K.js → wardleyDiagram-VM6X3IG4-yHMYVGhg.js} +2 -2
- package/dist/client/assets/{welcome-BRjof1AW.js → welcome-CGBWwWzE.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BwaDo7WT.js → xychartDiagram-S5SC5T6Z-Td7MQ_xN.js} +2 -2
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/CodexSetupSection.logic-CpyIRPfJ.js +0 -2
- package/dist/client/assets/ProviderModelPicker-lxEwYGAB.js +0 -2
- package/dist/client/assets/ThemeEditorPanel-CnhjGelD.js +0 -5
- package/dist/client/assets/_chat-B4G7pIId.js +0 -58
- package/dist/client/assets/app-window-CVIo0C1R.js +0 -2
- package/dist/client/assets/architecture-7GRP2DOG-B67w-l9F.js +0 -1
- package/dist/client/assets/arrow-left-D1nB4UjJ.js +0 -1
- package/dist/client/assets/arrow-right-Cbg5uZyw.js +0 -1
- package/dist/client/assets/arrow-up-down-DRcJBavW.js +0 -1
- package/dist/client/assets/bell-D5jiydSo.js +0 -1
- package/dist/client/assets/blocks-mHGBm843.js +0 -1
- package/dist/client/assets/bot-Db9dBVz5.js +0 -1
- package/dist/client/assets/brain-B_3rxsLd.js +0 -2
- package/dist/client/assets/calendar-clock-KAbrMUlv.js +0 -1
- package/dist/client/assets/channel-D8Is9vbt.js +0 -2
- package/dist/client/assets/chart-no-axes-column-CnM4ppv4.js +0 -1
- package/dist/client/assets/chromium-CvI58Z0o.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-CxsiNRJs.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-CxsiNRJs.js +0 -2
- package/dist/client/assets/corner-left-up-DSgsQQJh.js +0 -1
- package/dist/client/assets/download-BrSkg4EE.js +0 -1
- package/dist/client/assets/dynamic-COZhF9Vt.js +0 -3
- package/dist/client/assets/earth-D0ZhOX9I.js +0 -1
- package/dist/client/assets/ellipsis-Dze-H3uy.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-jDgS08dP.js +0 -1
- package/dist/client/assets/eye-OVEPp8Os.js +0 -1
- package/dist/client/assets/file-search-Y-7Ql86o.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-DsHnGCQL.js +0 -1
- package/dist/client/assets/fold-vertical-BMLbHh0a.js +0 -2
- package/dist/client/assets/folder-git-2-DdgpEuW8.js +0 -1
- package/dist/client/assets/folder-open-B9DmXcog.js +0 -1
- package/dist/client/assets/folder-plus-CLFJj-Gh.js +0 -1
- package/dist/client/assets/git-branch-SJsNyJlB.js +0 -1
- package/dist/client/assets/grip-vertical-_2pxkeEI.js +0 -1
- package/dist/client/assets/hard-drive-DMfAIp4-.js +0 -1
- package/dist/client/assets/history-C7dJNEkM.js +0 -1
- package/dist/client/assets/house-BpsJcs6J.js +0 -1
- package/dist/client/assets/keyboard-C0H4XsBS.js +0 -1
- package/dist/client/assets/link-CsVCGX_A.js +0 -1
- package/dist/client/assets/list-BKOLPymO.js +0 -1
- package/dist/client/assets/main-CJvawsJJ.js +0 -27
- package/dist/client/assets/main-DjXoj7An.css +0 -2
- package/dist/client/assets/message-circle-question-mark-0PixhBRe.js +0 -1
- package/dist/client/assets/message-square-dashed-jX8EWVKo.js +0 -1
- package/dist/client/assets/message-square-xfL83Fxi.js +0 -1
- package/dist/client/assets/messages-square-DwkvqiPv.js +0 -1
- package/dist/client/assets/mouse-pointer-2-DbBU41il.js +0 -2
- package/dist/client/assets/palette-DvhXYFMC.js +0 -1
- package/dist/client/assets/panel-left-DCz3M7jv.js +0 -1
- package/dist/client/assets/panels-top-left-C1xu8Xiu.js +0 -1
- package/dist/client/assets/projectScriptEditor-DxxYqdMP.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CA1GF-5t.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-Beda5tl-.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-D2CRVbbY.js +0 -1
- package/dist/client/assets/rotate-ccw-CyPuoUiH.js +0 -1
- package/dist/client/assets/rotate-cw-B20Q7RJJ.js +0 -1
- package/dist/client/assets/settings-2-DmZK5Wif.js +0 -1
- package/dist/client/assets/settings-Br2yM9q3.js +0 -1
- package/dist/client/assets/settings.archived-D1CPem1-.js +0 -2
- package/dist/client/assets/settings.computer-use-DvBtreaX.js +0 -2
- package/dist/client/assets/settings.connections-CeSH1Y-S.js +0 -2
- package/dist/client/assets/settings.decisions-FBz5pyct.js +0 -2
- package/dist/client/assets/settings.source-control-BXuO43FQ.js +0 -2
- package/dist/client/assets/shield-question-mark-Cmz7w9_M.js +0 -1
- package/dist/client/assets/square-pen-Dew4fHbM.js +0 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-PvZEFfKe.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DIDrEY3U.js +0 -9
- package/dist/client/assets/text-search-Cchv2p-9.js +0 -1
- package/dist/client/assets/unfold-vertical-BLnEY4R7.js +0 -2
- package/dist/client/assets/useHandleNewThread-DtCuKpGU.js +0 -2
- package/dist/client/assets/useNavigate-DfvN7ISg.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-ebFBoLTT.js";import{t as m}from"./linear-BUnzfXgk.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./init-C-OQMol4.js";import{i as _}from"./chunk-75Z2AOVW-DXz8BlJz.js";import{t as v}from"./line-BXhbrPh0.js";import"./chunk-PWAF6VOD-kBB0Jquc.js";import{t as y}from"./chunk-GMAD6QVW-CEXqem_-.js";import{f as b}from"./mermaid.core-zK2u82e-.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
5
|
`+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
6
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return e(j,`Parser`),j.prototype=A,A.Parser=j,new j})();C.parser=C;var w=C;function T(e){return e.type===`bar`}e(T,`isBarPlot`);function E(e){return e.type===`band`}e(E,`isBandAxisData`);function D(e){return e.type===`linear`}e(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{e(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{e(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{e(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),t.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{e(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=m().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=m().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}e(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{e(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function P(e,t,n,r){return new te(new O(r),e,t,n)}e(P,`getChartTitleComponent`);var ne=.75,re=.5,ie=.35;function F(e){return{fontSize:e,markerSize:e*ne,markerSpacing:e*ie,itemSpacing:e*re}}e(F,`getLegendLayout`);var ae=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{e(this,`ChartLegend`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(e=>e.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:t,markerSize:n,markerSpacing:r,itemSpacing:i}=F(this.chartConfig.legendFontSize),a=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(e=>e.title),t),o=this.chartConfig.legendPadding*2+n+r+a.width,s=this.chartConfig.legendPadding*2+this.visiblePlots.length*t+(this.visiblePlots.length-1)*i;return o<=e.width&&s<=e.height?(this.boundingRect.width=o,this.boundingRect.height=s):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:t,markerSpacing:n,itemSpacing:r}=F(this.chartConfig.legendFontSize),i=e+r,a=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,s=[],c=[];for(let[e,n]of this.visiblePlots.entries())if(T(n))s.push({x:a,y:o+e*i,width:t,height:t,fill:n.fill,strokeFill:n.fill,strokeWidth:0});else{let r=o+e*i+t/2;c.push({path:`M ${a},${r} L ${a+t},${r}`,strokeFill:n.strokeFill,strokeWidth:n.strokeWidth})}return[{groupTexts:[`legend`,`markers`],type:`rect`,data:s},{groupTexts:[`legend`,`markers`],type:`path`,data:c},{groupTexts:[`legend`,`label`],type:`text`,data:this.visiblePlots.map((r,s)=>({text:r.title,x:a+t+n,y:o+s*i+t/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:`middle`,horizontalPos:`left`}))}]}};function I(e,t,n,r){return new ae(new O(r),e,t,n)}e(I,`getChartLegendComponent`);var oe=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{e(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;if(t=this.orientation===`horizontal`?v().y(e=>e[0]).x(e=>e[1])(e):v().x(e=>e[0]).y(e=>e[1])(e),!t)return[];let n=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let t=[];for(let[n,[r,i]]of e.entries()){let e=this.plotData.pointLabels[n];e&&(this.orientation===`horizontal`?t.push({x:i+10,y:r,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):t.push({x:r,y:i-10,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}t.length>0&&n.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:t})}return n}},se=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{e(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ce=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{e(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new oe(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new se(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}};function le(e,t,n){return new ce(e,t,n)}e(le,`getPlotComponent`);var ue=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:P(e,t,n,r),plot:le(e,t,n),legend:I(e,t,n,r),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{e(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i={width:0,height:0},a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`bottom`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=s.height,this.componentStore.yAxis.setAxisPosition(`left`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=s.width,e-=s.width,i=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=i.width,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.legend.setBoundingBoxXY({x:n+a,y:r+Math.max((o-i.height)/2,0)}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+o}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:o,height:s});e-=c.width,t-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=c.height,t-=c.height,this.componentStore.xAxis.setAxisPosition(`left`),c=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=c.width,r=c.width,this.componentStore.yAxis.setAxisPosition(`top`),c=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=c.height,i=n+c.height,a=this.componentStore.legend.calculateSpace({width:e,height:s}),e-=a.width,e>0&&(o+=e,e=0),t>0&&(s+=t,t=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.legend.setBoundingBoxXY({x:r+o,y:i+Math.max((s-a.height)/2,0)}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},de=class{static{e(this,`XYChartBuilder`)}static build(e,t,n,r){return new ue(e,t,n,r).getDrawableElement()}},L=0,R,z=K(),B=G(),V=q(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1;function G(){let e=n(),t=s();return _(e.xyChart,t.themeVariables.xyChart)}e(G,`getChartDefaultThemeConfig`);function K(){let e=s();return _(l.xyChart,e.xyChart)}e(K,`getChartDefaultConfig`);function q(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}e(q,`getChartDefaultData`);function J(e){let t=s();return p(e.trim(),t)}e(J,`textSanitizer`);function Y(e){R=e}e(Y,`setTmpSVGG`);function fe(e){e===`horizontal`?z.chartOrientation=`horizontal`:z.chartOrientation=`vertical`}e(fe,`setOrientation`);function pe(e){V.xAxis.title=J(e.text)}e(pe,`setXAxisTitle`);function X(e,t){V.xAxis={type:`linear`,title:V.xAxis.title,min:e,max:t},U=!0}e(X,`setXAxisRangeData`);function me(e){V.xAxis={type:`band`,title:V.xAxis.title,categories:e.map(e=>J(e.text))},U=!0}e(me,`setXAxisBand`);function he(e){V.yAxis.title=J(e.text)}e(he,`setYAxisTitle`);function Z(e,t){V.yAxis={type:`linear`,title:V.yAxis.title,min:e,max:t},W=!0}e(Z,`setYAxisRangeData`);function ge(e){let t=Math.min(...e),n=Math.max(...e),r=D(V.yAxis)?V.yAxis.min:1/0,i=D(V.yAxis)?V.yAxis.max:-1/0;V.yAxis={type:`linear`,title:V.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}e(ge,`setYAxisRangeFromPlotData`);function Q(e){let t=[];if(e.length===0)return t;if(!U){let t=D(V.xAxis)?V.xAxis.min:1/0,n=D(V.xAxis)?V.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(E(V.xAxis)&&e.length>V.xAxis.categories.length&&(e=e.slice(0,V.xAxis.categories.length)),W||ge(e),E(V.xAxis)&&(t=V.xAxis.categories.map((t,n)=>[t,e[n]])),D(V.xAxis)){let n=V.xAxis.min,r=V.xAxis.max;if(e.length===1)t=[[`${n}`,e[0]]];else{let i=(r-n)/(e.length-1);t=e.map((e,t)=>[`${n+t*i}`,e])}}return t}e(Q,`transformDataWithoutCategory`);function $(e){return H[e===0?0:e%H.length]}e($,`getPlotColorFromPalette`);function _e(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?J(e.label):``),i=Q(n),a=r.some(e=>e!==``);V.plots.push({type:`line`,title:J(e.text),strokeFill:$(L),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),L++}e(_e,`setLineData`);function ve(e,t){let n=Q(t.map(e=>e.value));V.plots.push({type:`bar`,title:J(e.text),fill:$(L),data:n}),L++}e(ve,`setBarData`);function ye(){if(V.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return V.title=d(),de.build(z,V,B,R)}e(ye,`getDrawableElem`);function be(){return B}e(be,`getChartThemeConfig`);function xe(){return z}e(xe,`getChartConfig`);function Se(){return V}e(Se,`getXYChartData`);var Ce={parser:w,db:{getDrawableElem:ye,clear:e(function(){o(),L=0,z=K(),V=q(),B=G(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r,setOrientation:fe,setXAxisTitle:pe,setXAxisRangeData:X,setXAxisBand:me,setYAxisTitle:he,setYAxisRangeData:Z,setLineData:_e,setBarData:ve,setTmpSVGG:Y,getChartThemeConfig:be,getChartConfig:xe,getXYChartData:Se},renderer:{draw:e((n,r,i,a)=>{let o=a.db,s=o.getChartThemeConfig(),l=o.getChartConfig(),u=o.getXYChartData().plots[0].data.map(e=>e[1]);function d(e){return e===`top`?`text-before-edge`:`middle`}e(d,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}e(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}e(p,`getTextTransformation`),t.debug(`Rendering xychart chart
|
|
7
7
|
`+n);let m=b(r),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,l.width).attr(`height`,l.height).attr(`class`,`background`);c(m,l.height,l.width,!0),m.attr(`viewBox`,`0 0 ${l.width} ${l.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let _=o.getDrawableElem(),v={};function y(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&v[n]&&(i=v[n]),n+=e[r],t=v[n],t||=v[n]=i.append(`g`).attr(`class`,e[r])}return t}e(y,`getGroup`);for(let t of _){if(t.data.length===0)continue;let n=y(t.groupTexts);switch(t.type){case`rect`:if(n.selectAll(`rect`).data(t.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),l.showDataLabel){let r=l.showDataLabelOutsideBar;if(l.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};e(i,`fitsHorizontally`);let a=.7,o=10,c=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),l=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...l)),f=e(e=>r?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);n.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,r?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};e(i,`fitsInBar`);let a=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),l=e(e=>r?e.data.y-10:e.data.y+10,`determineLabelYPosition`);n.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,l).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:n.selectAll(`text`).data(t.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>d(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:n.selectAll(`path`).data(t.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth)}}},`draw`)}};export{Ce as diagram};
|
|
8
|
-
//# sourceMappingURL=xychartDiagram-S5SC5T6Z-
|
|
8
|
+
//# sourceMappingURL=xychartDiagram-S5SC5T6Z-Td7MQ_xN.js.map
|
package/dist/client/index.html
CHANGED
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
</script>
|
|
404
404
|
<style>html,body,#root{width:100%;height:100%;margin:0}body{color:#262626;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}html.dark body{color:#f5f5f5;background:#0a0a0a}#boot-shell{background:inherit;min-height:100%;color:inherit;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}html[data-theme-selected=true] #boot-shell{background:var(--boot-background);color:var(--boot-foreground)}#boot-shell-card{z-index:1;justify-content:center;align-items:center;width:96px;height:96px;display:flex;position:relative}#boot-shell-logo{object-fit:contain;width:64px;height:64px}#boot-error{text-align:center;justify-items:center;gap:16px;max-width:600px;padding:24px;display:grid}#boot-error p{overflow-wrap:anywhere;margin:0}#boot-error button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:8px 16px}</style>
|
|
405
405
|
<title>P4 Code</title>
|
|
406
|
-
<script type="module" crossorigin src="/assets/index-
|
|
406
|
+
<script type="module" crossorigin src="/assets/index-G0rP4C-v.js"></script>
|
|
407
407
|
</head>
|
|
408
408
|
<body>
|
|
409
409
|
<div id="root">
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Df as n,Vo as r,Xb as i,dm as a,fm as o,l as s,ma as c,mh as l,or as u,wx as d,xl as f,yl as p}from"./utils-Nv21__t3.js";import{t as m}from"./check-Cmy7pM2Y.js";import{t as h}from"./chevron-right-NbahR9_s.js";import{t as g}from"./external-link-NWS0I_zo.js";import{L as _,U as v}from"./runtime-CxeCZPZ3.js";import{C as y,O as b,S as x,f as ee,q as te}from"./useSettings-C1hmCYRR.js";import{f as S}from"./server-BBIVfjrf.js";import{i as C,n as ne}from"./session-DZH3pyoG.js";import{n as w}from"./query-gfas_Faw.js";import{t as T}from"./use-atom-command-DdGPgtPS.js";import{n as E,t as D}from"./radio-group-BcuemB8E.js";import{t as re}from"./input-CN9xdIYL.js";import{a as ie,c as ae,i as oe,r as se,s as ce,t as le}from"./dialog-C5PVc2Dc.js";import{x as O}from"./Icons-DJ824_3l.js";import{t as k}from"./preview-DgLUnqIn.js";import{a as ue}from"./settingsLayout-DKjAOwp4.js";import{t as de,y as A}from"./ChatGptUsageButton-BjxGhmRJ.js";import{Bi as fe,Ca as j,Ea as pe,Ta as me,Vi as M,wa as N}from"./main-CJvawsJJ.js";import{t as he}from"./RedactedSensitiveText-DtYR94zZ.js";var P=e(t(),1),F=d(),I=e(c(),1);function L(e){let t=(0,F.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,I.jsx)(O,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,I.jsxs)(u,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function R(e){let t=(0,F.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(B),[s,c]=(0,P.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,I.jsxs)(ie,{children:[(0,I.jsx)(ae,{children:`Reconnect ChatGPT`}),(0,I.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(z),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:`chatgpt-change-account`}),(0,I.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,I.jsx)(`div`,{className:`px-6 pb-6`,children:(0,I.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,I.jsx)(oe,{children:(0,I.jsx)(L,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,I.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,I.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function z(e){return(0,I.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,I.jsx)(D,{value:e.id}),(0,I.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function B(e){return e.id.startsWith(`chatgpt-profile:`)}function V(e){let t=(0,F.c)(36),{environmentId:i,onClose:c,renderSetup:l,onAccountCreated:d}=e,f=C(i,n),p=ee(i),m;t[0]===i?m=t[1]:(m=S.providersValueAtom(i),t[0]=i,t[1]=m);let h=r(m),g=T(S.updateSettings,`Add ChatGPT account`),[_,v]=(0,P.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,P.useState)(null),[w,E]=(0,P.useState)(!1),D=h?.find(e=>e.instanceId===x),ie=A(D),ae=(0,P.useEffectEvent)(c);(0,P.useEffect)(()=>{ie&&ae()},[ie]);let oe;t[4]!==b||t[5]!==i||t[6]!==_||t[7]!==d||t[8]!==c||t[9]!==w||t[10]!==p||t[11]!==g?(oe=async()=>{if(w||!_.trim()||!ne(i,`providers:manage`))return;E(!0);let e=o.make(`codex_${s()}`);(await g({environmentId:i,input:{patch:{providerInstances:{...p.providerInstances,[e]:{driver:a.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(d?(d(e,b),c()):te(e)),E(!1)},t[4]=b,t[5]=i,t[6]=_,t[7]=d,t[8]=c,t[9]=w,t[10]=p,t[11]=g,t[12]=oe):oe=t[12];let se=oe,ce=le,O=!ie,k;t[13]===c?k=t[14]:(k=e=>{e||c()},t[13]=c,t[14]=k);let de=pe,fe=x?b:`Add ChatGPT account`,M;t[15]===fe?M=t[16]:(M=(0,I.jsx)(N,{title:fe,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=fe,t[16]=M);let he=me,L=x?D?.setup?l(x,D):(0,I.jsx)(ue,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,I.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),se()},children:(0,I.jsx)(ue,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,I.jsx)(re,{"aria-label":`Account name`,value:_,disabled:w,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),R;t[17]!==he||t[18]!==L?(R=(0,I.jsx)(he,{children:L}),t[17]=he,t[18]=L,t[19]=R):R=t[19];let z;t[20]!==f||t[21]!==x||t[22]!==_||t[23]!==c||t[24]!==w?(z=(0,I.jsx)(j,{children:x?(0,I.jsx)(u,{variant:`outline`,onClick:c,children:`Finish later`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{variant:`outline`,disabled:w,onClick:c,children:`Cancel`}),(0,I.jsx)(u,{type:`submit`,form:`add-codex-account`,disabled:w||!_.trim()||!f,children:w?`Adding account…`:`Continue`})]})}),t[20]=f,t[21]=x,t[22]=_,t[23]=c,t[24]=w,t[25]=z):z=t[25];let B;t[26]!==de||t[27]!==R||t[28]!==z||t[29]!==M?(B=(0,I.jsxs)(de,{size:`wide`,children:[M,R,z]}),t[26]=de,t[27]=R,t[28]=z,t[29]=M,t[30]=B):B=t[30];let V;return t[31]!==ce||t[32]!==B||t[33]!==O||t[34]!==k?(V=(0,I.jsx)(ce,{open:O,onOpenChange:k,children:B}),t[31]=ce,t[32]=B,t[33]=O,t[34]=k,t[35]=V):V=t[35],V}var ge=l(p),_e=l(f),ve=/^[A-Za-z0-9_./:\\-]+$/;function ye(e,t,n){return ve.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function be(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function xe(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[be(n)]>H[be(e)])&&t.set(n.driver,n)}return t}var Se={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Ce(e,t){let n=Se[e];return t===`windows`?n.windows:n.posix}function we(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ge(r?.config??{});return`${ye(i(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=_e(r?.config??{});return`${ye(i(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var Te={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function U(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Ee(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var De={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Oe(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Ee(n)??t.recommendedRange;return{title:De[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Ee(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var ke=()=>void 0;function Ae(e){let t=(0,F.c)(11),[n,r]=(0,P.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=be(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,l;t[2]===e.provider?l=t[3]:(l=U(e.provider),t[2]=e.provider,t[3]=l);let d=l,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==d||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(he,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?d.headline:`Code with your ChatGPT subscription.`,control:o?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):c?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d.headline}):(0,I.jsx)(L,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,I.jsx)(u,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,I.jsx)(Pe,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,I.jsx)(Ne,{}),control:(0,I.jsx)(u,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,I.jsx)(u,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,I.jsx)(ue,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,I.jsx)(Me,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=d,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function je(e){let t=(0,F.c)(9),{environmentId:r,onClose:i,onAccountCreated:a}=e,o=C(r,n),s;t[0]!==o||t[1]!==r||t[2]!==i?(s=(e,t)=>(0,I.jsx)(Me,{environmentId:r,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!o,autoStart:!0,onAutoStartConsumed:ke,onModeChange:ke,onSignInCancelled:i,allowExistingCli:!1},e),t[0]=o,t[1]=r,t[2]=i,t[3]=s):s=t[3];let c;return t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==s?(c=(0,I.jsx)(V,{environmentId:r,onClose:i,onAccountCreated:a,renderSetup:s}),t[4]=r,t[5]=a,t[6]=i,t[7]=s,t[8]=c):c=t[8],c}function Me({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:a,autoStart:o,onAutoStartConsumed:s,allowExistingCli:c=!0,presentation:l,displayName:d,onSignInCancelled:f}){let p={environmentId:e,input:{instanceId:t}},h=w(S.providerAuthState(p)),ee=w(S.providerInstallState(p)),[C,ne]=(0,P.useState)(null),E=w(C?S.chatGptHandoffState(C):null),D=E.data?.phase===`auth`?E.data.state:h.data,[ie,ae]=(0,P.useState)(!1),[oe,se]=(0,P.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,O=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,j=ee.data,pe=y(e),me=pe!==null&&k(new URL(pe).hostname),N={reportFailure:!1,reportDefect:!1},F=T(S.startProviderAuth,N),z=T(S.refreshProviders,N),B=T(S.completeProviderAuth,N),V=T(S.cancelProviderAuth,N),ge=T(S.logoutProviderAuth,N),_e=T(S.startProviderInstall,N),ve=T(S.cancelProviderInstall,N),ye=T(S.chatGptReconnectProfile,N),be=T(S.chatGptImportProfile,N),H=!C&&(!me||window.desktopBridge?.receiveProviderAuthCallback!==void 0),xe=H&&!window.desktopBridge?.receiveProviderAuthCallback,Se=b(),Ce=x(Se),we=y(Se),Te=!me&&Se&&Ce?.connection.phase===`connected`&&we&&k(new URL(we).hostname)&&(window.desktopBridge!==void 0||k(window.location.hostname))?Se:null,U=new URL(window.location.href);U.pathname===`/welcome`&&(U.hash=`agents:${e}`),U.pathname===`/settings/providers`&&U.searchParams.set(`instanceId`,t);let Ee=xe,De=(0,P.useId)(),[Oe,ke]=(0,P.useState)(!1),[Ae,je]=(0,P.useState)({flowId:``,value:``}),Me=Ae.flowId===D?.flowId?Ae.value:``,[W,Fe]=(0,P.useState)(!1),[Ie,Le]=(0,P.useState)(null),Re=(0,P.useRef)(!1),[ze,Be]=(0,P.useState)(null),G=(0,P.useRef)(null),Ve=(0,P.useRef)(!1),He=(0,P.useRef)(null),[Ue,We]=(0,P.useState)(!1),K=j?.installedVersion!=null,q=n?.auth.status===`authenticated`,Ge=K&&j?.source!==`local`&&j?.version!=null&&j.version!==j.installedVersion,Ke=Ie!==null&&!q&&(D?.phase===`succeeded`||Ie===`handoff`);(0,P.useEffect)(()=>{(q||D?.phase===`failed`||D?.phase===`cancelled`)&&Le(null)},[q,D?.phase]),(0,P.useEffect)(()=>{Ie&&D?.phase===`succeeded`&&z({environmentId:e,input:{instanceId:t}})},[Ie,D?.phase,z,e,t]);let qe=o&&!Ue,Je=Ie===`sign-in`&&!q&&(D===null||D.phase===`idle`),Ye=Ke||Je||C!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,J=j?.phase===`downloading`||j?.phase===`extracting`||j?.phase===`verifying`,Y=qe||Ye||W&&!J,X=i||!r||W||h.error!==null||ee.error!==null,Z=W||Ye||J,Q=(0,P.useCallback)(async(e,t)=>{if(Re.current)return!1;Re.current=!0,Fe(!0),Be(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!_(r)){let e=v(r);Be(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Be(`Codex setup failed. Try again.`)}return Re.current=!1,Fe(!1),n},[]),Xe=(0,P.useId)(),Ze=(0,P.useRef)(0),Qe=(0,P.useRef)(null),[$e,et]=(0,P.useState)(!1),tt=(0,P.useCallback)(async n=>{let r=await Q(()=>be({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Le(`handoff`),ne(null)),et(!r)},[Q,be,e,t]);(0,P.useEffect)(()=>{if(!C||E.data?.phase!==`finished`)return;let e=C.input.attemptId;Qe.current!==e&&(Qe.current=e,tt(E.data.profile))},[C,E.data,tt]),(0,P.useEffect)(()=>{C&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Be(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[C,E.data,E.error]);let nt=(0,P.useCallback)(()=>(Le(null),C?(ne(null),Promise.resolve()):Q(()=>V({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[C,Q,V,e,t,D]),rt=(0,P.useCallback)(async(n=`chatgpt`)=>{if(Re.current)return;Ve.current=!0,et(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),Te){let i=`${Xe}:${++Ze.current}`;await Q(()=>ye({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:Te,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ve.current=!1);return}await Q(()=>F({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>Le(`sign-in`))||(Ve.current=!1)},[e,t,Q,F,H,Te,ye,Xe]),$=(0,P.useCallback)(async(n=`chatgpt`)=>{X||Z||(K&&!Ge?await rt(n):(G.current=n,await Q(()=>_e({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[X,Z,K,Ge,rt,Q,_e,e,t]);(0,P.useEffect)(()=>{!o||Ue||X||Z||j===null||!n?.setup?.canInstall||(We(!0),s(),$())},[o,Ue,X,Z,j,n?.setup?.canInstall,s,$]),(0,P.useEffect)(()=>{if(!(!G.current||W||J)){if(j?.phase===`failed`||j?.phase===`cancelled`)G.current=null;else if(K){let e=G.current;G.current=null,rt(e)}}},[W,J,j?.phase,K,rt]);let it=(0,P.useRef)(null),at=D?.flowId,ot=(0,P.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&at){if(it.current===n){await te().shell.openExternal(n);return}it.current=n;let i=await r(n);if(it.current!==n)return;it.current=null,await Q(()=>B({environmentId:e,input:{instanceId:t,flowId:at,callbackUrl:i}}))}else await te().shell.openExternal(n)}catch{Be(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,at,Q,B,e,t]);(0,P.useEffect)(()=>{if(H&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{it.current===A&&(it.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[H,A]),(0,P.useEffect)(()=>{Ve.current&&D?.phase===`waiting`&&D.flowId&&A&&He.current!==D.flowId&&(He.current=D.flowId,Ve.current=!1,xe||ot(A))},[D?.phase,D?.flowId,A,ot,xe]);let st=j?.phase===`downloading`?`Downloading ${(j.downloadedBytes/1e6).toFixed(1)}${j.totalBytes===null?``:` of ${(j.totalBytes/1e6).toFixed(1)}`} MB.`:j?.phase===`extracting`?`Installing Codex.`:j?.phase===`verifying`?`Checking Codex.`:K?`${j?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${j?.installedVersion?` · v${j.installedVersion}`:``}.`:j?.message??`P4 Code downloads and manages Codex for you.`,ct=Ke?`Finishing sign-in...`:J?st:Y||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(he,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,lt=Ee&&A&&D?.flowId&&M(U.toString())?fe({authorizationUrl:A,returnUrl:U.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,ut=(0,I.jsx)(u,{size:`sm`,variant:xe?`default`:`outline`,className:l===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!$e:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?tt(E.data.profile):A&&ot(A)},children:Ke?`Finishing sign-in...`:E.data?.phase===`finished`?$e?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?xe?`Open ChatGPT sign-in`:`Open sign-in page`:l===`onboarding`?`Open sign-in page`:`Signing in...`}),dt=!C&&D?.phase===`waiting`&&A?(0,I.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,I.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Me.trim())return;let r=Me.trim(),i=D.flowId;Q(()=>B({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&je({flowId:i,value:``})})},children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(re,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Me,maxLength:16384,disabled:W||i,onChange:e=>je({flowId:D.flowId??``,value:e.target.value})})}),(0,I.jsx)(u,{variant:`outline`,type:`submit`,disabled:W||i||!Me.trim(),children:`Connect`})]}),xe?null:(0,I.jsx)(`div`,{children:(0,I.jsxs)(u,{size:`xs`,variant:`ghost-muted`,onClick:()=>void te().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,I.jsx)(g,{className:`size-3.5`})]})}),lt?(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,I.jsx)(u,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,I.jsx)(`a`,{href:lt}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ft=dt&&Oe?(0,I.jsx)(`div`,{id:De,className:`w-full border-t border-border/50 pt-3`,children:dt}):null,pt=Ee?dt:dt?(0,I.jsxs)(`div`,{className:`space-y-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,I.jsx)(Ne,{label:`Having trouble signing in?`,expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}),ft]}):null,mt=(0,I.jsx)(R,{open:ie,methods:D?.methods??[],onClose:()=>ae(!1),onSelect:e=>{ae(!1),$(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),ht=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(l===`onboarding`){let r=ht??ze??(h.error||ee.error?`Could not read setup status. Reconnect and try again.`:j?.phase===`failed`?j.message:null);return(0,I.jsxs)(I.Fragment,{children:[mt,(0,I.jsxs)(Pe,{title:d||n?.displayName||`Codex`,description:J?st:q?n?.auth.email?.trim()?(0,I.jsxs)(I.Fragment,{children:[`Signed in as`,` `,(0,I.jsx)(he,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:dt&&!Ee?(0,I.jsx)(Ne,{expanded:Oe,controls:De,onToggle:()=>ke(e=>!e)}):qe||Je||D?.phase===`starting`||D?.phase===`waiting`||W&&!J?(0,I.jsx)(Ne,{}):Y||D?.phase===`failed`||D?.phase===`cancelled`?ct:`Code with your ChatGPT subscription.`,control:q&&!Z?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Ready`]}):Y?ut:(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:J||W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:Y&&!Ke||J?(0,I.jsx)(u,{size:`sm`,variant:`ghost-muted`,disabled:W||i,onClick:()=>{Ve.current=!1,G.current=null,C||Y&&D?.flowId?nt():j?.operationId&&Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}}))},children:`Cancel`}):!Y&&!q&&O?(0,I.jsx)(u,{size:`sm`,variant:`ghost-muted`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):!Y&&!q&&c?(0,I.jsx)(u,{size:`sm`,variant:`ghost-muted`,disabled:i||Z,onClick:()=>a(`existing`),children:`Use existing CLI`}):null,children:[Ee?pt:ft,r?(0,I.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,I.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[mt,(0,I.jsx)(ue,{title:`ChatGPT account`,description:ct,control:(0,I.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:Y?(0,I.jsxs)(I.Fragment,{children:[ut,!Ke&&(0,I.jsx)(u,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{(C||D?.flowId)&&(Ve.current=!1,nt(),f?.())},children:`Cancel`})]}):J?(0,I.jsx)(u,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{j?.operationId&&(G.current=null,Q(()=>ve({environmentId:e,input:{instanceId:t,operationId:j.operationId}})))},children:`Cancel`}):q?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{size:`sm`,variant:`outline`,disabled:X||Z,onClick:()=>ae(!0),children:`Change account`}),(0,I.jsx)(u,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void Q(()=>ge(p)),children:`Disconnect`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{O?ae(!0):$()},children:W?`Setting up...`:O?`Reconnect account`:`Continue with ChatGPT`}),O?(0,I.jsx)(u,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),q?(0,I.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,I.jsx)(de,{})}):null,ht?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:ht}):null,pt?(0,I.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:pt}):null,ze||h.error||ee.error||j?.phase===`failed`?(0,I.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:ze??(j?.phase===`failed`?j.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,F.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=S.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=w(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,I.jsx)(ue,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,I.jsx)(ue,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,I.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,I.jsx)(re,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,I.jsx)(ue,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,I.jsxs)(I.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ne(e){let t=(0,F.c)(10),{label:n,expanded:r,controls:i,onToggle:a}=e,o=n===void 0?`Complete sign-in in your browser.`:n,s=r!==void 0&&r;if(!a){let e;return t[0]===o?e=t[1]:(e=(0,I.jsx)(`div`,{className:`leading-relaxed`,children:o}),t[0]=o,t[1]=e),e}let c=`size-3 shrink-0 ${s?`rotate-90`:``}`,l;t[2]===c?l=t[3]:(l=(0,I.jsx)(h,{"aria-hidden":!0,className:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==s||t[6]!==o||t[7]!==a||t[8]!==l?(u=(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":s,"aria-controls":i,onClick:a,children:[o,l]}),t[4]=i,t[5]=s,t[6]=o,t[7]=a,t[8]=l,t[9]=u):u=t[9],u}function Pe(e){let t=(0,F.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=P.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(O,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,I.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,I.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,I.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,I.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Fe(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{Te as a,Ee as c,we as d,xe as f,Ae as i,be as l,je as n,U as o,L as p,W as r,Oe as s,Fe as t,Ce as u};
|
|
2
|
-
//# sourceMappingURL=CodexSetupSection.logic-CpyIRPfJ.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{Hr as n,It as r,Ns as i,Rt as a,Ta as o,Un as s,Ur as c,Ut as l,Vo as u,Wt as d,Xt as f,dn as p,dr as m,js as h,ma as g,or as _,sn as v,sr as y,t as b,um as x,un as S,vo as C,wx as w,yo as T}from"./utils-Nv21__t3.js";import{t as E}from"./check-Cmy7pM2Y.js";import{t as D}from"./chevron-right-NbahR9_s.js";import{t as O}from"./info-BHB-83EA.js";import{t as k}from"./sparkles-cStmYKbH.js";import{t as A}from"./star-DJ6Ycqv6.js";import{t as j}from"./x-CSwbgjBe.js";import{t as M}from"./zap-CrtYfJ8v.js";import{a as N,n as P,r as F,t as I}from"./tooltip-CYNXW1Ow.js";import{t as L}from"./CompositeRoot-Dz15SC7i.js";import{t as R}from"./useNavigate-DfvN7ISg.js";import{_ as z,d as B}from"./useSettings-C1hmCYRR.js";import{s as V}from"./server-BBIVfjrf.js";import{a as ee,n as te,r as ne,s as re,t as ie}from"./combobox-zg5NNJOT.js";import{n as ae}from"./scroll-area-CRoS-lxP.js";import{t as oe}from"./AnimatedHeight-CcLJhBdM.js";import{g as se,m as ce,p as le,v as ue}from"./keybindings-C81QSEVL.js";import{x as de}from"./Icons-DJ824_3l.js";import{i as fe,o as pe,t as me}from"./popover-aTTlR6NX.js";import{i as H,n as U,r as W,t as G}from"./alert-B49R80NU.js";import{t as K}from"./semver-CFbvOQKc.js";import{t as q}from"./kbd-Fa27fInv.js";import{b as he,t as J,y as Y}from"./ChatGptUsageButton-BjxGhmRJ.js";import{Vr as ge,gn as _e,hn as X,ss as ve,xn as ye}from"./main-CJvawsJJ.js";var Z=e(t(),1),be=w(),Q=e(g(),1);function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function $(e,t){let n=t?.trim();if(!n)return e;let r=RegExp(`^${xe(n)}(?:\\s*[.:/-]\\s*|\\s+)`,`iu`);return e.replace(r,``).trim()||e}function Se(e,t){let n=t?.preferShortName&&e.shortName?e.shortName:e.name;return h($(n,e.subProvider))}function Ce(e,t){let n=e.trim(),r=t?.trim();return r?n&&RegExp(`^${xe(n)}\\s+\\S`,`i`).test(r)?r:`${e} · ${r}`:e}function we(e){return Se(e,{preferShortName:!0})}function Te(e){return we(e)}var Ee={claudeAgent:`Claude Code`,codex:`the Codex CLI`};function De(e){return e.length<=2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`}function Oe(e,t=``){let n=t.trim().toLocaleLowerCase(),r=(e.updateRequiredModels??[]).filter(e=>n.length===0||e.name.toLocaleLowerCase().includes(n)||e.slug.toLocaleLowerCase().includes(n));if(r.length===0)return null;let i=r.map(e=>e.minVersion).reduce((e,t)=>K(t,e)>0?t:e);return`Update ${Ee[e.driver]??x[e.driver]??e.driver} to ${i.startsWith(`v`)?i:`v${i}`} or newer to use ${De(r.map(e=>e.name))}.`}var ke=`model:`,Ae=`legacy-models:`;function je(e,t){return`${ke}${e.length}:${e}${t}`}function Me(e){if(!e.startsWith(ke))return null;let t=e.slice(6),n=t.indexOf(`:`);if(n===-1)return null;let r=t.slice(0,n);if(!/^\d+$/.test(r))return null;let i=Number(r),a=t.slice(n+1);return!Number.isSafeInteger(i)||i>a.length?null:{instanceId:a.slice(0,i),slug:a.slice(i)}}function Ne(e){return`${Ae}${e}`}function Pe(e){return e.startsWith(Ae)?e.slice(14):null}var Fe=(0,Z.memo)(function(e){let t=(0,be.c)(71),n;t[0]!==e.model.subProvider||t[1]!==e.providerDisplayName?(n=Ce(e.providerDisplayName,e.model.subProvider),t[0]=e.model.subProvider,t[1]=e.providerDisplayName,t[2]=n):n=t[2];let r=n,i=e.index,a;t[3]!==e.instanceId||t[4]!==e.model.slug?(a=je(e.instanceId,e.model.slug),t[3]=e.instanceId,t[4]=e.model.slug,t[5]=a):a=t[5];let o=!!e.disabledReason,c=e.disabledReason&&`data-disabled:pointer-events-auto data-disabled:cursor-not-allowed`,l;t[6]===c?l=t[7]:(l=b(`group relative w-full !min-w-0 max-w-full cursor-pointer`,c),t[6]=c,t[7]=l);let u;t[8]!==e.model||t[9]!==e.preferShortName||t[10]!==e.useTriggerLabel?(u=e.useTriggerLabel?Te(e.model):Se(e.model,e.preferShortName?{preferShortName:!0}:void 0),t[8]=e.model,t[9]=e.preferShortName,t[10]=e.useTriggerLabel,t[11]=u):u=t[11];let d;t[12]===u?d=t[13]:(d=(0,Q.jsx)(`div`,{className:`min-w-0 truncate text-xs font-medium leading-snug`,children:u}),t[12]=u,t[13]=d);let f;t[14]===e.showNewBadge?f=t[15]:(f=e.showNewBadge?(0,Q.jsx)(`span`,{className:`shrink-0 rounded border border-update/35 bg-update/15 px-0.5 py-px text-3xs font-bold uppercase leading-none tracking-wide text-update-foreground`,"aria-label":`New model`,children:`New`}):null,t[14]=e.showNewBadge,t[15]=f);let p;t[16]===e.unavailable?p=t[17]:(p=e.unavailable?(0,Q.jsx)(s,{variant:`outline`,size:`sm`,children:`Unavailable`}):null,t[16]=e.unavailable,t[17]=p);let m;t[18]!==d||t[19]!==f||t[20]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[d,f,p]}),t[18]=d,t[19]=f,t[20]=p,t[21]=m):m=t[21];let h;t[22]!==e.acpRegistryAgentId||t[23]!==e.acpRegistryIconUrl||t[24]!==e.driverKind||t[25]!==e.providerDisplayName||t[26]!==e.showProvider||t[27]!==r?(h=e.showProvider&&(0,Q.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,Q.jsx)(he,{driverKind:e.driverKind,displayName:e.providerDisplayName,acpRegistryAgentId:e.acpRegistryAgentId,acpRegistryIconUrl:e.acpRegistryIconUrl,className:`size-3`,iconClassName:`size-3`}),(0,Q.jsx)(`span`,{className:`truncate text-xs font-normal leading-snug text-muted-foreground/70`,children:r})]}),t[22]=e.acpRegistryAgentId,t[23]=e.acpRegistryIconUrl,t[24]=e.driverKind,t[25]=e.providerDisplayName,t[26]=e.showProvider,t[27]=r,t[28]=h):h=t[28];let g;t[29]!==m||t[30]!==h?(g=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[m,h]}),t[29]=m,t[30]=h,t[31]=g):g=t[31];let v;t[32]!==e.isSelected||t[33]!==e.showSelection?(v=e.showSelection&&e.isSelected?(0,Q.jsx)(E,{className:`size-3.5`,"aria-hidden":`true`}):null,t[32]=e.isSelected,t[33]=e.showSelection,t[34]=v):v=t[34];let y;t[35]===e.jumpLabel?y=t[36]:(y=e.jumpLabel?(0,Q.jsx)(q,{children:e.jumpLabel}):null,t[35]=e.jumpLabel,t[36]=y);let x;t[37]===e?x=t[38]:(x=t=>{t.stopPropagation(),e.onToggleFavorite()},t[37]=e,t[38]=x);let S=!!e.disabledReason,C=e.isFavorite?`Remove from favorites`:`Add to favorites`,w=e.isFavorite&&`fill-current text-warning`,T;t[39]===w?T=t[40]:(T=b(`size-3.5 sm:size-3`,w),t[39]=w,t[40]=T);let D;t[41]===T?D=t[42]:(D=(0,Q.jsx)(A,{className:T}),t[41]=T,t[42]=D);let O;t[43]!==x||t[44]!==S||t[45]!==C||t[46]!==D?(O=(0,Q.jsx)(N,{render:(0,Q.jsx)(_,{size:`icon-xs`,variant:`ghost-muted`,className:`-mr-1 shrink-0`,onClick:x,onKeyDown:Ie,disabled:S,"aria-label":C,children:D})}),t[43]=x,t[44]=S,t[45]=C,t[46]=D,t[47]=O):O=t[47];let k=e.isFavorite?`Remove from favorites`:`Add to favorites`,j;t[48]===k?j=t[49]:(j=(0,Q.jsx)(P,{side:`top`,align:`center`,children:k}),t[48]=k,t[49]=j);let M;t[50]!==O||t[51]!==j?(M=(0,Q.jsxs)(I,{children:[O,j]}),t[50]=O,t[51]=j,t[52]=M):M=t[52];let F;t[53]!==v||t[54]!==y||t[55]!==M?(F=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[v,y,M]}),t[53]=v,t[54]=y,t[55]=M,t[56]=F):F=t[56];let L;t[57]!==e.index||t[58]!==g||t[59]!==a||t[60]!==F||t[61]!==o||t[62]!==l?(L=(0,Q.jsxs)(ne,{hideIndicator:!0,index:i,value:a,disabled:o,className:l,children:[g,F]}),t[57]=e.index,t[58]=g,t[59]=a,t[60]=F,t[61]=o,t[62]=l,t[63]=L):L=t[63];let R=L;if(!e.disabledReason)return R;let z;t[64]===R?z=t[65]:(z=(0,Q.jsx)(N,{render:R}),t[64]=R,t[65]=z);let B;t[66]===e.disabledReason?B=t[67]:(B=(0,Q.jsx)(P,{side:`left`,align:`center`,children:e.disabledReason}),t[66]=e.disabledReason,t[67]=B);let V;return t[68]!==z||t[69]!==B?(V=(0,Q.jsxs)(I,{children:[z,B]}),t[68]=z,t[69]=B,t[70]=V):V=t[70],V});function Ie(e){e.stopPropagation()}var Le=Z.forwardRef(function(e,t){let{disabled:r=!1,loopFocus:i=!0,orientation:a=`horizontal`,className:o,render:s,style:c,...l}=e,[u,d]=Z.useState(()=>new Map),f=Z.useMemo(()=>{let e=[];for(let t of u.values())t?.index&&!t.focusableWhenDisabled&&e.push(t.index);return e},[u]),p=Z.useMemo(()=>({disabled:r,orientation:a,setItemMap:d}),[r,a,d]),m={disabled:r,orientation:a},h={"aria-orientation":a,role:`toolbar`};return(0,Q.jsx)(n.Provider,{value:p,children:(0,Q.jsx)(L,{render:s,className:o,style:c,state:m,refs:[t],props:[h,l],disabledIndices:f,loopFocus:i,onMapChange:d,orientation:a})})}),Re=Z.createContext(void 0);function ze(e){let t=Z.useContext(Re);if(t===void 0&&!e)throw Error(C(68));return t}var Be=Z.forwardRef(function(e,t){let{className:n,disabled:r=!1,focusableWhenDisabled:i=!0,render:a,nativeButton:s=!0,style:l,...u}=e,d=Z.useMemo(()=>({focusableWhenDisabled:i}),[i]),{disabled:f,orientation:p}=c(),h=ze(!0),g=f||(h?.disabled??!1)||r,{getButtonProps:_,buttonRef:v}=o({disabled:g,focusableWhenDisabled:i,native:s});return(0,Q.jsx)(m,{tag:`button`,render:a,className:n,style:l,metadata:d,state:{disabled:g,orientation:p,focusable:i},refs:[t,v],props:[u,{disabled:g},_]})});function Ve(e){let t=e.displayName;if(!e.enabled||e.status===`disabled`)return`${t} — Disabled in settings.`;if(e.status===`ready`&&e.isAvailable)return t;let n=e.status===`error`?`Unavailable`:e.status===`warning`?`Limited`:`Not ready`,r=e.snapshot.message?.trim();return r?`${t} — ${n}. ${r}`:`${t} — ${n}.`}var He=`pointer-events-none absolute -right-1 top-1/2 z-10 h-5 w-0.75 -translate-y-1/2 rounded-l-full bg-primary`,Ue=`pointer-events-none absolute -right-0.5 top-0.5 z-10 flex size-3.5 items-center justify-center rounded-full bg-transparent shadow-sm text-update-foreground `,We=`left`,Ge=8,Ke=(0,Z.memo)(function(e){let t=(0,be.c)(27),n;t[0]===e?n=t[1]:(n=t=>{e.onSelectInstance(t)},t[0]=e,t[1]=n);let r=n,i=e.showFavorites??!0,[a,o]=(0,Z.useState)(null),s=(0,Z.useRef)(null),[c,u]=(0,Z.useState)(null),d;t[2]===e.selectedInstanceId?d=t[3]:(d=()=>{let t=s.current;if(!t)return;let n=Array.from(t.querySelectorAll(`[data-model-picker-provider]`)).find(t=>t.dataset.modelPickerProvider===e.selectedInstanceId);if(!n){u(null);return}u(n.offsetTop+n.offsetHeight/2-10)},t[2]=e.selectedInstanceId,t[3]=d);let p;t[4]!==e.instanceEntries||t[5]!==e.selectedInstanceId||t[6]!==i?(p=[e.instanceEntries,e.selectedInstanceId,i],t[4]=e.instanceEntries,t[5]=e.selectedInstanceId,t[6]=i,t[7]=p):p=t[7],(0,Z.useLayoutEffect)(d,p);let m;t[8]===e?m=t[9]:(m=t=>{if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)&&t.key===`ArrowRight`){t.preventDefault(),e.onFocusSearch();return}},t[8]=e,t[9]=m);let h;t[10]===c?h=t[11]:(h=c===null?null:(0,Q.jsx)(`div`,{"data-model-picker-selected-indicator":`true`,className:b(He,`right-0 translate-y-0 transition-[top] duration-200 ease-out`),style:{top:c}}),t[10]=c,t[11]=h);let g;t[12]!==r||t[13]!==e.selectedInstanceId||t[14]!==i?(g=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`relative w-full`,"data-model-picker-provider":`favorites`,children:(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(Be,{className:b(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded-md transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10 focus-visible:outline-none`),onClick:()=>r(`favorites`),type:`button`,"aria-label":`Favorites`,"aria-pressed":e.selectedInstanceId===`favorites`,children:(0,Q.jsx)(A,{className:`size-5 fill-current shrink-0`,"aria-hidden":!0})})}),(0,Q.jsx)(P,{side:We,sideOffset:Ge,align:`center`,children:`Favorites`})]})}),(0,Q.jsx)(`div`,{className:`border-b border-border/70`,"aria-hidden":`true`})]}):null,t[12]=r,t[13]=e.selectedInstanceId,t[14]=i,t[15]=g):g=t[15];let _;t[16]!==r||t[17]!==a||t[18]!==e?(_=e.instanceEntries.map(t=>{let n=!l(t),i=e.disabledInstanceIds?.has(t.instanceId)??!1,s=e.selectableUnavailableInstanceIds?.has(t.instanceId)??!1,c=n&&!s||i,u=e.selectedInstanceId===t.instanceId,d=a===t.instanceId,p=e.newBadgeInstanceIds?.has(t.instanceId)??!1,m=f(t,e.instanceEntries),h=n?Ve(t):i?e.getDisabledInstanceTooltip?.(t)??t.displayName:p?`${t.displayName} — New`:t.displayName,g=(0,Q.jsxs)(Be,{className:b(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded-md transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10 focus-visible:outline-none`,c&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-provider-accent-color":t.accentColor,onClick:()=>!c&&r(t.instanceId),onMouseEnter:()=>o(t.instanceId),onMouseLeave:()=>o(e=>e===t.instanceId?null:e),onFocus:()=>o(t.instanceId),onBlur:()=>o(e=>e===t.instanceId?null:e),disabled:c,focusableWhenDisabled:!c,"aria-pressed":u,type:`button`,"aria-label":n||i?h:p?`${t.displayName}, new`:t.displayName,children:[(0,Q.jsx)(he,{driverKind:t.driverKind,displayName:t.displayName,accentColor:t.accentColor,acpRegistryAgentId:t.acpRegistryAgentId,acpRegistryIconUrl:t.acpRegistryIconUrl,showBadge:m,className:`size-6 z-30`,iconClassName:`size-5`,indicatorBackground:d&&!c?`var(--muted)`:u?`var(--background)`:`color-mix(in oklab, var(--muted) 30%, transparent)`,...t.accentColor?{badgeClassName:`h-3 min-w-3 px-0.5 text-5xs`}:{}}),p?(0,Q.jsx)(`span`,{className:Ue,"aria-hidden":!0,children:(0,Q.jsx)(k,{className:`size-2`})}):null]}),_=c?(0,Q.jsx)(`span`,{className:`relative block w-full`,children:g}):g;return(0,Q.jsx)(`div`,{className:`relative w-full`,"data-model-picker-provider":t.instanceId,children:(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:_}),(0,Q.jsx)(P,{side:We,sideOffset:Ge,align:`center`,children:h})]})},t.instanceId)}),t[16]=r,t[17]=a,t[18]=e,t[19]=_):_=t[19];let v;t[20]!==h||t[21]!==g||t[22]!==_?(v=(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto overscroll-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,Q.jsxs)(`div`,{ref:s,className:`relative flex min-h-full flex-col gap-1 p-1`,children:[h,g,_]})}),t[20]=h,t[21]=g,t[22]=_,t[23]=v):v=t[23];let y;return t[24]!==m||t[25]!==v?(y=(0,Q.jsx)(Le,{className:`w-11 shrink-0 overflow-hidden bg-muted/30`,"data-model-picker-sidebar":`true`,"aria-label":`Providers`,orientation:`vertical`,onKeyDown:m,children:v}),t[24]=m,t[25]=v,t[26]=y):y=t[26],y});function qe(e){let t=e.compatibilityAdvisory;return e.status===`error`&&e.auth.status===`unauthenticated`?null:t?.status===`broken`||e.status===`ready`&&t?.status===`unsupported`?t:null}function Je(e){if(!e||e.status===`disabled`)return null;let t=qe(e);return t?[e.instanceId,t.status,e.version??``,t.message??``].join(`\0`):e.status===`ready`||e.driver===`antigravity`&&e.installed&&e.status===`warning`&&e.auth.status===`unknown`?null:[e.instanceId,e.status,e.auth.status,e.message??``].join(`\0`)}function Ye(e,t){let n=Je(e);return n!==null&&n!==t}function Xe(e){return e.driver===`antigravity`||e.setup?.canAuthenticate===!0||e.setup?.canInstall===!0}function Ze(e){if(e.auth.status!==`unauthenticated`&&e.compatibilityAdvisory?.status===`broken`&&e.compatibilityAdvisory.message)return e.compatibilityAdvisory.message;if(e.message)return e.message;let t=e.displayName?.trim()||T(e.driver);return!e.installed&&Xe(e)?`Open provider setup to install ${T(e.driver)} on this environment.`:e.auth.status===`unauthenticated`?Xe(e)?e.driver===`antigravity`?`Open provider setup to sign in with Google.`:`Open provider setup to sign in.`:`Sign in via the CLI to authenticate again.`:e.status===`ready`?`No models are available for this provider.`:e.status===`error`?`${t} provider is unavailable.`:`${t} provider has limited availability.`}var Qe=(0,Z.memo)(function(e){let t=(0,be.c)(30),{onDismiss:n,onOpenProviderSetup:r,status:i}=e;if(!i||Je(i)===null)return null;let a;t[0]!==i.displayName||t[1]!==i.driver?(a=i.displayName?.trim()||T(i.driver),t[0]=i.displayName,t[1]=i.driver,t[2]=a):a=t[2];let o=a,s=i.status===`error`&&i.auth.status===`unauthenticated`,c;t[3]===i?c=t[4]:(c=qe(i),t[3]=i,t[4]=c);let l=c,u=s?`${o} is unauthenticated`:l?`${o} ${i.version??``} is ${l.status===`broken`?`known to be broken`:`unsupported`}`:`${o} provider status`,d;t[5]!==l?.message||t[6]!==i?(d=l?.message??Ze(i),t[5]=l?.message,t[6]=i,t[7]=d):d=t[7];let f=d,p=l?.status!==`broken`&&(i.status===`warning`||l!==null)?`warning`:`error`,m=l&&l.status!==`broken`?`status`:`alert`,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(O,{}),t[8]=h):h=t[8];let g;t[9]===u?g=t[10]:(g=(0,Q.jsx)(H,{children:u}),t[9]=u,t[10]=g);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`div`,{className:`line-clamp-3`}),t[11]=v):v=t[11];let b;t[12]===f?b=t[13]:(b=(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:v,children:f}),(0,Q.jsx)(P,{side:`top`,className:`whitespace-pre-wrap`,children:f})]}),t[12]=f,t[13]=b);let x;t[14]!==r||t[15]!==i?(x=r&&Xe(i)?(0,Q.jsx)(y,{onClick:()=>r(i.instanceId),children:`Open provider setup`}):null,t[14]=r,t[15]=i,t[16]=x):x=t[16];let S;t[17]!==x||t[18]!==b?(S=(0,Q.jsxs)(W,{children:[b,x]}),t[17]=x,t[18]=b,t[19]=S):S=t[19];let C=`Dismiss ${o} provider ${i.status}`,w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(j,{}),t[20]=w):w=t[20];let E;t[21]!==n||t[22]!==C?(E=(0,Q.jsx)(U,{children:(0,Q.jsx)(_,{"aria-label":C,onClick:n,size:`icon-xs`,variant:`ghost-muted`,children:w})}),t[21]=n,t[22]=C,t[23]=E):E=t[23];let D;return t[24]!==S||t[25]!==E||t[26]!==p||t[27]!==m||t[28]!==g?(D=(0,Q.jsx)(`div`,{className:`pointer-events-auto mx-auto w-fit max-w-[calc(100%-2rem)] pt-3`,children:(0,Q.jsxs)(G,{variant:p,role:m,surface:`glass`,controlAlignment:`first-line`,children:[h,g,S,E]})}),t[24]=S,t[25]=E,t[26]=p,t[27]=m,t[28]=g,t[29]=D):D=t[29],D}),$e=24;function et(e){return[X(e.name),...e.shortName?[X(e.shortName)]:[],...e.subProvider?[X(e.subProvider)]:[],X(e.driverKind),X(e.providerDisplayName),nt(e)]}function tt(e,t,n){return _e({value:e,query:t,exactBase:n,prefixBase:n+2,boundaryBase:n+4,includesBase:n+6,...t.length>=3?{fuzzyBase:n+100}:{}})}function nt(e){return X([e.name,e.shortName,e.subProvider,e.driverKind,e.providerDisplayName].filter(e=>typeof e==`string`&&e.length>0).join(` `))}function rt(e,t){let n=X(t).split(/\s+/u).filter(e=>e.length>0);if(n.length===0)return 0;let r=et(e),i=0;for(let e of n){let t=[];for(let n=0;n<r.length;n+=1){let i=tt(r[n],e,n*10);i!==null&&t.push(i)}if(t.length===0)return null;i+=Math.min(...t)}return e.isFavorite?i-$e:i}function it(e){if(e.driverKind===`antigravity`&&e.model===`antigravity-default`){let t=e.options.filter(e=>e.slug!==`antigravity-default`&&!e.isUnavailable);return t.find(e=>e.aliases?.includes(`antigravity-default`))??t.find(e=>e.isDefault)}return e.options.find(t=>t.slug===e.model)}function at(e){return e.entry.driverKind===`antigravity`&&e.option.slug===`antigravity-default`?!1:l(e.entry)?!0:e.entry.enabled&&(e.entry.driverKind===`opencode`||e.entry.driverKind===`antigravity`)&&e.entry.instanceId===e.activeInstanceId&&e.option.slug===e.activeModel&&e.option.isUnavailable===!0}function ot(e,t){return e.enabled&&e.status!==`disabled`&&Xe(e.snapshot)&&(!l(e)||!e.installed||e.snapshot.auth.status===`unauthenticated`||!t.some(e=>!e.isUnavailable))}function st(e){let t=[`favorites`,...e.entries.filter(t=>!e.disabledInstanceIds?.has(t.instanceId)&&(l(t)||e.selectableUnavailableInstanceIds?.has(t.instanceId))).map(e=>e.instanceId)],n=t.indexOf(e.selectedInstanceId);return t[n<0?e.direction===1?0:t.length-1:(n+e.direction+t.length)%t.length]}var ct=new Map,lt=52;function ut(){let e=(0,be.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`h-0.5`}),e[0]=t):t=e[0],t}var dt=(0,Z.memo)(function(e){let{keybindings:t,modelOptionsByInstance:n,instanceEntries:o,getModelDisabledReason:s,onInstanceModelChange:c,onToggleModel:f}=e,[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),x=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w=(0,Z.useRef)(null),{favorites:T}=B(e.environmentId),E=e.instanceEntries.find(t=>t.instanceId===e.activeInstanceId),O=it({driverKind:E?.driverKind,model:e.model,options:n.get(e.activeInstanceId)??[]})?.slug??(e.model===`antigravity-default`?``:e.model),k=O?je(e.activeInstanceId,O):null,A=(0,Z.useMemo)(()=>e.selectedModels?.map(e=>{let t=it({driverKind:o.find(t=>t.instanceId===e.instanceId)?.driverKind,model:e.model,options:n.get(e.instanceId)??[]});return je(e.instanceId,t?.slug??e.model)}),[o,n,e.selectedModels]),j=(0,Z.useMemo)(()=>new Set(A??(k?[k]:[])),[A,k]),M=E!==void 0&&(n.get(e.activeInstanceId)??[]).some(t=>at({entry:E,option:t,activeInstanceId:e.activeInstanceId,activeModel:O}))&&!l(E),N=e.onOpenProviderSetup!==void 0&&E!==void 0&&ot(E,n.get(e.activeInstanceId)??[]),[P,I]=(0,Z.useState)(()=>e.lockedProvider!==null||M||N?e.activeInstanceId:T.length>0?`favorites`:e.activeInstanceId),[L,oe]=(0,Z.useState)(()=>new Set(n.get(e.activeInstanceId)?.some(e=>e.slug===O&&e.isLegacy)?[e.activeInstanceId]:[])),de=u(V),fe=t??de,pe=R(),me=z(e.environmentId),H=(0,Z.useCallback)(()=>{x.current?.focus({preventScroll:!0})},[]),U=(0,Z.useCallback)(e=>{I(e),window.requestAnimationFrame(()=>{H()})},[H]);(0,Z.useLayoutEffect)(()=>{H();let e=window.requestAnimationFrame(()=>{H()}),t=window.setTimeout(()=>{H()},0);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},[H]);let W=(0,Z.useMemo)(()=>new Set(T.map(e=>r(e.provider,e.model))),[T]),G=(0,Z.useMemo)(()=>new Map(o.map(e=>[e.instanceId,e])),[o]),K=(0,Z.useCallback)(t=>e.lockedProvider===null?!0:t.driverKind===e.lockedProvider?!e.lockedContinuationGroupKey||t.continuationGroupKey===e.lockedContinuationGroupKey:!1,[e.lockedContinuationGroupKey,e.lockedProvider]),q=(0,Z.useMemo)(()=>{let t=new Set;if(M&&t.add(e.activeInstanceId),e.onOpenProviderSetup)for(let e of o)ot(e,n.get(e.instanceId)??[])&&t.add(e.instanceId);return t.size>0?t:void 0},[M,o,n,e.activeInstanceId,e.onOpenProviderSetup]),he=(0,Z.useMemo)(()=>{let t=[];for(let[r,i]of n){let n=G.get(r);if(n)for(let a of i)at({entry:n,option:a,activeInstanceId:e.activeInstanceId,activeModel:O})&&t.push({slug:a.slug,name:a.name,...a.shortName?{shortName:a.shortName}:{},...a.subProvider?{subProvider:a.subProvider}:{},...a.badge?{badge:a.badge}:{},...a.isLegacy?{isLegacy:!0}:{},...a.isUnavailable?{isUnavailable:!0}:{},instanceId:r,driverKind:n.driverKind,instanceDisplayName:n.displayName,...n.accentColor?{instanceAccentColor:n.accentColor}:{},...n.acpRegistryAgentId?{acpRegistryAgentId:n.acpRegistryAgentId}:{},...n.acpRegistryIconUrl?{acpRegistryIconUrl:n.acpRegistryIconUrl}:{},...n.continuationGroupKey?{continuationGroupKey:n.continuationGroupKey}:{}})}return t},[n,G,e.activeInstanceId,O]),J=e.lockedProvider!==null,Y=p.trim().length>0,_e=(0,Z.useMemo)(()=>{if(!J)return;let e=new Set;for(let t of o)K(t)||e.add(t.instanceId);return e},[o,J,K]),X=(0,Z.useMemo)(()=>{let e=o.filter(d);if(!J)return e;let t=[],n=[];for(let r of e)K(r)?t.push(r):n.push(r);return[...t,...n]},[o,J,K]),ve=!Y&&X.length>0,be=(0,Z.useMemo)(()=>o.map(e=>e.instanceId),[o]),xe=(0,Z.useMemo)(()=>{let t=he;if(p.trim()){let n=t.map(e=>({model:e,score:rt({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName,isFavorite:W.has(r(e.instanceId,e.slug))},p),isFavorite:W.has(r(e.instanceId,e.slug)),tieBreaker:nt({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName})})).filter(e=>e.score!==null);if(e.lockedProvider!==null){let e=[];for(let t of n)K(t.model)&&e.push(t);return e.toSorted((e,t)=>{let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}).map(e=>e.model)}return n.toSorted((e,t)=>{let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}).map(e=>e.model)}return e.lockedProvider===null?t=P===`favorites`?t.filter(e=>W.has(r(e.instanceId,e.slug))):t.filter(e=>e.instanceId===P):(t=t.filter(e=>K(e)),t=P===`favorites`?t.filter(e=>W.has(r(e.instanceId,e.slug))):t.filter(e=>e.instanceId===P)),a(t,{favoriteModelKeys:W,groupFavorites:P!==`favorites`,instanceOrder:P===`favorites`?be:[]})},[W,he,be,K,e.lockedProvider,p,P]),$=(0,Z.useMemo)(()=>{if(Y||P===`favorites`)return null;let e=xe.filter(e=>!e.isLegacy),t=xe.filter(e=>e.isLegacy);return t.length===0?null:{key:Ne(P),currentModels:e,legacyModels:t,isExpanded:L.has(P)}},[L,xe,Y,P]),Se=(0,Z.useMemo)(()=>$?[...$.currentModels,...$.isExpanded?$.legacyModels:[]]:xe,[xe,$]),Ce=P===`favorites`?void 0:G.get(P),we=!Y&&e.onOpenProviderSetup?o.filter(e=>K(e)&&ot(e,n.get(e.instanceId)??[])&&(Ce?e.instanceId===Ce.instanceId:xe.length===0)):[],Te=(Y?o.filter(K):Ce?[Ce]:[]).flatMap(e=>{let t=Oe(e.snapshot,p);return t?[{instanceId:e.instanceId,notice:t}]:[]}),Ee=(0,Z.useCallback)(e=>{oe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),De=(0,Z.useCallback)((e,t,r=!1)=>{if(s?.(t,e))return;let a=n.get(t);if(!a)return;let o=G.get(t);if(!o)return;let l=i(o.driverKind,e,a);l&&(r&&f?f(t,l):c(t,l))},[G,s,n,c,f]),ke=(0,Z.useMemo)(()=>{let e=new Map,t=0;for(let n of Se){if(s?.(n.instanceId,n.slug))continue;let r=le(t);if(!r)return e;e.set(je(n.instanceId,n.slug),r),t+=1}return e},[s,Se]),Ae=(0,Z.useMemo)(()=>[...ke.keys()],[ke]),Ie=(0,Z.useMemo)(()=>[...he.map(e=>je(e.instanceId,e.slug)),...new Set(he.filter(e=>e.isLegacy).map(e=>Ne(e.instanceId)))],[he]),Le=(0,Z.useMemo)(()=>{let e=Se.map(e=>je(e.instanceId,e.slug));return $&&e.splice($.currentModels.length,0,$.key),e},[$,Se]),Re=(0,Z.useMemo)(()=>new Map(Se.map(e=>[je(e.instanceId,e.slug),e])),[Se]),[ze,Be]=(0,Z.useState)(()=>Le.length*lt),[Ve,He]=(0,Z.useState)(0);(0,Z.useLayoutEffect)(()=>S.current?.getState().listen(`totalSize`,Be),[]);let Ue=Le.length===0?0:`calc(${ze}px + var(--spacing) * 5)`,We=(0,Z.useCallback)(()=>{let e=S.current?.getScrollableNode();if(!(e instanceof HTMLElement))return;let t=Math.max(0,e.scrollHeight-e.clientHeight);g(e.scrollTop>1),v(t-e.scrollTop>1)},[]),Ge=(0,Z.useMemo)(()=>({terminalFocus:!1,terminalOpen:e.terminalOpen,modelPickerOpen:!0}),[e.terminalOpen]),qe=(0,Z.useMemo)(()=>{if(ke.size===0)return ct;let e={platform:navigator.platform,context:Ge},t=new Map;for(let[n,r]of ke){let i=ue(fe,r,e);i&&t.set(n,i)}return t.size>0?t:ct},[fe,ke,Ge]),Je=(0,Z.useMemo)(()=>({favoritesSet:W,modelJumpLabelByKey:qe,activeModelKey:k,selectedModelKeySet:j}),[W,qe,k,j]);return(0,Z.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||e.repeat||ge())return;let t=se(e,fe,{platform:navigator.platform,context:Ge});if(t===`modelPicker.previousProvider`||t===`modelPicker.nextProvider`){e.preventDefault(),e.stopPropagation();let n=st({entries:X,selectedInstanceId:P,direction:t===`modelPicker.nextProvider`?1:-1,disabledInstanceIds:_e,selectableUnavailableInstanceIds:q});m(``),U(n);return}let n=ce(t??``);if(n===null)return;e.preventDefault(),e.stopPropagation();let r=Ae[n];if(!r)return;let i=Me(r);i&&De(i.slug,i.instanceId)};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[De,U,fe,_e,Ae,Ge,q,P,X]),(0,Z.useLayoutEffect)(()=>{g(!1),v(Le.length>5);let e=0,t=window.requestAnimationFrame(()=>{We(),e=window.requestAnimationFrame(We)});return()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(e)}},[Le,We]),(0,Q.jsx)(F,{delay:0,children:(0,Q.jsxs)(`div`,{ref:C,className:`relative flex max-h-86.5 w-screen max-w-90 flex-row overflow-hidden`,style:Y?{height:Ve}:void 0,"data-model-picker-content":`true`,children:[ve&&(0,Q.jsx)(Ke,{selectedInstanceId:P,onSelectInstance:U,onFocusSearch:H,instanceEntries:X,showFavorites:!0,...q?{selectableUnavailableInstanceIds:q}:{},..._e?{disabledInstanceIds:_e,getDisabledInstanceTooltip:e=>`${e.displayName} is unavailable in this thread. Start a new thread to switch providers.`}:{}}),(0,Q.jsx)(ie,{inline:!0,items:Ie,filteredItems:Le,filter:null,autoHighlight:!0,open:!0,virtualized:!0,multiple:f!==void 0,value:f?[...j]:k,onItemHighlighted:(e,t)=>{w.current=typeof e==`string`?e:null,t.reason===`keyboard`&&t.index>=0&&S.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},onValueChange:(e,t)=>{let n=Array.isArray(e)?e.find(e=>!j.has(e))??[...j].find(t=>!e.includes(t)):e;if(typeof n!=`string`)return;let r=Pe(n);if(r){Ee(r);return}let i=Me(n);i&&De(i.slug,i.instanceId,`shiftKey`in t.event&&t.event.shiftKey===!0)},children:(0,Q.jsxs)(`div`,{className:b(`flex min-h-0 flex-1 flex-col overflow-hidden bg-muted/40`,ve&&`border-l border-border/70`),children:[(0,Q.jsx)(re,{ref:x,placeholder:`Search models...`,value:p,onChange:e=>{Y||He(C.current?.offsetHeight??0),m(e.target.value)},onKeyDown:t=>{if(ve&&!t.altKey&&!t.ctrlKey&&!t.metaKey&&(t.key===`ArrowLeft`&&!t.shiftKey&&p.length===0||t.key===`Tab`&&t.shiftKey)){let e=t.currentTarget.closest(`[data-model-picker-content]`)?.querySelector(`[data-model-picker-sidebar]`),n=e?.querySelector(`button[aria-pressed="true"]:not(:disabled)`)??e?.querySelector(`button:not(:disabled)`);if(n){t.preventDefault(),t.stopPropagation(),n.focus();return}}if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),e.onRequestClose?.();return}if(t.key===`Enter`&&w.current){t.preventBaseUIHandler?.(),t.preventDefault(),t.stopPropagation();let e=Pe(w.current);if(e){Ee(e);return}let n=Me(w.current);n&&De(n.slug,n.instanceId,t.shiftKey);return}t.stopPropagation()},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation()}),(0,Q.jsx)(`div`,{className:`relative min-h-0 overflow-hidden pr-px`,style:{height:Ue},children:(0,Q.jsx)(ee,{children:(0,Q.jsx)(ye,{ref:S,data:Le,extraData:Je,keyExtractor:e=>e,renderItem:({item:e,index:t})=>{if($?.key===e)return(0,Q.jsxs)(ne,{hideIndicator:!0,index:t,value:e,"aria-expanded":$.isExpanded,className:`group w-full cursor-pointer`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium leading-snug`,children:`Legacy models`}),(0,Q.jsxs)(`div`,{className:`mt-1 text-xs font-normal leading-snug text-muted-foreground/70`,children:[$.legacyModels.length,` models`]})]}),(0,Q.jsx)(D,{className:b(`size-4 transition-transform`,$.isExpanded&&`rotate-90`)})]});let n=Re.get(e);if(!n)return null;let i=s?.(n.instanceId,n.slug)??null;return(0,Q.jsx)(Fe,{index:t,model:n,instanceId:n.instanceId,driverKind:n.driverKind,providerDisplayName:n.instanceDisplayName,providerAccentColor:n.instanceAccentColor,acpRegistryAgentId:n.acpRegistryAgentId,acpRegistryIconUrl:n.acpRegistryIconUrl,isFavorite:W.has(r(n.instanceId,n.slug)),isSelected:A===void 0?e===k:j.has(e),showSelection:A!==void 0,showProvider:!0,preferShortName:!J,useTriggerLabel:!1,showNewBadge:n.badge===`new`,unavailable:n.isUnavailable===!0,jumpLabel:qe.get(e)??null,disabledReason:i,onToggleFavorite:()=>me(n.instanceId,n.slug)},e)},estimatedItemSize:lt,drawDistance:480,recycleItems:!0,contentContainerClassName:`pl-2 pr-px`,ItemSeparatorComponent:ut,onLayout:We,onScroll:We,className:b(`scrollbar-gutter-stable h-full overflow-x-hidden overscroll-y-contain py-1.5 [&::-webkit-scrollbar-track]:my-2`,ae({top:h,bottom:_}))})})}),we.length>0?(0,Q.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-y-auto border-t border-border/70 p-2`,children:we.map(t=>(0,Q.jsxs)(`div`,{className:`px-1 py-1.5 text-xs leading-snug`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-3 text-muted-foreground`,children:Ze(t.snapshot)}),(0,Q.jsx)(y,{className:`mt-1`,onClick:()=>{e.onRequestClose?.(),e.onOpenProviderSetup?.(t.instanceId)},children:we.length>1?`Set up ${t.displayName}`:`Open provider setup`})]},t.instanceId))}):(0,Q.jsx)(te,{className:`empty:h-0`,children:`No models found`}),Te.map(({instanceId:t,notice:n})=>(0,Q.jsxs)(`p`,{className:`shrink-0 border-t border-border/70 px-3 py-2 text-xs leading-snug text-muted-foreground`,children:[n,` `,(0,Q.jsx)(y,{onClick:()=>{e.onRequestClose?.(),pe({to:`/settings/providers`})},children:`Provider settings`})]},t))]})})]})})});function ft(e){let t=(0,be.c)(1),{provider:n}=e;if(!Y(n))return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t px-3 py-2`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(de,{className:`size-3.5`,"aria-hidden":`true`}),`Using ChatGPT plan`]}),(0,Q.jsx)(J,{size:`xs`})]}),t[0]=r):r=t[0],r}var pt=(0,Z.memo)(function(e){let t=(0,be.c)(119),n=v(),[r,i]=(0,Z.useState)(!1),a=e.open??r,o=e.size??`sm`,[c,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(null),d=(0,Z.useRef)(!!e.renderSettings),m;t[0]!==a||t[1]!==e?(m=()=>{let t=d.current&&!e.renderSettings;d.current=!!e.renderSettings,a&&t&&(l(!1),e.onOpenChange?.(!1),e.open===void 0&&i(!1))},t[0]=a,t[1]=e,t[2]=m):m=t[2];let h;t[3]!==a||t[4]!==e.onOpenChange||t[5]!==e.open||t[6]!==e.renderSettings?(h=[a,e.renderSettings,e.onOpenChange,e.open],t[3]=a,t[4]=e.onOpenChange,t[5]=e.open,t[6]=e.renderSettings,t[7]=h):h=t[7],(0,Z.useLayoutEffect)(m,h);let g,y;t[8]!==a||t[9]!==c?(g=()=>{a&&!c&&u.current?.querySelector(`[data-composer-model-settings] button:not(:disabled)`)?.focus({preventScroll:!0})},y=[a,c],t[8]=a,t[9]=c,t[10]=g,t[11]=y):(g=t[10],y=t[11]),(0,Z.useLayoutEffect)(g,y);let x;t[12]!==e.activeInstanceId||t[13]!==e.instanceEntries?(x=e.instanceEntries.find(t=>t.instanceId===e.activeInstanceId)??null,t[12]=e.activeInstanceId,t[13]=e.instanceEntries,t[14]=x):x=t[14];let C=x,w=e.activeInstanceId,T,E;if(t[15]!==C?.driverKind||t[16]!==w||t[17]!==e.model||t[18]!==e.modelOptionsByInstance){let n=e.modelOptionsByInstance.get(w)??[];T=it({driverKind:C?.driverKind,model:e.model,options:n})??(C?.driverKind===`opencode`||C?.driverKind===`antigravity`?void 0:n[0]),E=T?we(T):e.model===`antigravity-default`?`Choose model`:e.model||`Choose model`,t[15]=C?.driverKind,t[16]=w,t[17]=e.model,t[18]=e.modelOptionsByInstance,t[19]=T,t[20]=E}else T=t[19],E=t[20];let D=E,O;t[21]!==C||t[22]!==e.instanceEntries?(O=C!==null&&f(C,e.instanceEntries),t[21]=C,t[22]=e.instanceEntries,t[23]=O):O=t[23];let k=O,A;t[24]===e?A=t[25]:(A=t=>{t||l(!1),e.onOpenChange?.(t),e.open===void 0&&i(t)},t[24]=e,t[25]=A);let j=A,N,P;t[26]===a?(N=t[27],P=t[28]):(N=()=>{if(!a)return;let{documentElement:e,body:t}=document,n=e.style.overscrollBehavior,r=t.style.overflow,i=t.style.paddingRight,o=window.innerWidth-e.clientWidth;e.style.overscrollBehavior=`contain`,t.style.overflow=`hidden`,o>0&&(t.style.paddingRight=`${o}px`);let s=mt,c=e=>{s(e.target)||e.preventDefault()},l=e=>{s(e.target)||e.preventDefault()};return document.addEventListener(`wheel`,c,{capture:!0,passive:!1}),document.addEventListener(`touchmove`,l,{capture:!0,passive:!1}),()=>{document.removeEventListener(`wheel`,c,{capture:!0}),document.removeEventListener(`touchmove`,l,{capture:!0}),e.style.overscrollBehavior=n,t.style.overflow=r,t.style.paddingRight=i}},P=[a],t[26]=a,t[27]=N,t[28]=P),(0,Z.useEffect)(N,P);let F;t[29]!==e||t[30]!==j?(F=(t,n)=>{e.disabled||(e.onInstanceModelChange(t,n),e.renderSettings?l(!1):j(!1))},t[29]=e,t[30]=j,t[31]=F):F=t[31];let I=F,L,R,z,B,V,ee,te,ne,re;if(t[32]!==C||t[33]!==a||t[34]!==e.activeProviderIconClassName||t[35]!==e.compact||t[36]!==e.disabled||t[37]!==e.fastMode||t[38]!==e.instanceEntries||t[39]!==e.instanceIndicatorBackground||t[40]!==e.isComposerOwned||t[41]!==e.modelOptionsByInstance||t[42]!==e.renderSettings||t[43]!==e.selectedModels||t[44]!==e.triggerAriaLabel||t[45]!==e.triggerClassName||t[46]!==e.triggerLabel||t[47]!==j||t[48]!==k||t[49]!==o){B=e.selectedModels?.map(t=>{let n=e.instanceEntries.find(e=>e.instanceId===t.instanceId),r=it({driverKind:n?.driverKind,model:t.model,options:e.modelOptionsByInstance.get(t.instanceId)??[]});return{...t,entry:n,label:r?`${we(r)}${r.isUnavailable?` (Unavailable)`:``}`:t.model}}),z=B?B.length===0?`Choose models`:`${B.slice(0,2).map(ht).join(`, `)}${B.length>2?`, ${B.length-2} more`:``}`:void 0;let n=B?B.map(gt).join(`, `)||`Choose models`:void 0;R=me,ne=a,t[59]!==e.disabled||t[60]!==j?(re=t=>{if(e.disabled){j(!1);return}j(t)},t[59]=e.disabled,t[60]=j,t[61]=re):re=t[61],L=pe;let r=e.compact?`max-w-42 shrink-0`:!e.isComposerOwned&&`max-w-48 sm:max-w-56`,i;t[62]!==e.triggerClassName||t[63]!==r?(i=b(`min-w-0 shrink justify-between whitespace-nowrap`,r,e.triggerClassName),t[62]=e.triggerClassName,t[63]=r,t[64]=i):i=t[64],te=(0,Q.jsx)(S,{"aria-label":e.triggerAriaLabel??n,size:o,"data-chat-provider-model-picker":`true`,"data-composer-shortcut":e.renderSettings?`composer.effort`:void 0,className:i,disabled:e.disabled});let s=o===`xs`?`gap-1`:`gap-1.5`;t[65]===s?V=t[66]:(V=b(`flex min-w-0 flex-1 items-center`,s),t[65]=s,t[66]=V),ee=e.isComposerOwned?e.fastMode?(0,Q.jsx)(M,{"aria-hidden":!0,className:`size-4 fill-current text-foreground`}):null:B&&e.triggerLabel===void 0?(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center -space-x-1`,"aria-hidden":`true`,children:[B.slice(0,3).map(_t),B.length>3?(0,Q.jsxs)(`span`,{className:`relative z-30 flex size-4 items-center justify-center rounded-full bg-(--chat-composer-glass-surface,var(--background)) text-3xs ring-2 ring-(--chat-composer-glass-surface,var(--background))`,children:[`+`,B.length-3]}):null]}):C&&e.triggerLabel===void 0?(0,Q.jsx)(he,{driverKind:C.driverKind,displayName:C.displayName,accentColor:C.accentColor,acpRegistryAgentId:C.acpRegistryAgentId,acpRegistryIconUrl:C.acpRegistryIconUrl,showBadge:k,className:`size-4`,iconClassName:b(`size-4`,e.activeProviderIconClassName),indicatorBackground:e.instanceIndicatorBackground??`var(--contrast-input)`,badgeClassName:b(`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs`,o===`xs`&&`shadow-none`)}):null,t[32]=C,t[33]=a,t[34]=e.activeProviderIconClassName,t[35]=e.compact,t[36]=e.disabled,t[37]=e.fastMode,t[38]=e.instanceEntries,t[39]=e.instanceIndicatorBackground,t[40]=e.isComposerOwned,t[41]=e.modelOptionsByInstance,t[42]=e.renderSettings,t[43]=e.selectedModels,t[44]=e.triggerAriaLabel,t[45]=e.triggerClassName,t[46]=e.triggerLabel,t[47]=j,t[48]=k,t[49]=o,t[50]=L,t[51]=R,t[52]=z,t[53]=B,t[54]=V,t[55]=ee,t[56]=te,t[57]=ne,t[58]=re}else L=t[50],R=t[51],z=t[52],B=t[53],V=t[54],ee=t[55],te=t[56],ne=t[57],re=t[58];let ie=e.triggerLabel??z??D,ae;t[67]===ie?ae=t[68]:(ae=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,"data-chat-provider-model-picker-label":`true`,children:ie}),t[67]=ie,t[68]=ae);let se;t[69]===e.settingsLabel?se=t[70]:(se=e.settingsLabel?(0,Q.jsx)(`span`,{className:`shrink-0 font-normal text-muted-foreground`,children:e.settingsLabel}):null,t[69]=e.settingsLabel,t[70]=se);let ce;t[71]!==e.triggerLabel||t[72]!==B||t[73]!==T?.isUnavailable?(ce=T?.isUnavailable&&!B&&e.triggerLabel===void 0?(0,Q.jsx)(s,{variant:`outline`,size:`sm`,children:`Unavailable`}):null,t[71]=e.triggerLabel,t[72]=B,t[73]=T?.isUnavailable,t[74]=ce):ce=t[74];let le;t[75]!==V||t[76]!==ee||t[77]!==ae||t[78]!==se||t[79]!==ce?(le=(0,Q.jsxs)(`span`,{className:V,children:[ee,ae,se,ce]}),t[75]=V,t[76]=ee,t[77]=ae,t[78]=se,t[79]=ce,t[80]=le):le=t[80];let ue;t[81]===o?ue=t[82]:(ue=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,Q.jsx)(p,{size:o})}),t[81]=o,t[82]=ue);let de;t[83]!==L||t[84]!==te||t[85]!==le||t[86]!==ue?(de=(0,Q.jsxs)(L,{render:te,children:[le,ue]}),t[83]=L,t[84]=te,t[85]=le,t[86]=ue,t[87]=de):de=t[87];let H;t[88]!==n||t[89]!==e.isComposerOwned?(H=e.isComposerOwned?n:{},t[88]=n,t[89]=e.isComposerOwned,t[90]=H):H=t[90];let U;t[91]!==e.renderSettings||t[92]!==c?(U=e.renderSettings?{width:c?360:288}:void 0,t[91]=e.renderSettings,t[92]=c,t[93]=U):U=t[93];let W=c?`models`:`settings`,G=e.renderSettings?c?`composer-models-enter`:`composer-effort-enter`:void 0,K;t[94]!==C?.snapshot||t[95]!==w||t[96]!==I||t[97]!==z||t[98]!==e||t[99]!==j||t[100]!==c||t[101]!==D?(K=e.renderSettings&&!c?e.renderSettings(z??D,()=>l(!0)):(0,Q.jsxs)(Q.Fragment,{children:[e.renderSettings?(0,Q.jsx)(`div`,{className:`px-2 pt-2`,children:(0,Q.jsxs)(_,{variant:`ghost-muted`,size:`sm`,onClick:()=>l(!1),children:[(0,Q.jsx)(ve,{}),` Model settings`]})}):null,(0,Q.jsx)(dt,{environmentId:e.environmentId,activeInstanceId:w,model:e.model,...e.selectedModels===void 0?{}:{selectedModels:e.selectedModels},...e.onToggleModel?{onToggleModel:(t,n)=>{e.disabled||e.onToggleModel?.(t,n)}}:{},lockedProvider:e.lockedProvider,lockedContinuationGroupKey:e.lockedContinuationGroupKey??null,instanceEntries:e.instanceEntries,...e.keybindings?{keybindings:e.keybindings}:{},modelOptionsByInstance:e.modelOptionsByInstance,terminalOpen:e.terminalOpen??!1,onRequestClose:()=>j(!1),...e.onOpenProviderSetup?{onOpenProviderSetup:e.onOpenProviderSetup}:{},...e.getModelDisabledReason?{getModelDisabledReason:e.getModelDisabledReason}:{},onInstanceModelChange:I}),e.selectedModels===void 0?(0,Q.jsx)(ft,{provider:C?.snapshot??null}):null]}),t[94]=C?.snapshot,t[95]=w,t[96]=I,t[97]=z,t[98]=e,t[99]=j,t[100]=c,t[101]=D,t[102]=K):K=t[102];let q;t[103]!==W||t[104]!==G||t[105]!==K?(q=(0,Q.jsx)(oe,{children:(0,Q.jsx)(`div`,{className:G,children:K},W)}),t[103]=W,t[104]=G,t[105]=K,t[106]=q):q=t[106];let J;t[107]!==U||t[108]!==q?(J=(0,Q.jsx)(`div`,{ref:u,className:`max-w-[calc(100vw-2rem)] transition-[width] duration-200 ease-out motion-reduce:transition-none`,style:U,children:q}),t[107]=U,t[108]=q,t[109]=J):J=t[109];let Y;t[110]!==H||t[111]!==J?(Y=(0,Q.jsx)(fe,{...H,align:`start`,className:`before:hidden`,padding:`none`,children:J}),t[110]=H,t[111]=J,t[112]=Y):Y=t[112];let ge;return t[113]!==R||t[114]!==ne||t[115]!==re||t[116]!==de||t[117]!==Y?(ge=(0,Q.jsxs)(R,{open:ne,onOpenChange:re,children:[de,Y]}),t[113]=R,t[114]=ne,t[115]=re,t[116]=de,t[117]=Y,t[118]=ge):ge=t[118],ge});function mt(e){return e instanceof Element&&e.closest(`[data-model-picker-content]`)}function ht(e){return e.label}function gt(e){return e.label}function _t(e){return e.entry?(0,Q.jsx)(he,{driverKind:e.entry.driverKind,displayName:e.entry.displayName,accentColor:e.entry.accentColor,className:`size-4 rounded-full bg-(--chat-composer-glass-surface,var(--background)) ring-2 ring-(--chat-composer-glass-surface,var(--background))`,iconClassName:`size-4`},`${e.instanceId}:${e.model}`):null}export{Xe as a,Je as i,it as n,Ye as o,Qe as r,we as s,pt as t};
|
|
2
|
-
//# sourceMappingURL=ProviderModelPicker-lxEwYGAB.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{ma as n,or as r,t as i,wx as a}from"./utils-Nv21__t3.js";import{t as o}from"./mouse-pointer-2-DbBU41il.js";import{t as s}from"./paintbrush-D1BKpWrm.js";import{t as c}from"./plus-Cr075-cy.js";import{t as l}from"./x-CSwbgjBe.js";import{a as u,c as d,n as f,t as p,u as m}from"./tooltip-CYNXW1Ow.js";import{A as h,E as g,G as _,H as v,O as y,S as b,U as ee,W as x,_ as te,d as S,et as ne,g as C,m as w,s as T,u as E,y as D}from"./themePalette-CxbxrCEH.js";import{n as O,t as k}from"./toggle-group-B1ghB_yR.js";import{t as re}from"./input-CN9xdIYL.js";import{i as A,o as j,t as M}from"./popover-aTTlR6NX.js";import{i as N,n as P,r as F,t as I}from"./color-picker-BWffD8SG.js";import{Oa as L}from"./main-CJvawsJJ.js";var R=m(),ie=a(),z=e(t(),1),B=e(n(),1);function ae(e){return{canvas:`Background`,toolbar:`Toolbar background`,toolbarForeground:`Toolbar text`,toolbarBorder:`Toolbar border`,toolbarControl:`Toolbar control`,toolbarControlForeground:`Toolbar control text`,toolbarControlHover:`Toolbar control hover`,accent:`Accent color`,errorForeground:`Error text`,errorSurface:`Error background`,warningForeground:`Warning text`,warningSurface:`Warning background`,updateForeground:`Update text`,updateSurface:`Update background`}[e]||e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}function V(e){let t=v(e)??``,n=t.length===9?t.slice(7):``;return n===`ff`?``:n}function oe(e){return(v(e)??`#000000`).slice(0,7)}function se(e){let t=Number.parseInt(oe(e).slice(1),16);return[t>>16,t>>8&255,t&255]}function ce(e){let t=e.trim().replace(/^rgb\(\s*/i,``).replace(/\s*\)$/,``).split(/[,\s]+/).filter(Boolean).map(Number);return t.length!==3||t.some(e=>!Number.isInteger(e)||e<0||e>255)?null:`#${t.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function H(e){return se(e).join(`, `)}function U({label:e,value:t,onChange:n}){let r=oe(t),i=V(t),[a,o]=(0,z.useState)(()=>F(r)),[s,c]=(0,z.useState)(r),[l,u]=(0,z.useState)(()=>H(r)),d=(0,z.useRef)(!1),f=N(a.h,a.s,a.v),p=H(f);(0,z.useEffect)(()=>{d.current||(c(r),u(H(r))),o(e=>N(e.h,e.s,e.v)===r?e:F(r))},[r]);let m=(0,z.useRef)(n);m.current=n;let h=(0,z.useRef)(null),g=(0,z.useRef)(null),_=(0,z.useCallback)(()=>{g.current!==null&&(cancelAnimationFrame(g.current),g.current=null);let e=h.current;h.current=null,e!==null&&m.current(e)},[]);(0,z.useEffect)(()=>()=>_(),[_]);let v=(0,z.useCallback)(e=>{h.current=e,g.current??=requestAnimationFrame(()=>{g.current=null;let e=h.current;h.current=null,e!==null&&m.current(e)})},[]),y=(0,z.useCallback)(e=>{o(e);let t=N(e.h,e.s,e.v);c(t),u(H(t)),v(t+i)},[i,v]),b=e=>{if(c(e),!/^#[0-9a-f]{6}$/i.test(e))return;let t=F(e);o(t),u(H(e)),n(e.toLowerCase())},ee=e=>{u(e);let t=ce(e);t&&(o(F(t)),c(t),n(t+i))};return(0,B.jsxs)(`div`,{className:`w-72 bg-popover`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`truncate text-xs font-semibold text-foreground`,children:e}),(0,B.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Choose a color`})]}),(0,B.jsx)(`span`,{className:`size-7 shrink-0 rounded-full shadow-sm`,style:{backgroundColor:f}})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 px-3 pb-3 pt-3`,children:[(0,B.jsx)(P,{label:e,value:a,onChange:y,onInteractionEnd:_}),(0,B.jsx)(I,{label:`${e} hue`,value:a.h,onChange:e=>y({...a,h:e}),onInteractionEnd:_}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[1fr_1.2fr] gap-2`,children:[(0,B.jsxs)(`label`,{className:`grid min-w-0 gap-1`,children:[(0,B.jsx)(`span`,{className:`px-1 text-3xs font-semibold uppercase tracking-widest text-muted-foreground`,children:`HEX`}),(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 rounded-lg border border-input bg-background px-2 focus-within:border-ring`,children:[(0,B.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-full`,style:{backgroundColor:f}}),(0,B.jsx)(`input`,{"aria-label":`${e} picker hex value`,className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-xs text-foreground outline-none`,onBlur:()=>{d.current=!1,c(f),u(p)},onChange:e=>b(e.currentTarget.value),onFocus:()=>{d.current=!0},spellCheck:!1,value:s})]})]}),(0,B.jsxs)(`label`,{className:`grid min-w-0 gap-1`,children:[(0,B.jsx)(`span`,{className:`px-1 text-3xs font-semibold uppercase tracking-widest text-muted-foreground`,children:`RGB`}),(0,B.jsx)(`span`,{className:`flex min-w-0 items-center rounded-lg border border-input bg-background px-2 focus-within:border-ring`,children:(0,B.jsx)(`input`,{"aria-label":`${e} picker RGB value`,className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-xs text-foreground outline-none`,onBlur:()=>{d.current=!1,c(f),u(p)},onChange:e=>ee(e.currentTarget.value),onFocus:()=>{d.current=!0},spellCheck:!1,value:l})})]})]})]})]})}function le(e){let t=(0,ie.c)(13),{label:n,value:r,onChange:i,onInteract:a}=e,o=`Choose ${n} color`,s;t[0]===r?s=t[1]:(s=(0,B.jsx)(`span`,{className:`absolute inset-0 rounded-full shadow-sm`,style:{backgroundColor:r}}),t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==o||t[4]!==s?(c=(0,B.jsx)(j,{render:(0,B.jsx)(`button`,{"aria-label":o,className:`relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-foreground/30 transition-transform hover:scale-105 focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring`,onFocus:a,onPointerDown:a,type:`button`,children:s})}),t[2]=a,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==n||t[7]!==i||t[8]!==r?(l=(0,B.jsx)(A,{align:`end`,padding:`none`,"data-theme-editor-panel":``,side:`bottom`,sideOffset:10,children:(0,B.jsx)(U,{label:n,onChange:i,value:r})}),t[6]=n,t[7]=i,t[8]=r,t[9]=l):l=t[9];let u;return t[10]!==c||t[11]!==l?(u=(0,B.jsxs)(M,{children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u}var ue=(0,z.memo)(function(e){let t=(0,ie.c)(58),{role:n,value:r,onChange:a,onSelect:o,onToggleSelected:s,selected:c,label:l}=e,d=c!==void 0&&c,m;t[0]!==l||t[1]!==n?(m=l??ae(n),t[0]=l,t[1]=n,t[2]=m):m=t[2];let h=m,_;t[3]===r?_=t[4]:(_=g(r),t[3]=r,t[4]=_);let y=_,b=y?r:`#000000`,ee;t[5]===r?ee=t[6]:(ee=r.trim().toLowerCase().startsWith(`oklch(`)?v(r)??r:r,t[5]=r,t[6]=ee);let x=ee,te=d&&`bg-accent/60 inset-ring inset-ring-ring`,S;t[7]===te?S=t[8]:(S=i(`flex min-h-11 min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 transition-[background-color,box-shadow]`,te),t[7]=te,t[8]=S);let ne=`${d?`Hide`:`Show`} ${h} usage`,C;t[9]!==s||t[10]!==n?(C=()=>s?.(n),t[9]=s,t[10]=n,t[11]=C):C=t[11];let w;t[12]===h?w=t[13]:(w=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:h}),t[12]=h,t[13]=w);let T;t[14]!==d||t[15]!==ne||t[16]!==C||t[17]!==w?(T=(0,B.jsx)(u,{render:(0,B.jsx)(`button`,{"aria-label":ne,"aria-pressed":d,className:`flex min-w-0 flex-1 cursor-pointer items-center rounded-md text-left text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:C,type:`button`,children:w})}),t[14]=d,t[15]=ne,t[16]=C,t[17]=w,t[18]=T):T=t[18];let E=`${d?`Hide`:`Show`} where ${h} is used`,D;t[19]===E?D=t[20]:(D=(0,B.jsx)(f,{side:`top`,children:E}),t[19]=E,t[20]=D);let O;t[21]!==T||t[22]!==D?(O=(0,B.jsxs)(p,{children:[T,D]}),t[21]=T,t[22]=D,t[23]=O):O=t[23];let k;t[24]!==a||t[25]!==n?(k=e=>a(n,e),t[24]=a,t[25]=n,t[26]=k):k=t[26];let A;t[27]!==o||t[28]!==n?(A=()=>o?.(n),t[27]=o,t[28]=n,t[29]=A):A=t[29];let j;t[30]!==h||t[31]!==b||t[32]!==k||t[33]!==A?(j=(0,B.jsx)(le,{label:h,onChange:k,onInteract:A,value:b}),t[30]=h,t[31]=b,t[32]=k,t[33]=A,t[34]=j):j=t[34];let M=!y,N=`${h} hex value`,P=`${n}-hex`,F;t[35]!==a||t[36]!==n?(F=e=>a(n,e.currentTarget.value),t[35]=a,t[36]=n,t[37]=F):F=t[37];let I,L;t[38]!==o||t[39]!==n?(I=()=>o?.(n),L=()=>o?.(n),t[38]=o,t[39]=n,t[40]=I,t[41]=L):(I=t[40],L=t[41]);let R;t[42]!==x||t[43]!==M||t[44]!==N||t[45]!==P||t[46]!==F||t[47]!==I||t[48]!==L?(R=(0,B.jsx)(re,{"aria-invalid":M,"aria-label":N,className:`w-28 shrink-0`,font:`mono`,id:P,nativeInput:!0,onChange:F,onFocus:I,onPointerDown:L,size:`compact`,value:x}),t[42]=x,t[43]=M,t[44]=N,t[45]=P,t[46]=F,t[47]=I,t[48]=L,t[49]=R):R=t[49];let z;t[50]!==j||t[51]!==R?(z=(0,B.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[j,R]}),t[50]=j,t[51]=R,t[52]=z):z=t[52];let V;return t[53]!==n||t[54]!==O||t[55]!==z||t[56]!==S?(V=(0,B.jsxs)(`div`,{className:S,"data-theme-color-role":n,children:[O,z]}),t[53]=n,t[54]=O,t[55]=z,t[56]=S,t[57]=V):V=t[57],V}),de=[`background`,`border`,`foreground`],W=`data-theme-inspector-match`,G=`data-theme-token-probe`,K=`#01fea7`,q=`#fe01a7`,J=`theme-inspector-spotlight`,fe=`theme-inspector-spotlight-mask`,pe=`theme-inspector-spotlight-glow`,Y=`theme-inspector-hover`,me=`http://www.w3.org/2000/svg`,he={background:`canvas`,foreground:`text`,card:`surface`,"card-foreground":`text`,popover:`surfaceOverlay`,"popover-foreground":`text`,"surface-raised":`surfaceRaised`,primary:`messageAction`,"primary-foreground":`messageActionForeground`,secondary:`secondary`,"secondary-foreground":`secondaryForeground`,muted:`muted`,"muted-foreground":`mutedForeground`,placeholder:`placeholder`,"secondary-label":`secondaryLabel`,"icon-muted":`iconMuted`,accent:`accentSurface`,"accent-foreground":`accentSurfaceForeground`,destructive:`error`,"destructive-foreground":`errorForeground`,error:`error`,"error-foreground":`errorForeground`,"error-surface":`errorSurface`,warning:`warning`,"warning-foreground":`warningForeground`,"warning-surface":`warningSurface`,update:`update`,"update-foreground":`updateForeground`,"update-surface":`updateSurface`,message:`messageSurface`,"message-foreground":`messageForeground`,"message-action":`messageAction`,"message-action-foreground":`messageActionForeground`,"message-action-hover":`messageActionHover`,sidebar:`sidebar`,"sidebar-foreground":`sidebarForeground`,"sidebar-muted-foreground":`sidebarMutedForeground`,"sidebar-control-surface":`sidebarControlSurface`,"sidebar-row-hover":`sidebarRowHover`,"sidebar-row-active":`sidebarRowActive`,"sidebar-row-selected":`sidebarRowSelected`,"sidebar-border":`sidebarBorder`,border:`border`,input:`input`,ring:`focus`},ge={background:[`bg-`],border:[`border-`,`outline-`,`ring-`],foreground:[`text-`,`caret-`,`fill-`,`stroke-`]};function X(e){document.querySelectorAll(`[${e}]`).forEach(t=>t.removeAttribute(e))}function _e(){X(W),document.getElementById(J)?.remove()}function ve(){document.getElementById(Y)?.remove()}function Z(e){return document.createElementNS(me,e)}function ye(e){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0||t.right<0||t.bottom<0||t.left>window.innerWidth||t.top>window.innerHeight)return null;let n=t.left-5,r=t.top-5,i=Number.parseFloat(window.getComputedStyle(e).borderTopLeftRadius)||0;return{x:n,y:r,width:t.width+10,height:t.height+10,radius:Math.min(18,Math.max(7,i+5))}}function be(e,t){let n=ye(e.element);if(!n){ve();return}let r=document.getElementById(Y);if(!r){r=document.createElement(`div`),r.id=Y,r.setAttribute(`aria-hidden`,`true`);let e=document.createElement(`span`);e.dataset.themeInspectorHoverLabel=``,r.append(e),document.body.append(r)}r.style.left=`${n.x}px`,r.style.top=`${n.y}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,r.style.borderRadius=`${n.radius}px`,r.dataset.placement=n.y<32?`below`:`above`;let i=r.querySelector(`[data-theme-inspector-hover-label]`);i&&(i.textContent=t)}function xe(e){let t=new Map;for(let n of e){let e=ye(n);if(!e)continue;let r=[e.x,e.y,e.width,e.height].map(e=>Math.round(e)).join(`:`);t.set(r,e)}if(t.size===0){document.getElementById(J)?.remove();return}let n=document.getElementById(J);n||(n=Z(`svg`),n.id=J,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`focusable`,`false`),document.body.append(n)),n.setAttribute(`viewBox`,`0 0 ${window.innerWidth} ${window.innerHeight}`);let r=Z(`defs`),i=Z(`mask`);i.id=fe,i.setAttribute(`maskUnits`,`userSpaceOnUse`);let a=Z(`rect`);a.setAttribute(`width`,String(window.innerWidth)),a.setAttribute(`height`,String(window.innerHeight)),a.setAttribute(`fill`,`white`),i.append(a);let o=Z(`filter`);o.id=pe,o.setAttribute(`x`,`-50%`),o.setAttribute(`y`,`-50%`),o.setAttribute(`width`,`200%`),o.setAttribute(`height`,`200%`);let s=Z(`feGaussianBlur`);s.setAttribute(`stdDeviation`,`5`),s.setAttribute(`result`,`blur`);let c=Z(`feMerge`),l=Z(`feMergeNode`);l.setAttribute(`in`,`blur`);let u=Z(`feMergeNode`);u.setAttribute(`in`,`SourceGraphic`),c.append(l,u),o.append(s,c),r.append(i,o);let d=Z(`g`);for(let e of t.values()){let t=Z(`rect`);t.setAttribute(`x`,String(e.x)),t.setAttribute(`y`,String(e.y)),t.setAttribute(`width`,String(e.width)),t.setAttribute(`height`,String(e.height)),t.setAttribute(`rx`,String(e.radius)),t.setAttribute(`fill`,`black`),i.append(t);let n=t.cloneNode(!1);n.removeAttribute(`fill`),n.setAttribute(`class`,`theme-inspector-spotlight-glow`),n.setAttribute(`filter`,`url(#${pe})`),d.append(n)}let f=Z(`rect`);f.setAttribute(`class`,`theme-inspector-spotlight-dimmer`),f.setAttribute(`width`,String(window.innerWidth)),f.setAttribute(`height`,String(window.innerHeight)),f.setAttribute(`mask`,`url(#${fe})`),n.replaceChildren(r,f,d)}function Se(){xe([...document.querySelectorAll(`[${W}]`)])}function Ce(e){return e.matches(`input, textarea, select, option`)?!0:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&!!e.textContent?.trim())}function Q(e,{forHitTest:t=!1}={}){let n=window.getComputedStyle(e);if(n.display===`none`||n.visibility===`hidden`||Number(n.opacity)===0)return null;let r=[];for(let[e,t,i]of[[n.borderTopColor,n.borderTopStyle,n.borderTopWidth],[n.borderRightColor,n.borderRightStyle,n.borderRightWidth],[n.borderBottomColor,n.borderBottomStyle,n.borderBottomWidth],[n.borderLeftColor,n.borderLeftStyle,n.borderLeftWidth]])t!==`none`&&Number.parseFloat(i)>0&&r.push(e);n.outlineStyle!==`none`&&Number.parseFloat(n.outlineWidth)>0&&r.push(n.outlineColor),n.borderImageSource!==`none`&&r.push(n.borderImageSource),n.boxShadow!==`none`&&r.push(n.boxShadow);let i=[];return(t||Ce(e))&&i.push(n.color),e instanceof SVGElement&&i.push(n.fill,n.stroke),e.matches(`input, textarea`)&&i.push(n.caretColor),n.textDecorationLine!==`none`&&i.push(n.textDecorationColor),n.textShadow!==`none`&&i.push(n.textShadow),{background:[n.backgroundColor,n.backgroundImage].join(`
|
|
2
|
-
`),border:r.join(`
|
|
3
|
-
`),foreground:i.join(`
|
|
4
|
-
`)}}function we(e,t){return de.filter(n=>e[n]!==t[n])}function Te(e){let t=document.documentElement,n=t.hasAttribute(G);n||t.setAttribute(G,``);try{return e()}finally{window.getComputedStyle(t).color,n||t.removeAttribute(G)}}function $(e){let t=document.documentElement,n=C(e),r=t.style.getPropertyValue(n),i=t.style.getPropertyPriority(n),a=r.trim().toLowerCase()===K?q:K;return t.style.setProperty(n,a,`important`),()=>{r?t.style.setProperty(n,r,i):t.style.removeProperty(n)}}function Ee(e){let t=e.map($);return()=>{for(let e of t.toReversed())e()}}function De(){return[document.body,...document.body.querySelectorAll(`*`)].filter(e=>!e.closest(`[data-theme-editor-panel]`)&&!e.closest(`#${J}, #${Y}`))}function Oe(e,t){if(e.includes(`:`))return null;for(let n of ge[t])if(e.startsWith(n))return he[e.slice(n.length).split(`/`,1)[0]??``]??null;return null}function ke(e){for(let t of de)for(let n of e.classList){let e=Oe(n,t);if(e)return e}return null}function Ae(e){let t=[],n=e;for(;n&&n!==document.documentElement;)n.closest(`[data-theme-editor-panel]`)||t.push(n),n=n.parentElement;return t}function je(e){if(e.closest(`[data-theme-editor-panel]`))return null;for(let t of Ae(e)){let e=ke(t);if(e)return{element:t,role:e}}return null}function Me(e){performance.now(),X(W);let t=De(),n=performance.now(),r=Te(()=>{let n=new Map;for(let e of t){let t=Q(e);t&&n.set(e,t)}let r=Ee(e),i=new Set;try{for(let[e,t]of n){let n=Q(e);n&&we(t,n).length>0&&i.add(e)}}finally{r()}return i});performance.now()-n;let i=new Set;for(let e of r)i.add(e instanceof SVGElement?e.closest(`svg`)??e:e);for(let e of i)e.setAttribute(W,``);return xe([...i]),i.size}function Ne(e){if(e.closest(`[data-theme-editor-panel]`))return null;let t=Ae(e),n=je(e);if(n)return n;let r=Te(()=>{let e=new Map,n=new Map;for(let n of t){let t=Q(n,{forHitTest:!0});t&&e.set(n,t)}for(let t of ne){let r=$(t);try{for(let[r,i]of e){let e=Q(r,{forHitTest:!0});if(!e)continue;let a=n.get(r)??{};for(let n of we(i,e))a[n]??=t;n.set(r,a)}}finally{r()}}return n});for(let e of t){let t=r.get(e);if(t)for(let n of de){let r=t[n];if(r)return{element:e,role:r}}}return null}var Pe=[`canvas`,`accent`],Fe=[{id:`foundation`,title:`Foundation`,families:[{id:`background`,label:`Background`,role:`canvas`,roles:[`canvas`,`chrome`,`toolbar`]},{id:`surface`,label:`Surface`,role:`surface`,roles:[`surface`]},{id:`raised-surface`,label:`Raised surface`,role:`surfaceRaised`,roles:[`surfaceRaised`]},{id:`overlay`,label:`Overlay`,role:`surfaceOverlay`,roles:[`surfaceOverlay`]},{id:`text`,label:`Text`,role:`text`,roles:[`text`,`toolbarForeground`,`toolbarControlForeground`]},{id:`muted-text`,label:`Muted text`,role:`mutedForeground`,roles:[`textMuted`,`mutedForeground`,`placeholder`,`secondaryLabel`,`iconMuted`,`sidebarMutedForeground`]},{id:`border`,label:`Border`,role:`border`,roles:[`border`,`toolbarBorder`,`sidebarBorder`]},{id:`input`,label:`Input`,role:`input`,roles:[`input`]}]},{id:`brand-content`,title:`Brand & content`,families:[{id:`subtle-surface`,label:`Subtle surface`,role:`secondary`,roles:[`secondary`,`secondaryForeground`,`muted`,`toolbarControl`]},{id:`highlight-surface`,label:`Highlight surface`,role:`accentSurface`,roles:[`accentSurface`,`accentSurfaceForeground`,`toolbarControlHover`]},{id:`accent`,label:`Accent`,role:`accent`,roles:[`accent`,`accentForeground`,`focus`,`update`,`updateForeground`,`updateSurface`,`terminalCursor`]},{id:`action`,label:`Action`,role:`messageAction`,roles:[`messageAction`,`messageActionForeground`,`messageActionHover`]},{id:`message-surface`,label:`Message surface`,role:`messageSurface`,roles:[`messageSurface`,`messageForeground`]},{id:`code-surface`,label:`Code surface`,role:`codeBackground`,roles:[`codeBackground`,`codeForeground`]}]},{id:`search`,title:`Search`,families:[{id:`search-matches`,label:`Search matches`,role:`searchMatchBackground`,roles:[`searchMatchBackground`,`searchMatchForeground`]},{id:`current-match`,label:`Current match`,role:`searchMatchActiveBackground`,roles:[`searchMatchActiveBackground`,`searchMatchActiveForeground`]}]},{id:`context`,title:`Context`,families:[{id:`sidebar-background`,label:`Sidebar background`,role:`sidebar`,roles:[`sidebar`,`sidebarForeground`]},{id:`sidebar-controls`,label:`Sidebar controls`,role:`sidebarControlSurface`,roles:[`sidebarControlSurface`]},{id:`sidebar-selection`,label:`Sidebar selection`,role:`sidebarRowSelected`,roles:[`sidebarRowHover`,`sidebarRowActive`,`sidebarRowSelected`]},{id:`terminal-background`,label:`Terminal background`,role:`terminalBackground`,roles:[`terminalBackground`,`terminalForeground`,`terminalSelection`,`terminalScrollbar`,`terminalScrollbarHover`]}]},{id:`status`,title:`Status`,families:[{id:`error`,label:`Error`,role:`error`,roles:[`error`,`errorForeground`,`errorSurface`]},{id:`warning`,label:`Warning`,role:`warning`,roles:[`warning`,`warningForeground`,`warningSurface`]}]}],Ie=Fe.flatMap(e=>e.families),Le=new Map(Ie.flatMap(e=>e.roles.map(t=>[t,e])));function Re(e){return Le.get(e)??null}function ze(e){return{...w(e)}}function Be(){return{light:ze(`light`),dark:ze(`dark`)}}function Ve(e){return g(e.trim())}function He(e,t){let n=w(e);return E(e,Ve(t.canvas)?t.canvas:n.canvas,Ve(t.accent)?t.accent:n.accent)}function Ue({open:e,onOpenChange:t,onSaved:n,editingTheme:a,initialAppearance:m,seedTheme:g,seedName:v,restoreTheme:C}){let w=a!==null,[E,A]=(0,z.useState)(``),[j,M]=(0,z.useState)(m),[N,P]=(0,z.useState)(!1),[F,I]=(0,z.useState)(()=>Be()),[ie,V]=(0,z.useState)({light:!1,dark:!1}),[oe,se]=(0,z.useState)(!1),[ce,H]=(0,z.useState)(null),[U,le]=(0,z.useState)(!1),[de,W]=(0,z.useState)(``),[G,K]=(0,z.useState)(!1),[q,J]=(0,z.useState)(null),[fe,pe]=(0,z.useState)(null),[Y,me]=(0,z.useState)(null),[he,ge]=(0,z.useState)(null),X=(0,z.useRef)(null),Z=(0,z.useRef)(null),ye=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(!e)return;let t=()=>{let e,t;ge(n=>n&&(e=Math.max(280,Math.min(n.width,window.innerWidth-16)),t=Math.max(220,Math.min(n.height,window.innerHeight-16)),{width:e,height:t})),me(n=>{if(!n)return n;let r=$e(n.x,n.y,e),i=U?X.current?.offsetHeight??0:t??X.current?.offsetHeight??0,a=Math.max(8,window.innerHeight-i-8);return{x:r.x,y:Math.min(r.y,a)}})};return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[U,e]);let[xe,Ce]=(0,z.useState)(!1),Q=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(e&&!Q.current){let e=a??g??null,t=Be(),n=e?te(e,m)?m:e.appearance:m;if(e){t[e.appearance]={...e.colors};for(let n of[`light`,`dark`]){let r=e.variants?.[n];r&&(t[n]={...r})}}A(a?.label??v??``),M(n),P(e!==null&&e.managed!==!0),V({light:!1,dark:!1}),se(e!==null&&e.managed!==!0),I(t),J(null),pe(null),K(!1),H(null),Ce(!0)}!e&&xe&&Ce(!1),Q.current=e},[a,m,xe,e,v,g]);let we=ee(E),Te=E.trim().toLowerCase(),$=Te===``?null:S().find(e=>e.id!==a?.id&&(e.id===we||e.label.trim().toLowerCase()===Te))??null,Ee=$?D($):[],De=a?D(a):null,Oe=e=>De&&!De.includes(e)?`“${a?.label}” has no ${e} palette. Create a theme with the same name to add one.`:!w&&Ee.includes(e)?`“${$?.label}” already has a ${e} palette.`:null,ke=$?.id??null,Ae=Ee.join(`,`);(0,z.useEffect)(()=>{if(w||ke===null)return;let e=Ae.split(`,`).filter(Boolean);e.length===1&&M(t=>e.includes(t)?e[0]===`light`?`dark`:`light`:t)},[w,ke,Ae]),(0,z.useEffect)(()=>{e&&xe&&T(F[j],j)},[j,F,xe,e]),(0,z.useEffect)(()=>{if(e)return()=>{C()}},[e,C]);let Ie=(0,z.useCallback)((e,t)=>{I(n=>{let r={...n[j],[e]:t},i=!N&&Pe.includes(e)&&Ve(t);return{...n,[j]:N?_(j,n[j],e,t):i?He(j,r):r}}),!N&&Pe.includes(e)&&Ve(t)&&V(e=>({...e,[j]:!0})),N&&se(!0)},[j,N]),Le=(0,z.useCallback)((e,t=!1)=>{let n=Re(e)?.role??e;J(n),Pe.includes(n)||(P(!0),W(``)),t&&requestAnimationFrame(()=>{X.current?.querySelector(`[data-theme-color-role="${n}"]`)?.scrollIntoView({behavior:`smooth`,block:`nearest`})})},[]),ze=(0,z.useCallback)(e=>{J(t=>t===e?null:e)},[]),Ue=(0,z.useCallback)(()=>{J(null),pe(null),K(!1)},[]),We=(q?N?Re(q)?.roles??[q]:Pe.includes(q)?ne.filter(e=>F[j][e].trim().toLowerCase()===F[j][q].trim().toLowerCase()):[q]:[]).join(`,`);(0,z.useEffect)(()=>{if(_e(),!e||q===null){pe(null);return}if(G)return;let t=We.split(`,`),n=()=>pe(Me(t));n();let r=null,i=null,a=performance.now(),o=()=>{if(r!==null||i!==null)return;let e=Math.max(0,500-(performance.now()-a)),t=()=>{r=null,i=null,a=performance.now(),n()};e===0?r=requestAnimationFrame(t):i=setTimeout(t,e)},s=new MutationObserver(e=>{e.every(e=>e.target instanceof Element&&(e.target.closest(`#theme-inspector-spotlight`)||e.target.closest(`[data-theme-editor-panel]`)))||o()});s.observe(document.body,{childList:!0,subtree:!0});let c=null,l=()=>{c??=requestAnimationFrame(()=>{c=null,Se()})};return window.addEventListener(`resize`,l),window.addEventListener(`scroll`,l,!0),()=>{s.disconnect(),r!==null&&cancelAnimationFrame(r),i!==null&&clearTimeout(i),c!==null&&cancelAnimationFrame(c),window.removeEventListener(`resize`,l),window.removeEventListener(`scroll`,l,!0),_e()}},[G,e,We,q]),(0,z.useEffect)(()=>{if(!e||!G){ve();return}let t=!1,n=null,r=null,i=null,a=null,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{o(),n=null,r=null,ve()},c=e=>{r=e,be(e,Re(e.role)?.label??ae(e.role))},l=e=>{let t=e.target;if(!(t instanceof Element)||t.closest(`[data-theme-editor-panel]`)){s();return}o(),n=t,r=null;let a=je(t);if(a){c(a);return}ve(),i=window.setTimeout(()=>{if(i=null,n!==t||!t.isConnected)return;let e=Ne(t);e&&c(e)},140)},u=e=>{e.relatedTarget===null&&s()},d=e=>{let i=e.target;if(!(i instanceof Element)||i.closest(`[data-theme-editor-panel]`))return;e.preventDefault(),e.stopPropagation(),o();let a=n===i&&r?r:Ne(i);a&&(s(),Le(a.role,!0),t=!0)},f=e=>{let n=e.target;n instanceof Element&&!n.closest(`[data-theme-editor-panel]`)&&(e.preventDefault(),e.stopPropagation(),t&&K(!1),t=!1)},p=e=>{e.key===`Escape`&&(e.preventDefault(),s(),Ue())},m=()=>{r&&(a??=requestAnimationFrame(()=>{a=null,r&&be(r,Re(r.role)?.label??ae(r.role))}))},h=()=>s();return document.addEventListener(`pointerover`,l,!0),document.addEventListener(`pointerout`,u,!0),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`click`,f,!0),document.addEventListener(`keydown`,p,!0),window.addEventListener(`resize`,m),window.addEventListener(`scroll`,h,!0),()=>{document.removeEventListener(`pointerover`,l,!0),document.removeEventListener(`pointerout`,u,!0),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`click`,f,!0),document.removeEventListener(`keydown`,p,!0),window.removeEventListener(`resize`,m),window.removeEventListener(`scroll`,h,!0),o(),a!==null&&cancelAnimationFrame(a),ve()}},[Ue,G,e,Le]);let Ge=(0,z.useCallback)(e=>{if(P(e),e||(q&&!Pe.includes(q)&&J(null),!oe))return;let t=a&&D(a).length>1?[`light`,`dark`]:[j];V(e=>{let n={...e};for(let e of t)n[e]=!0;return n}),I(e=>{let n={...e};for(let r of t)n[r]=He(r,e[r]);return n}),se(!1)},[j,a,q,oe]),Ke=()=>{if(!E.trim()){H(`Name your theme first.`);return}try{let e=N?F:{light:ie.light?He(`light`,F.light):F.light,dark:ie.dark?He(`dark`,F.dark):F.dark},r,i=null,o=null;if(a&&$){let t=D(a),n=t.find(e=>Ee.includes(e));if(n){H(`“${$.label}” already has a ${n} palette. Pick another name.`);return}i=t[0]??null,r=x({...y({version:1,id:$.id,name:$.label,appearance:$.appearance,colors:$.colors,variants:{...$.variants,...Object.fromEntries(t.map(t=>[t,e[t]]))},...$.managed===!0&&!N?{managed:!0}:{}}),...$.collection?{collection:$.collection}:{}}),o=a;try{h(a.id)}catch(e){try{x($)}catch{}throw e}}else if(a){let t=a.appearance,n=t===`light`?`dark`:`light`;r=x({...y({version:1,id:a.id,name:E,appearance:t,colors:e[t],...D(a).length>1?{variants:{[n]:e[n]}}:{},...N?{}:{managed:!0}}),...a.collection?{collection:a.collection}:{}})}else if($){if(Ee.includes(j)){H(`“${$.label}” already has light and dark palettes. Pick another name.`);return}i=j,r=x({...y({version:1,id:$.id,name:$.label,appearance:$.appearance,colors:$.colors,variants:{...$.variants,[j]:e[j]},...$.managed===!0&&!N?{managed:!0}:{}}),...$.collection?{collection:$.collection}:{}})}else r=b(y({version:1,name:E,appearance:j,colors:e[j],...N?{}:{managed:!0}}));if(!n(r,{created:a===null&&i===null,...i?{mergedAppearance:i}:{}})){if(!a&&i===null)try{h(r.id)}catch{}else if($&&i!==null)try{x($),o&&b(o)}catch{}H(`Theme saved, but it could not be made active. Try again.`);return}t(!1)}catch(e){H(e instanceof Error?e.message:w?`Could not save the theme.`:`Could not create the theme.`)}},qe=()=>(0,B.jsxs)(`label`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:`Theme name`}),(0,B.jsx)(re,{autoFocus:!0,size:`sm`,onChange:e=>{A(e.currentTarget.value),H(null)},placeholder:w?`Theme name`:`e.g. Aurora`,value:E})]}),Je=e=>{let t=Oe(e),n=(0,B.jsx)(k,{"aria-disabled":t!==null,value:e,children:e===`light`?`Light`:`Dark`});return t===null?n:(0,B.jsxs)(p,{children:[(0,B.jsx)(u,{render:n}),(0,B.jsx)(f,{children:t})]})},Ye=()=>(0,B.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium`,children:`Appearance`}),(0,B.jsxs)(O,{"aria-label":`Theme appearance`,variant:`segmented`,value:[j],onValueChange:e=>{let t=e[0];(t===`light`||t===`dark`)&&Oe(t)===null&&M(t)},children:[Je(`light`),Je(`dark`)]})]}),Xe=()=>(0,B.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-start gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`text-sm font-medium`,children:`Colors`}),N?null:(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Two colors, rest derived`})]}),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[N?(0,B.jsx)(re,{"aria-label":`Filter colors`,className:`min-w-0 flex-1`,onChange:e=>W(e.currentTarget.value),placeholder:`Filter colors`,size:`sm`,value:de}):null,(0,B.jsxs)(`label`,{className:`ml-auto flex shrink-0 cursor-pointer items-center gap-2 pt-0.5 text-sm font-medium`,children:[(0,B.jsx)(`span`,{children:`Advanced`}),(0,B.jsx)(L,{"aria-label":`Use advanced theme colors`,checked:N,onCheckedChange:e=>Ge(!!e)})]})]})]}),Ze=(e,t=`grid gap-2 sm:grid-cols-2`)=>(0,B.jsx)(`div`,{className:t,children:e.map(e=>(0,B.jsx)(ue,{label:e.label,onChange:Ie,onSelect:Le,onToggleSelected:ze,role:e.role,selected:q===e.role,value:F[j][e.role]},e.id))}),Qe=()=>{let e=de.trim().toLowerCase(),t=Fe.map(t=>({...t,families:t.families.filter(t=>!e||[t.label,...t.roles.map(e=>ae(e))].join(` `).toLowerCase().includes(e))})).filter(e=>e.families.length>0);return N?(0,B.jsxs)(`div`,{className:`space-y-5`,children:[t.map(e=>(0,B.jsxs)(`section`,{className:`space-y-2`,children:[(0,B.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:e.title}),Ze(e.families,`grid gap-1`)]},e.id)),t.length===0?(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No matches.`}):null]}):(0,B.jsx)(`div`,{className:`grid gap-1`,children:Pe.map(e=>(0,B.jsx)(ue,{onChange:Ie,onSelect:Le,onToggleSelected:ze,role:e,label:e===`canvas`?`Background`:`Accent`,selected:q===e,value:F[j][e]},e))})},$e=(e,t,n)=>{let r=X.current,i=n??r?.offsetWidth??0;return{x:Math.min(Math.max(e,8),Math.max(8,window.innerWidth-i-8)),y:Math.min(Math.max(t,8),Math.max(8,window.innerHeight-48))}},et=e=>{if(e.target.closest(`button, input, a`))return;let t=X.current?.getBoundingClientRect();t&&(Z.current={dx:e.clientX-t.x,dy:e.clientY-t.y},e.currentTarget.setPointerCapture(e.pointerId))},tt=e=>{let t=Z.current;t&&me($e(e.clientX-t.dx,e.clientY-t.dy))},nt=()=>{Z.current=null},rt=e=>{let t=X.current?.getBoundingClientRect();t&&(e.preventDefault(),Y===null&&me($e(t.x,t.y)),ye.current={pointerX:e.clientX,pointerY:e.clientY,left:t.x,top:t.y,width:t.width,height:t.height},e.currentTarget.setPointerCapture(e.pointerId))},it=e=>{let t=ye.current;if(!t)return;let n=Math.max(280,window.innerWidth-8-t.left),r=Math.max(220,window.innerHeight-8-t.top);ge({width:Math.min(Math.max(t.width+e.clientX-t.pointerX,280),n),height:Math.min(Math.max(t.height+e.clientY-t.pointerY,220),r)})},at=()=>{ye.current=null};return(0,B.jsxs)(`div`,{"aria-label":w?`Edit theme`:`Create theme`,className:i(`dialog-glass fixed z-[110] flex max-h-[min(42rem,calc(100dvh-6rem))] w-[min(26rem,calc(100vw-2rem))] flex-col overflow-hidden rounded-xl border text-popover-foreground`,Y===null&&`bottom-4 right-4`,U&&`max-h-none`),"data-theme-editor-panel":!0,ref:X,role:`dialog`,style:{...Y?{left:Y.x,top:Y.y}:{},...he?{width:he.width}:{},...he&&!U?{height:he.height,maxHeight:`calc(100dvh - 1rem)`}:{}},children:[(0,B.jsxs)(`div`,{className:`flex cursor-grab touch-none select-none items-center gap-1 border-b border-border/70 px-3 py-2 active:cursor-grabbing`,onPointerCancel:nt,onPointerDown:et,onPointerMove:tt,onPointerUp:nt,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,B.jsx)(`h2`,{className:`shrink-0 truncate text-sm font-medium`,children:w?`Edit theme`:`Create theme`}),U?null:(0,B.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:G?`Select an element · Esc to cancel`:q?`${N?Re(q)?.label??ae(q):ae(q)} · ${fe??0} ${fe===1?`use`:`uses`}`:`Select a color below`})]}),(0,B.jsxs)(p,{children:[(0,B.jsx)(u,{render:(0,B.jsxs)(r,{"aria-label":G?`Cancel inspecting app colors`:`Inspect app colors`,"aria-pressed":G,size:`xs`,variant:G?`secondary`:`ghost`,onClick:()=>{if(G){Ue();return}K(!0)},children:[(0,B.jsx)(o,{}),G?`Cancel`:`Inspect`]})}),(0,B.jsx)(f,{"data-theme-editor-panel":``,children:G?`Cancel and clear the selection`:`Pick a color from the app`})]}),(0,B.jsx)(r,{"aria-label":U?`Expand the theme editor`:`Minimize the theme editor`,size:`icon-xs`,variant:`ghost`,onClick:()=>le(!U),children:(0,B.jsx)(d,{icon:U?R.ChevronUp:R.ChevronDown})}),(0,B.jsx)(r,{"aria-label":`Close the theme editor`,size:`icon-xs`,variant:`ghost`,onClick:()=>t(!1),children:(0,B.jsx)(l,{})})]}),U?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto py-3 pl-3 pr-1.5`,children:[qe(),ce?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:ce}):null,Ye(),(0,B.jsxs)(`div`,{className:`space-y-3`,children:[Xe(),Qe()]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border/70 px-3 py-2`,children:[(0,B.jsx)(r,{size:`sm`,variant:`ghost`,onClick:()=>t(!1),children:`Cancel`}),(0,B.jsx)(r,{disabled:!E.trim(),size:`sm`,onClick:Ke,children:w?$?`Merge into “${$.label}”`:`Save changes`:$?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(c,{}),`Add ${j} palette`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(s,{}),`Create theme`]})})]}),(0,B.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 right-0 z-10 flex size-5 cursor-se-resize touch-none select-none items-end justify-end p-1 text-muted-foreground/70`,onPointerCancel:at,onPointerDown:rt,onPointerMove:it,onPointerUp:at,children:(0,B.jsx)(`svg`,{className:`size-2.5`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.2`,viewBox:`0 0 8 8`,children:(0,B.jsx)(`path`,{d:`M7 1 1 7M7 4.5 4.5 7`})})})]})]})}export{Ue as ThemeEditorPanel};
|
|
5
|
-
//# sourceMappingURL=ThemeEditorPanel-CnhjGelD.js.map
|