@p4code/cli 0.8.10 → 0.8.11

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 (215) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CqXltjbH.mjs → binCli-DY9l0jFs.mjs} +2 -2
  3. package/dist/client/.vite/manifest.json +1302 -1302
  4. package/dist/client/assets/{AuthSurfaceShell-kd42gI_H.js → AuthSurfaceShell-B_P0_qZ6.js} +2 -2
  5. package/dist/client/assets/{ChatGptUsageButton-CVZHYvIk.js → ChatGptUsageButton-fMcoYEDa.js} +2 -2
  6. package/dist/client/assets/{ChatMarkdown-CyAwyBCe.js → ChatMarkdown-B7b91JUl.js} +4 -4
  7. package/dist/client/assets/{CodexSetupSection.logic-Bg24iMBv.js → CodexSetupSection.logic-CeUTTu-x.js} +2 -2
  8. package/dist/client/assets/{CommandBlock-DfFKmmpW.js → CommandBlock-BI3ZCXsB.js} +2 -2
  9. package/dist/client/assets/{ComposerPromptEditor-BUr_9EhS.js → ComposerPromptEditor-BkRvKIiZ.js} +4 -4
  10. package/dist/client/assets/{DevicePanel-CEAHHS0L.js → DevicePanel-B_jOvmeL.js} +2 -2
  11. package/dist/client/assets/{DeviceSetup-BlB01a4k.js → DeviceSetup-BXjqCO_9.js} +2 -2
  12. package/dist/client/assets/{DiffCommentAnnotation-DJ5wq6nm.js → DiffCommentAnnotation-D_1Iw0oL.js} +2 -2
  13. package/dist/client/assets/{DiffFileTree-C5ZwieTz.js → DiffFileTree-D6386u9x.js} +2 -2
  14. package/dist/client/assets/{DiffPanel-deSBv-2a.js → DiffPanel-D6VVj6BF.js} +2 -2
  15. package/dist/client/assets/{DiffWorkerPoolProvider-B5VjaCIu.js → DiffWorkerPoolProvider-Cw5WeG1t.js} +2 -2
  16. package/dist/client/assets/{EmbeddedDesign-CPW-9E2n.js → EmbeddedDesign-Drkomo9K.js} +2 -2
  17. package/dist/client/assets/{FileDiff-DHQS5O_i.js → FileDiff-FK4mtyx3.js} +2 -2
  18. package/dist/client/assets/{FilePreviewPanel-3ustJhi8.js → FilePreviewPanel-ncsuf7iX.js} +2 -2
  19. package/dist/client/assets/{FoldedSettingsSection-DaTUDHXw.js → FoldedSettingsSection-CRlh3-BO.js} +2 -2
  20. package/dist/client/assets/{NoProjectsHero-BP4MUjf4.js → NoProjectsHero-8d3l2unf.js} +2 -2
  21. package/dist/client/assets/{PanelLayoutControls-BNd5egB9.js → PanelLayoutControls-3fTyX_SN.js} +4 -4
  22. package/dist/client/assets/{PierreEntryIcon-CBahrBiu.js → PierreEntryIcon-DtlkLdir.js} +2 -2
  23. package/dist/client/assets/{PreviewPanel-rlVHqhKP.js → PreviewPanel-Ca3_DPh_.js} +2 -2
  24. package/dist/client/assets/{ProjectDefaultsSettings-Da05OPtO.js → ProjectDefaultsSettings-B--7QlKN.js} +2 -2
  25. package/dist/client/assets/{ProjectFavicon-Bkz2srRd.js → ProjectFavicon-YdOZ4g5-.js} +3 -3
  26. package/dist/client/assets/{ProjectIconPickerDialog-BpLImfmo.js → ProjectIconPickerDialog-C23nnU1a.js} +2 -2
  27. package/dist/client/assets/{ProviderAuthTerminal-ClXCW2ZL.js → ProviderAuthTerminal-YztsMr2F.js} +2 -2
  28. package/dist/client/assets/{ProviderModelPicker-BsAWSSR8.js → ProviderModelPicker-S_tiGeLH.js} +2 -2
  29. package/dist/client/assets/{ProviderSettingsForm-BaWOGIat.js → ProviderSettingsForm-C3nbCFfS.js} +2 -2
  30. package/dist/client/assets/{PullRequestCodeTab-CgecnYur.js → PullRequestCodeTab-BdP3_tNe.js} +2 -2
  31. package/dist/client/assets/{ReadOnlySourcePreview-CQr-JCID.js → ReadOnlySourcePreview-BNe8pyVf.js} +2 -2
  32. package/dist/client/assets/{RenderErrorBoundary-C3EBbed9.js → RenderErrorBoundary-DEgVmtJL.js} +2 -2
  33. package/dist/client/assets/{ScheduledTasksSettings-CTKk7p1m.js → ScheduledTasksSettings-CISo4C7r.js} +2 -2
  34. package/dist/client/assets/{ScopedSwitch-BhNULF6o.js → ScopedSwitch-eWB5GlaA.js} +2 -2
  35. package/dist/client/assets/{SettingsPanels-Dp_sFsPo.js → SettingsPanels-DA7lXl0N.js} +2 -2
  36. package/dist/client/assets/{SettingsPanels.logic-C9V5Hz91.js → SettingsPanels.logic-lCZaJhKM.js} +2 -2
  37. package/dist/client/assets/{SettingsScopeNotice-DSSyI0jy.js → SettingsScopeNotice-BAtVWG0d.js} +2 -2
  38. package/dist/client/assets/{T3ConnectAccountPages-B3e2wzII.js → T3ConnectAccountPages-nabxuL18.js} +2 -2
  39. package/dist/client/assets/{T3ConnectSidebarSignIn-BjQbm8G_.js → T3ConnectSidebarSignIn-CSVR5Zot.js} +2 -2
  40. package/dist/client/assets/{ThemeEditorPanel-AmBMRSJo.js → ThemeEditorPanel-BMtL4rIt.js} +2 -2
  41. package/dist/client/assets/{ThreadTerminalDrawer-BtTayxlc.js → ThreadTerminalDrawer-CLfVfvoq.js} +2 -2
  42. package/dist/client/assets/{Virtualizer-D4YaDR_b.js → Virtualizer-Bi8p4Z6E.js} +2 -2
  43. package/dist/client/assets/{_chat-DV6w-2C3.js → _chat-D-Gcj0-9.js} +5 -5
  44. package/dist/client/assets/{_chat.index--w9wFkxu.js → _chat.index-k4jctzPr.js} +2 -2
  45. package/dist/client/assets/{_chat.new--MAUGvmU.js → _chat.new-BlFtqZqt.js} +2 -2
  46. package/dist/client/assets/{_chat.pull-requests-0A2xwMPy.js → _chat.pull-requests-DrLHGpqx.js} +2 -2
  47. package/dist/client/assets/{abnfDiagram-VCTEODGH-zLaAF-3J.js → abnfDiagram-VCTEODGH-BVKlsgtX.js} +2 -2
  48. package/dist/client/assets/architecture-7GRP2DOG-BNBr3Sao.js +1 -0
  49. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DGrGnnOa.js → architectureDiagram-5GKGNRK7-zBJWGViu.js} +2 -2
  50. package/dist/client/assets/{assets-BwCKLAtY.js → assets-BhchpDuq.js} +2 -2
  51. package/dist/client/assets/{blockDiagram-I7D4REHJ-B5kjOwUJ.js → blockDiagram-I7D4REHJ-BdiAAtHi.js} +2 -2
  52. package/dist/client/assets/{browserHistoryStore-C4q3a0XH.js → browserHistoryStore-CqGVWa5a.js} +2 -2
  53. package/dist/client/assets/{browserLinkTarget-BrW2R2w9.js → browserLinkTarget-CINrbcxi.js} +2 -2
  54. package/dist/client/assets/{c4Diagram-7LVT6UL2-N-lKEret.js → c4Diagram-7LVT6UL2-CqnmSo8f.js} +2 -2
  55. package/dist/client/assets/channel-CfHDq-fp.js +2 -0
  56. package/dist/client/assets/{chunk-4HAMMTFA-DIgHroFa.js → chunk-4HAMMTFA-BpyojyCk.js} +2 -2
  57. package/dist/client/assets/{chunk-75Z2AOVW-BA8jPDfc.js → chunk-75Z2AOVW-LBmwoUvq.js} +2 -2
  58. package/dist/client/assets/{chunk-DU6HZSFF-Dj0ZwIfN.js → chunk-DU6HZSFF-zhv2Vnfx.js} +2 -2
  59. package/dist/client/assets/{chunk-F27PBJKO-CIY-Y3U7.js → chunk-F27PBJKO-K5uPeDhv.js} +2 -2
  60. package/dist/client/assets/{chunk-GMAD6QVW-CpRREKUL.js → chunk-GMAD6QVW-CAAu3Cn5.js} +2 -2
  61. package/dist/client/assets/{chunk-GVQU2GXP-BNRFhCn1.js → chunk-GVQU2GXP-Br_UAx49.js} +2 -2
  62. package/dist/client/assets/{chunk-IMKFNOWR-CwVumyvU.js → chunk-IMKFNOWR-Kqfxrrdn.js} +2 -2
  63. package/dist/client/assets/{chunk-L3NEJ4N5-DmnnKxVD.js → chunk-L3NEJ4N5-D1cWO7rm.js} +2 -2
  64. package/dist/client/assets/{chunk-OSK3NFVY-CVpY8qRB.js → chunk-OSK3NFVY-BiMJbcHf.js} +2 -2
  65. package/dist/client/assets/{chunk-P2QGCYS3-BXtrm_uK.js → chunk-P2QGCYS3-BuGzzo3g.js} +2 -2
  66. package/dist/client/assets/{chunk-POPQ4Y6H-BMv4TRlv.js → chunk-POPQ4Y6H-C_w0mNLk.js} +2 -2
  67. package/dist/client/assets/{chunk-PWAF6VOD-ChjYfHBz.js → chunk-PWAF6VOD-CJFd7LKC.js} +2 -2
  68. package/dist/client/assets/{chunk-SHT3W25Y-B8_bIgln.js → chunk-SHT3W25Y-Beev3ZeU.js} +2 -2
  69. package/dist/client/assets/{chunk-SVP7TREG-B_6y-HJg.js → chunk-SVP7TREG-BqpBEmtK.js} +2 -2
  70. package/dist/client/assets/{chunk-TICWLB2K-UT10I24y.js → chunk-TICWLB2K-B0vIU1Au.js} +2 -2
  71. package/dist/client/assets/classDiagram-ZZMXUADV-Cm99q1tS.js +2 -0
  72. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cm99q1tS.js +2 -0
  73. package/dist/client/assets/{connect-DhHj4PkS.js → connect-DGwXUKTk.js} +2 -2
  74. package/dist/client/assets/{connect-agent-BncssQEd.js → connect-agent-DFwOzcLG.js} +2 -2
  75. package/dist/client/assets/{cynefin-OW5HDTMX-CZNEfbCg.js → cynefin-OW5HDTMX-BjcFswd0.js} +1 -1
  76. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BKEovqGL.js → cynefinDiagram-5FMLGOSQ-BDWLg5Tt.js} +2 -2
  77. package/dist/client/assets/{dagre-GXQ25YYZ-D4NJOZw7.js → dagre-GXQ25YYZ-DZpVjkDw.js} +2 -2
  78. package/dist/client/assets/{device-CPrc6WRl.js → device-BEgZIK7u.js} +2 -2
  79. package/dist/client/assets/{diagram-S7CK7UJ4-DAVijJym.js → diagram-S7CK7UJ4-BpVs-kYJ.js} +2 -2
  80. package/dist/client/assets/{diagram-UQ7AKVKN-Cj6mxCST.js → diagram-UQ7AKVKN-EN7yKI08.js} +2 -2
  81. package/dist/client/assets/{diagram-VSXAHHWV-B8WJLooX.js → diagram-VSXAHHWV-B2oljv94.js} +2 -2
  82. package/dist/client/assets/{diagram-VX7I27RA-BC6KWAr-.js → diagram-VX7I27RA-BIl0lJ6d.js} +2 -2
  83. package/dist/client/assets/{diagram-Z3DM3KII-JUka6Rlo.js → diagram-Z3DM3KII-B8uoK-O5.js} +2 -2
  84. package/dist/client/assets/{diffRendering-DPsheMQA.js → diffRendering-DeZLcalP.js} +2 -2
  85. package/dist/client/assets/{dist-Byy10brL.js → dist-Bd1WIVAz.js} +2 -2
  86. package/dist/client/assets/{duoViewer-BguMFnDx.js → duoViewer-BZ7rNqkx.js} +2 -2
  87. package/dist/client/assets/{dynamic-DZ1i7e73.js → dynamic-BMz3CcWG.js} +2 -2
  88. package/dist/client/assets/{ebnfDiagram-PWID7BFC--X0uMdp8.js → ebnfDiagram-PWID7BFC-BQcQotuk.js} +2 -2
  89. package/dist/client/assets/{embeddedScripts-DtvNyJpi.js → embeddedScripts-Cek5ppgQ.js} +2 -2
  90. package/dist/client/assets/{entities-DSlJSLqU.js → entities-DPIZFvN7.js} +2 -2
  91. package/dist/client/assets/{environments-DcJA_6Bd.js → environments-Dm2_6Uan.js} +2 -2
  92. package/dist/client/assets/{erDiagram-RLTQ6QDP-D40nNb49.js → erDiagram-RLTQ6QDP-Y5XhNz9b.js} +2 -2
  93. package/dist/client/assets/eventmodeling-NTZA5JFV-B7plRWX7.js +1 -0
  94. package/dist/client/assets/{fileLinks-D1jJMhdN.js → fileLinks-1xYacDKI.js} +2 -2
  95. package/dist/client/assets/{fileTreeExpansion-g3uA37tp.js → fileTreeExpansion-B24BhRqA.js} +2 -2
  96. package/dist/client/assets/flowDiagram-HODETNUW-BEpQPBfI.js +1 -0
  97. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CUTw8cyG.js → ganttDiagram-EL5Y4UJY-DqWb0OUJ.js} +2 -2
  98. package/dist/client/assets/{getDiffFileInput-BEkxNzZ-.js → getDiffFileInput-CCYVAWRm.js} +2 -2
  99. package/dist/client/assets/{gitGraph-4MIJSDKK-CNrKR9iC.js → gitGraph-4MIJSDKK-5lcY1dZk.js} +1 -1
  100. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BDOHc4qo.js → gitGraphDiagram-WWUBYQGX-BJKz_rGI.js} +2 -2
  101. package/dist/client/assets/{guideRunStore-DjlqVSzn.js → guideRunStore-BhlldU3q.js} +2 -2
  102. package/dist/client/assets/{index-1TY23MT4.js → index-Dc7GC03y.js} +3 -3
  103. package/dist/client/assets/{info-A6RAGUB7-CcpUa_F0.js → info-A6RAGUB7-BWnMlmF7.js} +1 -1
  104. package/dist/client/assets/{infoDiagram-27XIBGKW-DSI34MwN.js → infoDiagram-27XIBGKW-DKW68xDy.js} +2 -2
  105. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CP954DlA.js → ishikawaDiagram-5VMMS53U-dRMCvDN0.js} +2 -2
  106. package/dist/client/assets/{journeyDiagram-3NMN7TZE-eT4l5GzW.js → journeyDiagram-3NMN7TZE-CAxCpgF5.js} +2 -2
  107. package/dist/client/assets/{kanban-definition-UXKFOSKX-C77A2Ei7.js → kanban-definition-UXKFOSKX-BaSkJW47.js} +2 -2
  108. package/dist/client/assets/{line-CLiRrUp0.js → line-B59oA22i.js} +2 -2
  109. package/dist/client/assets/{linkedPrompt-B-9VpB-9.js → linkedPrompt-Cqfqh2Aq.js} +2 -2
  110. package/dist/client/assets/main-Ch-SjebX.css +2 -0
  111. package/dist/client/assets/{main-BxSUUHl7.js → main-CxOeqlhD.js} +7 -7
  112. package/dist/client/assets/{mediaReference-Co0MbQU1.js → mediaReference-DRC-8GdL.js} +2 -2
  113. package/dist/client/assets/{mediaSource-CakREDG9.js → mediaSource-DWSwwPfV.js} +2 -2
  114. package/dist/client/assets/{mermaid-parser.core-Dm-CGUQK.js → mermaid-parser.core-DcamukpZ.js} +4 -4
  115. package/dist/client/assets/{mermaid.core-BUABPjrf.js → mermaid.core-C6GXL70P.js} +5 -5
  116. package/dist/client/assets/{mindmap-definition-YA3MSWOX-DdthJce-.js → mindmap-definition-YA3MSWOX-CEVz3xGI.js} +2 -2
  117. package/dist/client/assets/{onboarding-qFB0UvmL.js → onboarding-CLIRA2Sa.js} +2 -2
  118. package/dist/client/assets/{openFileInPreview-DH1_MQQg.js → openFileInPreview-uS9Qgrru.js} +2 -2
  119. package/dist/client/assets/{p4ProjectFile-Czc_hMvK.js → p4ProjectFile-CIYnqKbl.js} +2 -2
  120. package/dist/client/assets/{packet-AYTQ26CC-C3W7XCMm.js → packet-AYTQ26CC-B9XAEihD.js} +1 -1
  121. package/dist/client/assets/{pair-CcIVxc7L.js → pair-DTfs9_4K.js} +2 -2
  122. package/dist/client/assets/{pegDiagram-XKGWAZYB-DMWX9FLy.js → pegDiagram-XKGWAZYB-tcLsMhrs.js} +2 -2
  123. package/dist/client/assets/{phoneViewer-EcEiirVA.js → phoneViewer-wYjPQP4U.js} +2 -2
  124. package/dist/client/assets/{pie-WAS4IAKB-Bdmc_LNt.js → pie-WAS4IAKB-B3ig0TFp.js} +1 -1
  125. package/dist/client/assets/{pieDiagram-E7YTZNPT-D7g18I6h.js → pieDiagram-E7YTZNPT-uaJgfQOp.js} +2 -2
  126. package/dist/client/assets/{pierre-icons-BF6Bv7EQ.js → pierre-icons-Dav7jMBk.js} +2 -2
  127. package/dist/client/assets/popover-Bc0WvoPP.js +2 -0
  128. package/dist/client/assets/{preview-CzRHMudX.js → preview-C4lGbDhm.js} +2 -2
  129. package/dist/client/assets/{primary-BeYRWn1V.js → primary-CRkgnOCY.js} +2 -2
  130. package/dist/client/assets/{primaryCloudLinkState-BLsual21.js → primaryCloudLinkState-B_VNTJYL.js} +2 -2
  131. package/dist/client/assets/{projectFilesQueryState-DA41YjI0.js → projectFilesQueryState-U08pztRu.js} +2 -2
  132. package/dist/client/assets/{projectScriptEditor-BQz7SQAB.js → projectScriptEditor-D8mxKLOb.js} +2 -2
  133. package/dist/client/assets/{providerSkills-BqTkgag1.js → providerSkills-C7CtJefh.js} +2 -2
  134. package/dist/client/assets/{pullRequestDetail.logic-DZT0G8Eq.js → pullRequestDetail.logic-DGX-Sd8d.js} +2 -2
  135. package/dist/client/assets/{pullRequests-D40-ZAXm.js → pullRequests-BbD7hNlR.js} +2 -2
  136. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-B7fD9ov3.js → quadrantDiagram-AXDQQJYC-BOFUpnyi.js} +2 -2
  137. package/dist/client/assets/{queries-G1w-VoW0.js → queries-BVPZtaQA.js} +2 -2
  138. package/dist/client/assets/{radar-RG4KPBEZ-XnqFD0Vk.js → radar-RG4KPBEZ--djmIj49.js} +1 -1
  139. package/dist/client/assets/{railroad-74A4TZTK-DTwlNXl5.js → railroad-74A4TZTK-DMMw049f.js} +1 -1
  140. package/dist/client/assets/railroad-abnf-HS5TGJTU-BJdCwb3O.js +1 -0
  141. package/dist/client/assets/railroad-ebnf-LZEXJU2U-a9vhoAEG.js +1 -0
  142. package/dist/client/assets/railroad-peg-WCYAUIDC-Cyo-vXW_.js +1 -0
  143. package/dist/client/assets/{railroadDiagram-O6MQD6OU-CvCkOq5l.js → railroadDiagram-O6MQD6OU-Df9rhhFk.js} +2 -2
  144. package/dist/client/assets/{renderScheduler-pSLV-XuI.js → renderScheduler-b0pOdWwc.js} +2 -2
  145. package/dist/client/assets/{requirementDiagram-BXWQKSXE-taBU_pva.js → requirementDiagram-BXWQKSXE-BtGYMd7U.js} +2 -2
  146. package/dist/client/assets/{runtime-BtqGaFGQ.js → runtime-Bc4kgQim.js} +2 -2
  147. package/dist/client/assets/{runtime-B3_ce0WW.js → runtime-DZfpb67Q.js} +3 -3
  148. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DZUz0diJ.js → sankeyDiagram-P5KCCOFB-D7_y-s_u.js} +2 -2
  149. package/dist/client/assets/{scheduledTasksSettings.logic-C0Ez1DaI.js → scheduledTasksSettings.logic-CvvQA-b7.js} +2 -2
  150. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CljKM3sv.js → sequenceDiagram-WJ2MYXX4-AuXrX-b5.js} +2 -2
  151. package/dist/client/assets/{server-BP2BG-G5.js → server-LJ0-FVGH.js} +2 -2
  152. package/dist/client/assets/{session-B20XW_sH.js → session-Bc1P10r_.js} +2 -2
  153. package/dist/client/assets/{session-logic-BtEgohgO.js → session-logic-BNtU33qU.js} +2 -2
  154. package/dist/client/assets/{settings-DBl7ZVnV.js → settings-CZSrxmjf.js} +2 -2
  155. package/dist/client/assets/{settings.appearance-D8k8SMD3.js → settings.appearance-B_LipS5_.js} +2 -2
  156. package/dist/client/assets/settings.archived-B_h3CK_T.js +2 -0
  157. package/dist/client/assets/{settings.computer-use-pik9jKva.js → settings.computer-use-BAzpb53_.js} +2 -2
  158. package/dist/client/assets/{settings.connections-DCVjT1D4.js → settings.connections-Bv37N8Tm.js} +2 -2
  159. package/dist/client/assets/{settings.data-controls-immNwXN9.js → settings.data-controls-DIkcwUy1.js} +2 -2
  160. package/dist/client/assets/{settings.decisions-DWMEFgyI.js → settings.decisions-BN9ozN_A.js} +2 -2
  161. package/dist/client/assets/{settings.diagnostics-BU0rF2oy.js → settings.diagnostics-DuoGRNGf.js} +2 -2
  162. package/dist/client/assets/{settings.general-Dlcf9Hk5.js → settings.general-B-Bt2-nG.js} +2 -2
  163. package/dist/client/assets/{settings.integrations-CYXx2aGC.js → settings.integrations-CT3opViE.js} +2 -2
  164. package/dist/client/assets/{settings.keybindings-CZlUIeZC.js → settings.keybindings-BBTkicWk.js} +2 -2
  165. package/dist/client/assets/{settings.open-source-licenses-Df90UmKw.js → settings.open-source-licenses-C_hoYTwe.js} +2 -2
  166. package/dist/client/assets/{settings.plugins-DGKWDNbJ.js → settings.plugins-DafKnC5Q.js} +2 -2
  167. package/dist/client/assets/{settings.projects-BaH4TdtU.js → settings.projects-r2ZcxKud.js} +3 -3
  168. package/dist/client/assets/{settings.providers-jRQxDtSb.js → settings.providers-jbZijXPV.js} +3 -3
  169. package/dist/client/assets/{settings.scheduled-tasks-DedR0Odt.js → settings.scheduled-tasks-C0d4wkYE.js} +2 -2
  170. package/dist/client/assets/{settings.snap-shot-BphQmu0k.js → settings.snap-shot-D-zJVnjT.js} +2 -2
  171. package/dist/client/assets/{settings.source-control-raEHGAxv.js → settings.source-control-DIU1xRUy.js} +2 -2
  172. package/dist/client/assets/{settings.storage-CGgPDbYR.js → settings.storage-DRxTKEjG.js} +2 -2
  173. package/dist/client/assets/{settingsLayout-C0HMxLxU.js → settingsLayout-Cbpy7Mfz.js} +2 -2
  174. package/dist/client/assets/{sidebarProjectGrouping-DJA_Uu9w.js → sidebarProjectGrouping-DXnDcqLY.js} +2 -2
  175. package/dist/client/assets/{sortable.esm-cggA232Z.js → sortable.esm-Boen_E7K.js} +2 -2
  176. package/dist/client/assets/{sourceControl-oqWEMILZ.js → sourceControl-DE9QO1yg.js} +2 -2
  177. package/dist/client/assets/{stateDiagram-D77RDMKH-8ubzI9Qu.js → stateDiagram-D77RDMKH-EwB2WAAm.js} +2 -2
  178. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CcnJHQ4a.js +2 -0
  179. package/dist/client/assets/{swimlanes-42K2YHIH-BbvNjSwa.js → swimlanes-42K2YHIH-RngRFsjR.js} +2 -2
  180. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CrkPrysy.js +9 -0
  181. package/dist/client/assets/{terminalSessions-B774652v.js → terminalSessions-Cj-MqjH8.js} +2 -2
  182. package/dist/client/assets/{threadSort-Broxuoqw.js → threadSort-DD61dseb.js} +2 -2
  183. package/dist/client/assets/{timeline-definition-24CTP7MA-BxF3SHfH.js → timeline-definition-24CTP7MA-BfIggpP3.js} +2 -2
  184. package/dist/client/assets/{toast-Dm5S3V1c.js → toast-DYfY2t_z.js} +2 -2
  185. package/dist/client/assets/{treeView-Q6P3EWNA-CGSjigr_.js → treeView-Q6P3EWNA-BjKaOr9u.js} +1 -1
  186. package/dist/client/assets/{treemap-WGGIJYW6-BS1Y39WM.js → treemap-WGGIJYW6-ffFPsmk1.js} +1 -1
  187. package/dist/client/assets/{usage-ByG67Q9r.js → usage-CRK5JZJm.js} +2 -2
  188. package/dist/client/assets/{use-atom-command-COr3-BfL.js → use-atom-command-Dz_yqN35.js} +2 -2
  189. package/dist/client/assets/{useHandleNewThread-BWKsU_Gt.js → useHandleNewThread-DjevdE0U.js} +2 -2
  190. package/dist/client/assets/{usePullRequestActions-C65BTMJa.js → usePullRequestActions-BKpChcp1.js} +2 -2
  191. package/dist/client/assets/{useScopedModelAvailability-D2Bb81KH.js → useScopedModelAvailability-mUid6EfJ.js} +2 -2
  192. package/dist/client/assets/{useSettings-WGf2H_E7.js → useSettings-DCI8Hv09.js} +2 -2
  193. package/dist/client/assets/{useT3ConnectAuthPrompt-DkfGkujP.js → useT3ConnectAuthPrompt-C7Dm8xCm.js} +2 -2
  194. package/dist/client/assets/{vcsRefInvalidation-CUgwItfg.js → vcsRefInvalidation-3pHpDJC2.js} +2 -2
  195. package/dist/client/assets/{vennDiagram-4TSXK5OY-D82sXWUt.js → vennDiagram-4TSXK5OY-Bw5_1h9Y.js} +2 -2
  196. package/dist/client/assets/{wardley-WFR3VGLG-wxkoFCaM.js → wardley-WFR3VGLG-BzzHb86M.js} +1 -1
  197. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-DZkAGgtY.js → wardleyDiagram-VM6X3IG4-RCSx0hV5.js} +2 -2
  198. package/dist/client/assets/{welcome-CbLsZSs9.js → welcome-RXSMyzlx.js} +2 -2
  199. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BqDefNNt.js → xychartDiagram-S5SC5T6Z-CcISZM46.js} +2 -2
  200. package/dist/client/index.html +1 -1
  201. package/package.json +1 -1
  202. package/dist/client/assets/architecture-7GRP2DOG-BnVYv_Tj.js +0 -1
  203. package/dist/client/assets/channel-ke6KlN2m.js +0 -2
  204. package/dist/client/assets/classDiagram-ZZMXUADV-_dDKzg70.js +0 -2
  205. package/dist/client/assets/classDiagram-v2-VYDZK3BY-_dDKzg70.js +0 -2
  206. package/dist/client/assets/eventmodeling-NTZA5JFV-BxLxqsIB.js +0 -1
  207. package/dist/client/assets/flowDiagram-HODETNUW-CEdMSh3v.js +0 -1
  208. package/dist/client/assets/main-r-P9O3jD.css +0 -2
  209. package/dist/client/assets/popover-BDFZje9T.js +0 -2
  210. package/dist/client/assets/railroad-abnf-HS5TGJTU-DZY_wWOl.js +0 -1
  211. package/dist/client/assets/railroad-ebnf-LZEXJU2U-DuwTAynV.js +0 -1
  212. package/dist/client/assets/railroad-peg-WCYAUIDC-wPuXkdeA.js +0 -1
  213. package/dist/client/assets/settings.archived-DQ04FuiA.js +0 -2
  214. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-hQOpsZ3n.js +0 -2
  215. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BA9BVweg.js +0 -9
