@p4code/cli 0.9.24 → 0.9.26
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/{AcpMcpStdioBridge-BNuxv1nx.mjs → AcpMcpStdioBridge-DLEEBpNR.mjs} +4 -4
- package/dist/AcpMcpStdioBridge-Dozbm_3J.mjs +3 -0
- package/dist/{Effect-BrI3bavz.mjs → Effect-DwQPN8rO.mjs} +35 -2
- package/dist/{Schema-06GeVid5.mjs → Schema-CdYZrGX6.mjs} +24 -3
- package/dist/{Stream-DKSvHopl.mjs → Stream-F-Z4HJeD.mjs} +2 -2
- package/dist/{TraceDiagnostics-Dk5M3WAT.mjs → TraceDiagnostics-D1Qz3qce.mjs} +18 -7
- package/dist/bin.mjs +2 -2
- package/dist/{binCli-CBzw8eZx.mjs → binCli-CcEaWLAR.mjs} +11 -11
- package/dist/claude-history-worker.mjs +1 -1
- package/dist/{claudeHistoryWorker-BZBBGtSw.mjs → claudeHistoryWorker-Bf24F_k8.mjs} +1 -1
- package/dist/{claudeHistoryWorker-DlhW7K2f.mjs → claudeHistoryWorker-DOjYf4xB.mjs} +4 -4
- package/dist/client/.vite/manifest.json +2259 -2257
- package/dist/client/assets/{2NI2N5EU-Dz1H18lO.js → 2NI2N5EU--LXjbTE-.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-DxZW-JIQ.js → 4UO7MD6I-D_jr6_IV.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-Cl2owg_V.js → 5B3SVYGG-tThUTA_S.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-A0G_mE3E.js → 5GK6JWQ2-BCuuAhKJ.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-Bd00cghV.js → 5N7A7DKN-rdPMRoZL.js} +2 -2
- package/dist/client/assets/{5OC2THR4-ytZLjDMp.js → 5OC2THR4-gvpm3IL0.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-XbqbgHxv.js → 5S6HY5KT-CWanNmdR.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-BtndAY2_.js → 6IMQ5BUJ-1sguTKZ9.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-DNXmh00R.js → 6OLKWJ4F-9loy41nw.js} +2 -2
- package/dist/client/assets/{74OO7NKP-DbprmlDc.js → 74OO7NKP-ukQR6jKi.js} +2 -2
- package/dist/client/assets/{75O6YZUN-DZ_5zRwt.js → 75O6YZUN-BjBd5LQ0.js} +2 -2
- package/dist/client/assets/{77XECAW3-CgSkQSMJ.js → 77XECAW3-Ccw2Y7VD.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-ucE-F8EO.js → ABYRPUBD-CvqVJLPf.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-CimqRgXh.js +2 -0
- package/dist/client/assets/{AnimatedHeight-B2j_NXft.js → AnimatedHeight-Dwarin_V.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DqI-KrrY.js → AuthSurfaceShell-BvGaTutU.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-CXw0vAgW.js → BB2UYUI2-Drnmium_.js} +2 -2
- package/dist/client/assets/{BUM34MOA-DBHGisGU.js → BUM34MOA-AkPmeijf.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-MGn88wbo.js → CEQABKGZ-BNUlDSIK.js} +2 -2
- package/dist/client/assets/{CXAC5362-C1Fk1A6g.js → CXAC5362-Bmar3Iii.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-_JZfpkEi.js → ChatGptUsageButton-D6Iy8SVv.js} +2 -2
- package/dist/client/assets/ChatMarkdown-DHhJpg3q.js +49 -0
- package/dist/client/assets/{CheckboxIndicator-DFCs5GRD.js → CheckboxIndicator-DbA95VlZ.js} +2 -2
- package/dist/client/assets/{ClippedText-BIwvWMlV.js → ClippedText-UM8CaEu4.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-B8uhmM78.js → CodexSetupSection.logic-kKJPABQZ.js} +2 -2
- package/dist/client/assets/{CollapsiblePanel-CsWNZ7jo.js → CollapsiblePanel-C1iRr4kZ.js} +2 -2
- package/dist/client/assets/{ComboboxClear-Cv9NZFNr.js → ComboboxClear-DaifQLU5.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-BPe0M6wJ.js → ComboboxGroupLabel-C03JGZRD.js} +2 -2
- package/dist/client/assets/{CommandBlock-BJ2nHWe_.js → CommandBlock-DH_L_Tgo.js} +2 -2
- package/dist/client/assets/{CompositeRoot-RcqGhRAf.js → CompositeRoot-B1DTZCNU.js} +2 -2
- package/dist/client/assets/{ConnectAgentSurface-kcWh3f_f.js → ConnectAgentSurface-C5bZc2ZR.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-DIUevPBM.js → ConnectionStatusDot-CCTiSlHA.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-CmpBRyx_.js → DRLTVNUE-BqWUfmRf.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-rvY-xhxe.js → DYY6UVD2-CyRsghfa.js} +2 -2
- package/dist/client/assets/{DevicePanel-Bkrn90hU.js → DevicePanel-DocID7hH.js} +2 -2
- package/dist/client/assets/{DeviceSetup-BQvNWMm0.js → DeviceSetup-CX2OWVB9.js} +2 -2
- package/dist/client/assets/{DialogRoot-Dg58-QOq.js → DialogRoot-D64NsaiW.js} +2 -2
- package/dist/client/assets/{DialogTitle-CSaaIBpP.js → DialogTitle-CYefNdHm.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-eHSeIufV.js → DiffCommentAnnotation-ChKqFxt5.js} +2 -2
- package/dist/client/assets/{DiffFileTree-opfyNeFz.js → DiffFileTree-B6AgzOXX.js} +2 -2
- package/dist/client/assets/{DiffPanel-C4ySgbUg.js → DiffPanel-DKAHtq5x.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BwOTmWKP.js → DiffWorkerPoolProvider-CK3y5UA1.js} +3 -3
- package/dist/client/assets/{EmbeddedDesign-BW5Rcxmc.js → EmbeddedDesign-Bj-kkArq.js} +5 -5
- package/dist/client/assets/{EnvironmentMachineIcon-DM48TG2x.js → EnvironmentMachineIcon-CJ30kzSK.js} +2 -2
- package/dist/client/assets/{ExpandableText-CYFNBBpY.js → ExpandableText-CBPvhWvZ.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-B8vuCGFt.js → FNOVOB4O-DYXYw-b1.js} +2 -2
- package/dist/client/assets/{FieldControl-DHSVFpKc.js → FieldControl-CkgERQaU.js} +2 -2
- package/dist/client/assets/{FileDiff-CZk9prBc.js → FileDiff-BLuBewdN.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BcCGkQ__.js → FilePreviewPanel-DWNimHTU.js} +4 -4
- package/dist/client/assets/{FoldedSettingsSection-COBhgfnb.js → FoldedSettingsSection-C3cuD_W9.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-DRcTM9ws.js → HDGCDEEZ-7WPyPcLr.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-Dh4X6CJ4.js → HSJLKHB7-t8_OkffK.js} +2 -2
- package/dist/client/assets/{Icons-DpgbzNj8.js → Icons-BUrn1Fzo.js} +2 -2
- package/dist/client/assets/Input-Gb8KV9DV.js +2 -0
- package/dist/client/assets/{IntervalSecondsField-D0j2uU5s.js → IntervalSecondsField-D9JXVV-s.js} +2 -2
- package/dist/client/assets/JZOYTAAL-BzA5Kg5m.js +1 -0
- package/dist/client/assets/{K3MD6TGW-uz2CK9vb.js → K3MD6TGW-DoqPvoaq.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-uWbuKqQP.js → K7RP3OMA--ZFOkyEG.js} +2 -2
- package/dist/client/assets/KeybindingsSettings.logic-CMs7OPcH.js +2 -0
- package/dist/client/assets/{LHDIQX7Q-BaUgpa7I.js → LHDIQX7Q-hUqw2I9B.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-C-Usmwyz.js → LUXOKEGN-Dvu_mp-q.js} +2 -2
- package/dist/client/assets/{LinkMachineSelect-CB99X8v3.js → LinkMachineSelect-SHXPDP_g.js} +2 -2
- package/dist/client/assets/MathTypeset-C02HYdjx.css +1 -0
- package/dist/client/assets/{MathTypeset-Dv2b-uiV.js → MathTypeset-TM-3r0WA.js} +2 -2
- package/dist/client/assets/{ModelLiveLayer-DIrV--mW.js → ModelLiveLayer-Bb-7OhJ9.js} +3 -3
- package/dist/client/assets/{N3JZAHOW-CLD7n6Za.js → N3JZAHOW-LjhhJ-00.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-CVI_F8c-.js → NUIALGQ3-Dg1KXz02.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CAoW0Xej.js → NoProjectsHero-D0OPZtzO.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-g6xpsO0r.js → O65XPQGZ-BxaJR80d.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-CBkPdCIB.js → O7XIQ6OM-CCXPxMuU.js} +2 -2
- package/dist/client/assets/{OFQON5FD-DpM-bsDn.js → OFQON5FD-WUMBXQkX.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-CCjWOetO.js → P4ConnectAccountPages-BNK6s-RS.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-CfEPRRB6.js → P4ConnectSidebarSignIn-CWW40SMl.js} +2 -2
- package/dist/client/assets/{PJQHF43J-Sp1j42CR.js → PJQHF43J-BrNjCaLl.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CcdUv-ij.js → PanelLayoutControls-DiXjRWIw.js} +7 -7
- package/dist/client/assets/{PierreEntryIcon-vf9Z0_eJ.js → PierreEntryIcon-D29_Ylm_.js} +2 -2
- package/dist/client/assets/{PopoverHandle-s36xVlsK.js → PopoverHandle-BgggGdpn.js} +2 -2
- package/dist/client/assets/PreviewPanel-DutKwWE7.js +2 -0
- package/dist/client/assets/{ProjectDefaultsSettings-TlEARfjk.js → ProjectDefaultsSettings-DMfJN66D.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-Dd4p_a9n.js → ProjectFavicon-DFI1NI3D.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-D5UkwTkD.js → ProjectIconPickerDialog-BqGWzrTc.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Aw_ZBtDB.js → ProjectMonogram-D4xxVtw8.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Cw2WcQr1.js → ProviderAuthTerminal-CRSvI-Og.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-D73G0AKf.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-DaeugImp.js → ProviderSettingsForm-DchD8HSN.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-DdfQeIIl.js → PullRequestCodeTab-BdXdTg-d.js} +3 -3
- package/dist/client/assets/{RHNBAITX-DQfv99hf.js → RHNBAITX-PsYrngSs.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-Vvv9UVOM.js → ReadOnlySourcePreview-8jLKmc3M.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-bQSbv34p.js → RedactedSensitiveText-DhV2Jdu8.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-4-dgp9K8.js → RenderErrorBoundary-56lc2IQ3.js} +3 -3
- package/dist/client/assets/{RightPanelResizeHandle-B6vIzqA0.js → RightPanelResizeHandle-ClzdYxWw.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-BKBt5rH4.js → SLD4V6NK-CxidvPXU.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-Dbz9TZ6o.js → ScheduledTasksSettings-BdMCgBm5.js} +5 -5
- package/dist/client/assets/{ScopedSwitch-D1e9m-dH.js → ScopedSwitch-CwnjCta_.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-Cn2VDisz.js → ScrollAreaCorner-CfTQYjCW.js} +2 -2
- package/dist/client/assets/{SecretInput-C6zW-8wI.js → SecretInput-BYfVbTLh.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-C40FP3vq.js → SelectScrollUpArrow-BE0-tVtP.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection-WXBG9l_4.js → SelfImproveSettingsSection-DsqFeICK.js} +2 -2
- package/dist/client/assets/{SettingsPanels-BEtJwC6n.js → SettingsPanels-D_rJsyjt.js} +14 -14
- package/dist/client/assets/{SettingsPanels.logic-y95n8OOO.js → SettingsPanels.logic-BTJUBh-T.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DE1t1kw-.js → SettingsScopeNotice-CAVvn3pQ.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-CYLpofvt.js → SidebarStageBackdrop-DdxWuxIk.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-BryFgp5Q.js → T3PCR2KE-BtQsKjM5.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-DcRjYaVG.js → TKWO2OVW-CeYF-suq.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-hAylFob1.js → TSHNXIZL-FQ7ZWHEn.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-DeGNehj1.js → ThemeEditorPanel-BJucNhy-.js} +2 -2
- package/dist/client/assets/{ThreadDetailsItemsMenu-D0mfEKtW.js → ThreadDetailsItemsMenu-CRBBIuc7.js} +10 -10
- package/dist/client/assets/ThreadTerminalDrawer-Ci0mbLzJ.js +5 -0
- package/dist/client/assets/{TooltipProvider-DQ0TF9NB.js → TooltipProvider-BH5ni_Lo.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-BfaZIz58.js → UQJE5E4I-CeqBk-r6.js} +2 -2
- package/dist/client/assets/{USNYFO5S-jOq8Kcgw.js → USNYFO5S-_1m41tJt.js} +2 -2
- package/dist/client/assets/{Virtualizer-B3FSTwJv.js → Virtualizer-DLB0FYm-.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-1T3GTRY3.js → WEVWDWVA-DmSV8HLL.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Dno2N8Xd.js → WorkspaceBreadcrumb-DQkeBQUl.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-OLpcgD_f.js → WorkspacePageContainer-D2rx9iDg.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-Bn0m4gpR.js → WorkspacePageHeader-D8-RIRjQ.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-CaiE8-NB.js → X5RFHQXM-BUdDYXox.js} +2 -2
- package/dist/client/assets/{X62E3GBT-CKnjYZvp.js → X62E3GBT-BbQ7FmNB.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-DF-d22o-.js → XBNEOJTC-BLEZA-vx.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-VSj4WI2u.js → YHV2MVVZ-DM2RTtkR.js} +2 -2
- package/dist/client/assets/{YURCZMG2-C9wxlavt.js → YURCZMG2-D5w6cPMY.js} +2 -2
- package/dist/client/assets/{YVG2LODB-JRtigNQC.js → YVG2LODB-BkLbsaCo.js} +2 -2
- package/dist/client/assets/_chat-CKMs-ajx.js +47 -0
- package/dist/client/assets/{_chat.design-DxTdYmIe.js → _chat.design-CpqXODBn.js} +2 -2
- package/dist/client/assets/{_chat.index-CNIRuBqG.js → _chat.index-B0eOfZAf.js} +2 -2
- package/dist/client/assets/_chat.new-CqLuDynd.js +4 -0
- package/dist/client/assets/{_chat.pull-requests-C6rdgLS9.js → _chat.pull-requests-C4Eo8GDQ.js} +2 -2
- package/dist/client/assets/{alert-CfhQnxcL.js → alert-D1O9oex3.js} +2 -2
- package/dist/client/assets/{alert-dialog-Dn_PRSFU.js → alert-dialog-3XDceRWv.js} +2 -2
- package/dist/client/assets/{assetUrls-BMizLezw.js → assetUrls-Dq0gsqWs.js} +2 -2
- package/dist/client/assets/{assets-DT0KoRIr.js → assets-C3_UZib9.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-xnY5QhfE.js → browserHistoryStore-CVCo7qfb.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CH-4nkAf.js → browserLinkTarget-CopcRHna.js} +2 -2
- package/dist/client/assets/{checkbox-iFzfBLKr.js → checkbox-CxRqp4sO.js} +2 -2
- package/dist/client/assets/{color-picker-W1NtR7ha.js → color-picker-CvbP7BS3.js} +2 -2
- package/dist/client/assets/{combobox-B0IMIA-1.js → combobox-CuyUAuiC.js} +2 -2
- package/dist/client/assets/command-4bqVdX0m.js +2 -0
- package/dist/client/assets/{connect-BflmwHyv.js → connect-DFGquf-O.js} +2 -2
- package/dist/client/assets/connect-agent-Db5rxxY1.js +2 -0
- package/dist/client/assets/{design-B_bv-H7n.js → design-DzoN9JgQ.js} +2 -2
- package/dist/client/assets/{device-i4SkE05R.js → device-H2MyT_kA.js} +2 -2
- package/dist/client/assets/{dialog-DFlZvvht.js → dialog-CrLVN_m6.js} +2 -2
- package/dist/client/assets/{diffPanelStore-CGdPbp5I.js → diffPanelStore-CxnPNigi.js} +2 -2
- package/dist/client/assets/{diffRendering-B7lkQ5_O.js → diffRendering-cyTQV5bk.js} +2 -2
- package/dist/client/assets/{dist-BvS7KgJD.js → dist-J7s-H61h.js} +3 -3
- package/dist/client/assets/{draft-input-1HTN8QVo.js → draft-input-UuEBPJE8.js} +2 -2
- package/dist/client/assets/{duoViewer-DbnFva5H.js → duoViewer-C3DQnADY.js} +2 -2
- package/dist/client/assets/{dynamic-DmVpEfW3.js → dynamic-PDa6LTqb.js} +2 -2
- package/dist/client/assets/{embeddedScripts-D0-ABFFC.js → embeddedScripts-BDzRNXSL.js} +2 -2
- package/dist/client/assets/{empty-Dn5VI2Xk.js → empty-YMXgQbNI.js} +2 -2
- package/dist/client/assets/entities-HOBDIiHK.js +2 -0
- package/dist/client/assets/fileLinks-BlT4My6t.js +2 -0
- package/dist/client/assets/{fileTreeExpansion-Bp5eLBXI.js → fileTreeExpansion-D5nN-Oqd.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CKgGUEGl.js → getDiffFileInput-4gToQuSl.js} +2 -2
- package/dist/client/assets/{htmlRender-BdsR_7vV.js → htmlRender-CUGVJXGf.js} +2 -2
- package/dist/client/assets/{index-DQKD4Lk2.js → index-C04a0SKq.js} +3 -3
- package/dist/client/assets/{input-yaZxaTds.js → input-DxHa9qj5.js} +2 -2
- package/dist/client/assets/{input-group-B1TOCtDG.js → input-group-_rAbDbys.js} +2 -2
- package/dist/client/assets/katex-B940_AAO.js +258 -0
- package/dist/client/assets/{kbd-R7rkirqT.js → kbd-DjUfNaix.js} +2 -2
- package/dist/client/assets/{keybindings-CrlWqd5q.js → keybindings-8_1sqf8s.js} +2 -2
- package/dist/client/assets/{lazy-C5ansoaW.js → lazy-C1dqAep6.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-BxpFJiXB.js → lazyRouteComponent-DLamKhHF.js} +2 -2
- package/dist/client/assets/{link-2ZiGGBbw.js → link-D1nkgCv7.js} +2 -2
- package/dist/client/assets/{linkedPrompt-CwNmoWmu.js → linkedPrompt-Quysf0mk.js} +2 -2
- package/dist/client/assets/main-BFdCLmkY.js +39 -0
- package/dist/client/assets/main-BQBpA03z.css +2 -0
- package/dist/client/assets/mediaReference-D19Dzoh3.js +2 -0
- package/dist/client/assets/mediaSource-DfsR3T70.js +2 -0
- package/dist/client/assets/{modelScene-D8CdQkcp.js → modelScene-CcF-Uii-.js} +2 -2
- package/dist/client/assets/{number-field-DNna9ps3.js → number-field-CALZZPio.js} +2 -2
- package/dist/client/assets/{observeResize-Cz6dJUG2.js → observeResize-DLmefMqO.js} +2 -2
- package/dist/client/assets/{onboarding-BG6FdUUU.js → onboarding-plATuZco.js} +2 -2
- package/dist/client/assets/{openFileInPreview-BaemzSTr.js → openFileInPreview-BCGQQ_Ia.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-O_tvpvNW.js → p4ProjectFile-DCNJ4pTp.js} +2 -2
- package/dist/client/assets/{pair-BNIczJXa.js → pair-umv6-haX.js} +2 -2
- package/dist/client/assets/{pendingSendStore-Cc6n4Xji.js → pendingSendStore-CgfQk4GV.js} +2 -2
- package/dist/client/assets/{phoneViewer-CqawjVDW.js → phoneViewer-DJWjzgFc.js} +2 -2
- package/dist/client/assets/{pierre-icons-BfZ11Q2h.js → pierre-icons-fv1goMS6.js} +2 -2
- package/dist/client/assets/{popover-DnYfrQly.js → popover-DxCAIK62.js} +2 -2
- package/dist/client/assets/preview-Ce5ECOHv.js +2 -0
- package/dist/client/assets/{preview-Bi-hPWTp.js → preview-x1tmlUez.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-W10VSM09.js → previewMiniPlayerStore-CEd7VI6J.js} +2 -2
- package/dist/client/assets/{primary-CDuW5QwW.js → primary-DcnaBKM0.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BONYlcei.js → primaryCloudLinkState-TS0IW37f.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-Ck4wjfaq.js → projectFilesQueryState-DKw9S3nn.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-DgVU8tRa.js → projectScriptEditor-DT7-Ivvb.js} +2 -2
- package/dist/client/assets/{providerSkills-Dfc0PY_E.js → providerSkills-G8ld9nNp.js} +2 -2
- package/dist/client/assets/pullRequestDetail.logic-Dm3mx1US.js +10 -0
- package/dist/client/assets/{pullRequestIcons-DwblWS4R.js → pullRequestIcons-D8rnFTkk.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-Cc4bHb4o.js → pullRequestReviewStore-C45fih_P.js} +2 -2
- package/dist/client/assets/{pullRequests-BSjV3BBU.js → pullRequests-euX1Ch2G.js} +2 -2
- package/dist/client/assets/queries-DNRXml7d.js +2 -0
- package/dist/client/assets/query-Bw8YoCbO.js +2 -0
- package/dist/client/assets/{radio-group-EK7EPCn2.js → radio-group-DpD3XHAp.js} +2 -2
- package/dist/client/assets/{relay-Ceq0htTl.js → relay-YiJpGyaO.js} +2 -2
- package/dist/client/assets/{relayFailureReason-DfHD60Z_.js → relayFailureReason-Baxcpnas.js} +2 -2
- package/dist/client/assets/{renderScheduler-BGJGU9W9.js → renderScheduler-BuGbk7RK.js} +2 -2
- package/dist/client/assets/{rightPanelStore-AjYoRisO.js → rightPanelStore-BF1zmmXM.js} +2 -2
- package/dist/client/assets/runtime-DIAcbMTc.js +9 -0
- package/dist/client/assets/{runtimeModeConfig-Oh86kRYJ.js → runtimeModeConfig-4g_-_dE2.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-h-rZbNI3.js → scheduledTasksSettings.logic-BOrkdeD3.js} +3 -3
- package/dist/client/assets/{scroll-area-DhDCLqyU.js → scroll-area-CokPD3-i.js} +2 -2
- package/dist/client/assets/{select-CNcZzYBl.js → select-CxYi0YMi.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-CvQXlaMJ.js → selfImproveFindings-CE-lxRTw.js} +2 -2
- package/dist/client/assets/{server-Bw1ZPPkk.js → server-BNjk2K1j.js} +2 -2
- package/dist/client/assets/{session-YEQs2e4k.js → session-DMNo4Bh3.js} +2 -2
- package/dist/client/assets/{session-logic-BOQRidTa.js → session-logic-CELyWJ1v.js} +4 -4
- package/dist/client/assets/{settings-Dj9xov5g.js → settings-Bt6o5coA.js} +2 -2
- package/dist/client/assets/{settings.appearance-BFkpCG_N.js → settings.appearance-pkRxkhgs.js} +2 -2
- package/dist/client/assets/settings.archived-OjOh5b0A.js +2 -0
- package/dist/client/assets/{settings.computer-use-Bi6Yznts.js → settings.computer-use-Dh6Z2-Jg.js} +2 -2
- package/dist/client/assets/settings.connections-F3LWiK8-.js +2 -0
- package/dist/client/assets/{settings.data-controls-CMPajamk.js → settings.data-controls-DgOo9a4b.js} +2 -2
- package/dist/client/assets/{settings.decisions-BaYWexvw.js → settings.decisions-lQFEkC9t.js} +2 -2
- package/dist/client/assets/settings.designs-C1tyiETD.js +2 -0
- package/dist/client/assets/settings.diagnostics-kp_wJw6e.js +2 -0
- package/dist/client/assets/{settings.general-BqeVFfxZ.js → settings.general-B5Kke4t3.js} +2 -2
- package/dist/client/assets/{settings.integrations-CYmWtYZT.js → settings.integrations-CjiKCDy_.js} +2 -2
- package/dist/client/assets/{settings.keybindings-Rdl8b88k.js → settings.keybindings-CouYSmxE.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-C-Brz8iy.js → settings.open-source-licenses-CHFTLx1q.js} +2 -2
- package/dist/client/assets/settings.plugins-StUBBho3.js +5 -0
- package/dist/client/assets/{settings.projects-BTKNVvto.js → settings.projects-B_SxK9Cl.js} +4 -4
- package/dist/client/assets/settings.providers-Ch16WkgV.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-Da_-twWT.js → settings.scheduled-tasks-KNcUc94O.js} +2 -2
- package/dist/client/assets/{settings.secrets-B_ZY_xsv.js → settings.secrets-2aMmfgKR.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-lnIAMmUa.js → settings.snap-shot-B5cEBXZD.js} +2 -2
- package/dist/client/assets/settings.source-control-G_TX95re.js +2 -0
- package/dist/client/assets/settings.storage-BdNNKm9m.js +2 -0
- package/dist/client/assets/settingsLayout-CzGbLP4v.js +3 -0
- package/dist/client/assets/{sidebar-BUDllWET.js → sidebar-ovj9EiR4.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-xYoX3lLq.js → sidebarProjectGrouping-DT6LCDEX.js} +2 -2
- package/dist/client/assets/{skeleton-C6O21cqb.js → skeleton-0IEb3e4e.js} +2 -2
- package/dist/client/assets/sourceControl-CPobWWHq.js +2 -0
- package/dist/client/assets/{sourceControlClients-C3cHOUoL.js → sourceControlClients-4PlkytxQ.js} +2 -2
- package/dist/client/assets/{spinner-m1uNq_wW.js → spinner-7CSKKESP.js} +2 -2
- package/dist/client/assets/src-BVovWpja.js +15 -0
- package/dist/client/assets/{terminal-links-CxLXIwP1.js → terminal-links-BTdovUFa.js} +2 -2
- package/dist/client/assets/{terminalSessions-CXGA3pch.js → terminalSessions-EUiRWJti.js} +2 -2
- package/dist/client/assets/{textarea-xZYMC9X5.js → textarea-DMmmmGA1.js} +2 -2
- package/dist/client/assets/{themePalette-BcMO2M90.js → themePalette-C7ZOgucT.js} +2 -2
- package/dist/client/assets/{threadCheckpoints-DUorxvL1.js → threadCheckpoints-DjIk4Kvg.js} +2 -2
- package/dist/client/assets/{toggle-DumCe7R7.js → toggle-4vFx94TS.js} +2 -2
- package/dist/client/assets/{toggle-group-CzE2mG-B.js → toggle-group-d6H735Xi.js} +2 -2
- package/dist/client/assets/{tooltip-BhCWnsdW.js → tooltip-CGvxq8k3.js} +2 -2
- package/dist/client/assets/{uiStateStore-JOwhQqDV.js → uiStateStore-MbQdhAPp.js} +2 -2
- package/dist/client/assets/{usage-Blib8u_-.js → usage-Da_tm2dn.js} +2 -2
- package/dist/client/assets/{usageAccess-COKmar79.js → usageAccess-B-HGPPkp.js} +2 -2
- package/dist/client/assets/{usageFormat-2913AogD.js → usageFormat-DcON9Kz_.js} +2 -2
- package/dist/client/assets/{usageShortcuts-U_aRtpf7.js → usageShortcuts-B_o9XxKX.js} +2 -2
- package/dist/client/assets/{use-atom-command-DkmE-pw9.js → use-atom-command-C4Tyb1VL.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-BiZIzNf7.js → useAriaLabelledBy-CcwjH1QH.js} +2 -2
- package/dist/client/assets/useHandleNewThread-Qb_yy6KY.js +2 -0
- package/dist/client/assets/{useLocation-BXwb7I1F.js → useLocation-CIvcNoeU.js} +2 -2
- package/dist/client/assets/{useNavigate-P1p3Es15.js → useNavigate-DVrOlf8m.js} +2 -2
- package/dist/client/assets/{useNavigateBack-D02Al7yk.js → useNavigateBack-Dmf0SIc3.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-4l_tJOsn.js → useP4ConnectAuthPrompt-BPXqJdyY.js} +2 -2
- package/dist/client/assets/{useParams-DsmZTF__.js → useParams-BeJIRxxE.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-DeJYBk6u.js → usePermissionStatus-Cx1Wuwk0.js} +2 -2
- package/dist/client/assets/{usePopupViewport-BBKn7x_4.js → usePopupViewport-OR_PF2s-.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-DtDOHLgX.js → usePullRequestActions-B_Nrg846.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-DkFmgEzw.js → useRegisterFieldControl-B72Afmil.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-B-vTMNh_.js → useScopedModelAvailability-DVQ42jT4.js} +2 -2
- package/dist/client/assets/{useSettings-Dp27sUML.js → useSettings-BWMcQzC-.js} +2 -2
- package/dist/client/assets/{utils-BVnIIHXP.js → utils-DFNDxNZi.js} +21 -21
- package/dist/client/assets/{vcsRefInvalidation-DU1ipBl9.js → vcsRefInvalidation-CV8dYgi0.js} +2 -2
- package/dist/client/assets/{welcome-CmsT2lJW.js → welcome-BxhPM21H.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/client/third-party-licenses.json +1 -1
- package/dist/{mcpResponsePayloads-C8W7Qyxk.mjs → mcpResponsePayloads-SwQXsZoI.mjs} +3 -3
- package/dist/{preview-iNdhUsAa.mjs → preview-BGylKXB6.mjs} +235 -101
- package/dist/{renderer-DKOOIEoX.mjs → renderer-CQkeNW9b.mjs} +2 -2
- package/dist/{runtime-Bm_EVnst.mjs → runtime-O5AWAEzD.mjs} +3 -3
- package/dist/{runtimeLayer-hDhX2kHB.mjs → runtimeLayer-C-Fo4HWH.mjs} +1 -1
- package/dist/{runtimeLayer-CZ8Ru7Ia.mjs → runtimeLayer-ChPBglJB.mjs} +2298 -1209
- package/dist/{sdk-CcrYY4k4.mjs → sdk-C8tgjyIq.mjs} +29609 -23199
- package/dist/{server-qfCj2NpU.mjs → server-CsS0d2BE.mjs} +358 -88
- package/dist/{sha2-Daa2Fiv1.mjs → sha2-BjjJcoUu.mjs} +449 -24
- package/package.json +1 -1
- package/dist/AcpMcpStdioBridge-C9Ry_oCI.mjs +0 -3
- package/dist/client/assets/AlertDialogRoot-CNpt8h9w.js +0 -2
- package/dist/client/assets/ChatMarkdown-DO_2fTqM.js +0 -49
- package/dist/client/assets/Input-BT2VVALp.js +0 -2
- package/dist/client/assets/JZOYTAAL-BCzM9Qh2.js +0 -1
- package/dist/client/assets/KeybindingsSettings.logic-oAUXQqts.js +0 -2
- package/dist/client/assets/MathTypeset-DEcVZfaU.css +0 -1
- package/dist/client/assets/PreviewPanel-DIVx5x1H.js +0 -2
- package/dist/client/assets/ProviderModelPicker-rRVcFLyP.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-B77-xYz_.js +0 -5
- package/dist/client/assets/_chat-BA5cbHxE.js +0 -47
- package/dist/client/assets/_chat.new-Bw2VR60x.js +0 -4
- package/dist/client/assets/command-BdVxwZ8D.js +0 -2
- package/dist/client/assets/connect-agent-AVHGyda5.js +0 -2
- package/dist/client/assets/entities-JWl3bvMT.js +0 -2
- package/dist/client/assets/fileLinks-Y3tOmcmb.js +0 -2
- package/dist/client/assets/katex-DJhrJSbw.js +0 -258
- package/dist/client/assets/main-43D2LVmx.js +0 -38
- package/dist/client/assets/main-Rpw_0nEx.css +0 -2
- package/dist/client/assets/mediaReference-Bh7Pydqp.js +0 -2
- package/dist/client/assets/mediaSource-Do7lCSv7.js +0 -2
- package/dist/client/assets/preview-Dd9kGZBH.js +0 -2
- package/dist/client/assets/pullRequestDetail.logic-Dy7e4vh2.js +0 -10
- package/dist/client/assets/queries-BQAICaPF.js +0 -2
- package/dist/client/assets/query-DFSffMGJ.js +0 -2
- package/dist/client/assets/runtime-vb0YwEUc.js +0 -9
- package/dist/client/assets/settings.archived-D96oQP2t.js +0 -2
- package/dist/client/assets/settings.connections-C7OGFqf1.js +0 -2
- package/dist/client/assets/settings.designs-t7-jewWy.js +0 -2
- package/dist/client/assets/settings.diagnostics-qkp4kADk.js +0 -2
- package/dist/client/assets/settings.plugins-DAvzBYum.js +0 -5
- package/dist/client/assets/settings.providers-r89DCT90.js +0 -3
- package/dist/client/assets/settings.source-control-BIPVuyIo.js +0 -2
- package/dist/client/assets/settings.storage-vvoP_prr.js +0 -2
- package/dist/client/assets/settingsLayout-DaKDuaST.js +0 -3
- package/dist/client/assets/sourceControl-gh0Nj17P.js +0 -2
- package/dist/client/assets/src-DHn7yNZx.js +0 -15
- package/dist/client/assets/useHandleNewThread-C1YHLGL_.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ao as i,Df as a,Ef as o,Jo as s,Os as c,Pc as l,Pf as u,Wo as d,Zd as f,mr as p,op as m,t as h,wf as g,ys as _,zf as ee}from"./utils-DFNDxNZi.js";import{$i as te,Ec as v,Gc as y,Xc as b,fa as ne,kc as x,ra as re}from"./src-BVovWpja.js";import{Ar as ie,Tr as ae,wr as oe}from"./runtime-DIAcbMTc.js";import{a as se,h as ce,p as le}from"./relay-YiJpGyaO.js";import{J as ue,s as S}from"./useSettings-BWMcQzC-.js";import{f as de}from"./server-BNjk2K1j.js";import{i as fe,n as pe}from"./session-DMNo4Bh3.js";import{t as me}from"./use-atom-command-C4Tyb1VL.js";import{u as C}from"./rightPanelStore-BF1zmmXM.js";import{a as he}from"./fileLinks-BlT4My6t.js";import{t as ge}from"./toastHelpers-DxXYm50b.js";import{a as _e,n as w,t as T}from"./tooltip-CGvxq8k3.js";import{i as E,o as D,t as ve}from"./popover-DxCAIK62.js";import{t as O}from"./observeResize-DLmefMqO.js";import{S as ye,c as be,d as xe,n as Se,s as Ce,x as we}from"./browserHistoryStore-CVCo7qfb.js";import{S as Te,a as k,c as Ee,d as De,f as Oe,l as ke,p as A,u as Ae,x as je}from"./keybindings-8_1sqf8s.js";import{t as Me}from"./preview-Ce5ECOHv.js";import{n as Ne,r as Pe}from"./browserLinkTarget-CopcRHna.js";import{a as Fe,i as j,n as M,s as Ie,t as N}from"./terminal-links-BTdovUFa.js";import{a as Le,i as Re,o as ze,t as Be}from"./terminalSessions-EUiRWJti.js";import{t as Ve}from"./terminalLabels-BgLOlb2G.js";import{Io as He,bo as Ue,go as We,po as Ge,yo as Ke}from"./main-BFdCLmkY.js";var P=e(t(),1),qe=n(),F=e(r(),1);function Je(e){let{bounds:t,selectionRect:n,pointer:r,viewport:i}=e,a=r??{x:n?.right??t.left+t.width-140,y:n?n.bottom+4:t.top+12};return{x:Math.max(8,Math.min(Math.max(t.left,a.x),t.left+t.width,i.width-8)),y:Math.max(8,Math.min(Math.max(t.top,a.y),t.top+t.height,i.height-8))}}function I({element:e,getActionElement:t,onSelection:n,onDismiss:r}){let i=e.ownerDocument,a=i.defaultView,o=!1,s=!1,c=!1,l=null,u=null,d=null,f=e=>e!==null&&(t?.()?.contains(e)??!1),p=()=>{u!==null&&a.clearTimeout(u),d!==null&&a.cancelAnimationFrame(d),u=d=null},m=()=>{p(),o=s=!1,l=null,c=!0},h=()=>{m(),r(`cancel`)},g=()=>{m(),r(`interaction`)},_=e=>{p(),u=a.setTimeout(()=>{u=null,d=a.requestAnimationFrame(()=>{d=null,n(l)})},e)},ee=n=>{if(!n.isPrimary)return;if(f(n.target)){m();return}p(),o=n.button===0;let i=e.contains(n.target);s=!1,c=!0,l=null,i?r(`interaction`):t?.()&&r(`cancel`)},te=e=>{e.isPrimary&&(e.target?.closest(`button, [role=button]`)||(s=e.button===0&&!e.defaultPrevented,c=!s))},v=e=>{e.isPrimary&&e.button===0&&(o=!1)},y=e=>{e.button===0&&(o=!1,s&&(s=!1,l={x:e.clientX,y:e.clientY},_(e.detail>=2?500:0)))},b=e=>{f(e.target)&&e.key!==`Escape`||(e.key===`Escape`?h():o||(p(),s=!1,l=null,c=!1))},ne=e=>{f(e.target)?m():!o&&t?.()&&h()},x=()=>{p(),o||(l=null,c=!0),r(`cancel`)};return i.addEventListener(`pointerdown`,ee,!0),e.addEventListener(`pointerdown`,te),a.addEventListener(`pointerup`,v),a.addEventListener(`mouseup`,y),a.addEventListener(`pointercancel`,h),i.addEventListener(`keydown`,b),i.addEventListener(`focusin`,ne),e.addEventListener(`contextmenu`,g,!0),e.addEventListener(`scroll`,x,!0),a.addEventListener(`blur`,h),a.addEventListener(`resize`,h),{get pending(){return u!==null||d!==null},cancel:m,selectionChanged(){f(i.activeElement)||(o||s?r(`cancel`):!c&&u===null&&d===null&&_(0))},dispose(){m(),i.removeEventListener(`pointerdown`,ee,!0),e.removeEventListener(`pointerdown`,te),a.removeEventListener(`pointerup`,v),a.removeEventListener(`mouseup`,y),a.removeEventListener(`pointercancel`,h),i.removeEventListener(`keydown`,b),i.removeEventListener(`focusin`,ne),e.removeEventListener(`contextmenu`,g,!0),e.removeEventListener(`scroll`,x,!0),a.removeEventListener(`blur`,h),a.removeEventListener(`resize`,h)}}}var Ye=new Map(`Unidentified.Backquote.Backslash.BracketLeft.BracketRight.Comma.Digit0.Digit1.Digit2.Digit3.Digit4.Digit5.Digit6.Digit7.Digit8.Digit9.Equal.IntlBackslash.IntlRo.IntlYen.KeyA.KeyB.KeyC.KeyD.KeyE.KeyF.KeyG.KeyH.KeyI.KeyJ.KeyK.KeyL.KeyM.KeyN.KeyO.KeyP.KeyQ.KeyR.KeyS.KeyT.KeyU.KeyV.KeyW.KeyX.KeyY.KeyZ.Minus.Period.Quote.Semicolon.Slash.AltLeft.AltRight.Backspace.CapsLock.ContextMenu.ControlLeft.ControlRight.Enter.MetaLeft.MetaRight.ShiftLeft.ShiftRight.Space.Tab.Convert.KanaMode.NonConvert.Delete.End.Help.Home.Insert.PageDown.PageUp.ArrowDown.ArrowLeft.ArrowRight.ArrowUp.NumLock.Numpad0.Numpad1.Numpad2.Numpad3.Numpad4.Numpad5.Numpad6.Numpad7.Numpad8.Numpad9.NumpadAdd.NumpadBackspace.NumpadClear.NumpadClearEntry.NumpadComma.NumpadDecimal.NumpadDivide.NumpadEnter.NumpadEqual.NumpadMemoryAdd.NumpadMemoryClear.NumpadMemoryRecall.NumpadMemoryStore.NumpadMemorySubtract.NumpadMultiply.NumpadParenLeft.NumpadParenRight.NumpadSubtract.NumpadSeparator.NumpadArrowUp.NumpadArrowDown.NumpadArrowRight.NumpadArrowLeft.NumpadBegin.NumpadHome.NumpadEnd.NumpadInsert.NumpadDelete.NumpadPageUp.NumpadPageDown.Escape.F1.F2.F3.F4.F5.F6.F7.F8.F9.F10.F11.F12.F13.F14.F15.F16.F17.F18.F19.F20.F21.F22.F23.F24.F25.Fn.FnLock.PrintScreen.ScrollLock.Pause.BrowserBack.BrowserFavorites.BrowserForward.BrowserHome.BrowserRefresh.BrowserSearch.BrowserStop.Eject.LaunchApp1.LaunchApp2.LaunchMail.MediaPlayPause.MediaSelect.MediaStop.MediaTrackNext.MediaTrackPrevious.Power.Sleep.AudioVolumeDown.AudioVolumeMute.AudioVolumeUp.WakeUp.Copy.Cut.Paste`.split(`.`).map((e,t)=>[e,t]));function L(e){return Ye.get(e)??0}var Xe=new Map([[`!`,`1`],[`@`,`2`],[`#`,`3`],[`$`,`4`],[`%`,`5`],[`^`,`6`],[`&`,`7`],[`*`,`8`],[`(`,`9`],[`)`,`0`],[`~`,"`"],[`_`,`-`],[`+`,`=`],[`{`,`[`],[`}`,`]`],[`|`,`\\`],[`:`,`;`],[`"`,`'`],[`<`,`,`],[`>`,`.`],[`?`,`/`]]),R;function z(){if(R)return R;let e=(globalThis.navigator?.keyboard)?.getLayoutMap().catch(()=>void 0)??Promise.resolve(void 0);return R=e,e}function B(e,t=navigator.platform){return e.ctrlKey||e.metaKey||[...e.key].length!==1||e.altKey&&!l(t)?0:+!!e.shiftKey|(e.altKey?4:0)}function V(e,t){if([...e.key].length!==1)return 0;let n=t?.get(e.code);if(n&&[...n].length===1)return n.codePointAt(0)??0;if(/^[A-Z]$/u.test(e.key))return e.key.charCodeAt(0)+32;if(e.shiftKey){let t=Xe.get(e.key);if(t)return t.codePointAt(0)??0;let n=e.key.toLowerCase();return n!==e.key&&[...n].length===1?n.codePointAt(0)??0:0}return e.key.codePointAt(0)??0}var Ze=`/assets/ghostty-vt-DdA0Zryv.wasm`,Qe=`/assets/ghostty-write-pty-BWDOU6dy.wasm`,H=new TextDecoder,$e=class e{memory;layouts;exports;memoryView;memoryU8;ptyWriters=new Map;nextPtyWriterId=1;writePtyFunctionIndex=0;constructor(e){this.exports=e.exports;let t=e.exports.memory;if(!(t instanceof WebAssembly.Memory))throw Error(`libghostty-vt did not export WebAssembly memory`);this.memory=t,this.memoryView=new DataView(t.buffer),this.memoryU8=new Uint8Array(t.buffer);let n=this.call(`ghostty_type_json`),r=new Uint8Array(t.buffer),i=n;for(;i<r.length&&r[i]!==0;)i+=1;this.layouts=JSON.parse(H.decode(r.subarray(n,i)))}static async load(){let t=await fetch(Ze);if(!t.ok)throw Error(`Unable to load libghostty-vt (${t.status})`);let n,r=await WebAssembly.instantiate(await t.arrayBuffer(),{env:{log:(e,t)=>{if(!n)return;let r=n.exports.memory;if(!(r instanceof WebAssembly.Memory))return;let i=H.decode(new Uint8Array(r.buffer,e,t));console.debug(`[libghostty-vt]`,i)}}});n=r.instance;let i=new e(r.instance);return await i.installWritePtyTrampoline(),i}call(e,...t){return this.fn(e)(...t)}fn(e){let t=this.exports[e];if(typeof t!=`function`)throw Error(`libghostty-vt export is unavailable: ${e}`);return t}layout(e){let t=this.layouts[e];if(!t)throw Error(`libghostty-vt type layout is unavailable: ${e}`);return t}alloc(e){let t=this.call(`ghostty_wasm_alloc_u8_array`,e);if(t===0)throw Error(`libghostty-vt failed to allocate ${e} bytes`);return new Uint8Array(this.memory.buffer,t,e).fill(0),t}free(e,t){e!==0&&this.call(`ghostty_wasm_free_u8_array`,e,t)}allocOpaque(){let e=this.call(`ghostty_wasm_alloc_opaque`);if(e===0)throw Error(`libghostty-vt failed to allocate an opaque pointer`);return new DataView(this.memory.buffer).setUint32(e,0,!0),e}freeOpaque(e){e!==0&&this.call(`ghostty_wasm_free_opaque`,e)}readPointer(e){return this.memoryDataView().getUint32(e,!0)}attachPtyWriter(e,t){if(this.writePtyFunctionIndex===0)throw Error(`libghostty-vt PTY callback trampoline is unavailable`);let n=this.nextPtyWriterId++;return this.ptyWriters.set(n,t),this.call(`ghostty_terminal_set`,e,0,n),this.call(`ghostty_terminal_set`,e,1,this.writePtyFunctionIndex),n}detachPtyWriter(e,t){this.call(`ghostty_terminal_set`,e,1,0),this.call(`ghostty_terminal_set`,e,0,0),this.ptyWriters.delete(t)}view(e,t){return new DataView(this.memoryDataView().buffer,e,t)}bytes(e,t){return new Uint8Array(this.memoryDataView().buffer,e,t)}memoryDataView(){return this.refreshMemoryViews(),this.memoryView}memoryBytes(){return this.refreshMemoryViews(),this.memoryU8}refreshMemoryViews(){this.memoryU8.byteLength===0&&(this.memoryView=new DataView(this.memory.buffer),this.memoryU8=new Uint8Array(this.memory.buffer))}setField(e,t,n,r){let i=this.layout(t).fields[n];if(!i)throw Error(`libghostty-vt field is unavailable: ${t}.${n}`);let a=this.memoryDataView(),o=e+i.offset;switch(i.type){case`bool`:case`u8`:a.setUint8(o,r);return;case`u16`:a.setUint16(o,r,!0);return;case`i32`:a.setInt32(o,r,!0);return;case`u32`:case`enum`:a.setUint32(o,r,!0);return;case`u64`:a.setBigUint64(o,BigInt(r),!0);return;default:throw Error(`Unsupported libghostty-vt field type: ${i.type}`)}}readField(e,t,n){let r=this.layout(t).fields[n];if(!r)throw Error(`libghostty-vt field is unavailable: ${t}.${n}`);let i=this.memoryDataView(),a=e+r.offset;switch(r.type){case`bool`:case`u8`:return i.getUint8(a);case`u16`:return i.getUint16(a,!0);case`i32`:return i.getInt32(a,!0);case`u32`:case`enum`:return i.getUint32(a,!0);case`u64`:return Number(i.getBigUint64(a,!0));default:throw Error(`Unsupported libghostty-vt field type: ${r.type}`)}}async installWritePtyTrampoline(){let e=await fetch(Qe);if(!e.ok)throw Error(`Unable to load the libghostty-vt PTY trampoline (${e.status})`);let t=(await WebAssembly.instantiate(await e.arrayBuffer(),{env:{p4_write_pty:(e,t,n,r)=>{let i=this.ptyWriters.get(t);i&&r!==0&&i(H.decode(new Uint8Array(this.memory.buffer,n,r)))}}})).instance.exports.ghostty_write_pty,n=this.exports.__indirect_function_table;if(typeof t!=`function`||!(n instanceof WebAssembly.Table))throw Error(`libghostty-vt did not expose its callback table`);let r=n.length;n.grow(1),n.set(r,t),this.writePtyFunctionIndex=r}},U=null;function et(){return U??=$e.load().catch(e=>{throw U=null,e}),U}var W=0,G=-3,K=1e4,q=16,tt=768,J={cols:1,rows:2,dirty:3,rowIterator:4,background:5,foreground:6,cursor:7,cursorHasValue:8,cursorStyle:10,cursorVisible:11,cursorBlinking:12,cursorInViewport:14,cursorX:15,cursorY:16},Y={dirty:1,raw:2,cells:3},X={raw:1,style:2,graphemesLength:3,graphemes:4,background:5,foreground:6,selected:7},Z={keys:0,values:20,graphemesLength:40,selected:44,background:48,foreground:52,written:56,size:60},nt={wide:3},rt={narrow:0,wide:1,spacerTail:2,spacerHead:3},it=new TextDecoder,at=new TextEncoder;function ot(e,t){let n=(e,t)=>Math.floor((e*155+t*100)/255);return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b)}}function st(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b}function ct(e,t,n=0){if(t===1)return String.fromCodePoint(e.getUint32(n,!0));let r=4096,i=``;for(let a=0;a<t;a+=r){let o=Math.min(r,t-a),s=Array(o);for(let t=0;t<o;t+=1)s[t]=e.getUint32(n+(a+t)*4,!0);i+=String.fromCodePoint(...s)}return i}var lt=class e{runtime;terminalSlot=0;terminal=0;renderStateSlot=0;renderState=0;rowIteratorSlot=0;rowCellsSlot=0;keyEncoderSlot=0;keyEncoder=0;keyEventSlot=0;keyEvent=0;mouseEncoderSlot=0;mouseEncoder=0;mouseEventSlot=0;mouseEvent=0;ptyWriterId=0;ptyWriter=null;scratch=0;graphemes=0;graphemeCapacity=0;style=0;cellQuery=0;scrollbar=0;rows=[];disposed=!1;keyboardLayoutMap;constructor(e){this.runtime=e,z().then(e=>{this.disposed||(this.keyboardLayoutMap=e)})}static async create(t,n,r,i,a,o){let s=new e(await et());try{return s.initialize(t,n,r,i,a,o),s}catch(e){throw s.dispose(),e}}initialize(e,t,n,r,i,a){let o=this.runtime.layout(`GhosttyTerminalOptions`).size,s=this.runtime.alloc(o);this.runtime.setField(s,`GhosttyTerminalOptions`,`cols`,e),this.runtime.setField(s,`GhosttyTerminalOptions`,`rows`,t),this.runtime.setField(s,`GhosttyTerminalOptions`,`max_scrollback`,K),this.terminalSlot=this.runtime.allocOpaque();let c=this.runtime.call(`ghostty_terminal_new`,0,this.terminalSlot,s);this.runtime.free(s,o),this.assertSuccess(`ghostty_terminal_new`,c),this.terminal=this.runtime.readPointer(this.terminalSlot),this.applyDefaultCursorBlink(),this.ptyWriter=a,this.ptyWriterId=this.runtime.attachPtyWriter(this.terminal,a),this.renderStateSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_render_state_new`,this.runtime.call(`ghostty_render_state_new`,0,this.renderStateSlot)),this.renderState=this.runtime.readPointer(this.renderStateSlot),this.rowIteratorSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_render_state_row_iterator_new`,this.runtime.call(`ghostty_render_state_row_iterator_new`,0,this.rowIteratorSlot)),this.rowCellsSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_render_state_row_cells_new`,this.runtime.call(`ghostty_render_state_row_cells_new`,0,this.rowCellsSlot)),this.keyEncoderSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_key_encoder_new`,this.runtime.call(`ghostty_key_encoder_new`,0,this.keyEncoderSlot)),this.keyEncoder=this.runtime.readPointer(this.keyEncoderSlot),this.keyEventSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_key_event_new`,this.runtime.call(`ghostty_key_event_new`,0,this.keyEventSlot)),this.keyEvent=this.runtime.readPointer(this.keyEventSlot),this.mouseEncoderSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_mouse_encoder_new`,this.runtime.call(`ghostty_mouse_encoder_new`,0,this.mouseEncoderSlot)),this.mouseEncoder=this.runtime.readPointer(this.mouseEncoderSlot),this.mouseEventSlot=this.runtime.allocOpaque(),this.assertSuccess(`ghostty_mouse_event_new`,this.runtime.call(`ghostty_mouse_event_new`,0,this.mouseEventSlot)),this.mouseEvent=this.runtime.readPointer(this.mouseEventSlot),this.scratch=this.runtime.alloc(16);let l=this.runtime.layout(`GhosttyStyle`).size;this.style=this.runtime.alloc(l),this.runtime.setField(this.style,`GhosttyStyle`,`size`,l),this.cellQuery=this.runtime.alloc(Z.size);let u=this.runtime.memoryDataView(),d=[[X.style,this.style],[X.graphemesLength,this.cellQuery+Z.graphemesLength],[X.selected,this.cellQuery+Z.selected],[X.background,this.cellQuery+Z.background],[X.foreground,this.cellQuery+Z.foreground]];for(let[e,[t,n]]of d.entries())u.setUint32(this.cellQuery+Z.keys+e*4,t,!0),u.setUint32(this.cellQuery+Z.values+e*4,n,!0);this.scrollbar=this.runtime.alloc(this.runtime.layout(`GhosttyTerminalScrollbar`).size),this.setTheme(i),this.resize(e,t,n,r)}write(e){this.ensureActive();let t=typeof e==`string`?at.encode(e):e;if(t.length===0)return;let n=this.runtime.alloc(t.length);this.runtime.bytes(n,t.length).set(t),this.runtime.call(`ghostty_terminal_vt_write`,this.terminal,n,t.length),this.runtime.free(n,t.length)}resetAndWrite(e){if(this.ensureActive(),this.runtime.call(`ghostty_terminal_reset`,this.terminal),this.applyDefaultCursorBlink(),this.rows=[],e.length===0)return;let t=this.ptyWriter;this.ptyWriterId!==0&&(this.runtime.detachPtyWriter(this.terminal,this.ptyWriterId),this.ptyWriterId=0);try{this.write(e)}finally{t!==null&&!this.disposed&&(this.ptyWriterId=this.runtime.attachPtyWriter(this.terminal,t))}}resize(e,t,n,r){this.ensureActive(),this.assertSuccess(`ghostty_terminal_resize`,this.runtime.call(`ghostty_terminal_resize`,this.terminal,Math.max(1,Math.min(65535,e)),Math.max(1,Math.min(65535,t)),Math.max(1,Math.round(n)),Math.max(1,Math.round(r))))}applyDefaultCursorBlink(){let e=this.runtime.alloc(1);this.runtime.bytes(e,1)[0]=1,this.runtime.call(`ghostty_terminal_set`,this.terminal,23,e),this.runtime.free(e,1)}setTheme(e){this.ensureActive();let t=this.runtime.alloc(3);for(let[n,r]of[[11,e.foreground],[12,e.background],[13,e.cursor]])this.runtime.bytes(t,3).set([r.r,r.g,r.b]),this.runtime.call(`ghostty_terminal_set`,this.terminal,n,t);this.runtime.free(t,3),e.palette&&this.setPalette(e.palette)}setPalette(e){let t=this.runtime.alloc(tt);this.runtime.call(`ghostty_terminal_get`,this.terminal,25,t);let n=this.runtime.bytes(t,tt);e.slice(0,16).forEach((e,t)=>{n.set([e.r,e.g,e.b],t*3)}),this.runtime.call(`ghostty_terminal_set`,this.terminal,14,t),this.runtime.free(t,tt)}scroll(e){this.ensureActive();let t=this.runtime.layout(`GhosttyTerminalScrollViewport`),n=this.runtime.alloc(t.size);this.runtime.setField(n,`GhosttyTerminalScrollViewport`,`tag`,2);let r=t.fields.value;this.runtime.view(n+r.offset,r.size).setInt32(0,e,!0),this.runtime.call(`ghostty_terminal_scroll_viewport`,this.terminal,n),this.runtime.free(n,t.size)}scrollToBottom(){this.ensureActive();let e=this.runtime.layout(`GhosttyTerminalScrollViewport`),t=this.runtime.alloc(e.size);this.runtime.setField(t,`GhosttyTerminalScrollViewport`,`tag`,1),this.runtime.call(`ghostty_terminal_scroll_viewport`,this.terminal,t),this.runtime.free(t,e.size)}isViewportActive(){return this.ensureActive(),this.runtime.bytes(this.scratch,1)[0]=0,this.runtime.call(`ghostty_terminal_get`,this.terminal,32,this.scratch)===W&&this.runtime.bytes(this.scratch,1)[0]!==0}scrollbarState(){this.ensureActive();let e=this.runtime.layout(`GhosttyTerminalScrollbar`);return this.runtime.bytes(this.scrollbar,e.size).fill(0),this.runtime.call(`ghostty_terminal_get`,this.terminal,9,this.scrollbar)===W?{total:this.runtime.readField(this.scrollbar,`GhosttyTerminalScrollbar`,`total`),offset:this.runtime.readField(this.scrollbar,`GhosttyTerminalScrollbar`,`offset`),len:this.runtime.readField(this.scrollbar,`GhosttyTerminalScrollbar`,`len`)}:null}isMouseTracking(){return this.ensureActive(),this.runtime.bytes(this.scratch,1)[0]=0,this.runtime.call(`ghostty_terminal_get`,this.terminal,11,this.scratch)===W&&this.runtime.bytes(this.scratch,1)[0]!==0}isMouseAnyEventTracking(){return this.ensureActive(),this.runtime.bytes(this.scratch,1)[0]=0,this.runtime.call(`ghostty_terminal_mode_get`,this.terminal,1003,this.scratch)===W&&this.runtime.bytes(this.scratch,1)[0]!==0}isAlternateScreen(){return this.ensureActive(),this.runtime.bytes(this.scratch,4).fill(0),this.runtime.call(`ghostty_terminal_get`,this.terminal,6,this.scratch)===W&&this.runtime.view(this.scratch,4).getUint32(0,!0)===1}isApplicationCursorKeys(){return this.ensureActive(),this.runtime.bytes(this.scratch,1)[0]=0,this.runtime.call(`ghostty_terminal_mode_get`,this.terminal,1,this.scratch)===W&&this.runtime.bytes(this.scratch,1)[0]!==0}encodeKey(e,t=`press`){this.ensureActive(),this.runtime.call(`ghostty_key_encoder_setopt_from_terminal`,this.keyEncoder,this.terminal),this.runtime.call(`ghostty_key_event_set_action`,this.keyEvent,t===`release`?0:e.repeat?2:1),this.runtime.call(`ghostty_key_event_set_key`,this.keyEvent,L(e.code));let n=+!!e.shiftKey|(e.ctrlKey?2:0)|(e.altKey?4:0)|(e.metaKey?8:0)|(e.getModifierState(`CapsLock`)?16:0)|(e.getModifierState(`NumLock`)?32:0);this.runtime.call(`ghostty_key_event_set_mods`,this.keyEvent,n),this.runtime.call(`ghostty_key_event_set_consumed_mods`,this.keyEvent,B(e)),this.runtime.call(`ghostty_key_event_set_composing`,this.keyEvent,+!!e.isComposing),this.runtime.call(`ghostty_key_event_set_unshifted_codepoint`,this.keyEvent,V(e,this.keyboardLayoutMap));let r=e.key.length===1?e.key:``,i=at.encode(r),a=i.length===0?0:this.runtime.alloc(i.length);a!==0&&this.runtime.bytes(a,i.length).set(i),this.runtime.call(`ghostty_key_event_set_utf8`,this.keyEvent,a,i.length);let o=this.runtime.call(`ghostty_wasm_alloc_usize`),s=this.encodeOutput(o,(e,t)=>this.runtime.call(`ghostty_key_encoder_encode`,this.keyEncoder,this.keyEvent,e,t,o));return this.runtime.call(`ghostty_wasm_free_usize`,o),a!==0&&this.runtime.free(a,i.length),s}encodePaste(e){this.ensureActive();let t=at.encode(e);if(t.length===0)return``;let n=this.runtime.alloc(t.length);this.runtime.bytes(n,t.length).set(t),this.runtime.bytes(this.scratch,1)[0]=0;let r=this.runtime.call(`ghostty_terminal_mode_get`,this.terminal,2004,this.scratch)===W&&this.runtime.bytes(this.scratch,1)[0]!==0,i=this.runtime.call(`ghostty_wasm_alloc_usize`),a=``,o=this.runtime.call(`ghostty_paste_encode`,n,t.length,+!!r,0,0,i),s=this.runtime.view(i,4).getUint32(0,!0);if(o===G&&s>0){let e=this.runtime.alloc(s),o=this.runtime.call(`ghostty_paste_encode`,n,t.length,+!!r,e,s,i),c=this.runtime.view(i,4).getUint32(0,!0);a=o===W?it.decode(this.runtime.bytes(e,c)):``,this.runtime.free(e,s)}return this.runtime.call(`ghostty_wasm_free_usize`,i),this.runtime.free(n,t.length),a}encodeMouse(e){this.ensureActive(),this.runtime.call(`ghostty_mouse_encoder_setopt_from_terminal`,this.mouseEncoder,this.terminal);let t=this.runtime.layout(`GhosttyMouseEncoderSize`),n=this.runtime.alloc(t.size);for(let[r,i]of[[`size`,t.size],[`screen_width`,e.screenWidth],[`screen_height`,e.screenHeight],[`cell_width`,e.cellWidth],[`cell_height`,e.cellHeight],[`padding_top`,e.paddingTop],[`padding_bottom`,e.paddingBottom],[`padding_right`,e.paddingRight],[`padding_left`,e.paddingLeft]])this.runtime.setField(n,`GhosttyMouseEncoderSize`,r,Math.max(0,Math.round(i)));this.runtime.call(`ghostty_mouse_encoder_setopt`,this.mouseEncoder,2,n),this.runtime.free(n,t.size),this.runtime.bytes(this.scratch,1)[0]=+!!e.anyButtonPressed,this.runtime.call(`ghostty_mouse_encoder_setopt`,this.mouseEncoder,3,this.scratch),this.runtime.bytes(this.scratch,1)[0]=1,this.runtime.call(`ghostty_mouse_encoder_setopt`,this.mouseEncoder,4,this.scratch),this.runtime.call(`ghostty_mouse_event_set_action`,this.mouseEvent,e.action===`press`?0:e.action===`release`?1:2),e.button===null?this.runtime.call(`ghostty_mouse_event_clear_button`,this.mouseEvent):this.runtime.call(`ghostty_mouse_event_set_button`,this.mouseEvent,e.button),this.runtime.call(`ghostty_mouse_event_set_mods`,this.mouseEvent,e.mods);let r=this.runtime.layout(`GhosttyMousePosition`),i=this.runtime.alloc(r.size),a=this.runtime.view(i,r.size);a.setFloat32(r.fields.x.offset,e.x,!0),a.setFloat32(r.fields.y.offset,e.y,!0),this.runtime.call(`ghostty_mouse_event_set_position`,this.mouseEvent,i),this.runtime.free(i,r.size);let o=this.runtime.call(`ghostty_wasm_alloc_usize`),s=this.encodeOutput(o,(e,t)=>this.runtime.call(`ghostty_mouse_encoder_encode`,this.mouseEncoder,this.mouseEvent,e,t,o));return this.runtime.call(`ghostty_wasm_free_usize`,o),s}setSelection(e,t){this.ensureActive();let n=this.runtime.layout(`GhosttySelection`),r=this.runtime.layout(`GhosttyGridRef`).size,i=this.runtime.alloc(n.size),a=0,o=0;try{this.runtime.setField(i,`GhosttySelection`,`size`,n.size),a=this.gridRef(e.x,e.y,e.tag??1),o=this.gridRef(t.x,t.y,t.tag??1);let r=n.fields.start,s=n.fields.end;this.runtime.bytes(i+r.offset,r.size).set(this.runtime.bytes(a,r.size)),this.runtime.bytes(i+s.offset,s.size).set(this.runtime.bytes(o,s.size)),this.runtime.call(`ghostty_terminal_set`,this.terminal,21,i)}finally{this.runtime.free(a,r),this.runtime.free(o,r),this.runtime.free(i,n.size)}}selectAll(){this.ensureActive();let e=this.runtime.layout(`GhosttySelection`),t=this.runtime.alloc(e.size);try{if(this.runtime.setField(t,`GhosttySelection`,`size`,e.size),this.runtime.call(`ghostty_terminal_select_all`,this.terminal,t)!==W)return null;let n=this.pointFromGridRef(t+e.fields.start.offset,2),r=this.pointFromGridRef(t+e.fields.end.offset,2);return!n||!r?null:(this.runtime.call(`ghostty_terminal_set`,this.terminal,21,t),{start:n,end:r})}finally{this.runtime.free(t,e.size)}}selectionRange(){this.ensureActive();let e=this.runtime.layout(`GhosttySelection`),t=this.runtime.alloc(e.size);try{if(this.runtime.setField(t,`GhosttySelection`,`size`,e.size),this.runtime.call(`ghostty_terminal_get`,this.terminal,31,t)!==W)return null;let n=this.pointFromGridRef(t+e.fields.start.offset,2),r=this.pointFromGridRef(t+e.fields.end.offset,2);return n&&r?{start:n,end:r}:null}finally{this.runtime.free(t,e.size)}}selectWord(e,t){return this.selectAt(`GhosttyTerminalSelectWordOptions`,`ghostty_terminal_select_word`,e,t)}selectLine(e,t){return this.selectAt(`GhosttyTerminalSelectLineOptions`,`ghostty_terminal_select_line`,e,t)}hyperlinkAt(e,t){this.ensureActive();let n=this.gridRef(e,t),r=this.runtime.call(`ghostty_wasm_alloc_usize`),i=this.runtime.call(`ghostty_grid_ref_hyperlink_uri`,n,0,0,r),a=this.runtime.view(r,4).getUint32(0,!0),o=null;if(i===G&&a>0){let e=this.runtime.alloc(a),t=this.runtime.call(`ghostty_grid_ref_hyperlink_uri`,n,e,a,r),i=this.runtime.view(r,4).getUint32(0,!0);t===W&&i>0&&(o=it.decode(this.runtime.bytes(e,i))),this.runtime.free(e,a)}return this.runtime.call(`ghostty_wasm_free_usize`,r),this.runtime.free(n,this.runtime.layout(`GhosttyGridRef`).size),o}clearSelection(){this.ensureActive(),this.runtime.call(`ghostty_terminal_set`,this.terminal,21,0)}snapshot(){this.ensureActive(),this.assertSuccess(`ghostty_render_state_update`,this.runtime.call(`ghostty_render_state_update`,this.renderState,this.terminal));let e=this.getU16(J.cols),t=this.getU16(J.rows),n=this.getU32(J.dirty),r=this.getColor(J.foreground,{r:229,g:231,b:235}),i=this.getColor(J.background,{r:0,g:0,b:0}),a=this.getBool(J.cursorHasValue)?this.getColor(J.cursor,r):r,o=this.getBool(J.cursorInViewport),s=this.getBool(J.cursorVisible)&&o,c=o?this.getU16(J.cursorX):-1,l=o?this.getU16(J.cursorY):-1;(this.rows.length!==t||this.rows.some(t=>t.cells.length!==e))&&(this.rows=Array.from({length:t},()=>({cells:Array.from({length:e},()=>this.emptyCell(r,i)),text:``,isWrapContinuation:!1,wrapsToNext:!1})));let u=new Set;if(n!==0){this.assertSuccess(`ghostty_render_state_get(row iterator)`,this.runtime.call(`ghostty_render_state_get`,this.renderState,J.rowIterator,this.rowIteratorSlot));let a=this.runtime.readPointer(this.rowIteratorSlot),o=0;for(;o<t&&this.runtime.call(`ghostty_render_state_row_iterator_next`,a)!==0;)(n===2||this.getRowBool(a,Y.dirty))&&(this.rows[o]=this.readRow(a,e,r,i),u.add(o),this.runtime.memoryBytes()[this.scratch]=0,this.runtime.call(`ghostty_render_state_row_set`,a,0,this.scratch)),o+=1;this.runtime.memoryDataView().setUint32(this.scratch,0,!0),this.runtime.call(`ghostty_render_state_set`,this.renderState,0,this.scratch)}return{cols:e,rows:t,foreground:r,background:i,cursor:a,cursorX:c,cursorY:l,cursorVisible:s,cursorBlinking:this.getBool(J.cursorBlinking),cursorStyle:this.getU32(J.cursorStyle),dirtyRows:u,rowData:this.rows}}selectionText(){this.ensureActive();let e=this.runtime.alloc(q),t=this.runtime.view(e,q);t.setUint32(0,q,!0),t.setUint32(4,0,!0),t.setUint8(8,1),t.setUint8(9,1),t.setUint32(12,0,!0);let n=this.runtime.call(`ghostty_wasm_alloc_usize`),r=this.runtime.call(`ghostty_terminal_selection_format_buf`,this.terminal,e,0,0,n),i=this.runtime.view(n,4).getUint32(0,!0),a=``;if(r===G&&i>0){let t=this.runtime.alloc(i),r=this.runtime.call(`ghostty_terminal_selection_format_buf`,this.terminal,e,t,i,n),o=this.runtime.view(n,4).getUint32(0,!0);r===W&&(a=it.decode(this.runtime.bytes(t,o))),this.runtime.free(t,i)}return this.runtime.call(`ghostty_wasm_free_usize`,n),this.runtime.free(e,q),a}viewportPointToScreen(e,t){return this.convertPoint(e,t,1,2)}screenPointToViewport(e,t){return this.convertPoint(e,t,2,1)}convertPoint(e,t,n,r){this.ensureActive();let i=this.gridRef(e,t,n),a=this.pointFromGridRef(i,r);return this.runtime.free(i,this.runtime.layout(`GhosttyGridRef`).size),a}dispose(){if(!this.disposed){if(this.disposed=!0,this.mouseEvent&&this.runtime.call(`ghostty_mouse_event_free`,this.mouseEvent),this.mouseEncoder&&this.runtime.call(`ghostty_mouse_encoder_free`,this.mouseEncoder),this.keyEvent&&this.runtime.call(`ghostty_key_event_free`,this.keyEvent),this.keyEncoder&&this.runtime.call(`ghostty_key_encoder_free`,this.keyEncoder),this.rowCellsSlot){let e=this.runtime.readPointer(this.rowCellsSlot);e&&this.runtime.call(`ghostty_render_state_row_cells_free`,e)}if(this.rowIteratorSlot){let e=this.runtime.readPointer(this.rowIteratorSlot);e&&this.runtime.call(`ghostty_render_state_row_iterator_free`,e)}this.renderState&&this.runtime.call(`ghostty_render_state_free`,this.renderState),this.terminal&&(this.ptyWriterId&&this.runtime.detachPtyWriter(this.terminal,this.ptyWriterId),this.runtime.call(`ghostty_terminal_free`,this.terminal)),this.style&&this.runtime.free(this.style,this.runtime.layout(`GhosttyStyle`).size),this.cellQuery&&this.runtime.free(this.cellQuery,Z.size),this.scrollbar&&this.runtime.free(this.scrollbar,this.runtime.layout(`GhosttyTerminalScrollbar`).size),this.scratch&&this.runtime.free(this.scratch,16),this.graphemes&&this.runtime.free(this.graphemes,this.graphemeCapacity);for(let e of[this.mouseEventSlot,this.mouseEncoderSlot,this.keyEventSlot,this.keyEncoderSlot,this.rowCellsSlot,this.rowIteratorSlot,this.renderStateSlot,this.terminalSlot])this.runtime.freeOpaque(e)}}encodeOutput(e,t){let n=t(0,0),r=this.runtime.view(e,4).getUint32(0,!0);if(n===W&&r===0||n!==G||r===0)return``;let i=this.runtime.alloc(r),a=t(i,r),o=this.runtime.view(e,4).getUint32(0,!0),s=a===W?it.decode(this.runtime.bytes(i,o)):``;return this.runtime.free(i,r),s}readRow(e,t,n,r){this.assertSuccess(`ghostty_render_state_row_get(raw)`,this.runtime.call(`ghostty_render_state_row_get`,e,Y.raw,this.scratch));let i=this.runtime.memoryDataView().getBigUint64(this.scratch,!0);this.runtime.memoryBytes()[this.scratch+8]=0,this.assertSuccess(`ghostty_row_get(wrap continuation)`,this.runtime.call(`ghostty_row_get`,i,2,this.scratch+8));let a=this.runtime.memoryBytes()[this.scratch+8]!==0;this.runtime.memoryBytes()[this.scratch+8]=0,this.assertSuccess(`ghostty_row_get(wrap)`,this.runtime.call(`ghostty_row_get`,i,1,this.scratch+8));let o=this.runtime.memoryBytes()[this.scratch+8]!==0;this.assertSuccess(`ghostty_render_state_row_get(cells)`,this.runtime.call(`ghostty_render_state_row_get`,e,Y.cells,this.rowCellsSlot));let s=this.runtime.readPointer(this.rowCellsSlot),{size:c,fields:l}=this.runtime.layout(`GhosttyStyle`),u=this.runtime.fn(`ghostty_render_state_row_cells_next`),d=this.runtime.fn(`ghostty_render_state_row_cells_get_multi`),f=[];for(;f.length<t&&u(s)!==0;){this.runtime.memoryBytes().fill(0,this.style,this.style+c),this.runtime.setField(this.style,`GhosttyStyle`,`size`,c);let e=d(s,5,this.cellQuery+Z.keys,this.cellQuery+Z.values,this.cellQuery+Z.written),i=this.runtime.memoryDataView(),a=i.getUint32(this.cellQuery+Z.written,!0);a<3&&this.assertSuccess(`ghostty_render_state_row_cells_get_multi`,e);let o=i.getUint32(this.cellQuery+Z.graphemesLength,!0),u=i.getUint8(this.cellQuery+Z.selected)!==0,p=a>=4?this.readColor(this.cellQuery+Z.background):r,m=a===5?this.readColor(this.cellQuery+Z.foreground):a===3?this.getCellColor(s,X.foreground,n):n,h=``;if(o>0){let e=o*4;if(e>this.graphemeCapacity){let t=Math.max(e,this.graphemeCapacity*2),n=this.runtime.alloc(t);this.runtime.free(this.graphemes,this.graphemeCapacity),this.graphemes=n,this.graphemeCapacity=t}this.runtime.call(`ghostty_render_state_row_cells_get`,s,X.graphemes,this.graphemes)===W&&(h=ct(this.runtime.memoryDataView(),o,this.graphemes))}let g=0;if(h.length===0&&(f.at(-1)?.text.length||f.length===t-1)){this.assertSuccess(`ghostty_render_state_row_cells_get(raw)`,this.runtime.call(`ghostty_render_state_row_cells_get`,s,X.raw,this.scratch));let e=this.runtime.memoryDataView().getBigUint64(this.scratch,!0);this.runtime.memoryDataView().setUint32(this.scratch+8,0,!0),this.assertSuccess(`ghostty_cell_get(wide)`,this.runtime.call(`ghostty_cell_get`,e,nt.wide,this.scratch+8)),g=this.runtime.memoryDataView().getUint32(this.scratch+8,!0)}let _=this.runtime.memoryDataView();_.getUint8(this.style+l.inverse.offset)!==0&&([m,p]=[p,m]),_.getUint8(this.style+l.faint.offset)!==0&&(m=ot(m,p)),f.push({text:h,wide:g,foreground:m,background:p,bold:_.getUint8(this.style+l.bold.offset)!==0,italic:_.getUint8(this.style+l.italic.offset)!==0,invisible:_.getUint8(this.style+l.invisible.offset)!==0,strikethrough:_.getUint8(this.style+l.strikethrough.offset)!==0,overline:_.getUint8(this.style+l.overline.offset)!==0,underline:_.getInt32(this.style+l.underline.offset,!0)!==0,selected:u})}for(;f.length<t;)f.push(this.emptyCell(n,r));return{cells:f,text:f.map(e=>e.text||` `).join(``).trimEnd(),isWrapContinuation:a,wrapsToNext:o}}gridRef(e,t,n=1){let r=this.runtime.layout(`GhosttyPoint`),i=this.runtime.alloc(r.size);this.runtime.setField(i,`GhosttyPoint`,`tag`,n);let a=r.fields.value,o=a.offset,s=this.runtime.view(i+o,a.size);s.setUint16(0,Math.max(0,e),!0),s.setUint32(4,Math.max(0,t),!0);let c=this.runtime.layout(`GhosttyGridRef`).size,l=this.runtime.alloc(c);this.runtime.setField(l,`GhosttyGridRef`,`size`,c);let u=this.runtime.call(`ghostty_terminal_grid_ref`,this.terminal,i,l);return this.runtime.free(i,r.size),u!==W&&(this.runtime.free(l,c),this.assertSuccess(`ghostty_terminal_grid_ref`,u)),l}selectAt(e,t,n,r){this.ensureActive();let i=this.runtime.layout(e),a=this.runtime.layout(`GhosttySelection`),o=this.runtime.alloc(i.size),s=0,c=0,l=null;try{this.runtime.setField(o,e,`size`,i.size),s=this.gridRef(n,r);let u=i.fields.ref;if(this.runtime.bytes(o+u.offset,u.size).set(this.runtime.bytes(s,u.size)),c=this.runtime.alloc(a.size),this.runtime.setField(c,`GhosttySelection`,`size`,a.size),this.runtime.call(t,this.terminal,o,c)===W){let e=c+a.fields.start.offset,t=c+a.fields.end.offset,n=this.pointFromGridRef(e,1),r=this.pointFromGridRef(t,1),i=this.pointFromGridRef(e,2),o=this.pointFromGridRef(t,2);n&&r&&i&&o&&(l={viewport:{start:n,end:r},screen:{start:i,end:o}}),this.runtime.call(`ghostty_terminal_set`,this.terminal,21,c)}}finally{this.runtime.free(c,a.size),this.runtime.free(s,this.runtime.layout(`GhosttyGridRef`).size),this.runtime.free(o,i.size)}return l}pointFromGridRef(e,t){let n=this.runtime.layout(`GhosttyPointCoordinate`),r=this.runtime.alloc(n.size),i=this.runtime.call(`ghostty_terminal_point_from_grid_ref`,this.terminal,e,t,r)===W?{x:this.runtime.readField(r,`GhosttyPointCoordinate`,`x`),y:this.runtime.readField(r,`GhosttyPointCoordinate`,`y`)}:null;return this.runtime.free(r,n.size),i}getU16(e){return this.runtime.memoryDataView().setUint16(this.scratch,0,!0),this.assertSuccess(`ghostty_render_state_get`,this.runtime.call(`ghostty_render_state_get`,this.renderState,e,this.scratch)),this.runtime.memoryDataView().getUint16(this.scratch,!0)}getU32(e){return this.runtime.memoryDataView().setUint32(this.scratch,0,!0),this.assertSuccess(`ghostty_render_state_get`,this.runtime.call(`ghostty_render_state_get`,this.renderState,e,this.scratch)),this.runtime.memoryDataView().getUint32(this.scratch,!0)}getBool(e){return this.runtime.memoryBytes()[this.scratch]=0,this.assertSuccess(`ghostty_render_state_get`,this.runtime.call(`ghostty_render_state_get`,this.renderState,e,this.scratch)),this.runtime.memoryBytes()[this.scratch]!==0}getColor(e,t){return this.runtime.memoryBytes().fill(0,this.scratch,this.scratch+3),this.runtime.call(`ghostty_render_state_get`,this.renderState,e,this.scratch)===W?this.readColor(this.scratch):t}getRowBool(e,t){return this.runtime.memoryBytes()[this.scratch]=0,this.runtime.call(`ghostty_render_state_row_get`,e,t,this.scratch)===W&&this.runtime.memoryBytes()[this.scratch]!==0}getCellColor(e,t,n){return this.runtime.memoryBytes().fill(0,this.scratch,this.scratch+3),this.runtime.call(`ghostty_render_state_row_cells_get`,e,t,this.scratch)===W?this.readColor(this.scratch):n}readColor(e){let t=this.runtime.memoryDataView();return{r:t.getUint8(e),g:t.getUint8(e+1),b:t.getUint8(e+2)}}emptyCell(e,t){return{text:``,wide:0,foreground:e,background:t,bold:!1,italic:!1,invisible:!1,strikethrough:!1,overline:!1,underline:!1,selected:!1}}assertSuccess(e,t){if(t!==W)throw Error(`${e} failed with result ${t}`)}ensureActive(){if(this.disposed)throw Error(`libghostty-vt terminal has been disposed`)}};function ut(e,t){return st(e,t)}var dt=`rgba(72, 122, 191, 0.35)`;function Q(e){return`rgb(${e.r}, ${e.g}, ${e.b})`}function ft(e,t){return ut(e.foreground,t.foreground)&&e.bold===t.bold&&e.italic===t.italic&&e.invisible===t.invisible}function pt(e,t,n){let r=t+1;for(;r<e.length;){let t=e[r];if(!t)break;if(t.wide===rt.spacerTail)r+=1;else{if(t.text.length===0||!n(t))break;r+=1}}return r}function mt(e,t,n){return`${e.italic?`italic`:`normal`} ${e.bold?`700`:`400`} ${t}px ${n}`}function ht(e,t,n){e.font=`normal 400 ${t}px ${n}`;let r=e.measureText(`M`),i=e.measureText(`Mg`),a=i.actualBoundingBoxAscent||t,o=a+i.actualBoundingBoxDescent,s=Math.max(1,Math.round(t*1.35),Math.ceil(o));return{width:Math.max(1,r.width),height:s,baseline:Math.round((s-o)/2+a)}}function gt(e,t,n,r){return{cols:Math.max(1,Math.floor((e-r*2)/n.width)),rows:Math.max(1,Math.floor((t-r*2)/n.height))}}function _t(e){let{context:t,snapshot:n,metrics:r,fontSize:i,fontFamily:a,padding:o,forceFull:s,cursorOn:c,previousCursorY:l}=e,u=e.focused??!0,d=e.selectionBackground??dt,f=e.hoveredLinkRange??null,p=e.originY??o,m=s?Array.from({length:n.rows},(e,t)=>t):[...n.dirtyRows];l!=null&&l>=0&&!m.includes(l)&&m.push(l),n.cursorVisible&&n.cursorY>=0&&!m.includes(n.cursorY)&&m.push(n.cursorY),s&&(t.save(),t.resetTransform(),t.fillStyle=Q(n.background),t.fillRect(0,0,t.canvas.width,t.canvas.height),t.restore()),t.textBaseline=`alphabetic`;for(let e of m){let s=n.rowData[e];if(!s)continue;let c=p+e*r.height;t.fillStyle=Q(n.background),t.fillRect(o,c,n.cols*r.width,r.height);let l=0;for(;l<s.cells.length;){let e=s.cells[l];if(!e)break;let i=l+1;for(;i<s.cells.length;){let t=s.cells[i];if(!t||t.selected!==e.selected||!ut(t.background,e.background))break;i+=1}if(e.selected||!ut(e.background,n.background)){let a=o+l*r.width,s=(i-l)*r.width;ut(e.background,n.background)||(t.fillStyle=Q(e.background),t.fillRect(a,c,s,r.height)),e.selected&&(t.fillStyle=d,t.fillRect(a,c,s,r.height))}l=i}let u=0;for(;u<s.cells.length;){let e=s.cells[u];if(!e)break;if(e.text.length===0){u+=1;continue}let n=pt(s.cells,u,t=>ft(t,e)),l=s.cells.slice(u,n).map(e=>e.text).join(``);!e.invisible&&l.trim().length>0&&(t.save(),t.beginPath(),t.rect(o+u*r.width,c,(n-u)*r.width,r.height),t.clip(),t.font=mt(e,i,a),t.fillStyle=Q(e.foreground),t.fillText(l,o+u*r.width,c+r.baseline,(n-u)*r.width),t.restore()),u=n}for(let n=0;n<s.cells.length;n+=1){let i=s.cells[n],a=f!==null&&e>=f.start.y&&e<=f.end.y&&(e>f.start.y||n>=f.start.x)&&(e<f.end.y||n<=f.end.x);if(!i||!i.underline&&!i.strikethrough&&!i.overline&&!a)continue;t.fillStyle=Q(i.foreground);let l=o+n*r.width;(i.underline||a)&&t.fillRect(l,c+r.height-2,r.width,1),i.strikethrough&&t.fillRect(l,c+Math.floor(r.height*.55),r.width,1),i.overline&&t.fillRect(l,c+1,r.width,1)}}if(c&&n.cursorVisible&&n.cursorX>=0&&n.cursorY>=0){let e=o+n.cursorX*r.width,s=p+n.cursorY*r.height;if(t.fillStyle=Q(n.cursor),!u)t.strokeStyle=Q(n.cursor),t.strokeRect(e+.5,s+.5,r.width-1,r.height-1);else if(n.cursorStyle===0)t.fillRect(e,s,2,r.height);else if(n.cursorStyle===2)t.fillRect(e,s+r.height-2,r.width,2);else if(n.cursorStyle===3)t.strokeStyle=Q(n.cursor),t.strokeRect(e+.5,s+.5,r.width-1,r.height-1);else{t.fillRect(e,s,r.width,r.height);let o=n.rowData[n.cursorY]?.cells[n.cursorX];o?.text&&(t.font=mt(o,i,a),t.fillStyle=Q(n.background),t.fillText(o.text,e,s+r.baseline,r.width))}}}var vt=`/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2`,yt=6,bt=32,xt=`"Symbols Nerd Font Mono", "Symbols Nerd Font", "JetBrainsMono Nerd Font", "JetBrainsMono NF", "FiraCode Nerd Font", "Hack Nerd Font", "MesloLGS NF", "CaskaydiaCove Nerd Font", "PowerlineSymbols", monospace`,St=`"SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", `+xt,$=4,Ct=18,wt=500,Tt=250,Et=`iMW0@# .`,Dt=[`normal 400`,`normal 700`,`italic 400`,`italic 700`],Ot=null;function kt(){return Ot===null&&(Ot=(async()=>{try{let e=new FontFace(`Symbols Nerd Font Mono`,`url(${vt})`);document.fonts.add(await e.load())}catch{}})()),Ot}function At(e){return e.split(`,`).map(e=>{let t=e.trim();return t.length===0?``:/^(['"]).*\1$/.test(t)||/^[a-zA-Z][a-zA-Z0-9-]*$/.test(t)?t:`"${t.replaceAll(`"`,``)}"`}).filter(e=>e.length>0).join(`, `)}function jt(e){let t=e===void 0?``:At(e);return t.length===0?St:`${t}, ${xt}`}function Mt(e){let t=e===void 0?``:At(e);return t.length===0||!We(t)?St:jt(t)}async function Nt(e,t,n){let r=jt(e),i=n?.load??((e,t)=>document.fonts.load(e,t));try{await Promise.all(Dt.map(e=>i(`${e} ${t}px ${r}`,Et)))}catch{}return(n?.resolve??Mt)(e)}function Pt(e){return e===void 0||!Number.isFinite(e)?12:Math.max(yt,Math.min(bt,Math.round(e)))}function Ft(e){return e.focused&&e.cursorBlinking&&e.cursorVisible&&!e.reducedMotion}function It(e,t,n,r,i){if(!i)return t;let a=e-t*2-n*r;return t+Math.max(0,a)}function Lt(e,t){let n=Math.max(0,e.total),r=Math.max(0,Math.min(e.len,n)),i=Math.max(0,n-r);if(t<=0||r<=0||i===0)return null;let a=Math.min(t,Math.max(Ct,t*r/n));return{thumbHeight:a,thumbTop:Math.max(0,t-a)*(Math.max(0,Math.min(e.offset,i))/i),maxOffset:i}}function Rt(e,t,n,r){let i=Lt(e,t);if(i===null)return 0;let a=Math.max(0,t-i.thumbHeight);if(a===0)return 0;let o=Math.max(0,Math.min(n-r,a));return Math.round(o/a*i.maxOffset)}function zt(e){let{bounds:t,clientX:n,clientY:r,cols:i,rows:a,metrics:o,padding:s,originY:c}=e,l=n-t.left-s,u=r-t.top-c;return l<0||u<0||l>=i*o.width||u>=a*o.height?null:{x:Math.floor(l/o.width),y:Math.floor(u/o.height)}}function Bt(e){return e.wide===rt.spacerTail||e.wide===rt.spacerHead?``:e.text||` `}function Vt(e,t){let n=e.cells.map(Bt).join(``);return t?n.trimEnd():n}function Ht(e,t){let n=0;for(let r=0;r<t;r+=1){let t=e.cells[r];n+=t?Bt(t).length:1}return n}function Ut(e,t){return t?.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}function Wt(e,t){for(let n=0;n<e.cells.length;n+=1)if(t<Ht(e,n+1))return n;return Math.max(0,e.cells.length-1)}function Gt(e,t,n){let r=N(t+1,t=>{let n=e[t];return n?{isWrapped:n.isWrapContinuation,translateToString:(e=!1)=>Vt(n,e)}:null});if(!r)return null;let i=r.segments[0];if(i&&e[i.bufferLineNumber-1]?.isWrapContinuation)return null;let a=r.segments.find(e=>e.bufferLineNumber===t+1),o=e[t];if(!a||!o)return null;let s=r.segments.at(-1),c=s?e[s.bufferLineNumber-1]:void 0,l=c!==void 0&&c.wrapsToNext,u=o.cells[n]?.wide===rt.spacerTail?n-1:n,d=a.startIndex+Ht(o,u);for(let t of M(r.text))if(d>=t.start&&d<t.end){if(t.end===r.text.length&&l)return null;let n=r.segments.find(e=>t.start>=e.startIndex&&t.start<e.endIndex),i=r.segments.find(e=>t.end-1>=e.startIndex&&t.end-1<e.endIndex),a=n?e[n.bufferLineNumber-1]:void 0,o=i?e[i.bufferLineNumber-1]:void 0;if(!n||!i||!a||!o)return null;let s=Wt(o,t.end-1-i.startIndex);return{text:t.text,range:{start:{x:Wt(a,t.start-n.startIndex),y:n.bufferLineNumber-1},end:{x:o.cells[s+1]?.wide===rt.spacerTail?s+1:s,y:i.bufferLineNumber-1}}}}return null}function Kt(e,t=navigator.platform){let n=e.key.toLowerCase();return n===`insert`&&!l(t)?e.ctrlKey&&!e.shiftKey&&!e.metaKey:n===`c`?l(t)?e.metaKey:e.ctrlKey:!1}function qt(e,t){e.value=t,t.length!==0&&e.select()}function Jt(e,t){t.length!==0&&e.value===t&&(e.value=``)}function Yt(e,t){return e.length===0||!t?{preventDefault:!1,claimWriteFallback:!1}:(t.setData(`text/plain`,e),{preventDefault:!0,claimWriteFallback:!0})}function Xt(e,t=navigator.platform){let n=e.key.toLowerCase();return n===`insert`&&!l(t)?e.shiftKey&&!e.ctrlKey&&!e.metaKey:n===`v`?l(t)?e.metaKey:e.ctrlKey&&e.shiftKey:!1}function Zt(){return/linux|bsd/i.test(navigator.platform)}function Qt(e){return e.inputType===``||e.inputType===`insertCompositionText`||e.inputType===`insertFromComposition`}function $t(e,t){return e.isComposing||t||e.key===`Process`||e.keyCode===229}function en(e){return e.getModifierState(`AltGraph`)&&[...e.key].length===1}function tn(e,t){return e&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey}function nn(e,t,n){let r=e===`motion`?t:``;return{send:t.length>0&&(e!==`motion`||t!==n),nextMotionData:r}}function rn(e,t,n){return{tracking:t,motionData:e===t?n:``}}function an(e,t,n,r){let i=r+(e.deltaMode===1?e.deltaY*t:e.deltaMode===2?e.deltaY*n*t:e.deltaY)/t,a=Math.trunc(i);return{rows:a,remainder:i-a}}var on=50;function sn(e,t,n){let r=e<t?e-t:e>n?e-n:0;if(r===0)return 0;let i=Math.max(-1,Math.min(1,r/on));return Math.sign(i)+Math.round(i*14)}function cn(e,t){return e===0?``:(e<0?t?`\x1BOA`:`\x1B[A`:t?`\x1BOB`:`\x1B[B`).repeat(Math.abs(e))}function ln(e){switch(e){case 0:return 1;case 1:return 3;case 2:return 2;case 3:return 4;case 4:return 5;default:return null}}var un=4;function dn(e,t){return{count:e!==null&&t.timeStamp-e.time<=500&&Math.hypot(t.clientX-e.x,t.clientY-e.y)<=un?e.count>=3?1:e.count+1:1,time:t.timeStamp,x:t.clientX,y:t.clientY}}var fn=class e{canvas;input;scrollbar;cols=1;rows=1;mount;measuredCols=1;measuredRows=1;sharedGrid=null;context;core;options;visible;hasSize=!1;metrics;fontFamily;requestedFontFamily;fontSize;fontEpoch=0;pendingFontEpoch=null;stopObservingResize;scrollbarThumb;snapshot=null;frame=0;cursorTimer=null;compositionInputToSuppress=null;compositionSuppressionTimer=null;cursorOn=!0;renderedCursorY=null;forceFullRender=!0;canvasResizedSinceRender=!1;scrollbarDirty=!0;scrollbarState=null;scrollbarPointerId=null;scrollbarPointerOffset=0;disposed=!1;resizeNotifyTimer=null;originY=$;mountHeight=0;selectionEnd=null;selectionAnchorScreen=null;selectionMode=`cell`;selectionBase=null;selectionScrollTimer=null;selectionScrollDelta=0;selectionPointer=null;mouseReportingPointerId=null;mouseReportingButton=null;linkActivationPointerId=null;linkActivationLink=null;linkActivationValidation;linkActivationRequestId=0;linkActivationOrigin=null;hoveredLink=null;hoverPointer=null;linkHoverCandidate=null;linkHoverTimer=null;linkRowStability=[];selectionClickSequence=null;selectionMoved=!1;composing=!1;focused=!1;resizeNotified=!1;canvasConfigured=!1;theme;suppressedKeyCodes=new Set;pasteShortcutToken=0;copyShortcutToken=0;clearSelectionAfterCopy=!1;primedCopySelection=``;wheelRemainder=0;touchScroll=null;lastMouseMotionData=``;mouseAnyEventTracking=!1;dprMedia=null;reducedMotionMedia=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);inputLeft=-1;inputTop=-1;constructor(e,t,n,r,i,a,o,s,c,l){this.mount=e,this.canvas=t,this.input=n,this.scrollbar=r,this.scrollbarThumb=i,this.context=a,this.core=o,this.mouseAnyEventTracking=o.isMouseAnyEventTracking(),this.metrics=s,this.options=l,this.visible=l.visible??!0,this.theme=l.theme,this.fontFamily=c,this.requestedFontFamily=l.font?.family,this.fontSize=Pt(l.font?.size),this.installEvents(),this.watchDevicePixelRatio(),this.reducedMotionMedia?.addEventListener(`change`,this.onReducedMotionChange),document.fonts.addEventListener(`loadingdone`,this.onFontsLoaded),this.stopObservingResize=O(e,()=>this.fit())}static async create(t,n){let r=document.createElement(`canvas`);r.className=`block size-full cursor-text`,r.style.touchAction=`pan-x pinch-zoom`,r.setAttribute(`aria-hidden`,`true`);let i=document.createElement(`textarea`);i.className=`p4-ghostty-input`,i.setAttribute(`aria-label`,`Terminal input`),i.autocapitalize=`off`,i.autocomplete=`off`,i.spellcheck=!1,i.style.cssText=`position:absolute;left:4px;top:4px;width:1px;height:1px;opacity:0;padding:0;border:0;resize:none;pointer-events:none;`;let a=document.createElement(`div`);a.className=`group absolute top-1 right-px bottom-1 z-1 w-[var(--app-scrollbar-width)] cursor-default touch-none`,a.setAttribute(`role`,`scrollbar`),a.setAttribute(`aria-label`,`Terminal scrollback`),a.setAttribute(`aria-orientation`,`vertical`),a.tabIndex=0,a.hidden=!0;let o=document.createElement(`div`);o.className=`absolute inset-x-px top-0 rounded-[3px] bg-[var(--app-scrollbar-thumb)] transition-[background-color] duration-[120ms] ease-[ease-out] group-hover:bg-[var(--app-scrollbar-thumb-hover)] group-focus-visible:bg-[var(--app-scrollbar-thumb-hover)]`,a.append(o),t.replaceChildren(r,i,a);let s=r.getContext(`2d`,{alpha:!1});if(!s)throw Error(`Canvas 2D is unavailable`);s.fillStyle=`rgb(${n.theme.background.r}, ${n.theme.background.g}, ${n.theme.background.b})`,s.fillRect(0,0,r.width,r.height);let c=Pt(n.font?.size);try{await kt()}catch{}let l=await Nt(n.font?.family,c),u=ht(s,c,l),d=gt(t.clientWidth,t.clientHeight,u,$),f=await lt.create(d.cols,d.rows,u.width,u.height,n.theme,n.onData),p=new e(t,r,i,a,o,s,f,u,l,n);return p.fit(),p}setVisible(e){this.disposed||this.visible===e||(this.visible=e,this.cursorOn=!0,this.forceFullRender=!0,this.scrollbarDirty=!0,e?this.fit():(this.linkActivationRequestId+=1,this.clearHoveredLink(),this.linkRowStability=[],this.cancelRender(),this.setSelectionAutoscroll(0)))}write(e){this.disposed||(this.core.write(e),this.synchronizeMouseTrackingState(),this.cursorOn=!0,this.scrollbarDirty=!0,this.requestRender())}resetAndWrite(e){this.disposed||(this.lastMouseMotionData=``,this.core.resetAndWrite(e),this.synchronizeMouseTrackingState(),this.cursorOn=!0,this.forceFullRender=!0,this.scrollbarDirty=!0,this.requestRender())}setTheme(e){this.disposed||(this.theme=e,this.core.setTheme(e),this.forceFullRender=!0,this.requestRender())}refreshLinkActivation(){this.disposed||this.refreshHoveredLink()}async setFont(e){if(this.disposed)return;let t=Pt(e.size),n=++this.fontEpoch;this.pendingFontEpoch=n;let r=await Nt(e.family,t);this.disposed||n!==this.fontEpoch||(this.pendingFontEpoch=null,this.fontFamily=r,this.requestedFontFamily=e.family,this.fontSize=t,this.applyFontMetrics())}applyFontMetrics(){this.metrics=ht(this.context,this.fontSize,this.fontFamily),this.core.resize(this.cols,this.rows,this.metrics.width,this.metrics.height),this.inputLeft=-1,this.inputTop=-1,this.forceFullRender=!0,this.scrollbarDirty=!0,this.fit(),this.requestRender()}onReducedMotionChange=()=>{this.disposed||(this.cursorOn=!0,this.requestRender())};onFontsLoaded=()=>{if(this.disposed||this.pendingFontEpoch!==null)return;let e=Mt(this.requestedFontFamily);if(e!==this.fontFamily){this.fontFamily=e,this.applyFontMetrics();return}let t=ht(this.context,this.fontSize,this.fontFamily);(t.width!==this.metrics.width||t.height!==this.metrics.height||t.baseline!==this.metrics.baseline)&&this.applyFontMetrics()};resendSize(){this.resizeNotified=!1,this.fit()}fit(){if(this.disposed||!this.visible)return!1;let e=this.mount.clientWidth,t=this.mount.clientHeight;if(e<=0||t<=0)return this.hasSize=!1,this.forceFullRender=!0,this.cancelRender(),!1;this.hasSize=!0;let n=window.devicePixelRatio||1,r=Math.max(1,Math.round(e*n)),i=Math.max(1,Math.round(t*n)),a=!1;this.canvas.width===r&&this.canvas.height===i&&this.canvasConfigured||(this.canvas.width=r,this.canvas.height=i,this.context.setTransform(n,0,0,n,0,0),this.canvasConfigured=!0,this.canvasResizedSinceRender=!0,this.forceFullRender=!0,this.scrollbarDirty=!0,a=!0);let o=gt(e,t,this.metrics,$);return this.mountHeight=t,o.cols===this.measuredCols&&o.rows===this.measuredRows&&this.resizeNotified||(this.measuredCols=o.cols,this.measuredRows=o.rows,this.notifyResize()),this.applyGrid()&&(a=!0),(a||this.forceFullRender)&&this.renderFrame(),!0}setSharedGrid(e){this.disposed||(this.sharedGrid?.cols!==e?.cols||this.sharedGrid?.rows!==e?.rows)&&(this.sharedGrid=e,this.hasSize&&this.applyGrid()&&this.requestRender())}applyGrid(){let e=Math.min(this.sharedGrid?.cols??this.measuredCols,this.measuredCols),t=Math.min(this.sharedGrid?.rows??this.measuredRows,this.measuredRows);return e===this.cols&&t===this.rows?!1:(this.cols=e,this.rows=t,this.core.resize(e,t,this.metrics.width,this.metrics.height),this.forceFullRender=!0,this.scrollbarDirty=!0,!0)}notifyResize(){this.resizeNotified=!0,this.resizeNotifyTimer!==null&&window.clearTimeout(this.resizeNotifyTimer),this.resizeNotifyTimer=window.setTimeout(()=>{this.resizeNotifyTimer=null,this.disposed||this.options.onResize(this.measuredCols,this.measuredRows)},150)}onWindowPointerRelease=()=>{this.disposed||this.resizeNotifyTimer===null||(this.fit(),this.resizeNotifyTimer!==null&&(window.clearTimeout(this.resizeNotifyTimer),this.resizeNotifyTimer=null,this.options.onResize(this.measuredCols,this.measuredRows)))};focus(){!this.disposed&&this.visible&&this.input.focus({preventScroll:!0})}async pasteFromClipboard(e,t=()=>!0){let n=++this.pasteShortcutToken,r=await e();if(this.disposed||this.pasteShortcutToken!==n||!t()||(this.pasteShortcutToken+=1,r.length===0))return;let i=this.core.encodePaste(r);i.length>0&&this.options.onData(i)}pasteTerminalSelection(){let e=this.getSelection();e.length!==0&&this.pasteFromClipboard(()=>Promise.resolve(e))}hasSelection(){return this.core.selectionText().length>0}getSelection(){return this.core.selectionText()}getSelectionCellCount(){let e=this.core.selectionRange();return e?(Math.abs(e.end.y-e.start.y)+1)*this.cols:0}selectAll(){this.linkActivationRequestId+=1,this.clearPrimedCopy();let e=this.core.selectAll();this.selectionAnchorScreen=e?.start??null,this.selectionEnd=e?this.core.screenPointToViewport(e.end.x,e.end.y):null,this.selectionMode=`cell`,this.selectionBase=null,this.setSelectionAutoscroll(0),this.options.onSelectionChange(),this.forceFullRender=!0,this.requestRender()}getSelectionPosition(){let e=this.hasSelection()?this.core.selectionRange():null;if(!e)return null;let{start:t,end:n}=e;return t.y<n.y||t.y===n.y&&t.x<=n.x?{start:t,end:n}:{start:n,end:t}}getSelectionEndClientRect(){let e=this.getSelectionPosition();if(!e)return null;let t=this.core.screenPointToViewport(e.end.x,e.end.y);if(!t||t.x<0||t.x>=this.cols||t.y<0||t.y>=this.rows)return null;let n=this.canvas.getBoundingClientRect();return{right:n.left+$+(t.x+1)*this.metrics.width,bottom:n.top+this.originY+(t.y+1)*this.metrics.height}}clearSelection({source:e=`user`}={}){e===`user`&&(this.linkActivationRequestId+=1),this.clearPrimedCopy(),this.core.clearSelection(),this.selectionEnd=null,this.selectionAnchorScreen=null,this.selectionMode=`cell`,this.selectionBase=null,this.setSelectionAutoscroll(0),this.options.onSelectionChange(),this.forceFullRender=!0,this.requestRender()}scrollToBottom(){this.core.scrollToBottom(),this.forceFullRender=!0,this.scrollbarDirty=!0,this.requestRender()}isAtBottom(){return this.core.isViewportActive()}dispose(){this.disposed||(this.disposed=!0,this.clearHoveredLink(),this.stopObservingResize(),document.fonts.removeEventListener(`loadingdone`,this.onFontsLoaded),this.dprMedia?.removeEventListener(`change`,this.onDevicePixelRatioChange),this.dprMedia=null,this.reducedMotionMedia?.removeEventListener(`change`,this.onReducedMotionChange),this.selectionScrollTimer!==null&&window.clearInterval(this.selectionScrollTimer),this.resizeNotifyTimer!==null&&(window.clearTimeout(this.resizeNotifyTimer),this.resizeNotifyTimer=null,this.options.onResize(this.measuredCols,this.measuredRows)),this.cancelRender(),this.compositionSuppressionTimer!==null&&window.clearTimeout(this.compositionSuppressionTimer),this.removeEvents(),this.core.dispose(),(this.canvas.parentElement===this.mount||this.input.parentElement===this.mount||this.scrollbar.parentElement===this.mount)&&(this.canvas.remove(),this.input.remove(),this.scrollbar.remove()))}onKeyDown=e=>{if(en(e)||!this.options.beforeKey(e)||$t(e,this.composing)){this.suppressedKeyCodes.add(e.code);return}let t=l(navigator.platform),n=t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey;if(e.key.toLowerCase()===`a`&&n&&!e.altKey&&(t?!e.shiftKey:e.shiftKey)){e.preventDefault(),e.stopPropagation(),this.suppressedKeyCodes.add(e.code),this.selectAll();return}let r=e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&(e.key===`PageUp`||e.key===`PageDown`),i=e.shiftKey&&!e.altKey&&n&&(e.key===`Home`||e.key===`End`);if((r||i)&&!this.core.isAlternateScreen()){let t=this.readScrollbarState();if(t!==null){e.preventDefault(),e.stopPropagation(),this.suppressedKeyCodes.add(e.code);let n=e.key===`Home`?-t.offset:e.key===`End`?t.total-t.len-t.offset:Math.max(1,t.len)*(e.key===`PageUp`?-1:1);this.scrollViewport(n);return}}if(Kt(e)&&this.hasSelection()){let t=this.getSelection();if(this.primeCopy(t),e.shiftKey||e.key.toLowerCase()===`insert`)e.preventDefault(),document.execCommand(`copy`);else{this.clearSelectionAfterCopy=!e.shiftKey&&!l(navigator.platform);let n=navigator.clipboard;if(typeof n?.writeText==`function`){let e=++this.copyShortcutToken;Promise.resolve().then(()=>{this.disposed||this.copyShortcutToken!==e||n.writeText(t).then(()=>{this.disposed||this.copyShortcutToken!==e||this.clearSelectionAfterCopy&&(this.clearSelectionAfterCopy=!1,this.clearSelection())},()=>{this.copyShortcutToken===e&&(this.clearSelectionAfterCopy=!1)})})}}this.suppressedKeyCodes.add(e.code);return}if(Xt(e)){this.suppressedKeyCodes.add(e.code);let t=navigator.clipboard;if(typeof t?.readText==`function`){let e=++this.pasteShortcutToken;t.readText().then(t=>{this.disposed||this.pasteShortcutToken!==e||(this.pasteShortcutToken+=1,t.length>0&&this.options.onData(this.core.encodePaste(t)))},()=>{})}return}this.clearPrimedCopy();let a=this.core.encodeKey(e);a.length!==0&&(this.suppressedKeyCodes.delete(e.code),e.preventDefault(),e.stopPropagation(),this.options.onData(a))};onKeyUp=e=>{if(this.suppressedKeyCodes.delete(e.code)||$t(e,this.composing))return;let t=this.core.encodeKey(e,`release`);t.length!==0&&(e.preventDefault(),e.stopPropagation(),this.options.onData(t))};onFocus=()=>{this.focused=!0,this.cursorOn=!0,this.requestRender()};onBlur=()=>{this.focused=!1,this.refreshHoveredLink(),this.cursorOn=!0,this.requestRender()};onDevicePixelRatioChange=()=>{this.watchDevicePixelRatio(),this.fit()};watchDevicePixelRatio(){this.dprMedia?.removeEventListener(`change`,this.onDevicePixelRatioChange),this.dprMedia=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this.dprMedia.addEventListener(`change`,this.onDevicePixelRatioChange)}primeCopy(e){this.primedCopySelection=e,qt(this.input,e)}clearPrimedCopy(){Jt(this.input,this.primedCopySelection),this.primedCopySelection=``}onCopyEvent=e=>{let t=this.hasSelection()?this.getSelection():this.input.value;this.primeCopy(t);let n=Yt(t,e.clipboardData);n.preventDefault&&e.preventDefault(),n.claimWriteFallback&&(this.copyShortcutToken+=1,this.clearSelectionAfterCopy&&(this.clearSelectionAfterCopy=!1,this.clearSelection()))};onPaste=e=>{e.preventDefault();let t=e.clipboardData?.getData(`text/plain`)??``;t.length!==0&&(this.pasteShortcutToken+=1,this.options.onData(this.core.encodePaste(t)))};onCompositionStart=()=>{this.clearPrimedCopy(),this.clearCompositionInputSuppression(),this.composing=!0};onCompositionEnd=e=>{this.composing=!1;let t=this.input.value||e.data;t.length>0&&this.options.onData(t),this.input.value=``,this.compositionInputToSuppress=t,this.compositionSuppressionTimer=window.setTimeout(()=>{this.compositionInputToSuppress=null,this.compositionSuppressionTimer=null},100)};onInput=e=>{let t=e;if(this.composing||t.isComposing)return;let n=this.input.value||t.data||``;n===this.compositionInputToSuppress&&Qt(t)?(this.clearCompositionInputSuppression(),this.input.value=``):(this.clearCompositionInputSuppression(),n.length>0&&this.options.onData(n),this.input.value=``)};clearCompositionInputSuppression(){this.compositionSuppressionTimer!==null&&(window.clearTimeout(this.compositionSuppressionTimer),this.compositionSuppressionTimer=null),this.compositionInputToSuppress=null}onPointerDown=e=>{if(this.linkActivationRequestId+=1,e.pointerType===`touch`){if(e.preventDefault(),!e.isPrimary||this.touchScroll!==null)return;this.touchScroll={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,lastY:e.clientY,remainder:0,moved:!1},this.clearHoveredLink(),this.canvas.setPointerCapture(e.pointerId);return}if(this.focus(),tn(this.core.isMouseTracking(),e)){let t=ln(e.button);if(t===null)return;e.preventDefault(),e.stopPropagation(),this.clearHoveredLink(`default`),this.mouseReportingPointerId=e.pointerId,this.mouseReportingButton=t,this.sendMouse(`press`,t,e),this.canvas.setPointerCapture(e.pointerId);return}if(e.button===1&&Zt()){this.pasteTerminalSelection();return}if(e.button!==0)return;let t=this.recordSelectionClick(e),n=this.linkAt(e.clientX,e.clientY,!0);n&&!e.shiftKey&&t===1?(e.preventDefault(),e.stopPropagation(),this.linkActivationPointerId=e.pointerId,this.linkActivationLink=n,this.linkActivationValidation=this.validateLink(n.text),this.linkActivationOrigin={x:e.clientX,y:e.clientY,clickCount:t},this.canvas.setPointerCapture(e.pointerId)):(this.clearHoveredLink(),this.beginSelection(e,t),this.canvas.setPointerCapture(e.pointerId))};recordSelectionClick(e){return this.selectionClickSequence=dn(this.selectionClickSequence,e),this.selectionClickSequence.count}beginSelection(e,t){let n=this.cellAt(e.clientX,e.clientY);this.selectionMoved=!1,this.selectionMode=t>=3?`line`:t===2?`word`:`cell`;let r=this.selectionMode===`line`?this.core.selectLine(n.x,n.y):this.selectionMode===`word`?this.core.selectWord(n.x,n.y):null;if(r)this.selectionBase=r.screen,this.selectionEnd=r.viewport.end,this.selectionAnchorScreen=r.screen.start,this.options.onSelectionChange();else{this.selectionMode=`cell`,this.selectionBase=null,this.selectionEnd=n;let e=this.core.viewportPointToScreen(n.x,n.y);this.selectionAnchorScreen=e,e?this.core.setSelection({...e,tag:2},{...e,tag:2}):this.core.setSelection(n,n)}this.forceFullRender=!0,this.requestRender()}onPointerMove=e=>{if(e.pointerType===`touch`){let t=this.touchScroll;if(t?.pointerId!==e.pointerId||(e.preventDefault(),t.moved||=Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>un,!t.moved))return;let n=an({deltaY:t.lastY-e.clientY,deltaMode:0},this.metrics.height,this.rows,t.remainder);t.lastY=e.clientY,t.remainder=n.remainder,this.scrollRows(n.rows,e);return}if(this.linkActivationPointerId===e.pointerId){let t=this.linkActivationOrigin;if(t===null||Math.hypot(e.clientX-t.x,e.clientY-t.y)<=un)return;this.linkActivationPointerId=null,this.linkActivationLink=null,this.linkActivationValidation=void 0,this.linkActivationOrigin=null,this.clearHoveredLink(),this.beginSelection({clientX:t.x,clientY:t.y},t.clickCount)}let t=this.synchronizeMouseTrackingState();if(this.mouseReportingPointerId===e.pointerId||tn(t,e)){e.preventDefault(),this.hoverPointer={x:e.clientX,y:e.clientY},this.setHoveredLink(null),this.canvas.style.cursor=`default`,this.sendMouse(`motion`,this.buttonFromButtons(e.buttons),e);return}if(this.lastMouseMotionData=``,!this.selectionAnchorScreen||!this.canvas.hasPointerCapture(e.pointerId)){this.updateHoverCursor(e);return}this.clearHoveredLink(),this.selectionPointer={x:e.clientX,y:e.clientY};let n=this.canvas.getBoundingClientRect(),r=Math.max(n.top,0)+$,i=Math.min(n.bottom,window.innerHeight)-$;this.setSelectionAutoscroll(sn(e.clientY,r,i));let a=this.cellAt(e.clientX,e.clientY);(a.x!==this.selectionEnd?.x||a.y!==this.selectionEnd.y)&&this.extendSelectionTo(e.clientX,e.clientY)};extendSelectionTo(e,t){if(this.selectionAnchorScreen===null)return;let n=this.core.selectionRange()?.start;if(!n)return;let r=n.y-this.selectionAnchorScreen.y;if(this.selectionBase&&r!==0){let{start:e,end:t}=this.selectionBase;this.selectionBase={start:{x:e.x,y:e.y+r},end:{x:t.x,y:t.y+r}}}let i=this.cellAt(e,t);this.selectionMoved=!0,this.selectionEnd=i;let a=this.selectionMode===`line`?this.core.selectLine(i.x,i.y):this.selectionMode===`word`?this.core.selectWord(i.x,i.y):null,o=this.core.viewportPointToScreen(i.x,i.y);if(o===null)return;let s=this.selectionBase,c=s!==null&&(o.y<s.start.y||o.y===s.start.y&&o.x<s.start.x),l=s===null?n:c?s.end:s.start,u=a===null?o:c?a.screen.start:a.screen.end;this.selectionAnchorScreen=l,this.core.setSelection({...l,tag:2},{...u,tag:2}),this.options.onSelectionChange(),this.forceFullRender=!0,this.requestRender()}setSelectionAutoscroll(e){this.selectionScrollDelta=e,e===0?this.selectionScrollTimer!==null&&(window.clearInterval(this.selectionScrollTimer),this.selectionScrollTimer=null):this.selectionScrollTimer===null&&(this.selectionScrollTimer=window.setInterval(()=>{if(this.disposed||this.selectionScrollDelta===0)return;this.scrollViewport(this.selectionScrollDelta);let e=this.selectionPointer;e&&this.extendSelectionTo(e.x,e.y)},80))}updateHoverCursor(e){this.hoverPointer={x:e.clientX,y:e.clientY},this.refreshHoveredLink()}onPointerLeave=()=>{this.lastMouseMotionData=``,this.clearHoveredLink()};clearHoveredLink(e=``){this.hoverPointer=null,this.updateLinkHover(null),this.setHoveredLink(null),this.canvas.style.cursor=e}refreshHoveredLink(){let e=this.hoverPointer,t=e?this.findLinkAt(e.x,e.y):null;this.updateLinkHover(t),this.setHoveredLink(t&&this.options.canActivateLink?.(t.text)!==!1?t:null)}updateLinkHover(e){if(this.options.onLinkHover&&!(e?Ut(e,this.linkHoverCandidate):this.linkHoverCandidate===null)&&(this.linkHoverCandidate=e,this.linkHoverTimer!==null&&(window.clearTimeout(this.linkHoverTimer),this.linkHoverTimer=null),this.options.onLinkHover(null),e!==null)){let t=performance.now(),n=0;for(let r=e.range.start.y;r<=e.range.end.y;r++)n=Math.max(n,this.linkRowStability[r]?.changedAt??t);let r=Math.max(0,Tt-(t-n));if(r===0){this.options.onLinkHover(e.text);return}this.linkHoverTimer=window.setTimeout(()=>{this.linkHoverTimer=null,this.options.onLinkHover?.(e.text)},r)}}updateLinkRowStability(e){if(!this.options.onLinkHover||!this.snapshot)return;e&&(this.updateLinkHover(null),this.linkRowStability=[]);let t=performance.now();this.snapshot.rowData.forEach((e,n)=>{let r=this.linkRowStability[n]?.row;r&&r.text===e.text&&r.cells.length===e.cells.length&&r.isWrapContinuation===e.isWrapContinuation&&r.wrapsToNext===e.wrapsToNext||(this.linkRowStability[n]={row:e,changedAt:t})}),this.linkRowStability.length=this.snapshot.rows}setHoveredLink(e){let t=this.hoveredLink,n=t?.text===e?.text&&t?.range.start.x===e?.range.start.x&&t?.range.start.y===e?.range.start.y&&t?.range.end.x===e?.range.end.x&&t?.range.end.y===e?.range.end.y;this.canvas.style.cursor=e?`pointer`:``,!n&&(this.hoveredLink=e,this.forceFullRender=!0,this.requestRender())}onPointerUp=e=>{if(e.pointerType===`touch`){let t=this.touchScroll;if(t?.pointerId!==e.pointerId||(this.touchScroll=null,e.preventDefault(),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),e.type===`pointercancel`||t.moved))return;if(this.focus(),tn(this.core.isMouseTracking(),e))this.sendMouse(`press`,ln(0),e),this.sendMouse(`release`,ln(0),e);else{let t=this.linkAt(e.clientX,e.clientY,!0);t?this.activateLink(t,e):this.clearSelection()}}else if(this.setSelectionAutoscroll(0),this.linkActivationPointerId===e.pointerId){e.preventDefault(),e.stopPropagation();let t=this.linkActivationLink,n=this.linkActivationValidation;this.linkActivationPointerId=null,this.linkActivationLink=null,this.linkActivationValidation=void 0,this.linkActivationOrigin=null,this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),e.type!==`pointercancel`&&t&&Ut(t,this.linkAt(e.clientX,e.clientY,!0))&&this.activateLink(t,e,n)}else this.mouseReportingPointerId===e.pointerId?(e.preventDefault(),e.stopPropagation(),this.sendMouse(`release`,this.mouseReportingButton,e),this.mouseReportingPointerId=null,this.mouseReportingButton=null,this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),e.type===`pointercancel`?this.clearHoveredLink():(this.hoverPointer={x:e.clientX,y:e.clientY},this.refreshHoveredLink())):(this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),e.button===1&&Zt()?e.preventDefault():e.button===0&&(!this.selectionMoved&&this.selectionMode===`cell`&&this.clearSelection(),this.options.onSelectionChange()))};onWheel=e=>{if(e.deltaY===0)return;e.preventDefault();let t=an(e,this.metrics.height,this.rows,this.wheelRemainder);this.wheelRemainder=t.remainder,this.scrollRows(t.rows,e)};scrollRows(e,t){if(e===0)return;let n=Math.abs(e);if(tn(this.core.isMouseTracking(),t)){let r=e<0?4:5;for(let e=0;e<n;e+=1)this.sendMouse(`press`,r,t)}else this.core.isAlternateScreen()?this.options.onData(cn(e,this.core.isApplicationCursorKeys())):this.scrollViewport(e)}onMouseDown=e=>{(e.button===0||e.button===1&&Zt())&&e.preventDefault(),this.focus()};onMouseUp=e=>{e.button===1&&Zt()&&e.preventDefault()};onContextMenu=e=>{tn(this.core.isMouseTracking(),e)?e.preventDefault():this.options.onContextMenu?.(e)};onScrollbarPointerDown=e=>{if(e.button!==0)return;let t=this.readScrollbarState();if(t===null)return;let n=this.scrollbar.getBoundingClientRect(),r=Lt(t,n.height);r!==null&&(e.preventDefault(),e.stopPropagation(),this.scrollbarPointerId=e.pointerId,this.scrollbarPointerOffset=e.target===this.scrollbarThumb?e.clientY-n.top-r.thumbTop:r.thumbHeight/2,this.scrollbar.setPointerCapture(e.pointerId),this.scrollbarToPointer(e.clientY,n))};onScrollbarPointerMove=e=>{e.pointerId===this.scrollbarPointerId&&this.scrollbarState!==null&&(e.preventDefault(),this.scrollbarToPointer(e.clientY,this.scrollbar.getBoundingClientRect()))};onScrollbarPointerUp=e=>{e.pointerId===this.scrollbarPointerId&&(e.preventDefault(),this.scrollbarPointerId=null,this.scrollbar.hasPointerCapture(e.pointerId)&&this.scrollbar.releasePointerCapture(e.pointerId))};onScrollbarKeyDown=e=>{let t=this.readScrollbarState();if(t===null)return;let n=0;switch(e.key){case`ArrowUp`:n=-1;break;case`ArrowDown`:n=1;break;case`PageUp`:n=-Math.max(1,t.len);break;case`PageDown`:n=Math.max(1,t.len);break;case`Home`:n=-t.offset;break;case`End`:n=t.total-t.len-t.offset;break;default:return}e.preventDefault(),e.stopPropagation(),this.scrollViewport(n)};installEvents(){this.input.addEventListener(`keydown`,this.onKeyDown),this.input.addEventListener(`keyup`,this.onKeyUp),this.input.addEventListener(`focus`,this.onFocus),this.input.addEventListener(`blur`,this.onBlur),this.input.addEventListener(`input`,this.onInput),this.input.addEventListener(`paste`,this.onPaste),this.input.addEventListener(`copy`,this.onCopyEvent),this.input.addEventListener(`compositionstart`,this.onCompositionStart),this.input.addEventListener(`compositionend`,this.onCompositionEnd),this.canvas.addEventListener(`pointerdown`,this.onPointerDown),this.canvas.addEventListener(`pointermove`,this.onPointerMove),this.canvas.addEventListener(`pointerleave`,this.onPointerLeave),this.canvas.addEventListener(`pointerup`,this.onPointerUp),this.canvas.addEventListener(`pointercancel`,this.onPointerUp),this.canvas.addEventListener(`wheel`,this.onWheel,{passive:!1}),this.canvas.addEventListener(`mousedown`,this.onMouseDown),this.canvas.addEventListener(`mouseup`,this.onMouseUp),this.canvas.addEventListener(`contextmenu`,this.onContextMenu),this.scrollbar.addEventListener(`pointerdown`,this.onScrollbarPointerDown),this.scrollbar.addEventListener(`pointermove`,this.onScrollbarPointerMove),this.scrollbar.addEventListener(`pointerup`,this.onScrollbarPointerUp),this.scrollbar.addEventListener(`pointercancel`,this.onScrollbarPointerUp),this.scrollbar.addEventListener(`keydown`,this.onScrollbarKeyDown),window.addEventListener(`pointerup`,this.onWindowPointerRelease),window.addEventListener(`pointercancel`,this.onWindowPointerRelease)}removeEvents(){this.input.removeEventListener(`keydown`,this.onKeyDown),this.input.removeEventListener(`keyup`,this.onKeyUp),this.input.removeEventListener(`focus`,this.onFocus),this.input.removeEventListener(`blur`,this.onBlur),this.input.removeEventListener(`input`,this.onInput),this.input.removeEventListener(`paste`,this.onPaste),this.input.removeEventListener(`copy`,this.onCopyEvent),this.input.removeEventListener(`compositionstart`,this.onCompositionStart),this.input.removeEventListener(`compositionend`,this.onCompositionEnd),this.canvas.removeEventListener(`pointerdown`,this.onPointerDown),this.canvas.removeEventListener(`pointermove`,this.onPointerMove),this.canvas.removeEventListener(`pointerleave`,this.onPointerLeave),this.canvas.removeEventListener(`pointerup`,this.onPointerUp),this.canvas.removeEventListener(`pointercancel`,this.onPointerUp),this.canvas.removeEventListener(`wheel`,this.onWheel),this.canvas.removeEventListener(`mousedown`,this.onMouseDown),this.canvas.removeEventListener(`mouseup`,this.onMouseUp),this.canvas.removeEventListener(`contextmenu`,this.onContextMenu),this.scrollbar.removeEventListener(`pointerdown`,this.onScrollbarPointerDown),this.scrollbar.removeEventListener(`pointermove`,this.onScrollbarPointerMove),this.scrollbar.removeEventListener(`pointerup`,this.onScrollbarPointerUp),this.scrollbar.removeEventListener(`pointercancel`,this.onScrollbarPointerUp),this.scrollbar.removeEventListener(`keydown`,this.onScrollbarKeyDown),window.removeEventListener(`pointerup`,this.onWindowPointerRelease),window.removeEventListener(`pointercancel`,this.onWindowPointerRelease)}scrollViewport(e){let t=Math.trunc(e),n=this.readScrollbarState();if(n!==null){let e=Math.max(0,n.total-n.len),r=Math.max(0,Math.min(n.offset+t,e));t=r-n.offset,this.scrollbarState={...n,offset:r}}t!==0&&(this.core.scroll(t),this.forceFullRender=!0,this.scrollbarDirty=!0,this.requestRender())}scrollbarToPointer(e,t){let n=this.scrollbarState;if(n===null)return;let r=Rt(n,t.height,e-t.top,this.scrollbarPointerOffset);this.scrollViewport(r-n.offset)}updateScrollbar(){let e=this.readScrollbarState(),t=e===null?null:Lt(e,Math.max(0,this.mount.clientHeight-8));this.scrollbar.hidden=t===null,e!==null&&t!==null&&(this.scrollbar.setAttribute(`aria-valuemin`,`0`),this.scrollbar.setAttribute(`aria-valuemax`,String(t.maxOffset)),this.scrollbar.setAttribute(`aria-valuenow`,String(Math.max(0,Math.min(e.offset,t.maxOffset)))),this.scrollbarThumb.style.height=`${t.thumbHeight}px`,this.scrollbarThumb.style.transform=`translateY(${t.thumbTop}px)`)}readScrollbarState(){let e=this.core.scrollbarState();return this.scrollbarState=e,e}requestRender(){!this.disposed&&this.visible&&this.hasSize&&this.frame===0&&(this.frame=window.requestAnimationFrame(()=>{this.frame=0,this.renderFrame()}))}cancelRender(){this.frame!==0&&(window.cancelAnimationFrame(this.frame),this.frame=0),this.cursorTimer!==null&&(window.clearTimeout(this.cursorTimer),this.cursorTimer=null)}renderFrame(){if(this.disposed||!this.visible)return;if(this.frame!==0&&(window.cancelAnimationFrame(this.frame),this.frame=0),this.mount.clientWidth===0||this.mount.clientHeight===0){this.hasSize=!1,this.forceFullRender=!0,this.cancelRender();return}this.snapshot=this.core.snapshot(),this.blinkEnabled()||(this.cursorOn=!0);let e=this.readScrollbarState(),t=e!==null&&e.total>e.len,n=It(this.mountHeight,$,this.rows,this.metrics.height,t),r=this.canvasResizedSinceRender||n!==this.originY;this.canvasResizedSinceRender=!1,n!==this.originY&&(this.originY=n,this.forceFullRender=!0),this.updateLinkRowStability(r),this.refreshHoveredLink(),_t({context:this.context,snapshot:this.snapshot,metrics:this.metrics,fontSize:this.fontSize,fontFamily:this.fontFamily,padding:$,originY:this.originY,forceFull:this.forceFullRender,cursorOn:this.cursorOn,previousCursorY:this.renderedCursorY,focused:this.focused,hoveredLinkRange:this.hoveredLink?.range??null,...this.theme.selectionBackground===void 0?{}:{selectionBackground:this.theme.selectionBackground}}),this.positionInput(),this.renderedCursorY=this.cursorOn&&this.snapshot.cursorVisible&&this.snapshot.cursorY>=0?this.snapshot.cursorY:null,this.scrollbarDirty&&(this.scrollbarDirty=!1,this.updateScrollbar()),this.forceFullRender=!1,this.scheduleCursorBlink()}scheduleCursorBlink(){this.cursorTimer!==null&&window.clearTimeout(this.cursorTimer),this.cursorTimer=null,this.blinkEnabled()&&(this.cursorTimer=window.setTimeout(()=>{this.cursorTimer=null,this.cursorOn=!this.cursorOn,this.requestRender()},wt))}blinkEnabled(){let e=this.snapshot;return!e||!this.visible||!this.hasSize?!1:Ft({focused:this.focused,cursorBlinking:e.cursorBlinking,cursorVisible:e.cursorVisible,reducedMotion:this.reducedMotionMedia?.matches??!1})}positionInput(){let e=this.snapshot;if(!e||!e.cursorVisible||e.cursorX<0||e.cursorY<0)return;let t=$+e.cursorX*this.metrics.width,n=this.originY+e.cursorY*this.metrics.height;(t!==this.inputLeft||n!==this.inputTop)&&(this.inputLeft=t,this.inputTop=n,this.input.style.left=`${t}px`,this.input.style.top=`${n}px`,this.input.style.height=`${this.metrics.height}px`)}cellAt(e,t){let n=this.canvas.getBoundingClientRect();return{x:Math.max(0,Math.min(this.cols-1,Math.floor((e-n.left-$)/this.metrics.width))),y:Math.max(0,Math.min(this.rows-1,Math.floor((t-n.top-this.originY)/this.metrics.height)))}}validateLink(e){if(this.options.canActivateLink?.(e)!==!1)return;let t=this.options.validateLink?.(e);return t?.catch(()=>{}),t}activateLink(e,t,n=this.validateLink(e.text)){if(!n){this.options.onLinkActivate(e.text,t);return}let r=this.linkActivationRequestId;n.then(n=>{!this.disposed&&this.visible&&r===this.linkActivationRequestId&&Ut(e,this.findLinkAt(t.clientX,t.clientY))&&(n?this.options.onLinkActivate(e.text,t):this.clearSelection())},()=>{})}linkAt(e,t,n=!1){let r=this.findLinkAt(e,t);return r&&(n&&this.options.validateLink||this.options.canActivateLink?.(r.text)!==!1)?r:null}findLinkAt(e,t){if(!this.snapshot)return null;let n=zt({bounds:this.canvas.getBoundingClientRect(),clientX:e,clientY:t,cols:this.cols,rows:this.rows,metrics:this.metrics,padding:$,originY:this.originY});if(!n)return null;let r=this.core.hyperlinkAt(n.x,n.y);if(r){let e={...n},t={...n};for(;;){let t=e.x>0?{x:e.x-1,y:e.y}:e.y>0&&this.snapshot.rowData[e.y]?.isWrapContinuation?{x:this.cols-1,y:e.y-1}:null;if(!t||this.core.hyperlinkAt(t.x,t.y)!==r)break;e.x=t.x,e.y=t.y}for(;;){let e=t.x+1<this.cols?{x:t.x+1,y:t.y}:t.y+1<this.rows&&this.snapshot.rowData[t.y]?.wrapsToNext?{x:0,y:t.y+1}:null;if(!e||this.core.hyperlinkAt(e.x,e.y)!==r)break;t.x=e.x,t.y=e.y}return{text:r,range:{start:e,end:t}}}return Gt(this.snapshot.rowData,n.y,n.x)}sendMouse(e,t,n){let r=this.canvas.getBoundingClientRect(),i=this.core.encodeMouse({action:e,button:t,mods:+!!n.shiftKey|(n.ctrlKey?2:0)|(n.altKey?4:0)|(n.metaKey?8:0),x:Math.max(0,n.clientX-r.left),y:Math.max(0,n.clientY-r.top),screenWidth:r.width,screenHeight:r.height,cellWidth:this.metrics.width,cellHeight:this.metrics.height,paddingLeft:$,paddingRight:$,paddingTop:this.originY,paddingBottom:Math.max(0,r.height-this.originY-this.rows*this.metrics.height),anyButtonPressed:n.buttons!==0}),a=nn(e,i,this.lastMouseMotionData);this.lastMouseMotionData=a.nextMotionData,a.send&&this.options.onData(i)}synchronizeMouseTrackingState(){let e=this.core.isMouseAnyEventTracking(),t=rn(this.mouseAnyEventTracking,e,this.lastMouseMotionData);return this.mouseAnyEventTracking=t.tracking,this.lastMouseMotionData=t.motionData,e}buttonFromButtons(e){return e&1?1:e&4?3:e&2?2:e&8?4:e&16?5:null}};function pn(e){let t=(0,qe.c)(14),{children:n,label:r,onClick:i,tooltip:a}=e,o;t[0]===n?o=t[1]:(o=(0,F.jsx)(`span`,{className:`relative flex size-3 items-center justify-center group-hover/tab:hidden group-focus-visible/close:hidden`,children:n}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(m,{className:`hidden size-3 group-hover/tab:block group-focus-visible/close:block`}),t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==i||t[5]!==o?(c=(0,F.jsxs)(`button`,{type:`button`,className:`cursor-pointer group/close relative flex size-4 shrink-0 items-center justify-center rounded-sm hover:bg-muted`,"aria-label":r,onClick:i,children:[o,s]}),t[3]=r,t[4]=i,t[5]=o,t[6]=c):c=t[6];let l=c;if(!a)return l;let u;t[7]===l?u=t[8]:(u=(0,F.jsx)(_e,{render:l}),t[7]=l,t[8]=u);let d;t[9]===a?d=t[10]:(d=(0,F.jsx)(w,{children:a}),t[9]=a,t[10]=d);let f;return t[11]!==u||t[12]!==d?(f=(0,F.jsxs)(T,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13],f}var mn=0;function hn(){return mn>0}async function gn(e){let t=ue();if(!t)return!0;mn+=1;try{return await t.dialogs.confirm(e.length===1?[`Close terminal "${e[0]}"?`,`This stops the running process and clears its history.`].join(`
|
|
2
|
+
`):[`Close ${e.length} terminals?`,`This stops their running processes and clears their histories: ${e.map(e=>`"${e}"`).join(`, `)}.`].join(`
|
|
3
|
+
`),{variant:`destructive`})}catch{return!1}finally{--mn}}var _n={environmentId:y,threadId:y,targetOrigin:y,cause:x()},vn=class extends b()(`TerminalLinkPreviewOpenError`,_n){get message(){return`Failed to open terminal link ${this.targetOrigin} in preview for thread ${this.threadId}.`}};async function yn(e){if(!(!e.forceBrowser&&Ne(e.url)&&we(e.threadRef.environmentId)&&e.threadRef.threadId.length>0&&await Pe()===`app`)){e.fallbackToBrowser();return}let t={environmentId:e.threadRef.environmentId,threadId:e.threadRef.threadId,targetOrigin:new URL(e.url).origin},n=await xe(),r=ye(e.threadRef.environmentId),a=await e.openPreview({environmentId:e.threadRef.environmentId,input:{threadId:e.threadRef.threadId,url:e.url,viewport:be(n),profileId:Ce(n),...r===void 0?{}:{runtime:r}}});if(a._tag===`Failure`){if(ae(a))return;console.error(new vn({...t,cause:a.cause})),e.fallbackToBrowser()}else Se(e.threadRef,e.url),i(e.threadRef,a.value),C.getState().openBrowser(e.threadRef,a.value.tabId)}function bn(e){return{...e===void 0?{}:{platform:e},context:{terminalFocus:!0,terminalOpen:!0}}}function xn(e,t,n){return ke(e,t,bn(n))?(e.preventDefault(),!0):!1}function Sn(e,t,n){return e.repeat?xn(e,t,n):!1}var Cn=180,wn=.75;function Tn(){return typeof window>`u`?280:Math.max(Cn,Math.floor(window.innerHeight*wn))}function En(e,t=Tn()){return Math.min(Math.max(Math.round(Number.isFinite(e)?e:280),Cn),t)}function Dn(e,t){e.write(`\r\n[terminal] ${t}\r\n`)}function On(e,t){t.type===`reset`?e.resetAndWrite(t.data):t.type===`append`&&e.write(t.data)}var kn=3e3;function An(e,t,n){if(t.version===0)return n;let r=ze(t.output,n);if(r.type===`none`)return r.cursor;let i=e.getSelectionCellCount(),a=i<=kn,o=i>0&&a?e.getSelection():``;return On(e,r),(!a||i>0&&e.getSelection()!==o)&&e.clearSelection({source:`output`}),r.cursor}function jn(e,t){if(typeof document>`u`)return t;let n=document.createElement(`canvas`);n.width=1,n.height=1;let r=n.getContext(`2d`,{willReadFrequently:!0});if(!r)return t;r.clearRect(0,0,1,1),r.fillStyle=e,r.fillRect(0,0,1,1);let[i,a,o,s]=r.getImageData(0,0,1,1).data;return s===0?t:{r:i??t.r,g:a??t.g,b:o??t.b}}function Mn(e){let t=Number.parseInt(e.slice(1),16);return{r:t>>16&255,g:t>>8&255,b:t&255}}var Nn={light:[`#000000`,`#cd3131`,`#107c10`,`#949800`,`#0451a5`,`#bc05bc`,`#0598bc`,`#555555`,`#666666`,`#cd3131`,`#14ce14`,`#b5ba00`,`#0451a5`,`#bc05bc`,`#0598bc`,`#a5a5a5`].map(Mn),dark:[`#000000`,`#cd3131`,`#0dbc79`,`#e5e510`,`#2472c8`,`#bc3fbc`,`#11a8cd`,`#e5e5e5`,`#666666`,`#f14c4c`,`#23d18b`,`#f5f543`,`#3b8eea`,`#d670d6`,`#29b8db`,`#e5e5e5`].map(Mn)};function Pn(e){return e?JSON.stringify(Object.entries(e).filter(([e,t])=>e.length>0&&typeof t==`string`).sort(([e],[t])=>e.localeCompare(t))):``}function Fn(e,t){let n=e?.trim().toLowerCase();return!n||n===`transparent`||n===`rgba(0, 0, 0, 0)`||n===`rgba(0 0 0 / 0)`?t:e??t}function In(e,t,n){return Fn(e.getPropertyValue(t),n)}function Ln(e,t){let n=e.trim();return n.length>0?{family:n,size:t}:{size:t}}function Rn(e){let t=e?.closest(`[data-thread-terminal-drawer]`)??document.querySelector(`[data-thread-terminal-drawer]`)??document.body,n=getComputedStyle(t),r=e?getComputedStyle(e):n,i=r.colorScheme,a=i===`dark`||i!==`light`&&document.documentElement.classList.contains(`dark`),o=a?`rgb(14, 18, 24)`:`rgb(255, 255, 255)`,s=a?`rgb(237, 241, 247)`:`rgb(28, 33, 41)`,c=getComputedStyle(document.body),l=getComputedStyle(document.documentElement),u=Fn(n.backgroundColor,Fn(c.backgroundColor,o)),d=Fn(n.color,Fn(c.color,s)),f=In(r,`--terminal-background`,In(l,`--terminal-background`,u)),p=In(r,`--terminal-foreground`,In(l,`--terminal-foreground`,d)),m=In(r,`--terminal-cursor`,a?`rgb(180, 203, 255)`:`rgb(38, 56, 78)`),h=In(r,`--terminal-selection-background`,a?`rgba(180, 203, 255, 0.25)`:`rgba(37, 63, 99, 0.2)`);return{background:jn(f,a?{r:14,g:18,b:24}:{r:255,g:255,b:255}),foreground:jn(p,a?{r:237,g:241,b:247}:{r:28,g:33,b:41}),cursor:jn(m,a?{r:180,g:203,b:255}:{r:38,g:56,b:78}),palette:Nn[a?`dark`:`light`],selectionBackground:h}}function zn(e){let t=e.start.y+1;return{lineStart:t,lineEnd:Math.max(t,e.end.y+1)}}function Bn(e){return[...e?.canAddToChat===!1?[]:[{id:`add-to-chat`,label:`Add to chat`}],{id:`copy`,label:`Copy`}]}function Vn(e){let{hasSelection:t,canAddToChat:n=!0}=e;return[...Bn({canAddToChat:n}).map(e=>({...e,disabled:!t})),{id:`paste`,label:`Paste`,...e.readOnly?{disabled:!0}:{}},{id:`select-all`,label:`Select all`},{id:`scroll-to-bottom`,label:`Jump to latest`}]}function Hn(e){return e.actionPending||e.openMenuRequestId===e.currentRequestId}function Un(e,t,n,r){return r>0&&(e===`closed`||e===`exited`)&&e!==t&&!n}function Wn({advancedTypography:e,threadRef:t,threadId:n,terminalId:r,terminalLabel:i,cwd:a,worktreePath:o,runtimeEnv:c,providerInstanceId:l,onSessionExited:u,onAddTerminalContext:f,focusRequestId:p,autoFocus:m,visible:h,resizeEpoch:g,drawerHeight:ee,keybindings:v}){let y=(0,P.useRef)(null),b=(0,P.useRef)(null),x=(0,P.useRef)(h),C=t.environmentId,_e=fe(C,ne),w=(0,P.useEffectEvent)(()=>pe(C,ne)),T=fe(C,re),E=fe(C,te),[D,ve]=(0,P.useState)(null),O=(0,P.useContext)(Ie),ye=D!==null&&T&&E?Fe(C,he(D,a),a,O):null,be=(0,P.useEffectEvent)(e=>{if(j(e))return!0;if(!pe(C,`orchestration:operate`)||e!==D||!ye)return!1;let t=_(d.get(ye),()=>null);return t?.kind===`file`||t?.kind===`directory`}),xe=(0,P.useEffectEvent)(async e=>{if(j(e))return!0;if(!pe(C,`orchestration:operate`)||!pe(C,`filesystem:read`))return!1;let t=Fe(C,he(e,a),a,O);if(!t)return!1;let n=await oe(d,t,{reportFailure:!1});return n._tag===`Success`&&(n.value?.kind===`file`||n.value?.kind===`directory`)}),Se=s(de.configValueAtom(C)),Ce=He(C,Se?.availableEditors??[]),we=(0,P.useEffectEvent)(e=>Ce(e)),ke=me(Me.open,{reportFailure:!1}),Ne=me(Re.write,{reportFailure:!1}),Pe=me(Re.resize,{reportFailure:!1}),M=(0,P.useRef)(!1),N=(0,P.useRef)(0),Ve=(0,P.useRef)(null),We=(0,P.useRef)(v),Ge=(0,P.useMemo)(()=>Pn(c),[c]),qe=(0,P.useEffectEvent)(()=>{w()&&u()}),Ye=(0,P.useEffectEvent)(e=>{f?.(e)}),L=(0,P.useEffectEvent)(()=>f!==void 0),Xe=(0,P.useEffectEvent)(()=>i),R=S(t=>Ke({advanced:e,code:t.fontFamilyCode,terminal:t.fontFamilyTerminal})),z=S(t=>Ue({advanced:e,code:t.fontSizeCode,terminal:t.fontSizeTerminal})),B=(0,P.useRef)({family:R,size:z}),V=Be({environmentId:C,terminal:{threadId:n,terminalId:r,cwd:a,...o===void 0?{}:{worktreePath:o},...c?{env:c}:{},...l?{providerInstanceId:l}:{}}}),Ze=_e&&V.version>0&&V.status===`running`,Qe=Ze?V.output.generation:null,H=(0,P.useEffectEvent)(e=>Ne({environmentId:C,input:{threadId:n,terminalId:r,data:e}})),$e=(0,P.useEffectEvent)((e,t)=>{if(Ze&&w())return Pe({environmentId:C,input:{threadId:n,terminalId:r,cols:e,rows:t}})}),U=V.output,et=V.error,W=V.status,G=V.grid,K=(0,P.useRef)(G);K.current=G;let q=(0,P.useRef)(Le),tt=(0,P.useRef)(`closed`),J=(0,P.useEffectEvent)((e,t,n)=>{let r=tt.current;n>0&&t===`running`?M.current=!1:Un(t,r,M.current,n)&&(M.current=!0,Dn(e,t===`closed`?`Terminal closed`:`Process exited`),window.setTimeout(()=>{M.current&&qe()},0)),n>0&&(tt.current=t)}),Y=V.version,X=(0,P.useRef)({output:U,error:et,status:W,version:Y}),Z=(0,P.useRef)(X.current);return Z.current={output:U,error:et,status:W,version:Y},(0,P.useEffect)(()=>{We.current=v},[v]),(0,P.useLayoutEffect)(()=>{b.current&&(b.current.input.readOnly=!_e)},[_e]),(0,P.useEffect)(()=>{if(!ye)b.current?.refreshLinkActivation();else return d.subscribe(ye,()=>b.current?.refreshLinkActivation(),{immediate:!0})},[ye]),(0,P.useEffect)(()=>{Qe!==null&&b.current?.resendSize()},[Qe]),(0,P.useLayoutEffect)(()=>{x.current=h,b.current?.setVisible(h)},[h]),(0,P.useEffect)(()=>{let e=B.current;(e.family!==R||e.size!==z)&&(B.current={family:R,size:z},b.current?.setFont(Ln(R,z)))},[R,z]),(0,P.useEffect)(()=>{let e=y.current;if(!e)return;let n=ue(),i=!1,o=null,s=null,c=[],l=null;return(async()=>{let o=B.current,u={theme:Rn(e),font:Ln(o.family,o.size),get visible(){return x.current},onData:e=>me(e),onResize:(e,t)=>void $e(e,t),onSelectionChange:()=>_e(),beforeKey:e=>de(e),onLinkActivate:(e,t)=>fe(e,t),canActivateLink:e=>be(e),validateLink:e=>xe(e),onLinkHover:e=>ve(e!==null&&!j(e)?e:null),onContextMenu:e=>{b.current&&oe(e)}},d=await fn.create(e,u);if(i)return d.dispose(),null;d.setVisible(x.current),d.setTheme(Rn(e)),s=d,b.current=d,d.input.readOnly=!w();let f=B.current;(f.family!==o.family||f.size!==o.size)&&d.setFont(Ln(f.family,f.size));let p=Z.current;X.current=p,d.setSharedGrid(K.current);let m=ze(p.output,Le);m.type===`reset`&&m.data.length>0&&On(d,m),q.current=m.cursor,p.error!==null&&Dn(d,p.error),tt.current=`closed`,J(d,p.status,p.version),w()&&x.current&&e.contains(document.activeElement)&&d.focus();let h=(e=!1)=>{let t=Ve.current===N.current;(e||t)&&(N.current+=1),t&&n?.contextMenu.close()},g=()=>{l?.cancel(),h(!0)};c.push(g);let _=(e=null)=>{let t=b.current,n=y.current;if(!t||!n||!t.hasSelection())return null;let i=t.getSelection(),a=t.getSelectionPosition(),o=i.replace(/\r\n/g,`
|
|
4
|
+
`).replace(/^\n+|\n+$/g,``);if(!a||o.length===0)return null;let{lineStart:s,lineEnd:c}=zn(a);return{position:Je({bounds:n.getBoundingClientRect(),selectionRect:t.getSelectionEndClientRect(),pointer:e,viewport:{width:window.innerWidth,height:window.innerHeight}}),clipboardText:i,selection:{terminalId:r,terminalLabel:Xe(),lineStart:s,lineEnd:c,text:o}}},ee=e=>{let t=_();t?.clipboardText===e&&(Ye(t.selection),b.current?.clearSelection(),b.current?.focus())},te=(e,t,n)=>{if(e!==N.current)return;let r=b.current;r&&Dn(r,t instanceof Error?t.message:n)},v=e=>{e===N.current&&b.current?.focus()},ne=async(e,t)=>{try{await ce(e,`terminal selection`)}catch(e){te(t,e,`Unable to copy terminal selection`)}v(t)},re=async e=>{if(!w())return;let t=b.current;if(t){try{await t.pasteFromClipboard(()=>le(`terminal input`),()=>e===N.current)}catch(t){te(e,t,`Unable to read the clipboard`);return}v(e)}},oe=async e=>{if(!n||!b.current)return;e.preventDefault(),g();let t=_(),r=N.current,i;try{i=await n.contextMenu.show(Vn({hasSelection:t!==null,canAddToChat:L(),readOnly:!w()}),{x:e.clientX,y:e.clientY})}catch(e){te(r,e,`Unable to open the terminal context menu`),v(r);return}if(r===N.current&&i!==null)switch(i){case`add-to-chat`:t&&L()&&ee(t.clipboardText);return;case`copy`:t&&await ne(t.clipboardText,r);return;case`paste`:await re(r);return;case`select-all`:b.current?.selectAll(),v(r);return;case`scroll-to-bottom`:b.current?.scrollToBottom(),v(r);return}},ue=async e=>{if(!n){g();return}if(Ve.current===N.current)return;let t=_(e);if(!t){g();return}let r=++N.current;Ve.current=r;let i=await n.contextMenu.show(Bn({canAddToChat:L()}),t.position).finally(()=>{Ve.current===r&&(Ve.current=null)});if(r===N.current&&i!==null)switch(i){case`add-to-chat`:L()&&ee(t.clipboardText);return;case`copy`:await ne(t.clipboardText,r);return}},S=async(e,t)=>{if(!w())return;let n=b.current;if(!n)return;let r=await H(e);if(r._tag===`Failure`&&!ae(r)){let e=ie(r);Dn(n,e instanceof Error?e.message:t)}};function de(e){let t=We.current,n={context:{terminalFocus:!0,terminalOpen:!0}};if(xn(e,t)||A(e,t,n)||De(e,t,n)||Oe(e,t,n)||Ae(e,t,n)||k(e,t,n))return!1;let r=Te(e);if(r!==null)return e.preventDefault(),e.stopPropagation(),S(r,`Failed to move cursor`),!1;let i=je(e);return i===null?!Ee(e)||(e.preventDefault(),e.stopPropagation(),S(`\f`,`Failed to clear terminal`),!1):(e.preventDefault(),e.stopPropagation(),S(i,`Failed to delete terminal input`),!1)}function fe(e,r){if(!j(e)&&!pe(C,`orchestration:operate`))return;let i=b.current;if(!i)return;if(j(e)){if(!n){Dn(i,`Opening links is unavailable in this browser.`);return}let a=()=>{n.shell.openExternal(e).catch(e=>{Dn(i,e instanceof Error?e.message:`Unable to open link`)})};if(!pe(C,`preview:operate`)){a();return}yn({url:e,threadRef:t,openPreview:ke,fallbackToBrowser:a,forceBrowser:r.metaKey||r.ctrlKey}).catch(e=>{se.add(ge({type:`error`,title:`Unable to open link`,description:e instanceof Error?e.message:`An error occurred.`}))});return}let o=he(e,a);(async()=>{let e=await we(o);if(e._tag===`Success`||ae(e))return;let t=ie(e);Dn(i,t instanceof Error?t.message:`Unable to open path`)})()}function me(e){w()&&(async()=>{let t=await H(e);if(t._tag===`Success`||ae(t))return;let n=ie(t);Dn(d,n instanceof Error?n.message:`Terminal write failed`)})()}function _e(){b.current?.hasSelection()||Hn({actionPending:l?.pending??!1,openMenuRequestId:Ve.current,currentRequestId:N.current})&&g()}l=I({element:e,onSelection:e=>{ue(e)},onDismiss:e=>h(e===`interaction`)}),c.push(()=>l?.dispose());let T=new MutationObserver(()=>{let e=b.current;e&&e.setTheme(Rn(y.current))});T.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`]}),c.push(()=>T.disconnect());let E=window.setTimeout(()=>{let e=b.current;if(!e)return;let t=e.isAtBottom();e.fit(),t&&e.scrollToBottom()},30);c.push(()=>window.clearTimeout(E));let D=c;return c=[],s=null,()=>{for(let e of D.toReversed())e();b.current===d&&(b.current=null),d.dispose()}})().then(e=>{i?e?.():o=e}).catch(t=>{for(let e of c.toReversed())e();if(c=[],b.current===s&&(b.current=null),s?.dispose(),s=null,i)return;let n=t instanceof Error?t.message:`Unable to initialize libghostty-vt`;e.textContent=`${n} — close and reopen the terminal to retry.`}),()=>{i=!0;let t=e.contains(document.activeElement);o?.(),w()&&t&&e.isConnected&&e.focus({preventScroll:!0})}},[a,C,Ge,r,n,o]),(0,P.useEffect)(()=>{b.current?.setSharedGrid(G)},[G]),(0,P.useEffect)(()=>{let e=b.current,t={output:U,error:et,status:W,version:Y};if(!e){X.current=t;return}let n=X.current;J(e,t.status,t.version),(t.version!==n.version||t.output!==n.output)&&(q.current=An(e,t,q.current),t.error!==null&&t.error!==n.error&&Dn(e,t.error),X.current=t)},[U,et,W,Y]),(0,P.useEffect)(()=>{m&&_e&&h&&(b.current??y.current)?.focus()},[m,_e,p,h]),(0,P.useEffect)(()=>{let e=b.current;if(!e||!x.current)return;let t=e.isAtBottom(),n=window.requestAnimationFrame(()=>{x.current&&(e.fit(),t&&e.scrollToBottom())});return()=>{window.cancelAnimationFrame(n)}},[ee,C,g,r,n]),(0,F.jsx)(`div`,{ref:y,tabIndex:-1,className:`relative h-full w-full overflow-hidden bg-(--terminal-background)`})}function Gn(e){let t=(0,qe.c)(16),{label:n,className:r,onClick:i,children:a,disabled:o}=e,s=o&&`opacity-64 cursor-not-allowed`,c;t[0]!==r||t[1]!==s?(c=h(r,s),t[0]=r,t[1]=s,t[2]=c):c=t[2];let l=o?void 0:i,u;t[3]!==o||t[4]!==n||t[5]!==c||t[6]!==l?(u=(0,F.jsx)(`button`,{type:`button`,className:c,onClick:l,"aria-label":n,"aria-disabled":o}),t[3]=o,t[4]=n,t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]!==a||t[9]!==u?(d=(0,F.jsx)(D,{openOnHover:!0,render:u,children:a}),t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]===n?f=t[12]:(f=(0,F.jsx)(E,{tooltipStyle:!0,side:`bottom`,sideOffset:6,align:`center`,className:`pointer-events-none select-none`,children:n}),t[11]=n,t[12]=f);let p;return t[13]!==d||t[14]!==f?(p=(0,F.jsxs)(ve,{children:[d,f]}),t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Kn(e){let t=(0,qe.c)(166),{mode:n,threadRef:r,threadId:i,cwd:s,worktreePath:l,runtimeEnv:d,visible:m,height:_,terminalIds:te,activeTerminalId:y,terminalGroups:b,activeTerminalGroupId:x,focusRequestId:re,onSplitTerminal:ie,onSplitTerminalVertical:ae,onNewTerminal:oe,splitShortcutLabel:se,splitVerticalShortcutLabel:ce,newShortcutLabel:le,closeShortcutLabel:ue,onActiveTerminalChange:S,onCloseTerminal:de,onHeightChange:me,onAddTerminalContext:C,keybindings:he,terminalLabelsById:ge,terminalLaunchLocationsById:_e}=e,w=n===void 0?`drawer`:n,T=m===void 0||m,E=fe(r.environmentId,ne),D=w===`panel`,[ve]=c(Ge,!1,v),O=_,[ye,be]=(0,P.useState)(Tn),xe;t[0]!==O||t[1]!==i?(xe=()=>({threadId:i,height:O}),t[0]=O,t[1]=i,t[2]=xe):xe=t[2];let[Se,Ce]=(0,P.useState)(xe),we=Se.threadId===i?Se.height:O,Te;t[3]!==we||t[4]!==ye?(Te=En(we,ye),t[3]=we,t[4]=ye,t[5]=Te):Te=t[5];let k=Te,Ee;t[6]!==O||t[7]!==i?(Ee=e=>{Ce(t=>{let n=t.threadId===i?t.height:O,r=typeof e==`function`?e(n):e;return r===n&&t.threadId===i?t:{threadId:i,height:r}})},t[6]=O,t[7]=i,t[8]=Ee):Ee=t[8];let De=Ee,[Oe,ke]=(0,P.useState)(0),A=(0,P.useRef)(k),Ae=(0,P.useRef)(we),je=(0,P.useRef)(O),Me=(0,P.useRef)(me),Ne=(0,P.useRef)(null),Pe=(0,P.useRef)(!1),Fe;if(t[9]!==te){Fe=[];let e=new Set;for(let t of te){let n=t.trim();n.length===0||e.has(n)||(e.add(n),Fe.push(n))}t[9]=te,t[10]=Fe}else Fe=t[10];let j=Fe,M=j.length===0?``:j.includes(y)?y:j[0]??``,Ie;bb0:{if(j.length===0){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[11]=e):e=t[11],Ie=e;break bb0}let e;t[12]===j?e=t[13]:(e=new Set(j),t[12]=j,t[13]=e);let n=e,r;if(t[14]!==j||t[15]!==b||t[16]!==n){let e=new Set,i=new Set;r=[];let a=e=>{if(!i.has(e))return i.add(e),e;let t=2;for(;i.has(`${e}-${t}`);)t+=1;let n=`${e}-${t}`;return i.add(n),n};for(let t of b){let i=[],o=new Set;for(let r of t.terminalIds){let t=r.trim();t.length!==0&&(o.has(t)||(o.add(t),n.has(t)&&(e.has(t)||i.push(t))))}if(i.length===0)continue;for(let t of i)e.add(t);let s=t.id.trim().length>0?t.id.trim():`group-${i[0]??j[0]??``}`;r.push({id:a(s),terminalIds:i,...t.splitDirection===`vertical`?{splitDirection:`vertical`}:{}})}for(let t of j)e.has(t)||r.push({id:a(`group-${t}`),terminalIds:[t]});let o=new Map(j.map(Zn));r.sort((e,t)=>{let n=e=>Math.min(...e.map(e=>o.get(e)??1/0));return n(e.terminalIds)-n(t.terminalIds)}),t[14]=j,t[15]=b,t[16]=n,t[17]=r}else r=t[17];Ie=r}let N=Ie,Le;bb1:{let e=N.findIndex(e=>e.id===x);if(e>=0){Le=e;break bb1}let t=N.findIndex(e=>e.terminalIds.includes(M));Le=t>=0?t:0}let Re=Le,ze;t[18]!==j.length||t[19]!==Re||t[20]!==M||t[21]!==N?(ze=N[Re]?.terminalIds??(j.length>0?[M]:[]),t[18]=j.length,t[19]=Re,t[20]=M,t[21]=N,t[22]=ze):ze=t[22];let Be=ze,He=N[Re]?.splitDirection??`horizontal`,Ue=j.length>1,We=Be.length>1,Ke;t[23]===N?Ke=t[24]:(Ke=N.length>1||N.some(Xn),t[23]=N,t[24]=Ke);let Je=Ke,I=Be.length>=4,Ye;if(t[25]!==j||t[26]!==ge){Ye=new Map;for(let e of j)Ye.set(e,ge?.get(e)??Ve(e));t[25]=j,t[26]=ge,t[27]=Ye}else Ye=t[27];let L=Ye,Xe;t[28]!==s||t[29]!==d||t[30]!==_e||t[31]!==l?(Xe=e=>_e?.get(e)??{cwd:s,...l===void 0?{}:{worktreePath:l},...d?{runtimeEnv:d}:{}},t[28]=s,t[29]=d,t[30]=_e,t[31]=l,t[32]=Xe):Xe=t[32];let R=Xe,z=I?`Split Terminal Horizontally (max 4 per group)`:se?`Split Terminal Horizontally (${se})`:`Split Terminal Horizontally`,B=I?`Split Terminal Vertically (max 4 per group)`:ce?`Split Terminal Vertically (${ce})`:`Split Terminal Vertically`,V=le?`New Terminal (${le})`:`New Terminal`,Ze=ue?`Close Terminal (${ue})`:`Close Terminal`,Qe;t[33]!==E||t[34]!==I||t[35]!==ie?(Qe=()=>{E&&!I&&ie()},t[33]=E,t[34]=I,t[35]=ie,t[36]=Qe):Qe=t[36];let H=Qe,$e;t[37]!==E||t[38]!==I||t[39]!==ae?($e=()=>{E&&!I&&ae()},t[37]=E,t[38]=I,t[39]=ae,t[40]=$e):$e=t[40];let U=$e,et;t[41]!==E||t[42]!==oe?(et=()=>{E&&oe()},t[41]=E,t[42]=oe,t[43]=et):et=t[43];let W=et,G;t[44]!==E||t[45]!==de||t[46]!==L||t[47]!==r.environmentId?(G=e=>{E&&gn([L.get(e)??Ve(e)]).then(t=>{t&&pe(r.environmentId,`terminal:operate`)&&de(e)})},t[44]=E,t[45]=de,t[46]=L,t[47]=r.environmentId,t[48]=G):G=t[48];let K=G,q,tt;t[49]===me?(q=t[50],tt=t[51]):(q=()=>{Me.current=me},tt=[me],t[49]=me,t[50]=q,t[51]=tt),(0,P.useEffect)(q,tt);let J,Y;t[52]===k?(J=t[53],Y=t[54]):(J=()=>{let e=Ne.current;e?e.drawer?.style.setProperty(`height`,`${A.current}px`):A.current=k},Y=[k],t[52]=k,t[53]=J,t[54]=Y),(0,P.useLayoutEffect)(J,Y);let X,Z;t[55]===we?(X=t[56],Z=t[57]):(X=()=>{Ae.current=we},Z=[we],t[55]=we,t[56]=X,t[57]=Z),(0,P.useEffect)(X,Z);let nt;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(nt=e=>{je.current!==e&&(je.current=e,Me.current(e))},t[58]=nt):nt=t[58];let rt=nt,it;t[59]===O?it=t[60]:(it=()=>{je.current=O},t[59]=O,t[60]=it);let at;t[61]!==O||t[62]!==i?(at=[O,i],t[61]=O,t[62]=i,t[63]=at):at=t[63],(0,P.useEffect)(it,at);let ot;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ot=e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),Pe.current=!1,Ne.current={pointerId:e.pointerId,startY:e.clientY,startHeight:A.current,drawer:e.currentTarget.parentElement})},t[64]=ot):ot=t[64];let st=ot,ct;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ct=e=>{let t=Ne.current;if(!t||t.pointerId!==e.pointerId)return;e.preventDefault();let n=En(t.startHeight+(t.startY-e.clientY));n!==A.current&&(Pe.current=!0,A.current=n,t.drawer?.style.setProperty(`height`,`${n}px`))},t[65]=ct):ct=t[65];let lt=ct,ut;t[66]===De?ut=t[67]:(ut=e=>{let t=Ne.current;if(t&&t.pointerId===e.pointerId){if(Ne.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),!Pe.current||A.current===t.startHeight){let e=En(Ae.current);A.current=e,t.drawer?.style.setProperty(`height`,`${e}px`)}else De(A.current),rt(A.current),ke(Yn)}},t[66]=De,t[67]=ut);let dt=ut,Q,ft;t[68]===T?(Q=t[69],ft=t[70]):(Q=()=>{if(!T)return;let e=()=>{let e=Ne.current,t=En(A.current);e&&t!==A.current&&(A.current=t,e.drawer?.style.setProperty(`height`,`${t}px`)),be(Tn()),ke(Jn)};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},ft=[T],t[68]=T,t[69]=Q,t[70]=ft),(0,P.useEffect)(Q,ft);let pt,mt;t[71]===T?(pt=t[72],mt=t[73]):(pt=()=>{T&&(be(Tn()),ke(qn))},mt=[T],t[71]=T,t[72]=pt,t[73]=mt),(0,P.useEffect)(pt,mt);let ht,gt;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ht=()=>()=>{rt(Ae.current)},gt=[rt],t[74]=ht,t[75]=gt):(ht=t[74],gt=t[75]),(0,P.useEffect)(ht,gt);let _t;t[76]!==dt||t[77]!==D?(_t=D?null:(0,F.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-20 h-1.5 cursor-row-resize touch-none any-pointer-coarse:h-4`,onPointerDown:st,onPointerMove:lt,onPointerUp:dt,onPointerCancel:dt,onLostPointerCapture:dt}),t[76]=dt,t[77]=D,t[78]=_t):_t=t[78];let vt=_t;if(j.length===0){let e=D?`right-panel`:`drawer`,n=D?`h-full flex-1`:`shrink-0 border-t border-border/80`,r;t[79]===n?r=t[80]:(r=h(`relative flex min-w-0 flex-col overflow-hidden bg-background`,n),t[79]=n,t[80]=r);let i;t[81]!==k||t[82]!==D?(i=D?void 0:{height:`${k}px`},t[81]=k,t[82]=D,t[83]=i):i=t[83];let a;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsx)(`p`,{children:`No terminal sessions for this thread yet.`}),t[84]=a):a=t[84];let o=!E,s;t[85]!==V||t[86]!==W||t[87]!==o?(s=(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 px-4 py-6 text-center text-sm text-muted-foreground`,children:[a,(0,F.jsx)(p,{size:`xs`,variant:`outline`,onClick:W,disabled:o,children:V})]}),t[85]=V,t[86]=W,t[87]=o,t[88]=s):s=t[88];let c;return t[89]!==vt||t[90]!==e||t[91]!==r||t[92]!==i||t[93]!==s?(c=(0,F.jsxs)(`aside`,{"data-thread-terminal-drawer":!0,"data-terminal-owner":e,className:r,style:i,children:[vt,s]}),t[89]=vt,t[90]=e,t[91]=r,t[92]=i,t[93]=s,t[94]=c):c=t[94],c}let yt;t[95]!==R||t[96]!==M?(yt=R(M),t[95]=R,t[96]=M,t[97]=yt):yt=t[97];let bt=yt,xt=D?`right-panel`:`drawer`,St=D?`h-full flex-1`:`shrink-0 border-t border-border/80`,$;t[98]===St?$=t[99]:($=h(`relative flex min-w-0 flex-col overflow-hidden bg-background`,St),t[98]=St,t[99]=$);let Ct;t[100]!==k||t[101]!==D?(Ct=D?void 0:{height:`${k}px`},t[100]=k,t[101]=D,t[102]=Ct):Ct=t[102];let wt;t[103]!==E||t[104]!==Ze||t[105]!==K||t[106]!==I||t[107]!==Ue||t[108]!==V||t[109]!==W||t[110]!==H||t[111]!==U||t[112]!==M||t[113]!==z||t[114]!==B?(wt=!Ue&&(0,F.jsx)(`div`,{className:`pointer-events-none absolute right-2 top-2 z-20`,children:(0,F.jsxs)(`div`,{className:`pointer-events-auto inline-flex items-center overflow-hidden rounded-md border border-border/80 bg-background shadow-xs`,children:[(0,F.jsx)(Gn,{disabled:!E,className:`p-1 text-foreground/90 transition-colors ${I?`cursor-not-allowed opacity-64 hover:bg-transparent`:`hover:bg-accent`}`,onClick:H,label:z,children:(0,F.jsx)(o,{className:`size-3.25`})}),(0,F.jsx)(`div`,{className:`h-4 w-px bg-border/80`}),(0,F.jsx)(Gn,{disabled:!E,className:`p-1 text-foreground/90 transition-colors ${I?`cursor-not-allowed opacity-64 hover:bg-transparent`:`hover:bg-accent`}`,onClick:U,label:B,children:(0,F.jsx)(a,{className:`size-3.25`})}),(0,F.jsx)(`div`,{className:`h-4 w-px bg-border/80`}),(0,F.jsx)(Gn,{disabled:!E,className:`p-1 text-foreground/90 transition-colors hover:bg-accent`,onClick:W,label:V,children:(0,F.jsx)(f,{className:`size-3.25`})}),(0,F.jsx)(`div`,{className:`h-4 w-px bg-border/80`}),(0,F.jsx)(Gn,{disabled:!E,className:`p-1 text-foreground/90 transition-colors hover:bg-accent`,onClick:()=>K(M),label:Ze,children:(0,F.jsx)(ee,{className:`size-3.25`})})]})}),t[103]=E,t[104]=Ze,t[105]=K,t[106]=I,t[107]=Ue,t[108]=V,t[109]=W,t[110]=H,t[111]=U,t[112]=M,t[113]=z,t[114]=B,t[115]=wt):wt=t[115];let Tt=Ue&&`gap-1.5`,Et;t[116]===Tt?Et=t[117]:(Et=h(`flex h-full min-h-0 bg-(--terminal-background)`,Tt),t[116]=Tt,t[117]=Et);let Dt;t[118]!==bt||t[119]!==ve||t[120]!==k||t[121]!==re||t[122]!==We||t[123]!==he||t[124]!==S||t[125]!==C||t[126]!==de||t[127]!==Oe||t[128]!==R||t[129]!==M||t[130]!==He||t[131]!==L||t[132]!==i||t[133]!==r||t[134]!==T||t[135]!==Be?(Dt=(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:We?(0,F.jsx)(`div`,{className:`grid h-full w-full min-w-0 gap-0 overflow-hidden`,style:He===`vertical`?{gridTemplateRows:`repeat(${Be.length}, minmax(0, 1fr))`}:{gridTemplateColumns:`repeat(${Be.length}, minmax(0, 1fr))`},children:Be.map(e=>{let t=R(e);return(0,F.jsx)(`div`,{className:`min-h-0 min-w-0 ${He===`vertical`?`border-t first:border-t-0`:`border-l first:border-l-0`} ${e===M?`border-border`:`border-border/70`}`,onPointerDown:()=>{e!==M&&S(e)},children:(0,F.jsx)(`div`,{className:`h-full`,children:(0,F.jsx)(Wn,{advancedTypography:ve,threadRef:r,threadId:i,terminalId:e,terminalLabel:L.get(e)??`Terminal`,cwd:t.cwd,...t.worktreePath===void 0?{}:{worktreePath:t.worktreePath},...t.runtimeEnv?{runtimeEnv:t.runtimeEnv}:{},onSessionExited:()=>de(e),onAddTerminalContext:C,focusRequestId:re,autoFocus:e===M,visible:T,resizeEpoch:Oe,drawerHeight:k,keybindings:he})})},e)})}):(0,F.jsx)(`div`,{className:`h-full`,children:(0,F.jsx)(Wn,{advancedTypography:ve,threadRef:r,threadId:i,terminalId:M,terminalLabel:L.get(M)??`Terminal`,cwd:bt.cwd,...bt.worktreePath===void 0?{}:{worktreePath:bt.worktreePath},...bt.runtimeEnv?{runtimeEnv:bt.runtimeEnv}:{},onSessionExited:()=>de(M),onAddTerminalContext:C,focusRequestId:re,autoFocus:!0,visible:T,resizeEpoch:Oe,drawerHeight:k,keybindings:he},M)})}),t[118]=bt,t[119]=ve,t[120]=k,t[121]=re,t[122]=We,t[123]=he,t[124]=S,t[125]=C,t[126]=de,t[127]=Oe,t[128]=R,t[129]=M,t[130]=He,t[131]=L,t[132]=i,t[133]=r,t[134]=T,t[135]=Be,t[136]=Dt):Dt=t[136];let Ot;t[137]!==E||t[138]!==ue||t[139]!==Ze||t[140]!==K||t[141]!==I||t[142]!==Ue||t[143]!==V||t[144]!==S||t[145]!==W||t[146]!==H||t[147]!==U||t[148]!==M||t[149]!==N||t[150]!==Je||t[151]!==z||t[152]!==B||t[153]!==L?(Ot=Ue&&(0,F.jsxs)(`aside`,{className:`flex w-36 min-w-36 flex-col border border-border/70 bg-muted/10`,children:[(0,F.jsx)(`div`,{className:`flex h-[22px] items-stretch justify-end border-b border-border/70`,children:(0,F.jsxs)(`div`,{className:`inline-flex h-full items-stretch any-pointer-coarse:relative any-pointer-coarse:z-30`,children:[(0,F.jsx)(Gn,{disabled:!E,className:`inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${I?`cursor-not-allowed opacity-64 hover:bg-transparent`:`hover:bg-accent/70`}`,onClick:H,label:z,children:(0,F.jsx)(o,{className:`size-3.25`})}),(0,F.jsx)(Gn,{disabled:!E,className:`inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors ${I?`cursor-not-allowed opacity-64 hover:bg-transparent`:`hover:bg-accent/70`}`,onClick:U,label:B,children:(0,F.jsx)(a,{className:`size-3.25`})}),(0,F.jsx)(Gn,{disabled:!E,className:`inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70`,onClick:W,label:V,children:(0,F.jsx)(f,{className:`size-3.25`})}),(0,F.jsx)(Gn,{disabled:!E,className:`inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70`,onClick:()=>K(M),label:Ze,children:(0,F.jsx)(ee,{className:`size-3.25`})})]})}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1 py-1`,children:N.map(e=>{let t=e.terminalIds.includes(M),n=t?M:e.terminalIds[0]??M,r=e.terminalIds.length,i=r>1,s=i?e.splitDirection===`vertical`?`Stacked`:`Side by side`:`Single`,c=i?e.splitDirection===`vertical`?a:o:g;return(0,F.jsxs)(`div`,{className:`pb-0.5`,children:[Je&&(0,F.jsxs)(`button`,{type:`button`,className:`flex h-[22px] w-full cursor-pointer items-center gap-1 rounded px-1.5 text-2xs ${t?`bg-accent/50 text-foreground`:`text-muted-foreground hover:bg-accent/40 hover:text-foreground`}`,onClick:()=>S(n),children:[(0,F.jsx)(c,{className:`size-3 shrink-0`}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:s}),(0,F.jsx)(`span`,{className:`text-muted-foreground/70 text-3xs tabular-nums`,children:r})]}),(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.terminalIds.map(e=>{let t=e===M,n=L.get(e)??`Terminal`,r=`Close ${n}${t&&ue?` (${ue})`:``}`;return(0,F.jsxs)(`div`,{className:h(`group/tab flex h-6 w-full items-center gap-0.5 rounded-md pr-2 pl-1.5 text-xs`,t?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),children:[E?(0,F.jsx)(pn,{label:r,onClick:()=>K(e),tooltip:r,children:(0,F.jsx)(u,{className:`size-3 shrink-0`})}):(0,F.jsx)(u,{className:`size-3 shrink-0`}),(0,F.jsx)(`button`,{type:`button`,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-1 text-left`,onClick:()=>S(e),children:(0,F.jsx)(`span`,{className:`truncate`,children:n})})]},e)})})]},e.id)})})]}),t[137]=E,t[138]=ue,t[139]=Ze,t[140]=K,t[141]=I,t[142]=Ue,t[143]=V,t[144]=S,t[145]=W,t[146]=H,t[147]=U,t[148]=M,t[149]=N,t[150]=Je,t[151]=z,t[152]=B,t[153]=L,t[154]=Ot):Ot=t[154];let kt;t[155]!==Et||t[156]!==Dt||t[157]!==Ot?(kt=(0,F.jsx)(`div`,{className:`min-h-0 w-full flex-1`,children:(0,F.jsxs)(`div`,{className:Et,children:[Dt,Ot]})}),t[155]=Et,t[156]=Dt,t[157]=Ot,t[158]=kt):kt=t[158];let At;return t[159]!==vt||t[160]!==xt||t[161]!==$||t[162]!==Ct||t[163]!==wt||t[164]!==kt?(At=(0,F.jsxs)(`aside`,{"data-thread-terminal-drawer":!0,"data-terminal-owner":xt,className:$,style:Ct,children:[vt,wt,kt]}),t[159]=vt,t[160]=xt,t[161]=$,t[162]=Ct,t[163]=wt,t[164]=kt,t[165]=At):At=t[165],At}function qn(e){return e+1}function Jn(e){return e+1}function Yn(e){return e+1}function Xn(e){return e.terminalIds.length>1}function Zn(e,t){return[e,t]}export{xn as a,fn as c,Sn as i,I as l,Kn as n,gn as o,Rn as r,hn as s,Wn as t,Je as u};
|
|
5
|
+
//# sourceMappingURL=ThreadTerminalDrawer-Ci0mbLzJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./react-BUfh6y28.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$a as a,Ai as o,Ap as s,Bp as c,Co as l,Cp as u,Dp as d,Ea as f,Ei as p,Ep as m,Fi as h,Fp as g,Gp as _,Hp as v,Hr as y,Ip as b,Ir as x,Ji as S,Ka as C,Kp as w,Lp as T,Lr as E,Mp as D,Na as O,Ni as k,Np as A,Nr as ee,Op as j,Pp as M,Rp as N,Sa as P,Si as te,Ti as F,To as I,Tp as L,Ua as R,Ui as z,Up as B,Vp as ne,Wa as V,Wp as re,_a as ie,_i as ae,_o as oe,bi as se,bo as ce,di as le,fa as ue,fi as de,fo as fe,fp as pe,ga as me,gi as he,go as ge,hi as _e,ja as H,jp as ve,ki as ye,kp as be,kr as xe,li as Se,lp as U,mi as Ce,no as we,oi as Te,pa as Ee,qa as De,qp as Oe,ua as ke,ui as Ae,up as je,va as Me,vi as Ne,wa as Pe,wi as Fe,wp as Ie,xa as Le,xi as Re,xo as ze,yi as Be,zp as Ve}from"./utils-BVnIIHXP.js";import{f as He,i as Ue,n as We}from"./useRender-BP5vR6yH.js";var W=e(n()),G=e(i()),Ge=W.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Le,currentIdRef:{current:null},currentContextRef:{current:null}});function Ke(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=W.useRef(n),a=W.useRef(n),o=W.useRef(null),s=W.useRef(null),c=P();return(0,G.jsx)(Ge.Provider,{value:W.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function qe(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=W.useContext(Ge),[f,p]=W.useState(!1);return R(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),R(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Ee(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,H(fe))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),R(()=>()=>{l.current=null},[l]),W.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Je(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Ye(e){return e!=null&&e.clientX!=null}function Xe(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=W.useRef(!1),u=W.useRef(null),[d,f]=W.useState(),[p,m]=W.useState([]),h=V(e=>{i.set(`positionReference`,e)}),g=V((e,t,n)=>{l.current||(!c.current.openEvent||Ye(c.current.openEvent))&&i.set(`positionReference`,Je(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=V(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=Me(d)?o:a;W.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=C(o);function r(t){let n=ie(t);me(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||Ye(c.current.openEvent)?u.current=ue(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),W.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),W.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),W.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=W.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return W.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var K=e(t((e=>{e.Check=[[`path`,{d:`M20 6 9 17l-5-5`}]],e.ChevronDown=[[`path`,{d:`m6 9 6 6 6-6`}]],e.ChevronRight=[[`path`,{d:`m9 18 6-6-6-6`}]],e.ChevronUp=[[`path`,{d:`m18 15-6-6-6 6`}]],e.ChevronsDownUp=[[`path`,{d:`m7 20 5-5 5 5`}],[`path`,{d:`m7 4 5 5 5-5`}]],e.ChevronsUpDown=[[`path`,{d:`m7 15 5 5 5-5`}],[`path`,{d:`m7 9 5-5 5 5`}]],e.Circle=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]],e.CircleAlert=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]],e.CircleCheck=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m9 12 2 2 4-4`}]],e.Code2=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]],e.Columns2=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M12 3v18`}]],e.Copy=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],e.CornerUpRight=[[`path`,{d:`m15 14 5-5-5-5`}],[`path`,{d:`M4 20v-7a4 4 0 0 1 4-4h12`}]],e.Eye=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]],e.FoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]],e.Folder=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]],e.FolderClosed=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}],[`path`,{d:`M2 10h20`}]],e.FolderOpen=[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]],e.Image=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}]],e.Link=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]],e.ListPlus=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]],e.Lock=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]],e.LockOpen=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}]],e.Maximize2=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]],e.Minimize2=[[`path`,{d:`m14 10 7-7`}],[`path`,{d:`M20 10h-6V4`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M4 14h6v6`}]],e.Minus=[[`path`,{d:`M5 12h14`}]],e.Moon=[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`}]],e.PanelLeft=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]],e.PanelLeftClose=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]],e.Plus=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]],e.SquarePlus=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M8 12h8`}],[`path`,{d:`M12 8v8`}]],e.Sun=[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`m4.93 4.93 1.41 1.41`}],[`path`,{d:`m17.66 17.66 1.41 1.41`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`m6.34 17.66-1.41 1.41`}],[`path`,{d:`m19.07 4.93-1.41 1.41`}]],e.Table2=[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`}]],e.Text=[[`path`,{d:`M21 5H3`}],[`path`,{d:`M15 12H3`}],[`path`,{d:`M17 19H3`}]],e.UnfoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]],e.Volume2=[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`}]],e.VolumeOff=[[`path`,{d:`M16 9a5 5 0 0 1 .95 2.293`}],[`path`,{d:`M19.364 5.636a9 9 0 0 1 1.889 9.96`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11`}],[`path`,{d:`M9.828 4.172A.686.686 0 0 1 11 4.657v.686`}]]}))(),1),Ze=U(K.Check,m),Qe=U(K.ChevronDown,d),$e=U(K.ChevronRight,j),et=U(K.ChevronUp,be),tt=U(K.ChevronsDownUp,null),nt=U(K.ChevronsUpDown,null),rt=U(K.Circle,s),it=U(K.CircleAlert,L),at=U(K.CircleCheck,_),ot=U(K.Code2,ve),st=U(K.Columns2,D),ct=U(K.Copy,A),lt=U(K.CornerUpRight,null),ut=U(K.Eye,null),dt=U(K.FoldVertical,null),ft=U(K.Folder,M),pt=U(K.FolderClosed,M),mt=U(K.FolderOpen,g),ht=U(K.Image,b),gt=U(K.Link,T),_t=U(K.ListPlus,null),vt=U(K.Lock,null),yt=U(K.LockOpen,null),bt=U(K.Maximize2,N),xt=U(K.Minimize2,null),St=U(K.Minus,Ve),Ct=U(K.Moon,c),wt=U(K.PanelLeft,ne),Tt=U(K.PanelLeftClose,null),Et=U(K.Plus,u),Dt=U(K.SquarePlus,Ie),Ot=U(K.Sun,v),kt=U(K.Table2,B),At=U(K.Text,re),jt=U(K.UnfoldVertical,null),Mt=U(K.Volume2,w),Nt=U(K.VolumeOff,Oe),Pt=r(),Ft=e(f()),It=W.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=z({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(W.Fragment,{children:[l,c&&Ft.createPortal(n,c)]})}),Lt=`MmLlHhVvCcSsQqTtAaZz`;function Rt(e){let t=[],n=e.length,r=0,i=0,a=0,o=0,s=0,c=null,l=``,u=0,d=0,f=``,p=!1,m=e=>{throw Error(`morphicons: ${e} at d[${r}]`)},h=e=>e>=48&&e<=57,g=()=>{for(;r<n;){let t=e.charCodeAt(r);if(t===32||t===9||t===10||t===13||t===12||t===44)r++;else break}},_=()=>{g();let t=r;r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(r<n&&e[r]===`.`)for(r++;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(i||m(`expected number`),r<n&&(e[r]===`e`||e[r]===`E`)){let t=r;r++,r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;i||(r=t)}return Number(e.slice(t,r))},v=()=>{g();let t=e[r];return t===`0`||t===`1`?(r++,+(t===`1`)):m(`expected arc flag (0|1)`)},y=()=>(p||m(`path must start with M/m`),c||(c={x0:i,y0:a,segs:[],closed:!1},t.push(c)),c),b=!1,x=()=>_()+(b?i:0),S=()=>_()+(b?a:0);for(;g(),!(r>=n);){let n=e[r];switch(Lt.includes(n)?(l=n,r++):l===``?m(`path must start with M/m`):l===`M`?l=`L`:l===`m`?l=`l`:(l===`Z`||l===`z`)&&m(`stray data after Z`),b=l>=`a`,b?l.toUpperCase():l){case`M`:{p=!0;let e=x(),n=S();i=e,a=n,o=e,s=n,c={x0:e,y0:n,segs:[],closed:!1},t.push(c),f=``;break}case`L`:{let e=x(),t=S();y().segs.push([`L`,e,t]),i=e,a=t,f=``;break}case`H`:{let e=x();y().segs.push([`L`,e,a]),i=e,f=``;break}case`V`:{let e=S();y().segs.push([`L`,i,e]),a=e,f=``;break}case`C`:case`S`:{let e,t;l===`C`||l===`c`?(e=x(),t=S()):(e=f===`C`?2*i-u:i,t=f===`C`?2*a-d:a);let n=x(),r=S(),o=x(),s=S();y().segs.push([`C`,e,t,n,r,o,s]),u=n,d=r,i=o,a=s,f=`C`;break}case`Q`:case`T`:{let e,t;l===`Q`||l===`q`?(e=x(),t=S()):(e=f===`Q`?2*i-u:i,t=f===`Q`?2*a-d:a);let n=x(),r=S();y().segs.push([`Q`,e,t,n,r]),u=e,d=t,i=n,a=r,f=`Q`;break}case`A`:{let e=_(),t=_(),n=_(),r=v(),o=v(),s=x(),c=S();y().segs.push([`A`,e,t,n,r,o,s,c]),i=s,a=c,f=``;break}case`Z`:c&&=(c.closed=!0,null),i=o,a=s,f=``;break;default:m(`unsupported command "${l}"`)}}return t.filter(e=>e.segs.length>0)}function zt(e){return String(Math.round(e*100)/100)}function Bt(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=i.length/2;n+=`M${zt(i[0])} ${zt(i[1])}`;for(let e=1;e<a;e++)n+=`L${zt(i[2*e])} ${zt(i[2*e+1])}`;t?.[r]&&(n+=`Z`)}return n}function q(e){return String(Math.round(e*1e4)/1e4)}function Vt(e){let t=``;for(let{pts:n,closed:r}of e){t+=`M${q(n[0])} ${q(n[1])}`;for(let e=2;e<n.length;e+=6)t+=`C${q(n[e])} ${q(n[e+1])} ${q(n[e+2])} ${q(n[e+3])} ${q(n[e+4])} ${q(n[e+5])}`;r&&(t+=`Z`)}return t}var Ht=4/3*Math.tan(Math.PI/8),Ut=2*Math.PI;function Wt(e,t){let n=[e,t],r=e,i=t,a=(e,t,a,o,s,c)=>{n.push(e,t,a,o,s,c),r=s,i=c},o=(e,t)=>{Math.abs(e-r)<1e-12&&Math.abs(t-i)<1e-12||a(r+(e-r)/3,i+(t-i)/3,r+2*(e-r)/3,i+2*(t-i)/3,e,t)};return[a,o,(e,t,n,o)=>{a(r+2/3*(e-r),i+2/3*(t-i),n+2/3*(e-n),o+2/3*(t-o),n,o)},(e,t,n,s,c,l,u)=>{let d=r,f=i;if(Math.abs(l-d)<1e-12&&Math.abs(u-f)<1e-12)return;let p=Math.abs(e),m=Math.abs(t);if(p<1e-12||m<1e-12){o(l,u);return}let h=n*Math.PI/180,g=Math.cos(h),_=Math.sin(h),v=(d-l)/2,y=(f-u)/2,b=g*v+_*y,x=-_*v+g*y,S=b*b/(p*p)+x*x/(m*m);if(S>1){let e=Math.sqrt(S);p*=e,m*=e}let C=p*p,w=m*m,T=b*b,E=x*x,D=(C*w-C*E-w*T)/(C*E+w*T);D<0&&(D=0);let O=(s===c?-1:1)*Math.sqrt(D),k=O*p*x/m,A=-O*m*b/p,ee=g*k-_*A+(d+l)/2,j=_*k+g*A+(f+u)/2,M=Math.atan2((x-A)/m,(b-k)/p),N=Math.atan2((-x-A)/m,(-b-k)/p)-M;c===0&&N>0?N-=Ut:c===1&&N<0&&(N+=Ut);let P=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2)-1e-9)),te=N/P,F=4/3*Math.tan(te/4),I=e=>ee+p*Math.cos(e)*g-m*Math.sin(e)*_,L=e=>j+p*Math.cos(e)*_+m*Math.sin(e)*g,R=e=>-p*Math.sin(e)*g-m*Math.cos(e)*_,z=e=>-p*Math.sin(e)*_+m*Math.cos(e)*g,B=M,ne=d,V=f;for(let e=1;e<=P;e++){let t=M+te*e,n=e===P?l:I(t),r=e===P?u:L(t);a(ne+F*R(B),V+F*z(B),n-F*R(t),r-F*z(t),n,r),B=t,ne=n,V=r}},e=>(e&&o(n[0],n[1]),n.length<8?null:{pts:Float64Array.from(n),closed:e})]}function Gt(e){let[t,n,r,i,a]=Wt(e.x0,e.y0);for(let a of e.segs)switch(a[0]){case`L`:n(a[1],a[2]);break;case`C`:t(a[1],a[2],a[3],a[4],a[5],a[6]);break;case`Q`:r(a[1],a[2],a[3],a[4]);break;case`A`:i(a[1],a[2],a[3],a[4],a[5],a[6],a[7])}return a(e.closed)}function J(e,t,n=0){let r=e[t];if(r===void 0)return n;let i=typeof r==`number`?r:Number(r);return Number.isFinite(i)?i:n}function Kt(e){let t=String(e??``).trim();if(!t)return[];let n=t.split(/[\s,]+/).map(Number);if(n.some(e=>!Number.isFinite(e)))throw Error(`morphicons: invalid points: "${t}"`);return n}function qt(e,t){if(e.length<4)return null;let[,n,,,r]=Wt(e[0],e[1]);for(let t=2;t+1<e.length;t+=2)n(e[t],e[t+1]);return r(t)}function Jt(e,t,n,r){if(n<1e-12||r<1e-12)return null;let i=Ht*n,a=Ht*r,o=e+n,s=e-n,c=t+r,l=t-r,[u,,,,d]=Wt(o,t);return u(o,t+a,e+i,c,e,c),u(e-i,c,s,t+a,s,t),u(s,t-a,e-i,l,e,l),u(e+i,l,o,t-a,o,t),d(!0)}function Yt(e){let t=J(e,`x`),n=J(e,`y`),r=J(e,`width`),i=J(e,`height`);if(r<1e-12||i<1e-12)return null;let a=J(e,`rx`,NaN),o=J(e,`ry`,NaN);if(Number.isNaN(a)&&(a=Number.isNaN(o)?0:o),Number.isNaN(o)&&(o=a),a=Math.min(Math.max(a,0),r/2),o=Math.min(Math.max(o,0),i/2),a<1e-12||o<1e-12)return qt([t,n,t+r,n,t+r,n+i,t,n+i],!0);let s=t+a,c=t+r-a,l=t+r,u=n+o,d=n+i-o,f=n+i,p=Ht*a,m=Ht*o,[h,g,,,_]=Wt(s,n);return g(c,n),h(c+p,n,l,u-m,l,u),g(l,d),h(l,d+m,c+p,f,c,f),g(s,f),h(s-p,f,t,d+m,t,d),g(t,u),h(t,u-m,s-p,n,s,n),_(!0)}function Xt(e){let t=[],n=e=>{e&&t.push(e)};if(typeof e==`string`){for(let t of Rt(e))n(Gt(t));return t}for(let[t,r]of e)switch(t){case`path`:for(let e of Rt(String(r.d??``)))n(Gt(e));break;case`line`:{let[,e,,,t]=Wt(J(r,`x1`),J(r,`y1`));e(J(r,`x2`),J(r,`y2`)),n(t(!1));break}case`circle`:{let e=J(r,`r`);n(Jt(J(r,`cx`),J(r,`cy`),e,e));break}case`ellipse`:n(Jt(J(r,`cx`),J(r,`cy`),J(r,`rx`),J(r,`ry`)));break;case`rect`:n(Yt(r));break;case`polyline`:n(qt(Kt(r.points),!1));break;case`polygon`:n(qt(Kt(r.points),!0));break;default:throw Error(`morphicons: unsupported tag <${t}>`)}return t}function Zt(e){return e.items.map(()=>new Float64Array(2*e.n))}function Qt(e,t,n){for(let r=0;r<e.items.length;r++){let i=e.items[r],a=n[r],o=e.n,s=Math.exp(i.lnSigma*t),c=i.theta*t,l=Math.cos(c)*s,u=Math.sin(c)*s,d,f;if(i.block){let[e,n]=i.block.off,[r,a]=i.block.drift;d=i.ca[0]+r*t+(e*l-n*u-e),f=i.ca[1]+a*t+(e*u+n*l-n)}else d=i.ca[0]+(i.cb[0]-i.ca[0])*t,f=i.ca[1]+(i.cb[1]-i.ca[1])*t;for(let e=0;e<o;e++){let n=i.aC[2*e]+(i.bT[2*e]-i.aC[2*e])*t,r=i.aC[2*e+1]+(i.bT[2*e+1]-i.aC[2*e+1])*t;a[2*e]=d+n*l-r*u,a[2*e+1]=f+n*u+r*l}}}var $t=.35,en=.05,tn=.005,nn=8,rn=1e5;function Y(e){let t=e.length/2,n=0,r=0;for(let i=0;i<t;i++)n+=e[2*i],r+=e[2*i+1];return[n/t,r/t]}function an(e){let t=e.length/2,n=0;for(let r=1;r<t;r++)n+=Math.hypot(e[2*r]-e[2*r-2],e[2*r+1]-e[2*r-1]);return n}function on(e){let t=e.length/2,n=new Float64Array(2*t);for(let r=0;r<t;r++)n[2*r]=e[2*(t-1-r)],n[2*r+1]=e[2*(t-1-r)+1];return n}function sn(e,t){let n=e.length/2,r=new Float64Array(2*n);for(let i=0;i<n;i++){let a=(i+t)%n;r[2*i]=e[2*a],r[2*i+1]=e[2*a+1]}return r}function cn(e,t,n,r){let i=e.length/2,a=0,o=0,s=0,c=0,l=0,u=0;for(let d=0;d<i;d++){let i=e[2*d]-n[0],f=e[2*d+1]-n[1],p=t[2*d]-r[0],m=t[2*d+1]-r[1];a+=i*p,c+=f*m,o+=i*m,s+=f*p,l+=i*i+f*f,u+=p*p+m*m}let d=Math.atan2(o-s,a+c),f=Math.cos(d)*(a+c)+Math.sin(d)*(o-s),p=l>1e-12?f/l:1;p>1e-6||(p=1e-6);let m=Math.max(0,p*p*l-2*p*f+u),h=u>1e-12?Math.sqrt(m/u):0;return{theta:d,sigma:p,res:h}}function ln(e,t,n=!1,r=!1){let i=Y(e),a=Y(t),o=n&&!r,s=o?e:t,c=n||r?s.length/2:1,l=1/0,u=s,d={theta:0,sigma:1,res:0};for(let n=0;n<2;n++){let r=n?on(s):s;for(let n=0;n<c;n++){let s=n?sn(r,n):r,c=o?cn(s,t,i,a):cn(e,s,i,a),f=c.res+en*Math.abs(c.theta)/Math.PI;f<l&&(l=f,u=s,d=c)}}return o?{ca:i,cb:a,a:u,b:t,...d}:{ca:i,cb:a,a:e,b:u,...d}}function un(e,t){let n=t.map(Y),r=t.map(an);return e.map(e=>{let t=Y(e),i=an(e);return n.map((e,n)=>Math.hypot(t[0]-e[0],t[1]-e[1])+$t*Math.abs(i-r[n]))})}function dn(e){let t=e.length;if(t>nn){let n=[];for(let r=0;r<t;r++)for(let i=0;i<t;i++)n.push([e[r][i],r,i]);n.sort((e,t)=>e[0]-t[0]);let r=Array(t).fill(-1),i=Array(t).fill(!1);for(let[,e,t]of n)r[e]<0&&!i[t]&&(r[e]=t,i[t]=!0);return r}let n=Array.from({length:t},(e,t)=>t),r=n.slice(),i=1/0,a=(n,o,s)=>{if(!(s>=i)){if(o===t)i=s,r=n.slice();else for(let r=o;r<t;r++)[n[o],n[r]]=[n[r],n[o]],a(n,o+1,s+e[o][n[o]]),[n[o],n[r]]=[n[r],n[o]]}};return a(n,0,0),r}function fn(e){let t=e.length,n=e[0].length;if(n**t>rn){let r=e.map(e=>{let t=0;for(let n=1;n<e.length;n++)e[n]<e[t]&&(t=n);return t}),i=Array(n).fill(0);for(let e of r)i[e]++;for(let a=0;a<n;a++){if(i[a]>0)continue;let n=-1,o=1/0;for(let s=0;s<t;s++){if(i[r[s]]<2)continue;let t=e[s][a]-e[s][r[s]];t<o&&(o=t,n=s)}i[r[n]]--,r[n]=a,i[a]++}return r}let r=null,i=1/0,a=Array(t),o=Array(n).fill(0),s=(c,l,u)=>{if(!(l>=i||n-u>t-c)){if(c===t)i=l,r=a.slice();else for(let t=0;t<n;t++)a[c]=t,o[t]++,s(c+1,l+e[c][t],u+ +(o[t]===1)),o[t]--}};if(s(0,0,0),!r)throw Error(`morphicons: no valid surjection (B < S)`);return r}function pn(e,t){let n=e.length*t,r=new Float64Array(2*n),i=new Float64Array(2*n);e.forEach((e,n)=>{r.set(e.a,2*t*n),i.set(e.bO,2*t*n)});let a=Y(r),o=cn(r,i,a,Y(i));if(o.res>=tn)return;let s=Math.cos(-o.theta),c=Math.sin(-o.theta),l=Math.cos(o.theta),u=Math.sin(o.theta);for(let n of e){let e=0,r=0;for(let i=0;i<t;i++){let t=n.bO[2*i]-n.cb[0],a=n.bO[2*i+1]-n.cb[1];n.bT[2*i]=(t*s-a*c)/o.sigma,n.bT[2*i+1]=(t*c+a*s)/o.sigma;let d=o.sigma*(l*n.aC[2*i]-u*n.aC[2*i+1])-t,f=o.sigma*(u*n.aC[2*i]+l*n.aC[2*i+1])-a;e+=d*d+f*f,r+=t*t+a*a}n.theta=o.theta,n.lnSigma=Math.log(o.sigma),n.res=r>1e-12?Math.sqrt(e/r):0;let i=Math.exp(n.lnSigma),d=Math.cos(n.theta)*i,f=Math.sin(n.theta)*i,p=n.ca[0]-a[0],m=n.ca[1]-a[1],h=p*d-m*f-p,g=p*f+m*d-m;n.block={off:[p,m],drift:[n.cb[0]-n.ca[0]-h,n.cb[1]-n.ca[1]-g]}}}function mn(e,t){let n=e.length,r=t.length;if(n===0||r===0)throw Error(`morphicons: icon has no subpaths`);let i=e.map(e=>e.pts),a=t.map(e=>e.pts),o=[];if(n===r){let e=dn(un(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}else if(n<r){let e=fn(un(a,i));for(let t=0;t<r;t++)o.push([e[t],t])}else{let e=fn(un(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}let s=i[0].length/2,c=o.map(([n,r])=>{let o=ln(i[n],a[r],e[n].closed,t[r].closed),c=o.a,l=new Float64Array(2*s),u=new Float64Array(2*s),d=new Float64Array(2*s),f=Math.cos(-o.theta),p=Math.sin(-o.theta);for(let e=0;e<s;e++){l[2*e]=c[2*e]-o.ca[0],l[2*e+1]=c[2*e+1]-o.ca[1];let t=o.b[2*e]-o.cb[0],n=o.b[2*e+1]-o.cb[1];u[2*e]=(t*f-n*p)/o.sigma,u[2*e+1]=(t*p+n*f)/o.sigma,d[2*e]=o.b[2*e],d[2*e+1]=o.b[2*e+1]}return{a:c,aC:l,bT:u,bO:d,ca:o.ca,cb:o.cb,theta:o.theta,lnSigma:Math.log(o.sigma),res:o.res,closed:e[n].closed&&t[r].closed,block:null}});return c.length>1&&pn(c,s),{items:c,n:s}}var hn=Math.PI/8,gn=[.18343464249564978,.525532409916329,.7966664774136267,.9602898564975363],_n=[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626];function vn(e,t,n){let r=6*t,i=1-n,a=3*i*i,o=6*i*n,s=3*n*n,c=a*(e[r+2]-e[r])+o*(e[r+4]-e[r+2])+s*(e[r+6]-e[r+4]),l=a*(e[r+3]-e[r+1])+o*(e[r+5]-e[r+3])+s*(e[r+7]-e[r+5]);return Math.hypot(c,l)}function yn(e,t,n=1){let r=n/2,i=0;for(let n=0;n<4;n++)i+=_n[n]*(vn(e,t,r+r*gn[n])+vn(e,t,r-r*gn[n]));return i*r}function bn(e,t,n,r,i){let a=6*t,o=1-n,s=o*o*o,c=3*o*o*n,l=3*o*n*n,u=n*n*n;r[i]=s*e[a]+c*e[a+2]+l*e[a+4]+u*e[a+6],r[i+1]=s*e[a+1]+c*e[a+3]+l*e[a+5]+u*e[a+7]}function xn(e,t,n){let r=6*t,i=n?r+6:r,a=n?-1:1;for(let t of n?[4,2,0]:[2,4,6]){let n=a*(e[r+t]-e[i]),o=a*(e[r+t+1]-e[i+1]);if(n*n+o*o>1e-18)return[n,o]}return null}function Sn(e,t=hn){let n=e.pts,r=(n.length/2-1)/3,i=[];for(let e=0;e<r;e++)yn(n,e)>1e-9&&i.push(e);if(i.length===0)return[];let a=new Set,o=(e,r)=>{let i=xn(n,e,!0),o=xn(n,r,!1);i&&o&&Math.abs(Math.atan2(i[0]*o[1]-i[1]*o[0],i[0]*o[0]+i[1]*o[1]))>t&&a.add(r)};for(let e=0;e+1<i.length;e++)o(i[e],i[e+1]);return e.closed&&i.length>1&&o(i[i.length-1],i[0]),[...a].sort((e,t)=>e-t)}function Cn(e,t,n,r){if(n<=0)return 0;if(n>=r)return 1;let i=0,a=1,o=n/r;for(let s=0;s<12;s++){let s=yn(e,t,o)-n;if(Math.abs(s)<1e-10*r+1e-14)break;s>0?a=o:i=o;let c=vn(e,t,o),l=c>1e-12?o-s/c:(i+a)/2;l>i&&l<a||(l=(i+a)/2),o=l}return o}function wn(e,t=64,n=hn){let r=e.pts,i=(r.length/2-1)/3,a=new Float64Array(2*t),o=()=>{for(let e=0;e<t;e++)a[2*e]=r[0],a[2*e+1]=r[1];return a};if(i<1)return o();let s=Array(i),c=0;for(let e=0;e<i;e++)s[e]=yn(r,e),c+=s[e];if(c<1e-12)return o();let l=Sn(e,n),u=e.closed?l.length>0?l:[0]:[...new Set([0,...l,i])].sort((e,t)=>e-t),d=[];if(e.closed)for(let e=0;e<u.length;e++){let t=u[e],n=e+1<u.length?u[e+1]:u[0]+i;d.push([t,n])}else for(let e=0;e+1<u.length;e++)d.push([u[e],u[e+1]]);let f=d.map(([e,t])=>{let n=0;for(let r=e;r<t;r++)n+=s[r%i];return n}),p=e.closed?t:t-1;if(d.length>p)throw Error(`morphicons: N=${t} too small (${d.length} runs)`);let m=f.reduce((e,t)=>e+t,0)||1,h=f.map(e=>p*e/m),g=h.map(e=>Math.max(1,Math.floor(e))),_=p-g.reduce((e,t)=>e+t,0);if(_>0){let e=h.map((e,t)=>[Math.round((e-Math.floor(e))*1e9),t]).sort((e,t)=>t[0]-e[0]||e[1]-t[1]);for(let t=0;t<_;t++)g[e[t%g.length][1]]++}for(;_<0;){let e=0;for(let t=1;t<g.length;t++)g[t]>g[e]&&(e=t);if(g[e]<=1)break;g[e]--,_++}let v=0;for(let e=0;e<d.length;e++){let[t,n]=d[e],o=g[e],c=f[e],l=t%i*6;a[2*v]=r[l],a[2*v+1]=r[l+1],v++;let u=t,p=0;for(let e=1;e<o;e++){let t=c*e/o;for(;u<n-1&&p+s[u%i]<t;)p+=s[u%i],u++;let l=u%i,d=s[l];bn(r,l,d>1e-12?Cn(r,l,t-p,d):0,a,2*v),v++}}if(!e.closed){let e=6*i;a[2*v]=r[e],a[2*v+1]=r[e+1]}return a}function Tn(e,t=64){return Xt(e).map(e=>({pts:wn(e,t),closed:e.closed}))}var En=class{x=1;v=0;k=250;c=24;config(e,t){this.k=e,this.c=t}start(){this.x=0,this.v>14&&(this.v=14),this.v<-14&&(this.v=-14)}step(e){let t=Math.max(1,Math.min(16,Math.ceil(e/(1/240)))),n=e/t;for(let e=0;e<t;e++){let e=this.k*(1-this.x)-this.c*this.v;this.v+=e*n,this.x+=this.v*n}return Math.abs(1-this.x)<.001&&Math.abs(this.v)<.02}},Dn={smooth:{k:170,c:26},snappy:{k:420,c:30},bouncy:{k:300,c:14}},X=new Set,Z=0,Q=-1;function On(e){let t=Q<0?0:Math.min(Math.max((e-Q)/1e3,0),.1);Q=e;for(let e of[...X])e(t);X.size>0?Z=requestAnimationFrame(On):(Z=0,Q=-1)}function kn(e){X.add(e),Z===0&&(Q=-1,Z=requestAnimationFrame(On))}function An(e){X.delete(e),X.size===0&&Z!==0&&(cancelAnimationFrame(Z),Z=0,Q=-1)}var jn=new WeakMap,Mn=new WeakMap,Nn=new WeakMap;function $(e){if(typeof e==`string`)return Tn(e);let t=jn.get(e);return t||(t=Tn(e),jn.set(e,t)),t}function Pn(e){if(typeof e==`string`)return e;let t=Mn.get(e);return t||(t=Vt(Xt(e)),Mn.set(e,t)),t}function Fn(e,t){if(typeof e==`string`||typeof t==`string`)return mn($(e),$(t));let n=Nn.get(e);n||(n=new WeakMap,Nn.set(e,n));let r=n.get(t);return r||(r=mn($(e),$(t)),n.set(t,r)),r}function In(e){if(typeof e==`string`)return Dn[e];let t=Dn.snappy;return{k:e?.stiffness??t.k,c:e?.damping??t.c}}function Ln(e,t,n){let r=new En,i=n?.reducedMotion??`never`,a=t,o=!0,s=null,c=null,l=null,u=1,d=!1,f=!1;e.setAttribute(`d`,Pn(t));let p=t=>{let n=s,r=c,i=l;n&&r&&i&&(u=t,Qt(n,t,r),e.setAttribute(`d`,Bt(r,i)))},m=()=>{d&&(d=!1,An(h))},h=e=>{let t=r.step(e);p(r.x),t&&(m(),g())},g=()=>{o=!0,s=null,c=null,l=null,u=1,r.x=1,r.v=0,e.setAttribute(`d`,Pn(a))},_=()=>{let e=s,t=c;return o||!e||!t?$(a):t.map((t,n)=>({pts:Float64Array.from(t),closed:e.items[n].closed}))},v=e=>{s=o?Fn(a,e):mn(_(),$(e)),c=Zt(s),l=s.items.map(e=>e.closed),a=e,o=!1},y=e=>{m(),a=e,g()},b=()=>i===`always`?!0:i!==`user`||typeof matchMedia>`u`?!1:matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,x=(e,t)=>{if(f)return;let n=!o&&s!==null&&e===a;m(),r.v=0,n||v(e),p(t)};return{morphTo(e,t){if(f||e===a&&(o||d))return;if(b()){y(e);return}let{k:n,c:i}=In(t);r.config(n,i),v(e),r.start(),d||(d=!0,kn(h))},set(e){f||y(e)},seek:x,get progress(){return o?1:u},set progress(e){f||x(a,e)},get reducedMotion(){return i},set reducedMotion(e){i=e},destroy(){m(),f=!0,s=null,c=null,l=null}}}var Rn=typeof document>`u`?W.useEffect:W.useLayoutEffect;function zn(e,t,n){if(n<=0)return Pn(e);if(n>=1)return Pn(t);let r=mn(Tn(e),Tn(t)),i=Zt(r);return Qt(r,n,i),Bt(i,r.items.map(e=>e.closed))}var Bn=(0,W.forwardRef)(function(e,t){let{icon:n,from:r,to:i,progress:a,spring:o,reducedMotion:s,size:c=24,color:l=`currentColor`,strokeWidth:u=2,absoluteStrokeWidth:d,label:f,...p}=e,m=r!==void 0&&i!==void 0,h=n??r??i,[g]=(0,W.useState)(()=>m?zn(r,i,a??0):h===void 0?``:Pn(h)),_=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(o);y.current=o;let b=(0,W.useRef)(s);b.current=s;let x=(0,W.useRef)(n),S=(0,W.useRef)(m),C=(0,W.useRef)(!1),w=(0,W.useRef)(!1),T=(0,W.useRef)(null),E=(0,W.useCallback)(e=>{if(v.current)return v.current;let t=_.current;return C.current||!t?null:(v.current=Ln(t,e,{reducedMotion:b.current}),v.current)},[]);Rn(()=>{C.current=!1;let e=_.current;if(e&&h!==void 0){let t=Ln(e,m?r:h,{reducedMotion:b.current});if(v.current=t,m){T.current=[r,i];let e=a??0;e<=0?t.set(r):e>=1?t.set(i):(t.seek(i,e),w.current=!0)}}return()=>{C.current=!0,v.current?.destroy(),v.current=null,w.current=!1,T.current=null}},[]),(0,W.useEffect)(()=>{let e=v.current;e&&(e.reducedMotion=s??`never`)},[s]),(0,W.useEffect)(()=>{let e=S.current&&!m;S.current=m;let t=n!==x.current;if(x.current=n,m||n===void 0||!t&&!e)return;T.current=null,w.current=!1;let r=v.current;r?r.morphTo(n,y.current):E(n)},[n,m,E]),(0,W.useEffect)(()=>{if(!m)return;let e=v.current??E(r);if(!e)return;let t=a??0;T.current&&T.current[0]===r&&T.current[1]===i||(T.current=[r,i],w.current=!1),t<=0?(e.set(r),w.current=!1):t>=1?(e.set(i),w.current=!1):(w.current||=(e.set(r),!0),e.seek(i,t))},[m,r,i,a,E]),(0,W.useImperativeHandle)(t,()=>({morphTo:(e,t)=>{T.current=null,w.current=!1;let n=v.current;n?n.morphTo(e,t??y.current):E(e)},set:e=>{T.current=null,w.current=!1;let t=v.current;t?t.set(e):E(e)}}),[E]);let D=d?Number(u)*24/Number(c):u;return(0,G.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:c,height:c,viewBox:`0 0 24 24`,fill:`none`,stroke:l,strokeWidth:D,strokeLinecap:`round`,strokeLinejoin:`round`,role:f?`img`:void 0,"aria-hidden":!f||void 0,...p,children:[f?(0,G.jsx)(`title`,{children:f}):null,(0,G.jsx)(`path`,{ref:_,d:g})]})});function Vn(e){return typeof e==`object`&&!!e&&`lucide`in e}function Hn(e){let t=(0,Pt.c)(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({reducedMotion:a,icon:n,strokeWidth:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`user`:a,s=pe(),c=Vn(n)?s===`p4`?n.p4??n.lucide:n.lucide:n,l;t[5]!==s||t[6]!==i?(l=s===`p4`?je(i):i,t[5]=s,t[6]=i,t[7]=l):l=t[7];let u=l,d;t[8]===c?d=t[9]:(d=c===void 0?{}:{icon:c},t[8]=c,t[9]=d);let f;t[10]===u?f=t[11]:(f=u===void 0?{}:{strokeWidth:u},t[10]=u,t[11]=f);let p;return t[12]!==r||t[13]!==o||t[14]!==d||t[15]!==f?(p=(0,G.jsx)(Bn,{reducedMotion:o,...d,...f,...r}),t[12]=r,t[13]=o,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}var Un=W.createContext(void 0);function Wn(e){let t=W.useContext(Un);if(t===void 0&&!e)throw Error(He(72));return t}var Gn={...he,disabled:k(e=>e.disabled),instantType:k(e=>e.instantType),isInstantPhase:k(e=>e.isInstantPhase),trackCursorAxis:k(e=>e.trackCursorAxis),disableHoverablePopup:k(e=>e.disableHoverablePopup),lastOpenChangeReason:k(e=>e.openChangeReason),closeOnClick:k(e=>e.closeOnClick),closeDelay:k(e=>e.closeDelay),hasViewport:k(e=>e.hasViewport)},Kn=class e extends p{constructor(e,t,n=!1){let r=new ae,i={...qn(),...e};i.floatingRootContext=_e(r,t,n),super(i,{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Gn)}setOpen=(e,t)=>{let n=t.reason,r=n===ge,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0),Be(r,e,t.trigger),this.update(r)};r?Ft.flushSync(o):o()};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,H(oe,e))}static useStore(t,n){return Fe(t,(t,r)=>new e(n,t,r)).store}};function qn(){return{...Ce(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Jn=ye(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:o=`none`,actionsRef:s,onOpenChange:c,onOpenChangeComplete:l,handle:u,triggerId:d,defaultTriggerId:f=null,children:p}=e,m=Kn.useStore(u?.store,{open:n,openProp:r,activeTriggerId:f,triggerIdProp:d});xe(()=>{r===void 0&&m.state.open===!1&&n===!0&&m.update({open:!0,activeTriggerId:f})}),m.useControlledProp(`openProp`,r),m.useControlledProp(`triggerIdProp`,d),m.useContextCallback(`onOpenChange`,c),m.useContextCallback(`onOpenChangeComplete`,l);let h=m.useState(`open`),g=!t&&h,_=m.useState(`activeTriggerId`),v=m.useState(`mounted`),y=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:i}),m.useSyncedValue(`disabled`,t),se(m);let{forceUnmount:b,transitionStatus:x}=Re(g,m),S=m.useState(`isInstantPhase`),C=m.useState(`instantType`),w=m.useState(`lastOpenChangeReason`),T=W.useRef(null);R(()=>{h&&t&&m.setOpen(!1,H(a))},[h,t,m]),R(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),m.set(`instantType`,`delay`)):T.current!==null&&(m.set(`instantType`,T.current),T.current=null)},[x,S,w,C,m]),R(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]);let E=W.useCallback(()=>{m.setOpen(!1,H(we))},[m]);W.useImperativeHandle(s,()=>({unmount:b,close:E}),[b,E]);let D=g||v||!t&&o!==`none`;return(0,G.jsxs)(Un.Provider,{value:m,children:[D&&(0,G.jsx)(Yn,{store:m,disabled:t,trackCursorAxis:o}),typeof p==`function`?p({payload:y}):p]})});function Yn({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=h(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Xe(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=W.useMemo(()=>Ue(a.reference,i.reference),[a.reference,i.reference]),s=W.useMemo(()=>Ue(a.trigger,i.trigger),[a.trigger,i.trigger]),c=W.useMemo(()=>Ue(Ne,a.floating,i.floating),[a.floating,i.floating]);return te(e,{activeTriggerProps:o,inactiveTriggerProps:s,popupProps:c}),null}var Xn=W.createContext(void 0);function Zn(){return W.useContext(Xn)}var Qn=function(e){return e[e.popupOpen=ce.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),$n=`data-base-ui-tooltip-trigger`;function er(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(De(n))return n}}let t=e.target;return De(t)?t:null}function tr(e){let t=e;for(;t;){if(t.hasAttribute($n))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&De(n.host)?n.host:null}return null}var nr=o(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...p}=e,m=Wn(!0),h=a?.store??m;if(!h)throw Error(He(82));let g=O(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=W.useRef(null),x=c??600,S=d??0,{registerTrigger:C,isMountedByThisTrigger:w}=F(g,b,h,{payload:o,closeOnClick:u,closeDelay:S}),T=Zn(),{delayRef:E,isInstantPhase:D,hasProvider:k}=qe(y,{open:v}),A=le(y);h.useSyncedValue(`isInstantPhase`,D);let ee=h.useState(`disabled`),j=s??ee,M=ke(j),N=h.useState(`trackCursorAxis`),te=h.useState(`disableHoverablePopup`),I=W.useRef(!1),L=P(),R=W.useRef(void 0);function z(){let e=T?.delay,t=typeof E.current==`object`?E.current.open:void 0,n=x;return k&&(n=t===0?0:c??e??x),n}function B(e){let t=b.current;if(!t||!e)return!1;let n=tr(e);return n!==null&&n!==t&&me(t,n)}function ne(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let V=Se(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!te&&N!==`both`?Te():null,restMs:z,delay(){let e=typeof E.current==`object`?E.current.close:void 0,t=S;return d==null&&k&&(t=e),{close:t}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),re=de(y,{enabled:!j}).reference,ie=e=>{let t=I.current,n=er(e),r=ne(n),i=b.current,a=i&&n&&me(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,H(ge,e));else if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&Me(R.current)){let t=()=>{I.current||M.current||h.select(`open`)||h.setOpen(!0,H(ge,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},ae=h.useState(`triggerProps`,w);return We(`button`,e,{state:{open:v},ref:[t,C,b],props:[V,re,w||N!==`none`?ae:void 0,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){B(er(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,h.set(`closeOnClick`,u),u&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[Qn.triggerDisabled]:j?``:void 0,[$n]:j?void 0:``},p],stateAttributesMapping:l})}),rr=W.createContext(void 0);function ir(){let e=W.useContext(rr);if(e===void 0)throw Error(He(70));return e}var ar=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Wn().useState(`mounted`)||n?(0,G.jsx)(rr.Provider,{value:n,children:(0,G.jsx)(It,{ref:t,...r})}):null}),or=W.createContext(void 0);function sr(){let e=W.useContext(or);if(e===void 0)throw Error(He(71));return e}var cr=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=S,style:g,..._}=e,v=Wn(),y=ir(),b=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),D=v.useState(`floatingRootContext`),O=v.useState(`instantType`),k=v.useState(`transitionStatus`),A=v.useState(`hasViewport`),j=x({anchor:i,positionMethod:a,floatingRootContext:D,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:A?E:void 0}),M=W.useMemo(()=>({open:b,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:w===`none`?O:`tracking-cursor`}),[b,j.side,j.align,j.anchorHidden,w,O]),N=ee(e,M,{styles:j.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!C,inert:!b||w===`both`||T});return(0,G.jsx)(or.Provider,{value:j,children:N})}),lr={...ze,...I},ur=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Wn(),{side:s,align:c}=sr(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Pe({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ae(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return We(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,y(d),a],stateAttributesMapping:lr})}),dr=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=W.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=W.useMemo(()=>({open:t,close:n}),[t,n]);return(0,G.jsx)(Xn.Provider,{value:i,children:(0,G.jsx)(Ke,{delay:a,timeoutMs:r,children:e.children})})};export{ht as A,Tt as B,ct as C,ft as D,dt as E,bt as F,At as G,Dt as H,xt as I,Nt as J,jt as K,St as L,_t as M,vt as N,pt as O,yt as P,Ct as R,st as S,ut as T,Ot as U,Et as V,kt as W,nt as _,ar as a,at as b,Kn as c,It as d,Ze as f,tt as g,et as h,sr as i,gt as j,mt as k,Wn as l,$e as m,ur as n,nr as o,Qe as p,Mt as q,cr as r,Jn as s,dr as t,Hn as u,rt as v,lt as w,ot as x,it as y,wt as z};
|
|
2
|
-
//# sourceMappingURL=TooltipProvider-
|
|
1
|
+
import{a as e,n as t,t as n}from"./react-BUfh6y28.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{$a as a,Ai as o,Ap as s,Bp as c,Co as l,Dp as u,Ea as d,Ei as f,Ep as p,Fi as m,Fp as h,Gp as g,Hp as _,Hr as v,Ip as y,Ir as b,Ji as x,Jp as S,Ka as C,Kp as w,Lp as T,Lr as E,Mp as D,Na as O,Ni as k,Np as A,Nr as ee,Op as j,Pp as M,Rp as N,Sa as P,Si as te,Ti as F,To as I,Tp as L,Ua as R,Ui as z,Up as B,Vp as ne,Wa as V,Wp as re,_a as ie,_i as ae,_o as oe,bi as se,bo as ce,di as le,fa as ue,fi as de,fo as fe,fp as pe,ga as me,gi as he,go as ge,hi as _e,ja as H,jp as ve,ki as ye,kp as be,kr as xe,li as Se,lp as U,mi as Ce,no as we,oi as Te,pa as Ee,qa as De,qp as Oe,ua as ke,ui as Ae,up as je,va as Me,vi as Ne,wa as Pe,wi as Fe,wp as Ie,xa as Le,xi as Re,xo as ze,yi as Be,zp as Ve}from"./utils-DFNDxNZi.js";import{f as He,i as Ue,n as We}from"./useRender-BP5vR6yH.js";var W=e(n()),G=e(i()),Ge=W.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Le,currentIdRef:{current:null},currentContextRef:{current:null}});function Ke(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=W.useRef(n),a=W.useRef(n),o=W.useRef(null),s=W.useRef(null),c=P();return(0,G.jsx)(Ge.Provider,{value:W.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function qe(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=W.useContext(Ge),[f,p]=W.useState(!1);return R(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),R(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Ee(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,H(fe))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),R(()=>()=>{l.current=null},[l]),W.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function Je(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Ye(e){return e!=null&&e.clientX!=null}function Xe(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=W.useRef(!1),u=W.useRef(null),[d,f]=W.useState(),[p,m]=W.useState([]),h=V(e=>{i.set(`positionReference`,e)}),g=V((e,t,n)=>{l.current||(!c.current.openEvent||Ye(c.current.openEvent))&&i.set(`positionReference`,Je(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=V(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=Me(d)?o:a;W.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=C(o);function r(t){let n=ie(t);me(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||Ye(c.current.openEvent)?u.current=ue(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),W.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),W.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),W.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=W.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return W.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var K=e(t((e=>{e.Check=[[`path`,{d:`M20 6 9 17l-5-5`}]],e.ChevronDown=[[`path`,{d:`m6 9 6 6 6-6`}]],e.ChevronRight=[[`path`,{d:`m9 18 6-6-6-6`}]],e.ChevronUp=[[`path`,{d:`m18 15-6-6-6 6`}]],e.ChevronsDownUp=[[`path`,{d:`m7 20 5-5 5 5`}],[`path`,{d:`m7 4 5 5 5-5`}]],e.ChevronsUpDown=[[`path`,{d:`m7 15 5 5 5-5`}],[`path`,{d:`m7 9 5-5 5 5`}]],e.Circle=[[`circle`,{cx:`12`,cy:`12`,r:`10`}]],e.CircleAlert=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]],e.CircleCheck=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m9 12 2 2 4-4`}]],e.Code2=[[`path`,{d:`m18 16 4-4-4-4`}],[`path`,{d:`m6 8-4 4 4 4`}],[`path`,{d:`m14.5 4-5 16`}]],e.Columns2=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M12 3v18`}]],e.Copy=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]],e.CornerUpRight=[[`path`,{d:`m15 14 5-5-5-5`}],[`path`,{d:`M4 20v-7a4 4 0 0 1 4-4h12`}]],e.Eye=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]],e.FoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3-3-3 3`}],[`path`,{d:`m15 5-3 3-3-3`}]],e.Folder=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]],e.FolderClosed=[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}],[`path`,{d:`M2 10h20`}]],e.FolderOpen=[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]],e.Image=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}],[`circle`,{cx:`9`,cy:`9`,r:`2`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`}]],e.Link=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}]],e.ListPlus=[[`path`,{d:`M16 5H3`}],[`path`,{d:`M11 12H3`}],[`path`,{d:`M16 19H3`}],[`path`,{d:`M18 9v6`}],[`path`,{d:`M21 12h-6`}]],e.Lock=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`}]],e.LockOpen=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`}]],e.Maximize2=[[`path`,{d:`M15 3h6v6`}],[`path`,{d:`m21 3-7 7`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M9 21H3v-6`}]],e.Minimize2=[[`path`,{d:`m14 10 7-7`}],[`path`,{d:`M20 10h-6V4`}],[`path`,{d:`m3 21 7-7`}],[`path`,{d:`M4 14h6v6`}]],e.Minus=[[`path`,{d:`M5 12h14`}]],e.Moon=[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`}]],e.PanelLeft=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}]],e.PanelLeftClose=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M9 3v18`}],[`path`,{d:`m16 15-3-3 3-3`}]],e.Plus=[[`path`,{d:`M5 12h14`}],[`path`,{d:`M12 5v14`}]],e.SquarePlus=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}],[`path`,{d:`M8 12h8`}],[`path`,{d:`M12 8v8`}]],e.Sun=[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M12 20v2`}],[`path`,{d:`m4.93 4.93 1.41 1.41`}],[`path`,{d:`m17.66 17.66 1.41 1.41`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`m6.34 17.66-1.41 1.41`}],[`path`,{d:`m19.07 4.93-1.41 1.41`}]],e.Table2=[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`}]],e.Text=[[`path`,{d:`M21 5H3`}],[`path`,{d:`M15 12H3`}],[`path`,{d:`M17 19H3`}]],e.UnfoldVertical=[[`path`,{d:`M12 22v-6`}],[`path`,{d:`M12 8V2`}],[`path`,{d:`M4 12H2`}],[`path`,{d:`M10 12H8`}],[`path`,{d:`M16 12h-2`}],[`path`,{d:`M22 12h-2`}],[`path`,{d:`m15 19-3 3-3-3`}],[`path`,{d:`m15 5-3-3-3 3`}]],e.Volume2=[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`}]],e.VolumeOff=[[`path`,{d:`M16 9a5 5 0 0 1 .95 2.293`}],[`path`,{d:`M19.364 5.636a9 9 0 0 1 1.889 9.96`}],[`path`,{d:`m2 2 20 20`}],[`path`,{d:`m7 7-.587.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298V11`}],[`path`,{d:`M9.828 4.172A.686.686 0 0 1 11 4.657v.686`}]]}))(),1),Ze=U(K.Check,u),Qe=U(K.ChevronDown,j),$e=U(K.ChevronRight,be),et=U(K.ChevronUp,s),tt=U(K.ChevronsDownUp,null),nt=U(K.ChevronsUpDown,null),rt=U(K.Circle,ve),it=U(K.CircleAlert,p),at=U(K.CircleCheck,w),ot=U(K.Code2,D),st=U(K.Columns2,A),ct=U(K.Copy,M),lt=U(K.CornerUpRight,null),ut=U(K.Eye,null),dt=U(K.FoldVertical,null),ft=U(K.Folder,h),pt=U(K.FolderClosed,h),mt=U(K.FolderOpen,y),ht=U(K.Image,T),gt=U(K.Link,N),_t=U(K.ListPlus,null),vt=U(K.Lock,null),yt=U(K.LockOpen,null),bt=U(K.Maximize2,Ve),xt=U(K.Minimize2,null),St=U(K.Minus,c),Ct=U(K.Moon,ne),wt=U(K.PanelLeft,_),Tt=U(K.PanelLeftClose,null),Et=U(K.Plus,Ie),Dt=U(K.SquarePlus,L),Ot=U(K.Sun,B),kt=U(K.Table2,re),At=U(K.Text,g),jt=U(K.UnfoldVertical,null),Mt=U(K.Volume2,Oe),Nt=U(K.VolumeOff,S),Pt=r(),Ft=e(d()),It=W.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=z({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(W.Fragment,{children:[l,c&&Ft.createPortal(n,c)]})}),Lt=`MmLlHhVvCcSsQqTtAaZz`;function Rt(e){let t=[],n=e.length,r=0,i=0,a=0,o=0,s=0,c=null,l=``,u=0,d=0,f=``,p=!1,m=e=>{throw Error(`morphicons: ${e} at d[${r}]`)},h=e=>e>=48&&e<=57,g=()=>{for(;r<n;){let t=e.charCodeAt(r);if(t===32||t===9||t===10||t===13||t===12||t===44)r++;else break}},_=()=>{g();let t=r;r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(r<n&&e[r]===`.`)for(r++;r<n&&h(e.charCodeAt(r));)r++,i=!0;if(i||m(`expected number`),r<n&&(e[r]===`e`||e[r]===`E`)){let t=r;r++,r<n&&(e[r]===`+`||e[r]===`-`)&&r++;let i=!1;for(;r<n&&h(e.charCodeAt(r));)r++,i=!0;i||(r=t)}return Number(e.slice(t,r))},v=()=>{g();let t=e[r];return t===`0`||t===`1`?(r++,+(t===`1`)):m(`expected arc flag (0|1)`)},y=()=>(p||m(`path must start with M/m`),c||(c={x0:i,y0:a,segs:[],closed:!1},t.push(c)),c),b=!1,x=()=>_()+(b?i:0),S=()=>_()+(b?a:0);for(;g(),!(r>=n);){let n=e[r];switch(Lt.includes(n)?(l=n,r++):l===``?m(`path must start with M/m`):l===`M`?l=`L`:l===`m`?l=`l`:(l===`Z`||l===`z`)&&m(`stray data after Z`),b=l>=`a`,b?l.toUpperCase():l){case`M`:{p=!0;let e=x(),n=S();i=e,a=n,o=e,s=n,c={x0:e,y0:n,segs:[],closed:!1},t.push(c),f=``;break}case`L`:{let e=x(),t=S();y().segs.push([`L`,e,t]),i=e,a=t,f=``;break}case`H`:{let e=x();y().segs.push([`L`,e,a]),i=e,f=``;break}case`V`:{let e=S();y().segs.push([`L`,i,e]),a=e,f=``;break}case`C`:case`S`:{let e,t;l===`C`||l===`c`?(e=x(),t=S()):(e=f===`C`?2*i-u:i,t=f===`C`?2*a-d:a);let n=x(),r=S(),o=x(),s=S();y().segs.push([`C`,e,t,n,r,o,s]),u=n,d=r,i=o,a=s,f=`C`;break}case`Q`:case`T`:{let e,t;l===`Q`||l===`q`?(e=x(),t=S()):(e=f===`Q`?2*i-u:i,t=f===`Q`?2*a-d:a);let n=x(),r=S();y().segs.push([`Q`,e,t,n,r]),u=e,d=t,i=n,a=r,f=`Q`;break}case`A`:{let e=_(),t=_(),n=_(),r=v(),o=v(),s=x(),c=S();y().segs.push([`A`,e,t,n,r,o,s,c]),i=s,a=c,f=``;break}case`Z`:c&&=(c.closed=!0,null),i=o,a=s,f=``;break;default:m(`unsupported command "${l}"`)}}return t.filter(e=>e.segs.length>0)}function zt(e){return String(Math.round(e*100)/100)}function Bt(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=i.length/2;n+=`M${zt(i[0])} ${zt(i[1])}`;for(let e=1;e<a;e++)n+=`L${zt(i[2*e])} ${zt(i[2*e+1])}`;t?.[r]&&(n+=`Z`)}return n}function q(e){return String(Math.round(e*1e4)/1e4)}function Vt(e){let t=``;for(let{pts:n,closed:r}of e){t+=`M${q(n[0])} ${q(n[1])}`;for(let e=2;e<n.length;e+=6)t+=`C${q(n[e])} ${q(n[e+1])} ${q(n[e+2])} ${q(n[e+3])} ${q(n[e+4])} ${q(n[e+5])}`;r&&(t+=`Z`)}return t}var Ht=4/3*Math.tan(Math.PI/8),Ut=2*Math.PI;function Wt(e,t){let n=[e,t],r=e,i=t,a=(e,t,a,o,s,c)=>{n.push(e,t,a,o,s,c),r=s,i=c},o=(e,t)=>{Math.abs(e-r)<1e-12&&Math.abs(t-i)<1e-12||a(r+(e-r)/3,i+(t-i)/3,r+2*(e-r)/3,i+2*(t-i)/3,e,t)};return[a,o,(e,t,n,o)=>{a(r+2/3*(e-r),i+2/3*(t-i),n+2/3*(e-n),o+2/3*(t-o),n,o)},(e,t,n,s,c,l,u)=>{let d=r,f=i;if(Math.abs(l-d)<1e-12&&Math.abs(u-f)<1e-12)return;let p=Math.abs(e),m=Math.abs(t);if(p<1e-12||m<1e-12){o(l,u);return}let h=n*Math.PI/180,g=Math.cos(h),_=Math.sin(h),v=(d-l)/2,y=(f-u)/2,b=g*v+_*y,x=-_*v+g*y,S=b*b/(p*p)+x*x/(m*m);if(S>1){let e=Math.sqrt(S);p*=e,m*=e}let C=p*p,w=m*m,T=b*b,E=x*x,D=(C*w-C*E-w*T)/(C*E+w*T);D<0&&(D=0);let O=(s===c?-1:1)*Math.sqrt(D),k=O*p*x/m,A=-O*m*b/p,ee=g*k-_*A+(d+l)/2,j=_*k+g*A+(f+u)/2,M=Math.atan2((x-A)/m,(b-k)/p),N=Math.atan2((-x-A)/m,(-b-k)/p)-M;c===0&&N>0?N-=Ut:c===1&&N<0&&(N+=Ut);let P=Math.max(1,Math.ceil(Math.abs(N)/(Math.PI/2)-1e-9)),te=N/P,F=4/3*Math.tan(te/4),I=e=>ee+p*Math.cos(e)*g-m*Math.sin(e)*_,L=e=>j+p*Math.cos(e)*_+m*Math.sin(e)*g,R=e=>-p*Math.sin(e)*g-m*Math.cos(e)*_,z=e=>-p*Math.sin(e)*_+m*Math.cos(e)*g,B=M,ne=d,V=f;for(let e=1;e<=P;e++){let t=M+te*e,n=e===P?l:I(t),r=e===P?u:L(t);a(ne+F*R(B),V+F*z(B),n-F*R(t),r-F*z(t),n,r),B=t,ne=n,V=r}},e=>(e&&o(n[0],n[1]),n.length<8?null:{pts:Float64Array.from(n),closed:e})]}function Gt(e){let[t,n,r,i,a]=Wt(e.x0,e.y0);for(let a of e.segs)switch(a[0]){case`L`:n(a[1],a[2]);break;case`C`:t(a[1],a[2],a[3],a[4],a[5],a[6]);break;case`Q`:r(a[1],a[2],a[3],a[4]);break;case`A`:i(a[1],a[2],a[3],a[4],a[5],a[6],a[7])}return a(e.closed)}function J(e,t,n=0){let r=e[t];if(r===void 0)return n;let i=typeof r==`number`?r:Number(r);return Number.isFinite(i)?i:n}function Kt(e){let t=String(e??``).trim();if(!t)return[];let n=t.split(/[\s,]+/).map(Number);if(n.some(e=>!Number.isFinite(e)))throw Error(`morphicons: invalid points: "${t}"`);return n}function qt(e,t){if(e.length<4)return null;let[,n,,,r]=Wt(e[0],e[1]);for(let t=2;t+1<e.length;t+=2)n(e[t],e[t+1]);return r(t)}function Jt(e,t,n,r){if(n<1e-12||r<1e-12)return null;let i=Ht*n,a=Ht*r,o=e+n,s=e-n,c=t+r,l=t-r,[u,,,,d]=Wt(o,t);return u(o,t+a,e+i,c,e,c),u(e-i,c,s,t+a,s,t),u(s,t-a,e-i,l,e,l),u(e+i,l,o,t-a,o,t),d(!0)}function Yt(e){let t=J(e,`x`),n=J(e,`y`),r=J(e,`width`),i=J(e,`height`);if(r<1e-12||i<1e-12)return null;let a=J(e,`rx`,NaN),o=J(e,`ry`,NaN);if(Number.isNaN(a)&&(a=Number.isNaN(o)?0:o),Number.isNaN(o)&&(o=a),a=Math.min(Math.max(a,0),r/2),o=Math.min(Math.max(o,0),i/2),a<1e-12||o<1e-12)return qt([t,n,t+r,n,t+r,n+i,t,n+i],!0);let s=t+a,c=t+r-a,l=t+r,u=n+o,d=n+i-o,f=n+i,p=Ht*a,m=Ht*o,[h,g,,,_]=Wt(s,n);return g(c,n),h(c+p,n,l,u-m,l,u),g(l,d),h(l,d+m,c+p,f,c,f),g(s,f),h(s-p,f,t,d+m,t,d),g(t,u),h(t,u-m,s-p,n,s,n),_(!0)}function Xt(e){let t=[],n=e=>{e&&t.push(e)};if(typeof e==`string`){for(let t of Rt(e))n(Gt(t));return t}for(let[t,r]of e)switch(t){case`path`:for(let e of Rt(String(r.d??``)))n(Gt(e));break;case`line`:{let[,e,,,t]=Wt(J(r,`x1`),J(r,`y1`));e(J(r,`x2`),J(r,`y2`)),n(t(!1));break}case`circle`:{let e=J(r,`r`);n(Jt(J(r,`cx`),J(r,`cy`),e,e));break}case`ellipse`:n(Jt(J(r,`cx`),J(r,`cy`),J(r,`rx`),J(r,`ry`)));break;case`rect`:n(Yt(r));break;case`polyline`:n(qt(Kt(r.points),!1));break;case`polygon`:n(qt(Kt(r.points),!0));break;default:throw Error(`morphicons: unsupported tag <${t}>`)}return t}function Zt(e){return e.items.map(()=>new Float64Array(2*e.n))}function Qt(e,t,n){for(let r=0;r<e.items.length;r++){let i=e.items[r],a=n[r],o=e.n,s=Math.exp(i.lnSigma*t),c=i.theta*t,l=Math.cos(c)*s,u=Math.sin(c)*s,d,f;if(i.block){let[e,n]=i.block.off,[r,a]=i.block.drift;d=i.ca[0]+r*t+(e*l-n*u-e),f=i.ca[1]+a*t+(e*u+n*l-n)}else d=i.ca[0]+(i.cb[0]-i.ca[0])*t,f=i.ca[1]+(i.cb[1]-i.ca[1])*t;for(let e=0;e<o;e++){let n=i.aC[2*e]+(i.bT[2*e]-i.aC[2*e])*t,r=i.aC[2*e+1]+(i.bT[2*e+1]-i.aC[2*e+1])*t;a[2*e]=d+n*l-r*u,a[2*e+1]=f+n*u+r*l}}}var $t=.35,en=.05,tn=.005,nn=8,rn=1e5;function Y(e){let t=e.length/2,n=0,r=0;for(let i=0;i<t;i++)n+=e[2*i],r+=e[2*i+1];return[n/t,r/t]}function an(e){let t=e.length/2,n=0;for(let r=1;r<t;r++)n+=Math.hypot(e[2*r]-e[2*r-2],e[2*r+1]-e[2*r-1]);return n}function on(e){let t=e.length/2,n=new Float64Array(2*t);for(let r=0;r<t;r++)n[2*r]=e[2*(t-1-r)],n[2*r+1]=e[2*(t-1-r)+1];return n}function sn(e,t){let n=e.length/2,r=new Float64Array(2*n);for(let i=0;i<n;i++){let a=(i+t)%n;r[2*i]=e[2*a],r[2*i+1]=e[2*a+1]}return r}function cn(e,t,n,r){let i=e.length/2,a=0,o=0,s=0,c=0,l=0,u=0;for(let d=0;d<i;d++){let i=e[2*d]-n[0],f=e[2*d+1]-n[1],p=t[2*d]-r[0],m=t[2*d+1]-r[1];a+=i*p,c+=f*m,o+=i*m,s+=f*p,l+=i*i+f*f,u+=p*p+m*m}let d=Math.atan2(o-s,a+c),f=Math.cos(d)*(a+c)+Math.sin(d)*(o-s),p=l>1e-12?f/l:1;p>1e-6||(p=1e-6);let m=Math.max(0,p*p*l-2*p*f+u),h=u>1e-12?Math.sqrt(m/u):0;return{theta:d,sigma:p,res:h}}function ln(e,t,n=!1,r=!1){let i=Y(e),a=Y(t),o=n&&!r,s=o?e:t,c=n||r?s.length/2:1,l=1/0,u=s,d={theta:0,sigma:1,res:0};for(let n=0;n<2;n++){let r=n?on(s):s;for(let n=0;n<c;n++){let s=n?sn(r,n):r,c=o?cn(s,t,i,a):cn(e,s,i,a),f=c.res+en*Math.abs(c.theta)/Math.PI;f<l&&(l=f,u=s,d=c)}}return o?{ca:i,cb:a,a:u,b:t,...d}:{ca:i,cb:a,a:e,b:u,...d}}function un(e,t){let n=t.map(Y),r=t.map(an);return e.map(e=>{let t=Y(e),i=an(e);return n.map((e,n)=>Math.hypot(t[0]-e[0],t[1]-e[1])+$t*Math.abs(i-r[n]))})}function dn(e){let t=e.length;if(t>nn){let n=[];for(let r=0;r<t;r++)for(let i=0;i<t;i++)n.push([e[r][i],r,i]);n.sort((e,t)=>e[0]-t[0]);let r=Array(t).fill(-1),i=Array(t).fill(!1);for(let[,e,t]of n)r[e]<0&&!i[t]&&(r[e]=t,i[t]=!0);return r}let n=Array.from({length:t},(e,t)=>t),r=n.slice(),i=1/0,a=(n,o,s)=>{if(!(s>=i)){if(o===t)i=s,r=n.slice();else for(let r=o;r<t;r++)[n[o],n[r]]=[n[r],n[o]],a(n,o+1,s+e[o][n[o]]),[n[o],n[r]]=[n[r],n[o]]}};return a(n,0,0),r}function fn(e){let t=e.length,n=e[0].length;if(n**t>rn){let r=e.map(e=>{let t=0;for(let n=1;n<e.length;n++)e[n]<e[t]&&(t=n);return t}),i=Array(n).fill(0);for(let e of r)i[e]++;for(let a=0;a<n;a++){if(i[a]>0)continue;let n=-1,o=1/0;for(let s=0;s<t;s++){if(i[r[s]]<2)continue;let t=e[s][a]-e[s][r[s]];t<o&&(o=t,n=s)}i[r[n]]--,r[n]=a,i[a]++}return r}let r=null,i=1/0,a=Array(t),o=Array(n).fill(0),s=(c,l,u)=>{if(!(l>=i||n-u>t-c)){if(c===t)i=l,r=a.slice();else for(let t=0;t<n;t++)a[c]=t,o[t]++,s(c+1,l+e[c][t],u+ +(o[t]===1)),o[t]--}};if(s(0,0,0),!r)throw Error(`morphicons: no valid surjection (B < S)`);return r}function pn(e,t){let n=e.length*t,r=new Float64Array(2*n),i=new Float64Array(2*n);e.forEach((e,n)=>{r.set(e.a,2*t*n),i.set(e.bO,2*t*n)});let a=Y(r),o=cn(r,i,a,Y(i));if(o.res>=tn)return;let s=Math.cos(-o.theta),c=Math.sin(-o.theta),l=Math.cos(o.theta),u=Math.sin(o.theta);for(let n of e){let e=0,r=0;for(let i=0;i<t;i++){let t=n.bO[2*i]-n.cb[0],a=n.bO[2*i+1]-n.cb[1];n.bT[2*i]=(t*s-a*c)/o.sigma,n.bT[2*i+1]=(t*c+a*s)/o.sigma;let d=o.sigma*(l*n.aC[2*i]-u*n.aC[2*i+1])-t,f=o.sigma*(u*n.aC[2*i]+l*n.aC[2*i+1])-a;e+=d*d+f*f,r+=t*t+a*a}n.theta=o.theta,n.lnSigma=Math.log(o.sigma),n.res=r>1e-12?Math.sqrt(e/r):0;let i=Math.exp(n.lnSigma),d=Math.cos(n.theta)*i,f=Math.sin(n.theta)*i,p=n.ca[0]-a[0],m=n.ca[1]-a[1],h=p*d-m*f-p,g=p*f+m*d-m;n.block={off:[p,m],drift:[n.cb[0]-n.ca[0]-h,n.cb[1]-n.ca[1]-g]}}}function mn(e,t){let n=e.length,r=t.length;if(n===0||r===0)throw Error(`morphicons: icon has no subpaths`);let i=e.map(e=>e.pts),a=t.map(e=>e.pts),o=[];if(n===r){let e=dn(un(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}else if(n<r){let e=fn(un(a,i));for(let t=0;t<r;t++)o.push([e[t],t])}else{let e=fn(un(i,a));for(let t=0;t<n;t++)o.push([t,e[t]])}let s=i[0].length/2,c=o.map(([n,r])=>{let o=ln(i[n],a[r],e[n].closed,t[r].closed),c=o.a,l=new Float64Array(2*s),u=new Float64Array(2*s),d=new Float64Array(2*s),f=Math.cos(-o.theta),p=Math.sin(-o.theta);for(let e=0;e<s;e++){l[2*e]=c[2*e]-o.ca[0],l[2*e+1]=c[2*e+1]-o.ca[1];let t=o.b[2*e]-o.cb[0],n=o.b[2*e+1]-o.cb[1];u[2*e]=(t*f-n*p)/o.sigma,u[2*e+1]=(t*p+n*f)/o.sigma,d[2*e]=o.b[2*e],d[2*e+1]=o.b[2*e+1]}return{a:c,aC:l,bT:u,bO:d,ca:o.ca,cb:o.cb,theta:o.theta,lnSigma:Math.log(o.sigma),res:o.res,closed:e[n].closed&&t[r].closed,block:null}});return c.length>1&&pn(c,s),{items:c,n:s}}var hn=Math.PI/8,gn=[.18343464249564978,.525532409916329,.7966664774136267,.9602898564975363],_n=[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626];function vn(e,t,n){let r=6*t,i=1-n,a=3*i*i,o=6*i*n,s=3*n*n,c=a*(e[r+2]-e[r])+o*(e[r+4]-e[r+2])+s*(e[r+6]-e[r+4]),l=a*(e[r+3]-e[r+1])+o*(e[r+5]-e[r+3])+s*(e[r+7]-e[r+5]);return Math.hypot(c,l)}function yn(e,t,n=1){let r=n/2,i=0;for(let n=0;n<4;n++)i+=_n[n]*(vn(e,t,r+r*gn[n])+vn(e,t,r-r*gn[n]));return i*r}function bn(e,t,n,r,i){let a=6*t,o=1-n,s=o*o*o,c=3*o*o*n,l=3*o*n*n,u=n*n*n;r[i]=s*e[a]+c*e[a+2]+l*e[a+4]+u*e[a+6],r[i+1]=s*e[a+1]+c*e[a+3]+l*e[a+5]+u*e[a+7]}function xn(e,t,n){let r=6*t,i=n?r+6:r,a=n?-1:1;for(let t of n?[4,2,0]:[2,4,6]){let n=a*(e[r+t]-e[i]),o=a*(e[r+t+1]-e[i+1]);if(n*n+o*o>1e-18)return[n,o]}return null}function Sn(e,t=hn){let n=e.pts,r=(n.length/2-1)/3,i=[];for(let e=0;e<r;e++)yn(n,e)>1e-9&&i.push(e);if(i.length===0)return[];let a=new Set,o=(e,r)=>{let i=xn(n,e,!0),o=xn(n,r,!1);i&&o&&Math.abs(Math.atan2(i[0]*o[1]-i[1]*o[0],i[0]*o[0]+i[1]*o[1]))>t&&a.add(r)};for(let e=0;e+1<i.length;e++)o(i[e],i[e+1]);return e.closed&&i.length>1&&o(i[i.length-1],i[0]),[...a].sort((e,t)=>e-t)}function Cn(e,t,n,r){if(n<=0)return 0;if(n>=r)return 1;let i=0,a=1,o=n/r;for(let s=0;s<12;s++){let s=yn(e,t,o)-n;if(Math.abs(s)<1e-10*r+1e-14)break;s>0?a=o:i=o;let c=vn(e,t,o),l=c>1e-12?o-s/c:(i+a)/2;l>i&&l<a||(l=(i+a)/2),o=l}return o}function wn(e,t=64,n=hn){let r=e.pts,i=(r.length/2-1)/3,a=new Float64Array(2*t),o=()=>{for(let e=0;e<t;e++)a[2*e]=r[0],a[2*e+1]=r[1];return a};if(i<1)return o();let s=Array(i),c=0;for(let e=0;e<i;e++)s[e]=yn(r,e),c+=s[e];if(c<1e-12)return o();let l=Sn(e,n),u=e.closed?l.length>0?l:[0]:[...new Set([0,...l,i])].sort((e,t)=>e-t),d=[];if(e.closed)for(let e=0;e<u.length;e++){let t=u[e],n=e+1<u.length?u[e+1]:u[0]+i;d.push([t,n])}else for(let e=0;e+1<u.length;e++)d.push([u[e],u[e+1]]);let f=d.map(([e,t])=>{let n=0;for(let r=e;r<t;r++)n+=s[r%i];return n}),p=e.closed?t:t-1;if(d.length>p)throw Error(`morphicons: N=${t} too small (${d.length} runs)`);let m=f.reduce((e,t)=>e+t,0)||1,h=f.map(e=>p*e/m),g=h.map(e=>Math.max(1,Math.floor(e))),_=p-g.reduce((e,t)=>e+t,0);if(_>0){let e=h.map((e,t)=>[Math.round((e-Math.floor(e))*1e9),t]).sort((e,t)=>t[0]-e[0]||e[1]-t[1]);for(let t=0;t<_;t++)g[e[t%g.length][1]]++}for(;_<0;){let e=0;for(let t=1;t<g.length;t++)g[t]>g[e]&&(e=t);if(g[e]<=1)break;g[e]--,_++}let v=0;for(let e=0;e<d.length;e++){let[t,n]=d[e],o=g[e],c=f[e],l=t%i*6;a[2*v]=r[l],a[2*v+1]=r[l+1],v++;let u=t,p=0;for(let e=1;e<o;e++){let t=c*e/o;for(;u<n-1&&p+s[u%i]<t;)p+=s[u%i],u++;let l=u%i,d=s[l];bn(r,l,d>1e-12?Cn(r,l,t-p,d):0,a,2*v),v++}}if(!e.closed){let e=6*i;a[2*v]=r[e],a[2*v+1]=r[e+1]}return a}function Tn(e,t=64){return Xt(e).map(e=>({pts:wn(e,t),closed:e.closed}))}var En=class{x=1;v=0;k=250;c=24;config(e,t){this.k=e,this.c=t}start(){this.x=0,this.v>14&&(this.v=14),this.v<-14&&(this.v=-14)}step(e){let t=Math.max(1,Math.min(16,Math.ceil(e/(1/240)))),n=e/t;for(let e=0;e<t;e++){let e=this.k*(1-this.x)-this.c*this.v;this.v+=e*n,this.x+=this.v*n}return Math.abs(1-this.x)<.001&&Math.abs(this.v)<.02}},Dn={smooth:{k:170,c:26},snappy:{k:420,c:30},bouncy:{k:300,c:14}},X=new Set,Z=0,Q=-1;function On(e){let t=Q<0?0:Math.min(Math.max((e-Q)/1e3,0),.1);Q=e;for(let e of[...X])e(t);X.size>0?Z=requestAnimationFrame(On):(Z=0,Q=-1)}function kn(e){X.add(e),Z===0&&(Q=-1,Z=requestAnimationFrame(On))}function An(e){X.delete(e),X.size===0&&Z!==0&&(cancelAnimationFrame(Z),Z=0,Q=-1)}var jn=new WeakMap,Mn=new WeakMap,Nn=new WeakMap;function $(e){if(typeof e==`string`)return Tn(e);let t=jn.get(e);return t||(t=Tn(e),jn.set(e,t)),t}function Pn(e){if(typeof e==`string`)return e;let t=Mn.get(e);return t||(t=Vt(Xt(e)),Mn.set(e,t)),t}function Fn(e,t){if(typeof e==`string`||typeof t==`string`)return mn($(e),$(t));let n=Nn.get(e);n||(n=new WeakMap,Nn.set(e,n));let r=n.get(t);return r||(r=mn($(e),$(t)),n.set(t,r)),r}function In(e){if(typeof e==`string`)return Dn[e];let t=Dn.snappy;return{k:e?.stiffness??t.k,c:e?.damping??t.c}}function Ln(e,t,n){let r=new En,i=n?.reducedMotion??`never`,a=t,o=!0,s=null,c=null,l=null,u=1,d=!1,f=!1;e.setAttribute(`d`,Pn(t));let p=t=>{let n=s,r=c,i=l;n&&r&&i&&(u=t,Qt(n,t,r),e.setAttribute(`d`,Bt(r,i)))},m=()=>{d&&(d=!1,An(h))},h=e=>{let t=r.step(e);p(r.x),t&&(m(),g())},g=()=>{o=!0,s=null,c=null,l=null,u=1,r.x=1,r.v=0,e.setAttribute(`d`,Pn(a))},_=()=>{let e=s,t=c;return o||!e||!t?$(a):t.map((t,n)=>({pts:Float64Array.from(t),closed:e.items[n].closed}))},v=e=>{s=o?Fn(a,e):mn(_(),$(e)),c=Zt(s),l=s.items.map(e=>e.closed),a=e,o=!1},y=e=>{m(),a=e,g()},b=()=>i===`always`?!0:i!==`user`||typeof matchMedia>`u`?!1:matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,x=(e,t)=>{if(f)return;let n=!o&&s!==null&&e===a;m(),r.v=0,n||v(e),p(t)};return{morphTo(e,t){if(f||e===a&&(o||d))return;if(b()){y(e);return}let{k:n,c:i}=In(t);r.config(n,i),v(e),r.start(),d||(d=!0,kn(h))},set(e){f||y(e)},seek:x,get progress(){return o?1:u},set progress(e){f||x(a,e)},get reducedMotion(){return i},set reducedMotion(e){i=e},destroy(){m(),f=!0,s=null,c=null,l=null}}}var Rn=typeof document>`u`?W.useEffect:W.useLayoutEffect;function zn(e,t,n){if(n<=0)return Pn(e);if(n>=1)return Pn(t);let r=mn(Tn(e),Tn(t)),i=Zt(r);return Qt(r,n,i),Bt(i,r.items.map(e=>e.closed))}var Bn=(0,W.forwardRef)(function(e,t){let{icon:n,from:r,to:i,progress:a,spring:o,reducedMotion:s,size:c=24,color:l=`currentColor`,strokeWidth:u=2,absoluteStrokeWidth:d,label:f,...p}=e,m=r!==void 0&&i!==void 0,h=n??r??i,[g]=(0,W.useState)(()=>m?zn(r,i,a??0):h===void 0?``:Pn(h)),_=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(o);y.current=o;let b=(0,W.useRef)(s);b.current=s;let x=(0,W.useRef)(n),S=(0,W.useRef)(m),C=(0,W.useRef)(!1),w=(0,W.useRef)(!1),T=(0,W.useRef)(null),E=(0,W.useCallback)(e=>{if(v.current)return v.current;let t=_.current;return C.current||!t?null:(v.current=Ln(t,e,{reducedMotion:b.current}),v.current)},[]);Rn(()=>{C.current=!1;let e=_.current;if(e&&h!==void 0){let t=Ln(e,m?r:h,{reducedMotion:b.current});if(v.current=t,m){T.current=[r,i];let e=a??0;e<=0?t.set(r):e>=1?t.set(i):(t.seek(i,e),w.current=!0)}}return()=>{C.current=!0,v.current?.destroy(),v.current=null,w.current=!1,T.current=null}},[]),(0,W.useEffect)(()=>{let e=v.current;e&&(e.reducedMotion=s??`never`)},[s]),(0,W.useEffect)(()=>{let e=S.current&&!m;S.current=m;let t=n!==x.current;if(x.current=n,m||n===void 0||!t&&!e)return;T.current=null,w.current=!1;let r=v.current;r?r.morphTo(n,y.current):E(n)},[n,m,E]),(0,W.useEffect)(()=>{if(!m)return;let e=v.current??E(r);if(!e)return;let t=a??0;T.current&&T.current[0]===r&&T.current[1]===i||(T.current=[r,i],w.current=!1),t<=0?(e.set(r),w.current=!1):t>=1?(e.set(i),w.current=!1):(w.current||=(e.set(r),!0),e.seek(i,t))},[m,r,i,a,E]),(0,W.useImperativeHandle)(t,()=>({morphTo:(e,t)=>{T.current=null,w.current=!1;let n=v.current;n?n.morphTo(e,t??y.current):E(e)},set:e=>{T.current=null,w.current=!1;let t=v.current;t?t.set(e):E(e)}}),[E]);let D=d?Number(u)*24/Number(c):u;return(0,G.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:c,height:c,viewBox:`0 0 24 24`,fill:`none`,stroke:l,strokeWidth:D,strokeLinecap:`round`,strokeLinejoin:`round`,role:f?`img`:void 0,"aria-hidden":!f||void 0,...p,children:[f?(0,G.jsx)(`title`,{children:f}):null,(0,G.jsx)(`path`,{ref:_,d:g})]})});function Vn(e){return typeof e==`object`&&!!e&&`lucide`in e}function Hn(e){let t=(0,Pt.c)(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({reducedMotion:a,icon:n,strokeWidth:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`user`:a,s=pe(),c=Vn(n)?s===`p4`?n.p4??n.lucide:n.lucide:n,l;t[5]!==s||t[6]!==i?(l=s===`p4`?je(i):i,t[5]=s,t[6]=i,t[7]=l):l=t[7];let u=l,d;t[8]===c?d=t[9]:(d=c===void 0?{}:{icon:c},t[8]=c,t[9]=d);let f;t[10]===u?f=t[11]:(f=u===void 0?{}:{strokeWidth:u},t[10]=u,t[11]=f);let p;return t[12]!==r||t[13]!==o||t[14]!==d||t[15]!==f?(p=(0,G.jsx)(Bn,{reducedMotion:o,...d,...f,...r}),t[12]=r,t[13]=o,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}var Un=W.createContext(void 0);function Wn(e){let t=W.useContext(Un);if(t===void 0&&!e)throw Error(He(72));return t}var Gn={...he,disabled:k(e=>e.disabled),instantType:k(e=>e.instantType),isInstantPhase:k(e=>e.isInstantPhase),trackCursorAxis:k(e=>e.trackCursorAxis),disableHoverablePopup:k(e=>e.disableHoverablePopup),lastOpenChangeReason:k(e=>e.openChangeReason),closeOnClick:k(e=>e.closeOnClick),closeDelay:k(e=>e.closeDelay),hasViewport:k(e=>e.hasViewport)},Kn=class e extends f{constructor(e,t,n=!1){let r=new ae,i={...qn(),...e};i.floatingRootContext=_e(r,t,n),super(i,{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Gn)}setOpen=(e,t)=>{let n=t.reason,r=n===ge,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0),Be(r,e,t.trigger),this.update(r)};r?Ft.flushSync(o):o()};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,H(oe,e))}static useStore(t,n){return Fe(t,(t,r)=>new e(n,t,r)).store}};function qn(){return{...Ce(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var Jn=ye(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:o=`none`,actionsRef:s,onOpenChange:c,onOpenChangeComplete:l,handle:u,triggerId:d,defaultTriggerId:f=null,children:p}=e,m=Kn.useStore(u?.store,{open:n,openProp:r,activeTriggerId:f,triggerIdProp:d});xe(()=>{r===void 0&&m.state.open===!1&&n===!0&&m.update({open:!0,activeTriggerId:f})}),m.useControlledProp(`openProp`,r),m.useControlledProp(`triggerIdProp`,d),m.useContextCallback(`onOpenChange`,c),m.useContextCallback(`onOpenChangeComplete`,l);let h=m.useState(`open`),g=!t&&h,_=m.useState(`activeTriggerId`),v=m.useState(`mounted`),y=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:o,disableHoverablePopup:i}),m.useSyncedValue(`disabled`,t),se(m);let{forceUnmount:b,transitionStatus:x}=Re(g,m),S=m.useState(`isInstantPhase`),C=m.useState(`instantType`),w=m.useState(`lastOpenChangeReason`),T=W.useRef(null);R(()=>{h&&t&&m.setOpen(!1,H(a))},[h,t,m]),R(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),m.set(`instantType`,`delay`)):T.current!==null&&(m.set(`instantType`,T.current),T.current=null)},[x,S,w,C,m]),R(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]);let E=W.useCallback(()=>{m.setOpen(!1,H(we))},[m]);W.useImperativeHandle(s,()=>({unmount:b,close:E}),[b,E]);let D=g||v||!t&&o!==`none`;return(0,G.jsxs)(Un.Provider,{value:m,children:[D&&(0,G.jsx)(Yn,{store:m,disabled:t,trackCursorAxis:o}),typeof p==`function`?p({payload:y}):p]})});function Yn({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=m(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Xe(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=W.useMemo(()=>Ue(a.reference,i.reference),[a.reference,i.reference]),s=W.useMemo(()=>Ue(a.trigger,i.trigger),[a.trigger,i.trigger]),c=W.useMemo(()=>Ue(Ne,a.floating,i.floating),[a.floating,i.floating]);return te(e,{activeTriggerProps:o,inactiveTriggerProps:s,popupProps:c}),null}var Xn=W.createContext(void 0);function Zn(){return W.useContext(Xn)}var Qn=function(e){return e[e.popupOpen=ce.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),$n=`data-base-ui-tooltip-trigger`;function er(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(De(n))return n}}let t=e.target;return De(t)?t:null}function tr(e){let t=e;for(;t;){if(t.hasAttribute($n))return t;let e=t.parentElement;if(e){t=e;continue}let n=t.getRootNode();t=`host`in n&&De(n.host)?n.host:null}return null}var nr=o(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...p}=e,m=Wn(!0),h=a?.store??m;if(!h)throw Error(He(82));let g=O(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=W.useRef(null),x=c??600,S=d??0,{registerTrigger:C,isMountedByThisTrigger:w}=F(g,b,h,{payload:o,closeOnClick:u,closeDelay:S}),T=Zn(),{delayRef:E,isInstantPhase:D,hasProvider:k}=qe(y,{open:v}),A=le(y);h.useSyncedValue(`isInstantPhase`,D);let ee=h.useState(`disabled`),j=s??ee,M=ke(j),N=h.useState(`trackCursorAxis`),te=h.useState(`disableHoverablePopup`),I=W.useRef(!1),L=P(),R=W.useRef(void 0);function z(){let e=T?.delay,t=typeof E.current==`object`?E.current.open:void 0,n=x;return k&&(n=t===0?0:c??e??x),n}function B(e){let t=b.current;if(!t||!e)return!1;let n=tr(e);return n!==null&&n!==t&&me(t,n)}function ne(e){let t=B(e);return I.current=t,t&&(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1,L.clear()),t}let V=Se(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!te&&N!==`both`?Te():null,restMs:z,delay(){let e=typeof E.current==`object`?E.current.close:void 0,t=S;return d==null&&k&&(t=e),{close:t}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!I.current}}),re=de(y,{enabled:!j}).reference,ie=e=>{let t=I.current,n=er(e),r=ne(n),i=b.current,a=i&&n&&me(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`)h.setOpen(!1,H(ge,e));else if(t&&!r&&a&&!M.current&&!h.select(`open`)&&i&&Me(R.current)){let t=()=>{I.current||M.current||h.select(`open`)||h.setOpen(!0,H(ge,e,i))},n=z();n===0?(L.clear(),t()):L.start(n,t)}},ae=h.useState(`triggerProps`,w);return We(`button`,e,{state:{open:v},ref:[t,C,b],props:[V,re,w||N!==`none`?ae:void 0,{onMouseOver(e){ie(e.nativeEvent)},onFocus(e){B(er(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){I.current=!1,L.clear(),R.current=void 0},onPointerEnter(e){R.current=e.pointerType},onPointerDown(e){R.current=e.pointerType,h.set(`closeOnClick`,u),u&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,[Qn.triggerDisabled]:j?``:void 0,[$n]:j?void 0:``},p],stateAttributesMapping:l})}),rr=W.createContext(void 0);function ir(){let e=W.useContext(rr);if(e===void 0)throw Error(He(70));return e}var ar=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Wn().useState(`mounted`)||n?(0,G.jsx)(rr.Provider,{value:n,children:(0,G.jsx)(It,{ref:t,...r})}):null}),or=W.createContext(void 0);function sr(){let e=W.useContext(or);if(e===void 0)throw Error(He(71));return e}var cr=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=x,style:g,..._}=e,v=Wn(),y=ir(),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`trackCursorAxis`),T=v.useState(`disableHoverablePopup`),D=v.useState(`floatingRootContext`),O=v.useState(`instantType`),k=v.useState(`transitionStatus`),A=v.useState(`hasViewport`),j=b({anchor:i,positionMethod:a,floatingRootContext:D,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:A?E:void 0}),M=W.useMemo(()=>({open:S,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:w===`none`?O:`tracking-cursor`}),[S,j.side,j.align,j.anchorHidden,w,O]),N=ee(e,M,{styles:j.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!C,inert:!S||w===`both`||T});return(0,G.jsx)(or.Provider,{value:j,children:N})}),lr={...ze,...I},ur=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Wn(),{side:s,align:c}=sr(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Pe({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Ae(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return We(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[f,v(d),a],stateAttributesMapping:lr})}),dr=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=W.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=W.useMemo(()=>({open:t,close:n}),[t,n]);return(0,G.jsx)(Xn.Provider,{value:i,children:(0,G.jsx)(Ke,{delay:a,timeoutMs:r,children:e.children})})};export{ht as A,Tt as B,ct as C,ft as D,dt as E,bt as F,At as G,Dt as H,xt as I,Nt as J,jt as K,St as L,_t as M,vt as N,pt as O,yt as P,Ct as R,st as S,ut as T,Ot as U,Et as V,kt as W,nt as _,ar as a,at as b,Kn as c,It as d,Ze as f,tt as g,et as h,sr as i,gt as j,mt as k,Wn as l,$e as m,ur as n,nr as o,Qe as p,Mt as q,cr as r,Jn as s,dr as t,Hn as u,rt as v,lt as w,ot as x,it as y,wt as z};
|
|
2
|
+
//# sourceMappingURL=TooltipProvider-BH5ni_Lo.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,d as t,f as n,g as r,h as i,n as a,r as o,s,t as c}from"./77XECAW3-
|
|
2
|
-
//# sourceMappingURL=UQJE5E4I-
|
|
1
|
+
import{_ as e,d as t,f as n,g as r,h as i,n as a,r as o,s,t as c}from"./77XECAW3-Ccw2Y7VD.js";import{r as l,t as u}from"./DKTLEL5E-DciMwFJ1.js";import{t as d}from"./TSHNXIZL-FQ7ZWHEn.js";import{a as f,i as p,o as m}from"./ABYRPUBD-CvqVJLPf.js";import{n as h,r as g,t as _}from"./CXAC5362-Bmar3Iii.js";import{PeleError as v,_ as y,g as b}from"./lazy-C1dqAep6.js";var x=11,S=class{type=`mindmap`;title;nodes=[];getType=_;baseLevel=0;open=[];addNode(e,t,n,r){let i=this.nodes.length===0;i&&(this.baseLevel=e),e-=this.baseLevel;let a=this.open,o=a.length;for(;o>0&&a[o-1].level>=e;)o--;let s=a[o-1];if(!s&&!i)throw new v(`There can be only one root. No parent could be found for ("${n}")`,`semantic`,{type:`mindmap`});let c={id:this.nodes.length,nodeId:t,level:e,descr:n,type:r,children:[],isRoot:i};s&&(c.section=s.isRoot?s.children.length%x:s.section,s.children.push(c)),a.length=o,a.push(c),this.nodes.push(c)}decorateNode(e){let t=this.nodes[this.nodes.length-1];!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.class=e.class))}};function C(e,t){g(e,t,!1)}var ee=[``,`rounded`,`rect`,`circle`,`cloud`,`bang`,`hex`],te=`stadium`,ne=36,re=8,ie=18,ae=52,oe=28,se=6,ce=12,le=.22,w=6,T=28,ue=12,de=8,fe=10;function pe(e,t,n,r){if(e.lines.length<2)return c(e,t+e.width/2,n,` class="pele-label"`,r);let o=``,s=n-e.height/2;for(let n=0;n<e.lines.length;n++)o+=c(a(e,n),t+e.widths[n]/2,s+i(e,n),` class="pele-label"`,r);return o}function me(e,t,n){return u(n,r=>E(e,t,n,r))}function E(i,a,u,g){let _=u.fontSize??16,v=u.measurer??y(u.fontFamily),x=u.padding??8,S=u.icons,C=a.mindmap?.maxNodeWidth,me=typeof C==`number`&&C>0?Math.min(C,2e3):200,E=_*1.25,D=i.nodes,O=D.length,k=new Int32Array(O),A=new Int32Array(O);for(let e=0;e<O;e++)for(let t of D[e].children)k[t.id]=e,A[t.id]=A[e]+1;let he=g&&u.maxWidth!==void 0&&u.maxWidth>0?u.maxWidth-2*x:1/0,ge=Array(O),j=Array(O),M=new Float64Array(O),N=new Float64Array(O),P=new Float64Array(O),F=new Float64Array(O),I=new Uint8Array(O);for(let e=0;e<O;e++){let t=D[e];I[e]=+(t.icon!==void 0&&b(t.icon)!==``);let n=Math.min(me,Math.max(72,he-A[e]*T-2*se-(I[e]?E+w:0))),r=ge[e]=s(t.descr,!0,v,_,n),i=r.width+(I[e]?E+(r.width>0?w:0):0),a=Math.max(r.height,Math.round(_*1.5)),o=ee[t.type]||(e===0?te:``);if(g&&e===0&&o!==`rect`&&o!==`rounded`&&(o=te),j[e]=o,o===``){let n=t.children.length>0;M[e]=i+2*(n?ce:se),N[e]=a+(n?6:0),F[e]=N[e]/2}else{let t=p(o,i,a);M[e]=t.w,N[e]=t.h,P[e]=t.dy,F[e]=t.h/2}}let L=new Float64Array(O),R=new Float64Array(O),z=new Float64Array(O),_e=new Float64Array(O),ve=0,ye=(e,t,n,r)=>{let i=0,a=0;for(let o=t;o<n;o++){let t=e[o].id;R[t]=i,a=e[o].children.length>0||o+1<n&&e[o+1].children.length>0?Math.max(r,ie):r,i+=L[t]+a}ve=i-a;let o=e[t].id,s=e[n-1].id;return(R[o]+z[o]+F[o]+R[s]+z[s]+F[s])/2};for(let e=O-1;e>0;e--){let t=D[e].children;if(t.length===0){L[e]=N[e];continue}let n=ye(t,0,t.length,re)-F[e],r=Math.min(0,n);L[e]=Math.max(ve,n+N[e])-r,z[e]=n-r,_e[e]=-r}let B=new Float64Array(O),V=new Float64Array(O),H=new Float64Array(O),U=new Int8Array(O),be=new Float64Array(O);if(g){let e=0;for(let t=0;t<O;t++)t>0&&k[t]===0&&(e+=fe),B[t]=A[t]*T+M[t]/2,V[t]=e,e+=N[t]+fe}else if(O>0){let e=D[0].children,t=e.length,n=0;for(let t of e)n+=L[t.id];let r=t,i=1/0,a=0;for(let o=1;o<t;o++){a+=L[e[o-1].id];let s=Math.abs(2*a-n+(2*o-t)*oe);s<i&&(i=s,r=o)}for(let n=0,i=r,a=1;n<t;n=i,i=t,a=-1){let t=ye(e,n,i,oe);for(let r=n;r<i;r++){let n=e[r].id;H[n]=R[n]-t,U[n]=a}}V[0]=-N[0]/2;for(let e=0;e<O;e++){e>0&&(V[e]=H[e]+z[e]);for(let t of D[e].children){let n=t.id;e>0&&(U[n]=U[e],H[n]=H[e]+_e[e]+R[n]),B[n]=B[e]+U[n]*(M[e]/2+(e>0?ne:ae)+M[n]/2)}}}let W=0,G=0,K=0,q=0,J=``,Y=``,X=``,Z=``,xe=e=>{X!==``&&(J+=`<g class="pele-branch pele-section-${e??0}"><g class="pele-edges" fill="none" stroke="${Z}" stroke-width="1.5">${Y}</g>${X}</g>`,Y=X=``)};for(let r=1;r<=O;r++){let i=r%O,a=D[i],s=j[i],l=ge[i],u=B[i],d=V[i];if(W=Math.min(W,u-M[i]/2),G=Math.max(G,u+M[i]/2),K=Math.min(K,d),q=Math.max(q,d+N[i]),(i===0||k[i]===0)&&xe(D[r-1].section),i>0&&g){k[i]===0&&(Z=t(a.section??0));let e=k[i],r=e===0?Math.min(Math.max(ue,N[0]/2),T-de):ue,o=B[e]-M[e]/2+Math.min(r,M[e]/2),c=be[e]||V[e]+N[e],l=u-M[i]/2+(s?m(s,M[i],N[i],3):0),f=d+F[i],p=Math.max(0,Math.min(de,l-o,f-c));be[e]=f-p,Y+=`<path class="pele-edge" d="M${n(o)},${n(c)}V${n(f-p)}Q${n(o)},${n(f)} ${n(o+p)},${n(f)}H${n(l)}"/>`}else if(i>0){k[i]===0&&(Z=t(a.section??0));let e=k[i],r=U[i],o=r>0?1:3,c=B[e]+r*(M[e]/2-(j[e]?m(j[e],M[e],N[e],o):0)),l=V[e]+F[e],f=u-r*M[i]/2+(s?r*m(s,M[i],N[i],4-o):0),p=d+F[i],h=n((c+f)/2);Y+=`<path class="pele-edge" d="M${n(c)},${n(l)}C${h},${n(l)} ${h},${n(p)} ${n(f)},${n(p)}"/>`}let p=!s&&a.children.length>0,_=` fill="${Z}" fill-opacity="${le}" stroke="${Z}"`,v=``;s?v=i>0?f(s,M[i],N[i],_,` stroke="${Z}"`):f(s,M[i],N[i],` fill="var(--_s)" stroke="var(--_b)"`,` stroke="var(--_b)"`):p&&(v=`<rect x="${n(-M[i]/2)}" y="${n(-N[i]/2)}" width="${n(M[i])}" height="${n(N[i])}" rx="${n(N[i]/2)}"${_}/>`);let y=0;a.icon&&I[i]&&(y=(E+(l.width>0?w:0))/2,v+=h(a.icon,-y-l.width/2,P[i]-E/2,E,S));let b=`<g class="pele-node pele-shape-${s||(p?`branch`:`text`)}${i>0?``:` pele-root`}${e(a.class??``)}" data-id="${o(a.nodeId)}" transform="translate(${n(u)},${n(d+N[i]/2)})">`+v+(g&&!s?pe(l,y-l.width/2,P[i],S):c(l,y,P[i],` class="pele-label"`,S))+`</g>`;i>0?X+=b:J+=b}let Q=d(i.title,v,_,l(u)),Se=Q.height>0?Q.height+16:0,Ce=Math.max(G-W,Q.width),$=Math.ceil(Ce+2*x),we=Math.ceil(q-K+Se+2*x),Te=c(Q,$/2,x+Q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${n(x-W+(Ce-G+W)/2)},${n(x+Se-K)})">${J}</g>`;return{svg:r(`mindmap`,$,we,_,u,{},Te),width:$,height:we,links:[]}}var D={type:`mindmap`,math:!0,parse(e,t,n){let r=new S;return r.title=n,C(e,r),r},render:me};export{D as mindmap};
|
|
2
|
+
//# sourceMappingURL=UQJE5E4I-CeqBk-r6.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,g as r,h as i,l as a,m as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./6OLKWJ4F-
|
|
1
|
+
import{c as e,d as t,f as n,g as r,h as i,l as a,m as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./6OLKWJ4F-9loy41nw.js";import{a as m,f as h,g,m as _,p as v,r as y,s as ee,t as b,v as x,y as S}from"./77XECAW3-Ccw2Y7VD.js";import{a as C,s as w}from"./N3JZAHOW-LjhhJ-00.js";import{n as T}from"./DKTLEL5E-DciMwFJ1.js";import{t as E}from"./K3MD6TGW-DoqPvoaq.js";import{PeleError as D,_ as te}from"./lazy-C1dqAep6.js";var O=class{nodes=new Map;labels;links=[];trends=new Map;pipelines=new Map;annotations=[];notes=[];accelerators=[];deaccelerators=[];annotationsBox;axes={};size;addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label};this.nodes.set(e.id,{...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY}),this.labels=void 0}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){this.pipelines.get(e)?.componentIds.push(t);let n=this.nodes.get(t);n&&(n.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;if(!this.labels){this.labels=new Map;for(let[e,t]of this.nodes)this.labels.has(t.label)||this.labels.set(t.label,e)}return this.labels.get(e)??e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw new D(`Node "${t.label}" is missing coordinates`,`semantic`,{type:`wardley`});e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}};function k(e,t){let n=e<=1?e*100:e;if(n<0||n>100)throw new D(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`,`semantic`,{type:`wardley`});return n}function A(e,t,n){return{x:k(t,`${n} evolution`),y:k(e,`${n} visibility`)}}function j(e){return e===`+<>`?`bidirectional`:e===`+<`?`backward`:e===`+>`?`forward`:void 0}function ne(e){if(!e?.startsWith(`+`))return{};let t=e.indexOf(`'`,2),n=e[1]===`'`&&t!==-1?e.slice(2,t):void 0;return e.includes(`<>`)?{flow:`bidirectional`,label:n}:e.includes(`<`)?{flow:`backward`,label:n}:e.includes(`>`)?{flow:`forward`,label:n}:{label:n}}function M(e){return e?[(e.negX?-1:1)*e.offsetX,(e.negY?-1:1)*e.offsetY]:[void 0,void 0]}function re(e,t){e.size&&t.setSize(e.size.width,e.size.height),e.evolution&&t.setAxes({stages:e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),stageBoundaries:e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary)});for(let n of e.anchors){let e=A(n.visibility,n.evolution,`Anchor "${n.name}"`);t.addNode({id:n.name,label:n.name,x:e.x,y:e.y,className:`anchor`})}for(let n of e.components){let e=A(n.visibility,n.evolution,`Component "${n.name}"`),[r,i]=M(n.label);t.addNode({id:n.name,label:n.name,x:e.x,y:e.y,className:`component`,labelOffsetX:r,labelOffsetY:i,inertia:n.inertia,sourceStrategy:n.decorator?.strategy})}for(let n of e.notes){let e=A(n.visibility,n.evolution,`Note "${n.text}"`);t.addNote({text:n.text,x:e.x,y:e.y})}for(let n of e.pipelines){let e=t.getNode(n.parent);if(!e||typeof e.y!=`number`)throw new D(`Pipeline "${n.parent}" must reference an existing component with coordinates.`,`semantic`,{type:`wardley`});let r=e.y;t.startPipeline(n.parent);for(let e of n.components){let i=`${n.parent}_${e.name}`,[a,o]=M(e.label),s=k(e.evolution,`Pipeline component "${e.name}" evolution`);t.addNode({id:i,label:e.name,x:s,y:r,className:`pipeline-component`,labelOffsetX:a,labelOffsetY:o,inertia:void 0,sourceStrategy:void 0}),t.addPipelineComponent(n.parent,i)}}for(let n of e.links){let e=!!n.arrow&&(n.arrow.includes(`-.->`)||n.arrow.includes(`.-.`)),r=ne(n.arrow),i=j(n.fromPort)??j(n.toPort)??r.flow;t.addLink({source:t.resolveNodeId(n.from),target:t.resolveNodeId(n.to),dashed:e,label:r.label??n.linkLabel,flow:i})}for(let n of e.evolves){let e=t.getNode(n.component);e?.y!==void 0&&t.addTrend({nodeId:n.component,targetX:k(n.target,`Evolve target for "${n.component}"`),targetY:e.y})}if(e.annotations.length>0){let n=A(e.annotations[0].x,e.annotations[0].y,`Annotations box`);t.setAnnotationsBox(n.x,n.y)}for(let n of e.annotation){let e=A(n.x,n.y,`Annotation ${n.number}`);t.addAnnotation({number:n.number,coordinates:[{x:e.x,y:e.y}],text:n.text})}for(let n of e.accelerators){let e=A(n.x,n.y,`Accelerator "${n.name}"`);t.addAccelerator({name:n.name,x:e.x,y:e.y})}for(let n of e.deaccelerators){let e=A(n.x,n.y,`Deaccelerator "${n.name}"`);t.addDeaccelerator({name:n.name,x:e.x,y:e.y})}}function N(e,t){let n=new O;return re(e,n),{type:`wardley`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,...n.build()}}function P(e,t){let n=t;for(let t=e.charCodeAt(n);t>=48&&t<=57;t=e.charCodeAt(n))n++;return n}function F(){let e=0,t=0;return(n,r)=>{if((r<e||r>=t)&&(e=r,t=P(n,r)),t===r||n.charCodeAt(t)!==46)return-1;let i=P(n,t+1);return i>t+1?i:-1}}var I={name:`ARROW`,pattern:/->/y,first:`-`},L={name:`LINK_ARROW`,pattern:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/y,first:`->+`},R=(e,t)=>({name:e,pattern:new RegExp(t,`y`),first:t[0]}),z=[{name:`[`,pattern:`[`},{name:`,`,pattern:`,`},{name:`]`,pattern:`]`},{name:`@`,pattern:`@`},{name:`/`,pattern:`/`},{name:`(`,pattern:`(`},{name:`)`,pattern:`)`},{name:`-`,pattern:`-`,longer:[I,L,u]},{name:`{`,pattern:`{`},{name:`}`,pattern:`}`},{name:`WARDLEY_NUMBER`,pattern:/[0-9]+\.[0-9]+/y,first:`0123456789`,scanner:F},I,{name:`LINK_PORT`,pattern:/\+<>|\+>|\+</y,first:`+`},L,{name:`LINK_LABEL`,pattern:/;[^\n\r]+/y,first:`;`},{name:`STRATEGY`,pattern:/build|buy|outsource|market/y,first:`bom`},R(`KW_WARDLEY`,`wardley-beta`),R(`KW_SIZE`,`size`),R(`KW_EVOLUTION`,`evolution`),R(`KW_ANCHOR`,`anchor`),R(`KW_COMPONENT`,`component`),R(`KW_LABEL`,`label`),R(`KW_INERTIA`,`inertia`),R(`KW_EVOLVE`,`evolve`),R(`KW_PIPELINE`,`pipeline`),R(`KW_NOTE`,`note`),R(`KW_ANNOTATIONS`,`annotations`),R(`KW_ANNOTATION`,`annotation`),R(`KW_ACCELERATOR`,`accelerator`),R(`KW_DEACCELERATOR`,`deaccelerator`),{name:`NAME_WITH_SPACES`,pattern:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/y,first:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`},{name:`WS`,pattern:/[ \t]+/y,hidden:!0,first:` `},E(),f,l,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y,first:`0123456789`},o,{name:`ID`,pattern:/[\w]([-\w]*\w)?/y,first:`_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`},a,p,u,c,d];function B(a){let o=new i(s(a,z,`wardley`),z,`wardley`),c={$type:`Wardley`,anchors:[],components:[],links:[],evolves:[],pipelines:[],notes:[],annotations:[],annotation:[],accelerators:[],deaccelerators:[]},l=e=>o.kinds[o.i]===e,u=()=>l(36)||l(37)||l(30),d=()=>l(36)?n(o.take()):l(37)||l(30)?o.take():o.fail(`a name`),f=()=>Number(o.expect(10)),p=()=>parseInt(o.expect(35)),m=()=>l(10)?Number(o.take()):parseInt(o.expect(35)),h=()=>{if(!l(-1))for(l(38)||o.fail(`a line break or the end of input`);l(38);)o.i++},g=e=>{o.expect(0);let t=e();o.expect(1);let n=e();return o.expect(2),[t,n]},_=()=>{o.expect(21),o.expect(0);let e=o.accept(7),t=p();o.expect(1);let n=o.accept(7),r=p();return o.expect(2),{$type:`Label`,negX:e,offsetX:t,negY:n,offsetY:r}},v=()=>{let e={$type:`EvolutionStage`,name:d()};return o.accept(3)&&(e.boundary=f()),o.accept(4)&&(e.secondName=d()),e};for(;l(38);)o.i++;for(o.expect(16);!l(-1);)switch(o.kind){case 38:o.i++;break;case 32:c.accDescr=e(o.take()),h();break;case 33:c.accTitle=r(o.take()),h();break;case 34:c.title=t(o.take()),h();break;case 17:{o.i++;let[e,t]=g(p);h(),c.size={$type:`Size`,width:e,height:t};break}case 18:{o.i++;let e=[v()];for(o.expect(11),e.push(v());o.accept(11);)e.push(v());h(),c.evolution={$type:`Evolution`,stages:e};break}case 19:{o.i++;let e=d(),[t,n]=g(f);h(),c.anchors.push({$type:`Anchor`,name:e,visibility:t,evolution:n});break}case 20:{o.i++;let e={$type:`Component`,name:d(),visibility:0,evolution:0,inertia:!1};[e.visibility,e.evolution]=g(f),l(21)&&(e.label=_()),l(5)&&o.kinds[o.i+1]===15&&(o.i++,e.decorator={$type:`Decorator`,strategy:o.take()},o.expect(6)),o.accept(22)?e.inertia=!0:o.accept(5)&&(o.expect(22),o.expect(6),e.inertia=!0),h(),c.components.push(e);break}case 23:{o.i++;let e=d(),t=f();h(),c.evolves.push({$type:`Evolve`,component:e,target:t});break}case 24:{o.i++;let e=d();for(o.expect(8),o.expect(38);l(38);)o.i++;let t=[];do{o.expect(20);let e={$type:`PipelineComponent`,name:d(),evolution:0};o.expect(0),e.evolution=f(),o.expect(2),l(21)&&(e.label=_()),h(),t.push(e)}while(l(20));o.expect(9),h(),c.pipelines.push({$type:`Pipeline`,parent:e,components:t});break}case 25:{o.i++;let e=n(o.expect(36)),[t,r]=g(f);h(),c.notes.push({$type:`Note`,text:e,visibility:t,evolution:r});break}case 26:{o.i++;let[e,t]=g(m);h(),c.annotations.push({$type:`Annotations`,x:e,y:t});break}case 27:{o.i++;let e=p();o.expect(1);let[t,r]=g(m),i=n(o.expect(36));h(),c.annotation.push({$type:`Annotation`,number:e,x:t,y:r,text:i});break}case 28:case 29:{let e=o.kind===29;o.i++;let t=d(),[n,r]=g(f);h(),e?c.deaccelerators.push({$type:`Deaccelerator`,name:t,x:n,y:r}):c.accelerators.push({$type:`Accelerator`,name:t,x:n,y:r});break}default:{u()||o.fail(`a statement`);let e={$type:`Link`,from:d(),to:``};l(12)&&(e.fromPort=o.take()),(l(13)||l(11))&&(e.arrow=o.take()),e.to=d(),l(12)&&(e.toPort=o.take()),l(14)&&(e.linkLabel=o.take().substring(1).trim()),h(),c.links.push(e)}}return c}var ie=[`Genesis`,`Custom Built`,`Product`,`Commodity`],ae=48,V=6,H=10,oe=8,U=15,W=60,se=30,ce=20,G=`var(--_c)`,K=`var(--_l)`;function q(e,t,n,r,i){let a=e[`wardley-beta`]?.[t];return typeof a==`number`&&a>=r&&a<=i?a:n}function J(e,t,n){return e<t?t:e>n?n:e}function le(e,t,n,r){let i=v(e),a=``,o=n;for(let n of e.lines){let r=!0;for(let e of n){if(e.icon!==void 0)continue;let n=m(e.style&~i);a+=`<tspan${r?` x="${h(t)}" y="${h(o)}"`:``}${n}>${S(e.text)}</tspan>`,r=!1}o+=e.lineHeight}return a===``?``:`<text${x(r,i)} xml:space="preserve">${a}</text>`}function ue(e,t,n,r){return J(typeof t==`number`&&Number.isFinite(t)?t:q(e,n,r,1,1e6),200,1e4)-2*ae}function Y(e,t,n){let r=ue(t,e.size?.width,`width`,900);return T(n,r,160,(i,a)=>X(e,t,n,i,r,a))}function X(e,t,n,r,i,a){let o=n.fontSize??16,s=Math.round(o*.8125),c=Math.round(o*.6875),l=n.measurer??te(n.fontFamily),u=n.padding??8,d=ue(t,e.size?.height,`height`,600)*Math.max(.75,r/i),f=t[`wardley-beta`]?.showGrid===!0,p=0,m=0,v=r,x=d,S=(e,t,n,r)=>{e<p&&(p=e),t<m&&(m=t),n>v&&(v=n),r>x&&(x=r)},T=(e,t,r,i)=>(S(t-e.width/2,r-e.height/2,t+e.width/2,r+e.height/2),b(e,t,r,i,n.icons)),E=(e,t,n,r)=>(S(t,n-e.size,t+e.width,n-e.size+e.height+4),le(e,t,n,r)),D=(e,t,n=a?Math.max(64,Math.min(120,r/2)):4e3,i=0)=>ee(e,!1,l,t,n,i),O=e=>e/100*r,k=e=>d-e/100*d,A=e.axes.stages&&e.axes.stages.length>0?e.axes.stages:ie,j=e.axes.stageBoundaries,ne=j!==void 0&&j.length===A.length,M=``,re=``,N=d,P=0;if(A.forEach((e,t)=>{let n=ne?P:t/A.length,i=ne?J(j[t],0,1):(t+1)/A.length;P=i,t>0&&(M+=`<path class="pele-wardley-stage" d="M${h(n*r)},0V${h(d)}" stroke="var(--_b)" stroke-dasharray="4 4"/>`);let a=D(e,s,Math.max(48,Math.abs(i-n)*r-12));re+=T(a,(n+i)/2*r,d+8+a.height/2,` class="pele-wardley-stage-label" font-size="${s}" fill="var(--_m)"`),N=Math.max(N,d+8+a.height)}),f)for(let e=1;e<4;e++)M+=`<path class="pele-wardley-grid" d="M${h(r*e/4)},0V${h(d)}M0,${h(d*e/4)}H${h(r)}" stroke="var(--_b)" stroke-dasharray="2 6"/>`;M+=`<path class="pele-wardley-axis" d="M0,0V${h(d)}H${h(r)}" stroke="${K}"/>`;let F=D(e.axes.xLabel??`Evolution`,s),I=D(e.axes.yLabel??`Visibility`,s),L=` class="pele-wardley-axis-label" font-size="${s}" font-weight="var(--_hw)"`,R=T(F,r/2,N+6+F.height/2,L)+b(I,-16,d/2,`${L} transform="rotate(-90 -16 ${h(d/2)})"`);S(-16-I.height/2,0,0,0);let z=N+6+F.height+10,B=new Map;for(let t of e.nodes)B.set(t.id,{x:O(t.x),y:k(t.y),node:t});let ae=``,q=new Map;for(let t of e.pipelines){q.set(t.nodeId,new Set(t.componentIds));let e=[];for(let n of t.componentIds){let t=B.get(n);t&&e.push(t)}if(e.length===0)continue;e.sort((e,t)=>e.x-t.x);let n=e[0].x,r=e[e.length-1].x,i=e[0].y,a=i-2*V,o=B.get(t.nodeId);o&&(o.x=(n+r)/2,o.y=a-H/6),S(n-U,a,r+U,a+4*V),ae+=`<g class="pele-wardley-pipeline" data-id="${y(t.nodeId)}"><rect x="${h(n-U)}" y="${h(a)}" width="${h(r-n+2*U)}" height="${h(4*V)}" fill="var(--_s)" stroke="var(--_b)"${_}/>`+(e.length>1?`<path d="M${h(n)},${h(i)}H${h(r)}" stroke="${K}" stroke-dasharray="4 4"/>`:``)+`</g>`}let Y=new Map,X=(e,t,n)=>{let i=e.node;if(i.className===`anchor`){let e=Y.get(i);return e||Y.set(i,e=D(i.label,s,a?Math.max(64,r/2):4e3,1)),1/Math.hypot(t/(e.width/2+5),n/(s*.8))}return i.isPipelineParent?H/Math.SQRT2:i.sourceStrategy?2*V:V},Z=new Map,de=(e,t,n)=>{Math.abs(t)<.25||Math.abs(n)<.25||Z.set(e,(Z.get(e)??0)|(t>0?n<0?1:2:n<0?4:8))},fe=``;for(let t of e.links){let e=B.get(t.source),n=B.get(t.target);if(!e||!n||e===n||q.get(t.target)?.has(t.source))continue;let r=n.x-e.x,i=n.y-e.y,a=Math.hypot(r,i);if(a<.01)continue;let o=r/a,s=i/a,l=X(e,o,s),u=X(n,o,s);if(l+u>=a)continue;de(e,o,s),de(n,-o,-s);let d=e.x+o*l,f=e.y+s*l,p=n.x-o*u,m=n.y-s*u,g=``;(t.flow===`forward`||t.flow===`bidirectional`)&&(g+=w(`arrow_point`,p,m,o,s,K),p-=o*C(`arrow_point`),m-=s*C(`arrow_point`)),(t.flow===`backward`||t.flow===`bidirectional`)&&(g+=w(`arrow_point`,d,f,-o,-s,K),d+=o*C(`arrow_point`),f+=s*C(`arrow_point`));let _=``;if(t.label){let r=D(t.label,c+1,200),i=o>=0?1:-1,a=s*i,l=-o*i,u=5+Math.abs(a)*r.width/2+Math.abs(l)*r.height/2;_=T(r,(e.x+n.x)/2+a*u,(e.y+n.y)/2+l*u,` class="pele-edge-label" font-size="${c+1}" fill="var(--_m)"`)}fe+=`<g class="pele-edge${t.dashed?` pele-wardley-dashed`:``}" data-id="${y(t.source)}-${y(t.target)}"><path d="M${h(d)},${h(f)}L${h(p)},${h(m)}" stroke="${K}"${t.dashed?` stroke-dasharray="6 6"`:``}/>`+g+_+`</g>`}let pe=``;for(let t of e.trends){let e=B.get(t.nodeId);if(!e)continue;let n=O(t.targetX),r=k(t.targetY),i=n-e.x,a=r-e.y,o=Math.hypot(i,a),s=``,c=o>0?X(e,i/o,a/o):0;if(o>c+V+4){let t=i/o,l=a/o,u=n-t*(V+2),d=r-l*(V+2);s=`<path d="M${h(e.x+t*c)},${h(e.y+l*c)}L${h(u-t*C(`arrow_point`))},${h(d-l*C(`arrow_point`))}" stroke="${G}" stroke-dasharray="4 4"/>`+w(`arrow_point`,u,d,t,l,G)}S(n-V,r-V,n+V,r+V),pe+=`<g class="pele-wardley-trend" data-id="${y(t.nodeId)}">${s}<circle cx="${h(n)}" cy="${h(r)}" r="${V}" fill="var(--_bg)" stroke="${G}"/></g>`}let me=``,Q=1.2*V,he=.7*V;for(let e of B.values()){let t=e.node,{x:n,y:i}=e,o=t.className===`anchor`,c=t.sourceStrategy,l=``;if(c){let e=c===`outsource`?`var(--_m)`:c===`buy`?`var(--_a)`:c===`build`?`var(--_s)`:`var(--_bg)`;l+=`<circle class="pele-wardley-${c}" cx="${h(n)}" cy="${h(i)}" r="${2*V}" fill="${e}" stroke="${K}"/>`}if(c===`market`){let e=Q*Math.cos(Math.PI/6),t=i+Q*Math.sin(Math.PI/6);l+=`<path d="M${h(n)},${h(i-Q)}L${h(n-e)},${h(t)}H${h(n+e)}Z" fill="none" stroke="${K}"/>`;for(let[r,a]of[[n,i-Q],[n-e,t],[n+e,t]])l+=`<circle cx="${h(r)}" cy="${h(a)}" r="${h(he)}" fill="var(--_bg)" stroke="${K}"/>`}else t.isPipelineParent?l+=`<rect x="${h(n-H/2)}" y="${h(i-H/2)}" width="${H}" height="${H}" fill="var(--_bg)" stroke="${K}"/>`:o||(l+=`<circle cx="${h(n)}" cy="${h(i)}" r="${V}" fill="var(--_bg)" stroke="${K}"/>`);if(t.inertia===!0){let e=(t.isPipelineParent?H/2:V)+10+(c?V+4:0);l+=`<rect class="pele-wardley-inertia" x="${h(n+e)}" y="${h(i-V)}" width="4" height="${2*V}" fill="${K}"/>`}let u=t.labelOffsetX===void 0?void 0:J(t.labelOffsetX,-5e3,5e3),d=t.labelOffsetY===void 0?void 0:J(t.labelOffsetY,-5e3,5e3),f;if(o)f=T(Y.get(t)??D(t.label,s,a?Math.max(64,r/2):4e3,1),n+(u??0),i+(d??-3),` class="pele-label" font-size="${s}" font-weight="var(--_hw)"`);else{let r=D(t.label,s),a=` class="pele-label" font-size="${s}"`,o=oe+(c?10:0);if(u!==void 0||d!==void 0)f=E(r,n+(u??o),i+(d??-o),a);else if(t.inPipeline)f=T(r,n,i+2*V+4+r.height/2,a);else{let t=Z.get(e)??0,c=t&1?t&2?t&4?t&8?1:8:4:2:1,l=c===1||c===2,u=c===1||c===4;f=E(r,l?n+o:n-o-r.width,u?i-o:i+o+s*.75,a)}}S(n-2*V,i-2*V,n+2*V+20,i+2*V),me+=`<g class="pele-node pele-wardley-${o?`anchor`:t.isPipelineParent?`pipeline-parent`:t.inPipeline?`pipeline-component`:`component`}" data-id="${y(t.id)}">${l}${f}</g>`}let ge=``;for(let t of e.annotations){let e=D(String(t.number),c,4e3,1),n=``;for(let r of t.coordinates){let t=O(r.x),i=k(r.y),a=Math.max(10,e.width/2+4);S(t-a,i-a,t+a,i+a),n+=`<circle cx="${h(t)}" cy="${h(i)}" r="${h(a)}" fill="var(--_bg)" stroke="${K}"/>`+b(e,t,i,` font-size="${c}" font-weight="var(--_hw)"`)}ge+=`<g class="pele-wardley-annotation" data-id="${y(String(t.number))}">${n}</g>`}let _e=e.annotations.filter(e=>e.text).sort((e,t)=>e.number-t.number);if(_e.length>0){let t=_e.map(e=>D(`${e.number}. ${e.text}`,s,a?Math.max(80,r-20):320)),n=0,i=0;for(let e of t)n=Math.max(n,e.width),i+=e.height;n+=20,i+=14;let o=e.annotationsBox,c=o?J(O(o.x),0,Math.max(0,r-n)):0,l=o?J(k(o.y),0,Math.max(0,d-i)):z;S(c,l,c+n,l+i);let u=``,f=l+7;for(let e of t)u+=le(e,c+10,f+e.lineHeight/2+s*.35,` font-size="${s}"`),f+=e.height;ge+=`<g class="pele-wardley-annotations"><rect x="${h(c)}" y="${h(l)}" width="${h(n)}" height="${h(i)}" fill="var(--_bg)" stroke="var(--_b)"${_}/>${u}</g>`}let ve=``;for(let t of e.notes)ve+=E(D(t.text,s,Math.min(360,r*.6),1),O(t.x),k(t.y),` class="pele-wardley-note" font-size="${s}" font-weight="var(--_hw)"`);let ye=``,be=(e,t,n,r)=>{let i=O(t),a=k(n),o=se/2,s=r?i+W:i,l=r?i:i+W,u=r?i+W-ce:i+ce,d=`M${h(l)},${h(a-o)}H${h(u)}V${h(a-o-8)}L${h(s)},${h(a)}L${h(u)},${h(a+o+8)}V${h(a+o)}H${h(l)}Z`;S(i,a-o-8,i+W,a+o+8),ye+=`<g class="pele-wardley-${r?`accelerator`:`deaccelerator`}" data-id="${y(e)}"><path d="${d}" fill="var(--_s)" stroke="${K}"/>`+T(D(e,c+1,160,1),i+W/2,a+o+8+12,` font-size="${c+1}" font-weight="var(--_hw)"`)+`</g>`};for(let t of e.accelerators)be(t.name,t.x,t.y,!0);for(let t of e.deaccelerators)be(t.name,t.x,t.y,!1);let $=ee(e.title,!1,l,o,a?Math.max(80,r):4e3,1),xe=$.height>0?$.height+12:0,Se=Math.min(p,r/2-$.width/2),Ce=Math.max(v,r/2+$.width/2),we=u-Se,Te=u+xe-m,Ee=Math.ceil(Ce-Se+2*u),De=Math.ceil(x-m+xe+2*u),Oe=b($,we+r/2,u+$.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${h(we)},${h(Te)})"><g class="pele-wardley-frame" fill="none">${M}</g>`+re+R+ae+(fe?`<g class="pele-edges" fill="none">${fe}</g>`:``)+(pe?`<g class="pele-wardley-trends" fill="none">${pe}</g>`:``)+me+ge+ve+ye+`</g>`;return{svg:g(`wardley`,Ee,De,o,n,e,Oe),width:Ee,height:De,links:[]}}var Z={type:`wardley`,section:`wardley-beta`,parse:(e,t,n)=>N(B(e),n),render:Y};export{Z as wardley};
|
|
3
|
-
//# sourceMappingURL=USNYFO5S-
|
|
3
|
+
//# sourceMappingURL=USNYFO5S-_1m41tJt.js.map
|