yepanywhere 0.10.2 → 0.11.0
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/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -4
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +3 -3
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts +16 -0
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.js +27 -0
- package/bundled/@yep-anywhere/shared/dist/issues.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts +12 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.js +56 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +50 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +48 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js +5 -0
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/{AboutSettings-DnDy6BEd.js → AboutSettings-Ck7P-jDQ.js} +1 -1
- package/client-dist/assets/{ActivityPage-MFWjNC-D.js → ActivityPage-lGdcdJ-e.js} +1 -1
- package/client-dist/assets/{AgentContextSettings-D8g4_T92.js → AgentContextSettings-UprX6zdD.js} +1 -1
- package/client-dist/assets/{AgentsPage-CXHC9oBL.js → AgentsPage-BNPVqFjZ.js} +1 -1
- package/client-dist/assets/App-3o8SyXXM.js +2 -0
- package/client-dist/assets/AppearanceSettings-DMW7A_Rf.js +2 -0
- package/client-dist/assets/{AppsSettings-BPk1YKiU.js → AppsSettings-D9Fdhvnq.js} +1 -1
- package/client-dist/assets/{AttachmentChip-BRmKgPA9.js → AttachmentChip-qYXy0CtC.js} +1 -1
- package/client-dist/assets/{AuthContext-BPHX3zIQ.js → AuthContext-IbT77aGw.js} +1 -1
- package/client-dist/assets/{BangCommandDisplayObject-DpwVa9Ll.js → BangCommandDisplayObject-BOag7vGT.js} +1 -1
- package/client-dist/assets/{BangCommandsPage-B8zpyOBf.js → BangCommandsPage--PeiFzRy.js} +1 -1
- package/client-dist/assets/{BlameBrowser-BLuAT9qK.js → BlameBrowser-DrfV_lH3.js} +1 -1
- package/client-dist/assets/{BrowserDebugToolbarButton-BXfPrxyA.js → BrowserDebugToolbarButton-DhIc8BpN.js} +1 -1
- package/client-dist/assets/{BrowserExtensionSettings-CZ0s6ASb.js → BrowserExtensionSettings-DAMeZFOL.js} +1 -1
- package/client-dist/assets/{CacheMissBillingSettings-ue0Jahu3.js → CacheMissBillingSettings-BW6Nf5ut.js} +1 -1
- package/client-dist/assets/{CodexUpdatePrompt-DXdrlvWV.js → CodexUpdatePrompt-H0-B1yB-.js} +1 -1
- package/client-dist/assets/{CommittedRangeInput-CLkpNnP_.js → CommittedRangeInput-C6In6Q8s.js} +1 -1
- package/client-dist/assets/{CommittedRangeNumberInput-Co1Mkg_Y.js → CommittedRangeNumberInput-DF-kPNGu.js} +1 -1
- package/client-dist/assets/{ConversationPreviewPage-B4Ph-QV7.js → ConversationPreviewPage-CTu-ffV7.js} +1 -1
- package/client-dist/assets/{CopyTextButton-Bpeo8K_-.js → CopyTextButton-oYhSruA8.js} +1 -1
- package/client-dist/assets/{DevelopmentSettings-B3XBUEkp.js → DevelopmentSettings-DGtUr0Qz.js} +1 -1
- package/client-dist/assets/{DevicesSettings-D_iWcxbb.js → DevicesSettings-XMDAT-N4.js} +1 -1
- package/client-dist/assets/{EmulatorPage-B1cu6Lq_.js → EmulatorPage-De0YMKUL.js} +1 -1
- package/client-dist/assets/{EmulatorSettings-nvQEL90Z.js → EmulatorSettings-C5TOwBvn.js} +1 -1
- package/client-dist/assets/{EnvironmentSettings-Ba6izhQj.js → EnvironmentSettings-B1gePTdK.js} +1 -1
- package/client-dist/assets/{FilePage-9Ss6nJ-y.js → FilePage-zx4PfIbF.js} +1 -1
- package/client-dist/assets/FileViewer-D8IcGVo-.js +63 -0
- package/client-dist/assets/{FilterDropdown-D-CDFjqG.js → FilterDropdown-BJ5npFAA.js} +1 -1
- package/client-dist/assets/FloatingActionButton-Dm0404b2.js +1 -0
- package/client-dist/assets/{GitStatusPage-CH31Bai2.js → GitStatusPage-D-4o8YmB.js} +6 -6
- package/client-dist/assets/{GlobalSessionsPage-CgxvBzzy.js → GlobalSessionsPage-DD6UMomT.js} +2 -2
- package/client-dist/assets/{GlossaryContext-PMCo1K6f.js → GlossaryContext-BA5X62Ck.js} +1 -1
- package/client-dist/assets/{HeartbeatTextArea-bCQAiAc-.js → HeartbeatTextArea-ywZAleeh.js} +1 -1
- package/client-dist/assets/{HostIdentityContext-B3FgYv0w.js → HostIdentityContext-_GKYzEQ6.js} +1 -1
- package/client-dist/assets/{HostsPage-BG_bgfeL.js → HostsPage-OGegHtTp.js} +1 -1
- package/client-dist/assets/{InboxContext-BnIIp9cf.js → InboxContext-CZTibzZl.js} +1 -1
- package/client-dist/assets/{InboxPage-D1M26n9s.js → InboxPage-DuvRGWdd.js} +1 -1
- package/client-dist/assets/IssueSettings-BE0SFhgx.js +1 -0
- package/client-dist/assets/IssueSettings-CPOZbMa8.css +1 -0
- package/client-dist/assets/IssuesPage-CA4k5N50.css +1 -0
- package/client-dist/assets/IssuesPage-CWd-GCCG.js +1 -0
- package/client-dist/assets/{LifecycleWebhooksSettings-CaNL4aDT.js → LifecycleWebhooksSettings-bzUj5dsE.js} +1 -1
- package/client-dist/assets/{LocalAccessSettings-7EI7L-wA.js → LocalAccessSettings-DSezlzqb.js} +1 -1
- package/client-dist/assets/LocalMediaModal-DMrKaM1a.js +14 -0
- package/client-dist/assets/LocalSourcePage-Cttx4S9P.js +1 -0
- package/client-dist/assets/{LoginPage-C4023DZw.js → LoginPage-DVf285Ok.js} +1 -1
- package/client-dist/assets/{MarkdownPreview-ClsW_S6S.js → MarkdownPreview-TXbYZwdp.js} +2 -2
- package/client-dist/assets/{MessageAge-B2tHxpYx.js → MessageAge-7FVIZWEv.js} +1 -1
- package/client-dist/assets/MessageDeliverySettings-iykyxRVS.js +4 -0
- package/client-dist/assets/MessageInput-D1epbc4v.js +7 -0
- package/client-dist/assets/{MessageInputToolbar-C79z9qW6.js → MessageInputToolbar-CgXvBkeG.js} +8 -8
- package/client-dist/assets/MessageList-Ce3MvdtI.js +4 -0
- package/client-dist/assets/{MicrophoneIcon-BLs10fC3.js → MicrophoneIcon-Dhu4NCe6.js} +1 -1
- package/client-dist/assets/{Modal-iT2_XPlO.js → Modal-CHNqXAgW.js} +9 -9
- package/client-dist/assets/{ModelSettings-B4fCDCIJ.js → ModelSettings-DBQKdWCg.js} +1 -1
- package/client-dist/assets/{NavigationLayout-BpvrdPoS.js → NavigationLayout-UkQvkodY.js} +1 -1
- package/client-dist/assets/NewSessionForm-Ds5dM9lx.js +9 -0
- package/client-dist/assets/NewSessionPage-BERKMRdN.js +2 -0
- package/client-dist/assets/{NotificationsSettings-I2SS2U9N.js → NotificationsSettings-1RBQorDi.js} +1 -1
- package/client-dist/assets/{PageHeader-Dbb8BZq2.js → PageHeader-DYCnk788.js} +1 -1
- package/client-dist/assets/{PerformanceSettings-Ci8oh2Js.js → PerformanceSettings-CGz5ct-T.js} +1 -1
- package/client-dist/assets/ProjectAppPage-EfNtdwLY.js +1 -0
- package/client-dist/assets/ProjectAppViewer-CRnJGIt-.css +1 -0
- package/client-dist/assets/ProjectAppViewer-slr3FXj4.js +1 -0
- package/client-dist/assets/{ProjectSessionDefaultsModal-D33bQF-Q.js → ProjectSessionDefaultsModal-5yjuvV8S.js} +1 -1
- package/client-dist/assets/{ProjectTemplatesSettings-D8Sr5dDj.js → ProjectTemplatesSettings-DWZfH0JJ.js} +1 -1
- package/client-dist/assets/{ProjectsPage-CIHRcMpx.js → ProjectsPage-BJV93FM-.js} +1 -1
- package/client-dist/assets/{ProviderBadge-DmhZSMRX.js → ProviderBadge-C-UpobLD.js} +1 -1
- package/client-dist/assets/{ProviderChildSessionDetail-D3xbfVZT.js → ProviderChildSessionDetail-CmyTKIwt.js} +3 -3
- package/client-dist/assets/ProviderChildSessionPage-Clp1hlBo.js +1 -0
- package/client-dist/assets/{ProviderSignIn-DRgPyX8J.js → ProviderSignIn-d13WuHAR.js} +1 -1
- package/client-dist/assets/{ProviderSignInPage-ByQPPIRT.js → ProviderSignInPage-CkeyyeWl.js} +1 -1
- package/client-dist/assets/{ProvidersSettings-nHJSxVfC.js → ProvidersSettings-Ddj2J4N2.js} +1 -1
- package/client-dist/assets/{RecapAfterSecondsControl-BsBxbSpd.js → RecapAfterSecondsControl-D_AiWfq1.js} +1 -1
- package/client-dist/assets/{RemoteAccessSettings-Cq_gn76d.js → RemoteAccessSettings-CaE3iqqj.js} +1 -1
- package/client-dist/assets/{RemoteExecutorsSettings-CTRjrID3.js → RemoteExecutorsSettings-snCnHbRp.js} +1 -1
- package/client-dist/assets/{RenderModeContext-CZwSZkSZ.js → RenderModeContext-CuIMXqQV.js} +1 -1
- package/client-dist/assets/{RenderModeGlyph-dL8kAPff.js → RenderModeGlyph-ldDSjj9f.js} +1 -1
- package/client-dist/assets/{RouterPoolSelector-Pmu8xrjx.js → RouterPoolSelector-H3X29mOM.js} +2 -2
- package/client-dist/assets/{SchemaValidationContext-DqOi1YmB.js → SchemaValidationContext-CPr8V317.js} +1 -1
- package/client-dist/assets/{SearchPreview-DIbIaW_4.js → SearchPreview-DvMlCBIp.js} +1 -1
- package/client-dist/assets/{SecureConnection-DwcGBdlV.js → SecureConnection-DeVWJw06.js} +2 -2
- package/client-dist/assets/{SessionHeader.module-Co1boPaC.js → SessionHeader.module-DfkDdP3M.js} +1 -1
- package/client-dist/assets/{SessionMetadataContext-Bfs4TAAj.js → SessionMetadataContext-D0F_4Wp0.js} +1 -1
- package/client-dist/assets/SessionPage-xeog2S54.js +50 -0
- package/client-dist/assets/{SettingsItem-C7eQXUQf.js → SettingsItem-BgyAjvy6.js} +1 -1
- package/client-dist/assets/{SourceControlSettings-D58qSFZm.js → SourceControlSettings-B9T3f2Et.js} +1 -1
- package/client-dist/assets/{SourceFileHeaderActions-DNRytjPK.js → SourceFileHeaderActions-ByzC_I1c.js} +1 -1
- package/client-dist/assets/{SpeechControlMenu-BA2W-shI.js → SpeechControlMenu-Dhkd9fo9.js} +1 -1
- package/client-dist/assets/SpeechSettings-DEZsiCyG.js +2 -0
- package/client-dist/assets/{SpeechSmartTurnControls-DgT6bhA4.js → SpeechSmartTurnControls-BdmFc3C9.js} +1 -1
- package/client-dist/assets/{StorageSettings-DsvbVixL.js → StorageSettings-CiuHgnzi.js} +1 -1
- package/client-dist/assets/{ThinkingControls-Bi0PcWyP.js → ThinkingControls-Bf_4_n66.js} +1 -1
- package/client-dist/assets/ToolbarSettings-DupwvB70.js +1 -0
- package/client-dist/assets/{TrackerStatusBadge-CYRbIvfC.js → TrackerStatusBadge-nbexFcyV.js} +1 -1
- package/client-dist/assets/{UsersSettings-BjSX_kKq.js → UsersSettings-CrGxlDav.js} +1 -1
- package/client-dist/assets/{ViewerModePage-BlsOYFrz.js → ViewerModePage-DCVHfUMc.js} +1 -1
- package/client-dist/assets/ViewerWindowActions-DV5bxAAy.js +1 -0
- package/client-dist/assets/VoiceInputButton-4SbrfhMk.js +1 -0
- package/client-dist/assets/{WorkstreamsPage-B10INHZx.js → WorkstreamsPage-CUsI5c-n.js} +1 -1
- package/client-dist/assets/YaServerProvider-Dt9IBXDZ.js +31 -0
- package/client-dist/assets/{YepAnywhereLogo-CIpZ5dke.js → YepAnywhereLogo-ccRUdgT-.js} +1 -1
- package/client-dist/assets/{abnfDiagram-VCTEODGH-sCU1nPAM.js → abnfDiagram-VCTEODGH-Dysqh90e.js} +1 -1
- package/client-dist/assets/{arc-DjiGPMMi.js → arc-BfmRVkD-.js} +1 -1
- package/client-dist/assets/{architectureDiagram-5GKGNRK7-3RzD-zEy.js → architectureDiagram-5GKGNRK7-Bp1GI0XP.js} +1 -1
- package/client-dist/assets/{attachmentFileNames-clPM_F1w.js → attachmentFileNames-CGZzPAjE.js} +1 -1
- package/client-dist/assets/{blockDiagram-I7D4REHJ-BU6A9-4i.js → blockDiagram-I7D4REHJ-9vaOU_YP.js} +1 -1
- package/client-dist/assets/{browserTab-BXElY_d5.js → browserTab-CLF9iteD.js} +1 -1
- package/client-dist/assets/{c4Diagram-7LVT6UL2-CxusgaWH.js → c4Diagram-7LVT6UL2-Cj9qrKnL.js} +1 -1
- package/client-dist/assets/channel-Bx4xMN3u.js +1 -0
- package/client-dist/assets/{chunk-2Q5K7J3B-CBi0JNQU.js → chunk-2Q5K7J3B-DD_50QMk.js} +1 -1
- package/client-dist/assets/{chunk-5VM5RSS4-CskSgDiX.js → chunk-5VM5RSS4-Ba0GJEZb.js} +1 -1
- package/client-dist/assets/{chunk-F27PBJKO-Dl65caQS.js → chunk-F27PBJKO-D3_CXW_b.js} +1 -1
- package/client-dist/assets/{chunk-IMKFNOWR-BHAs2B4i.js → chunk-IMKFNOWR-Bx7Jus4R.js} +1 -1
- package/client-dist/assets/{chunk-JWPE2WC7-CRWKI8Z7.js → chunk-JWPE2WC7-1B1j7YcM.js} +1 -1
- package/client-dist/assets/{chunk-POPQ4Y6H-CzdOCWYO.js → chunk-POPQ4Y6H-CgMmmF_H.js} +1 -1
- package/client-dist/assets/{chunk-SVP7TREG-DxoiR2Mk.js → chunk-SVP7TREG-DDSE5Wq6.js} +1 -1
- package/client-dist/assets/{chunk-TICWLB2K-cve5023y.js → chunk-TICWLB2K-DUZGu3ce.js} +1 -1
- package/client-dist/assets/{chunk-XXDRQBXY-mSd5ZgMm.js → chunk-XXDRQBXY-oJdOaI50.js} +1 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CTAikA-f.js +1 -0
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CTAikA-f.js +1 -0
- package/client-dist/assets/{clientSummaryStore-Cr4yWo-Y.js → clientSummaryStore-Dsgo1zWK.js} +1 -1
- package/client-dist/assets/{compactSettingsControls-BI6RhVII.js → compactSettingsControls-CgeiII5J.js} +1 -1
- package/client-dist/assets/{cose-bilkent-JH36ORCC-CoI7dvL-.js → cose-bilkent-JH36ORCC-CQKgCYKk.js} +1 -1
- package/client-dist/assets/{cynefin-OW5HDTMX-B6We6WUI.js → cynefin-OW5HDTMX-S85H965d.js} +1 -1
- package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BUzaWybE.js → cynefinDiagram-5FMLGOSQ-B4ri3nX3.js} +1 -1
- package/client-dist/assets/{dagre-GXQ25YYZ-BYhpPlP3.js → dagre-GXQ25YYZ-DoQhim_k.js} +1 -1
- package/client-dist/assets/{diagram-S7CK7UJ4-FkUIxzy0.js → diagram-S7CK7UJ4-DYy2x0Ta.js} +1 -1
- package/client-dist/assets/{diagram-UQ7AKVKN-B0_3U7US.js → diagram-UQ7AKVKN-DxCcDSWg.js} +1 -1
- package/client-dist/assets/{diagram-VSXAHHWV-DNF_DVVi.js → diagram-VSXAHHWV-tDbIkKUf.js} +1 -1
- package/client-dist/assets/{diagram-VX7I27RA-DgeEEgTw.js → diagram-VX7I27RA-Qdg9iySG.js} +1 -1
- package/client-dist/assets/{diagram-Z3DM3KII-S5soWFl_.js → diagram-Z3DM3KII-BTpWBWAH.js} +1 -1
- package/client-dist/assets/{ebnfDiagram-PWID7BFC-kfLCEtAi.js → ebnfDiagram-PWID7BFC-DBHufTpw.js} +1 -1
- package/client-dist/assets/{erDiagram-RLTQ6QDP-xI7CqDO3.js → erDiagram-RLTQ6QDP-DGkKs4b_.js} +1 -1
- package/client-dist/assets/{flowDiagram-HODETNUW-CVSTa2nO.js → flowDiagram-HODETNUW-DVKc1wL6.js} +1 -1
- package/client-dist/assets/{frontendReload-54GeNGj9.js → frontendReload-B4jfUIeG.js} +1 -1
- package/client-dist/assets/{ganttDiagram-EL5Y4UJY-CI03o3Me.js → ganttDiagram-EL5Y4UJY-lIq_NgbX.js} +1 -1
- package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-BlnPaeW9.js → gitGraphDiagram-WWUBYQGX-BjX5H3_l.js} +1 -1
- package/client-dist/assets/index-BSMD-gHP.js +1 -0
- package/client-dist/assets/index-BhTv6hAY.js +64 -0
- package/client-dist/assets/{index-DrKoeozX.js → index-CdtGIhcy.js} +1 -1
- package/client-dist/assets/{index-1dMuvv06.js → index-DjQ2chjT.js} +1 -1
- package/client-dist/assets/{index-DvjdkG8Q.js → index-DnFlh5Zf.js} +2 -2
- package/client-dist/assets/{infoDiagram-27XIBGKW-C7GxDcfT.js → infoDiagram-27XIBGKW-BRxpTbKN.js} +1 -1
- package/client-dist/assets/{ishikawaDiagram-5VMMS53U-DBZVNUMP.js → ishikawaDiagram-5VMMS53U-BXr5zlby.js} +1 -1
- package/client-dist/assets/{journeyDiagram-3NMN7TZE-CT3nDRx4.js → journeyDiagram-3NMN7TZE-BO5vc5JN.js} +1 -1
- package/client-dist/assets/{kanban-definition-UXKFOSKX-Dgns21Ky.js → kanban-definition-UXKFOSKX-FJ2uF-MR.js} +1 -1
- package/client-dist/assets/{layout-CCGb-lVs.js → layout-BQ-_ERR1.js} +1 -1
- package/client-dist/assets/{limitedUserBrowserDefaults-C6cuD-wF.js → limitedUserBrowserDefaults-CwcMxPe5.js} +1 -1
- package/client-dist/assets/{limitedUserDefaultsClient-BPifr9h5.js → limitedUserDefaultsClient-CLg4zzsz.js} +1 -1
- package/client-dist/assets/{linear-BO4yAkdf.js → linear-BwwPzSrY.js} +1 -1
- package/client-dist/assets/{long-context-effort-warning-By1TxT0F.js → long-context-effort-warning-ims8_Hv4.js} +1 -1
- package/client-dist/assets/main-BX4yZXDF.js +43 -0
- package/client-dist/assets/mermaid.core-D26C4xkK.js +312 -0
- package/client-dist/assets/micTitleActivity-yQ5HgRnF.js +1 -0
- package/client-dist/assets/{mindmap-definition-YA3MSWOX-W-bMySj1.js → mindmap-definition-YA3MSWOX-Bv_gNy8_.js} +1 -1
- package/client-dist/assets/{newSessionPrefill-CHZfBHqQ.js → newSessionPrefill-BC5a8IpP.js} +1 -1
- package/client-dist/assets/{pegDiagram-XKGWAZYB-BMSL3Swk.js → pegDiagram-XKGWAZYB-CBB23R00.js} +1 -1
- package/client-dist/assets/{permissionModes-DJvRe3vP.js → permissionModes-C5_i_UDc.js} +1 -1
- package/client-dist/assets/{pieDiagram-E7YTZNPT-fzcyJjCG.js → pieDiagram-E7YTZNPT-C0uC29fl.js} +1 -1
- package/client-dist/assets/{quadrantDiagram-AXDQQJYC-EQecMBLb.js → quadrantDiagram-AXDQQJYC-BYcINwOa.js} +1 -1
- package/client-dist/assets/{railroadDiagram-O6MQD6OU-DvY2buxp.js → railroadDiagram-O6MQD6OU-DwLq6WlM.js} +1 -1
- package/client-dist/assets/{recentProjectPathLinks-Km2YzBV7.js → recentProjectPathLinks-Bp8ZFFVQ.js} +1 -1
- package/client-dist/assets/{registerServiceWorker-DvFS41on.js → registerServiceWorker-BEwfu1re.js} +1 -1
- package/client-dist/assets/{remoteRoutePaths-Crh_32jX.js → remoteRoutePaths-DpabBbC6.js} +1 -1
- package/client-dist/assets/{requirementDiagram-BXWQKSXE-CIdu0GYt.js → requirementDiagram-BXWQKSXE-H7ltzzju.js} +1 -1
- package/client-dist/assets/{sankeyDiagram-P5KCCOFB-BzupSIep.js → sankeyDiagram-P5KCCOFB-DQ_BH-ec.js} +1 -1
- package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-BCz8DLSg.js → sequenceDiagram-WJ2MYXX4-CE5cJN0V.js} +1 -1
- package/client-dist/assets/{sessionNavigationState-pHYi3UxP.js → sessionNavigationState-nTMUDlwU.js} +1 -1
- package/client-dist/assets/sessionVhostApps-DbEDY32Q.js +1 -0
- package/client-dist/assets/{sessionViewerController-BKTu5sj-.js → sessionViewerController-BGKUu-Zg.js} +1 -1
- package/client-dist/assets/{sessionViewerPlacement-D4lCtx-b.js → sessionViewerPlacement-cjpznhMG.js} +1 -1
- package/client-dist/assets/{sizeCapture-INFHLROL-nGK4qjL2.js → sizeCapture-INFHLROL-DTs5ZL4J.js} +1 -1
- package/client-dist/assets/{sourceControlNavigationState-B1jkV2pd.js → sourceControlNavigationState-D8WJCFc_.js} +1 -1
- package/client-dist/assets/{sourceTransportPaths-COX454wy.js → sourceTransportPaths-BTR7eFi5.js} +1 -1
- package/client-dist/assets/{speechDraftTransaction-cFbNnQHh.js → speechDraftTransaction-Bn7ppW5b.js} +1 -1
- package/client-dist/assets/{stateDiagram-D77RDMKH-CFix9P5-.js → stateDiagram-D77RDMKH-CGP-PcgJ.js} +1 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-BeSd02wx.js +1 -0
- package/client-dist/assets/{swimlanes-42K2YHIH-3cL-IerY.js → swimlanes-42K2YHIH-BUyuyk1Q.js} +1 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-DJ-GHCq1.js +8 -0
- package/client-dist/assets/{timeline-definition-24CTP7MA-Cc4302bU.js → timeline-definition-24CTP7MA-CbhEbRKF.js} +1 -1
- package/client-dist/assets/{uiTrace-DGW4HhGn.js → uiTrace-CvAgW12D.js} +1 -1
- package/client-dist/assets/{useAcliCommentarySetting-Br7kBvtE.js → useAcliCommentarySetting-B9uDJlBW.js} +1 -1
- package/client-dist/assets/{useActivityBusState-CzYhbKlD.js → useActivityBusState-CJk1MiYW.js} +1 -1
- package/client-dist/assets/{useAttachmentUploadQuality-B_kWKCMo.js → useAttachmentUploadQuality-Bx88B-aj.js} +1 -1
- package/client-dist/assets/{useBackgroundRevalidation-BpXlX3fs.js → useBackgroundRevalidation-SUxysljm.js} +1 -1
- package/client-dist/assets/{useCodexUpdateStatus-w-5NajaG.js → useCodexUpdateStatus-CihSrx5C.js} +1 -1
- package/client-dist/assets/{useComposerPromptRail-DL5r3CAD.js → useComposerPromptRail-DcRpLRmu.js} +1 -1
- package/client-dist/assets/{useConnectedDevices-BJILFKIz.js → useConnectedDevices-Ciuv3J4o.js} +1 -1
- package/client-dist/assets/useDocumentTitle-wGc9OsUg.js +1 -0
- package/client-dist/assets/{useEmulators-cGrsK5mh.js → useEmulators-CQCzysEZ.js} +1 -1
- package/client-dist/assets/{useFileActivity-Y1m-dClR.js → useFileActivity-CpuLfNl9.js} +1 -1
- package/client-dist/assets/{useFloatingActionButtonEnabled-CgWMCFmO.js → useFloatingActionButtonEnabled-BKJ8RfOu.js} +1 -1
- package/client-dist/assets/{useForkSummaryAutoOpen-qfV9Dgsp.js → useForkSummaryAutoOpen-DRGGsQgo.js} +1 -1
- package/client-dist/assets/useGeneratedTitleLength-R5Q60VSi.js +1 -0
- package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-DXTp5fUz.js → useKeepMobileKeyboardOpenAfterDelivery-DXMbsQWe.js} +1 -1
- package/client-dist/assets/{useLiveToolOutputEnabled-rQskgO0g.js → useLiveToolOutputEnabled-Qb_QFuzk.js} +1 -1
- package/client-dist/assets/{useModelSettings-DMjdRGMd.js → useModelSettings-BSbgwkL8.js} +1 -1
- package/client-dist/assets/{useNotifyInApp-BBmQnbh7.js → useNotifyInApp-BucZAqVF.js} +1 -1
- package/client-dist/assets/{useOnboarding-CF1WDG2d.js → useOnboarding-BzoWTXrR.js} +1 -1
- package/client-dist/assets/{usePanelSlideAnimations-C5qJWoVe.js → usePanelSlideAnimations-XdQhGgr-.js} +1 -1
- package/client-dist/assets/{useProjectAppComposing-C8gaOUg9.js → useProjectAppComposing-DBPyVUba.js} +1 -1
- package/client-dist/assets/{useProjectTemplateChoices-C0Uxthrq.js → useProjectTemplateChoices-niJIV5HQ.js} +1 -1
- package/client-dist/assets/{useProviders-B7fACEDA.js → useProviders-B54BXYv3.js} +1 -1
- package/client-dist/assets/{useQuestionAsideSetting-CR1M9_u6.js → useQuestionAsideSetting-CILJe25J.js} +1 -1
- package/client-dist/assets/{useRecentSessions-DBXvckSG.js → useRecentSessions-CQJcnOeU.js} +1 -1
- package/client-dist/assets/{useRelativeNow-B7XFLfKm.js → useRelativeNow-C2ME3OxV.js} +1 -1
- package/client-dist/assets/{useReloadNotifications-D2NJM_v_.js → useReloadNotifications-PKjb8H55.js} +1 -1
- package/client-dist/assets/{useRemoteExecutors-j1cpFGnw.js → useRemoteExecutors-CMd01rZ7.js} +1 -1
- package/client-dist/assets/{useSearchConcurrency-DlrPqVlr.js → useSearchConcurrency-BIVnIche.js} +1 -1
- package/client-dist/assets/useSessionRightPaneSetting-C5YgsyBy.js +1 -0
- package/client-dist/assets/{useSidebarWidth-DnB-wKom.js → useSidebarWidth-op0qbgd4.js} +1 -1
- package/client-dist/assets/{useSourceControlCleanLanding-ByQI1cWZ.js → useSourceControlCleanLanding-BE8h6VMD.js} +1 -1
- package/client-dist/assets/{useStableToolPreviewRendering-DtPpSoyX.js → useStableToolPreviewRendering-Bdiaz4I5.js} +1 -1
- package/client-dist/assets/{useTabTitleActivityPreference-DH0VanNM.js → useTabTitleActivityPreference-ZJ19N5_Q.js} +1 -1
- package/client-dist/assets/{useVhostAccess-D6l6YouM.js → useVhostAccess-CttxSyIC.js} +1 -1
- package/client-dist/assets/{useWorkflowTags-5i3ohGrH.js → useWorkflowTags-CsPhaG2p.js} +1 -1
- package/client-dist/assets/{vennDiagram-4TSXK5OY-BJaUYJ8y.js → vennDiagram-4TSXK5OY-DkXe2h8B.js} +1 -1
- package/client-dist/assets/{wardleyDiagram-VM6X3IG4-DEgI0m1V.js → wardleyDiagram-VM6X3IG4-BnBGhOBQ.js} +1 -1
- package/client-dist/assets/{xychartDiagram-S5SC5T6Z-BuAw5_xn.js → xychartDiagram-S5SC5T6Z-Bxkl9DZJ.js} +1 -1
- package/client-dist/index.html +3 -3
- package/client-dist/sw.js +2 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +10 -2
- package/dist/app.js.map +1 -1
- package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
- package/dist/artifacts/ArtifactServer.js +3 -20
- package/dist/artifacts/ArtifactServer.js.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.d.ts.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.js +31 -1
- package/dist/artifacts/ProjectAppDelivery.js.map +1 -1
- package/dist/artifacts/pdfInFrame.d.ts +17 -0
- package/dist/artifacts/pdfInFrame.d.ts.map +1 -0
- package/dist/artifacts/pdfInFrame.js +30 -0
- package/dist/artifacts/pdfInFrame.js.map +1 -0
- package/dist/projects/ProjectAppStore.d.ts +0 -1
- package/dist/projects/ProjectAppStore.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.d.ts +88 -0
- package/dist/projects/ProjectServiceManager.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.js +4 -2
- package/dist/projects/ProjectServiceManager.js.map +1 -1
- package/dist/projects/template-runtime.d.ts +5 -0
- package/dist/projects/template-runtime.d.ts.map +1 -1
- package/dist/projects/template-runtime.js +3 -1
- package/dist/projects/template-runtime.js.map +1 -1
- package/dist/routes/issue-content.d.ts +6 -0
- package/dist/routes/issue-content.d.ts.map +1 -0
- package/dist/routes/issue-content.js +25 -0
- package/dist/routes/issue-content.js.map +1 -0
- package/dist/routes/issues.d.ts +2 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +34 -4
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/project-app.d.ts.map +1 -1
- package/dist/routes/project-app.js +27 -2
- package/dist/routes/project-app.js.map +1 -1
- package/dist/routes/project-creation.d.ts +7 -0
- package/dist/routes/project-creation.d.ts.map +1 -1
- package/dist/routes/project-creation.js +12 -0
- package/dist/routes/project-creation.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +33 -11
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +2 -0
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/speech.d.ts.map +1 -1
- package/dist/routes/speech.js +3 -1
- package/dist/routes/speech.js.map +1 -1
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +1 -0
- package/dist/routes/version.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +10 -2
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +7 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +10 -0
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +33 -3
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/services/RendezWatchService.d.ts +3 -0
- package/dist/services/RendezWatchService.d.ts.map +1 -1
- package/dist/services/RendezWatchService.js +6 -0
- package/dist/services/RendezWatchService.js.map +1 -1
- package/dist/services/issues/IssueStore.d.ts +24 -0
- package/dist/services/issues/IssueStore.d.ts.map +1 -1
- package/dist/services/issues/IssueStore.js +67 -11
- package/dist/services/issues/IssueStore.js.map +1 -1
- package/dist/services/issues/confirm.d.ts.map +1 -1
- package/dist/services/issues/confirm.js +37 -3
- package/dist/services/issues/confirm.js.map +1 -1
- package/dist/services/issues/content.d.ts +36 -0
- package/dist/services/issues/content.d.ts.map +1 -0
- package/dist/services/issues/content.js +328 -0
- package/dist/services/issues/content.js.map +1 -0
- package/dist/services/issues/status.d.ts.map +1 -1
- package/dist/services/issues/status.js +12 -4
- package/dist/services/issues/status.js.map +1 -1
- package/dist/services/rendezSessions.d.ts +2 -1
- package/dist/services/rendezSessions.d.ts.map +1 -1
- package/dist/services/rendezSessions.js +17 -3
- package/dist/services/rendezSessions.js.map +1 -1
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +9 -2
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/codex-rollout-window.d.ts +2 -0
- package/dist/sessions/codex-rollout-window.d.ts.map +1 -1
- package/dist/sessions/codex-rollout-window.js +1 -0
- package/dist/sessions/codex-rollout-window.js.map +1 -1
- package/dist/storage/discovery-sqlite.d.ts.map +1 -1
- package/dist/storage/discovery-sqlite.js +2 -0
- package/dist/storage/discovery-sqlite.js.map +1 -1
- package/dist/storage/migrations/012-issue-content.d.ts +3 -0
- package/dist/storage/migrations/012-issue-content.d.ts.map +1 -0
- package/dist/storage/migrations/012-issue-content.js +14 -0
- package/dist/storage/migrations/012-issue-content.js.map +1 -0
- package/dist/supervisor/Process.d.ts +10 -1
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +22 -0
- package/dist/supervisor/Process.js.map +1 -1
- package/package.json +5 -5
- package/client-dist/assets/App-BIHEvA6Q.js +0 -2
- package/client-dist/assets/AppearanceSettings-CDplyLIJ.js +0 -2
- package/client-dist/assets/FileViewer-Crw6E_2M.js +0 -63
- package/client-dist/assets/FloatingActionButton-BMjNa4vb.js +0 -1
- package/client-dist/assets/IssueSettings-BLIuCNxO.css +0 -1
- package/client-dist/assets/IssueSettings-Dr6JKfQf.js +0 -1
- package/client-dist/assets/IssuesPage-DOfq79D-.css +0 -1
- package/client-dist/assets/IssuesPage-QmPw-DCB.js +0 -1
- package/client-dist/assets/LocalMediaModal-5au-Ku3n.js +0 -14
- package/client-dist/assets/LocalSourcePage-YurHSY4M.js +0 -1
- package/client-dist/assets/MessageDeliverySettings-D2fzmys9.js +0 -4
- package/client-dist/assets/MessageInput-BUZmOeKI.js +0 -7
- package/client-dist/assets/MessageList-CJgDrWOy.js +0 -4
- package/client-dist/assets/NewSessionForm-4104gBMd.js +0 -9
- package/client-dist/assets/NewSessionPage-AzsvU8Mk.js +0 -2
- package/client-dist/assets/ProjectAppPage-CoxqMJ-6.js +0 -1
- package/client-dist/assets/ProjectAppViewer-D5Juq0Mx.css +0 -1
- package/client-dist/assets/ProjectAppViewer-D_8Lq6Oy.js +0 -1
- package/client-dist/assets/ProviderChildSessionPage-CrSrF2ST.js +0 -1
- package/client-dist/assets/SessionPage-DjR-n2cx.js +0 -50
- package/client-dist/assets/SpeechSettings-CObFsnUu.js +0 -2
- package/client-dist/assets/ToolbarSettings-CyhCBLrg.js +0 -1
- package/client-dist/assets/ViewerWindowActions-DM1Jwlo9.js +0 -1
- package/client-dist/assets/VoiceInputButton-jq6m-rwS.js +0 -1
- package/client-dist/assets/YaServerProvider-fGtUHCJb.js +0 -1
- package/client-dist/assets/channel-BMLLCpix.js +0 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CriLRYaG.js +0 -1
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CriLRYaG.js +0 -1
- package/client-dist/assets/index-C-4wHkcA.js +0 -46
- package/client-dist/assets/index-D73NQkRu.js +0 -1
- package/client-dist/assets/main-BpQ_EIjC.js +0 -43
- package/client-dist/assets/mermaid.core-CnOzO4__.js +0 -312
- package/client-dist/assets/sessionVhostApps-DJY4ZLda.js +0 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-D-_jRHCc.js +0 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-CMY1RzMZ.js +0 -8
- package/client-dist/assets/useDocumentTitle-CeauK1Xu.js +0 -1
- package/client-dist/assets/useGeneratedTitleLength-0cRz1f9b.js +0 -1
- package/client-dist/assets/useSessionRightPaneSetting-BOgcH2kB.js +0 -1
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var fl=Object.defineProperty;var hl=(e,t,n)=>t in e?fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>hl(e,typeof t!="symbol"?t+"":t,n);import{j as i,r as c,b as xr,X as Ls,a as _s,i as or,s as ml,d as bo,ag as pl}from"./clientSummaryStore-Cr4yWo-Y.js";import{c as te,i as So,U as Ve,g as Ct,u as Ie,w as we,bX as ko,t as Ot,bv as Ht,bY as Co,bJ as gl,bs as Sn,bm as wl,bw as vl,bZ as xl,d as yl}from"./main-BpQ_EIjC.js";import{a as Wt,c as Es,b as bl,d as Sl,e as kl,r as Cl,u as Mn,t as ir,g as Ll}from"./sourceTransportPaths-COX454wy.js";import{u as yr}from"./SessionMetadataContext-Bfs4TAAj.js";import{g as _l,e as Kt,d as br,h as El,i as jl,r as Rl,j as Ml,k as qn,p as Al,l as Pl,m as Tl,n as Fl,o as $l,q as Nl,s as Bl,t as Dl,V as Il,S as Ol,v as Hl,b as Ul,L as Vl,w as js,x as ql}from"./LocalMediaModal-5au-Ku3n.js";import{a as Wl,f as Sr,c as Kl,w as Bt,x as Ut,y as kr,z as Rs,S as zl,A as Gl,u as Lt,o as Xl,s as Yl,m as Ql,Q as Ms,b as Cr,r as Jl,M as Lo,i as Zl,B as ec,D as tc,E as As,d as nc}from"./Modal-iT2_XPlO.js";import{n as Vt,g as qt,a as Lr,b as _o,i as lr,d as Eo,m as _r}from"./text-B4tk85DK.js";import{c as rc,aM as sc,$ as oc,s as lt,b9 as ic,bu as lc,bv as cc,S as Wn,_ as ac,bj as uc}from"./index-C-4wHkcA.js";import{i as jo,f as Ro,a as dc}from"./usePanelSlideAnimations-C5qJWoVe.js";import{a5 as kn,u as Mo,a6 as fc,a7 as hc,a8 as mc,a9 as pc,G as Ps,o as gc,Z as wc,$ as vc,a2 as xc,_ as yc,K as bc,R as Ts,U as Fs,V as Sc,W as kc,X as Cc,Y as Lc,aa as _c}from"./GlossaryContext-PMCo1K6f.js";import{a as at}from"./appHref-ByaEnJGJ.js";import{V as $s}from"./ViewerWindowActions-DM1Jwlo9.js";import{R as Ec,e as Ao,c as cr,F as Po,l as To,i as ar,f as jc,g as Rc}from"./sessionVhostApps-DJY4ZLda.js";import{a as Mc,M as Fo,u as Ac,c as Ns,F as Pc,b as Tc,d as Fc,g as $c}from"./MarkdownPreview-ClsW_S6S.js";import Nc from"./katex-DLorvT8M.js";import{a as Bc,c as Dc}from"./RenderModeContext-CZwSZkSZ.js";import{f as $o,s as Ic,r as Oc,l as Hc,c as Uc}from"./uiTrace-DGW4HhGn.js";import{b as Vc,g as qc,d as Wc,c as Bs,m as Kc,p as No}from"./sessionViewerController-BKTu5sj-.js";import{C as zc}from"./CopyTextButton-Bpeo8K_-.js";import{a as Gc}from"./RenderModeGlyph-dL8kAPff.js";const Xc=Object.freeze({"\\textsc":"\\text{#1}","\\mbox":"\\text{#1}","\\mathbbm":"\\mathbb{#1}","\\mathds":"\\mathbb{#1}","\\O":"\\text{Ø}","\\textsubscript":"_{\\text{#1}}","\\nicefrac":"{}^{#1}\\!/\\!_{#2}"});function Yc(){return{...Xc}}const Qc=/\\(color|textcolor|colorbox|pagecolor)\s*\[\s*([A-Za-z]+)\s*\]\s*\{([^{}]*)\}/g;function ln(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function Jc(e,t){const n=t.split(",").map(o=>o.trim()),r=n.map(Number),s=r.every(o=>Number.isFinite(o));switch(e){case"rgb":return n.length===3&&s?`#${r.map(o=>ln(o*255)).join("")}`:null;case"RGB":return n.length===3&&s?`#${r.map(ln).join("")}`:null;case"HTML":return/^[0-9A-Fa-f]{6}$/.test(t.trim())?`#${t.trim()}`:null;case"gray":{if(n.length!==1||!s)return null;const o=ln((r[0]??0)*255);return`#${o}${o}${o}`}case"cmyk":{if(n.length!==4||!s)return null;const[o=0,l=0,a=0,d=0]=r;return`#${[o,l,a].map(u=>ln(255*(1-u)*(1-d))).join("")}`}default:return null}}function Zc(e){return e.includes("[")?e.replace(Qc,(t,n,r,s)=>{if(n==="pagecolor")return"";const o=Jc(r,s);return o?`\\${n}{${o}}`:t}):e}const gp=32,wp=64*1024;function vp(e){const t=e.trim().replace(/^#\s*/,""),n=/^acli: 1(?:\s+(.*))?$/.exec(t),r=/^acli-capabilities:\s+(.+)$/.exec(t),s=((n==null?void 0:n[1])??(r==null?void 0:r[1])??"").split(/\s+/);return s.includes(n?"+commentary-lines":"commentary-lines/1")?"lines":s.includes(n?"+commentary":"commentary/1")?"json":null}function ea(e){JSON.parse(e);const t=/\s*("(?:\\.|[^"\\])*"|[{}[\],:]|[^\s{}[\],:]+)/y;let n=0;const r=()=>{t.lastIndex=n;const o=t.exec(e);if(!o)throw new Error("Missing JSON token");return n=t.lastIndex,{text:o[1],start:n-o[1].length}},s=o=>{if(o>128)throw new Error("JSON nesting exceeds commentary limit");const l=r(),a={start:l.start,end:n};if(l.text==="{"){a.members=[];const d=new Set;for(;;){const u=r();if(u.text==="}")break;const h=JSON.parse(u.text);if(d.has(h))throw new Error("Ambiguous duplicate JSON member");if(d.add(h),r(),a.members.push({key:h,start:u.start,value:s(o+1)}),r().text==="}")break}a.end=n}else if(l.text==="["){a.items=[];const d=n;if(r().text!=="]"){n=d;do a.items.push(s(o+1));while(r().text!=="]")}a.end=n}return a};return s(0)}function Ds(e,t){const n=JSON.parse(e.slice(t.start,t.end));if(!n||Array.isArray(n)||typeof n!="object"||Object.keys(n).length!==1||!Array.isArray(n.commentary)||n.commentary.length===0)return null;const r=[];for(const s of n.commentary){if(!s||typeof s!="object"||Array.isArray(s)||Object.keys(s).length!==1||typeof s.text!="string"||!s.text.trim())return null;r.push(s.text)}return r}function Bo(e,t){const n=[];let r=t.start;for(const s of e.removed)s.start<t.start||s.end>t.end||(n.push(e.source.slice(r,s.start)),r=s.end);return n.push(e.source.slice(r,t.end)),n.join("")}function xp(e,t){return t.context?Bo(e,t.context):null}function yp(e){const t={source:e,data:e,commentary:[],removed:[],metadataOnly:!1};if(e.length>1024*1024)return t;if(!e.includes("_acli")&&!e.includes("\\")){try{JSON.parse(e),t.json=!0}catch{}return t}let n;try{n=ea(e)}catch{return t}t.json=!0;const r=o=>{var l;return((l=o.members)==null?void 0:l.length)===1&&o.members[0].key==="_acli"&&Ds(e,o.members[0].value)!==null},s=(o,l,a)=>{var d;if(o.items){let u=null;o.items.forEach((h,m)=>{s(h,`${l}/${m}`,u),r(h)||(u=h)})}(d=o.members)==null||d.forEach((u,h,m)=>{if(u.key!=="_acli"){s(u.value,`${l}/${u.key.replace(/~/g,"~0").replace(/\//g,"~1")}`,null);return}const w=Ds(e,u.value);if(!w)return;const x=r(o)?a:o===n?null:o;w.forEach((p,v)=>{t.commentary.push({id:`${l}/_acli/commentary/${v}`,text:p,context:x})});const f=m[h+1],b=m[h-1];t.removed.push({start:!f&&b?b.value.end:u.start,end:f?f.start:u.value.end})})};return s(n,"",null),t.removed.sort((o,l)=>o.start-l.start),t.metadataOnly=r(n),t.data=Bo(t,{start:0,end:e.length}),t}function bp(e){const t="# _acli.commentary: ",n=e.startsWith(t)?e.slice(t.length).replace(/\r?\n$/,""):"",r=e.length<=1024*1024&&!!n.trim();return{source:e,data:r?"":e,commentary:r?[{id:"line",text:n,context:null}]:[],removed:r?[{start:0,end:e.length}]:[],metadataOnly:r}}class ta{constructor(t="json"){st(this,"fragments",[]);st(this,"depth",0);st(this,"quoted",!1);st(this,"escaped",!1);st(this,"json",!1);st(this,"started",!1);this.format=t}append(t){const n=[];let r=0;for(let s=0;s<t.length;s++){const o=t[s];!this.started&&!/\s/.test(o)&&(this.started=!0,this.json=this.format==="json"&&(o==="{"||o==="[")),this.json&&(this.quoted?this.escaped?this.escaped=!1:o==="\\"?this.escaped=!0:o==='"'&&(this.quoted=!1):o==='"'?this.quoted=!0:o==="{"||o==="["?this.depth++:(o==="}"||o==="]")&&this.depth--),o===`
|
|
2
|
-
`&&(!this.json||!this.quoted&&this.depth<=0)&&(this.fragments.push(t.slice(r,s+1)),n.push(...this.finish()),r=s+1)}return r<t.length&&this.fragments.push(t.slice(r)),n}finish(){const t=this.fragments.join("");return this.fragments=[],this.depth=0,this.quoted=!1,this.escaped=!1,this.json=!1,this.started=!1,t?[t]:[]}}const na=8e3,ra=120,sa=3;function Sp(e){return(e.split(/\r?\n/u).map(n=>n.trim()).find(Boolean)??"Source review").slice(0,ra)}function oa(e,t,n=sa,r="new"){if(!Number.isInteger(t)||t<0)return null;let s=0;for(const o of e){if(t<s+o.lines.length)return ia(o,t-s,n,r);s+=o.lines.length}return null}function ia(e,t,n,r){var m,w;let s=e.oldStart,o=e.newStart;for(let x=0;x<t;x++){const f=(m=e.lines[x])==null?void 0:m[0];f==="-"?s++:(f==="+"||s++,o++)}const l=(w=e.lines[t])==null?void 0:w[0];let a,d,u;l==="-"?(a="old",d=s,u=null):l==="+"?(a="new",d=null,u=o):(a=r,d=s,u=o);const h=Math.max(0,t-n);return{side:a,oldLine:d,newLine:u,snippet:la(e.lines,t,n),snippetAnchorOffset:t-h}}function la(e,t,n){const r=Math.max(0,t-n),s=Math.min(e.length,t+n+1),o=[];for(let l=r;l<s;l++)o.push((e[l]??"").slice(1));return o.join(`
|
|
3
|
-
`).slice(0,na)}const cn=/(?:https?:\/\/|www\.)[^\s<>]+/gi,ca=new Set([".",",",":",";","!","?","'",'"',"`","*","_","~"]),aa={")":"(","]":"[","}":"{"};function Is(e,t){let n=0;for(const r of e)r===t&&(n+=1);return n}function ua(e){let t=e;for(;;){const n=t[t.length-1];if(n===void 0)break;if(ca.has(n)){t=t.slice(0,-1);continue}const r=aa[n];if(r){const s=t.slice(0,-1);if(Is(s,r)>Is(s,n))break;t=t.slice(0,-1);continue}break}return t}function da(e){const t=e.startsWith("www.")?`https://${e}`:e;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname.includes(".")?null:t}catch{return null}}function Do(e,t){const n=[];let r=0;cn.lastIndex=0;for(let s=cn.exec(e);s!==null;s=cn.exec(e)){const o=ua(s[0]),l=da(o),a=s.index+o.length,d=(t==null?void 0:t.suppressTrailingUrl)===!0&&a>=e.length;!l||d||(s.index>r&&n.push({type:"text",text:e.slice(r,s.index)}),n.push({type:"url",text:o,href:l}),r=a,cn.lastIndex=a)}return r<e.length&&n.push({type:"text",text:e.slice(r)}),n}function Io(e){return/https?:\/\/|www\./i.test(e)}function kp(e,t,n){if(!Io(e))return n(e);const r=t.external?' target="_blank" rel="noopener noreferrer"':"";return Do(e,t).map(s=>s.type==="url"&&s.href?`<a href="${n(s.href)}"${r}>${n(s.text)}</a>`:n(s.text)).join("")}const fa=/^([\w.-]+)\[(\d+)\]\{([^}]*)\}:\s*$/;function ha(e){const t=[];let n="",r=!1,s=!1;for(let o=0;o<e.length;o+=1){const l=e[o];if(r)l==='"'?e[o+1]==='"'?(n+='"',o+=1):(r=!1,s=!0):n+=l;else if(s){if(l!==",")return null;t.push(n),n="",s=!1}else if(l==='"'&&n==="")r=!0;else{if(l==='"')return null;l===","?(t.push(n),n=""):n+=l}}return r?null:(t.push(n),t)}function ma(e){var s,o;const t=e.trim().split(`
|
|
4
|
-
`),n=[];let r=0;for(;r<t.length;){if(!((s=t[r])!=null&&s.trim())){r+=1;continue}const l=(o=t[r])==null?void 0:o.trim().match(fa);if(!l)return null;const a=Number(l[2]),d=(l[3]??"").split(",").map(h=>h.trim());if(d.length===0||d.some(h=>!h))return null;r+=1;const u=[];for(let h=0;h<a;h+=1,r+=1){const m=t[r];if(m===void 0||!m.trim())return null;const w=ha(m.trim());if(!w||w.length!==d.length)return null;u.push(w)}n.push({name:l[1]??"",columns:d,rows:u})}return n.length>0?n:null}const pa="6.3.289";function ga(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M13.5 8h-11M6.5 4l-4 4 4 4"})})}const Oo=c.createContext(null);function wa({children:e,onQuoteTextBlock:t}){return i.jsx(Oo.Provider,{value:t,children:e})}function An(){return c.useContext(Oo)}const va=300*1e3,xa=32,ya=1024*1024,ba=100,Me=new Map,ur=new Set,xn=[];function Er(e){return(e==null?void 0:e.nowMs)??Date.now()}function Ho(e){return Array.isArray(e)?e.map(t=>Ho(t)):e??null}function Os(e){if(!e)return{};if(e instanceof URLSearchParams){const n={};for(const r of Array.from(new Set(e.keys())).sort()){const s=e.getAll(r);n[r]=s.length>1?s:s[0]??""}return n}const t={};for(const n of Object.keys(e).sort())t[n]=Ho(e[n]);return t}function dr(e){if(e===void 0)return"undefined";if(e===null||typeof e!="object")return JSON.stringify(e)??String(e);if(Array.isArray(e))return`[${e.map(n=>dr(n)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${dr(t[n])}`).join(",")}}`}function Pn(e){const t=e.projectId??null;return{key:dr({sourceKey:e.sourceKey,routeId:e.routeId,projectId:t,routeParams:Os(e.routeParams),queryParams:Os(e.queryParams)}),sourceKey:e.sourceKey,routeId:e.routeId,projectId:t}}function Uo(e){var t;try{return((t=JSON.stringify(e))==null?void 0:t.length)??0}catch{return 0}}function Vo(){for(const e of Array.from(ur))e()}function Sa(e){return{key:e.key,sourceKey:e.sourceKey,routeId:e.routeId,projectId:e.projectId,createdAt:e.createdAt,updatedAt:e.updatedAt,lastAccessedAt:e.lastAccessedAt,expiresAt:e.expiresAt,approxBytes:e.approxBytes}}function jr(){typeof window>"u"||(window.__YA_ROUTE_RETENTION__={entries:()=>Kn().entries,events:()=>Kn().events,diagnostics:Kn,clear:ja,invalidate:Ea})}function kt(e,t={}){for(xn.push(e);xn.length>ba;)xn.shift();jr(),t.emit&&Vo()}function zt(e,t,n,r=!0){const s=Me.get(e);s&&(Me.delete(e),kt({type:t==="invalidate"?"invalidate":"evict",key:s.key,sourceKey:s.sourceKey,routeId:s.routeId,projectId:s.projectId,at:n,reason:t,approxBytes:s.approxBytes},{emit:r}))}function ka(e){for(const t of Array.from(Me.values()))t.expiresAt<=e&&zt(t.key,"expired",e,!1)}function Ca(){let e=0;for(const t of Me.values())e+=t.approxBytes;return e}function La(e,t){const n=e.maxEntries??xa,r=e.maxBytes??ya;for(;Me.size>n||Ca()>r;){const s=Array.from(Me.values()).sort((o,l)=>o.lastAccessedAt!==l.lastAccessedAt?o.lastAccessedAt-l.lastAccessedAt:o.updatedAt-l.updatedAt)[0];if(!s)break;zt(s.key,"lru",t,!1)}}function qo(e){return ur.add(e),jr(),()=>{ur.delete(e)}}function _a(e,t={}){const n=Er(t),r=Pn(e),s=Me.get(r.key),o=t.recordDiagnostics??!0;return s?s.expiresAt<=n?t.touch===!1&&!o?{value:null,missReason:"expired"}:(zt(s.key,"expired",n),o&&kt({type:"miss",key:r.key,sourceKey:r.sourceKey,routeId:r.routeId,projectId:r.projectId,at:n,reason:"expired"}),{value:null,missReason:"expired"}):(t.touch!==!1&&(s.lastAccessedAt=n),o&&kt({type:"hit",key:s.key,sourceKey:s.sourceKey,routeId:s.routeId,projectId:s.projectId,at:n,approxBytes:s.approxBytes}),{value:s.value}):(o&&kt({type:"miss",key:r.key,sourceKey:r.sourceKey,routeId:r.routeId,projectId:r.projectId,at:n,reason:"missing"}),{value:null,missReason:"missing"})}function Rr(e,t){return _a(e,t).value}function Mr(e,t,n={}){const r=Er(n);ka(r);const s=Pn(e),o=Me.get(s.key),l=n.ttlMs??va,a={...s,value:t,createdAt:(o==null?void 0:o.createdAt)??r,updatedAt:r,lastAccessedAt:r,expiresAt:r+l,approxBytes:n.approxBytes??Uo(t)};Me.set(s.key,a),La(n,r),kt({type:"write",key:a.key,sourceKey:a.sourceKey,routeId:a.routeId,projectId:a.projectId,at:r,approxBytes:a.approxBytes},{emit:!0})}function Cp(e,t,n={}){const r=Rr(e,{...n,touch:!1,recordDiagnostics:!1}),s=typeof t=="function"?t(r):Object.assign({},r,t);Mr(e,s,n);const o=Pn(e);kt({type:"patch",key:o.key,sourceKey:o.sourceKey,routeId:o.routeId,projectId:o.projectId,at:Er(n),approxBytes:n.approxBytes??Uo(s)})}function Ea(e){const t=Date.now();zt(Pn(e).key,"invalidate",t)}function ja(){const e=Date.now();for(const t of Array.from(Me.values()))zt(t.key,"invalidate",e,!1);Vo()}function Kn(){const e=Array.from(Me.values(),Sa);return{entries:e,events:[...xn],totalBytes:e.reduce((t,n)=>t+n.approxBytes,0)}}jr();const Ra=3e4,Ma=750,Aa=60*1e3;function Pa(){return Wl(),!0}function Wo(e,t,n,r){return{sourceKey:e,routeId:n?"git-status:data:cached-untracked":r?"git-status:data:no-untracked":"git-status:data",projectId:t}}function Ta(e,t,n,r){const s=c.useMemo(()=>t?Wo(e,t,n,r):null,[e,t,n,r]);return c.useSyncExternalStore(qo,()=>s?Rr(s,{touch:!1,recordDiagnostics:!1}):null,()=>null)}function Fa(e,t={}){const n=xr(),r=Pa(),s=t.useUntrackedCache===!0,o=t.omitUntracked===!0,l=c.useMemo(()=>rc({endpoint:s?"git-status:cached-untracked":o?"git-status:no-untracked":"git-status",projectId:e??null}),[o,e,s]),a=Ta(n,e,s,o),d=`${n}\0${l}`,u=c.useRef({identity:d,value:a});u.current.identity!==d?u.current={identity:d,value:a}:a!==null&&(u.current.value=a);const h=a??u.current.value,[m,w]=c.useState(null),[x,f]=c.useState(!1),b=c.useMemo(()=>$a(h,m,s),[h,m,s]),[p,v]=c.useState(()=>!!e&&b===null),[k,L]=c.useState(null),[C,j]=c.useState(null),y=c.useRef(!0),S=c.useRef(0),g=c.useRef(0),E=c.useRef(null),M=c.useRef(b),P=c.useRef(m),B=c.useRef(a),T=c.useRef({queryKey:"",present:!1});M.current=b,P.current=m,B.current=a,c.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),c.useEffect(()=>{g.current+=1,E.current=null,w(null),f(!1),j(null)},[o,e,n,s]),c.useEffect(()=>{L(null),v(!!e&&M.current===null)},[e,l,n]),c.useEffect(()=>{if(e)return sc({sourceKey:n,key:l})},[e,l,n]);const A=c.useCallback(async({background:H=!1}={})=>{if(!e||!r||!s||(a==null?void 0:a.isGitRepo)!==!0)return;const q=++g.current;(!H||P.current===null)&&j(null),P.current===null&&f(!0);const D=E.current,W=D??te.listGitUntrackedFiles(e);D||(E.current=W);try{const Y=await W;y.current&&q===g.current&&(w(Y),f(!1),j(null))}catch(Y){y.current&&q===g.current&&!Ls(Y)&&(!H||P.current===null)&&j(Y instanceof Error?Y:new Error(String(Y)))}finally{y.current&&q===g.current&&f(!1),E.current===W&&(E.current=null)}},[e,r,a==null?void 0:a.isGitRepo,s]),F=c.useCallback(async({force:H=!1,background:q=!1}={})=>{if(!e||!r)return;const D=++S.current,W=B.current!==null,Y=M.current!==null;!q&&!Y&&v(!0),q||L(null);const oe={projectId:e},X=(Z,J)=>{const ee=J.meta.projectId;ee&&Mr(Wo(J.sourceKey,ee,s,o),Z,{ttlMs:Aa})},fe=Z=>{const J=Z.meta.projectId;if(!J)throw new Error("Project id is required");return te.getGitStatus(J,{...o?{omitUntracked:!0}:{},...s?{useUntrackedCache:!0}:{}})};try{const Z=await oc({sourceKey:n,key:l,force:H||!W,meta:oe,fetcher:fe,applySnapshot:X});if(!y.current||D!==S.current)return;Z.status!=="obsolete"&&L(null)}catch(Z){if(!y.current||D!==S.current)return;M.current===null&&!Ls(Z)&&L(Z instanceof Error?Z:new Error(String(Z)))}finally{y.current&&D===S.current&&v(!1)}},[o,e,l,r,n,s]);c.useEffect(()=>{!e||!r||F({background:M.current!==null})},[F,e,r]),c.useEffect(()=>{const H=T.current,q=a!==null;T.current={queryKey:l,present:q},H.queryKey===l&&H.present&&!q&&e&&r&&document.visibilityState==="visible"&&document.hasFocus()&&F()},[F,e,l,r,a]),c.useEffect(()=>{(a==null?void 0:a.isGitRepo)===!0&&A({background:P.current!==null})},[A,a==null?void 0:a.isGitRepo]);const N=t.poll!==!1;c.useEffect(()=>{if(!e||!r)return;let H=document.visibilityState==="visible"&&document.hasFocus();const q=()=>{const D=document.visibilityState==="visible"&&document.hasFocus();if(D!==H&&(H=D,!!D)){if(B.current===null){F();return}N&&(F({force:!0,background:!0}),A({background:!0}))}};return document.addEventListener("visibilitychange",q),window.addEventListener("focus",q),window.addEventListener("blur",q),()=>{document.removeEventListener("visibilitychange",q),window.removeEventListener("focus",q),window.removeEventListener("blur",q)}},[F,A,N,e,r]),c.useEffect(()=>{if(!e||!r||t.poll===!1)return;let H=!1,q=!1,D=null,W=null;const Y=()=>{F({force:!0,background:!0}),A({background:!0})},oe=()=>{D&&(clearInterval(D),D=null)},X=()=>{D||(D=setInterval(Y,Ra))},fe=()=>{W&&(clearTimeout(W),W=null)},Z=()=>{oe(),H&&X()},J=()=>{H&&(fe(),W=setTimeout(()=>{W=null,Y(),Z()},Ma))},ee=()=>{const ye=document.visibilityState==="visible"&&document.hasFocus();q&&ye===H||(q=!0,H=ye,H?X():(oe(),fe()))},_=_s.onSource(n,"process-state-changed",ye=>{ye.projectId===e&&ye.activity!=="in-turn"&&J()}),re=_s.onSource(n,"reconnect",J);return ee(),document.addEventListener("visibilitychange",ee),window.addEventListener("focus",ee),window.addEventListener("blur",ee),()=>{H=!1,oe(),fe(),_(),re(),document.removeEventListener("visibilitychange",ee),window.removeEventListener("focus",ee),window.removeEventListener("blur",ee)}},[F,A,t.poll,e,r,n]);const I=c.useCallback(async()=>{await Promise.all([F({force:!0,background:M.current!==null}),A({background:P.current!==null})])},[F,A]);return{gitStatus:b,untrackedFiles:m,untrackedLoading:x,untrackedError:C,loading:p,error:k,refetch:I}}function $a(e,t,n){if(!n||(e==null?void 0:e.isGitRepo)===!1||!e||!t)return e;const r=[...t.files.map(l=>{var a;return{path:l,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...(a=t.lastEditors)!=null&&a[l]?{lastEditor:t.lastEditors[l]}:{}}}),...t.folders.map(({path:l})=>({path:l,status:"?",staged:!1,linesAdded:null,linesDeleted:null}))],o=[...e.files.filter(l=>l.status!=="?"),...r];return{...e,files:o,isClean:o.length===0}}const Na=5e3,Ba=6e4;function Hs(e,t){return{sourceKey:e,routeId:"git-status:file-projections",projectId:t}}function Da(e,t,n){const r=c.useMemo(()=>t?Hs(e,t):null,[t,e]),s=c.useSyncExternalStore(qo,()=>r?Rr(r,{touch:!1,recordDiagnostics:!1}):null,()=>null),o=(s==null?void 0:s.statusKey)===n?s.value:null,l=c.useRef(n);l.current=n;const a=Kl({sourceKey:e,key:{endpoint:"git-status:file-projections",projectId:t??null,statusKey:n},enabled:!!(t&&n),hasData:o!==null,staleTimeMs:Na,meta:{projectId:t,statusKey:n},fetcher:async u=>{const h=u.meta;if(!h.projectId)throw new Error("Project is required for file projections");return te.getGitFileProjections(h.projectId)},applySnapshot:(u,h)=>{const m=h.meta;!m.projectId||!m.statusKey||m.statusKey!==l.current||Mr(Hs(h.sourceKey,m.projectId),{statusKey:m.statusKey,value:u},{ttlMs:Ba})}});return{manifest:o??(n&&!a.error?(s==null?void 0:s.value)??null:null),loading:!!(n&&!o&&!a.error)}}function Ia(e){const t=Vt(e).replace(/^\.\/+/,""),n=t.startsWith("/")||t.startsWith("//")||/^[a-zA-Z]:\//.test(t),r=t===".."||t.startsWith("../");return t&&!n&&!r?t:null}function Us(e,t){return e?t.find(n=>n.path===e||n.origPath===e)??null:null}function Oa(e){var t,n;return JSON.stringify([((n=(t=e.recentCommits)==null?void 0:t[0])==null?void 0:n.hash)??null,e.files.map(r=>[r.path,r.origPath??null,r.status,r.staged,r.linesAdded,r.linesDeleted])])}function Ko(e,t){var x,f;const n=xr(),r=Sr(n),s=lt(r,ic),o=lt(r,lc),l=c.useMemo(()=>Ia(t),[t]),a=s&&o&&l?e:void 0,{gitStatus:d,loading:u,error:h}=Fa(a,{poll:!1,omitUntracked:!1}),m=d!=null&&d.isGitRepo&&l?Oa(d):null,w=Da(n,a,m);return{cumulativeFile:Us(l,((x=w.manifest)==null?void 0:x.cumulativeFiles)??[]),loading:!!(e&&l&&(r===null||o&&a&&(u||!d&&!h||d!=null&&d.isGitRepo&&w.loading))),relativePath:l,supported:o,worktreeFile:Us(l,((f=w.manifest)==null?void 0:f.worktreeFiles)??[])}}const Ha=["block","paragraph-hover","paragraph-always"],zo="paragraph-hover";function Ua(e){return Ha.includes(e)?e:void 0}const Dt=So(Ve.quoteReplyButtonMode,zo,Ua);Dt.set;function Go(){return{quoteReplyButtonMode:c.useSyncExternalStore(Dt.subscribe,Dt.read,()=>zo),setQuoteReplyButtonMode:Dt.set}}Dt.read;const Va="_cluster_ypdbz_1",qa="_button_ypdbz_9",Wa="_text_ypdbz_37",Ka="_quote_ypdbz_56",za="_source_ypdbz_75",Ga="_rich_ypdbz_94",Xa="_newSession_ypdbz_112",Ya="_specimen_ypdbz_132",Qa="_mobile_ypdbz_137",Ja="_docked_ypdbz_146",De={cluster:Va,button:qa,text:Wa,quote:Ka,source:za,rich:Ga,newSession:Xa,specimen:Ya,mobile:Qa,docked:Ja},Za=30,eu=44,$t=6;function Vs(){return i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),i.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}const qs={text:i.jsx(Vs,{}),quote:">",source:i.jsx(Vs,{}),rich:"Aa",newSession:"+"},tu={text:De.text,quote:De.quote,source:De.source,rich:De.rich,newSession:De.newSession};function nu({kind:e,label:t,onClick:n,onPointerDown:r,onPointerUp:s,specimen:o=!1}){const l=`${De.button} ${tu[e]} ${o?De.specimen:""}`;return o?i.jsx("span",{className:l,"aria-hidden":"true","data-selection-action-specimen":e,children:qs[e]}):i.jsx("button",{type:"button",className:l,onMouseDown:a=>a.preventDefault(),onPointerDown:a=>{a.preventDefault(),r==null||r(a)},onPointerUp:s,onClick:n,"aria-label":t,title:t,children:qs[e]})}function ru({children:e,docked:t=!1,mobile:n=!1,placement:r,style:s}){return i.jsx("div",{className:[De.cluster,t?De.docked:"",n?De.mobile:""].filter(Boolean).join(" "),style:s,"data-selection-action-cluster":"true","data-selection-action-placement":r,children:e})}const su="session-file-comments",Xo="data-session-file-comment-mode",Yo=100,ou=2e4,Ws=8e3;function iu({sourceKey:e,sessionId:t,projectId:n,filePath:r}){return[su,e,t,n,r].map(encodeURIComponent).join(":")}function Ks(e){try{const t=JSON.parse(or.getItem(e)??"null");if(!Array.isArray(t))return[];const n=[];for(const r of t.slice(0,Yo)){if(!cu(r))continue;const{id:s,location:o,quote:l,text:a,afterLine:d,afterBlock:u}=r;typeof s!="string"||!s||typeof o!="string"||!o||typeof l!="string"||!l.trim()||typeof a!="string"||!a.trim()||o.length>Ws||l.length>Ws||a.length>ou||d!==void 0&&(!Number.isInteger(d)||Number(d)<1)||u!==void 0&&(!Number.isInteger(u)||Number(u)<0)||n.push({id:s,location:o,quote:l,text:a,...d===void 0?{}:{afterLine:Number(d)},...u===void 0?{}:{afterBlock:Number(u)}})}return n}catch{return[]}}function zn(e,t){const n=t.filter(r=>r.text.trim()).slice(0,Yo);if(n.length===0){or.removeItem(e);return}or.setItem(e,JSON.stringify(n))}function Qo(e){const t=e.quote.replace(/\r\n?/g,`
|
|
5
|
-
`).replace(/^\n+|\n+$/g,"").split(`
|
|
6
|
-
`).map(n=>`> ${n}`).join(`
|
|
7
|
-
`);return`${e.location}
|
|
8
|
-
|
|
9
|
-
${t}
|
|
10
|
-
|
|
11
|
-
${e.text.trim()}`}function lu(e){return e.map(Qo).join(`
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
`)}function cu(e){return typeof e=="object"&&e!==null}const wt="session-transcript-selection-active",au=50;function zs(e,t,n){return Math.max(t,Math.min(n,e))}function Gs(e,t,n){const r=e.sourceElement.ownerDocument.createRange();return r.selectNodeContents(e.sourceElement),t==="after"?r.setStart(e.range.endContainer,e.range.endOffset):r.setEnd(e.range.startContainer,e.range.startOffset),!r.toString().trim()||typeof r.getClientRects!="function"?!0:!Array.from(r.getClientRects()).some(s=>s.width>0&&s.height>0&&s.bottom>n.top+1&&s.top<n.bottom-1)}function uu(e){const t=new Set(e.map(r=>r.sourceElement)),n=[];for(const r of t){const s=r.ownerDocument.createRange();s.selectNodeContents(r),typeof s.getClientRects=="function"&&n.push(...Array.from(s.getClientRects()).filter(o=>o.width>0&&o.height>0))}return n}function du(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ar(e){var t;return((t=e.matchMedia)==null?void 0:t.call(e,"(pointer: coarse)").matches)===!0}function fu(e,t){if(Ar(t))return!0;const n=e.pointerType;return n==="touch"||n==="pen"}function hu(e,t,n){return t===0&&n===0?!0:e.ranges.some(r=>typeof r.getClientRects!="function"?!0:Array.from(r.getClientRects()).some(s=>t>=s.left-1&&t<=s.right+1&&n>=s.top-1&&n<=s.bottom+1))}function mu(e,t,n,r,s){const{snippets:o}=n,l=n.root,a=e.ownerDocument.defaultView??window,d=Ar(a),u=d?eu:Za,h=t.getRangeAt(t.rangeCount-1),m=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null,w=typeof h.getClientRects=="function"?Array.from(h.getClientRects()).filter(q=>q.width!==0||q.height!==0):[],x=m&&(m.width!==0||m.height!==0);if(!x&&!s)return null;const f=l.getBoundingClientRect(),b=x?m:{top:(s==null?void 0:s.clientY)??f.top,right:(s==null?void 0:s.clientX)??f.left,bottom:(s==null?void 0:s.clientY)??f.top,left:(s==null?void 0:s.clientX)??f.left,width:0,height:0},p=w[0]??b,v=w.at(-1)??b,k=r*u+(r-1)*$t,L=o[0],C=o.at(-1),j=C?Gs(C,"after",v):!1,y=L?Gs(L,"before",p):!1,S=f.right-v.right,g=p.left-f.left,E=f.bottom-b.bottom,M=b.top-f.top,P=Math.max(0,l.clientHeight-u),B=Math.max(0,l.clientWidth-k),T=b.left-f.left+(b.width-k)/2,A={after:{top:v.top-f.top+(v.height-u)/2,left:v.right-f.left+$t},before:{top:p.top-f.top+(p.height-u)/2,left:p.left-f.left-k-$t},below:{top:b.bottom-f.top+$t,left:T},above:{top:b.top-f.top-u-$t,left:T}},F=uu(o),N=q=>{if(q==="after"&&!j||q==="before"&&!y)return!1;const D=A[q];if(D.left<0||D.top<0||D.left+k>l.clientWidth||D.top+u>l.clientHeight)return!1;const W={top:f.top+D.top,right:f.left+D.left+k,bottom:f.top+D.top+u,left:f.left+D.left};return W.left<0||W.top<0||W.right>a.innerWidth||W.bottom>a.innerHeight?!1:!F.some(Y=>du(W,Y))},I=["after","before","below","above"].find(N)??[["after",S-k],["before",g-k],["below",E-u],["above",M-u]].reduce((q,D)=>D[1]>q[1]?D:q)[0],H=A[I];return{side:I,docked:d&&l===e,mobile:d,snapshot:n,top:zs(H.top,0,P),left:zs(H.left,0,B)}}function pu({actionCount:e,getActionCount:t,containerRef:n,inert:r,isInteractiveTarget:s}){const o=c.useRef(!1),[l,a]=c.useState(null),d=c.useCallback(()=>a(null),[]),u=c.useCallback(()=>{const h=n.current,m=h==null?void 0:h.ownerDocument.getSelection();if(!h||!m||m.isCollapsed||m.rangeCount===0)return null;const w=Bt(h,m);if(!w)return null;const x=Ut(w);return x.length===0?null:{anchors:x.map(kn),snippets:x,ranges:x.map(f=>f.range.cloneRange()),root:w}},[n]);return c.useEffect(()=>{if(r)return;const h=m=>{if(m.defaultPrevented||!m.clipboardData)return;const w=n.current;if(!w)return;const x=Bt(w);if(x){const f=Ut(x);if(f.length===0)return;m.clipboardData.setData("text/plain",kr(f)),m.preventDefault()}};return document.addEventListener("copy",h),()=>document.removeEventListener("copy",h)},[n,r]),c.useEffect(()=>{if(r)return;const h=n.current,m=(h==null?void 0:h.ownerDocument)??document,w=x=>{const f=n.current;if(x.button!==0||!f||s(x.target))return;const b=m.getSelection(),p=Bt(f,b),v=Rs(f,x.target);p&&p===v&&(b==null||b.removeAllRanges())};return m.addEventListener("mousedown",w,!0),()=>m.removeEventListener("mousedown",w,!0)},[n,r,s]),c.useEffect(()=>{if(r)return;const h=n.current,m=(h==null?void 0:h.ownerDocument)??document,w=m.defaultView??window;if(!Ar(w))return;let x=null,f=null;const b=v=>{const k=n.current,L=(k==null?void 0:k.closest(".session-page"))??null,C=(k==null?void 0:k.ownerDocument.body)??null;x&&x!==L&&x.classList.remove(wt),f&&f!==C&&f.classList.remove(wt),x=L,f=C,L==null||L.classList.toggle(wt,v),C==null||C.classList.toggle(wt,v&&L!==null)},p=()=>{const v=n.current;b(v?Bt(v,v.ownerDocument.getSelection())!==null:!1)};return m.addEventListener("selectionchange",p),m.addEventListener("pointerup",p,!0),m.addEventListener("keyup",p,!0),w.addEventListener("blur",p),()=>{m.removeEventListener("selectionchange",p),m.removeEventListener("pointerup",p,!0),m.removeEventListener("keyup",p,!0),w.removeEventListener("blur",p),x==null||x.classList.remove(wt),f==null||f.classList.remove(wt)}},[n,r]),c.useEffect(()=>{var S;if(r||e===0){a(null);return}const h=((S=n.current)==null?void 0:S.ownerDocument)??document,m=h.defaultView??window;let w,x=!1;const f=()=>{x=!1,w!==void 0&&(m.clearTimeout(w),w=void 0)},b=g=>{if(o.current&&!g){a(null);return}const E=n.current,M=E==null?void 0:E.ownerDocument.getSelection(),P=u();if(!E||!M||!P){a(null);return}const B=(t==null?void 0:t(P))??e;if(B===0){a(null);return}a(mu(E,M,P,B,g))},p=()=>{w=m.setTimeout(()=>{w=void 0,x&&(x=!1,b(),p())},au)},v=()=>{if(w!==void 0){x=!0;return}b(),p()},k=()=>{const g=h.getSelection();if(!g||g.isCollapsed||g.rangeCount===0){f();return}v()},L=g=>{const E=n.current;if(g.target instanceof Element&&g.target.closest('[data-selection-action-cluster="true"]')){o.current=!1,f();return}if(f(),!E||!Rs(E,g.target)){o.current=!1;return}o.current=!0,a(null)},C=g=>{const E=o.current;o.current=!1,E&&(f(),m.setTimeout(()=>{f(),b({clientX:g.clientX,clientY:g.clientY})},0))},j=()=>{o.current=!1,f()},y=()=>{if(o.current){f();return}const g=h.getSelection();if(!g||g.isCollapsed||g.rangeCount===0){f(),a(null);return}v()};return h.addEventListener("selectionchange",y),h.addEventListener("pointerdown",L,!0),h.addEventListener("pointercancel",j,!0),h.addEventListener("pointerup",C,!0),m.addEventListener("resize",k),m.addEventListener("scroll",k,!0),()=>{f(),h.removeEventListener("selectionchange",y),h.removeEventListener("pointerdown",L,!0),h.removeEventListener("pointercancel",j,!0),h.removeEventListener("pointerup",C,!0),m.removeEventListener("resize",k),m.removeEventListener("scroll",k,!0)}},[e,u,n,t,r]),{captureSnapshot:u,dismiss:d,state:l}}const an=Ct(Ve.selectionQuoteActionEnabled,!0),un=Ct(Ve.selectionTextCopyActionEnabled,!1),dn=Ct(Ve.selectionSourceCopyActionEnabled,!0),fn=Ct(Ve.selectionRichCopyActionEnabled,!1),hn=Ct(Ve.selectionNewSessionActionEnabled,!1);function gu(){const e=c.useSyncExternalStore(an.subscribe,an.read,an.read),t=c.useSyncExternalStore(un.subscribe,un.read,un.read),n=c.useSyncExternalStore(dn.subscribe,dn.read,dn.read),r=c.useSyncExternalStore(fn.subscribe,fn.read,fn.read),s=c.useSyncExternalStore(hn.subscribe,hn.read,hn.read);return{selectionQuoteActionEnabled:e,setSelectionQuoteActionEnabled:an.set,selectionTextCopyActionEnabled:t,setSelectionTextCopyActionEnabled:un.set,selectionSourceCopyActionEnabled:n,setSelectionSourceCopyActionEnabled:dn.set,selectionRichCopyActionEnabled:r,setSelectionRichCopyActionEnabled:fn.set,selectionNewSessionActionEnabled:s,setSelectionNewSessionActionEnabled:hn.set}}function Gn(e){return e.snippets.some(t=>t.sourceElement.closest(`[${Xo}="true"]`)!==null)}function wu(e){return kr(e.snippets)}function vu(e){return e.snippets.map(t=>t.markdown).join(`
|
|
16
|
-
|
|
17
|
-
`)}function Xs(e){return e.snippets.some(t=>!t.isLiteral&&t.markdown!==t.selectedText)}function xu(e){return e.anchors.map(t=>t.quotedText).join(`
|
|
18
|
-
|
|
19
|
-
`)}function yu(e){const t=e.snippets.map(o=>o.sourceLocation);if(t.some(o=>o===void 0))return null;const n=t[0];if(!n||t.some(o=>(o==null?void 0:o.projectId)!==n.projectId||o.filePath!==n.filePath))return null;const r=Math.min(...t.map(o=>(o==null?void 0:o.lineStart)??n.lineStart)),s=Math.max(...t.map(o=>(o==null?void 0:o.lineEnd)??n.lineEnd));return`${n.filePath}:${r}${s>r?`-${s}`:""}`}function bu(e){const t=xu(e),n=yu(e);return n?`${n}
|
|
20
|
-
|
|
21
|
-
${t}`:t}function Su({applyQuoteAnchors:e,applyQuoteFromSelection:t,containerRef:n,inert:r,isInteractiveTarget:s,onQuoteSelection:o,onStartNewSessionFromSelection:l}){const a=c.useRef(null),{selectionQuoteActionEnabled:d,selectionTextCopyActionEnabled:u,selectionSourceCopyActionEnabled:h,selectionRichCopyActionEnabled:m,selectionNewSessionActionEnabled:w}=gu(),{t:x}=Ie(),{menu:f,openAt:b}=Mo(x,{dismiss:x("sessionDismissSelectionActions"),menu:x("sessionSelectionActionMenu")}),p=c.useMemo(()=>{const T=[];return u&&T.push({kind:"text",label:x("sessionCopySelectionText")}),h&&T.push({kind:"source",label:x("sessionCopySelectionSource")}),m&&T.push({kind:"rich",label:x("sessionCopySelectionRich")}),d&&o&&T.push({kind:"quote",label:x("sessionQuoteSelection")}),w&&l&&T.push({kind:"newSession",label:x("sessionNewSessionFromSelection")}),T},[o,l,w,d,m,h,u,x]),v=c.useCallback(T=>{const A=Xs(T),F=Gn(T);return p.filter(N=>(N.kind!=="source"||A)&&(N.kind!=="quote"||!F))},[p]),k=c.useCallback(T=>v(T).length,[v]),L=pu({actionCount:p.length,getActionCount:k,containerRef:n,inert:r,isInteractiveTarget:s});c.useEffect(()=>{if(r||!o||!d)return;const T=A=>{if(A.defaultPrevented||A.isComposing||A.ctrlKey||A.metaKey||A.altKey||A.key.length!==1||s(A.target))return;const F=L.captureSnapshot();F&&Gn(F)||t(A.key)&&(L.dismiss(),A.preventDefault(),A.stopPropagation())};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[t,L.captureSnapshot,L.dismiss,r,s,o,d]);const C=c.useCallback((T,A)=>{if(T==="text"){const N=wu(A);return N?(we(N),!0):!1}if(T==="quote"){const N=e(A.anchors);return N&&L.dismiss(),N}if(T==="source"){const N=vu(A);return N?(we(N),!0):!1}if(T==="newSession")return l?(l(bu(A)),!0):!1;const F=_l(A.root,A.ranges);return F?(ko(F.html,F.text),!0):!1},[e,L.dismiss,l]),j=c.useCallback(T=>{const A=[{label:x("sessionCopySelectionText"),onSelect:()=>{C("text",T)}}];return Xs(T)&&A.push({label:x("sessionCopySelectionSource"),onSelect:()=>{C("source",T)}}),o&&!Gn(T)&&A.push({label:x("sessionQuoteSelection"),onSelect:()=>{C("quote",T)}}),l&&A.push({label:x("sessionNewSessionFromSelection"),onSelect:()=>{C("newSession",T)}}),A},[C,o,l,x]);c.useEffect(()=>{if(r)return;const T=n.current,A=T==null?void 0:T.ownerDocument;if(!T||!A)return;const F=A.defaultView??window,N=I=>{if(I.defaultPrevented||s(I.target)||fu(I,F))return;const H=L.captureSnapshot();!H||!hu(H,I.clientX,I.clientY)||(I.preventDefault(),I.stopPropagation(),b(I.clientX,I.clientY,A.activeElement instanceof HTMLElement?A.activeElement:null,j(H)))};return A.addEventListener("contextmenu",N),()=>A.removeEventListener("contextmenu",N)},[L.captureSnapshot,n,r,s,b,j]);const y=L.state,S=y!==null&&y.snapshot.root!==n.current,g=y!=null&&y.docked&&typeof document<"u"?document.querySelector("[data-selection-actions-mobile-slot]"):null,E=(y==null?void 0:y.docked)===!0&&g!==null,M=y?i.jsx(ru,{docked:E,mobile:y.mobile,placement:y.side,style:E?void 0:{top:`${y.top}px`,left:`${y.left}px`},children:v(y.snapshot).map(({kind:T,label:A})=>i.jsx(nu,{kind:T,label:A,onPointerDown:()=>{a.current=null},onPointerUp:F=>{y.mobile&&(F.preventDefault(),C(T,y.snapshot)&&(a.current=T))},onClick:()=>{if(a.current===T){a.current=null;return}C(T,y.snapshot)}},T))}):null,P=E&&M?Ot.createPortal(M,g):null,B=y&&!E?S?y.snapshot.root.isConnected?Ot.createPortal(M,y.snapshot.root):null:M:null;return{dismiss:L.dismiss,floatingSelectionActions:B,mobileSelectionActions:P,selectionContextMenu:f}}function ku({containerRef:e,composerDraftSignal:t,onQuoteSelection:n,quoteClearSignal:r}){const s=c.useRef(null),o=c.useRef([]),[l,a]=c.useState([]),d=c.useRef(null),u=c.useRef(null),h=c.useRef(t),m=c.useRef(()=>{}),w=c.useCallback(C=>{if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(C.length===0){CSS.highlights.delete("comment-tint");return}const j=C.filter(y=>fc(y,e.current)).map(hc).filter(y=>y!==null);if(j.length===0){CSS.highlights.delete("comment-tint");return}CSS.highlights.set("comment-tint",new Highlight(...j))},[e]),x=c.useCallback(()=>{var C;(C=u.current)==null||C.call(u),u.current=null},[]),f=c.useCallback(()=>{var C;(C=d.current)==null||C.disconnect(),d.current=null},[]),b=c.useCallback(C=>{var E;f();const j=Array.from(new Set(C.map(M=>M.sourceElement).filter(M=>M.isConnected))),y=j[0],S=(E=y==null?void 0:y.ownerDocument.defaultView)==null?void 0:E.MutationObserver;if(!y||!S)return;const g=new S(()=>{w(o.current)});for(const M of j)g.observe(M,{childList:!0,characterData:!0,subtree:!0});d.current=g},[w,f]),p=c.useCallback(()=>{x();const C=h.current;!C||o.current.length===0||(u.current=C.subscribeDraftChanges(j=>{m.current(j)}))},[x]),v=c.useCallback(C=>{const j=o.current;C!==j&&(o.current=C,a(Array.from(new Set(C.map(y=>y.renderId).filter(y=>y!==void 0)))),w(C),b(C),j.length===0&&C.length>0?p():j.length>0&&C.length===0&&x())},[w,b,p,x]);m.current=C=>{const j=o.current;if(j.length===0)return;const y=s.current;if(y===null&&C.metadata.mayAffectQuoteAnchors===!1)return;s.current=null;const S=mc(y??C.text),g=j.filter(E=>pc(S,E));g.length!==j.length&&v(g)},c.useEffect(()=>(h.current=t,p(),x),[t,p,x]),c.useEffect(()=>()=>{x(),f(),w([])},[w,f,x]);const k=c.useCallback((C,j="")=>{var g,E;if(!n||C.length===0)return!1;const y=C.map(M=>{const P=M.sourceLocation;return P?`re: ${P.filePath}:${P.lineStart}
|
|
22
|
-
${M.quotedText}`:M.quotedText}).join(`
|
|
23
|
-
|
|
24
|
-
`),S=n(j?`${y}
|
|
25
|
-
${j}`:`${y}
|
|
26
|
-
`);return S===null?!1:(s.current=S,v([...o.current,...C]),(E=(g=e.current)==null?void 0:g.ownerDocument.getSelection())==null||E.removeAllRanges(),!0)},[e,n,v]),L=c.useCallback((C="")=>{const j=e.current;if(!j)return!1;const y=Bt(j);if(!y)return!1;const S=Ut(y).map(kn);return k(S,C)},[k,e]);return c.useEffect(()=>{r>0&&v([])},[r,v]),{anchoredRenderIds:l,applyQuoteAnchors:k,applyQuoteFromSelection:L}}function Jo({containerRef:e,inert:t,onQuoteSelection:n,onStartNewSessionFromSelection:r,composerDraftSignal:s,quoteClearSignal:o,isInteractiveTarget:l}){const{quoteReplyButtonMode:a}=Go(),d=ku({containerRef:e,composerDraftSignal:s,onQuoteSelection:n,quoteClearSignal:o}),u=Su({...d,containerRef:e,inert:t,isInteractiveTarget:l,onQuoteSelection:n,onStartNewSessionFromSelection:r}),h=c.useCallback(m=>{d.applyQuoteAnchors([m])&&u.dismiss()},[d.applyQuoteAnchors,u.dismiss]);return{anchoredRenderIds:d.anchoredRenderIds,alwaysShowQuoteCircles:a==="paragraph-always",paragraphQuoteCirclesEnabled:a!=="block",handleQuoteTextBlock:h,mobileSelectionActions:u.mobileSelectionActions,floatingSelectionActions:u.floatingSelectionActions,selectionContextMenu:u.selectionContextMenu}}const Lp=Jo;function Ys(e,t){const n=new Map(t.map(r=>[r.id,r.text]));return e.filter(r=>n.get(r.id)!==r.text)}function Cu({active:e,storageKey:t,sendComment:n}){const[r,s]=c.useState([]),[o,l]=c.useState(null),[a,d]=c.useState(new Set),[u,h]=c.useState(!1),m=c.useRef(r),w=c.useRef(o),x=c.useRef(a),f=c.useRef(n),b=c.useRef(t);w.current=o,x.current=a,f.current=n,b.current=t,c.useEffect(()=>{var M;const g=t?Ks(t):[];m.current=g,w.current=((M=g.at(-1))==null?void 0:M.id)??null,s(g),l(w.current);const E=new Set;x.current=E,d(E),h(!1)},[t]),c.useEffect(()=>{if(t)return ml(t,()=>{const g=Ks(t);m.current=g,s(g)})},[t]);const p=c.useCallback(()=>{const g=b.current;g&&zn(g,m.current),s(m.current)},[]),v=c.useCallback(g=>{m.current=g,s(g)},[]),k=c.useCallback(g=>{w.current=g,l(g)},[]),L=c.useCallback(g=>{h(!1);const E=m.current.find(T=>T.id===w.current);if((E==null?void 0:E.location)===g.location&&E.quote===g.quote)return;const M=m.current.filter(T=>T.id!==w.current||T.text.trim()),P=M.find(T=>T.location===g.location&&T.quote===g.quote);if(P){v(M),k(P.id);return}const B={...g,id:bo(),text:""};v([...M,B]),k(B.id)},[v,k]),C=c.useCallback((g,E)=>{h(!1),m.current=m.current.map(M=>M.id===g?{...M,text:E}:M)},[]),j=c.useCallback(g=>{h(!1),v(m.current.filter(E=>E.id!==g)),w.current===g&&k(null)},[v,k]),y=c.useCallback(async g=>{const E=m.current.find(N=>N.id===g),M=f.current;if(!(E!=null&&E.text.trim())||!M||x.current.has(g))return!1;const P=new Set(x.current).add(g);x.current=P,d(P),p();const B=await M(Qo(E)),T=new Set(x.current);if(T.delete(g),x.current=T,d(T),!B)return h(!0),!1;const A=Ys(m.current,[E]);v(A),w.current===g&&!A.some(N=>N.id===g)&&k(null);const F=b.current;return F&&zn(F,A),h(!1),!0},[p,v,k]),S=c.useCallback(async()=>{const g=f.current,E=m.current.filter(N=>N.text.trim()&&!x.current.has(N.id));if(E.length===0)return p(),!0;if(!g)return p(),!1;const M=new Set(E.map(N=>N.id)),P=new Set([...x.current,...M]);x.current=P,d(P),p();const B=await g(lu(E)),T=new Set(x.current);for(const N of M)T.delete(N);if(x.current=T,d(T),!B)return h(!0),!1;const A=Ys(m.current,E);v(A),w.current&&M.has(w.current)&&!A.some(N=>N.id===w.current)&&k(null);const F=b.current;return F&&zn(F,A),h(!1),!0},[p,v,k]);return c.useEffect(()=>{if(e)return()=>{S()}},[e,S]),{activeDraft:r.find(g=>g.id===o)??null,cancel:j,error:u,flush:S,open:L,persist:p,sendOne:y,sendingIds:a,update:C}}function Lu(e){return e.replace(/<\/span>\r?\n(?=<span class="line(?:\s|"))/g,"</span>")}function _u(e){const t=[];let n=0;const r=/\r\n|\r|\n/g;for(let s=r.exec(e);s;s=r.exec(e)){const o=s.index;t.push({start:n,end:o,text:e.slice(n,o)}),n=s.index+s[0].length}return t.push({start:n,end:e.length,text:e.slice(n)}),t}function Zo(e,t,n){e.setAttribute(zl,String(t)),e.setAttribute(Gl,String(n))}function Eu(e,t){const n=new Map,r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);let s=0;for(let o=r.nextNode();o;o=r.nextNode()){const l=o,a=l.data;if(t.text.slice(s,s+a.length)!==a)return;const d=t.start+s,u=d+a.length;for(let h=l.parentElement;h&&h!==e;h=h.parentElement){const m=n.get(h);n.set(h,{start:m?Math.min(m.start,d):d,end:m?Math.max(m.end,u):u})}s+=a.length}if(s===t.text.length)for(const[o,l]of n)Zo(o,l.start,l.end)}function ei(e,t){const n=Lu(e);return t===void 0||typeof document>"u"?n:ju(n,t)}function ju(e,t){const n=document.createElement("template");n.innerHTML=e;const r=Array.from(n.content.querySelectorAll("code .line")),s=_u(t);for(let o=0;o<r.length;o+=1){const l=r[o],a=s[o];!l||!a||l.textContent!==a.text||(Zo(l,a.start,a.end),Eu(l,a))}return n.innerHTML}function Ru(e,t){if(typeof document>"u")return null;const n=document.createElement("template");if(n.innerHTML=e,!Array.from(n.content.querySelectorAll("code .line[data-line]")).some(o=>Number(o.dataset.line)===t))return null;const s=o=>{const l=n.content.cloneNode(!0);for(const d of l.querySelectorAll("code .line[data-line]")){const u=Number(d.dataset.line);(!Number.isInteger(u)||!o(u))&&d.remove()}const a=document.createElement("div");return a.append(l),a.innerHTML};return{before:s(o=>o<=t),after:s(o=>o>t)}}function ti(e){return c.useMemo(()=>({__html:e}),[e])}const Mu="_container_1s663_7",Au={container:Mu};function Pu({html:e,source:t,className:n,...r}){const s=c.useMemo(()=>ei(e,t),[e,t]),o=ti(s);return i.jsx("div",{...r,className:`shiki-container ${Au.container}${n?` ${n}`:""}`,dangerouslySetInnerHTML:o})}function Tu({value:e,title:t,className:n,disabled:r=!1,icon:s="copy"}){const[o,l]=c.useState(!1),[a,d]=c.useState(!1);return c.useEffect(()=>{if(!o)return;const u=setTimeout(()=>l(!1),1200);return()=>clearTimeout(u)},[o]),i.jsx("button",{type:"button",className:`copy-button ${o?"copied":""} ${n??""}`,title:t,"aria-label":t,disabled:r||a,onClick:async u=>{u.stopPropagation(),d(!0);const h=typeof e=="function"?await Ht(e()):await we(e);d(!1),h&&l(!0)},children:o?i.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})}):i.jsx(Fu,{icon:s})})}function Fu({icon:e}){const t={width:13,height:13,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};return e==="path"?i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("path",{d:"M3 7h6l2 2h10v9H3z"}),i.jsx("path",{d:"M8 14h8"}),i.jsx("path",{d:"m13 11 3 3-3 3"})]}):e==="content"?i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("path",{d:"M6 2h8l4 4v16H6z"}),i.jsx("path",{d:"M14 2v5h5"}),i.jsx("path",{d:"M9 12h6M9 16h6"})]}):i.jsxs("svg",{...t,"aria-hidden":"true",children:[i.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),i.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}const $u="_root_eaud3_1",Nu="_commit_eaud3_14",Bu="_age_eaud3_23",Du="_dirty_eaud3_27",Iu="_uncommitted_eaud3_33",vt={root:$u,commit:Nu,age:Bu,dirty:Du,uncommitted:Iu};function Pr({projectId:e,path:t,rev:n,origPath:r,dirtyLabel:s,uncommittedLabel:o,className:l}){const a=xr(),d=Sr(a),u=Lt(),h=lt(d,cc),m=`${a}\0${e}\0${t}\0${n??""}\0${r??""}`,[w,x]=c.useState({identity:m,value:null}),f=w.identity===m?w.value:null,[b,p]=c.useState(null);if(c.useEffect(()=>{if(!h||!e||!t)return;let C=!1;return te.getGitFileRevision(e,{path:t,rev:n,origPath:r}).then(j=>{C||x({identity:m,value:j})}).catch(()=>{C||x({identity:m,value:null})}),()=>{C=!0}},[m,r,t,e,n,h]),!h||!(f!=null&&f.isGitRepo))return null;if(!f.commit)return i.jsx("span",{className:`${vt.root} ${vt.uncommitted} ${l??""}`,children:o});const v=new URLSearchParams({projectId:e,rev:f.commit.hash,commitFile:n?t:r??t}),k=at(`${u}/git-status?${v.toString()}`),L=Hu(f.commit);return i.jsxs("span",{className:`${vt.root} ${l??""}`,children:[i.jsx("a",{className:vt.commit,href:k,title:L,onContextMenu:C=>{C.preventDefault(),C.stopPropagation(),p({identity:m,x:C.clientX,y:C.clientY})},children:f.commit.shortHash}),i.jsxs("span",{className:vt.age,children:["(",Ou(f.commit.authorDate),")"]}),f.dirty&&i.jsx("span",{className:vt.dirty,children:s}),(b==null?void 0:b.identity)===m&&i.jsx(Ec,{x:b.x,y:b.y,onClose:()=>p(null),onOpen:()=>window.open(k,"_blank","noopener,noreferrer"),fileTarget:{projectId:e,path:n?t:r??t,rev:f.commit.hash}})]})}function Ou(e,t=Date.now()){const n=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3));if(n<60)return"now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);if(s<24)return`${s}h ago`;const o=Math.floor(s/24);return o<30?`${o}d ago`:o<365?`${Math.floor(o/30)}mo ago`:`${Math.floor(o/365)}y ago`}function Hu(e){const t=new Date(e.authorDate).toLocaleString(),n=`${e.message}${e.messageTruncated?`
|
|
27
|
-
...`:""}`;return`${e.authorName}
|
|
28
|
-
${t}
|
|
29
|
-
|
|
30
|
-
${n}`}function Xn(e,t,n,r){if(r){const s=Wt(r,{filePath:n});if(!s)return!1;e.setAttribute("href",s),e.dataset.publicShareFileLink="true"}else e.setAttribute("href",Kt({projectId:t,filePath:n})),e.dataset.yaPrivateProjectFileLink="true";return e.dataset.yaResource="project-file",e.dataset.yaProjectId=t,e.dataset.yaPath=n,e.title=`${n}
|
|
31
|
-
Click to view, or use a browser link gesture to open this file`,!0}function Uu(e,t,n,r,s={projectPaths:!0,mentionedDirectories:!0}){var f,b;const o=Vu.test(e);if(!e||!(t!=null&&t.length)&&s.projectPaths&&!o&&!e.includes("data-ya-directory-file")||!n||typeof document>"u")return{changed:!1,html:e};const l=new Map(t==null?void 0:t.map(p=>[p.text,p.filePath])),a=document.createElement("template");a.innerHTML=e;let d=!1;const u=()=>(o&&Ku(a.content)&&(d=!0),{changed:d,html:d?a.innerHTML:e});if(!s.projectPaths&&!r){for(const p of a.content.querySelectorAll('a[data-ya-resource="project-file"], a[data-ya-resource="local-file"], a[data-fixed-font-file-path]'))p.replaceWith(...p.childNodes),d=!0;return{changed:d,html:d?a.innerHTML:e}}const h=new Set;if(s.mentionedDirectories&&!r)for(const p of a.content.querySelectorAll("[data-ya-directory-file]")){const v=p.dataset.yaDirectoryFile;if(!v)continue;const k=p.closest("a")??p.querySelector("a")??document.createElement("a");Xn(k,n,v,null),k.contains(p)?p.textContent=v:(k.textContent=v,p.replaceChildren(k)),k.setAttribute("href",Kt({projectId:n,filePath:v,lineNumber:Number(k.dataset.yaLine)||void 0,columnNumber:Number(k.dataset.yaColumn)||void 0})),h.add(k),d=!0}if(l.size===0)return u();for(const p of a.content.querySelectorAll('a[data-ya-resource="project-file"]')){if(h.has(p))continue;const v=l.get(((f=p.textContent)==null?void 0:f.trim())??"");v&&Xn(p,n,v,r)&&(d=!0)}const m=document.createTreeWalker(a.content,NodeFilter.SHOW_TEXT),w=[];let x=m.nextNode();for(;x;)x instanceof Text&&!((b=x.parentElement)!=null&&b.closest("a,button,script,style,textarea"))&&w.push(x),x=m.nextNode();for(const p of w){const v=$o(p.data).filter(k=>l.has(k.text));for(let k=v.length-1;k>=0;k-=1){const L=v[k];if(!L)continue;const C=document.createElement("a");if(!Xn(C,n,l.get(L.text),r))continue;p.splitText(L.end);const j=p.splitText(L.start);j.replaceWith(C),C.append(j),d=!0}}return u()}const Vu=/data-ya-line="|:\d+(?:[-:]\d+)?(?:<\/code>)?<\/a>|<\/a>:\d/,qu='a[data-ya-resource="project-file"], a[data-ya-resource="local-file"], a[data-fixed-font-file-path]',Wu=[["data-ya-line","line","lineNumber"],["data-ya-line-end","lineEnd","lineEnd"],["data-ya-column","column","columnNumber"]];function Ku(e){let t=!1;for(const n of e.querySelectorAll(qu)){const r=zu(n)??Gu(n);r&&(n.after(r),t=!0)}return t}function zu(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let n=t.nextNode();for(;n&&!(n instanceof Text&&n.data);)n=t.nextNode();if(!(n instanceof Text)||n.data!==e.textContent)return null;const r=Ic(n.data);if(!r)return null;const{position:s}=r,o=e.dataset.yaPath??e.dataset.fixedFontFilePath??"";if(!(e.dataset.yaLine?Number(e.dataset.yaLine)===s.lineNumber:!o.endsWith(s.text)))return null;const a=n.splitText(r.path.length);e.replaceWith(...e.childNodes),n.replaceWith(e),e.append(n);const d=ni(e,s);return d.append(a),ri(e,null),d}function Gu(e){const t=e.nextSibling;if(e.dataset.yaLine||!(t instanceof Text))return null;const n=Oc(t.data);if(!n)return null;t.splitText(n.text.length);const r=ni(e,n);return r.append(t),r}function ni(e,t){const n=e.cloneNode(!1);return ri(n,t),n}function ri(e,t){const n=e.getAttribute("href"),r=n?new URL(n,"http://localhost"):null;for(const[s,o,l]of Wu){const a=t==null?void 0:t[l];a===void 0?(e.removeAttribute(s),r==null||r.searchParams.delete(o)):(e.setAttribute(s,String(a)),r==null||r.searchParams.set(o,String(a)))}n&&r&&e.setAttribute("href",n.startsWith("/")?`${r.pathname}${r.search}${r.hash}`:r.href)}const Qs=8;function Js(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Xu(){if(typeof window>"u")return Qs;const e=window.__RENDER_PROFILE__;if(e&&typeof e=="object"){const t=e.thresholdMs;if(typeof t=="number"&&Number.isFinite(t))return Math.max(0,t)}return Qs}function Yu(){return Co()||typeof window<"u"&&window.__RENDER_PROFILE__!==void 0}function si(e,t,n){if(!Yu())return n();const r=Js();try{return n()}finally{const s=Js()-r;if(s>=Xu()){const o=typeof t=="function"?t():t,l={name:e,durationMs:Math.round(s*10)/10,...o};Hc("render-profile",l),typeof window<"u"&&window.__RENDER_PROFILE__!==void 0&&!Co()&&console.log("[RenderProfile]",l)}}}function fr(e,t){return!e||!t?null:{scrollRoot:e,initialOffset:t.getBoundingClientRect().top-e.getBoundingClientRect().top}}function oi(e,t){if(!e||!t)return;const r=t.getBoundingClientRect().top-e.scrollRoot.getBoundingClientRect().top-e.initialOffset;Math.abs(r)>1&&(e.scrollRoot.scrollTop+=r)}function Qu(e,t){const n=c.useRef(null),r=c.useRef(null),s=c.useCallback(()=>{const o=n.current;if(o){let l=o.parentElement;for(;l;){const{overflowY:a}=window.getComputedStyle(l);if(a==="auto"||a==="scroll")break;l=l.parentElement}r.current=fr(l,o)}t()},[t]);return c.useLayoutEffect(()=>{const o=r.current;o&&(r.current=null,oi(o,n.current))},[e]),{btnRef:n,handleClick:s}}function Ju(e){const t=e.trim().replace(/^#\s*/,"");return/^acli: 1(?:\s+\+?[a-z][a-z0-9-]*)*$/.test(t)||/^acli-capabilities: (?:[a-z][a-z0-9-]*\/1)(?:\s+[a-z][a-z0-9-]*\/1)*$/.test(t)}function Zu(e){JSON.parse(e);const t=e.match(/"(?:\\.|[^"\\])*"|[{}[\],:]|[^\s{}[\],:]+/g)??[];let n=0,r="";const s=()=>`
|
|
32
|
-
${" ".repeat(n)}`;return t.forEach((o,l)=>{o==="{"||o==="["?(r+=o,n++,t[l+1]!==(o==="{"?"}":"]")&&(r+=s())):o==="}"||o==="]"?(n--,t[l-1]!==(o==="}"?"{":"[")&&(r+=s()),r+=o):o===","?r+=o+s():o===":"?r+=": ":r+=o}),r+(e.endsWith(`
|
|
33
|
-
`)?`
|
|
34
|
-
`:"")}function ed(e){const t=new ta,n=[...t.append(e),...t.finish()];let r;return n.map(s=>{var l;const o=(l=/^\s*(`{3,}|~{3,})/.exec(s))==null?void 0:l[1];if(o)return r?o[0]===r[0]&&o.length>=r.length&&(r=void 0):r=o,{kind:"text",source:s,text:s};if(!r&&Ju(s))return{kind:"metadata",source:s,text:s};if(!r&&/^[\s]*[[{]/.test(s))try{return{kind:"json",source:s,text:Zu(s)}}catch{}return{kind:"text",source:s,text:s}})}const Zs=new Map;function ii(e){let t=Zs.get(e);return t||(t=So(`yep-anywhere-session-last-file:${e}`,"",n=>n),Zs.set(e,t)),t}function li(e,t){ii(e).set(t)}function _p(e){const t=ii(e);return c.useSyncExternalStore(t.subscribe,t.read,()=>"")}const td="yep-anywhere-session-open-file:",Cn=new Map;function hr(e){return`${td}${e}`}function Tn(e){try{const t=sessionStorage.getItem(hr(e));if(!t)return null;const n=JSON.parse(t);return typeof n.route!="string"||!n.route?null:{route:n.route,minimized:n.minimized===!0,scrollTop:typeof n.scrollTop=="number"&&n.scrollTop>=0?n.scrollTop:void 0}}catch{return null}}function Ln(e,t){try{t?sessionStorage.setItem(hr(e),JSON.stringify(t)):sessionStorage.removeItem(hr(e))}catch{}}function nd(e,t,n){const r=Tn(e);Cn.set(e,t),Ln(e,(r==null?void 0:r.route)===n?r:{route:n,minimized:!1})}function rd(e,t,n){if(Cn.get(e)!==t)return;const r=Tn(e);!r||r.scrollTop===n||Ln(e,{...r,scrollTop:n})}Vc(()=>{const e=qc();for(const[t,n]of Cn){if((e==null?void 0:e.id)===n){const r=Tn(t);r&&r.minimized!==e.minimized&&Ln(t,{...r,minimized:e.minimized});continue}Cn.delete(t),Ln(t,null)}});const sd="_root_e552i_1",od="_link_e552i_7",id="_inline_e552i_17",ld="_cluster_e552i_21",cd="_inlineLink_e552i_50",ad="_header_e552i_60",ud="_headerLink_e552i_67",dd="_active_e552i_74",Qe={root:sd,link:od,inline:id,cluster:ld,inlineLink:cd,header:ad,headerLink:ud,active:dd};function fd({children:e,className:t}){return i.jsx("span",{className:`${Qe.cluster} ${t??""}`,children:e})}function ut({basePath:e="",diffMode:t,filePath:n,lineEnd:r,lineNumber:s,projectId:o,viewMode:l}){return`${e}${Kt({diffMode:t,filePath:n,lineEnd:r,lineNumber:s,projectId:o,viewMode:l})}`}function ci({activeView:e="source",availability:t,className:n,onSelect:r,projectId:s,variant:o}){const{t:l}=Ie(),a=Lt(),d=t.relativePath;if(!t.supported||!d||!t.worktreeFile&&!t.cumulativeFile)return null;const u=w=>at(ut({basePath:a,diffMode:w,filePath:d,projectId:s})),h=w=>x=>{x.stopPropagation(),!(!r||x.button!==0||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey)&&(x.preventDefault(),r(w))},m=w=>[Qe.link,o==="header"?Qe.headerLink:Qe.inlineLink,e===w?Qe.active:null].filter(Boolean).join(" ");return i.jsxs("span",{className:[Qe.root,o==="header"?Qe.header:Qe.inline,n].filter(Boolean).join(" "),"data-file-diff-links":o,role:"group","aria-label":l("fileDiffViews"),children:[t.worktreeFile&&i.jsx("a",{className:m("worktree"),href:u("worktree"),"aria-current":e==="worktree"?"page":void 0,"aria-label":l("fileDiffVsHeadTitle",{path:d}),title:l("fileDiffVsHeadTitle",{path:d}),onClick:h("worktree"),children:l("fileDiffVsHead")}),t.cumulativeFile&&i.jsx("a",{className:m("cumulative"),href:u("cumulative"),"aria-current":e==="cumulative"?"page":void 0,"aria-label":l("fileDiffVsParentTitle",{path:d}),title:l("fileDiffVsParentTitle",{path:d}),onClick:h("cumulative"),children:l("fileDiffVsParent")})]})}function hd(e,t){const n=document.createElement("template");return n.innerHTML=e,Cl(n.content,t),n.innerHTML}function Tr(e){return{loadFile:async(t,n,r,s,o,l)=>{const a={};return r&&(a.highlight="true"),s!==void 0&&(a.line=String(s)),o!==void 0&&(a.lineEnd=String(o)),l==="range"&&(a.view="range"),await Sl({relayUrl:e.relayUrl,relayUsername:e.relayUsername,path:kl(e,"content",n,a)})},getRawFileUrl:()=>null,fetchRawFileBlob:(t,n)=>Es(e,t,n),createMediaSource:t=>({buildApiPath:n=>bl(e,n),fetchBlob:n=>Es(e,t??null,n)}),transformRenderedMarkdownHtml:t=>hd(t,e)}}const md="_paneViewer_w9qdr_1",pd="_nestedPaneViewer_w9qdr_9",gd="_fileViewerModal_w9qdr_15",wd="_fileViewerModalCompact_w9qdr_29",mn={paneViewer:md,nestedPaneViewer:pd,fileViewerModal:gd,fileViewerModalCompact:wd};function vd({className:e,filePath:t,projectId:n}){const r=Ko(n,_n(n,t)),s=br(),o=An(),l=c.useId(),[a,d]=c.useState(),u=r.relativePath;return!r.supported||!u?null:i.jsxs(i.Fragment,{children:[i.jsx(ci,{availability:r,className:e,projectId:n,variant:"inline",onSelect:h=>{h!=="source"&&(s?ui({id:l,sessionId:s,projectId:n,filePath:u,diffMode:h,quoteReply:o}):d(h))}}),a&&i.jsx(_t,{projectId:n,filePath:u,diffMode:a,onClose:()=>d(void 0)})]})}function xd({filePath:e}){return i.jsx(zc,{text:e,label:"Copy path",copiedLabel:"Copied path",className:"file-path-copy",onClick:t=>t.stopPropagation()})}function ai(e){if(!jo(e))return null;try{const t=Ro(e);return _o(t)}catch{return null}}function _n(e,t){const n=ai(e),r=Lr(t,n);if(r!==null)return r;const s=Vt(t);return!(s.startsWith("/")||/^[a-zA-Z]:\//.test(s))&&t.includes("\\")?Vt(t):t}function Fr(e,t){return e===void 0?"":t!==void 0&&t>e?`:${e}-${t}`:`:${e}`}function ui({id:e,sessionId:t,projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l="full",diffMode:a,presentation:d,quoteReply:u,source:h,openInNewTabUrl:m}){const w=Fr(s,o);li(t,ut({projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l,diffMode:a})),No({id:e,kind:"file",sessionId:t,label:`${r}${w}`,briefLabel:qt(r),filePath:r,lineSuffix:w,supportsRightPane:!0,renderContent:(x,f)=>i.jsx(_t,{managedViewerId:e,inactive:x,rightPane:f,quoteReply:u,projectId:n,filePath:r,lineNumber:s,lineEnd:o,viewMode:l,diffMode:a,initialPresentation:d,source:h,openInNewTabUrl:m},e)})}const Ep=c.memo(function({filePath:t,projectId:n,lineNumber:r,lineEnd:s,columnNumber:o,displayText:l,showLineSuffix:a=!0,showFullPath:d=!1,viewMode:u="full",showCopyButton:h=!0,showVersionControlLinks:m=!0}){const w=Mn(),x=br(),f=An(),b=Lt(),p=Cr().transport,v=c.useId(),[k,L]=c.useState(!1),[C,j]=c.useState(),[y,S]=c.useState(null),g=c.useMemo(()=>_n(n,t),[n,t]),E=Ao(n,g),M=c.useMemo(()=>ai(n),[n]),P=c.useMemo(()=>lr(g)?Lr(g,M):Vt(g).replace(/^\.\/+/,""),[M,g]),B=c.useMemo(()=>Eo(lr(t)?t:g,M),[t,M,g]),T=To(n,B,P,w!==null),A=cr(g),F=w?Wt(w,{columnNumber:o,filePath:g,lineEnd:s,lineNumber:r,viewMode:u}):null,N=w!==null?F:at(ut({basePath:b,filePath:g,lineEnd:s,lineNumber:r,projectId:n,viewMode:u})),I=c.useMemo(()=>w?Tr(w):void 0,[w]),H=c.useCallback(z=>{if(x&&w===null){ui({id:v,sessionId:x,projectId:n,filePath:g,lineNumber:r,lineEnd:s,viewMode:u,presentation:z,quoteReply:f,source:I,openInNewTabUrl:N});return}j(z),L(!0)},[N,s,r,v,n,w,I,x,f,u,g]),q=c.useCallback(z=>{if(z.stopPropagation(),!(z.button!==0||z.metaKey||z.ctrlKey||z.shiftKey||z.altKey)){if(w&&!F){z.preventDefault();return}z.preventDefault(),H()}},[H,w,F]),D=c.useCallback(()=>{L(!1)},[]),W=c.useCallback(z=>{z.preventDefault(),z.stopPropagation(),S({x:z.clientX,y:z.clientY})},[]),Y=c.useCallback(()=>S(null),[]),oe=c.useCallback(z=>H(z),[H]),X=c.useCallback(()=>{N&&we(new URL(N,window.location.href).href)},[N]),fe=c.useCallback(()=>{const z=I?I.loadFile(n,g,!1):te.getFile(n,g);Ht(z.then(he=>he.content??""))},[n,I,g]),Z=c.useCallback(()=>{const z=I?I.loadFile(n,g,!0):te.getFile(n,g,!0);gl(z.then(he=>Rl(g,he)))},[n,I,g]),J=c.useCallback(()=>{const z=I==null?void 0:I.fetchRawFileBlob;return{fileName:qt(g),directUrl:I?void 0:Sn(n,g,!0),loadBlob:I&&z?()=>I.loadFile(n,g,!1).then(he=>z(he,g,!0)):()=>p.fetchBlob(ir(Sn(n,g,!0)))}},[n,I,p,g]),ee=d?t:qt(t),_=l||ee,re=Fr(r,s),ye=re&&o!==void 0&&s===void 0?`:${o}`:"",Se=`${re}${ye}`,ue=a?Se:"",Ae=wl(`${t}${Se}`);return i.jsxs(i.Fragment,{children:[i.jsxs(fd,{children:[i.jsxs("a",{href:N??"#",className:"file-path-link",onClick:q,onContextMenu:W,...Ae,children:[i.jsx("span",{className:"file-path-link-name",children:_}),ue&&i.jsx("span",{className:"file-path-link-line",children:ue})]}),h&&i.jsx(xd,{filePath:g}),w===null&&m&&i.jsx(vd,{projectId:n,filePath:g})]}),y&&i.jsx(Po,{x:y.x,y:y.y,canStartNewSession:w===null,onClose:Y,onOpen:()=>oe(),download:J(),onOpenSource:A?()=>oe("source"):void 0,onOpenPreview:A?()=>oe("preview"):void 0,onStartNewSession:E,localSource:T,fileTarget:w===null?{projectId:n,path:P??g}:void 0,onCopyProjectRelativePath:P?()=>void we(P):void 0,onCopyAbsolutePath:w===null&&B?()=>void we(B):void 0,onCopyFilePath:!P&&!B?()=>void we(g):void 0,onCopyViewerLink:N?X:void 0,onCopyContents:fe,onCopyRenderedContents:A?Z:void 0}),k&&i.jsx(_t,{projectId:n,filePath:g,lineNumber:r,lineEnd:s,viewMode:u,initialPresentation:C,source:I,openInNewTabUrl:N,onClose:D})]})});function yd(e){return i.jsx(_t,{...e})}function _t({projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s="full",diffMode:o,initialPresentation:l,source:a,openInNewTabUrl:d,managedViewerId:u,inactive:h=!1,rightPane:m=!1,nestedViewer:w=!1,quoteReply:x,onClose:f}){const b=Mn(),p=c.useMemo(()=>b?Tr(b):void 0,[b]),v=a??p,k=An(),L=x??k,C=br(),j=El(),y=u===void 0&&(w||j!==null),S=m||y&&!!(j!=null&&j.target),g=u===void 0&&!y&&!!C&&b===null,E=yr(),M=c.useId(),P=u??M,B=jl(),T=!!(h||y&&(j!=null&&j.inactive)||(B==null?void 0:B.id)===P&&B.minimized),A=c.useRef(f);A.current=f;const F=c.useCallback(()=>{var _;if(u!==void 0){Wc(P);return}Bs(P),(_=A.current)==null||_.call(A)},[P,u]),N=c.useCallback(()=>Kc(P),[P]);c.useLayoutEffect(()=>{if(u!==void 0||y||b!==null)return;const _=Fr(n,r);No({id:P,kind:"file",sessionId:C??(E==null?void 0:E.sessionId)??"",label:`${t}${_}`,briefLabel:qt(t),onClose:F,filePath:t,lineSuffix:_,...g?{supportsRightPane:!0,renderContent:(re,ye)=>i.jsx(yd,{managedViewerId:P,inactive:re,rightPane:ye,quoteReply:L,projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s,diffMode:o,initialPresentation:l,source:v,openInNewTabUrl:d})}:{}})},[F,t,r,n,u,y,P,b,E==null?void 0:E.sessionId,C,g,e,s,l,o,v,d,L]),c.useEffect(()=>{if(!(u!==void 0||g||y))return()=>Bs(P)},[u,P,g,y]);const I=_=>{_.target===_.currentTarget&&F()},H=!g&&!T&&(!S||y||(B==null?void 0:B.id)===P),q=C??(y?B==null?void 0:B.sessionId:void 0)??(E==null?void 0:E.sessionId);c.useEffect(()=>{u!==void 0||b!==null||!q||li(q,ut({projectId:e,filePath:_n(e,t),lineNumber:n,lineEnd:r,viewMode:s,diffMode:o}))},[u,b,q,o,e,t,n,r,s]);const D=u!==void 0&&!y&&b===null&&!v&&(B==null?void 0:B.id)===u&&B.sessionId||null,W=ut({projectId:e,filePath:_n(e,t),lineNumber:n,lineEnd:r,viewMode:s,diffMode:o}),Y=c.useMemo(()=>{if(!D||u===void 0)return;const _=Tn(D);return{initialTop:(_==null?void 0:_.route)===W?_.scrollTop:void 0,save:re=>rd(D,u,re)}},[D,u,W]);c.useEffect(()=>{D&&u!==void 0&&nd(D,u,W)},[D,u,W]);const oe=S&&(j==null?void 0:j.docked)===!0;if(Xl(F,H,"__fileViewerModal"),Yl(F,H),Ql(F,H&&!oe),g)return null;const X=i.jsx(Nm,{projectId:e,filePath:t,lineNumber:n,lineEnd:r,viewMode:s,initialPresentation:l,diffMode:o,source:v,openInNewTabUrl:d,onClose:F,onMinimize:b===null&&!y?N:void 0,parentViewerId:u,scrollMemory:Y}),fe=L?i.jsx(wa,{onQuoteTextBlock:L,children:X}):X;if(S){const _=i.jsx(Ps,{projectId:e,children:i.jsx("div",{className:`${mn.paneViewer} ${y?mn.nestedPaneViewer:""}`,role:"dialog","aria-label":t,onKeyDown:oe&&H?re=>{re.key!=="Escape"||re.defaultPrevented||(re.preventDefault(),re.stopPropagation(),F())}:void 0,...Ms,children:fe})});return y&&(j!=null&&j.target)?Ot.createPortal(_,j.target):_}const Z=b===null?document.querySelector(".navigation-route-layer.is-active [data-session-viewer-layer]")??document.querySelector("[data-session-viewer-layer]"):null,J=i.jsx("div",{className:"modal-overlay","aria-hidden":T||void 0,style:T?{display:"none"}:void 0,onClick:I,onMouseDown:_=>_.stopPropagation(),children:i.jsx("dialog",{className:`modal file-viewer-modal ${mn.fileViewerModal} ${s==="range"?`file-viewer-modal-compact ${mn.fileViewerModalCompact}`:""}`,...Ms,open:!0,onClick:_=>_.stopPropagation(),children:fe})}),ee=b===null?Z??document.querySelector(".navigation-route-layer.is-active .session-page")??document.querySelector(".session-page"):null;return Ot.createPortal(b?J:i.jsx(Ps,{projectId:e,children:J}),ee??document.body)}const bd=new RegExp(String.raw`\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07]*(?:\x07|\x1b\\)|[@-Z\\-_])`,"g");function pe(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ct(e){return pe(e).replaceAll(`
|
|
35
|
-
`," ")}function $r(e){return e.replace(bd,"")}function pn(e){return e.replace(/^[ab]\//,"")}function Sd(e){const t=e.replace(/\r\n/g,`
|
|
36
|
-
`).split(`
|
|
37
|
-
`);for(const n of t){const r=/^\+\+\+\s+(?!\/dev\/null)(?:[ab]\/)?(.+?)\s*$/.exec(n);if(r!=null&&r[1])return pn(r[1].trim())}for(const n of t){const r=/^---\s+(?!\/dev\/null)(?:[ab]\/)?(.+?)\s*$/.exec(n);if(r!=null&&r[1])return pn(r[1].trim())}for(const n of t){const r=/^diff --git\s+a\/(.+?)\s+b\/(.+?)\s*$/.exec(n);if(r!=null&&r[2])return pn(r[2].trim());if(r!=null&&r[1])return pn(r[1].trim())}}function eo(e){const t=[];for(const n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n)}return t.join("/")}function kd(e,t){const n=e.trim();if(!n||n.startsWith("#")||n.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n))return null;const r=n.split(/[?#]/,1)[0]??"";if(!r)return null;if(r.startsWith("/"))return eo(r.slice(1));const s=t!=null&&t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";return eo(s?`${s}/${r}`:r)}function Cd(e,t,n={}){const r=kd(t,n.baseFilePath);if(!r)return null;const s=pe(e||t);if(!n.projectId)return{html:s,changed:!0};const l=(n.publicShare&&Wt(n.publicShare,{filePath:r}))??at(`${n.basePath??""}${Kt({projectId:n.projectId,filePath:r})}`),a=`/${r}`,d=_r(a,n.projectPath);return{html:`<a class="fixed-font-file-link" href="${ct(l)}" data-fixed-font-file-path="${ct(r)}" data-tooltip="${ct(d)}">${s}</a>`,changed:!0}}function Nt(e,t){return!t.linkifyUrls||!Io(e)?pe(e):Do(e).map(n=>n.type==="url"&&n.href?`<a href="${ct(n.href)}" target="_blank" rel="noopener noreferrer">${pe(n.text)}</a>`:pe(n.text)).join("")}function to(e,t){var l;if(!t.projectId||!((l=t.projectPathLinks)!=null&&l.length)){const a=Nt(e,t);return{html:a,changed:a!==pe(e)}}const n=new Map(t.projectPathLinks.map(a=>[a.text,a.filePath])),r=$o(e).filter(a=>n.has(a.text));if(r.length===0){const a=Nt(e,t);return{html:a,changed:a!==pe(e)}}let s="",o=0;for(const a of r){if(a.start<o)continue;const d=n.get(a.text),{pathEnd:u,end:h,position:m}=Uc(e,a,d),w=no(t.projectId,d,e.slice(a.start,u),t);if(!w){s+=Nt(e.slice(o,h),t),o=h;continue}s+=Nt(e.slice(o,a.start),t),s+=w,m&&(s+=no(t.projectId,d,m.text,t,m)??pe(m.text)),o=h}return s+=Nt(e.slice(o),t),{html:s,changed:!0}}function no(e,t,n,r,s){const o={filePath:t,lineNumber:s==null?void 0:s.lineNumber,lineEnd:s==null?void 0:s.lineEnd,columnNumber:s==null?void 0:s.columnNumber},l=r.publicShare?Wt(r.publicShare,o):at(`${r.basePath??""}${Kt({projectId:e,...o})}`);if(!l)return null;const a=`${_r(t,r.projectPath)}${(s==null?void 0:s.text)??""}`,d=s?` data-ya-line="${s.lineNumber}"${s.lineEnd?` data-ya-line-end="${s.lineEnd}"`:""}`:"";return`<a class="fixed-font-file-link" href="${ct(l)}" data-fixed-font-file-path="${ct(t)}"${d} data-tooltip="${ct(a)}">${pe(n)}</a>`}function En(e,t){try{return Nc.renderToString(Zc(e),{throwOnError:!1,displayMode:t,macros:Yc(),output:"htmlAndMathml",strict:"ignore",trust:!1})}catch{const n=t?`$$${e}$$`:`$${e}$`;return`<span class="fixed-font-math-error">${pe(n)}</span>`}}function Nr(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function di(e,t,n){let r=n;for(;r<e.length;){const s=e.indexOf(t,r);if(s<0||!Nr(e,s))return s;r=s+t.length}return-1}function fi(e,t){const n=e.startsWith("$$",t)?{close:"$$",open:"$$"}:e.startsWith("\\[",t)&&!Nr(e,t)?{close:"\\]",open:"\\["}:null;if(!n)return null;const r=di(e,n.close,t+n.open.length);if(r<0)return null;const s=e.slice(t+n.open.length,r).trim();return s?{end:r+n.close.length,html:En(s,!0)}:null}function hi(e,t){if(e.startsWith("\\(",t)&&!Nr(e,t)){const a=di(e,"\\)",t+2);if(a<0)return null;const d=e.slice(t+2,a).trim();return!d||d.includes(`
|
|
38
|
-
`)?null:{end:a+2,html:En(d,!1)}}if(e[t]!=="$")return null;const n=e[t+1];if(!n||/\s/.test(n))return null;let r=t+1;for(;r<e.length;){const a=e[r];if(a===`
|
|
39
|
-
`)return null;if(a==="$")break;r+=1}if(r>=e.length||e[r]!=="$")return null;const s=e[r-1];if(!s||/\s/.test(s))return null;const o=e[r+1];if(o&&(/\d/.test(o)||o==="$"))return null;const l=e.slice(t+1,r);return!l||!/[\\^{}+]/.test(l)&&!/\d/.test(l)?null:{end:r+1,html:En(l,!1)}}function mi(e){return{chars:e.length,lines:e.length===0?0:e.split(`
|
|
40
|
-
`).length}}function pi(e){let t="",n=!1,r=0,s=0;for(;s<e.length;){const o=fi(e,s),l=o?null:hi(e,s),a=o??l;if(!a){s+=1;continue}t+=pe(e.slice(r,s)),t+=a.html,n=!0,s=a.end,r=s}return t+=pe(e.slice(r)),{html:t,changed:n}}function Ld(e,t={}){return si("fixed-font-math",()=>({...mi(e),diffAware:t.diffAware??!1}),()=>t.diffAware?Ad(e):pi(e))}function _d(e){const t=e.replace(/\r\n/g,`
|
|
41
|
-
`).split(`
|
|
42
|
-
`);if(t.some(s=>s.startsWith("@@ "))||t.some(s=>s.startsWith("diff --git "))||t.some(s=>s.startsWith("--- "))&&t.some(s=>s.startsWith("+++ ")))return!0;let n=0,r=0;for(const s of t)s.startsWith("+")&&!s.startsWith("+++")&&(n+=1),s.startsWith("-")&&!s.startsWith("---")&&(r+=1);return n>0&&r>0&&n+r>=2}function gi(e,t){return t&&e.length>0&&(e[0]===" "||e[0]==="+"&&!e.startsWith("+++")||e[0]==="-"&&!e.startsWith("---"))?{prefix:e[0],content:e.slice(1)}:{prefix:"",content:e}}function mr(e){const t=e.trim();return t.startsWith("|")&&t.endsWith("|")&&t.split("|").length>=4}function yn(e){return e.trim().slice(1,-1).split("|").map(n=>n.trim())}function Yn(e){if(!mr(e))return!1;const t=yn(e);return t.length>0&&t.every(n=>/^:?-{2,}:?$/.test(n.replace(/\s+/g,"")))}function Ed(e){const t=e.replace(/\s+/g,""),n=t.startsWith(":"),r=t.endsWith(":");return n&&r?"center":r?"right":n?"left":null}function ot(e,t={}){let n="",r=!1,s=0,o=0;const l=a=>{if(a>s){const d=to(e.slice(s,a),t);n+=d.html,d.changed&&(r=!0)}};for(;o<e.length;){const a=e[o];if(a==="`"){const w=e.indexOf("`",o+1);if(w>o+1){l(o);const x=to(e.slice(o+1,w),t);n+=`<code>${x.html}</code>`,r=!0,o=w+1,s=o;continue}}if(a==="["){const w=e.indexOf("]",o+1);if(w>o+1&&e[w+1]==="("){const x=e.indexOf(")",w+2);if(x>w+2){const f=e.slice(o+1,w),b=e.slice(w+2,x),p=Cd(f,b,t);if(p){l(o),n+=p.html,r=!0,o=x+1,s=o;continue}}}}const d=fi(e,o),u=d?null:hi(e,o),h=d??u;if(h){l(o),n+=h.html,r=!0,o=h.end,s=o;continue}const m=e.startsWith("**",o)?"**":e.startsWith("__",o)?"__":null;if(m){const w=e.indexOf(m,o+2);if(w>o+2){l(o);const x=ot(e.slice(o+2,w),t);n+=`<strong>${x.html}</strong>`,r=!0,o=w+2,s=o;continue}}o+=1}return l(e.length),{html:n,changed:r}}function pr(e){return e==="+"?"fixed-font-diff-added":e==="-"?"fixed-font-diff-removed":e===" "?"fixed-font-diff-context":""}function gr(e){return`<span class="fixed-font-diff-gutter">${e===""||e===" "?" ":pe(e)}</span>`}function jd(e,t,n={}){var x,f;const r=e[t],s=e[t+1];if(!r||!mr(r.content))return null;const o=!!s&&Yn(s.content);let l=o?t+2:t+1;for(;l<e.length&&mr(((x=e[l])==null?void 0:x.content)??"")&&!(l+1<e.length&&Yn(((f=e[l+1])==null?void 0:f.content)??""));)l+=1;if(!o&&l-t<2)return null;const a=o?yn(s.content).map(Ed):[],d=o?e.slice(t+2,l).filter(b=>!Yn(b.content)):e.slice(t,l),u=e.slice(t,l).some(b=>b.prefix!==""),h=(b,p,v)=>{const k=a[v],L=k?` style="text-align: ${k}"`:"";return`<${b}${L}>${ot(p,n).html}</${b}>`},m=o?(()=>{const b=yn(r.content).map((v,k)=>h("th",v,k)).join(""),p=u?`<th class="fixed-font-diff-gutter-cell">${gr(r.prefix)}</th>`:"";return`<thead><tr class="${pr(r.prefix)}">${p}${b}</tr></thead>`})():"",w=d.map(b=>{const p=yn(b.content).map((k,L)=>h("td",k,L)).join(""),v=u?`<td class="fixed-font-diff-gutter-cell">${gr(b.prefix)}</td>`:"";return`<tr class="${pr(b.prefix)}">${v}${p}</tr>`}).join("");return{end:l,html:`<div class="fixed-font-markdown-block"><table class="fixed-font-markdown-table">${m}<tbody>${w}</tbody></table></div>`}}function Rd(e,t,n){var h;if(n)return null;const s=(((h=e[t])==null?void 0:h.content.trim())??"").match(/^[\w.-]+\[(\d+)\]\{[^}]*\}:$/);if(!s)return null;const o=t+1+Number(s[1]);if(o>e.length)return null;const l=ma(e.slice(t,o).map(m=>m.content).join(`
|
|
43
|
-
`)),a=(l==null?void 0:l.length)===1?l[0]:void 0;if(!a)return null;const d=`<thead><tr>${a.columns.map(m=>`<th>${pe(m)}</th>`).join("")}</tr></thead>`,u=a.rows.map(m=>`<tr>${m.map(w=>`<td>${pe(w)}</td>`).join("")}</tr>`).join("");return{end:o,html:`<div class="fixed-font-markdown-block"><table class="fixed-font-markdown-table">${d}<tbody>${u}</tbody></table></div>`}}function Md(e,t={}){var a;const n=/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/.exec(e);if(n!=null&&n[1]&&n[2])return{html:ot(n[2],t).html,changed:!0,className:`fixed-font-markdown-heading fixed-font-markdown-heading-${n[1].length}`};if(/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/.test(e))return{html:'<span class="fixed-font-markdown-rule" aria-hidden="true"></span>',changed:!0,className:"fixed-font-markdown-rule-line"};const r=/^\s{0,3}>\s?(.*)$/.exec(e);if(r)return{html:ot(r[1]??"",t).html,changed:!0,className:"fixed-font-markdown-blockquote"};const s=/^(\s*)([-*+]|\d+[.)])\s+(.+)$/.exec(e);if(s!=null&&s[2]&&s[3]){const d=((a=s[1])==null?void 0:a.length)??0,u=s[2].length+1;return{html:`<span class="fixed-font-markdown-list-marker">${/^\d/.test(s[2])?pe(s[2]):"•"}</span><span class="fixed-font-markdown-list-body">${ot(s[3],t).html}</span>`,changed:!0,className:"fixed-font-markdown-list-line",style:`--fixed-font-list-indent-ch:${d};--fixed-font-list-marker-ch:${u};`}}const o=/^(\s+)(\S[\s\S]*)$/.exec(e);if(o!=null&&o[1]&&o[2]){const d=ot(o[2],t);return{html:`<span class="fixed-font-leading-indent" style="--fixed-font-leading-ch:${o[1].length};"></span>${d.html}`,changed:d.changed}}return ot(e,t)}function wi(e,t,n){var d,u,h;const r=(d=e[t])==null?void 0:d.content.trim(),s=r==="$$"?"$$":r==="\\["?"\\]":null;if(!s)return null;let o=t+1;for(;o<e.length&&((u=e[o])==null?void 0:u.content.trim())!==s;)o+=1;if(o>=e.length)return null;const l=e.slice(t+1,o).map(m=>m.content).join(`
|
|
44
|
-
`).trim();if(!l)return null;const a=En(l,!0);if(n){const m=e.slice(t,o+1),w=((h=m[0])==null?void 0:h.prefix)??"";return m.some(x=>x.prefix!==w)?null:{end:o+1,html:Br({prefix:w},{className:"fixed-font-markdown-display-math",html:a})}}return{end:o+1,html:a}}function Br(e,t){const n=["fixed-font-rendered-line",pr(e.prefix),t.className].filter(Boolean).join(" "),r=t.style?` style="${t.style}"`:"";return`<div class="${n}">${gr(e.prefix)}<div class="fixed-font-rendered-line__content"${r}>${t.html}</div></div>`}function Ad(e){const t=$r(e).replace(/\r\n/g,`
|
|
45
|
-
`).split(`
|
|
46
|
-
`).map(o=>gi(o,!0));let n="",r=!1,s=0;for(;s<t.length;){const o=wi(t,s,!0);if(o){n+=o.html,r=!0,s=o.end;continue}const l=t[s];if(!l){s+=1;continue}const a=pi(l.content);n+=Br(l,a),a.changed&&(r=!0),s+=1}return{html:n,changed:r}}function Pd(e,t={}){const n=$r(e),r=t.baseFilePath??Sd(n),s=t.diffAware??_d(n);if(!s&&ed(n).some(h=>h.kind!=="text"))return{html:pe(n),changed:!1};const o={...t,baseFilePath:r},l=n.replace(/\r\n/g,`
|
|
47
|
-
`).split(`
|
|
48
|
-
`).map(h=>gi(h,s));let a="",d=!1,u=0;for(;u<l.length;){const h=wi(l,u,s);if(h){a+=h.html,h.end<l.length&&(a+=`
|
|
49
|
-
`),d=!0,u=h.end;continue}const m=Rd(l,u,s);if(m){a+=m.html,d=!0,u=m.end;continue}const w=jd(l,u,o);if(w){a+=w.html,d=!0,u=w.end;continue}const x=l[u];if(!x){u+=1;continue}const f=Md(x.content,o);f.changed&&(d=!0),s?a+=Br(x,f):(a+=f.html,u<l.length-1&&(a+=`
|
|
50
|
-
`)),u+=1}return{html:a,changed:d}}function wr(e,t={}){return si("fixed-font-rich-content",()=>({...mi(e),diffAware:t.diffAware??null,hasProjectId:!!t.projectId,hasBaseFilePath:!!t.baseFilePath}),()=>Pd(e,t))}function Td(e,t){return t==="themed"?e:e.replace(/ data-tooltip="([^"]*)"/g,(n,r)=>` title="${r}"`)}function jp({sourceText:e,sourceView:t,renderRenderedView:n,diffAware:r,baseFilePath:s,initialMode:o,precomputedRendered:l,renderMode:a="rich",projectPathLinks:d}){const u=yr(),h=Mn(),m=Lt(),w=vl(),{projectPaths:x,mentionedDirectories:f}=Bc(),b=gc(s),[p,v]=c.useState(null),k=c.useRef(null),L=c.useMemo(()=>$r(e),[e]),C=c.useMemo(()=>h?Tr(h):void 0,[h]),j=c.useMemo(()=>l??(a==="math"?Ld(e,{diffAware:r}):wr(e,{diffAware:r,projectId:u==null?void 0:u.projectId,projectPath:(u==null?void 0:u.projectPath)??void 0,baseFilePath:s,basePath:m,publicShare:h,projectPathLinks:d})),[l,e,a,r,u==null?void 0:u.projectId,u==null?void 0:u.projectPath,s,m,h,d]),{showRendered:y,toggleLocalMode:S}=Dc(j.changed,{initialMode:o,renderWhenDisabled:!1,resetDependencies:[e,a]}),{btnRef:g,handleClick:E}=Qu(y,S),M=c.useMemo(()=>{var N;const A=Uu(j.html,void 0,u==null?void 0:u.projectId,h,{projectPaths:x,mentionedDirectories:f}).html,F=Td(A,w);return Mc(F,b.state==="ready"&&((N=b.result)==null?void 0:N.status)==="ready"?b.result.artifact:void 0).html},[b,j.html,w,x,f,u==null?void 0:u.projectId,h]);c.useEffect(()=>{const A=k.current;if(!(!A||!L.trim()))return Jl(A,L,void 0,y&&j.changed?"rendered":"literal")},[L,y,j.changed]);const P=c.useCallback(A=>{var N,I;const F=(I=(N=A.target)==null?void 0:N.closest)==null?void 0:I.call(N,"a[data-fixed-font-file-path]");F&&(A.button!==0||A.metaKey||A.ctrlKey||A.shiftKey||A.altKey||(A.preventDefault(),A.stopPropagation(),v({filePath:F.dataset.fixedFontFilePath??"",href:F.getAttribute("href"),lineNumber:Number(F.dataset.yaLine)||void 0,lineEnd:Number(F.dataset.yaLineEnd)||void 0})))},[]),B=c.useCallback(A=>{const F=k.current,N=F?kr(Ut(F)):"";Ml(A.nativeEvent,A.currentTarget)&&N&&A.clipboardData.setData("text/plain",N)},[]),T=(u==null?void 0:u.projectId)??(h==null?void 0:h.projectId)??"";return i.jsxs("div",{ref:k,className:"fixed-font-render-toggle","data-render-mode":y&&j.changed?"rendered":"source",children:[y&&j.changed?i.jsx("div",{onClick:P,onCopy:B,children:n(M)}):t,j.changed&&i.jsx("button",{ref:g,type:"button",className:`fixed-font-render-toggle__button ${y?"is-rendered":""}`,onClick:E,"aria-label":y?"Show source":"Show rendered view",title:y?"Show source":"Show rendered view","aria-pressed":y,children:i.jsx(Gc,{})}),p&&T!==""&&i.jsx(_t,{projectId:T,filePath:p.filePath,lineNumber:p.lineNumber,lineEnd:p.lineEnd,source:C,openInNewTabUrl:p.href,onClose:()=>v(null)})]})}function Fd(e){return e==="auto"||e==="unified"||e==="side-by-side"}function $d(){try{const e=localStorage.getItem(Ve.diffViewMode);if(Fd(e))return e}catch{}return"auto"}function Nd(){const[e,t]=c.useState($d),n=c.useCallback(r=>{t(r);try{localStorage.setItem(Ve.diffViewMode,r)}catch{}},[]);return[e,n]}const Bd="[data-source-list-item]:not(:disabled)",Dd="[data-source-file-item]:not(:disabled)",Id=100;function Qn(){xl(Id)}function Rp(e,{filesOnly:t=!1,onPage:n}={}){var h,m;const r=e.key==="PageDown"?1:e.key==="PageUp"?-1:null;if(r===null&&e.key!=="ArrowDown"&&e.key!=="ArrowUp"&&e.key!=="ArrowLeft"&&e.key!=="ArrowRight"||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;if(r!==null){if(!n)return;e.preventDefault(),Qn(),n(r);return}const s=Array.from(e.currentTarget.querySelectorAll(t?Dd:Bd));if(s.length===0)return;const o=document.activeElement,l=s.indexOf(o);if(l<0)return;if(e.key==="ArrowLeft"||e.key==="ArrowRight"){const w=s[l],x=w.getAttribute("aria-expanded");if(e.preventDefault(),Qn(),e.key==="ArrowRight"){if(x==="false"){w.click();return}if(x==="true"){const p=s[l+1];if(!p||!((h=w.parentElement)!=null&&h.contains(p)))return;p.focus()}return}if(x==="true"){w.click();return}const f=w.closest("ul");if(!f||f===e.currentTarget)return;const b=(m=f.parentElement)==null?void 0:m.querySelector(":scope > [data-source-list-item]:not(:disabled)");if(!b)return;b.focus();return}const a=e.key==="ArrowDown"?1:-1,d=Math.min(s.length-1,Math.max(0,l+a)),u=s[d];u&&(e.preventDefault(),Qn(),u!==o&&u.focus())}function Mp(e,t=!0){c.useEffect(()=>{if(!t)return;const n=r=>{if(r.defaultPrevented||r.key!=="/"||r.altKey||r.ctrlKey||r.metaKey||vi(r.target))return;const s=e.current;s&&(r.preventDefault(),s.focus(),s.select())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e])}function vi(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT":!1}const Od=1e3;function Hd(e,t){return e==="unified"||e==="side-by-side"?e:t>=Od?"side-by-side":"unified"}function Ud(e){const t=[];let n=0;for(const r of e){t.push({type:"header",text:`@@ -${r.oldStart},${r.oldLines} +${r.newStart},${r.newLines} @@`});let s=[],o=[];const l=()=>{const a=Math.max(s.length,o.length);for(let d=0;d<a;d++)t.push({type:"line",left:s[d]??null,right:o[d]??null});s=[],o=[]};for(const a of r.lines){const d=n++,u=a[0];u==="-"?s.push(d):u==="+"?o.push(d):(l(),t.push({type:"line",left:d,right:d}))}l()}return t}function xi(e,t=!1){var s;const n=new Map;if(typeof DOMParser>"u")return n;const r=new DOMParser().parseFromString(e,"text/html");for(const o of r.querySelectorAll("[data-diff-line]")){const l=Number(o.getAttribute("data-diff-line"));Number.isInteger(l)&&(t&&((s=o.querySelector(".diff-prefix"))==null||s.remove()),n.set(l,o.outerHTML))}return n}const Vd=c.createContext(null);function qd(){return c.useContext(Vd)}const bn=new Map;function Wd(e,t){let n=bn.get(e);return n||(n=new Set,bn.set(e,n)),n.add(t),()=>{n==null||n.delete(t),n&&n.size===0&&bn.delete(e)}}function ro(e){for(const t of bn.get(e)??[])t()}function Kd(e,t,n=!1){const r=yl(),s=Lt(),o=qd(),[l,a]=c.useState([]),[d,u]=c.useState(!1),[h,m]=c.useState(null),w=c.useRef(null),x=c.useCallback(async()=>{try{const p=await te.listReviewComments(e);a(p.comments.filter(v=>v.status==="pending"&&v.anchor.path===t))}catch{}},[e,t]);c.useEffect(()=>(x(),Wd(e,()=>{x()})),[e,x]);const f=c.useCallback(async(p,v)=>{u(!0),m(null);try{const{comment:k}=await te.addReviewComment(e,p,v);return a(L=>[...L,k]),ro(e),!0}catch(k){return m(k instanceof Error?k.message:"Failed to add comment"),!1}finally{u(!1)}},[e]),b=c.useCallback(async(p,v,k,L,C)=>{var j;u(!0),m(null);try{const y=JSON.stringify({anchor:p,text:v,target:k}),S=n&&((j=w.current)==null?void 0:j.key)===y?w.current:null,g=S?S.commentId:(await te.addReviewComment(e,p,v)).comment.id,E=(S==null?void 0:S.submissionId)??bo();n&&!S&&(w.current={key:y,commentId:g,submissionId:E});const M=n?{id:E}:void 0,P=M?await te.submitReview(e,[g],k,k==="new"?C:void 0,M):k==="new"&&C?await te.submitReview(e,[g],k,C):await te.submitReview(e,[g],k);return ro(e),P.sessionId?(w.current=null,r(`${s}/projects/${e}/sessions/${P.sessionId}`),"navigated"):(n&&(w.current=null),m(L),x(),"queued")}catch(y){return m(y instanceof Error?y.message:"Failed to submit"),"error"}finally{u(!1)}},[e,r,s,x,n]);return{pending:l,defaultSession:o,busy:d,error:h,setError:m,refreshPending:x,addToReview:f,submitNow:b}}function so({sessionId:e,fallback:t,children:n,className:r}){var k,L;const s=pl(e),{showDelayMs:o,warmShowDelayMs:l,maxHeightPx:a}=wc(),d=c.useRef(null),{anchor:u,hoverCardId:h,clear:m,onPointerEnter:w,onPointerMove:x,onPointerLeave:f}=vc({targetRef:d,showDelayMs:o,warmShowDelayMs:l,refreshPreview:{projectId:t.projectId,sessionId:e,lastAgentText:s==null?void 0:s.lastAgentText,owner:(k=s==null?void 0:s.ownership)==null?void 0:k.owner,available:!!s}});c.useEffect(()=>{if(!u)return;const C=()=>m();return window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[u,m]);const p=((L=!!(s!=null&&s.customTitle)?s==null?void 0:s.title:(s==null?void 0:s.initialPrompt)??(s==null?void 0:s.fullTitle)??(s==null?void 0:s.title))==null?void 0:L.trim())||t.title,v=(s==null?void 0:s.provider)??t.provider;return i.jsxs("span",{ref:d,className:r,onPointerEnter:w,onPointerMove:x,onPointerLeave:f,children:[n,u&&i.jsx(xc,{hoverCardId:h,anchor:u,prompt:p,lastAgentText:s==null?void 0:s.lastAgentText,provider:v,model:(s==null?void 0:s.model)??t.model,projectName:s==null?void 0:s.projectName,ageLabel:yc(s==null?void 0:s.updatedAt,s==null?void 0:s.createdAt),status:s==null?void 0:s.ownership,pendingInputType:s==null?void 0:s.pendingInputType,hasUnread:s==null?void 0:s.hasUnread,activity:s==null?void 0:s.activity,maxHeightPx:a,onMouseLeave:m})]})}async function zd(e){var r;const t=[];let n;for(;;){const s=await te.getGlobalSessions({project:e,limit:500,after:n});if(t.push(...s.sessions),!s.hasMore)return t;const o=(r=s.sessions[s.sessions.length-1])==null?void 0:r.updatedAt;if(!o||o===n)throw new Error("Existing-session list did not advance");n=o}}function Gd(e,t){const n=e.customTitle||e.title||e.id.slice(0,8),r=e.model?`${e.provider}/${e.model}`:e.provider;return t?`${n} · ${r} · ${t}`:`${n} · ${r}`}const Xd="_window_1f36g_1",Yd="_anchor_1f36g_12",Qd="_snippet_1f36g_18",Jd="_input_1f36g_30",Zd="_error_1f36g_41",ef="_actions_1f36g_46",tf="_submitActions_1f36g_53",nf="_destination_1f36g_62",rf="_destinationError_1f36g_76",sf="_defaultSessionTarget_1f36g_82",of="_submit_1f36g_53",Le={window:Xd,anchor:Yd,snippet:Qd,input:Jd,error:Zd,actions:ef,submitActions:tf,destination:nf,destinationError:rf,defaultSessionTarget:sf,submit:of};function lf({projectId:e,anchorLabel:t,snippet:n,busy:r,error:s,onCancel:o,onAddToReview:l,defaultSession:a,onSubmit:d,t:u}){const[h,m]=c.useState(""),[w,x]=c.useState(null),[f,b]=c.useState(!1),[p,v]=c.useState((a==null?void 0:a.id)??"new"),k=c.useRef(!1),L=h.trim().length>0&&!r;c.useEffect(()=>{let y=!1;return zd(e).then(S=>{var g;y||(x(S),!a&&!k.current&&v(((g=S[0])==null?void 0:g.id)??"new"))}).catch(()=>{y||b(!0)}),()=>{y=!0}},[a,e]);const C=(w==null?void 0:w.find(y=>y.id===p))??null,j=i.jsx("button",{type:"button",className:Le.submit,onClick:()=>d(h,p),disabled:!L,children:u("sourceReviewSubmitComment")});return i.jsx(yi,{anchorLabel:t,snippet:n,text:h,placeholder:u("sourceReviewCommentPlaceholder"),error:s,onChange:m,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"review-comment-window-cancel",onClick:o,disabled:r,children:u("cancel")}),i.jsx("button",{type:"button",className:"review-comment-window-add",onClick:()=>l(h),disabled:!L,children:u("sourceReviewAddToReview")}),i.jsxs("div",{className:Le.submitActions,children:[i.jsxs("label",{className:Le.destination,children:[i.jsx("span",{children:u("sourceReviewTargetLegend")}),i.jsxs("select",{value:p,onChange:y=>{k.current=!0,v(y.target.value)},children:[i.jsx("option",{value:"new",children:u("sourceReviewTargetNew")}),a&&!(w!=null&&w.some(y=>y.id===a.id))&&i.jsxs("option",{value:a.id,children:[a.title," ·"," ",a.newSession.provider,a.newSession.model?`/${a.newSession.model}`:""," ","· ",u("sourceReviewCurrentSuffix")]}),w==null?void 0:w.map(y=>i.jsx("option",{value:y.id,children:Gd(y,y.id===(a==null?void 0:a.id)?u("sourceReviewCurrentSuffix"):void 0)},y.id))]})]}),f&&i.jsx("span",{className:Le.destinationError,children:u("sourceReviewSessionsUnavailable")}),a&&p===a.id?i.jsx(so,{sessionId:a.id,fallback:{projectId:a.projectId,title:a.title,provider:a.newSession.provider,model:a.newSession.model},className:Le.defaultSessionTarget,children:j}):C?i.jsx(so,{sessionId:C.id,fallback:{projectId:C.projectId,title:C.customTitle||C.title||C.id.slice(0,8),provider:C.provider,model:C.model},className:Le.defaultSessionTarget,children:j}):j]})]})})}function yi({anchorLabel:e,snippet:t,text:n,placeholder:r,autoFocus:s=!0,error:o,onChange:l,onBlur:a,onKeyDown:d,actions:u}){return i.jsxs("div",{className:Le.window,"data-markdown-copy-ignore":"true",children:[i.jsx("div",{className:Le.anchor,children:e}),i.jsx("pre",{className:Le.snippet,children:t}),i.jsx("textarea",{className:Le.input,autoFocus:s,rows:3,value:n,placeholder:r,onBlur:a,onChange:h=>l(h.target.value),onKeyDown:d}),o&&i.jsx("div",{className:Le.error,children:o}),i.jsx("div",{className:Le.actions,children:u})]})}const cf="_menuTrigger_qenm5_1",af={menuTrigger:cf};function uf({container:e,structuredPatch:t,pending:n,revisions:r,consumeLongPressClick:s,onOpenComment:o,onOpenMenu:l,onBeginLongPress:a,onMoveLongPress:d,onEndLongPress:u,t:h}){const[m,w]=c.useState(null),x=c.useCallback(p=>{if(!(p instanceof HTMLElement))return null;const v=p.closest("[data-diff-line]");return!v||!e.contains(v)?null:Jn(e,v,t)},[e,t]),f=c.useCallback(p=>{w(v=>(v==null?void 0:v.flatIndex)===p.flatIndex&&v.contextSide===p.contextSide&&v.top===p.top?v:p)},[]),b=c.useCallback(()=>{if(!m)return null;const p=e.querySelectorAll(`[data-diff-line="${m.flatIndex}"]`),v=Array.from(p).find(k=>bi(k)===m.contextSide)??p[0];return v?Jn(e,v,t):null},[m,e,t]);return c.useLayoutEffect(()=>{const p=g=>{var M;if(s()||!(((M=window.getSelection())==null?void 0:M.isCollapsed)??!0))return;const E=x(g.target);E&&o(E)},v=g=>{const E=x(g.target);E&&(g.preventDefault(),g.stopPropagation(),f(E.target),l(E,{x:g.clientX,y:g.clientY}))},k=g=>{const E=x(g.target);E&&(f(E.target),a(E,g))},L=g=>{d(g);const E=x(g.target);E&&f(E.target)},C=()=>u(),j=()=>{u(),w(null)},y=g=>{const E=x(g.target);E&&f(E.target)},S=g=>{const E=x(g.target);if(!E)return;if(g.key==="ContextMenu"||g.shiftKey&&g.key==="F10"){g.preventDefault(),g.stopPropagation();const T=E.node.getBoundingClientRect();l(E,{x:T.left+Math.min(32,T.width/2),y:T.bottom});return}if(g.key==="Enter"||g.key===" "){g.preventDefault(),o(E);return}if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;const M=Array.from(e.querySelectorAll("[data-diff-line]")),P=M.indexOf(E.node),B=M[P+(g.key==="ArrowDown"?1:-1)];B&&(g.preventDefault(),B.focus())};return e.addEventListener("click",p),e.addEventListener("contextmenu",v),e.addEventListener("pointerdown",k),e.addEventListener("pointermove",L),e.addEventListener("pointerup",C),e.addEventListener("pointercancel",C),e.addEventListener("pointerleave",j),e.addEventListener("focusin",y),e.addEventListener("keydown",S),()=>{e.removeEventListener("click",p),e.removeEventListener("contextmenu",v),e.removeEventListener("pointerdown",k),e.removeEventListener("pointermove",L),e.removeEventListener("pointerup",C),e.removeEventListener("pointercancel",C),e.removeEventListener("pointerleave",j),e.removeEventListener("focusin",y),e.removeEventListener("keydown",S)}},[f,s,e,a,u,d,o,l,x]),c.useLayoutEffect(()=>{const p=new Set(n.map(L=>ff(L.anchor))),v=()=>{const L=e.querySelectorAll("[data-diff-line]");for(const C of L){const j=Jn(e,C,t),y=j?r==null?void 0:r[j.location.side]:void 0;C.classList.toggle("has-review-comment",!!j&&p.has(Si(j.location,y))),C.tabIndex=0,C.setAttribute("aria-label",h("sourceDiffLineActions"))}};v();const k=new MutationObserver(v);return k.observe(e,{childList:!0,subtree:!0}),()=>k.disconnect()},[e,n,r,t,h]),{activeLine:m,resolveActiveLine:b}}function Jn(e,t,n){const r=Number(t.getAttribute("data-diff-line")),s=bi(t),o=oa(n,r,void 0,s);if(!o)return null;const l=t.getBoundingClientRect(),a=e.getBoundingClientRect();return{node:t,target:{flatIndex:r,contextSide:s,top:l.top-a.top+e.scrollTop},location:o}}function bi(e){var t;return((t=e.closest("[data-diff-col]"))==null?void 0:t.getAttribute("data-diff-col"))==="old"?"old":"new"}function df(e){return(e==null?void 0:e.kind)==="sha"?`sha:${e.sha}`:"uncommitted"}function Si(e,t){return`${df(t)}:${e.side}:${e.oldLine}:${e.newLine}`}function ff(e){return Si(e,e.revision)}function hf({projectId:e,filePath:t,structuredPatch:n,revisions:r,projections:s,container:o,onOpenChange:l,renderSource:a,t:d}){const[u,h]=c.useState(null),{pending:m,defaultSession:w,busy:x,error:f,setError:b,addToReview:p,submitNow:v}=Kd(e,t,s!==void 0);c.useLayoutEffect(()=>(l==null||l(u!==null),()=>{u&&(l==null||l(!1))}),[l,u]);const k=c.useCallback(y=>{b(null),h(y)},[b]),L=c.useCallback(async y=>{u&&await p(u.anchor,y)&&h(null)},[p,u]),C=c.useCallback(async(y,S,g)=>{if(!u)return;await v(u.anchor,y,S,d("sourceReviewSubmitQueued"),g)==="navigated"&&h(null)},[u,v,d]),j=u?i.jsx(lf,{projectId:e,anchorLabel:`${t}:${u.anchor.newLine??u.anchor.oldLine??"?"}`,snippet:u.anchor.snippet,busy:x,error:f,onCancel:()=>h(null),onAddToReview:L,defaultSession:w,onSubmit:(y,S)=>C(y,S,S==="new"?w==null?void 0:w.newSession:void 0),t:d},`${u.anchor.side}:${u.flatIndex}`):null;return i.jsxs(i.Fragment,{children:[a({openComment:u,editor:j}),i.jsx(mf,{filePath:t,structuredPatch:n,revisions:r,projections:s,container:o,pending:m,onOpenComment:k,t:d})]})}function mf({filePath:e,structuredPatch:t,revisions:n,projections:r,container:s,pending:o,onOpenComment:l,t:a}){const{menu:d,openAt:u,openFromButton:h,beginLongPressAt:m,moveLongPressAt:w,endLongPress:x,consumeLongPressClick:f}=Mo(a),b=c.useCallback(y=>({path:e,revision:(n==null?void 0:n[y.side])??{kind:"uncommitted",savedAt:new Date().toISOString()},side:y.side,oldLine:y.oldLine,newLine:y.newLine,snippet:y.snippet,snippetAnchorOffset:y.snippetAnchorOffset,...r!=null&&r[y.side]?{projection:r[y.side]}:{}}),[e,r,n]),p=c.useCallback(({location:y,target:S})=>{l({anchor:b(y),flatIndex:S.flatIndex})},[b,l]),v=c.useCallback((y,S,g)=>{const E=S.snippet.split(`
|
|
51
|
-
`)[S.snippetAnchorOffset]??"",M=S.newLine??S.oldLine;return[{label:a("sourceCommentOnLine"),onSelect:()=>p({target:y,location:S,node:g})},{label:a("sourceCopyLine"),separatorBefore:!0,onSelect:()=>{we(E)}},{label:a("sourceCopyPathLine"),onSelect:()=>{we(M?`${e}:${M}`:e)}}]},[e,p,a]),k=c.useCallback((y,S)=>{u(S.x,S.y,y.node,v(y.target,y.location,y.node))},[v,u]),L=c.useCallback((y,S)=>{m(S,y.node,v(y.target,y.location,y.node))},[m,v]),{activeLine:C,resolveActiveLine:j}=uf({container:s,structuredPatch:t,pending:o,revisions:n,consumeLongPressClick:f,onOpenComment:p,onOpenMenu:k,onBeginLongPress:L,onMoveLongPress:w,onEndLongPress:x,t:a});return i.jsxs(i.Fragment,{children:[C&&i.jsx("button",{type:"button",className:af.menuTrigger,style:{top:C.top},"aria-label":a("sourceMoreActions"),title:a("sourceMoreActions"),onClick:y=>{const S=j();S&&h(y,v(S.target,S.location,S.node))},children:"⋯"}),d]})}const Dr=c.memo(function({as:t="div",trustedHtml:n,...r}){const s=ti(n);return i.jsx(t,{...r,dangerouslySetInnerHTML:s})}),pf="_root_nfjne_1",gf="_source_nfjne_7",wf="_editor_nfjne_11",yt={root:pf,source:gf,editor:wf};function It({before:e,editor:t,after:n}){return t?i.jsxs("div",{className:yt.root,"data-review-comment-split":"",children:[i.jsx("div",{className:yt.source,"data-review-comment-before":"",children:e}),i.jsx("div",{className:yt.editor,children:t}),i.jsx("div",{className:yt.source,"data-review-comment-after":"",children:n})]}):i.jsx(i.Fragment,{children:e})}function vf({editor:e}){return e?i.jsx("div",{className:yt.root,"data-review-comment-inline":"",children:i.jsx("div",{className:yt.editor,children:e})}):null}const xf=c.memo(function({diffHtml:t,structuredPatch:n,splitAfterLine:r,editor:s=null}){const o=c.useMemo(()=>xi(t),[t]),l=c.useMemo(()=>Ud(n),[n]),a=r===void 0?-1:l.findIndex(d=>d.type==="line"&&(d.left===r||d.right===r));return a<0||!s?i.jsx(Zn,{rows:l,fragments:o}):i.jsx(It,{before:i.jsx(Zn,{rows:l.slice(0,a+1),fragments:o}),editor:s,after:i.jsx(Zn,{rows:l.slice(a+1),fragments:o})})});function Zn({rows:e,fragments:t}){return i.jsx("div",{className:"side-by-side-diff",children:e.map((n,r)=>n.type==="header"?i.jsx(Dr,{className:"sbs-header highlighted-diff",trustedHtml:`<pre class="shiki"><code><span class="line line-hunk">${yf(n.text)}</span></code></pre>`},`h-${r}`):i.jsxs("div",{className:"sbs-row",children:[i.jsx(io,{col:"old",html:oo(t,n.left)}),i.jsx(io,{col:"new",html:oo(t,n.right)})]},`r-${r}`))})}function oo(e,t){return t===null?null:e.get(t)??null}function io({col:e,html:t}){return t===null?i.jsx("div",{className:"sbs-cell sbs-empty"}):i.jsx(Dr,{className:"sbs-cell highlighted-diff","data-diff-col":e,trustedHtml:`<pre class="shiki"><code>${t}</code></pre>`})}function yf(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const bf="_plain_v5smy_1",Sf="_hunkHeader_v5smy_22",lo={plain:bf,hunkHeader:Sf},er=".line-deleted, .line-inserted, .diff-removed, .diff-added, .fixed-font-diff-removed, .fixed-font-diff-added",co=c.memo(function({diffHtml:t,structuredPatch:n,splitAfterLine:r,editor:s=null,plain:o=!1,hideRemovedLines:l=!1}){const a=c.useMemo(()=>o?new Map:xi(t,l),[t,l,o]),d=c.useMemo(()=>o?[]:Cf(n,l),[l,o,n]);if(o)return i.jsx(kf,{hunks:n,hideRemovedLines:l});const u=r===void 0?-1:d.findIndex(h=>h.type==="line"&&h.flatIndex===r);return u<0||!s?i.jsx(tr,{rows:d,fragments:a,omitDiffPrefixes:l}):i.jsx(It,{before:i.jsx(tr,{rows:d.slice(0,u+1),fragments:a,omitDiffPrefixes:l}),editor:s,after:i.jsx(tr,{rows:d.slice(u+1),fragments:a,omitDiffPrefixes:l})})});function kf({hunks:e,hideRemovedLines:t}){return i.jsx("div",{className:lo.plain,"data-diff-rendering":"plain",children:i.jsx("pre",{children:i.jsx("code",{children:e.map((n,r)=>i.jsxs(c.Fragment,{children:[!t&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${lo.hunkHeader} line-hunk`,children:`@@ -${n.oldStart},${n.oldLines} +${n.newStart},${n.newLines} @@`}),`
|
|
52
|
-
`]}),n.lines.filter(s=>!t||!s.startsWith("-")).map(s=>t?s.slice(1):s).join(`
|
|
53
|
-
`),r+1<e.length?`
|
|
54
|
-
`:""]},`${n.oldStart}:${n.newStart}:${r}`))})})})}function Cf(e,t){const n=[];let r=0;for(const s of e){t||n.push({type:"header",text:`@@ -${s.oldStart},${s.oldLines} +${s.newStart},${s.newLines} @@`});for(const o of s.lines)(!t||!o.startsWith("-"))&&n.push({type:"line",flatIndex:r,text:o}),r+=1}return n}function tr({rows:e,fragments:t,omitDiffPrefixes:n}){const r=e.map(s=>s.type==="header"?`<span class="line line-hunk">${nr(s.text)}</span>`:t.get(s.flatIndex)??`<span class="${Lf(s.text)}" data-diff-line="${s.flatIndex}">${n?"":`<span class="diff-prefix">${nr(s.text[0]??" ")}</span>`}${nr(s.text.slice(1))}</span>`).join("");return i.jsx(Dr,{className:"highlighted-diff",trustedHtml:`<pre class="shiki"><code>${r}</code></pre>`})}function Lf(e){return e[0]==="-"?"line line-deleted":e[0]==="+"?"line line-inserted":"line line-context"}function nr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const _f="_plainNotice_xkep3_1",Ef={plainNotice:_f},jf=1e6*20;function Rf(e){return e.flatMap(t=>t.lines).join(`
|
|
55
|
-
`)}function ao(e){return e.length===0?null:e.map(t=>t.lines.filter(n=>n.startsWith(" ")||n.startsWith("+")).map(n=>n.slice(1)).join(`
|
|
56
|
-
`)).join(`
|
|
57
|
-
`)}function gn(e){return e.closest(".git-diff-preview-body, .modal-content")??e}const Gt={kind:"worktree"},Mf={kind:"working-tree-history"};function jn(e){if(e.kind==="commit")return e.sha;if(e.kind==="comparison"||e.kind==="inclusive-comparison")return e.headSha}function Ir(e){const t=Math.max(0,e.scrollHeight-e.clientHeight);return t===0?0:Math.min(1,Math.max(0,e.scrollTop/t))}function Af(e,t){const n=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=n*Math.min(1,Math.max(0,t))}function vr(e,t,n,r){return e==="commit"?{kind:"commit",sha:t}:e==="comparison"||e==="inclusive-comparison"?{kind:e,baseSha:t,headSha:n}:e==="file-projection"?{kind:"file-projection",mode:r}:e==="working-tree-history"?Mf:Gt}function ki(e,t,n,r,s){return n.kind==="commit"?te.getGitCommitDiff(e,{sha:n.sha,path:t.path,status:t.status,...t.origPath?{origPath:t.origPath}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}}):n.kind==="comparison"||n.kind==="inclusive-comparison"?(n.kind==="inclusive-comparison"?te.getGitInclusiveComparisonDiff:te.getGitComparisonDiff)(e,{baseSha:n.baseSha,headSha:n.headSha,path:t.path,status:t.status,...t.origPath?{origPath:t.origPath}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}}):n.kind==="file-projection"?te.getGitFileProjectionDiff(e,{path:t.path,mode:n.mode,...t.origPath?{origPath:t.origPath}:{},fullContext:r}):te.getGitDiff(e,{path:t.path,staged:t.staged,status:t.status,...n.kind==="working-tree-history"?{againstHead:!0,...t.origPath?{origPath:t.origPath}:{}}:{},fullContext:r,...s?{ignoreWhitespace:!0}:{}})}function Pf(e){if(e.kind==="commit"){const t={kind:"sha",sha:e.sha};return{old:t,new:t}}if(e.kind==="comparison"||e.kind==="inclusive-comparison")return{old:{kind:"sha",sha:e.baseSha},new:{kind:"sha",sha:e.headSha}}}const Ap=c.forwardRef(function({file:t,fileKey:n,projectId:r,source:s=Gt,headerActions:o,retainedScrollRatio:l,retainedDiffView:a,onRetainScrollRatio:d,onRetainDiffView:u,onCommentEditorOpenChange:h,captureReviewProjections:m=!1,ignoreWhitespace:w=!1,onToggleIgnoreWhitespace:x,onProjectionRequestFailure:f,t:b},p){const v=t?t.path.split("/").pop()||t.path:null,k=c.useRef(null),L=c.useRef(null),C=c.useCallback(j=>{L.current=j},[]);return c.useImperativeHandle(p,()=>({jumpToNextHunk:()=>{var j;return((j=L.current)==null?void 0:j.next())??!1},jumpToPreviousHunk:()=>{var j;return((j=L.current)==null?void 0:j.previous())??!1},scrollByPage:j=>{const y=k.current;if(!y)return;const S=Math.max(0,y.scrollHeight-y.clientHeight);y.scrollTop=Math.min(S,Math.max(0,y.scrollTop+j*y.clientHeight))}}),[]),c.useLayoutEffect(()=>{const j=k.current;return()=>{!n||!j||d==null||d(n,Ir(j))}},[n,d]),i.jsx("section",{className:"git-diff-preview-pane",children:i.jsx("div",{className:"git-diff-preview-body",ref:k,children:t&&n?i.jsx(Or,{file:t,fileKey:n,projectId:r,source:s,retainedScrollRatio:l,scrollContainerRef:k,retainedDiffView:a,onRetainDiffView:u,paneHeader:{title:v??t.path,path:t.path,actions:o,revision:i.jsx(Pr,{projectId:r,path:t.path,origPath:jn(s)?void 0:t.origPath,rev:jn(s),dirtyLabel:b("fileRevisionDirty"),uncommittedLabel:b("fileRevisionUncommitted")})},onHunkNavigationChange:C,onCommentEditorOpenChange:h,captureReviewProjections:m,ignoreWhitespace:w,onToggleIgnoreWhitespace:x,onProjectionRequestFailure:f,t:b}):i.jsxs(i.Fragment,{children:[i.jsx(Hr,{title:b("gitStatusDiffPreview"),path:"",actions:o}),i.jsx("div",{className:"git-diff-placeholder",children:b("gitStatusSelectFileForDiff")})]})})})});function Pp({file:e,fileKey:t,projectId:n,source:r=Gt,headerActions:s,retainedScrollRatio:o,retainedDiffView:l,onRetainScrollRatio:a,onRetainDiffView:d,onCommentEditorOpenChange:u,captureReviewProjections:h=!1,ignoreWhitespace:m=!1,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:f,onClose:b}){const p=c.useRef(null);return c.useLayoutEffect(()=>{const v=p.current;return()=>{v&&(a==null||a(t,Ir(v)))}},[t,a]),i.jsxs(Lo,{title:e.path,onClose:b,closeOnBackGesture:!0,contentRef:p,children:[i.jsxs("div",{className:"git-diff-preview-header-actions",children:[i.jsx(Pr,{projectId:n,path:e.path,origPath:jn(r)?void 0:e.origPath,rev:jn(r),dirtyLabel:f("fileRevisionDirty"),uncommittedLabel:f("fileRevisionUncommitted")}),s]}),i.jsx(Or,{file:e,fileKey:t,projectId:n,source:r,retainedScrollRatio:o,scrollContainerRef:p,retainedDiffView:l,onRetainDiffView:d,onCommentEditorOpenChange:u,captureReviewProjections:h,ignoreWhitespace:m,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:f})]})}function Or({file:e,fileKey:t,projectId:n,source:r=Gt,retainedDiffView:s,onRetainDiffView:o,paneHeader:l,onHunkNavigationChange:a,onCommentEditorOpenChange:d,captureReviewProjections:u=!1,ignoreWhitespace:h=!1,onToggleIgnoreWhitespace:m,onProjectionRequestFailure:w,retainedScrollRatio:x,scrollContainerRef:f,t:b}){const p=r.kind,v=r.kind==="commit"?r.sha:r.kind==="comparison"||r.kind==="inclusive-comparison"?r.baseSha:"",k=r.kind==="comparison"||r.kind==="inclusive-comparison"?r.headSha:"",L=r.kind==="file-projection"?r.mode:"worktree",C=JSON.stringify([t,p,v,k,L,h]),[j,y]=c.useState(()=>({requestKey:C,result:null,loading:!0,error:null})),S=j.requestKey===C?j:{result:null,loading:!0,error:null},{result:g,loading:E,error:M}=S,P=c.useRef({fileKey:t,view:s});P.current.fileKey!==t&&(P.current={fileKey:t,view:s});const B=c.useCallback((N,I)=>{P.current.fileKey===N&&(P.current.view={...P.current.view,...I}),o==null||o(N,I)},[o]),T=c.useRef(g),A=c.useRef(x===void 0?null:{fileKey:t,ratio:x});T.current=g,c.useLayoutEffect(()=>{A.current=x===void 0?null:{fileKey:t,ratio:x}},[t,x]),c.useLayoutEffect(()=>{const N=A.current;if(!g||(N==null?void 0:N.fileKey)!==t)return;const I=f==null?void 0:f.current;I&&(Af(I,N.ratio),A.current=null)},[g,t,f]),c.useEffect(()=>{let N=!1;return y(I=>I.requestKey===C?{...I,loading:!0,error:null}:{requestKey:C,result:null,loading:!0,error:null}),ki(n,e,vr(p,v,k,L),void 0,h).then(I=>{if(!N){const H=f==null?void 0:f.current;T.current&&H&&(A.current={fileKey:t,ratio:Ir(H)}),y({requestKey:C,result:I,loading:!1,error:null})}}).catch(I=>{if(!N){(h||p==="comparison"||p==="inclusive-comparison")&&(w==null||w(I));const H=I.message||b("gitStatusLoadDiffFailed");y(q=>q.requestKey===C?{...q,loading:!1,error:H}:{requestKey:C,result:null,loading:!1,error:H})}}),()=>{N=!0}},[n,e,t,C,p,v,k,L,h,w,f,b]);const F=E&&!g;return i.jsxs(i.Fragment,{children:[l&&(F||!g&&M)&&i.jsx(Hr,{title:l.title,path:l.path,actions:l.actions,revision:l.revision}),F&&i.jsx("div",{className:"git-diff-loading",children:b("gitStatusLoadingDiff")}),!g&&M&&i.jsx("div",{className:"git-diff-error",children:M}),g&&i.jsxs(i.Fragment,{children:[M&&i.jsx("div",{className:"git-diff-error",children:M}),i.jsx(Tf,{file:e,fileKey:t,projectId:n,source:r,diffResult:g,retainedDiffView:P.current.view,onRetainDiffView:B,paneHeader:l,onHunkNavigationChange:a,onCommentEditorOpenChange:d,captureReviewProjections:u,ignoreWhitespace:h,onToggleIgnoreWhitespace:m,onProjectionRequestFailure:w,t:b},C)]})]})}function Tf({file:e,fileKey:t,projectId:n,source:r=Gt,diffResult:s,retainedDiffView:o,onRetainDiffView:l,paneHeader:a,onHunkNavigationChange:d,onCommentEditorOpenChange:u,captureReviewProjections:h=!1,ignoreWhitespace:m=!1,onToggleIgnoreWhitespace:w,onProjectionRequestFailure:x,t:f}){const[b,p]=c.useState(()=>((o==null?void 0:o.showFullContext)??!1)||((o==null?void 0:o.hideRemovedLines)??!1)),[v,k]=c.useState(()=>(o==null?void 0:o.hideRemovedLines)??!1),L=c.useMemo(()=>JSON.stringify([s.structuredPatch,s.previewSkipped??null]),[s.previewSkipped,s.structuredPatch]),[C,j]=c.useState({revisionKey:null,result:null,loading:!1,error:null}),y=C.revisionKey===L?C:{result:null,loading:!1,error:null},{result:S,loading:g,error:E}=y,[M,P]=c.useState(()=>(o==null?void 0:o.showMarkdownPreview)??!1),B=c.useRef(null),T=c.useRef(null),[A,F]=c.useState(null),N=c.useCallback(U=>{B.current=U,F(U)},[]),[I,H]=Nd(),[q,D]=c.useState(0),W=r.kind,Y=r.kind==="commit"?r.sha:r.kind==="comparison"||r.kind==="inclusive-comparison"?r.baseSha:"",oe=r.kind==="comparison"||r.kind==="inclusive-comparison"?r.headSha:"",X=r.kind==="file-projection"?r.mode:"worktree",fe=c.useMemo(()=>Pf(vr(W,Y,oe,X)),[Y,X,oe,W]);c.useEffect(()=>{const U=B.current;if(!U||typeof ResizeObserver>"u")return;const O=new ResizeObserver(Q=>{var ge;const me=(ge=Q[0])==null?void 0:ge.contentRect.width;typeof me=="number"&&D(me)});return O.observe(U),()=>O.disconnect()},[]);const Z=c.useCallback(()=>{H(I==="auto"?"unified":I==="unified"?"side-by-side":"auto")},[I,H]),J=ar(e.path),ee=c.useMemo(()=>J?wr(Rf(s.structuredPatch),{diffAware:!0,baseFilePath:e.path,projectId:n}):null,[s.structuredPatch,e.path,J,n]),_=c.useMemo(()=>S?ao(S.structuredPatch):null,[S]),re=c.useMemo(()=>!J||_===null||S!=null&&S.markdownHtml?null:wr(_,{baseFilePath:e.path,projectId:n}),[e.path,S==null?void 0:S.markdownHtml,_,J,n]),ye=(S==null?void 0:S.markdownHtml)||(re==null?void 0:re.html),Se=J&&(!!s.markdownHtml||(ee==null?void 0:ee.changed)===!0||(re==null?void 0:re.changed)===!0),ue=M&&Se,Ae=b?ye:ee==null?void 0:ee.html,z=c.useCallback(U=>{l==null||l(t,U)},[t,l]),he=c.useCallback(async()=>{if(S)return S;if(g)return null;const U=L;j(O=>O.revisionKey===U?{...O,loading:!0,error:null}:{revisionKey:U,result:null,loading:!0,error:null});try{const O=await ki(n,e,vr(W,Y,oe,X),!0,m);return j(Q=>Q.revisionKey===U?{revisionKey:U,result:O,loading:!1,error:null}:Q),O}catch(O){(m||W==="comparison"||W==="inclusive-comparison")&&(x==null||x(O));const Q=O instanceof Error?O.message:f("gitStatusLoadContextFailed");return j(me=>me.revisionKey===U?{revisionKey:U,result:null,loading:!1,error:Q}:me),null}},[S,g,L,n,e,W,Y,oe,X,m,x,f]),qe=c.useCallback(async()=>{const U=!b;if(U&&!await he())return;const O=B.current,Q=O?gn(O):null;T.current=fr(Q,(O==null?void 0:O.querySelector(er))??null),p(U),U||k(!1),z({showFullContext:U,...U?{}:{hideRemovedLines:!1}})},[he,z,b]),Xt=c.useCallback(async()=>{const U=!v;if(U&&!await he())return;const O=B.current,Q=O?gn(O):null;T.current=fr(Q,(O==null?void 0:O.querySelector(er))??null),U&&p(!0),k(U),z({hideRemovedLines:U,...U?{showFullContext:!0}:{}})},[v,he,z]),Yt=c.useCallback(()=>{const U=!M;P(U),z({showMarkdownPreview:U})},[z,M]),Fn=c.useCallback(async()=>{const U=b?S??await he():s,O=U?ao(U.structuredPatch):null;if(O===null)throw new Error("Diff content is unavailable");return O},[s,S,he,b]);c.useEffect(()=>{b&&!S&&!g&&he()},[g,S,he,b]),c.useLayoutEffect(()=>{var O;const U=T.current;U&&(T.current=null,oi(U,((O=B.current)==null?void 0:O.querySelector(er))??null))},[b,v,S]);const de=b&&S?S:s,We=de.renderMode==="plain"||de.diffHtml.length>jf,Je=We?"":de.diffHtml,Qt=c.useMemo(()=>de.previewSkipped?null:If(de.structuredPatch),[de.previewSkipped,de.structuredPatch]),Ke=de.previewSkipped??Qt,[Pe,Et]=c.useState({index:0,count:0}),dt=c.useRef(Pe);c.useEffect(()=>{dt.current=Pe},[Pe]);const Ze=c.useCallback(()=>ue||Ke||!B.current?[]:Array.from(B.current.querySelectorAll(".line-hunk")),[Ke,ue]),ft=c.useCallback(()=>{const U=B.current,O=Ze();if(!U||O.length===0){Et(ve=>ve.count===0?ve:{index:0,count:0});return}const me=gn(U).getBoundingClientRect().top+52;let ge=0;for(let ve=0;ve<O.length;ve++){const _e=O[ve];if(_e&&_e.getBoundingClientRect().top<=me)ge=ve;else break}Et(ve=>ve.index===ge&&ve.count===O.length?ve:{index:ge,count:O.length})},[Ze]),le=c.useCallback(U=>{const O=Ze();if(O.length===0)return!1;const me=((dt.current.count===O.length?dt.current.index:0)+U+O.length)%O.length,ge=O[me];return!ge||typeof ge.scrollIntoView!="function"?!1:(ge.scrollIntoView({block:"start",behavior:"smooth"}),Et({index:me,count:O.length}),!0)},[Ze]),ze=c.useCallback(()=>le(1),[le]),Oe=c.useCallback(()=>le(-1),[le]);c.useEffect(()=>{const U=B.current;if(!U)return;const O=gn(U);let Q=requestAnimationFrame(ft),me=!1;const ge=()=>{me||(me=!0,Q=requestAnimationFrame(()=>{me=!1,ft()}))};return O.addEventListener("scroll",ge,{passive:!0}),()=>{cancelAnimationFrame(Q),O.removeEventListener("scroll",ge)}},[ft]),c.useEffect(()=>(d==null||d({next:ze,previous:Oe}),()=>d==null?void 0:d(null)),[ze,Oe,d]),c.useLayoutEffect(()=>{const U=O=>{const Q=O.key.toLowerCase();if(Q!=="n"&&Q!=="p"||O.altKey||O.ctrlKey||O.metaKey||vi(O.target))return;(Q==="n"?ze():Oe())&&O.preventDefault()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[ze,Oe]);const Jt=Pe.count>0?i.jsxs("span",{className:"diff-hunk-navigation",children:[i.jsx("button",{type:"button",className:"diff-hunk-step",onClick:Oe,title:f("sourcePreviousHunkShortcut"),"aria-label":f("sourcePreviousHunkShortcut"),children:"‹"}),i.jsxs("span",{className:"diff-hunk-indicator",children:[Pe.index+1,"/",Pe.count]}),i.jsx("button",{type:"button",className:"diff-hunk-step",onClick:ze,title:f("sourceNextHunkShortcut"),"aria-label":f("sourceNextHunkShortcut"),children:"›"})]}):null,ht=i.jsxs(i.Fragment,{children:[Jt,w&&i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${m?"active":""}`,onClick:w,title:f(m?"gitStatusIgnoreWhitespaceActive":"gitStatusIgnoreWhitespace"),"aria-label":f(m?"gitStatusIgnoreWhitespaceActive":"gitStatusIgnoreWhitespace"),"aria-pressed":m,children:i.jsx("span",{className:"diff-whitespace-glyph","aria-hidden":"true",children:"_+"})}),Se&&i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${ue?"active":""}`,onClick:Yt,title:f(ue?"gitStatusDiff":"gitStatusPreview"),"aria-label":f(ue?"gitStatusDiff":"gitStatusPreview"),"aria-pressed":ue,children:i.jsx(Nf,{showDiff:ue})}),i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${b?"active":""}`,onClick:qe,disabled:g,title:f(g?"gitStatusLoading":b?"gitStatusDiffOnly":"gitStatusFullContext"),"aria-label":f(g?"gitStatusLoading":b?"gitStatusDiffOnly":"gitStatusFullContext"),"aria-pressed":b,children:i.jsx(Ff,{expanded:b})}),i.jsx("button",{type:"button",className:`diff-context-toggle diff-toolbar-icon-button ${v?"active":""}`,onClick:Xt,disabled:g,title:f(v?"gitStatusShowRemovedLines":"gitStatusHideRemovedLines"),"aria-label":f(v?"gitStatusShowRemovedLines":"gitStatusHideRemovedLines"),"aria-pressed":v,children:i.jsx($f,{hidden:v})}),i.jsx(Tu,{value:Fn,title:f("fileViewerCopyContent"),className:"diff-context-toggle diff-toolbar-icon-button",disabled:g||!!Ke||de.structuredPatch.length===0,icon:"content"}),!ue&&!We&&!v&&i.jsx("button",{type:"button",className:"diff-context-toggle diff-toolbar-icon-button",onClick:Z,title:`${f("diffViewModeTitle")}: ${f(uo(I))}`,"aria-label":`${f("diffViewModeTitle")}: ${f(uo(I))}`,children:i.jsx(Bf,{mode:I})})]}),et=(U,O)=>de.structuredPatch.length===0?i.jsx("div",{className:"git-diff-empty-projection",children:f(m?"gitStatusWhitespaceChangesHidden":"gitStatusNoContentChanges")}):Je&&!v&&Hd(I,q)==="side-by-side"?i.jsx(xf,{diffHtml:Je,structuredPatch:de.structuredPatch,splitAfterLine:U,editor:O}):Je?i.jsx(co,{diffHtml:Je,structuredPatch:de.structuredPatch,hideRemovedLines:v,plain:We,splitAfterLine:U,editor:O}):i.jsx(co,{diffHtml:"",structuredPatch:de.structuredPatch,hideRemovedLines:v,plain:We,splitAfterLine:U,editor:O});return i.jsxs(i.Fragment,{children:[a?i.jsx(Hr,{title:a.title,path:a.path,actions:a.actions,revision:a.revision,children:ht}):i.jsxs("div",{className:"diff-context-controls source-diff-context-controls",children:[i.jsx("span",{className:"diff-context-path",children:e.path}),i.jsx("div",{className:"diff-context-buttons",children:ht})]}),E&&i.jsx("div",{className:"diff-context-error",children:E}),i.jsxs("div",{className:"diff-modal-content source-diff-pane diff-gutter-aligned",ref:N,children:[We&&!Ke&&!ue&&i.jsx("div",{className:Ef.plainNotice,children:f("gitStatusDiffPlainMode")}),ue&&Ae?i.jsx(Fo,{html:Ae,sourcePath:e.path}):Ke?i.jsx(Df,{file:e,previewSkipped:Ke,t:f}):A?i.jsx(hf,{projectId:n,filePath:e.path,structuredPatch:de.structuredPatch,revisions:fe,projections:h?de.reviewProjections:void 0,container:A,onOpenChange:u,renderSource:({openComment:U,editor:O})=>et(U==null?void 0:U.flatIndex,O),t:f}):et(void 0,null)]})]})}function Hr({title:e,path:t,actions:n,revision:r,children:s}){const o=t&&t!==e?t.endsWith(e)?t.slice(0,-e.length).replace(/\/$/,""):t:"";return i.jsxs("div",{className:`git-diff-pane-toolbar ${qn.header}`,children:[i.jsxs("div",{className:qn.identity,children:[i.jsxs("span",{className:"git-diff-file-identity",title:t||e,children:[o&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"git-diff-toolbar-path",children:o}),i.jsx("span",{className:"git-diff-toolbar-separator","aria-hidden":"true",children:"/"})]}),i.jsx("h3",{className:"git-diff-preview-title",children:e})]}),r]}),i.jsxs("div",{className:qn.actions,children:[s&&i.jsx("div",{className:"diff-context-buttons",children:s}),n&&i.jsx("div",{className:"git-diff-preview-header-actions",children:n})]})]})}function Ff({expanded:e}){return i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 12h14"}),e?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m8 7 4-4 4 4"}),i.jsx("path",{d:"m8 17 4 4 4-4"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m8 3 4 4 4-4"}),i.jsx("path",{d:"m8 21 4-4 4 4"})]})]})}function $f({hidden:e}){return i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 7h14M5 12h14M5 17h14"}),e&&i.jsx("path",{d:"M4 4l16 16"})]})}function Nf({showDiff:e}){return e?i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m8 9-4 3 4 3M16 9l4 3-4 3M14 5l-4 14"})}):i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z"}),i.jsx("circle",{cx:"12",cy:"12",r:"2.5"})]})}function Bf({mode:e}){return i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:e==="side-by-side"?i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M3 7h7M14 7h7"}),i.jsx("path",{d:"M3 12h7M14 12h7"}),i.jsx("path",{d:"M3 17h7M14 17h7"})]}):i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"}),e==="auto"&&i.jsx("path",{d:"M5 4h4M5 4v3M19 20h-4M19 20v-3"})]})})}function uo(e){switch(e){case"unified":return"diffViewModeUnified";case"side-by-side":return"diffViewModeSideBySide";default:return"diffViewModeAuto"}}function Df({file:e,previewSkipped:t,t:n}){return i.jsxs("div",{className:"git-diff-preview-skipped",children:[i.jsx("div",{className:"git-diff-preview-skipped-title",children:n("gitStatusDiffPreviewSkipped")}),i.jsx("div",{className:"git-diff-preview-skipped-message",children:Of(t,n)}),i.jsxs("dl",{className:"git-diff-preview-skipped-details",children:[i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedPath")}),i.jsx("dd",{children:e.path})]}),t.totalBytes!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedSize")}),i.jsx("dd",{children:Hf(t.totalBytes)})]}),t.totalChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedCharacters")}),i.jsx("dd",{children:t.totalChars.toLocaleString()})]}),t.totalLines!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedLines")}),i.jsx("dd",{children:t.totalLines.toLocaleString()})]}),t.maxLineChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedLineLength")}),i.jsx("dd",{children:t.maxLineChars.toLocaleString()})]}),t.htmlChars!==void 0&&i.jsxs("div",{children:[i.jsx("dt",{children:n("gitStatusDiffPreviewSkippedHtmlSize")}),i.jsx("dd",{children:t.htmlChars.toLocaleString()})]})]})]})}function If(e){let t=0,n=0;for(const r of e)for(const s of r.lines)for(const o of s){const l=o.codePointAt(0);if(l!==void 0){if(l===0||l===65533)return{reason:"binary"};t+=1,(l<32&&l!==8&&l!==9&&l!==10&&l!==12&&l!==13&&l!==27||l===127)&&(n+=1)}}return n/Math.max(t,1)>.01?{reason:"binary"}:null}function Of(e,t){switch(e.reason){case"binary":return t("gitStatusDiffPreviewSkippedBinary");case"content-too-large":return t("gitStatusDiffPreviewSkippedContentTooLarge");case"line-too-long":return t("gitStatusDiffPreviewSkippedLineTooLong");case"html-too-large":return t("gitStatusDiffPreviewSkippedHtmlTooLarge")}}function Hf(e){return e<1024?`${e} B`:e<1024*1024?`${fo(e/1024)} KB`:`${fo(e/(1024*1024))} MB`}function fo(e){return e>=10?e.toFixed(0):e.toFixed(1)}function Ci(e){var u,h;const{sourceKey:t,transport:n}=Cr(),r=Sr(t),{principal:s,resolved:o}=Zl(),l=r==null?void 0:r.artifactViewer,a=(l==null?void 0:l.vhostPublicRoot)??(l!=null&&l.localOrigin?"localhost":void 0),d=lt(r,Wn.vhostFileSites.name)&&o&&(s.username===null||lt(r,Wn.vhostFileSiteReplacement.name)&&((u=s.grants)==null?void 0:u.allowPublicApps)===!0&&!!e&&bc(s.grants,e)==="new-session")&&!(l!=null&&l.locked);return c.useMemo(()=>{var m;return d&&a?{hostSuffix:a,canReplace:lt(r,Wn.vhostFileSiteReplacement.name),canUsePrivateLinks:((m=s.grants)==null?void 0:m.allowPrivateAppLinks)!==!1,list:async w=>(await n.fetch(`/artifacts/vhost-sites?${new URLSearchParams({path:w,...e?{projectId:e}:{}})}`)).sites,serve:w=>n.fetch("/artifacts/vhost-sites",{method:"POST",body:JSON.stringify({...w,...e?{projectId:e}:{}})}),stop:async w=>{await n.fetch(`/artifacts/vhost-sites/${encodeURIComponent(w)}`,{method:"DELETE"})}}:null},[d,a,n,e,r,(h=s.grants)==null?void 0:h.allowPrivateAppLinks])}const Uf="_section_49wo0_4",Vf="_heading_49wo0_11",qf="_description_49wo0_15",Wf="_error_49wo0_22",Kf="_form_49wo0_28",zf="_nameField_49wo0_35",Gf="_scheme_49wo0_63",Xf="_suffix_49wo0_64",Yf="_access_49wo0_76",Qf="_replace_49wo0_84",Jf="_sites_49wo0_116",Zf="_site_49wo0_116",eh="_url_49wo0_135",th="_badge_49wo0_144",nh="_actions_49wo0_161",ae={section:Uf,heading:Vf,description:qf,error:Wf,form:Kf,nameField:zf,scheme:Gf,suffix:Xf,access:Yf,replace:Qf,sites:Jf,site:Zf,url:eh,badge:th,public:"_public_49wo0_156",actions:nh};function rh(e){const t=e.split(/[\\/]/).at(-1)??"",r=(t.replace(/\.[^.]*$/,"")||t).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40).replace(/-+$/,"");return r==="index"?"":r}function sh({filePath:e,service:t}){const{t:n}=Ie(),r=c.useId(),[s,o]=c.useState(null),[l,a]=c.useState(()=>rh(e)),[d,u]=c.useState("public"),[h,m]=c.useState(""),[w,x]=c.useState(!1),[f,b]=c.useState(!1),[p,v]=c.useState(null),[k,L]=c.useState(null),C=c.useCallback(async()=>{v(null);try{o(await t.list(e))}catch(S){o([]),v(S instanceof Error?S.message:String(S))}},[e,t]);c.useEffect(()=>{C()},[C]);const j=async()=>{const S=l.trim().toLowerCase();if(S){b(!0),v(null),L(null);try{const g=await t.serve({name:S,path:e,public:d!=="link",...d==="password"?{password:h}:{},...w?{replace:!0}:{}});m(""),o(M=>[...(M??[]).filter(P=>P.name!==g.name),g]);const E=g.publicUrl??g.localUrl;E&&await we(E)&&L(n("fileVhostCopied"))}catch(g){v(g instanceof Error?g.message:String(g))}finally{b(!1)}}},y=async S=>{if(window.confirm(n("fileVhostStopConfirm",{name:S.name}))){b(!0),v(null),L(null);try{await t.stop(S.name),o(g=>(g??[]).filter(E=>E.name!==S.name)),L(n("fileVhostStopped"))}catch(g){v(g instanceof Error?g.message:String(g))}finally{b(!1)}}};return i.jsxs("section",{className:ae.section,"aria-labelledby":`${r}-heading`,children:[i.jsx("strong",{id:`${r}-heading`,className:ae.heading,children:n("fileVhostHeading")}),i.jsx("p",{className:ae.description,children:n("fileVhostDescription")}),s===null?i.jsx("p",{className:ae.description,children:n("fileVhostLoading")}):s.length>0?i.jsx("ul",{className:ae.sites,children:s.map(S=>{const g=S.publicUrl??S.localUrl;return i.jsxs("li",{className:ae.site,children:[g?i.jsx("a",{className:ae.url,href:g,target:"_blank",rel:"noopener noreferrer",children:oh(g)}):i.jsx("span",{className:ae.url,children:S.name}),i.jsx("span",{className:`${ae.badge} ${S.public&&!S.passwordProtected?ae.public:""}`,children:S.public?S.passwordProtected?n("fileVhostPasswordBadge"):n("fileVhostPublicBadge"):n("fileVhostPrivateBadge")}),i.jsxs("span",{className:ae.actions,children:[g&&i.jsx("button",{type:"button",className:"settings-button",disabled:f,onClick:async()=>L(await we(g)?n("fileVhostCopied"):n("viewerCopyLinkFailed")),children:n("fileVhostCopy")}),i.jsx("button",{type:"button",className:"settings-button",disabled:f,onClick:()=>void y(S),children:n("fileVhostStop")})]})]},S.name)})}):null,s!==null&&(s.length===0||t.canReplace)&&i.jsxs("form",{className:ae.form,onSubmit:S=>{S.preventDefault(),j()},children:[i.jsxs("label",{className:ae.nameField,htmlFor:`${r}-name`,children:[i.jsx("span",{className:ae.scheme,children:"https://"}),i.jsx("input",{id:`${r}-name`,"aria-label":n("fileVhostName"),value:l,onChange:S=>a(S.target.value),autoComplete:"off",spellCheck:!1,disabled:f,placeholder:n("fileVhostNamePlaceholder")}),i.jsxs("span",{className:ae.suffix,children:[".",t.hostSuffix,"/"]})]}),i.jsxs("label",{className:ae.access,children:[n("fileVhostAccess"),i.jsxs("select",{value:d,onChange:S=>u(S.target.value),disabled:f,children:[i.jsx("option",{value:"public",children:n("fileVhostAccessPublic")}),i.jsx("option",{value:"password",children:n("fileVhostAccessPassword")}),t.canUsePrivateLinks!==!1&&i.jsx("option",{value:"link",children:n("fileVhostAccessLink")})]})]}),d==="password"&&i.jsxs("label",{className:ae.access,children:[n("fileVhostPassword"),i.jsx("input",{type:"password",value:h,onChange:S=>m(S.target.value),autoComplete:"new-password",disabled:f})]}),t.canReplace&&i.jsxs("label",{className:ae.replace,children:[i.jsx("input",{type:"checkbox",checked:w,onChange:S=>x(S.target.checked),disabled:f}),n("fileVhostReplace")]}),i.jsx("button",{type:"submit",className:"settings-button settings-button-primary",disabled:f||!l.trim()||d==="password"&&!h,children:n(f?"fileVhostServing":"fileVhostServe")})]}),p&&i.jsx("p",{className:ae.error,role:"alert",children:p}),k&&i.jsx("p",{className:ae.description,role:"status",children:k})]})}function oh(e){const t=new URL(e);return`${t.host}${t.pathname==="/"?"":t.pathname}`}const ih="_modal_v6w6p_1",lh="_fileIdentity_v6w6p_10",ch="_liveBadge_v6w6p_39",ah="_description_v6w6p_52",uh="_warning_v6w6p_59",dh="_createButton_v6w6p_82",fh="_manualCopy_v6w6p_97",hh="_inventory_v6w6p_118",mh="_inventoryHeading_v6w6p_123",Be={modal:ih,fileIdentity:lh,liveBadge:ch,description:ah,warning:uh,createButton:dh,manualCopy:fh,inventory:hh,inventoryHeading:mh};function ph({anchorRect:e,filePath:t,projectId:n,title:r,playLinks:s=!1,onClose:o}){const{t:l}=Ie(),a=Ci(n),d=ec(),u=P=>s&&Al(P)||P,[h,m]=c.useState([]),[w,x]=c.useState(!0),[f,b]=c.useState(null),[p,v]=c.useState(null),[k,L]=c.useState(null),[C,j]=c.useState(null),y=c.useRef(null),S=c.useCallback(async()=>{if(!d){x(!1);return}x(!0),v(null);try{const P=await te.getPublicFileShares(n,t);m(P.items)}catch(P){v(P instanceof Error?P.message:l("publicFileShareLoadFailed"))}finally{x(!1)}},[t,n,l,d]);c.useEffect(()=>{S()},[S]),c.useEffect(()=>{var P,B;C&&((P=y.current)==null||P.focus(),(B=y.current)==null||B.select())},[C]);const g=async()=>{b("create"),v(null),L(null),j(null);const P=te.createPublicFileShare({projectId:n,path:t,...r?{title:r}:{}}),B=Ht(P.then(T=>u(T.url)));try{const T=await P;await B?L(l("publicFileShareCopied")):(j(u(T.url)),L(l("publicFileShareManualCopy"))),await S()}catch(T){v(T instanceof Error?T.message:l("publicFileShareCreateFailed"))}finally{b(null)}},E=async P=>{v(null),L(null),j(null);const B=u(P.url);if(await Ht(Promise.resolve(B))){L(l("publicFileShareCopied"));return}j(B),L(l("publicFileShareManualCopy"))},M=async P=>{if(window.confirm(l("publicShareManagementRevokeOneConfirm"))){b(`revoke:${P.shareId}`),v(null),L(null);try{await te.revokePublicFileShare(P.shareId),m(B=>B.filter(T=>T.shareId!==P.shareId)),L(l("publicFileShareRevoked"))}catch(B){v(B instanceof Error?B.message:l("publicFileShareRevokeFailed"))}finally{b(null)}}};return i.jsx(Lo,{anchorRect:e,title:l("publicFileShareTitle"),onClose:o,children:i.jsxs("div",{className:Be.modal,children:[i.jsxs("div",{className:Be.fileIdentity,title:t,children:[i.jsx(gh,{}),i.jsx("span",{children:t}),i.jsx("span",{className:Be.liveBadge,children:l("publicShareLiveBadge")})]}),i.jsx("p",{className:Be.description,children:l("publicFileShareDescription")}),s&&i.jsx("p",{className:Be.description,children:l("publicFileSharePlayLinks")}),i.jsxs("div",{className:Be.warning,role:"note",children:[i.jsx(wh,{}),i.jsx("span",{children:l("publicFileShareWarning")})]}),d&&i.jsxs("button",{type:"button",className:`settings-button settings-button-primary ${Be.createButton}`,disabled:f!==null,onClick:()=>void g(),children:[i.jsx(vh,{}),l(f==="create"?"publicFileShareCreating":"publicFileShareCreate")]}),C&&i.jsxs("label",{className:Be.manualCopy,children:[i.jsx("span",{children:l("publicFileShareUrlLabel")}),i.jsx("input",{ref:y,readOnly:!0,value:C})]}),p&&i.jsx(Ts,{tone:"error",children:p}),k&&i.jsx(Ts,{tone:"notice",children:k}),d&&i.jsxs("div",{className:Be.inventory,children:[i.jsx("div",{className:Be.inventoryHeading,children:i.jsx("strong",{children:l("publicFileShareExisting")})}),w?i.jsx(Fs,{loading:!0,children:l("publicFileShareLoading")}):h.length===0?i.jsx(Fs,{children:l("publicFileShareEmpty")}):i.jsx(Sc,{compact:!0,children:h.map(P=>{const B=f===`revoke:${P.shareId}`;return i.jsx(kc,{title:P.title||t.split("/").at(-1)||t,mode:"live",modeLabel:l("publicShareLiveBadge"),copyAction:{label:l("publicFileShareCopy"),disabled:f!==null,onClick:()=>void E(P)},revokeAction:{label:l("publicFileShareRevoke"),disabled:f!==null,working:B,onClick:()=>void M(P)},children:i.jsx(Cc,{children:new Date(P.createdAt).toLocaleString()})},P.shareId)})}),!w&&i.jsx(Lc,{children:l("publicFileShareCount",{count:h.length})})]}),a&&i.jsx(sh,{filePath:t,service:a})]})})}function gh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M5 2.5h6l4 4v11H5zM11 2.5v4h4"})})}function wh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M10 2.5 18 17H2zM10 7v4.5M10 14.5v.1"})})}function vh(){return i.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"m8 12 4-4M6.5 14.5l-1 1a2.8 2.8 0 0 1-4-4l3-3a2.8 2.8 0 0 1 4 0M13.5 5.5l1-1a2.8 2.8 0 1 1 4 4l-3 3a2.8 2.8 0 0 1-4 0"})})}const xh="_viewer_1u0i8_1",yh="_header_1u0i8_6",bh="_identityRow_1u0i8_11",Sh="_context_1u0i8_18",kh="_info_1u0i8_29",Ch="_path_1u0i8_34",Lh="_measurement_1u0i8_46",_h="_pathMeasure_1u0i8_53",Eh="_actions_1u0i8_60",jh="_body_1u0i8_69",Rh="_backButton_1u0i8_73",Mh="_htmlPreviewFrame_1u0i8_80",Ah="_diffBody_1u0i8_88",Ph="_reloadStale_1u0i8_93",Th="_rawToggle_1u0i8_97",Fh="_commentToggle_1u0i8_107",$h="_commentSend_1u0i8_117",Nh="_provenanceRow_1u0i8_130",Bh="_quoteReplySurface_1u0i8_140",Dh="_windowActions_1u0i8_146",Ih="_fullscreenButton_1u0i8_152",se={viewer:xh,header:yh,identityRow:bh,context:Sh,info:kh,path:Ch,measurement:Lh,pathMeasure:_h,actions:Eh,body:jh,backButton:Rh,htmlPreviewFrame:Mh,diffBody:Ah,reloadStale:Ph,rawToggle:Th,commentToggle:Fh,commentSend:$h,provenanceRow:Nh,quoteReplySurface:Bh,windowActions:Dh,fullscreenButton:Ih};function Oh(e){return e instanceof Element&&e.closest("input, textarea, select, [contenteditable]:not([contenteditable='false'])")!==null}function Hh(e){if(!e.isConnected||e.closest('[aria-hidden="true"]'))return!1;const t=e.closest('[role="dialog"]')??e.closest(".file-viewer")??e,n=e.ownerDocument.activeElement;return!n||n===e.ownerDocument.body||t.contains(n)}function Uh(e){var d,u,h;const t=e==null?void 0:e.ownerDocument.getSelection();if(!e||!t)return!1;const n=e.ownerDocument.createRange(),r=((d=e.ownerDocument.defaultView)==null?void 0:d.NodeFilter)??NodeFilter,s=e.ownerDocument.createTreeWalker(e,r.SHOW_TEXT),o=s.nextNode();if(o){let m=o;for(let w=s.nextNode();w;w=s.nextNode())m=w;n.setStart(o,0),n.setEnd(m,((u=m.textContent)==null?void 0:u.length)??0)}else n.selectNodeContents(e);t.removeAllRanges(),t.addRange(n);const l=((h=e.ownerDocument.defaultView)==null?void 0:h.Event)??Event;return e.ownerDocument.dispatchEvent(new l("selectionchange")),!0}function Vh({className:e,contentRef:t}){const{t:n}=Ie(),r=c.useCallback(()=>Uh(t.current),[t]);c.useEffect(()=>{var d;const l=((d=t.current)==null?void 0:d.ownerDocument)??document,a=u=>{const h=t.current;!h||u.defaultPrevented||u.isComposing||u.altKey||u.shiftKey||!(u.ctrlKey||u.metaKey)||u.key.toLowerCase()!=="a"||Oh(u.target)||!Hh(h)||(u.preventDefault(),u.stopPropagation(),r())};return l.addEventListener("keydown",a,!0),()=>l.removeEventListener("keydown",a,!0)},[t,r]);const s=n("viewerSelectAll"),o=n("viewerSelectAllTitle");return i.jsx("button",{type:"button",className:e,onMouseDown:l=>l.preventDefault(),onPointerDown:l=>l.preventDefault(),onClick:r,title:o,"aria-label":s,children:i.jsx(qh,{})})}function qh(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M6 2H2v4M10 2h4v4M14 10v4h-4M6 14H2v-4"}),i.jsx("rect",{x:"5",y:"5",width:"6",height:"6",rx:"1"})]})}const ho="p, ul, ol, blockquote, pre, h1, h2, h3, h4, h5, h6, table",Wh=200,Kh=120;function zh(e){const t=e.closest("[data-ya-code-block], pre"),n=t==null?void 0:t.querySelector(":scope > pre > code, :scope > code");return Array.from((n==null?void 0:n.classList)??[]).some(r=>r.toLowerCase()==="language-mermaid")}function Gh(e){const t=Array.from(e.querySelectorAll(ho)),n=t.filter(s=>!zh(s));return{blocks:n.filter(s=>{var l;const o=(l=s.parentElement)==null?void 0:l.closest(ho);return!o||!e.contains(o)}),onlyMermaid:t.length>0&&n.length===0}}function Xh(e,t){return e.length===t.length&&e.every((n,r)=>{var s,o,l;return n.blockIndex===((s=t[r])==null?void 0:s.blockIndex)&&n.top===((o=t[r])==null?void 0:o.top)&&n.height===((l=t[r])==null?void 0:l.height)})}function Li(e,t){const n=e[t];if(!n)throw new Error(`Missing paragraph block ${t}`);return n}function Yh(e,t,n){const r=n.getBoundingClientRect();return Array.from(t).sort((s,o)=>s-o).map(s=>{const o=Li(e,s).getBoundingClientRect();return{blockIndex:s,top:o.top-r.top+n.scrollTop,height:o.height}})}function Qh({alwaysShowQuoteCircle:e,contentRef:t,layoutKey:n,onQuoteBlock:r,paragraphQuoteCirclesEnabled:s,sourceRef:o,surfaceRef:l}){const{t:a}=Ie(),d=c.useRef([]),[u,h]=c.useState([]),[m,w]=c.useState(!1);c.useEffect(()=>{const b=t.current,p=l.current;if(!b||!p){d.current.length>0&&(d.current=[],h([]));return}let v=[],k=new WeakMap;const L=new Set;let C=0,j=0,y=!1;const S=()=>{C=0;const A=Yh(v,L,p);d.current=A.map(F=>Li(v,F.blockIndex)),h(F=>Xh(F,A)?F:A)},g=()=>{C===0&&(C=requestAnimationFrame(S))},E=()=>{window.clearTimeout(j),j=window.setTimeout(g,Kh)},M=!s||typeof IntersectionObserver>"u"?null:new IntersectionObserver(A=>{const F=A.find(N=>N.target===p);if(F&&!F.isIntersecting){if(!y)return;y=!1,L.clear(),M==null||M.disconnect(),M==null||M.observe(p),g();return}if(F!=null&&F.isIntersecting&&!y){y=!0;for(const N of v)M==null||M.observe(N)}for(const N of A){if(!(N.target instanceof HTMLElement))continue;const I=k.get(N.target);I!==void 0&&(N.isIntersecting?L.add(I):L.delete(I))}g()},{rootMargin:`${Wh}px 0px`}),P=()=>{if(M)for(const F of v)M.unobserve(F);const A=Gh(b);if(w(A.onlyMermaid),!s){d.current=[],h(F=>F.length>0?[]:F);return}if(v=A.blocks,k=new WeakMap,v.forEach((F,N)=>{k.set(F,N)}),L.clear(),M&&y)for(const F of v)M.observe(F);else if(!M)for(let F=0;F<v.length;F+=1)L.add(F);g()};P(),M&&M.observe(p);const B=!s||typeof ResizeObserver>"u"?null:new ResizeObserver(E);B==null||B.observe(b);const T=new MutationObserver(P);return T.observe(b,{childList:!0,subtree:!0}),()=>{B==null||B.disconnect(),T.disconnect(),M==null||M.disconnect(),C!==0&&cancelAnimationFrame(C),window.clearTimeout(j)}},[t,n,s,l]);const x=c.useCallback(()=>{const b=o.current,p=t.current;if(!b)return;const v=tc(b);if(!v)return;const k=p&&p!==b?As(b,p):null;r(kn(k?{...v,range:k.range,selectedText:k.selectedText}:v))},[t,r,o]),f=c.useCallback(b=>{const p=o.current,v=d.current[b];if(!p||!v)return;const k=As(p,v);k&&r(kn(k))},[r,o]);return m?null:i.jsx("div",{className:"text-block-quote-rail",children:s&&u.length>0?u.map((b,p)=>i.jsx("button",{type:"button",className:`text-block-quote text-block-quote-paragraph ${e?"always-visible":""}`,style:{top:`${b.top+b.height}px`},onClick:()=>f(p),title:a("sessionQuoteBlock"),"aria-label":a("sessionQuoteBlock"),children:">"},b.blockIndex)):i.jsx("button",{type:"button",className:`text-block-quote text-block-quote-fallback ${e?"always-visible":""}`,onClick:x,title:a("sessionQuoteBlock"),"aria-label":a("sessionQuoteBlock"),children:">"})})}function Jh({availableWidth:e,contextWidth:t,headerGap:n,filenameWidth:r,provenanceWidth:s,windowWidth:o}){return o>0&&t+Math.max(r,s)+o+n*(t>0?2:1)<=e}const bt=`/api/pdfjs/${pa}`,wn=Ct(Ve.pdfjsRenderer,!1);let rr=null;function Zh(){return rr??(rr=ac(()=>import(`${bt}/build/pdf.min.mjs`),[]).then(e=>(e.GlobalWorkerOptions.workerSrc=`${bt}/build/pdf.worker.min.mjs`,e),e=>{throw rr=null,e})),rr}function em(e){let t=null,n=!1;return{promise:Zh().then(s=>{if(n)throw new Error("PDF closed");return t=s.getDocument({url:e,withCredentials:!0,isEvalSupported:!1,verbosity:0,cMapUrl:`${bt}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${bt}/standard_fonts/`,wasmUrl:`${bt}/wasm/`,iccUrl:`${bt}/iccs/`}),t.promise}),destroy:()=>{n=!0,t==null||t.destroy()}}}function tm(){return{pdfjsRendererEnabled:c.useSyncExternalStore(wn.subscribe,wn.read,wn.read),setPdfjsRendererEnabled:wn.set}}const nm="_pdf_1rme7_1",rm="_openPdf_1rme7_13",sm="_media_1rme7_19",om="_font_1rme7_36",im="_glyphs_1rme7_47",St={pdf:nm,openPdf:rm,media:sm,font:om,glyphs:im},lm="_view_1n5sd_2",cm="_scroller_1n5sd_12",am="_document_1n5sd_22",um="_page_1n5sd_33",dm="_zoomControls_1n5sd_40",fm="_zoomLevel_1n5sd_73",xt={view:lm,scroller:cm,document:am,page:um,zoomControls:dm,zoomLevel:fm},_i=.5,Ei=5,Rn=1.25,hm=960,mm=12,pm=16777216,ji=e=>Math.min(Ei,Math.max(_i,e));function gm({url:e,fileName:t,loading:n,onError:r}){const{t:s}=Ie(),[o,l]=c.useState(null),a=c.useRef(null),d=c.useRef(null),[u,h]=c.useState(null),[m,w]=c.useState(1),x=c.useRef(m);x.current=m;const f=c.useRef(null);c.useEffect(()=>{let k=!1;l(null),w(1);const L=em(e);return L.promise.then(async C=>{const j=[];for(let y=1;y<=C.numPages;y+=1)j.push((await C.getPage(y)).getViewport({scale:1}));k||l({document:C,sizes:j})}).catch(()=>{k||r()}),()=>{k=!0,L.destroy()}},[e,r]),c.useLayoutEffect(()=>{const k=a.current;if(!k)return;const L=()=>h(Math.max(1,Math.min(hm,k.clientWidth-2*mm)));L();const C=new ResizeObserver(L);return C.observe(k),()=>C.disconnect()},[o]);const b=c.useCallback((k,L,C)=>{const j=a.current,y=x.current,S=ji(y*k);if(!j||S===y){mo(d.current);return}const g=j.getBoundingClientRect(),E=L-g.left,M=C-g.top,P=S/y;f.current={left:(j.scrollLeft+E)*P-E,top:(j.scrollTop+M)*P-M},w(S)},[]);c.useLayoutEffect(()=>{mo(d.current);const k=a.current,L=f.current;f.current=null,k&&L&&(k.scrollLeft=L.left,k.scrollTop=L.top)},[m]),wm(a,d,x,b,o!==null);const p=k=>{var C;const L=(C=a.current)==null?void 0:C.getBoundingClientRect();L&&b(k,L.left+L.width/2,L.top+L.height/2)};if(!o)return i.jsx("div",{className:"file-viewer-loading",children:n});const v=u===null?null:u*m;return i.jsxs("div",{className:xt.view,children:[i.jsx("div",{ref:a,className:xt.scroller,children:i.jsx("div",{ref:d,className:xt.document,role:"document","aria-label":t,children:v!==null&&o.sizes.map((k,L)=>i.jsx(vm,{document:o.document,pageNumber:L+1,size:k,width:v,root:a,onError:r},L))})}),i.jsxs("div",{className:xt.zoomControls,children:[i.jsx("button",{type:"button",onClick:()=>p(1/Rn),disabled:m<=_i,"aria-label":s("pdfjsZoomOut"),children:"−"}),i.jsxs("button",{type:"button",className:xt.zoomLevel,onClick:()=>p(1/m),"aria-label":s("pdfjsZoomFit"),children:[Math.round(m*100),"%"]}),i.jsx("button",{type:"button",onClick:()=>p(Rn),disabled:m>=Ei,"aria-label":s("pdfjsZoomIn"),children:"+"})]})]})}function mo(e){e&&(e.style.transform="",e.style.transformOrigin="")}function wm(e,t,n,r,s){c.useEffect(()=>{const o=e.current;if(!s||!o)return;let l=null,a;const d=(f,b,p)=>{const v=t.current;if(!v)return f;const k=ji(n.current*f)/n.current,L=v.getBoundingClientRect();return v.style.transformOrigin=`${b-L.left}px ${p-L.top}px`,v.style.transform=`scale(${k})`,k},u=f=>Math.hypot(f[0].clientX-f[1].clientX,f[0].clientY-f[1].clientY),h=f=>{if(f.touches.length!==2)return;const[b,p]=[f.touches[0],f.touches[1]];l={scale:1,clientX:(b.clientX+p.clientX)/2,clientY:(b.clientY+p.clientY)/2,startDistance:u(f.touches)}},m=f=>{!l||f.touches.length!==2||(f.preventDefault(),l.scale=d(u(f.touches)/l.startDistance,l.clientX,l.clientY))},w=f=>{if(!l||f.touches.length>=2)return;const b=l;l=null,r(b.scale,b.clientX,b.clientY)},x=f=>{if(!f.ctrlKey)return;f.preventDefault(),l??(l={scale:1,clientX:f.clientX,clientY:f.clientY,startDistance:0});const p=f.deltaMode!==WheelEvent.DOM_DELTA_PIXEL||Math.abs(f.deltaY)>=50?f.deltaY<0?Rn:1/Rn:Math.exp(-f.deltaY/100);l.scale=d(l.scale*p,l.clientX,l.clientY),clearTimeout(a),a=setTimeout(()=>{const v=l;l=null,v&&r(v.scale,v.clientX,v.clientY)},150)};return o.addEventListener("touchstart",h,{passive:!0}),o.addEventListener("touchmove",m,{passive:!1}),o.addEventListener("touchend",w),o.addEventListener("touchcancel",w),o.addEventListener("wheel",x,{passive:!1}),()=>{clearTimeout(a),o.removeEventListener("touchstart",h),o.removeEventListener("touchmove",m),o.removeEventListener("touchend",w),o.removeEventListener("touchcancel",w),o.removeEventListener("wheel",x)}},[e,t,n,r,s])}function vm({document:e,pageNumber:t,size:n,width:r,root:s,onError:o}){const l=c.useRef(null);return c.useEffect(()=>{const a=l.current;if(!a)return;let d=null,u=!1,h=!1;const m=async()=>{u=!0;const f=await e.getPage(t),b=r*window.devicePixelRatio,p=b*n.height/n.width,v=Math.min(1,Math.sqrt(pm/(b*p))),k=f.getViewport({scale:b*v/n.width});if(h||!u)return;a.width=Math.round(k.width),a.height=Math.round(k.height);const L=f.render({canvas:a,viewport:k});d=L,await L.promise},w=()=>{u=!1,d==null||d.cancel(),d=null,a.width=0,a.height=0},x=new IntersectionObserver(f=>{const b=f.some(p=>p.isIntersecting);b&&!u?m().catch(p=>{!h&&u&&!xm(p)&&o()}):!b&&(u||a.width>0)&&w()},{root:s.current,rootMargin:"100% 50%"});return x.observe(a),()=>{h=!0,x.disconnect(),d==null||d.cancel()}},[e,t,n,r,s,o]),i.jsx("canvas",{ref:l,className:xt.page,style:{width:r,aspectRatio:`${n.width} / ${n.height}`}})}function xm(e){return e instanceof Error&&e.name==="RenderingCancelledException"}function po(e){return e==="application/pdf"?"pdf":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":e.startsWith("font/")?"font":null}function ym(e){var t;try{return((t=e.contentDocument)==null?void 0:t.contentType)==="application/pdf"}catch{return!1}}const bm=["ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz","0123456789 !?&@#$%*()[]{}"],Sm=[14,20,32,48];function km({kind:e,url:t,fileName:n,sampleText:r,unsupported:s,pdfjsAvailable:o=!1}){const{t:l}=Ie(),{pdfjsRendererEnabled:a}=tm(),[d,u]=c.useState(null),[h,m]=c.useState(null),w=c.useCallback(()=>u(t),[t]),x=c.useCallback(()=>m(t),[t]);if(e==="pdf"&&o&&a&&h!==t)return i.jsx(gm,{url:t,fileName:n,loading:l("fileViewerLoading",{name:n}),onError:x});if(d===t)return e!=="pdf"?i.jsx(i.Fragment,{children:s}):i.jsxs(i.Fragment,{children:[s,i.jsx("p",{className:St.openPdf,children:i.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:l("fileViewerOpenNewTab")})})]});switch(e){case"pdf":return i.jsx("iframe",{className:St.pdf,src:t,title:n,onLoad:f=>{ym(f.currentTarget)||w()}});case"audio":return i.jsx("div",{className:St.media,children:i.jsx("audio",{controls:!0,preload:"metadata",src:t,onError:w})});case"video":return i.jsx("div",{className:St.media,children:i.jsx("video",{controls:!0,preload:"metadata",src:t,onError:w})});case"font":return i.jsx(Cm,{url:t,sampleText:r,onError:w,unsupported:s})}}let go=0;function Cm({url:e,sampleText:t,onError:n,unsupported:r}){const[s,o]=c.useState(null);return c.useEffect(()=>{if(typeof FontFace>"u")return;go+=1;const l=new FontFace(`ya-file-viewer-font-${go}`,`url("${e}")`);let a=!1;return o(null),l.load().then(d=>{a||(document.fonts.add(d),o(d.family))},()=>{a||n()}),()=>{a=!0,document.fonts.delete(l)}},[e,n]),typeof FontFace>"u"?i.jsx(i.Fragment,{children:r}):s?i.jsxs("div",{className:St.font,"data-font-specimen":!0,style:{fontFamily:`"${s}"`},children:[Sm.map(l=>i.jsx("p",{style:{fontSize:`${l}px`},children:t},l)),bm.map(l=>i.jsx("p",{className:St.glyphs,children:l},l))]}):null}function wo(e){return e<1024?`${e} b`:e<1024*1024?`${Math.round(e/1024)} kb`:`${Math.round(e/(1024*1024)*10)/10} mb`}function Lm(e){var r;const t=((r=e.split(".").pop())==null?void 0:r.toLowerCase())||"";return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",html:"html",css:"css",scss:"scss",md:"markdown",markdown:"markdown"}[t]||"plaintext"}function vo(e){return e.startsWith("image/")}const xo=1e4;function vn(e,t){return/\.(?:html?|xhtml)$/i.test(e)||t==="text/html"||t==="application/xhtml+xml"}function _m(e){if(!jo(e))return null;try{return _o(Ro(e))}catch{return null}}function Em(e,t){return e===void 0?null:{end:Math.max(e,t??e),start:e}}function it(e){return(e==null?void 0:e.contentStartLine)??1}function Ri(e){if(e.contentEndLine!==void 0)return e.contentEndLine;if(e.content!==void 0)return it(e)+e.content.split(`
|
|
58
|
-
`).length-1}function yo(e){if(!e.contentTruncated)return null;const t=Ri(e),n=e.contentTotalLines?` of ${e.contentTotalLines}`:"";return`Showing lines ${it(e)}-${t}${n}`}function Mi(e,t,n){return t===void 0?e:`${e}:${t}${n&&n>t?`-${n}`:""}`}function jm(e,t,n,r){const s=e.split(`
|
|
59
|
-
`),o=r-t;if(o<0||o>=s.length)return null;const l=Math.max(0,o-3),a=Math.min(s.length,o+4);return{location:Mi(n,r),quote:s.slice(l,a).join(`
|
|
60
|
-
`),afterLine:r}}function Rm(e,t){const n=Array.from(e.querySelectorAll(".markdown-rendered > :not([data-review-comment-inline-host])"));let r;for(let s=0;s<n.length;s+=1)try{t.intersectsNode(n[s])&&(r=s)}catch{}return r}function Mm({afterBlock:e,children:t,editor:n,previewRef:r}){const[s,o]=c.useState(null);return c.useLayoutEffect(()=>{if(e===void 0){o(null);return}const l=r.current;if(!l){o(null);return}const a=l.ownerDocument.createElement("div");a.dataset.reviewCommentInlineHost="";const d=()=>{const m=l.querySelectorAll(".markdown-rendered > :not([data-review-comment-inline-host])").item(e);m&&m.nextElementSibling!==a&&m.after(a)};if(d(),!a.isConnected){o(null);return}const u=new MutationObserver(d);return u.observe(l,{childList:!0,subtree:!0}),o(a),()=>{u.disconnect(),a.remove()}},[e,r]),i.jsxs("div",{ref:r,children:[t,s?Ot.createPortal(i.jsx(vf,{editor:n}),s,"session-file-comment-editor"):null]})}function Am({busy:e,cancelLabel:t,draft:n,error:r,onCancel:s,onChange:o,onPersist:l,onSend:a,placeholder:d,sendLabel:u}){const[h,m]=c.useState(n.text);return i.jsx(yi,{anchorLabel:n.location,snippet:n.quote,text:h,placeholder:d,autoFocus:!n.preserveSelection,error:r,onBlur:l,onChange:w=>{m(w),o(n.id,w)},onKeyDown:w=>{w.key!=="Enter"||w.shiftKey||w.nativeEvent.isComposing||(w.preventDefault(),w.stopPropagation(),a(n.id))},actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:()=>s(n.id),disabled:e,children:t}),i.jsx("button",{type:"button",className:se.commentSend,onClick:()=>a(n.id),disabled:!h.trim()||e,children:u})]})})}function Pm(e,t,n,r){if(!e)return e;const s=Em(n,r),o=(s==null?void 0:s.start)===(s==null?void 0:s.end);let l=0;return e.replace(/<span class="([^"]*)">/g,(a,d)=>{if(!d.split(/\s+/).includes("line"))return a;l+=1;const u=t+l-1,h=s!==null&&u>=s.start&&u<=s.end;return`<span class="${[d,o&&h?"highlighted-line":"",u===(s==null?void 0:s.start)?"highlighted-line-start":"",u===(s==null?void 0:s.end)?"highlighted-line-end":""].filter(Boolean).join(" ")}" data-line="${u}">`})}const sr={loadFile:(e,t,n,r,s,o)=>te.getFile(e,t,n,r,s,o),getRawFileUrl:(e,t,n)=>te.getFileRawUrl(e,t,n),statFile:(e,t)=>te.getFileMetadata(e,t),fetchRawFileBlob:(e,t,n)=>{const{rawUrl:r}=e;if(!r)throw new Error("Raw file URL unavailable");const s=n?`${r}${r.includes("?")?"&":"?"}download=true`:r;return js(s)},createMediaSource:e=>e?{fetchBlob:async(t,n)=>Ll(e,t)??js(n)}:void 0};function Tm(e,t){if(t.modifiedAt===void 0)return e;const n=e.includes("?")?"&":"?";return`${e}${n}v=${t.modifiedAt}-${t.size}`}function Fm(e,t){const n=e.getBoundingClientRect();return t.getBoundingClientRect().top-n.top+e.scrollTop}function Ai(e,t){if(e.scrollHeight<=e.clientHeight)return 0;const n=Fm(e,t),r=e.clientHeight*.1,s=Math.max(0,e.scrollHeight-e.clientHeight);return Math.max(0,Math.min(s,n-r))}function $m(e,t,n){var l;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||!(e.target instanceof Element))return!1;const r=(l=e.target.closest("a[href]"))==null?void 0:l.getAttribute("href");if(!t||!(r!=null&&r.startsWith("#")))return!1;e.preventDefault();let s=r.slice(1);try{s=decodeURIComponent(s)}catch{}const o=Array.from(t.querySelectorAll("[id]")).find(a=>a.id===s);return o instanceof HTMLElement&&n&&(n.scrollTop=Ai(n,o)),!0}const Nm=c.memo(function({projectId:t,filePath:n,source:r=sr,openInNewTabUrl:s,onClose:o,onMinimize:l,parentViewerId:a,standalone:d=!1,lineNumber:u,lineEnd:h,viewMode:m="full",initialPresentation:w,diffMode:x,headerLeading:f,scrollMemory:b}){var Ss,ks,Cs;const{t:p}=Ie(),v=An(),k=Pl(),L=yr(),{quoteReplyButtonMode:C}=Go(),j=Cr(),y=j.transport,S=Mn(),g=`${t}\0${n}\0${x??"source"}`,[E,M]=c.useState(!1),[P,B]=c.useState(null),[T,A]=c.useState(null),F=c.useRef(null),[N,I]=c.useState(()=>({identity:g,view:x??"source"})),H=N.identity===g?N.view:x??"source",q=c.useCallback(R=>{R==="source"&&(F.current=g,M(!1),A(null)),I({identity:g,view:R})},[g]),D=H!=="source",W=D?void 0:u,Y=D?void 0:h,oe=D?"full":m,X=Ko(S===null?t:void 0,n),fe=H==="worktree"?X.worktreeFile:H==="cumulative"?X.cumulativeFile:null,Z=y.capabilities.sameOriginUrls,J=Lt(),ee=S&&S.projectId!==null?Tl(J,{relayUsername:S.relayUsername,relayUrl:S.relayUrl,secret:S.secret,projectId:S.projectId,path:n}):null,[_,re]=c.useState(null),[ye,Se]=c.useState(!0),[ue,Ae]=c.useState(null),[z,he]=c.useState(!1),[qe,Xt]=c.useState(!1),[Yt,Fn]=c.useState(null),de=c.useRef(null),We=c.useRef(null),Je=c.useRef(null),[Qt,Ke]=c.useState(null),[Pe,Et]=c.useState(!1),[dt,Ze]=c.useState(null),ft=c.useRef(null),[le,ze]=c.useState(!1),[Oe,Jt]=c.useState(null),[ht,et]=c.useState(null),[U,O]=c.useState(null),Q=Ac(),me=Ns(Fc,Q.density),ge=Ns(Tc,Q.density),ve=$c(me),_e=c.useMemo(()=>_m(t),[t]),mt=c.useMemo(()=>lr(n)?Lr(n,_e):Vt(n).replace(/^\.\/+/,""),[n,_e]),tt=mt??n,Pi=c.useMemo(()=>({projectId:t,filePath:tt,contentStartLine:_?it(_):1}),[_,t,tt]),Ti=c.useMemo(()=>L&&k?iu({sourceKey:j.sourceKey,sessionId:L.sessionId,projectId:t,filePath:n}):null,[n,t,k,L,j.sourceKey]),ne=Cu({active:le,storageKey:Ti,sendComment:k}),ke=c.useRef(null);c.useLayoutEffect(()=>{const R=Yt,$=de.current,V=We.current,K=Je.current,ie=Qt;if(!R||!$||!V||!K||!ie)return;const be=()=>{const Re=getComputedStyle(R),xe=Number.parseFloat(Re.paddingLeft)+Number.parseFloat(Re.paddingRight),Ue=Jh({availableWidth:R.clientWidth-xe,contextWidth:$.getBoundingClientRect().width,headerGap:Number.parseFloat(getComputedStyle($.parentElement).columnGap)||0,filenameWidth:K.getBoundingClientRect().width,provenanceWidth:V.scrollWidth,windowWidth:ie.getBoundingClientRect().width});Et(Ye=>Ye===Ue?Ye:Ue)},G=typeof ResizeObserver>"u"?null:new ResizeObserver(be);for(const Re of[R,$,V,K,ie])G==null||G.observe(Re);return be(),()=>{G==null||G.disconnect()}},[Yt,Qt]),_c(ke,D||_==null?void 0:_.content,Pi,E?"rendered":"literal");const Ur=jc(),Fi=c.useCallback(R=>{Ur(t,R)},[t,Ur]),jt=c.useRef(null),{modal:Zt,localFileModal:$n,projectFileModal:pt,handleClick:Nn,handleContextMenu:Bn,openResource:Vr,closeModal:$i,closeLocalFileModal:Ni,closeProjectFileModal:Bi,contextMenuElement:Di}=Fl({projectContext:{projectId:t,projectPath:_e}}),qr=c.useRef(Nn),Wr=c.useRef(Bn);qr.current=Nn,Wr.current=Bn;const Kr=c.useCallback(R=>{$m(R,jt.current,ke.current)||qr.current(R)},[]),zr=c.useRef(Vr);zr.current=Vr;const Ii=c.useCallback((R,$)=>{zr.current(R,$)},[]),Gr=c.useCallback(R=>Wr.current(R),[]),Dn=c.useCallback(R=>{var V,K;if(R.key!==" ")return;const $=(K=(V=R.target).closest)==null?void 0:K.call(V,"a[href]");$&&(R.preventDefault(),$.click())},[]),Oi=c.useCallback(R=>{R.button>0||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']")||R.currentTarget.focus({preventScroll:!0})},[]),Hi=c.useCallback(R=>{if(R.button!==0||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']"))return;const $=R.currentTarget.ownerDocument.getSelection();if(!$||$.isCollapsed||$.rangeCount===0)return;($.anchorNode!==null&&R.currentTarget.contains($.anchorNode)||$.focusNode!==null&&R.currentTarget.contains($.focusNode))&&$.removeAllRanges()},[]),He=!!(k&&L&&o&&!d&&S===null&&!D&&(_!=null&&_.metadata.isText)&&_.content!==void 0&&!(E&&vn(n,_.metadata.mimeType)));c.useEffect(()=>{!le||He||(ne.flush(),ze(!1))},[le,He,ne.flush]);const Xr=c.useCallback(()=>{const R=ke.current;if(!le||!He||!R)return;const $=Ut(R);if($.length===0)return;const V=$.map(G=>G.sourceLocation).filter(G=>(G==null?void 0:G.filePath)===tt),K=V.length===$.length?Math.min(...V.map(G=>(G==null?void 0:G.lineStart)??1)):void 0,ie=V.length===$.length?Math.max(...V.map(G=>(G==null?void 0:G.lineEnd)??1)):void 0,be=E?Rm(jt.current??R,$.at(-1).range):void 0;ne.open({location:Mi(tt,K,ie),quote:$.map(G=>G.markdown).join(`
|
|
61
|
-
|
|
62
|
-
`),preserveSelection:!0,...!E&&ie!==void 0?{afterLine:ie}:{},...be===void 0?{}:{afterBlock:be}})},[le,He,ne.open,E,tt]);c.useEffect(()=>{if(!le||!He)return;const R=ke.current,$=R==null?void 0:R.ownerDocument;if(!R||!$)return;let V=!1,K=0;const ie=()=>{window.clearTimeout(K),K=window.setTimeout(Xr,0)},be=xe=>{xe.button===0&&xe.target instanceof Node&&R.contains(xe.target)&&!(xe.target instanceof Element&&xe.target.closest("button, input, textarea, select, a[href]"))&&(V=!0)},G=()=>{V&&(V=!1,ie())},Re=()=>{const xe=$.activeElement;xe instanceof Element&&xe.closest('[data-markdown-copy-ignore="true"]')||V||ie()};return $.addEventListener("pointerdown",be,!0),$.addEventListener("pointerup",G,!0),$.addEventListener("pointercancel",G,!0),$.addEventListener("selectionchange",Re),ie(),()=>{window.clearTimeout(K),$.removeEventListener("pointerdown",be,!0),$.removeEventListener("pointerup",G,!0),$.removeEventListener("pointercancel",G,!0),$.removeEventListener("selectionchange",Re)}},[le,He,Xr]);const Ui=c.useCallback(R=>{if(!le||!He||!(_!=null&&_.content)||R.target instanceof Element&&R.target.closest("button, input, textarea, select, a[href], [contenteditable='true']"))return;const $=R.currentTarget.ownerDocument.getSelection();if($&&!$.isCollapsed)return;const V=R.target instanceof Element?R.target.closest("[data-line]"):null,K=Number(V==null?void 0:V.dataset.line);if(!Number.isInteger(K))return;const ie=jm(_.content,it(_),tt,K);ie&&ne.open(ie)},[le,He,_,ne.open,tt]),Vi=c.useCallback(()=>{ze(R=>(R&&ne.flush(),!R))},[ne.flush]),qi=c.useCallback(R=>{if(!le)return;const $=R.relatedTarget;if(!($ instanceof Node)){ne.persist();return}(R.currentTarget.closest("dialog")??R.currentTarget).contains($)||ne.flush()},[le,ne.flush,ne.persist]),Yr=c.useCallback(()=>{ne.flush(),o==null||o()},[o,ne.flush]),Wi=c.useCallback(()=>{ne.flush(),l==null||l()},[l,ne.flush]),Qr=c.useMemo(()=>{var R;return(R=r.createMediaSource)==null?void 0:R.call(r,_)},[_,r]),Ee=c.useMemo(()=>_!=null&&_.renderedMarkdownHtml?r.transformRenderedMarkdownHtml?r.transformRenderedMarkdownHtml(_.renderedMarkdownHtml,_):_.renderedMarkdownHtml:null,[_,r]),Ki=c.useMemo(()=>Ee?i.jsx(Fo,{html:Ee,sourcePath:n,density:ge,ariaLabel:p("fileViewerPreview"),onClick:Kr,onContextMenu:Gr,onKeyDown:Dn}):null,[n,Dn,Kr,Gr,ge,Ee,p]),Rt=c.useMemo(()=>_?$l(n,_,Ee??void 0):null,[_,n,Ee]),en=c.useMemo(()=>Pm(_==null?void 0:_.highlightedHtml,it(_),W,Y),[Y,W,_]);Nl(jt,!D&&E?Ee:null,Qr);const In=!D&&E?Ee:D?null:en,On=`${t}\0${n}\0${u??""}\0${h??""}\0${m}`,[zi,Gi]=c.useState(0),[Hn,Xi]=c.useState(0),[Te,Un]=c.useState(null),Jr=c.useCallback(()=>{const R=_==null?void 0:_.metadata.modifiedAt;!r.statFile||R===void 0||r.statFile(t,n).then($=>{const V=$.metadata.modifiedAt;V!==void 0&&Un(V!==R||$.metadata.size!==(_==null?void 0:_.metadata.size)?{state:"stale",at:V}:{state:"fresh",loadedAt:R})}).catch(()=>Un(null))},[r,t,n,_]),Zr=c.useCallback(()=>{Un(null),Gi(R=>R+1),Xi(R=>R+1)},[]);c.useEffect(()=>{H==="source"||X.loading||(H==="worktree"&&!X.worktreeFile||H==="cumulative"&&!X.cumulativeFile)&&q("source")},[H,X,q]),c.useEffect(()=>{let R=!1;if(D){Se(!1),Ae(null),O(null);return}const $=ft.current,V=_!==null&&($==null?void 0:$.identity)===On&&$.source===r;if(V&&$.reloadRequest===Hn){Se(!1),Ae(null);return}return V||(Se(!0),Ae(null),O(null)),r.loadFile(t,n,!0,W,Y,oe).then(K=>{if(!R){if(ft.current={identity:On,source:r,reloadRequest:Hn},re(K),V){Se(!1);return}const ie=ar(n)&&!!K.renderedMarkdownHtml,be=K.content!==void 0&&vn(n,K.metadata.mimeType);M(F.current===g?!1:w?w==="preview"&&(ie||be):ie||be),Se(!1)}}).catch(K=>{R||(Ae(K.message||p("fileViewerLoadFailed")),Se(!1))}),()=>{R=!0}},[t,D,Y,W,oe,n,w,Hn,r,On,p,g,_]),c.useEffect(()=>{const R=_==null?void 0:_.metadata.mimeType;if(!_||!R||!(vo(R)||po(R))){et(null);return}if(!r.fetchRawFileBlob||Z){et(null);return}let $=!1,V=null;return et(null),r.fetchRawFileBlob(_,n,!1).then(K=>{$||(V=URL.createObjectURL(K.type===R?K:new Blob([K],{type:R})),et(V))}).catch(K=>{$||Ae(K instanceof Error?K.message:String(K))}),()=>{$=!0,V&&URL.revokeObjectURL(V)}},[_,n,Z,r]),c.useEffect(()=>{if(!qe)return;const R=$=>{$.key==="Escape"&&Xt(!1)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[qe]);const tn=c.useRef(b==null?void 0:b.initialTop),es=In??_;c.useEffect(()=>{const R=tn.current,$=ke.current;if(R===void 0||!es||!$)return;const V=requestAnimationFrame(()=>{tn.current=void 0,$.scrollTop=R});return()=>cancelAnimationFrame(V)},[es]),c.useEffect(()=>{var V;if(W===void 0||!In||tn.current!==void 0)return;const R=U??((V=ke.current)==null?void 0:V.querySelector(".highlighted-line-start, .markdown-preview-span-start")),$=ke.current;R&&$&&requestAnimationFrame(()=>{$.scrollTop=Ai($,R)})},[W,In,U]);const Yi=c.useCallback(async()=>{if((_==null?void 0:_.content)!==void 0)try{if(!await we(_.content))throw new Error("Clipboard write failed");he(!0),setTimeout(()=>he(!1),3e3)}catch(R){console.error("Failed to copy:",R)}},[_==null?void 0:_.content]),Qi=c.useCallback(()=>{Ht(r.loadFile(t,n,!1).then(R=>R.content??""))},[n,t,r]),Ji=c.useCallback(()=>{Rt&&ko(Rt.html,Rt.text)},[Rt]),ts=c.useMemo(()=>_r(n,_e),[n,_e]),Mt=c.useMemo(()=>Eo(n,_e),[n,_e]),At=c.useMemo(()=>S?Wt(S,{filePath:n,lineEnd:h,lineNumber:u,viewMode:m}):null,[n,h,u,S,m]),ns=c.useMemo(()=>s||At||at(ut({basePath:J,filePath:n,lineEnd:h,lineNumber:u,projectId:t,viewMode:m})),[J,n,h,u,s,t,At,m]),Pt=c.useMemo(()=>H==="source"||At?ns:at(ut({basePath:J,diffMode:H,filePath:X.relativePath??n,projectId:t})),[H,J,n,X.relativePath,t,At,ns]),je=qt(n),rs=Lm(n),nn=_?vo(_.metadata.mimeType):!1,gt=c.useMemo(()=>_!=null&&_.content?_.content.split(`
|
|
63
|
-
`):[],[_==null?void 0:_.content]),Ge=_?((Ss=r.getRawFileUrl)==null?void 0:Ss.call(r,t,n,!1))??_.rawUrl:null,ss=Z&&Ge&&_?Tm(Ge,_.metadata):null,rn=nn?Z&&Ge?Ge:ht??(r.fetchRawFileBlob?null:Ge):null,os=p("fileViewerOpenImageNewTab"),is=Ao(t,n),Zi=To(t,Mt,mt,S!==null),ls=Rc(),cs=c.useCallback(()=>{var $;if(!_)return;const R=r.fetchRawFileBlob;ls({fileName:je,directUrl:(($=r.getRawFileUrl)==null?void 0:$.call(r,t,n,!0))??void 0,loadBlob:R?()=>R(_,n,!0):()=>y.fetchBlob(ir(Sn(t,n,!0)))})},[_,je,n,t,ls,r,y]),Vn=c.useMemo(()=>new URL(Pt,window.location.href).href,[Pt]),as=c.useCallback(()=>{if(rn){window.open(rn,"_blank","noopener");return}window.open(Pt,"_blank","noopener")},[rn,Pt]),el=c.useCallback(()=>_?r.fetchRawFileBlob?r.fetchRawFileBlob(_,n,!1):y.fetchBlob(ir(Sn(t,n))):Promise.reject(new Error("Image is not loaded")),[_,n,t,r,y]),us=Bl({fileName:je,filePath:n,loadBlob:nn?el:void 0,onOpen:as,projectPath:_e,viewerLink:Pt}),ds=c.useCallback(R=>{R.preventDefault(),R.stopPropagation(),Jt({x:R.clientX,y:R.clientY})},[]),tl=c.useCallback(()=>Jt(null),[]),[Xe,nl]=c.useState(null),[fs,rl]=c.useState(null),sl=c.useCallback(R=>{ke.current=R,nl(R)},[]),hs=!D&&E&&(_==null?void 0:_.content)!==void 0&&_.metadata!==void 0&&vn(n,_.metadata.mimeType),ms=D||(_==null?void 0:_.content)!==void 0,ol=Dl(c.useMemo(()=>hs?fs:ms&&Xe?{kind:"element",element:Xe}:null,[hs,fs,ms,Xe]));if(c.useEffect(()=>{if(!b||!Xe)return;let R=0;const $=()=>{R||tn.current!==void 0||(R=requestAnimationFrame(()=>{R=0,b.save(Xe.scrollTop)}))};return Xe.addEventListener("scroll",$,{passive:!0}),()=>{Xe.removeEventListener("scroll",$),cancelAnimationFrame(R)}},[b,Xe]),ye||!D&&!_&&!ue||D&&X.loading&&!fe)return i.jsx("div",{className:"file-viewer",children:i.jsx("div",{className:"file-viewer-loading",children:p("fileViewerLoading",{name:je})})});const ce=_==null?void 0:_.metadata,Fe=_==null?void 0:_.content,ps=nn,gs=!!(r.fetchRawFileBlob||Ge),sn=Fe!==void 0&&ar(n)&&!!Ee,nt=Fe!==void 0&&ce!==void 0&&vn(n,ce.mimeType),ws=sn||nt,Ce=le?ne.activeDraft:null,il=Ce?ne.sendingIds.has(Ce.id):!1,$e=Ce?i.jsx(Am,{draft:Ce,placeholder:p("fileViewerCommentPlaceholder"),error:ne.error?p("fileViewerCommentSendFailed"):null,busy:il,cancelLabel:p("cancel"),sendLabel:p("toolbarSend"),onCancel:ne.cancel,onChange:ne.update,onPersist:ne.persist,onSend:R=>void ne.sendOne(R)},Ce.id):null,Tt=$e&&!E?Ce==null?void 0:Ce.afterLine:void 0,vs=$e&&E&&Ee&&(Ce==null?void 0:Ce.afterBlock)!==void 0?Ce.afterBlock:void 0,xs=()=>{if(D)return fe?i.jsx("div",{className:se.diffBody,children:i.jsx(Or,{file:fe,fileKey:`file-viewer:${H}:${fe.path}`,projectId:t,source:{kind:"file-projection",mode:H},captureReviewProjections:!0,t:p})}):i.jsx("div",{className:"file-viewer-loading",children:p("fileViewerLoading",{name:je})});if(ue||!_||!ce)return i.jsx("div",{className:"file-viewer-error",children:ue||p("fileViewerNotFound")});if(ps){const $=ss??(r.fetchRawFileBlob?ht:Ge),V=rn??$;return i.jsx("div",{className:"file-viewer-image",children:$&&V?i.jsx("a",{className:"file-viewer-image-link",href:V,target:"_blank",rel:"noopener noreferrer",title:os,"aria-label":os,onContextMenu:us.handleContextMenu,children:i.jsx("img",{src:$,alt:je})}):i.jsx("div",{className:"file-viewer-loading",children:p("fileViewerLoading",{name:je})})})}const R=po(ce.mimeType);if(R){const $=ss??(r.fetchRawFileBlob?ht:Ge);return $?i.jsx(km,{kind:R,url:$,fileName:je,sampleText:p("fileViewerFontSample"),unsupported:ys,pdfjsAvailable:Z}):i.jsx("div",{className:"file-viewer-loading",children:p("fileViewerLoading",{name:je})})}if(Fe!==void 0){if(E&&sn&&Ee)return i.jsx(Mm,{afterBlock:$e?vs:void 0,editor:$e,previewRef:jt,children:Ki});if(E&&nt)return i.jsx(ql,{html:Fe,path:n,projectId:t,className:se.htmlPreviewFrame,title:je,autoStart:T===g,toolbarHost:P,reloadKey:zi,onFindSource:rl,documentPath:Mt,onLocalResourceLink:Ii},g);if(en){const Ue=yo(_),Ye=Tt!==void 0?Ru(ei(en,_.content),Tt):null,rt=(on,Ft)=>i.jsx(Pu,{html:on,source:Ft,onClick:Nn,onContextMenu:Bn,onKeyDown:Dn});return i.jsxs("div",{className:"file-viewer-code file-viewer-code-highlighted","data-language":_.highlightedLanguage??rs,style:ve,children:[Ye&&$e?i.jsx(It,{before:rt(Ye.before),editor:$e,after:rt(Ye.after)}):rt(en,_.content),_.highlightedTruncated&&i.jsx("div",{className:"file-viewer-truncated",children:p("fileViewerHighlightTruncated")}),Ue&&i.jsx("div",{className:"file-viewer-truncated",children:Ue})]})}const $=gt.length>xo?gt.slice(0,xo):gt,V=it(_),K=W??0,ie=Math.max(K,Y??K),be=K===ie,G=yo(_),Re=(Ue,Ye)=>{const rt=$.slice(Ue,Ye);return rt.length>0?i.jsxs("div",{className:"code-highlighter-plain",children:[i.jsx("div",{className:"code-line-numbers",children:rt.map((on,Ft)=>{const Ne=V+Ue+Ft;return i.jsx("div",{children:Ne},`ln-${Ne}`)})}),i.jsx("pre",{className:"code-content",children:i.jsx("code",{children:rt.map((on,Ft)=>{const Ne=V+Ue+Ft,al=W!==void 0&&Ne>=K&&Ne<=ie,ul=[be&&al?"highlighted-line":"",Ne===K?"highlighted-line-start":"",Ne===ie?"highlighted-line-end":""].filter(Boolean).join(" ");return i.jsx("div",{ref:W!==void 0&&Ne===K?dl=>O(dl):void 0,className:ul||void 0,"data-line":Ne,children:on||" "},`line-${Ne}`)})})})]}):null},xe=Tt===void 0?null:Math.min($.length,Math.max(0,Tt-V+1));return i.jsxs("div",{className:"file-viewer-code","data-language":rs,style:ve,children:[xe!==null&&$e?i.jsx(It,{before:Re(0,xe),editor:$e,after:Re(xe,$.length)}):$.length>0?Re(0,$.length):i.jsx("div",{className:"file-viewer-empty-content",children:"No content read"}),$.length<gt.length&&i.jsx("div",{className:"file-viewer-truncated",children:p("fileViewerPlainTruncated",{count:$.length,total:gt.length})}),G&&i.jsx("div",{className:"file-viewer-truncated",children:G})]})}return ys},ys=i.jsxs("div",{className:"file-viewer-binary",children:[i.jsx("p",{children:p("fileViewerBinary")}),i.jsxs("p",{children:[i.jsx("strong",{children:p("fileViewerType")})," ",ce==null?void 0:ce.mimeType]}),i.jsxs("p",{children:[i.jsx("strong",{children:p("fileViewerSize")})," ",ce?wo(ce.size):""]}),gs&&i.jsx("button",{type:"button",className:"file-viewer-download-btn",onClick:cs,children:p("fileViewerDownloadFile")})]}),bs=i.jsx("div",{ref:Ke,className:se.windowActions,children:i.jsx($s,{url:Vn,copyLink:!1,moveOut:!d,onMinimize:l?Wi:void 0,onClose:o?Yr:void 0,minimizeLabel:p("fileViewerMinimize")})}),ll=i.jsxs("div",{ref:Fn,className:`file-viewer-header ${se.header}`,"data-window-actions-top":Pe||void 0,children:[i.jsx("span",{className:se.measurement,"aria-hidden":"true",children:i.jsx("span",{ref:Je,className:`${se.path} ${se.pathMeasure}`,children:ts})}),i.jsxs("div",{className:se.identityRow,children:[i.jsxs("div",{ref:de,className:se.context,children:[f,o&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.backButton}`,onClick:Yr,title:p("actionBack"),"aria-label":p("actionBack"),children:i.jsx(ga,{})})]}),i.jsxs("div",{className:`file-viewer-info ${se.info}`,children:[i.jsx("span",{className:`file-viewer-path ${se.path}`,title:n,onContextMenu:ds,children:ts}),i.jsxs("div",{ref:We,className:se.provenanceRow,children:[S===null&&X.relativePath&&i.jsx(Pr,{projectId:t,path:X.relativePath,origPath:(ks=X.worktreeFile)==null?void 0:ks.origPath,dirtyLabel:p("fileRevisionDirty"),uncommittedLabel:p("fileRevisionUncommitted")}),i.jsxs("span",{className:"file-viewer-meta",children:[ce?wo(ce.size):"",!D&&(ce==null?void 0:ce.isText)&&Fe!==void 0&&i.jsxs(i.Fragment,{children:[" • ",_!=null&&_.contentTruncated?`lines ${it(_)}-${Ri(_)}${_!=null&&_.contentTotalLines?` of ${_.contentTotalLines}`:""}`:p("fileViewerLines",{count:gt.length})]})]})]})]}),Pe&&bs]}),i.jsxs("div",{className:`file-viewer-actions ${se.actions}`,children:[i.jsx(Il,{find:ol}),S===null&&i.jsx(ci,{activeView:H,availability:X,onSelect:q,projectId:t,variant:"header"}),(D||ws)&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.rawToggle}`,"aria-label":p("fileViewerRawSource"),"aria-pressed":!D&&!E,title:p("fileViewerRawSource"),onClick:()=>{if(D){q("source");return}A(!E&&nt?g:null),M(R=>!R)},children:i.jsx(Im,{})}),He&&i.jsx("button",{type:"button",className:`file-viewer-action ${se.commentToggle}`,"aria-label":p("fileViewerCommentMode"),"aria-pressed":le,title:p("fileViewerCommentMode"),onClick:Vi,children:i.jsx(Wm,{})}),S===null&&r===sr&&!D&&(ce==null?void 0:ce.isText)&&Fe!==void 0&&i.jsx(Ol,{source:{path:n,projectId:t},line:W,artifact:nt,onSaved:nt?void 0:Zr}),i.jsx("span",{ref:B}),!D&&(_||ue)&&i.jsx("button",{type:"button",className:`file-viewer-action${(Te==null?void 0:Te.state)==="stale"?` ${se.reloadStale}`:""}`,"aria-label":p("fileViewerReload"),title:(Te==null?void 0:Te.state)==="stale"?p("fileViewerReloadStale",{time:new Date(Te.at).toLocaleTimeString()}):(Te==null?void 0:Te.state)==="fresh"?p("fileViewerReloadFresh"):p("fileViewerReload"),onMouseEnter:Jr,onFocus:Jr,onClick:Zr,children:i.jsx(Dm,{})}),!D&&(ce==null?void 0:ce.isText)&&Fe!==void 0&&i.jsx(Pc,{canZoomIn:Q.canZoomIn,canZoomOut:Q.canZoomOut,onZoomIn:Q.zoomIn,onZoomOut:Q.zoomOut}),(D||!ps&&Fe!==void 0&&!(E&&nt))&&i.jsx(Vh,{className:"file-viewer-action",contentRef:ke}),!D&&Fe!==void 0&&i.jsx("button",{type:"button",className:`file-viewer-action ${z?"copied":""}`,onClick:Yi,title:p(z?"fileViewerCopied":"fileViewerCopyContent"),children:z?i.jsx(Vm,{}):i.jsx(Om,{})}),S===null&&r===sr&&!D&&i.jsx(Hm,{projectId:t,onOpen:Ze}),S!==null&&S.projectId!==null&&!D&&nt&&Fe!==void 0&&i.jsx(Hl,{mode:"interactive",source:{},artifact:!0,href:ee,active:!1,label:p("publicSharePlay"),onToggle:()=>window.open(ee,"_blank","noopener")}),S===null&&i.jsx("button",{type:"button",className:"file-viewer-action file-viewer-new-session",onClick:is,title:p("fileViewerNewSession"),children:i.jsx(qm,{})}),!D&&gs&&i.jsx("button",{type:"button",className:"file-viewer-action",onClick:cs,title:p("fileViewerDownload"),children:i.jsx(Km,{})}),i.jsx("button",{type:"button",className:`file-viewer-action file-viewer-fullscreen-toggle ${se.fullscreenButton}`,onClick:()=>Xt(!qe),title:p(qe?"fileViewerExitFullscreen":"fileViewerFullscreen"),children:qe?i.jsx(Gm,{}):i.jsx(zm,{})}),i.jsx($s,{url:Vn,onCopyLinkContextMenu:ds,moveOut:!1}),!Pe&&bs]})]}),cl=["file-viewer",se.viewer,d&&"file-viewer-standalone",qe&&"file-viewer-fullscreen",oe==="range"&&"file-viewer-compact"].filter(Boolean).join(" ");return i.jsxs("div",{className:cl,onBlurCapture:qi,children:[ll,dt&&i.jsx(ph,{anchorRect:dt,filePath:n,projectId:t,title:je,playLinks:T===g,onClose:()=>Ze(null)}),Oe&&i.jsx(Po,{x:Oe.x,y:Oe.y,canStartNewSession:S===null,onClose:tl,onOpen:as,onOpenSource:cr(n)?()=>{A(null),M(!1)}:void 0,onOpenPreview:cr(n)&&ws?()=>{A(g),M(!0)}:void 0,onStartNewSession:is,localSource:Zi,fileTarget:S===null?{projectId:t,path:mt??n,origPath:(Cs=X.worktreeFile)==null?void 0:Cs.origPath}:void 0,onCopyProjectRelativePath:mt?()=>void we(mt):void 0,onCopyAbsolutePath:S===null&&Mt?()=>void we(Mt):void 0,onCopyFilePath:!mt&&!Mt?()=>void we(n):void 0,onCopyViewerLink:()=>void we(Vn),onCopyContents:Qi,onCopyRenderedContents:Rt?Ji:void 0}),Di,nn?us.contextMenuElement:null,i.jsxs("div",{className:`file-viewer-body ${se.body} ${v&&E&&sn?se.quoteReplySurface:""}`,ref:sl,tabIndex:-1,...le?{[Xo]:"true"}:{},onClick:Ui,onMouseDownCapture:Hi,onPointerDown:Oi,children:[$e&&Tt===void 0&&vs===void 0?i.jsx(It,{before:xs(),editor:$e}):xs(),!le&&v&&E&&sn?i.jsx(Qh,{alwaysShowQuoteCircle:C==="paragraph-always",contentRef:jt,layoutKey:`${n}\0${Ee??""}`,onQuoteBlock:v,paragraphQuoteCirclesEnabled:C!=="block",sourceRef:ke,surfaceRef:ke}):null,d?i.jsx(Bm,{containerRef:ke,onStartNewSessionFromSelection:S===null?Fi:void 0}):null]}),Zt?i.jsx(Ul,{path:Zt.path,mediaType:Zt.mediaType,mediaSource:Qr,dismissOnBack:!0,parentViewerId:Zt.mediaType==="image"?a:void 0,onClose:$i}):null,$n?i.jsx(Vl,{resource:$n.resource,initialPresentation:$n.initialPresentation,dismissOnBack:!0,onClose:Ni}):null,pt?i.jsx(_t,{nestedViewer:!0,projectId:pt.projectId,filePath:pt.filePath,lineNumber:pt.lineNumber,lineEnd:pt.lineEnd,initialPresentation:pt.initialPresentation,onClose:Bi}):null]})});function Bm({containerRef:e,onStartNewSessionFromSelection:t}){const{floatingSelectionActions:n,selectionContextMenu:r}=Jo({containerRef:e,inert:!1,onStartNewSessionFromSelection:t,quoteClearSignal:0,isInteractiveTarget:s=>s instanceof Element&&s.closest("button, input, textarea, select, a[href], [contenteditable='true']")!==null});return i.jsxs(i.Fragment,{children:[n,r]})}function Dm(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),i.jsx("path",{d:"M13.5 2.5v3.2h-3.2"})]})}function Im(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M5.5 4 2 8l3.5 4M10.5 4 14 8l-3.5 4M9.5 2.5l-3 11"})})}function Om(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),i.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 0 0 9.5 2H3.5A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5"})]})}function Hm({onOpen:e,projectId:t}){const{t:n}=Ie(),{version:r}=nc(),{status:s}=dc();return!Ci(t)&&((s==null?void 0:s.canCreate)!==!0||!lt(r,uc))?null:i.jsx("button",{type:"button",className:"file-viewer-action",onClick:l=>e(l.currentTarget.getBoundingClientRect()),title:n("fileViewerSharePublicly"),"aria-label":n("fileViewerSharePublicly"),children:i.jsx(Um,{})})}function Um(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"m8 12 4-4M6.5 14.5l-1 1a2.8 2.8 0 0 1-4-4l3-3a2.8 2.8 0 0 1 4 0M13.5 5.5l1-1a2.8 2.8 0 1 1 4 4l-3 3a2.8 2.8 0 0 1-4 0"})})}function Vm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M3 8.5L6.5 12L13 4"})})}function qm(){return i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 5v6M5 8h6"})]})}function Wm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M3 3.5h10v7H7l-3.5 2.5v-2.5H3z"})})}function Km(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 2v9M4 8l4 4 4-4M2 14h12"})})}function zm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M2 5V2h3M11 2h3v3M14 11v3h-3M5 14H2v-3"})})}function Gm(){return i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M5 2v3H2M14 5h-3V2M11 14v-3h3M2 11h3v3"})})}export{si as $,Rr as A,ga as B,Tu as C,sa as D,_p as E,Nm as F,Ap as G,An as H,Dr as I,Tn as J,ui as K,ut as L,_n as M,vp as N,ta as O,yp as P,Ha as Q,lf as R,nu as S,bp as T,kp as U,Uu as V,Qh as W,_t as X,ti as Y,Ep as Z,xd as _,Go as a,ed as a0,jp as a1,Vh as a2,wr as a3,Ju as a4,fd as a5,vd as a6,fr as a7,er as a8,oi as a9,co as aa,Qu as ab,Pu as ac,xp as ad,gp as ae,wp as af,gu as b,Io as c,Qn as d,Wd as e,Kd as f,Pr as g,It as h,Mp as i,Rp as j,Lp as k,wa as l,Ea as m,Pp as n,vi as o,ro as p,Sp as q,Ld as r,Do as s,zd as t,tm as u,Gd as v,Fa as w,Vd as x,qo as y,Cp as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,b as ye,j as s,d as Te}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as Ce,f as ee,c as Re,D as De,h as Pe}from"./speechDraftTransaction-cFbNnQHh.js";import{g as Ee,a as Ne}from"./newSessionDefaults-CdVn-sOG.js";import{g as Me}from"./useModelSettings-DMjdRGMd.js";import{u as je,c as ke,d as we}from"./useProviders-B7fACEDA.js";import{e as Be,u as Ke}from"./Modal-iT2_XPlO.js";import{o as Le}from"./index-C-4wHkcA.js";import{D as Fe,a as We,S as Ae,c as _e,e as $e,s as Ve}from"./useSidebarWidth-DnB-wKom.js";import{u as Oe,V as Ue}from"./VoiceInputButton-jq6m-rwS.js";import{u as He}from"./useFloatingActionButtonEnabled-CgWMCFmO.js";import{s as ze}from"./newSessionPrefill-CHZfBHqQ.js";import{u as re,d as Ge,e as qe}from"./main-BpQ_EIjC.js";import{g as te,a as Xe,b as Je,c as Qe,d as X,e as Ye,t as Ze,m as et,f as tt,r as ne}from"./YaServerProvider-fGtUHCJb.js";import{P as nt}from"./ProviderBadge-DmhZSMRX.js";import"./react-runtime-D-UPQ57m.js";import"./deviceDetection-BVPclkty.js";import"./remoteRoutePaths-Crh_32jX.js";import"./MicrophoneIcon-BLs10fC3.js";function rt(){const{providers:o,loading:a}=je(),{settings:h,isLoading:v}=Be();return n.useMemo(()=>{if(a||v||o.length===0)return null;const I=new Set(ke(o).map(y=>y.name)),d=h==null?void 0:h.newSessionDefaults,j=d!=null&&d.provider&&I.has(d.provider)?d.provider:null,x=o.find(y=>y.name===j)??we(o);if(!x)return null;const m=Ee(d,x.name,{model:x.name==="claude"?Le(Me()):void 0});return{provider:x.name,modelId:Ne(x.name,x.models??[],m.model)}},[o,a,h,v])}const st=830,it=100,J=24,ct=80;function ot(o,a){const h=o-a,v=Math.min(h,st);return(h-v)/2}function at(){const o=Oe();return n.useMemo(()=>{if(o<Fe)return null;const a=We(),v=o<a+600?Ae:a,I=ot(o,v),d=it+J*2;if(I<d)return null;const j=J,x=Math.min(I-J*2,300);return{visible:!0,right:j,bottom:ct,maxWidth:x}},[o])}function lt(){return`speech-target-${Te()}`}function ut(){const{t:o}=re(),a=rt();return a?s.jsx("span",{className:"composer-model-chip-static",title:o("floatingComposerModelChipTitle"),children:s.jsx(nt,{provider:a.provider,model:a.modelId??void 0})}):null}function Nt(){const{t:o}=re(),a=Ge(),h=qe(),v=Ke(),I=ye(),d=n.useMemo(()=>_e(I),[I]),j=at(),{floatingActionButtonEnabled:x}=He(),[m,y]=n.useState(!1),[g,se,f]=Ce(d),[k,L]=n.useState(""),C=n.useRef(k);C.current=k;const[U,Q]=n.useState(null),A=n.useRef(null),[,_]=n.useState(0),R=n.useRef(null),D=n.useRef(null),H=n.useRef(null),l=n.useRef(null),u=n.useRef(null),b=n.useRef(new Map),P=n.useRef(null),N=n.useRef(null),$=n.useRef(null),z=n.useRef(!1),V=n.useRef(null),F=l.current,O=te(g,k,F),W=F?Xe(g,O,F.end,F.replaceEnd??F.end):Je(g,O,g.length),w=$e(h.pathname);n.useEffect(()=>{w&&Ve(w)},[w]),n.useEffect(()=>{var e,t;m&&((e=R.current)==null||e.focus(),(t=D.current)==null||t.prewarm())},[m]),n.useLayoutEffect(()=>{const e=V.current,t=R.current;!e||!t||g!==e.value||t.value!==e.value||(V.current=null,e.restore(t))},[g]),n.useEffect(()=>{if(!m)return;const e=t=>{H.current&&!H.current.contains(t.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m]);const B=n.useCallback(e=>{const t=typeof e=="string"?e:void 0,r=D.current;if(t===void 0&&((r==null?void 0:r.isListening)===!0||A.current!==null)){$.current=Qe(f.getDraft(),C.current,l.current),r!=null&&r.isListening&&r.stopAndFinalize();return}const i=(t??g).trim();if(i){if(ze(I,i),f.clearDraft(),y(!1),w){a(`${v}/new-session?projectId=${encodeURIComponent(w)}`);return}a(`${v}/new-session`)}},[g,w,a,f,v,I]),ie=e=>{var t;if(!(e.key==="Enter"&&e.nativeEvent.isComposing)){if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(U==="transcribing"||U==="finalizing")){e.preventDefault(),e.stopPropagation(),pe();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&((t=D.current)!=null&&t.isListening)){e.preventDefault(),e.stopPropagation(),D.current.toggle();return}e.key==="Enter"&&!e.shiftKey?(e.preventDefault(),B()):e.key==="Escape"&&y(!1)}},ce=n.useCallback(()=>{y(!0)},[]),oe=n.useCallback(()=>{const e=R.current,t=f.getDraft(),r=Math.max(0,Math.min((e==null?void 0:e.selectionStart)??t.length,t.length)),i=Math.max(r,Math.min((e==null?void 0:e.selectionEnd)??r,t.length)),c=lt(),p=tt(r,i);u.current=c,l.current=p,b.current.set(c,p),V.current=null,P.current=null,z.current=!1,e&&(ee(e),e.setSelectionRange(r,i)),C.current="",L("")},[f]),S=n.useCallback(()=>{const e=N.current;e!==null&&(clearTimeout(e.timer),N.current=null)},[]);n.useEffect(()=>S,[S]);const E=n.useCallback((e,t)=>{var Z;const r=e!==void 0,i=R.current,c=l.current;if(!i||!c)return;const p=i.selectionStart,K=i.selectionEnd,xe=T=>p===K?A.current==="listening"?ne(T,p,K):X(T):T.replaceSelectedAtMs===void 0&&T.end===p&&T.replaceEnd===K?T:ne(T,p,K);p===K&&S();const Ie=C.current.trim().length>0;if(r&&(Ie||P.current!==null)){P.current={draft:t??f.getDraft(),start:p,end:K};return}const q=xe(c);A.current==="listening"&&q!==c&&((Z=D.current)==null||Z.beginInsertionBoundary()),l.current=q,u.current&&b.current.set(u.current,q),_(T=>T+1)},[S,f]),G=n.useCallback(()=>{if(S(),!l.current)return;const e=X(l.current);l.current=e,u.current&&b.current.set(u.current,e),_(t=>t+1)},[S]),ae=n.useCallback(()=>{window.setTimeout(()=>E(!0),0)},[E]),M=n.useCallback((e,t)=>{const r=Re({textareaRef:R,getDraft:f.getDraft,setDraft:f.setDraft,setInterimTranscript:c=>{C.current=c,L(c)},speechInsertionRangeRef:l,activeSpeechTargetIdRef:u,speechInsertionRangesRef:b,pendingTextareaSelectionRef:V,pendingSpeechRetargetRef:P,onInsertionBoundary:()=>{var c;return(c=D.current)==null?void 0:c.beginInsertionBoundary()},onSpeechTargetChanged:()=>_(c=>c+1),onSmartTurnSend:B,composerEditedDuringSpeech:()=>z.current},e,t),i=t==null?void 0:t.speechTargetId;return i&&i!==u.current&&b.current.delete(i)&&_(c=>c+1),r},[f,B]),le=n.useCallback((e,t)=>{const r=t!=null&&t.speechTargetId?b.current.get(t.speechTargetId)??null:l.current,i=t!=null&&t.smartTurnCommand||P.current?0:Ye(r);if(i>0){S();const c=setTimeout(()=>{const p=N.current;!p||p.timer!==c||(N.current=null,M(p.transcript,p.metadata))},i);N.current={timer:c,transcript:e,metadata:t};return}return S(),M(e,t)},[S,M]),Y=n.useCallback(()=>{const e=N.current;e!==null&&(clearTimeout(e.timer),N.current=null,M(e.transcript,e.metadata))},[M]),ue=n.useCallback(()=>{const e=te(f.getDraft(),C.current,l.current);return Y(),e&&M(e),P.current=null,C.current="",L(""),ee(R.current),!!e},[M,f,Y]),de=n.useCallback(e=>{C.current=e,L(e)},[]),fe=n.useCallback((e,t)=>{if(A.current=e,e==="listening"&&E(),e===null){const r=u.current;r&&b.current.delete(r),l.current=null,u.current=null,P.current=null;const i=$.current;$.current=null,t==="completed"&&i!==null&&B(i)}Q(e)},[E,B]),pe=n.useCallback(()=>{var t;(t=D.current)==null||t.cancelProcessing(),S();const e=u.current;e&&b.current.delete(e),l.current=null,u.current=null,P.current=null,$.current=null,Q(null),L("")},[S]),he=n.useCallback(()=>{const e=f.getDraft();return{draftKey:d,speechTargetId:u.current??void 0,textBeforeCursor:Ze(e,l.current,R.current)}},[f,d]),me=/\/sessions\/[^/]+/.test(h.pathname),ge=!x||!j||h.pathname.endsWith("/new-session")||me,{right:Se,bottom:be,maxWidth:ve}=j??{right:24,bottom:80,maxWidth:200};return s.jsxs("div",{ref:H,className:`fab-container ${m?"fab-expanded":"fab-collapsed"}`,style:{right:`${Se}px`,bottom:`${be}px`,width:`${ve}px`,display:ge?"none":void 0},children:[m&&s.jsxs("div",{className:"fab-input-panel",children:[s.jsx(De,{draftKey:d}),s.jsxs("div",{className:`speech-draft-field ${O?"has-interim":""}`,children:[s.jsxs("div",{className:"speech-draft-inline",children:[O&&s.jsxs("div",{className:"speech-draft-mirror","aria-hidden":"true",children:[s.jsx("span",{children:W.before}),W.separatorBefore,s.jsx("span",{className:"speech-interim-inline",children:W.transcript}),s.jsx("span",{className:"speech-interim-caret"}),W.separatorAfter,s.jsx("span",{children:W.after})]}),s.jsx("textarea",{"data-draft-key":d,ref:R,value:g,onChange:e=>{const t=e.target.value;if(S(),b.current.size>0){const r=new Map;for(const[i,c]of b.current)r.set(i,X(et(g,t,c)));b.current=r,l.current=u.current!==null?r.get(u.current)??null:null}u.current!==null&&Pe(g,t)&&(z.current=!0),E(!0,t),se(t)},onKeyDown:ie,onSelect:E,onPointerUp:E,onClick:ae,onKeyUp:E,onCut:G,onCopy:G,onPaste:G,placeholder:o("fabPlaceholder"),className:"fab-textarea",rows:3})]}),k&&s.jsx("div",{className:"speech-interim-status",role:"status","aria-live":"polite","aria-label":"Tentative speech transcript",children:k})]}),s.jsxs("div",{className:"fab-input-toolbar",children:[s.jsx(ut,{}),s.jsx(Ue,{ref:D,onTranscript:le,onInterimTranscript:de,onListeningStart:oe,onListeningStop:ue,onPendingSpeechChange:fe,getTranscriptionContext:he,className:"toolbar-button"}),s.jsx("button",{type:"button",className:"fab-submit",onClick:B,disabled:!(g.trim()||U!==null||k),"aria-label":o("fabGoToNewSession"),children:"↵"})]})]}),s.jsx("button",{type:"button",className:`fab-button ${m?"fab-button-active":""}`,onClick:m?()=>y(!1):ce,"aria-label":o(m?"fabClose":"fabNewSession"),children:s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:m?"fab-icon-rotated":"",children:[s.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),s.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}export{Nt as FloatingActionButton};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._settings_d5xgp_1{display:grid;gap:var(--space-2)}._control_d5xgp_5,._days_d5xgp_6,._action_d5xgp_7{box-sizing:border-box;min-height:36px;min-width:0;max-width:100%;padding:8px 10px;border:1px solid var(--border-input);border-radius:var(--radius-md);background:var(--bg-input);color:var(--text-primary);font:inherit;font-size:var(--font-size-sm)}._control_d5xgp_5{width:240px}._days_d5xgp_6{width:80px}._action_d5xgp_7{min-height:44px}._control_d5xgp_5:focus-visible,._days_d5xgp_6:focus-visible,._action_d5xgp_7:focus-visible{outline:2px solid var(--focus-border);outline-offset:2px}._control_d5xgp_5:disabled,._days_d5xgp_6:disabled,._action_d5xgp_7:disabled{opacity:.5}._settings_d5xgp_1 ._scopeRow_d5xgp_41{flex-direction:column;align-items:stretch;gap:var(--space-3)}._scopeRow_d5xgp_41 ._control_d5xgp_5{width:100%;min-height:44px}._toggle_d5xgp_51 input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;margin:0;z-index:1;cursor:pointer}._credential_d5xgp_66{margin:var(--space-2) 0;padding:var(--space-3);border:1px solid var(--border-color);border-radius:var(--radius-md)}._credential_d5xgp_66 legend{padding:0 var(--space-1);font-weight:600}._credential_d5xgp_66 ul{margin:var(--space-1) 0;padding-left:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-xs)}._stacked_d5xgp_90{display:flex;flex-direction:column;gap:var(--space-1);margin:var(--space-2) 0}._stacked_d5xgp_90 input{width:100%}._names_d5xgp_101{font-family:var(--font-mono, monospace)}._projects_d5xgp_105{margin:0;padding-left:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-sm);overflow-wrap:anywhere}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,r as j}from"./clientSummaryStore-Cr4yWo-Y.js";import{b as _,e as w,d as A}from"./Modal-iT2_XPlO.js";import{u as C}from"./main-BpQ_EIjC.js";import{S as p}from"./SettingsItem-C7eQXUQf.js";import{u as G,S as P}from"./index-DvjdkG8Q.js";import{s as I,S as R}from"./index-C-4wHkcA.js";import"./react-runtime-D-UPQ57m.js";import"./remoteRoutePaths-Crh_32jX.js";import"./PageHeader-Dbb8BZq2.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./NavigationLayout-BpvrdPoS.js";import"./useSidebarWidth-DnB-wKom.js";import"./frontendReload-54GeNGj9.js";import"./usePanelSlideAnimations-C5qJWoVe.js";import"./useFileActivity-Y1m-dClR.js";import"./GlossaryContext-PMCo1K6f.js";import"./ProviderBadge-DmhZSMRX.js";import"./appHref-ByaEnJGJ.js";import"./YepAnywhereLogo-CIpZ5dke.js";import"./index-D73NQkRu.js";import"./limitedUserBrowserDefaults-C6cuD-wF.js";const B=["AES","AGPL","ANSI","BSD","COVID","CVE","CWE","ECMA","EPL","FIPS","GMT","GPL","GPT","IEC","IEEE","ISO","JPEG","LGPL","MPEG","MPL","PEP","RFC","SHA","SOC","SQL","SSH","TLS","USB","UTC","UTF","WCAG"],T="_settings_d5xgp_1",L="_control_d5xgp_5",H="_days_d5xgp_6",$="_action_d5xgp_7",J="_scopeRow_d5xgp_41",O="_toggle_d5xgp_51",D="_credential_d5xgp_66",K="_stacked_d5xgp_90",M="_names_d5xgp_101",V="_projects_d5xgp_105",r={settings:T,control:L,days:H,action:$,scopeRow:J,toggle:O,credential:D,stacked:K,names:M,projects:V};function fe(){const{t}=C(),l=_();return G(t("issuesTitle")),s.jsx(P,{title:t("issuesTitle"),description:t("issuesDescription"),children:s.jsx(F,{},l.sourceKey)})}function F(){const{t}=C(),{transport:l}=_(),{refetch:g}=w(),[e,o]=j.useState(),[c,u]=j.useState([]),[m,h]=j.useState(""),[n,f]=j.useState(!1),x=j.useRef(l);x.current=l,j.useEffect(()=>{let a=!1;return o(void 0),h(""),f(!1),l.fetch("/issues/settings").then(d=>{a||(o(d.settings),u(d.knownJiraProjects??[]))}).catch(()=>{a||h(t("issuesLoadError"))}),()=>{a=!0}},[l,t]);const b=async a=>{const d=e;o(a),f(!0),h("");try{const v=await l.fetch("/issues/settings",{method:"PUT",body:JSON.stringify(a)});x.current===l&&(o(v.settings),u(v.knownJiraProjects??[]),await g())}catch{x.current===l&&(o(d),h(t("issuesSaveError")))}finally{x.current===l&&f(!1)}};return s.jsxs("div",{className:r.settings,children:[s.jsx(p,{as:"label",id:"issue-discovery-enabled",label:t("issuesEnable"),description:t("issuesRetention"),children:s.jsxs("span",{className:`toggle-switch ${r.toggle}`,children:[s.jsx("input",{type:"checkbox","aria-label":t("issuesEnable"),checked:(e==null?void 0:e.enabled)??!1,disabled:!e||n,onChange:a=>e&&void b({...e,enabled:a.target.checked})}),s.jsx("span",{className:"toggle-slider"})]})}),s.jsx(p,{id:"issue-discovery-scope",label:t("issuesScope"),className:r.scopeRow,description:(e==null?void 0:e.scope)==="recent"?t("issuesRecentHelp"):t("issuesViewedHelp"),children:s.jsxs("select",{className:r.control,"aria-label":t("issuesScope"),value:(e==null?void 0:e.scope)??"viewed",disabled:!e||n,onChange:a=>e&&void b({...e,scope:a.target.value}),children:[s.jsx("option",{value:"viewed",children:t("issuesViewed")}),s.jsx("option",{value:"recent",children:t("issuesRecent")})]})}),(e==null?void 0:e.scope)==="recent"&&s.jsx(p,{id:"issue-discovery-days",label:t("issuesDays"),children:s.jsx("input",{className:r.days,type:"number","aria-label":t("issuesDays"),min:1,max:90,defaultValue:e.recentDays,disabled:n,onBlur:a=>{const d=Number(a.target.value);Number.isInteger(d)&&d>=1&&d<=90?b({...e,recentDays:d}):a.target.value=String(e.recentDays)}})}),s.jsx(p,{as:"label",id:"issue-aggressive-matching",label:t("issuesAggressiveMatching"),description:t("issuesAggressiveHelp"),children:s.jsxs("span",{className:`toggle-switch ${r.toggle}`,children:[s.jsx("input",{type:"checkbox","aria-label":t("issuesAggressiveMatching"),checked:(e==null?void 0:e.aggressiveMatching)??!1,disabled:!e||n,onChange:a=>e&&void b({...e,aggressiveMatching:a.target.checked})}),s.jsx("span",{className:"toggle-slider"})]})}),s.jsx(p,{id:"issue-known-projects",className:r.scopeRow,label:t("issuesKnownProjects"),description:t("issuesKnownProjectsHelp"),children:c.length?s.jsx("ul",{className:r.projects,children:c.map(a=>s.jsxs("li",{children:[s.jsx("strong",{children:a.prefix})," · ",a.site]},`${a.prefix}:${a.site}`))}):s.jsx("span",{children:t("issuesNoKnownProjects")})}),e&&s.jsx(W,{settings:e,busy:n,save:b}),e&&s.jsx(Q,{settings:e,busy:n,save:b}),m&&s.jsx("p",{role:"alert",children:m})]})}const U={enabled:!1,jiraSite:"",jiraEmail:""};function W({settings:t,busy:l,save:g}){const{t:e}=C(),{transport:o}=_(),[c,u]=j.useState(),[m,h]=j.useState(""),n=t.confirmation??U,{version:f}=A(),x=I(f,R.githubStatusControls.name),b=t.githubStatusEnabled??n.enabled,a=t.githubCli??{enabled:!0,account:""},d=c==null?void 0:c.find(i=>i.provider==="github"),[v,S]=j.useState(""),E=i=>void g({...t,...x?{githubStatusEnabled:b}:{},confirmation:{...n,...i}});j.useEffect(()=>{let i=!1;if(u(void 0),!(!n.enabled&&!(x&&b)))return o.fetch("/issues/credentials").then(y=>{i||u(y.credentials)}).catch(()=>{i||u([])}),()=>{i=!0}},[o,n.enabled,x,b,a.enabled,a.account]);const k=async(i,y)=>{h(i),S("");try{const N=await o.fetch("/issues/credentials",{method:"PUT",body:JSON.stringify({provider:i,key:y})});u(N.credentials)}catch{S(e("issuesSaveError"))}finally{h("")}};return s.jsxs(s.Fragment,{children:[x&&s.jsxs(s.Fragment,{children:[s.jsx(p,{as:"label",id:"issue-github-status",label:e("issuesGithubStatusEnable"),description:e("issuesGithubStatusHelp"),children:s.jsxs("span",{className:`toggle-switch ${r.toggle}`,children:[s.jsx("input",{type:"checkbox","aria-label":e("issuesGithubStatusEnable"),checked:b,disabled:l,onChange:i=>void g({...t,githubStatusEnabled:i.target.checked})}),s.jsx("span",{className:"toggle-slider"})]})}),s.jsx(p,{as:"label",id:"issue-github-cli",label:e("issuesGithubCliEnable"),description:e("issuesGithubCliHelp"),children:s.jsxs("span",{className:`toggle-switch ${r.toggle}`,children:[s.jsx("input",{type:"checkbox","aria-label":e("issuesGithubCliEnable"),checked:a.enabled,disabled:l,onChange:i=>void g({...t,githubCli:{...a,enabled:i.target.checked}})}),s.jsx("span",{className:"toggle-slider"})]})}),s.jsx(p,{id:"issue-github-account",className:r.scopeRow,label:e("issuesGithubAccount"),description:e("issuesGithubAccountHelp"),children:s.jsxs("select",{className:r.control,"aria-label":e("issuesGithubAccount"),value:a.account,disabled:l||!a.enabled,onChange:i=>void g({...t,githubCli:{...a,account:i.target.value}}),children:[s.jsx("option",{value:"",children:e("issuesGithubActiveAccount")}),[...new Set([...(d==null?void 0:d.accounts)??[],...a.account?[a.account]:[]])].map(i=>s.jsx("option",{value:i,children:i},i))]})}),s.jsx(p,{id:"issue-github-cache",className:r.scopeRow,label:e("issuesGithubCache"),description:e("issuesGithubCacheHelp"),children:s.jsx("button",{type:"button",className:r.action,disabled:l||!!m,onClick:()=>{h("cache"),S(""),o.fetch("/issues/status",{method:"DELETE"}).catch(()=>S(e("issuesSaveError"))).finally(()=>h(""))},children:e("issuesGithubCacheClear")})})]}),s.jsx(p,{as:"label",id:"issue-confirm-enabled",label:e("issuesConfirmEnable"),description:e("issuesConfirmHelp"),children:s.jsxs("span",{className:`toggle-switch ${r.toggle}`,children:[s.jsx("input",{type:"checkbox","aria-label":e("issuesConfirmEnable"),checked:n.enabled,disabled:l,onChange:i=>E({enabled:i.target.checked})}),s.jsx("span",{className:"toggle-slider"})]})}),n.enabled&&s.jsxs(s.Fragment,{children:[s.jsx(p,{id:"issue-confirm-jira-site",label:e("issuesJiraSite"),children:s.jsx("input",{className:r.control,type:"url","aria-label":e("issuesJiraSite"),placeholder:"https://example.atlassian.net",defaultValue:n.jiraSite,disabled:l,onBlur:i=>E({jiraSite:i.target.value.trim()})})}),s.jsx(p,{id:"issue-confirm-jira-email",label:e("issuesJiraEmail"),children:s.jsx("input",{className:r.control,type:"email","aria-label":e("issuesJiraEmail"),defaultValue:n.jiraEmail,disabled:l,onBlur:i=>E({jiraEmail:i.target.value.trim()})})})]}),c==null?void 0:c.filter(i=>i.provider==="github"?n.enabled||x&&b:n.enabled).map(i=>s.jsx(Z,{credential:i,busy:m===i.provider,store:k},i.provider)),v&&s.jsx("p",{role:"alert",children:v})]})}function Z({credential:t,busy:l,store:g}){var h;const{t:e}=C(),[o,c]=j.useState(""),u=t.provider==="github"?e("issuesCredentialGithub"):e("issuesCredentialJira"),m=t.sources.find(n=>n.kind==="stored");return s.jsxs("fieldset",{className:r.credential,children:[s.jsx("legend",{children:u}),s.jsx("p",{children:t.active?e("issuesCredentialActive",{source:t.active}):e("issuesCredentialMissing")}),((h=t.active)==null?void 0:h.startsWith("gh auth token"))&&t.account&&s.jsx("p",{children:e("issuesGithubUsingAccount",{account:t.account})}),s.jsx("ul",{children:t.sources.map(n=>s.jsxs("li",{children:[n.name,": ",n.present?e("issuesCredentialPresent"):e("issuesCredentialAbsent")]},n.name))}),s.jsxs("label",{className:r.stacked,children:[e("issuesCredentialOverride"),s.jsx("input",{type:"password","aria-label":`${u}: ${e("issuesCredentialOverride")}`,autoComplete:"new-password","data-1p-ignore":!0,"data-lpignore":"true",value:o,disabled:l,onChange:n=>c(n.target.value)})]}),s.jsx("button",{type:"button",disabled:l||!o.trim(),onClick:()=>{g(t.provider,o.trim()).then(()=>c(""))},children:e("issuesCredentialSave")}),(m==null?void 0:m.present)&&s.jsx("button",{type:"button",disabled:l,onClick:()=>void g(t.provider,""),children:e("issuesCredentialClear")})]})}function Q({settings:t,busy:l,save:g}){const{t:e}=C(),o=t.jiraKeyBlocklist??[...B];return s.jsx(p,{id:"issue-jira-blocklist",label:e("issuesBlocklist"),children:s.jsx("input",{type:"text",className:`${r.control} ${r.names}`,"aria-label":e("issuesBlocklist"),defaultValue:o.join(" "),disabled:l,onBlur:c=>{const u=c.target.value.toUpperCase().split(/[\s,]+/).filter(Boolean);u.every(m=>/^[A-Z][A-Z0-9_]{0,31}$/.test(m))?g({...t,jiraKeyBlocklist:u}):c.target.value=o.join(" ")}})})}export{fe as IssueSettings};
|