ryco-cli 0.1.28 → 0.1.29
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.cjs +17 -4
- package/dist/bin.mjs +17 -4
- package/dist/client/assets/{AccountSettings-DF6okodO.js → AccountSettings-FN7pwqYA.js} +1 -1
- package/dist/client/assets/{AiFocusSettings-BNNr6MW3.js → AiFocusSettings-xcDAMaqH.js} +1 -1
- package/dist/client/assets/{AnimatedHeight-q2A-ikJ5.js → AnimatedHeight-BNg7wnTK.js} +1 -1
- package/dist/client/assets/{AppearanceSettings-BD0MZkm7.js → AppearanceSettings-BvsvAOsG.js} +1 -1
- package/dist/client/assets/{BranchToolbar.logic-DN0He2gp.js → BranchToolbar.logic-DFsXV3Qs.js} +1 -1
- package/dist/client/assets/{BrowserPanel-C_ddyv_7.js → BrowserPanel-D-g_xDZs.js} +1 -1
- package/dist/client/assets/{ChatRightPanel-B62ml3EW.js → ChatRightPanel-Bm906qNi.js} +5 -5
- package/dist/client/assets/{ChatThreadRouteView-BnvzR19h.js → ChatThreadRouteView-CATwakjI.js} +1 -1
- package/dist/client/assets/{CommandPaletteDialog-KtIlImWg.js → CommandPaletteDialog-Obv1bvxj.js} +1 -1
- package/dist/client/assets/{CompositeRoot-CTspN_gA.js → CompositeRoot-CfkIdky8.js} +1 -1
- package/dist/client/assets/{ComputerUseSettings-B4KnZnFy.js → ComputerUseSettings-ljYmTHea.js} +1 -1
- package/dist/client/assets/{ConnectionsSettings-BW1hWm-b.js → ConnectionsSettings-CIXs7x_E.js} +1 -1
- package/dist/client/assets/{ContextHandoffEndpointLabel-BCNMjnEV.js → ContextHandoffEndpointLabel-BzI4Wi1i.js} +1 -1
- package/dist/client/assets/{DiagnosticsSettings-Biqth29E.js → DiagnosticsSettings-DGX_2T2M.js} +1 -1
- package/dist/client/assets/{DialogHandle-B1kG1DEu.js → DialogHandle-CTtSYpsC.js} +1 -1
- package/dist/client/assets/{DialogPopup-CZ-twaqA.js → DialogPopup-DdZlhHuQ.js} +1 -1
- package/dist/client/assets/DialogRoot-k2_0SNKA.js +1 -0
- package/dist/client/assets/{DialogTitle-D8Vib3Xi.js → DialogTitle-Du7CAbaO.js} +1 -1
- package/dist/client/assets/{DialogTrigger-C8WNfJfY.js → DialogTrigger-VpFh8Xza.js} +1 -1
- package/dist/client/assets/{DialogViewport-BzuRIust.js → DialogViewport-BwuqbGLY.js} +1 -1
- package/dist/client/assets/{DraftChatThreadRouteView-Bf196For.js → DraftChatThreadRouteView-Cmc5HpWf.js} +1 -1
- package/dist/client/assets/{GlassSurface-R5jo7uZp.js → GlassSurface-BlWIlQ0s.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-xi9LAlqs.js → HostedConnectionControls-ySHqwr4K.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-B5cJPL0b.js → HostedHubRoot-Caz8PElK.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-BPxYI2S8.js → HostedNativeAuthorizationRoute-BSq_AlY2.js} +1 -1
- package/dist/client/assets/{HostedNodeRenameDialog-CZ6B6eOA.js → HostedNodeRenameDialog-ChxJdr-Z.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-Da0fanPZ.js → HostedRelayTrustNotice-DPVrIfj_.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-CVIFEYar.js → IntegrationsSettingsPanel-eAq5h-D5.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-FJVISTz3.js → KeybindingsSettings-D1XaEVGH.js} +1 -1
- package/dist/client/assets/{LazyBrowserPanel-ChCZntfd.js → LazyBrowserPanel-B6POLJh3.js} +1 -1
- package/dist/client/assets/{McpServersSettings-D5qSFad1.js → McpServersSettings-DqLA6n5v.js} +1 -1
- package/dist/client/assets/{MobileSheet-BZwVUjae.js → MobileSheet-CtQIYRlY.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-C9eJS4Wt.js → NodeSecuritySettings-Skm7GQDl.js} +1 -1
- package/dist/client/assets/{NullStore-iCZTvdl5.js → NullStore-b8PhjwPZ.js} +1 -1
- package/dist/client/assets/{OnboardingDialog-lWnlzsHQ.js → OnboardingDialog-8-fKvY5H.js} +1 -1
- package/dist/client/assets/{OpinionatedPluginsSettings-DQ77FhYa.js → OpinionatedPluginsSettings-BIJfJ34L.js} +1 -1
- package/dist/client/assets/{PdfAttachmentPreview-CmCBedSk.js → PdfAttachmentPreview-CTo1AyZs.js} +1 -1
- package/dist/client/assets/{PhoneGetAppInterstitial-DU7Pjbrv.js → PhoneGetAppInterstitial-DwopOWnQ.js} +1 -1
- package/dist/client/assets/{PhoneHome-D91zzTlE.js → PhoneHome-CUzxhhR4.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-vyuCLVtH.js → PhoneSettingsSurface-BK2RHmYJ.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-QMtod_bc.js → ProvidersSettingsPanel-DPxL7AsR.js} +1 -1
- package/dist/client/assets/{QuitShortcutFeedback-Bti16E53.js → QuitShortcutFeedback-eCvP_MNj.js} +1 -1
- package/dist/client/assets/{RedactedSensitiveText-9r8QC1lJ.js → RedactedSensitiveText-DH4mWpB6.js} +1 -1
- package/dist/client/assets/{RootAppShell-CYT2IfYW.js → RootAppShell-DwiWD4Cy.js} +2 -2
- package/dist/client/assets/{Separator-ClXl-hQH.js → Separator-BiINUUQl.js} +1 -1
- package/dist/client/assets/{SettingsDialog-BUcF48F9.js → SettingsDialog-CE8qy0qL.js} +1 -1
- package/dist/client/assets/{SettingsPanels-BydjDF1I.js → SettingsPanels-BYknk6GO.js} +1 -1
- package/dist/client/assets/{SettingsPanels.editor-zrq4ZT2j.js → SettingsPanels.editor-64bM0lhg.js} +1 -1
- package/dist/client/assets/{SourceControlSettings-CqVmc4sB.js → SourceControlSettings-BbveiAj3.js} +1 -1
- package/dist/client/assets/{StatisticsPage-k-gimGKE.js → StatisticsPage-CAO_tCeC.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-CtShfsl4.js → StatisticsPanel-SNlgMv2o.js} +1 -1
- package/dist/client/assets/{StatisticsSettingsLink-BapVo9aC.js → StatisticsSettingsLink-BpkNubL2.js} +1 -1
- package/dist/client/assets/{ThreadTerminalDrawer-Bfs5NCNv.js → ThreadTerminalDrawer-9x_kqQPy.js} +1 -1
- package/dist/client/assets/{ThreadWorkspacePanel-L6uNQRNX.js → ThreadWorkspacePanel-BXE17C4x.js} +1 -1
- package/dist/client/assets/{abnfDiagram-N423BO3Z-BzwwixLv.js → abnfDiagram-N423BO3Z-DAmGykdr.js} +1 -1
- package/dist/client/assets/{activity-CPE_7Kqw.js → activity-DRZlu-MC.js} +1 -1
- package/dist/client/assets/{alert-DVbwtykC.js → alert-CwrDisFU.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-CQNNG5gU.js +1 -0
- package/dist/client/assets/{architectureDiagram-T3A2C74G-DEiVciWZ.js → architectureDiagram-T3A2C74G-DypU2ERW.js} +1 -1
- package/dist/client/assets/{arrow-left-Ce-aUiy1.js → arrow-left-XhcJWpRy.js} +1 -1
- package/dist/client/assets/{arrow-right-BEwkAmxp.js → arrow-right-BBs6iTUL.js} +1 -1
- package/dist/client/assets/{arrow-up-right-CLCNhOeC.js → arrow-up-right-CJ9Vq7nK.js} +1 -1
- package/dist/client/assets/{badge-DqZmJa1g.js → badge-BswOCwph.js} +1 -1
- package/dist/client/assets/{blockDiagram-VBNYF7ZC-C-PBzm5g.js → blockDiagram-VBNYF7ZC-B9MhR9hY.js} +1 -1
- package/dist/client/assets/{bot-k1yDQ5mQ.js → bot-D5wgL7pu.js} +1 -1
- package/dist/client/assets/{c4Diagram-5PPSVZJV-DB6SIv2V.js → c4Diagram-5PPSVZJV-C22FWSoE.js} +1 -1
- package/dist/client/assets/{capabilities-C9OPiefV.js → capabilities-Bj_X9FZ-.js} +1 -1
- package/dist/client/assets/channel-BtX-w3CK.js +1 -0
- package/dist/client/assets/{chart-column-CVU4MshQ.js → chart-column-D6Lnkklk.js} +1 -1
- package/dist/client/assets/chevron-right-Ddq5gL-L.js +1 -0
- package/dist/client/assets/{chunk-2GRJ4B5K-CFM4Ac_N.js → chunk-2GRJ4B5K-D1tZuCzA.js} +1 -1
- package/dist/client/assets/{chunk-4I5QYGJK-a9tLNjnj.js → chunk-4I5QYGJK-Clf86zK0.js} +1 -1
- package/dist/client/assets/{chunk-5RXB4S5H-CbEb4Ht8.js → chunk-5RXB4S5H-B36N5RYZ.js} +1 -1
- package/dist/client/assets/{chunk-6Q2QTUOP-DPUmSmhc.js → chunk-6Q2QTUOP-IAxdzsQJ.js} +1 -1
- package/dist/client/assets/{chunk-7Z6QIM7H-Ba8d__CQ.js → chunk-7Z6QIM7H-Ctqebv_4.js} +1 -1
- package/dist/client/assets/{chunk-GF5L2VYU-BKOdlQ2f.js → chunk-GF5L2VYU-CAfciJae.js} +1 -1
- package/dist/client/assets/{chunk-I66GZJ75-DAfCveu2.js → chunk-I66GZJ75-BZ7XtZf4.js} +1 -1
- package/dist/client/assets/{chunk-JQJVKLGR-CPzgDuD8.js → chunk-JQJVKLGR-DVuZCWnv.js} +1 -1
- package/dist/client/assets/{chunk-KBJHAD2P-X87J_pHD.js → chunk-KBJHAD2P-DtWbzsRm.js} +1 -1
- package/dist/client/assets/{chunk-NSK5VX7P-BgrjQWAz.js → chunk-NSK5VX7P-BVMz_Hc4.js} +1 -1
- package/dist/client/assets/{chunk-QR6OTTB3-NTX__XXO.js → chunk-QR6OTTB3-DWitTCy-.js} +1 -1
- package/dist/client/assets/{chunk-UBXNYLIW-BVySE3ty.js → chunk-UBXNYLIW-BuxXXP2s.js} +1 -1
- package/dist/client/assets/{chunk-W5SLKNZC-0-ctjkBJ.js → chunk-W5SLKNZC-Bnf3sQl4.js} +1 -1
- package/dist/client/assets/{chunk-WRU74C26-AGGo_1S7.js → chunk-WRU74C26-xu-KDOon.js} +1 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-BgDa3HFl.js +1 -0
- package/dist/client/assets/classDiagram-v2-OCEON4UE-BgDa3HFl.js +1 -0
- package/dist/client/assets/{clipboard-copy-C3icJCGA.js → clipboard-copy-oDSkUUg4.js} +1 -1
- package/dist/client/assets/{cynefin-OW5HDTMX-BR32cltb.js → cynefin-OW5HDTMX-DGNyiNSf.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-MW4NZA55-B7S5bXUw.js → cynefinDiagram-MW4NZA55-_ctibv4i.js} +1 -1
- package/dist/client/assets/{dagre-VZM6K2ZE-BZOfZvme.js → dagre-VZM6K2ZE-Bo-bS1Y0.js} +1 -1
- package/dist/client/assets/{data-list-E_dNBqgV.js → data-list-DLsM39Hp.js} +1 -1
- package/dist/client/assets/{desktopWorkspace-DIoIhyml.js → desktopWorkspace-Ocqt625W.js} +1 -1
- package/dist/client/assets/{deviceName-BY2WK012.js → deviceName-z0ZWSq0z.js} +1 -1
- package/dist/client/assets/{diagram-7IWD3JNH-CypfFHxI.js → diagram-7IWD3JNH-DSjtw1SY.js} +1 -1
- package/dist/client/assets/{diagram-B4RE2ZJO-CaYsJtDz.js → diagram-B4RE2ZJO-B7fWEvIa.js} +1 -1
- package/dist/client/assets/{diagram-LBJQPF4R-BdhZtcd2.js → diagram-LBJQPF4R-trRYCE5d.js} +1 -1
- package/dist/client/assets/{diagram-Q27KOJAE-CW1SMIBy.js → diagram-Q27KOJAE-_DYcRggk.js} +1 -1
- package/dist/client/assets/{diagram-UB23O5K3-Cq8GGDkV.js → diagram-UB23O5K3-BkMzOHX8.js} +1 -1
- package/dist/client/assets/{download-Fq1MsYfI.js → download-CHdS3R_v.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-BXEA7PRR-CE78Op8p.js → ebnfDiagram-BXEA7PRR-DubiOMCG.js} +1 -1
- package/dist/client/assets/{editorPreferences-DzxKMQJx.js → editorPreferences-DVhg0CXd.js} +1 -1
- package/dist/client/assets/{empty-DXTz-nBL.js → empty-BlBl_Vvw.js} +1 -1
- package/dist/client/assets/{erDiagram-JOGREHBK-Bn6BFae6.js → erDiagram-JOGREHBK-CFDiNfSJ.js} +1 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-DpzGHjmu.js +1 -0
- package/dist/client/assets/flowDiagram-UKHOOZJN-CaDVMm72.js +1 -0
- package/dist/client/assets/{ganttDiagram-PKOTCBZU-C8NbmUQP.js → ganttDiagram-PKOTCBZU-DT2XhE-m.js} +1 -1
- package/dist/client/assets/{gitGraph-4MIJSDKK-Dg7W2mOf.js → gitGraph-4MIJSDKK-BI5UGiqb.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-XEC1jydW.js → gitGraphDiagram-DS77QQ5N-CzAB97Rd.js} +1 -1
- package/dist/client/assets/{group-CcSMHbpZ.js → group-DZJuSiJL.js} +1 -1
- package/dist/client/assets/{hostedConnectionCoordinator-BkxMXc2s.js → hostedConnectionCoordinator-BztHfGNt.js} +1 -1
- package/dist/client/assets/{hubRoutes-Ch__ge2L.js → hubRoutes-DExWSvVE.js} +1 -1
- package/dist/client/assets/{index-3zoAo5bo.js → index-BAJdq3TK.js} +1 -1
- package/dist/client/assets/{info-A6RAGUB7-CPN5xH7s.js → info-A6RAGUB7-DdGYYgLX.js} +1 -1
- package/dist/client/assets/{infoDiagram-6WML65LV-DbXXnE3-.js → infoDiagram-6WML65LV-zhUpER6a.js} +1 -1
- package/dist/client/assets/{input-zI-YDU9i.js → input-CzU08wbL.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-DAjJrXWe.js → ishikawaDiagram-WSZJBQD7-BQLkqykE.js} +1 -1
- package/dist/client/assets/{journeyDiagram-NVQOT4AX-CaGm-K-C.js → journeyDiagram-NVQOT4AX-DBgsbKOF.js} +1 -1
- package/dist/client/assets/{kanban-definition-27J2QSJJ-C2YRqY28.js → kanban-definition-27J2QSJJ-DF-Rr-xs.js} +1 -1
- package/dist/client/assets/{kbd-DlXUKjl1.js → kbd-DKuvGqFP.js} +1 -1
- package/dist/client/assets/{key-round-DLUapaUr.js → key-round-CvyrSjb2.js} +1 -1
- package/dist/client/assets/{layers-3D4z3mrk.js → layers-CwP65mnC.js} +1 -1
- package/dist/client/assets/{log-out-BxEBqpSs.js → log-out-D3rICSt5.js} +1 -1
- package/dist/client/assets/{main-DsnAjTqg.js → main-RFllWEko.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-Dhd66igk.js → mermaid-parser.core-BiGKtilP.js} +2 -2
- package/dist/client/assets/{mermaidEngine-3NZnIFOn.js → mermaidEngine-Cjfgf3Bg.js} +3 -3
- package/dist/client/assets/{mindmap-definition-FAOFIHXS-SuO77jBW.js → mindmap-definition-FAOFIHXS-SiU9JwWJ.js} +1 -1
- package/dist/client/assets/{motion-B4mmVewo.js → motion-C9rN_t9p.js} +1 -1
- package/dist/client/assets/{packet-AYTQ26CC-BZwkWo3N.js → packet-AYTQ26CC-F-HuW5Dr.js} +1 -1
- package/dist/client/assets/{palette-BXA2I3bI.js → palette-gaqgtube.js} +1 -1
- package/dist/client/assets/{pegDiagram-VL7TDLO6-DgWypDaQ.js → pegDiagram-VL7TDLO6-cC-QUd7I.js} +1 -1
- package/dist/client/assets/{pie-WAS4IAKB-C1iJ73d9.js → pie-WAS4IAKB-BI3XUcLN.js} +1 -1
- package/dist/client/assets/{pieDiagram-7S7Q4E2Y-DK1OTG7x.js → pieDiagram-7S7Q4E2Y-BP4gJ4ZK.js} +1 -1
- package/dist/client/assets/{play-CJNYRuck.js → play-BJZrOx6T.js} +1 -1
- package/dist/client/assets/{providerDriverMeta-DJ9TrG26.js → providerDriverMeta-LJ2vJxm-.js} +1 -1
- package/dist/client/assets/{qr-code-HMr6crTy.js → qr-code-BFO8lV1M.js} +1 -1
- package/dist/client/assets/{qr-code-CBzdIN1G.js → qr-code-Cmfz5JKf.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-CIgZ3afX.js → quadrantDiagram-CIZ2JOQS-DO-N1m-q.js} +1 -1
- package/dist/client/assets/{radar-RG4KPBEZ-vq15KQ2S.js → radar-RG4KPBEZ-CfayXQ5F.js} +1 -1
- package/dist/client/assets/{radio-group-1yuMmVHi.js → radio-group-BueX1AVO.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-DWMARNIs.js → railroad-74A4TZTK-CT6f-etT.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-B890iayj.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-C079Tzw6.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DxvOX5Rh.js +1 -0
- package/dist/client/assets/{railroadDiagram-AXF67PYL-rE9Jx5yK.js → railroadDiagram-AXF67PYL-DC8egbob.js} +1 -1
- package/dist/client/assets/{refresh-cw-DBJIPv7m.js → refresh-cw-K_hU8_ld.js} +1 -1
- package/dist/client/assets/{requirementDiagram-LRYGKXZP-Dkz6KTug.js → requirementDiagram-LRYGKXZP-DJMzcLk_.js} +1 -1
- package/dist/client/assets/{runtime-DpHhg0dl.js → runtime-OM-uAtaj.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-W5VNT64P-qCyqmTya.js → sankeyDiagram-W5VNT64P-YR6aIYLj.js} +1 -1
- package/dist/client/assets/{save-BFsP9OG2.js → save-Mh-PA_2P.js} +1 -1
- package/dist/client/assets/{scroll-area-CxjQJZM9.js → scroll-area-BC-LB_zE.js} +1 -1
- package/dist/client/assets/{scrollEdges-CXvSHaVb.js → scrollEdges-Zcpuz3un.js} +1 -1
- package/dist/client/assets/{separator-D3j91Nju.js → separator-yx1r9ZDw.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-SI44F4Z6-GCGWxGKL.js → sequenceDiagram-SI44F4Z6-BVeSqWDA.js} +1 -1
- package/dist/client/assets/{settingsLayout-3SUkadS6.js → settingsLayout-BbjDM-p0.js} +1 -1
- package/dist/client/assets/{sheet-BOQ2T2gY.js → sheet-CpEwjOWn.js} +1 -1
- package/dist/client/assets/{shield-alert-CWQ-fgqm.js → shield-alert-CXmR7fM9.js} +1 -1
- package/dist/client/assets/{shield-check-Dgpx5EQs.js → shield-check-CdFhWT_o.js} +1 -1
- package/dist/client/assets/{shield-Colgxqw7.js → shield-i098Bm_B.js} +1 -1
- package/dist/client/assets/{sidebar-BIv8pHHx.js → sidebar-DayQTDZp.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-BpKCw8IR.js → sidebarProjectFolders-DXqx3OlZ.js} +1 -1
- package/dist/client/assets/{sidebarStatusText-DSeDlb-o.js → sidebarStatusText-kdA6QMZS.js} +1 -1
- package/dist/client/assets/{sidebarUndo-DzblmE6P.js → sidebarUndo-BHFfJj0k.js} +1 -1
- package/dist/client/assets/{skeleton-BdJ4w_TS.js → skeleton-BwFgUtuE.js} +1 -1
- package/dist/client/assets/{smartphone-DhBEWfKK.js → smartphone-DGfizz51.js} +1 -1
- package/dist/client/assets/square-Cd2WS1gv.js +1 -0
- package/dist/client/assets/{star-BAzXRepp.js → star-J3x3fktG.js} +1 -1
- package/dist/client/assets/{stateDiagram-OKZ733FA-D8fRUjov.js → stateDiagram-OKZ733FA-DoIZN669.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-BnzsGHaN.js +1 -0
- package/dist/client/assets/storeSelectors-D60AAN01.js +1 -0
- package/dist/client/assets/{swimlanes-SLNWSIFB-BKy9AxWZ.js → swimlanes-SLNWSIFB-BoFLigyK.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-BnA-oDvU.js +8 -0
- package/dist/client/assets/{switch-DgLijJhN.js → switch-D9inWKdd.js} +1 -1
- package/dist/client/assets/{timeline-definition-Z64GVDOM-DV53IwmP.js → timeline-definition-Z64GVDOM-D65EmNWc.js} +1 -1
- package/dist/client/assets/{toggle-group-DRIEnEQy.js → toggle-group-YNqzWsK0.js} +1 -1
- package/dist/client/assets/{toggle-BgR-G8hl.js → toggle-wMq3LLn1.js} +1 -1
- package/dist/client/assets/{tokenModePresentation-Bh3mJ9H-.js → tokenModePresentation-C0-NgmX5.js} +1 -1
- package/dist/client/assets/{tooltip-CsNk2GK1.js → tooltip-mwOCSCXF.js} +1 -1
- package/dist/client/assets/{treeView-Q6P3EWNA-BgFMn3HH.js → treeView-Q6P3EWNA-C2S-OPgI.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-B45XVWgo.js → treemap-WGGIJYW6-6Ovsu9iH.js} +1 -1
- package/dist/client/assets/{unplug-0SZT8Az_.js → unplug-BEfcl9Ht.js} +1 -1
- package/dist/client/assets/useAppSidebarCollapsed-C0jpPtER.js +1 -0
- package/dist/client/assets/useBaseUiId-Bz8dcyjd.js +1 -0
- package/dist/client/assets/{useLabelableId-CTlGVpp_.js → useLabelableId-C8bc9a0F.js} +1 -1
- package/dist/client/assets/{useNavigate-xewFGSmS.js → useNavigate-01O5dMQe.js} +1 -1
- package/dist/client/assets/{usePhoneThreadActions-CuSwvIb4.js → usePhoneThreadActions-BIdh81kF.js} +1 -1
- package/dist/client/assets/{usePopupViewport-CCXjC0oV.js → usePopupViewport-DYYZwfTW.js} +1 -1
- package/dist/client/assets/{useScrollLock-DkiskCYn.js → useScrollLock-BO185DkJ.js} +1 -1
- package/dist/client/assets/{useStatistics-C5V0rg9r.js → useStatistics-D55-xLMz.js} +1 -1
- package/dist/client/assets/{useTriggerFocusGuards-Cd4IS7Sl.js → useTriggerFocusGuards-CMLVr18J.js} +1 -1
- package/dist/client/assets/{useValueChanged-DUWoN5BG.js → useValueChanged-DSyRHPje.js} +1 -1
- package/dist/client/assets/{user-round-BtyrzbBf.js → user-round-C-U7TZKG.js} +1 -1
- package/dist/client/assets/{vennDiagram-T6HMQDX7-DAr5h306.js → vennDiagram-T6HMQDX7-fZAexcYr.js} +1 -1
- package/dist/client/assets/{vscode-icons-LDoILSKI.js → vscode-icons-BYX6fBsM.js} +1 -1
- package/dist/client/assets/{wardley-WFR3VGLG-6MSUlbTx.js → wardley-WFR3VGLG-gdYWSMxK.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-T6FBY63Y-Bwv8xq6E.js → wardleyDiagram-T6FBY63Y-iDJxQb70.js} +1 -1
- package/dist/client/assets/{workspaceMetadataProjection-DzVpakWU.js → workspaceMetadataProjection-So9-wSEZ.js} +1 -1
- package/dist/client/assets/{wrench-BDHgkqDa.js → wrench-D79uBUSl.js} +1 -1
- package/dist/client/assets/{xychartDiagram-ELKLHX3M-Be0CbWLp.js → xychartDiagram-ELKLHX3M-B4cfMwpJ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/package.json +1 -1
- package/dist/client/assets/DialogRoot-CEU7Xp57.js +0 -1
- package/dist/client/assets/architecture-7GRP2DOG-B6OTx_1D.js +0 -1
- package/dist/client/assets/channel-D_j9jK0M.js +0 -1
- package/dist/client/assets/chevron-right-D3dUAoht.js +0 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-Ck79EbLj.js +0 -1
- package/dist/client/assets/classDiagram-v2-OCEON4UE-Ck79EbLj.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-COIUUd8Y.js +0 -1
- package/dist/client/assets/flowDiagram-UKHOOZJN-Cdhu8N9G.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DtRRa_PL.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-WQz4QHTw.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-1gkGEpqz.js +0 -1
- package/dist/client/assets/square--aW0vCo4.js +0 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-vKQeXqcV.js +0 -1
- package/dist/client/assets/storeSelectors-BFVEGU0F.js +0 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-qtmvcwUS.js +0 -8
- package/dist/client/assets/useAppSidebarCollapsed-CvO9sEQ7.js +0 -1
- package/dist/client/assets/useBaseUiId-B5nK6G4h.js +0 -1
package/dist/client/assets/{AppearanceSettings-BD0MZkm7.js → AppearanceSettings-BvsvAOsG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Kr as n,Qr as r,ao as i,ei as a,ho as o,lo as s,mo as c}from"./runtime-DpHhg0dl.js";import{t as l}from"./react-CwJFpaho.js";import{Ct as u,Dt as d,Et as f,Ft as p,J as m,K as h,Pt as g,Q as _,Tt as v,Ut as y,X as b,Y as x,Z as S,gr as C,jt as w,q as T,t as E}from"./switch-DgLijJhN.js";import{t as D}from"./compiler-runtime-C4g8XhC5.js";import{t as O}from"./badge-DqZmJa1g.js";import{J as k,Q as A}from"./ContextHandoffEndpointLabel-BCNMjnEV.js";import{t as j}from"./clipboard-copy-C3icJCGA.js";import{t as ee}from"./download-Fq1MsYfI.js";import{t as te}from"./palette-BXA2I3bI.js";import{t as M}from"./input-zI-YDU9i.js";import{_ as N,a as P,b as F,f as ne,i as re,l as I,m as L,o as ie,p as ae,u as oe,y as se}from"./appearancePreferences-nFx4MHoI.js";import{C as ce,S as le,_ as R,a as ue,b as de,c as fe,d as pe,f as me,g as z,h as he,i as ge,l as _e,m as B,o as ve,p as ye,r as V,s as H,t as U,u as be,v as xe,x as W,y as Se}from"./useTheme-B441xg4F.js";import{n as Ce,r as we,t as Te}from"./toggle-group-DRIEnEQy.js";import{i as G,n as K,r as q,t as J}from"./settingsLayout-3SUkadS6.js";import{ut as Ee}from"./main-DsnAjTqg.js";var Y={name:`baseline`,size:24,node:[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]};Y.node;var X=o(Y),De={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};De.node;var Oe=o(De),ke={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};ke.node;var Ae=o(ke),je={name:`radius`,size:24,node:[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};je.node;var Me=o(je),Ne={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ne.node;var Pe=o(Ne),Fe={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Fe.node;var Ie=o(Fe),Z=e(l(),1),Q=D(),Le=`.rycotheme.json`,Re=/[^a-z0-9-_]+/gi;function ze(e){let t=(e.name||e.id).trim().replace(Re,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Le}`}function Be(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Ve(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!ye(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function He(e,t=`rename`){let n=Ve(e);if(!be().find(e=>e.id===n.id))return ge(n),{theme:n,action:`added`};if(pe(n.id)||t===`rename`){let e={...n,id:_e(n.id)};return ge(e),{theme:e,action:`renamed`}}return de(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ue(e){let t=Be(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function We(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Be(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ze(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Ge(e,t={}){let n=He(await e.text(),t.collision??`rename`);return t.activate&&(Se(n.theme.id),ue(n.theme)),n}var $=t();function Ke(e,t,n){return e<t?t:e>n?n:e}function qe(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Je({r:e,g:t,b:n}){let r=e=>Ke(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function Ye({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Xe({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function Ze(e){let t=(0,Q.c)(71),{value:n,onChange:r,children:i,side:o,align:s,ariaLabel:c,triggerClassName:l}=e,u=o===void 0?`bottom`:o,p=s===void 0?`start`:s,m;t[0]===n?m=t[1]:(m=()=>{let e=qe(n);return e?Ye(e):{h:0,s:0,v:0}},t[0]=n,t[1]=m);let[h,g]=(0,Z.useState)(m),[_,y]=(0,Z.useState)(n),[b,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w=(0,Z.useRef)(r),T=(0,Z.useRef)(h.h),E;t[2]===r?E=t[3]:(E=()=>{w.current=r},t[2]=r,t[3]=E),(0,Z.useEffect)(E);let D,O;t[4]===h.h?(D=t[5],O=t[6]):(D=()=>{T.current=h.h},O=[h.h],t[4]=h.h,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{if(S.current=null,C.current===null)return;let e=C.current;C.current=null,w.current(e)},t[7]=k):k=t[7];let A=k,j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{C.current=e,S.current===null&&(S.current=requestAnimationFrame(A))},t[8]=j):j=t[8];let ee=j,te,N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>()=>{if(S.current!==null&&(cancelAnimationFrame(S.current),S.current=null),C.current!==null){let e=C.current;C.current=null,w.current(e)}},te=[],t[9]=te,t[10]=N):(te=t[9],N=t[10]),(0,Z.useEffect)(N,te);let P;t[11]===h?P=t[12]:(P=Je(Xe(h)),t[11]=h,t[12]=P);let F=P,ne,re;t[13]!==F||t[14]!==n?(ne=()=>{if(n.toLowerCase()===F.toLowerCase())return;let e=qe(n);if(!e)return;let t=Ye(e);g(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),y(n)},re=[n,F],t[13]=F,t[14]=n,t[15]=ne,t[16]=re):(ne=t[15],re=t[16]),(0,Z.useEffect)(ne,re);let I=(0,Z.useRef)(null),L;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{let t=I.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=Ke(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;g(e=>{let t={h:e.h,s:a,v:o},n=Je(Xe(t));return y(n),C.current=n,S.current===null&&(S.current=requestAnimationFrame(A)),t})},t[17]=L):L=t[17];let ie=L,ae;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ie(e)},t[18]=ae):ae=t[18];let oe=ae,se;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ie(e)},t[19]=se):se=t[19];let ce=se,le=(0,Z.useRef)(null),R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{let t=le.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;g(e=>{let t={h:i,s:e.s,v:e.v},n=Je(Xe(t));return y(n),C.current=n,S.current===null&&(S.current=requestAnimationFrame(A)),t})},t[20]=R):R=t[20];let ue=R,de;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ue(e)},t[21]=de):de=t[21];let fe=de,pe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ue(e)},t[22]=pe):pe=t[22];let me=pe,z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{y(e);let t=qe(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=Ye(t),r={h:n.s===0?T.current:n.h,s:n.s,v:n.v};g(r),ee(Je(t))},t[23]=z):z=t[23];let he=z,ge=`${h.h/360*100}%`,_e=`${h.s*100}%`,B=`${(1-h.v)*100}%`,ve=`hsl(${h.h} 100% 50%)`,ye;t[24]===l?ye=t[25]:(ye=a(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,l),t[24]=l,t[25]=ye);let V;t[26]!==c||t[27]!==i||t[28]!==ye?(V=(0,$.jsx)(d,{"aria-label":c,className:ye,children:i}),t[26]=c,t[27]=i,t[28]=ye,t[29]=V):V=t[29];let H;t[30]===h.s?H=t[31]:(H=Math.round(h.s*100),t[30]=h.s,t[31]=H);let U;t[32]===ve?U=t[33]:(U={backgroundColor:ve},t[32]=ve,t[33]=U);let be;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=be):be=t[34];let xe;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=xe):xe=t[35];let W;t[36]!==_e||t[37]!==B?(W=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:_e,top:B}}),t[36]=_e,t[37]=B,t[38]=W):W=t[38];let Se;t[39]!==H||t[40]!==U||t[41]!==W?(Se=(0,$.jsxs)(`div`,{ref:I,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:U,onPointerDown:oe,onPointerMove:ce,children:[be,xe,W]}),t[39]=H,t[40]=U,t[41]=W,t[42]=Se):Se=t[42];let Ce;t[43]===h.h?Ce=t[44]:(Ce=Math.round(h.h),t[43]=h.h,t[44]=Ce);let we;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(we={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=we):we=t[45];let Te;t[46]===ge?Te=t[47]:(Te=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:ge}}),t[46]=ge,t[47]=Te);let G;t[48]!==Ce||t[49]!==Te?(G=(0,$.jsx)(`div`,{ref:le,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Ce,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:we,onPointerDown:fe,onPointerMove:me,children:Te}),t[48]=Ce,t[49]=Te,t[50]=G):G=t[50];let K;t[51]===F?K=t[52]:(K=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:F}}),t[51]=F,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>he(e.currentTarget.value),t[53]=q):q=t[53];let J;t[54]===_?J=t[55]:(J=(0,$.jsx)(M,{value:_,size:`sm`,nativeInput:!0,onChange:q,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=_,t[55]=J);let Ee;t[56]!==K||t[57]!==J?(Ee=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,J]}),t[56]=K,t[57]=J,t[58]=Ee):Ee=t[58];let Y;t[59]!==Se||t[60]!==G||t[61]!==Ee?(Y=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Se,G,Ee]}),t[59]=Se,t[60]=G,t[61]=Ee,t[62]=Y):Y=t[62];let X;t[63]!==p||t[64]!==u||t[65]!==Y?(X=(0,$.jsx)(f,{side:u,align:p,className:`w-64`,children:Y}),t[63]=p,t[64]=u,t[65]=Y,t[66]=X):X=t[66];let De;return t[67]!==b||t[68]!==V||t[69]!==X?(De=(0,$.jsxs)(v,{open:b,onOpenChange:x,children:[V,X]}),t[67]=b,t[68]=V,t[69]=X,t[70]=De):De=t[70],De}var Qe=[{value:`stacked`,label:`Unified`,description:`Removed and added lines together in one column.`},{value:`split`,label:`Split`,description:`Compare the original and updated code side by side.`}];function $e(e){let t=(0,Q.c)(16),{number:n,kind:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r?{backgroundColor:`color-mix(in srgb, var(--background) 92%, var(--${r===`added`?`success`:`destructive`}))`}:void 0,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`w-7 shrink-0 select-none text-center text-muted-foreground/60`,children:n}),t[2]=n,t[3]=o);let s=r===`added`?`var(--success)`:`var(--destructive)`,c;t[4]===s?c=t[5]:(c={color:s},t[4]=s,t[5]=c);let l=r===`added`?`+`:r===`removed`?`−`:` `,u;t[6]!==c||t[7]!==l?(u=(0,$.jsx)(`span`,{className:`w-4 shrink-0`,style:c,children:l}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=(0,$.jsx)(`span`,{children:i}),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==o||t[13]!==u||t[14]!==d?(f=(0,$.jsxs)(`div`,{className:`flex whitespace-pre leading-6`,style:a,children:[o,u,d]}),t[11]=a,t[12]=o,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function et(e){let t=(0,Q.c)(10),{layout:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{children:`greeting.ts`}),i=(0,$.jsx)(`span`,{className:`text-success`,children:`+1`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex justify-between border-b border-border bg-muted/30 px-3 py-2`,children:[r,(0,$.jsxs)(`span`,{children:[i,` `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`−1`})]})]}),t[2]=o):o=t[2];let s=n===`split`&&`grid grid-cols-2 divide-x divide-border`,c;t[3]===s?c=t[4]:(c=a(`min-h-32 py-3`,s),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=n===`split`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:3,children:``})]}),(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]}),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==l?(u=(0,$.jsxs)(`div`,{"aria-hidden":`true`,className:`overflow-hidden rounded-lg border border-border bg-background text-left font-mono text-[10px] text-foreground`,children:[o,(0,$.jsx)(`div`,{className:c,children:l})]}),t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function tt(){let e=(0,Q.c)(6),[t,n]=we(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`p`,{className:`px-4 pt-4 text-xs text-muted-foreground`,children:`Choose how code changes appear in the diff viewer. You can also switch from its toolbar.`}),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=Qe.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.value,"aria-label":`${e.label} diff style`,onClick:()=>n(e.value),className:a(`min-w-0 rounded-xl border p-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring`,t===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/20`),children:[(0,$.jsx)(et,{layout:e.value}),(0,$.jsxs)(`span`,{className:`mt-3 flex items-center justify-between text-sm font-medium`,children:[e.label,t===e.value&&(0,$.jsx)(c,{"aria-hidden":`true`,className:`size-4`})]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]},e.value)),e[1]=t,e[2]=n,e[3]=i):i=e[3];let o;return e[4]===i?o=e[5]:(o=(0,$.jsxs)(G,{title:`Diff style`,children:[r,(0,$.jsx)(`div`,{role:`group`,"aria-label":`Diff style`,className:`grid gap-4 p-4 lg:grid-cols-2`,children:i})]}),e[4]=i,e[5]=o),o}function nt(e){let t=(0,Q.c)(22),{theme:n,variant:r,compact:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=Object.fromEntries(Object.entries(z(xe(n,r))).map(it)),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex w-[26%] flex-col gap-2 border-r border-[var(--sidebar-border)] bg-[var(--sidebar)] p-[4%]`,children:[(0,$.jsx)(`span`,{className:`font-semibold`,children:`Ryco`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),(0,$.jsx)(`span`,{className:`h-3 rounded bg-[var(--sidebar-accent)]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded bg-[var(--muted-foreground)] opacity-25`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-25`})]}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l=a?(0,$.jsx)(`div`,{className:`h-3 w-2/3 shrink-0 self-end rounded bg-[var(--secondary)]`}):(0,$.jsx)(`div`,{className:`self-end rounded bg-[var(--secondary)] px-2 py-1`,children:`Build something great`}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),t[6]=u):u=t[6];let d;t[7]===a?d=t[8]:(d=a?(0,$.jsx)(`div`,{className:`h-1.5 w-2/3 rounded bg-[var(--muted-foreground)] opacity-25`}):(0,$.jsxs)(`div`,{className:`rounded border border-[var(--border)] bg-[var(--card)] p-2 font-mono`,children:[(0,$.jsx)(`span`,{style:{color:`var(--info)`},children:`const `}),`theme =`,` `,(0,$.jsx)(`span`,{style:{color:`var(--success)`},children:`"ryco"`}),`;`,(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`// Make it yours`})]}),t[7]=a,t[8]=d);let f;t[9]===a?f=t[10]:(f=a?(0,$.jsx)(`span`,{className:`h-1 w-1/2 rounded bg-[var(--muted-foreground)] opacity-30`}):(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`Ask anything…`}),t[9]=a,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`size-3 rounded-full bg-[var(--primary)]`}),t[11]=p):p=t[11];let m;t[12]===f?m=t[13]:(m=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center justify-between rounded-md border border-[var(--input)] px-2 py-1.5`,children:[f,p]}),t[12]=f,t[13]=m);let h;t[14]!==l||t[15]!==d||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`flex aspect-[16/9] text-[9px] leading-relaxed`,children:[c,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 p-[4%]`,children:[l,u,d,m]})]}),t[14]=l,t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`flex h-2`,children:[`sidebar`,`background`,`primary`,`info`,`success`,`warning`,`destructive`].map(rt)}),t[18]=g):g=t[18];let _;return t[19]!==s||t[20]!==h?(_=(0,$.jsxs)(`div`,{"aria-hidden":`true`,style:s,className:`w-full overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]`,children:[h,g]}),t[19]=s,t[20]=h,t[21]=_):_=t[21],_}function rt(e){return(0,$.jsx)(`span`,{className:`flex-1`,style:{backgroundColor:`var(--${e})`}},e)}function it(e){let[t,n]=e;return[`--${t}`,n]}var at=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],ot=new Set(W),st=null,ct=null;function lt(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;st||(st=document.createElement(`div`),st.style.position=`absolute`,st.style.visibility=`hidden`,st.style.pointerEvents=`none`,document.body.append(st)),st.style.color=``,st.style.color=e;let t=getComputedStyle(st).color;ct||=document.createElement(`canvas`),ct.width=1,ct.height=1;let n=ct.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function ut(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function dt(e,t){return{...e,name:t}}function ft(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function pt(e){return V.includes(e)}function mt(e){let t=(0,Q.c)(124),{source:n,draft:i,onDraftChange:a,onSave:o,onCancel:s,resolvedVariant:c}=e,[l,d]=(0,Z.useState)(`form`),[f,p]=(0,Z.useState)(c),g;t[0]===i?g=t[1]:(g=()=>JSON.stringify(i,null,2),t[0]=i,t[1]=g);let[v,y]=(0,Z.useState)(g),[C,w]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(!1),O;t[2]===n?O=t[3]:(O=JSON.stringify(n),t[2]=n,t[3]=O);let k;t[4]===i?k=t[5]:(k=JSON.stringify(i),t[4]=i,t[5]=k);let A=O!==k,j;t[6]===i?j=t[7]:(j=()=>{ue(i)},t[6]=i,t[7]=j);let ee;t[8]!==i||t[9]!==c?(ee=[i,c],t[8]=i,t[9]=c,t[10]=ee):ee=t[10],(0,Z.useEffect)(j,ee);let te,N;t[11]!==i||t[12]!==l?(te=()=>{l===`form`&&y(JSON.stringify(i,null,2))},N=[i,l],t[11]=i,t[12]=l,t[13]=te,t[14]=N):(te=t[13],N=t[14]),(0,Z.useEffect)(te,N);let P;t[15]!==i||t[16]!==a?(P=e=>{a(dt(i,e))},t[15]=i,t[16]=a,t[17]=P):P=t[17];let F=P,ne;t[18]!==i||t[19]!==a?(ne=e=>{a(ft(i,e))},t[18]=i,t[19]=a,t[20]=ne):ne=t[20];let re=ne,I;t[21]!==i||t[22]!==a||t[23]!==f?(I=(e,t)=>{a(ut(i,f,e,t))},t[21]=i,t[22]=a,t[23]=f,t[24]=I):I=t[24];let L=I,ie;t[25]===a?ie=t[26]:(ie=e=>{y(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;w(t instanceof Error?t.message:`Invalid JSON`);return}if(!ye(t)){w(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}w(null),a(t)},t[25]=a,t[26]=ie);let ae=ie,oe;t[27]!==A||t[28]!==s?(oe=()=>{if(A){D(!0);return}s()},t[27]=A,t[28]=s,t[29]=oe):oe=t[29];let se=oe,R,de,fe;if(t[30]!==i.dark||t[31]!==i.light||t[32]!==f){fe=(f===`dark`?i.dark:i.light)??{};let e;t[36]===f?e=t[37]:(e=(f===`dark`?ce.dark:ce.light)??{},t[36]=f,t[37]=e),R=e,de=Object.entries(fe).filter(_t),t[30]=i.dark,t[31]=i.light,t[32]=f,t[33]=R,t[34]=de,t[35]=fe}else R=t[33],de=t[34],fe=t[35];let pe=de,me=ht,z=me(i.light)||me(i.dark),he;t[38]!==i.name||t[39]!==z||t[40]!==C?(he=C!==null||i.name.trim().length===0||z,t[38]=i.name,t[39]=z,t[40]=C,t[41]=he):he=t[41];let ge=he,_e;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=_e):_e=t[42];let B=i.name||`Untitled`,ve;t[43]!==i.name||t[44]!==B?(ve=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:i.name,children:B}),t[43]=i.name,t[44]=B,t[45]=ve):ve=t[45];let V;t[46]===A?V=t[47]:(V=A?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=A,t[47]=V);let H;t[48]===se?H=t[49]:(H=(0,$.jsx)(r,{size:`sm`,variant:`outline`,onClick:se,children:`Cancel`}),t[48]=se,t[49]=H);let U;t[50]!==o||t[51]!==ge?(U=(0,$.jsx)(r,{size:`sm`,onClick:o,disabled:ge,children:`Save`}),t[50]=o,t[51]=ge,t[52]=U):U=t[52];let be;t[53]!==H||t[54]!==U?(be=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[H,U]}),t[53]=H,t[54]=U,t[55]=be):be=t[55];let xe;t[56]!==ve||t[57]!==V||t[58]!==be?(xe=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[_e,ve,V,be]}),t[56]=ve,t[57]=V,t[58]=be,t[59]=xe):xe=t[59];let W;t[60]===l?W=t[61]:(W=[l],t[60]=l,t[61]=W);let Se,we,G;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{let t=e[0];(t===`form`||t===`json`)&&d(t)},we=(0,$.jsx)(Te,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),G=(0,$.jsx)(Te,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=Se,t[63]=we,t[64]=G):(Se=t[62],we=t[63],G=t[64]);let K;t[65]===W?K=t[66]:(K=(0,$.jsxs)(Ce,{value:W,variant:`outline`,size:`sm`,onValueChange:Se,children:[we,G]}),t[65]=W,t[66]=K);let q;t[67]===f?q=t[68]:(q=[f],t[67]=f,t[68]=q);let J,Ee,Y;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{let t=e[0];(t===`light`||t===`dark`)&&p(t)},Ee=(0,$.jsx)(Te,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),Y=(0,$.jsx)(Te,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=J,t[70]=Ee,t[71]=Y):(J=t[69],Ee=t[70],Y=t[71]);let X;t[72]===q?X=t[73]:(X=(0,$.jsxs)(Ce,{value:q,variant:`outline`,size:`sm`,onValueChange:J,children:[Ee,Y]}),t[72]=q,t[73]=X);let De;t[74]!==K||t[75]!==X?(De=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[K,X]}),t[74]=K,t[75]=X,t[76]=De):De=t[76];let Oe;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=Oe):Oe=t[77];let ke;t[78]===F?ke=t[79]:(ke=e=>F(e.currentTarget.value),t[78]=F,t[79]=ke);let Ae;t[80]===i.name?Ae=t[81]:(Ae=i.name.trim().length===0||void 0,t[80]=i.name,t[81]=Ae);let je;t[82]!==i.name||t[83]!==ke||t[84]!==Ae?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Oe,(0,$.jsx)(M,{value:i.name,nativeInput:!0,onChange:ke,"aria-invalid":Ae})]}),t[82]=i.name,t[83]=ke,t[84]=Ae,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=i.description??``,Pe;t[87]===re?Pe=t[88]:(Pe=e=>re(e.currentTarget.value),t[87]=re,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(M,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==ae||t[96]!==L||t[97]!==R||t[98]!==C||t[99]!==v||t[100]!==l||t[101]!==pe||t[102]!==fe?(Le=l===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[at.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=fe[e]??``,n=R[e]??``,r=le(e);return r?(0,$.jsx)(vt,{token:e,kind:r,value:t,inherited:n,onChange:t=>L(e,t)},e):null})})]},e.title)),pe.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[pe.length,` token`,pe.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(u,{value:v,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>ae(e.currentTarget.value),"aria-invalid":C!==null||void 0}),C?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:C}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=ae,t[96]=L,t[97]=R,t[98]=C,t[99]=v,t[100]=l,t[101]=pe,t[102]=fe,t[103]=Le):Le=t[103];let Re;t[104]!==De||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[De,Ie,Le]}),t[104]=De,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(_,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(b,{children:[ze,(0,$.jsxs)(m,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(T,{render:(0,$.jsx)(r,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===s?He=t[113]:(He=(0,$.jsxs)(x,{children:[Ve,(0,$.jsx)(r,{variant:`destructive`,onClick:()=>{D(!1),s()},children:`Discard changes`})]}),t[112]=s,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(S,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==E||t[118]!==Ue?(We=(0,$.jsx)(h,{open:E,onOpenChange:D,children:Ue}),t[117]=E,t[118]=Ue,t[119]=We):We=t[119];let Ge;return t[120]!==xe||t[121]!==Re||t[122]!==We?(Ge=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[xe,Re,We]}),t[120]=xe,t[121]=Re,t[122]=We,t[123]=Ge):Ge=t[123],Ge}function ht(e){return Object.entries(e??{}).some(gt)}function gt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=le(t);return r?!B(r,n):!1}function _t(e){let[t]=e;return!ot.has(t)}function vt(e){let t=(0,Q.c)(12),{token:n,kind:r,value:i,inherited:o,onChange:s}=e,c=i.length>0,l=r===`font-family`&&`sm:col-span-2`,u;t[0]===l?u=t[1]:(u=a(`rounded-md border border-border/60 bg-background px-2 py-1.5`,l),t[0]=l,t[1]=u);let d;t[2]!==o||t[3]!==r||t[4]!==s||t[5]!==c||t[6]!==n||t[7]!==i?(d=r===`color`?(0,$.jsx)(xt,{token:n,value:i,inherited:o,overridden:c,onChange:s}):r===`opacity`?(0,$.jsx)(St,{token:n,value:i,inherited:o,overridden:c,onChange:s}):r===`length`?(0,$.jsx)(Ct,{token:n,value:i,inherited:o,overridden:c,onChange:s}):(0,$.jsx)(Tt,{token:n,value:i,inherited:o,overridden:c,onChange:s}),t[2]=o,t[3]=r,t[4]=s,t[5]=c,t[6]=n,t[7]=i,t[8]=d):d=t[8];let f;return t[9]!==u||t[10]!==d?(f=(0,$.jsx)(`div`,{className:u,children:d}),t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function yt(e){let t=(0,Q.c)(6),{token:n,onChange:a}=e,o=`Reset --${n}`,s;t[0]===a?s=t[1]:(s=()=>a(``),t[0]=a,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(i,{className:`size-3.5`,"aria-hidden":!0}),t[2]=c):c=t[2];let l;return t[3]!==o||t[4]!==s?(l=(0,$.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":o,onClick:s,className:`text-muted-foreground`,children:c}),t[3]=o,t[4]=s,t[5]=l):l=t[5],l}function bt(e){let t=(0,Q.c)(6),{token:n,overridden:r}=e,i=r?`text-foreground`:`text-muted-foreground/70`,o;t[0]===i?o=t[1]:(o=a(`truncate font-mono text-[11px]`,i),t[0]=i,t[1]=o);let s=`--${n}`,c;return t[2]!==o||t[3]!==s||t[4]!==n?(c=(0,$.jsxs)(`span`,{className:o,title:s,children:[`--`,n]}),t[2]=o,t[3]=s,t[4]=n,t[5]=c):c=t[5],c}function xt(e){let t=(0,Q.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=he(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!me(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=Ze,d=lt(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==a||t[20]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=v):v=t[21];let y=i||`inherit default`,b=l||void 0,x;t[22]===o?x=t[23]:(x=e=>o(e.currentTarget.value),t[22]=o,t[23]=x);let S;t[24]!==b||t[25]!==x||t[26]!==y||t[27]!==r?(S=(0,$.jsx)(M,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:y,"aria-invalid":b,onChange:x}),t[24]=b,t[25]=x,t[26]=y,t[27]=r,t[28]=S):S=t[28];let C;t[29]!==S||t[30]!==v?(C=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[v,S]}),t[29]=S,t[30]=v,t[31]=C):C=t[31];let w;t[32]!==o||t[33]!==a||t[34]!==n?(w=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=w):w=t[35];let T;return t[36]!==C||t[37]!==w||t[38]!==f||t[39]!==_?(T=(0,$.jsxs)(`div`,{className:f,children:[_,C,w]}),t[36]=C,t[37]=w,t[38]=f,t[39]=_,t[40]=T):T=t[40],T}function St(e){let t=(0,Q.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!B(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(bt,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,v;t[13]===o?v=t[14]:(v=e=>o(e.currentTarget.value),t[13]=o,t[14]=v);let y;t[15]!==g||t[16]!==_||t[17]!==v||t[18]!==r?(y=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:v})}),t[15]=g,t[16]=_,t[17]=v,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==o||t[21]!==a||t[22]!==n?(b=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=b):b=t[23];let x;t[24]!==y||t[25]!==b||t[26]!==h?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,y,b]}),t[24]=y,t[25]=b,t[26]=h,t[27]=x):x=t[27];let S;return t[28]!==x||t[29]!==f?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,x]}),t[28]=x,t[29]=f,t[30]=S):S=t[30],S}function Ct(e){let t=(0,Q.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=R(r),c=R(i);let e=c?pt(c.unit):!1,f=l?pt(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!B(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(bt,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&pt(l.unit)?l.unit:c&&pt(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,v;t[39]!==a||t[40]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=v):v=t[41];let y=n===`font-size-base`?1:.05,b;t[42]===h?b=t[43]:(b=e=>h(e.currentTarget.value),t[42]=h,t[43]=b);let x;t[44]!==p||t[45]!==s||t[46]!==y||t[47]!==b?(x=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:s,nativeInput:!0,type:`number`,step:y,size:`sm`,placeholder:p,onChange:b})}),t[44]=p,t[45]=s,t[46]=y,t[47]=b,t[48]=x):x=t[48];let S;t[49]===_?S=t[50]:(S=e=>_(e.currentTarget.value),t[49]=_,t[50]=S);let C=`--${n} unit`,w;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(w=V.map(wt),t[51]=w):w=t[51];let T;t[52]!==C||t[53]!==S||t[54]!==f?(T=(0,$.jsx)(`select`,{value:f,onChange:S,"aria-label":C,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:w}),t[52]=C,t[53]=S,t[54]=f,t[55]=T):T=t[55];let E;t[56]!==o||t[57]!==a||t[58]!==n?(E=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=E):E=t[59];let D;t[60]!==T||t[61]!==E||t[62]!==x?(D=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,T,E]}),t[60]=T,t[61]=E,t[62]=x,t[63]=D):D=t[63];let O;return t[64]!==D||t[65]!==v?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[v,D]}),t[64]=D,t[65]=v,t[66]=O):O=t[66],O}function wt(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function Tt(e){let t=(0,Q.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!B(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(bt,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let v;t[19]!==g||t[20]!==_?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}var Et=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Dt={default:1,light:.92,medium:.84,high:.78,glass:.72};function Ot({surface:e=`node`}={}){let t=e===`hub`,{theme:i,setTheme:o,resolvedTheme:c,activeThemeId:l,setActiveTheme:u}=U(),[d,f]=(0,Z.useState)(null),[v,E]=(0,Z.useState)(null),[D,te]=(0,Z.useState)(null),[M,I]=(0,Z.useState)(()=>L()),[ce,le]=(0,Z.useState)(0),R=(0,Z.useRef)(null),me=be(),z=(0,Z.useMemo)(()=>d!==null&&v!==null?{source:fe(d),draft:v}:null,[v,d,ce]),he=D?fe(D):null,B=(0,Z.useCallback)(()=>le(e=>e+1),[]);(0,Z.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&I(L())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let ye=(0,Z.useCallback)((e,t)=>{F(e,t),ae(),I(L())},[]),V=(0,Z.useCallback)(e=>{se(e),ae(),I(L())},[]),xe=(0,Z.useCallback)(()=>{se(`primaryColorMode`),se(`primaryColor`),ae(),I(L())},[]),W=(0,Z.useCallback)(e=>{F(`primaryColorMode`,e?`custom`:`theme`),ae(),I(L())},[]),Ce=(0,Z.useCallback)(e=>{F(`primaryColor`,e),F(`primaryColorMode`,`custom`),ae(),I(L())},[]),we=(0,Z.useCallback)(e=>{if(pe(e.id)){let t=H(e);ge(t),Se(t.id),u(t.id),f(t.id),E(t),B();return}u(e.id),f(e.id),E(e)},[B,u]),Te=(0,Z.useCallback)(e=>{let t=H(e);ge(t),u(t.id),f(t.id),E(t),B()},[B,u]),Y=(0,Z.useCallback)(()=>{let e={id:_e(`new`),name:`New theme`,builtIn:!1};ge(e),u(e.id),f(e.id),E(e),B()},[B,u]),De=(0,Z.useCallback)(()=>{z&&(de(z.source.id,z.draft),z.source.id===z.draft.id?ue(z.draft):u(z.draft.id),f(null),E(null),B())},[z,B,u]),ke=(0,Z.useCallback)(()=>{z&&ue(z.source),f(null),E(null)},[z]),je=(0,Z.useCallback)(()=>{D&&(d===D&&(f(null),E(null)),ve(D),te(null),B())},[d,D,B]),Ne=(0,Z.useCallback)(e=>{try{We(e)}catch(e){n.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Fe=(0,Z.useCallback)(async e=>{try{await Ue(e),n.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){n.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),Q=(0,Z.useCallback)(()=>{R.current?.click()},[]),Le=(0,Z.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Ge(t,{collision:`rename`,activate:!0});u(e.theme.id),B(),n.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){n.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[B,u]);return(0,$.jsxs)(K,{children:[(0,$.jsx)(G,{title:`Color mode`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-3 gap-3 p-4`,role:`group`,"aria-label":`Color mode`,children:Et.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":i===e.value,onClick:()=>o(e.value),className:a(`min-w-0 rounded-xl border p-2 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-ring`,i===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/30`),children:[(0,$.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg`,children:[(0,$.jsx)(nt,{compact:!0,theme:fe(l),variant:e.value===`dark`?`dark`:`light`}),e.value===`system`&&(0,$.jsx)(`div`,{className:`absolute inset-0 [clip-path:inset(0_0_0_50%)]`,children:(0,$.jsx)(nt,{compact:!0,theme:fe(l),variant:`dark`})})]}),(0,$.jsx)(`span`,{className:`mt-2 block font-medium`,children:e.label})]},e.value))})}),(0,$.jsx)(G,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:R,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Le,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(r,{size:`xs`,variant:`ghost`,onClick:Y,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ee,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(r,{size:`xs`,variant:`ghost`,onClick:Q,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ie,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,className:`grid grid-cols-2 gap-4 p-4`,children:me.map(e=>{let t=e.id===l,n=d===e.id;return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>u(e.id),onKeyDown:t=>{let n=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(n){t.preventDefault();let r=(me.findIndex(t=>t.id===e.id)+n+me.length)%me.length;u(me[r].id),(t.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.item(r).focus()}(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),u(e.id))},className:a(`flex cursor-pointer flex-wrap items-center gap-3 rounded-xl border p-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,t?`border-primary`:`border-border`,t?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(nt,{theme:e,variant:c}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:a(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,t?`border-primary`:`border-muted-foreground/40`),children:t?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,$.jsxs)(w,{children:[(0,$.jsx)(y,{render:(0,$.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Theme actions for ${e.name}`,children:(0,$.jsx)(A,{className:`size-4`})})}),(0,$.jsxs)(p,{align:`end`,children:[!e.builtIn&&(0,$.jsxs)(g,{onClick:()=>we(e),children:[(0,$.jsx)(C,{}),` Edit`]}),(0,$.jsxs)(g,{onClick:()=>Te(e),children:[(0,$.jsx)(s,{}),` Duplicate`]}),(0,$.jsxs)(g,{onClick:()=>Ne(e),children:[(0,$.jsx)(ee,{}),` Export`]}),(0,$.jsxs)(g,{onClick:()=>void Fe(e),children:[(0,$.jsx)(j,{}),` Copy JSON`]}),!e.builtIn&&(0,$.jsxs)(g,{onClick:()=>te(e.id),children:[(0,$.jsx)(k,{}),` Delete`]})]})]})})]}),n&&z?(0,$.jsx)(`div`,{className:`col-span-full`,children:(0,$.jsx)(mt,{source:z.source,draft:z.draft,onDraftChange:e=>E(e),onSave:De,onCancel:ke,resolvedVariant:c})}):null]},e.id)})})}),!t&&(0,$.jsx)(tt,{}),(0,$.jsxs)(G,{title:`Typography`,children:[(0,$.jsx)(q,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:N(`fontFamilySans`)?(0,$.jsx)(J,{label:`interface font`,onClick:()=>V(`fontFamilySans`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Interface font`,icon:(0,$.jsx)(Pe,{className:`size-3.5`}),options:P,value:M.fontFamilySans,sample:`The quick brown fox`,onChange:e=>ye(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(q,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:N(`fontFamilyMono`)?(0,$.jsx)(J,{label:`code font`,onClick:()=>V(`fontFamilyMono`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Code font`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:re,value:M.fontFamilyMono,sample:`const answer = 42`,onChange:e=>ye(`fontFamilyMono`,e)})}),(0,$.jsx)(q,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:N(`fontSizeBase`)?(0,$.jsx)(J,{label:`text size`,onClick:()=>V(`fontSizeBase`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Text size`,icon:(0,$.jsx)(X,{className:`size-3.5`}),options:ie,value:M.fontSizeBase,onChange:e=>ye(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:M.fontSizeBase},children:`Aa`})})})})]}),(0,$.jsxs)(G,{title:`Interface`,children:[t?null:(0,$.jsx)(q,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:N(`radius`)?(0,$.jsx)(J,{label:`corner radius`,onClick:()=>V(`radius`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Me,{className:`size-3.5`}),options:oe,value:M.radius,onChange:e=>ye(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:M.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:M.radius}})]})})}),(0,$.jsx)(q,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:N(`primaryColorMode`)||N(`primaryColor`)?(0,$.jsx)(J,{label:`primary color`,onClick:xe}):null,control:(0,$.jsx)(At,{mode:M.primaryColorMode,value:M.primaryColor,onModeChange:W,onColorChange:Ce})}),(0,$.jsx)(q,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:N(`surfaceTransparency`)?(0,$.jsx)(J,{label:`transparency`,onClick:()=>V(`surfaceTransparency`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Transparency`,icon:(0,$.jsx)(Ae,{className:`size-3.5`}),options:ne,value:M.surfaceTransparency,onChange:e=>ye(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:Dt[M.surfaceTransparency]??Dt.default}})})})})]}),(0,$.jsx)(h,{open:D!==null,onOpenChange:e=>{e||te(null)},children:(0,$.jsxs)(S,{children:[(0,$.jsxs)(b,{children:[(0,$.jsx)(_,{children:`Delete custom theme?`}),(0,$.jsx)(m,{children:he?`"${he.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(x,{children:[(0,$.jsx)(T,{render:(0,$.jsx)(r,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(r,{variant:`destructive`,onClick:je,children:`Delete theme`})]})]})})]})}function kt(e){let t=(0,Q.c)(43),{ariaLabel:n,icon:r,options:i,value:o,sample:s,onChange:c}=e,l;if(t[0]!==i||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=d?.value??o,m;t[7]===p?m=t[8]:(m={fontFamily:p},t[7]=p,t[8]=m);let h=d?.label??o,g;t[9]!==m||t[10]!==h?(g=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:m,children:h}),t[9]=m,t[10]=h,t[11]=g):g=t[11];let _=d?.description??`Custom`,v;t[12]===_?v=t[13]:(v=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:_}),t[12]=_,t[13]=v);let y;t[14]!==g||t[15]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==f||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,y]}),t[17]=f,t[18]=y,t[19]=b):b=t[19];let x=d?.value??o,S;t[20]===x?S=t[21]:(S={fontFamily:x},t[20]=x,t[21]=S);let C;t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:S,title:s,children:s}),t[22]=s,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C?(w=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[b,C]}),t[25]=b,t[26]=C,t[27]=w):w=t[27];let T;if(t[28]!==n||t[29]!==c||t[30]!==i||t[31]!==u){let e;t[33]!==n||t[34]!==c||t[35]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>c(e.value),className:a(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=c,t[35]=u,t[36]=e):e=t[36],T=i.map(e),t[28]=n,t[29]=c,t[30]=i,t[31]=u,t[32]=T}else T=t[32];let E;t[37]!==n||t[38]!==T?(E=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:T}),t[37]=n,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==w||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[w,E]}),t[40]=w,t[41]=E,t[42]=D):D=t[42],D}function At(e){let t=(0,Q.c)(48),{mode:n,value:r,onModeChange:i,onColorChange:o}=e,s=n===`custom`,c;t[0]===r?c=t[1]:(c=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():I[0].value,t[0]=r,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=I.find(e=>e.value===l),t[2]=l,t[3]=u);let d=u,f=s&&!d?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,p=!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,m;t[4]!==f||t[5]!==p?(m=a(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,f,p),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h=m,g;t[7]===l?g=t[8]:(g=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:l}}),t[7]=l,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=_):_=t[9];let v;t[10]===l?v=t[11]:(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[_,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:l})]}),t[10]=l,t[11]=v);let y;t[12]!==g||t[13]!==v?(y=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[g,v]}),t[12]=g,t[13]=v,t[14]=y):y=t[14];let b=y,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(te,{className:`size-3.5`})}),t[15]=x):x=t[15];let S=s?d?.label??`Custom`:`Theme color`,C;t[16]===S?C=t[17]:(C=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:S}),t[16]=S,t[17]=C);let w=s?l:`Active palette`,T;t[18]===w?T=t[19]:(T=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:w}),t[18]=w,t[19]=T);let D;t[20]!==C||t[21]!==T?(D=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[x,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[C,T]})]}),t[20]=C,t[21]=T,t[22]=D):D=t[22];let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=O):O=t[23];let k=!s,A;t[24]===i?A=t[25]:(A=e=>i(!e),t[24]=i,t[25]=A);let j;t[26]!==k||t[27]!==A?(j=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[O,(0,$.jsx)(E,{checked:k,onCheckedChange:A,"aria-label":`Use theme primary color`})]}),t[26]=k,t[27]=A,t[28]=j):j=t[28];let ee;t[29]!==D||t[30]!==j?(ee=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[D,j]}),t[29]=D,t[30]=j,t[31]=ee):ee=t[31];let M;t[32]!==s||t[33]!==l||t[34]!==o?(M=I.map(e=>{let t=l===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":s&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>o(e.value),disabled:!s,className:a(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,s&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=s,t[33]=l,t[34]=o,t[35]=M):M=t[35];let N;t[36]!==s||t[37]!==h||t[38]!==b||t[39]!==l||t[40]!==o?(N=s?(0,$.jsx)(Ze,{value:l,onChange:o,ariaLabel:`Pick custom primary color`,triggerClassName:h,children:b}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:h,children:b}),t[36]=s,t[37]=h,t[38]=b,t[39]=l,t[40]=o,t[41]=N):N=t[41];let P;t[42]!==M||t[43]!==N?(P=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[M,N]}),t[42]=M,t[43]=N,t[44]=P):P=t[44];let F;return t[45]!==ee||t[46]!==P?(F=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[ee,P]}),t[45]=ee,t[46]=P,t[47]=F):F=t[47],F}function jt(e){let t=(0,Q.c)(50),{ariaLabel:n,icon:r,options:i,value:o,onChange:s,preview:c}=e,l;if(t[0]!==i||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f=i.length>1?u/(i.length-1)*100:0,p;t[5]===r?p=t[6]:(p=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=p);let m=d?.label??o,h;t[7]===m?h=t[8]:(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:m}),t[7]=m,t[8]=h);let g=d?.description??o,_;t[9]===g?_=t[10]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:g}),t[9]=g,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==p||t[15]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[p,v]}),t[14]=p,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==c||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,c]}),t[17]=c,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=a(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=x):x=t[20];let S=Math.max(0,i.length-1),C=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,w;t[21]===C?w=t[22]:(w={background:C,borderRadius:`999px`},t[21]=C,t[22]=w);let T;t[23]!==s||t[24]!==i?(T=e=>{let t=i[Number(e.currentTarget.value)];t&&s(t.value)},t[23]=s,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==n||t[27]!==u||t[28]!==S||t[29]!==w||t[30]!==T?(E=(0,$.jsx)(`input`,{"aria-label":n,className:x,max:S,min:0,step:1,type:`range`,value:u,style:w,onChange:T}),t[26]=n,t[27]=u,t[28]=S,t[29]=w,t[30]=T,t[31]=E):E=t[31];let D=`repeat(${i.length}, minmax(0, 1fr))`,O;t[32]===D?O=t[33]:(O={gridTemplateColumns:D},t[32]=D,t[33]=O);let k;if(t[34]!==n||t[35]!==s||t[36]!==i||t[37]!==u){let e;t[39]!==n||t[40]!==s||t[41]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>s(e.value),className:a(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:a(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=s,t[41]=u,t[42]=e):e=t[42],k=i.map(e),t[34]=n,t[35]=s,t[36]=i,t[37]=u,t[38]=k}else k=t[38];let A;t[43]!==O||t[44]!==k?(A=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:O,children:k}),t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==E||t[47]!==A||t[48]!==b?(j=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[b,E,A]}),t[46]=E,t[47]=A,t[48]=b,t[49]=j):j=t[49],j}export{Ot as AppearanceSettingsPanel};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$l as t,Kr as n,Qr as r,ao as i,ei as a,ho as o,lo as s,mo as c}from"./runtime-OM-uAtaj.js";import{t as l}from"./react-CwJFpaho.js";import{Ct as u,Dt as d,Et as f,Ft as p,J as m,K as h,Pt as g,Q as _,Tt as v,Ut as y,X as b,Y as x,Z as S,gr as C,jt as w,q as T,t as E}from"./switch-D9inWKdd.js";import{t as D}from"./compiler-runtime-C4g8XhC5.js";import{t as O}from"./badge-BswOCwph.js";import{J as k,Q as A}from"./ContextHandoffEndpointLabel-BzI4Wi1i.js";import{t as j}from"./clipboard-copy-oDSkUUg4.js";import{t as ee}from"./download-CHdS3R_v.js";import{t as te}from"./palette-gaqgtube.js";import{t as M}from"./input-CzU08wbL.js";import{_ as N,a as P,b as F,f as ne,i as re,l as I,m as L,o as ie,p as ae,u as oe,y as se}from"./appearancePreferences-nFx4MHoI.js";import{C as ce,S as le,_ as R,a as ue,b as de,c as fe,d as pe,f as me,g as z,h as he,i as ge,l as _e,m as B,o as ve,p as ye,r as V,s as H,t as U,u as be,v as xe,x as W,y as Se}from"./useTheme-B441xg4F.js";import{n as Ce,r as we,t as Te}from"./toggle-group-YNqzWsK0.js";import{i as G,n as K,r as q,t as J}from"./settingsLayout-BbjDM-p0.js";import{ut as Ee}from"./main-RFllWEko.js";var Y={name:`baseline`,size:24,node:[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]};Y.node;var X=o(Y),De={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};De.node;var Oe=o(De),ke={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};ke.node;var Ae=o(ke),je={name:`radius`,size:24,node:[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};je.node;var Me=o(je),Ne={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ne.node;var Pe=o(Ne),Fe={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Fe.node;var Ie=o(Fe),Z=e(l(),1),Q=D(),Le=`.rycotheme.json`,Re=/[^a-z0-9-_]+/gi;function ze(e){let t=(e.name||e.id).trim().replace(Re,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Le}`}function Be(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Ve(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!ye(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function He(e,t=`rename`){let n=Ve(e);if(!be().find(e=>e.id===n.id))return ge(n),{theme:n,action:`added`};if(pe(n.id)||t===`rename`){let e={...n,id:_e(n.id)};return ge(e),{theme:e,action:`renamed`}}return de(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ue(e){let t=Be(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function We(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Be(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ze(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Ge(e,t={}){let n=He(await e.text(),t.collision??`rename`);return t.activate&&(Se(n.theme.id),ue(n.theme)),n}var $=t();function Ke(e,t,n){return e<t?t:e>n?n:e}function qe(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Je({r:e,g:t,b:n}){let r=e=>Ke(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function Ye({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Xe({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function Ze(e){let t=(0,Q.c)(71),{value:n,onChange:r,children:i,side:o,align:s,ariaLabel:c,triggerClassName:l}=e,u=o===void 0?`bottom`:o,p=s===void 0?`start`:s,m;t[0]===n?m=t[1]:(m=()=>{let e=qe(n);return e?Ye(e):{h:0,s:0,v:0}},t[0]=n,t[1]=m);let[h,g]=(0,Z.useState)(m),[_,y]=(0,Z.useState)(n),[b,x]=(0,Z.useState)(!1),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w=(0,Z.useRef)(r),T=(0,Z.useRef)(h.h),E;t[2]===r?E=t[3]:(E=()=>{w.current=r},t[2]=r,t[3]=E),(0,Z.useEffect)(E);let D,O;t[4]===h.h?(D=t[5],O=t[6]):(D=()=>{T.current=h.h},O=[h.h],t[4]=h.h,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{if(S.current=null,C.current===null)return;let e=C.current;C.current=null,w.current(e)},t[7]=k):k=t[7];let A=k,j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{C.current=e,S.current===null&&(S.current=requestAnimationFrame(A))},t[8]=j):j=t[8];let ee=j,te,N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>()=>{if(S.current!==null&&(cancelAnimationFrame(S.current),S.current=null),C.current!==null){let e=C.current;C.current=null,w.current(e)}},te=[],t[9]=te,t[10]=N):(te=t[9],N=t[10]),(0,Z.useEffect)(N,te);let P;t[11]===h?P=t[12]:(P=Je(Xe(h)),t[11]=h,t[12]=P);let F=P,ne,re;t[13]!==F||t[14]!==n?(ne=()=>{if(n.toLowerCase()===F.toLowerCase())return;let e=qe(n);if(!e)return;let t=Ye(e);g(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),y(n)},re=[n,F],t[13]=F,t[14]=n,t[15]=ne,t[16]=re):(ne=t[15],re=t[16]),(0,Z.useEffect)(ne,re);let I=(0,Z.useRef)(null),L;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{let t=I.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=Ke(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;g(e=>{let t={h:e.h,s:a,v:o},n=Je(Xe(t));return y(n),C.current=n,S.current===null&&(S.current=requestAnimationFrame(A)),t})},t[17]=L):L=t[17];let ie=L,ae;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ie(e)},t[18]=ae):ae=t[18];let oe=ae,se;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ie(e)},t[19]=se):se=t[19];let ce=se,le=(0,Z.useRef)(null),R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{let t=le.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;g(e=>{let t={h:i,s:e.s,v:e.v},n=Je(Xe(t));return y(n),C.current=n,S.current===null&&(S.current=requestAnimationFrame(A)),t})},t[20]=R):R=t[20];let ue=R,de;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ue(e)},t[21]=de):de=t[21];let fe=de,pe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ue(e)},t[22]=pe):pe=t[22];let me=pe,z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{y(e);let t=qe(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=Ye(t),r={h:n.s===0?T.current:n.h,s:n.s,v:n.v};g(r),ee(Je(t))},t[23]=z):z=t[23];let he=z,ge=`${h.h/360*100}%`,_e=`${h.s*100}%`,B=`${(1-h.v)*100}%`,ve=`hsl(${h.h} 100% 50%)`,ye;t[24]===l?ye=t[25]:(ye=a(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,l),t[24]=l,t[25]=ye);let V;t[26]!==c||t[27]!==i||t[28]!==ye?(V=(0,$.jsx)(d,{"aria-label":c,className:ye,children:i}),t[26]=c,t[27]=i,t[28]=ye,t[29]=V):V=t[29];let H;t[30]===h.s?H=t[31]:(H=Math.round(h.s*100),t[30]=h.s,t[31]=H);let U;t[32]===ve?U=t[33]:(U={backgroundColor:ve},t[32]=ve,t[33]=U);let be;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=be):be=t[34];let xe;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=xe):xe=t[35];let W;t[36]!==_e||t[37]!==B?(W=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:_e,top:B}}),t[36]=_e,t[37]=B,t[38]=W):W=t[38];let Se;t[39]!==H||t[40]!==U||t[41]!==W?(Se=(0,$.jsxs)(`div`,{ref:I,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:U,onPointerDown:oe,onPointerMove:ce,children:[be,xe,W]}),t[39]=H,t[40]=U,t[41]=W,t[42]=Se):Se=t[42];let Ce;t[43]===h.h?Ce=t[44]:(Ce=Math.round(h.h),t[43]=h.h,t[44]=Ce);let we;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(we={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=we):we=t[45];let Te;t[46]===ge?Te=t[47]:(Te=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:ge}}),t[46]=ge,t[47]=Te);let G;t[48]!==Ce||t[49]!==Te?(G=(0,$.jsx)(`div`,{ref:le,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Ce,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:we,onPointerDown:fe,onPointerMove:me,children:Te}),t[48]=Ce,t[49]=Te,t[50]=G):G=t[50];let K;t[51]===F?K=t[52]:(K=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:F}}),t[51]=F,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>he(e.currentTarget.value),t[53]=q):q=t[53];let J;t[54]===_?J=t[55]:(J=(0,$.jsx)(M,{value:_,size:`sm`,nativeInput:!0,onChange:q,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=_,t[55]=J);let Ee;t[56]!==K||t[57]!==J?(Ee=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,J]}),t[56]=K,t[57]=J,t[58]=Ee):Ee=t[58];let Y;t[59]!==Se||t[60]!==G||t[61]!==Ee?(Y=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Se,G,Ee]}),t[59]=Se,t[60]=G,t[61]=Ee,t[62]=Y):Y=t[62];let X;t[63]!==p||t[64]!==u||t[65]!==Y?(X=(0,$.jsx)(f,{side:u,align:p,className:`w-64`,children:Y}),t[63]=p,t[64]=u,t[65]=Y,t[66]=X):X=t[66];let De;return t[67]!==b||t[68]!==V||t[69]!==X?(De=(0,$.jsxs)(v,{open:b,onOpenChange:x,children:[V,X]}),t[67]=b,t[68]=V,t[69]=X,t[70]=De):De=t[70],De}var Qe=[{value:`stacked`,label:`Unified`,description:`Removed and added lines together in one column.`},{value:`split`,label:`Split`,description:`Compare the original and updated code side by side.`}];function $e(e){let t=(0,Q.c)(16),{number:n,kind:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r?{backgroundColor:`color-mix(in srgb, var(--background) 92%, var(--${r===`added`?`success`:`destructive`}))`}:void 0,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`w-7 shrink-0 select-none text-center text-muted-foreground/60`,children:n}),t[2]=n,t[3]=o);let s=r===`added`?`var(--success)`:`var(--destructive)`,c;t[4]===s?c=t[5]:(c={color:s},t[4]=s,t[5]=c);let l=r===`added`?`+`:r===`removed`?`−`:` `,u;t[6]!==c||t[7]!==l?(u=(0,$.jsx)(`span`,{className:`w-4 shrink-0`,style:c,children:l}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=(0,$.jsx)(`span`,{children:i}),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==o||t[13]!==u||t[14]!==d?(f=(0,$.jsxs)(`div`,{className:`flex whitespace-pre leading-6`,style:a,children:[o,u,d]}),t[11]=a,t[12]=o,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function et(e){let t=(0,Q.c)(10),{layout:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{children:`greeting.ts`}),i=(0,$.jsx)(`span`,{className:`text-success`,children:`+1`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex justify-between border-b border-border bg-muted/30 px-3 py-2`,children:[r,(0,$.jsxs)(`span`,{children:[i,` `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`−1`})]})]}),t[2]=o):o=t[2];let s=n===`split`&&`grid grid-cols-2 divide-x divide-border`,c;t[3]===s?c=t[4]:(c=a(`min-h-32 py-3`,s),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=n===`split`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:3,children:``})]}),(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]}),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==l?(u=(0,$.jsxs)(`div`,{"aria-hidden":`true`,className:`overflow-hidden rounded-lg border border-border bg-background text-left font-mono text-[10px] text-foreground`,children:[o,(0,$.jsx)(`div`,{className:c,children:l})]}),t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function tt(){let e=(0,Q.c)(6),[t,n]=we(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`p`,{className:`px-4 pt-4 text-xs text-muted-foreground`,children:`Choose how code changes appear in the diff viewer. You can also switch from its toolbar.`}),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=Qe.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.value,"aria-label":`${e.label} diff style`,onClick:()=>n(e.value),className:a(`min-w-0 rounded-xl border p-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring`,t===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/20`),children:[(0,$.jsx)(et,{layout:e.value}),(0,$.jsxs)(`span`,{className:`mt-3 flex items-center justify-between text-sm font-medium`,children:[e.label,t===e.value&&(0,$.jsx)(c,{"aria-hidden":`true`,className:`size-4`})]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]},e.value)),e[1]=t,e[2]=n,e[3]=i):i=e[3];let o;return e[4]===i?o=e[5]:(o=(0,$.jsxs)(G,{title:`Diff style`,children:[r,(0,$.jsx)(`div`,{role:`group`,"aria-label":`Diff style`,className:`grid gap-4 p-4 lg:grid-cols-2`,children:i})]}),e[4]=i,e[5]=o),o}function nt(e){let t=(0,Q.c)(22),{theme:n,variant:r,compact:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=Object.fromEntries(Object.entries(z(xe(n,r))).map(it)),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex w-[26%] flex-col gap-2 border-r border-[var(--sidebar-border)] bg-[var(--sidebar)] p-[4%]`,children:[(0,$.jsx)(`span`,{className:`font-semibold`,children:`Ryco`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),(0,$.jsx)(`span`,{className:`h-3 rounded bg-[var(--sidebar-accent)]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded bg-[var(--muted-foreground)] opacity-25`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-25`})]}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l=a?(0,$.jsx)(`div`,{className:`h-3 w-2/3 shrink-0 self-end rounded bg-[var(--secondary)]`}):(0,$.jsx)(`div`,{className:`self-end rounded bg-[var(--secondary)] px-2 py-1`,children:`Build something great`}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),t[6]=u):u=t[6];let d;t[7]===a?d=t[8]:(d=a?(0,$.jsx)(`div`,{className:`h-1.5 w-2/3 rounded bg-[var(--muted-foreground)] opacity-25`}):(0,$.jsxs)(`div`,{className:`rounded border border-[var(--border)] bg-[var(--card)] p-2 font-mono`,children:[(0,$.jsx)(`span`,{style:{color:`var(--info)`},children:`const `}),`theme =`,` `,(0,$.jsx)(`span`,{style:{color:`var(--success)`},children:`"ryco"`}),`;`,(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`// Make it yours`})]}),t[7]=a,t[8]=d);let f;t[9]===a?f=t[10]:(f=a?(0,$.jsx)(`span`,{className:`h-1 w-1/2 rounded bg-[var(--muted-foreground)] opacity-30`}):(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`Ask anything…`}),t[9]=a,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`size-3 rounded-full bg-[var(--primary)]`}),t[11]=p):p=t[11];let m;t[12]===f?m=t[13]:(m=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center justify-between rounded-md border border-[var(--input)] px-2 py-1.5`,children:[f,p]}),t[12]=f,t[13]=m);let h;t[14]!==l||t[15]!==d||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`flex aspect-[16/9] text-[9px] leading-relaxed`,children:[c,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 p-[4%]`,children:[l,u,d,m]})]}),t[14]=l,t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`flex h-2`,children:[`sidebar`,`background`,`primary`,`info`,`success`,`warning`,`destructive`].map(rt)}),t[18]=g):g=t[18];let _;return t[19]!==s||t[20]!==h?(_=(0,$.jsxs)(`div`,{"aria-hidden":`true`,style:s,className:`w-full overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]`,children:[h,g]}),t[19]=s,t[20]=h,t[21]=_):_=t[21],_}function rt(e){return(0,$.jsx)(`span`,{className:`flex-1`,style:{backgroundColor:`var(--${e})`}},e)}function it(e){let[t,n]=e;return[`--${t}`,n]}var at=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],ot=new Set(W),st=null,ct=null;function lt(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;st||(st=document.createElement(`div`),st.style.position=`absolute`,st.style.visibility=`hidden`,st.style.pointerEvents=`none`,document.body.append(st)),st.style.color=``,st.style.color=e;let t=getComputedStyle(st).color;ct||=document.createElement(`canvas`),ct.width=1,ct.height=1;let n=ct.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function ut(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function dt(e,t){return{...e,name:t}}function ft(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function pt(e){return V.includes(e)}function mt(e){let t=(0,Q.c)(124),{source:n,draft:i,onDraftChange:a,onSave:o,onCancel:s,resolvedVariant:c}=e,[l,d]=(0,Z.useState)(`form`),[f,p]=(0,Z.useState)(c),g;t[0]===i?g=t[1]:(g=()=>JSON.stringify(i,null,2),t[0]=i,t[1]=g);let[v,y]=(0,Z.useState)(g),[C,w]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(!1),O;t[2]===n?O=t[3]:(O=JSON.stringify(n),t[2]=n,t[3]=O);let k;t[4]===i?k=t[5]:(k=JSON.stringify(i),t[4]=i,t[5]=k);let A=O!==k,j;t[6]===i?j=t[7]:(j=()=>{ue(i)},t[6]=i,t[7]=j);let ee;t[8]!==i||t[9]!==c?(ee=[i,c],t[8]=i,t[9]=c,t[10]=ee):ee=t[10],(0,Z.useEffect)(j,ee);let te,N;t[11]!==i||t[12]!==l?(te=()=>{l===`form`&&y(JSON.stringify(i,null,2))},N=[i,l],t[11]=i,t[12]=l,t[13]=te,t[14]=N):(te=t[13],N=t[14]),(0,Z.useEffect)(te,N);let P;t[15]!==i||t[16]!==a?(P=e=>{a(dt(i,e))},t[15]=i,t[16]=a,t[17]=P):P=t[17];let F=P,ne;t[18]!==i||t[19]!==a?(ne=e=>{a(ft(i,e))},t[18]=i,t[19]=a,t[20]=ne):ne=t[20];let re=ne,I;t[21]!==i||t[22]!==a||t[23]!==f?(I=(e,t)=>{a(ut(i,f,e,t))},t[21]=i,t[22]=a,t[23]=f,t[24]=I):I=t[24];let L=I,ie;t[25]===a?ie=t[26]:(ie=e=>{y(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;w(t instanceof Error?t.message:`Invalid JSON`);return}if(!ye(t)){w(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}w(null),a(t)},t[25]=a,t[26]=ie);let ae=ie,oe;t[27]!==A||t[28]!==s?(oe=()=>{if(A){D(!0);return}s()},t[27]=A,t[28]=s,t[29]=oe):oe=t[29];let se=oe,R,de,fe;if(t[30]!==i.dark||t[31]!==i.light||t[32]!==f){fe=(f===`dark`?i.dark:i.light)??{};let e;t[36]===f?e=t[37]:(e=(f===`dark`?ce.dark:ce.light)??{},t[36]=f,t[37]=e),R=e,de=Object.entries(fe).filter(_t),t[30]=i.dark,t[31]=i.light,t[32]=f,t[33]=R,t[34]=de,t[35]=fe}else R=t[33],de=t[34],fe=t[35];let pe=de,me=ht,z=me(i.light)||me(i.dark),he;t[38]!==i.name||t[39]!==z||t[40]!==C?(he=C!==null||i.name.trim().length===0||z,t[38]=i.name,t[39]=z,t[40]=C,t[41]=he):he=t[41];let ge=he,_e;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=_e):_e=t[42];let B=i.name||`Untitled`,ve;t[43]!==i.name||t[44]!==B?(ve=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:i.name,children:B}),t[43]=i.name,t[44]=B,t[45]=ve):ve=t[45];let V;t[46]===A?V=t[47]:(V=A?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=A,t[47]=V);let H;t[48]===se?H=t[49]:(H=(0,$.jsx)(r,{size:`sm`,variant:`outline`,onClick:se,children:`Cancel`}),t[48]=se,t[49]=H);let U;t[50]!==o||t[51]!==ge?(U=(0,$.jsx)(r,{size:`sm`,onClick:o,disabled:ge,children:`Save`}),t[50]=o,t[51]=ge,t[52]=U):U=t[52];let be;t[53]!==H||t[54]!==U?(be=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[H,U]}),t[53]=H,t[54]=U,t[55]=be):be=t[55];let xe;t[56]!==ve||t[57]!==V||t[58]!==be?(xe=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[_e,ve,V,be]}),t[56]=ve,t[57]=V,t[58]=be,t[59]=xe):xe=t[59];let W;t[60]===l?W=t[61]:(W=[l],t[60]=l,t[61]=W);let Se,we,G;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{let t=e[0];(t===`form`||t===`json`)&&d(t)},we=(0,$.jsx)(Te,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),G=(0,$.jsx)(Te,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=Se,t[63]=we,t[64]=G):(Se=t[62],we=t[63],G=t[64]);let K;t[65]===W?K=t[66]:(K=(0,$.jsxs)(Ce,{value:W,variant:`outline`,size:`sm`,onValueChange:Se,children:[we,G]}),t[65]=W,t[66]=K);let q;t[67]===f?q=t[68]:(q=[f],t[67]=f,t[68]=q);let J,Ee,Y;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{let t=e[0];(t===`light`||t===`dark`)&&p(t)},Ee=(0,$.jsx)(Te,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),Y=(0,$.jsx)(Te,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=J,t[70]=Ee,t[71]=Y):(J=t[69],Ee=t[70],Y=t[71]);let X;t[72]===q?X=t[73]:(X=(0,$.jsxs)(Ce,{value:q,variant:`outline`,size:`sm`,onValueChange:J,children:[Ee,Y]}),t[72]=q,t[73]=X);let De;t[74]!==K||t[75]!==X?(De=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[K,X]}),t[74]=K,t[75]=X,t[76]=De):De=t[76];let Oe;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=Oe):Oe=t[77];let ke;t[78]===F?ke=t[79]:(ke=e=>F(e.currentTarget.value),t[78]=F,t[79]=ke);let Ae;t[80]===i.name?Ae=t[81]:(Ae=i.name.trim().length===0||void 0,t[80]=i.name,t[81]=Ae);let je;t[82]!==i.name||t[83]!==ke||t[84]!==Ae?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Oe,(0,$.jsx)(M,{value:i.name,nativeInput:!0,onChange:ke,"aria-invalid":Ae})]}),t[82]=i.name,t[83]=ke,t[84]=Ae,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=i.description??``,Pe;t[87]===re?Pe=t[88]:(Pe=e=>re(e.currentTarget.value),t[87]=re,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(M,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==ae||t[96]!==L||t[97]!==R||t[98]!==C||t[99]!==v||t[100]!==l||t[101]!==pe||t[102]!==fe?(Le=l===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[at.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=fe[e]??``,n=R[e]??``,r=le(e);return r?(0,$.jsx)(vt,{token:e,kind:r,value:t,inherited:n,onChange:t=>L(e,t)},e):null})})]},e.title)),pe.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[pe.length,` token`,pe.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(u,{value:v,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>ae(e.currentTarget.value),"aria-invalid":C!==null||void 0}),C?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:C}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=ae,t[96]=L,t[97]=R,t[98]=C,t[99]=v,t[100]=l,t[101]=pe,t[102]=fe,t[103]=Le):Le=t[103];let Re;t[104]!==De||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[De,Ie,Le]}),t[104]=De,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(_,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(b,{children:[ze,(0,$.jsxs)(m,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(T,{render:(0,$.jsx)(r,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===s?He=t[113]:(He=(0,$.jsxs)(x,{children:[Ve,(0,$.jsx)(r,{variant:`destructive`,onClick:()=>{D(!1),s()},children:`Discard changes`})]}),t[112]=s,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(S,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==E||t[118]!==Ue?(We=(0,$.jsx)(h,{open:E,onOpenChange:D,children:Ue}),t[117]=E,t[118]=Ue,t[119]=We):We=t[119];let Ge;return t[120]!==xe||t[121]!==Re||t[122]!==We?(Ge=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[xe,Re,We]}),t[120]=xe,t[121]=Re,t[122]=We,t[123]=Ge):Ge=t[123],Ge}function ht(e){return Object.entries(e??{}).some(gt)}function gt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=le(t);return r?!B(r,n):!1}function _t(e){let[t]=e;return!ot.has(t)}function vt(e){let t=(0,Q.c)(12),{token:n,kind:r,value:i,inherited:o,onChange:s}=e,c=i.length>0,l=r===`font-family`&&`sm:col-span-2`,u;t[0]===l?u=t[1]:(u=a(`rounded-md border border-border/60 bg-background px-2 py-1.5`,l),t[0]=l,t[1]=u);let d;t[2]!==o||t[3]!==r||t[4]!==s||t[5]!==c||t[6]!==n||t[7]!==i?(d=r===`color`?(0,$.jsx)(xt,{token:n,value:i,inherited:o,overridden:c,onChange:s}):r===`opacity`?(0,$.jsx)(St,{token:n,value:i,inherited:o,overridden:c,onChange:s}):r===`length`?(0,$.jsx)(Ct,{token:n,value:i,inherited:o,overridden:c,onChange:s}):(0,$.jsx)(Tt,{token:n,value:i,inherited:o,overridden:c,onChange:s}),t[2]=o,t[3]=r,t[4]=s,t[5]=c,t[6]=n,t[7]=i,t[8]=d):d=t[8];let f;return t[9]!==u||t[10]!==d?(f=(0,$.jsx)(`div`,{className:u,children:d}),t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function yt(e){let t=(0,Q.c)(6),{token:n,onChange:a}=e,o=`Reset --${n}`,s;t[0]===a?s=t[1]:(s=()=>a(``),t[0]=a,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(i,{className:`size-3.5`,"aria-hidden":!0}),t[2]=c):c=t[2];let l;return t[3]!==o||t[4]!==s?(l=(0,$.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":o,onClick:s,className:`text-muted-foreground`,children:c}),t[3]=o,t[4]=s,t[5]=l):l=t[5],l}function bt(e){let t=(0,Q.c)(6),{token:n,overridden:r}=e,i=r?`text-foreground`:`text-muted-foreground/70`,o;t[0]===i?o=t[1]:(o=a(`truncate font-mono text-[11px]`,i),t[0]=i,t[1]=o);let s=`--${n}`,c;return t[2]!==o||t[3]!==s||t[4]!==n?(c=(0,$.jsxs)(`span`,{className:o,title:s,children:[`--`,n]}),t[2]=o,t[3]=s,t[4]=n,t[5]=c):c=t[5],c}function xt(e){let t=(0,Q.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=he(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!me(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=Ze,d=lt(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==a||t[20]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=v):v=t[21];let y=i||`inherit default`,b=l||void 0,x;t[22]===o?x=t[23]:(x=e=>o(e.currentTarget.value),t[22]=o,t[23]=x);let S;t[24]!==b||t[25]!==x||t[26]!==y||t[27]!==r?(S=(0,$.jsx)(M,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:y,"aria-invalid":b,onChange:x}),t[24]=b,t[25]=x,t[26]=y,t[27]=r,t[28]=S):S=t[28];let C;t[29]!==S||t[30]!==v?(C=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[v,S]}),t[29]=S,t[30]=v,t[31]=C):C=t[31];let w;t[32]!==o||t[33]!==a||t[34]!==n?(w=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=w):w=t[35];let T;return t[36]!==C||t[37]!==w||t[38]!==f||t[39]!==_?(T=(0,$.jsxs)(`div`,{className:f,children:[_,C,w]}),t[36]=C,t[37]=w,t[38]=f,t[39]=_,t[40]=T):T=t[40],T}function St(e){let t=(0,Q.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!B(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(bt,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,v;t[13]===o?v=t[14]:(v=e=>o(e.currentTarget.value),t[13]=o,t[14]=v);let y;t[15]!==g||t[16]!==_||t[17]!==v||t[18]!==r?(y=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:v})}),t[15]=g,t[16]=_,t[17]=v,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==o||t[21]!==a||t[22]!==n?(b=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=b):b=t[23];let x;t[24]!==y||t[25]!==b||t[26]!==h?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,y,b]}),t[24]=y,t[25]=b,t[26]=h,t[27]=x):x=t[27];let S;return t[28]!==x||t[29]!==f?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,x]}),t[28]=x,t[29]=f,t[30]=S):S=t[30],S}function Ct(e){let t=(0,Q.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=R(r),c=R(i);let e=c?pt(c.unit):!1,f=l?pt(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!B(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(bt,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&pt(l.unit)?l.unit:c&&pt(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,v;t[39]!==a||t[40]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=v):v=t[41];let y=n===`font-size-base`?1:.05,b;t[42]===h?b=t[43]:(b=e=>h(e.currentTarget.value),t[42]=h,t[43]=b);let x;t[44]!==p||t[45]!==s||t[46]!==y||t[47]!==b?(x=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:s,nativeInput:!0,type:`number`,step:y,size:`sm`,placeholder:p,onChange:b})}),t[44]=p,t[45]=s,t[46]=y,t[47]=b,t[48]=x):x=t[48];let S;t[49]===_?S=t[50]:(S=e=>_(e.currentTarget.value),t[49]=_,t[50]=S);let C=`--${n} unit`,w;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(w=V.map(wt),t[51]=w):w=t[51];let T;t[52]!==C||t[53]!==S||t[54]!==f?(T=(0,$.jsx)(`select`,{value:f,onChange:S,"aria-label":C,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:w}),t[52]=C,t[53]=S,t[54]=f,t[55]=T):T=t[55];let E;t[56]!==o||t[57]!==a||t[58]!==n?(E=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=E):E=t[59];let D;t[60]!==T||t[61]!==E||t[62]!==x?(D=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,T,E]}),t[60]=T,t[61]=E,t[62]=x,t[63]=D):D=t[63];let O;return t[64]!==D||t[65]!==v?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[v,D]}),t[64]=D,t[65]=v,t[66]=O):O=t[66],O}function wt(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function Tt(e){let t=(0,Q.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!B(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(bt,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let v;t[19]!==g||t[20]!==_?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}var Et=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Dt={default:1,light:.92,medium:.84,high:.78,glass:.72};function Ot({surface:e=`node`}={}){let t=e===`hub`,{theme:i,setTheme:o,resolvedTheme:c,activeThemeId:l,setActiveTheme:u}=U(),[d,f]=(0,Z.useState)(null),[v,E]=(0,Z.useState)(null),[D,te]=(0,Z.useState)(null),[M,I]=(0,Z.useState)(()=>L()),[ce,le]=(0,Z.useState)(0),R=(0,Z.useRef)(null),me=be(),z=(0,Z.useMemo)(()=>d!==null&&v!==null?{source:fe(d),draft:v}:null,[v,d,ce]),he=D?fe(D):null,B=(0,Z.useCallback)(()=>le(e=>e+1),[]);(0,Z.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&I(L())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let ye=(0,Z.useCallback)((e,t)=>{F(e,t),ae(),I(L())},[]),V=(0,Z.useCallback)(e=>{se(e),ae(),I(L())},[]),xe=(0,Z.useCallback)(()=>{se(`primaryColorMode`),se(`primaryColor`),ae(),I(L())},[]),W=(0,Z.useCallback)(e=>{F(`primaryColorMode`,e?`custom`:`theme`),ae(),I(L())},[]),Ce=(0,Z.useCallback)(e=>{F(`primaryColor`,e),F(`primaryColorMode`,`custom`),ae(),I(L())},[]),we=(0,Z.useCallback)(e=>{if(pe(e.id)){let t=H(e);ge(t),Se(t.id),u(t.id),f(t.id),E(t),B();return}u(e.id),f(e.id),E(e)},[B,u]),Te=(0,Z.useCallback)(e=>{let t=H(e);ge(t),u(t.id),f(t.id),E(t),B()},[B,u]),Y=(0,Z.useCallback)(()=>{let e={id:_e(`new`),name:`New theme`,builtIn:!1};ge(e),u(e.id),f(e.id),E(e),B()},[B,u]),De=(0,Z.useCallback)(()=>{z&&(de(z.source.id,z.draft),z.source.id===z.draft.id?ue(z.draft):u(z.draft.id),f(null),E(null),B())},[z,B,u]),ke=(0,Z.useCallback)(()=>{z&&ue(z.source),f(null),E(null)},[z]),je=(0,Z.useCallback)(()=>{D&&(d===D&&(f(null),E(null)),ve(D),te(null),B())},[d,D,B]),Ne=(0,Z.useCallback)(e=>{try{We(e)}catch(e){n.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Fe=(0,Z.useCallback)(async e=>{try{await Ue(e),n.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){n.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),Q=(0,Z.useCallback)(()=>{R.current?.click()},[]),Le=(0,Z.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Ge(t,{collision:`rename`,activate:!0});u(e.theme.id),B(),n.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){n.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[B,u]);return(0,$.jsxs)(K,{children:[(0,$.jsx)(G,{title:`Color mode`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-3 gap-3 p-4`,role:`group`,"aria-label":`Color mode`,children:Et.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":i===e.value,onClick:()=>o(e.value),className:a(`min-w-0 rounded-xl border p-2 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-ring`,i===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/30`),children:[(0,$.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg`,children:[(0,$.jsx)(nt,{compact:!0,theme:fe(l),variant:e.value===`dark`?`dark`:`light`}),e.value===`system`&&(0,$.jsx)(`div`,{className:`absolute inset-0 [clip-path:inset(0_0_0_50%)]`,children:(0,$.jsx)(nt,{compact:!0,theme:fe(l),variant:`dark`})})]}),(0,$.jsx)(`span`,{className:`mt-2 block font-medium`,children:e.label})]},e.value))})}),(0,$.jsx)(G,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:R,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Le,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(r,{size:`xs`,variant:`ghost`,onClick:Y,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ee,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(r,{size:`xs`,variant:`ghost`,onClick:Q,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ie,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,className:`grid grid-cols-2 gap-4 p-4`,children:me.map(e=>{let t=e.id===l,n=d===e.id;return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>u(e.id),onKeyDown:t=>{let n=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(n){t.preventDefault();let r=(me.findIndex(t=>t.id===e.id)+n+me.length)%me.length;u(me[r].id),(t.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.item(r).focus()}(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),u(e.id))},className:a(`flex cursor-pointer flex-wrap items-center gap-3 rounded-xl border p-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,t?`border-primary`:`border-border`,t?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(nt,{theme:e,variant:c}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:a(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,t?`border-primary`:`border-muted-foreground/40`),children:t?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,$.jsxs)(w,{children:[(0,$.jsx)(y,{render:(0,$.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Theme actions for ${e.name}`,children:(0,$.jsx)(A,{className:`size-4`})})}),(0,$.jsxs)(p,{align:`end`,children:[!e.builtIn&&(0,$.jsxs)(g,{onClick:()=>we(e),children:[(0,$.jsx)(C,{}),` Edit`]}),(0,$.jsxs)(g,{onClick:()=>Te(e),children:[(0,$.jsx)(s,{}),` Duplicate`]}),(0,$.jsxs)(g,{onClick:()=>Ne(e),children:[(0,$.jsx)(ee,{}),` Export`]}),(0,$.jsxs)(g,{onClick:()=>void Fe(e),children:[(0,$.jsx)(j,{}),` Copy JSON`]}),!e.builtIn&&(0,$.jsxs)(g,{onClick:()=>te(e.id),children:[(0,$.jsx)(k,{}),` Delete`]})]})]})})]}),n&&z?(0,$.jsx)(`div`,{className:`col-span-full`,children:(0,$.jsx)(mt,{source:z.source,draft:z.draft,onDraftChange:e=>E(e),onSave:De,onCancel:ke,resolvedVariant:c})}):null]},e.id)})})}),!t&&(0,$.jsx)(tt,{}),(0,$.jsxs)(G,{title:`Typography`,children:[(0,$.jsx)(q,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:N(`fontFamilySans`)?(0,$.jsx)(J,{label:`interface font`,onClick:()=>V(`fontFamilySans`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Interface font`,icon:(0,$.jsx)(Pe,{className:`size-3.5`}),options:P,value:M.fontFamilySans,sample:`The quick brown fox`,onChange:e=>ye(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(q,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:N(`fontFamilyMono`)?(0,$.jsx)(J,{label:`code font`,onClick:()=>V(`fontFamilyMono`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Code font`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:re,value:M.fontFamilyMono,sample:`const answer = 42`,onChange:e=>ye(`fontFamilyMono`,e)})}),(0,$.jsx)(q,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:N(`fontSizeBase`)?(0,$.jsx)(J,{label:`text size`,onClick:()=>V(`fontSizeBase`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Text size`,icon:(0,$.jsx)(X,{className:`size-3.5`}),options:ie,value:M.fontSizeBase,onChange:e=>ye(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:M.fontSizeBase},children:`Aa`})})})})]}),(0,$.jsxs)(G,{title:`Interface`,children:[t?null:(0,$.jsx)(q,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:N(`radius`)?(0,$.jsx)(J,{label:`corner radius`,onClick:()=>V(`radius`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Me,{className:`size-3.5`}),options:oe,value:M.radius,onChange:e=>ye(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:M.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:M.radius}})]})})}),(0,$.jsx)(q,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:N(`primaryColorMode`)||N(`primaryColor`)?(0,$.jsx)(J,{label:`primary color`,onClick:xe}):null,control:(0,$.jsx)(At,{mode:M.primaryColorMode,value:M.primaryColor,onModeChange:W,onColorChange:Ce})}),(0,$.jsx)(q,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:N(`surfaceTransparency`)?(0,$.jsx)(J,{label:`transparency`,onClick:()=>V(`surfaceTransparency`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Transparency`,icon:(0,$.jsx)(Ae,{className:`size-3.5`}),options:ne,value:M.surfaceTransparency,onChange:e=>ye(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:Dt[M.surfaceTransparency]??Dt.default}})})})})]}),(0,$.jsx)(h,{open:D!==null,onOpenChange:e=>{e||te(null)},children:(0,$.jsxs)(S,{children:[(0,$.jsxs)(b,{children:[(0,$.jsx)(_,{children:`Delete custom theme?`}),(0,$.jsx)(m,{children:he?`"${he.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(x,{children:[(0,$.jsx)(T,{render:(0,$.jsx)(r,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(r,{variant:`destructive`,onClick:je,children:`Delete theme`})]})]})})]})}function kt(e){let t=(0,Q.c)(43),{ariaLabel:n,icon:r,options:i,value:o,sample:s,onChange:c}=e,l;if(t[0]!==i||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=d?.value??o,m;t[7]===p?m=t[8]:(m={fontFamily:p},t[7]=p,t[8]=m);let h=d?.label??o,g;t[9]!==m||t[10]!==h?(g=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:m,children:h}),t[9]=m,t[10]=h,t[11]=g):g=t[11];let _=d?.description??`Custom`,v;t[12]===_?v=t[13]:(v=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:_}),t[12]=_,t[13]=v);let y;t[14]!==g||t[15]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==f||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,y]}),t[17]=f,t[18]=y,t[19]=b):b=t[19];let x=d?.value??o,S;t[20]===x?S=t[21]:(S={fontFamily:x},t[20]=x,t[21]=S);let C;t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:S,title:s,children:s}),t[22]=s,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C?(w=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[b,C]}),t[25]=b,t[26]=C,t[27]=w):w=t[27];let T;if(t[28]!==n||t[29]!==c||t[30]!==i||t[31]!==u){let e;t[33]!==n||t[34]!==c||t[35]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>c(e.value),className:a(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=c,t[35]=u,t[36]=e):e=t[36],T=i.map(e),t[28]=n,t[29]=c,t[30]=i,t[31]=u,t[32]=T}else T=t[32];let E;t[37]!==n||t[38]!==T?(E=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:T}),t[37]=n,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==w||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[w,E]}),t[40]=w,t[41]=E,t[42]=D):D=t[42],D}function At(e){let t=(0,Q.c)(48),{mode:n,value:r,onModeChange:i,onColorChange:o}=e,s=n===`custom`,c;t[0]===r?c=t[1]:(c=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():I[0].value,t[0]=r,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=I.find(e=>e.value===l),t[2]=l,t[3]=u);let d=u,f=s&&!d?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,p=!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,m;t[4]!==f||t[5]!==p?(m=a(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,f,p),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h=m,g;t[7]===l?g=t[8]:(g=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:l}}),t[7]=l,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=_):_=t[9];let v;t[10]===l?v=t[11]:(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[_,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:l})]}),t[10]=l,t[11]=v);let y;t[12]!==g||t[13]!==v?(y=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[g,v]}),t[12]=g,t[13]=v,t[14]=y):y=t[14];let b=y,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(te,{className:`size-3.5`})}),t[15]=x):x=t[15];let S=s?d?.label??`Custom`:`Theme color`,C;t[16]===S?C=t[17]:(C=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:S}),t[16]=S,t[17]=C);let w=s?l:`Active palette`,T;t[18]===w?T=t[19]:(T=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:w}),t[18]=w,t[19]=T);let D;t[20]!==C||t[21]!==T?(D=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[x,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[C,T]})]}),t[20]=C,t[21]=T,t[22]=D):D=t[22];let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=O):O=t[23];let k=!s,A;t[24]===i?A=t[25]:(A=e=>i(!e),t[24]=i,t[25]=A);let j;t[26]!==k||t[27]!==A?(j=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[O,(0,$.jsx)(E,{checked:k,onCheckedChange:A,"aria-label":`Use theme primary color`})]}),t[26]=k,t[27]=A,t[28]=j):j=t[28];let ee;t[29]!==D||t[30]!==j?(ee=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[D,j]}),t[29]=D,t[30]=j,t[31]=ee):ee=t[31];let M;t[32]!==s||t[33]!==l||t[34]!==o?(M=I.map(e=>{let t=l===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":s&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>o(e.value),disabled:!s,className:a(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,s&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!s&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=s,t[33]=l,t[34]=o,t[35]=M):M=t[35];let N;t[36]!==s||t[37]!==h||t[38]!==b||t[39]!==l||t[40]!==o?(N=s?(0,$.jsx)(Ze,{value:l,onChange:o,ariaLabel:`Pick custom primary color`,triggerClassName:h,children:b}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:h,children:b}),t[36]=s,t[37]=h,t[38]=b,t[39]=l,t[40]=o,t[41]=N):N=t[41];let P;t[42]!==M||t[43]!==N?(P=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[M,N]}),t[42]=M,t[43]=N,t[44]=P):P=t[44];let F;return t[45]!==ee||t[46]!==P?(F=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[ee,P]}),t[45]=ee,t[46]=P,t[47]=F):F=t[47],F}function jt(e){let t=(0,Q.c)(50),{ariaLabel:n,icon:r,options:i,value:o,onChange:s,preview:c}=e,l;if(t[0]!==i||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.value===o,t[3]=o,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=o,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f=i.length>1?u/(i.length-1)*100:0,p;t[5]===r?p=t[6]:(p=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=p);let m=d?.label??o,h;t[7]===m?h=t[8]:(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:m}),t[7]=m,t[8]=h);let g=d?.description??o,_;t[9]===g?_=t[10]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:g}),t[9]=g,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==p||t[15]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[p,v]}),t[14]=p,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==c||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,c]}),t[17]=c,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=a(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=x):x=t[20];let S=Math.max(0,i.length-1),C=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,w;t[21]===C?w=t[22]:(w={background:C,borderRadius:`999px`},t[21]=C,t[22]=w);let T;t[23]!==s||t[24]!==i?(T=e=>{let t=i[Number(e.currentTarget.value)];t&&s(t.value)},t[23]=s,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==n||t[27]!==u||t[28]!==S||t[29]!==w||t[30]!==T?(E=(0,$.jsx)(`input`,{"aria-label":n,className:x,max:S,min:0,step:1,type:`range`,value:u,style:w,onChange:T}),t[26]=n,t[27]=u,t[28]=S,t[29]=w,t[30]=T,t[31]=E):E=t[31];let D=`repeat(${i.length}, minmax(0, 1fr))`,O;t[32]===D?O=t[33]:(O={gridTemplateColumns:D},t[32]=D,t[33]=O);let k;if(t[34]!==n||t[35]!==s||t[36]!==i||t[37]!==u){let e;t[39]!==n||t[40]!==s||t[41]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>s(e.value),className:a(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:a(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=s,t[41]=u,t[42]=e):e=t[42],k=i.map(e),t[34]=n,t[35]=s,t[36]=i,t[37]=u,t[38]=k}else k=t[38];let A;t[43]!==O||t[44]!==k?(A=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:O,children:k}),t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==E||t[47]!==A||t[48]!==b?(j=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[b,E,A]}),t[46]=E,t[47]=A,t[48]=b,t[49]=j):j=t[49],j}export{Ot as AppearanceSettingsPanel};
|
package/dist/client/assets/{BranchToolbar.logic-DN0He2gp.js → BranchToolbar.logic-DFsXV3Qs.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import"./primary-CQh_KHGG.js";import{fa as t}from"./src-DHNjfMxR.js";import{Qn as n,Xn as r,Yn as i,Zn as a,ar as o,cr as s,er as c,hu as l,ir as u,nr as d,p as f,rr as p,tr as m,y as h}from"./runtime-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import"./primary-CQh_KHGG.js";import{fa as t}from"./src-DHNjfMxR.js";import{Qn as n,Xn as r,Yn as i,Zn as a,ar as o,cr as s,er as c,hu as l,ir as u,nr as d,p as f,rr as p,tr as m,y as h}from"./runtime-OM-uAtaj.js";import{t as g}from"./react-CwJFpaho.js";import{Ln as _,Rn as v}from"./switch-D9inWKdd.js";import{t as y}from"./compiler-runtime-C4g8XhC5.js";function b(e){let t=e.match(/^\s{0,3}#{1,6}\s+(.+)$/m)?.[1]?.trim();return t&&t.length>0?t:null}function x(e){let t=e.trimEnd().split(/\r?\n/),n=t[0]&&/^\s{0,3}#{1,6}\s+/.test(t[0])?t.slice(1):[...t];for(;n[0]?.trim().length===0;)n.shift();if((n[0]?.match(/^\s{0,3}#{1,6}\s+(.+)$/))?.[1]?.trim().toLowerCase()===`summary`)for(n.shift();n[0]?.trim().length===0;)n.shift();return n.join(`
|
|
2
2
|
`)}function S(e,t){let n=t?.maxLines??8,r=x(e).trimEnd().split(/\r?\n/).map(e=>e.trimEnd()),i=[],a=0,o=!1;for(let e of r){let t=e.trim().length>0;if(t&&a>=n){o=!0;break}i.push(e),t&&(a+=1)}for(;i.length>0&&i.at(-1)?.trim().length===0;)i.pop();return i.length===0?b(e)??`Plan preview unavailable.`:(o&&i.push(``,`...`),i.join(`
|
|
3
3
|
`))}function C(e){let t=e.toLowerCase().replace(/[`'".,!?()[\]{}]+/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t.length>0?t:`plan`}function w(e){return`PLEASE IMPLEMENT THIS PLAN:\n${e.trim()}`}function T(e){let t=e.draftText.trim();return t.length>0?{text:t,interactionMode:`plan`}:{text:w(e.planMarkdown),interactionMode:`default`}}function E(e){let t=b(e);return t?`Implement ${t}`:`Implement plan`}function D(e){return`${C(b(e)??`plan`)}.md`}function O(e){return`${e.trimEnd()}\n`}function k(e,t){let n=new Blob([t],{type:`text/markdown;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),window.setTimeout(()=>{URL.revokeObjectURL(r)},0)}var A=y(),j=e(g(),1);function M(e){let t=(0,A.c)(13),i=p(e),{environmentId:a,cwd:o,query:s,enabled:d,limit:f,staleTime:h}=e,g,_;t[0]!==o||t[1]!==a||t[2]!==f?(g=()=>{if(a===null||o===null)return;let e={environmentId:a,cwd:o,...f===void 0?{}:{limit:f}};return u(e),()=>c(e)},_=[a,o,f],t[0]=o,t[1]=a,t[2]=f,t[3]=g,t[4]=_):(g=t[3],_=t[4]),(0,j.useEffect)(g,_);let v,y;t[5]!==o||t[6]!==d||t[7]!==a||t[8]!==f||t[9]!==s||t[10]!==h?(v=()=>{m({environmentId:a,cwd:o,query:s,...d===void 0?{}:{enabled:d},...f===void 0?{}:{limit:f},...h===void 0?{}:{staleTime:h}})},y=[a,o,s,d,f,h],t[5]=o,t[6]=d,t[7]=a,t[8]=f,t[9]=s,t[10]=h,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,j.useEffect)(v,y);let b=l(n(i));return i===null?r:b}function N(e){let t=d(e),n=(0,j.useSyncExternalStore)(h,()=>e.environmentId===null?null:f(e.environmentId),()=>null),r=(0,j.useRef)(e);r.current=e,(0,j.useEffect)(()=>{let e=r.current,t=e.environmentId===null?void 0:s(e.environmentId,n?.client??null);return o(e,t??null)},[t,n]);let c=l(a(t));return t===null?i:c}function P(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function F(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=P(e);if(t)return t}return null}t([`local`,`worktree`]);function I(e){let t=v(e.runtimeLabel),n=v(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!_(e):!1)??`Device connecting…`:t??n??e.environmentId}function L(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function R(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function z(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function B(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function V(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{T as _,L as a,N as c,w as d,E as f,b as g,O as h,R as i,M as l,k as m,B as n,I as o,D as p,z as r,V as s,F as t,S as u,x as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xt as t}from"./primary-CQh_KHGG.js";import{$l as n,Qr as r,ao as i,lr as a,so as o}from"./runtime-DpHhg0dl.js";import{t as s}from"./react-CwJFpaho.js";import{br as c,hr as l,kr as u}from"./switch-DgLijJhN.js";import{t as d}from"./compiler-runtime-C4g8XhC5.js";import{t as f}from"./arrow-left-Ce-aUiy1.js";import{t as p}from"./arrow-right-BEwkAmxp.js";import{t as m}from"./star-BAzXRepp.js";import{ut as h}from"./main-DsnAjTqg.js";var g=d(),_=e(s(),1),v=n();function y(e){let t=(0,g.c)(14),{tab:n,width:r}=e,i=(0,_.useRef)(null),[a,o]=(0,_.useState)(null),s=window.desktopBridge?.browser,c=n.presentation===`window`,l,u;t[0]!==c||t[1]!==n.id?(l=()=>{if(!s||!i.current||c)return;let e=crypto.randomUUID(),t=0,r=!1,a=``,l=0,u=()=>{if(t=0,r||!i.current)return;let c=i.current.getBoundingClientRect(),d=![...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [data-slot="popover-popup"], [role="menu"]`)].some(e=>!e.contains(i.current))&&document.visibilityState===`visible`&&c.width>=1&&c.height>=1&&c.left>=0&&c.top>=0&&c.left<innerWidth&&c.top<innerHeight&&!i.current.closest(`[inert], [aria-hidden="true"]`),f={owner:e,tab:d?n.id:null,x:Math.max(0,c.left),y:Math.max(0,c.top),width:Math.max(1,Math.min(c.width,innerWidth-c.left)),height:Math.max(1,Math.min(c.height,innerHeight-c.top))},p=JSON.stringify(f);p!==a&&(a=p,s.surface(f).catch(e=>{r||o(e instanceof Error?e.message:`Browser surface unavailable.`)})),performance.now()<l&&(t=requestAnimationFrame(u))},d=()=>{!t&&!r&&(t=requestAnimationFrame(u))},f=()=>{l=performance.now()+500,d()},p=new ResizeObserver(d);p.observe(i.current);let m=new MutationObserver(d);return m.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`inert`,`aria-hidden`,`data-state`]}),window.addEventListener(`resize`,f),document.addEventListener(`scroll`,d,!0),document.addEventListener(`visibilitychange`,d),document.addEventListener(`transitionrun`,f,!0),f(),()=>{r=!0,cancelAnimationFrame(t),p.disconnect(),m.disconnect(),window.removeEventListener(`resize`,f),document.removeEventListener(`scroll`,d,!0),document.removeEventListener(`visibilitychange`,d),document.removeEventListener(`transitionrun`,f,!0),s.surface({owner:e,tab:null,x:0,y:0,width:1,height:1}).catch(b)}},u=[s,n.id,c],t[0]=c,t[1]=n.id,t[2]=l,t[3]=u):(l=t[2],u=t[3]),(0,_.useEffect)(l,u);let d=r??`100%`,f;t[4]===d?f=t[5]:(f={width:d,maxWidth:`100%`,height:`100%`},t[4]=d,t[5]=f);let p;t[6]!==a||t[7]!==n.id||t[8]!==n.title||t[9]!==n.url?(p=s?a?(0,v.jsx)(`p`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:a}):null:(0,v.jsx)(`iframe`,{title:n.title||`Browser preview`,src:n.url,sandbox:`allow-scripts allow-forms`,referrerPolicy:`no-referrer`,className:`size-full border-0`},n.id+n.url),t[6]=a,t[7]=n.id,t[8]=n.title,t[9]=n.url,t[10]=p):p=t[10];let m;return t[11]!==f||t[12]!==p?(m=(0,v.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-hidden bg-muted/30`,children:(0,v.jsx)(`div`,{ref:i,className:`relative min-h-0 bg-white`,style:f,children:p})}),t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function b(){}var x=t(e=>({native:{tabs:[]},fallback:[],selected:{},setNative:t=>e({native:t}),select:(t,n)=>e(e=>({selected:{...e.selected,[t]:n}})),openFallback:(t,n)=>{let r=crypto.randomUUID();return e(e=>({fallback:[...e.fallback,{id:r,project:n,url:t,title:new URL(t).host,loading:!1,canGoBack:!1,canGoForward:!1,zoom:1,presentation:`panel`,error:null}],selected:{...e.selected,[n]:r}})),r},closeFallback:t=>e(e=>({fallback:e.fallback.filter(e=>e.id!==t)})),navigateFallback:(t,n)=>e(e=>({fallback:e.fallback.map(e=>e.id===t?{...e,url:n,title:new URL(n).host}:e)}))})),S=0,C,w=0;function T(e){let t=window.desktopBridge?.browser;(0,_.useEffect)(()=>{if(t){if(S++===0){let e=++w,n=!1;C=t.onState(e=>{n=!0,x.getState().setNative(e)}),t.getState().then(t=>{!n&&S&&e===w&&x.getState().setNative(t)}).catch(()=>{})}return()=>{--S===0&&(w++,C?.(),C=void 0)}}},[t]);let n=x(e=>t?e.native.tabs:e.fallback),r=x(t=>t.selected[e]),i=n.filter(t=>t.project===e||t.project===``);return{tabs:i,selected:i.find(e=>e.id===r)??i[0]??null,api:t}}function E(e,t){return JSON.stringify([e,t])}function D(e){let t=e.trim(),n=new URL(/^[a-z][a-z\d+.-]*:\/\//iu.test(t)?t:`http://${t}`);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password||!n.hostname)throw Error(`Enter an HTTP(S) URL without embedded credentials.`);return n.href}function O({environmentId:e,cwd:t}){let n=E(e,t),{tabs:s,selected:d,api:g}=T(n),b=(0,_.useRef)(null),[S,C]=(0,_.useState)(``),[w,O]=(0,_.useState)(null),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(null),F;try{let n=window.desktopBridge?.getLocalEnvironmentBootstrap()?.httpBaseUrl,r=e?a(e):null;n&&r&&new URL(n).origin===new URL(r).origin&&(F=t??void 0)}catch{}let[I,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(!1),B=(0,_.useRef)({generation:0}).current,[V,H]=(0,_.useState)([]),U=j?null:d,W=U===null;(0,_.useEffect)(()=>g?.onFocusAddress(e=>{e===U?.id&&(b.current?.focus(),b.current?.select())}),[g,U?.id]),(0,_.useEffect)(()=>{C(U?.url??``)},[U?.id,U?.url]),(0,_.useEffect)(()=>{M(!1);try{let e=JSON.parse(localStorage.getItem(`ryco:browser-sites:${n}`)??`[]`);H(Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,20):[])}catch{H([])}},[n]);let G=async e=>{O(null);try{await e()}catch(e){O(e instanceof Error?e.message:`Browser request failed.`)}},K=(0,_.useCallback)(async()=>{if(!g)return;let e=++B.generation;z(!0);try{let t=await g.discover(F);e===B.generation&&L(t)}catch(t){e===B.generation&&O(t instanceof Error?t.message:`Discovery failed.`)}finally{e===B.generation&&z(!1)}},[g,F,B]);(0,_.useEffect)(()=>(L([]),W&&g&&K(),()=>{B.generation++}),[W,g,K,B,n]);let q=async e=>{let t=D(e);A(!0);try{if(g){let e=await g.open({url:t,project:n});x.getState().select(n,e)}else x.getState().openFallback(t,n);M(!1)}finally{A(!1)}},J=(e,t={})=>{g&&U&&G(()=>g.command({...t,action:e,tab:U.id}))};return(0,v.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`Project browser`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b p-1`,role:`tablist`,"aria-label":`Browser tabs`,children:[s.map(e=>(0,v.jsxs)(`div`,{className:`flex min-w-0 max-w-44 shrink-0 items-center rounded bg-muted/40`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":U?.id===e.id,className:`flex min-w-0 items-center gap-1.5 px-2 py-1.5 text-xs`,onClick:()=>{x.getState().select(n,e.id),M(!1)},children:[e.loading?(0,v.jsx)(o,{className:`size-3 shrink-0 animate-spin`}):(0,v.jsx)(c,{className:`size-3 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate`,children:e.title||e.url||`Loading…`})]}),(0,v.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title||`browser tab`}`,className:`p-1 text-muted-foreground hover:text-foreground`,onClick:()=>void G(()=>g?g.command({action:`close`,tab:e.id}):Promise.resolve(x.getState().closeFallback(e.id))),children:(0,v.jsx)(i,{className:`size-3`})})]},e.id)),(0,v.jsx)(r,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`New browser tab`,onClick:()=>{M(!0),C(``)},children:(0,v.jsx)(h,{className:`size-3.5`})})]}),(0,v.jsxs)(`form`,{className:`flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),G(async()=>{if(U){let e=D(S);g?await g.command({action:`navigate`,tab:U.id,url:e}):x.getState().navigateFallback(U.id,e)}else await q(S)})},children:[(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Back`,disabled:!g||!U?.canGoBack,onClick:()=>J(`back`),children:(0,v.jsx)(f,{className:`size-3.5`})}),(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Forward`,disabled:!g||!U?.canGoForward,onClick:()=>J(`forward`),children:(0,v.jsx)(p,{className:`size-3.5`})}),(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":U?.loading?`Stop loading`:`Reload`,disabled:!g||!U,onClick:()=>J(U?.loading?`stop`:`reload`),children:U?.loading?(0,v.jsx)(i,{className:`size-3.5`}):(0,v.jsx)(l,{className:`size-3.5`})}),(0,v.jsx)(`input`,{ref:b,"aria-label":`Browser address`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs`,placeholder:`Enter a URL or localhost:3000`,value:S,onChange:e=>C(e.target.value),onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(r,{type:`submit`,size:`sm`,variant:`outline`,disabled:k,children:`Go`}),(0,v.jsx)(r,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7`,disabled:!U?.url,"aria-label":`Save project URL`,"aria-pressed":!!(U&&V.includes(U.url)),onClick:()=>{if(!U?.url)return;let e=V.includes(U.url)?V.filter(e=>e!==U.url):[U.url,...V].slice(0,20);try{localStorage.setItem(`ryco:browser-sites:${n}`,JSON.stringify(e)),H(e)}catch{O(`Could not save this URL.`)}},children:(0,v.jsx)(m,{className:`size-3.5`})})]}),U?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,v.jsxs)(`select`,{"aria-label":`Browser viewport`,className:`bg-background`,value:N??`auto`,onChange:e=>P(e.target.value===`auto`?null:Number(e.target.value)),children:[(0,v.jsx)(`option`,{value:`auto`,children:`Responsive`}),(0,v.jsx)(`option`,{value:`390`,children:`Phone · 390px`}),(0,v.jsx)(`option`,{value:`768`,children:`Tablet · 768px`}),(0,v.jsx)(`option`,{value:`1280`,children:`Desktop · 1280px`})]}),g?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`select`,{"aria-label":`Browser zoom`,className:`bg-background`,value:U.zoom,onChange:e=>J(`zoom`,{zoom:Number(e.target.value)}),children:[.5,.75,1,1.25,1.5,2].map(e=>(0,v.jsxs)(`option`,{value:e,children:[e*100,`%`]},e))}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(U.signInPopup===`armed`||U.signInPopup===`open`?`cancel-sign-in`:`allow-sign-in`),children:U.signInPopup===`open`?`Close sign-in popup`:U.signInPopup===`armed`?`Cancel sign-in`:`Allow sign-in popup`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`devtools`),children:`DevTools`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`popout`),children:`Pop out`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>void G(()=>window.desktopBridge?.computerUse?.stop()??Promise.resolve()),children:`Stop agent`})]}):(0,v.jsx)(`span`,{children:`Web preview · sites may restrict embedding`}),(0,v.jsxs)(`a`,{href:U.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex items-center gap-1`,"aria-label":`Open in external browser`,children:[(0,v.jsx)(u,{className:`size-3`}),`External`]})]}):null,g&&U&&(U.signInPopup===`armed`||U.signInPopup===`blocked`||U.signInPopup===`failed`)?(0,v.jsx)(`p`,{role:`status`,className:`border-b p-2 text-xs text-muted-foreground`,children:U.signInPopup===`armed`?`One sign-in popup allowed for 30 seconds. Click the site’s sign-in button again. Switching panels cancels permission.`:U.signInPopup===`failed`?`Sign-in popup could not load. Allow a new sign-in popup and retry the site’s sign-in button.`:`Popup blocked. To sign in, choose Allow sign-in popup, then retry the site’s sign-in button.`}):null,w||U?.error?(0,v.jsx)(`p`,{role:`alert`,className:`border-b p-2 text-xs text-destructive`,children:w??U?.error}):null,U?U.presentation===`window`?(0,v.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-sm`,children:[(0,v.jsx)(`p`,{children:`This tab is open in a separate window.`}),(0,v.jsx)(r,{variant:`outline`,onClick:()=>J(`dock`),children:`Bring back into Ryco`})]}):(0,v.jsx)(y,{tab:U,width:N}):(0,v.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5`,children:[(0,v.jsx)(c,{className:`mb-3 size-7 text-muted-foreground`}),(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Your project, live`}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Enter an address above, or choose a site below. Agents can use these same tabs through Ryco Browser.`}),(0,v.jsx)(`p`,{className:`mt-2 truncate text-[11px] text-muted-foreground`,title:t??void 0,children:t??`No project selected`}),V.length?(0,v.jsxs)(`div`,{className:`mt-5`,children:[(0,v.jsx)(`h4`,{className:`mb-2 text-xs font-medium`,children:`Saved for this project`}),V.map(e=>(0,v.jsx)(`button`,{type:`button`,className:`block w-full truncate rounded px-2 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e)),children:e},e))]}):null,(0,v.jsxs)(`div`,{className:`mt-5 flex items-center justify-between`,children:[(0,v.jsx)(`h4`,{className:`text-xs font-medium`,children:`Services on this computer`}),(0,v.jsx)(r,{variant:`ghost`,size:`sm`,disabled:!g||R,onClick:()=>void K(),children:R?`Finding…`:`Refresh`})]}),g?!I.length&&!R?(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No local HTTP services found. Start your project’s dev server, then refresh.`}):I.map(e=>(0,v.jsxs)(`button`,{type:`button`,disabled:k,className:`mt-1 flex w-full items-center justify-between rounded border border-border/60 px-3 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e.url)),children:[(0,v.jsx)(`span`,{children:e.url}),(0,v.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.projectMatch?`This project · `:``,e.process]})]},e.url)):(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Local port discovery is available in Ryco desktop. For remote projects, enter a reachable or forwarded URL.`}),k?(0,v.jsx)(`p`,{role:`status`,className:`mt-3 text-xs`,children:`Opening page…`}):null]})]})}export{O as BrowserPanel};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Xt as t}from"./primary-CQh_KHGG.js";import{$l as n,Qr as r,ao as i,lr as a,so as o}from"./runtime-OM-uAtaj.js";import{t as s}from"./react-CwJFpaho.js";import{br as c,hr as l,kr as u}from"./switch-D9inWKdd.js";import{t as d}from"./compiler-runtime-C4g8XhC5.js";import{t as f}from"./arrow-left-XhcJWpRy.js";import{t as p}from"./arrow-right-BBs6iTUL.js";import{t as m}from"./star-J3x3fktG.js";import{ut as h}from"./main-RFllWEko.js";var g=d(),_=e(s(),1),v=n();function y(e){let t=(0,g.c)(14),{tab:n,width:r}=e,i=(0,_.useRef)(null),[a,o]=(0,_.useState)(null),s=window.desktopBridge?.browser,c=n.presentation===`window`,l,u;t[0]!==c||t[1]!==n.id?(l=()=>{if(!s||!i.current||c)return;let e=crypto.randomUUID(),t=0,r=!1,a=``,l=0,u=()=>{if(t=0,r||!i.current)return;let c=i.current.getBoundingClientRect(),d=![...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [data-slot="popover-popup"], [role="menu"]`)].some(e=>!e.contains(i.current))&&document.visibilityState===`visible`&&c.width>=1&&c.height>=1&&c.left>=0&&c.top>=0&&c.left<innerWidth&&c.top<innerHeight&&!i.current.closest(`[inert], [aria-hidden="true"]`),f={owner:e,tab:d?n.id:null,x:Math.max(0,c.left),y:Math.max(0,c.top),width:Math.max(1,Math.min(c.width,innerWidth-c.left)),height:Math.max(1,Math.min(c.height,innerHeight-c.top))},p=JSON.stringify(f);p!==a&&(a=p,s.surface(f).catch(e=>{r||o(e instanceof Error?e.message:`Browser surface unavailable.`)})),performance.now()<l&&(t=requestAnimationFrame(u))},d=()=>{!t&&!r&&(t=requestAnimationFrame(u))},f=()=>{l=performance.now()+500,d()},p=new ResizeObserver(d);p.observe(i.current);let m=new MutationObserver(d);return m.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`inert`,`aria-hidden`,`data-state`]}),window.addEventListener(`resize`,f),document.addEventListener(`scroll`,d,!0),document.addEventListener(`visibilitychange`,d),document.addEventListener(`transitionrun`,f,!0),f(),()=>{r=!0,cancelAnimationFrame(t),p.disconnect(),m.disconnect(),window.removeEventListener(`resize`,f),document.removeEventListener(`scroll`,d,!0),document.removeEventListener(`visibilitychange`,d),document.removeEventListener(`transitionrun`,f,!0),s.surface({owner:e,tab:null,x:0,y:0,width:1,height:1}).catch(b)}},u=[s,n.id,c],t[0]=c,t[1]=n.id,t[2]=l,t[3]=u):(l=t[2],u=t[3]),(0,_.useEffect)(l,u);let d=r??`100%`,f;t[4]===d?f=t[5]:(f={width:d,maxWidth:`100%`,height:`100%`},t[4]=d,t[5]=f);let p;t[6]!==a||t[7]!==n.id||t[8]!==n.title||t[9]!==n.url?(p=s?a?(0,v.jsx)(`p`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:a}):null:(0,v.jsx)(`iframe`,{title:n.title||`Browser preview`,src:n.url,sandbox:`allow-scripts allow-forms`,referrerPolicy:`no-referrer`,className:`size-full border-0`},n.id+n.url),t[6]=a,t[7]=n.id,t[8]=n.title,t[9]=n.url,t[10]=p):p=t[10];let m;return t[11]!==f||t[12]!==p?(m=(0,v.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-hidden bg-muted/30`,children:(0,v.jsx)(`div`,{ref:i,className:`relative min-h-0 bg-white`,style:f,children:p})}),t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function b(){}var x=t(e=>({native:{tabs:[]},fallback:[],selected:{},setNative:t=>e({native:t}),select:(t,n)=>e(e=>({selected:{...e.selected,[t]:n}})),openFallback:(t,n)=>{let r=crypto.randomUUID();return e(e=>({fallback:[...e.fallback,{id:r,project:n,url:t,title:new URL(t).host,loading:!1,canGoBack:!1,canGoForward:!1,zoom:1,presentation:`panel`,error:null}],selected:{...e.selected,[n]:r}})),r},closeFallback:t=>e(e=>({fallback:e.fallback.filter(e=>e.id!==t)})),navigateFallback:(t,n)=>e(e=>({fallback:e.fallback.map(e=>e.id===t?{...e,url:n,title:new URL(n).host}:e)}))})),S=0,C,w=0;function T(e){let t=window.desktopBridge?.browser;(0,_.useEffect)(()=>{if(t){if(S++===0){let e=++w,n=!1;C=t.onState(e=>{n=!0,x.getState().setNative(e)}),t.getState().then(t=>{!n&&S&&e===w&&x.getState().setNative(t)}).catch(()=>{})}return()=>{--S===0&&(w++,C?.(),C=void 0)}}},[t]);let n=x(e=>t?e.native.tabs:e.fallback),r=x(t=>t.selected[e]),i=n.filter(t=>t.project===e||t.project===``);return{tabs:i,selected:i.find(e=>e.id===r)??i[0]??null,api:t}}function E(e,t){return JSON.stringify([e,t])}function D(e){let t=e.trim(),n=new URL(/^[a-z][a-z\d+.-]*:\/\//iu.test(t)?t:`http://${t}`);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password||!n.hostname)throw Error(`Enter an HTTP(S) URL without embedded credentials.`);return n.href}function O({environmentId:e,cwd:t}){let n=E(e,t),{tabs:s,selected:d,api:g}=T(n),b=(0,_.useRef)(null),[S,C]=(0,_.useState)(``),[w,O]=(0,_.useState)(null),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(null),F;try{let n=window.desktopBridge?.getLocalEnvironmentBootstrap()?.httpBaseUrl,r=e?a(e):null;n&&r&&new URL(n).origin===new URL(r).origin&&(F=t??void 0)}catch{}let[I,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(!1),B=(0,_.useRef)({generation:0}).current,[V,H]=(0,_.useState)([]),U=j?null:d,W=U===null;(0,_.useEffect)(()=>g?.onFocusAddress(e=>{e===U?.id&&(b.current?.focus(),b.current?.select())}),[g,U?.id]),(0,_.useEffect)(()=>{C(U?.url??``)},[U?.id,U?.url]),(0,_.useEffect)(()=>{M(!1);try{let e=JSON.parse(localStorage.getItem(`ryco:browser-sites:${n}`)??`[]`);H(Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,20):[])}catch{H([])}},[n]);let G=async e=>{O(null);try{await e()}catch(e){O(e instanceof Error?e.message:`Browser request failed.`)}},K=(0,_.useCallback)(async()=>{if(!g)return;let e=++B.generation;z(!0);try{let t=await g.discover(F);e===B.generation&&L(t)}catch(t){e===B.generation&&O(t instanceof Error?t.message:`Discovery failed.`)}finally{e===B.generation&&z(!1)}},[g,F,B]);(0,_.useEffect)(()=>(L([]),W&&g&&K(),()=>{B.generation++}),[W,g,K,B,n]);let q=async e=>{let t=D(e);A(!0);try{if(g){let e=await g.open({url:t,project:n});x.getState().select(n,e)}else x.getState().openFallback(t,n);M(!1)}finally{A(!1)}},J=(e,t={})=>{g&&U&&G(()=>g.command({...t,action:e,tab:U.id}))};return(0,v.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`Project browser`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b p-1`,role:`tablist`,"aria-label":`Browser tabs`,children:[s.map(e=>(0,v.jsxs)(`div`,{className:`flex min-w-0 max-w-44 shrink-0 items-center rounded bg-muted/40`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":U?.id===e.id,className:`flex min-w-0 items-center gap-1.5 px-2 py-1.5 text-xs`,onClick:()=>{x.getState().select(n,e.id),M(!1)},children:[e.loading?(0,v.jsx)(o,{className:`size-3 shrink-0 animate-spin`}):(0,v.jsx)(c,{className:`size-3 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate`,children:e.title||e.url||`Loading…`})]}),(0,v.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title||`browser tab`}`,className:`p-1 text-muted-foreground hover:text-foreground`,onClick:()=>void G(()=>g?g.command({action:`close`,tab:e.id}):Promise.resolve(x.getState().closeFallback(e.id))),children:(0,v.jsx)(i,{className:`size-3`})})]},e.id)),(0,v.jsx)(r,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`New browser tab`,onClick:()=>{M(!0),C(``)},children:(0,v.jsx)(h,{className:`size-3.5`})})]}),(0,v.jsxs)(`form`,{className:`flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),G(async()=>{if(U){let e=D(S);g?await g.command({action:`navigate`,tab:U.id,url:e}):x.getState().navigateFallback(U.id,e)}else await q(S)})},children:[(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Back`,disabled:!g||!U?.canGoBack,onClick:()=>J(`back`),children:(0,v.jsx)(f,{className:`size-3.5`})}),(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Forward`,disabled:!g||!U?.canGoForward,onClick:()=>J(`forward`),children:(0,v.jsx)(p,{className:`size-3.5`})}),(0,v.jsx)(r,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":U?.loading?`Stop loading`:`Reload`,disabled:!g||!U,onClick:()=>J(U?.loading?`stop`:`reload`),children:U?.loading?(0,v.jsx)(i,{className:`size-3.5`}):(0,v.jsx)(l,{className:`size-3.5`})}),(0,v.jsx)(`input`,{ref:b,"aria-label":`Browser address`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs`,placeholder:`Enter a URL or localhost:3000`,value:S,onChange:e=>C(e.target.value),onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(r,{type:`submit`,size:`sm`,variant:`outline`,disabled:k,children:`Go`}),(0,v.jsx)(r,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7`,disabled:!U?.url,"aria-label":`Save project URL`,"aria-pressed":!!(U&&V.includes(U.url)),onClick:()=>{if(!U?.url)return;let e=V.includes(U.url)?V.filter(e=>e!==U.url):[U.url,...V].slice(0,20);try{localStorage.setItem(`ryco:browser-sites:${n}`,JSON.stringify(e)),H(e)}catch{O(`Could not save this URL.`)}},children:(0,v.jsx)(m,{className:`size-3.5`})})]}),U?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,v.jsxs)(`select`,{"aria-label":`Browser viewport`,className:`bg-background`,value:N??`auto`,onChange:e=>P(e.target.value===`auto`?null:Number(e.target.value)),children:[(0,v.jsx)(`option`,{value:`auto`,children:`Responsive`}),(0,v.jsx)(`option`,{value:`390`,children:`Phone · 390px`}),(0,v.jsx)(`option`,{value:`768`,children:`Tablet · 768px`}),(0,v.jsx)(`option`,{value:`1280`,children:`Desktop · 1280px`})]}),g?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`select`,{"aria-label":`Browser zoom`,className:`bg-background`,value:U.zoom,onChange:e=>J(`zoom`,{zoom:Number(e.target.value)}),children:[.5,.75,1,1.25,1.5,2].map(e=>(0,v.jsxs)(`option`,{value:e,children:[e*100,`%`]},e))}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(U.signInPopup===`armed`||U.signInPopup===`open`?`cancel-sign-in`:`allow-sign-in`),children:U.signInPopup===`open`?`Close sign-in popup`:U.signInPopup===`armed`?`Cancel sign-in`:`Allow sign-in popup`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`devtools`),children:`DevTools`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`popout`),children:`Pop out`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>void G(()=>window.desktopBridge?.computerUse?.stop()??Promise.resolve()),children:`Stop agent`})]}):(0,v.jsx)(`span`,{children:`Web preview · sites may restrict embedding`}),(0,v.jsxs)(`a`,{href:U.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex items-center gap-1`,"aria-label":`Open in external browser`,children:[(0,v.jsx)(u,{className:`size-3`}),`External`]})]}):null,g&&U&&(U.signInPopup===`armed`||U.signInPopup===`blocked`||U.signInPopup===`failed`)?(0,v.jsx)(`p`,{role:`status`,className:`border-b p-2 text-xs text-muted-foreground`,children:U.signInPopup===`armed`?`One sign-in popup allowed for 30 seconds. Click the site’s sign-in button again. Switching panels cancels permission.`:U.signInPopup===`failed`?`Sign-in popup could not load. Allow a new sign-in popup and retry the site’s sign-in button.`:`Popup blocked. To sign in, choose Allow sign-in popup, then retry the site’s sign-in button.`}):null,w||U?.error?(0,v.jsx)(`p`,{role:`alert`,className:`border-b p-2 text-xs text-destructive`,children:w??U?.error}):null,U?U.presentation===`window`?(0,v.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-sm`,children:[(0,v.jsx)(`p`,{children:`This tab is open in a separate window.`}),(0,v.jsx)(r,{variant:`outline`,onClick:()=>J(`dock`),children:`Bring back into Ryco`})]}):(0,v.jsx)(y,{tab:U,width:N}):(0,v.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5`,children:[(0,v.jsx)(c,{className:`mb-3 size-7 text-muted-foreground`}),(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Your project, live`}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Enter an address above, or choose a site below. Agents can use these same tabs through Ryco Browser.`}),(0,v.jsx)(`p`,{className:`mt-2 truncate text-[11px] text-muted-foreground`,title:t??void 0,children:t??`No project selected`}),V.length?(0,v.jsxs)(`div`,{className:`mt-5`,children:[(0,v.jsx)(`h4`,{className:`mb-2 text-xs font-medium`,children:`Saved for this project`}),V.map(e=>(0,v.jsx)(`button`,{type:`button`,className:`block w-full truncate rounded px-2 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e)),children:e},e))]}):null,(0,v.jsxs)(`div`,{className:`mt-5 flex items-center justify-between`,children:[(0,v.jsx)(`h4`,{className:`text-xs font-medium`,children:`Services on this computer`}),(0,v.jsx)(r,{variant:`ghost`,size:`sm`,disabled:!g||R,onClick:()=>void K(),children:R?`Finding…`:`Refresh`})]}),g?!I.length&&!R?(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No local HTTP services found. Start your project’s dev server, then refresh.`}):I.map(e=>(0,v.jsxs)(`button`,{type:`button`,disabled:k,className:`mt-1 flex w-full items-center justify-between rounded border border-border/60 px-3 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e.url)),children:[(0,v.jsx)(`span`,{children:e.url}),(0,v.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.projectMatch?`This project · `:``,e.process]})]},e.url)):(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Local port discovery is available in Ryco desktop. For remote projects, enter a reachable or forwarded URL.`}),k?(0,v.jsx)(`p`,{role:`status`,className:`mt-3 text-xs`,children:`Opening page…`}):null]})]})}export{O as BrowserPanel};
|