@@ -1,3 +1,3 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,A_ as r,Ab as i,Ch as a,Cs as o,Dc as s,Dy as c,Fg as l,Fy as u,Go as d,Jw as f,Ky as ee,ME as te,MT as ne,Nb as re,Ng as ie,Ob as ae,Pb as oe,Qw as p,Qy as se,Rs as ce,S_ as le,Ss as ue,Sy as de,Th as fe,Ts as pe,Wy as me,Xo as he,Xw as m,Xy as ge,Yo as h,_l as _e,ah as ve,bb as ye,bh as be,ch as xe,dh as Se,eS as Ce,gl as we,hh as Te,ih as Ee,jb as De,n_ as Oe,nb as ke,r_ as Ae,rb as je,t_ as Me,th as Ne,ub as Pe,uh as Fe,wh as Ie,xb as Le,ys as Re,zy as ze}from"./utils-CRwA5SKO.js";import{R as Be,W as Ve,_t as g}from"./runtime-B3_ce0WW.js";import{T as He}from"./runtime-BtqGaFGQ.js";import{i as _}from"./toast-Dm5S3V1c.js";import{a as Ue,o as We}from"./environments-DcJA_6Bd.js";import{f as v,u as Ge}from"./server-BP2BG-G5.js";import{i as Ke,n as qe,t as Je}from"./session-B20XW_sH.js";import{t as y}from"./use-atom-command-COr3-BfL.js";import{B as Ye,C as Xe,F as Ze,N as Qe,P as $e,V as et,b as tt,c as nt,i as b,k as rt,l as it,n as x,o as at,r as ot,v as st,w as ct,x as lt}from"./themePalette-CdoksNDx.js";var S=e(t(),1),C=te(),ut={status:`idle`},w=ut,T=null,E=[],D=0,dt=new Set;function O(e){w=e;for(let e of dt)e()}function ft(e){T?.resolve(e);for(let t of E)t.resolve(e);T=null,E=[]}function pt(){return w}function mt(e){return dt.add(e),()=>{dt.delete(e)}}function ht(){D+=1;let e=!0;return()=>{e&&(e=!1,D=Math.max(0,D-1),D===0&&(ft(!1),O(ut)))}}function gt(e,t){if(D!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(T||w.status===`closing`){E.push(r);return}T=r,O({status:`confirming`,message:e,variant:r.variant})})}function _t(){return w.status!==`idle`||T!==null||E.length>0}function vt(e){if(w.status!==`confirming`||!T)return;let t=T;T=null,t.resolve(e),O({status:`closing`,message:w.message,variant:w.variant})}function yt(){if(w.status!==`closing`)return;let e=E.shift();if(!e){O(ut);return}T=e,O({status:`confirming`,message:e.message,variant:e.variant})}var bt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function xt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return s(t)?`${n.map(e=>bt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var St=`http://www.w3.org/2000/svg`,Ct={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function wt(e,t){let n=Ct[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(St,`svg`);r.setAttribute(`xmlns`,St),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(St,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Tt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Et(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var k=null;function Dt(){return k!==null}function Ot(){k?.(),k=null}function kt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,c=!1,l=()=>u(null),u=e=>{if(o)return;o=!0,k===l&&(k=null),document.removeEventListener(`keydown`,d),document.removeEventListener(`pointerdown`,f,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Et(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},d=e=>{e.key===`Escape`&&(e.preventDefault(),u(null))},f=e=>{c&&!Et(e.target,i)&&u(null)},ee=e=>{c&&!Et(e.target,i)&&(e.preventDefault(),u(null))},te=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ne=(e,t,n,r,o)=>{te(r);let l=document.createElement(`div`);l.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,l.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,l.style.left=`${t}px`,l.style.top=`${n}px`,l.dataset.level=String(r);let d=document.createElement(`div`);d.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,d.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&d.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),d.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,d.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let l=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${l} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${l} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${l} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?wt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=wt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,a.appendChild(f),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=xt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,s(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=wt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,s=!1,l=()=>{let e=o||s;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,l()}),a.addEventListener(`mouseleave`,()=>{o=!1,l()}),a.addEventListener(`focus`,()=>{s=!0,l()}),a.addEventListener(`blur`,()=>{s=!1,l()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Tt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{te(r+1)}),a.addEventListener(`click`,()=>{c&&u(t.id)})}d.appendChild(a)}l.appendChild(d),l.addEventListener(`mouseenter`,()=>{te(r+1)}),document.body.appendChild(l),i[r]=l,a[r]=o,requestAnimationFrame(()=>{Tt(l,t,n)})};document.addEventListener(`keydown`,d),document.addEventListener(`pointerdown`,f,!0),document.addEventListener(`contextmenu`,ee,!0),ne(e,t?.x??0,t?.y??0,0),k&&k(),k=l,requestAnimationFrame(()=>{c=!0})})}var At=`t3code:client-settings:v1`;function jt(){return typeof window<`u`}function Mt(){return jt()?o(At,Ne):null}function Nt(e){jt()&&pe(At,e,Ne)}var Pt;function Ft(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>gt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):kt(e,t),close:async()=>{window.desktopBridge||Ot()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Mt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Nt(e)}}}}function It(){return Ft()}function Lt(){if(typeof window<`u`)return Pt||(Pt=It(),Pt)}function Rt(){let e=Lt();if(!e)throw Error(`Local API not found`);return e}var A=`t3code:theme`,zt=`(prefers-color-scheme: dark)`,j={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function Bt(){return M()}function Vt(){return typeof window>`u`?{}:Ht()}function M(){if(typeof window>`u`)return null;try{return rt(window.localStorage.getItem(b))}catch{return null}}function Ht(){try{let e=JSON.parse(window.localStorage.getItem(`t3code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function N(e){return`${e?.light??``}|${e?.dark??``}`}var Ut=`theme-color`,Wt=`meta[name="${Ut}"][data-dynamic-theme-color="true"]`,P=class extends ze()(`ThemeStorageError`,{operation:c([`read`,`write`]),storageKey:u,theme:Pe(at),cause:de()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},Gt=je(P),Kt=class extends ze()(`DesktopThemeSyncError`,{theme:at,cause:de()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},qt=je(Kt),F=[],I=null,Jt=!0,L=null,R=null,z=null;function B(){Jt=!0;for(let e of F)e()}function Yt(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(zt).matches}function Xt(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(ot);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function Zt(e){return e===`light`||e===`dark`||e===`system`}function V(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(x);if(Zt(e))return e}catch{}return Xt(e)?`system`:tt(e)??`light`}function Qt(e){if(typeof window<`u`)try{window.localStorage.setItem(x,e)}catch(e){throw new P({operation:`write`,storageKey:x,cause:e})}}function $t(){if(typeof window>`u`)return j.theme;let e;try{e=window.localStorage.getItem(A)}catch(e){throw new P({operation:`read`,storageKey:A,cause:e})}return e!==null&&ct(e)?it(e):j.theme}function en(e){if(typeof window<`u`)try{window.localStorage.setItem(A,e),z=null}catch(t){throw new P({operation:`write`,storageKey:A,theme:e,cause:t})}}function H(){if(z!==null)return j.theme;try{return $t()}catch(e){let t=Gt(e)?e:new P({operation:`read`,storageKey:A,cause:e});return z=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),j.theme}}function tn(){let e=document.querySelector(Wt);return e||(e=document.createElement(`meta`),e.name=Ut,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function nn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function rn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function an(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?nn(e.getPropertyValue(`--app-chrome-background`)):null,n=nn(getComputedStyle(rn()).backgroundColor),r=nn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${Ut}"]`);if(a.length===0){tn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function U(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=V(e),i=r===`system`,a=i?Yt():!1,o=M();if(R?.theme===e&&R.systemDark===a&&R.followSystem===i&&R.appearanceMode===r&&N(R.themeHalves)===N(o)){sn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=$e(e,a,i,r,o);nt(Ze(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),R={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},an(),sn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function on(e,t,n,r,i=M()){try{await e.setTheme(Qe(t,n,r,i))}catch(e){throw new Kt({theme:t,cause:e})}}function sn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=M(),a=Qe(e,t,n,i);r&&typeof r.setTheme==`function`&&L!==a&&(L=a,on(r,e,t,n,i).catch(t=>{let n=qt(t)?t:new Kt({theme:e,cause:t});console.error(n.message,{theme:n.theme,...g(n)}),L===a&&(L=null)}))}typeof document<`u`&&typeof window<`u`&&U(H());function cn(){if(typeof window>`u`)return j;if(!Jt&&I)return I;Jt=!1;let e=H(),t=V(e),n=t===`system`,r=n?Yt():!1,i=M(),a=$e(e,r,n,t,i);return I&&I.theme===e&&I.resolvedTheme===a&&I.systemDark===r&&I.followSystem===n&&I.appearanceMode===t&&N(I.themeHalves)===N(i)||(I={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),I}function ln(){return j}function un(){let e=H();V(e)===`system`&&U(e,{suppressTransitions:!0}),B()}function dn(e){e.key===A?(z=null,U(H(),{suppressTransitions:!0}),B()):e.key===`t3code:theme-follow-system`||e.key===`t3code:theme-appearance-mode`||e.key===`t3code:theme-halves:v1`?(U(H(),{suppressTransitions:!0}),B()):(e.key===`t3code:themes:v1`||e.key===null)&&(e.key===null&&(z=null),Xe(),R=null,U(H(),{suppressTransitions:!0}),B())}var W=null;function fn(e){if(typeof window>`u`)return()=>{};if(F.push(e),!W){let e=typeof window.matchMedia==`function`?window.matchMedia(zt):null;e?.addEventListener(`change`,un),window.addEventListener(`storage`,dn),W=()=>{e?.removeEventListener(`change`,un),window.removeEventListener(`storage`,dn)}}return()=>{F=F.filter(t=>t!==e),F.length===0&&(W?.(),W=null)}}function pn(){let e=(0,S.useSyncExternalStore)(fn,cn,ln),{theme:t,resolvedTheme:n}=e,r=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(V(H()));let t=window.localStorage.getItem(b);window.localStorage.removeItem(b);try{en(e)}catch(e){if(t!==null)try{window.localStorage.setItem(b,t)}catch{}throw e}}catch(t){let n=Gt(t)?t:new P({operation:`write`,storageKey:A,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...g(n)}),!1}return U(e,{suppressTransitions:!0}),B(),!0},[]),i=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(e)}catch(e){let t=Gt(e)?e:new P({operation:`write`,storageKey:x,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return z=null,U(H(),{suppressTransitions:!0}),B(),!0},[]),a=(0,S.useCallback)(e=>{let n=V(t),r=e?`system`:n===`system`?tt(t)??`light`:n;return i(r)},[i,t]),o=(0,S.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...Ht()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(b):window.localStorage.setItem(b,JSON.stringify(n))}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),s=(0,S.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(b)}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),c=(0,S.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(R=null,U(H(),{suppressTransitions:!0,preservePreview:e}),B())},[]);return(0,S.useEffect)(()=>{U(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var mn=ee(ke(me)),hn=oe(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),mn(t).pipe(Ce(e=>e.issue))}),gn=new ae(hn,re());De().pipe(i(re({space:2})));var _n=e=>u.pipe(ge(e,gn)),G={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:f(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:Ee,providerHealthRefreshInterval:Fe,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:f(15),hostPowerMonitorActiveInterval:f(1),hostPowerMonitorIdleInterval:f(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function K(e){return G[e]}function q(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function vn(e){let t=q(e),n=G[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return p(e)===p(t)}function yn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=vn(e),n=[q(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(yn(t,G[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=q(e),i=G[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function xn(e){let t={schemaVersion:1,profile:ve,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||p(e.automaticGitFetchInterval)!==p(Ee)||p(e.providerHealthRefreshInterval)!==p(Fe);return vn(n&&i?{schemaVersion:1,profile:p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)&&p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Sn(e){let t=xn(e);return bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Cn=_n(Te);se(Cn);function wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?be(t.instanceId):fe(n)}var Tn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>Me.make(e));function En(e,t,n){let r=[...Tn.map(e=>[Ae(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Tn.includes(t.driver)?[[Oe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ce(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:l[a]??ie[a]??`gpt-6-luna`}}function Dn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ie(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&we(i)&&_e(i)?r:e.textGenerationModelSelection}function On(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ie(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&we(e)&&_e(e))return r}return Dn(e,t,n)}function kn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function An(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var jn=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Mn(e){let t={},n={};for(let[r,i]of Object.entries(e))jn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function Nn(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Le(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Le(e,[`continueThreadsAfterServerUpdate`])}function Pn(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}var Fn=`[CLIENT_SETTINGS]`,In=new Set,Ln=new Set,Rn=xe,Y=`pending`,X=null,zn=0,Bn=Promise.resolve(),Vn=0;function Hn(){for(let e of In)e()}function Un(){for(let e of Ln)e()}function Z(){return Rn}function Wn(e){Rn=e,Hn()}function Gn(e){Y!==e&&(Y=e,Un())}function Kn(e){return In.add(e),Q().catch(()=>void 0),()=>{In.delete(e)}}function qn(){return Y===`ready`}function Jn(){return Y}function Yn(e){return Ln.add(e),Q().catch(()=>void 0),()=>{Ln.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=zn;Gn(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await Rt().persistence.getClientSettings();if(e!==zn)return;t&&Wn({...xe,...t}),Gn(`ready`)}catch(t){throw e===zn&&Gn(`failed`),console.error(`${Fn} hydrate failed`,{operation:`hydrate`,...g(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Xn=e=>Rt().persistence.setClientSettings(e);function Zn(e){let t=Bn.then(e);return Bn=t.then(()=>void 0,()=>void 0),t}function Qn(e,t=Xn){let n=Y!==`ready`||Vn>0;return n?Vn+=1:Wn({...Z(),...e}),Zn(async()=>{if(n)try{Y!==`ready`&&await Q(),Wn({...Z(),...e})}finally{--Vn}await t(Z())}).catch(e=>{console.error(`${Fn} persist failed`,{operation:`persist`,...g(e)})})}async function $n(e,t=Xn){return Zn(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Wn(r),r}})}var er=new Set(ye(Te.fields));function tr(e){let t={},n={};for(let[r,i]of Object.entries(e))er.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function nr(){return Z()}function rr(){return Q()}function ir(){return(0,S.useSyncExternalStore)(Yn,qn,ar)}function ar(){return!1}function or(){return(0,S.useSyncExternalStore)(Yn,Jn,sr)}function sr(){return`pending`}function $(){return(0,S.useSyncExternalStore)(Kn,Z,cr)}function cr(){return xe}function lr(e,t){return{...t,...e,...kn(e,t)}}var ur=new Set;function dr(e,t){let n=(0,C.c)(8),r=$(),i=ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=y(v.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||ur.has(e))return;let n=An(t,r);n&&(ur.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>ur.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,S.useEffect)(s,c)}function fr(e,t){let n=(0,C.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=lr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function pr(e){let t=(0,C.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function mr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function hr(){let e=(0,C.c)(7),t=ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=pn(),o=(0,S.useSyncExternalStore)(Ye,lt,gr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=Ze(i,a,r),l=st(c);s=mr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??et(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function gr(){return null}async function _r(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await rr(),{...An(e,nr()),...t}}function vr(e){let t=(0,C.c)(6),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=y(v.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await _r(r,t)}catch{_.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function yr(e){let t=(0,S.use)(he),n=(0,S.useRef)(new Map),r=vr(e);return(0,S.useCallback)(async(i,a)=>{if(!e)return;let o=v.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await rr()}catch{_.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=kn(c,nr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&Re(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var br=n(null);function xr(e){let t=(0,C.c)(5),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=$();dr(e,r);let a=r??Se,o;return t[2]!==i||t[3]!==a?(o=kn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function Sr(e,t){let n=(0,C.c)(2),r;n[0]===e?r=n[1]:(r=v.settingsValueAtom(e),n[0]=e,n[1]=r);let i=h(r);return dr(e,i),fr(i??Se,t)}function Cr(e){let t=(0,C.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=y(v.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function wr(e){let t=We(),n=h(Ge);return dr(t?.environmentId??null,t?.serverConfig?.settings??null),fr(n,e)}var Tr=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function Er(){let e=(0,C.c)(2),t=We(),n;return e[0]===t?n=e[1]:(n=t!==null||!He(),e[0]=t,e[1]=n),n}function Dr(e){let t=(0,C.c)(3),i=e!==void 0&&e,{environments:a}=Ue(),o;return t[0]!==a||t[1]!==i?(o=n(e=>a.filter(Pn).flatMap(t=>{let n=e(Je.sessionStateAtom(t.environmentId));if(i&&n._tag===`Initial`)return[t.environmentId];let a=n._tag===`Failure`?null:ne(ue(n));return a!==null&&r(a,`settings:write`)?[t.environmentId]:[]})),t[0]=a,t[1]=i,t[2]=o):o=t[2],h(o)}function Or(e){let t=(0,C.c)(10);Ke(e,le);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=y(v.updateSettings,n),{environments:i}=Ue(),o;t[1]!==i||t[2]!==r?(o=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Be(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ve(t);_.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=o):o=t[3];let s=o,c=Dr(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==s||t[8]!==c?(l=t=>{let{serverPatch:n,clientPatch:o}=tr(t),l=e===null||a(n).every(t=>qe(e,t));if(Object.keys(n).length>0&&!l&&_.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&l){let{sharedPatch:t,localPatch:o}=Mn(n),l=Nr;if(Object.keys(o).length>0&&(e?s({environmentId:e,input:{patch:o}}):l()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(c);e&&o.add(e);let s=[],u=[];for(let r of o){let o=i.find(e=>e.environmentId===r),c=Nn(t,o?.serverConfig?.environment.capabilities,o?.serverConfig?.settings,n,r===e);if(Object.keys(c).length!==0){if(d.get(Je.sessionStateAtom(r))._tag!==`Initial`&&!a(t).every(e=>qe(r,e))){u.push(o?.label??r);continue}s.push({environmentId:r,input:{patch:c}})}}s.length===0?l(u.length>0?`This connection lacks permission to change settings on ${u.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(s.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(kr)}}Object.keys(o).length>0&&Qn(o)},t[4]=e,t[5]=i,t[6]=r,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function kr(e){let t=e.flatMap(Mr);if(t.length===0)return;let n=e.filter(jr).map(Ar);_.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,A_ as r,Ab as i,Ch as a,Cs as o,Dc as s,Dy as c,Fg as l,Fy as u,Go as d,Jw as f,Ky as ee,ME as te,MT as ne,Nb as re,Ng as ie,Ob as ae,Pb as oe,Qw as p,Qy as se,Rs as ce,S_ as le,Ss as ue,Sy as de,Th as fe,Ts as pe,Wy as me,Xo as he,Xw as m,Xy as ge,Yo as h,_l as _e,ah as ve,bb as ye,bh as be,ch as xe,dh as Se,eS as Ce,gl as we,hh as Te,ih as Ee,jb as De,n_ as Oe,nb as ke,r_ as Ae,rb as je,t_ as Me,th as Ne,ub as Pe,uh as Fe,wh as Ie,xb as Le,ys as Re,zy as ze}from"./utils-CRwA5SKO.js";import{R as Be,W as Ve,_t as g}from"./runtime-DZfpb67Q.js";import{T as He}from"./runtime-Bc4kgQim.js";import{i as _}from"./toast-DYfY2t_z.js";import{a as Ue,o as We}from"./environments-Dm2_6Uan.js";import{f as v,u as Ge}from"./server-LJ0-FVGH.js";import{i as Ke,n as qe,t as Je}from"./session-Bc1P10r_.js";import{t as y}from"./use-atom-command-Dz_yqN35.js";import{B as Ye,C as Xe,F as Ze,N as Qe,P as $e,V as et,b as tt,c as nt,i as b,k as rt,l as it,n as x,o as at,r as ot,v as st,w as ct,x as lt}from"./themePalette-CdoksNDx.js";var S=e(t(),1),C=te(),ut={status:`idle`},w=ut,T=null,E=[],D=0,dt=new Set;function O(e){w=e;for(let e of dt)e()}function ft(e){T?.resolve(e);for(let t of E)t.resolve(e);T=null,E=[]}function pt(){return w}function mt(e){return dt.add(e),()=>{dt.delete(e)}}function ht(){D+=1;let e=!0;return()=>{e&&(e=!1,D=Math.max(0,D-1),D===0&&(ft(!1),O(ut)))}}function gt(e,t){if(D!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(T||w.status===`closing`){E.push(r);return}T=r,O({status:`confirming`,message:e,variant:r.variant})})}function _t(){return w.status!==`idle`||T!==null||E.length>0}function vt(e){if(w.status!==`confirming`||!T)return;let t=T;T=null,t.resolve(e),O({status:`closing`,message:w.message,variant:w.variant})}function yt(){if(w.status!==`closing`)return;let e=E.shift();if(!e){O(ut);return}T=e,O({status:`confirming`,message:e.message,variant:e.variant})}var bt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function xt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return s(t)?`${n.map(e=>bt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var St=`http://www.w3.org/2000/svg`,Ct={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function wt(e,t){let n=Ct[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(St,`svg`);r.setAttribute(`xmlns`,St),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(St,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Tt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function Et(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var k=null;function Dt(){return k!==null}function Ot(){k?.(),k=null}function kt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,c=!1,l=()=>u(null),u=e=>{if(o)return;o=!0,k===l&&(k=null),document.removeEventListener(`keydown`,d),document.removeEventListener(`pointerdown`,f,!0),document.removeEventListener(`contextmenu`,ee,!0);let t=Et(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},d=e=>{e.key===`Escape`&&(e.preventDefault(),u(null))},f=e=>{c&&!Et(e.target,i)&&u(null)},ee=e=>{c&&!Et(e.target,i)&&(e.preventDefault(),u(null))},te=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ne=(e,t,n,r,o)=>{te(r);let l=document.createElement(`div`);l.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,l.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,l.style.left=`${t}px`,l.style.top=`${n}px`,l.dataset.level=String(r);let d=document.createElement(`div`);d.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,d.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&d.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),d.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,d.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let l=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${l} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${l} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${l} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?wt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=wt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let f=document.createElement(`span`);if(f.className=`min-w-0 flex-1 truncate`,f.textContent=t.label,a.appendChild(f),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=xt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,s(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=wt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,s=!1,l=()=>{let e=o||s;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,l()}),a.addEventListener(`mouseleave`,()=>{o=!1,l()}),a.addEventListener(`focus`,()=>{s=!0,l()}),a.addEventListener(`blur`,()=>{s=!1,l()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ne(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Tt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{te(r+1)}),a.addEventListener(`click`,()=>{c&&u(t.id)})}d.appendChild(a)}l.appendChild(d),l.addEventListener(`mouseenter`,()=>{te(r+1)}),document.body.appendChild(l),i[r]=l,a[r]=o,requestAnimationFrame(()=>{Tt(l,t,n)})};document.addEventListener(`keydown`,d),document.addEventListener(`pointerdown`,f,!0),document.addEventListener(`contextmenu`,ee,!0),ne(e,t?.x??0,t?.y??0,0),k&&k(),k=l,requestAnimationFrame(()=>{c=!0})})}var At=`t3code:client-settings:v1`;function jt(){return typeof window<`u`}function Mt(){return jt()?o(At,Ne):null}function Nt(e){jt()&&pe(At,e,Ne)}var Pt;function Ft(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>gt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):kt(e,t),close:async()=>{window.desktopBridge||Ot()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Mt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Nt(e)}}}}function It(){return Ft()}function Lt(){if(typeof window<`u`)return Pt||(Pt=It(),Pt)}function Rt(){let e=Lt();if(!e)throw Error(`Local API not found`);return e}var A=`t3code:theme`,zt=`(prefers-color-scheme: dark)`,j={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function Bt(){return M()}function Vt(){return typeof window>`u`?{}:Ht()}function M(){if(typeof window>`u`)return null;try{return rt(window.localStorage.getItem(b))}catch{return null}}function Ht(){try{let e=JSON.parse(window.localStorage.getItem(`t3code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function N(e){return`${e?.light??``}|${e?.dark??``}`}var Ut=`theme-color`,Wt=`meta[name="${Ut}"][data-dynamic-theme-color="true"]`,P=class extends ze()(`ThemeStorageError`,{operation:c([`read`,`write`]),storageKey:u,theme:Pe(at),cause:de()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},Gt=je(P),Kt=class extends ze()(`DesktopThemeSyncError`,{theme:at,cause:de()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},qt=je(Kt),F=[],I=null,Jt=!0,L=null,R=null,z=null;function B(){Jt=!0;for(let e of F)e()}function Yt(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(zt).matches}function Xt(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(ot);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function Zt(e){return e===`light`||e===`dark`||e===`system`}function V(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(x);if(Zt(e))return e}catch{}return Xt(e)?`system`:tt(e)??`light`}function Qt(e){if(typeof window<`u`)try{window.localStorage.setItem(x,e)}catch(e){throw new P({operation:`write`,storageKey:x,cause:e})}}function $t(){if(typeof window>`u`)return j.theme;let e;try{e=window.localStorage.getItem(A)}catch(e){throw new P({operation:`read`,storageKey:A,cause:e})}return e!==null&&ct(e)?it(e):j.theme}function en(e){if(typeof window<`u`)try{window.localStorage.setItem(A,e),z=null}catch(t){throw new P({operation:`write`,storageKey:A,theme:e,cause:t})}}function H(){if(z!==null)return j.theme;try{return $t()}catch(e){let t=Gt(e)?e:new P({operation:`read`,storageKey:A,cause:e});return z=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),j.theme}}function tn(){let e=document.querySelector(Wt);return e||(e=document.createElement(`meta`),e.name=Ut,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function nn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function rn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function an(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?nn(e.getPropertyValue(`--app-chrome-background`)):null,n=nn(getComputedStyle(rn()).backgroundColor),r=nn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${Ut}"]`);if(a.length===0){tn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function U(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=V(e),i=r===`system`,a=i?Yt():!1,o=M();if(R?.theme===e&&R.systemDark===a&&R.followSystem===i&&R.appearanceMode===r&&N(R.themeHalves)===N(o)){sn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=$e(e,a,i,r,o);nt(Ze(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),R={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},an(),sn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function on(e,t,n,r,i=M()){try{await e.setTheme(Qe(t,n,r,i))}catch(e){throw new Kt({theme:t,cause:e})}}function sn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=M(),a=Qe(e,t,n,i);r&&typeof r.setTheme==`function`&&L!==a&&(L=a,on(r,e,t,n,i).catch(t=>{let n=qt(t)?t:new Kt({theme:e,cause:t});console.error(n.message,{theme:n.theme,...g(n)}),L===a&&(L=null)}))}typeof document<`u`&&typeof window<`u`&&U(H());function cn(){if(typeof window>`u`)return j;if(!Jt&&I)return I;Jt=!1;let e=H(),t=V(e),n=t===`system`,r=n?Yt():!1,i=M(),a=$e(e,r,n,t,i);return I&&I.theme===e&&I.resolvedTheme===a&&I.systemDark===r&&I.followSystem===n&&I.appearanceMode===t&&N(I.themeHalves)===N(i)||(I={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),I}function ln(){return j}function un(){let e=H();V(e)===`system`&&U(e,{suppressTransitions:!0}),B()}function dn(e){e.key===A?(z=null,U(H(),{suppressTransitions:!0}),B()):e.key===`t3code:theme-follow-system`||e.key===`t3code:theme-appearance-mode`||e.key===`t3code:theme-halves:v1`?(U(H(),{suppressTransitions:!0}),B()):(e.key===`t3code:themes:v1`||e.key===null)&&(e.key===null&&(z=null),Xe(),R=null,U(H(),{suppressTransitions:!0}),B())}var W=null;function fn(e){if(typeof window>`u`)return()=>{};if(F.push(e),!W){let e=typeof window.matchMedia==`function`?window.matchMedia(zt):null;e?.addEventListener(`change`,un),window.addEventListener(`storage`,dn),W=()=>{e?.removeEventListener(`change`,un),window.removeEventListener(`storage`,dn)}}return()=>{F=F.filter(t=>t!==e),F.length===0&&(W?.(),W=null)}}function pn(){let e=(0,S.useSyncExternalStore)(fn,cn,ln),{theme:t,resolvedTheme:n}=e,r=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(V(H()));let t=window.localStorage.getItem(b);window.localStorage.removeItem(b);try{en(e)}catch(e){if(t!==null)try{window.localStorage.setItem(b,t)}catch{}throw e}}catch(t){let n=Gt(t)?t:new P({operation:`write`,storageKey:A,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...g(n)}),!1}return U(e,{suppressTransitions:!0}),B(),!0},[]),i=(0,S.useCallback)(e=>{if(typeof window>`u`)return!1;try{Qt(e)}catch(e){let t=Gt(e)?e:new P({operation:`write`,storageKey:x,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return z=null,U(H(),{suppressTransitions:!0}),B(),!0},[]),a=(0,S.useCallback)(e=>{let n=V(t),r=e?`system`:n===`system`?tt(t)??`light`:n;return i(r)},[i,t]),o=(0,S.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...Ht()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(b):window.localStorage.setItem(b,JSON.stringify(n))}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),s=(0,S.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(b)}catch(e){let t=new P({operation:`write`,storageKey:b,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...g(t)}),!1}return U(H(),{suppressTransitions:!0}),B(),!0},[]),c=(0,S.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(R=null,U(H(),{suppressTransitions:!0,preservePreview:e}),B())},[]);return(0,S.useEffect)(()=>{U(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var mn=ee(ke(me)),hn=oe(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),mn(t).pipe(Ce(e=>e.issue))}),gn=new ae(hn,re());De().pipe(i(re({space:2})));var _n=e=>u.pipe(ge(e,gn)),G={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:f(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:Ee,providerHealthRefreshInterval:Fe,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:f(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:f(15),hostPowerMonitorActiveInterval:f(1),hostPowerMonitorIdleInterval:f(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function K(e){return G[e]}function q(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function vn(e){let t=q(e),n=G[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return p(e)===p(t)}function yn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function bn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=vn(e),n=[q(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(yn(t,G[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=q(e),i=G[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function xn(e){let t={schemaVersion:1,profile:ve,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||p(e.automaticGitFetchInterval)!==p(Ee)||p(e.providerHealthRefreshInterval)!==p(Fe);return vn(n&&i?{schemaVersion:1,profile:p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)&&p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...p(e.automaticGitFetchInterval)===p(K(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...p(e.providerHealthRefreshInterval)===p(K(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Sn(e){let t=xn(e);return bn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Cn=_n(Te);se(Cn);function wn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?be(t.instanceId):fe(n)}var Tn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>Me.make(e));function En(e,t,n){let r=[...Tn.map(e=>[Ae(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Tn.includes(t.driver)?[[Oe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&ce(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:l[a]??ie[a]??`gpt-6-luna`}}function Dn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ie(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&we(i)&&_e(i)?r:e.textGenerationModelSelection}function On(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ie(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&we(e)&&_e(e))return r}return Dn(e,t,n)}function kn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function An(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var jn=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function Mn(e){let t={},n={};for(let[r,i]of Object.entries(e))jn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function Nn(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!wn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Le(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Le(e,[`continueThreadsAfterServerUpdate`])}function Pn(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}var Fn=`[CLIENT_SETTINGS]`,In=new Set,Ln=new Set,Rn=xe,Y=`pending`,X=null,zn=0,Bn=Promise.resolve(),Vn=0;function Hn(){for(let e of In)e()}function Un(){for(let e of Ln)e()}function Z(){return Rn}function Wn(e){Rn=e,Hn()}function Gn(e){Y!==e&&(Y=e,Un())}function Kn(e){return In.add(e),Q().catch(()=>void 0),()=>{In.delete(e)}}function qn(){return Y===`ready`}function Jn(){return Y}function Yn(e){return Ln.add(e),Q().catch(()=>void 0),()=>{Ln.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=zn;Gn(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await Rt().persistence.getClientSettings();if(e!==zn)return;t&&Wn({...xe,...t}),Gn(`ready`)}catch(t){throw e===zn&&Gn(`failed`),console.error(`${Fn} hydrate failed`,{operation:`hydrate`,...g(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Xn=e=>Rt().persistence.setClientSettings(e);function Zn(e){let t=Bn.then(e);return Bn=t.then(()=>void 0,()=>void 0),t}function Qn(e,t=Xn){let n=Y!==`ready`||Vn>0;return n?Vn+=1:Wn({...Z(),...e}),Zn(async()=>{if(n)try{Y!==`ready`&&await Q(),Wn({...Z(),...e})}finally{--Vn}await t(Z())}).catch(e=>{console.error(`${Fn} persist failed`,{operation:`persist`,...g(e)})})}async function $n(e,t=Xn){return Zn(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Wn(r),r}})}var er=new Set(ye(Te.fields));function tr(e){let t={},n={};for(let[r,i]of Object.entries(e))er.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function nr(){return Z()}function rr(){return Q()}function ir(){return(0,S.useSyncExternalStore)(Yn,qn,ar)}function ar(){return!1}function or(){return(0,S.useSyncExternalStore)(Yn,Jn,sr)}function sr(){return`pending`}function $(){return(0,S.useSyncExternalStore)(Kn,Z,cr)}function cr(){return xe}function lr(e,t){return{...t,...e,...kn(e,t)}}var ur=new Set;function dr(e,t){let n=(0,C.c)(8),r=$(),i=ir(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=y(v.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||ur.has(e))return;let n=An(t,r);n&&(ur.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>ur.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,S.useEffect)(s,c)}function fr(e,t){let n=(0,C.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=lr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function pr(e){let t=(0,C.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function mr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function hr(){let e=(0,C.c)(7),t=ir(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=pn(),o=(0,S.useSyncExternalStore)(Ye,lt,gr),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=Ze(i,a,r),l=st(c);s=mr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??et(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function gr(){return null}async function _r(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await rr(),{...An(e,nr()),...t}}function vr(e){let t=(0,C.c)(6),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=y(v.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await _r(r,t)}catch{_.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function yr(e){let t=(0,S.use)(he),n=(0,S.useRef)(new Map),r=vr(e);return(0,S.useCallback)(async(i,a)=>{if(!e)return;let o=v.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await rr()}catch{_.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=kn(c,nr()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&Re(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var br=n(null);function xr(e){let t=(0,C.c)(5),n;t[0]===e?n=t[1]:(n=e?v.settingsValueAtom(e):br,t[0]=e,t[1]=n);let r=h(n),i=$();dr(e,r);let a=r??Se,o;return t[2]!==i||t[3]!==a?(o=kn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function Sr(e,t){let n=(0,C.c)(2),r;n[0]===e?r=n[1]:(r=v.settingsValueAtom(e),n[0]=e,n[1]=r);let i=h(r);return dr(e,i),fr(i??Se,t)}function Cr(e){let t=(0,C.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=y(v.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function wr(e){let t=We(),n=h(Ge);return dr(t?.environmentId??null,t?.serverConfig?.settings??null),fr(n,e)}var Tr=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function Er(){let e=(0,C.c)(2),t=We(),n;return e[0]===t?n=e[1]:(n=t!==null||!He(),e[0]=t,e[1]=n),n}function Dr(e){let t=(0,C.c)(3),i=e!==void 0&&e,{environments:a}=Ue(),o;return t[0]!==a||t[1]!==i?(o=n(e=>a.filter(Pn).flatMap(t=>{let n=e(Je.sessionStateAtom(t.environmentId));if(i&&n._tag===`Initial`)return[t.environmentId];let a=n._tag===`Failure`?null:ne(ue(n));return a!==null&&r(a,`settings:write`)?[t.environmentId]:[]})),t[0]=a,t[1]=i,t[2]=o):o=t[2],h(o)}function Or(e){let t=(0,C.c)(10);Ke(e,le);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=y(v.updateSettings,n),{environments:i}=Ue(),o;t[1]!==i||t[2]!==r?(o=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Be(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ve(t);_.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=o):o=t[3];let s=o,c=Dr(!0),l;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==s||t[8]!==c?(l=t=>{let{serverPatch:n,clientPatch:o}=tr(t),l=e===null||a(n).every(t=>qe(e,t));if(Object.keys(n).length>0&&!l&&_.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&l){let{sharedPatch:t,localPatch:o}=Mn(n),l=Nr;if(Object.keys(o).length>0&&(e?s({environmentId:e,input:{patch:o}}):l()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,o=new Set(c);e&&o.add(e);let s=[],u=[];for(let r of o){let o=i.find(e=>e.environmentId===r),c=Nn(t,o?.serverConfig?.environment.capabilities,o?.serverConfig?.settings,n,r===e);if(Object.keys(c).length!==0){if(d.get(Je.sessionStateAtom(r))._tag!==`Initial`&&!a(t).every(e=>qe(r,e))){u.push(o?.label??r);continue}s.push({environmentId:r,input:{patch:c}})}}s.length===0?l(u.length>0?`This connection lacks permission to change settings on ${u.join(`, `)}.`:o.size>0?`Update older servers to save this setting.`:void 0):Promise.all(s.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(kr)}}Object.keys(o).length>0&&Qn(o)},t[4]=e,t[5]=i,t[6]=r,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function kr(e){let t=e.flatMap(Mr);if(t.length===0)return;let n=e.filter(jr).map(Ar);_.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
2
2
  `)})}function Ar(e){let{label:t}=e;return t}function jr(e){let{result:t}=e;return t._tag===`Success`}function Mr(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Be(n))return[];let r=Ve(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function Nr(e){let t=e===void 0?Tr:e;return _.add({type:`warning`,title:`Setting not saved`,description:t})}function Pr(e){return Or(e)}function Fr(){return Or(We()?.environmentId??null)}function Ir(){return Lr}function Lr(e){return Qn(e)}export{_n as A,yt as B,On as C,bn as D,K as E,an as F,vt as G,pt as H,pn as I,mt as K,Rt as L,Bt as M,Vt as N,Sn as O,$t as P,Lt as R,En as S,q as T,ht as U,_t as V,gt as W,yr as _,Qn as a,Pr as b,ir as c,xr as d,Sr as f,Er as g,wr as h,lr as i,V as j,xn as k,or as l,Cr as m,rr as n,$n as o,dr as p,nr as r,pr as s,Tr as t,hr as u,Ir as v,Dn as w,Fr as x,vr as y,Dt as z};
3
- //# sourceMappingURL=useSettings-WGf2H_E7.js.map
3
+ //# sourceMappingURL=useSettings-DCI8Hv09.js.map
@@ -1,2 +1,2 @@
1
- import{ME as e}from"./utils-CRwA5SKO.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-Byy10brL.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
- //# sourceMappingURL=useT3ConnectAuthPrompt-DkfGkujP.js.map
1
+ import{ME as e}from"./utils-CRwA5SKO.js";import{t}from"./env-wK1YYxA8.js";import{i as n}from"./dist-Bd1WIVAz.js";import{t as r}from"./authRedirect-DWE5a_T9.js";var i=e();function a(){let e=(0,i.c)(2),a=n(),o;return e[0]===a?o=e[1]:(o={authPrompt:null,openAuthPrompt:()=>{a.openSignIn(r(window.location.href,t))}},e[0]=a,e[1]=o),o}export{a as t};
2
+ //# sourceMappingURL=useT3ConnectAuthPrompt-C7Dm8xCm.js.map
@@ -1,2 +1,2 @@
1
- import{$o as e,A_ as t,Ax as n,Bx as r,Dx as i,Lc as a,ME as o,Qo as s,RS as c,VS as l,Xx as u,ZS as d,Zo as f,bx as p,cC as m,dC as ee,eC as h,f_ as g,fx as _,iS as v,jT as te,jw as y,lC as ne,nC as b,nx as x,ow as S,ox as C,rx as w,ss as T,tx as E,uC as D,zT as O}from"./utils-CRwA5SKO.js";import{N as k,_t as A,k as j,qt as M}from"./runtime-B3_ce0WW.js";import{$ as N,X as P,et as F,it as I,nt as L,tt as R}from"./entities-DSlJSLqU.js";import{t as z}from"./runtime-BtqGaFGQ.js";import{f as re}from"./environments-DcJA_6Bd.js";import{t as B}from"./session-B20XW_sH.js";import{n as V}from"./query-CpOQgkic.js";var H=o(),U=`~effect/PartitionedSemaphore`,W=e=>{let t=Math.max(0,e.permits);if(!Number.isFinite(t))return{[U]:U,capacity:t,available:c(t),take:()=>h,release:()=>c(t),withPermits:()=>e=>e,withPermit:()=>e=>e,withPermitsIfAvailable:()=>e=>w(e)};let n=t,r=0,a=m(),o=a[Symbol.iterator](),s=!1,u=0,f=e=>{if(e>0&&(u+=e),!s){s=!0;try{for(;u>0&&r>0;){let e=o.next();if(e.done&&(o=a[Symbol.iterator](),e=o.next(),e.done))break;let t=e.value[1].values().next().value;t!==void 0&&(--t.permits,--r,--u,t.permits===0&&t.resume())}}finally{s=!1}}return r===0&&(n=Math.min(t,n+u),u=0),n},g=(e,i)=>i<=0?h:t<i?v:b(t=>n>=i?(n-=i,y(t,e=>{S(e)&&f(i)}),h):C(t=>{if(n>=i){t(g(e,i));return}let o=i-n;n>0&&(n=0),r+=o;let s=te(ne(a,e),()=>{let t=new Set;return ee(a,e,t),t}),c={permits:o,resume:()=>{u(),t(h)}},u=()=>{s.delete(c)&&s.size===0&&D(a,e)};return s.add(c),l(()=>{u(),r-=c.permits,f(i-c.permits)})})),_=(e,t)=>n=>{if(t<=0)return n;let r=g(e,t);return d(e=>i(e(r),()=>p(e(n),l(()=>{f(t)}))))},x=e=>e<=0?!0:t<e||n<e?!1:(n-=e,!0);return{[U]:U,capacity:t,available:l(()=>n),take:g,release:e=>l(()=>f(e)),withPermits:_,withPermit:e=>_(e,1),withPermitsIfAvailable:e=>t=>e<=0?w(t):b(n=>x(e)?(y(n,()=>{f(e)}),w(t)):c(O()))}};function G(e){if(e.sessionError!==null)return{canReadFiles:!1,isPending:!1,error:e.sessionError};if(e.session===null){let t=!e.isCatalogReady||e.connection?.phase===`connected`||e.connection?.phase===`connecting`||e.connection?.phase===`reconnecting`;return{canReadFiles:!1,isPending:t,error:t?null:e.connection?.error??`This environment is not connected.`}}return{canReadFiles:t(e.session,g),isPending:!1,error:null}}function K(e,t=``,n=!0){let r=n&&I(e,t),i=r?N(e):``;return{isBrowsing:r,directoryPath:i,filterQuery:r&&!L(e)?F(e):``,parentPath:r?R(i):null,canBrowseUp:r&&P(i)}}function q(e,t){let n=t.toLowerCase(),r=t.startsWith(`.`),i=e.filter(e=>e.name.toLowerCase().startsWith(n)&&(r||!e.name.startsWith(`.`)));return{visibleEntries:i,exactEntry:t.length>0?i.find(e=>e.name===t)??null:null}}function J(){let e=0;return{invalidate:()=>{e+=1},run:async(t,n)=>{let r=++e;return await t(),r===e&&(n(),!0)}}}function Y(e){return e===`connected`}function X(e){return{browse:k(e,{label:`environment-data:filesystem:browse`,tag:a.filesystemBrowse})}}var ie=X(z);function ae(e){let t=(0,H.c)(7),n;t[0]===e?n=t[1]:(n=e===null?null:B.sessionStateAtom(e),t[0]=e,t[1]=n);let r=V(n),i=re(e),a=i.presentation?.connection??null,o;return t[2]!==i.isReady||t[3]!==r.data||t[4]!==r.error||t[5]!==a?(o=G({isCatalogReady:i.isReady,connection:a,session:r.data,sessionError:r.error}),t[2]=i.isReady,t[3]=r.data,t[4]=r.error,t[5]=a,t[6]=o):o=t[6],o}var oe=j(),se={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd])},ce=f(t=>e({revision:0,persistedCacheReadable:!0}).pipe(s,T(`environment-data:vcs:list-refs-state:${t}`))),Z=W({permits:1});function Q(e){return ce(e.environmentId)}function le(e,t,n){e.update(Q(t),e=>({revision:e.revision+1,persistedCacheReadable:n??e.persistedCacheReadable}))}function $(e,t){return Z.withPermit(e)(t)}var ue=n(`VcsRefsState.invalidateCached`)(function*(e,t){let n=yield*M;yield*$(t.environmentId,r(function*(){le(e,t,yield*n.clearVcsRefs(t.environmentId).pipe(x(!0),_(e=>u(`Could not remove invalidated cached Git refs.`).pipe(E({environmentId:t.environmentId,cwd:t.cwd,...A(e)}),x(!1)))))}))});export{oe as a,Y as c,K as d,se as i,J as l,Q as n,ie as o,$ as r,ae as s,ue as t,q as u};
2
- //# sourceMappingURL=vcsRefInvalidation-CUgwItfg.js.map
1
+ import{$o as e,A_ as t,Ax as n,Bx as r,Dx as i,Lc as a,ME as o,Qo as s,RS as c,VS as l,Xx as u,ZS as d,Zo as f,bx as p,cC as m,dC as ee,eC as h,f_ as g,fx as _,iS as v,jT as te,jw as y,lC as ne,nC as b,nx as x,ow as S,ox as C,rx as w,ss as T,tx as E,uC as D,zT as O}from"./utils-CRwA5SKO.js";import{N as k,_t as A,k as j,qt as M}from"./runtime-DZfpb67Q.js";import{$ as N,X as P,et as F,it as I,nt as L,tt as R}from"./entities-DPIZFvN7.js";import{t as z}from"./runtime-Bc4kgQim.js";import{f as re}from"./environments-Dm2_6Uan.js";import{t as B}from"./session-Bc1P10r_.js";import{n as V}from"./query-CpOQgkic.js";var H=o(),U=`~effect/PartitionedSemaphore`,W=e=>{let t=Math.max(0,e.permits);if(!Number.isFinite(t))return{[U]:U,capacity:t,available:c(t),take:()=>h,release:()=>c(t),withPermits:()=>e=>e,withPermit:()=>e=>e,withPermitsIfAvailable:()=>e=>w(e)};let n=t,r=0,a=m(),o=a[Symbol.iterator](),s=!1,u=0,f=e=>{if(e>0&&(u+=e),!s){s=!0;try{for(;u>0&&r>0;){let e=o.next();if(e.done&&(o=a[Symbol.iterator](),e=o.next(),e.done))break;let t=e.value[1].values().next().value;t!==void 0&&(--t.permits,--r,--u,t.permits===0&&t.resume())}}finally{s=!1}}return r===0&&(n=Math.min(t,n+u),u=0),n},g=(e,i)=>i<=0?h:t<i?v:b(t=>n>=i?(n-=i,y(t,e=>{S(e)&&f(i)}),h):C(t=>{if(n>=i){t(g(e,i));return}let o=i-n;n>0&&(n=0),r+=o;let s=te(ne(a,e),()=>{let t=new Set;return ee(a,e,t),t}),c={permits:o,resume:()=>{u(),t(h)}},u=()=>{s.delete(c)&&s.size===0&&D(a,e)};return s.add(c),l(()=>{u(),r-=c.permits,f(i-c.permits)})})),_=(e,t)=>n=>{if(t<=0)return n;let r=g(e,t);return d(e=>i(e(r),()=>p(e(n),l(()=>{f(t)}))))},x=e=>e<=0?!0:t<e||n<e?!1:(n-=e,!0);return{[U]:U,capacity:t,available:l(()=>n),take:g,release:e=>l(()=>f(e)),withPermits:_,withPermit:e=>_(e,1),withPermitsIfAvailable:e=>t=>e<=0?w(t):b(n=>x(e)?(y(n,()=>{f(e)}),w(t)):c(O()))}};function G(e){if(e.sessionError!==null)return{canReadFiles:!1,isPending:!1,error:e.sessionError};if(e.session===null){let t=!e.isCatalogReady||e.connection?.phase===`connected`||e.connection?.phase===`connecting`||e.connection?.phase===`reconnecting`;return{canReadFiles:!1,isPending:t,error:t?null:e.connection?.error??`This environment is not connected.`}}return{canReadFiles:t(e.session,g),isPending:!1,error:null}}function K(e,t=``,n=!0){let r=n&&I(e,t),i=r?N(e):``;return{isBrowsing:r,directoryPath:i,filterQuery:r&&!L(e)?F(e):``,parentPath:r?R(i):null,canBrowseUp:r&&P(i)}}function q(e,t){let n=t.toLowerCase(),r=t.startsWith(`.`),i=e.filter(e=>e.name.toLowerCase().startsWith(n)&&(r||!e.name.startsWith(`.`)));return{visibleEntries:i,exactEntry:t.length>0?i.find(e=>e.name===t)??null:null}}function J(){let e=0;return{invalidate:()=>{e+=1},run:async(t,n)=>{let r=++e;return await t(),r===e&&(n(),!0)}}}function Y(e){return e===`connected`}function X(e){return{browse:k(e,{label:`environment-data:filesystem:browse`,tag:a.filesystemBrowse})}}var ie=X(z);function ae(e){let t=(0,H.c)(7),n;t[0]===e?n=t[1]:(n=e===null?null:B.sessionStateAtom(e),t[0]=e,t[1]=n);let r=V(n),i=re(e),a=i.presentation?.connection??null,o;return t[2]!==i.isReady||t[3]!==r.data||t[4]!==r.error||t[5]!==a?(o=G({isCatalogReady:i.isReady,connection:a,session:r.data,sessionError:r.error}),t[2]=i.isReady,t[3]=r.data,t[4]=r.error,t[5]=a,t[6]=o):o=t[6],o}var oe=j(),se={mode:`serial`,key:({environmentId:e,input:t})=>JSON.stringify([e,t.cwd])},ce=f(t=>e({revision:0,persistedCacheReadable:!0}).pipe(s,T(`environment-data:vcs:list-refs-state:${t}`))),Z=W({permits:1});function Q(e){return ce(e.environmentId)}function le(e,t,n){e.update(Q(t),e=>({revision:e.revision+1,persistedCacheReadable:n??e.persistedCacheReadable}))}function $(e,t){return Z.withPermit(e)(t)}var ue=n(`VcsRefsState.invalidateCached`)(function*(e,t){let n=yield*M;yield*$(t.environmentId,r(function*(){le(e,t,yield*n.clearVcsRefs(t.environmentId).pipe(x(!0),_(e=>u(`Could not remove invalidated cached Git refs.`).pipe(E({environmentId:t.environmentId,cwd:t.cwd,...A(e)}),x(!1)))))}))});export{oe as a,Y as c,K as d,se as i,J as l,Q as n,ie as o,$ as r,ae as s,ue as t,q as u};
2
+ //# sourceMappingURL=vcsRefInvalidation-3pHpDJC2.js.map
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-oBChb5qS.js";import{$ as n,H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,tt as f,v as p,w as m,y as h}from"./chunk-DU6HZSFF-Dj0ZwIfN.js";import{i as g}from"./chunk-75Z2AOVW-BA8jPDfc.js";import{t as _}from"./rough.esm-Dy-Kn_BL.js";import{f as v}from"./mermaid.core-BUABPjrf.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{p as t}from"./src-oBChb5qS.js";import{$ as n,H as r,K as i,U as a,a as o,b as s,c,et as l,f as u,nt as d,tt as f,v as p,w as m,y as h}from"./chunk-DU6HZSFF-zhv2Vnfx.js";import{i as g}from"./chunk-75Z2AOVW-LBmwoUvq.js";import{t as _}from"./rough.esm-Dy-Kn_BL.js";import{f as v}from"./mermaid.core-C6GXL70P.js";var y=(e,t)=>f(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e==="default"?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
@@ -32,4 +32,4 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l
32
32
  color: ${e.vennSetTextColor};
33
33
  }
34
34
  `,`getStyles`);function Ve(e){let t=new Map;for(let n of e){let e=n.targets.join(`|`),r=t.get(e);r?Object.assign(r,n.styles):t.set(e,{...n.styles})}return t}e(Ve,`buildStyleByKey`);var He=e((e,r,i,a)=>{let o=a.db,u=o.getConfig?.(),{themeVariables:f,look:p,handDrawnSeed:m}=s(),h=p===`handDrawn`,g=[f.venn1,f.venn2,f.venn3,f.venn4,f.venn5,f.venn6,f.venn7,f.venn8].filter(Boolean),b=o.getDiagramTitle?.(),x=o.getSubsetData(),S=o.getTextData(),C=Ve(o.getStyleData()),w=We(x),T=u?.width??800,E=u?.height??450,D=T/1600,O=b?48*D:0,k=f.primaryTextColor??f.textColor,A=v(r);A.attr(`viewBox`,`0 0 ${T} ${E}`),b&&A.append(`text`).text(b).attr(`class`,`venn-title`).attr(`font-size`,`${32*D}px`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`x`,`50%`).attr(`y`,32*D).style(`fill`,f.vennTitleTextColor||f.titleColor);let j=t(document.createElement(`div`)),M=he().width(T).height(E-O);j.datum(w).call(M);let N=h?_.svg(j.select(`svg`).node()):void 0,P=we(w,{width:T,height:E-O,padding:u?.padding??15}),F=new Map;for(let e of P){let t=$([...e.data.sets].sort());F.set(t,e)}S.length>0&&Ue(u,F,j,S,D,C);let I=d(f.background||`#f4f4f4`);j.selectAll(`.venn-circle`).each(function(e,r){let i=t(this),a=$([...e.sets].sort()),o=C.get(a),s=o?.fill||g[r%g.length]||f.primaryColor;i.classed(`venn-set-${r%8}`,!0);let c=o?.[`fill-opacity`]??.1,u=o?.stroke||s,d=o?.[`stroke-width`]||`${5*D}`;if(h&&N){let e=F.get(a);if(e&&e.circles.length>0){let t=e.circles[0],n=N.circle(t.x,t.y,t.radius*2,{roughness:.7,seed:m,fill:y(s,.7),fillStyle:`hachure`,fillWeight:2,hachureGap:8,hachureAngle:-41+r*60,stroke:u,strokeWidth:parseFloat(String(d))});i.select(`path`).remove(),i.node()?.insertBefore(n,i.select(`text`).node())}}else i.select(`path`).style(`fill`,s).style(`fill-opacity`,c).style(`stroke`,u).style(`stroke-width`,d).style(`stroke-opacity`,.95);let p=o?.color||(I?l(s,30):n(s,30));i.select(`text`).style(`font-size`,`${48*D}px`).style(`fill`,p)}),h&&N?j.selectAll(`.venn-intersection`).each(function(e){let n=t(this),r=$([...e.sets].sort()),i=C.get(r),a=i?.fill;if(a){let e=n.select(`path`),t=e.attr(`d`);if(t){let n=N.path(t,{roughness:.7,seed:m,fill:y(a,.3),fillStyle:`cross-hatch`,fillWeight:2,hachureGap:6,hachureAngle:60,stroke:`none`}),r=e.node();r?.parentNode?.insertBefore(n,r),e.remove()}}else n.select(`path`).style(`fill-opacity`,0);n.select(`text`).style(`font-size`,`${48*D}px`).style(`fill`,i?.color??f.vennSetTextColor??k)}):(j.selectAll(`.venn-intersection text`).style(`font-size`,`${48*D}px`).style(`fill`,e=>{let t=$([...e.sets].sort());return C.get(t)?.color??f.vennSetTextColor??k}),j.selectAll(`.venn-intersection path`).style(`fill-opacity`,e=>{let t=$([...e.sets].sort());return+!!C.get(t)?.fill}).style(`fill`,e=>{let t=$([...e.sets].sort());return C.get(t)?.fill??`transparent`}));let L=A.append(`g`).attr(`transform`,`translate(0, ${O})`),R=j.select(`svg`).node();if(R&&`childNodes`in R)for(let e of[...R.childNodes])L.node()?.appendChild(e);c(A,E,T,u?.useMaxWidth??!0)},`draw`);function $(e){return e.join(`|`)}e($,`stableSetsKey`);function Ue(e,t,n,r,i,a){let o=e?.useDebugLayout??!1,s=n.select(`svg`).append(`g`).attr(`class`,`venn-text-nodes`),c=new Map;for(let e of r){let t=$(e.sets),n=c.get(t);n?n.push(e):c.set(t,[e])}for(let[e,n]of c.entries()){let r=t.get(e);if(!r?.text)continue;let c=r.text.x,l=r.text.y,u=Math.min(...r.circles.map(e=>e.radius)),d=Math.min(...r.circles.map(e=>e.radius-Math.hypot(c-e.x,l-e.y))),f=Number.isFinite(d)?Math.max(0,d):0;f===0&&Number.isFinite(u)&&(f=u*.6);let p=s.append(`g`).attr(`class`,`venn-text-area`).attr(`font-size`,`${40*i}px`);o&&p.append(`circle`).attr(`class`,`venn-text-debug-circle`).attr(`cx`,c).attr(`cy`,l).attr(`r`,f).attr(`fill`,`none`).attr(`stroke`,`purple`).attr(`stroke-width`,1.5*i).attr(`stroke-dasharray`,`${6*i} ${4*i}`);let m=Math.max(80*i,f*2*.95),h=Math.max(60*i,f*2*.95),g=(r.data.label&&r.data.label.length>0?Math.min(32*i,f*.25):0)+(n.length<=2?30*i:0),_=c-m/2,v=l-h/2+g,y=Math.max(1,Math.ceil(Math.sqrt(n.length))),b=Math.max(1,Math.ceil(n.length/y)),x=m/y,S=h/b;for(let[e,t]of n.entries()){let n=e%y,r=Math.floor(e/y),s=_+x*(n+.5),c=v+S*(r+.5);o&&p.append(`rect`).attr(`class`,`venn-text-debug-cell`).attr(`x`,_+x*n).attr(`y`,v+S*r).attr(`width`,x).attr(`height`,S).attr(`fill`,`none`).attr(`stroke`,`teal`).attr(`stroke-width`,1*i).attr(`stroke-dasharray`,`${4*i} ${3*i}`);let l=x*.9,u=S*.9,d=p.append(`foreignObject`).attr(`class`,`venn-text-node-fo`).attr(`width`,l).attr(`height`,u).attr(`x`,s-l/2).attr(`y`,c-u/2).attr(`overflow`,`visible`),f=a.get(t.id)?.color,m=d.append(`xhtml:span`).attr(`class`,`venn-text-node`).style(`display`,`flex`).style(`width`,`100%`).style(`height`,`100%`).style(`white-space`,`normal`).style(`align-items`,`center`).style(`justify-content`,`center`).style(`text-align`,`center`).style(`overflow-wrap`,`normal`).style(`word-break`,`normal`).text(t.label??t.id);f&&m.style(`color`,f)}}}e(Ue,`renderTextNodes`);function We(e){let t=new Set(e.map(e=>[...e.sets].sort().join(`|`))),n=new Map(e.filter(e=>e.sets.length===1&&e.size!==void 0).map(e=>[e.sets[0],e.size])),r=[];for(let i of e){if(i.sets.length<3)continue;let e=[...i.sets].sort();for(let i=0;i<e.length-1;i++)for(let a=i+1;a<e.length;a++){let o=[e[i],e[a]],s=o.join(`|`);if(!t.has(s)){t.add(s);let e=n.get(o[0]),i=n.get(o[1]),a=e!==void 0&&i!==void 0?Math.min(e,i)/4:2.5;r.push({sets:o,size:a,label:``})}}}return r.length>0?[...e,...r]:e}e(We,`ensurePairwiseSubsets`);var Ge={parser:Te,db:ze,renderer:{draw:He},styles:Be};export{Ge as diagram};
