@p4code/cli 0.8.35 → 0.8.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-26z5sNBT.mjs → binCli-mInzhqSL.mjs} +5 -5
- package/dist/client/.vite/manifest.json +2031 -2031
- package/dist/client/assets/{2NI2N5EU-BLnY4aCF.js → 2NI2N5EU-DVsZziQ3.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-BApNVkfU.js → 4UO7MD6I-Cs3yBe-m.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-Y7V7NdZO.js → 5B3SVYGG-CxW0L1iX.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-BSIhKcw-.js → 5GK6JWQ2-Cb25PEnx.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-CNUCnWLs.js → 5N7A7DKN-udLyT643.js} +2 -2
- package/dist/client/assets/{5OC2THR4-Bne-pf_A.js → 5OC2THR4-DqD-reis.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-7d4UMONz.js → 5S6HY5KT-Cy7mIKKq.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-BWW19n-D.js → 6IMQ5BUJ-Qu9PVsT7.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-CxTUuvA6.js → 6OLKWJ4F-BYzZS9mf.js} +2 -2
- package/dist/client/assets/{74OO7NKP-DByVTRKE.js → 74OO7NKP-h3ga2-vb.js} +2 -2
- package/dist/client/assets/{75O6YZUN-CZanyedf.js → 75O6YZUN-ByAK3P56.js} +2 -2
- package/dist/client/assets/{77XECAW3-TL2w7pHK.js → 77XECAW3-D_lZqaZv.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-CJboH7Uz.js → ABYRPUBD-BPWfXZyu.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +2 -0
- package/dist/client/assets/{AnimatedHeight-OxEbW01v.js → AnimatedHeight-D0-6CAPr.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-KQXgPV4i.js → AuthSurfaceShell-30QvY1bI.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-BxW-R2h1.js → BB2UYUI2-CGgafKC2.js} +2 -2
- package/dist/client/assets/{BUM34MOA-ngG-irUy.js → BUM34MOA-Cn4iaSBT.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-C-u-W0bS.js → CEQABKGZ-CmBEfzh3.js} +2 -2
- package/dist/client/assets/{CXAC5362-DfFRkI7L.js → CXAC5362-xibpmz3Y.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-C3KgGt4z.js → ChatGptUsageButton-DU3PVHJW.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-9gWM0ED9.js → ChatMarkdown-D-cNSjFn.js} +5 -5
- package/dist/client/assets/{CheckboxIndicator-DbU3csPQ.js → CheckboxIndicator-CZCy38xt.js} +2 -2
- package/dist/client/assets/{ClippedText-CS_BYNco.js → ClippedText-D_rM_XDj.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-CNbTXxKb.js → CodexSetupSection.logic-g6_GE4bw.js} +2 -2
- package/dist/client/assets/{ComboboxClear-Bn_kslrf.js → ComboboxClear-tOmMpuVi.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-fL8lMA25.js → ComboboxGroupLabel-CgZZIHwV.js} +2 -2
- package/dist/client/assets/{CommandBlock-DcQXu_lq.js → CommandBlock-6rjypfVF.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-DQ9wFfKn.js → ComposerPromptEditor-Dxfhec2W.js} +4 -4
- package/dist/client/assets/{CompositeRoot-BuwzXGHT.js → CompositeRoot-Bsb8efI6.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-DGbJY7Hw.js → ConnectionDiagnosisDetails-Q0M5gCCf.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-CixsTBXI.js → ConnectionStatusDot-DAuD0jkU.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-Cbb71R0Y.js → DRLTVNUE-BVseXOzv.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-BZn5fuF5.js → DYY6UVD2-Bz33D3dq.js} +2 -2
- package/dist/client/assets/{DevicePanel-JP__PY1s.js → DevicePanel-CsSQr7vQ.js} +2 -2
- package/dist/client/assets/{DeviceSetup-D8qb_qBj.js → DeviceSetup-Cl7L9wsi.js} +2 -2
- package/dist/client/assets/{DialogTitle-B_9LEmy3.js → DialogTitle-bcvBtKP-.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-WMKzOwCh.js → DiffCommentAnnotation-bhzNqujM.js} +2 -2
- package/dist/client/assets/{DiffFileTree-BSbsOOmA.js → DiffFileTree-BySeJqhq.js} +2 -2
- package/dist/client/assets/{DiffPanel-BWFuiHvv.js → DiffPanel-CCFas4eA.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BBk0lIX3.js → DiffWorkerPoolProvider-CkkqWbz-.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-D5YUndkh.js → EmbeddedDesign-iuThcPT3.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-Dpgx67FY.js → EnvironmentMachineIcon-iUmoTUYt.js} +2 -2
- package/dist/client/assets/{ExpandableText-Cpm1gOKG.js → ExpandableText-ByCx68yv.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-BkEIrB0k.js → FNOVOB4O-DK3iet1g.js} +2 -2
- package/dist/client/assets/{FieldControl-BHe6unoZ.js → FieldControl-DtsEariK.js} +2 -2
- package/dist/client/assets/{FileDiff-C1vAOUga.js → FileDiff-Bu2BSqBV.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-CbpNevZP.js → FilePreviewPanel-8cI8gciT.js} +2 -2
- package/dist/client/assets/{FoldedSettingsSection-DySTg20x.js → FoldedSettingsSection-RYq8GTvV.js} +2 -2
- package/dist/client/assets/{FormContext-CmvUzTS-.js → FormContext-CIK8MKa2.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-CN-ckGDk.js → HDGCDEEZ-B_J1N6RY.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-B0BvmnZE.js → HSJLKHB7-B2SbZQUf.js} +2 -2
- package/dist/client/assets/{Icons-B4l3TqYa.js → Icons-xsXA_L6w.js} +2 -2
- package/dist/client/assets/Input-D3Qi4jCN.js +2 -0
- package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +1 -0
- package/dist/client/assets/{K3MD6TGW-IS0rWO1U.js → K3MD6TGW-VU68yYxr.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-DcqjCOJO.js → K7RP3OMA-zaD_NBVC.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-mF9mJWrc.js → KeybindingsSettings.logic-BJe27xmi.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-CLMgIt4Y.js → LHDIQX7Q-DCLqoRGy.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-B1dkmN_M.js → LUXOKEGN-CmxZpSzC.js} +2 -2
- package/dist/client/assets/{MathTypeset-qeRVy_bc.js → MathTypeset-Hhqwg4PF.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-C6sq5aqx.js → N3JZAHOW-Cev8Cn9M.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-BG7xJ_qe.js → NUIALGQ3-CV92Kt25.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-B0KzU91d.js → NoProjectsHero-CMqIlSNl.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-BEfVfDlS.js → O65XPQGZ-bGyTGMsB.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-BUiRjV87.js → O7XIQ6OM-DVdEfB1N.js} +2 -2
- package/dist/client/assets/{OFQON5FD-DTgVPbd-.js → OFQON5FD-Ca_CNS26.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-C4KYM5XU.js → P4ConnectAccountPages-Buss2oTL.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-DNPUNJl_.js → P4ConnectSidebarSignIn-D1n4y6Gq.js} +2 -2
- package/dist/client/assets/{PJQHF43J-QRnhQpHu.js → PJQHF43J-B__IdKwP.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-4VFKEoHg.js → PanelLayoutControls-EIunk_2Q.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-DeI-j_7w.js → PierreEntryIcon-GQImyog1.js} +2 -2
- package/dist/client/assets/{PopoverHandle-DMB4QSp6.js → PopoverHandle-Cj5egwXv.js} +2 -2
- package/dist/client/assets/{PreviewPanel-CO66mekh.js → PreviewPanel-BkFeksTl.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-BF-iyQ8T.js → ProjectDefaultsSettings-DX2Kf-tx.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-_6hkSNzm.js → ProjectFavicon-OMOnEzVu.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-DeL1rZxy.js → ProjectIconPickerDialog-Q4GkqwDs.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Cn4l-YGU.js → ProjectMonogram-Br5sgd24.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-qGeMxZDy.js → ProviderAuthTerminal-Q584HoOn.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DJQYH_Pp.js → ProviderModelPicker-JNM9nJs_.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-BSVuPnR0.js → ProviderSettingsForm-CdiKhrJE.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-0OaJE6XS.js → PullRequestCodeTab-Co76Qf6Z.js} +2 -2
- package/dist/client/assets/{RHNBAITX-ChqB7inB.js → RHNBAITX-Oryl0UiR.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-B08Wms4m.js → ReadOnlySourcePreview-aUjexBVb.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BsOuLEci.js → RenderErrorBoundary-Oe5BzG3n.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-IkYRGtTH.js → SLD4V6NK-DbsINoTD.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-1UDkELZo.js → ScheduledTasksSettings-1uXNtcPA.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-Bhp6-hCj.js → ScopedSwitch-D8-FelRH.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-BPMuWLbs.js → ScrollAreaCorner-nnFi-Ecx.js} +2 -2
- package/dist/client/assets/{SecretInput-RlOzrLKL.js → SecretInput-CqAhFuNO.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-6kh66YCd.js → SelectScrollUpArrow-BQJrvk31.js} +2 -2
- package/dist/client/assets/{SettingsPanels-BfBUSBAG.js → SettingsPanels-CNgY_ZPe.js} +4 -4
- package/dist/client/assets/{SettingsPanels.logic-BsFZYDgm.js → SettingsPanels.logic-Dr_NyHjE.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-H7UzC9bb.js → SettingsScopeNotice-BFxCBOnl.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-BxaunvVy.js → T3PCR2KE-2R1FY5zG.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-DFURsfqA.js → TKWO2OVW-BjhIZzCe.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-CIukdyLy.js → TSHNXIZL-B_cvoUct.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-otrA-nTg.js → ThemeEditorPanel-B7MiqZ90.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-BQKZCFAC.js → ThreadTerminalDrawer-DHoyxd6-.js} +2 -2
- package/dist/client/assets/{TooltipViewport-ZmVCer7P.js → TooltipViewport-ThbbZQDo.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-CfqCotH2.js → UQJE5E4I-2r98lr05.js} +2 -2
- package/dist/client/assets/{USNYFO5S-CctAAheU.js → USNYFO5S-CvTI5t_o.js} +2 -2
- package/dist/client/assets/{Virtualizer-CImHNxBq.js → Virtualizer-BgcEI5KE.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-DS9YO9IT.js → WEVWDWVA-U7ygIdf3.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-BW_omYU1.js → WorkspaceBreadcrumb-_zND61qF.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-BS8FWt_4.js → WorkspacePageContainer-LYv_7Qc0.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-CE_94tTR.js → WorkspacePageHeader-B_0ute56.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-B0KbwoE1.js → X5RFHQXM-D4S0_b0W.js} +2 -2
- package/dist/client/assets/{X62E3GBT-wpz8X9Yh.js → X62E3GBT-CrIC4h9P.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-DFRK5c6Y.js → XBNEOJTC-D2_RQZjM.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-1NnqTTZ2.js → YHV2MVVZ-BmAcJLBt.js} +2 -2
- package/dist/client/assets/{YURCZMG2-rnzWY5ij.js → YURCZMG2-RCCTu3bv.js} +2 -2
- package/dist/client/assets/{YVG2LODB-Dxuuk2M-.js → YVG2LODB-Cvp0Ei-1.js} +2 -2
- package/dist/client/assets/{_chat-1QGQLbCc.js → _chat-CwO3_WVM.js} +5 -5
- package/dist/client/assets/{_chat.design-z2pu_9A5.js → _chat.design-DX1VqYkX.js} +2 -2
- package/dist/client/assets/{_chat.index-D8X9o5jY.js → _chat.index-Dzh3d42S.js} +2 -2
- package/dist/client/assets/{_chat.new-CGJw8cpo.js → _chat.new-BHRvXFPr.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-BfW9qMU1.js → _chat.pull-requests-BZilN1TK.js} +2 -2
- package/dist/client/assets/{alert-DO06etEs.js → alert-BN-r9V4f.js} +2 -2
- package/dist/client/assets/{assetUrls-CmOUMX2M.js → assetUrls-B6vsSVWR.js} +2 -2
- package/dist/client/assets/{assets-aBpLf8r4.js → assets-CID0y4Uv.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-tYgeZygn.js → browserHistoryStore-CK4YsfkQ.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CQFfJKWJ.js → browserLinkTarget-BJ30b4-s.js} +2 -2
- package/dist/client/assets/{checkbox-BEQFb7GO.js → checkbox-BJhN1L_L.js} +2 -2
- package/dist/client/assets/{color-picker-CXfnfmuH.js → color-picker-D2LwMwlZ.js} +2 -2
- package/dist/client/assets/{combobox--XoXA5uu.js → combobox-Cw2-7qyI.js} +2 -2
- package/dist/client/assets/{command-E2aLhsct.js → command-BIELTYJu.js} +2 -2
- package/dist/client/assets/{composer-logic-BPTz1APL.js → composer-logic-P-jVPXi4.js} +2 -2
- package/dist/client/assets/{composerDraftUploads-b_0oxKs9.js → composerDraftUploads-S66xDlS0.js} +2 -2
- package/dist/client/assets/{connect-CU9dNvTt.js → connect-D4llmZsa.js} +2 -2
- package/dist/client/assets/{connect-agent-Byc9PCdW.js → connect-agent-BlR0FAbF.js} +2 -2
- package/dist/client/assets/{design-CoGbXd61.js → design-Cdl1XCBU.js} +2 -2
- package/dist/client/assets/{device-DmH6IHQ4.js → device-Bc5H3PTz.js} +2 -2
- package/dist/client/assets/{dialog-CBBxT1gk.js → dialog-BRtKKGzk.js} +2 -2
- package/dist/client/assets/{diffRendering-BOVFJuWd.js → diffRendering-DtBTalAD.js} +2 -2
- package/dist/client/assets/{dist-B2P3f-0Q.js → dist-oE_MNxpZ.js} +3 -3
- package/dist/client/assets/{draft-input-CSOOVntS.js → draft-input-vviXwx5Q.js} +2 -2
- package/dist/client/assets/{duoViewer-BhHYrurM.js → duoViewer-kcp00m8a.js} +2 -2
- package/dist/client/assets/{dynamic-BhzrutAo.js → dynamic-C8_ODyue.js} +2 -2
- package/dist/client/assets/{embeddedScripts-43_R83vp.js → embeddedScripts-skldQmE1.js} +2 -2
- package/dist/client/assets/{empty-FOL5U4KY.js → empty-rC3eYvxq.js} +2 -2
- package/dist/client/assets/{entities-Bqo0n1Pb.js → entities-B8Vupv5g.js} +2 -2
- package/dist/client/assets/{fileLinks-D4GSqJYj.js → fileLinks-BoyzENAX.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-BBT5F8P1.js → fileTreeExpansion-DndrZZAD.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CGw09SPI.js → getDiffFileInput-C1QBFdFu.js} +2 -2
- package/dist/client/assets/{guideRunStore-DvIkVECt.js → guideRunStore-BgFFILxA.js} +2 -2
- package/dist/client/assets/{htmlRender-CmEeFzCo.js → htmlRender-ddkOIEbT.js} +2 -2
- package/dist/client/assets/{index-B1djVqM4.js → index-BwdieRvq.js} +3 -3
- package/dist/client/assets/{input-ekYqAkUx.js → input-BYd74ook.js} +2 -2
- package/dist/client/assets/{input-group-C3pxk97H.js → input-group-DMFlSk_7.js} +2 -2
- package/dist/client/assets/{kbd-3FPzNikV.js → kbd-rp5mX21h.js} +2 -2
- package/dist/client/assets/{keybindings-B3oDRRkK.js → keybindings-B_kRk5Fi.js} +2 -2
- package/dist/client/assets/{lazy-DyNR0b0B.js → lazy-CeaQ3-Fj.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-BPxq_G_s.js → lazyRouteComponent-COYyJY2H.js} +2 -2
- package/dist/client/assets/{link-B3B5a5Ju.js → link-CsXnX9WM.js} +2 -2
- package/dist/client/assets/{linkedPrompt-BsCPMHxQ.js → linkedPrompt-B5iI7U8H.js} +2 -2
- package/dist/client/assets/{main-BWh6jqG2.js → main-VfCRP294.js} +7 -7
- package/dist/client/assets/{mediaReference-Bb8H-qbI.js → mediaReference-ZW7gfO5X.js} +2 -2
- package/dist/client/assets/{mediaSource-C2MsZgy8.js → mediaSource-DsT6G6Wm.js} +2 -2
- package/dist/client/assets/{number-field-SoHEiP55.js → number-field-CEA6qXbs.js} +2 -2
- package/dist/client/assets/{observeResize-3Vj9DYOV.js → observeResize-DSyLC8QK.js} +2 -2
- package/dist/client/assets/{onboarding-CPgiVEVK.js → onboarding-BPkAEHBV.js} +2 -2
- package/dist/client/assets/{openFileInPreview-BBWCOLh_.js → openFileInPreview-CGM83ICx.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-qmvlbzKv.js → p4ProjectFile-CwpteA7b.js} +2 -2
- package/dist/client/assets/{pair-CZnRGdd8.js → pair-D9v8gc0o.js} +2 -2
- package/dist/client/assets/{pendingSendStore-L5KquCDf.js → pendingSendStore-BuEVrrEM.js} +2 -2
- package/dist/client/assets/{phoneViewer-D-8v-sMf.js → phoneViewer-CNE0SVmy.js} +2 -2
- package/dist/client/assets/{pierre-icons-jwqMPUxD.js → pierre-icons-ChDlOt-h.js} +2 -2
- package/dist/client/assets/{popover-OfG3wVsl.js → popover-BjUpdrKu.js} +2 -2
- package/dist/client/assets/{preview-BYnEURcB.js → preview-3EscFepc.js} +2 -2
- package/dist/client/assets/{preview-DGdQ5Ycc.js → preview-DHLYKEKb.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-Dlbj5KrZ.js → previewMiniPlayerStore-DHjQeV1U.js} +2 -2
- package/dist/client/assets/{primary-B47ivN3o.js → primary-NcsmRI6j.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-CreqR0gU.js → primaryCloudLinkState-DkXIVBHW.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-CanWrACx.js → projectFilesQueryState-0jxJ50Qq.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-gWuw6vwd.js → projectScriptEditor-CMGXoIEJ.js} +2 -2
- package/dist/client/assets/{providerSkills-C_Rxqah9.js → providerSkills-4hnESoi_.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-RASi2EgP.js → pullRequestDetail.logic-sbOM8yDW.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-ucGaXXG7.js → pullRequestIcons-B7Om_B_D.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CEr41DEl.js → pullRequestReviewStore-CIL8WfOG.js} +2 -2
- package/dist/client/assets/{pullRequests-Bw3Ui6hK.js → pullRequests-CMTRCOu7.js} +2 -2
- package/dist/client/assets/{queries-EslKFJTV.js → queries-hhl_J8u9.js} +2 -2
- package/dist/client/assets/{query-d1pQlqP0.js → query-CfGzD8v6.js} +2 -2
- package/dist/client/assets/{radio-group-Ciy_K5uE.js → radio-group-up2QNXjf.js} +2 -2
- package/dist/client/assets/{renderScheduler-CP-JkmKx.js → renderScheduler-Dgqqs-EX.js} +2 -2
- package/dist/client/assets/{rightPanelStore-D3KOmuPa.js → rightPanelStore-CGF0-d-1.js} +2 -2
- package/dist/client/assets/{runtime-d6B1vJeH.js → runtime-Ca_Z-vg5.js} +3 -3
- package/dist/client/assets/{runtime-DR7JxgbQ.js → runtime-OeWFs5Hf.js} +3 -3
- package/dist/client/assets/{runtimeModeConfig-Rxeb1uGg.js → runtimeModeConfig-BTG9FTYe.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-CVIC4Kpr.js → scheduledTasksSettings.logic-BeuOnCov.js} +2 -2
- package/dist/client/assets/{scroll-area-yyfi3ycu.js → scroll-area-BNQKEZbp.js} +2 -2
- package/dist/client/assets/{select-DaYjjw1q.js → select-D_zHR42Y.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-1XIHD-7i.js → selfImproveFindings-CAZ0j1GD.js} +2 -2
- package/dist/client/assets/{server-sXApTCjZ.js → server-6nKYyc8r.js} +2 -2
- package/dist/client/assets/{session-C949OsEI.js → session-BxUdP61p.js} +2 -2
- package/dist/client/assets/{session-logic-DkSfwnHl.js → session-logic-Dr1plzXe.js} +2 -2
- package/dist/client/assets/{settings-B0O54Q3P.js → settings-DE_hSu0q.js} +2 -2
- package/dist/client/assets/{settings.appearance-BesXhA1a.js → settings.appearance-C--uy4It.js} +2 -2
- package/dist/client/assets/settings.archived-D-55XnxQ.js +2 -0
- package/dist/client/assets/{settings.computer-use-BeKmLbNe.js → settings.computer-use-DhnqPqMm.js} +2 -2
- package/dist/client/assets/{settings.connections-D1UxckE0.js → settings.connections-BPVLazeK.js} +2 -2
- package/dist/client/assets/{settings.data-controls-lPiIwMgc.js → settings.data-controls-CIzGvqCI.js} +2 -2
- package/dist/client/assets/{settings.decisions-D97jIUyr.js → settings.decisions-CU-6rIpn.js} +2 -2
- package/dist/client/assets/{settings.designs-B473PRvt.js → settings.designs-DHYhhG4k.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-DDOaOIDg.js → settings.diagnostics-csgW1_E8.js} +2 -2
- package/dist/client/assets/{settings.general-qzEOE2zF.js → settings.general-CeBkrL9-.js} +2 -2
- package/dist/client/assets/{settings.integrations-D6ctQ9WI.js → settings.integrations-DqSYBosl.js} +2 -2
- package/dist/client/assets/{settings.keybindings-BL57H4sD.js → settings.keybindings-C7D1i238.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-DaS82UhN.js → settings.open-source-licenses-6oFDgAt7.js} +2 -2
- package/dist/client/assets/{settings.plugins-DnS3RrT2.js → settings.plugins-DfM65Xio.js} +2 -2
- package/dist/client/assets/{settings.projects-D-ZICXey.js → settings.projects-CeoZzdMW.js} +3 -3
- package/dist/client/assets/{settings.providers-CFpCmv0o.js → settings.providers-BBgppyE3.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-IEAC3STn.js → settings.scheduled-tasks-Csi8wfij.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-BaOFk9WR.js → settings.snap-shot-BdVdSIJy.js} +2 -2
- package/dist/client/assets/{settings.source-control-BW16AA5z.js → settings.source-control-Bme3qg7j.js} +2 -2
- package/dist/client/assets/{settings.storage-D4vBYBRP.js → settings.storage-DTcg-0aj.js} +2 -2
- package/dist/client/assets/{settingsLayout-CFQx1XDM.js → settingsLayout-4ySvFdXb.js} +2 -2
- package/dist/client/assets/{sidebar-C1E4GqL6.js → sidebar-CHDwV4Ca.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-9cUrCOXH.js → sidebarProjectGrouping-BcOVY8p-.js} +2 -2
- package/dist/client/assets/{skeleton-BCpBrYxh.js → skeleton-BcLPbojY.js} +2 -2
- package/dist/client/assets/{sourceControl-DwJWPP0h.js → sourceControl-CPrl7cyO.js} +2 -2
- package/dist/client/assets/{sourceControlClients-BBJW7ra4.js → sourceControlClients-oNOd36Cq.js} +2 -2
- package/dist/client/assets/{spinner-CSTrcxhP.js → spinner-_ourbdVb.js} +2 -2
- package/dist/client/assets/{terminal-links-D18LpQ1T.js → terminal-links-DuZi4b83.js} +2 -2
- package/dist/client/assets/{terminalSessions-C2NUFncF.js → terminalSessions-D0vbdqqx.js} +2 -2
- package/dist/client/assets/{textarea-R4UQ47Ns.js → textarea-DlXXDHPJ.js} +2 -2
- package/dist/client/assets/{themePalette-neUNWCzK.js → themePalette-VIM7Gehx.js} +2 -2
- package/dist/client/assets/{toast-B84QdqqM.js → toast-DXWclCrr.js} +2 -2
- package/dist/client/assets/{toggle-BH5BGBcD.js → toggle-Dofc34s2.js} +2 -2
- package/dist/client/assets/{toggle-group-Di3SFV73.js → toggle-group-CYKsfBbD.js} +2 -2
- package/dist/client/assets/{tooltip-D-GRl-oZ.js → tooltip-CY3W5y-f.js} +2 -2
- package/dist/client/assets/{uiStateStore-xSkh4_PU.js → uiStateStore-CdkBStdp.js} +2 -2
- package/dist/client/assets/{usage-DUdXloVo.js → usage-DQcgd75_.js} +2 -2
- package/dist/client/assets/{usageAccess-DSLF-sRE.js → usageAccess-CCSxXl9X.js} +2 -2
- package/dist/client/assets/{usageFormat-Bzyvr9m4.js → usageFormat-ByjmRjTe.js} +2 -2
- package/dist/client/assets/{usageShortcuts-D6nQeRtx.js → usageShortcuts-DOWm0Vo9.js} +2 -2
- package/dist/client/assets/{use-atom-command-DA6OG-Qk.js → use-atom-command-vqjL7n-x.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-PLuOxvFb.js → useAriaLabelledBy-B7FNFpmO.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-Dm0SCq59.js → useHandleNewThread-BYNZXzR_.js} +2 -2
- package/dist/client/assets/{useLocation-Bqc94klS.js → useLocation-B_XV0lDx.js} +2 -2
- package/dist/client/assets/{useNavigate-DdjG4MB_.js → useNavigate-BWqAWfiZ.js} +2 -2
- package/dist/client/assets/{useNavigateBack-sP0LsL3p.js → useNavigateBack-C52nbvbb.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-C9d7n33S.js → useP4ConnectAuthPrompt-DKhdNYj8.js} +2 -2
- package/dist/client/assets/{useParams-DZQvRQLJ.js → useParams-ekGanxxb.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BzfAUU9X.js → usePermissionStatus-CWV_yoZe.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-DIjGLg1E.js → usePullRequestActions-DxtkLQ5D.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-CyBVe0G0.js → useRegisterFieldControl-BAJIcFiO.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-D4n22Nmm.js → useScopedModelAvailability-815e0x20.js} +2 -2
- package/dist/client/assets/{useSettings-CaJMqrvF.js → useSettings-gPlpTIWi.js} +2 -2
- package/dist/client/assets/{utils-BoMYW9A3.js → utils-DhUt689t.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-w_CQ3i43.js → vcsRefInvalidation-CW_MIqdt.js} +2 -2
- package/dist/client/assets/{welcome-BIKH3rbU.js → welcome-k7S47hyM.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-CveKT929.mjs → renderer-Ay-1ojn7.mjs} +2 -2
- package/dist/{runtime-DGGSjC6Q.mjs → runtime-bP6MSuMS.mjs} +3 -1
- package/package.json +2 -2
- package/dist/client/assets/AlertDialogRoot-9jRALQXL.js +0 -2
- package/dist/client/assets/Input-Cv-TKh6s.js +0 -2
- package/dist/client/assets/JZOYTAAL-CB_B_Rei.js +0 -1
- package/dist/client/assets/settings.archived-FtcZf_Ug.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./jsx-runtime-BnjsACtP.js";import{Bi as r,Br as i,Ca as a,Ci as o,Co as s,Dr as c,Fi as l,Fr as u,Ha as d,Ii as f,Ka as p,Ki as m,Kr as h,Li as g,Lr as _,Mo as v,Mr as y,Ni as b,Oo as x,Pi as S,Pr as C,Ri as w,Sa as T,Si as E,To as D,Tr as O,Ui as k,Va as A,_i as j,bi as M,bo as N,ci as P,eo as F,fi as I,gi as L,hi as R,ia as z,ii as B,ja as V,ji as H,jr as U,ka as W,kr as G,mi as K,mo as q,pi as J,ri as ee,si as te,vi as ne,vr as re,wa as ie,wi as ae,wo as Y,xi as oe,xo as se,ya as ce,yi as le,yo as ue,za as de,zi as fe}from"./utils-BoMYW9A3.js";import{J as pe}from"./TooltipViewport-ZmVCer7P.js";var X=e(t()),me=X.createContext(void 0);function Z(e){let t=X.useContext(me);if(t===void 0&&!e)throw Error(v(47));return t}var he=e(ie());function ge(){return{...I(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var _e={...K,disabled:H(e=>e.disabled),instantType:H(e=>e.instantType),openMethod:H(e=>e.openMethod),openChangeReason:H(e=>e.openChangeReason),modal:H(e=>e.modal),focusManagerModal:H(e=>e.focusManagerModal),stickIfOpen:H(e=>e.stickIfOpen),titleElementId:H(e=>e.titleElementId),descriptionElementId:H(e=>e.descriptionElementId),openOnHover:H(e=>e.openOnHover),closeDelay:H(e=>e.closeDelay),hasViewport:H(e=>e.hasViewport)},ve=class e extends ae{constructor(e,t,n=!1){let r={...ge(),...e},i=new R;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=J(i,t,n),super(r,{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:X.createRef(),beforeContentFocusGuardRef:X.createRef(),stickIfOpenTimeout:new ce,triggerElements:i},_e)}setOpen=(e,t)=>{let n=t.reason===q,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)};let a=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&a!=null&&(t.trigger=this.context.triggerElements.getById(a)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let n={open:e,openChangeReason:t.reason};j(n,e,t.trigger),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),he.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=E(t,(t,r)=>new e(n,t,r));return X.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()},Q=e(n());function ye({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:l,defaultTriggerId:u=null}=e,d=ve.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:u,triggerIdProp:l});c(()=>{n===void 0&&d.state.open===!1&&r===!0&&d.update({open:!0,activeTriggerId:u})}),d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),m=d.useState(`payload`),h=fe()!=null;d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),oe(d,f),ne(d);let{forceUnmount:g}=le(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o,nested:h}),X.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let _=X.useCallback(()=>{d.setOpen(!1,W(F))},[d]);X.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:_}),[g,_]);let v=f||p,y=X.useMemo(()=>({store:d}),[d]);return(0,Q.jsxs)(me.Provider,{value:y,children:[v&&(0,Q.jsx)(xe,{store:d,modal:o}),typeof t==`function`?t({payload:m}):t]})}function be(e){return Z(!0)?(0,Q.jsx)(ye,{props:e}):(0,Q.jsx)(g,{children:(0,Q.jsx)(ye,{props:e})})}function xe({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=b(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference??x,a=r.trigger??x,o=X.useMemo(()=>D(L,r.floating),[r.floating]);return M(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:o}),null}var Se=X.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Z(!0),g=c?.store??h?.store;if(!g)throw Error(v(74));let _=V(p),y=g.useState(`isTriggerActive`,_),b=g.useState(`floatingRootContext`),x=g.useState(`isOpenedByTrigger`,_),C=g.useState(`triggerPopupId`,_),w=X.useRef(null),{registerTrigger:T,isMountedByThisTrigger:E}=o(_,w,g,{payload:l,disabled:a,openOnHover:u,closeDelay:f}),D=g.useState(`openChangeReason`),A=g.useState(`stickIfOpen`),j=g.useState(`openMethod`),M=g.useState(`focusManagerModal`),P=te(b,{enabled:b!=null&&u&&(j!==`touch`||D!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:B(),restMs:d,delay:{close:f},triggerElementRef:w,isActiveTrigger:y,isClosing:()=>g.select(`transitionStatus`)===`ending`}),F=S(b,{enabled:b!=null,stickIfOpen:A}),I=O(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),L=g.useState(`triggerProps`,E),{getButtonProps:R,buttonRef:H}=de({disabled:a,native:s}),U={open(e){return e&&D===`trigger-press`?N.open(e):se.open(e)}},{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:K}=re(g,w),q=Y(`button`,e,{state:{disabled:a,open:x},ref:[H,t,T,w],props:[F.reference,P,L,I,{[k]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":C},m,R],stateAttributesMapping:U});return E&&!M?(0,Q.jsxs)(X.Fragment,{children:[(0,Q.jsx)(z,{ref:W,onFocus:G}),(0,Q.jsx)(X.Fragment,{children:q},_),(0,Q.jsx)(z,{ref:g.context.triggerFocusTargetRef,onFocus:K})]}):(0,Q.jsx)(X.Fragment,{children:q},_)}),Ce=X.createContext(void 0);function we(){let e=X.useContext(Ce);if(e===void 0)throw Error(v(45));return e}var Te=X.forwardRef(function(e,t){let{keepMounted:n=!1,...i}=e,{store:a}=Z();return a.useState(`mounted`)||n?(0,Q.jsx)(Ce.Provider,{value:n,children:(0,Q.jsx)(r,{ref:t,...i})}):null}),Ee=X.createContext(void 0);function De(){let e=X.useContext(Ee);if(!e)throw Error(v(46));return e}var Oe=X.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:o,positionMethod:s=`absolute`,side:c=`bottom`,align:l=`center`,sideOffset:d=0,alignOffset:p=0,collisionBoundary:h=`clipping-ancestors`,collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:x=!1,collisionAvoidance:S=m,...T}=e,{store:E}=Z(),D=we(),O=w(),k=E.useState(`floatingRootContext`),j=E.useState(`mounted`),M=E.useState(`open`),N=E.useState(`openChangeReason`),P=E.useState(`activeTriggerElement`),F=E.useState(`modal`),I=E.useState(`openMethod`),L=E.useState(`positionerElement`),R=E.useState(`instantType`),z=E.useState(`transitionStatus`),B=E.useState(`hasViewport`),V=X.useRef(null),H=a(L,!1,!1),W=C({anchor:o,floatingRootContext:k,positionMethod:s,mounted:j,side:c,sideOffset:d,align:l,alignOffset:p,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:x,keepMounted:D,nodeId:O,collisionAvoidance:S,adaptiveOrigin:B?u:void 0}),K=k.useState(`domReferenceElement`);A(()=>{let e=K,t=V.current;if(e&&(V.current=e),t&&e&&e!==t){E.set(`instantType`,void 0);let e=new AbortController;return H(()=>{E.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[K,H,E]),G(M&&F===!0&&N!==`trigger-hover`,I===`touch`,L,P);let q=X.useCallback(e=>{E.set(`positionerElement`,e)},[E]),J={open:M,side:W.side,align:W.align,anchorHidden:W.anchorHidden,instant:R},ee=U(e,J,{styles:W.positionerStyles,transitionStatus:z,props:T,refs:[t,q],hidden:!j,inert:!M});return(0,Q.jsxs)(Ee.Provider,{value:W,children:[j&&F===!0&&N!==`trigger-hover`&&(0,Q.jsx)(y,{ref:E.context.internalBackdropRef,inert:_(!M),cutout:P}),(0,Q.jsx)(f,{id:O,children:ee})]})}),$=X.createContext(void 0);function ke(){let[e,t]=X.useState(0),n=d(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:X.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Ae(e){let{value:t,children:n}=e;return(0,Q.jsx)($.Provider,{value:t,children:n})}function je(){let e=X.useContext($);A(()=>e?.register(),[e])}var Me={...ue,...s},Ne=X.forwardRef(function(e,t){let{render:n,className:r,style:a,initialFocus:o,finalFocus:s,...c}=e,{store:u}=Z(),d=De(),f=ee(!0)!=null,{context:m,hasClosePart:g}=ke(),_=u.useState(`open`),v=u.useState(`openMethod`),y=u.useState(`instantType`),b=u.useState(`transitionStatus`),x=u.useState(`popupProps`),S=u.useState(`titleElementId`),C=u.useState(`descriptionElementId`),w=u.useState(`modal`),E=u.useState(`mounted`),D=u.useState(`openChangeReason`),O=u.useState(`activeTriggerElement`),k=u.useState(`floatingRootContext`),A=k.useState(`floatingId`),j=u.useState(`disabled`),M=u.useState(`openOnHover`),N=u.useState(`closeDelay`),F=c.id??A;T({open:_,ref:u.context.popupRef,onComplete(){_&&u.context.onOpenChangeComplete?.(!0)}}),P(k,{enabled:M&&!j,closeDelay:N});function I(e){return e!==`touch`||u.context.popupRef.current}let R=o===void 0?I:o,z=w!==!1&&g;u.useSyncedValue(`focusManagerModal`,z);let B=X.useCallback(e=>{u.set(`popupElement`,e)},[u]),V={open:_,side:d.side,align:d.align,instant:y,transitionStatus:b},H=Y(`div`,e,{state:V,ref:[t,u.context.popupRef,B],props:[x,{id:F,role:`dialog`,...L,"aria-labelledby":S,"aria-describedby":C,onKeyDown(e){f&&h.has(e.key)&&e.stopPropagation()}},i(b),c],stateAttributesMapping:Me});return(0,Q.jsx)(l,{context:k,openInteractionType:v,modal:z,disabled:!E||D===`trigger-hover`,initialFocus:R,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:p(O)?O:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,Q.jsx)(Ae,{value:m,children:H})})}),Pe=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({}),Fe={activationDirection:e=>e?{"data-activation-direction":e}:null},Ie=X.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{store:s}=Z(),{side:c}=De(),l=s.useState(`instantType`),{children:u,state:d}=pe({store:s,side:c,cssVars:Pe,children:a}),f={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l};return Y(`div`,e,{state:f,ref:t,props:[o,{children:u}],stateAttributesMapping:Fe})}),Le=class{constructor(){this.store=new ve}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error(v(80,e));this.store.setOpen(!0,W(F,void 0,t))}close(){this.store.setOpen(!1,W(F,void 0,void 0))}get isOpen(){return this.store.select(`open`)}};function Re(){return new Le}export{Oe as a,be as c,je as i,Z as l,Ie as n,Te as o,Ne as r,Se as s,Re as t};
|
|
2
|
-
//# sourceMappingURL=PopoverHandle-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./jsx-runtime-BnjsACtP.js";import{Bi as r,Br as i,Ca as a,Ci as o,Co as s,Dr as c,Fi as l,Fr as u,Ha as d,Ii as f,Ka as p,Ki as m,Kr as h,Li as g,Lr as _,Mo as v,Mr as y,Ni as b,Oo as x,Pi as S,Pr as C,Ri as w,Sa as T,Si as E,To as D,Tr as O,Ui as k,Va as A,_i as j,bi as M,bo as N,ci as P,eo as F,fi as I,gi as L,hi as R,ia as z,ii as B,ja as V,ji as H,jr as U,ka as W,kr as G,mi as K,mo as q,pi as J,ri as ee,si as te,vi as ne,vr as re,wa as ie,wi as ae,wo as Y,xi as oe,xo as se,ya as ce,yi as le,yo as ue,za as de,zi as fe}from"./utils-DhUt689t.js";import{J as pe}from"./TooltipViewport-ThbbZQDo.js";var X=e(t()),me=X.createContext(void 0);function Z(e){let t=X.useContext(me);if(t===void 0&&!e)throw Error(v(47));return t}var he=e(ie());function ge(){return{...I(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var _e={...K,disabled:H(e=>e.disabled),instantType:H(e=>e.instantType),openMethod:H(e=>e.openMethod),openChangeReason:H(e=>e.openChangeReason),modal:H(e=>e.modal),focusManagerModal:H(e=>e.focusManagerModal),stickIfOpen:H(e=>e.stickIfOpen),titleElementId:H(e=>e.titleElementId),descriptionElementId:H(e=>e.descriptionElementId),openOnHover:H(e=>e.openOnHover),closeDelay:H(e=>e.closeDelay),hasViewport:H(e=>e.hasViewport)},ve=class e extends ae{constructor(e,t,n=!1){let r={...ge(),...e},i=new R;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=J(i,t,n),super(r,{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:X.createRef(),beforeContentFocusGuardRef:X.createRef(),stickIfOpenTimeout:new ce,triggerElements:i},_e)}setOpen=(e,t)=>{let n=t.reason===q,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)};let a=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&a!=null&&(t.trigger=this.context.triggerElements.getById(a)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let n={open:e,openChangeReason:t.reason};j(n,e,t.trigger),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),he.flushSync(o)):o(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=E(t,(t,r)=>new e(n,t,r));return X.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()},Q=e(n());function ye({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:l,defaultTriggerId:u=null}=e,d=ve.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:u,triggerIdProp:l});c(()=>{n===void 0&&d.state.open===!1&&r===!0&&d.update({open:!0,activeTriggerId:u})}),d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),m=d.useState(`payload`),h=fe()!=null;d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),oe(d,f),ne(d);let{forceUnmount:g}=le(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o,nested:h}),X.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let _=X.useCallback(()=>{d.setOpen(!1,W(F))},[d]);X.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:_}),[g,_]);let v=f||p,y=X.useMemo(()=>({store:d}),[d]);return(0,Q.jsxs)(me.Provider,{value:y,children:[v&&(0,Q.jsx)(xe,{store:d,modal:o}),typeof t==`function`?t({payload:m}):t]})}function be(e){return Z(!0)?(0,Q.jsx)(ye,{props:e}):(0,Q.jsx)(g,{children:(0,Q.jsx)(ye,{props:e})})}function xe({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=b(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference??x,a=r.trigger??x,o=X.useMemo(()=>D(L,r.floating),[r.floating]);return M(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:o}),null}var Se=X.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Z(!0),g=c?.store??h?.store;if(!g)throw Error(v(74));let _=V(p),y=g.useState(`isTriggerActive`,_),b=g.useState(`floatingRootContext`),x=g.useState(`isOpenedByTrigger`,_),C=g.useState(`triggerPopupId`,_),w=X.useRef(null),{registerTrigger:T,isMountedByThisTrigger:E}=o(_,w,g,{payload:l,disabled:a,openOnHover:u,closeDelay:f}),D=g.useState(`openChangeReason`),A=g.useState(`stickIfOpen`),j=g.useState(`openMethod`),M=g.useState(`focusManagerModal`),P=te(b,{enabled:b!=null&&u&&(j!==`touch`||D!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:B(),restMs:d,delay:{close:f},triggerElementRef:w,isActiveTrigger:y,isClosing:()=>g.select(`transitionStatus`)===`ending`}),F=S(b,{enabled:b!=null,stickIfOpen:A}),I=O(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),L=g.useState(`triggerProps`,E),{getButtonProps:R,buttonRef:H}=de({disabled:a,native:s}),U={open(e){return e&&D===`trigger-press`?N.open(e):se.open(e)}},{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:K}=re(g,w),q=Y(`button`,e,{state:{disabled:a,open:x},ref:[H,t,T,w],props:[F.reference,P,L,I,{[k]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":x,"aria-controls":C},m,R],stateAttributesMapping:U});return E&&!M?(0,Q.jsxs)(X.Fragment,{children:[(0,Q.jsx)(z,{ref:W,onFocus:G}),(0,Q.jsx)(X.Fragment,{children:q},_),(0,Q.jsx)(z,{ref:g.context.triggerFocusTargetRef,onFocus:K})]}):(0,Q.jsx)(X.Fragment,{children:q},_)}),Ce=X.createContext(void 0);function we(){let e=X.useContext(Ce);if(e===void 0)throw Error(v(45));return e}var Te=X.forwardRef(function(e,t){let{keepMounted:n=!1,...i}=e,{store:a}=Z();return a.useState(`mounted`)||n?(0,Q.jsx)(Ce.Provider,{value:n,children:(0,Q.jsx)(r,{ref:t,...i})}):null}),Ee=X.createContext(void 0);function De(){let e=X.useContext(Ee);if(!e)throw Error(v(46));return e}var Oe=X.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:o,positionMethod:s=`absolute`,side:c=`bottom`,align:l=`center`,sideOffset:d=0,alignOffset:p=0,collisionBoundary:h=`clipping-ancestors`,collisionPadding:g=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:x=!1,collisionAvoidance:S=m,...T}=e,{store:E}=Z(),D=we(),O=w(),k=E.useState(`floatingRootContext`),j=E.useState(`mounted`),M=E.useState(`open`),N=E.useState(`openChangeReason`),P=E.useState(`activeTriggerElement`),F=E.useState(`modal`),I=E.useState(`openMethod`),L=E.useState(`positionerElement`),R=E.useState(`instantType`),z=E.useState(`transitionStatus`),B=E.useState(`hasViewport`),V=X.useRef(null),H=a(L,!1,!1),W=C({anchor:o,floatingRootContext:k,positionMethod:s,mounted:j,side:c,sideOffset:d,align:l,alignOffset:p,arrowPadding:v,collisionBoundary:h,collisionPadding:g,sticky:b,disableAnchorTracking:x,keepMounted:D,nodeId:O,collisionAvoidance:S,adaptiveOrigin:B?u:void 0}),K=k.useState(`domReferenceElement`);A(()=>{let e=K,t=V.current;if(e&&(V.current=e),t&&e&&e!==t){E.set(`instantType`,void 0);let e=new AbortController;return H(()=>{E.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[K,H,E]),G(M&&F===!0&&N!==`trigger-hover`,I===`touch`,L,P);let q=X.useCallback(e=>{E.set(`positionerElement`,e)},[E]),J={open:M,side:W.side,align:W.align,anchorHidden:W.anchorHidden,instant:R},ee=U(e,J,{styles:W.positionerStyles,transitionStatus:z,props:T,refs:[t,q],hidden:!j,inert:!M});return(0,Q.jsxs)(Ee.Provider,{value:W,children:[j&&F===!0&&N!==`trigger-hover`&&(0,Q.jsx)(y,{ref:E.context.internalBackdropRef,inert:_(!M),cutout:P}),(0,Q.jsx)(f,{id:O,children:ee})]})}),$=X.createContext(void 0);function ke(){let[e,t]=X.useState(0),n=d(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:X.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function Ae(e){let{value:t,children:n}=e;return(0,Q.jsx)($.Provider,{value:t,children:n})}function je(){let e=X.useContext($);A(()=>e?.register(),[e])}var Me={...ue,...s},Ne=X.forwardRef(function(e,t){let{render:n,className:r,style:a,initialFocus:o,finalFocus:s,...c}=e,{store:u}=Z(),d=De(),f=ee(!0)!=null,{context:m,hasClosePart:g}=ke(),_=u.useState(`open`),v=u.useState(`openMethod`),y=u.useState(`instantType`),b=u.useState(`transitionStatus`),x=u.useState(`popupProps`),S=u.useState(`titleElementId`),C=u.useState(`descriptionElementId`),w=u.useState(`modal`),E=u.useState(`mounted`),D=u.useState(`openChangeReason`),O=u.useState(`activeTriggerElement`),k=u.useState(`floatingRootContext`),A=k.useState(`floatingId`),j=u.useState(`disabled`),M=u.useState(`openOnHover`),N=u.useState(`closeDelay`),F=c.id??A;T({open:_,ref:u.context.popupRef,onComplete(){_&&u.context.onOpenChangeComplete?.(!0)}}),P(k,{enabled:M&&!j,closeDelay:N});function I(e){return e!==`touch`||u.context.popupRef.current}let R=o===void 0?I:o,z=w!==!1&&g;u.useSyncedValue(`focusManagerModal`,z);let B=X.useCallback(e=>{u.set(`popupElement`,e)},[u]),V={open:_,side:d.side,align:d.align,instant:y,transitionStatus:b},H=Y(`div`,e,{state:V,ref:[t,u.context.popupRef,B],props:[x,{id:F,role:`dialog`,...L,"aria-labelledby":S,"aria-describedby":C,onKeyDown(e){f&&h.has(e.key)&&e.stopPropagation()}},i(b),c],stateAttributesMapping:Me});return(0,Q.jsx)(l,{context:k,openInteractionType:v,modal:z,disabled:!E||D===`trigger-hover`,initialFocus:R,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:p(O)?O:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,Q.jsx)(Ae,{value:m,children:H})})}),Pe=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({}),Fe={activationDirection:e=>e?{"data-activation-direction":e}:null},Ie=X.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{store:s}=Z(),{side:c}=De(),l=s.useState(`instantType`),{children:u,state:d}=pe({store:s,side:c,cssVars:Pe,children:a}),f={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:l};return Y(`div`,e,{state:f,ref:t,props:[o,{children:u}],stateAttributesMapping:Fe})}),Le=class{constructor(){this.store=new ve}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error(v(80,e));this.store.setOpen(!0,W(F,void 0,t))}close(){this.store.setOpen(!1,W(F,void 0,void 0))}get isOpen(){return this.store.select(`open`)}};function Re(){return new Le}export{Oe as a,be as c,je as i,Z as l,Ie as n,Te as o,Ne as r,Se as s,Re as t};
|
|
2
|
+
//# sourceMappingURL=PopoverHandle-Cj5egwXv.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,D as a,Ed as o,Fg as s,Hf as c,Jn as l,Jo as u,Ko as d,Op as f,Qn as p,Qo as m,Rf as h,Sp as g,Tp as _,Uf as v,Wo as y,Y_ as b,Yn as x,Yp as S,Zn as C,ar as w,cr as T,dr as E,ec as D,im as ee,kg as O,lr as k,nd as A,nr as j,od as M,of as N,rh as P,rr as te,sd as F,sr as I,t as ne,tm as L,tr as R,ur as z}from"./utils-BoMYW9A3.js";import{R as re,W as B}from"./runtime-DR7JxgbQ.js";import{b as ie}from"./entities-Bqo0n1Pb.js";import{it as V}from"./ChatMarkdown-9gWM0ED9.js";import{i as H}from"./toast-B84QdqqM.js";import{C as ae,O as oe,S as U,q as W,r as se}from"./useSettings-CaJMqrvF.js";import{i as ce,n as G}from"./session-C949OsEI.js";import{t as le}from"./use-atom-command-DA6OG-Qk.js";import{u as ue}from"./rightPanelStore-D3KOmuPa.js";import{t as de}from"./toastHelpers-DxXYm50b.js";import{M as K,j as q}from"./PanelLayoutControls-4VFKEoHg.js";import{o as fe}from"./timestampFormat-wac2e_Jz.js";import{a as pe,n as me,t as he}from"./tooltip-D-GRl-oZ.js";import{a as ge,o as _e,r as ve,t as ye}from"./empty-FOL5U4KY.js";import{n as be,t as xe}from"./discovery-list-CrJrW6_m.js";import{t as Se}from"./observeResize-3Vj9DYOV.js";import{T as Ce,a as we,b as Te,f as Ee,i as De,n as Oe,o as ke,r as Ae,t as je,u as Me,w as Ne}from"./browserHistoryStore-tYgeZygn.js";import{n as Pe}from"./openFileInPreview-BBWCOLh_.js";import{t as Fe}from"./preview-BYnEURcB.js";import{a as Ie,i as Le,r as Re,t as ze}from"./preview-DGdQ5Ycc.js";import{Ai as Be,Hi as Ve,Ii as He,Ki as Ue,Li as We,Mi as Ge,Ni as Ke,Oa as qe,Ri as Je,Ui as J,Vi as Ye,Xi as Y,ga as Xe,ha as Ze,ji as Qe,ki as $e,qi as X}from"./main-BWh6jqG2.js";import{a as et,c as tt,d as nt,f as rt,i as it,l as at,n as ot,o as st,r as ct,s as lt,u as ut}from"./_chat-1QGQLbCc.js";var Z=e(t(),1),Q=n(),dt=`data:image/png;base64,`;function ft(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(dt))return{status:`failed`};let n=Y(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(r(),1),pt=()=>{};function mt(e){let t=(0,Q.c)(79),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:s,inputDisabled:c,focusUrlNonce:l,onBack:u,onForward:d,onRefresh:p,onSubmit:m,onOpenInBrowser:h,onCapture:g,captureDisabled:_,recording:v,onSeparateWindow:y,separateWindow:b,separateWindowDisabled:x,onPickElement:S,pickActive:C,pickDisabled:w,pickDisabledReason:T,trailingActions:D,leadingActions:ee}=e,O=(0,Z.useRef)(null),[k,j]=(0,Z.useState)(n),[P,te]=(0,Z.useState)(!1),I,L;t[0]===l?(I=t[1],L=t[2]):(I=()=>{if(l==null)return;let e=O.current;e&&e.focus()},L=[l],t[0]=l,t[1]=I,t[2]=L),(0,Z.useEffect)(I,L);let R;t[3]!==k||t[4]!==m?(R=e=>{e?.preventDefault();let t=k.trim();t.length!==0&&(m(t),O.current?.blur())},t[3]=k,t[4]=m,t[5]=R):R=t[5];let z=R,re=i?u:pt,B=!i,ie;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(M,{}),t[6]=ie):ie=t[6];let V;t[7]!==re||t[8]!==B?(V=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:re,disabled:B,"aria-label":`Back`,type:`button`,children:ie}),t[7]=re,t[8]=B,t[9]=V):V=t[9];let H=a?d:pt,ae=!a,oe;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(F,{}),t[10]=oe):oe=t[10];let U;t[11]!==H||t[12]!==ae?(U=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:H,disabled:ae,"aria-label":`Forward`,type:`button`,children:oe}),t[11]=H,t[12]=ae,t[13]=U):U=t[13];let W;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`mx-0.5 h-4 w-px bg-border`}),t[14]=W):W=t[14];let se=s?pt:p,ce=r?`Stop`:`Refresh`,G;t[15]!==s||t[16]!==se||t[17]!==ce?(G=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:se,disabled:s,"aria-label":ce,type:`button`}),t[15]=s,t[16]=se,t[17]=ce,t[18]=G):G=t[18];let le;t[19]===r?le=t[20]:(le=(0,$.jsx)(qe,{refreshing:r}),t[19]=r,t[20]=le);let ue;t[21]!==G||t[22]!==le?(ue=(0,$.jsx)(pe,{render:G,children:le}),t[21]=G,t[22]=le,t[23]=ue):ue=t[23];let de=r?`Loading…`:`Refresh`,K;t[24]===de?K=t[25]:(K=(0,$.jsx)(me,{children:de}),t[24]=de,t[25]=K);let q;t[26]!==ue||t[27]!==K?(q=(0,$.jsxs)(he,{children:[ue,K]}),t[26]=ue,t[27]=K,t[28]=q):q=t[28];let fe;t[29]!==U||t[30]!==q||t[31]!==V?(fe=(0,$.jsxs)(`div`,{className:`surface-glass flex h-8 shrink-0 items-center gap-0.5 rounded-full border border-border/60 px-1 shadow-sm [&_button]:rounded-full`,role:`group`,"aria-label":`Navigation`,children:[V,U,W,q]}),t[29]=U,t[30]=q,t[31]=V,t[32]=fe):fe=t[32];let ge=P?k:n,_e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>j(e.target.value),t[33]=_e):_e=t[33];let ve;t[34]===n?ve=t[35]:(ve=()=>{j(n),te(!0),queueMicrotask(()=>O.current?.select())},t[34]=n,t[35]=ve);let ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{te(!1)},t[36]=ye):ye=t[36];let be;t[37]!==z||t[38]!==n?(be=e=>{e.key===`Enter`&&z(e),e.key===`Escape`&&(e.preventDefault(),j(n),O.current?.blur())},t[37]=z,t[38]=n,t[39]=be):be=t[39];let xe;t[40]!==c||t[41]!==ge||t[42]!==ve||t[43]!==be?(xe=(0,$.jsx)(`input`,{ref:O,value:ge,onChange:_e,onFocus:ve,onBlur:ye,onKeyDown:be,"aria-label":`Address`,placeholder:`Search or enter URL`,spellCheck:!1,disabled:c,"data-preview-url-input":!0,className:`w-full min-w-0 truncate bg-transparent text-center text-sm text-foreground outline-none placeholder:text-muted-foreground focus:text-left`}),t[40]=c,t[41]=ge,t[42]=ve,t[43]=be,t[44]=xe):xe=t[44];let Se;t[45]!==P||t[46]!==h?(Se=h&&!P?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-1 flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100 [&_button]:rounded-full`,children:(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:h,"aria-label":`Open in system browser`,type:`button`}),children:(0,$.jsx)(N,{})}),(0,$.jsx)(me,{children:`Open in system browser`})]})}):null,t[45]=P,t[46]=h,t[47]=Se):Se=t[47];let Ce;t[48]!==xe||t[49]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`surface-glass group/address relative flex h-8 min-w-0 flex-1 items-center rounded-full border border-border/60 px-8 shadow-sm transition-colors focus-within:border-ring has-disabled:opacity-64`,children:[xe,Se]}),t[48]=xe,t[49]=Se,t[50]=Ce):Ce=t[50];let we;t[51]!==S||t[52]!==C||t[53]!==w||t[54]!==T?(we=S?(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:S,disabled:w,"aria-label":C?`Cancel annotation`:`Annotate preview`,"aria-pressed":C?`true`:`false`,type:`button`}),children:(0,$.jsx)(f,{className:ne(C&&`text-primary`)})}),(0,$.jsx)(me,{children:w&&T?T:C?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[51]=S,t[52]=C,t[53]=w,t[54]=T,t[55]=we):we=t[55];let Te;t[56]!==_||t[57]!==g||t[58]!==v?(Te=g?(0,$.jsxs)(he,{children:[(0,$.jsxs)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:e=>g(e.shiftKey),"aria-label":v?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:_}),children:[(0,$.jsx)(o,{className:ne(v&&`text-destructive`)}),v?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(me,{children:v?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[56]=_,t[57]=g,t[58]=v,t[59]=Te):Te=t[59];let Ee;t[60]!==y||t[61]!==b||t[62]!==x?(Ee=y?(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:y,"aria-label":b?`Bring preview back from its window`:`Open preview in a window`,"aria-pressed":b?`true`:`false`,type:`button`,disabled:x}),children:(0,$.jsx)(A,{className:ne(b&&`text-primary`)})}),(0,$.jsx)(me,{children:b?`Bring back`:`Open in separate window`})]}):null,t[60]=y,t[61]=b,t[62]=x,t[63]=Ee):Ee=t[63];let De;t[64]!==ee||t[65]!==z||t[66]!==fe||t[67]!==Ce||t[68]!==we||t[69]!==Te||t[70]!==Ee||t[71]!==D?(De=(0,$.jsxs)(`form`,{onSubmit:z,className:`flex h-12 min-h-12 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-2.5 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[fe,ee,Ce,we,Te,Ee,D]}),t[64]=ee,t[65]=z,t[66]=fe,t[67]=Ce,t[68]=we,t[69]=Te,t[70]=Ee,t[71]=D,t[72]=De):De=t[72];let Oe;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={boxShadow:`0 0 6px 1px var(--color-ring)`},t[73]=Oe):Oe=t[73];let ke;t[74]===r?ke=t[75]:(ke=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Oe}),t[74]=r,t[75]=ke);let Ae;return t[76]!==De||t[77]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`relative`,children:[De,ke]}),t[76]=De,t[77]=ke,t[78]=Ae):Ae=t[78],Ae}function ht(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=gt(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(q,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(be,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function gt(e){return e.processName?e.processName:`Listening`}function _t(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let s=o,c=s.pathname===`/`?``:s.pathname,l=`${s.host}${c}${s.search}${s.hash}`,u;t[2]===r.lastVisitedAt?u=t[3]:(u=je(r.lastVisitedAt)?fe(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=u);let d=u;lt();let f;t[4]!==r.url||t[5]!==n?(f=(0,$.jsx)(q,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=f):f=t[6];let p=r.title??l,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:p}),t[7]=p,t[8]=m);let h=r.title?`${l} · `:``,g;t[9]!==h||t[10]!==d?(g=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[h,d]}),t[9]=h,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==i||t[16]!==f||t[17]!==_?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[f,_]}),t[15]=i,t[16]=f,t[17]=_,t[18]=v):v=t[18];let y=`Remove ${l} from history`,b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(P,{className:`size-3.5`}),t[19]=b):b=t[19];let x;t[20]!==a||t[21]!==y?(x=(0,$.jsx)(`button`,{type:`button`,"aria-label":y,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:b}),t[20]=a,t[21]=y,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==v?(S=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[v,x]}),t[23]=x,t[24]=v,t[25]=S):S=t[25],S}function vt(e){let t=(0,Q.c)(7),n=J(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:ke(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=yt({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function yt(e){let t=new Map;for(let n of e.configuredUrls){let e=xt(n);if(!e)continue;let r=bt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=bt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function bt(e,t){let n=e.toLowerCase();return`${ze(n)?`loopback`:n}:${t}`}function xt(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!ze(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function St(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=vt(c),u,d,f,p;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(Ct).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(ye,{children:[(0,$.jsx)(ge,{variant:`icon`,children:(0,$.jsx)(h,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(_e,{children:`No preview yet`}),(0,$.jsx)(ve,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],p=e;break bb0}f=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,u=`mx-auto flex w-full max-w-xl flex-col gap-6`,d=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(v,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(xe,{children:e.map(e=>(0,$.jsx)(_t,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else u=t[8],d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[13]!==s||t[14]!==l||t[15]!==n?(m=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(L,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(xe,{children:l.map(e=>(0,$.jsx)(ht,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=m):m=t[16];let g;t[17]!==u||t[18]!==d||t[19]!==m?(g=(0,$.jsxs)(`div`,{className:u,children:[d,m]}),t[17]=u,t[18]=d,t[19]=m,t[20]=g):g=t[20];let _;return t[21]!==f||t[22]!==g?(_=(0,$.jsx)(`div`,{className:f,children:g}),t[21]=f,t[22]=g,t[23]=_):_=t[23],_}function Ct(e){return URL.canParse(e.url)}var wt=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Tt=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(z,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(_,{})}),(0,$.jsx)(me,{children:`More`})]}),e[0]=t):t=e[0],t};function Et(e){let t=(0,Q.c)(69),{enabled:n,actions:r,zoomFactor:a,colorScheme:o,deviceToolbarVisible:s,onToggleDeviceToolbar:c,profileName:l,move:u}=e,d;t[0]===a?d=t[1]:(d=Math.round(a*100),t[0]=a,t[1]=d);let f=`${d}%`,m=!n,h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Tt,{}),t[2]=h):h=t[2];let _;t[3]!==r.hardReload||t[4]!==m?(_=(0,$.jsx)(i,{onClick:r.hardReload,disabled:m,children:`Hard reload`}),t[3]=r.hardReload,t[4]=m,t[5]=_):_=t[5];let v;t[6]!==r.openDevTools||t[7]!==m?(v=r.openDevTools?(0,$.jsx)(i,{onClick:r.openDevTools,disabled:m,children:`Open DevTools`}):null,t[6]=r.openDevTools,t[7]=m,t[8]=v):v=t[8];let y;t[9]===u?y=t[10]:(y=u?(0,$.jsx)(i,{onClick:u.onMove,children:u.label}):null,t[9]=u,t[10]=y);let b=s?`Hide device toolbar`:`Show device toolbar`,D;t[11]!==m||t[12]!==c||t[13]!==b?(D=(0,$.jsx)(i,{onClick:c,disabled:m,children:b}),t[11]=m,t[12]=c,t[13]=b,t[14]=D):D=t[14];let O;t[15]===m?O=t[16]:(O=(0,$.jsx)(k,{disabled:m,children:`Appearance`}),t[15]=m,t[16]=O);let A;t[17]===r?A=t[18]:(A=e=>r.setColorScheme(e),t[17]=r,t[18]=A);let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=wt.map(Ot),t[19]=M):M=t[19];let N;t[20]!==o||t[21]!==A?(N=(0,$.jsx)(T,{children:(0,$.jsx)(j,{value:o,onValueChange:A,children:M})}),t[20]=o,t[21]=A,t[22]=N):N=t[22];let P;t[23]!==N||t[24]!==O?(P=(0,$.jsxs)(I,{children:[O,N]}),t[23]=N,t[24]=O,t[25]=P):P=t[25];let te;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(w,{}),t[26]=te):te=t[26];let F;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{children:`Zoom`}),t[27]=F):F=t[27];let ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(g,{}),t[28]=ne):ne=t[28];let L;t[29]!==r.zoomOut||t[30]!==m?(L=(0,$.jsx)(E,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomOut,"aria-label":`Zoom out`,disabled:m,children:ne}),t[29]=r.zoomOut,t[30]=m,t[31]=L):L=t[31];let z;t[32]===f?z=t[33]:(z=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:f}),t[32]=f,t[33]=z);let re;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(S,{}),t[34]=re):re=t[34];let B;t[35]!==r.zoomIn||t[36]!==m?(B=(0,$.jsx)(E,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomIn,"aria-label":`Zoom in`,disabled:m,children:re}),t[35]=r.zoomIn,t[36]=m,t[37]=B):B=t[37];let ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(ee,{}),t[38]=ie):ie=t[38];let V;t[39]!==r.resetZoom||t[40]!==m?(V=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:r.resetZoom,"aria-label":`Reset zoom`,disabled:m,children:ie}),t[39]=r.resetZoom,t[40]=m,t[41]=V):V=t[41];let H;t[42]!==L||t[43]!==z||t[44]!==B||t[45]!==V?(H=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[L,z,B,V]}),t[42]=L,t[43]=z,t[44]=B,t[45]=V,t[46]=H):H=t[46];let ae;t[47]!==m||t[48]!==H?(ae=(0,$.jsxs)(i,{closeOnClick:!1,onClick:Dt,className:`justify-between`,disabled:m,children:[F,H]}),t[47]=m,t[48]=H,t[49]=ae):ae=t[49];let oe;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(w,{}),t[50]=oe):oe=t[50];let U;t[51]===l?U=t[52]:(U=l?(0,$.jsx)(p,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,l]})}):null,t[51]=l,t[52]=U);let W;t[53]===r.clearCookies?W=t[54]:(W=(0,$.jsx)(i,{onClick:r.clearCookies,children:`Clear cookies`}),t[53]=r.clearCookies,t[54]=W);let se;t[55]===r.clearCache?se=t[56]:(se=(0,$.jsx)(i,{onClick:r.clearCache,children:`Clear cache`}),t[55]=r.clearCache,t[56]=se);let ce;t[57]!==U||t[58]!==W||t[59]!==se?(ce=(0,$.jsxs)(C,{children:[U,W,se]}),t[57]=U,t[58]=W,t[59]=se,t[60]=ce):ce=t[60];let G;return t[61]!==P||t[62]!==ae||t[63]!==ce||t[64]!==_||t[65]!==v||t[66]!==y||t[67]!==D?(G=(0,$.jsxs)(x,{children:[h,(0,$.jsxs)(R,{align:`end`,sideOffset:6,children:[_,v,y,D,P,te,ae,oe,ce]})]}),t[61]=P,t[62]=ae,t[63]=ce,t[64]=_,t[65]=v,t[66]=y,t[67]=D,t[68]=G):G=t[68],G}function Dt(e){return e.preventDefault()}function Ot(e){return(0,$.jsx)(te,{value:e.value,children:e.label},e.value)}function kt(e){return m[e]||(e.length>0?e:`Network error`)}function At(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Pt(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Nt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(E,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function jt(e){let t=(0,Q.c)(44),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Pt(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=kt(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Nt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),t[14]=y):y=t[14];let b,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`li`,{children:`Checking your connection`}),b=(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),t[15]=b,t[16]=x):(b=t[15],x=t[16]);let S;t[17]===o?S=t[18]:(S=o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,t[17]=o,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`}),t[19]=C):C=t[19];let w;t[20]===S?w=t[21]:(w=(0,$.jsx)(Xe,{children:(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[y,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[x,b,S,C]})]})}),t[20]=S,t[21]=w);let T;t[22]!==s||t[23]!==w?(T=(0,$.jsx)(Ze,{open:s,children:w}),t[22]=s,t[23]=w,t[24]=T):T=t[24];let D;t[25]===m?D=t[26]:(D=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[25]=m,t[26]=D);let ee;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>c(Mt),t[27]=ee):ee=t[27];let O=s?`Hide details`:`Details`,k;t[28]===O?k=t[29]:(k=(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:ee,children:O}),t[28]=O,t[29]=k);let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`div`,{className:`flex-1`}),t[30]=A):A=t[30];let j;t[31]===o?j=t[32]:(j=o?(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[31]=o,t[32]=j);let M;t[33]===a?M=t[34]:(M=(0,$.jsx)(E,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[33]=a,t[34]=M);let N;t[35]!==k||t[36]!==j||t[37]!==M?(N=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[k,A,j,M]}),t[35]=k,t[36]=j,t[37]=M,t[38]=N):N=t[38];let P;return t[39]!==T||t[40]!==D||t[41]!==N||t[42]!==v?(P=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,T,D,N]})}),t[39]=T,t[40]=D,t[41]=N,t[42]=v,t[43]=P):P=t[43],P}function Mt(e){return!e}function Nt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Pt(e){try{return new URL(e).host}catch{return null}}var Ft=1500,It=.001;function Lt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<It))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},Ft),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=ne(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function Rt(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var zt=typeof window>`u`?null:W();function Bt(e){let t=(0,Q.c)(12),n=nt(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?rt({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void zt?.shell.openExternal(e.url).catch(Vt),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(At,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function Vt(){}function Ht({threadRef:e,tabId:t,configuredUrls:n,visible:r,onSendAnnotation:i}){let[o,f]=(0,Z.useState)(void 0),[p,m]=(0,Z.useState)(!1),h=ce(e.environmentId,`orchestration:operate`)&&!!i,g=Ke(),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!0),b=(0,Z.useRef)(e);b.current=e;let x=u(e),S=we(e,50),C=a(e=>e.addPreviewAnnotation),w=a(e=>e.addImage),T=ae(e.environmentId),ee=T?new URL(T).hostname:null,k=le(Fe.open),A=le(Fe.close,`preview close`),j=U(e.environmentId)?.label??`the environment`,M=oe(),N=ie(e.environmentId),P=le(Fe.resize,`preview viewport resize`),te=le(Fe.adjust,`preview appearance or zoom`);ot(e),(0,Z.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let F=t??x.activeTabId,I=F?We(e,x.serverEpoch,F):null,L=F&&I?g.has(I)?I:$e(e,F):null,R=F?x.sessions[F]??null:null,z=Ce(e.environmentId,R),W=R?.runtime===`server`&&!z,K=R?.runtime===`server`,q=(0,Z.useRef)(null),[fe,ge]=(0,Z.useState)(!1),_e=(0,Z.useRef)(null),[ve,ye]=(0,Z.useState)(0),be=R?.runtime===`server`&&(R.viewport??O)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=_e.current;if(e&&be)return Se(e,([e])=>ye(Math.max(1,Math.round(e?.contentRect.width??0))))},[be]);let[xe,je]=(0,Z.useState)(null),Ne=W&&xe!==I,[ze,qe]=(0,Z.useState)(null),J=F?x.desktopByTabId[F]??null:null,Y=R?.navStatus??{_tag:`Idle`},Xe=Y._tag===`Idle`?``:Y.url,Ze=J?.loading??Y._tag===`Loading`,nt=J?.canGoBack??R?.canGoBack??!1,rt=J?.canGoForward??R?.canGoForward??!1,lt=Y._tag===`Idle`,Q=Y._tag===`LoadFailed`,dt=st(R),pt=W&&!dt&&!Q&&ze!==I,ht=J?.controller??`none`,gt=R?.viewport??O,_t=Ee(),vt=R?.profileId??`default`,yt=Rt(_t.profiles,vt),bt=He(e=>I?e.byTabId[I]?.rect??null:null),xt=Y._tag===`Success`?Y.url:null,Ct=Y._tag===`Success`?Y.title:null,wt=S[0]?.url,Tt=D(e);(0,Z.useEffect)(()=>{xt&&Ct&&wt&&De(b.current,xt,Ct,ee)},[ee,wt,Ct,xt,Tt]);let Dt=(0,Z.useCallback)(async t=>{if(W&&q.current)return!Ne&&(q.current.navigate(t),y(e,t),!0);if(I&&X)return await X.navigate(I,t),y(e,t),!0;let n=await Ue({openPreview:k,threadRef:e,url:t});if(n._tag===`Failure`&&!re(n)){let e=B(n);e instanceof Pe&&H.add({type:`error`,title:`Unable to open browser`,description:e.message})}return n._tag===`Success`},[W,k,I,Ne,e]),Ot=(0,Z.useCallback)(async t=>{try{let n=Le(t,Ie(se()));await Dt(n)&&Oe(e,n)}catch{}},[Dt,e]),kt=(0,Z.useCallback)(async t=>{try{let n=W||!X?Re(t):ke(e.environmentId,t);await Dt(n)&&Oe(e,t)}catch{}},[W,Dt,e]),At=(0,Z.useCallback)(()=>{W?q.current?.reload():X&&I&&X.refresh(I)},[W,I]),Mt=(0,Z.useCallback)(async t=>{if(!F)return;let n=await te({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:F,...t}});if(n._tag===`Failure`){let e=B(n);H.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}d(e,n.value)},[te,F,e]),Nt=R?.zoomFactor??1,Pt=(0,Z.useCallback)(e=>{let t=s.indexOf(Nt),n=e===0?1:s[Math.min(Math.max((t<0?7:t)+e,0),s.length-1)];n!==Nt&&Mt({zoomFactor:n})},[Mt,Nt]),Ft=(0,Z.useCallback)(()=>{K?Pt(1):X&&I&&X.zoomIn(I)},[I,K,Pt]),It=(0,Z.useCallback)(()=>{K?Pt(-1):X&&I&&X.zoomOut(I)},[I,K,Pt]),Vt=(0,Z.useCallback)(()=>{K?Pt(0):X&&I&&X.resetZoom(I)},[I,K,Pt]),Ht=(0,Z.useCallback)(async t=>{if(!F)return;let n=await P({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:F,viewport:t}});if(n._tag===`Failure`){let e=B(n);throw H.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}d(e,n.value)},[P,F,e]),Ut=()=>{if(I){if(gt._tag!==`fill`){Ye(I,O).catch(()=>void 0);return}Ye(I,Me({defaults:_t,panelRect:bt,zoomFactor:K?Nt:J?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(I)return Ve(I,Ht)},[Ht,I]);let Wt=(0,Z.useCallback)(()=>{W?q.current?.history(-1):X&&I&&X.goBack(I)},[W,I]),Gt=(0,Z.useCallback)(()=>{W?q.current?.history(1):X&&I&&X.goForward(I)},[W,I]),Kt=(0,Z.useCallback)(()=>{zt&&Xe&&zt.shell.openExternal(Xe).catch(()=>void 0)},[Xe]),qt=Te(e.environmentId,M,N,R),Jt=qt===`server`?`Open in ${j}'s browser`:`Open on this computer`,Yt=(0,Z.useCallback)(async()=>{if(!qt||!F||!R)return;let t=await Ue({openPreview:k,threadRef:e,...Xe?{url:qt===`desktop`?ke(e.environmentId,Xe):Xe}:{},viewport:gt,...R.profileId===void 0?{}:{profileId:R.profileId},runtime:qt});if(t._tag===`Failure`){if(re(t))return;let e=B(t);H.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}ue.getState().openBrowser(e,t.value.tabId),await at({closePreview:A,snapshot:R,tabId:F,threadRef:e})},[A,qt,k,R,F,e,Xe,gt]),Xt=e=>()=>{e&&I&&e(I).catch(()=>void 0)},Zt=K?{hardReload:()=>void Mt({hardReload:!0}),setColorScheme:e=>void Mt({colorScheme:e}),zoomIn:Ft,zoomOut:It,resetZoom:Vt,clearCookies:()=>void Mt({clear:`cookies`}),clearCache:()=>void Mt({clear:`cache`}),...z&&X?{openDevTools:Xt(X.openDevTools)}:{}}:X?{hardReload:Xt(X.hardReload),setColorScheme:e=>{I&&X?.setColorScheme(I,e).catch(()=>void 0)},zoomIn:Ft,zoomOut:It,resetZoom:Vt,clearCookies:()=>void X?.clearCookies(e.environmentId,vt).catch(()=>void 0),clearCache:()=>void X?.clearCache(e.environmentId,vt).catch(()=>void 0),openDevTools:Xt(X.openDevTools)}:null,Qt=(0,Z.useCallback)(()=>{X&&I&&(J?.pictureInPicture?X.pictureInPicture.close:X.pictureInPicture.open)(I).catch(e=>{H.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[J?.pictureInPicture,I]),$t=(0,Z.useCallback)(t=>{if(!X||!I||!F)return;let n=X;if(L){Ge(L).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){H.update(r,de({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{H.update(r,de({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:V(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{H.update(r,de({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i}}}))};r=H.add(de({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i}}}))},e=>{H.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){Qe(I,e,F).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Be(e)||H.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(I).then(e=>{let t={children:V(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{H.update(a,de({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t}}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=H.add(de({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t}}}))},e=>{H.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[L,I,F,e]),en=(0,Z.useCallback)(()=>{if(!X||!I)return;if(_.current){_.current.cancelled=!0,X.cancelPickElement(I).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;_.current=n,m(!0),(async()=>{try{if(await X.setAnnotationSendEnabled?.(I,!!i&&G(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await X.pickElement(I);if(!t||n.cancelled)return;_.current===n&&(_.current=null,v.current&&m(!1),r=!0);let{annotation:a,submission:o,screenshotFailed:s=!1}=t,c=ft(a),l=s||c.status===`failed`,u=c.status===`failed`?{...a,screenshot:null}:a;C(e,u),l&&H.add(de({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=c.status===`captured`?c.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&w(e,f),o===`send`&&G(e.environmentId,`orchestration:operate`)&&i?.(u,f)}catch{}finally{let e=_.current===n;if(e&&(_.current=null,v.current&&m(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[w,C,i,I,e]);return(0,Z.useEffect)(()=>{p&&X&&I&&X.setAnnotationSendEnabled?.(I,h).catch(()=>void 0)},[h,p,I]),(0,Z.useEffect)(()=>()=>{_.current&&(_.current.cancelled=!0,_.current=null,X&&I&&X.cancelPickElement(I).catch(()=>void 0),v.current&&m(!1))},[I]),(0,Z.useEffect)(()=>{if(r)return ut(e=>{switch(e){case`refresh`:At();return;case`focus-url`:f(e=>(e??0)+1);return;case`zoom-in`:Ft();return;case`zoom-out`:It();return;case`reset-zoom`:Vt();return;case`toggle-panel`:return}})},[At,Vt,Ft,It,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":D(e),children:[(0,$.jsx)(mt,{url:Xe,loading:Ze||pt,canGoBack:nt&&!Ne,canGoForward:rt&&!Ne,refreshDisabled:lt||Ne,inputDisabled:Ne,focusUrlNonce:o,onBack:Wt,onForward:Gt,onRefresh:At,onSubmit:e=>void Ot(e),onOpenInBrowser:F?Kt:void 0,onCapture:X&&F&&!W?$t:void 0,captureDisabled:!J||Q||J.pictureInPicture,recording:L!==null,onSeparateWindow:X&&F&&(!K||z)?Qt:void 0,separateWindow:J?.pictureInPicture??!1,separateWindowDisabled:I===null||!K&&!(J?.hasWebContents??!1),onPickElement:X&&F&&!W?en:void 0,pickActive:p,pickDisabled:!F||Q,pickDisabledReason:Q?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:vt===_t.profileId?null:(0,$.jsxs)(he,{children:[vt===`incognito`?(0,$.jsx)(pe,{render:(0,$.jsx)(`span`,{role:`img`,"aria-label":yt,className:`flex shrink-0 text-muted-foreground`}),children:(0,$.jsx)(c,{className:`size-4`})}):(0,$.jsx)(pe,{render:(0,$.jsx)(l,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:yt})}),(0,$.jsx)(me,{side:`top`,children:yt})]}),trailingActions:Zt?(0,$.jsx)(Et,{enabled:I!==null&&(K||(J?.hasWebContents??!1)),actions:Zt,...qt?{move:{label:Jt,onMove:()=>void Yt()}}:{},profileName:yt,zoomFactor:K?Nt:J?.zoomFactor??1,colorScheme:K?R?.colorScheme??`system`:J?.colorScheme??`system`,deviceToolbarVisible:gt._tag!==`fill`,onToggleDeviceToolbar:Ut}):null}),(0,$.jsxs)(`div`,{ref:_e,className:`relative min-h-0 flex-1 overflow-hidden`,children:[I&&R&&W?(0,$.jsxs)($.Fragment,{children:[gt._tag!==`fill`&&!dt&&!Q?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(Je,{setting:gt,width:ve,aspectRatio:fe?gt.width/gt.height:null,onAspectRatioChange:e=>ge(e!==null),onChange:e=>Ye(I,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:gt._tag===`fill`?0:38},children:(0,$.jsx)(ct,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:R.tabId,visible:r,onFirstFrame:()=>qe(I),onControl:e=>je(e?.controller===`you`?I:null),onPopup:t=>tt(e,t,`panel`),className:ne(`absolute inset-0 h-full w-full`,(dt||Q)&&`invisible`)},I)})]}):I&&R&&!dt?X&&J?.pictureInPicture?(0,$.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`Showing in a separate window.`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(E,{size:`sm`,variant:`outline`,onClick:Qt,children:`Bring back`}),(0,$.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>void X?.pictureInPicture.open(I),children:`Show window`})]})]}):X?(0,$.jsx)(et,{tabId:I,visible:r&&!Q,className:`absolute inset-0 h-full w-full`},I):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,dt?(0,$.jsx)(St,{threadRef:e,environmentId:e.environmentId,configuredUrls:n,recentEntries:S,onRemoveRecent:t=>Ae(e,t),onOpenUrl:e=>void kt(e)}):null,R&&J?(0,$.jsx)(Lt,{zoomFactor:J.zoomFactor}):null,I&&J&&!dt&&!Q&&!g.has(I)?(0,$.jsx)(it,{tabId:I,zoomFactor:J.zoomFactor,controller:ht}):null,Y._tag===`LoadFailed`&&Y.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Bt,{threadRef:e,tabId:R?.tabId??``,url:Y.url,download:Y.download})}):Y._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(jt,{url:Y.url,code:Y.code,description:Y.description,onReload:At,...qt===`server`?{move:{label:Jt,onMove:()=>void Yt()}}:{}})}):null]})]})}function Ut(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o,onSendAnnotation:s}=e,c=Ne(r.environmentId),l=ce(r.environmentId,b);if(!l||!c){let e=l?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(K,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{tabId:i},t[5]=i,t[6]=u);let d;t[7]===s?d=t[8]:(d=s?{onSendAnnotation:s}:{},t[7]=s,t[8]=d);let f;t[9]!==a||t[10]!==u||t[11]!==d||t[12]!==r||t[13]!==o?(f=(0,$.jsx)(Ht,{threadRef:r,...u,configuredUrls:a,visible:o,...d}),t[9]=a,t[10]=u,t[11]=d,t[12]=r,t[13]=o,t[14]=f):f=t[14];let p;return t[15]!==n||t[16]!==f?(p=(0,$.jsx)(K,{mode:n,children:f}),t[15]=n,t[16]=f,t[17]=p):p=t[17],p}export{Ut as PreviewPanel};
|
|
2
|
-
//# sourceMappingURL=PreviewPanel-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,D as a,Ed as o,Fg as s,Hf as c,Jn as l,Jo as u,Ko as d,Op as f,Qn as p,Qo as m,Rf as h,Sp as g,Tp as _,Uf as v,Wo as y,Y_ as b,Yn as x,Yp as S,Zn as C,ar as w,cr as T,dr as E,ec as D,im as ee,kg as O,lr as k,nd as A,nr as j,od as M,of as N,rh as P,rr as te,sd as F,sr as I,t as ne,tm as L,tr as R,ur as z}from"./utils-DhUt689t.js";import{R as re,W as B}from"./runtime-OeWFs5Hf.js";import{b as ie}from"./entities-B8Vupv5g.js";import{it as V}from"./ChatMarkdown-D-cNSjFn.js";import{i as H}from"./toast-DXWclCrr.js";import{C as ae,O as oe,S as U,q as W,r as se}from"./useSettings-gPlpTIWi.js";import{i as ce,n as G}from"./session-BxUdP61p.js";import{t as le}from"./use-atom-command-vqjL7n-x.js";import{u as ue}from"./rightPanelStore-CGF0-d-1.js";import{t as de}from"./toastHelpers-DxXYm50b.js";import{M as K,j as q}from"./PanelLayoutControls-EIunk_2Q.js";import{o as fe}from"./timestampFormat-wac2e_Jz.js";import{a as pe,n as me,t as he}from"./tooltip-CY3W5y-f.js";import{a as ge,o as _e,r as ve,t as ye}from"./empty-rC3eYvxq.js";import{n as be,t as xe}from"./discovery-list-CrJrW6_m.js";import{t as Se}from"./observeResize-DSyLC8QK.js";import{T as Ce,a as we,b as Te,f as Ee,i as De,n as Oe,o as ke,r as Ae,t as je,u as Me,w as Ne}from"./browserHistoryStore-CK4YsfkQ.js";import{n as Pe}from"./openFileInPreview-CGM83ICx.js";import{t as Fe}from"./preview-3EscFepc.js";import{a as Ie,i as Le,r as Re,t as ze}from"./preview-DHLYKEKb.js";import{Ai as Be,Hi as Ve,Ii as He,Ki as Ue,Li as We,Mi as Ge,Ni as Ke,Oa as qe,Ri as Je,Ui as J,Vi as Ye,Xi as Y,ga as Xe,ha as Ze,ji as Qe,ki as $e,qi as X}from"./main-VfCRP294.js";import{a as et,c as tt,d as nt,f as rt,i as it,l as at,n as ot,o as st,r as ct,s as lt,u as ut}from"./_chat-CwO3_WVM.js";var Z=e(t(),1),Q=n(),dt=`data:image/png;base64,`;function ft(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(dt))return{status:`failed`};let n=Y(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(r(),1),pt=()=>{};function mt(e){let t=(0,Q.c)(79),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:s,inputDisabled:c,focusUrlNonce:l,onBack:u,onForward:d,onRefresh:p,onSubmit:m,onOpenInBrowser:h,onCapture:g,captureDisabled:_,recording:v,onSeparateWindow:y,separateWindow:b,separateWindowDisabled:x,onPickElement:S,pickActive:C,pickDisabled:w,pickDisabledReason:T,trailingActions:D,leadingActions:ee}=e,O=(0,Z.useRef)(null),[k,j]=(0,Z.useState)(n),[P,te]=(0,Z.useState)(!1),I,L;t[0]===l?(I=t[1],L=t[2]):(I=()=>{if(l==null)return;let e=O.current;e&&e.focus()},L=[l],t[0]=l,t[1]=I,t[2]=L),(0,Z.useEffect)(I,L);let R;t[3]!==k||t[4]!==m?(R=e=>{e?.preventDefault();let t=k.trim();t.length!==0&&(m(t),O.current?.blur())},t[3]=k,t[4]=m,t[5]=R):R=t[5];let z=R,re=i?u:pt,B=!i,ie;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(M,{}),t[6]=ie):ie=t[6];let V;t[7]!==re||t[8]!==B?(V=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:re,disabled:B,"aria-label":`Back`,type:`button`,children:ie}),t[7]=re,t[8]=B,t[9]=V):V=t[9];let H=a?d:pt,ae=!a,oe;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(F,{}),t[10]=oe):oe=t[10];let U;t[11]!==H||t[12]!==ae?(U=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:H,disabled:ae,"aria-label":`Forward`,type:`button`,children:oe}),t[11]=H,t[12]=ae,t[13]=U):U=t[13];let W;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`mx-0.5 h-4 w-px bg-border`}),t[14]=W):W=t[14];let se=s?pt:p,ce=r?`Stop`:`Refresh`,G;t[15]!==s||t[16]!==se||t[17]!==ce?(G=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:se,disabled:s,"aria-label":ce,type:`button`}),t[15]=s,t[16]=se,t[17]=ce,t[18]=G):G=t[18];let le;t[19]===r?le=t[20]:(le=(0,$.jsx)(qe,{refreshing:r}),t[19]=r,t[20]=le);let ue;t[21]!==G||t[22]!==le?(ue=(0,$.jsx)(pe,{render:G,children:le}),t[21]=G,t[22]=le,t[23]=ue):ue=t[23];let de=r?`Loading…`:`Refresh`,K;t[24]===de?K=t[25]:(K=(0,$.jsx)(me,{children:de}),t[24]=de,t[25]=K);let q;t[26]!==ue||t[27]!==K?(q=(0,$.jsxs)(he,{children:[ue,K]}),t[26]=ue,t[27]=K,t[28]=q):q=t[28];let fe;t[29]!==U||t[30]!==q||t[31]!==V?(fe=(0,$.jsxs)(`div`,{className:`surface-glass flex h-8 shrink-0 items-center gap-0.5 rounded-full border border-border/60 px-1 shadow-sm [&_button]:rounded-full`,role:`group`,"aria-label":`Navigation`,children:[V,U,W,q]}),t[29]=U,t[30]=q,t[31]=V,t[32]=fe):fe=t[32];let ge=P?k:n,_e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>j(e.target.value),t[33]=_e):_e=t[33];let ve;t[34]===n?ve=t[35]:(ve=()=>{j(n),te(!0),queueMicrotask(()=>O.current?.select())},t[34]=n,t[35]=ve);let ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{te(!1)},t[36]=ye):ye=t[36];let be;t[37]!==z||t[38]!==n?(be=e=>{e.key===`Enter`&&z(e),e.key===`Escape`&&(e.preventDefault(),j(n),O.current?.blur())},t[37]=z,t[38]=n,t[39]=be):be=t[39];let xe;t[40]!==c||t[41]!==ge||t[42]!==ve||t[43]!==be?(xe=(0,$.jsx)(`input`,{ref:O,value:ge,onChange:_e,onFocus:ve,onBlur:ye,onKeyDown:be,"aria-label":`Address`,placeholder:`Search or enter URL`,spellCheck:!1,disabled:c,"data-preview-url-input":!0,className:`w-full min-w-0 truncate bg-transparent text-center text-sm text-foreground outline-none placeholder:text-muted-foreground focus:text-left`}),t[40]=c,t[41]=ge,t[42]=ve,t[43]=be,t[44]=xe):xe=t[44];let Se;t[45]!==P||t[46]!==h?(Se=h&&!P?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-1 flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100 [&_button]:rounded-full`,children:(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,onClick:h,"aria-label":`Open in system browser`,type:`button`}),children:(0,$.jsx)(N,{})}),(0,$.jsx)(me,{children:`Open in system browser`})]})}):null,t[45]=P,t[46]=h,t[47]=Se):Se=t[47];let Ce;t[48]!==xe||t[49]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`surface-glass group/address relative flex h-8 min-w-0 flex-1 items-center rounded-full border border-border/60 px-8 shadow-sm transition-colors focus-within:border-ring has-disabled:opacity-64`,children:[xe,Se]}),t[48]=xe,t[49]=Se,t[50]=Ce):Ce=t[50];let we;t[51]!==S||t[52]!==C||t[53]!==w||t[54]!==T?(we=S?(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:S,disabled:w,"aria-label":C?`Cancel annotation`:`Annotate preview`,"aria-pressed":C?`true`:`false`,type:`button`}),children:(0,$.jsx)(f,{className:ne(C&&`text-primary`)})}),(0,$.jsx)(me,{children:w&&T?T:C?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[51]=S,t[52]=C,t[53]=w,t[54]=T,t[55]=we):we=t[55];let Te;t[56]!==_||t[57]!==g||t[58]!==v?(Te=g?(0,$.jsxs)(he,{children:[(0,$.jsxs)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:e=>g(e.shiftKey),"aria-label":v?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:_}),children:[(0,$.jsx)(o,{className:ne(v&&`text-destructive`)}),v?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(me,{children:v?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[56]=_,t[57]=g,t[58]=v,t[59]=Te):Te=t[59];let Ee;t[60]!==y||t[61]!==b||t[62]!==x?(Ee=y?(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,onClick:y,"aria-label":b?`Bring preview back from its window`:`Open preview in a window`,"aria-pressed":b?`true`:`false`,type:`button`,disabled:x}),children:(0,$.jsx)(A,{className:ne(b&&`text-primary`)})}),(0,$.jsx)(me,{children:b?`Bring back`:`Open in separate window`})]}):null,t[60]=y,t[61]=b,t[62]=x,t[63]=Ee):Ee=t[63];let De;t[64]!==ee||t[65]!==z||t[66]!==fe||t[67]!==Ce||t[68]!==we||t[69]!==Te||t[70]!==Ee||t[71]!==D?(De=(0,$.jsxs)(`form`,{onSubmit:z,className:`flex h-12 min-h-12 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-2.5 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[fe,ee,Ce,we,Te,Ee,D]}),t[64]=ee,t[65]=z,t[66]=fe,t[67]=Ce,t[68]=we,t[69]=Te,t[70]=Ee,t[71]=D,t[72]=De):De=t[72];let Oe;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={boxShadow:`0 0 6px 1px var(--color-ring)`},t[73]=Oe):Oe=t[73];let ke;t[74]===r?ke=t[75]:(ke=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Oe}),t[74]=r,t[75]=ke);let Ae;return t[76]!==De||t[77]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`relative`,children:[De,ke]}),t[76]=De,t[77]=ke,t[78]=Ae):Ae=t[78],Ae}function ht(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=gt(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(q,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(be,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function gt(e){return e.processName?e.processName:`Listening`}function _t(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let s=o,c=s.pathname===`/`?``:s.pathname,l=`${s.host}${c}${s.search}${s.hash}`,u;t[2]===r.lastVisitedAt?u=t[3]:(u=je(r.lastVisitedAt)?fe(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=u);let d=u;lt();let f;t[4]!==r.url||t[5]!==n?(f=(0,$.jsx)(q,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=f):f=t[6];let p=r.title??l,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:p}),t[7]=p,t[8]=m);let h=r.title?`${l} · `:``,g;t[9]!==h||t[10]!==d?(g=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[h,d]}),t[9]=h,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==i||t[16]!==f||t[17]!==_?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[f,_]}),t[15]=i,t[16]=f,t[17]=_,t[18]=v):v=t[18];let y=`Remove ${l} from history`,b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(P,{className:`size-3.5`}),t[19]=b):b=t[19];let x;t[20]!==a||t[21]!==y?(x=(0,$.jsx)(`button`,{type:`button`,"aria-label":y,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:b}),t[20]=a,t[21]=y,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==v?(S=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[v,x]}),t[23]=x,t[24]=v,t[25]=S):S=t[25],S}function vt(e){let t=(0,Q.c)(7),n=J(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:ke(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=yt({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function yt(e){let t=new Map;for(let n of e.configuredUrls){let e=xt(n);if(!e)continue;let r=bt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=bt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function bt(e,t){let n=e.toLowerCase();return`${ze(n)?`loopback`:n}:${t}`}function xt(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!ze(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function St(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=vt(c),u,d,f,p;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(Ct).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(ye,{children:[(0,$.jsx)(ge,{variant:`icon`,children:(0,$.jsx)(h,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(_e,{children:`No preview yet`}),(0,$.jsx)(ve,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],p=e;break bb0}f=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,u=`mx-auto flex w-full max-w-xl flex-col gap-6`,d=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(v,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(xe,{children:e.map(e=>(0,$.jsx)(_t,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else u=t[8],d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[13]!==s||t[14]!==l||t[15]!==n?(m=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(L,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(xe,{children:l.map(e=>(0,$.jsx)(ht,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=m):m=t[16];let g;t[17]!==u||t[18]!==d||t[19]!==m?(g=(0,$.jsxs)(`div`,{className:u,children:[d,m]}),t[17]=u,t[18]=d,t[19]=m,t[20]=g):g=t[20];let _;return t[21]!==f||t[22]!==g?(_=(0,$.jsx)(`div`,{className:f,children:g}),t[21]=f,t[22]=g,t[23]=_):_=t[23],_}function Ct(e){return URL.canParse(e.url)}var wt=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Tt=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(he,{children:[(0,$.jsx)(pe,{render:(0,$.jsx)(z,{render:(0,$.jsx)(E,{variant:`glass`,size:`icon`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(_,{})}),(0,$.jsx)(me,{children:`More`})]}),e[0]=t):t=e[0],t};function Et(e){let t=(0,Q.c)(69),{enabled:n,actions:r,zoomFactor:a,colorScheme:o,deviceToolbarVisible:s,onToggleDeviceToolbar:c,profileName:l,move:u}=e,d;t[0]===a?d=t[1]:(d=Math.round(a*100),t[0]=a,t[1]=d);let f=`${d}%`,m=!n,h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Tt,{}),t[2]=h):h=t[2];let _;t[3]!==r.hardReload||t[4]!==m?(_=(0,$.jsx)(i,{onClick:r.hardReload,disabled:m,children:`Hard reload`}),t[3]=r.hardReload,t[4]=m,t[5]=_):_=t[5];let v;t[6]!==r.openDevTools||t[7]!==m?(v=r.openDevTools?(0,$.jsx)(i,{onClick:r.openDevTools,disabled:m,children:`Open DevTools`}):null,t[6]=r.openDevTools,t[7]=m,t[8]=v):v=t[8];let y;t[9]===u?y=t[10]:(y=u?(0,$.jsx)(i,{onClick:u.onMove,children:u.label}):null,t[9]=u,t[10]=y);let b=s?`Hide device toolbar`:`Show device toolbar`,D;t[11]!==m||t[12]!==c||t[13]!==b?(D=(0,$.jsx)(i,{onClick:c,disabled:m,children:b}),t[11]=m,t[12]=c,t[13]=b,t[14]=D):D=t[14];let O;t[15]===m?O=t[16]:(O=(0,$.jsx)(k,{disabled:m,children:`Appearance`}),t[15]=m,t[16]=O);let A;t[17]===r?A=t[18]:(A=e=>r.setColorScheme(e),t[17]=r,t[18]=A);let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=wt.map(Ot),t[19]=M):M=t[19];let N;t[20]!==o||t[21]!==A?(N=(0,$.jsx)(T,{children:(0,$.jsx)(j,{value:o,onValueChange:A,children:M})}),t[20]=o,t[21]=A,t[22]=N):N=t[22];let P;t[23]!==N||t[24]!==O?(P=(0,$.jsxs)(I,{children:[O,N]}),t[23]=N,t[24]=O,t[25]=P):P=t[25];let te;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(w,{}),t[26]=te):te=t[26];let F;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`span`,{children:`Zoom`}),t[27]=F):F=t[27];let ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(g,{}),t[28]=ne):ne=t[28];let L;t[29]!==r.zoomOut||t[30]!==m?(L=(0,$.jsx)(E,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomOut,"aria-label":`Zoom out`,disabled:m,children:ne}),t[29]=r.zoomOut,t[30]=m,t[31]=L):L=t[31];let z;t[32]===f?z=t[33]:(z=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:f}),t[32]=f,t[33]=z);let re;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(S,{}),t[34]=re):re=t[34];let B;t[35]!==r.zoomIn||t[36]!==m?(B=(0,$.jsx)(E,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomIn,"aria-label":`Zoom in`,disabled:m,children:re}),t[35]=r.zoomIn,t[36]=m,t[37]=B):B=t[37];let ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(ee,{}),t[38]=ie):ie=t[38];let V;t[39]!==r.resetZoom||t[40]!==m?(V=(0,$.jsx)(E,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:r.resetZoom,"aria-label":`Reset zoom`,disabled:m,children:ie}),t[39]=r.resetZoom,t[40]=m,t[41]=V):V=t[41];let H;t[42]!==L||t[43]!==z||t[44]!==B||t[45]!==V?(H=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[L,z,B,V]}),t[42]=L,t[43]=z,t[44]=B,t[45]=V,t[46]=H):H=t[46];let ae;t[47]!==m||t[48]!==H?(ae=(0,$.jsxs)(i,{closeOnClick:!1,onClick:Dt,className:`justify-between`,disabled:m,children:[F,H]}),t[47]=m,t[48]=H,t[49]=ae):ae=t[49];let oe;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(w,{}),t[50]=oe):oe=t[50];let U;t[51]===l?U=t[52]:(U=l?(0,$.jsx)(p,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,l]})}):null,t[51]=l,t[52]=U);let W;t[53]===r.clearCookies?W=t[54]:(W=(0,$.jsx)(i,{onClick:r.clearCookies,children:`Clear cookies`}),t[53]=r.clearCookies,t[54]=W);let se;t[55]===r.clearCache?se=t[56]:(se=(0,$.jsx)(i,{onClick:r.clearCache,children:`Clear cache`}),t[55]=r.clearCache,t[56]=se);let ce;t[57]!==U||t[58]!==W||t[59]!==se?(ce=(0,$.jsxs)(C,{children:[U,W,se]}),t[57]=U,t[58]=W,t[59]=se,t[60]=ce):ce=t[60];let G;return t[61]!==P||t[62]!==ae||t[63]!==ce||t[64]!==_||t[65]!==v||t[66]!==y||t[67]!==D?(G=(0,$.jsxs)(x,{children:[h,(0,$.jsxs)(R,{align:`end`,sideOffset:6,children:[_,v,y,D,P,te,ae,oe,ce]})]}),t[61]=P,t[62]=ae,t[63]=ce,t[64]=_,t[65]=v,t[66]=y,t[67]=D,t[68]=G):G=t[68],G}function Dt(e){return e.preventDefault()}function Ot(e){return(0,$.jsx)(te,{value:e.value,children:e.label},e.value)}function kt(e){return m[e]||(e.length>0?e:`Network error`)}function At(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Pt(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Nt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(E,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function jt(e){let t=(0,Q.c)(44),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Pt(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=kt(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Nt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),t[14]=y):y=t[14];let b,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`li`,{children:`Checking your connection`}),b=(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),t[15]=b,t[16]=x):(b=t[15],x=t[16]);let S;t[17]===o?S=t[18]:(S=o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,t[17]=o,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`}),t[19]=C):C=t[19];let w;t[20]===S?w=t[21]:(w=(0,$.jsx)(Xe,{children:(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[y,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[x,b,S,C]})]})}),t[20]=S,t[21]=w);let T;t[22]!==s||t[23]!==w?(T=(0,$.jsx)(Ze,{open:s,children:w}),t[22]=s,t[23]=w,t[24]=T):T=t[24];let D;t[25]===m?D=t[26]:(D=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[25]=m,t[26]=D);let ee;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>c(Mt),t[27]=ee):ee=t[27];let O=s?`Hide details`:`Details`,k;t[28]===O?k=t[29]:(k=(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:ee,children:O}),t[28]=O,t[29]=k);let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`div`,{className:`flex-1`}),t[30]=A):A=t[30];let j;t[31]===o?j=t[32]:(j=o?(0,$.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[31]=o,t[32]=j);let M;t[33]===a?M=t[34]:(M=(0,$.jsx)(E,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[33]=a,t[34]=M);let N;t[35]!==k||t[36]!==j||t[37]!==M?(N=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[k,A,j,M]}),t[35]=k,t[36]=j,t[37]=M,t[38]=N):N=t[38];let P;return t[39]!==T||t[40]!==D||t[41]!==N||t[42]!==v?(P=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,T,D,N]})}),t[39]=T,t[40]=D,t[41]=N,t[42]=v,t[43]=P):P=t[43],P}function Mt(e){return!e}function Nt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Pt(e){try{return new URL(e).host}catch{return null}}var Ft=1500,It=.001;function Lt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<It))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},Ft),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=ne(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function Rt(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var zt=typeof window>`u`?null:W();function Bt(e){let t=(0,Q.c)(12),n=nt(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?rt({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void zt?.shell.openExternal(e.url).catch(Vt),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(At,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function Vt(){}function Ht({threadRef:e,tabId:t,configuredUrls:n,visible:r,onSendAnnotation:i}){let[o,f]=(0,Z.useState)(void 0),[p,m]=(0,Z.useState)(!1),h=ce(e.environmentId,`orchestration:operate`)&&!!i,g=Ke(),_=(0,Z.useRef)(null),v=(0,Z.useRef)(!0),b=(0,Z.useRef)(e);b.current=e;let x=u(e),S=we(e,50),C=a(e=>e.addPreviewAnnotation),w=a(e=>e.addImage),T=ae(e.environmentId),ee=T?new URL(T).hostname:null,k=le(Fe.open),A=le(Fe.close,`preview close`),j=U(e.environmentId)?.label??`the environment`,M=oe(),N=ie(e.environmentId),P=le(Fe.resize,`preview viewport resize`),te=le(Fe.adjust,`preview appearance or zoom`);ot(e),(0,Z.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let F=t??x.activeTabId,I=F?We(e,x.serverEpoch,F):null,L=F&&I?g.has(I)?I:$e(e,F):null,R=F?x.sessions[F]??null:null,z=Ce(e.environmentId,R),W=R?.runtime===`server`&&!z,K=R?.runtime===`server`,q=(0,Z.useRef)(null),[fe,ge]=(0,Z.useState)(!1),_e=(0,Z.useRef)(null),[ve,ye]=(0,Z.useState)(0),be=R?.runtime===`server`&&(R.viewport??O)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=_e.current;if(e&&be)return Se(e,([e])=>ye(Math.max(1,Math.round(e?.contentRect.width??0))))},[be]);let[xe,je]=(0,Z.useState)(null),Ne=W&&xe!==I,[ze,qe]=(0,Z.useState)(null),J=F?x.desktopByTabId[F]??null:null,Y=R?.navStatus??{_tag:`Idle`},Xe=Y._tag===`Idle`?``:Y.url,Ze=J?.loading??Y._tag===`Loading`,nt=J?.canGoBack??R?.canGoBack??!1,rt=J?.canGoForward??R?.canGoForward??!1,lt=Y._tag===`Idle`,Q=Y._tag===`LoadFailed`,dt=st(R),pt=W&&!dt&&!Q&&ze!==I,ht=J?.controller??`none`,gt=R?.viewport??O,_t=Ee(),vt=R?.profileId??`default`,yt=Rt(_t.profiles,vt),bt=He(e=>I?e.byTabId[I]?.rect??null:null),xt=Y._tag===`Success`?Y.url:null,Ct=Y._tag===`Success`?Y.title:null,wt=S[0]?.url,Tt=D(e);(0,Z.useEffect)(()=>{xt&&Ct&&wt&&De(b.current,xt,Ct,ee)},[ee,wt,Ct,xt,Tt]);let Dt=(0,Z.useCallback)(async t=>{if(W&&q.current)return!Ne&&(q.current.navigate(t),y(e,t),!0);if(I&&X)return await X.navigate(I,t),y(e,t),!0;let n=await Ue({openPreview:k,threadRef:e,url:t});if(n._tag===`Failure`&&!re(n)){let e=B(n);e instanceof Pe&&H.add({type:`error`,title:`Unable to open browser`,description:e.message})}return n._tag===`Success`},[W,k,I,Ne,e]),Ot=(0,Z.useCallback)(async t=>{try{let n=Le(t,Ie(se()));await Dt(n)&&Oe(e,n)}catch{}},[Dt,e]),kt=(0,Z.useCallback)(async t=>{try{let n=W||!X?Re(t):ke(e.environmentId,t);await Dt(n)&&Oe(e,t)}catch{}},[W,Dt,e]),At=(0,Z.useCallback)(()=>{W?q.current?.reload():X&&I&&X.refresh(I)},[W,I]),Mt=(0,Z.useCallback)(async t=>{if(!F)return;let n=await te({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:F,...t}});if(n._tag===`Failure`){let e=B(n);H.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}d(e,n.value)},[te,F,e]),Nt=R?.zoomFactor??1,Pt=(0,Z.useCallback)(e=>{let t=s.indexOf(Nt),n=e===0?1:s[Math.min(Math.max((t<0?7:t)+e,0),s.length-1)];n!==Nt&&Mt({zoomFactor:n})},[Mt,Nt]),Ft=(0,Z.useCallback)(()=>{K?Pt(1):X&&I&&X.zoomIn(I)},[I,K,Pt]),It=(0,Z.useCallback)(()=>{K?Pt(-1):X&&I&&X.zoomOut(I)},[I,K,Pt]),Vt=(0,Z.useCallback)(()=>{K?Pt(0):X&&I&&X.resetZoom(I)},[I,K,Pt]),Ht=(0,Z.useCallback)(async t=>{if(!F)return;let n=await P({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:F,viewport:t}});if(n._tag===`Failure`){let e=B(n);throw H.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}d(e,n.value)},[P,F,e]),Ut=()=>{if(I){if(gt._tag!==`fill`){Ye(I,O).catch(()=>void 0);return}Ye(I,Me({defaults:_t,panelRect:bt,zoomFactor:K?Nt:J?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(I)return Ve(I,Ht)},[Ht,I]);let Wt=(0,Z.useCallback)(()=>{W?q.current?.history(-1):X&&I&&X.goBack(I)},[W,I]),Gt=(0,Z.useCallback)(()=>{W?q.current?.history(1):X&&I&&X.goForward(I)},[W,I]),Kt=(0,Z.useCallback)(()=>{zt&&Xe&&zt.shell.openExternal(Xe).catch(()=>void 0)},[Xe]),qt=Te(e.environmentId,M,N,R),Jt=qt===`server`?`Open in ${j}'s browser`:`Open on this computer`,Yt=(0,Z.useCallback)(async()=>{if(!qt||!F||!R)return;let t=await Ue({openPreview:k,threadRef:e,...Xe?{url:qt===`desktop`?ke(e.environmentId,Xe):Xe}:{},viewport:gt,...R.profileId===void 0?{}:{profileId:R.profileId},runtime:qt});if(t._tag===`Failure`){if(re(t))return;let e=B(t);H.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}ue.getState().openBrowser(e,t.value.tabId),await at({closePreview:A,snapshot:R,tabId:F,threadRef:e})},[A,qt,k,R,F,e,Xe,gt]),Xt=e=>()=>{e&&I&&e(I).catch(()=>void 0)},Zt=K?{hardReload:()=>void Mt({hardReload:!0}),setColorScheme:e=>void Mt({colorScheme:e}),zoomIn:Ft,zoomOut:It,resetZoom:Vt,clearCookies:()=>void Mt({clear:`cookies`}),clearCache:()=>void Mt({clear:`cache`}),...z&&X?{openDevTools:Xt(X.openDevTools)}:{}}:X?{hardReload:Xt(X.hardReload),setColorScheme:e=>{I&&X?.setColorScheme(I,e).catch(()=>void 0)},zoomIn:Ft,zoomOut:It,resetZoom:Vt,clearCookies:()=>void X?.clearCookies(e.environmentId,vt).catch(()=>void 0),clearCache:()=>void X?.clearCache(e.environmentId,vt).catch(()=>void 0),openDevTools:Xt(X.openDevTools)}:null,Qt=(0,Z.useCallback)(()=>{X&&I&&(J?.pictureInPicture?X.pictureInPicture.close:X.pictureInPicture.open)(I).catch(e=>{H.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[J?.pictureInPicture,I]),$t=(0,Z.useCallback)(t=>{if(!X||!I||!F)return;let n=X;if(L){Ge(L).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){H.update(r,de({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{H.update(r,de({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:V(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{H.update(r,de({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i}}}))};r=H.add(de({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i}}}))},e=>{H.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){Qe(I,e,F).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Be(e)||H.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(I).then(e=>{let t={children:V(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{H.update(a,de({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t}}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=H.add(de({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t}}}))},e=>{H.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[L,I,F,e]),en=(0,Z.useCallback)(()=>{if(!X||!I)return;if(_.current){_.current.cancelled=!0,X.cancelPickElement(I).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;_.current=n,m(!0),(async()=>{try{if(await X.setAnnotationSendEnabled?.(I,!!i&&G(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await X.pickElement(I);if(!t||n.cancelled)return;_.current===n&&(_.current=null,v.current&&m(!1),r=!0);let{annotation:a,submission:o,screenshotFailed:s=!1}=t,c=ft(a),l=s||c.status===`failed`,u=c.status===`failed`?{...a,screenshot:null}:a;C(e,u),l&&H.add(de({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=c.status===`captured`?c.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&w(e,f),o===`send`&&G(e.environmentId,`orchestration:operate`)&&i?.(u,f)}catch{}finally{let e=_.current===n;if(e&&(_.current=null,v.current&&m(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[w,C,i,I,e]);return(0,Z.useEffect)(()=>{p&&X&&I&&X.setAnnotationSendEnabled?.(I,h).catch(()=>void 0)},[h,p,I]),(0,Z.useEffect)(()=>()=>{_.current&&(_.current.cancelled=!0,_.current=null,X&&I&&X.cancelPickElement(I).catch(()=>void 0),v.current&&m(!1))},[I]),(0,Z.useEffect)(()=>{if(r)return ut(e=>{switch(e){case`refresh`:At();return;case`focus-url`:f(e=>(e??0)+1);return;case`zoom-in`:Ft();return;case`zoom-out`:It();return;case`reset-zoom`:Vt();return;case`toggle-panel`:return}})},[At,Vt,Ft,It,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":D(e),children:[(0,$.jsx)(mt,{url:Xe,loading:Ze||pt,canGoBack:nt&&!Ne,canGoForward:rt&&!Ne,refreshDisabled:lt||Ne,inputDisabled:Ne,focusUrlNonce:o,onBack:Wt,onForward:Gt,onRefresh:At,onSubmit:e=>void Ot(e),onOpenInBrowser:F?Kt:void 0,onCapture:X&&F&&!W?$t:void 0,captureDisabled:!J||Q||J.pictureInPicture,recording:L!==null,onSeparateWindow:X&&F&&(!K||z)?Qt:void 0,separateWindow:J?.pictureInPicture??!1,separateWindowDisabled:I===null||!K&&!(J?.hasWebContents??!1),onPickElement:X&&F&&!W?en:void 0,pickActive:p,pickDisabled:!F||Q,pickDisabledReason:Q?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:vt===_t.profileId?null:(0,$.jsxs)(he,{children:[vt===`incognito`?(0,$.jsx)(pe,{render:(0,$.jsx)(`span`,{role:`img`,"aria-label":yt,className:`flex shrink-0 text-muted-foreground`}),children:(0,$.jsx)(c,{className:`size-4`})}):(0,$.jsx)(pe,{render:(0,$.jsx)(l,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:yt})}),(0,$.jsx)(me,{side:`top`,children:yt})]}),trailingActions:Zt?(0,$.jsx)(Et,{enabled:I!==null&&(K||(J?.hasWebContents??!1)),actions:Zt,...qt?{move:{label:Jt,onMove:()=>void Yt()}}:{},profileName:yt,zoomFactor:K?Nt:J?.zoomFactor??1,colorScheme:K?R?.colorScheme??`system`:J?.colorScheme??`system`,deviceToolbarVisible:gt._tag!==`fill`,onToggleDeviceToolbar:Ut}):null}),(0,$.jsxs)(`div`,{ref:_e,className:`relative min-h-0 flex-1 overflow-hidden`,children:[I&&R&&W?(0,$.jsxs)($.Fragment,{children:[gt._tag!==`fill`&&!dt&&!Q?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(Je,{setting:gt,width:ve,aspectRatio:fe?gt.width/gt.height:null,onAspectRatioChange:e=>ge(e!==null),onChange:e=>Ye(I,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:gt._tag===`fill`?0:38},children:(0,$.jsx)(ct,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:R.tabId,visible:r,onFirstFrame:()=>qe(I),onControl:e=>je(e?.controller===`you`?I:null),onPopup:t=>tt(e,t,`panel`),className:ne(`absolute inset-0 h-full w-full`,(dt||Q)&&`invisible`)},I)})]}):I&&R&&!dt?X&&J?.pictureInPicture?(0,$.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`Showing in a separate window.`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(E,{size:`sm`,variant:`outline`,onClick:Qt,children:`Bring back`}),(0,$.jsx)(E,{size:`sm`,variant:`ghost`,onClick:()=>void X?.pictureInPicture.open(I),children:`Show window`})]})]}):X?(0,$.jsx)(et,{tabId:I,visible:r&&!Q,className:`absolute inset-0 h-full w-full`},I):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,dt?(0,$.jsx)(St,{threadRef:e,environmentId:e.environmentId,configuredUrls:n,recentEntries:S,onRemoveRecent:t=>Ae(e,t),onOpenUrl:e=>void kt(e)}):null,R&&J?(0,$.jsx)(Lt,{zoomFactor:J.zoomFactor}):null,I&&J&&!dt&&!Q&&!g.has(I)?(0,$.jsx)(it,{tabId:I,zoomFactor:J.zoomFactor,controller:ht}):null,Y._tag===`LoadFailed`&&Y.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Bt,{threadRef:e,tabId:R?.tabId??``,url:Y.url,download:Y.download})}):Y._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(jt,{url:Y.url,code:Y.code,description:Y.description,onReload:At,...qt===`server`?{move:{label:Jt,onMove:()=>void Yt()}}:{}})}):null]})]})}function Ut(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o,onSendAnnotation:s}=e,c=Ne(r.environmentId),l=ce(r.environmentId,b);if(!l||!c){let e=l?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(K,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{tabId:i},t[5]=i,t[6]=u);let d;t[7]===s?d=t[8]:(d=s?{onSendAnnotation:s}:{},t[7]=s,t[8]=d);let f;t[9]!==a||t[10]!==u||t[11]!==d||t[12]!==r||t[13]!==o?(f=(0,$.jsx)(Ht,{threadRef:r,...u,configuredUrls:a,visible:o,...d}),t[9]=a,t[10]=u,t[11]=d,t[12]=r,t[13]=o,t[14]=f):f=t[14];let p;return t[15]!==n||t[16]!==f?(p=(0,$.jsx)(K,{mode:n,children:f}),t[15]=n,t[16]=f,t[17]=p):p=t[17],p}export{Ut as PreviewPanel};
|
|
2
|
+
//# sourceMappingURL=PreviewPanel-BkFeksTl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{Fs as r,Ht as ee,Jt as te,Kt as ne,Nt as re,Oh as i,Vt as ie,rn as ae}from"./utils-BoMYW9A3.js";import{a,c as o,o as s,s as c,t as l}from"./select-DaYjjw1q.js";import{t as oe}from"./useNavigate-DdjG4MB_.js";import{i as se}from"./toast-B84QdqqM.js";import{E as ce,i as le}from"./useSettings-CaJMqrvF.js";import{t as ue}from"./server-sXApTCjZ.js";import{t as u}from"./pullRequestDetail.logic-RASi2EgP.js";import{i as de}from"./p4ProjectFile-qmvlbzKv.js";import{C as d,F as fe,I as f,P as pe,R as me,V as he,a as p,m as ge,n as _e,r as m,s as ve}from"./settingsLayout-CFQx1XDM.js";import{ir as h,va as ye}from"./main-BWh6jqG2.js";import{t as be}from"./ProviderModelPicker-DJQYH_Pp.js";import{n as xe,t as Se}from"./runtimeModeConfig-Rxeb1uGg.js";var Ce=t(),g=e(n(),1),we=[`recursive`,`top-level`,`none`];function Te(e){return e!==null&&we.includes(e)}function Ee(e){let t=(0,Ce.c)(95),{category:n}=e,{scope:Ee,target:_,targets:Ae,connectedEnvironments:je}=he(),v=fe(),y=me(),Me=oe(),{environments:b}=ce(),x,S,C,w,T;if(t[0]!==b||t[1]!==v||t[2]!==_){C=_?b.find(e=>e.environmentId===_.environmentId):void 0;let e=C?.serverConfig?.providers??ue;w=ne(e,v.defaultModelSelection),x=te(ie(ee(e),v,_?.projectId??null)),S=re(v,e,w?.instanceId,w?.model),T=x.find(e=>e.instanceId===w?.instanceId),t[0]=b,t[1]=v,t[2]=_,t[3]=x,t[4]=S,t[5]=C,t[6]=w,t[7]=T}else x=t[3],S=t[4],C=t[5],w=t[6],T=t[7];let E=T,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=[`defaultModelSelection`],t[8]=D):D=t[8];let O=f(D),k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=[`defaultRuntimeMode`],t[9]=k):k=t[9];let A=f(k),Ne=Se[v.defaultRuntimeMode].icon,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=[`defaultThreadEnvMode`],t[10]=j):j=t[10];let M=f(j),N;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=[`worktreeSubmodules`],t[11]=N):N=t[11];let P=f(N),F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=[`enableAgentBrowserAccess`],t[12]=F):F=t[12];let I=f(F),L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=[`defaultAutoPull`],t[13]=L):L=t[13];let R=f(L),Pe;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=[`removeAgentCreditsOnMerge`],t[14]=Pe):Pe=t[14];let z=f(Pe),B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`pullRequestMergeMethod`],t[15]=B):B=t[15];let Fe=f(B),Ie;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=[`defaultModelSelection`],t[16]=Ie):Ie=t[16];let Le=pe(Ie),V=Ee.kind===`project`||Ee.kind===`checkout`,H=je.length===0,Re;t[17]===_?Re=t[18]:(Re=_?de(_.settings,null,null,null).settings:null,t[17]=_,t[18]=Re);let ze=Re,Be;t[19]!==x||t[20]!==b||t[21]!==v||t[22]!==Ae?(Be=function(e,t){let n=x.find(t=>t.instanceId===e);for(let r of Ae){let te=b.find(e=>e.environmentId===r.environmentId),ne=te?.serverConfig;if(!ne)continue;let i=ie(ee(ne.providers),r.settings,r.projectId).find(t=>t.instanceId===e),ae=re(le(r.settings,v),ne.providers).get(e);if(!i?.enabled||!i.isAvailable||i.driverKind!==n?.driverKind||!ae?.some(e=>e.slug===t&&!e.isUnavailable))return`This model is unavailable on ${te?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},t[19]=x,t[20]=b,t[21]=v,t[22]=Ae,t[23]=Be):Be=t[23];let U=Be,Ve;t[24]!==U||t[25]!==y?(Ve=e=>{let t=e?U(e.instanceId,e.model):null;if(t){se.add({type:`error`,title:`Default model not saved`,description:t});return}y({defaultModelSelection:e})},t[24]=U,t[25]=y,t[26]=Ve):Ve=t[26];let W=Ve,He;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`defaultModelSelection`],t[27]=He):He=t[27];let Ue=V?`Model for new threads in this project.`:`Default model for new threads. Projects can override it.`,We=H||O||Le===`project`?void 0:v.defaultModelSelection===null?`Automatic`:void 0,G;t[28]!==W||t[29]!==v.defaultModelSelection?(G=v.defaultModelSelection===null?null:(0,g.jsx)(m,{label:`default model`,onClick:()=>W(null)}),t[28]=W,t[29]=v.defaultModelSelection,t[30]=G):G=t[30];let K;t[31]!==E||t[32]!==x||t[33]!==O||t[34]!==U||t[35]!==S||t[36]!==Me||t[37]!==C||t[38]!==w||t[39]!==W||t[40]!==v.planModeEnabled?(K=w&&E?(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[(0,g.jsx)(be,{environmentId:C?.environmentId??null,activeInstanceId:w.instanceId,model:w.model,lockedProvider:null,instanceEntries:x,modelOptionsByInstance:S,triggerClassName:_e,...O?{triggerLabel:`Mixed`}:{},getModelDisabledReason:U,onOpenProviderSetup:e=>{C&&Me({to:`/settings/providers`,search:{environmentId:C.environmentId,instanceId:e}})},onInstanceModelChange:(e,t)=>W(r(e,t))}),O?null:(0,g.jsx)(ae,{provider:E.driverKind,models:E.models,model:w.model,modelOptions:w.options??[],allowPromptInjectedEffort:!1,planModeEnabled:v.planModeEnabled,triggerClassName:_e,onModelOptionsChange:e=>W(r(w.instanceId,w.model,e))})]}):(0,g.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No providers available`}),t[31]=E,t[32]=x,t[33]=O,t[34]=U,t[35]=S,t[36]=Me,t[37]=C,t[38]=w,t[39]=W,t[40]=v.planModeEnabled,t[41]=K):K=t[41];let Ge;t[42]!==O||t[43]!==Ue||t[44]!==We||t[45]!==G||t[46]!==K?(Ge=(0,g.jsx)(p,{serverScoped:!0,settingKeys:He,mixed:O,id:`default-model`,title:`Model`,description:Ue,status:We,resetAction:G,control:K}),t[42]=O,t[43]=Ue,t[44]=We,t[45]=G,t[46]=K,t[47]=Ge):Ge=t[47];let Ke=Ge,qe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(qe=[`defaultThreadEnvMode`],t[48]=qe):qe=t[48];let q;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(q=h(`new-threads`),t[49]=q):q=t[49];let Je=V?`Where new threads in this project start.`:`Where new threads start. Projects and their p4.json can override it.`,J;t[50]!==V||t[51]!==v.defaultThreadEnvMode||t[52]!==y?(J=!V&&v.defaultThreadEnvMode!==null?(0,g.jsx)(m,{label:`default workspace`,onClick:()=>y({defaultThreadEnvMode:null})}):null,t[50]=V,t[51]=v.defaultThreadEnvMode,t[52]=y,t[53]=J):J=t[53];let Ye=M?null:ze?.defaultThreadEnvMode??null,Y;t[54]===y?Y=t[55]:(Y=e=>{(e===`auto`||e===`local`||e===`worktree`)&&y({defaultThreadEnvMode:e})},t[54]=y,t[55]=Y);let X;t[56]===H?X=t[57]:(X=(0,g.jsx)(c,{size:`sm`,"aria-label":`Default workspace`,children:(0,g.jsx)(o,{children:e=>e===`auto`||e===`local`||e===`worktree`?d(e):H?`Unavailable`:`Mixed`})}),t[56]=H,t[57]=X);let Xe;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,g.jsx)(a,{value:`auto`,children:d(`auto`)}),t[58]=Xe):Xe=t[58];let Ze;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,g.jsx)(a,{value:`local`,children:d(`local`)}),t[59]=Ze):Ze=t[59];let Qe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,g.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[Xe,Ze,(0,g.jsx)(a,{value:`worktree`,children:d(`worktree`)})]}),t[60]=Qe):Qe=t[60];let Z;t[61]!==Ye||t[62]!==Y||t[63]!==X?(Z=(0,g.jsxs)(l,{value:Ye,onValueChange:Y,children:[X,Qe]}),t[61]=Ye,t[62]=Y,t[63]=X,t[64]=Z):Z=t[64];let $e;t[65]!==M||t[66]!==Je||t[67]!==J||t[68]!==Z?($e=(0,g.jsx)(p,{serverScoped:!0,settingKeys:qe,mixed:M,id:q.id,title:`Workspace`,description:Je,resetAction:J,control:Z}),t[65]=M,t[66]=Je,t[67]=J,t[68]=Z,t[69]=$e):$e=t[69];let et=$e,tt=n===`general`||n===`project`?`project-defaults`:n===`integrations`?`browser-access`:`source-control-defaults`,nt=n===`general`||n===`project`?`New threads`:n===`integrations`?`Browser`:`Repositories`,Q;t[70]!==Ne||t[71]!==n||t[72]!==ze?.worktreeSubmodules||t[73]!==V||t[74]!==z||t[75]!==R||t[76]!==I||t[77]!==Fe||t[78]!==A||t[79]!==P||t[80]!==Ke||t[81]!==v.defaultAutoPull||t[82]!==v.defaultRuntimeMode||t[83]!==v.enableAgentBrowserAccess||t[84]!==v.pullRequestMergeMethod||t[85]!==v.removeAgentCreditsOnMerge||t[86]!==v.worktreeSubmodules||t[87]!==H||t[88]!==y||t[89]!==et?(Q=n===`project`?(0,g.jsxs)(g.Fragment,{children:[Ke,et]}):n===`general`?(0,g.jsxs)(g.Fragment,{children:[Ke,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultRuntimeMode`],mixed:A,...h(`default-permissions`),description:V?`Permissions for new threads in this project.`:`Default permissions for new threads. Projects can override them.`,resetAction:v.defaultRuntimeMode===i.defaultRuntimeMode?null:(0,g.jsx)(m,{label:`default permissions`,onClick:()=>y({defaultRuntimeMode:i.defaultRuntimeMode})}),control:(0,g.jsxs)(l,{value:A?null:v.defaultRuntimeMode,onValueChange:e=>{e&&y({defaultRuntimeMode:e})},children:[(0,g.jsxs)(c,{size:`sm`,"aria-label":`Default permissions`,children:[!A&&(0,g.jsx)(Ne,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,g.jsx)(o,{children:A?`Mixed`:Se[v.defaultRuntimeMode].label})]}),(0,g.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:xe.map(ke)})]})}),et,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`worktreeSubmodules`],mixed:P,...h(`worktree-submodules`),description:V?`How new worktrees in this project populate git submodules.`:`How new worktrees populate git submodules. Projects and their p4.json can override it.`,resetAction:!V&&v.worktreeSubmodules!==null?(0,g.jsx)(m,{label:`worktree submodules`,onClick:()=>y({worktreeSubmodules:null})}):null,control:(0,g.jsxs)(l,{value:P?null:ze?.worktreeSubmodules??null,onValueChange:e=>{Te(e)&&y({worktreeSubmodules:e})},children:[(0,g.jsx)(c,{size:`sm`,"aria-label":`Worktree submodules`,children:(0,g.jsx)(o,{children:e=>Te(e)?ge[e]:H?`Unavailable`:`Mixed`})}),(0,g.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:we.map(Oe)})]})})]}):n===`source-control`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultAutoPull`],mixed:R,id:`automatic-pull`,title:`Automatically pull`,description:V?`Keeps this project's default branch current when the checkout has no local changes or commits.`:`Keeps the default branch current when the checkout has no local changes or commits. Projects can override it.`,resetAction:v.defaultAutoPull?(0,g.jsx)(m,{label:`default automatic pull`,tooltip:`Reset automatic pull to off`,onClick:()=>y({defaultAutoPull:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Default automatic pull`,mixed:R,checked:!R&&v.defaultAutoPull,onCheckedChange:e=>y({defaultAutoPull:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`removeAgentCreditsOnMerge`],mixed:z,...h(`remove-agent-credits-on-merge`),description:`Remove recognized agent credit lines from GitHub merge and squash messages, keeping human co-authors. Includes auto-merge. Excludes merge queues, stack merges, and existing commits.`,resetAction:v.removeAgentCreditsOnMerge?(0,g.jsx)(m,{label:`agent credit removal`,tooltip:`Keep agent credits`,onClick:()=>y({removeAgentCreditsOnMerge:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Remove agent credits when merging`,mixed:z,checked:!z&&v.removeAgentCreditsOnMerge,onCheckedChange:e=>y({removeAgentCreditsOnMerge:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`pullRequestMergeMethod`],mixed:Fe,...h(`pull-request-merge-method`),description:V?`Pull requests in this project start with this method.`:`Pull requests start with this method. Last selected reuses whatever you chose most recently on this device.`,resetAction:v.pullRequestMergeMethod===null?null:(0,g.jsx)(m,{label:`default merge method`,tooltip:`Reset to last selected`,onClick:()=>y({pullRequestMergeMethod:null})}),control:(0,g.jsxs)(l,{value:Fe?null:v.pullRequestMergeMethod??`last`,onValueChange:e=>{e===`last`?y({pullRequestMergeMethod:null}):(e===`merge`||e===`squash`||e===`rebase`)&&y({pullRequestMergeMethod:e})},children:[(0,g.jsx)(c,{size:`sm`,"aria-label":`Default pull request merge method`,children:(0,g.jsx)(o,{children:De})}),(0,g.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[(0,g.jsx)(a,{value:`last`,children:`Last selected`}),(0,g.jsx)(a,{value:`merge`,children:u.merge}),(0,g.jsx)(a,{value:`squash`,children:u.squash}),(0,g.jsx)(a,{value:`rebase`,children:u.rebase})]})]})})]}):(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`enableAgentBrowserAccess`],mixed:I,id:h(`agent-browser-access`).id,title:`Agent browser access`,description:V?`Allow agents in this project to use the shared browser. Applies when the agent session next starts.`:`Allow agents to use the shared browser. Projects can override it.`,resetAction:v.enableAgentBrowserAccess===i.enableAgentBrowserAccess?null:(0,g.jsx)(m,{label:`default browser access`,onClick:()=>y({enableAgentBrowserAccess:i.enableAgentBrowserAccess})}),control:(0,g.jsx)(ye,{"aria-label":`Agent browser access`,mixed:I,checked:!I&&v.enableAgentBrowserAccess,onCheckedChange:e=>y({enableAgentBrowserAccess:e})})})}),t[70]=Ne,t[71]=n,t[72]=ze?.worktreeSubmodules,t[73]=V,t[74]=z,t[75]=R,t[76]=I,t[77]=Fe,t[78]=A,t[79]=P,t[80]=Ke,t[81]=v.defaultAutoPull,t[82]=v.defaultRuntimeMode,t[83]=v.enableAgentBrowserAccess,t[84]=v.pullRequestMergeMethod,t[85]=v.removeAgentCreditsOnMerge,t[86]=v.worktreeSubmodules,t[87]=H,t[88]=y,t[89]=et,t[90]=Q):Q=t[90];let $;return t[91]!==tt||t[92]!==nt||t[93]!==Q?($=(0,g.jsx)(ve,{id:tt,title:nt,children:Q}),t[91]=tt,t[92]=nt,t[93]=Q,t[94]=$):$=t[94],$}function De(e){return e===`merge`||e===`squash`||e===`rebase`?u[e]:e===`last`?`Last selected`:`Mixed`}function Oe(e){return(0,g.jsx)(a,{value:e,children:ge[e]},e)}function ke(e){let t=Se[e],n=t.icon;return(0,g.jsx)(a,{value:e,className:`min-w-64`,children:(0,g.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,g.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,g.jsx)(`span`,{className:`text-xs leading-4 text-muted-foreground`,children:t.description})]})},e)}export{Ee as t};
|
|
2
|
-
//# sourceMappingURL=ProjectDefaultsSettings-
|
|
1
|
+
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{Fs as r,Ht as ee,Jt as te,Kt as ne,Nt as re,Oh as i,Vt as ie,rn as ae}from"./utils-DhUt689t.js";import{a,c as o,o as s,s as c,t as l}from"./select-D_zHR42Y.js";import{t as oe}from"./useNavigate-BWqAWfiZ.js";import{i as se}from"./toast-DXWclCrr.js";import{E as ce,i as le}from"./useSettings-gPlpTIWi.js";import{t as ue}from"./server-6nKYyc8r.js";import{t as u}from"./pullRequestDetail.logic-sbOM8yDW.js";import{i as de}from"./p4ProjectFile-CwpteA7b.js";import{C as d,F as fe,I as f,P as pe,R as me,V as he,a as p,m as ge,n as _e,r as m,s as ve}from"./settingsLayout-4ySvFdXb.js";import{ir as h,va as ye}from"./main-VfCRP294.js";import{t as be}from"./ProviderModelPicker-JNM9nJs_.js";import{n as xe,t as Se}from"./runtimeModeConfig-BTG9FTYe.js";var Ce=t(),g=e(n(),1),we=[`recursive`,`top-level`,`none`];function Te(e){return e!==null&&we.includes(e)}function Ee(e){let t=(0,Ce.c)(95),{category:n}=e,{scope:Ee,target:_,targets:Ae,connectedEnvironments:je}=he(),v=fe(),y=me(),Me=oe(),{environments:b}=ce(),x,S,C,w,T;if(t[0]!==b||t[1]!==v||t[2]!==_){C=_?b.find(e=>e.environmentId===_.environmentId):void 0;let e=C?.serverConfig?.providers??ue;w=ne(e,v.defaultModelSelection),x=te(ie(ee(e),v,_?.projectId??null)),S=re(v,e,w?.instanceId,w?.model),T=x.find(e=>e.instanceId===w?.instanceId),t[0]=b,t[1]=v,t[2]=_,t[3]=x,t[4]=S,t[5]=C,t[6]=w,t[7]=T}else x=t[3],S=t[4],C=t[5],w=t[6],T=t[7];let E=T,D;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=[`defaultModelSelection`],t[8]=D):D=t[8];let O=f(D),k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=[`defaultRuntimeMode`],t[9]=k):k=t[9];let A=f(k),Ne=Se[v.defaultRuntimeMode].icon,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=[`defaultThreadEnvMode`],t[10]=j):j=t[10];let M=f(j),N;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=[`worktreeSubmodules`],t[11]=N):N=t[11];let P=f(N),F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=[`enableAgentBrowserAccess`],t[12]=F):F=t[12];let I=f(F),L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=[`defaultAutoPull`],t[13]=L):L=t[13];let R=f(L),Pe;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=[`removeAgentCreditsOnMerge`],t[14]=Pe):Pe=t[14];let z=f(Pe),B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=[`pullRequestMergeMethod`],t[15]=B):B=t[15];let Fe=f(B),Ie;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=[`defaultModelSelection`],t[16]=Ie):Ie=t[16];let Le=pe(Ie),V=Ee.kind===`project`||Ee.kind===`checkout`,H=je.length===0,Re;t[17]===_?Re=t[18]:(Re=_?de(_.settings,null,null,null).settings:null,t[17]=_,t[18]=Re);let ze=Re,Be;t[19]!==x||t[20]!==b||t[21]!==v||t[22]!==Ae?(Be=function(e,t){let n=x.find(t=>t.instanceId===e);for(let r of Ae){let te=b.find(e=>e.environmentId===r.environmentId),ne=te?.serverConfig;if(!ne)continue;let i=ie(ee(ne.providers),r.settings,r.projectId).find(t=>t.instanceId===e),ae=re(le(r.settings,v),ne.providers).get(e);if(!i?.enabled||!i.isAvailable||i.driverKind!==n?.driverKind||!ae?.some(e=>e.slug===t&&!e.isUnavailable))return`This model is unavailable on ${te?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},t[19]=x,t[20]=b,t[21]=v,t[22]=Ae,t[23]=Be):Be=t[23];let U=Be,Ve;t[24]!==U||t[25]!==y?(Ve=e=>{let t=e?U(e.instanceId,e.model):null;if(t){se.add({type:`error`,title:`Default model not saved`,description:t});return}y({defaultModelSelection:e})},t[24]=U,t[25]=y,t[26]=Ve):Ve=t[26];let W=Ve,He;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`defaultModelSelection`],t[27]=He):He=t[27];let Ue=V?`Model for new threads in this project.`:`Default model for new threads. Projects can override it.`,We=H||O||Le===`project`?void 0:v.defaultModelSelection===null?`Automatic`:void 0,G;t[28]!==W||t[29]!==v.defaultModelSelection?(G=v.defaultModelSelection===null?null:(0,g.jsx)(m,{label:`default model`,onClick:()=>W(null)}),t[28]=W,t[29]=v.defaultModelSelection,t[30]=G):G=t[30];let K;t[31]!==E||t[32]!==x||t[33]!==O||t[34]!==U||t[35]!==S||t[36]!==Me||t[37]!==C||t[38]!==w||t[39]!==W||t[40]!==v.planModeEnabled?(K=w&&E?(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[(0,g.jsx)(be,{environmentId:C?.environmentId??null,activeInstanceId:w.instanceId,model:w.model,lockedProvider:null,instanceEntries:x,modelOptionsByInstance:S,triggerClassName:_e,...O?{triggerLabel:`Mixed`}:{},getModelDisabledReason:U,onOpenProviderSetup:e=>{C&&Me({to:`/settings/providers`,search:{environmentId:C.environmentId,instanceId:e}})},onInstanceModelChange:(e,t)=>W(r(e,t))}),O?null:(0,g.jsx)(ae,{provider:E.driverKind,models:E.models,model:w.model,modelOptions:w.options??[],allowPromptInjectedEffort:!1,planModeEnabled:v.planModeEnabled,triggerClassName:_e,onModelOptionsChange:e=>W(r(w.instanceId,w.model,e))})]}):(0,g.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No providers available`}),t[31]=E,t[32]=x,t[33]=O,t[34]=U,t[35]=S,t[36]=Me,t[37]=C,t[38]=w,t[39]=W,t[40]=v.planModeEnabled,t[41]=K):K=t[41];let Ge;t[42]!==O||t[43]!==Ue||t[44]!==We||t[45]!==G||t[46]!==K?(Ge=(0,g.jsx)(p,{serverScoped:!0,settingKeys:He,mixed:O,id:`default-model`,title:`Model`,description:Ue,status:We,resetAction:G,control:K}),t[42]=O,t[43]=Ue,t[44]=We,t[45]=G,t[46]=K,t[47]=Ge):Ge=t[47];let Ke=Ge,qe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(qe=[`defaultThreadEnvMode`],t[48]=qe):qe=t[48];let q;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(q=h(`new-threads`),t[49]=q):q=t[49];let Je=V?`Where new threads in this project start.`:`Where new threads start. Projects and their p4.json can override it.`,J;t[50]!==V||t[51]!==v.defaultThreadEnvMode||t[52]!==y?(J=!V&&v.defaultThreadEnvMode!==null?(0,g.jsx)(m,{label:`default workspace`,onClick:()=>y({defaultThreadEnvMode:null})}):null,t[50]=V,t[51]=v.defaultThreadEnvMode,t[52]=y,t[53]=J):J=t[53];let Ye=M?null:ze?.defaultThreadEnvMode??null,Y;t[54]===y?Y=t[55]:(Y=e=>{(e===`auto`||e===`local`||e===`worktree`)&&y({defaultThreadEnvMode:e})},t[54]=y,t[55]=Y);let X;t[56]===H?X=t[57]:(X=(0,g.jsx)(c,{size:`sm`,"aria-label":`Default workspace`,children:(0,g.jsx)(o,{children:e=>e===`auto`||e===`local`||e===`worktree`?d(e):H?`Unavailable`:`Mixed`})}),t[56]=H,t[57]=X);let Xe;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,g.jsx)(a,{value:`auto`,children:d(`auto`)}),t[58]=Xe):Xe=t[58];let Ze;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,g.jsx)(a,{value:`local`,children:d(`local`)}),t[59]=Ze):Ze=t[59];let Qe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,g.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[Xe,Ze,(0,g.jsx)(a,{value:`worktree`,children:d(`worktree`)})]}),t[60]=Qe):Qe=t[60];let Z;t[61]!==Ye||t[62]!==Y||t[63]!==X?(Z=(0,g.jsxs)(l,{value:Ye,onValueChange:Y,children:[X,Qe]}),t[61]=Ye,t[62]=Y,t[63]=X,t[64]=Z):Z=t[64];let $e;t[65]!==M||t[66]!==Je||t[67]!==J||t[68]!==Z?($e=(0,g.jsx)(p,{serverScoped:!0,settingKeys:qe,mixed:M,id:q.id,title:`Workspace`,description:Je,resetAction:J,control:Z}),t[65]=M,t[66]=Je,t[67]=J,t[68]=Z,t[69]=$e):$e=t[69];let et=$e,tt=n===`general`||n===`project`?`project-defaults`:n===`integrations`?`browser-access`:`source-control-defaults`,nt=n===`general`||n===`project`?`New threads`:n===`integrations`?`Browser`:`Repositories`,Q;t[70]!==Ne||t[71]!==n||t[72]!==ze?.worktreeSubmodules||t[73]!==V||t[74]!==z||t[75]!==R||t[76]!==I||t[77]!==Fe||t[78]!==A||t[79]!==P||t[80]!==Ke||t[81]!==v.defaultAutoPull||t[82]!==v.defaultRuntimeMode||t[83]!==v.enableAgentBrowserAccess||t[84]!==v.pullRequestMergeMethod||t[85]!==v.removeAgentCreditsOnMerge||t[86]!==v.worktreeSubmodules||t[87]!==H||t[88]!==y||t[89]!==et?(Q=n===`project`?(0,g.jsxs)(g.Fragment,{children:[Ke,et]}):n===`general`?(0,g.jsxs)(g.Fragment,{children:[Ke,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultRuntimeMode`],mixed:A,...h(`default-permissions`),description:V?`Permissions for new threads in this project.`:`Default permissions for new threads. Projects can override them.`,resetAction:v.defaultRuntimeMode===i.defaultRuntimeMode?null:(0,g.jsx)(m,{label:`default permissions`,onClick:()=>y({defaultRuntimeMode:i.defaultRuntimeMode})}),control:(0,g.jsxs)(l,{value:A?null:v.defaultRuntimeMode,onValueChange:e=>{e&&y({defaultRuntimeMode:e})},children:[(0,g.jsxs)(c,{size:`sm`,"aria-label":`Default permissions`,children:[!A&&(0,g.jsx)(Ne,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,g.jsx)(o,{children:A?`Mixed`:Se[v.defaultRuntimeMode].label})]}),(0,g.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:xe.map(ke)})]})}),et,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`worktreeSubmodules`],mixed:P,...h(`worktree-submodules`),description:V?`How new worktrees in this project populate git submodules.`:`How new worktrees populate git submodules. Projects and their p4.json can override it.`,resetAction:!V&&v.worktreeSubmodules!==null?(0,g.jsx)(m,{label:`worktree submodules`,onClick:()=>y({worktreeSubmodules:null})}):null,control:(0,g.jsxs)(l,{value:P?null:ze?.worktreeSubmodules??null,onValueChange:e=>{Te(e)&&y({worktreeSubmodules:e})},children:[(0,g.jsx)(c,{size:`sm`,"aria-label":`Worktree submodules`,children:(0,g.jsx)(o,{children:e=>Te(e)?ge[e]:H?`Unavailable`:`Mixed`})}),(0,g.jsx)(s,{align:`end`,alignItemWithTrigger:!1,children:we.map(Oe)})]})})]}):n===`source-control`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultAutoPull`],mixed:R,id:`automatic-pull`,title:`Automatically pull`,description:V?`Keeps this project's default branch current when the checkout has no local changes or commits.`:`Keeps the default branch current when the checkout has no local changes or commits. Projects can override it.`,resetAction:v.defaultAutoPull?(0,g.jsx)(m,{label:`default automatic pull`,tooltip:`Reset automatic pull to off`,onClick:()=>y({defaultAutoPull:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Default automatic pull`,mixed:R,checked:!R&&v.defaultAutoPull,onCheckedChange:e=>y({defaultAutoPull:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`removeAgentCreditsOnMerge`],mixed:z,...h(`remove-agent-credits-on-merge`),description:`Remove recognized agent credit lines from GitHub merge and squash messages, keeping human co-authors. Includes auto-merge. Excludes merge queues, stack merges, and existing commits.`,resetAction:v.removeAgentCreditsOnMerge?(0,g.jsx)(m,{label:`agent credit removal`,tooltip:`Keep agent credits`,onClick:()=>y({removeAgentCreditsOnMerge:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Remove agent credits when merging`,mixed:z,checked:!z&&v.removeAgentCreditsOnMerge,onCheckedChange:e=>y({removeAgentCreditsOnMerge:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`pullRequestMergeMethod`],mixed:Fe,...h(`pull-request-merge-method`),description:V?`Pull requests in this project start with this method.`:`Pull requests start with this method. Last selected reuses whatever you chose most recently on this device.`,resetAction:v.pullRequestMergeMethod===null?null:(0,g.jsx)(m,{label:`default merge method`,tooltip:`Reset to last selected`,onClick:()=>y({pullRequestMergeMethod:null})}),control:(0,g.jsxs)(l,{value:Fe?null:v.pullRequestMergeMethod??`last`,onValueChange:e=>{e===`last`?y({pullRequestMergeMethod:null}):(e===`merge`||e===`squash`||e===`rebase`)&&y({pullRequestMergeMethod:e})},children:[(0,g.jsx)(c,{size:`sm`,"aria-label":`Default pull request merge method`,children:(0,g.jsx)(o,{children:De})}),(0,g.jsxs)(s,{align:`end`,alignItemWithTrigger:!1,children:[(0,g.jsx)(a,{value:`last`,children:`Last selected`}),(0,g.jsx)(a,{value:`merge`,children:u.merge}),(0,g.jsx)(a,{value:`squash`,children:u.squash}),(0,g.jsx)(a,{value:`rebase`,children:u.rebase})]})]})})]}):(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`enableAgentBrowserAccess`],mixed:I,id:h(`agent-browser-access`).id,title:`Agent browser access`,description:V?`Allow agents in this project to use the shared browser. Applies when the agent session next starts.`:`Allow agents to use the shared browser. Projects can override it.`,resetAction:v.enableAgentBrowserAccess===i.enableAgentBrowserAccess?null:(0,g.jsx)(m,{label:`default browser access`,onClick:()=>y({enableAgentBrowserAccess:i.enableAgentBrowserAccess})}),control:(0,g.jsx)(ye,{"aria-label":`Agent browser access`,mixed:I,checked:!I&&v.enableAgentBrowserAccess,onCheckedChange:e=>y({enableAgentBrowserAccess:e})})})}),t[70]=Ne,t[71]=n,t[72]=ze?.worktreeSubmodules,t[73]=V,t[74]=z,t[75]=R,t[76]=I,t[77]=Fe,t[78]=A,t[79]=P,t[80]=Ke,t[81]=v.defaultAutoPull,t[82]=v.defaultRuntimeMode,t[83]=v.enableAgentBrowserAccess,t[84]=v.pullRequestMergeMethod,t[85]=v.removeAgentCreditsOnMerge,t[86]=v.worktreeSubmodules,t[87]=H,t[88]=y,t[89]=et,t[90]=Q):Q=t[90];let $;return t[91]!==tt||t[92]!==nt||t[93]!==Q?($=(0,g.jsx)(ve,{id:tt,title:nt,children:Q}),t[91]=tt,t[92]=nt,t[93]=Q,t[94]=$):$=t[94],$}function De(e){return e===`merge`||e===`squash`||e===`rebase`?u[e]:e===`last`?`Last selected`:`Mixed`}function Oe(e){return(0,g.jsx)(a,{value:e,children:ge[e]},e)}function ke(e){let t=Se[e],n=t.icon;return(0,g.jsx)(a,{value:e,className:`min-w-64`,children:(0,g.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,g.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,g.jsx)(`span`,{className:`text-xs leading-4 text-muted-foreground`,children:t.description})]})},e)}export{Ee as t};
|
|
2
|
+
//# sourceMappingURL=ProjectDefaultsSettings-DX2Kf-tx.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dynamic-
|
|
2
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./index-
|
|
3
|
-
//# sourceMappingURL=ProjectFavicon-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dynamic-C8_ODyue.js","assets/react-DH3P2YXY.js","assets/index-BwdieRvq.js","assets/Icon-BiSXef-P.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./index-BwdieRvq.js";import{n as r,t as i}from"./jsx-runtime-BnjsACtP.js";import{Cf as a,lh as o,t as s,ts as c}from"./utils-DhUt689t.js";import{a as l,i as u}from"./runtime-Ca_Z-vg5.js";import{E as d,O as f,l as p}from"./TooltipViewport-ThbbZQDo.js";import{n as m}from"./assets-CID0y4Uv.js";import{i as h,r as g,t as _}from"./ProjectMonogram-Br5sgd24.js";var v=r(),y=e(t(),1),b=e(i(),1),x=(0,y.lazy)(()=>n(()=>import(`./dynamic-C8_ODyue.js`).then(e=>({default:e.DynamicIcon})),__vite__mapDeps([0,1,2,3])));function S(){let e=(0,v.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(a,{className:`size-full text-inherit`}),e[0]=t):t=e[0],t}function C(e){let t=(0,v.c)(11),{name:n,className:r}=e,i=o(),a;t[0]!==n||t[1]!==i?(a=h(i,n),t[0]=n,t[1]=i,t[2]=a):a=t[2];let{p4:s,strokeWidth:c}=a;if(s){let e;return t[3]!==s||t[4]!==r?(e=(0,b.jsx)(s,{className:r}),t[3]=s,t[4]=r,t[5]=e):e=t[5],e}let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(S,{}),t[6]=l):l=t[6];let u;return t[7]!==r||t[8]!==n||t[9]!==c?(u=(0,b.jsx)(y.Suspense,{fallback:l,children:(0,b.jsx)(x,{name:n,className:r,strokeWidth:c,fallback:S})}),t[7]=r,t[8]=n,t[9]=c,t[10]=u):u=t[10],u}function w(e){let t=(0,v.c)(41),{project:n}=e,r;t[0]!==n.environmentId||t[1]!==n.faviconPath||t[2]!==n.workspaceRoot?(r=m({environmentId:n.environmentId,cwd:n.workspaceRoot,faviconPath:n.faviconPath}),t[0]=n.environmentId,t[1]=n.faviconPath,t[2]=n.workspaceRoot,t[3]=r):r=t[3];let i=c(r);if(n.projectIcon?.kind===`monogram`){let r;return t[4]!==e.className||t[5]!==n.projectIcon.color||t[6]!==n.projectIcon.text?(r=(0,b.jsx)(_,{text:n.projectIcon.text,color:n.projectIcon.color,className:e.className}),t[4]=e.className,t[5]=n.projectIcon.color,t[6]=n.projectIcon.text,t[7]=r):r=t[7],r}if(n.projectIcon?.kind===`emoji`){let r;return t[8]!==e.className||t[9]!==n.projectIcon.emoji?(r=(0,b.jsx)(T,{className:e.className,icon:a,emoji:n.projectIcon.emoji}),t[8]=e.className,t[9]=n.projectIcon.emoji,t[10]=r):r=t[10],r}if(n.projectIcon?.kind===`lucide`){let r,i,a,o,c;if(t[11]!==e.className||t[12]!==n.projectIcon.color||t[13]!==n.projectIcon.name){let l=g(n.projectIcon.color),u=s(`inline-flex size-3.5 shrink-0 items-center justify-center`,l,e.className);o=`true`,c=u,r=C,i=n.projectIcon.name,a=s(`size-full`,l),t[11]=e.className,t[12]=n.projectIcon.color,t[13]=n.projectIcon.name,t[14]=r,t[15]=i,t[16]=a,t[17]=o,t[18]=c}else r=t[14],i=t[15],a=t[16],o=t[17],c=t[18];let l;t[19]!==r||t[20]!==i||t[21]!==a?(l=(0,b.jsx)(r,{name:i,className:a}),t[19]=r,t[20]=i,t[21]=a,t[22]=l):l=t[22];let u;return t[23]!==o||t[24]!==c||t[25]!==l?(u=(0,b.jsx)(`span`,{"aria-hidden":o,className:c,children:l}),t[23]=o,t[24]=c,t[25]=l,t[26]=u):u=t[26],u}let o=e.fallbackIcon??a;if(!i||l(i)){let n;return t[27]!==o||t[28]!==e.className||t[29]!==e.folderExpanded?(n=(0,b.jsx)(T,{className:e.className,icon:o,folderExpanded:e.folderExpanded}),t[27]=o,t[28]=e.className,t[29]=e.folderExpanded,t[30]=n):n=t[30],n}let d;t[31]!==n.environmentId||t[32]!==n.faviconPath||t[33]!==n.workspaceRoot?(d=u(n.environmentId,n.workspaceRoot,n.faviconPath),t[31]=n.environmentId,t[32]=n.faviconPath,t[33]=n.workspaceRoot,t[34]=d):d=t[34];let f=d,p;return t[35]!==o||t[36]!==f||t[37]!==e.className||t[38]!==e.folderExpanded||t[39]!==i?(p=(0,b.jsx)(E,{src:i,className:e.className,fallbackIcon:o,folderExpanded:e.folderExpanded},f),t[35]=o,t[36]=f,t[37]=e.className,t[38]=e.folderExpanded,t[39]=i,t[40]=p):p=t[40],p}function T(e){let t=(0,v.c)(13),{className:n,icon:r,emoji:i,folderExpanded:a}=e;if(i){let e;t[0]===n?e=t[1]:(e=s(`inline-flex size-3.5 shrink-0 items-center justify-center leading-none [container-type:size]`,n),t[0]=n,t[1]=e);let r;t[2]===i?r=t[3]:(r=(0,b.jsx)(`span`,{className:`text-[length:80cqh] leading-none`,children:i}),t[2]=i,t[3]=r);let a;return t[4]!==e||t[5]!==r?(a=(0,b.jsx)(`span`,{"aria-hidden":`true`,className:e,children:r}),t[4]=e,t[5]=r,t[6]=a):a=t[6],a}let o;t[7]===n?o=t[8]:(o=s(`size-3.5 shrink-0 text-icon-muted`,n),t[7]=n,t[8]=o);let c=o,l;return t[9]!==r||t[10]!==a||t[11]!==c?(l=a===void 0?(0,b.jsx)(r,{className:c}):(0,b.jsx)(p,{"aria-hidden":!0,className:c,icon:a?f:d}),t[9]=r,t[10]=a,t[11]=c,t[12]=l):l=t[12],l}function E(e){let t=(0,v.c)(18),{src:n,className:r,fallbackIcon:i,folderExpanded:a}=e,o;t[0]===n?o=t[1]:(o=()=>n.startsWith(`data:image/`)?n:null,t[0]=n,t[1]=o);let[c,l]=(0,y.useState)(o),u=c!==n,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{l(t=>t===e?null:t)},t[2]=d):d=t[2];let f=d,p;t[3]!==i||t[4]!==r||t[5]!==c||t[6]!==a?(p=c===null?(0,b.jsx)(T,{className:r,icon:i,folderExpanded:a}):null,t[3]=i,t[4]=r,t[5]=c,t[6]=a,t[7]=p):p=t[7];let m;t[8]!==r||t[9]!==c?(m=c?(0,b.jsx)(`img`,{src:c,alt:``,className:s(`size-3.5 shrink-0 rounded-[25%] object-contain`,r),onError:()=>f(c)}):null,t[8]=r,t[9]=c,t[10]=m):m=t[10];let h;t[11]!==u||t[12]!==n?(h=u?(0,b.jsx)(`img`,{src:n,alt:``,className:`hidden`,onLoad:()=>{l(n)},onError:()=>f(n)}):null,t[11]=u,t[12]=n,t[13]=h):h=t[13];let g;return t[14]!==p||t[15]!==m||t[16]!==h?(g=(0,b.jsxs)(b.Fragment,{children:[p,m,h]}),t[14]=p,t[15]=m,t[16]=h,t[17]=g):g=t[17],g}export{w as t};
|
|
3
|
+
//# sourceMappingURL=ProjectFavicon-OMOnEzVu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Eb as i,dr as a,i_ as o,lh as s,t as c}from"./utils-
|
|
2
|
-
//# sourceMappingURL=ProjectIconPickerDialog-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Eb as i,dr as a,i_ as o,lh as s,t as c}from"./utils-DhUt689t.js";import{n as ee,t as l}from"./toggle-group-CYKsfBbD.js";import{t as u}from"./input-BYd74ook.js";import{t as te}from"./scroll-area-BNQKEZbp.js";import{a as ne,c as re,i as d,o as ie,r as ae,s as oe,t as se}from"./dialog-BRtKKGzk.js";import{i as f,n as p,r as ce,t as le}from"./ProjectMonogram-Br5sgd24.js";import{DynamicIcon as m,t as h}from"./dynamic-C8_ODyue.js";var g=n();function _(e){return e.normalize(`NFKC`).trim()}function v(e){let t=_(e).match(/[\p{L}\p{N}]+/gu)??[],n=t[0];if(!n)return`PR`;let r=Array.from(n),i=r[0]??`P`,a=r.slice(1).find(e=>/\p{N}/u.test(e))??(t.length>1?Array.from(t.at(-1)??``)[0]:r.at(-1))??i;return Array.from(`${i}${a}`.toUpperCase()).slice(0,2).join(``)}function y(e){let t=_(e).toLocaleLowerCase(`en-US`)||`project`,n=0;for(let e of t)n=(n*31+(e.codePointAt(0)??0))%p.length;return p[n]?.value??`blue`}function b(e){return{monogram:v(e),color:y(e)}}var x=e(t(),1),S=[`folder-code`,`code-2`,`terminal`,`globe-2`,`server`,`database`,`bot`,`sparkles`,`smartphone`,`monitor`,`cloud-cog`,`package`,`book-open`,`flask-conical`,`shield-check`,`rocket`,`gamepad-2`,`music`,`image`,`shopping-bag`,`git-branch`,`workflow`,`wrench`,`layers-3`],ue=[{emoji:`💻`,label:`Computer`},{emoji:`🛠️`,label:`Tools`},{emoji:`🚀`,label:`Rocket`},{emoji:`🤖`,label:`Robot`},{emoji:`✨`,label:`Sparkles`},{emoji:`⚡`,label:`Lightning`},{emoji:`🌐`,label:`Web`},{emoji:`📱`,label:`Mobile`},{emoji:`🖥️`,label:`Desktop`},{emoji:`⌨️`,label:`Keyboard`},{emoji:`⚙️`,label:`Gear`},{emoji:`🗄️`,label:`Database`},{emoji:`☁️`,label:`Cloud`},{emoji:`📦`,label:`Package`},{emoji:`📚`,label:`Books`},{emoji:`🧪`,label:`Test tube`},{emoji:`🔒`,label:`Lock`},{emoji:`🎮`,label:`Game`},{emoji:`🎵`,label:`Music`},{emoji:`🎬`,label:`Movie`},{emoji:`🖼️`,label:`Picture`},{emoji:`🛍️`,label:`Shopping`},{emoji:`🔥`,label:`Fire`},{emoji:`💡`,label:`Idea`},{emoji:`🧩`,label:`Puzzle`},{emoji:`📊`,label:`Chart`},{emoji:`🧠`,label:`Brain`},{emoji:`🦄`,label:`Unicorn`},{emoji:`🐙`,label:`Octopus`},{emoji:`🌱`,label:`Seedling`}];function de(e){let t=e.trim().toLowerCase().replaceAll(/\s+/g,`-`);return t?h.filter(e=>e.includes(t)).slice(0,60):S}function fe(e){let t=e.trim();if(!t)return null;let n=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(t)[Symbol.iterator]().next().value?.segment,r=/^\p{Regional_Indicator}{2}$/u.test(n??``),i=/^[#*0-9]\uFE0F?\u20E3$/u.test(n??``);return!n||!/\p{Extended_Pictographic}/u.test(n)&&!r&&!i?null:n}var C=e(r(),1),pe=`folder-code`,me=i(o);function he(e){let t=(0,g.c)(8),{name:n}=e,r=s(),i;t[0]!==n||t[1]!==r?(i=f(r,n),t[0]=n,t[1]=r,t[2]=i):i=t[2];let{p4:a,strokeWidth:o}=i;if(a){let e;return t[3]===a?e=t[4]:(e=(0,C.jsx)(a,{className:`size-5`}),t[3]=a,t[4]=e),e}let c;return t[5]!==n||t[6]!==o?(c=(0,C.jsx)(m,{name:n,className:`size-5`,strokeWidth:o}),t[5]=n,t[6]=o,t[7]=c):c=t[7],c}function ge(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function w(e){let t=(0,g.c)(84),{current:n,projectName:r,open:i,onOpenChange:o,onSelect:s}=e,f;t[0]===r?f=t[1]:(f=b(r),t[0]=r,t[1]=f);let m=f,[h,_]=(0,x.useState)(n?.kind??`lucide`),[v,y]=(0,x.useState)(n?.kind===`lucide`?n.name:pe),[S,w]=(0,x.useState)(n&&n.kind!==`emoji`?n.color:m.color),[T,_e]=(0,x.useState)(n?.kind===`monogram`?n.text:m.monogram),[E,D]=(0,x.useState)(n?.kind===`emoji`?n.emoji:`💻`),[O,ve]=(0,x.useState)(``),[k,ye]=(0,x.useState)(``),be=(0,x.useRef)(!1),A,j;t[2]!==m.color||t[3]!==m.monogram||t[4]!==n||t[5]!==i?(A=()=>{i&&!be.current&&(_(n?.kind??`lucide`),y(n?.kind===`lucide`?n.name:pe),w(n&&n.kind!==`emoji`?n.color:m.color),_e(n?.kind===`monogram`?n.text:m.monogram),D(n?.kind===`emoji`?n.emoji:`💻`),ve(``),ye(``)),be.current=i},j=[n,i,m.color,m.monogram],t[2]=m.color,t[3]=m.monogram,t[4]=n,t[5]=i,t[6]=A,t[7]=j):(A=t[6],j=t[7]),(0,x.useEffect)(A,j);let M;t[8]===O?M=t[9]:(M=de(O),t[8]=O,t[9]=M);let N=M,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[10]!==m.monogram||t[11]!==S||t[12]!==k||t[13]!==E||t[14]!==v||t[15]!==N||t[16]!==T||t[17]!==h||t[18]!==o||t[19]!==s||t[20]!==i||t[21]!==O){let e=ce(S),n,r;t[35]===T?(n=t[36],r=t[37]):(n=T.normalize(`NFKC`).trim().toUpperCase(),r=me(n),t[35]=T,t[36]=n,t[37]=r),K=r;let a;t[38]!==S||t[39]!==E||t[40]!==v||t[41]!==h||t[42]!==n||t[43]!==o||t[44]!==s||t[45]!==K?(a=()=>{(h!==`monogram`||K)&&(s(h===`monogram`?{kind:`monogram`,text:n,color:S}:h===`lucide`?{kind:`lucide`,name:v,color:S}:{kind:`emoji`,emoji:E}),o(!1))},t[38]=S,t[39]=E,t[40]=v,t[41]=h,t[42]=n,t[43]=o,t[44]=s,t[45]=K,t[46]=a):a=t[46],L=a,I=se,z=i,B=o,F=oe,G=`w-full sm:w-[32rem]`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,C.jsxs)(ne,{children:[(0,C.jsx)(re,{children:`Choose project icon`}),(0,C.jsx)(ae,{children:`Choose an icon, emoji, or monogram.`})]}),t[47]=R):R=t[47],P=ie,V=`flex min-h-0 flex-col`;let d;t[48]===h?d=t[49]:(d=[h],t[48]=h,t[49]=d);let f,g,b,x;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=e[0];(t===`lucide`||t===`emoji`||t===`monogram`)&&_(t)},g=(0,C.jsx)(l,{value:`lucide`,children:`Icons`}),b=(0,C.jsx)(l,{value:`emoji`,children:`Emoji`}),x=(0,C.jsx)(l,{value:`monogram`,children:`Monogram`}),t[50]=f,t[51]=g,t[52]=b,t[53]=x):(f=t[50],g=t[51],b=t[52],x=t[53]),t[54]===d?H=t[55]:(H=(0,C.jsxs)(ee,{"aria-label":`Icon type`,variant:`segmented`,value:d,onValueChange:f,children:[g,b,x]}),t[54]=d,t[55]=H),t[56]!==S||t[57]!==h?(U=h===`emoji`?null:(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Color`}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`group`,"aria-label":`Icon color`,children:p.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":S===e.value,className:c(`flex size-6 items-center justify-center rounded-full border border-transparent outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,S===e.value&&`border-foreground/64`),onClick:()=>w(e.value),children:(0,C.jsx)(`span`,{className:c(`size-4 rounded-full`,e.swatchClassName)})},e.value))})]}),t[56]=S,t[57]=h,t[58]=U):U=t[58],W=h===`lucide`?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(u,{type:`search`,value:O,"aria-label":`Search Lucide icons`,placeholder:`Search all Lucide icons`,onChange:e=>ve(e.currentTarget.value)}),(0,C.jsx)(te,{scrollFade:!0,className:`max-h-64`,children:(0,C.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:N.map(t=>(0,C.jsx)(`button`,{type:`button`,"aria-label":ge(t),"aria-pressed":v===t,className:c(`flex aspect-square items-center justify-center rounded-md border border-transparent outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,v===t&&`border-border bg-accent`,e),onClick:()=>y(t),children:(0,C.jsx)(he,{name:t})},t))})}),N.length===0?(0,C.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No icons found.`}):null]}):h===`monogram`?(0,C.jsxs)(`div`,{className:`flex items-center gap-4 py-2`,children:[(0,C.jsx)(le,{text:K?n:m.monogram,color:S,className:`size-12`}),(0,C.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,C.jsx)(`label`,{htmlFor:`project-monogram`,className:`text-sm font-medium`,children:`Letters`}),(0,C.jsx)(u,{id:`project-monogram`,value:T,onChange:e=>_e(e.currentTarget.value),"aria-describedby":`project-monogram-hint`,"aria-invalid":!K,autoComplete:`off`}),(0,C.jsx)(`p`,{id:`project-monogram-hint`,className:`text-xs text-muted-foreground`,children:`One or two letters or numbers.`})]})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(te,{scrollFade:!0,className:`max-h-64`,children:(0,C.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:ue.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":E===e.emoji,className:c(`flex aspect-square items-center justify-center rounded-md border border-transparent text-xl outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,E===e.emoji&&`border-border bg-accent`),onClick:()=>D(e.emoji),children:e.emoji},e.emoji))})}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Or paste any emoji`}),(0,C.jsx)(u,{value:k,"aria-label":`Custom emoji`,placeholder:`Paste an emoji`,onChange:e=>{let t=e.currentTarget.value;ye(t);let n=fe(t);n&&D(n)}})]})]}),t[10]=m.monogram,t[11]=S,t[12]=k,t[13]=E,t[14]=v,t[15]=N,t[16]=T,t[17]=h,t[18]=o,t[19]=s,t[20]=i,t[21]=O,t[22]=P,t[23]=F,t[24]=I,t[25]=L,t[26]=R,t[27]=z,t[28]=B,t[29]=V,t[30]=H,t[31]=U,t[32]=W,t[33]=G,t[34]=K}else P=t[22],F=t[23],I=t[24],L=t[25],R=t[26],z=t[27],B=t[28],V=t[29],H=t[30],U=t[31],W=t[32],G=t[33],K=t[34];let q;t[59]!==P||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==W?(q=(0,C.jsxs)(P,{className:V,children:[H,U,W]}),t[59]=P,t[60]=V,t[61]=H,t[62]=U,t[63]=W,t[64]=q):q=t[64];let J;t[65]===o?J=t[66]:(J=(0,C.jsx)(a,{variant:`outline`,onClick:()=>o(!1),children:`Cancel`}),t[65]=o,t[66]=J);let Y=h===`monogram`&&!K,X;t[67]!==L||t[68]!==Y?(X=(0,C.jsx)(a,{onClick:L,disabled:Y,children:`Save icon`}),t[67]=L,t[68]=Y,t[69]=X):X=t[69];let Z;t[70]!==J||t[71]!==X?(Z=(0,C.jsxs)(d,{children:[J,X]}),t[70]=J,t[71]=X,t[72]=Z):Z=t[72];let Q;t[73]!==F||t[74]!==R||t[75]!==q||t[76]!==Z||t[77]!==G?(Q=(0,C.jsxs)(F,{className:G,children:[R,q,Z]}),t[73]=F,t[74]=R,t[75]=q,t[76]=Z,t[77]=G,t[78]=Q):Q=t[78];let $;return t[79]!==I||t[80]!==z||t[81]!==B||t[82]!==Q?($=(0,C.jsx)(I,{open:z,onOpenChange:B,children:Q}),t[79]=I,t[80]=z,t[81]=B,t[82]=Q,t[83]=$):$=t[83],$}export{w as ProjectIconPickerDialog};
|
|
2
|
+
//# sourceMappingURL=ProjectIconPickerDialog-Q4GkqwDs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{Ap as r,sh as i,t as a}from"./utils-
|
|
2
|
-
//# sourceMappingURL=ProjectMonogram-
|
|
1
|
+
import{a as e}from"./react-DH3P2YXY.js";import{n as t,t as n}from"./jsx-runtime-BnjsACtP.js";import{Ap as r,sh as i,t as a}from"./utils-DhUt689t.js";function o(e,t){return e===`lucide`?{p4:null,strokeWidth:2}:{p4:r[t]??null,strokeWidth:i(void 0)}}var s=t(),c=[{value:`gray`,label:`Gray`,className:`text-gray-600 dark:text-gray-400`,swatchClassName:`bg-gray-500`},{value:`red`,label:`Red`,className:`text-red-600 dark:text-red-400`,swatchClassName:`bg-red-500`},{value:`orange`,label:`Orange`,className:`text-orange-600 dark:text-orange-400`,swatchClassName:`bg-orange-500`},{value:`amber`,label:`Amber`,className:`text-amber-600 dark:text-amber-400`,swatchClassName:`bg-amber-500`},{value:`yellow`,label:`Yellow`,className:`text-yellow-600 dark:text-yellow-400`,swatchClassName:`bg-yellow-500`},{value:`lime`,label:`Lime`,className:`text-lime-600 dark:text-lime-400`,swatchClassName:`bg-lime-500`},{value:`green`,label:`Green`,className:`text-green-600 dark:text-green-400`,swatchClassName:`bg-green-500`},{value:`emerald`,label:`Emerald`,className:`text-emerald-600 dark:text-emerald-400`,swatchClassName:`bg-emerald-500`},{value:`teal`,label:`Teal`,className:`text-teal-600 dark:text-teal-400`,swatchClassName:`bg-teal-500`},{value:`cyan`,label:`Cyan`,className:`text-cyan-600 dark:text-cyan-400`,swatchClassName:`bg-cyan-500`},{value:`sky`,label:`Sky`,className:`text-sky-600 dark:text-sky-400`,swatchClassName:`bg-sky-500`},{value:`blue`,label:`Blue`,className:`text-blue-600 dark:text-blue-400`,swatchClassName:`bg-blue-500`},{value:`indigo`,label:`Indigo`,className:`text-indigo-600 dark:text-indigo-400`,swatchClassName:`bg-indigo-500`},{value:`violet`,label:`Violet`,className:`text-violet-600 dark:text-violet-400`,swatchClassName:`bg-violet-500`},{value:`purple`,label:`Purple`,className:`text-purple-600 dark:text-purple-400`,swatchClassName:`bg-purple-500`},{value:`fuchsia`,label:`Fuchsia`,className:`text-fuchsia-600 dark:text-fuchsia-400`,swatchClassName:`bg-fuchsia-500`},{value:`pink`,label:`Pink`,className:`text-pink-600 dark:text-pink-400`,swatchClassName:`bg-pink-500`},{value:`rose`,label:`Rose`,className:`text-rose-600 dark:text-rose-400`,swatchClassName:`bg-rose-500`}],l=Object.fromEntries(c.map(({value:e,className:t})=>[e,t]));function u(e){return l[e]}var d=e(n(),1),f=new Intl.Segmenter(void 0,{granularity:`grapheme`});function p(e){let t=(0,s.c)(14),{text:n,color:r,className:i}=e,o;t[0]===i?o=t[1]:(o=a(`inline-flex size-4 shrink-0 items-center justify-center`,i),t[0]=i,t[1]=o);let c;t[2]===r?c=t[3]:(c=a(`size-full overflow-hidden rounded-[25%] font-mono select-none`,u(r)),t[2]=r,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={backgroundColor:`color-mix(in srgb, currentColor 14%, transparent)`},t[4]=l):l=t[4];let p=Array.from(f.segment(n)).length===1?6:12,m;t[5]!==p||t[6]!==n?(m=(0,d.jsx)(`text`,{x:`8`,y:`10.8`,textAnchor:`middle`,fill:`currentColor`,className:`font-mono`,fontSize:`8.25`,fontWeight:`700`,textLength:p,lengthAdjust:`spacingAndGlyphs`,textRendering:`geometricPrecision`,children:n}),t[5]=p,t[6]=n,t[7]=m):m=t[7];let h;t[8]!==c||t[9]!==m?(h=(0,d.jsx)(`svg`,{viewBox:`0 0 16 16`,className:c,style:l,children:m}),t[8]=c,t[9]=m,t[10]=h):h=t[10];let g;return t[11]!==o||t[12]!==h?(g=(0,d.jsx)(`span`,{"aria-hidden":`true`,className:o,children:h}),t[11]=o,t[12]=h,t[13]=g):g=t[13],g}export{o as i,c as n,u as r,p as t};
|
|
2
|
+
//# sourceMappingURL=ProjectMonogram-Br5sgd24.js.map
|
package/dist/client/assets/{ProviderAuthTerminal-qGeMxZDy.js → ProviderAuthTerminal-Q584HoOn.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{q as i}from"./useSettings-
|
|
2
|
-
//# sourceMappingURL=ProviderAuthTerminal-
|
|
1
|
+
import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{q as i}from"./useSettings-gPlpTIWi.js";import{c as a,r as o}from"./ThreadTerminalDrawer-DHoyxd6-.js";var s=n(),c=e(t(),1),l=e(r(),1);function u(e){let t=(0,s.c)(16),{output:n,outputOffset:r,onResponse:u}=e,p=(0,c.useRef)(null),m=(0,c.useRef)(null),h=r??n.length,g;t[0]!==u||t[1]!==n||t[2]!==h?(g={output:n,offset:h,onResponse:u},t[0]=u,t[1]=n,t[2]=h,t[3]=g):g=t[3];let _=(0,c.useRef)(g),v=(0,c.useRef)(0),[y,b]=(0,c.useState)(null),x,S;t[4]!==u||t[5]!==n||t[6]!==r?(x=()=>{_.current={output:n,offset:r??n.length,onResponse:u};let e=m.current;if(!e)return;let t=_.current.offset-v.current;t>0&&t<=n.length?e.write(n.slice(-t)):t!==0&&e.resetAndWrite(n),v.current=_.current.offset},S=[n,r,u],t[4]=u,t[5]=n,t[6]=r,t[7]=x,t[8]=S):(x=t[7],S=t[8]),(0,c.useEffect)(x,S);let C,w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{let e=p.current;if(!e)return;let t=!1;return a.create(e,{theme:o(e),font:{size:13},onData:e=>_.current.onResponse({type:`terminal`,data:e}),onResize:(e,t)=>_.current.onResponse({type:`terminal`,data:``,size:{cols:e,rows:t}}),onSelectionChange:f,beforeKey:d,onLinkActivate:e=>{/^https?:\/\//i.test(e)&&i().shell.openExternal(e).catch(()=>b(`Could not open the provider link.`))}}).then(e=>{if(t){e.dispose();return}m.current=e,e.write(_.current.output),v.current=_.current.offset}).catch(()=>b(`Could not load the sign-in terminal. Cancel and retry sign-in.`)),()=>{t=!0,m.current?.dispose(),m.current=null}},w=[],t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,c.useEffect)(C,w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,l.jsx)(`div`,{ref:p,"aria-label":`Provider sign-in terminal`,className:`relative h-64 overflow-hidden rounded-md border border-border`}),t[11]=T):T=t[11];let E;t[12]===y?E=t[13]:(E=y?(0,l.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:y}):null,t[12]=y,t[13]=E);let D;return t[14]===E?D=t[15]:(D=(0,l.jsxs)(l.Fragment,{children:[T,E]}),t[14]=E,t[15]=D),D}function d(e){return e.key!==`Tab`}function f(){}export{u as default};
|
|
2
|
+
//# sourceMappingURL=ProviderAuthTerminal-Q584HoOn.js.map
|