@p4code/cli 0.8.27 → 0.8.28

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.
Files changed (229) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CPTSeXBG.mjs → binCli-CTh3xknE.mjs} +3 -3
  3. package/dist/client/.vite/manifest.json +1339 -1339
  4. package/dist/client/assets/{AuthSurfaceShell-Io9UMk5e.js → AuthSurfaceShell-D_hzy5by.js} +2 -2
  5. package/dist/client/assets/{ChatGptUsageButton-C5QxZxAY.js → ChatGptUsageButton-B7IBN3Pq.js} +2 -2
  6. package/dist/client/assets/{ChatMarkdown-n-Pmpt9I.js → ChatMarkdown-6bkZ78vO.js} +7 -7
  7. package/dist/client/assets/CodexSetupSection.logic-87IQTLRa.js +2 -0
  8. package/dist/client/assets/{CommandBlock-BI6CIDH1.js → CommandBlock-DXCZ6paN.js} +2 -2
  9. package/dist/client/assets/{ComposerPromptEditor-3AzcmrcZ.js → ComposerPromptEditor-DZ-YKnMe.js} +6 -6
  10. package/dist/client/assets/{DevicePanel-CglyhaAG.js → DevicePanel-CECEStbX.js} +2 -2
  11. package/dist/client/assets/{DeviceSetup-Bazjz7NZ.js → DeviceSetup-Ck1EofY9.js} +2 -2
  12. package/dist/client/assets/{DiffCommentAnnotation-aW33-n8Z.js → DiffCommentAnnotation-CvI2pBnS.js} +2 -2
  13. package/dist/client/assets/{DiffFileTree-BUpgXQ-A.js → DiffFileTree-DbLr5IWH.js} +2 -2
  14. package/dist/client/assets/{DiffPanel-C7V9CYKL.js → DiffPanel-Cq1eltuZ.js} +2 -2
  15. package/dist/client/assets/{DiffWorkerPoolProvider-DMh_rKAW.js → DiffWorkerPoolProvider-KQyWsi6k.js} +3 -3
  16. package/dist/client/assets/{EmbeddedDesign-C5OUFTlD.js → EmbeddedDesign-DhM04pU7.js} +2 -2
  17. package/dist/client/assets/{FileDiff-CSn7_lgS.js → FileDiff-CNttiWtf.js} +2 -2
  18. package/dist/client/assets/{FilePreviewPanel-3-FZcESN.js → FilePreviewPanel-CGicpbOo.js} +5 -5
  19. package/dist/client/assets/{FoldedSettingsSection-f9BtRG8P.js → FoldedSettingsSection-BTPWwXUE.js} +2 -2
  20. package/dist/client/assets/{NoProjectsHero-BvLl09sT.js → NoProjectsHero-kyhQJSgF.js} +2 -2
  21. package/dist/client/assets/{P4ConnectAccountPages-55eXXvOR.js → P4ConnectAccountPages-DRIMCs7k.js} +2 -2
  22. package/dist/client/assets/{P4ConnectSidebarSignIn-CJxHyKxw.js → P4ConnectSidebarSignIn-C-ZetXUN.js} +2 -2
  23. package/dist/client/assets/{PanelLayoutControls-BVds3zWp.js → PanelLayoutControls-D9ZXss-X.js} +7 -7
  24. package/dist/client/assets/{PierreEntryIcon-BfQvfMe4.js → PierreEntryIcon-B803YO8_.js} +2 -2
  25. package/dist/client/assets/PreviewPanel-BziiiQxi.js +2 -0
  26. package/dist/client/assets/{ProjectDefaultsSettings-CD7_iiCV.js → ProjectDefaultsSettings-xYQqDWRw.js} +2 -2
  27. package/dist/client/assets/{ProjectFavicon-DZ3q6Z0H.js → ProjectFavicon-BxL9C_zZ.js} +3 -3
  28. package/dist/client/assets/{ProjectIconPickerDialog-BHl4mXHB.js → ProjectIconPickerDialog-gjdCKD85.js} +2 -2
  29. package/dist/client/assets/{ProviderAuthTerminal-CFc0xySv.js → ProviderAuthTerminal-BdqGbrD-.js} +2 -2
  30. package/dist/client/assets/{ProviderModelPicker-C8efuVrz.js → ProviderModelPicker-BFOGSdmh.js} +2 -2
  31. package/dist/client/assets/{ProviderSettingsForm-DFLuI_nx.js → ProviderSettingsForm-BJzj9wl2.js} +2 -2
  32. package/dist/client/assets/{PullRequestCodeTab-DRVlxTwy.js → PullRequestCodeTab-C8muv3ss.js} +3 -3
  33. package/dist/client/assets/{ReadOnlySourcePreview-Bu2_ZtA-.js → ReadOnlySourcePreview-CnJC2otA.js} +2 -2
  34. package/dist/client/assets/{RenderErrorBoundary-D4jGtlFT.js → RenderErrorBoundary-CWP7Ykmu.js} +2 -2
  35. package/dist/client/assets/{ScheduledTasksSettings-C0hXWVvl.js → ScheduledTasksSettings-B2-ZEorL.js} +4 -4
  36. package/dist/client/assets/{ScopedSwitch-LBZ02wBh.js → ScopedSwitch-BX-fVWkE.js} +2 -2
  37. package/dist/client/assets/{SettingsPanels-DWwikGem.js → SettingsPanels-BDtXSbdD.js} +7 -7
  38. package/dist/client/assets/{SettingsPanels.logic-CZpg8aSK.js → SettingsPanels.logic-OCadp8dD.js} +2 -2
  39. package/dist/client/assets/{SettingsScopeNotice-DjEkL-Ym.js → SettingsScopeNotice-Dajn79Bg.js} +2 -2
  40. package/dist/client/assets/{ThemeEditorPanel-DOEkSOth.js → ThemeEditorPanel-DXEV7Ie_.js} +2 -2
  41. package/dist/client/assets/{ThreadTerminalDrawer-BZX00N_c.js → ThreadTerminalDrawer-aFQnCwrV.js} +3 -3
  42. package/dist/client/assets/{Virtualizer-CJW8pEVT.js → Virtualizer-DMRRdqR9.js} +2 -2
  43. package/dist/client/assets/{_chat-Ca7FuMbD.js → _chat-EbDz56cx.js} +34 -34
  44. package/dist/client/assets/{_chat.design-CDj4DPmx.js → _chat.design-DWI-MLY7.js} +2 -2
  45. package/dist/client/assets/{_chat.index-CpvSvFZH.js → _chat.index-CIbURiJU.js} +2 -2
  46. package/dist/client/assets/{_chat.new-3bIU60mQ.js → _chat.new-DkERK7Ju.js} +2 -2
  47. package/dist/client/assets/{_chat.pull-requests-BTLE24EW.js → _chat.pull-requests-BXkli2jv.js} +2 -2
  48. package/dist/client/assets/{abnfDiagram-VCTEODGH-DS1tb4Dy.js → abnfDiagram-VCTEODGH-ByXKIMIJ.js} +2 -2
  49. package/dist/client/assets/architecture-7GRP2DOG-DI9suUNc.js +1 -0
  50. package/dist/client/assets/{architectureDiagram-5GKGNRK7-D0zpK53v.js → architectureDiagram-5GKGNRK7-CRs8AN1Y.js} +2 -2
  51. package/dist/client/assets/{assets-BG_JXxWD.js → assets-BNBTdYNP.js} +2 -2
  52. package/dist/client/assets/{blockDiagram-I7D4REHJ-SL4el5ol.js → blockDiagram-I7D4REHJ-ilgACMM3.js} +2 -2
  53. package/dist/client/assets/{browserHistoryStore-TYW6lOuv.js → browserHistoryStore-BX8E7ldD.js} +2 -2
  54. package/dist/client/assets/{browserLinkTarget-BNoJwTBt.js → browserLinkTarget-D3eCixJp.js} +2 -2
  55. package/dist/client/assets/{c4Diagram-7LVT6UL2-CWJKC-4H.js → c4Diagram-7LVT6UL2-Bwq3-L7P.js} +2 -2
  56. package/dist/client/assets/channel-BAWAGigO.js +2 -0
  57. package/dist/client/assets/{chunk-4HAMMTFA-BPAna-Wv.js → chunk-4HAMMTFA-C4jNDShb.js} +2 -2
  58. package/dist/client/assets/{chunk-75Z2AOVW-jKPMvGhC.js → chunk-75Z2AOVW-L1wmF_KI.js} +2 -2
  59. package/dist/client/assets/{chunk-DU6HZSFF-DQeySev0.js → chunk-DU6HZSFF-BfZ5xWy3.js} +2 -2
  60. package/dist/client/assets/{chunk-F27PBJKO-jWPdwF7M.js → chunk-F27PBJKO-BkacPGLC.js} +2 -2
  61. package/dist/client/assets/{chunk-GMAD6QVW-DpPhOysA.js → chunk-GMAD6QVW-oeSYhMBo.js} +2 -2
  62. package/dist/client/assets/{chunk-GVQU2GXP-Ci4jKLcc.js → chunk-GVQU2GXP-BuEWFnig.js} +2 -2
  63. package/dist/client/assets/{chunk-IMKFNOWR-D29vnX6w.js → chunk-IMKFNOWR-DD3QIg9Y.js} +2 -2
  64. package/dist/client/assets/{chunk-L3NEJ4N5-C0YH77t5.js → chunk-L3NEJ4N5-z7EX83WR.js} +2 -2
  65. package/dist/client/assets/{chunk-OSK3NFVY-DfSRnLdf.js → chunk-OSK3NFVY-DHZoeWxe.js} +2 -2
  66. package/dist/client/assets/{chunk-P2QGCYS3-Bg2pIwSk.js → chunk-P2QGCYS3-CoY88v85.js} +2 -2
  67. package/dist/client/assets/{chunk-POPQ4Y6H-CctNE5Wx.js → chunk-POPQ4Y6H-C0LoWsGT.js} +2 -2
  68. package/dist/client/assets/{chunk-PWAF6VOD-C1f1DGpf.js → chunk-PWAF6VOD-D56FBahr.js} +2 -2
  69. package/dist/client/assets/{chunk-SHT3W25Y-xnpqecbr.js → chunk-SHT3W25Y-DV5FTtwQ.js} +2 -2
  70. package/dist/client/assets/{chunk-SVP7TREG-DnMt1uxV.js → chunk-SVP7TREG-8Re3q7oh.js} +2 -2
  71. package/dist/client/assets/{chunk-TICWLB2K-Cu6mah4v.js → chunk-TICWLB2K-Cf6JQRsk.js} +2 -2
  72. package/dist/client/assets/classDiagram-ZZMXUADV-DIxrr9dl.js +2 -0
  73. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DIxrr9dl.js +2 -0
  74. package/dist/client/assets/{composer-logic-ByYUEP0g.js → composer-logic-qo_WCoOG.js} +2 -2
  75. package/dist/client/assets/{composerDraftUploads-BPBBqP0N.js → composerDraftUploads-V25cFF6x.js} +2 -2
  76. package/dist/client/assets/{connect-agent-BHr4rYhL.js → connect-agent-BxzfRNpE.js} +2 -2
  77. package/dist/client/assets/{connect-rIIk2LpN.js → connect-xS5TNxN6.js} +2 -2
  78. package/dist/client/assets/{cynefin-OW5HDTMX-awGYteF9.js → cynefin-OW5HDTMX-IIXmP-nN.js} +1 -1
  79. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-N1-lLKT-.js → cynefinDiagram-5FMLGOSQ-BcJM9-A6.js} +2 -2
  80. package/dist/client/assets/{dagre-GXQ25YYZ-DCPL5qNf.js → dagre-GXQ25YYZ-DdHQMvS3.js} +2 -2
  81. package/dist/client/assets/{design-D9pNp4fS.js → design-BJ2IVJXi.js} +2 -2
  82. package/dist/client/assets/{device-DvcJXr0e.js → device-B5UHgye_.js} +2 -2
  83. package/dist/client/assets/{diagram-S7CK7UJ4-DEZdO6ar.js → diagram-S7CK7UJ4-CryZrud_.js} +2 -2
  84. package/dist/client/assets/{diagram-UQ7AKVKN-B2XQyTB4.js → diagram-UQ7AKVKN-BAERLSjk.js} +2 -2
  85. package/dist/client/assets/{diagram-VSXAHHWV-DldfdFb5.js → diagram-VSXAHHWV-BFezrcB9.js} +2 -2
  86. package/dist/client/assets/{diagram-VX7I27RA-CifXMdiI.js → diagram-VX7I27RA-C_DPu9hN.js} +2 -2
  87. package/dist/client/assets/{diagram-Z3DM3KII-jXVmEkNO.js → diagram-Z3DM3KII-gf1HXqDh.js} +2 -2
  88. package/dist/client/assets/{diffRendering-DxGUmEvq.js → diffRendering-BZVYVxSb.js} +2 -2
  89. package/dist/client/assets/{dist-COvLc5b4.js → dist-C4dEfrtE.js} +2 -2
  90. package/dist/client/assets/{duoViewer-B50bcQwg.js → duoViewer-BSJbAeAM.js} +2 -2
  91. package/dist/client/assets/{dynamic-DDCwZvn2.js → dynamic-BwDInrZk.js} +2 -2
  92. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CXxPKnge.js → ebnfDiagram-PWID7BFC-DOa1Oxoi.js} +2 -2
  93. package/dist/client/assets/{embeddedScripts-Gpq5uvk8.js → embeddedScripts-B6n6Rzsw.js} +2 -2
  94. package/dist/client/assets/{entities-CHcmKww2.js → entities-f_LpWDGP.js} +2 -2
  95. package/dist/client/assets/{erDiagram-RLTQ6QDP-Bg12tmzC.js → erDiagram-RLTQ6QDP-BOgY2RsW.js} +2 -2
  96. package/dist/client/assets/eventmodeling-NTZA5JFV-DWccyGhB.js +1 -0
  97. package/dist/client/assets/{fileLinks-OMeT3EGv.js → fileLinks-C5feST6o.js} +2 -2
  98. package/dist/client/assets/{fileTreeExpansion-DlEbR8A9.js → fileTreeExpansion-4McmDYkr.js} +2 -2
  99. package/dist/client/assets/flowDiagram-HODETNUW-2xlj_oad.js +1 -0
  100. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Cg6B23Gi.js → ganttDiagram-EL5Y4UJY-DHANnqYy.js} +2 -2
  101. package/dist/client/assets/{getDiffFileInput-DU7M1ayK.js → getDiffFileInput-DjHqn-Tb.js} +2 -2
  102. package/dist/client/assets/{gitGraph-4MIJSDKK-DY1yzqnv.js → gitGraph-4MIJSDKK-B1wP1IDj.js} +1 -1
  103. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CuxKBsR7.js → gitGraphDiagram-WWUBYQGX-odn00pH9.js} +2 -2
  104. package/dist/client/assets/{guideRunStore-CtlhC1A4.js → guideRunStore-BuXFHADO.js} +2 -2
  105. package/dist/client/assets/{index-DT3GBOff.js → index-DW7vuxv_.js} +3 -3
  106. package/dist/client/assets/{info-A6RAGUB7-FELuhJNt.js → info-A6RAGUB7-Dvw63L11.js} +1 -1
  107. package/dist/client/assets/{infoDiagram-27XIBGKW-Bl4I0Plv.js → infoDiagram-27XIBGKW-CU82rrtH.js} +2 -2
  108. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-UAMqnpij.js → ishikawaDiagram-5VMMS53U-CUWA9EZ6.js} +2 -2
  109. package/dist/client/assets/{journeyDiagram-3NMN7TZE-J6lpIBGT.js → journeyDiagram-3NMN7TZE-DxDN61m2.js} +2 -2
  110. package/dist/client/assets/{kanban-definition-UXKFOSKX-BAmj09Ml.js → kanban-definition-UXKFOSKX-DsVX8mLR.js} +2 -2
  111. package/dist/client/assets/{line-BT7eNXjs.js → line-Bd1UwAnv.js} +2 -2
  112. package/dist/client/assets/{linkedPrompt-BVuTIuW9.js → linkedPrompt-9p_0HiUR.js} +2 -2
  113. package/dist/client/assets/main-D6OSHTK1.js +28 -0
  114. package/dist/client/assets/main-DYflPzD9.css +2 -0
  115. package/dist/client/assets/{mediaReference-4ijjnwgU.js → mediaReference-BqCWwE_6.js} +2 -2
  116. package/dist/client/assets/{mediaSource-BBXGRYvD.js → mediaSource-CKXEV-xH.js} +2 -2
  117. package/dist/client/assets/{mermaid-parser.core-DEiOK0ka.js → mermaid-parser.core-DNVawM8U.js} +4 -4
  118. package/dist/client/assets/{mermaid.core-Bx8b2pKm.js → mermaid.core-DiY2Mo1k.js} +5 -5
  119. package/dist/client/assets/{mindmap-definition-YA3MSWOX-BXyIIcif.js → mindmap-definition-YA3MSWOX-D9niWwdo.js} +2 -2
  120. package/dist/client/assets/{onboarding-D_AA7mEu.js → onboarding-ChIfLFtJ.js} +2 -2
  121. package/dist/client/assets/{openFileInPreview-BX2EPx-W.js → openFileInPreview-BEwUYee4.js} +2 -2
  122. package/dist/client/assets/{p4ProjectFile-DCsCl5_0.js → p4ProjectFile-CuaSnYfs.js} +2 -2
  123. package/dist/client/assets/{packet-AYTQ26CC-Bqx116EX.js → packet-AYTQ26CC-DUQ3tZCm.js} +1 -1
  124. package/dist/client/assets/{pair-B5LOQH2j.js → pair-CqJy0vEz.js} +2 -2
  125. package/dist/client/assets/{pegDiagram-XKGWAZYB-BsvAGr54.js → pegDiagram-XKGWAZYB-CngbWshp.js} +2 -2
  126. package/dist/client/assets/{phoneViewer-BT-wd3b1.js → phoneViewer-EiVMUfJk.js} +2 -2
  127. package/dist/client/assets/{pie-WAS4IAKB-evx-Z-FQ.js → pie-WAS4IAKB-BTlxIvlT.js} +1 -1
  128. package/dist/client/assets/{pieDiagram-E7YTZNPT-CKykWbhU.js → pieDiagram-E7YTZNPT-DGB8Wyv9.js} +2 -2
  129. package/dist/client/assets/{pierre-icons-DpUmwZMv.js → pierre-icons-h-5PO6Es.js} +2 -2
  130. package/dist/client/assets/{preview-CgesrIRi.js → preview-D2IUAcO1.js} +2 -2
  131. package/dist/client/assets/{primary-D90_IvSw.js → primary-BiKaD1fF.js} +2 -2
  132. package/dist/client/assets/{primaryCloudLinkState-BipC1sbg.js → primaryCloudLinkState-Cj6NnNj4.js} +2 -2
  133. package/dist/client/assets/{projectFilesQueryState-B0Z25WLd.js → projectFilesQueryState-C9qxBsmE.js} +2 -2
  134. package/dist/client/assets/projectScriptEditor-CIO5ye4D.js +2 -0
  135. package/dist/client/assets/{providerSkills-WK9rr3PR.js → providerSkills-Dez8rDqH.js} +2 -2
  136. package/dist/client/assets/{pullRequestDetail.logic-DU6FbcfP.js → pullRequestDetail.logic-UDSGN79l.js} +2 -2
  137. package/dist/client/assets/{pullRequests-Cv7P2eIY.js → pullRequests-DK5muENv.js} +2 -2
  138. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DXX_yCol.js → quadrantDiagram-AXDQQJYC-Dyks054W.js} +2 -2
  139. package/dist/client/assets/{queries-CzWn4iT1.js → queries-CnKYA1jH.js} +2 -2
  140. package/dist/client/assets/{radar-RG4KPBEZ-DVDYLdDv.js → radar-RG4KPBEZ-5t86Aak1.js} +1 -1
  141. package/dist/client/assets/{railroad-74A4TZTK-QbHjzV3H.js → railroad-74A4TZTK-CjZW18sO.js} +1 -1
  142. package/dist/client/assets/railroad-abnf-HS5TGJTU-DOBW6UbH.js +1 -0
  143. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Ck7zj7ML.js +1 -0
  144. package/dist/client/assets/railroad-peg-WCYAUIDC-BkEDvnoB.js +1 -0
  145. package/dist/client/assets/{railroadDiagram-O6MQD6OU-iJ7qhNbR.js → railroadDiagram-O6MQD6OU-DY2XrwTu.js} +2 -2
  146. package/dist/client/assets/{renderScheduler-BLVmyLhe.js → renderScheduler-CxIHtCj0.js} +2 -2
  147. package/dist/client/assets/{requirementDiagram-BXWQKSXE-xiWwbUm-.js → requirementDiagram-BXWQKSXE-9MWiyLFr.js} +2 -2
  148. package/dist/client/assets/{runtime-D2c--mqA.js → runtime-BtL_3nGT.js} +3 -3
  149. package/dist/client/assets/{runtime-FrzhE_LH.js → runtime-CxXKASQ8.js} +2 -2
  150. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-0nRyou7P.js → sankeyDiagram-P5KCCOFB-o3eBJ4t5.js} +2 -2
  151. package/dist/client/assets/{scheduledTasksSettings.logic-BXS7vhZ-.js → scheduledTasksSettings.logic-CpaoLLyc.js} +2 -2
  152. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CC5JdpP4.js → sequenceDiagram-WJ2MYXX4-E9SEYXIP.js} +2 -2
  153. package/dist/client/assets/{server-DZYI6rhH.js → server-DK7wLDqS.js} +2 -2
  154. package/dist/client/assets/{session-DhEZhn9K.js → session-CB_SwK9v.js} +2 -2
  155. package/dist/client/assets/{session-logic-6vU9tCVO.js → session-logic-lPOzc1cs.js} +2 -2
  156. package/dist/client/assets/{settings-DHEFuexL.js → settings-vpymP2yR.js} +2 -2
  157. package/dist/client/assets/{settings.appearance-5kVeILsJ.js → settings.appearance-CRhnBCI2.js} +2 -2
  158. package/dist/client/assets/settings.archived-qDhcwMq8.js +2 -0
  159. package/dist/client/assets/{settings.computer-use-B_rhtPVE.js → settings.computer-use-54EsP-qO.js} +2 -2
  160. package/dist/client/assets/{settings.connections-B8NEiau5.js → settings.connections-Ck3AgyGG.js} +2 -2
  161. package/dist/client/assets/{settings.data-controls-B9FYgTyX.js → settings.data-controls-D_RMMjIN.js} +2 -2
  162. package/dist/client/assets/{settings.decisions-B2cCo6C4.js → settings.decisions-Cbvkif9S.js} +2 -2
  163. package/dist/client/assets/{settings.designs-B-dMaR0b.js → settings.designs-BefGbBVB.js} +2 -2
  164. package/dist/client/assets/{settings.diagnostics-DtokU1DC.js → settings.diagnostics-XFetpvca.js} +2 -2
  165. package/dist/client/assets/{settings.general-CEl6ByN_.js → settings.general-Bk6wtWtE.js} +2 -2
  166. package/dist/client/assets/settings.integrations-C6Lgx1NO.js +2 -0
  167. package/dist/client/assets/{settings.keybindings-r4Dy4hkg.js → settings.keybindings-BkE-gcjT.js} +2 -2
  168. package/dist/client/assets/{settings.open-source-licenses-BGGKTeAP.js → settings.open-source-licenses-C10v2gWN.js} +2 -2
  169. package/dist/client/assets/{settings.plugins-C6Q3vhFM.js → settings.plugins-DCZ1gwld.js} +4 -4
  170. package/dist/client/assets/{settings.projects-DtZL3XlK.js → settings.projects-BInuPAfr.js} +3 -3
  171. package/dist/client/assets/{settings.providers-BHl68xr7.js → settings.providers-ggyV-d7U.js} +3 -3
  172. package/dist/client/assets/{settings.scheduled-tasks-DTxlZQAV.js → settings.scheduled-tasks-CkALFkch.js} +2 -2
  173. package/dist/client/assets/{settings.snap-shot-CFuPNtXn.js → settings.snap-shot-R8RC_FLN.js} +2 -2
  174. package/dist/client/assets/settings.source-control-DteTH38s.js +2 -0
  175. package/dist/client/assets/{settings.storage-Bw_3CvHq.js → settings.storage-CMsiwSuK.js} +2 -2
  176. package/dist/client/assets/{settingsLayout-C1Jfxbij.js → settingsLayout-CFe_w3zi.js} +2 -2
  177. package/dist/client/assets/{sidebar-BopQa8qy.js → sidebar-tK61bIR5.js} +2 -2
  178. package/dist/client/assets/sidebarProjectGrouping-DR0wmmJk.js +2 -0
  179. package/dist/client/assets/{sourceControl-Lsyqeoql.js → sourceControl-DNVstovX.js} +2 -2
  180. package/dist/client/assets/{sourceControlClients-DQbmIpu5.js → sourceControlClients-CW3X8Vqj.js} +2 -2
  181. package/dist/client/assets/{stateDiagram-D77RDMKH-m8Y-mxXE.js → stateDiagram-D77RDMKH-DIphJncn.js} +2 -2
  182. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-l4hzw06_.js +2 -0
  183. package/dist/client/assets/{swimlanes-42K2YHIH-wRxafkPC.js → swimlanes-42K2YHIH-BY19pg1S.js} +2 -2
  184. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Dm5nKQAS.js +9 -0
  185. package/dist/client/assets/{terminalSessions-CYOZNbmk.js → terminalSessions-Br7AMEFR.js} +2 -2
  186. package/dist/client/assets/{timeline-definition-24CTP7MA-rIHAblCw.js → timeline-definition-24CTP7MA-ByzcuBaC.js} +2 -2
  187. package/dist/client/assets/toast-C2NI-Hlh.js +2 -0
  188. package/dist/client/assets/toastHelpers-DxXYm50b.js +2 -0
  189. package/dist/client/assets/{treeView-Q6P3EWNA-Bcy74tP0.js → treeView-Q6P3EWNA-C6l--y6F.js} +1 -1
  190. package/dist/client/assets/{treemap-WGGIJYW6-CfQsmSnc.js → treemap-WGGIJYW6-2WmHmD0F.js} +1 -1
  191. package/dist/client/assets/{uiStateStore-BvYsbiUI.js → uiStateStore-z548e4qC.js} +3 -3
  192. package/dist/client/assets/{usage-DKGEF7z4.js → usage-Bb-jkura.js} +2 -2
  193. package/dist/client/assets/{use-atom-command-DrwAZaSK.js → use-atom-command-BBLN3-cB.js} +2 -2
  194. package/dist/client/assets/{useHandleNewThread-CX2gg9sv.js → useHandleNewThread-CsUYJUoP.js} +2 -2
  195. package/dist/client/assets/{useP4ConnectAuthPrompt-BVHt43id.js → useP4ConnectAuthPrompt-C_DWHou2.js} +2 -2
  196. package/dist/client/assets/{usePullRequestActions-CKEsy23v.js → usePullRequestActions-2RLXa_AL.js} +2 -2
  197. package/dist/client/assets/{useScopedModelAvailability-DxkmmSwB.js → useScopedModelAvailability-CLSjirRK.js} +2 -2
  198. package/dist/client/assets/useSettings-BeOQNM41.js +3 -0
  199. package/dist/client/assets/{vcsRefInvalidation-Cp8DmrdA.js → vcsRefInvalidation-D5r-YO6n.js} +2 -2
  200. package/dist/client/assets/{vennDiagram-4TSXK5OY-BYWi9jUi.js → vennDiagram-4TSXK5OY-CsSeQEmm.js} +2 -2
  201. package/dist/client/assets/{wardley-WFR3VGLG-BQv1A50b.js → wardley-WFR3VGLG-DHUa30e5.js} +1 -1
  202. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-Cp-BLL4g.js → wardleyDiagram-VM6X3IG4-NUfaDxHP.js} +2 -2
  203. package/dist/client/assets/{welcome-COe2CLyM.js → welcome-DUwjP1q3.js} +2 -2
  204. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CNBL0I4g.js → xychartDiagram-S5SC5T6Z-wdjDjsiQ.js} +2 -2
  205. package/dist/client/index.html +1 -1
  206. package/package.json +1 -1
  207. package/dist/client/assets/CodexSetupSection.logic-452dIoYg.js +0 -2
  208. package/dist/client/assets/PreviewPanel-Cj2fiJWr.js +0 -2
  209. package/dist/client/assets/architecture-7GRP2DOG-qKmX7534.js +0 -1
  210. package/dist/client/assets/channel-DI-bXazi.js +0 -2
  211. package/dist/client/assets/classDiagram-ZZMXUADV-DrD0Oidb.js +0 -2
  212. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DrD0Oidb.js +0 -2
  213. package/dist/client/assets/eventmodeling-NTZA5JFV-DGgBiDNH.js +0 -1
  214. package/dist/client/assets/flowDiagram-HODETNUW-DvUNziGW.js +0 -1
  215. package/dist/client/assets/main-CSxSeVCm.js +0 -28
  216. package/dist/client/assets/main-CcPhKii6.css +0 -2
  217. package/dist/client/assets/projectScriptEditor-BAAT-cd6.js +0 -2
  218. package/dist/client/assets/railroad-abnf-HS5TGJTU-cPiNHmv2.js +0 -1
  219. package/dist/client/assets/railroad-ebnf-LZEXJU2U-D_qTHfDb.js +0 -1
  220. package/dist/client/assets/railroad-peg-WCYAUIDC-DzNZR6g5.js +0 -1
  221. package/dist/client/assets/settings.archived-jwpZnQSj.js +0 -2
  222. package/dist/client/assets/settings.integrations-B6wNRi_e.js +0 -2
  223. package/dist/client/assets/settings.source-control-DzHVHiHN.js +0 -2
  224. package/dist/client/assets/sidebarProjectGrouping-CTN-1PEY.js +0 -2
  225. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-Co2rfAar.js +0 -2
  226. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DgApCEOp.js +0 -9
  227. package/dist/client/assets/toast-VoruYA6X.js +0 -2
  228. package/dist/client/assets/toastHelpers-Dsph6LwL.js +0 -2
  229. package/dist/client/assets/useSettings-u7ZNp27u.js +0 -3