35
- //# sourceMappingURL=vennDiagram-4TSXK5OY-D82sXWUt.js.map
35
+ //# sourceMappingURL=vennDiagram-4TSXK5OY-Bw5_1h9Y.js.map
@@ -1 +1 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{i as e}from"./mermaid-parser.core-Dm-CGUQK.js";export{e as createWardleyServices};
1
+ import"./chunk-FOHPRMQF-DzxwRta7.js";import{i as e}from"./mermaid-parser.core-DcamukpZ.js";export{e as createWardleyServices};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./mermaid-parser.core-Dm-CGUQK.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-oBChb5qS.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,v as u,w as d,x as f,y as p}from"./chunk-DU6HZSFF-Dj0ZwIfN.js";import{i as m}from"./chunk-75Z2AOVW-BA8jPDfc.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as g}from"./mermaid.core-BUABPjrf.js";var _=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=t((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=t((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:t(async t=>{let r=await e(`wardley`,t);n.debug(r);let i=S.parser?.yy;if(!i||typeof i.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(r,i)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return f()[`wardley-beta`]}t(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}t(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}t(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}t(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}t(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}t(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}t(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}t(N,`setSize`);function P(e){C.startPipeline(e)}t(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}t(F,`addPipelineComponent`);function I(e){C.setAxes(e)}t(I,`updateAxes`);function L(e){return C.getNode(e)}t(L,`getNode`);function R(e){return C.resolveNodeId(e)}t(R,`resolveNodeId`);function z(){return C.build()}t(z,`getWardleyData`);function B(){C.clear(),s()}t(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:o,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:d,getAccDescription:u,setAccDescription:i},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=t(()=>{let{themeVariables:e}=f();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=t(()=>{let e=f()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:t((e,r,i,a)=>{n.debug(`Rendering Wardley map
1
+ import{n as e}from"./mermaid-parser.core-DcamukpZ.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-oBChb5qS.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,v as u,w as d,x as f,y as p}from"./chunk-DU6HZSFF-zhv2Vnfx.js";import{i as m}from"./chunk-75Z2AOVW-LBmwoUvq.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as g}from"./mermaid.core-C6GXL70P.js";var _=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=t((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=t((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:t(async t=>{let r=await e(`wardley`,t);n.debug(r);let i=S.parser?.yy;if(!i||typeof i.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(r,i)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return f()[`wardley-beta`]}t(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}t(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}t(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}t(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}t(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}t(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}t(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}t(N,`setSize`);function P(e){C.startPipeline(e)}t(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}t(F,`addPipelineComponent`);function I(e){C.setAxes(e)}t(I,`updateAxes`);function L(e){return C.getNode(e)}t(L,`getNode`);function R(e){return C.resolveNodeId(e)}t(R,`resolveNodeId`);function z(){return C.build()}t(z,`getWardleyData`);function B(){C.clear(),s()}t(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:o,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:d,getAccDescription:u,setAccDescription:i},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=t(()=>{let{themeVariables:e}=f();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=t(()=>{let e=f()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:t((e,r,i,a)=>{n.debug(`Rendering Wardley map
2
2
  `+e);let o=W(),s=U(),c=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,m=d.size?.height??o.height,h=g(r);h.selectAll(`*`).remove(),l(h,m,p,o.useMaxWidth),h.attr(`viewBox`,`0 0 ${p} ${m}`);let _=h.append(`g`).attr(`class`,`wardley-map`),v=h.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,m).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=m-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>m-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,m-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,m-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding-b*n).attr(`y2`,m-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,h=o.padding,g=m-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(h,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-15}
4
4
  L ${n+60-20} ${r-15}
@@ -76,4 +76,4 @@ import{n as e}from"./mermaid-parser.core-Dm-CGUQK.js";import{n as t}from"./chunk
76
76
  fill: ${a.axisTextColor};
77
77
  }
78
78
  `},`styles`)};export{G as diagram};
79
- //# sourceMappingURL=wardleyDiagram-VM6X3IG4-DZkAGgtY.js.map
79
+ //# sourceMappingURL=wardleyDiagram-VM6X3IG4-RCSx0hV5.js.map