@p4code/cli 0.8.18 → 0.8.20
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-usgrWcNe.mjs → binCli-BU4pyUVV.mjs} +697 -479
- package/dist/client/.vite/manifest.json +2275 -2186
- package/dist/client/assets/AlertDialogRoot-CI-BT04n.js +2 -0
- package/dist/client/assets/{AnimatedHeight-CO3_zEQw.js → AnimatedHeight-B1LdeRxh.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-BBPbK1uA.js → AuthSurfaceShell-Di1ASoMs.js} +2 -2
- package/dist/client/assets/{CSPContext-D8znCJtI.js → CSPContext-Bn8q5RdR.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-Bda8Ir5S.js → ChatGptUsageButton-Ckccc0cE.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-BS1t8pnS.js → ChatMarkdown-BHsOWwiC.js} +13 -13
- package/dist/client/assets/{CheckboxIndicator-D-KUEtIm.js → CheckboxIndicator-DUUgNp1r.js} +2 -2
- package/dist/client/assets/CodexSetupSection.logic-BbXZAyvp.js +2 -0
- package/dist/client/assets/{CollapsiblePanel-84e9KCIs.js → CollapsiblePanel-D1aZAbsh.js} +2 -2
- package/dist/client/assets/{ComboboxClear-FsZ2LcVw.js → ComboboxClear-CMNv82AR.js} +2 -2
- package/dist/client/assets/ComboboxGroupLabel-BqpdqndG.js +2 -0
- package/dist/client/assets/CommandBlock-Da6pXLt_.js +2 -0
- package/dist/client/assets/{ComposerPromptEditor-BGcYrFoa.js → ComposerPromptEditor-DxcWPWlA.js} +13 -13
- package/dist/client/assets/{CompositeRoot-fbPbFqqK.js → CompositeRoot-BP063J4d.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-t_vHmaco.js → ConnectionStatusDot-DvalNlEr.js} +2 -2
- package/dist/client/assets/DevicePanel-DePWOu4d.js +2 -0
- package/dist/client/assets/DeviceSetup-BK7tjknq.js +2 -0
- package/dist/client/assets/{DialogTitle-DnR18OB7.js → DialogTitle-OaePW-Ih.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-Br9sOo_6.js → DiffCommentAnnotation-BzohZvIj.js} +2 -2
- package/dist/client/assets/DiffFileTree-OcbtQyxq.js +2 -0
- package/dist/client/assets/DiffPanel-BajglAZa.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-DydpPFgM.js → DiffWorkerPoolProvider--30q2unm.js} +3 -3
- package/dist/client/assets/EmbeddedDesign-BcPI7zAV.js +19 -0
- package/dist/client/assets/{EmbeddedDesign-BsHZJ1Ch.css → EmbeddedDesign-DmybFtYo.css} +1 -1
- package/dist/client/assets/{EnvironmentMachineIcon-BMWCDR69.js → EnvironmentMachineIcon-DszKXxD_.js} +2 -2
- package/dist/client/assets/{ExpandableText-B6Dvgn62.js → ExpandableText-hoL-6ubc.js} +2 -2
- package/dist/client/assets/{FieldControl-CVOjReHh.js → FieldControl-DDVVfmpB.js} +2 -2
- package/dist/client/assets/{FileDiff-Dhyt7ZAJ.js → FileDiff-DSxfw81M.js} +2 -2
- package/dist/client/assets/FilePreviewPanel-jsWBRHEP.js +34 -0
- package/dist/client/assets/{FoldedSettingsSection-Clo0JgyS.js → FoldedSettingsSection-B66vyjYD.js} +2 -2
- package/dist/client/assets/{FormContext--axmNCbu.js → FormContext-B0PXExmu.js} +2 -2
- package/dist/client/assets/{Icons-BYSK3arN.js → Icons-CX6xNdVb.js} +2 -2
- package/dist/client/assets/Input-C7aWgRC_.js +2 -0
- package/dist/client/assets/{KeybindingsSettings.logic-30fwcukL.js → KeybindingsSettings.logic-6FRd2ilb.js} +2 -2
- package/dist/client/assets/NoProjectsHero-BJh2xTW2.js +2 -0
- package/dist/client/assets/{PanelLayoutControls-DL7sleZ-.js → PanelLayoutControls-BH9E0RgY.js} +10 -10
- package/dist/client/assets/{PierreEntryIcon-DKHnMJOl.js → PierreEntryIcon-DqZ3rsf9.js} +2 -2
- package/dist/client/assets/{PopoverHandle-C-e81PS3.js → PopoverHandle-DRjGw1Yt.js} +2 -2
- package/dist/client/assets/PreviewPanel-BvQZWo4y.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-DpMGLYiX.js +2 -0
- package/dist/client/assets/ProjectFavicon-C3ZH51Lw.js +3 -0
- package/dist/client/assets/{ProjectIconPickerDialog-Bxa9i4w_.js → ProjectIconPickerDialog-R3JbSZVv.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-CYD6eMbI.js → ProjectMonogram-IuYJI7zN.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Cm88QElc.js → ProviderAuthTerminal-C-Y-b2Id.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-DcDT2aJc.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-CLYzJJII.js → ProviderSettingsForm-CPtnly6g.js} +2 -2
- package/dist/client/assets/PullRequestCodeTab-CHzbe4Pg.js +6 -0
- package/dist/client/assets/{ReadOnlySourcePreview-D2Vkrzyc.js → ReadOnlySourcePreview-BdxBRo90.js} +2 -2
- package/dist/client/assets/RenderErrorBoundary-DOhJQzqI.js +2 -0
- package/dist/client/assets/ScheduledTasksSettings-BhwaQrJM.js +4 -0
- package/dist/client/assets/{ScopedSwitch-BrJEJr8I.js → ScopedSwitch--Y2Q_Dkg.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-BYUnXNwJ.js → ScrollAreaCorner-Ck3L5tlH.js} +2 -2
- package/dist/client/assets/{SecretInput-CIbdWrQZ.js → SecretInput-UofV3Jxx.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-Cr4PrE_F.js → SelectScrollUpArrow-C_YHAw_f.js} +2 -2
- package/dist/client/assets/{SettingsPanels-B8q4OSW7.js → SettingsPanels-rRn3RxRM.js} +8 -8
- package/dist/client/assets/{SettingsPanels.logic-C5FkY28P.js → SettingsPanels.logic-CSbITXNG.js} +2 -2
- package/dist/client/assets/SettingsScopeNotice-B7r3-bw2.js +2 -0
- package/dist/client/assets/{T3ConnectAccountPages-DDSM7QWS.js → T3ConnectAccountPages-CZ221lRl.js} +2 -2
- package/dist/client/assets/{T3ConnectSidebarSignIn-GnkVas23.js → T3ConnectSidebarSignIn-pHxwsU9J.js} +2 -2
- package/dist/client/assets/ThemeEditorPanel-BRKQI9pP.js +5 -0
- package/dist/client/assets/{ThreadTerminalDrawer-4huAp-uS.js → ThreadTerminalDrawer-CYuLsPbc.js} +4 -4
- package/dist/client/assets/TooltipViewport-B_Oz-gLq.js +2 -0
- package/dist/client/assets/{Virtualizer-DjBOkz4F.js → Virtualizer-ChNeVtXh.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-ClxInGsT.js → WorkspaceBreadcrumb-CpHuVRke.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-DwN_ETF0.js → WorkspacePageContainer-BQ0Bk5Qy.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-BvKCy7v2.js → WorkspacePageHeader-Cx1gpU1l.js} +2 -2
- package/dist/client/assets/{_chat-C2VZmKVT.js → _chat-BNr1JB8N.js} +34 -34
- package/dist/client/assets/_chat.index-CGo_2dVK.js +2 -0
- package/dist/client/assets/_chat.new-B8h0E9bY.js +4 -0
- package/dist/client/assets/_chat.pull-requests-C9e5UJiQ.js +2 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-Cv0dw1u8.js → abnfDiagram-VCTEODGH-BewL_eNL.js} +2 -2
- package/dist/client/assets/{alert-DYmkyE3l.js → alert-CNni4aGm.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-DB68MNLl.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-BvQMjhmC.js → architectureDiagram-5GKGNRK7-C9j-xrz2.js} +2 -2
- package/dist/client/assets/{assets-COg7jyyX.js → assets-Co5XIu-W.js} +2 -2
- package/dist/client/assets/{blockDiagram-I7D4REHJ-DR7f58YJ.js → blockDiagram-I7D4REHJ-DSaqyAe3.js} +2 -2
- package/dist/client/assets/browserHistoryStore-C3MIb5y-.js +2 -0
- package/dist/client/assets/{browserLinkTarget-Bp-zUm0R.js → browserLinkTarget-B0Nl9z4y.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-zgFjNACn.js → c4Diagram-7LVT6UL2-DCgzKaRE.js} +2 -2
- package/dist/client/assets/channel-C9_T9oRs.js +2 -0
- package/dist/client/assets/{checkbox-brLYzznm.js → checkbox-BpAfakhx.js} +2 -2
- package/dist/client/assets/{chunk-4HAMMTFA-Q6ZY3Aj6.js → chunk-4HAMMTFA-DstDTNNT.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-Dv4NtCmQ.js → chunk-75Z2AOVW-Dz-DtxrH.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-D-pyRDMG.js → chunk-DU6HZSFF-Ll_1n6K5.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-BOXrNdwG.js → chunk-F27PBJKO-BhJS5B0M.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-uYd_Q5lX.js → chunk-GMAD6QVW-YF2_U_Rb.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-C3aAR6o_.js → chunk-GVQU2GXP-VQA2Ub_O.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-CbCHd80E.js → chunk-IMKFNOWR-CUKSWZZL.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-B5jDlsms.js → chunk-L3NEJ4N5-B1mYJGkp.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-DgNZQb8q.js → chunk-OSK3NFVY-DeMda-I1.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-ptp4LKHi.js → chunk-P2QGCYS3-Cw7ng-Rc.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-CRBmOW8B.js → chunk-POPQ4Y6H-UV50oooU.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-DHkc8IcS.js → chunk-PWAF6VOD-DN41TR2O.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-B5XMb9ST.js → chunk-SHT3W25Y-wined05I.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-Lt0ZENIq.js → chunk-SVP7TREG-Cwfsds3m.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-BhZt3DVX.js → chunk-TICWLB2K-COhBRrwy.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-DKnt792Z.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-DKnt792Z.js +2 -0
- package/dist/client/assets/{color-picker-D7d1go0g.js → color-picker-KVitc2gM.js} +2 -2
- package/dist/client/assets/{combobox-DSVavlIH.js → combobox-DiUoVqyf.js} +2 -2
- package/dist/client/assets/command-CMR1n6Uf.js +2 -0
- package/dist/client/assets/composer-logic-BcXfvdPq.js +6 -0
- package/dist/client/assets/composerDraftUploads-CDI8NeKM.js +2 -0
- package/dist/client/assets/{connect-C39BhZ-c.js → connect-BmEDcR9c.js} +2 -2
- package/dist/client/assets/{connect-agent-Dj_Cfdx6.js → connect-agent-CfaBrLrx.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-CNKdS-0M.js → cynefin-OW5HDTMX-NISsUCRb.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CoFxzJSW.js → cynefinDiagram-5FMLGOSQ-CcmIsbpK.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-q0omC4bc.js → dagre-GXQ25YYZ-UITp4lya.js} +2 -2
- package/dist/client/assets/design-C4-KEBUo.js +2 -0
- package/dist/client/assets/{device-CWgOLpbF.js → device-BcFks_r6.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-CdFkGs_B.js → diagram-S7CK7UJ4-DGjl3T82.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-B0KtokqT.js → diagram-UQ7AKVKN-CXGDugDN.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-DjtTeImL.js → diagram-VSXAHHWV-ClIfV-Eb.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-DRYLlkkf.js → diagram-VX7I27RA-CcyEAXBh.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-C-x2EfL6.js → diagram-Z3DM3KII-B4b4azfJ.js} +2 -2
- package/dist/client/assets/{dialog-DYFQxVoN.js → dialog-D--IO2tX.js} +2 -2
- package/dist/client/assets/{diffRendering-6DuM2rGF.js → diffRendering-CCO51SHu.js} +2 -2
- package/dist/client/assets/{discovery-list-BvblDG7m.js → discovery-list-E9mW3ie9.js} +2 -2
- package/dist/client/assets/{dist-CkgAUeqn.js → dist-BUfo2bac.js} +3 -3
- package/dist/client/assets/{draft-input-27erQjx_.js → draft-input-BqhTvFTz.js} +2 -2
- package/dist/client/assets/{duoViewer-CBnLVCTt.js → duoViewer-DrRt1X-q.js} +2 -2
- package/dist/client/assets/{dynamic-Cjr9H8t4.js → dynamic-BHunf18B.js} +3 -3
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-UISo4OT-.js → ebnfDiagram-PWID7BFC-C4BXGn4k.js} +2 -2
- package/dist/client/assets/{embeddedScripts-Dr-tOtuJ.js → embeddedScripts-3mOBT50V.js} +2 -2
- package/dist/client/assets/{empty-2jxBvPLn.js → empty-IIGW45Hv.js} +2 -2
- package/dist/client/assets/{entities-DCbEYTvn.js → entities-ByTmol1p.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-CeWlUdOf.js → erDiagram-RLTQ6QDP-DCS17tz_.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-DnLkFrkm.js +1 -0
- package/dist/client/assets/{fileLinks-5NSgRKPU.js → fileLinks-Xjn6JEGT.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-CA6c4E3-.js → fileTreeExpansion-tsD7A-Z5.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-BFbQWgza.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-KPPMvqNL.js → ganttDiagram-EL5Y4UJY-BGFtO7uE.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-CuM1lgsL.js → getDiffFileInput-DFWDPe9O.js} +2 -2
- package/dist/client/assets/git-compare-DW_c6fci.js +2 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-BGSFaZro.js → gitGraph-4MIJSDKK-DZeZydG5.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CwYf9r63.js → gitGraphDiagram-WWUBYQGX-3uL4kQuc.js} +2 -2
- package/dist/client/assets/{guideRunStore-B3Y6e_nf.js → guideRunStore-CGkdBBWi.js} +2 -2
- package/dist/client/assets/{htmlRender-BaqdfJ6m.js → htmlRender-n-z4ejOb.js} +2 -2
- package/dist/client/assets/{index-DmPPPGJb.js → index-CB8eLeeR.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-C831OtOR.js → info-A6RAGUB7-C3L7Iy2t.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-DVstIW76.js → infoDiagram-27XIBGKW-B8XmKHVk.js} +2 -2
- package/dist/client/assets/{input-83N8btBC.js → input-DX_wpYEr.js} +2 -2
- package/dist/client/assets/{input-group-Q757vhrD.js → input-group-B7App4HX.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CJq0N-AL.js → ishikawaDiagram-5VMMS53U-DqYb5ghg.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-D76KCD6f.js → journeyDiagram-3NMN7TZE-f4xls24M.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-D1kzRMIP.js → kanban-definition-UXKFOSKX-C4hiNifc.js} +2 -2
- package/dist/client/assets/{kbd-D8UfTN0o.js → kbd-CBsCsK1C.js} +2 -2
- package/dist/client/assets/{keybindings-DLDyoB30.js → keybindings-DQLn36Qh.js} +2 -2
- package/dist/client/assets/layout-grid-CCkPw5ih.js +2 -0
- package/dist/client/assets/{lazyRouteComponent-BCGAjyjO.js → lazyRouteComponent-F8XJwdjp.js} +2 -2
- package/dist/client/assets/{line-QHGhF6Vm.js → line-CAwl86yA.js} +2 -2
- package/dist/client/assets/{link-Bgj44djS.js → link-Dsk-mMeT.js} +2 -2
- package/dist/client/assets/{linkedPrompt-D1aW6nV5.js → linkedPrompt-D3xnUYyG.js} +2 -2
- package/dist/client/assets/main-B3UqEpE9.css +2 -0
- package/dist/client/assets/main-DzuY7nUi.js +26 -0
- package/dist/client/assets/{mediaReference-CQtke4j3.js → mediaReference-DFBMieZe.js} +2 -2
- package/dist/client/assets/{mediaSource-CI2bKK3n.js → mediaSource-DwE2MD82.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-Brqe55KM.js → mermaid-parser.core-CQTH3UnZ.js} +4 -4
- package/dist/client/assets/{mermaid.core-Cdl6aiT5.js → mermaid.core-D6j4Oepc.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-CcdCCRbd.js → mindmap-definition-YA3MSWOX-mUjULOXx.js} +2 -2
- package/dist/client/assets/{number-field-DQIrEOoj.js → number-field-CO0djGoZ.js} +2 -2
- package/dist/client/assets/{observeResize-BaPAtI3Q.js → observeResize-DnTxIA8M.js} +2 -2
- package/dist/client/assets/{onboarding-ObMsA9VF.js → onboarding-BWsXQF-8.js} +2 -2
- package/dist/client/assets/{openFileInPreview-CdBR5kuZ.js → openFileInPreview-BjXtA6rm.js} +2 -2
- package/dist/client/assets/{p4ProjectFile--u7SOSK5.js → p4ProjectFile-Cit38tzd.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-BSuHbq7S.js → packet-AYTQ26CC-B6oJlnoT.js} +1 -1
- package/dist/client/assets/{pair-C11lrlzi.js → pair-BOAY3H4W.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-Iy9neoGN.js → pegDiagram-XKGWAZYB-MKsaJe-e.js} +2 -2
- package/dist/client/assets/{phoneViewer-iqsNqM8D.js → phoneViewer-DhI2RNKg.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-BlC5Ctcv.js → pie-WAS4IAKB-CVr4vbdT.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-CtVgATJF.js → pieDiagram-E7YTZNPT-CU60SxBF.js} +2 -2
- package/dist/client/assets/{pierre-icons-fSsw9aa-.js → pierre-icons-B278VAke.js} +2 -2
- package/dist/client/assets/{popover-B1MF5i1c.js → popover-BJ6nvlLO.js} +2 -2
- package/dist/client/assets/{preview-DwLWkMZG.js → preview-BPE4Ptwy.js} +2 -2
- package/dist/client/assets/{preview-ITad1JAy.js → preview-Cf8NQ1hB.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-DN-AYBed.js → previewMiniPlayerStore-C-S6Z_7R.js} +2 -2
- package/dist/client/assets/{primary-8A8hvHFL.js → primary-C8ChofNZ.js} +2 -2
- package/dist/client/assets/primaryCloudLinkState-CC_tdVXQ.js +2 -0
- package/dist/client/assets/{projectFilesQueryState-CGllQp_V.js → projectFilesQueryState-Btmth-fd.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-DwqFzld2.js → projectScriptEditor-jVLgvupi.js} +2 -2
- package/dist/client/assets/providerSkills-CQC96ZMr.js +2 -0
- package/dist/client/assets/{pullRequestDetail.logic-CkxKh0fV.js → pullRequestDetail.logic-CM8xaqJx.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-CSZus-cz.js → pullRequestIcons-BjW5TUsG.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-78f71w6J.js → pullRequestReviewStore-CfDcNEFp.js} +2 -2
- package/dist/client/assets/pullRequests-BhR0uCs5.js +2 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-kq18RP_F.js → quadrantDiagram-AXDQQJYC-YO_Vicsa.js} +2 -2
- package/dist/client/assets/{queries-DCKH7ltg.js → queries-BEkNnQZg.js} +2 -2
- package/dist/client/assets/{query-B1uAr_ii.js → query-MZn8giyP.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-Cbkq33o2.js → radar-RG4KPBEZ-C7MHhieK.js} +1 -1
- package/dist/client/assets/{radio-group-CFJMQH66.js → radio-group-Ca6IMyWa.js} +2 -2
- package/dist/client/assets/{railroad-74A4TZTK-Ba3TZ4Wg.js → railroad-74A4TZTK-SZuHkN8h.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DrVmy01m.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BcPn9yic.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-Dv1rvzCW.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-BfOnyiaT.js → railroadDiagram-O6MQD6OU-Da7fqGWf.js} +2 -2
- package/dist/client/assets/{renderScheduler-CcWhS7Yq.js → renderScheduler-lUltsq6V.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-DFzAGiJp.js → requirementDiagram-BXWQKSXE-i46-nz91.js} +2 -2
- package/dist/client/assets/{rightPanelStore-DfMWWfvR.js → rightPanelStore-UcehuwgS.js} +2 -2
- package/dist/client/assets/{runtime-B9IDNXDU.js → runtime-BunkcrGh.js} +3 -3
- package/dist/client/assets/runtime-DTzyj6T4.js +2 -0
- package/dist/client/assets/{runtimeModeConfig-C3TbI2qR.js → runtimeModeConfig-CTQ97M7F.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D9gFGibV.js → sankeyDiagram-P5KCCOFB-CZzNX2hl.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DVbZRIYJ.js → scheduledTasksSettings.logic-CkbvhKba.js} +2 -2
- package/dist/client/assets/{scroll-area-DGS0jgnh.js → scroll-area-BStafc_O.js} +2 -2
- package/dist/client/assets/{select-Dsx46akG.js → select-BIK-KVyd.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-C9pRaNT5.js → sequenceDiagram-WJ2MYXX4-32aHdDFl.js} +2 -2
- package/dist/client/assets/{server-CoH7V4JL.js → server-COuN0pwg.js} +2 -2
- package/dist/client/assets/{session-logic-C4wGF3_E.js → session-logic-CqRiME2K.js} +2 -2
- package/dist/client/assets/{session-Bo2ZSprC.js → session-seR2OUj0.js} +2 -2
- package/dist/client/assets/settings-CiPM9fHt.js +2 -0
- package/dist/client/assets/{settings.appearance-6ktu9wdJ.js → settings.appearance-B91nMGep.js} +2 -2
- package/dist/client/assets/settings.archived-CucIYN3P.js +2 -0
- package/dist/client/assets/{settings.computer-use-C24sO93u.js → settings.computer-use-eCFCpqRb.js} +2 -2
- package/dist/client/assets/settings.connections-C-yLB0Yr.js +2 -0
- package/dist/client/assets/settings.data-controls-BGHuOOAF.js +2 -0
- package/dist/client/assets/{settings.decisions-kar2kv7T.js → settings.decisions-DbzSG84P.js} +2 -2
- package/dist/client/assets/settings.designs-DzW0uzhe.js +2 -0
- package/dist/client/assets/settings.diagnostics-Vw2M9wTQ.js +2 -0
- package/dist/client/assets/{settings.general-C1zsJgwK.js → settings.general-CfY4GAoq.js} +2 -2
- package/dist/client/assets/settings.integrations-C0hzJpnr.js +2 -0
- package/dist/client/assets/{settings.keybindings-CYcsJ6DQ.js → settings.keybindings-QcHgKHxE.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-DnBHlZE2.js → settings.open-source-licenses-CVPaYBdL.js} +2 -2
- package/dist/client/assets/settings.plugins-Db2nz9n9.js +5 -0
- package/dist/client/assets/settings.projects-Bxf_7lyF.js +4 -0
- package/dist/client/assets/settings.providers-XFKxTM8C.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-Bf37L1OK.js → settings.scheduled-tasks-B7OyO0sP.js} +2 -2
- package/dist/client/assets/settings.snap-shot-BabiAbdd.js +2 -0
- package/dist/client/assets/settings.source-control-BKphaihu.js +2 -0
- package/dist/client/assets/{settings.storage-DmbTXujz.js → settings.storage-CUhQEKB5.js} +2 -2
- package/dist/client/assets/settingsLayout-BNfRQ-bS.js +3 -0
- package/dist/client/assets/sidebar-CilourkR.js +2 -0
- package/dist/client/assets/{sidebarProjectGrouping-DrnsFA8t.js → sidebarProjectGrouping-BVhK5qEe.js} +2 -2
- package/dist/client/assets/{skeleton-0mC3wMw1.js → skeleton-DoQ8WJ33.js} +2 -2
- package/dist/client/assets/{sourceControl-D6TEHNpa.js → sourceControl-CZSeEF87.js} +2 -2
- package/dist/client/assets/sourceControlClients-gLUbjqCT.js +2 -0
- package/dist/client/assets/{spinner-DHOdl-gn.js → spinner-dBHTxMdw.js} +2 -2
- package/dist/client/assets/{standalone-page-Dx8vGwaJ.js → standalone-page-7u6OMfTi.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-D8n56CID.js → stateDiagram-D77RDMKH-DzKAnfb5.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-B8R9PPf1.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-DZZct2ih.js → swimlanes-42K2YHIH-CQb8er0I.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CM0Ncs1m.js +9 -0
- package/dist/client/assets/{terminal-links-Di9Ijg8X.js → terminal-links-DaTgSxq7.js} +2 -2
- package/dist/client/assets/{terminalSessions-B8EDcX8b.js → terminalSessions-DijGQOOD.js} +2 -2
- package/dist/client/assets/{textarea-BvPoR1cI.js → textarea-DyCJe8OO.js} +2 -2
- package/dist/client/assets/{themePalette-zFOiBKDi.js → themePalette-mGukKeaJ.js} +2 -2
- package/dist/client/assets/threadSort-Bd2rijEy.js +2 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-BGfuRztb.js → timeline-definition-24CTP7MA-DznrmSZM.js} +2 -2
- package/dist/client/assets/toast-WpVvhflo.js +2 -0
- package/dist/client/assets/{toggle-DeCGfzT2.js → toggle-C4iGKTHY.js} +2 -2
- package/dist/client/assets/{toggle-group-DekLc0Ax.js → toggle-group-CM-lVPv_.js} +2 -2
- package/dist/client/assets/tooltip-C85X81rS.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-BPM2x-ME.js → treeView-Q6P3EWNA-ChE0E3HR.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-sku0fChI.js → treemap-WGGIJYW6-BzvvYy-b.js} +1 -1
- package/dist/client/assets/uiStateStore-DGq3v0QD.js +6 -0
- package/dist/client/assets/usage-B75rDU8q.js +2 -0
- package/dist/client/assets/{usageAccess-BGb3m0YV.js → usageAccess-BS7RH41F.js} +2 -2
- package/dist/client/assets/{usageFormat-H-RgZ0fy.js → usageFormat-neDCKBUu.js} +2 -2
- package/dist/client/assets/{usageShortcuts-C320W17X.js → usageShortcuts-BXE7khxl.js} +2 -2
- package/dist/client/assets/{use-atom-command-GpCw1tWF.js → use-atom-command-6Jnx7WG6.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-C8nSWyQ9.js → useAriaLabelledBy-0jbiz1G5.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-FJLPEfoH.js → useHandleNewThread-ot_mP7L5.js} +2 -2
- package/dist/client/assets/{useLocation-Ccsih1eo.js → useLocation-CEeuom34.js} +2 -2
- package/dist/client/assets/useNavigate-B5WzUZJ7.js +2 -0
- package/dist/client/assets/{useNavigateBack-PnWVFtkU.js → useNavigateBack-B1hKrkap.js} +2 -2
- package/dist/client/assets/{useParams-CoeDewwU.js → useParams-DPNRViD9.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-mBtsOu9K.js → usePermissionStatus-DhHAmOgT.js} +2 -2
- package/dist/client/assets/usePullRequestActions-CC8iuW6L.js +3 -0
- package/dist/client/assets/{useRegisterFieldControl-9rSmWR2W.js → useRegisterFieldControl-DHg4qk95.js} +2 -2
- package/dist/client/assets/useScopedModelAvailability-AfE61RiJ.js +2 -0
- package/dist/client/assets/useSettings-Dr8XPXiN.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-ZyPZIXm7.js → useT3ConnectAuthPrompt-CVbTUWTC.js} +2 -2
- package/dist/client/assets/utils-ChK8VEFC.js +37 -0
- package/dist/client/assets/{vcsRefInvalidation-DfCz0cGO.js → vcsRefInvalidation-4ukX8s_d.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-CjhblZp4.js → vennDiagram-4TSXK5OY-B7LoDpFP.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-Cuf_pn9-.js → wardley-WFR3VGLG-BGtlW2Xe.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CMQ-_cYv.js → wardleyDiagram-VM6X3IG4-BFhvdWVx.js} +2 -2
- package/dist/client/assets/welcome-B_CtEQwh.js +2 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BlCqmJgA.js → xychartDiagram-S5SC5T6Z-CEb-52Rm.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-7OJ6c0Me.mjs → renderer-5lNN05tA.mjs} +2 -2
- package/dist/{runtime-BHqdsO3Y.mjs → runtime-BuR0otfT.mjs} +135 -55
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-D6ed6zQR.js +0 -2
- package/dist/client/assets/CodexSetupSection.logic-Ed9SDkqP.js +0 -2
- package/dist/client/assets/CommandBlock-C7ASE_F_.js +0 -2
- package/dist/client/assets/DevicePanel-CS1FTu-C.js +0 -2
- package/dist/client/assets/DeviceSetup-DZAK0_tm.js +0 -2
- package/dist/client/assets/DiffFileTree-DkLJXYZf.js +0 -2
- package/dist/client/assets/DiffPanel-CGV12wM6.js +0 -2
- package/dist/client/assets/EmbeddedDesign--Xz14U92.js +0 -19
- package/dist/client/assets/FilePreviewPanel-8tUtMikb.js +0 -34
- package/dist/client/assets/Input-CVwvVqbx.js +0 -2
- package/dist/client/assets/NoProjectsHero-Lsb9cuvO.js +0 -2
- package/dist/client/assets/PreviewPanel-DmaoFTEA.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-CrKY01_P.js +0 -2
- package/dist/client/assets/ProjectFavicon-B5C6TpKj.js +0 -3
- package/dist/client/assets/ProviderModelPicker-CeB11O3P.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-BqH4glgo.js +0 -6
- package/dist/client/assets/RenderErrorBoundary-BgOA8qma.js +0 -2
- package/dist/client/assets/ScheduledTasksSettings-BMQ-_Rms.js +0 -4
- package/dist/client/assets/SettingsScopeNotice-_WSLtOW4.js +0 -2
- package/dist/client/assets/ThemeEditorPanel-DB8D5_6u.js +0 -5
- package/dist/client/assets/TooltipViewport-kqulS2nz.js +0 -2
- package/dist/client/assets/_chat.index-CQSbFMBa.js +0 -2
- package/dist/client/assets/_chat.new-BxObe9FX.js +0 -4
- package/dist/client/assets/_chat.pull-requests-JS9EZDI7.js +0 -2
- package/dist/client/assets/architecture-7GRP2DOG-Dd1d-ckm.js +0 -1
- package/dist/client/assets/browserHistoryStore-_SurQa0e.js +0 -2
- package/dist/client/assets/channel-Dsne2IjR.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-Dazl0CLN.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Dazl0CLN.js +0 -2
- package/dist/client/assets/command-DsE3Ju6m.js +0 -2
- package/dist/client/assets/environments-iW64jjyO.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-B5z8GPGl.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-CEpweBDE.js +0 -1
- package/dist/client/assets/git-compare-CCnx9obs.js +0 -2
- package/dist/client/assets/layout-grid-DDlG0mCT.js +0 -2
- package/dist/client/assets/main-ChIB1-3M.css +0 -2
- package/dist/client/assets/main-lV-t-UZx.js +0 -30
- package/dist/client/assets/primaryCloudLinkState-BP-HZzf2.js +0 -2
- package/dist/client/assets/providerSkills-O72EMm0V.js +0 -2
- package/dist/client/assets/pullRequests-7IQc0VIk.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-l3gFfdc2.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-eiWL8AW4.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-UK0E-Txe.js +0 -1
- package/dist/client/assets/runtime-B5cKWtKn.js +0 -2
- package/dist/client/assets/settings-mrxLMm57.js +0 -2
- package/dist/client/assets/settings.archived-Hl4HyrFx.js +0 -2
- package/dist/client/assets/settings.connections-CgaYGg_W.js +0 -2
- package/dist/client/assets/settings.data-controls-DNY0fL9E.js +0 -2
- package/dist/client/assets/settings.diagnostics-BHSEPjF8.js +0 -2
- package/dist/client/assets/settings.integrations-DykwmCf7.js +0 -2
- package/dist/client/assets/settings.plugins-B7Nlb85S.js +0 -5
- package/dist/client/assets/settings.projects-Ob8jKbIh.js +0 -4
- package/dist/client/assets/settings.providers-BIm-8j9C.js +0 -3
- package/dist/client/assets/settings.snap-shot-D37zM8an.js +0 -2
- package/dist/client/assets/settings.source-control-DmRUgcsk.js +0 -2
- package/dist/client/assets/settingsLayout-CqGfrbmD.js +0 -3
- package/dist/client/assets/sidebar-C_I_pq_E.js +0 -2
- package/dist/client/assets/sortable.esm-DuAaqmgD.js +0 -6
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DqXgq-FS.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DAX63YhZ.js +0 -9
- package/dist/client/assets/threadSort-Cn23YHH2.js +0 -2
- package/dist/client/assets/toast-CN7Jd-pG.js +0 -2
- package/dist/client/assets/tooltip-DaSC-3cL.js +0 -2
- package/dist/client/assets/usage-CKRSqJso.js +0 -2
- package/dist/client/assets/useNavigate-Dhy_1-Mg.js +0 -2
- package/dist/client/assets/usePullRequestActions-_K7fD4Ny.js +0 -3
- package/dist/client/assets/useScopedModelAvailability-DE1E_lbg.js +0 -2
- package/dist/client/assets/useSettings-CKA-LDDj.js +0 -3
- package/dist/client/assets/utils-BAPnqm16.js +0 -37
- package/dist/client/assets/welcome-nE6tva7L.js +0 -2
package/dist/client/assets/{SettingsPanels.logic-C5FkY28P.js → SettingsPanels.logic-CSbITXNG.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$w as e,XT as t,fh as n}from"./utils-
|
|
2
|
-
//# sourceMappingURL=SettingsPanels.logic-
|
|
1
|
+
import{$w as e,XT as t,fh as n}from"./utils-ChK8VEFC.js";import{F as r,L as i,R as a,z as o}from"./useSettings-Dr8XPXiN.js";function s(e){return e!==`separate`}function c(e,t=`repository`){return e?t===`repository_path`?`repository_path`:`repository`:`separate`}var l=`t3code:last-enabled-project-grouping-mode`;function u(){try{return localStorage.getItem(l)===`repository_path`?`repository_path`:`repository`}catch{return`repository`}}function d(e){if(e!==`separate`)try{localStorage.setItem(l,e)}catch{}}function f(e){return!t(e.backgroundActivity,n.backgroundActivity)||e.backgroundActivityProfile!==n.backgroundActivityProfile||!t(e.automaticGitFetchInterval,n.automaticGitFetchInterval)||!t(e.providerHealthRefreshInterval,n.providerHealthRefreshInterval)}function p(e){return[...e.fontFamilySans!==n.fontFamilySans||e.fontSizeInterface!==n.fontSizeInterface?[`Interface font`]:[],...e.fontFamilyComposer!==n.fontFamilyComposer||e.fontSizePrompt!==n.fontSizePrompt?[`Prompt font`]:[],...e.fontFamilyCode!==n.fontFamilyCode||e.fontSizeCode!==n.fontSizeCode?[`Code font`]:[],...e.fontFamilyTerminal!==n.fontFamilyTerminal||e.fontSizeTerminal!==n.fontSizeTerminal?[`Terminal font`]:[]]}function m(e,t){return e._tag===t._tag?e._tag===`fill`||t._tag===`fill`?!0:e.width!==t.width||e.height!==t.height?!1:e._tag===`preset`&&t._tag===`preset`?e.presetId===t.presetId:!0:!1}function h(e){return[...m(e.browserDefaultViewport,n.browserDefaultViewport)?[]:[`Browser viewport`],...e.browserDefaultZoomFactor===n.browserDefaultZoomFactor?[]:[`Browser zoom`],...e.browserDefaultAppearance===n.browserDefaultAppearance?[]:[`Browser appearance`],...e.browserRecordingFrameRate===n.browserRecordingFrameRate?[]:[`Recording frame rate`],...e.browserRecordingShowKeyPresses?[`Recording key presses`]:[],...e.browserRecordingShowMousePresses?[`Recording mouse presses`]:[],...e.browserLinkTarget===n.browserLinkTarget?[]:[`Open links in`],...e.browserAutoShowFloatingPreview===n.browserAutoShowFloatingPreview?[]:[`Floating preview`]]}function g(e){let t=o(e),n=i({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}});return n.profile===`custom`?`advanced`:n.profile}function _(e,t){let n=a(e);return{schemaVersion:1,profile:`custom`,baseProfile:t,overrides:n.profile===`custom`?n.overrides:{}}}function v(e){return{providerInstances:{...e.settings.providerInstances,[e.instanceId]:e.instance},...e.textGenerationModelSelection===void 0?{}:{textGenerationModelSelection:e.textGenerationModelSelection}}}function y(t){return Math.round(e(t)/1e3)}function b(e,t=0){return e===null||!Number.isFinite(e)?t:Math.max(t,Math.round(e))}function x(e,t,n){let i={automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery,...n};for(let[e,t]of Object.entries(i))t===void 0&&delete i[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:r(e),overrides:i}}}export{h as a,s as c,u as d,d as f,y as i,b as l,_ as n,p as o,g as p,v as r,f as s,x as t,c as u};
|
|
2
|
+
//# sourceMappingURL=SettingsPanels.logic-CSbITXNG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n,sr as r}from"./utils-ChK8VEFC.js";import{t as i}from"./useNavigate-B5WzUZJ7.js";import{t as a}from"./useLocation-CEeuom34.js";import{E as o}from"./useSettings-Dr8XPXiN.js";import{n as s,r as c,t as l}from"./alert-CNni4aGm.js";import{B as u,H as d,i as f}from"./settingsLayout-BNfRQ-bS.js";var p=t(),m=e(n(),1);function h(e){let t=(0,p.c)(42),{children:n,target:h,targetId:y,eligibleEnvironmentIds:b}=e,{selectScope:x,search:S}=u(),C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(C={from:`/settings`},t[0]=C):C=t[0];let w=i(C),T;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(T={select:v},t[1]=T):T=t[1];let E=a(T),{environments:D}=o(),O=d(),k,A,j,M,N,P,F,I;if(t[2]!==n||t[3]!==b||t[4]!==D||t[5]!==O||t[6]!==w||t[7]!==E||t[8]!==S||t[9]!==x||t[10]!==h||t[11]!==y){let e=h===`checkout`?O.filter(e=>!S.project||e.projectKey===S.project).flatMap(_):h===`project`?O.map(g):h===`environment`?D.filter(e=>b===void 0||b.includes(e.environmentId)).map(e=>({label:D.some(t=>t.environmentId!==e.environmentId&&t.label===e.label)?`${e.label} · ${e.displayUrl||e.environmentId}`:e.label,search:{machine:e.environmentId}})):[{label:`Open all environments`,search:{}}];M=f,j=l,I=`status`,A=c,t[20]===n?F=t[21]:(F=(0,m.jsx)(`p`,{children:n}),t[20]=n,t[21]=F),k=s,N=`flex-wrap`;let i;t[22]!==w||t[23]!==E||t[24]!==x||t[25]!==y?(i=e=>(0,m.jsx)(r,{size:`sm-multiline`,variant:`outline`,className:`max-w-full break-all text-left`,onClick:()=>{y?w({to:E,search:()=>e.search,hash:y}):x(e.search)},children:e.label},JSON.stringify(e.search)),t[22]=w,t[23]=E,t[24]=x,t[25]=y,t[26]=i):i=t[26],P=e.map(i),t[2]=n,t[3]=b,t[4]=D,t[5]=O,t[6]=w,t[7]=E,t[8]=S,t[9]=x,t[10]=h,t[11]=y,t[12]=k,t[13]=A,t[14]=j,t[15]=M,t[16]=N,t[17]=P,t[18]=F,t[19]=I}else k=t[12],A=t[13],j=t[14],M=t[15],N=t[16],P=t[17],F=t[18],I=t[19];let L;t[27]!==k||t[28]!==N||t[29]!==P?(L=(0,m.jsx)(k,{className:N,children:P}),t[27]=k,t[28]=N,t[29]=P,t[30]=L):L=t[30];let R;t[31]!==A||t[32]!==F||t[33]!==L?(R=(0,m.jsxs)(A,{children:[F,L]}),t[31]=A,t[32]=F,t[33]=L,t[34]=R):R=t[34];let z;t[35]!==j||t[36]!==I||t[37]!==R?(z=(0,m.jsx)(j,{role:I,children:R}),t[35]=j,t[36]=I,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==M||t[40]!==z?(B=(0,m.jsx)(M,{children:z}),t[39]=M,t[40]=z,t[41]=B):B=t[41],B}function g(e){return{label:e.displayName,search:{project:e.projectKey}}}function _(e){return e.memberProjects.map(t=>({label:`${e.displayName} · ${t.environmentLabel??`Environment`} · ${t.workspaceRoot}`,search:{project:e.projectKey,machine:t.environmentId,checkout:t.physicalProjectKey}}))}function v(e){return e.pathname}export{h as t};
|
|
2
|
+
//# sourceMappingURL=SettingsScopeNotice-B7r3-bw2.js.map
|
package/dist/client/assets/{T3ConnectAccountPages-DDSM7QWS.js → T3ConnectAccountPages-CZ221lRl.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,$x as r,DC as i,Go as a,NE as o,Qo as s,Wn as c,Xp as l,Yo as u,lE as d,ns as f,oT as p,rm as m,sr as h,ss as g,t as _,va as v,xs as y}from"./utils-BAPnqm16.js";import{I as b,O as x,R as S,W as C,d as w,f as T,h as E,k as D,m as O,mn as k,r as ee}from"./runtime-B9IDNXDU.js";import{i as A}from"./toast-CN7Jd-pG.js";import{t as j}from"./use-atom-command-GpCw1tWF.js";import{t as M}from"./skeleton-0mC3wMw1.js";import{i as te,r as ne}from"./dist-CkgAUeqn.js";import{a as N,i as P,o as F,r as I,t as L}from"./empty-2jxBvPLn.js";import{Fa as re,Ia as ie,Pa as ae,qa as oe}from"./main-lV-t-UZx.js";var R=e(v(),1),z=o(),B=e(t(),1),V=f(i(k,ee.contextEffect.pipe(r(e=>p(e,k))))),H=w(V),U=D(),W=b(V,{label:`web:managed-relay:deregister-environment`,scheduler:U,concurrency:{mode:`serial`,key:e=>e.accountId},execute:(e,t)=>T(t,e)}),G=n(y([])).pipe(s,g(`managed-relay:web:environments:null`)),K=n(y([])).pipe(s,g(`managed-relay:web:devices:null`));function se(){let e=(0,z.c)(14),t=u(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.environmentsAtom(t):G,e[0]=t,e[1]=n);let r=u(n),i;e[2]===r?i=e[3]:(i=E(r),e[2]=r,e[3]=i);let o=i,s,c;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay environment listing failed`,{message:o.error,traceId:o.errorTraceId})},c=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=c):(s=e[6],c=e[7]),(0,B.useEffect)(s,c);let l;e[8]===t?l=e[9]:(l=()=>{t&&H.refreshEnvironments(a,t)},e[8]=t,e[9]=l);let d=l,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}function q(){let e=(0,z.c)(14),t=u(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.devicesAtom(t):K,e[0]=t,e[1]=n);let r=u(n),i;e[2]===r?i=e[3]:(i=E(r),e[2]=r,e[3]=i);let o=i,s,c;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay device listing failed`,{message:o.error,traceId:o.errorTraceId})},c=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=c):(s=e[6],c=e[7]),(0,B.useEffect)(s,c);let l;e[8]===t?l=e[9]:(l=()=>{t&&H.refreshDevices(a,t)},e[8]=t,e[9]=l);let d=l,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}var ce=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),le=[[`notifyOnApproval`,`approvals`],[`notifyOnInput`,`input requests`],[`notifyOnCompletion`,`completions`],[`notifyOnFailure`,`failures`]];function ue(e){return`${e.platform===`android`?`Android`:e.iosMajorVersion===null?`iOS`:`iOS ${e.iosMajorVersion}`}${e.appVersion?` · P4 Code ${e.appVersion}`:``}`}function de(e){if(!e.notifications.enabled)return`Push notifications are disabled on this device.`;let t=le.flatMap(([t,n])=>e.notifications[t]?[n]:[]);return t.length>0?`Alerts enabled for ${t.join(`, `)}.`:`Push notifications are enabled, but no alert types are selected.`}function fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Update time unavailable`:`Updated ${ce.format(t)}`}var J=e(d(),1);function Y(e){let t=(0,z.c)(18),{action:n,children:r,className:i,description:a,title:o}=e,s;t[0]===i?s=t[1]:(s=_(`w-full min-w-0 text-foreground`,i),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=(0,J.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:o}),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=a?(0,J.jsx)(`p`,{className:`mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9`,children:a}):null,t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n?(0,J.jsx)(`div`,{className:`shrink-0`,children:n}):null,t[9]=n,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,J.jsxs)(`header`,{className:`flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:s,children:[f,r]}),t[14]=r,t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function X(e){let t=(0,z.c)(7),{className:n,disabled:r,isPending:i,onClick:a}=e,o=r!==void 0&&r||i,s;t[0]===i?s=t[1]:(s=(0,J.jsx)(oe,{"aria-hidden":`true`,size:`sm`,refreshing:i}),t[0]=i,t[1]=s);let c;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,J.jsxs)(h,{size:`sm`,variant:`outline`,className:n,disabled:o,onClick:a,children:[s,`Refresh`]}),t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Z(e){let t=(0,z.c)(12),{children:n,className:r,icon:i}=e,a;t[0]===r?a=t[1]:(a=_(`border-t py-4 first:border-t-0`,r),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[4]=n,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,J.jsx)(`li`,{className:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}var pe=[`primary`,`secondary`];function Q(e){let t=(0,z.c)(4),{enabled:n,label:r}=e,i=n?`success`:`outline`,a=n?`On`:`Off`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,J.jsxs)(c,{variant:i,children:[r,`: `,a]}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function me(e){let t=(0,z.c)(32),{device:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(m,{className:`size-4`}),t[0]=r):r=t[0];let i;t[1]===n.label?i=t[2]:(i=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=i);let a;t[3]===n?a=t[4]:(a=ue(n),t[3]=n,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`p`,{className:`text-xs leading-4.5 text-muted-foreground`,children:a}),t[5]=a,t[6]=o);let s;t[7]!==i||t[8]!==o?(s=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;t[10]===n.updatedAt?c=t[11]:(c=fe(n.updatedAt),t[10]=n.updatedAt,t[11]=c);let l;t[12]===c?l=t[13]:(l=(0,J.jsx)(`p`,{className:`shrink-0 text-2xs leading-4 text-muted-foreground/75`,children:c}),t[12]=c,t[13]=l);let u;t[14]!==s||t[15]!==l?(u=(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3`,children:[s,l]}),t[14]=s,t[15]=l,t[16]=u):u=t[16];let d;t[17]===n.notifications.enabled?d=t[18]:(d=(0,J.jsx)(Q,{enabled:n.notifications.enabled,label:`Push notifications`}),t[17]=n.notifications.enabled,t[18]=d);let f;t[19]===n.liveActivities.enabled?f=t[20]:(f=(0,J.jsx)(Q,{enabled:n.liveActivities.enabled,label:`Live Activities`}),t[19]=n.liveActivities.enabled,t[20]=f);let p;t[21]!==f||t[22]!==d?(p=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d,f]}),t[21]=f,t[22]=d,t[23]=p):p=t[23];let h;t[24]===n?h=t[25]:(h=de(n),t[24]=n,t[25]=h);let g;t[26]===h?g=t[27]:(g=(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-4.5 text-muted-foreground/80`,children:h}),t[26]=h,t[27]=g);let _;return t[28]!==p||t[29]!==g||t[30]!==u?(_=(0,J.jsxs)(Z,{icon:r,children:[u,p,g]}),t[28]=p,t[29]=g,t[30]=u,t[31]=_):_=t[31],_}function he(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{"aria-label":`Loading mobile clients`,className:`divide-y border-t`,role:`status`,children:pe.map(ge)}),e[0]=t):t=e[0],t}function ge(e){return(0,J.jsx)(`div`,{className:`py-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(M,{shape:`card`,className:`size-8 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,J.jsx)(M,{className:`h-3.5 w-36`}),(0,J.jsx)(M,{className:`h-3 w-28`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`h-4.5 w-28`}),(0,J.jsx)(M,{className:`h-4.5 w-24`})]})]})]})},e)}function _e(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(m,{})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(L,{size:`compact`,children:[t,(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No mobile clients`}),(0,J.jsx)(I,{children:`Install P4 Code on your phone and sign in to P4 Connect to get push notifications and Live Activities.`})]})]}),e[1]=n):n=e[1],n}function ve(){let e=(0,z.c)(18),t=q(),n;e[0]===t.data?n=e[1]:(n=t.data??[],e[0]=t.data,e[1]=n);let r=n,i=!t.accountId||t.data===null&&!t.error,a=t.error!==null&&t.data===null,o;e[2]!==t.isPending||e[3]!==t.refresh?(o=(0,J.jsx)(X,{isPending:t.isPending,onClick:t.refresh}),e[2]=t.isPending,e[3]=t.refresh,e[4]=o):o=e[4];let s;e[5]!==t.error||e[6]!==t.refresh?(s=t.error?(0,J.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 border-t border-destructive/35 py-3 text-xs sm:flex-row sm:items-center sm:justify-between`,role:`alert`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load mobile clients`}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.error})]}),(0,J.jsx)(h,{size:`xs`,variant:`outline`,onClick:t.refresh,children:`Try again`})]}):null,e[5]=t.error,e[6]=t.refresh,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==a||e[10]!==i?(c=i?(0,J.jsx)(he,{}):a?null:r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(ye)}):(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsx)(_e,{})}),e[8]=r,e[9]=a,e[10]=i,e[11]=c):c=e[11];let l;e[12]!==s||e[13]!==c?(l=(0,J.jsxs)(`div`,{children:[s,c]}),e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;return e[15]!==o||e[16]!==l?(u=(0,J.jsx)(Y,{title:`Mobile clients`,description:`Mobile devices that get notifications from your environments.`,action:o,children:l}),e[15]=o,e[16]=l,e[17]=u):u=e[17],u}function ye(e){return(0,J.jsx)(me,{device:e},e.deviceId)}var be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Link date unavailable`:`Linked ${be.format(t)}`}function Se(e){return e.endpoint.providerKind===`cloudflare_tunnel`?`Managed tunnel`:`Activity publishing only`}function Ce(e){let t=(0,z.c)(46),{environment:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(l,{className:`size-4`}),t[0]=r):r=t[0];let i=e.confirmationOpen,a=e.onConfirmationChange,o;t[1]===n.label?o=t[2]:(o=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=o);let s;t[3]===n.linkedAt?s=t[4]:(s=xe(n.linkedAt),t[3]=n.linkedAt,t[4]=s);let c;t[5]===n?c=t[6]:(c=Se(n),t[5]=n,t[6]=c);let u;t[7]!==s||t[8]!==c?(u=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[s,` · `,c]}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==o||t[11]!==u?(d=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,u]}),t[10]=o,t[11]=u,t[12]=d):d=t[12];let f;t[13]===e.mutationPending?f=t[14]:(f=(0,J.jsx)(ie,{render:(0,J.jsx)(h,{size:`sm`,variant:`destructive-outline`,disabled:e.mutationPending,children:`Deregister`})}),t[13]=e.mutationPending,t[14]=f);let p;t[15]!==d||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17];let m=`Confirm deregistration of ${n.label}`,g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(`h4`,{className:`text-sm leading-4.5 font-semibold text-foreground`,children:`Deregister server`}),t[18]=g):g=t[18];let _;t[19]===n.label?_=t[20]:(_=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[`“`,n.label,`” will be removed from this account.`]}),t[19]=n.label,t[20]=_);let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(`p`,{className:`mt-4 max-w-xl text-xs leading-4.5 text-muted-foreground`,children:`P4 Connect access will be revoked, any managed tunnel will be removed, and a host space will become available. Local connections on your devices are not changed.`}),t[21]=v):v=t[21];let y;t[22]===e?y=t[23]:(y=()=>e.onConfirmationChange(!1),t[22]=e,t[23]=y);let b;t[24]!==e.mutationPending||t[25]!==y?(b=(0,J.jsx)(h,{size:`sm`,variant:`ghost`,disabled:e.mutationPending,onClick:y,children:`Cancel`}),t[24]=e.mutationPending,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==n||t[28]!==e?(x=()=>e.onDeregister(n),t[27]=n,t[28]=e,t[29]=x):x=t[29];let S=e.mutationPending?`Deregistering…`:`Deregister`,C;t[30]!==e.mutationPending||t[31]!==x||t[32]!==S?(C=(0,J.jsx)(h,{size:`sm`,variant:`destructive`,disabled:e.mutationPending,onClick:x,children:S}),t[30]=e.mutationPending,t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==b||t[35]!==C?(w=(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[b,C]}),t[34]=b,t[35]=C,t[36]=w):w=t[36];let T;t[37]!==m||t[38]!==_||t[39]!==w?(T=(0,J.jsx)(re,{children:(0,J.jsx)(`div`,{className:`pt-3`,children:(0,J.jsxs)(`div`,{className:`rounded-lg border border-input bg-muted/32 px-5 py-4 shadow-xs/5`,role:`group`,"aria-label":m,children:[g,_,v,w]})})}),t[37]=m,t[38]=_,t[39]=w,t[40]=T):T=t[40];let E;return t[41]!==e.confirmationOpen||t[42]!==e.onConfirmationChange||t[43]!==T||t[44]!==p?(E=(0,J.jsx)(Z,{icon:r,children:(0,J.jsxs)(ae,{open:i,onOpenChange:a,children:[p,T]})}),t[41]=e.confirmationOpen,t[42]=e.onConfirmationChange,t[43]=T,t[44]=p,t[45]=E):E=t[45],E}function we(){let e=(0,z.c)(41),t=se(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},e[0]=n):n=e[0];let r=j(W,n),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(!1),u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={accountId:null,linkedAtById:new Map},e[1]=u):u=e[1];let[d,f]=(0,B.useState)(u),p;e[2]!==r||e[3]!==t?(p=async e=>{let n=t.accountId;if(!n||c.current)return;c.current=!0,a(e.environmentId);let i=await r({accountId:n,environmentId:e.environmentId});if(c.current=!1,a(null),i._tag===`Success`){s(null),f(t=>{let r=new Map(t.accountId===n?t.linkedAtById:[]);return r.set(e.environmentId,e.linkedAt),{accountId:n,linkedAtById:r}}),t.refresh(),A.add({type:`success`,title:`Server deregistered`,description:`P4 Connect access was revoked and a host space is now available.`});return}if(S(i))return;let o=C(i),l=o instanceof Error?o.message:`Could not deregister the server.`,u=x(o);console.error(`[t3-connect] Could not deregister environment`,{environmentId:e.environmentId,message:l,traceId:u,cause:o}),A.add({type:`error`,title:`Could not deregister server`,description:l,data:u?{secondaryActionProps:{children:`Copy trace ID`,onClick:()=>void navigator.clipboard?.writeText(u)}}:void 0})},e[2]=r,e[3]=t,e[4]=p):p=e[4];let m=p,h;e[5]!==t.accountId||e[6]!==d.accountId||e[7]!==d.linkedAtById?(h=d.accountId===t.accountId?d.linkedAtById:new Map,e[5]=t.accountId,e[6]=d.accountId,e[7]=d.linkedAtById,e[8]=h):h=e[8];let g=h,_,v,y,b,w,T;if(e[9]!==o||e[10]!==i||e[11]!==t.accountId||e[12]!==t.data||e[13]!==t.error||e[14]!==t.isPending||e[15]!==t.refresh||e[16]!==m||e[17]!==g){let n;e[24]===g?n=e[25]:(n=e=>g.get(e.environmentId)!==e.linkedAt,e[24]=g,e[25]=n);let r=(t.data??[]).filter(n),a=!t.accountId||t.data===null&&!t.error;_=Y,b=`P4 Connect`,w=`Environments registered to your account. Connections on this device are managed in Settings.`;let c=i!==null;e[26]!==t.isPending||e[27]!==t.refresh||e[28]!==c?(T=(0,J.jsx)(X,{disabled:c,isPending:t.isPending,onClick:t.refresh}),e[26]=t.isPending,e[27]=t.refresh,e[28]=c,e[29]=T):T=e[29],e[30]===t.error?v=e[31]:(v=t.error?(0,J.jsxs)(`div`,{className:`mb-4 border-t border-destructive/35 py-3 text-xs`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load P4 Connect environments`}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.error})]}):null,e[30]=t.error,e[31]=v),y=a?(0,J.jsx)(`p`,{className:`border-t py-4 text-xs text-muted-foreground`,role:`status`,children:`Loading environments…`}):r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(e=>(0,J.jsx)(Ce,{environment:e,confirmationOpen:o===e.environmentId,mutationPending:i!==null,onConfirmationChange:t=>s(t?e.environmentId:null),onDeregister:e=>void m(e)},e.environmentId))}):t.error?null:(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsxs)(L,{size:`compact`,children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(l,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No P4 Connect environments`}),(0,J.jsx)(I,{children:`Link an environment from its local Settings to make it available through P4 Connect.`})]})]})}),e[9]=o,e[10]=i,e[11]=t.accountId,e[12]=t.data,e[13]=t.error,e[14]=t.isPending,e[15]=t.refresh,e[16]=m,e[17]=g,e[18]=_,e[19]=v,e[20]=y,e[21]=b,e[22]=w,e[23]=T}else _=e[18],v=e[19],y=e[20],b=e[21],w=e[22],T=e[23];let E;e[32]!==v||e[33]!==y?(E=(0,J.jsxs)(`div`,{children:[v,y]}),e[32]=v,e[33]=y,e[34]=E):E=e[34];let D;return e[35]!==_||e[36]!==b||e[37]!==w||e[38]!==T||e[39]!==E?(D=(0,J.jsx)(_,{title:b,description:w,action:T,children:E}),e[35]=_,e[36]=b,e[37]=w,e[38]=T,e[39]=E,e[40]=D):D=e[40],D}var $=[{label:`Mobile clients`,url:`mobile-clients`,icon:(0,J.jsx)(m,{className:`size-4`}),content:(0,J.jsx)(ve,{})},{label:`P4 Connect`,url:`t3-connect`,icon:(0,J.jsx)(l,{className:`size-4`}),content:(0,J.jsx)(we,{})}];function Te(){let e=(0,z.c)(8),t=te(),{isSignedIn:n}=ne(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={},e[0]=r):r=e[0];let[i,a]=(0,B.useState)(r),o;e[1]===t?o=e[2]:(o=()=>{let e=(e,t)=>a(n=>({...n,[e]:t}));t.openUserProfile({__experimental_startPath:`/t3-connect`,customPages:$.map(t=>({label:t.label,url:t.url,mount:n=>e(`content:${t.url}`,n),unmount:()=>e(`content:${t.url}`,void 0),mountIcon:n=>e(`icon:${t.url}`,n),unmountIcon:()=>e(`icon:${t.url}`,void 0)}))})},e[1]=t,e[2]=o);let s=o,c;e[3]===i?c=e[4]:(c=$.flatMap(e=>{let t=i[`content:${e.url}`],n=i[`icon:${e.url}`];return[t?(0,R.createPortal)(e.content,t,`content:${e.url}`):null,n?(0,R.createPortal)(e.icon,n,`icon:${e.url}`):null]}),e[3]=i,e[4]=c);let l=c,u=n?s:null,d;return e[5]!==l||e[6]!==u?(d={open:u,portals:l},e[5]=l,e[6]=u,e[7]=d):d=e[7],d}export{Te as n,$ as t};
|
|
2
|
-
//# sourceMappingURL=T3ConnectAccountPages-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,$x as r,DC as i,Go as a,NE as o,Qo as s,Wn as c,Xp as l,Yo as u,lE as d,ns as f,oT as p,rm as m,sr as h,ss as g,t as _,va as v,xs as y}from"./utils-ChK8VEFC.js";import{I as b,O as x,R as S,W as C,d as w,f as T,h as E,k as D,m as O,mn as k,r as ee}from"./runtime-BunkcrGh.js";import{i as A}from"./toast-WpVvhflo.js";import{t as j}from"./use-atom-command-6Jnx7WG6.js";import{t as M}from"./skeleton-DoQ8WJ33.js";import{i as te,r as ne}from"./dist-BUfo2bac.js";import{a as N,i as P,o as F,r as I,t as L}from"./empty-IIGW45Hv.js";import{$i as re,ea as ie,fa as ae,ta as oe}from"./main-DzuY7nUi.js";var R=e(v(),1),z=o(),B=e(t(),1),V=f(i(k,ee.contextEffect.pipe(r(e=>p(e,k))))),H=w(V),U=D(),W=b(V,{label:`web:managed-relay:deregister-environment`,scheduler:U,concurrency:{mode:`serial`,key:e=>e.accountId},execute:(e,t)=>T(t,e)}),G=n(y([])).pipe(s,g(`managed-relay:web:environments:null`)),K=n(y([])).pipe(s,g(`managed-relay:web:devices:null`));function se(){let e=(0,z.c)(14),t=u(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.environmentsAtom(t):G,e[0]=t,e[1]=n);let r=u(n),i;e[2]===r?i=e[3]:(i=E(r),e[2]=r,e[3]=i);let o=i,s,c;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay environment listing failed`,{message:o.error,traceId:o.errorTraceId})},c=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=c):(s=e[6],c=e[7]),(0,B.useEffect)(s,c);let l;e[8]===t?l=e[9]:(l=()=>{t&&H.refreshEnvironments(a,t)},e[8]=t,e[9]=l);let d=l,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}function q(){let e=(0,z.c)(14),t=u(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.devicesAtom(t):K,e[0]=t,e[1]=n);let r=u(n),i;e[2]===r?i=e[3]:(i=E(r),e[2]=r,e[3]=i);let o=i,s,c;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay device listing failed`,{message:o.error,traceId:o.errorTraceId})},c=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=c):(s=e[6],c=e[7]),(0,B.useEffect)(s,c);let l;e[8]===t?l=e[9]:(l=()=>{t&&H.refreshDevices(a,t)},e[8]=t,e[9]=l);let d=l,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}var ce=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),le=[[`notifyOnApproval`,`approvals`],[`notifyOnInput`,`input requests`],[`notifyOnCompletion`,`completions`],[`notifyOnFailure`,`failures`]];function ue(e){return`${e.platform===`android`?`Android`:e.iosMajorVersion===null?`iOS`:`iOS ${e.iosMajorVersion}`}${e.appVersion?` · P4 Code ${e.appVersion}`:``}`}function de(e){if(!e.notifications.enabled)return`Push notifications are disabled on this device.`;let t=le.flatMap(([t,n])=>e.notifications[t]?[n]:[]);return t.length>0?`Alerts enabled for ${t.join(`, `)}.`:`Push notifications are enabled, but no alert types are selected.`}function fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Update time unavailable`:`Updated ${ce.format(t)}`}var J=e(d(),1);function Y(e){let t=(0,z.c)(18),{action:n,children:r,className:i,description:a,title:o}=e,s;t[0]===i?s=t[1]:(s=_(`w-full min-w-0 text-foreground`,i),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=(0,J.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:o}),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=a?(0,J.jsx)(`p`,{className:`mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9`,children:a}):null,t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n?(0,J.jsx)(`div`,{className:`shrink-0`,children:n}):null,t[9]=n,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,J.jsxs)(`header`,{className:`flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:s,children:[f,r]}),t[14]=r,t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function X(e){let t=(0,z.c)(7),{className:n,disabled:r,isPending:i,onClick:a}=e,o=r!==void 0&&r||i,s;t[0]===i?s=t[1]:(s=(0,J.jsx)(ae,{"aria-hidden":`true`,size:`sm`,refreshing:i}),t[0]=i,t[1]=s);let c;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,J.jsxs)(h,{size:`sm`,variant:`outline`,className:n,disabled:o,onClick:a,children:[s,`Refresh`]}),t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Z(e){let t=(0,z.c)(12),{children:n,className:r,icon:i}=e,a;t[0]===r?a=t[1]:(a=_(`border-t py-4 first:border-t-0`,r),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[4]=n,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,J.jsx)(`li`,{className:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}var pe=[`primary`,`secondary`];function Q(e){let t=(0,z.c)(4),{enabled:n,label:r}=e,i=n?`success`:`outline`,a=n?`On`:`Off`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,J.jsxs)(c,{variant:i,children:[r,`: `,a]}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function me(e){let t=(0,z.c)(32),{device:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(m,{className:`size-4`}),t[0]=r):r=t[0];let i;t[1]===n.label?i=t[2]:(i=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=i);let a;t[3]===n?a=t[4]:(a=ue(n),t[3]=n,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`p`,{className:`text-xs leading-4.5 text-muted-foreground`,children:a}),t[5]=a,t[6]=o);let s;t[7]!==i||t[8]!==o?(s=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;t[10]===n.updatedAt?c=t[11]:(c=fe(n.updatedAt),t[10]=n.updatedAt,t[11]=c);let l;t[12]===c?l=t[13]:(l=(0,J.jsx)(`p`,{className:`shrink-0 text-2xs leading-4 text-muted-foreground/75`,children:c}),t[12]=c,t[13]=l);let u;t[14]!==s||t[15]!==l?(u=(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3`,children:[s,l]}),t[14]=s,t[15]=l,t[16]=u):u=t[16];let d;t[17]===n.notifications.enabled?d=t[18]:(d=(0,J.jsx)(Q,{enabled:n.notifications.enabled,label:`Push notifications`}),t[17]=n.notifications.enabled,t[18]=d);let f;t[19]===n.liveActivities.enabled?f=t[20]:(f=(0,J.jsx)(Q,{enabled:n.liveActivities.enabled,label:`Live Activities`}),t[19]=n.liveActivities.enabled,t[20]=f);let p;t[21]!==f||t[22]!==d?(p=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d,f]}),t[21]=f,t[22]=d,t[23]=p):p=t[23];let h;t[24]===n?h=t[25]:(h=de(n),t[24]=n,t[25]=h);let g;t[26]===h?g=t[27]:(g=(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-4.5 text-muted-foreground/80`,children:h}),t[26]=h,t[27]=g);let _;return t[28]!==p||t[29]!==g||t[30]!==u?(_=(0,J.jsxs)(Z,{icon:r,children:[u,p,g]}),t[28]=p,t[29]=g,t[30]=u,t[31]=_):_=t[31],_}function he(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{"aria-label":`Loading mobile clients`,className:`divide-y border-t`,role:`status`,children:pe.map(ge)}),e[0]=t):t=e[0],t}function ge(e){return(0,J.jsx)(`div`,{className:`py-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(M,{shape:`card`,className:`size-8 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,J.jsx)(M,{className:`h-3.5 w-36`}),(0,J.jsx)(M,{className:`h-3 w-28`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`h-4.5 w-28`}),(0,J.jsx)(M,{className:`h-4.5 w-24`})]})]})]})},e)}function _e(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(m,{})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(L,{size:`compact`,children:[t,(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No mobile clients`}),(0,J.jsx)(I,{children:`Install P4 Code on your phone and sign in to P4 Connect to get push notifications and Live Activities.`})]})]}),e[1]=n):n=e[1],n}function ve(){let e=(0,z.c)(18),t=q(),n;e[0]===t.data?n=e[1]:(n=t.data??[],e[0]=t.data,e[1]=n);let r=n,i=!t.accountId||t.data===null&&!t.error,a=t.error!==null&&t.data===null,o;e[2]!==t.isPending||e[3]!==t.refresh?(o=(0,J.jsx)(X,{isPending:t.isPending,onClick:t.refresh}),e[2]=t.isPending,e[3]=t.refresh,e[4]=o):o=e[4];let s;e[5]!==t.error||e[6]!==t.refresh?(s=t.error?(0,J.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 border-t border-destructive/35 py-3 text-xs sm:flex-row sm:items-center sm:justify-between`,role:`alert`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load mobile clients`}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.error})]}),(0,J.jsx)(h,{size:`xs`,variant:`outline`,onClick:t.refresh,children:`Try again`})]}):null,e[5]=t.error,e[6]=t.refresh,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==a||e[10]!==i?(c=i?(0,J.jsx)(he,{}):a?null:r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(ye)}):(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsx)(_e,{})}),e[8]=r,e[9]=a,e[10]=i,e[11]=c):c=e[11];let l;e[12]!==s||e[13]!==c?(l=(0,J.jsxs)(`div`,{children:[s,c]}),e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;return e[15]!==o||e[16]!==l?(u=(0,J.jsx)(Y,{title:`Mobile clients`,description:`Mobile devices that get notifications from your environments.`,action:o,children:l}),e[15]=o,e[16]=l,e[17]=u):u=e[17],u}function ye(e){return(0,J.jsx)(me,{device:e},e.deviceId)}var be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Link date unavailable`:`Linked ${be.format(t)}`}function Se(e){return e.endpoint.providerKind===`cloudflare_tunnel`?`Managed tunnel`:`Activity publishing only`}function Ce(e){let t=(0,z.c)(46),{environment:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(l,{className:`size-4`}),t[0]=r):r=t[0];let i=e.confirmationOpen,a=e.onConfirmationChange,o;t[1]===n.label?o=t[2]:(o=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=o);let s;t[3]===n.linkedAt?s=t[4]:(s=xe(n.linkedAt),t[3]=n.linkedAt,t[4]=s);let c;t[5]===n?c=t[6]:(c=Se(n),t[5]=n,t[6]=c);let u;t[7]!==s||t[8]!==c?(u=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[s,` · `,c]}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==o||t[11]!==u?(d=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,u]}),t[10]=o,t[11]=u,t[12]=d):d=t[12];let f;t[13]===e.mutationPending?f=t[14]:(f=(0,J.jsx)(oe,{render:(0,J.jsx)(h,{size:`sm`,variant:`destructive-outline`,disabled:e.mutationPending,children:`Deregister`})}),t[13]=e.mutationPending,t[14]=f);let p;t[15]!==d||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17];let m=`Confirm deregistration of ${n.label}`,g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(`h4`,{className:`text-sm leading-4.5 font-semibold text-foreground`,children:`Deregister server`}),t[18]=g):g=t[18];let _;t[19]===n.label?_=t[20]:(_=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[`“`,n.label,`” will be removed from this account.`]}),t[19]=n.label,t[20]=_);let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,J.jsx)(`p`,{className:`mt-4 max-w-xl text-xs leading-4.5 text-muted-foreground`,children:`P4 Connect access will be revoked, any managed tunnel will be removed, and a host space will become available. Local connections on your devices are not changed.`}),t[21]=v):v=t[21];let y;t[22]===e?y=t[23]:(y=()=>e.onConfirmationChange(!1),t[22]=e,t[23]=y);let b;t[24]!==e.mutationPending||t[25]!==y?(b=(0,J.jsx)(h,{size:`sm`,variant:`ghost`,disabled:e.mutationPending,onClick:y,children:`Cancel`}),t[24]=e.mutationPending,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==n||t[28]!==e?(x=()=>e.onDeregister(n),t[27]=n,t[28]=e,t[29]=x):x=t[29];let S=e.mutationPending?`Deregistering…`:`Deregister`,C;t[30]!==e.mutationPending||t[31]!==x||t[32]!==S?(C=(0,J.jsx)(h,{size:`sm`,variant:`destructive`,disabled:e.mutationPending,onClick:x,children:S}),t[30]=e.mutationPending,t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==b||t[35]!==C?(w=(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[b,C]}),t[34]=b,t[35]=C,t[36]=w):w=t[36];let T;t[37]!==m||t[38]!==_||t[39]!==w?(T=(0,J.jsx)(ie,{children:(0,J.jsx)(`div`,{className:`pt-3`,children:(0,J.jsxs)(`div`,{className:`rounded-lg border border-input bg-muted/32 px-5 py-4 shadow-xs/5`,role:`group`,"aria-label":m,children:[g,_,v,w]})})}),t[37]=m,t[38]=_,t[39]=w,t[40]=T):T=t[40];let E;return t[41]!==e.confirmationOpen||t[42]!==e.onConfirmationChange||t[43]!==T||t[44]!==p?(E=(0,J.jsx)(Z,{icon:r,children:(0,J.jsxs)(re,{open:i,onOpenChange:a,children:[p,T]})}),t[41]=e.confirmationOpen,t[42]=e.onConfirmationChange,t[43]=T,t[44]=p,t[45]=E):E=t[45],E}function we(){let e=(0,z.c)(41),t=se(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},e[0]=n):n=e[0];let r=j(W,n),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(!1),u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={accountId:null,linkedAtById:new Map},e[1]=u):u=e[1];let[d,f]=(0,B.useState)(u),p;e[2]!==r||e[3]!==t?(p=async e=>{let n=t.accountId;if(!n||c.current)return;c.current=!0,a(e.environmentId);let i=await r({accountId:n,environmentId:e.environmentId});if(c.current=!1,a(null),i._tag===`Success`){s(null),f(t=>{let r=new Map(t.accountId===n?t.linkedAtById:[]);return r.set(e.environmentId,e.linkedAt),{accountId:n,linkedAtById:r}}),t.refresh(),A.add({type:`success`,title:`Server deregistered`,description:`P4 Connect access was revoked and a host space is now available.`});return}if(S(i))return;let o=C(i),l=o instanceof Error?o.message:`Could not deregister the server.`,u=x(o);console.error(`[t3-connect] Could not deregister environment`,{environmentId:e.environmentId,message:l,traceId:u,cause:o}),A.add({type:`error`,title:`Could not deregister server`,description:l,data:u?{secondaryActionProps:{children:`Copy trace ID`,onClick:()=>void navigator.clipboard?.writeText(u)}}:void 0})},e[2]=r,e[3]=t,e[4]=p):p=e[4];let m=p,h;e[5]!==t.accountId||e[6]!==d.accountId||e[7]!==d.linkedAtById?(h=d.accountId===t.accountId?d.linkedAtById:new Map,e[5]=t.accountId,e[6]=d.accountId,e[7]=d.linkedAtById,e[8]=h):h=e[8];let g=h,_,v,y,b,w,T;if(e[9]!==o||e[10]!==i||e[11]!==t.accountId||e[12]!==t.data||e[13]!==t.error||e[14]!==t.isPending||e[15]!==t.refresh||e[16]!==m||e[17]!==g){let n;e[24]===g?n=e[25]:(n=e=>g.get(e.environmentId)!==e.linkedAt,e[24]=g,e[25]=n);let r=(t.data??[]).filter(n),a=!t.accountId||t.data===null&&!t.error;_=Y,b=`P4 Connect`,w=`Environments registered to your account. Connections on this device are managed in Settings.`;let c=i!==null;e[26]!==t.isPending||e[27]!==t.refresh||e[28]!==c?(T=(0,J.jsx)(X,{disabled:c,isPending:t.isPending,onClick:t.refresh}),e[26]=t.isPending,e[27]=t.refresh,e[28]=c,e[29]=T):T=e[29],e[30]===t.error?v=e[31]:(v=t.error?(0,J.jsxs)(`div`,{className:`mb-4 border-t border-destructive/35 py-3 text-xs`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load P4 Connect environments`}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.error})]}):null,e[30]=t.error,e[31]=v),y=a?(0,J.jsx)(`p`,{className:`border-t py-4 text-xs text-muted-foreground`,role:`status`,children:`Loading environments…`}):r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(e=>(0,J.jsx)(Ce,{environment:e,confirmationOpen:o===e.environmentId,mutationPending:i!==null,onConfirmationChange:t=>s(t?e.environmentId:null),onDeregister:e=>void m(e)},e.environmentId))}):t.error?null:(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsxs)(L,{size:`compact`,children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(l,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No P4 Connect environments`}),(0,J.jsx)(I,{children:`Link an environment from its local Settings to make it available through P4 Connect.`})]})]})}),e[9]=o,e[10]=i,e[11]=t.accountId,e[12]=t.data,e[13]=t.error,e[14]=t.isPending,e[15]=t.refresh,e[16]=m,e[17]=g,e[18]=_,e[19]=v,e[20]=y,e[21]=b,e[22]=w,e[23]=T}else _=e[18],v=e[19],y=e[20],b=e[21],w=e[22],T=e[23];let E;e[32]!==v||e[33]!==y?(E=(0,J.jsxs)(`div`,{children:[v,y]}),e[32]=v,e[33]=y,e[34]=E):E=e[34];let D;return e[35]!==_||e[36]!==b||e[37]!==w||e[38]!==T||e[39]!==E?(D=(0,J.jsx)(_,{title:b,description:w,action:T,children:E}),e[35]=_,e[36]=b,e[37]=w,e[38]=T,e[39]=E,e[40]=D):D=e[40],D}var $=[{label:`Mobile clients`,url:`mobile-clients`,icon:(0,J.jsx)(m,{className:`size-4`}),content:(0,J.jsx)(ve,{})},{label:`P4 Connect`,url:`t3-connect`,icon:(0,J.jsx)(l,{className:`size-4`}),content:(0,J.jsx)(we,{})}];function Te(){let e=(0,z.c)(8),t=te(),{isSignedIn:n}=ne(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={},e[0]=r):r=e[0];let[i,a]=(0,B.useState)(r),o;e[1]===t?o=e[2]:(o=()=>{let e=(e,t)=>a(n=>({...n,[e]:t}));t.openUserProfile({__experimental_startPath:`/t3-connect`,customPages:$.map(t=>({label:t.label,url:t.url,mount:n=>e(`content:${t.url}`,n),unmount:()=>e(`content:${t.url}`,void 0),mountIcon:n=>e(`icon:${t.url}`,n),unmountIcon:()=>e(`icon:${t.url}`,void 0)}))})},e[1]=t,e[2]=o);let s=o,c;e[3]===i?c=e[4]:(c=$.flatMap(e=>{let t=i[`content:${e.url}`],n=i[`icon:${e.url}`];return[t?(0,R.createPortal)(e.content,t,`content:${e.url}`):null,n?(0,R.createPortal)(e.icon,n,`icon:${e.url}`):null]}),e[3]=i,e[4]=c);let l=c,u=n?s:null,d;return e[5]!==l||e[6]!==u?(d={open:u,portals:l},e[5]=l,e[6]=u,e[7]=d):d=e[7],d}export{Te as n,$ as t};
|
|
2
|
+
//# sourceMappingURL=T3ConnectAccountPages-CZ221lRl.js.map
|
package/dist/client/assets/{T3ConnectSidebarSignIn-GnkVas23.js → T3ConnectSidebarSignIn-pHxwsU9J.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n,qf as r}from"./utils-
|
|
2
|
-
//# sourceMappingURL=T3ConnectSidebarSignIn-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{NE as t,lE as n,qf as r}from"./utils-ChK8VEFC.js";import{o as i}from"./runtime-BunkcrGh.js";import{n as a,r as o}from"./dist-BUfo2bac.js";import{c as s,l as c,s as l}from"./sidebar-CilourkR.js";import{t as u}from"./T3ConnectAccountPages-CZ221lRl.js";import{t as d}from"./useT3ConnectAuthPrompt-CVbTUWTC.js";var f=t(),p=e(n(),1);function m(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(v,{}),e[0]=t):t=e[0],t}function h(){let e=(0,f.c)(1);if(!i())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(g,{}),e[0]=t):t=e[0],t}function g(){let e=(0,f.c)(1),{isLoaded:t,isSignedIn:n}=o();if(!t||!n)return null;let r;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,p.jsx)(a,{appearance:{elements:{avatarBox:`size-7`,userButtonTrigger:`rounded-lg p-1 hover:bg-sidebar-row-hover`}},children:u.map(_)}),e[0]=r):r=e[0],r}function _(e){return(0,p.jsx)(a.UserProfilePage,{label:e.label,labelIcon:e.icon,url:e.url,children:e.content},e.url)}function v(){let e=(0,f.c)(7),{isLoaded:t,isSignedIn:n}=o(),{authPrompt:i,openAuthPrompt:a}=d();if(!t||n)return null;let u,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,p.jsx)(r,{}),m=(0,p.jsx)(`span`,{children:`Sign in to P4 Connect`}),e[0]=u,e[1]=m):(u=e[0],m=e[1]);let h;e[2]===a?h=e[3]:(h=(0,p.jsx)(l,{children:(0,p.jsx)(c,{children:(0,p.jsxs)(s,{onClick:a,children:[u,m]})})}),e[2]=a,e[3]=h);let g;return e[4]!==i||e[5]!==h?(g=(0,p.jsxs)(p.Fragment,{children:[h,i]}),e[4]=i,e[5]=h,e[6]=g):g=e[6],g}export{h as T3ConnectSidebarAvatar,m as T3ConnectSidebarSignIn};
|
|
2
|
+
//# sourceMappingURL=T3ConnectSidebarSignIn-pHxwsU9J.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{NE as n,Pp as r,Um as i,fp as a,lE as o,sr as s,t as c,vp as l}from"./utils-ChK8VEFC.js";import{f as u,l as d,m as f}from"./TooltipViewport-B_Oz-gLq.js";import{A as p,E as m,G as h,H as g,O as _,S as v,U as y,W as b,_ as x,d as ee,et as S,g as C,m as w,s as te,u as T,y as E}from"./themePalette-mGukKeaJ.js";import{a as ne,n as re,t as ie}from"./tooltip-C85X81rS.js";import{n as D,t as O}from"./toggle-group-CM-lVPv_.js";import{t as ae}from"./input-DX_wpYEr.js";import{i as k,o as A,t as j}from"./popover-BJ6nvlLO.js";import{i as M,n as N,r as P,t as F}from"./color-picker-KVitc2gM.js";import{na as I}from"./main-DzuY7nUi.js";var oe=n(),L=e(t(),1),R=e(o(),1);function z(e){return{canvas:`Background`,toolbar:`Toolbar background`,toolbarForeground:`Toolbar text`,toolbarBorder:`Toolbar border`,toolbarControl:`Toolbar control`,toolbarControlForeground:`Toolbar control text`,toolbarControlHover:`Toolbar control hover`,accent:`Accent color`,errorForeground:`Error text`,errorSurface:`Error background`,warningForeground:`Warning text`,warningSurface:`Warning background`,updateForeground:`Update text`,updateSurface:`Update background`}[e]||e.replace(/([A-Z])/g,` $1`).replace(/^./,e=>e.toUpperCase())}function B(e){let t=g(e)??``,n=t.length===9?t.slice(7):``;return n===`ff`?``:n}function se(e){return(g(e)??`#000000`).slice(0,7)}function ce(e){let t=Number.parseInt(se(e).slice(1),16);return[t>>16,t>>8&255,t&255]}function le(e){let t=e.trim().replace(/^rgb\(\s*/i,``).replace(/\s*\)$/,``).split(/[,\s]+/).filter(Boolean).map(Number);return t.length!==3||t.some(e=>!Number.isInteger(e)||e<0||e>255)?null:`#${t.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function V(e){return ce(e).join(`, `)}function H({label:e,value:t,onChange:n}){let r=se(t),i=B(t),[a,o]=(0,L.useState)(()=>P(r)),[s,c]=(0,L.useState)(r),[l,u]=(0,L.useState)(()=>V(r)),d=(0,L.useRef)(!1),f=M(a.h,a.s,a.v),p=V(f);(0,L.useEffect)(()=>{d.current||(c(r),u(V(r))),o(e=>M(e.h,e.s,e.v)===r?e:P(r))},[r]);let m=(0,L.useRef)(n);m.current=n;let h=(0,L.useRef)(null),g=(0,L.useRef)(null),_=(0,L.useCallback)(()=>{g.current!==null&&(cancelAnimationFrame(g.current),g.current=null);let e=h.current;h.current=null,e!==null&&m.current(e)},[]);(0,L.useEffect)(()=>()=>_(),[_]);let v=(0,L.useCallback)(e=>{h.current=e,g.current??=requestAnimationFrame(()=>{g.current=null;let e=h.current;h.current=null,e!==null&&m.current(e)})},[]),y=(0,L.useCallback)(e=>{o(e);let t=M(e.h,e.s,e.v);c(t),u(V(t)),v(t+i)},[i,v]),b=e=>{if(c(e),!/^#[0-9a-f]{6}$/i.test(e))return;let t=P(e);o(t),u(V(e)),n(e.toLowerCase())},x=e=>{u(e);let t=le(e);t&&(o(P(t)),c(t),n(t+i))};return(0,R.jsxs)(`div`,{className:`w-72 bg-popover`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/70 px-4 py-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`truncate text-xs font-semibold text-foreground`,children:e}),(0,R.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:`Choose a color`})]}),(0,R.jsx)(`span`,{className:`size-7 shrink-0 rounded-full shadow-sm`,style:{backgroundColor:f}})]}),(0,R.jsxs)(`div`,{className:`grid gap-3 px-3 pb-3 pt-3`,children:[(0,R.jsx)(N,{label:e,value:a,onChange:y,onInteractionEnd:_}),(0,R.jsx)(F,{label:`${e} hue`,value:a.h,onChange:e=>y({...a,h:e}),onInteractionEnd:_}),(0,R.jsxs)(`div`,{className:`grid grid-cols-[1fr_1.2fr] gap-2`,children:[(0,R.jsxs)(`label`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(`span`,{className:`px-1 text-3xs font-semibold uppercase tracking-widest text-muted-foreground`,children:`HEX`}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 rounded-lg border border-input bg-background px-2 focus-within:border-ring`,children:[(0,R.jsx)(`span`,{className:`size-3.5 shrink-0 rounded-full`,style:{backgroundColor:f}}),(0,R.jsx)(`input`,{"aria-label":`${e} picker hex value`,className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-xs text-foreground outline-none`,onBlur:()=>{d.current=!1,c(f),u(p)},onChange:e=>b(e.currentTarget.value),onFocus:()=>{d.current=!0},spellCheck:!1,value:s})]})]}),(0,R.jsxs)(`label`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(`span`,{className:`px-1 text-3xs font-semibold uppercase tracking-widest text-muted-foreground`,children:`RGB`}),(0,R.jsx)(`span`,{className:`flex min-w-0 items-center rounded-lg border border-input bg-background px-2 focus-within:border-ring`,children:(0,R.jsx)(`input`,{"aria-label":`${e} picker RGB value`,className:`h-8 min-w-0 flex-1 bg-transparent font-mono text-xs text-foreground outline-none`,onBlur:()=>{d.current=!1,c(f),u(p)},onChange:e=>x(e.currentTarget.value),onFocus:()=>{d.current=!0},spellCheck:!1,value:l})})]})]})]})]})}function U(e){let t=(0,oe.c)(13),{label:n,value:r,onChange:i,onInteract:a}=e,o=`Choose ${n} color`,s;t[0]===r?s=t[1]:(s=(0,R.jsx)(`span`,{className:`absolute inset-0 rounded-full shadow-sm`,style:{backgroundColor:r}}),t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==o||t[4]!==s?(c=(0,R.jsx)(A,{render:(0,R.jsx)(`button`,{"aria-label":o,className:`relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-foreground/30 transition-transform hover:scale-105 focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring`,onFocus:a,onPointerDown:a,type:`button`,children:s})}),t[2]=a,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==n||t[7]!==i||t[8]!==r?(l=(0,R.jsx)(k,{align:`end`,padding:`none`,"data-theme-editor-panel":``,side:`bottom`,sideOffset:10,children:(0,R.jsx)(H,{label:n,onChange:i,value:r})}),t[6]=n,t[7]=i,t[8]=r,t[9]=l):l=t[9];let u;return t[10]!==c||t[11]!==l?(u=(0,R.jsxs)(j,{children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u}var ue=(0,L.memo)(function(e){let t=(0,oe.c)(58),{role:n,value:r,onChange:i,onSelect:a,onToggleSelected:o,selected:s,label:l}=e,u=s!==void 0&&s,d;t[0]!==l||t[1]!==n?(d=l??z(n),t[0]=l,t[1]=n,t[2]=d):d=t[2];let f=d,p;t[3]===r?p=t[4]:(p=m(r),t[3]=r,t[4]=p);let h=p,_=h?r:`#000000`,v;t[5]===r?v=t[6]:(v=r.trim().toLowerCase().startsWith(`oklch(`)?g(r)??r:r,t[5]=r,t[6]=v);let y=v,b=u&&`bg-accent/60 inset-ring inset-ring-ring`,x;t[7]===b?x=t[8]:(x=c(`flex min-h-11 min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 transition-[background-color,box-shadow]`,b),t[7]=b,t[8]=x);let ee=`${u?`Hide`:`Show`} ${f} usage`,S;t[9]!==o||t[10]!==n?(S=()=>o?.(n),t[9]=o,t[10]=n,t[11]=S):S=t[11];let C;t[12]===f?C=t[13]:(C=(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:f}),t[12]=f,t[13]=C);let w;t[14]!==u||t[15]!==ee||t[16]!==S||t[17]!==C?(w=(0,R.jsx)(ne,{render:(0,R.jsx)(`button`,{"aria-label":ee,"aria-pressed":u,className:`flex min-w-0 flex-1 cursor-pointer items-center rounded-md text-left text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:S,type:`button`,children:C})}),t[14]=u,t[15]=ee,t[16]=S,t[17]=C,t[18]=w):w=t[18];let te=`${u?`Hide`:`Show`} where ${f} is used`,T;t[19]===te?T=t[20]:(T=(0,R.jsx)(re,{side:`top`,children:te}),t[19]=te,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,R.jsxs)(ie,{children:[w,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==i||t[25]!==n?(D=e=>i(n,e),t[24]=i,t[25]=n,t[26]=D):D=t[26];let O;t[27]!==a||t[28]!==n?(O=()=>a?.(n),t[27]=a,t[28]=n,t[29]=O):O=t[29];let k;t[30]!==f||t[31]!==_||t[32]!==D||t[33]!==O?(k=(0,R.jsx)(U,{label:f,onChange:D,onInteract:O,value:_}),t[30]=f,t[31]=_,t[32]=D,t[33]=O,t[34]=k):k=t[34];let A=!h,j=`${f} hex value`,M=`${n}-hex`,N;t[35]!==i||t[36]!==n?(N=e=>i(n,e.currentTarget.value),t[35]=i,t[36]=n,t[37]=N):N=t[37];let P,F;t[38]!==a||t[39]!==n?(P=()=>a?.(n),F=()=>a?.(n),t[38]=a,t[39]=n,t[40]=P,t[41]=F):(P=t[40],F=t[41]);let I;t[42]!==y||t[43]!==A||t[44]!==j||t[45]!==M||t[46]!==N||t[47]!==P||t[48]!==F?(I=(0,R.jsx)(ae,{"aria-invalid":A,"aria-label":j,className:`w-28 shrink-0`,font:`mono`,id:M,nativeInput:!0,onChange:N,onFocus:P,onPointerDown:F,size:`compact`,value:y}),t[42]=y,t[43]=A,t[44]=j,t[45]=M,t[46]=N,t[47]=P,t[48]=F,t[49]=I):I=t[49];let L;t[50]!==k||t[51]!==I?(L=(0,R.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[k,I]}),t[50]=k,t[51]=I,t[52]=L):L=t[52];let B;return t[53]!==n||t[54]!==E||t[55]!==L||t[56]!==x?(B=(0,R.jsxs)(`div`,{className:x,"data-theme-color-role":n,children:[E,L]}),t[53]=n,t[54]=E,t[55]=L,t[56]=x,t[57]=B):B=t[57],B}),de=[`background`,`border`,`foreground`],W=`data-theme-inspector-match`,fe=`data-theme-token-probe`,G=`#01fea7`,pe=`#fe01a7`,K=`theme-inspector-spotlight`,q=`theme-inspector-spotlight-mask`,me=`theme-inspector-spotlight-glow`,J=`theme-inspector-hover`,Y=`http://www.w3.org/2000/svg`,he={background:`canvas`,foreground:`text`,card:`surface`,"card-foreground":`text`,popover:`surfaceOverlay`,"popover-foreground":`text`,"surface-raised":`surfaceRaised`,primary:`messageAction`,"primary-foreground":`messageActionForeground`,secondary:`secondary`,"secondary-foreground":`secondaryForeground`,muted:`muted`,"muted-foreground":`mutedForeground`,placeholder:`placeholder`,"secondary-label":`secondaryLabel`,"icon-muted":`iconMuted`,accent:`accentSurface`,"accent-foreground":`accentSurfaceForeground`,destructive:`error`,"destructive-foreground":`errorForeground`,error:`error`,"error-foreground":`errorForeground`,"error-surface":`errorSurface`,warning:`warning`,"warning-foreground":`warningForeground`,"warning-surface":`warningSurface`,update:`update`,"update-foreground":`updateForeground`,"update-surface":`updateSurface`,message:`messageSurface`,"message-foreground":`messageForeground`,"message-action":`messageAction`,"message-action-foreground":`messageActionForeground`,"message-action-hover":`messageActionHover`,sidebar:`sidebar`,"sidebar-foreground":`sidebarForeground`,"sidebar-muted-foreground":`sidebarMutedForeground`,"sidebar-control-surface":`sidebarControlSurface`,"sidebar-row-hover":`sidebarRowHover`,"sidebar-row-active":`sidebarRowActive`,"sidebar-row-selected":`sidebarRowSelected`,"sidebar-border":`sidebarBorder`,border:`border`,input:`input`,ring:`focus`},ge={background:[`bg-`],border:[`border-`,`outline-`,`ring-`],foreground:[`text-`,`caret-`,`fill-`,`stroke-`]};function _e(e){document.querySelectorAll(`[${e}]`).forEach(t=>t.removeAttribute(e))}function ve(){_e(W),document.getElementById(K)?.remove()}function ye(){document.getElementById(J)?.remove()}function X(e){return document.createElementNS(Y,e)}function be(e){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0||t.right<0||t.bottom<0||t.left>window.innerWidth||t.top>window.innerHeight)return null;let n=t.left-5,r=t.top-5,i=Number.parseFloat(window.getComputedStyle(e).borderTopLeftRadius)||0;return{x:n,y:r,width:t.width+10,height:t.height+10,radius:Math.min(18,Math.max(7,i+5))}}function xe(e,t){let n=be(e.element);if(!n){ye();return}let r=document.getElementById(J);if(!r){r=document.createElement(`div`),r.id=J,r.setAttribute(`aria-hidden`,`true`);let e=document.createElement(`span`);e.dataset.themeInspectorHoverLabel=``,r.append(e),document.body.append(r)}r.style.left=`${n.x}px`,r.style.top=`${n.y}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,r.style.borderRadius=`${n.radius}px`,r.dataset.placement=n.y<32?`below`:`above`;let i=r.querySelector(`[data-theme-inspector-hover-label]`);i&&(i.textContent=t)}function Se(e){let t=new Map;for(let n of e){let e=be(n);if(!e)continue;let r=[e.x,e.y,e.width,e.height].map(e=>Math.round(e)).join(`:`);t.set(r,e)}if(t.size===0){document.getElementById(K)?.remove();return}let n=document.getElementById(K);n||(n=X(`svg`),n.id=K,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`focusable`,`false`),document.body.append(n)),n.setAttribute(`viewBox`,`0 0 ${window.innerWidth} ${window.innerHeight}`);let r=X(`defs`),i=X(`mask`);i.id=q,i.setAttribute(`maskUnits`,`userSpaceOnUse`);let a=X(`rect`);a.setAttribute(`width`,String(window.innerWidth)),a.setAttribute(`height`,String(window.innerHeight)),a.setAttribute(`fill`,`white`),i.append(a);let o=X(`filter`);o.id=me,o.setAttribute(`x`,`-50%`),o.setAttribute(`y`,`-50%`),o.setAttribute(`width`,`200%`),o.setAttribute(`height`,`200%`);let s=X(`feGaussianBlur`);s.setAttribute(`stdDeviation`,`5`),s.setAttribute(`result`,`blur`);let c=X(`feMerge`),l=X(`feMergeNode`);l.setAttribute(`in`,`blur`);let u=X(`feMergeNode`);u.setAttribute(`in`,`SourceGraphic`),c.append(l,u),o.append(s,c),r.append(i,o);let d=X(`g`);for(let e of t.values()){let t=X(`rect`);t.setAttribute(`x`,String(e.x)),t.setAttribute(`y`,String(e.y)),t.setAttribute(`width`,String(e.width)),t.setAttribute(`height`,String(e.height)),t.setAttribute(`rx`,String(e.radius)),t.setAttribute(`fill`,`black`),i.append(t);let n=t.cloneNode(!1);n.removeAttribute(`fill`),n.setAttribute(`class`,`theme-inspector-spotlight-glow`),n.setAttribute(`filter`,`url(#${me})`),d.append(n)}let f=X(`rect`);f.setAttribute(`class`,`theme-inspector-spotlight-dimmer`),f.setAttribute(`width`,String(window.innerWidth)),f.setAttribute(`height`,String(window.innerHeight)),f.setAttribute(`mask`,`url(#${q})`),n.replaceChildren(r,f,d)}function Ce(){Se([...document.querySelectorAll(`[${W}]`)])}function we(e){return e.matches(`input, textarea, select, option`)?!0:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&!!e.textContent?.trim())}function Z(e,{forHitTest:t=!1}={}){let n=window.getComputedStyle(e);if(n.display===`none`||n.visibility===`hidden`||Number(n.opacity)===0)return null;let r=[];for(let[e,t,i]of[[n.borderTopColor,n.borderTopStyle,n.borderTopWidth],[n.borderRightColor,n.borderRightStyle,n.borderRightWidth],[n.borderBottomColor,n.borderBottomStyle,n.borderBottomWidth],[n.borderLeftColor,n.borderLeftStyle,n.borderLeftWidth]])t!==`none`&&Number.parseFloat(i)>0&&r.push(e);n.outlineStyle!==`none`&&Number.parseFloat(n.outlineWidth)>0&&r.push(n.outlineColor),n.borderImageSource!==`none`&&r.push(n.borderImageSource),n.boxShadow!==`none`&&r.push(n.boxShadow);let i=[];return(t||we(e))&&i.push(n.color),e instanceof SVGElement&&i.push(n.fill,n.stroke),e.matches(`input, textarea`)&&i.push(n.caretColor),n.textDecorationLine!==`none`&&i.push(n.textDecorationColor),n.textShadow!==`none`&&i.push(n.textShadow),{background:[n.backgroundColor,n.backgroundImage].join(`
|
|
2
|
+
`),border:r.join(`
|
|
3
|
+
`),foreground:i.join(`
|
|
4
|
+
`)}}function Te(e,t){return de.filter(n=>e[n]!==t[n])}function Ee(e){let t=document.documentElement,n=t.hasAttribute(fe);n||t.setAttribute(fe,``);try{return e()}finally{window.getComputedStyle(t).color,n||t.removeAttribute(fe)}}function De(e){let t=document.documentElement,n=C(e),r=t.style.getPropertyValue(n),i=t.style.getPropertyPriority(n),a=r.trim().toLowerCase()===G?pe:G;return t.style.setProperty(n,a,`important`),()=>{r?t.style.setProperty(n,r,i):t.style.removeProperty(n)}}function Q(e){let t=e.map(De);return()=>{for(let e of t.toReversed())e()}}function Oe(){return[document.body,...document.body.querySelectorAll(`*`)].filter(e=>!e.closest(`[data-theme-editor-panel]`)&&!e.closest(`#${K}, #${J}`))}function ke(e,t){if(e.includes(`:`))return null;for(let n of ge[t])if(e.startsWith(n))return he[e.slice(n.length).split(`/`,1)[0]??``]??null;return null}function Ae(e){for(let t of de)for(let n of e.classList){let e=ke(n,t);if(e)return e}return null}function je(e){let t=[],n=e;for(;n&&n!==document.documentElement;)n.closest(`[data-theme-editor-panel]`)||t.push(n),n=n.parentElement;return t}function Me(e){if(e.closest(`[data-theme-editor-panel]`))return null;for(let t of je(e)){let e=Ae(t);if(e)return{element:t,role:e}}return null}function Ne(e){performance.now(),_e(W);let t=Oe(),n=performance.now(),r=Ee(()=>{let n=new Map;for(let e of t){let t=Z(e);t&&n.set(e,t)}let r=Q(e),i=new Set;try{for(let[e,t]of n){let n=Z(e);n&&Te(t,n).length>0&&i.add(e)}}finally{r()}return i});performance.now()-n;let i=new Set;for(let e of r)i.add(e instanceof SVGElement?e.closest(`svg`)??e:e);for(let e of i)e.setAttribute(W,``);return Se([...i]),i.size}function Pe(e){if(e.closest(`[data-theme-editor-panel]`))return null;let t=je(e),n=Me(e);if(n)return n;let r=Ee(()=>{let e=new Map,n=new Map;for(let n of t){let t=Z(n,{forHitTest:!0});t&&e.set(n,t)}for(let t of S){let r=De(t);try{for(let[r,i]of e){let e=Z(r,{forHitTest:!0});if(!e)continue;let a=n.get(r)??{};for(let n of Te(i,e))a[n]??=t;n.set(r,a)}}finally{r()}}return n});for(let e of t){let t=r.get(e);if(t)for(let n of de){let r=t[n];if(r)return{element:e,role:r}}}return null}var $=[`canvas`,`accent`],Fe=[{id:`foundation`,title:`Foundation`,families:[{id:`background`,label:`Background`,role:`canvas`,roles:[`canvas`,`chrome`,`toolbar`]},{id:`surface`,label:`Surface`,role:`surface`,roles:[`surface`]},{id:`raised-surface`,label:`Raised surface`,role:`surfaceRaised`,roles:[`surfaceRaised`]},{id:`overlay`,label:`Overlay`,role:`surfaceOverlay`,roles:[`surfaceOverlay`]},{id:`text`,label:`Text`,role:`text`,roles:[`text`,`toolbarForeground`,`toolbarControlForeground`]},{id:`muted-text`,label:`Muted text`,role:`mutedForeground`,roles:[`textMuted`,`mutedForeground`,`placeholder`,`secondaryLabel`,`iconMuted`,`sidebarMutedForeground`]},{id:`border`,label:`Border`,role:`border`,roles:[`border`,`toolbarBorder`,`sidebarBorder`]},{id:`input`,label:`Input`,role:`input`,roles:[`input`]}]},{id:`brand-content`,title:`Brand & content`,families:[{id:`subtle-surface`,label:`Subtle surface`,role:`secondary`,roles:[`secondary`,`secondaryForeground`,`muted`,`toolbarControl`]},{id:`highlight-surface`,label:`Highlight surface`,role:`accentSurface`,roles:[`accentSurface`,`accentSurfaceForeground`,`toolbarControlHover`]},{id:`accent`,label:`Accent`,role:`accent`,roles:[`accent`,`accentForeground`,`focus`,`update`,`updateForeground`,`updateSurface`,`terminalCursor`]},{id:`action`,label:`Action`,role:`messageAction`,roles:[`messageAction`,`messageActionForeground`,`messageActionHover`]},{id:`message-surface`,label:`Message surface`,role:`messageSurface`,roles:[`messageSurface`,`messageForeground`]},{id:`code-surface`,label:`Code surface`,role:`codeBackground`,roles:[`codeBackground`,`codeForeground`]}]},{id:`search`,title:`Search`,families:[{id:`search-matches`,label:`Search matches`,role:`searchMatchBackground`,roles:[`searchMatchBackground`,`searchMatchForeground`]},{id:`current-match`,label:`Current match`,role:`searchMatchActiveBackground`,roles:[`searchMatchActiveBackground`,`searchMatchActiveForeground`]}]},{id:`context`,title:`Context`,families:[{id:`sidebar-background`,label:`Sidebar background`,role:`sidebar`,roles:[`sidebar`,`sidebarForeground`]},{id:`sidebar-controls`,label:`Sidebar controls`,role:`sidebarControlSurface`,roles:[`sidebarControlSurface`]},{id:`sidebar-selection`,label:`Sidebar selection`,role:`sidebarRowSelected`,roles:[`sidebarRowHover`,`sidebarRowActive`,`sidebarRowSelected`]},{id:`terminal-background`,label:`Terminal background`,role:`terminalBackground`,roles:[`terminalBackground`,`terminalForeground`,`terminalSelection`,`terminalScrollbar`,`terminalScrollbarHover`]}]},{id:`status`,title:`Status`,families:[{id:`error`,label:`Error`,role:`error`,roles:[`error`,`errorForeground`,`errorSurface`]},{id:`warning`,label:`Warning`,role:`warning`,roles:[`warning`,`warningForeground`,`warningSurface`]}]}],Ie=Fe.flatMap(e=>e.families),Le=new Map(Ie.flatMap(e=>e.roles.map(t=>[t,e])));function Re(e){return Le.get(e)??null}function ze(e){return{...w(e)}}function Be(){return{light:ze(`light`),dark:ze(`dark`)}}function Ve(e){return m(e.trim())}function He(e,t){let n=w(e);return T(e,Ve(t.canvas)?t.canvas:n.canvas,Ve(t.accent)?t.accent:n.accent)}function Ue({open:e,onOpenChange:t,onSaved:n,editingTheme:o,initialAppearance:m,seedTheme:g,seedName:C,restoreTheme:w}){let T=o!==null,[k,A]=(0,L.useState)(``),[j,M]=(0,L.useState)(m),[N,P]=(0,L.useState)(!1),[F,oe]=(0,L.useState)(()=>Be()),[B,se]=(0,L.useState)({light:!1,dark:!1}),[ce,le]=(0,L.useState)(!1),[V,H]=(0,L.useState)(null),[U,de]=(0,L.useState)(!1),[W,fe]=(0,L.useState)(``),[G,pe]=(0,L.useState)(!1),[K,q]=(0,L.useState)(null),[me,J]=(0,L.useState)(null),[Y,he]=(0,L.useState)(null),[ge,_e]=(0,L.useState)(null),X=(0,L.useRef)(null),be=(0,L.useRef)(null),Se=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!e)return;let t=()=>{let e,t;_e(n=>n&&(e=Math.max(280,Math.min(n.width,window.innerWidth-16)),t=Math.max(220,Math.min(n.height,window.innerHeight-16)),{width:e,height:t})),he(n=>{if(!n)return n;let r=et(n.x,n.y,e),i=U?X.current?.offsetHeight??0:t??X.current?.offsetHeight??0,a=Math.max(8,window.innerHeight-i-8);return{x:r.x,y:Math.min(r.y,a)}})};return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[U,e]);let[we,Z]=(0,L.useState)(!1),Te=(0,L.useRef)(!1);(0,L.useEffect)(()=>{if(e&&!Te.current){let e=o??g??null,t=Be(),n=e?x(e,m)?m:e.appearance:m;if(e){t[e.appearance]={...e.colors};for(let n of[`light`,`dark`]){let r=e.variants?.[n];r&&(t[n]={...r})}}A(o?.label??C??``),M(n),P(e!==null&&e.managed!==!0),se({light:!1,dark:!1}),le(e!==null&&e.managed!==!0),oe(t),q(null),J(null),pe(!1),H(null),Z(!0)}!e&&we&&Z(!1),Te.current=e},[o,m,we,e,C,g]);let Ee=y(k),De=k.trim().toLowerCase(),Q=De===``?null:ee().find(e=>e.id!==o?.id&&(e.id===Ee||e.label.trim().toLowerCase()===De))??null,Oe=Q?E(Q):[],ke=o?E(o):null,Ae=e=>ke&&!ke.includes(e)?`“${o?.label}” has no ${e} palette. Create a theme with the same name to add one.`:!T&&Oe.includes(e)?`“${Q?.label}” already has a ${e} palette.`:null,je=Q?.id??null,Ie=Oe.join(`,`);(0,L.useEffect)(()=>{if(T||je===null)return;let e=Ie.split(`,`).filter(Boolean);e.length===1&&M(t=>e.includes(t)?e[0]===`light`?`dark`:`light`:t)},[T,je,Ie]),(0,L.useEffect)(()=>{e&&we&&te(F[j],j)},[j,F,we,e]),(0,L.useEffect)(()=>{if(e)return()=>{w()}},[e,w]);let Le=(0,L.useCallback)((e,t)=>{oe(n=>{let r={...n[j],[e]:t},i=!N&&$.includes(e)&&Ve(t);return{...n,[j]:N?h(j,n[j],e,t):i?He(j,r):r}}),!N&&$.includes(e)&&Ve(t)&&se(e=>({...e,[j]:!0})),N&&le(!0)},[j,N]),ze=(0,L.useCallback)((e,t=!1)=>{let n=Re(e)?.role??e;q(n),$.includes(n)||(P(!0),fe(``)),t&&requestAnimationFrame(()=>{X.current?.querySelector(`[data-theme-color-role="${n}"]`)?.scrollIntoView({behavior:`smooth`,block:`nearest`})})},[]),Ue=(0,L.useCallback)(e=>{q(t=>t===e?null:e)},[]),We=(0,L.useCallback)(()=>{q(null),J(null),pe(!1)},[]),Ge=(K?N?Re(K)?.roles??[K]:$.includes(K)?S.filter(e=>F[j][e].trim().toLowerCase()===F[j][K].trim().toLowerCase()):[K]:[]).join(`,`);(0,L.useEffect)(()=>{if(ve(),!e||K===null){J(null);return}if(G)return;let t=Ge.split(`,`),n=()=>J(Ne(t));n();let r=null,i=null,a=performance.now(),o=()=>{if(r!==null||i!==null)return;let e=Math.max(0,500-(performance.now()-a)),t=()=>{r=null,i=null,a=performance.now(),n()};e===0?r=requestAnimationFrame(t):i=setTimeout(t,e)},s=new MutationObserver(e=>{e.every(e=>e.target instanceof Element&&(e.target.closest(`#theme-inspector-spotlight`)||e.target.closest(`[data-theme-editor-panel]`)))||o()});s.observe(document.body,{childList:!0,subtree:!0});let c=null,l=()=>{c??=requestAnimationFrame(()=>{c=null,Ce()})};return window.addEventListener(`resize`,l),window.addEventListener(`scroll`,l,!0),()=>{s.disconnect(),r!==null&&cancelAnimationFrame(r),i!==null&&clearTimeout(i),c!==null&&cancelAnimationFrame(c),window.removeEventListener(`resize`,l),window.removeEventListener(`scroll`,l,!0),ve()}},[G,e,Ge,K]),(0,L.useEffect)(()=>{if(!e||!G){ye();return}let t=!1,n=null,r=null,i=null,a=null,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{o(),n=null,r=null,ye()},c=e=>{r=e,xe(e,Re(e.role)?.label??z(e.role))},l=e=>{let t=e.target;if(!(t instanceof Element)||t.closest(`[data-theme-editor-panel]`)){s();return}o(),n=t,r=null;let a=Me(t);if(a){c(a);return}ye(),i=window.setTimeout(()=>{if(i=null,n!==t||!t.isConnected)return;let e=Pe(t);e&&c(e)},140)},u=e=>{e.relatedTarget===null&&s()},d=e=>{let i=e.target;if(!(i instanceof Element)||i.closest(`[data-theme-editor-panel]`))return;e.preventDefault(),e.stopPropagation(),o();let a=n===i&&r?r:Pe(i);a&&(s(),ze(a.role,!0),t=!0)},f=e=>{let n=e.target;n instanceof Element&&!n.closest(`[data-theme-editor-panel]`)&&(e.preventDefault(),e.stopPropagation(),t&&pe(!1),t=!1)},p=e=>{e.key===`Escape`&&(e.preventDefault(),s(),We())},m=()=>{r&&(a??=requestAnimationFrame(()=>{a=null,r&&xe(r,Re(r.role)?.label??z(r.role))}))},h=()=>s();return document.addEventListener(`pointerover`,l,!0),document.addEventListener(`pointerout`,u,!0),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`click`,f,!0),document.addEventListener(`keydown`,p,!0),window.addEventListener(`resize`,m),window.addEventListener(`scroll`,h,!0),()=>{document.removeEventListener(`pointerover`,l,!0),document.removeEventListener(`pointerout`,u,!0),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`click`,f,!0),document.removeEventListener(`keydown`,p,!0),window.removeEventListener(`resize`,m),window.removeEventListener(`scroll`,h,!0),o(),a!==null&&cancelAnimationFrame(a),ye()}},[We,G,e,ze]);let Ke=(0,L.useCallback)(e=>{if(P(e),e||(K&&!$.includes(K)&&q(null),!ce))return;let t=o&&E(o).length>1?[`light`,`dark`]:[j];se(e=>{let n={...e};for(let e of t)n[e]=!0;return n}),oe(e=>{let n={...e};for(let r of t)n[r]=He(r,e[r]);return n}),le(!1)},[j,o,K,ce]),qe=()=>{if(!k.trim()){H(`Name your theme first.`);return}try{let e=N?F:{light:B.light?He(`light`,F.light):F.light,dark:B.dark?He(`dark`,F.dark):F.dark},r,i=null,a=null;if(o&&Q){let t=E(o),n=t.find(e=>Oe.includes(e));if(n){H(`“${Q.label}” already has a ${n} palette. Pick another name.`);return}i=t[0]??null,r=b({..._({version:1,id:Q.id,name:Q.label,appearance:Q.appearance,colors:Q.colors,variants:{...Q.variants,...Object.fromEntries(t.map(t=>[t,e[t]]))},...Q.managed===!0&&!N?{managed:!0}:{}}),...Q.collection?{collection:Q.collection}:{}}),a=o;try{p(o.id)}catch(e){try{b(Q)}catch{}throw e}}else if(o){let t=o.appearance,n=t===`light`?`dark`:`light`;r=b({..._({version:1,id:o.id,name:k,appearance:t,colors:e[t],...E(o).length>1?{variants:{[n]:e[n]}}:{},...N?{}:{managed:!0}}),...o.collection?{collection:o.collection}:{}})}else if(Q){if(Oe.includes(j)){H(`“${Q.label}” already has light and dark palettes. Pick another name.`);return}i=j,r=b({..._({version:1,id:Q.id,name:Q.label,appearance:Q.appearance,colors:Q.colors,variants:{...Q.variants,[j]:e[j]},...Q.managed===!0&&!N?{managed:!0}:{}}),...Q.collection?{collection:Q.collection}:{}})}else r=v(_({version:1,name:k,appearance:j,colors:e[j],...N?{}:{managed:!0}}));if(!n(r,{created:o===null&&i===null,...i?{mergedAppearance:i}:{}})){if(!o&&i===null)try{p(r.id)}catch{}else if(Q&&i!==null)try{b(Q),a&&v(a)}catch{}H(`Theme saved, but it could not be made active. Try again.`);return}t(!1)}catch(e){H(e instanceof Error?e.message:T?`Could not save the theme.`:`Could not create the theme.`)}},Je=()=>(0,R.jsxs)(`label`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:`Theme name`}),(0,R.jsx)(ae,{autoFocus:!0,size:`sm`,onChange:e=>{A(e.currentTarget.value),H(null)},placeholder:T?`Theme name`:`e.g. Aurora`,value:k})]}),Ye=e=>{let t=Ae(e),n=(0,R.jsx)(O,{"aria-disabled":t!==null,value:e,children:e===`light`?`Light`:`Dark`});return t===null?n:(0,R.jsxs)(ie,{children:[(0,R.jsx)(ne,{render:n}),(0,R.jsx)(re,{children:t})]})},Xe=()=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:`Appearance`}),(0,R.jsxs)(D,{"aria-label":`Theme appearance`,variant:`segmented`,value:[j],onValueChange:e=>{let t=e[0];(t===`light`||t===`dark`)&&Ae(t)===null&&M(t)},children:[Ye(`light`),Ye(`dark`)]})]}),Ze=()=>(0,R.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-start gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium`,children:`Colors`}),N?null:(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Two colors, rest derived`})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[N?(0,R.jsx)(ae,{"aria-label":`Filter colors`,className:`min-w-0 flex-1`,onChange:e=>fe(e.currentTarget.value),placeholder:`Filter colors`,size:`sm`,value:W}):null,(0,R.jsxs)(`label`,{className:`ml-auto flex shrink-0 cursor-pointer items-center gap-2 pt-0.5 text-sm font-medium`,children:[(0,R.jsx)(`span`,{children:`Advanced`}),(0,R.jsx)(I,{"aria-label":`Use advanced theme colors`,checked:N,onCheckedChange:e=>Ke(!!e)})]})]})]}),Qe=(e,t=`grid gap-2 sm:grid-cols-2`)=>(0,R.jsx)(`div`,{className:t,children:e.map(e=>(0,R.jsx)(ue,{label:e.label,onChange:Le,onSelect:ze,onToggleSelected:Ue,role:e.role,selected:K===e.role,value:F[j][e.role]},e.id))}),$e=()=>{let e=W.trim().toLowerCase(),t=Fe.map(t=>({...t,families:t.families.filter(t=>!e||[t.label,...t.roles.map(e=>z(e))].join(` `).toLowerCase().includes(e))})).filter(e=>e.families.length>0);return N?(0,R.jsxs)(`div`,{className:`space-y-5`,children:[t.map(e=>(0,R.jsxs)(`section`,{className:`space-y-2`,children:[(0,R.jsx)(`h4`,{className:`text-sm font-medium text-foreground`,children:e.title}),Qe(e.families,`grid gap-1`)]},e.id)),t.length===0?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No matches.`}):null]}):(0,R.jsx)(`div`,{className:`grid gap-1`,children:$.map(e=>(0,R.jsx)(ue,{onChange:Le,onSelect:ze,onToggleSelected:Ue,role:e,label:e===`canvas`?`Background`:`Accent`,selected:K===e,value:F[j][e]},e))})},et=(e,t,n)=>{let r=X.current,i=n??r?.offsetWidth??0;return{x:Math.min(Math.max(e,8),Math.max(8,window.innerWidth-i-8)),y:Math.min(Math.max(t,8),Math.max(8,window.innerHeight-48))}},tt=e=>{if(e.target.closest(`button, input, a`))return;let t=X.current?.getBoundingClientRect();t&&(be.current={dx:e.clientX-t.x,dy:e.clientY-t.y},e.currentTarget.setPointerCapture(e.pointerId))},nt=e=>{let t=be.current;t&&he(et(e.clientX-t.dx,e.clientY-t.dy))},rt=()=>{be.current=null},it=e=>{let t=X.current?.getBoundingClientRect();t&&(e.preventDefault(),Y===null&&he(et(t.x,t.y)),Se.current={pointerX:e.clientX,pointerY:e.clientY,left:t.x,top:t.y,width:t.width,height:t.height},e.currentTarget.setPointerCapture(e.pointerId))},at=e=>{let t=Se.current;if(!t)return;let n=Math.max(280,window.innerWidth-8-t.left),r=Math.max(220,window.innerHeight-8-t.top);_e({width:Math.min(Math.max(t.width+e.clientX-t.pointerX,280),n),height:Math.min(Math.max(t.height+e.clientY-t.pointerY,220),r)})},ot=()=>{Se.current=null};return(0,R.jsxs)(`div`,{"aria-label":T?`Edit theme`:`Create theme`,className:c(`dialog-glass fixed z-[110] flex max-h-[min(42rem,calc(100dvh-6rem))] w-[min(26rem,calc(100vw-2rem))] flex-col overflow-hidden rounded-xl border text-popover-foreground`,Y===null&&`bottom-4 right-4`,U&&`max-h-none`),"data-theme-editor-panel":!0,ref:X,role:`dialog`,style:{...Y?{left:Y.x,top:Y.y}:{},...ge?{width:ge.width}:{},...ge&&!U?{height:ge.height,maxHeight:`calc(100dvh - 1rem)`}:{}},children:[(0,R.jsxs)(`div`,{className:`flex cursor-grab touch-none select-none items-center gap-1 border-b border-border/70 px-3 py-2 active:cursor-grabbing`,onPointerCancel:rt,onPointerDown:tt,onPointerMove:nt,onPointerUp:rt,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,R.jsx)(`h2`,{className:`shrink-0 truncate text-sm font-medium`,children:T?`Edit theme`:`Create theme`}),U?null:(0,R.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:G?`Select an element · Esc to cancel`:K?`${N?Re(K)?.label??z(K):z(K)} · ${me??0} ${me===1?`use`:`uses`}`:`Select a color below`})]}),(0,R.jsxs)(ie,{children:[(0,R.jsx)(ne,{render:(0,R.jsxs)(s,{"aria-label":G?`Cancel inspecting app colors`:`Inspect app colors`,"aria-pressed":G,size:`xs`,variant:G?`secondary`:`ghost`,onClick:()=>{if(G){We();return}pe(!0)},children:[(0,R.jsx)(a,{}),G?`Cancel`:`Inspect`]})}),(0,R.jsx)(re,{"data-theme-editor-panel":``,children:G?`Cancel and clear the selection`:`Pick a color from the app`})]}),(0,R.jsx)(s,{"aria-label":U?`Expand the theme editor`:`Minimize the theme editor`,size:`icon-xs`,variant:`ghost`,onClick:()=>de(!U),children:(0,R.jsx)(d,{icon:U?f:u})}),(0,R.jsx)(s,{"aria-label":`Close the theme editor`,size:`icon-xs`,variant:`ghost`,onClick:()=>t(!1),children:(0,R.jsx)(i,{})})]}),U?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto py-3 pl-3 pr-1.5`,children:[Je(),V?(0,R.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:V}):null,Xe(),(0,R.jsxs)(`div`,{className:`space-y-3`,children:[Ze(),$e()]})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border/70 px-3 py-2`,children:[(0,R.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>t(!1),children:`Cancel`}),(0,R.jsx)(s,{disabled:!k.trim(),size:`sm`,onClick:qe,children:T?Q?`Merge into “${Q.label}”`:`Save changes`:Q?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(r,{}),`Add ${j} palette`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l,{}),`Create theme`]})})]}),(0,R.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 right-0 z-10 flex size-5 cursor-se-resize touch-none select-none items-end justify-end p-1 text-muted-foreground/70`,onPointerCancel:ot,onPointerDown:it,onPointerMove:at,onPointerUp:ot,children:(0,R.jsx)(`svg`,{className:`size-2.5`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.2`,viewBox:`0 0 8 8`,children:(0,R.jsx)(`path`,{d:`M7 1 1 7M7 4.5 4.5 7`})})})]})]})}export{Ue as ThemeEditorPanel};
|
|
5
|
+
//# sourceMappingURL=ThemeEditorPanel-BRKQI9pP.js.map
|