@@ -1,8 +1,8 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-DQeySev0.js";import{t as m}from"./linear-BUnzfXgk.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./init-C-OQMol4.js";import{i as _}from"./chunk-75Z2AOVW-jKPMvGhC.js";import{t as v}from"./line-BT7eNXjs.js";import"./chunk-PWAF6VOD-C1f1DGpf.js";import{t as y}from"./chunk-GMAD6QVW-DpPhOysA.js";import{f as b}from"./mermaid.core-Bx8b2pKm.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-oBChb5qS.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-BfZ5xWy3.js";import{t as m}from"./linear-BUnzfXgk.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./init-C-OQMol4.js";import{i as _}from"./chunk-75Z2AOVW-L1wmF_KI.js";import{t as v}from"./line-Bd1UwAnv.js";import"./chunk-PWAF6VOD-D56FBahr.js";import{t as y}from"./chunk-GMAD6QVW-oeSYhMBo.js";import{f as b}from"./mermaid.core-DiY2Mo1k.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
5
  `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
6
  `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return e(j,`Parser`),j.prototype=A,A.Parser=j,new j})();C.parser=C;var w=C;function T(e){return e.type===`bar`}e(T,`isBarPlot`);function E(e){return e.type===`band`}e(E,`isBandAxisData`);function D(e){return e.type===`linear`}e(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{e(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{e(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{e(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),t.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{e(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=m().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=m().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}e(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{e(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function P(e,t,n,r){return new te(new O(r),e,t,n)}e(P,`getChartTitleComponent`);var ne=.75,re=.5,ie=.35;function F(e){return{fontSize:e,markerSize:e*ne,markerSpacing:e*ie,itemSpacing:e*re}}e(F,`getLegendLayout`);var ae=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{e(this,`ChartLegend`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(e=>e.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:t,markerSize:n,markerSpacing:r,itemSpacing:i}=F(this.chartConfig.legendFontSize),a=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(e=>e.title),t),o=this.chartConfig.legendPadding*2+n+r+a.width,s=this.chartConfig.legendPadding*2+this.visiblePlots.length*t+(this.visiblePlots.length-1)*i;return o<=e.width&&s<=e.height?(this.boundingRect.width=o,this.boundingRect.height=s):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:t,markerSpacing:n,itemSpacing:r}=F(this.chartConfig.legendFontSize),i=e+r,a=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,s=[],c=[];for(let[e,n]of this.visiblePlots.entries())if(T(n))s.push({x:a,y:o+e*i,width:t,height:t,fill:n.fill,strokeFill:n.fill,strokeWidth:0});else{let r=o+e*i+t/2;c.push({path:`M ${a},${r} L ${a+t},${r}`,strokeFill:n.strokeFill,strokeWidth:n.strokeWidth})}return[{groupTexts:[`legend`,`markers`],type:`rect`,data:s},{groupTexts:[`legend`,`markers`],type:`path`,data:c},{groupTexts:[`legend`,`label`],type:`text`,data:this.visiblePlots.map((r,s)=>({text:r.title,x:a+t+n,y:o+s*i+t/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:`middle`,horizontalPos:`left`}))}]}};function I(e,t,n,r){return new ae(new O(r),e,t,n)}e(I,`getChartLegendComponent`);var oe=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{e(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;if(t=this.orientation===`horizontal`?v().y(e=>e[0]).x(e=>e[1])(e):v().x(e=>e[0]).y(e=>e[1])(e),!t)return[];let n=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let t=[];for(let[n,[r,i]]of e.entries()){let e=this.plotData.pointLabels[n];e&&(this.orientation===`horizontal`?t.push({x:i+10,y:r,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):t.push({x:r,y:i-10,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}t.length>0&&n.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:t})}return n}},se=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{e(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ce=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{e(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new oe(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new se(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}};function le(e,t,n){return new ce(e,t,n)}e(le,`getPlotComponent`);var ue=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:P(e,t,n,r),plot:le(e,t,n),legend:I(e,t,n,r),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{e(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i={width:0,height:0},a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`bottom`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=s.height,this.componentStore.yAxis.setAxisPosition(`left`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=s.width,e-=s.width,i=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=i.width,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.legend.setBoundingBoxXY({x:n+a,y:r+Math.max((o-i.height)/2,0)}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+o}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:o,height:s});e-=c.width,t-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=c.height,t-=c.height,this.componentStore.xAxis.setAxisPosition(`left`),c=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=c.width,r=c.width,this.componentStore.yAxis.setAxisPosition(`top`),c=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=c.height,i=n+c.height,a=this.componentStore.legend.calculateSpace({width:e,height:s}),e-=a.width,e>0&&(o+=e,e=0),t>0&&(s+=t,t=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.legend.setBoundingBoxXY({x:r+o,y:i+Math.max((s-a.height)/2,0)}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},de=class{static{e(this,`XYChartBuilder`)}static build(e,t,n,r){return new ue(e,t,n,r).getDrawableElement()}},L=0,R,z=K(),B=G(),V=q(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1;function G(){let e=n(),t=s();return _(e.xyChart,t.themeVariables.xyChart)}e(G,`getChartDefaultThemeConfig`);function K(){let e=s();return _(l.xyChart,e.xyChart)}e(K,`getChartDefaultConfig`);function q(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}e(q,`getChartDefaultData`);function J(e){let t=s();return p(e.trim(),t)}e(J,`textSanitizer`);function Y(e){R=e}e(Y,`setTmpSVGG`);function fe(e){e===`horizontal`?z.chartOrientation=`horizontal`:z.chartOrientation=`vertical`}e(fe,`setOrientation`);function pe(e){V.xAxis.title=J(e.text)}e(pe,`setXAxisTitle`);function X(e,t){V.xAxis={type:`linear`,title:V.xAxis.title,min:e,max:t},U=!0}e(X,`setXAxisRangeData`);function me(e){V.xAxis={type:`band`,title:V.xAxis.title,categories:e.map(e=>J(e.text))},U=!0}e(me,`setXAxisBand`);function he(e){V.yAxis.title=J(e.text)}e(he,`setYAxisTitle`);function Z(e,t){V.yAxis={type:`linear`,title:V.yAxis.title,min:e,max:t},W=!0}e(Z,`setYAxisRangeData`);function ge(e){let t=Math.min(...e),n=Math.max(...e),r=D(V.yAxis)?V.yAxis.min:1/0,i=D(V.yAxis)?V.yAxis.max:-1/0;V.yAxis={type:`linear`,title:V.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}e(ge,`setYAxisRangeFromPlotData`);function Q(e){let t=[];if(e.length===0)return t;if(!U){let t=D(V.xAxis)?V.xAxis.min:1/0,n=D(V.xAxis)?V.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(E(V.xAxis)&&e.length>V.xAxis.categories.length&&(e=e.slice(0,V.xAxis.categories.length)),W||ge(e),E(V.xAxis)&&(t=V.xAxis.categories.map((t,n)=>[t,e[n]])),D(V.xAxis)){let n=V.xAxis.min,r=V.xAxis.max;if(e.length===1)t=[[`${n}`,e[0]]];else{let i=(r-n)/(e.length-1);t=e.map((e,t)=>[`${n+t*i}`,e])}}return t}e(Q,`transformDataWithoutCategory`);function $(e){return H[e===0?0:e%H.length]}e($,`getPlotColorFromPalette`);function _e(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?J(e.label):``),i=Q(n),a=r.some(e=>e!==``);V.plots.push({type:`line`,title:J(e.text),strokeFill:$(L),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),L++}e(_e,`setLineData`);function ve(e,t){let n=Q(t.map(e=>e.value));V.plots.push({type:`bar`,title:J(e.text),fill:$(L),data:n}),L++}e(ve,`setBarData`);function ye(){if(V.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return V.title=d(),de.build(z,V,B,R)}e(ye,`getDrawableElem`);function be(){return B}e(be,`getChartThemeConfig`);function xe(){return z}e(xe,`getChartConfig`);function Se(){return V}e(Se,`getXYChartData`);var Ce={parser:w,db:{getDrawableElem:ye,clear:e(function(){o(),L=0,z=K(),V=q(),B=G(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r,setOrientation:fe,setXAxisTitle:pe,setXAxisRangeData:X,setXAxisBand:me,setYAxisTitle:he,setYAxisRangeData:Z,setLineData:_e,setBarData:ve,setTmpSVGG:Y,getChartThemeConfig:be,getChartConfig:xe,getXYChartData:Se},renderer:{draw:e((n,r,i,a)=>{let o=a.db,s=o.getChartThemeConfig(),l=o.getChartConfig(),u=o.getXYChartData().plots[0].data.map(e=>e[1]);function d(e){return e===`top`?`text-before-edge`:`middle`}e(d,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}e(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}e(p,`getTextTransformation`),t.debug(`Rendering xychart chart
7
7
  `+n);let m=b(r),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,l.width).attr(`height`,l.height).attr(`class`,`background`);c(m,l.height,l.width,!0),m.attr(`viewBox`,`0 0 ${l.width} ${l.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let _=o.getDrawableElem(),v={};function y(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&v[n]&&(i=v[n]),n+=e[r],t=v[n],t||=v[n]=i.append(`g`).attr(`class`,e[r])}return t}e(y,`getGroup`);for(let t of _){if(t.data.length===0)continue;let n=y(t.groupTexts);switch(t.type){case`rect`:if(n.selectAll(`rect`).data(t.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),l.showDataLabel){let r=l.showDataLabelOutsideBar;if(l.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};e(i,`fitsHorizontally`);let a=.7,o=10,c=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),l=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...l)),f=e(e=>r?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);n.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,r?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};e(i,`fitsInBar`);let a=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),l=e(e=>r?e.data.y-10:e.data.y+10,`determineLabelYPosition`);n.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,l).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:n.selectAll(`text`).data(t.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>d(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:n.selectAll(`path`).data(t.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth)}}},`draw`)}};export{Ce as diagram};
8
- //# sourceMappingURL=xychartDiagram-S5SC5T6Z-CNBL0I4g.js.map
8
+ //# sourceMappingURL=xychartDiagram-S5SC5T6Z-wdjDjsiQ.js.map
@@ -384,7 +384,7 @@
384
384
  </script>
385
385
  <style>html,body,#root{width:100%;height:100%;margin:0}body{color:#262626;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif}html.dark body{color:#f5f5f5;background:#0a0a0a}#boot-shell{background:inherit;min-height:100%;color:inherit;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}html[data-theme-selected=true] #boot-shell{background:var(--boot-background);color:var(--boot-foreground)}#boot-shell-card{z-index:1;justify-content:center;align-items:center;width:96px;height:96px;display:flex;position:relative}#boot-shell-logo{object-fit:contain;width:64px;height:64px}#boot-error{text-align:center;justify-items:center;gap:16px;max-width:600px;padding:24px;display:grid}#boot-error p{overflow-wrap:anywhere;margin:0}#boot-error button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:8px 16px}</style>
386
386
  <title>P4 Code</title>
387
- <script type="module" crossorigin src="/assets/index-DT3GBOff.js"></script>
387
+ <script type="module" crossorigin src="/assets/index-DW7vuxv_.js"></script>
388
388
  </head>
389
389
  <body>
390
390
  <div id="root">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p4code/cli",
3
- "version": "0.8.27",
3
+ "version": "0.8.28",
4
4
  "description": "P4 Code coding agent server and command-line client",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,BE as r,Cd as i,HT as a,T_ as o,Zd as s,ah as c,bd as l,c_ as u,ib as d,l as f,lr as p,mE as m,s_ as h,sh as g,t as _}from"./utils-B0w8dSf5.js";import{R as v,W as y}from"./runtime-D2c--mqA.js";import{C as b,O as x,S as ee,f as te,q as S}from"./useSettings-u7ZNp27u.js";import{f as C}from"./server-DZYI6rhH.js";import{i as w,n as ne}from"./session-DhEZhn9K.js";import{n as re}from"./query-DrtB5w10.js";import{t as T}from"./use-atom-command-DrwAZaSK.js";import{n as E,t as D}from"./radio-group-D5b1YnNe.js";import{t as ie}from"./input-CDBTiBJx.js";import{a as ae,c as O,i as oe,r as se,s as ce,t as le}from"./dialog-Bdi4gsq5.js";import{x as k}from"./Icons-bbJxtd49.js";import{t as ue}from"./preview-DL8QWLgw.js";import{S as A,t as de}from"./ChatGptUsageButton-C5QxZxAY.js";import{a as j}from"./settingsLayout-C1Jfxbij.js";import{Ci as M,Si as fe,aa as N,ca as pe,da as me,lr as P,oa as he,sa as F,ua as I}from"./main-CSxSeVCm.js";var L=e(t(),1),R=r(),z=e(m(),1);function B(e){let t=(0,R.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,z.jsx)(k,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,z.jsxs)(p,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function ge(e){let t=(0,R.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(ve),[s,c]=(0,L.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=le,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=ce,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,z.jsxs)(ae,{children:[(0,z.jsx)(O,{children:`Reconnect ChatGPT`}),(0,z.jsx)(se,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(_e),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,z.jsx)(D,{value:`chatgpt-change-account`}),(0,z.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,z.jsx)(`div`,{className:`px-6 pb-6`,children:(0,z.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,z.jsx)(oe,{children:(0,z.jsx)(B,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,z.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,z.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function _e(e){return(0,z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,z.jsx)(D,{value:e.id}),(0,z.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function ve(e){return e.id.startsWith(`chatgpt-profile:`)}function ye(e){let t=(0,R.c)(36),{environmentId:r,onClose:i,renderSetup:a,onAccountCreated:s}=e,c=w(r,o),l=te(r),d;t[0]===r?d=t[1]:(d=C.providersValueAtom(r),t[0]=r,t[1]=d);let m=n(d),g=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,L.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,ee]=(0,L.useState)(null),[S,re]=(0,L.useState)(!1),E=m?.find(e=>e.instanceId===x),D=A(E),ae=(0,L.useEffectEvent)(i);(0,L.useEffect)(()=>{D&&ae()},[D]);let O;t[4]!==b||t[5]!==r||t[6]!==_||t[7]!==s||t[8]!==i||t[9]!==S||t[10]!==l||t[11]!==g?(O=async()=>{if(S||!_.trim()||!ne(r,`providers:manage`))return;re(!0);let e=u.make(`codex_${f()}`);(await g({environmentId:r,input:{patch:{providerInstances:{...l.providerInstances,[e]:{driver:h.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(s?(s(e,b),i()):ee(e)),re(!1)},t[4]=b,t[5]=r,t[6]=_,t[7]=s,t[8]=i,t[9]=S,t[10]=l,t[11]=g,t[12]=O):O=t[12];let oe=O,se=le,ce=!D,k;t[13]===i?k=t[14]:(k=e=>{e||i()},t[13]=i,t[14]=k);let ue=pe,de=x?b:`Add ChatGPT account`,M;t[15]===de?M=t[16]:(M=(0,z.jsx)(he,{title:de,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[15]=de,t[16]=M);let fe=F,me=x?E?.setup?a(x,E):(0,z.jsx)(j,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,z.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),oe()},children:(0,z.jsx)(j,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,z.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),P;t[17]!==fe||t[18]!==me?(P=(0,z.jsx)(fe,{children:me}),t[17]=fe,t[18]=me,t[19]=P):P=t[19];let I;t[20]!==c||t[21]!==x||t[22]!==_||t[23]!==i||t[24]!==S?(I=(0,z.jsx)(N,{children:x?(0,z.jsx)(p,{variant:`outline`,onClick:i,children:`Finish later`}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(p,{variant:`outline`,disabled:S,onClick:i,children:`Cancel`}),(0,z.jsx)(p,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!c,children:S?`Adding account…`:`Continue`})]})}),t[20]=c,t[21]=x,t[22]=_,t[23]=i,t[24]=S,t[25]=I):I=t[25];let B;t[26]!==ue||t[27]!==P||t[28]!==I||t[29]!==M?(B=(0,z.jsxs)(ue,{size:`wide`,children:[M,P,I]}),t[26]=ue,t[27]=P,t[28]=I,t[29]=M,t[30]=B):B=t[30];let ge;return t[31]!==se||t[32]!==B||t[33]!==ce||t[34]!==k?(ge=(0,z.jsx)(se,{open:ce,onOpenChange:k,children:B}),t[31]=se,t[32]=B,t[33]=ce,t[34]=k,t[35]=ge):ge=t[35],ge}var be=d(c),xe=d(g),Se=/^[A-Za-z0-9_./:\\-]+$/;function Ce(e,t,n){return Se.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function we(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var V={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function H(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||V[we(n)]>V[we(e)])&&t.set(n.driver,n)}return t}var Te={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Ee(e,t){let n=Te[e];return t===`windows`?n.windows:n.posix}function De(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=be(r?.config??{});return`${Ce(a(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=xe(r?.config??{});return`${Ce(a(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var Oe={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function U(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function ke(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var Ae={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function je(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=ke(n)??t.recommendedRange;return{title:Ae[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=ke(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var Me=()=>void 0;function Ne(e){let t=(0,R.c)(11),[n,r]=(0,L.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=we(e.provider),t[0]=e.provider,t[1]=i);let a=i,o=e.enabled&&a===`ready`,s=e.provider?.auth.status===`authenticated`,c=a===`checking`,u;t[2]===e.provider?u=t[3]:(u=U(e.provider),t[2]=e.provider,t[3]=u);let d=u,f;return t[4]!==s||t[5]!==c||t[6]!==o||t[7]!==d||t[8]!==e||t[9]!==n?(f=e.mode===`existing`&&e.presentation===`onboarding`?(0,z.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:o?e.provider?.auth.email?.trim()?(0,z.jsxs)(z.Fragment,{children:[`Signed in as`,` `,(0,z.jsx)(P,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:c?`Checking your Codex CLI...`:e.provider?.installed?d.headline:`Code with your ChatGPT subscription.`,control:o?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,z.jsx)(l,{className:`size-3.5`}),`Ready`]}):c?(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):s?(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d.headline}):(0,z.jsx)(B,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!s&&!o&&!c?(0,z.jsx)(p,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,z.jsx)(Le,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,z.jsx)(Ie,{}),control:(0,z.jsx)(p,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,z.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,z.jsx)(j,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,z.jsx)(Fe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=s,t[5]=c,t[6]=o,t[7]=d,t[8]=e,t[9]=n,t[10]=f):f=t[10],f}function Pe(e){let t=(0,R.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,o),s;t[0]!==a||t[1]!==n||t[2]!==r?(s=(e,t)=>(0,z.jsx)(Fe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:Me,onModeChange:Me,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=s):s=t[3];let c;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==s?(c=(0,z.jsx)(ye,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:s}),t[4]=n,t[5]=i,t[6]=r,t[7]=s,t[8]=c):c=t[8],c}function Fe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:a,autoStart:o,onAutoStartConsumed:c,allowExistingCli:u=!0,presentation:d,displayName:f,onSignInCancelled:m}){let h={environmentId:e,input:{instanceId:t}},g=re(C.providerAuthState(h)),te=re(C.providerInstallState(h)),[w,ne]=(0,L.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:g.data,[ae,O]=(0,L.useState)(!1),[oe,se]=(0,L.useState)(`chatgpt`),ce=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,le=D?.methods?.find(e=>e.id===oe)?.accountEmail,k=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),A=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,N=te.data,pe=b(e),he=pe!==null&&ue(new URL(pe).hostname),F={reportFailure:!1,reportDefect:!1},R=T(C.startProviderAuth,F),_e=T(C.refreshProviders,F),ve=T(C.completeProviderAuth,F),ye=T(C.cancelProviderAuth,F),be=T(C.logoutProviderAuth,F),xe=T(C.startProviderInstall,F),Se=T(C.cancelProviderInstall,F),Ce=T(C.chatGptReconnectProfile,F),we=T(C.chatGptImportProfile,F),V=!w&&(!he||window.desktopBridge?.receiveProviderAuthCallback!==void 0),H=V&&!window.desktopBridge?.receiveProviderAuthCallback,Te=x(),Ee=ee(Te),De=b(Te),Oe=!he&&Te&&Ee?.connection.phase===`connected`&&De&&ue(new URL(De).hostname)&&(window.desktopBridge!==void 0||ue(window.location.hostname))?Te:null,U=new URL(window.location.href);U.pathname===`/welcome`&&(U.hash=`agents:${e}`),U.pathname===`/settings/providers`&&U.searchParams.set(`instanceId`,t);let ke=H,Ae=(0,L.useId)(),[je,Me]=(0,L.useState)(!1),[Ne,Pe]=(0,L.useState)({flowId:``,value:``}),Fe=Ne.flowId===D?.flowId?Ne.value:``,[W,Re]=(0,L.useState)(!1),[ze,Be]=(0,L.useState)(null),Ve=(0,L.useRef)(!1),[He,Ue]=(0,L.useState)(null),G=(0,L.useRef)(null),We=(0,L.useRef)(!1),Ge=(0,L.useRef)(null),[Ke,qe]=(0,L.useState)(!1),K=N?.installedVersion!=null,q=n?.auth.status===`authenticated`,Je=K&&N?.source!==`local`&&N?.version!=null&&N.version!==N.installedVersion,Ye=ze!==null&&!q&&(D?.phase===`succeeded`||ze===`handoff`);(0,L.useEffect)(()=>{(q||D?.phase===`failed`||D?.phase===`cancelled`)&&Be(null)},[q,D?.phase]),(0,L.useEffect)(()=>{ze&&D?.phase===`succeeded`&&_e({environmentId:e,input:{instanceId:t}})},[ze,D?.phase,_e,e,t]);let Xe=o&&!Ke,Ze=ze===`sign-in`&&!q&&(D===null||D.phase===`idle`),Qe=Ye||Ze||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,J=N?.phase===`downloading`||N?.phase===`extracting`||N?.phase===`verifying`,Y=Xe||Qe||W&&!J,X=i||!r||W||g.error!==null||te.error!==null,Z=W||Qe||J,Q=(0,L.useCallback)(async(e,t)=>{if(Ve.current)return!1;Ve.current=!0,Re(!0),Ue(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!v(r)){let e=y(r);Ue(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{Ue(`Codex setup failed. Try again.`)}return Ve.current=!1,Re(!1),n},[]),$e=(0,L.useId)(),et=(0,L.useRef)(0),tt=(0,L.useRef)(null),[nt,rt]=(0,L.useState)(!1),it=(0,L.useCallback)(async n=>{let r=await Q(()=>we({environmentId:e,input:{instanceId:t,profile:n}}));r&&(Be(`handoff`),ne(null)),rt(!r)},[Q,we,e,t]);(0,L.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;tt.current!==e&&(tt.current=e,it(E.data.profile))},[w,E.data,it]),(0,L.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(Ue(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let at=(0,L.useCallback)(()=>(Be(null),w?(ne(null),Promise.resolve()):Q(()=>ye({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,Q,ye,e,t,D]),ot=(0,L.useCallback)(async(n=`chatgpt`)=>{if(Ve.current)return;We.current=!0,rt(!1),se(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),Oe){let i=`${$e}:${++et.current}`;await Q(()=>Ce({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:Oe,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(We.current=!1);return}await Q(()=>R({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:V?`client`:`server`}}),()=>Be(`sign-in`))||(We.current=!1)},[e,t,Q,R,V,Oe,Ce,$e]),$=(0,L.useCallback)(async(n=`chatgpt`)=>{X||Z||(K&&!Je?await ot(n):(G.current=n,await Q(()=>xe({environmentId:e,input:{instanceId:t}}))||(G.current=null)))},[X,Z,K,Je,ot,Q,xe,e,t]);(0,L.useEffect)(()=>{!o||Ke||X||Z||N===null||!n?.setup?.canInstall||(qe(!0),c(),$())},[o,Ke,X,Z,N,n?.setup?.canInstall,c,$]),(0,L.useEffect)(()=>{if(!(!G.current||W||J)){if(N?.phase===`failed`||N?.phase===`cancelled`)G.current=null;else if(K){let e=G.current;G.current=null,ot(e)}}},[W,J,N?.phase,K,ot]);let st=(0,L.useRef)(null),ct=D?.flowId,lt=(0,L.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&V&&ct){if(st.current===n){await S().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await Q(()=>ve({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await S().shell.openExternal(n)}catch{Ue(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[V,ct,Q,ve,e,t]);(0,L.useEffect)(()=>{if(V&&A&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===A&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(A).catch(()=>void 0)}},[V,A]),(0,L.useEffect)(()=>{We.current&&D?.phase===`waiting`&&D.flowId&&A&&Ge.current!==D.flowId&&(Ge.current=D.flowId,We.current=!1,H||lt(A))},[D?.phase,D?.flowId,A,lt,H]);let ut=N?.phase===`downloading`?`Downloading ${(N.downloadedBytes/1e6).toFixed(1)}${N.totalBytes===null?``:` of ${(N.totalBytes/1e6).toFixed(1)}`} MB.`:N?.phase===`extracting`?`Installing Codex.`:N?.phase===`verifying`?`Checking Codex.`:K?`${N?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${N?.installedVersion?` · v${N.installedVersion}`:``}.`:N?.message??`P4 Code downloads and manages Codex for you.`,dt=Ye?`Finishing sign-in...`:J?ut:Y||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&le?`Continue as ${le} on OpenAI.`:D?.message??`Finish signing in in your browser.`:q?n?.auth.email?.trim()?(0,z.jsxs)(z.Fragment,{children:[`Signed in as`,` `,(0,z.jsx)(P,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:ce??`Use your ChatGPT subscription.`,ft=ke&&A&&D?.flowId&&M(U.toString())?fe({authorizationUrl:A,returnUrl:U.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,z.jsx)(p,{size:`sm`,variant:H?`default`:`outline`,className:d===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?W||!nt:!A||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?it(E.data.profile):A&&lt(A)},children:Ye?`Finishing sign-in...`:E.data?.phase===`finished`?nt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?H?`Open ChatGPT sign-in`:`Open sign-in page`:d===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&A?(0,z.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,z.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,z.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Fe.trim())return;let r=Fe.trim(),i=D.flowId;Q(()=>ve({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Pe({flowId:i,value:``})})},children:[(0,z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Fe,maxLength:16384,disabled:W||i,onChange:e=>Pe({flowId:D.flowId??``,value:e.target.value})})}),(0,z.jsx)(p,{variant:`outline`,type:`submit`,disabled:W||i||!Fe.trim(),children:`Connect`})]}),H?null:(0,z.jsx)(`div`,{children:(0,z.jsxs)(p,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(A),children:[`Try sign-in in your browser`,(0,z.jsx)(s,{className:`size-3.5`})]})}),ft?(0,z.jsxs)(`details`,{children:[(0,z.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,z.jsx)(p,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,z.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,z.jsx)(I,{open:je,children:(0,z.jsx)(me,{children:(0,z.jsx)(`div`,{id:Ae,className:_(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=ke?mt:mt?(0,z.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,z.jsx)(Ie,{label:`Having trouble signing in?`,expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,z.jsx)(ge,{open:ae,methods:D?.methods??[],onClose:()=>O(!1),onSelect:e=>{O(!1),$(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(d===`onboarding`){let r=vt??He??(g.error||te.error?`Could not read setup status. Reconnect and try again.`:N?.phase===`failed`?N.message:null);return(0,z.jsxs)(z.Fragment,{children:[_t,(0,z.jsxs)(Le,{title:f||n?.displayName||`Codex`,description:J?ut:q?n?.auth.email?.trim()?(0,z.jsxs)(z.Fragment,{children:[`Signed in as`,` `,(0,z.jsx)(P,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!ke?(0,z.jsx)(Ie,{expanded:je,controls:Ae,onToggle:()=>Me(e=>!e)}):Xe||Ze||D?.phase===`starting`||D?.phase===`waiting`||W&&!J?(0,z.jsx)(Ie,{}):Y||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:q&&!Z?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,z.jsx)(l,{className:`size-3.5`}),`Ready`]}):Y?pt:(0,z.jsx)(B,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):$()},children:J||W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:Y&&!Ye||J?(0,z.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:W||i,onClick:()=>{We.current=!1,G.current=null,w||Y&&D?.flowId?at():N?.operationId&&Q(()=>Se({environmentId:e,input:{instanceId:t,operationId:N.operationId}}))},children:`Cancel`}):!Y&&!q&&k?(0,z.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):!Y&&!q&&u?(0,z.jsx)(p,{size:`sm`,variant:`ghost-muted`,disabled:i||Z,onClick:()=>a(`existing`),children:`Use existing CLI`}):null,children:[ke?gt:ht(),r?(0,z.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,z.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,z.jsx)(j,{title:`ChatGPT account`,description:dt,control:(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:Y?(0,z.jsxs)(z.Fragment,{children:[pt,!Ye&&(0,z.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{(w||D?.flowId)&&(We.current=!1,at(),m?.())},children:`Cancel`})]}):J?(0,z.jsx)(p,{size:`sm`,variant:`ghost`,disabled:W||i,onClick:()=>{N?.operationId&&(G.current=null,Q(()=>Se({environmentId:e,input:{instanceId:t,operationId:N.operationId}})))},children:`Cancel`}):q?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(p,{size:`sm`,variant:`outline`,disabled:X||Z,onClick:()=>O(!0),children:`Change account`}),(0,z.jsx)(p,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void Q(()=>be(h)),children:`Disconnect`})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(B,{size:`sm`,disabled:X||Z||(K?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{k?O(!0):$()},children:W?`Setting up...`:k?`Reconnect account`:`Continue with ChatGPT`}),k?(0,z.jsx)(p,{size:`sm`,variant:`ghost`,disabled:X||Z,onClick:()=>void $(`chatgpt-change-account`),children:`Use a different account`}):null]})})}),q?(0,z.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,z.jsx)(de,{})}):null,vt?(0,z.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,z.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,He||g.error||te.error||N?.phase===`failed`?(0,z.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:He??(N?.phase===`failed`?N.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function W(e){let t=(0,R.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,z.jsx)(j,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,z.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,z.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,z.jsx)(j,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,z.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,z.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,z.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,z.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,z.jsx)(j,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,z.jsxs)(z.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Ie(e){let t=(0,R.c)(10),{label:n,expanded:r,controls:a,onToggle:o}=e,s=n===void 0?`Complete sign-in in your browser.`:n,c=r!==void 0&&r;if(!o){let e;return t[0]===s?e=t[1]:(e=(0,z.jsx)(`div`,{className:`leading-relaxed`,children:s}),t[0]=s,t[1]=e),e}let l=`size-3 shrink-0 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,z.jsx)(i,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==o||t[8]!==u?(d=(0,z.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":c,"aria-controls":a,onClick:o,children:[s,u]}),t[4]=a,t[5]=c,t[6]=s,t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Le(e){let t=(0,R.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=L.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,z.jsx)(k,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,z.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,z.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,z.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,z.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Re(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{Oe as a,ke as c,De as d,H as f,Ne as i,we as l,Pe as n,U as o,B as p,W as r,je as s,Re as t,Ee as u};
2
- //# sourceMappingURL=CodexSetupSection.logic-452dIoYg.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,BE as r,Bp as i,D as a,Ho as o,Jm as s,Kn as c,Ko as l,Kp as u,Nf as d,Pf as f,Qs as p,Qu as m,Wo as h,Xn as g,Xo as _,Yn as v,Yp as y,Zd as b,Zn as x,Zu as S,_d as C,ar as w,cr as T,er as E,gp as D,kf as O,lr as k,mE as A,or as ee,pg as j,pp as te,qn as M,qu as N,rr as P,sr as F,t as ne,tr as I,w_ as L,yg as R,yp as re}from"./utils-B0w8dSf5.js";import{R as ie,W as z}from"./runtime-D2c--mqA.js";import{b as ae}from"./entities-CHcmKww2.js";import{ct as B}from"./ChatMarkdown-n-Pmpt9I.js";import{i as V}from"./toast-VoruYA6X.js";import{C as oe,O as se,S as H,q as U}from"./useSettings-u7ZNp27u.js";import{i as ce,n as le}from"./session-DhEZhn9K.js";import{t as W}from"./use-atom-command-DrwAZaSK.js";import{u as ue}from"./rightPanelStore-BLSD3K6s.js";import{n as G}from"./toastHelpers-Dsph6LwL.js";import{A as K,k as q}from"./PanelLayoutControls-BVds3zWp.js";import{o as de}from"./timestampFormat-wac2e_Jz.js";import{a as fe,n as pe,t as me}from"./tooltip-CuJiZzK7.js";import{a as he,o as ge,r as _e,t as ve}from"./empty-DeLw5x6B.js";import{n as ye,t as be}from"./discovery-list-CPLxz_C8.js";import{t as xe}from"./observeResize-3DufCT68.js";import{n as Se}from"./openFileInPreview-BX2EPx-W.js";import{T as Ce,a as we,b as Te,f as Ee,i as De,n as Oe,o as ke,r as Ae,t as je,u as Me,w as Ne}from"./browserHistoryStore-TYW6lOuv.js";import{t as Pe}from"./preview-CgesrIRi.js";import{n as Fe,r as Ie,t as Le}from"./preview-DL8QWLgw.js";import{Ca as Re,Di as ze,Ei as Be,Gi as J,Hi as Y,Ii as Ve,Li as He,Mi as Ue,Ni as We,Oi as Ge,Ri as X,Ti as Ke,Vi as qe,da as Je,ji as Ye,ua as Xe,wi as Ze}from"./main-CSxSeVCm.js";import{a as Qe,c as $e,d as et,f as tt,i as nt,l as rt,n as it,o as at,r as ot,s as st,u as ct}from"./_chat-Ca7FuMbD.js";var Z=e(t(),1),Q=r(),lt=`data:image/png;base64,`;function ut(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(lt))return{status:`failed`};let n=J(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(A(),1),dt=()=>{};function ft(e){let t=(0,Q.c)(79),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:o,inputDisabled:s,focusUrlNonce:c,onBack:l,onForward:u,onRefresh:d,onSubmit:f,onOpenInBrowser:p,onCapture:h,captureDisabled:g,recording:_,onSeparateWindow:v,separateWindow:y,separateWindowDisabled:x,onPickElement:w,pickActive:T,pickDisabled:E,pickDisabledReason:D,trailingActions:O,leadingActions:A}=e,ee=(0,Z.useRef)(null),[j,te]=(0,Z.useState)(n),[M,P]=(0,Z.useState)(!1),F,I;t[0]===c?(F=t[1],I=t[2]):(F=()=>{if(c==null)return;let e=ee.current;e&&e.focus()},I=[c],t[0]=c,t[1]=F,t[2]=I),(0,Z.useEffect)(F,I);let L;t[3]!==j||t[4]!==f?(L=e=>{e?.preventDefault();let t=j.trim();t.length!==0&&(f(t),ee.current?.blur())},t[3]=j,t[4]=f,t[5]=L):L=t[5];let R=L,ie=i?l:dt,z=!i,ae;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(S,{}),t[6]=ae):ae=t[6];let B;t[7]!==ie||t[8]!==z?(B=(0,$.jsx)(k,{variant:`ghost`,size:`icon-xs`,onClick:ie,disabled:z,"aria-label":`Back`,type:`button`,children:ae}),t[7]=ie,t[8]=z,t[9]=B):B=t[9];let V=a?u:dt,oe=!a,se;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(m,{}),t[10]=se):se=t[10];let H;t[11]!==V||t[12]!==oe?(H=(0,$.jsx)(k,{variant:`ghost`,size:`icon-xs`,onClick:V,disabled:oe,"aria-label":`Forward`,type:`button`,children:se}),t[11]=V,t[12]=oe,t[13]=H):H=t[13];let U;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`mx-0.5 h-4 w-px bg-border`}),t[14]=U):U=t[14];let ce=o?dt:d,le=r?`Stop`:`Refresh`,W;t[15]!==o||t[16]!==ce||t[17]!==le?(W=(0,$.jsx)(k,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:o,"aria-label":le,type:`button`}),t[15]=o,t[16]=ce,t[17]=le,t[18]=W):W=t[18];let ue;t[19]===r?ue=t[20]:(ue=(0,$.jsx)(Re,{refreshing:r}),t[19]=r,t[20]=ue);let G;t[21]!==W||t[22]!==ue?(G=(0,$.jsx)(fe,{render:W,children:ue}),t[21]=W,t[22]=ue,t[23]=G):G=t[23];let K=r?`Loading…`:`Refresh`,q;t[24]===K?q=t[25]:(q=(0,$.jsx)(pe,{children:K}),t[24]=K,t[25]=q);let de;t[26]!==G||t[27]!==q?(de=(0,$.jsxs)(me,{children:[G,q]}),t[26]=G,t[27]=q,t[28]=de):de=t[28];let he;t[29]!==H||t[30]!==de||t[31]!==B?(he=(0,$.jsxs)(`div`,{className:`surface-glass flex h-8 shrink-0 items-center gap-0.5 rounded-full border border-border/60 px-1 shadow-sm [&_button]:rounded-full`,role:`group`,"aria-label":`Navigation`,children:[B,H,U,de]}),t[29]=H,t[30]=de,t[31]=B,t[32]=he):he=t[32];let ge=M?j:n,_e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(_e=e=>te(e.target.value),t[33]=_e):_e=t[33];let ve;t[34]===n?ve=t[35]:(ve=()=>{te(n),P(!0),queueMicrotask(()=>ee.current?.select())},t[34]=n,t[35]=ve);let ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{P(!1)},t[36]=ye):ye=t[36];let be;t[37]!==R||t[38]!==n?(be=e=>{e.key===`Enter`&&R(e),e.key===`Escape`&&(e.preventDefault(),te(n),ee.current?.blur())},t[37]=R,t[38]=n,t[39]=be):be=t[39];let xe;t[40]!==s||t[41]!==ge||t[42]!==ve||t[43]!==be?(xe=(0,$.jsx)(`input`,{ref:ee,value:ge,onChange:_e,onFocus:ve,onBlur:ye,onKeyDown:be,"aria-label":`Address`,placeholder:`Search or enter URL`,spellCheck:!1,disabled:s,"data-preview-url-input":!0,className:`w-full min-w-0 truncate bg-transparent text-center text-sm text-foreground outline-none placeholder:text-muted-foreground focus:text-left`}),t[40]=s,t[41]=ge,t[42]=ve,t[43]=be,t[44]=xe):xe=t[44];let Se;t[45]!==M||t[46]!==p?(Se=p&&!M?(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-1 flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100 [&_button]:rounded-full`,children:(0,$.jsxs)(me,{children:[(0,$.jsx)(fe,{render:(0,$.jsx)(k,{variant:`ghost`,size:`icon-xs`,onClick:p,"aria-label":`Open in system browser`,type:`button`}),children:(0,$.jsx)(b,{})}),(0,$.jsx)(pe,{children:`Open in system browser`})]})}):null,t[45]=M,t[46]=p,t[47]=Se):Se=t[47];let Ce;t[48]!==xe||t[49]!==Se?(Ce=(0,$.jsxs)(`div`,{className:`surface-glass group/address relative flex h-8 min-w-0 flex-1 items-center rounded-full border border-border/60 px-8 shadow-sm transition-colors focus-within:border-ring has-disabled:opacity-64`,children:[xe,Se]}),t[48]=xe,t[49]=Se,t[50]=Ce):Ce=t[50];let we;t[51]!==w||t[52]!==T||t[53]!==E||t[54]!==D?(we=w?(0,$.jsxs)(me,{children:[(0,$.jsx)(fe,{render:(0,$.jsx)(k,{variant:`glass`,size:`icon`,onClick:w,disabled:E,"aria-label":T?`Cancel annotation`:`Annotate preview`,"aria-pressed":T?`true`:`false`,type:`button`}),children:(0,$.jsx)(re,{className:ne(T&&`text-primary`)})}),(0,$.jsx)(pe,{children:E&&D?D:T?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[51]=w,t[52]=T,t[53]=E,t[54]=D,t[55]=we):we=t[55];let Te;t[56]!==g||t[57]!==h||t[58]!==_?(Te=h?(0,$.jsxs)(me,{children:[(0,$.jsxs)(fe,{render:(0,$.jsx)(k,{variant:`glass`,size:`icon`,onClick:e=>h(e.shiftKey),"aria-label":_?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:g}),children:[(0,$.jsx)(C,{className:ne(_&&`text-destructive`)}),_?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(pe,{children:_?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[56]=g,t[57]=h,t[58]=_,t[59]=Te):Te=t[59];let Ee;t[60]!==v||t[61]!==y||t[62]!==x?(Ee=v?(0,$.jsxs)(me,{children:[(0,$.jsx)(fe,{render:(0,$.jsx)(k,{variant:`glass`,size:`icon`,onClick:v,"aria-label":y?`Bring preview back from its window`:`Open preview in a window`,"aria-pressed":y?`true`:`false`,type:`button`,disabled:x}),children:(0,$.jsx)(N,{className:ne(y&&`text-primary`)})}),(0,$.jsx)(pe,{children:y?`Bring back`:`Open in separate window`})]}):null,t[60]=v,t[61]=y,t[62]=x,t[63]=Ee):Ee=t[63];let De;t[64]!==A||t[65]!==R||t[66]!==he||t[67]!==Ce||t[68]!==we||t[69]!==Te||t[70]!==Ee||t[71]!==O?(De=(0,$.jsxs)(`form`,{onSubmit:R,className:`flex h-12 min-h-12 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-2.5 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[he,A,Ce,we,Te,Ee,O]}),t[64]=A,t[65]=R,t[66]=he,t[67]=Ce,t[68]=we,t[69]=Te,t[70]=Ee,t[71]=O,t[72]=De):De=t[72];let Oe;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={boxShadow:`0 0 6px 1px var(--color-ring)`},t[73]=Oe):Oe=t[73];let ke;t[74]===r?ke=t[75]:(ke=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Oe}),t[74]=r,t[75]=ke);let Ae;return t[76]!==De||t[77]!==ke?(Ae=(0,$.jsxs)(`div`,{className:`relative`,children:[De,ke]}),t[76]=De,t[77]=ke,t[78]=Ae):Ae=t[78],Ae}function pt(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=mt(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(q,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(ye,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function mt(e){return e.processName?e.processName:`Listening`}function ht(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let c=o,l=c.pathname===`/`?``:c.pathname,u=`${c.host}${l}${c.search}${c.hash}`,d;t[2]===r.lastVisitedAt?d=t[3]:(d=je(r.lastVisitedAt)?de(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=d);let f=d;st();let p;t[4]!==r.url||t[5]!==n?(p=(0,$.jsx)(q,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=p):p=t[6];let m=r.title??u,h;t[7]===m?h=t[8]:(h=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:m}),t[7]=m,t[8]=h);let g=r.title?`${u} · `:``,_;t[9]!==g||t[10]!==f?(_=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[g,f]}),t[9]=g,t[10]=f,t[11]=_):_=t[11];let v;t[12]!==h||t[13]!==_?(v=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[h,_]}),t[12]=h,t[13]=_,t[14]=v):v=t[14];let y;t[15]!==i||t[16]!==p||t[17]!==v?(y=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[p,v]}),t[15]=i,t[16]=p,t[17]=v,t[18]=y):y=t[18];let b=`Remove ${u} from history`,x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(s,{className:`size-3.5`}),t[19]=x):x=t[19];let S;t[20]!==a||t[21]!==b?(S=(0,$.jsx)(`button`,{type:`button`,"aria-label":b,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:x}),t[20]=a,t[21]=b,t[22]=S):S=t[22];let C;return t[23]!==S||t[24]!==y?(C=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[y,S]}),t[23]=S,t[24]=y,t[25]=C):C=t[25],C}function gt(e){let t=(0,Q.c)(7),n=X(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:ke(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=_t({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function _t(e){let t=new Map;for(let n of e.configuredUrls){let e=yt(n);if(!e)continue;let r=vt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=vt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function vt(e,t){let n=e.toLowerCase();return`${Le(n)?`loopback`:n}:${t}`}function yt(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!Le(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function bt(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=gt(c),d,p,m,h;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(xt).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(ve,{children:[(0,$.jsx)(he,{variant:`icon`,children:(0,$.jsx)(O,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(ge,{children:`No preview yet`}),(0,$.jsx)(_e,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],h=e;break bb0}m=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,d=`mx-auto flex w-full max-w-xl flex-col gap-6`,p=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(f,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(be,{children:e.map(e=>(0,$.jsx)(ht,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=d,t[9]=p,t[10]=m,t[11]=h}else d=t[8],p=t[9],m=t[10],h=t[11];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;t[13]!==s||t[14]!==l||t[15]!==n?(g=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(u,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(be,{children:l.map(e=>(0,$.jsx)(pt,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=g):g=t[16];let _;t[17]!==d||t[18]!==p||t[19]!==g?(_=(0,$.jsxs)(`div`,{className:d,children:[p,g]}),t[17]=d,t[18]=p,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==m||t[22]!==_?(v=(0,$.jsx)(`div`,{className:m,children:_}),t[21]=m,t[22]=_,t[23]=v):v=t[23],v}function xt(e){return URL.canParse(e.url)}var St=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Ct=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(me,{children:[(0,$.jsx)(fe,{render:(0,$.jsx)(T,{render:(0,$.jsx)(k,{variant:`glass`,size:`icon`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(D,{})}),(0,$.jsx)(pe,{children:`More`})]}),e[0]=t):t=e[0],t};function wt(e){let t=(0,Q.c)(69),{enabled:r,actions:a,zoomFactor:o,colorScheme:s,deviceToolbarVisible:c,onToggleDeviceToolbar:l,profileName:u,move:d}=e,f;t[0]===o?f=t[1]:(f=Math.round(o*100),t[0]=o,t[1]=f);let p=`${f}%`,m=!r,h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Ct,{}),t[2]=h):h=t[2];let _;t[3]!==a.hardReload||t[4]!==m?(_=(0,$.jsx)(x,{onClick:a.hardReload,disabled:m,children:`Hard reload`}),t[3]=a.hardReload,t[4]=m,t[5]=_):_=t[5];let b;t[6]!==a.openDevTools||t[7]!==m?(b=a.openDevTools?(0,$.jsx)(x,{onClick:a.openDevTools,disabled:m,children:`Open DevTools`}):null,t[6]=a.openDevTools,t[7]=m,t[8]=b):b=t[8];let S;t[9]===d?S=t[10]:(S=d?(0,$.jsx)(x,{onClick:d.onMove,children:d.label}):null,t[9]=d,t[10]=S);let C=c?`Hide device toolbar`:`Show device toolbar`,T;t[11]!==m||t[12]!==l||t[13]!==C?(T=(0,$.jsx)(x,{onClick:l,disabled:m,children:C}),t[11]=m,t[12]=l,t[13]=C,t[14]=T):T=t[14];let D;t[15]===m?D=t[16]:(D=(0,$.jsx)(F,{disabled:m,children:`Appearance`}),t[15]=m,t[16]=D);let O;t[17]===a?O=t[18]:(O=e=>a.setColorScheme(e),t[17]=a,t[18]=O);let A;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(A=St.map(Et),t[19]=A):A=t[19];let j;t[20]!==s||t[21]!==O?(j=(0,$.jsx)(ee,{children:(0,$.jsx)(E,{value:s,onValueChange:O,children:A})}),t[20]=s,t[21]=O,t[22]=j):j=t[22];let N;t[23]!==j||t[24]!==D?(N=(0,$.jsxs)(w,{children:[D,j]}),t[23]=j,t[24]=D,t[25]=N):N=t[25];let ne;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(P,{}),t[26]=ne):ne=t[26];let I;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(`span`,{children:`Zoom`}),t[27]=I):I=t[27];let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(te,{}),t[28]=L):L=t[28];let R;t[29]!==a.zoomOut||t[30]!==m?(R=(0,$.jsx)(k,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:a.zoomOut,"aria-label":`Zoom out`,disabled:m,children:L}),t[29]=a.zoomOut,t[30]=m,t[31]=R):R=t[31];let re;t[32]===p?re=t[33]:(re=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:p}),t[32]=p,t[33]=re);let ie;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(i,{}),t[34]=ie):ie=t[34];let z;t[35]!==a.zoomIn||t[36]!==m?(z=(0,$.jsx)(k,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:a.zoomIn,"aria-label":`Zoom in`,disabled:m,children:ie}),t[35]=a.zoomIn,t[36]=m,t[37]=z):z=t[37];let ae;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(y,{}),t[38]=ae):ae=t[38];let B;t[39]!==a.resetZoom||t[40]!==m?(B=(0,$.jsx)(k,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:a.resetZoom,"aria-label":`Reset zoom`,disabled:m,children:ae}),t[39]=a.resetZoom,t[40]=m,t[41]=B):B=t[41];let V;t[42]!==R||t[43]!==re||t[44]!==z||t[45]!==B?(V=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[R,re,z,B]}),t[42]=R,t[43]=re,t[44]=z,t[45]=B,t[46]=V):V=t[46];let oe;t[47]!==m||t[48]!==V?(oe=(0,$.jsxs)(x,{closeOnClick:!1,onClick:Tt,className:`justify-between`,disabled:m,children:[I,V]}),t[47]=m,t[48]=V,t[49]=oe):oe=t[49];let se;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(P,{}),t[50]=se):se=t[50];let H;t[51]===u?H=t[52]:(H=u?(0,$.jsx)(g,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,u]})}):null,t[51]=u,t[52]=H);let U;t[53]===a.clearCookies?U=t[54]:(U=(0,$.jsx)(x,{onClick:a.clearCookies,children:`Clear cookies`}),t[53]=a.clearCookies,t[54]=U);let ce;t[55]===a.clearCache?ce=t[56]:(ce=(0,$.jsx)(x,{onClick:a.clearCache,children:`Clear cache`}),t[55]=a.clearCache,t[56]=ce);let le;t[57]!==H||t[58]!==U||t[59]!==ce?(le=(0,$.jsxs)(v,{children:[H,U,ce]}),t[57]=H,t[58]=U,t[59]=ce,t[60]=le):le=t[60];let W;return t[61]!==N||t[62]!==oe||t[63]!==le||t[64]!==_||t[65]!==b||t[66]!==S||t[67]!==T?(W=(0,$.jsxs)(M,{children:[h,(0,$.jsxs)(n,{align:`end`,sideOffset:6,children:[_,b,S,T,N,ne,oe,se,le]})]}),t[61]=N,t[62]=oe,t[63]=le,t[64]=_,t[65]=b,t[66]=S,t[67]=T,t[68]=W):W=t[68],W}function Tt(e){return e.preventDefault()}function Et(e){return(0,$.jsx)(I,{value:e.value,children:e.label},e.value)}function Dt(e){return _[e]||(e.length>0?e:`Network error`)}function Ot(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Mt(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(jt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(k,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function kt(e){let t=(0,Q.c)(44),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Mt(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=Dt(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(jt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),t[14]=y):y=t[14];let b,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`li`,{children:`Checking your connection`}),b=(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),t[15]=b,t[16]=x):(b=t[15],x=t[16]);let S;t[17]===o?S=t[18]:(S=o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,t[17]=o,t[18]=S);let C;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`}),t[19]=C):C=t[19];let w;t[20]===S?w=t[21]:(w=(0,$.jsx)(Je,{children:(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[y,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[x,b,S,C]})]})}),t[20]=S,t[21]=w);let T;t[22]!==s||t[23]!==w?(T=(0,$.jsx)(Xe,{open:s,children:w}),t[22]=s,t[23]=w,t[24]=T):T=t[24];let E;t[25]===m?E=t[26]:(E=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[25]=m,t[26]=E);let D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>c(At),t[27]=D):D=t[27];let O=s?`Hide details`:`Details`,A;t[28]===O?A=t[29]:(A=(0,$.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:D,children:O}),t[28]=O,t[29]=A);let ee;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(`div`,{className:`flex-1`}),t[30]=ee):ee=t[30];let j;t[31]===o?j=t[32]:(j=o?(0,$.jsx)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[31]=o,t[32]=j);let te;t[33]===a?te=t[34]:(te=(0,$.jsx)(k,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[33]=a,t[34]=te);let M;t[35]!==A||t[36]!==j||t[37]!==te?(M=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[A,ee,j,te]}),t[35]=A,t[36]=j,t[37]=te,t[38]=M):M=t[38];let N;return t[39]!==T||t[40]!==E||t[41]!==M||t[42]!==v?(N=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,T,E,M]})}),t[39]=T,t[40]=E,t[41]=M,t[42]=v,t[43]=N):N=t[43],N}function At(e){return!e}function jt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Mt(e){try{return new URL(e).host}catch{return null}}var Nt=1500,Pt=.001;function Ft(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Pt))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},Nt),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=ne(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function It(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var Lt=typeof window>`u`?null:U();function Rt(e){let t=(0,Q.c)(12),n=et(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?tt({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void Lt?.shell.openExternal(e.url).catch(zt),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(Ot,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function zt(){}function Bt({threadRef:e,tabId:t,configuredUrls:n,visible:r,onSendAnnotation:i}){let[s,u]=(0,Z.useState)(void 0),[f,m]=(0,Z.useState)(!1),g=ce(e.environmentId,`orchestration:operate`)&&!!i,_=Ge(),v=(0,Z.useRef)(null),y=(0,Z.useRef)(!0),b=(0,Z.useRef)(e);b.current=e;let x=l(e),S=we(e,50),C=a(e=>e.addPreviewAnnotation),w=a(e=>e.addImage),T=oe(e.environmentId),E=T?new URL(T).hostname:null,D=W(Pe.open),O=W(Pe.close,`preview close`),A=H(e.environmentId)?.label??`the environment`,ee=se(),te=ae(e.environmentId),M=W(Pe.resize,`preview viewport resize`),N=W(Pe.adjust,`preview appearance or zoom`);it(e),(0,Z.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]);let P=t??x.activeTabId,F=P?Ue(e,x.serverEpoch,P):null,I=P&&F?_.has(F)?F:Ze(e,P):null,L=P?x.sessions[P]??null:null,re=Ce(e.environmentId,L),U=L?.runtime===`server`&&!re,K=L?.runtime===`server`,q=(0,Z.useRef)(null),[de,he]=(0,Z.useState)(!1),ge=(0,Z.useRef)(null),[_e,ve]=(0,Z.useState)(0),ye=L?.runtime===`server`&&(L.viewport??j)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=ge.current;if(e&&ye)return xe(e,([e])=>ve(Math.max(1,Math.round(e?.contentRect.width??0))))},[ye]);let[be,je]=(0,Z.useState)(null),Ne=U&&be!==F,[Le,Re]=(0,Z.useState)(null),J=P?x.desktopByTabId[P]??null:null,X=L?.navStatus??{_tag:`Idle`},Je=X._tag===`Idle`?``:X.url,Xe=J?.loading??X._tag===`Loading`,et=J?.canGoBack??L?.canGoBack??!1,tt=J?.canGoForward??L?.canGoForward??!1,st=X._tag===`Idle`,Q=X._tag===`LoadFailed`,lt=at(L),dt=U&&!lt&&!Q&&Le!==F,pt=J?.controller??`none`,mt=L?.viewport??j,ht=Ee(),gt=L?.profileId??`default`,_t=It(ht.profiles,gt),vt=Ye(e=>F?e.byTabId[F]?.rect??null:null),yt=X._tag===`Success`?X.url:null,xt=X._tag===`Success`?X.title:null,St=S[0]?.url,Ct=p(e);(0,Z.useEffect)(()=>{yt&&xt&&St&&De(b.current,yt,xt,E)},[E,St,xt,yt,Ct]);let Tt=(0,Z.useCallback)(async t=>{if(U&&q.current)return!Ne&&(q.current.navigate(t),o(e,t),!0);if(F&&Y)return await Y.navigate(F,t),o(e,t),!0;let n=await qe({openPreview:D,threadRef:e,url:t});if(n._tag===`Failure`&&!ie(n)){let e=z(n);e instanceof Se&&V.add({type:`error`,title:`Unable to open browser`,description:e.message})}return n._tag===`Success`},[U,D,F,Ne,e]),Et=(0,Z.useCallback)(async t=>{try{let n=Ie(t);await Tt(n)&&Oe(e,n)}catch{}},[Tt,e]),Dt=(0,Z.useCallback)(async t=>{try{let n=U||!Y?Fe(t):ke(e.environmentId,t);await Tt(n)&&Oe(e,t)}catch{}},[U,Tt,e]),Ot=(0,Z.useCallback)(()=>{U?q.current?.reload():Y&&F&&Y.refresh(F)},[U,F]),At=(0,Z.useCallback)(async t=>{if(!P)return;let n=await N({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:P,...t}});if(n._tag===`Failure`){let e=z(n);V.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}h(e,n.value)},[N,P,e]),jt=L?.zoomFactor??1,Mt=(0,Z.useCallback)(e=>{let t=R.indexOf(jt),n=e===0?1:R[Math.min(Math.max((t<0?7:t)+e,0),R.length-1)];n!==jt&&At({zoomFactor:n})},[At,jt]),Nt=(0,Z.useCallback)(()=>{K?Mt(1):Y&&F&&Y.zoomIn(F)},[F,K,Mt]),Pt=(0,Z.useCallback)(()=>{K?Mt(-1):Y&&F&&Y.zoomOut(F)},[F,K,Mt]),zt=(0,Z.useCallback)(()=>{K?Mt(0):Y&&F&&Y.resetZoom(F)},[F,K,Mt]),Bt=(0,Z.useCallback)(async t=>{if(!P)return;let n=await M({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:P,viewport:t}});if(n._tag===`Failure`){let e=z(n);throw V.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}h(e,n.value)},[M,P,e]),Vt=()=>{if(F){if(mt._tag!==`fill`){Ve(F,j).catch(()=>void 0);return}Ve(F,Me({defaults:ht,panelRect:vt,zoomFactor:K?jt:J?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(F)return He(F,Bt)},[Bt,F]);let Ht=(0,Z.useCallback)(()=>{U?q.current?.history(-1):Y&&F&&Y.goBack(F)},[U,F]),Ut=(0,Z.useCallback)(()=>{U?q.current?.history(1):Y&&F&&Y.goForward(F)},[U,F]),Wt=(0,Z.useCallback)(()=>{Lt&&Je&&Lt.shell.openExternal(Je).catch(()=>void 0)},[Je]),Gt=Te(e.environmentId,ee,te,L),Kt=Gt===`server`?`Open in ${A}'s browser`:`Open on this computer`,qt=(0,Z.useCallback)(async()=>{if(!Gt||!P||!L)return;let t=await qe({openPreview:D,threadRef:e,...Je?{url:Gt===`desktop`?ke(e.environmentId,Je):Je}:{},viewport:mt,...L.profileId===void 0?{}:{profileId:L.profileId},runtime:Gt});if(t._tag===`Failure`){if(ie(t))return;let e=z(t);V.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}ue.getState().openBrowser(e,t.value.tabId),await rt({closePreview:O,snapshot:L,tabId:P,threadRef:e})},[O,Gt,D,L,P,e,Je,mt]),Jt=e=>()=>{e&&F&&e(F).catch(()=>void 0)},Yt=K?{hardReload:()=>void At({hardReload:!0}),setColorScheme:e=>void At({colorScheme:e}),zoomIn:Nt,zoomOut:Pt,resetZoom:zt,clearCookies:()=>void At({clear:`cookies`}),clearCache:()=>void At({clear:`cache`}),...re&&Y?{openDevTools:Jt(Y.openDevTools)}:{}}:Y?{hardReload:Jt(Y.hardReload),setColorScheme:e=>{F&&Y?.setColorScheme(F,e).catch(()=>void 0)},zoomIn:Nt,zoomOut:Pt,resetZoom:zt,clearCookies:()=>void Y?.clearCookies(e.environmentId,gt).catch(()=>void 0),clearCache:()=>void Y?.clearCache(e.environmentId,gt).catch(()=>void 0),openDevTools:Jt(Y.openDevTools)}:null,Xt=(0,Z.useCallback)(()=>{Y&&F&&(J?.pictureInPicture?Y.pictureInPicture.close:Y.pictureInPicture.open)(F).catch(e=>{V.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[J?.pictureInPicture,F]),Zt=(0,Z.useCallback)(t=>{if(!Y||!F||!P)return;let n=Y;if(I){ze(I).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){V.update(r,G({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{V.update(r,G({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:B(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{V.update(r,G({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i},secondaryActionVariant:`outline`}}))};r=V.add(G({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{V.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){Be(F,e,P).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Ke(e)||V.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(F).then(e=>{let t={children:B(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{V.update(a,G({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=V.add(G({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},e=>{V.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[I,F,P,e]),Qt=(0,Z.useCallback)(()=>{if(!Y||!F)return;if(v.current){v.current.cancelled=!0,Y.cancelPickElement(F).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;v.current=n,m(!0),(async()=>{try{if(await Y.setAnnotationSendEnabled?.(F,!!i&&le(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await Y.pickElement(F);if(!t||n.cancelled)return;v.current===n&&(v.current=null,y.current&&m(!1),r=!0);let{annotation:a,submission:o,screenshotFailed:s=!1}=t,c=ut(a),l=s||c.status===`failed`,u=c.status===`failed`?{...a,screenshot:null}:a;C(e,u),l&&V.add(G({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=c.status===`captured`?c.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&w(e,f),o===`send`&&le(e.environmentId,`orchestration:operate`)&&i?.(u,f)}catch{}finally{let e=v.current===n;if(e&&(v.current=null,y.current&&m(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[w,C,i,F,e]);return(0,Z.useEffect)(()=>{f&&Y&&F&&Y.setAnnotationSendEnabled?.(F,g).catch(()=>void 0)},[g,f,F]),(0,Z.useEffect)(()=>()=>{v.current&&(v.current.cancelled=!0,v.current=null,Y&&F&&Y.cancelPickElement(F).catch(()=>void 0),y.current&&m(!1))},[F]),(0,Z.useEffect)(()=>{if(r)return ct(e=>{switch(e){case`refresh`:Ot();return;case`focus-url`:u(e=>(e??0)+1);return;case`zoom-in`:Nt();return;case`zoom-out`:Pt();return;case`reset-zoom`:zt();return;case`toggle-panel`:return}})},[Ot,zt,Nt,Pt,r]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":p(e),children:[(0,$.jsx)(ft,{url:Je,loading:Xe||dt,canGoBack:et&&!Ne,canGoForward:tt&&!Ne,refreshDisabled:st||Ne,inputDisabled:Ne,focusUrlNonce:s,onBack:Ht,onForward:Ut,onRefresh:Ot,onSubmit:e=>void Et(e),onOpenInBrowser:P?Wt:void 0,onCapture:Y&&P&&!U?Zt:void 0,captureDisabled:!J||Q||J.pictureInPicture,recording:I!==null,onSeparateWindow:Y&&P&&(!K||re)?Xt:void 0,separateWindow:J?.pictureInPicture??!1,separateWindowDisabled:F===null||!K&&!(J?.hasWebContents??!1),onPickElement:Y&&P&&!U?Qt:void 0,pickActive:f,pickDisabled:!P||Q,pickDisabledReason:Q?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:gt===ht.profileId?null:(0,$.jsxs)(me,{children:[gt===`incognito`?(0,$.jsx)(fe,{render:(0,$.jsx)(`span`,{role:`img`,"aria-label":_t,className:`flex shrink-0 text-muted-foreground`}),children:(0,$.jsx)(d,{className:`size-4`})}):(0,$.jsx)(fe,{render:(0,$.jsx)(c,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:_t})}),(0,$.jsx)(pe,{side:`top`,children:_t})]}),trailingActions:Yt?(0,$.jsx)(wt,{enabled:F!==null&&(K||(J?.hasWebContents??!1)),actions:Yt,...Gt?{move:{label:Kt,onMove:()=>void qt()}}:{},profileName:_t,zoomFactor:K?jt:J?.zoomFactor??1,colorScheme:K?L?.colorScheme??`system`:J?.colorScheme??`system`,deviceToolbarVisible:mt._tag!==`fill`,onToggleDeviceToolbar:Vt}):null}),(0,$.jsxs)(`div`,{ref:ge,className:`relative min-h-0 flex-1 overflow-hidden`,children:[F&&L&&U?(0,$.jsxs)($.Fragment,{children:[mt._tag!==`fill`&&!lt&&!Q?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(We,{setting:mt,width:_e,aspectRatio:de?mt.width/mt.height:null,onAspectRatioChange:e=>he(e!==null),onChange:e=>Ve(F,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:mt._tag===`fill`?0:38},children:(0,$.jsx)(ot,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:L.tabId,visible:r,onFirstFrame:()=>Re(F),onControl:e=>je(e?.controller===`you`?F:null),onPopup:t=>$e(e,t,`panel`),className:ne(`absolute inset-0 h-full w-full`,(lt||Q)&&`invisible`)},F)})]}):F&&L&&!lt?Y&&J?.pictureInPicture?(0,$.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-8 text-center`,children:[(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`Showing in a separate window.`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(k,{size:`sm`,variant:`outline`,onClick:Xt,children:`Bring back`}),(0,$.jsx)(k,{size:`sm`,variant:`ghost`,onClick:()=>void Y?.pictureInPicture.open(F),children:`Show window`})]})]}):Y?(0,$.jsx)(Qe,{tabId:F,visible:r&&!Q,className:`absolute inset-0 h-full w-full`},F):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,lt?(0,$.jsx)(bt,{threadRef:e,environmentId:e.environmentId,configuredUrls:n,recentEntries:S,onRemoveRecent:t=>Ae(e,t),onOpenUrl:e=>void Dt(e)}):null,L&&J?(0,$.jsx)(Ft,{zoomFactor:J.zoomFactor}):null,F&&J&&!lt&&!Q&&!_.has(F)?(0,$.jsx)(nt,{tabId:F,zoomFactor:J.zoomFactor,controller:pt}):null,X._tag===`LoadFailed`&&X.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Rt,{threadRef:e,tabId:L?.tabId??``,url:X.url,download:X.download})}):X._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(kt,{url:X.url,code:X.code,description:X.description,onReload:Ot,...Gt===`server`?{move:{label:Kt,onMove:()=>void qt()}}:{}})}):null]})]})}function Vt(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:a,visible:o,onSendAnnotation:s}=e,c=Ne(r.environmentId),l=ce(r.environmentId,L);if(!l||!c){let e=l?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(K,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let u;t[5]===i?u=t[6]:(u=i===void 0?{}:{tabId:i},t[5]=i,t[6]=u);let d;t[7]===s?d=t[8]:(d=s?{onSendAnnotation:s}:{},t[7]=s,t[8]=d);let f;t[9]!==a||t[10]!==u||t[11]!==d||t[12]!==r||t[13]!==o?(f=(0,$.jsx)(Bt,{threadRef:r,...u,configuredUrls:a,visible:o,...d}),t[9]=a,t[10]=u,t[11]=d,t[12]=r,t[13]=o,t[14]=f):f=t[14];let p;return t[15]!==n||t[16]!==f?(p=(0,$.jsx)(K,{mode:n,children:f}),t[15]=n,t[16]=f,t[17]=p):p=t[17],p}export{Vt as PreviewPanel};
2
- //# sourceMappingURL=PreviewPanel-Cj2fiJWr.js.map
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-DEiOK0ka.js";export{e as createArchitectureServices};
@@ -1,2 +0,0 @@
1
- import{at as e,it as t}from"./chunk-DU6HZSFF-DQeySev0.js";var n=(n,r)=>e.lang.round(t.parse(n)[r]);export{n as t};
2
- //# sourceMappingURL=channel-DI-bXazi.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-DQeySev0.js";import"./chunk-75Z2AOVW-jKPMvGhC.js";import"./chunk-PWAF6VOD-C1f1DGpf.js";import"./chunk-GMAD6QVW-DpPhOysA.js";import"./chunk-P2QGCYS3-Bg2pIwSk.js";import"./chunk-4HAMMTFA-BPAna-Wv.js";import"./chunk-GVQU2GXP-Ci4jKLcc.js";import"./chunk-OSK3NFVY-DfSRnLdf.js";import"./chunk-F27PBJKO-jWPdwF7M.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-CctNE5Wx.js";import"./chunk-L3NEJ4N5-C0YH77t5.js";import{i as t,n,r,t as i}from"./chunk-TICWLB2K-Cu6mah4v.js";import"./mermaid.core-Bx8b2pKm.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
2
- //# sourceMappingURL=classDiagram-ZZMXUADV-DrD0Oidb.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-DQeySev0.js";import"./chunk-75Z2AOVW-jKPMvGhC.js";import"./chunk-PWAF6VOD-C1f1DGpf.js";import"./chunk-GMAD6QVW-DpPhOysA.js";import"./chunk-P2QGCYS3-Bg2pIwSk.js";import"./chunk-4HAMMTFA-BPAna-Wv.js";import"./chunk-GVQU2GXP-Ci4jKLcc.js";import"./chunk-OSK3NFVY-DfSRnLdf.js";import"./chunk-F27PBJKO-jWPdwF7M.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-CctNE5Wx.js";import"./chunk-L3NEJ4N5-C0YH77t5.js";import{i as t,n,r,t as i}from"./chunk-TICWLB2K-Cu6mah4v.js";import"./mermaid.core-Bx8b2pKm.js";var a={parser:n,get db(){return new i},renderer:r,styles:t,init:e(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
2
- //# sourceMappingURL=classDiagram-v2-VYDZK3BY-DrD0Oidb.js.map
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{O as e}from"./mermaid-parser.core-DEiOK0ka.js";export{e as createEventModelingServices};
@@ -1 +0,0 @@
1
- import"./src-oBChb5qS.js";import"./chunk-DU6HZSFF-DQeySev0.js";import"./chunk-75Z2AOVW-jKPMvGhC.js";import"./chunk-PWAF6VOD-C1f1DGpf.js";import"./chunk-GMAD6QVW-DpPhOysA.js";import"./chunk-P2QGCYS3-Bg2pIwSk.js";import"./chunk-4HAMMTFA-BPAna-Wv.js";import"./chunk-GVQU2GXP-Ci4jKLcc.js";import"./chunk-OSK3NFVY-DfSRnLdf.js";import"./chunk-F27PBJKO-jWPdwF7M.js";import"./chunk-XXDRQBXY-BvKO0v-W.js";import"./chunk-POPQ4Y6H-CctNE5Wx.js";import"./chunk-L3NEJ4N5-C0YH77t5.js";import{n as e}from"./chunk-SHT3W25Y-xnpqecbr.js";import"./mermaid.core-Bx8b2pKm.js";export{e as diagram};