@microvac/ui 0.1.0-rc.14 → 0.1.0-rc.15

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 (280) hide show
  1. package/dist/assets/{ActiveAgentsPanel-C9AP9hJu.js → ActiveAgentsPanel-BEx06tMt.js} +1 -1
  2. package/dist/assets/{AdapterManager-CmxTUKJH.js → AdapterManager-3kEEQWFJ.js} +1 -1
  3. package/dist/assets/{AdvancedToolsRoute-CXsQnTei.js → AdvancedToolsRoute-CgS6B-oh.js} +1 -1
  4. package/dist/assets/{AgentActionButtons-DWq2OuVK.js → AgentActionButtons-Cz3jCEd7.js} +1 -1
  5. package/dist/assets/{AgentAdvancedTab-dhBDxF-H.js → AgentAdvancedTab-BG6ZIAuN.js} +1 -1
  6. package/dist/assets/{AgentBulkSettingsSheet-DYT4ovDg.js → AgentBulkSettingsSheet-BrrbvspS.js} +1 -1
  7. package/dist/assets/{AgentChat-r0TPOfPK.js → AgentChat-Dw9iXD6H.js} +1 -1
  8. package/dist/assets/{AgentDetailPage-Bc_okBuS.js → AgentDetailPage-CuVIHv_q.js} +3 -3
  9. package/dist/assets/{AgentIdentityChip-CB2NBXkZ.js → AgentIdentityChip-BrVCcuHQ.js} +1 -1
  10. package/dist/assets/{AgentRosterFilters-b7qMLv8-.js → AgentRosterFilters-GQ2bdXfW.js} +2 -2
  11. package/dist/assets/{Agents-BsvXy3pZ.js → Agents-clrVQnvc.js} +2 -2
  12. package/dist/assets/{Agents.production-BeOZmzaF.js → Agents.production-DTopo7XB.js} +2 -2
  13. package/dist/assets/{AnimatedDialogContent-CWshmxP2.js → AnimatedDialogContent-CDLfw-dJ.js} +1 -1
  14. package/dist/assets/{AppDetail-DbqENTF_.js → AppDetail-BcWBg5yW.js} +1 -1
  15. package/dist/assets/{AppNotConnected-BhnCqL0F.js → AppNotConnected-NgfyHZ4L.js} +1 -1
  16. package/dist/assets/{ApprovalDetail-B2KiYLTj.js → ApprovalDetail-Dm_1V4tC.js} +1 -1
  17. package/dist/assets/{Approvals-j-wRmqKj.js → Approvals-i5AB3JPj.js} +1 -1
  18. package/dist/assets/{AppsConnect-CcPVEZ0C.js → AppsConnect-D660Tpuo.js} +1 -1
  19. package/dist/assets/{AppsReview-B8eWvKkS.js → AppsReview-DdTqOisY.js} +1 -1
  20. package/dist/assets/{ArtifactEmptyGraphic-5mdkS5jj.js → ArtifactEmptyGraphic-DzxCruYA.js} +1 -1
  21. package/dist/assets/{Artifacts-Bz7Oo6VX.js → Artifacts-CkXBz6nh.js} +1 -1
  22. package/dist/assets/{AssigneePickerInner-DdpF7hck.js → AssigneePickerInner-BNjyABBe.js} +1 -1
  23. package/dist/assets/{AssistantConnection-BpaaJDc_.js → AssistantConnection-CNF6mDmO.js} +1 -1
  24. package/dist/assets/{AttentionInlineVerbs-DlPQVCO-.js → AttentionInlineVerbs-BiyZ1ekZ.js} +1 -1
  25. package/dist/assets/{AttentionQueueRow-BC6ezctS.js → AttentionQueueRow-Bh0dKHpF.js} +1 -1
  26. package/dist/assets/{AuditHub-BVP7LKL9.js → AuditHub-BK848cb4.js} +1 -1
  27. package/dist/assets/{AuditRuns-DqizHgX1.js → AuditRuns-CUdlbP7S.js} +1 -1
  28. package/dist/assets/{Auth-DOF0snjp.js → Auth-DDqxm5gD.js} +1 -1
  29. package/dist/assets/{BoardChat-BYAbDtfd.js → BoardChat-fvKqk0R7.js} +1 -1
  30. package/dist/assets/{BoardClaim-7y41Pr8e.js → BoardClaim-BEC5BZfz.js} +1 -1
  31. package/dist/assets/{BootstrapSetupUxLab-BftH1vOv.js → BootstrapSetupUxLab-CXzErrin.js} +1 -1
  32. package/dist/assets/{Browse-Ck01W1Yl.js → Browse-DoovSMuF.js} +1 -1
  33. package/dist/assets/{BudgetPolicyCard-CKhrzfgy.js → BudgetPolicyCard-BYMlczCq.js} +1 -1
  34. package/dist/assets/{CaseDetail-qlXKJ66D.js → CaseDetail-UMAcSH_x.js} +1 -1
  35. package/dist/assets/{CaseStatus-B3RiZVDH.js → CaseStatus-BI0aMl9l.js} +1 -1
  36. package/dist/assets/{Cases-CFV3V-5X.js → Cases-CMTkGghU.js} +1 -1
  37. package/dist/assets/{ChatEndpointDetail-7Hi5TJNt.js → ChatEndpointDetail-CocNEInH.js} +1 -1
  38. package/dist/assets/{ChatEndpointSetup-CtwgH6sg.js → ChatEndpointSetup-Cyi2tI9K.js} +1 -1
  39. package/dist/assets/{ChatIdentityConfirm-CXjksBwX.js → ChatIdentityConfirm-Ba3JuTX1.js} +1 -1
  40. package/dist/assets/{CliAuth-KVjrGMfZ.js → CliAuth-D2jnueGH.js} +1 -1
  41. package/dist/assets/{Companies-oeJem3De.js → Companies-K75I9dJs.js} +1 -1
  42. package/dist/assets/{CompanyAccess-vWT6G-n_.js → CompanyAccess-Cw6nLUhE.js} +1 -1
  43. package/dist/assets/{CompanyActivity-zOzzeN1B.js → CompanyActivity-BsgmVpWS.js} +1 -1
  44. package/dist/assets/CompanyActivity.production-w-KGxvo6.js +1 -0
  45. package/dist/assets/{CompanyConnections-llSEaVa2.js → CompanyConnections-yRPYSdm7.js} +1 -1
  46. package/dist/assets/{CompanyEnvironments-DNyyGC_S.js → CompanyEnvironments-BA7kWdOJ.js} +1 -1
  47. package/dist/assets/{CompanyExport-CFa-F8Es.js → CompanyExport-DfsK4b9c.js} +1 -1
  48. package/dist/assets/{CompanyImport-DG6qwQ8F.js → CompanyImport-DJHAsmSF.js} +1 -1
  49. package/dist/assets/{CompanySettings-Dv5Z3ZQi.js → CompanySettings-DwzHGXec.js} +1 -1
  50. package/dist/assets/{CompanySettingsPluginPage-CZk1d_0d.js → CompanySettingsPluginPage-Bpa81PF3.js} +1 -1
  51. package/dist/assets/{CompanySkills-CdzWhJfQ.js → CompanySkills-eTqgbqQN.js} +1 -1
  52. package/dist/assets/{CompanySkills.production-IoCRW5FQ.js → CompanySkills.production-CQSWfH0r.js} +1 -1
  53. package/dist/assets/{ConfigureBuiltInAgentModal-BwW7XQ1O.js → ConfigureBuiltInAgentModal-DgeD7t_i.js} +1 -1
  54. package/dist/assets/{CopyableGatewayUrl-PTn061ft.js → CopyableGatewayUrl-B6K3rOal.js} +1 -1
  55. package/dist/assets/{CordisPluginSettings-C_BeeGEc.js → CordisPluginSettings-DD3AnD2G.js} +1 -1
  56. package/dist/assets/{Costs-DhuNxwSj.js → Costs-orBM8T-a.js} +1 -1
  57. package/dist/assets/{CrossIssueCollaborationUxLab-ZaAXq46r.js → CrossIssueCollaborationUxLab-Bv9y9-NE.js} +1 -1
  58. package/dist/assets/{Dashboard-BaDnqiKo.js → Dashboard-CrSBNKX1.js} +1 -1
  59. package/dist/assets/{DashboardLive-D-Ed7osd.js → DashboardLive-Cg8C9RiS.js} +1 -1
  60. package/dist/assets/{DecisionDateChips-D3pl_mLn.js → DecisionDateChips-BLZKZH71.js} +1 -1
  61. package/dist/assets/{DecisionHistoryPanel-D5MzyrOh.js → DecisionHistoryPanel-yK-CP7Qg.js} +1 -1
  62. package/dist/assets/{DecisionQueuePage-D3UZ9oRk.js → DecisionQueuePage-BKXbERai.js} +1 -1
  63. package/dist/assets/{DesignGuide-COTo7ICj.js → DesignGuide-2FswNsXz.js} +1 -1
  64. package/dist/assets/{DesignSandboxTaskThread-CMeCSQid.js → DesignSandboxTaskThread-CGU--FXR.js} +1 -1
  65. package/dist/assets/{EmailConnectionAccess-kCL7obSr.js → EmailConnectionAccess-CZ5QRKyg.js} +1 -1
  66. package/dist/assets/{EmailEndpointSetup-BGrksR_u.js → EmailEndpointSetup-BI2vsd8Y.js} +1 -1
  67. package/dist/assets/{EnforcementBanner-_Eb_nK3M.js → EnforcementBanner-B-iX466h.js} +1 -1
  68. package/dist/assets/{EntityRow-gpsOgEtu.js → EntityRow-BsICt6pd.js} +1 -1
  69. package/dist/assets/{ExecutionWorkspaceDetail-DwGkH6d3.js → ExecutionWorkspaceDetail-CMqR9puh.js} +1 -1
  70. package/dist/assets/{ExternalAgentInviteDialog-CGid6pM9.js → ExternalAgentInviteDialog-De30ZrLP.js} +1 -1
  71. package/dist/assets/{FilterBar-1D-VhrvG.js → FilterBar-rCmsTtG4.js} +1 -1
  72. package/dist/assets/{FolderControls-CQ6kef3c.js → FolderControls-CmnB7Ap-.js} +1 -1
  73. package/dist/assets/{GatewayDetail-CCqekM1J.js → GatewayDetail-Duw9pJ10.js} +1 -1
  74. package/dist/assets/{GatewaysList-nFsRcszh.js → GatewaysList-BBhVGhRq.js} +1 -1
  75. package/dist/assets/{GitHubConnectionRecovery-B9sFWJup.js → GitHubConnectionRecovery-6VshLoNV.js} +1 -1
  76. package/dist/assets/{GoalDetail-BQ8y55P-.js → GoalDetail-CahntjlI.js} +1 -1
  77. package/dist/assets/{GoalTree-laRjXp0P.js → GoalTree-CU4GBFCh.js} +1 -1
  78. package/dist/assets/{Goals-Cm14EaeP.js → Goals-CzM2NDFR.js} +1 -1
  79. package/dist/assets/{InstanceAccess-DxQ-Akt_.js → InstanceAccess-CZzkE65W.js} +1 -1
  80. package/dist/assets/{InstanceExperimentalSettings-BxwqbXNw.js → InstanceExperimentalSettings-DWumKtOK.js} +1 -1
  81. package/dist/assets/{InviteLanding-Cf0L_u6s.js → InviteLanding-BIy2z50u.js} +1 -1
  82. package/dist/assets/{IssueChatLongThreadPerf-BfsF6FdF.js → IssueChatLongThreadPerf-D4DJvdOG.js} +1 -1
  83. package/dist/assets/{JoinRequestQueue-BXCdTFG_.js → JoinRequestQueue-C5rauGYm.js} +1 -1
  84. package/dist/assets/{Layout.production-CqzU0qMi.js → Layout.production-BSDWnupa.js} +1 -1
  85. package/dist/assets/{McpConnect-COWnZ9Eb.js → McpConnect-BN8ST0RS.js} +1 -1
  86. package/dist/assets/{MembershipAction-C9i9Sdmi.js → MembershipAction-DTjhGn-L.js} +1 -1
  87. package/dist/assets/{MetricCard-Bwnt3_p3.js → MetricCard-CeL9Pdn5.js} +1 -1
  88. package/dist/assets/{MissingPluginTabPlaceholder-B0Zxv1Kx.js → MissingPluginTabPlaceholder-CbQiSVnZ.js} +1 -1
  89. package/dist/assets/{NewAgent-BIlJ5Dyt.js → NewAgent-BszrNpQk.js} +1 -1
  90. package/dist/assets/{NewAgentDialog-CJdMxxYL.js → NewAgentDialog-U9qAcTzc.js} +1 -1
  91. package/dist/assets/{NewGoalDialog-B8izfKLm.js → NewGoalDialog-DqKbk4-i.js} +1 -1
  92. package/dist/assets/{NewProjectDialog-DXqjTYFK.js → NewProjectDialog-DrlUAF-N.js} +1 -1
  93. package/dist/assets/{OnboardingPrimitives-DHYBqn_0.js → OnboardingPrimitives-BkgPF4Mu.js} +1 -1
  94. package/dist/assets/{OnboardingWizard-DqSfZ13V.js → OnboardingWizard-CMBMcuXv.js} +1 -1
  95. package/dist/assets/{OrgChart.production-DrSFUf7i.js → OrgChart.production-BLczTjRj.js} +1 -1
  96. package/dist/assets/{PaperclipCloudOAuthHandoff-jPUvjJ8q.js → PaperclipCloudOAuthHandoff-BTtF8UPD.js} +1 -1
  97. package/dist/assets/{PluginManager-h3LFPaUq.js → PluginManager-CCcqlfgK.js} +1 -1
  98. package/dist/assets/{PluginPage-E5Im4454.js → PluginPage-B1empV69.js} +1 -1
  99. package/dist/assets/{PluginSettings-BBO0jAgo.js → PluginSettings-DtopaRqR.js} +1 -1
  100. package/dist/assets/{ProfileDetailRoute-CQBD7fms.js → ProfileDetailRoute-BqvVpBZi.js} +1 -1
  101. package/dist/assets/{ProfileSettings-BwnVEHLp.js → ProfileSettings-5__tVfGi.js} +1 -1
  102. package/dist/assets/{ProfileWizardRoute-By_SC6Gn.js → ProfileWizardRoute-vt-MRLuD.js} +1 -1
  103. package/dist/assets/{ProjectDetail-CbiwFBAE.js → ProjectDetail-DJ4zjube.js} +1 -1
  104. package/dist/assets/{ProjectRepositoryInput-DZF9bX4E.js → ProjectRepositoryInput-BJcnj3At.js} +1 -1
  105. package/dist/assets/{ProjectWorkspaceDetail-DPsl_4bD.js → ProjectWorkspaceDetail-DEAO3q6v.js} +1 -1
  106. package/dist/assets/{ProjectWorkspacesContent-COH4dOWK.js → ProjectWorkspacesContent-CZvO7p0i.js} +1 -1
  107. package/dist/assets/{Projects-Ch9Qu7sn.js → Projects-Dm7-zXUH.js} +1 -1
  108. package/dist/assets/{QuotaBar-DIFOT9Uh.js → QuotaBar-Drp3CaxX.js} +1 -1
  109. package/dist/assets/{RepositoryEditor-DHB1bqId.js → RepositoryEditor-BT_VAkJu.js} +1 -1
  110. package/dist/assets/{Responsibilities-C5O0JXXG.js → Responsibilities-DbUEtGZu.js} +1 -1
  111. package/dist/assets/{ResponsibilityDetail-D6NpZpkm.js → ResponsibilityDetail--S8_GOkb.js} +1 -1
  112. package/dist/assets/{ResponsibleUserDenialUxLab-CFrIWYwe.js → ResponsibleUserDenialUxLab-1PB3JNG0.js} +1 -1
  113. package/dist/assets/{ReviewQueueCard-BPC4Lm67.js → ReviewQueueCard-B8w9aXKU.js} +1 -1
  114. package/dist/assets/{RoutineAuditActivity-sKyzMajz.js → RoutineAuditActivity-BCo7pYe5.js} +1 -1
  115. package/dist/assets/{RoutineDetail-CG8HF5fp.js → RoutineDetail-C9Dwn5G9.js} +1 -1
  116. package/dist/assets/{RoutineRunVariablesDialog-CKh3CmLD.js → RoutineRunVariablesDialog-Baomcbe3.js} +1 -1
  117. package/dist/assets/{Routines-tF2qfUKo.js → Routines-Dkv4gJno.js} +1 -1
  118. package/dist/assets/{Routines.production-BTyj1Ljr.js → Routines.production-Cs2Y-lpt.js} +1 -1
  119. package/dist/assets/{RoutinesToolbar-CvUFVCGN.js → RoutinesToolbar-BNKfCrTo.js} +1 -1
  120. package/dist/assets/{Search-Z9D0NuS1.js → Search-CVx4cl2o.js} +1 -1
  121. package/dist/assets/{Secrets-DgmbLOJK.js → Secrets-C2qv2HKZ.js} +1 -1
  122. package/dist/assets/{SkillBinaryFile-F3_9qcaM.js → SkillBinaryFile-DDkhLlfC.js} +1 -1
  123. package/dist/assets/{SkillCardIcon-CXHUCMej.js → SkillCardIcon-Cp_hws0N.js} +1 -1
  124. package/dist/assets/{SkillFolderTree-CB3lrTIE.js → SkillFolderTree-Cv0CmfYx.js} +1 -1
  125. package/dist/assets/{SkillSourceTree-BbuciCo6.js → SkillSourceTree-DmjlUswf.js} +1 -1
  126. package/dist/assets/{SkillSources-Dlo6Cew3.js → SkillSources-nmlYypUU.js} +1 -1
  127. package/dist/assets/{SkillStudio-ZO-Nf7eI.js → SkillStudio-BK3y_3zr.js} +1 -1
  128. package/dist/assets/{SkillsNavigationTabs-B9Iqnlqt.js → SkillsNavigationTabs-DRwMP1eu.js} +1 -1
  129. package/dist/assets/{SpekoPhoneCallback-C4VnMiZh.js → SpekoPhoneCallback-Cqi7AIyH.js} +1 -1
  130. package/dist/assets/{SpekoProviderSetup-I4evPZb3.js → SpekoProviderSetup-CJI4oXk5.js} +1 -1
  131. package/dist/assets/{StatusCards-D0MVzbsw.js → StatusCards-DKyyY81S.js} +1 -1
  132. package/dist/assets/{SummarySlotCard-DUXgZPxG.js → SummarySlotCard-f3RomdZS.js} +1 -1
  133. package/dist/assets/{TailscaleConnector-CMhT73gj.js → TailscaleConnector-yQWLR1Ra.js} +1 -1
  134. package/dist/assets/{TaskChatLab-D9-KAE-7.js → TaskChatLab-Dsr7eyj4.js} +1 -1
  135. package/dist/assets/{TaskSummaryList-CUxieFNe.js → TaskSummaryList-eFDfK_QH.js} +1 -1
  136. package/dist/assets/{Timeline-BNMoRbtK.js → Timeline-BWA9dyk6.js} +1 -1
  137. package/dist/assets/{ToolsAdminGate-CEr0zy2T.js → ToolsAdminGate-DpBg30hQ.js} +1 -1
  138. package/dist/assets/{TrustPresetSection-B9YXZtkh.js → TrustPresetSection-DtWjK9Kp.js} +1 -1
  139. package/dist/assets/{UserProfile-D-tnW96X.js → UserProfile-C66UI5xx.js} +1 -1
  140. package/dist/assets/{WebhookUrlWarning-Ba_DixKh.js → WebhookUrlWarning-CDygVnDH.js} +1 -1
  141. package/dist/assets/{WhatNeedsMe-B-Jzj8_M.js → WhatNeedsMe-BQ82RHus.js} +1 -1
  142. package/dist/assets/{Workspaces-BqhDI_Bl.js → Workspaces-DrjJes30.js} +1 -1
  143. package/dist/assets/{abnfDiagram-YUKMZFIV-Bn9P-nUW.js → abnfDiagram-YUKMZFIV-Crkksu2D.js} +1 -1
  144. package/dist/assets/{architecture-WOLXFQ4H-V1ldsZlt.js → architecture-WOLXFQ4H-bHU8FW0c.js} +1 -1
  145. package/dist/assets/{architectureDiagram-47P4ROYG-BkYxt-Gc.js → architectureDiagram-47P4ROYG-Bj5Styf9.js} +1 -1
  146. package/dist/assets/{arrow-down-left-o81ENfeW.js → arrow-down-left-Ck9VQyqQ.js} +1 -1
  147. package/dist/assets/{blockDiagram-E7TT5TSB-BO7pPYbp.js → blockDiagram-E7TT5TSB-OeHpNCQ-.js} +1 -1
  148. package/dist/assets/{budgets-0Dw6TH1A.js → budgets-CAWPqcn4.js} +1 -1
  149. package/dist/assets/{building-complex-DciZTnys.js → building-complex-Dxiyk_pH.js} +1 -1
  150. package/dist/assets/{c4Diagram-CRA5TL53-D4EpmmzV.js → c4Diagram-CRA5TL53-QbK5p76P.js} +1 -1
  151. package/dist/assets/channel-BSmZkKA8.js +1 -0
  152. package/dist/assets/{chat-channels-DWyry-9M.js → chat-channels-CzTZV2fr.js} +1 -1
  153. package/dist/assets/{chunk-2BW5OAIV-DFXIyCJy.js → chunk-2BW5OAIV-Ckr4HfBO.js} +1 -1
  154. package/dist/assets/{chunk-3YJQHVM4-Dj5wEKIw.js → chunk-3YJQHVM4-C_uoPpLR.js} +1 -1
  155. package/dist/assets/{chunk-4EA7E6EY-5XiUVgzK.js → chunk-4EA7E6EY-BeMEfIRS.js} +1 -1
  156. package/dist/assets/{chunk-7TKQ45FW-D0opKcsy.js → chunk-7TKQ45FW-DiwqWHvN.js} +1 -1
  157. package/dist/assets/{chunk-AW2ZBBNX-DnjsTe04.js → chunk-AW2ZBBNX-Cf57K3PO.js} +1 -1
  158. package/dist/assets/{chunk-DBDB3WZW-DNqSQPZ0.js → chunk-DBDB3WZW-B2qouVQO.js} +1 -1
  159. package/dist/assets/{chunk-E2ZNV5FY-cjSf_BTz.js → chunk-E2ZNV5FY-DG8wQ_NS.js} +1 -1
  160. package/dist/assets/{chunk-EU5HNXII-CZYBiaSw.js → chunk-EU5HNXII-cxRrXRGV.js} +1 -1
  161. package/dist/assets/{chunk-FVRAUYC3-DSc0-wJA.js → chunk-FVRAUYC3-Dizswk0V.js} +1 -1
  162. package/dist/assets/{chunk-HJ2JQQFS-MXK0gYSP.js → chunk-HJ2JQQFS-DL4lnpSv.js} +1 -1
  163. package/dist/assets/{chunk-HTAEGDNF-BjDZm_5k.js → chunk-HTAEGDNF-Zxjdb6kj.js} +1 -1
  164. package/dist/assets/{chunk-KQW6MTUR-Bfj0tDmO.js → chunk-KQW6MTUR-BsVaJdnu.js} +1 -1
  165. package/dist/assets/{chunk-NTY3LDVX-Bpz5TkVb.js → chunk-NTY3LDVX-DyT9N5sM.js} +1 -1
  166. package/dist/assets/{chunk-VPRB5NB3-CfeHjtbb.js → chunk-VPRB5NB3-BNz5CtBn.js} +1 -1
  167. package/dist/assets/{chunk-XC4XBNZT-FBCWmi6K.js → chunk-XC4XBNZT-CCgIhjYS.js} +1 -1
  168. package/dist/assets/{circle-slash-DqKFFqfb.js → circle-slash-uNv_ha0X.js} +1 -1
  169. package/dist/assets/{classDiagram-v2-K4WV4PDN-DbC_J0kK.js → classDiagram-v2-K4WV4PDN-Cdh3CEl4.js} +1 -1
  170. package/dist/assets/{coins-BztUbqyl.js → coins-BDAh8hDQ.js} +1 -1
  171. package/dist/assets/{collections-BxrcELwt.js → collections-B58p51lw.js} +1 -1
  172. package/dist/assets/{connection-owner-D-ikSHyR.js → connection-owner-D8fNrFqC.js} +1 -1
  173. package/dist/assets/{cynefin-EF2NZ3EQ-COwSJ4qP.js → cynefin-EF2NZ3EQ-BkwhfqJ0.js} +1 -1
  174. package/dist/assets/{cynefinDiagram-3GCD6N5R-diaEJq9Y.js → cynefinDiagram-3GCD6N5R-DuGb_wq2.js} +1 -1
  175. package/dist/assets/{dagre-W4DXFKR2-BPAMRuIj.js → dagre-W4DXFKR2-Bxq_Mhia.js} +1 -1
  176. package/dist/assets/{diagram-2UJZ2QOL-BvRnO1Id.js → diagram-2UJZ2QOL-B-P_hrXV.js} +1 -1
  177. package/dist/assets/{diagram-OVF4WLC6-CDgBeD0m.js → diagram-OVF4WLC6-Ds0BqQWH.js} +1 -1
  178. package/dist/assets/{diagram-PFPMY2P6-DAw9lREG.js → diagram-PFPMY2P6-Dpqb2-Cb.js} +1 -1
  179. package/dist/assets/{diagram-UMYRVEAY-ZQqQn22t.js → diagram-UMYRVEAY-BJSoxjiu.js} +1 -1
  180. package/dist/assets/{diagram-YEKJPTXX-CoJtGgWs.js → diagram-YEKJPTXX-BxaG_9tT.js} +1 -1
  181. package/dist/assets/{diagram-ZIFT7M5P-qW_Zn_bO.js → diagram-ZIFT7M5P-6acvVOtc.js} +1 -1
  182. package/dist/assets/{dist-B2E6oBK1.js → dist-0EWXio4m.js} +1 -1
  183. package/dist/assets/{dist-IcdxEhjC.js → dist-BGvZP_Cl.js} +1 -1
  184. package/dist/assets/{dist-DXjkgaZX.js → dist-BZ7AbEhN.js} +1 -1
  185. package/dist/assets/{dist-_EtfntKJ.js → dist-BlosHr86.js} +1 -1
  186. package/dist/assets/{dist-DylHAy-6.js → dist-Bmr4uhSk.js} +1 -1
  187. package/dist/assets/{dist-DML0cJH3.js → dist-C6yMfMNS.js} +1 -1
  188. package/dist/assets/{dist-Dl94YqeS.js → dist-CMZQedYl.js} +1 -1
  189. package/dist/assets/{dist-DKyBHaH2.js → dist-C_N_-eaT.js} +1 -1
  190. package/dist/assets/{dist-CvRpZH53.js → dist-CaUbG4Hl.js} +1 -1
  191. package/dist/assets/{dist-ptDa9fKh.js → dist-Cn7-nxjU.js} +1 -1
  192. package/dist/assets/{dist-CG-phytt.js → dist-Cnj95_pX.js} +1 -1
  193. package/dist/assets/{dist-DbXGl-wj.js → dist-D9DR7k9k.js} +1 -1
  194. package/dist/assets/{dist-CjRqeLFz.js → dist-DIwsVdS2.js} +1 -1
  195. package/dist/assets/{dist-BCJybC91.js → dist-DVE0lLId.js} +1 -1
  196. package/dist/assets/{dist-CPgRB-NQ.js → dist-DkAPL4CQ.js} +1 -1
  197. package/dist/assets/{dist-CeSzCyeG.js → dist-Dl6N3kpQ.js} +1 -1
  198. package/dist/assets/{dist-DZruZxAk.js → dist-DmBvXBzK.js} +1 -1
  199. package/dist/assets/{dist-CdmdXwCZ.js → dist-DpgXK0aZ.js} +1 -1
  200. package/dist/assets/{dist-CYRzGbSY.js → dist-gMRyU9GJ.js} +1 -1
  201. package/dist/assets/{dist-CG6fC1Db.js → dist-jQQX2kOU.js} +1 -1
  202. package/dist/assets/{dist-DZIxMHOT.js → dist-lUaUoFTq.js} +1 -1
  203. package/dist/assets/{dist-CuwPDbnL.js → dist-qw1ZF2vD.js} +1 -1
  204. package/dist/assets/{dist-B6Qde8KJ.js → dist-rH4qrNAn.js} +1 -1
  205. package/dist/assets/{ebnfDiagram-VR2GEFS7-DA4UvKXV.js → ebnfDiagram-VR2GEFS7-Ytj3Z5qC.js} +1 -1
  206. package/dist/assets/{elk-IJKZMXRS-CM74d3mJ.js → elk-IJKZMXRS-CJurNqqK.js} +1 -1
  207. package/dist/assets/{erDiagram-O2IAPWRE-d869V0qL.js → erDiagram-O2IAPWRE-hyXckW2d.js} +1 -1
  208. package/dist/assets/{eventmodeling-K75KTNOO-C-oz_eyI.js → eventmodeling-K75KTNOO-D3xQujrh.js} +1 -1
  209. package/dist/assets/flowDiagram-OXPTDLAJ-D4ojBTuY.js +1 -0
  210. package/dist/assets/{folder-plus-CxWXoYCi.js → folder-plus-BJZSMzuj.js} +1 -1
  211. package/dist/assets/{ganttDiagram-R7TSEDQI-BBul4Kpm.js → ganttDiagram-R7TSEDQI-C8U_ITl4.js} +1 -1
  212. package/dist/assets/{gitGraph-VSP46ZUC-BriEZgAq.js → gitGraph-VSP46ZUC-CDeq3yKT.js} +1 -1
  213. package/dist/assets/{gitGraphDiagram-XJZIOB7I-I12rg8s1.js → gitGraphDiagram-XJZIOB7I-CST3EWE9.js} +1 -1
  214. package/dist/assets/{goals-CvMWzjH4.js → goals-BNJZ4nzg.js} +1 -1
  215. package/dist/assets/{index-Bt31d8ga.js → index-BJtnP7H1.js} +8 -8
  216. package/dist/assets/{info-OHQRW6UA-CxrcGiem.js → info-OHQRW6UA-CPvTWk7J.js} +1 -1
  217. package/dist/assets/{infoDiagram-5W2HQ5XZ-4Sm0LiOu.js → infoDiagram-5W2HQ5XZ-BPUiNdxI.js} +1 -1
  218. package/dist/assets/{ishikawaDiagram-K3B6WC7H-CKXvKV-s.js → ishikawaDiagram-K3B6WC7H-D5Z3rmaA.js} +1 -1
  219. package/dist/assets/{issue-detail-4PCbYpdv.js → issue-detail-CZfjXs0M.js} +3 -3
  220. package/dist/assets/{journeyDiagram-COXZFDF6-BHsrZLvQ.js → journeyDiagram-COXZFDF6-CEkwEYdR.js} +1 -1
  221. package/dist/assets/{kanban-definition-P3RFRI5V-8HhnIs_l.js → kanban-definition-P3RFRI5V-8h_R6Qjq.js} +1 -1
  222. package/dist/assets/{line-rrKrpB-b.js → line-Ljt_vfsb.js} +1 -1
  223. package/dist/assets/{link-BecLzmfo.js → link-DvgFK0mz.js} +1 -1
  224. package/dist/assets/{list-filter-BC3D4IoX.js → list-filter-BR4_dvwm.js} +1 -1
  225. package/dist/assets/{log-in-BJCGwGGT.js → log-in-Dvx9-FMC.js} +1 -1
  226. package/dist/assets/{mcpSkills-DRs3pGKn.js → mcpSkills-76szK_k1.js} +1 -1
  227. package/dist/assets/{mermaid-parser.core-DmG0b4S0.js → mermaid-parser.core-BjFu937m.js} +3 -3
  228. package/dist/assets/{mermaid.core-D1vILTuF.js → mermaid.core-B0t95EIS.js} +4 -4
  229. package/dist/assets/{mindmap-definition-LZFPQGKD-DIMpL0de.js → mindmap-definition-LZFPQGKD-TVnHYUR4.js} +1 -1
  230. package/dist/assets/{packet-JDAUHWVQ-BnbYht3G.js → packet-JDAUHWVQ-aNGiRWLy.js} +1 -1
  231. package/dist/assets/{pegDiagram-BGZESJAR-BUjtJVjT.js → pegDiagram-BGZESJAR-DDadxqWQ.js} +1 -1
  232. package/dist/assets/{pie-XZMESJXO-CM4VXUb-.js → pie-XZMESJXO-CydFP1hd.js} +1 -1
  233. package/dist/assets/{pieDiagram-CAPJLFHJ-B3v8ryvG.js → pieDiagram-CAPJLFHJ-KhdUDwDS.js} +1 -1
  234. package/dist/assets/{power-0mw59G-l.js → power-sYV-WuqQ.js} +1 -1
  235. package/dist/assets/{profile-summary-B5rPf8v-.js → profile-summary-D4LPX-Dv.js} +1 -1
  236. package/dist/assets/{quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js → quadrantDiagram-GDMTTRAM-B1X8K2Fs.js} +1 -1
  237. package/dist/assets/{radar-ABXABTNO-v6yZj4Fk.js → radar-ABXABTNO-BqodkLpx.js} +1 -1
  238. package/dist/assets/{railroad-I3PHUGI6-D-U8Cs0m.js → railroad-I3PHUGI6-HmRKXDJj.js} +1 -1
  239. package/dist/assets/{railroad-abnf-LNEFI6M7-Dw3fkrVy.js → railroad-abnf-LNEFI6M7-CkBttaHp.js} +1 -1
  240. package/dist/assets/{railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js → railroad-ebnf-DWYD2UWJ-C6DBawFA.js} +1 -1
  241. package/dist/assets/{railroad-peg-JR7BVNR7-Bf8u1-RZ.js → railroad-peg-JR7BVNR7-Z9df3u5o.js} +1 -1
  242. package/dist/assets/{railroadDiagram-SM67HX2B-Drr5UhQI.js → railroadDiagram-SM67HX2B-2vDUUppL.js} +1 -1
  243. package/dist/assets/{requirementDiagram-X7JNWC4A-D5ef6_ac.js → requirementDiagram-X7JNWC4A-DAuP39Hc.js} +1 -1
  244. package/dist/assets/{sankeyDiagram-UM26HJRW-DncJWIz_.js → sankeyDiagram-UM26HJRW-ByS54QZK.js} +1 -1
  245. package/dist/assets/{saved-permissions-CizWg8-P.js → saved-permissions-CPiYtxkZ.js} +1 -1
  246. package/dist/assets/{scroll-text-Ck6HB7eM.js → scroll-text-CVSt6aO2.js} +1 -1
  247. package/dist/assets/{sdk-CWyUlmcn.js → sdk-vrG4HtB4.js} +1 -1
  248. package/dist/assets/{search-DkTqg7ab.js → search-CG-QtPVH.js} +1 -1
  249. package/dist/assets/{send-CYVi50sh.js → send-CH-0xdLm.js} +1 -1
  250. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js → sequenceDiagram-ZO4K6R2Y-DvWxKTLK.js} +1 -1
  251. package/dist/assets/{shared-CIwISWMj.js → shared-D37zfckm.js} +1 -1
  252. package/dist/assets/{smoke-lab-matrix-A7ubFpfk.js → smoke-lab-matrix-C5gR81E3.js} +1 -1
  253. package/dist/assets/{stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js → stateDiagram-v2-TBUQTH76-DtiiZIXq.js} +1 -1
  254. package/dist/assets/{swimlanes-N4OXWK64-NXVbx1w8.js → swimlanes-N4OXWK64-BWSEtCbX.js} +1 -1
  255. package/dist/assets/swimlanesDiagram-K3J5GTZL-Bl_9DvHU.js +8 -0
  256. package/dist/assets/{timeline-definition-YOQAKGHF-DqI-Mv2e.js → timeline-definition-YOQAKGHF-U4QcniMh.js} +1 -1
  257. package/dist/assets/{treeView-D4JQ5SDB-CZBlE7ya.js → treeView-D4JQ5SDB-B2tdrtsj.js} +1 -1
  258. package/dist/assets/{treemap-SAJKECNS-BlueznID.js → treemap-SAJKECNS-DodN8j4n.js} +1 -1
  259. package/dist/assets/{useAgentlessOnboardingAutoOpen-CnFwEQ-H.js → useAgentlessOnboardingAutoOpen-DSWW7Juw.js} +1 -1
  260. package/dist/assets/{useAuthorizationWindow-DnFQsiFj.js → useAuthorizationWindow-tg3aKEU7.js} +1 -1
  261. package/dist/assets/{useDateRange-9EbqkWXy.js → useDateRange-CnZQr2KO.js} +1 -1
  262. package/dist/assets/{useFastResponsesEnabled-D8dunm4j.js → useFastResponsesEnabled-B8tHSJ1y.js} +1 -1
  263. package/dist/assets/{usePageView-BiX5i8ck.js → usePageView-CtFMs34g.js} +1 -1
  264. package/dist/assets/{useProfilesData-0VYQ4lAT.js → useProfilesData-CWHdMSuL.js} +1 -1
  265. package/dist/assets/{useReviewCount-WBWxwKI3.js → useReviewCount-W_bCZ2Hz.js} +1 -1
  266. package/dist/assets/{useRoutineFormOptions-DnX5DBn1.js → useRoutineFormOptions-CCLMmVSF.js} +1 -1
  267. package/dist/assets/{useSummaryDraftStream-DPQRvaXT.js → useSummaryDraftStream-NVNYNt72.js} +1 -1
  268. package/dist/assets/{useTailscaleConnections-BDff6dWx.js → useTailscaleConnections-Dy52nCY3.js} +1 -1
  269. package/dist/assets/{usecaseDiagram-VIAY4XPW-BSDn8OaJ.js → usecaseDiagram-VIAY4XPW-kEHhqgOj.js} +1 -1
  270. package/dist/assets/{vennDiagram-BLWOH2XV-BBSA9KNN.js → vennDiagram-BLWOH2XV-NPJU0aCU.js} +1 -1
  271. package/dist/assets/{wardley-7MLQ67FV-CsT-rTZ9.js → wardley-7MLQ67FV-bUGKvIPT.js} +1 -1
  272. package/dist/assets/{wardleyDiagram-YMQ3BMBF-BLClsIjw.js → wardleyDiagram-YMQ3BMBF-qtUDHfhb.js} +1 -1
  273. package/dist/assets/{xychartDiagram-TAQBALBS-2x4wB0gq.js → xychartDiagram-TAQBALBS-C-z57aZj.js} +1 -1
  274. package/dist/index.html +4 -4
  275. package/dist/sw.js +1 -1
  276. package/package.json +1 -1
  277. package/dist/assets/CompanyActivity.production-DbaFBsM0.js +0 -1
  278. package/dist/assets/channel-BQh2vFIU.js +0 -1
  279. package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +0 -1
  280. package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +0 -8
@@ -1,3 +1,3 @@
1
- var We=Object.defineProperty;var a=(t,s)=>We(t,"name",{value:s,configurable:!0});import{a as Ve}from"./rolldown-runtime-DhZMWcEn.js";import{En as le,ai as qe}from"./issue-detail-4PCbYpdv.js";import{i as ze,r as Le}from"./RoutineRunVariablesDialog-CKh3CmLD.js";import{$A as Be,Ap as b,B_ as He,Bb as Ke,Bl as Qe,Bw as Ye,Fb as Ge,GS as Y,H_ as Je,Hm as Ze,ME as Xe,NE as V,Nb as et,Np as I,Op as M,Pb as tt,Pp as O,Rb as st,Um as oe,V_ as nt,Vm as ne,Y_ as at,__ as W,ay as rt,bE as lt,f_ as it,fy as ot,g_ as Ie,iC as ut,jT as ct,jb as be,kT as dt,kp as $,ly as ht,my as mt,nj as ft,op as _,p_ as xt,qC as ue,rb as pt,sy as gt,ub as G,uy as jt,v_ as Ne,xE as J,x_ as yt,zE as vt,z_ as wt}from"./index-Bt31d8ga.js";var g=Ve(ft(),1),e=Ve(Be(),1),Me=["text","textarea","number","boolean","select","date"];function _e(t){return JSON.stringify(t)}a(_e,"serializeVariables");function Oe(t){return t.split(",").map(s=>s.trim()).filter(Boolean)}a(Oe,"parseSelectOptions");function F(t,s,n){return t.map(r=>r.name===s?n(r):r)}a(F,"updateVariableList");function $e(t,s){return t==="boolean"?null:t==="date"?typeof s=="string"&&Le(s)?s:null:s}a($e,"defaultValueForType");function bt({title:t,description:s,value:n,onChange:r,variant:i="default"}){const[d,m]=(0,g.useState)(!0),c=(0,g.useMemo)(()=>ze([t,s],n),[s,t,n]),u=_e(c),y=_e(n);return(0,g.useEffect)(()=>{u!==y&&r(c)},[y,r,u,c]),c.length===0?null:i==="compact"?(0,e.jsx)(Nt,{variables:c,onPatch:a((h,f)=>r(F(c,h,f)),"onPatch")}):(0,e.jsxs)(wt,{open:d,onOpenChange:m,className:"overflow-hidden rounded-lg border border-border/70",children:[(0,e.jsxs)(nt,{className:"flex w-full items-center justify-between px-3 py-2 text-left",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Variables"}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Detected from `","{{name}}","` placeholders in the title and instructions."]})]}),d?(0,e.jsx)(ct,{className:"h-4 w-4 text-muted-foreground"}):(0,e.jsx)(dt,{className:"h-4 w-4 text-muted-foreground"})]}),(0,e.jsx)(He,{className:"divide-y divide-border/70 border-t border-border/70",children:c.map(h=>(0,e.jsxs)("div",{className:"p-4",children:[(0,e.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Je,{variant:"outline",className:"font-mono text-xs",children:`{{${h.name}}}`}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Prompt the user for this value before each manual run."})]}),(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Label"}),(0,e.jsx)(W,{value:h.label??"",onChange:a(f=>r(F(c,h.name,x=>({...x,label:f.target.value||null}))),"onChange"),placeholder:h.name.replaceAll("_"," ")})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Type"}),(0,e.jsxs)(M,{value:h.type,onValueChange:a(f=>r(F(c,h.name,x=>({...x,type:f,defaultValue:$e(f,x.defaultValue),options:f==="select"?x.options:[]}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Me.map(f=>(0,e.jsx)(b,{value:f,children:f},f))})]})]}),(0,e.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(_,{className:"text-xs",children:"Default value"}),(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("input",{type:"checkbox",checked:h.required,onChange:a(f=>r(F(c,h.name,x=>({...x,required:f.target.checked}))),"onChange")}),"Required"]})]}),h.type==="textarea"?(0,e.jsx)(Ie,{rows:3,value:h.defaultValue==null?"":String(h.defaultValue),onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange")}):h.type==="boolean"?(0,e.jsxs)(M,{value:h.defaultValue===!0?"true":h.defaultValue===!1?"false":"__unset__",onValueChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f==="__unset__"?null:f==="true"}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),(0,e.jsx)(b,{value:"true",children:"True"}),(0,e.jsx)(b,{value:"false",children:"False"})]})]}):h.type==="select"?(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Options"}),(0,e.jsx)(W,{value:h.options.join(", "),onChange:a(f=>{const x=Oe(f.target.value);r(F(c,h.name,N=>({...N,options:x,defaultValue:typeof N.defaultValue=="string"&&x.includes(N.defaultValue)?N.defaultValue:null})))},"onChange"),placeholder:"high, medium, low"})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Default option"}),(0,e.jsxs)(M,{value:typeof h.defaultValue=="string"?h.defaultValue:"__unset__",onValueChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f==="__unset__"?null:f}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{placeholder:"No default"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),h.options.map(f=>(0,e.jsx)(b,{value:f,children:f},f))]})]})]})]}):h.type==="date"?(0,e.jsx)(W,{type:"date",value:typeof h.defaultValue=="string"?h.defaultValue:"",onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange")}):(0,e.jsx)(W,{type:h.type==="number"?"number":"text",value:h.defaultValue==null?"":String(h.defaultValue),onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange"),placeholder:h.type==="number"?"42":"Default value"})]})]})]},h.name))})]})}a(bt,"RoutineVariablesEditor");var P={name:"w-full shrink-0 sm:w-48",type:"w-28 shrink-0",defaultValue:"min-w-0 flex-1 basis-32",required:"flex w-16 shrink-0 justify-center"};function Nt({variables:t,onPatch:s}){return(0,e.jsxs)("div",{className:"flex flex-col gap-2",role:"group","aria-label":"Variables",children:[(0,e.jsx)(_,{children:"Variables"}),(0,e.jsxs)("div",{className:"hidden items-center gap-2 text-xs text-muted-foreground sm:flex","aria-hidden":"true",children:[(0,e.jsx)("span",{className:P.name,children:"Name"}),(0,e.jsx)("span",{className:P.type,children:"Type"}),(0,e.jsx)("span",{className:P.defaultValue,children:"Default"}),(0,e.jsx)("span",{className:P.required,children:"Required"})]}),t.map(n=>{const r=a(i=>s(n.name,d=>({...d,...i})),"patch");return(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("code",{className:`${P.name} truncate font-mono text-xs`,title:`{{${n.name}}}`,children:`{{${n.name}}}`}),(0,e.jsxs)(M,{value:n.type,onValueChange:a(i=>s(n.name,d=>({...d,type:i,defaultValue:$e(i,d.defaultValue),options:i==="select"?d.options:[]})),"onValueChange"),children:[(0,e.jsx)(I,{className:P.type,"aria-label":`Type of ${n.name}`,children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Me.map(i=>(0,e.jsx)(b,{value:i,children:i},i))})]}),(0,e.jsx)("div",{className:P.defaultValue,children:n.type==="boolean"?(0,e.jsxs)(M,{value:n.defaultValue===!0?"true":n.defaultValue===!1?"false":"__unset__",onValueChange:a(i=>r({defaultValue:i==="__unset__"?null:i==="true"}),"onValueChange"),children:[(0,e.jsx)(I,{className:"w-full","aria-label":`Default for ${n.name}`,children:(0,e.jsx)(O,{})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),(0,e.jsx)(b,{value:"true",children:"True"}),(0,e.jsx)(b,{value:"false",children:"False"})]})]}):n.type==="select"?(0,e.jsxs)(M,{value:typeof n.defaultValue=="string"?n.defaultValue:"__unset__",onValueChange:a(i=>r({defaultValue:i==="__unset__"?null:i}),"onValueChange"),children:[(0,e.jsx)(I,{className:"w-full","aria-label":`Default for ${n.name}`,children:(0,e.jsx)(O,{placeholder:"No default"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),n.options.map(i=>(0,e.jsx)(b,{value:i,children:i},i))]})]}):n.type==="textarea"?(0,e.jsx)(Ie,{rows:1,"aria-label":`Default for ${n.name}`,value:n.defaultValue==null?"":String(n.defaultValue),placeholder:"No default",onChange:a(i=>r({defaultValue:i.target.value||null}),"onChange")}):(0,e.jsx)(W,{type:n.type==="number"?"number":n.type==="date"?"date":"text","aria-label":`Default for ${n.name}`,value:n.defaultValue==null?"":String(n.defaultValue),placeholder:"No default",onChange:a(i=>r({defaultValue:i.target.value||null}),"onChange")})}),(0,e.jsxs)("label",{className:`${P.required} items-center gap-2 text-xs text-muted-foreground`,children:[(0,e.jsx)("input",{type:"checkbox",checked:n.required,"aria-label":`${n.name} is required`,onChange:a(i=>r({required:i.target.checked}),"onChange")}),(0,e.jsx)("span",{className:"sm:hidden",children:"Required"})]})]}),n.type==="select"?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`${P.name} hidden sm:block`,"aria-hidden":"true"}),(0,e.jsx)(W,{className:"min-w-0 flex-1","aria-label":`Options for ${n.name}`,value:n.options.join(", "),placeholder:"Options, separated by commas: high, medium, low",onChange:a(i=>{const d=Oe(i.target.value);s(n.name,m=>({...m,options:d,defaultValue:typeof m.defaultValue=="string"&&d.includes(m.defaultValue)?m.defaultValue:null}))},"onChange")}),(0,e.jsx)("span",{className:`${P.required} hidden sm:block`,"aria-hidden":"true"})]}):null]},n.name)})]})}a(Nt,"CompactVariableRows");var _t={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},z=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}];function Z(t,s){const n=new Set;for(const r of t.split(",")){const i=r.trim();if(i==="")throw new Error("Empty cron field element");const d=i.indexOf("/");if(d!==-1){const c=i.slice(0,d),u=Number.parseInt(i.slice(d+1),10);if(!Number.isInteger(u)||u<=0)throw new Error("Invalid cron step");let y=s.min,h=s.max;if(c!=="*")if(c.includes("-")){const[f,x]=c.split("-").map(N=>Number.parseInt(N,10));if(!Number.isInteger(f)||!Number.isInteger(x))throw new Error("Invalid cron range");y=f,h=x}else{const f=Number.parseInt(c,10);if(!Number.isInteger(f))throw new Error("Invalid cron start");y=f}X(y,s),X(h,s);for(let f=y;f<=h;f+=u)n.add(f);continue}if(i.includes("-")){const[c,u]=i.split("-").map(y=>Number.parseInt(y,10));if(!Number.isInteger(c)||!Number.isInteger(u))throw new Error("Invalid cron range");if(X(c,s),X(u,s),c>u)throw new Error("Invalid cron range (start > end)");for(let y=c;y<=u;y++)n.add(y);continue}if(i==="*"||i==="?"){for(let c=s.min;c<=s.max;c++)n.add(c);continue}const m=Number.parseInt(i,10);if(!Number.isInteger(m))throw new Error("Invalid cron value");X(m,s),n.add(m)}if(n.size===0)throw new Error("Empty cron field");return[...n].sort((r,i)=>r-i)}a(Z,"parseField");function X(t,s){if(t<s.min||t>s.max)throw new Error(`Cron value ${t} out of range`)}a(X,"assertBounds");function ke(t,s){return t.length===s.max-s.min+1&&t[0]===s.min&&t.at(-1)===s.max}a(ke,"coversEntireField");function De(t){if(!t)return null;const s=t.trim().split(/\s+/);if(s.length!==5)return null;try{const n=Z(s[2],z[2]),r=Z(s[4],z[4]);return{minutes:Z(s[0],z[0]),hours:Z(s[1],z[1]),daysOfMonth:n,months:Z(s[3],z[3]),daysOfWeek:r,daysOfMonthWildcard:ke(n,z[2]),daysOfWeekWildcard:ke(r,z[4])}}catch{return null}}a(De,"parseCronExpression");function kt(t,s){const n=new Intl.DateTimeFormat("en-US",{timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",weekday:"short",hourCycle:"h23"}),r={};for(const d of n.formatToParts(t))d.type!=="literal"&&(r[d.type]=d.value);const i=_t[r.weekday??""];if(i===void 0)throw new Error(`Unable to resolve weekday for ${s}`);return{month:Number(r.month),day:Number(r.day),hour:Number(r.hour),minute:Number(r.minute),weekday:i}}a(kt,"getZonedMinuteParts");function St(t,s){const n=t.daysOfMonth.includes(s.day),r=t.daysOfWeek.includes(s.weekday),i=!t.daysOfMonthWildcard&&!t.daysOfWeekWildcard?n||r:n&&r;return t.minutes.includes(s.minute)&&t.hours.includes(s.hour)&&t.months.includes(s.month)&&i}a(St,"matches");function Ct(t,s,n={}){const r=De(t);if(!r||s<=0)return[];const i=n.timeZone??"UTC",d=n.after??new Date,m=new Date(d.getTime());m.setUTCSeconds(0,0),m.setUTCMinutes(m.getUTCMinutes()+1);const c=[],u=1054080;for(let y=0;y<u&&c.length<s;y++){let h;try{h=kt(m,i)}catch{return c}St(r,h)&&c.push(new Date(m.getTime())),m.setUTCMinutes(m.getUTCMinutes()+1)}return c}a(Ct,"nextCronFires");var Tt=[{value:"every_minute",label:"Every minute"},{value:"every_hour",label:"Every hour"},{value:"every_day",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"custom",label:"Custom (cron)"}],he=Array.from({length:24},(t,s)=>({value:String(s),label:s===0?"12 AM":s<12?`${s} AM`:s===12?"12 PM":`${s-12} PM`})),ce=Array.from({length:12},(t,s)=>({value:String(s*5),label:String(s*5).padStart(2,"0")})),me=[{value:"1",label:"Mon"},{value:"2",label:"Tue"},{value:"3",label:"Wed"},{value:"4",label:"Thu"},{value:"5",label:"Fri"},{value:"6",label:"Sat"},{value:"0",label:"Sun"}],Ae=Array.from({length:31},(t,s)=>({value:String(s+1),label:String(s+1)}));function ae(t,s){return t.some(n=>n.value===s)}a(ae,"hasOption");function de(t){const s={hour:"10",minute:"0",dayOfWeek:"1",dayOfMonth:"1"};if(!t||!t.trim())return{preset:"every_day",...s};const n=t.trim().split(/\s+/);if(n.length!==5)return{preset:"custom",...s};const[r,i,d,m,c]=n,u=ae(ce,r),y=ae(he,i);return r==="*"&&i==="*"&&d==="*"&&m==="*"&&c==="*"?{preset:"every_minute",...s}:i==="*"&&d==="*"&&m==="*"&&c==="*"&&u?{preset:"every_hour",...s,minute:r}:d==="*"&&m==="*"&&c==="*"&&y&&u?{preset:"every_day",...s,hour:i,minute:r}:d==="*"&&m==="*"&&c==="1-5"&&y&&u?{preset:"weekdays",...s,hour:i,minute:r}:d==="*"&&m==="*"&&ae(me,c)&&y&&u?{preset:"weekly",...s,hour:i,minute:r,dayOfWeek:c}:m==="*"&&ae(Ae,d)&&c==="*"&&y&&u?{preset:"monthly",...s,hour:i,minute:r,dayOfMonth:d}:{preset:"custom",...s}}a(de,"parseCronToPreset");function Et(t,s,n,r,i){switch(t){case"every_minute":return"* * * * *";case"every_hour":return`${n} * * * *`;case"every_day":return`${n} ${s} * * *`;case"weekdays":return`${n} ${s} * * 1-5`;case"weekly":return`${n} ${s} * * ${r}`;case"monthly":return`${n} ${s} ${i} * *`;case"custom":return""}}a(Et,"buildCron");function Vt(t){const{preset:s,hour:n,minute:r,dayOfWeek:i,dayOfMonth:d}=de(t),m=he.find(u=>u.value===n)?.label??`${n}`,c=`${m.replace(/ (AM|PM)$/,"")}:${r.padStart(2,"0")} ${m.match(/(AM|PM)$/)?.[0]??""}`;switch(s){case"every_minute":return"Every minute";case"every_hour":return`Every hour at :${r.padStart(2,"0")}`;case"every_day":return`Every day at ${c}`;case"weekdays":return`Weekdays at ${c}`;case"weekly":return`Every ${me.find(u=>u.value===i)?.label??i} at ${c}`;case"monthly":return`Monthly on the ${d}${It(Number(d))} at ${c}`;case"custom":return t||"No schedule set"}}a(Vt,"describeSchedule");function It(t){const s=["th","st","nd","rd"],n=t%100;return s[(n-20)%10]||s[n]||s[0]}a(It,"ordinalSuffix");function Se(t){const s=t.trim();if(!s)return{valid:!1,message:"Enter a 5-field cron expression.",nextFires:[]};const n=s.split(/\s+/);if(n.length!==5)return{valid:!1,message:`Use exactly 5 fields; this has ${n.length}.`,nextFires:[]};if(!De(s))return{valid:!1,message:"Cron fields must use valid numbers, ranges, lists, wildcards, or steps.",nextFires:[]};const r=Ct(s,3,{timeZone:"UTC"});return{valid:!0,message:r.length>0?"Valid cron.":"Valid cron, but no upcoming fires were found.",nextFires:r}}a(Se,"getScheduleCronValidation");function Mt({value:t,onChange:s,onValidityChange:n,inline:r=!1,trailing:i}){const d=(0,g.useMemo)(()=>de(t),[t]),[m,c]=(0,g.useState)(d.preset),[u,y]=(0,g.useState)(d.hour),[h,f]=(0,g.useState)(d.minute),[x,N]=(0,g.useState)(d.dayOfWeek),[D,L]=(0,g.useState)(d.dayOfMonth),[C,E]=(0,g.useState)(m==="custom"?t:""),k=(0,g.useMemo)(()=>Se(C),[C]);(0,g.useEffect)(()=>{n?.(m!=="custom"||k.valid)},[k.valid,n,m]),(0,g.useEffect)(()=>{const o=de(t);c(o.preset),y(o.hour),f(o.minute),N(o.dayOfWeek),L(o.dayOfMonth),o.preset==="custom"&&E(t)},[t]);const S=(0,g.useCallback)((o,U,j,T,K,B)=>{s(o==="custom"?B:Et(o,U,j,T,K))},[s]),q=a(o=>{c(o),o==="custom"?E(t):S(o,u,h,x,D,C)},"handlePresetChange");return(0,e.jsxs)("div",{className:r?"flex flex-wrap items-center gap-2":"space-y-3",children:[(0,e.jsxs)(M,{value:m,onValueChange:a(o=>q(o),"onValueChange"),children:[(0,e.jsx)(I,{className:r?"w-36":"w-full","aria-label":"Schedule frequency",children:(0,e.jsx)(O,{placeholder:"Choose frequency..."})}),(0,e.jsx)($,{children:Tt.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]}),m==="custom"?(0,e.jsxs)("div",{className:r?"min-w-48 flex-1 space-y-1.5":"space-y-1.5",children:[(0,e.jsx)(W,{value:C,onChange:a(o=>{const U=o.target.value;E(U);const j=Se(U);n?.(j.valid),j.valid&&S("custom",u,h,x,D,U)},"onChange"),placeholder:"0 10 * * *","aria-label":"Cron expression","aria-invalid":!k.valid,className:"font-mono text-sm"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Five fields: minute hour day-of-month month day-of-week"}),(0,e.jsxs)("p",{className:k.valid?"text-xs text-muted-foreground":"text-xs text-destructive","aria-live":"polite",children:[k.message,k.valid&&k.nextFires.length>0?` Next: ${k.nextFires.map(o=>o.toLocaleString()).join(", ")}.`:null]})]}):(0,e.jsxs)("div",{className:r?"contents":"flex flex-wrap items-center gap-2",children:[m!=="every_minute"&&m!=="every_hour"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"at"}),(0,e.jsxs)(M,{value:u,onValueChange:a(o=>{y(o),S(m,o,h,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-120px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:he.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:":"}),(0,e.jsxs)(M,{value:h,onValueChange:a(o=>{f(o),S(m,u,o,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:ce.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]})]}),m==="every_hour"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"at minute"}),(0,e.jsxs)(M,{value:h,onValueChange:a(o=>{f(o),S(m,u,o,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:ce.map(o=>(0,e.jsxs)(b,{value:o.value,children:[":",o.label]},o.value))})]})]}),m==="weekly"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"on"}),(0,e.jsx)("div",{className:"flex gap-1",children:me.map(o=>(0,e.jsx)(V,{type:"button",variant:x===o.value?"default":"outline",size:"sm",className:"h-7 px-2 text-xs","aria-pressed":x===o.value,onClick:a(()=>{N(o.value),S(m,u,h,o.value,D,C)},"onClick"),children:o.label},o.value))})]}),m==="monthly"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"on day"}),(0,e.jsxs)(M,{value:D,onValueChange:a(o=>{L(o),S(m,u,h,x,o,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Ae.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]})]})]}),i]})}a(Mt,"ScheduleEditor");function Yt(t){return t.status==="archived"?"archived":t.assigneeAgentId?t.status==="active"?"active":"paused":"draft"}a(Yt,"routineAutomationState");var Gt={active:"Active",paused:"Paused",draft:"Draft",archived:"Archived"};function Jt({state:t,hasWebhooks:s,hasSchedule:n}){return t!=="paused"&&t!=="draft"?null:s&&n?"Scheduled runs are skipped and webhook events are ignored until this routine is on.":s?"Webhook events are ignored until this routine is on. The sending app gets an error.":n?"Scheduled runs are skipped until this routine is on.":null}a(Jt,"routinePausedNotice");function Zt({state:t,nextRun:s,hasEnabledWebhook:n,hasStandingCheck:r,now:i}){return t==="draft"?null:t==="archived"?"No longer runs":t==="paused"?"Run now still works":s?`Next run ${Ot(s,i)}`:n?"Runs when a webhook arrives":r?"Checked each time the agent wakes up":"Only runs when you start it"}a(Zt,"routineStatusDetail");function Xt(t){return t.filter(s=>s.kind==="schedule"&&s.enabled&&s.nextRunAt).map(s=>new Date(s.nextRunAt)).filter(s=>Number.isFinite(s.getTime())).sort((s,n)=>s.getTime()-n.getTime())[0]??null}a(Xt,"nextScheduledRun");function Ot(t,s=new Date){const n=t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),r=a(d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime(),"startOfDay"),i=Math.round((r(t)-r(s))/864e5);return i===0?`today at ${n}`:i===1?`tomorrow at ${n}`:`${t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})} at ${n}`}a(Ot,"formatNextRun");function es(t){return t.cronExpression?Vt(t.cronExpression):"Schedule"}a(es,"describeScheduleTrigger");function re(t){const s=t.signingMode==="github_hmac"?"GitHub webhook":"Webhook";return t.label?`${s} · ${t.label}`:s}a(re,"webhookTitle");function $t(t){const s=t.lastWebhookDelivery;return!t.setupPending||!s?!1:s.test?s.previous!=null:!0}a($t,"webhookRetesting");function Re(t){return t.setupPending?$t(t)?"testing":"setup":t.enabled?t.lastWebhookDelivery?.status==="rejected"?"rejected":t.lastWebhookDelivery?.status==="received"&&!t.lastWebhookDelivery.test?"receiving":"waiting":"paused"}a(Re,"webhookHealth");var Dt={setup:"Setup unfinished",testing:"Testing · events don’t run",paused:"Paused",rejected:"Key rejected",receiving:"Receiving events",waiting:"Waiting for the first event"};function ts(t,{routineActive:s,testing:n}){const r=Re(t),i=t.setupPending&&t.lastWebhookDelivery?.test?t.lastWebhookDelivery:null;return i?.status==="received"?"test_received":i?.status==="rejected"?"test_rejected":!s&&r!=="setup"&&r!=="testing"?"ignored_while_paused":r==="setup"&&n?"setup_testing":r}a(ts,"webhookStatusKey");var ss={setup:{title:"Waiting for a test event",detail:"Send one from your app. Test events never start the routine."},setup_testing:{title:"Waiting for a test event",detail:"Send one from your app. It won’t start the routine. Real events are ignored until you finish testing."},testing:{title:"Testing",detail:"Send an event from your app. It won’t start the routine. Real events are ignored until you finish testing."},waiting:{title:"Ready",detail:"The next event starts this routine."},receiving:{title:"Receiving events",detail:"Each event starts this routine."},rejected:{title:"The last event was rejected",detail:"The key didn’t match. Replace the key, then paste the new one into your app."},test_rejected:{title:"The last event was rejected",detail:"The key didn’t match. Replace the key, then paste the new one into your app."},test_received:{title:"Test event received",detail:"The connection works. No task was created."},ignored_while_paused:{title:"Ignoring events while the routine is paused",detail:"Turn the routine on to start it from this webhook. Until then the sending app gets an error."},paused:{title:"Paused",detail:"Events are ignored until you resume this webhook."}};function ns(t){const s=[];return t.concurrencyPolicy==="always_enqueue"&&s.push("Queues every run, even while one is still working"),t.concurrencyPolicy==="skip_if_active"&&s.push("Skips a run while one is still working"),t.catchUpPolicy==="enqueue_missed_with_cap"&&s.push("Catches up on runs missed while paused"),t.activityGatePolicy==="require_external_activity"&&s.push(t.activityGateScope==="project"?"Skips scheduled runs when nothing changed in its project":"Skips scheduled runs when nothing changed"),s}a(ns,"customRunRules");function as(t){const s=t.trim().split(/\n\s*\n/);if(s.length<=1)return{preview:t.trim(),truncated:!1};const n=/^#{1,6}\s/.test(s[0]??"")?2:1;return{preview:s.slice(0,n).join(`
1
+ var We=Object.defineProperty;var a=(t,s)=>We(t,"name",{value:s,configurable:!0});import{a as Ve}from"./rolldown-runtime-DhZMWcEn.js";import{En as le,ai as qe}from"./issue-detail-CZfjXs0M.js";import{i as ze,r as Le}from"./RoutineRunVariablesDialog-Baomcbe3.js";import{$A as Be,Ap as b,B_ as He,Bb as Ke,Bl as Qe,Bw as Ye,Fb as Ge,GS as Y,H_ as Je,Hm as Ze,ME as Xe,NE as V,Nb as et,Np as I,Op as M,Pb as tt,Pp as O,Rb as st,Um as oe,V_ as nt,Vm as ne,Y_ as at,__ as W,ay as rt,bE as lt,f_ as it,fy as ot,g_ as Ie,iC as ut,jT as ct,jb as be,kT as dt,kp as $,ly as ht,my as mt,nj as ft,op as _,p_ as xt,qC as ue,rb as pt,sy as gt,ub as G,uy as jt,v_ as Ne,xE as J,x_ as yt,zE as vt,z_ as wt}from"./index-BJtnP7H1.js";var g=Ve(ft(),1),e=Ve(Be(),1),Me=["text","textarea","number","boolean","select","date"];function _e(t){return JSON.stringify(t)}a(_e,"serializeVariables");function Oe(t){return t.split(",").map(s=>s.trim()).filter(Boolean)}a(Oe,"parseSelectOptions");function F(t,s,n){return t.map(r=>r.name===s?n(r):r)}a(F,"updateVariableList");function $e(t,s){return t==="boolean"?null:t==="date"?typeof s=="string"&&Le(s)?s:null:s}a($e,"defaultValueForType");function bt({title:t,description:s,value:n,onChange:r,variant:i="default"}){const[d,m]=(0,g.useState)(!0),c=(0,g.useMemo)(()=>ze([t,s],n),[s,t,n]),u=_e(c),y=_e(n);return(0,g.useEffect)(()=>{u!==y&&r(c)},[y,r,u,c]),c.length===0?null:i==="compact"?(0,e.jsx)(Nt,{variables:c,onPatch:a((h,f)=>r(F(c,h,f)),"onPatch")}):(0,e.jsxs)(wt,{open:d,onOpenChange:m,className:"overflow-hidden rounded-lg border border-border/70",children:[(0,e.jsxs)(nt,{className:"flex w-full items-center justify-between px-3 py-2 text-left",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:"Variables"}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Detected from `","{{name}}","` placeholders in the title and instructions."]})]}),d?(0,e.jsx)(ct,{className:"h-4 w-4 text-muted-foreground"}):(0,e.jsx)(dt,{className:"h-4 w-4 text-muted-foreground"})]}),(0,e.jsx)(He,{className:"divide-y divide-border/70 border-t border-border/70",children:c.map(h=>(0,e.jsxs)("div",{className:"p-4",children:[(0,e.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,e.jsx)(Je,{variant:"outline",className:"font-mono text-xs",children:`{{${h.name}}}`}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Prompt the user for this value before each manual run."})]}),(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Label"}),(0,e.jsx)(W,{value:h.label??"",onChange:a(f=>r(F(c,h.name,x=>({...x,label:f.target.value||null}))),"onChange"),placeholder:h.name.replaceAll("_"," ")})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Type"}),(0,e.jsxs)(M,{value:h.type,onValueChange:a(f=>r(F(c,h.name,x=>({...x,type:f,defaultValue:$e(f,x.defaultValue),options:f==="select"?x.options:[]}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Me.map(f=>(0,e.jsx)(b,{value:f,children:f},f))})]})]}),(0,e.jsxs)("div",{className:"space-y-1.5 md:col-span-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)(_,{className:"text-xs",children:"Default value"}),(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("input",{type:"checkbox",checked:h.required,onChange:a(f=>r(F(c,h.name,x=>({...x,required:f.target.checked}))),"onChange")}),"Required"]})]}),h.type==="textarea"?(0,e.jsx)(Ie,{rows:3,value:h.defaultValue==null?"":String(h.defaultValue),onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange")}):h.type==="boolean"?(0,e.jsxs)(M,{value:h.defaultValue===!0?"true":h.defaultValue===!1?"false":"__unset__",onValueChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f==="__unset__"?null:f==="true"}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),(0,e.jsx)(b,{value:"true",children:"True"}),(0,e.jsx)(b,{value:"false",children:"False"})]})]}):h.type==="select"?(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Options"}),(0,e.jsx)(W,{value:h.options.join(", "),onChange:a(f=>{const x=Oe(f.target.value);r(F(c,h.name,N=>({...N,options:x,defaultValue:typeof N.defaultValue=="string"&&x.includes(N.defaultValue)?N.defaultValue:null})))},"onChange"),placeholder:"high, medium, low"})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)(_,{className:"text-xs",children:"Default option"}),(0,e.jsxs)(M,{value:typeof h.defaultValue=="string"?h.defaultValue:"__unset__",onValueChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f==="__unset__"?null:f}))),"onValueChange"),children:[(0,e.jsx)(I,{children:(0,e.jsx)(O,{placeholder:"No default"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),h.options.map(f=>(0,e.jsx)(b,{value:f,children:f},f))]})]})]})]}):h.type==="date"?(0,e.jsx)(W,{type:"date",value:typeof h.defaultValue=="string"?h.defaultValue:"",onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange")}):(0,e.jsx)(W,{type:h.type==="number"?"number":"text",value:h.defaultValue==null?"":String(h.defaultValue),onChange:a(f=>r(F(c,h.name,x=>({...x,defaultValue:f.target.value||null}))),"onChange"),placeholder:h.type==="number"?"42":"Default value"})]})]})]},h.name))})]})}a(bt,"RoutineVariablesEditor");var P={name:"w-full shrink-0 sm:w-48",type:"w-28 shrink-0",defaultValue:"min-w-0 flex-1 basis-32",required:"flex w-16 shrink-0 justify-center"};function Nt({variables:t,onPatch:s}){return(0,e.jsxs)("div",{className:"flex flex-col gap-2",role:"group","aria-label":"Variables",children:[(0,e.jsx)(_,{children:"Variables"}),(0,e.jsxs)("div",{className:"hidden items-center gap-2 text-xs text-muted-foreground sm:flex","aria-hidden":"true",children:[(0,e.jsx)("span",{className:P.name,children:"Name"}),(0,e.jsx)("span",{className:P.type,children:"Type"}),(0,e.jsx)("span",{className:P.defaultValue,children:"Default"}),(0,e.jsx)("span",{className:P.required,children:"Required"})]}),t.map(n=>{const r=a(i=>s(n.name,d=>({...d,...i})),"patch");return(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("code",{className:`${P.name} truncate font-mono text-xs`,title:`{{${n.name}}}`,children:`{{${n.name}}}`}),(0,e.jsxs)(M,{value:n.type,onValueChange:a(i=>s(n.name,d=>({...d,type:i,defaultValue:$e(i,d.defaultValue),options:i==="select"?d.options:[]})),"onValueChange"),children:[(0,e.jsx)(I,{className:P.type,"aria-label":`Type of ${n.name}`,children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Me.map(i=>(0,e.jsx)(b,{value:i,children:i},i))})]}),(0,e.jsx)("div",{className:P.defaultValue,children:n.type==="boolean"?(0,e.jsxs)(M,{value:n.defaultValue===!0?"true":n.defaultValue===!1?"false":"__unset__",onValueChange:a(i=>r({defaultValue:i==="__unset__"?null:i==="true"}),"onValueChange"),children:[(0,e.jsx)(I,{className:"w-full","aria-label":`Default for ${n.name}`,children:(0,e.jsx)(O,{})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),(0,e.jsx)(b,{value:"true",children:"True"}),(0,e.jsx)(b,{value:"false",children:"False"})]})]}):n.type==="select"?(0,e.jsxs)(M,{value:typeof n.defaultValue=="string"?n.defaultValue:"__unset__",onValueChange:a(i=>r({defaultValue:i==="__unset__"?null:i}),"onValueChange"),children:[(0,e.jsx)(I,{className:"w-full","aria-label":`Default for ${n.name}`,children:(0,e.jsx)(O,{placeholder:"No default"})}),(0,e.jsxs)($,{children:[(0,e.jsx)(b,{value:"__unset__",children:"No default"}),n.options.map(i=>(0,e.jsx)(b,{value:i,children:i},i))]})]}):n.type==="textarea"?(0,e.jsx)(Ie,{rows:1,"aria-label":`Default for ${n.name}`,value:n.defaultValue==null?"":String(n.defaultValue),placeholder:"No default",onChange:a(i=>r({defaultValue:i.target.value||null}),"onChange")}):(0,e.jsx)(W,{type:n.type==="number"?"number":n.type==="date"?"date":"text","aria-label":`Default for ${n.name}`,value:n.defaultValue==null?"":String(n.defaultValue),placeholder:"No default",onChange:a(i=>r({defaultValue:i.target.value||null}),"onChange")})}),(0,e.jsxs)("label",{className:`${P.required} items-center gap-2 text-xs text-muted-foreground`,children:[(0,e.jsx)("input",{type:"checkbox",checked:n.required,"aria-label":`${n.name} is required`,onChange:a(i=>r({required:i.target.checked}),"onChange")}),(0,e.jsx)("span",{className:"sm:hidden",children:"Required"})]})]}),n.type==="select"?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`${P.name} hidden sm:block`,"aria-hidden":"true"}),(0,e.jsx)(W,{className:"min-w-0 flex-1","aria-label":`Options for ${n.name}`,value:n.options.join(", "),placeholder:"Options, separated by commas: high, medium, low",onChange:a(i=>{const d=Oe(i.target.value);s(n.name,m=>({...m,options:d,defaultValue:typeof m.defaultValue=="string"&&d.includes(m.defaultValue)?m.defaultValue:null}))},"onChange")}),(0,e.jsx)("span",{className:`${P.required} hidden sm:block`,"aria-hidden":"true"})]}):null]},n.name)})]})}a(Nt,"CompactVariableRows");var _t={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},z=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:6}];function Z(t,s){const n=new Set;for(const r of t.split(",")){const i=r.trim();if(i==="")throw new Error("Empty cron field element");const d=i.indexOf("/");if(d!==-1){const c=i.slice(0,d),u=Number.parseInt(i.slice(d+1),10);if(!Number.isInteger(u)||u<=0)throw new Error("Invalid cron step");let y=s.min,h=s.max;if(c!=="*")if(c.includes("-")){const[f,x]=c.split("-").map(N=>Number.parseInt(N,10));if(!Number.isInteger(f)||!Number.isInteger(x))throw new Error("Invalid cron range");y=f,h=x}else{const f=Number.parseInt(c,10);if(!Number.isInteger(f))throw new Error("Invalid cron start");y=f}X(y,s),X(h,s);for(let f=y;f<=h;f+=u)n.add(f);continue}if(i.includes("-")){const[c,u]=i.split("-").map(y=>Number.parseInt(y,10));if(!Number.isInteger(c)||!Number.isInteger(u))throw new Error("Invalid cron range");if(X(c,s),X(u,s),c>u)throw new Error("Invalid cron range (start > end)");for(let y=c;y<=u;y++)n.add(y);continue}if(i==="*"||i==="?"){for(let c=s.min;c<=s.max;c++)n.add(c);continue}const m=Number.parseInt(i,10);if(!Number.isInteger(m))throw new Error("Invalid cron value");X(m,s),n.add(m)}if(n.size===0)throw new Error("Empty cron field");return[...n].sort((r,i)=>r-i)}a(Z,"parseField");function X(t,s){if(t<s.min||t>s.max)throw new Error(`Cron value ${t} out of range`)}a(X,"assertBounds");function ke(t,s){return t.length===s.max-s.min+1&&t[0]===s.min&&t.at(-1)===s.max}a(ke,"coversEntireField");function De(t){if(!t)return null;const s=t.trim().split(/\s+/);if(s.length!==5)return null;try{const n=Z(s[2],z[2]),r=Z(s[4],z[4]);return{minutes:Z(s[0],z[0]),hours:Z(s[1],z[1]),daysOfMonth:n,months:Z(s[3],z[3]),daysOfWeek:r,daysOfMonthWildcard:ke(n,z[2]),daysOfWeekWildcard:ke(r,z[4])}}catch{return null}}a(De,"parseCronExpression");function kt(t,s){const n=new Intl.DateTimeFormat("en-US",{timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",weekday:"short",hourCycle:"h23"}),r={};for(const d of n.formatToParts(t))d.type!=="literal"&&(r[d.type]=d.value);const i=_t[r.weekday??""];if(i===void 0)throw new Error(`Unable to resolve weekday for ${s}`);return{month:Number(r.month),day:Number(r.day),hour:Number(r.hour),minute:Number(r.minute),weekday:i}}a(kt,"getZonedMinuteParts");function St(t,s){const n=t.daysOfMonth.includes(s.day),r=t.daysOfWeek.includes(s.weekday),i=!t.daysOfMonthWildcard&&!t.daysOfWeekWildcard?n||r:n&&r;return t.minutes.includes(s.minute)&&t.hours.includes(s.hour)&&t.months.includes(s.month)&&i}a(St,"matches");function Ct(t,s,n={}){const r=De(t);if(!r||s<=0)return[];const i=n.timeZone??"UTC",d=n.after??new Date,m=new Date(d.getTime());m.setUTCSeconds(0,0),m.setUTCMinutes(m.getUTCMinutes()+1);const c=[],u=1054080;for(let y=0;y<u&&c.length<s;y++){let h;try{h=kt(m,i)}catch{return c}St(r,h)&&c.push(new Date(m.getTime())),m.setUTCMinutes(m.getUTCMinutes()+1)}return c}a(Ct,"nextCronFires");var Tt=[{value:"every_minute",label:"Every minute"},{value:"every_hour",label:"Every hour"},{value:"every_day",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"custom",label:"Custom (cron)"}],he=Array.from({length:24},(t,s)=>({value:String(s),label:s===0?"12 AM":s<12?`${s} AM`:s===12?"12 PM":`${s-12} PM`})),ce=Array.from({length:12},(t,s)=>({value:String(s*5),label:String(s*5).padStart(2,"0")})),me=[{value:"1",label:"Mon"},{value:"2",label:"Tue"},{value:"3",label:"Wed"},{value:"4",label:"Thu"},{value:"5",label:"Fri"},{value:"6",label:"Sat"},{value:"0",label:"Sun"}],Ae=Array.from({length:31},(t,s)=>({value:String(s+1),label:String(s+1)}));function ae(t,s){return t.some(n=>n.value===s)}a(ae,"hasOption");function de(t){const s={hour:"10",minute:"0",dayOfWeek:"1",dayOfMonth:"1"};if(!t||!t.trim())return{preset:"every_day",...s};const n=t.trim().split(/\s+/);if(n.length!==5)return{preset:"custom",...s};const[r,i,d,m,c]=n,u=ae(ce,r),y=ae(he,i);return r==="*"&&i==="*"&&d==="*"&&m==="*"&&c==="*"?{preset:"every_minute",...s}:i==="*"&&d==="*"&&m==="*"&&c==="*"&&u?{preset:"every_hour",...s,minute:r}:d==="*"&&m==="*"&&c==="*"&&y&&u?{preset:"every_day",...s,hour:i,minute:r}:d==="*"&&m==="*"&&c==="1-5"&&y&&u?{preset:"weekdays",...s,hour:i,minute:r}:d==="*"&&m==="*"&&ae(me,c)&&y&&u?{preset:"weekly",...s,hour:i,minute:r,dayOfWeek:c}:m==="*"&&ae(Ae,d)&&c==="*"&&y&&u?{preset:"monthly",...s,hour:i,minute:r,dayOfMonth:d}:{preset:"custom",...s}}a(de,"parseCronToPreset");function Et(t,s,n,r,i){switch(t){case"every_minute":return"* * * * *";case"every_hour":return`${n} * * * *`;case"every_day":return`${n} ${s} * * *`;case"weekdays":return`${n} ${s} * * 1-5`;case"weekly":return`${n} ${s} * * ${r}`;case"monthly":return`${n} ${s} ${i} * *`;case"custom":return""}}a(Et,"buildCron");function Vt(t){const{preset:s,hour:n,minute:r,dayOfWeek:i,dayOfMonth:d}=de(t),m=he.find(u=>u.value===n)?.label??`${n}`,c=`${m.replace(/ (AM|PM)$/,"")}:${r.padStart(2,"0")} ${m.match(/(AM|PM)$/)?.[0]??""}`;switch(s){case"every_minute":return"Every minute";case"every_hour":return`Every hour at :${r.padStart(2,"0")}`;case"every_day":return`Every day at ${c}`;case"weekdays":return`Weekdays at ${c}`;case"weekly":return`Every ${me.find(u=>u.value===i)?.label??i} at ${c}`;case"monthly":return`Monthly on the ${d}${It(Number(d))} at ${c}`;case"custom":return t||"No schedule set"}}a(Vt,"describeSchedule");function It(t){const s=["th","st","nd","rd"],n=t%100;return s[(n-20)%10]||s[n]||s[0]}a(It,"ordinalSuffix");function Se(t){const s=t.trim();if(!s)return{valid:!1,message:"Enter a 5-field cron expression.",nextFires:[]};const n=s.split(/\s+/);if(n.length!==5)return{valid:!1,message:`Use exactly 5 fields; this has ${n.length}.`,nextFires:[]};if(!De(s))return{valid:!1,message:"Cron fields must use valid numbers, ranges, lists, wildcards, or steps.",nextFires:[]};const r=Ct(s,3,{timeZone:"UTC"});return{valid:!0,message:r.length>0?"Valid cron.":"Valid cron, but no upcoming fires were found.",nextFires:r}}a(Se,"getScheduleCronValidation");function Mt({value:t,onChange:s,onValidityChange:n,inline:r=!1,trailing:i}){const d=(0,g.useMemo)(()=>de(t),[t]),[m,c]=(0,g.useState)(d.preset),[u,y]=(0,g.useState)(d.hour),[h,f]=(0,g.useState)(d.minute),[x,N]=(0,g.useState)(d.dayOfWeek),[D,L]=(0,g.useState)(d.dayOfMonth),[C,E]=(0,g.useState)(m==="custom"?t:""),k=(0,g.useMemo)(()=>Se(C),[C]);(0,g.useEffect)(()=>{n?.(m!=="custom"||k.valid)},[k.valid,n,m]),(0,g.useEffect)(()=>{const o=de(t);c(o.preset),y(o.hour),f(o.minute),N(o.dayOfWeek),L(o.dayOfMonth),o.preset==="custom"&&E(t)},[t]);const S=(0,g.useCallback)((o,U,j,T,K,B)=>{s(o==="custom"?B:Et(o,U,j,T,K))},[s]),q=a(o=>{c(o),o==="custom"?E(t):S(o,u,h,x,D,C)},"handlePresetChange");return(0,e.jsxs)("div",{className:r?"flex flex-wrap items-center gap-2":"space-y-3",children:[(0,e.jsxs)(M,{value:m,onValueChange:a(o=>q(o),"onValueChange"),children:[(0,e.jsx)(I,{className:r?"w-36":"w-full","aria-label":"Schedule frequency",children:(0,e.jsx)(O,{placeholder:"Choose frequency..."})}),(0,e.jsx)($,{children:Tt.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]}),m==="custom"?(0,e.jsxs)("div",{className:r?"min-w-48 flex-1 space-y-1.5":"space-y-1.5",children:[(0,e.jsx)(W,{value:C,onChange:a(o=>{const U=o.target.value;E(U);const j=Se(U);n?.(j.valid),j.valid&&S("custom",u,h,x,D,U)},"onChange"),placeholder:"0 10 * * *","aria-label":"Cron expression","aria-invalid":!k.valid,className:"font-mono text-sm"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Five fields: minute hour day-of-month month day-of-week"}),(0,e.jsxs)("p",{className:k.valid?"text-xs text-muted-foreground":"text-xs text-destructive","aria-live":"polite",children:[k.message,k.valid&&k.nextFires.length>0?` Next: ${k.nextFires.map(o=>o.toLocaleString()).join(", ")}.`:null]})]}):(0,e.jsxs)("div",{className:r?"contents":"flex flex-wrap items-center gap-2",children:[m!=="every_minute"&&m!=="every_hour"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"at"}),(0,e.jsxs)(M,{value:u,onValueChange:a(o=>{y(o),S(m,o,h,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-120px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:he.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:":"}),(0,e.jsxs)(M,{value:h,onValueChange:a(o=>{f(o),S(m,u,o,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:ce.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]})]}),m==="every_hour"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"at minute"}),(0,e.jsxs)(M,{value:h,onValueChange:a(o=>{f(o),S(m,u,o,x,D,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:ce.map(o=>(0,e.jsxs)(b,{value:o.value,children:[":",o.label]},o.value))})]})]}),m==="weekly"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"on"}),(0,e.jsx)("div",{className:"flex gap-1",children:me.map(o=>(0,e.jsx)(V,{type:"button",variant:x===o.value?"default":"outline",size:"sm",className:"h-7 px-2 text-xs","aria-pressed":x===o.value,onClick:a(()=>{N(o.value),S(m,u,h,o.value,D,C)},"onClick"),children:o.label},o.value))})]}),m==="monthly"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"on day"}),(0,e.jsxs)(M,{value:D,onValueChange:a(o=>{L(o),S(m,u,h,x,o,C)},"onValueChange"),children:[(0,e.jsx)(I,{className:"w-(--sz-80px)",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Ae.map(o=>(0,e.jsx)(b,{value:o.value,children:o.label},o.value))})]})]})]}),i]})}a(Mt,"ScheduleEditor");function Yt(t){return t.status==="archived"?"archived":t.assigneeAgentId?t.status==="active"?"active":"paused":"draft"}a(Yt,"routineAutomationState");var Gt={active:"Active",paused:"Paused",draft:"Draft",archived:"Archived"};function Jt({state:t,hasWebhooks:s,hasSchedule:n}){return t!=="paused"&&t!=="draft"?null:s&&n?"Scheduled runs are skipped and webhook events are ignored until this routine is on.":s?"Webhook events are ignored until this routine is on. The sending app gets an error.":n?"Scheduled runs are skipped until this routine is on.":null}a(Jt,"routinePausedNotice");function Zt({state:t,nextRun:s,hasEnabledWebhook:n,hasStandingCheck:r,now:i}){return t==="draft"?null:t==="archived"?"No longer runs":t==="paused"?"Run now still works":s?`Next run ${Ot(s,i)}`:n?"Runs when a webhook arrives":r?"Checked each time the agent wakes up":"Only runs when you start it"}a(Zt,"routineStatusDetail");function Xt(t){return t.filter(s=>s.kind==="schedule"&&s.enabled&&s.nextRunAt).map(s=>new Date(s.nextRunAt)).filter(s=>Number.isFinite(s.getTime())).sort((s,n)=>s.getTime()-n.getTime())[0]??null}a(Xt,"nextScheduledRun");function Ot(t,s=new Date){const n=t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),r=a(d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime(),"startOfDay"),i=Math.round((r(t)-r(s))/864e5);return i===0?`today at ${n}`:i===1?`tomorrow at ${n}`:`${t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})} at ${n}`}a(Ot,"formatNextRun");function es(t){return t.cronExpression?Vt(t.cronExpression):"Schedule"}a(es,"describeScheduleTrigger");function re(t){const s=t.signingMode==="github_hmac"?"GitHub webhook":"Webhook";return t.label?`${s} · ${t.label}`:s}a(re,"webhookTitle");function $t(t){const s=t.lastWebhookDelivery;return!t.setupPending||!s?!1:s.test?s.previous!=null:!0}a($t,"webhookRetesting");function Re(t){return t.setupPending?$t(t)?"testing":"setup":t.enabled?t.lastWebhookDelivery?.status==="rejected"?"rejected":t.lastWebhookDelivery?.status==="received"&&!t.lastWebhookDelivery.test?"receiving":"waiting":"paused"}a(Re,"webhookHealth");var Dt={setup:"Setup unfinished",testing:"Testing · events don’t run",paused:"Paused",rejected:"Key rejected",receiving:"Receiving events",waiting:"Waiting for the first event"};function ts(t,{routineActive:s,testing:n}){const r=Re(t),i=t.setupPending&&t.lastWebhookDelivery?.test?t.lastWebhookDelivery:null;return i?.status==="received"?"test_received":i?.status==="rejected"?"test_rejected":!s&&r!=="setup"&&r!=="testing"?"ignored_while_paused":r==="setup"&&n?"setup_testing":r}a(ts,"webhookStatusKey");var ss={setup:{title:"Waiting for a test event",detail:"Send one from your app. Test events never start the routine."},setup_testing:{title:"Waiting for a test event",detail:"Send one from your app. It won’t start the routine. Real events are ignored until you finish testing."},testing:{title:"Testing",detail:"Send an event from your app. It won’t start the routine. Real events are ignored until you finish testing."},waiting:{title:"Ready",detail:"The next event starts this routine."},receiving:{title:"Receiving events",detail:"Each event starts this routine."},rejected:{title:"The last event was rejected",detail:"The key didn’t match. Replace the key, then paste the new one into your app."},test_rejected:{title:"The last event was rejected",detail:"The key didn’t match. Replace the key, then paste the new one into your app."},test_received:{title:"Test event received",detail:"The connection works. No task was created."},ignored_while_paused:{title:"Ignoring events while the routine is paused",detail:"Turn the routine on to start it from this webhook. Until then the sending app gets an error."},paused:{title:"Paused",detail:"Events are ignored until you resume this webhook."}};function ns(t){const s=[];return t.concurrencyPolicy==="always_enqueue"&&s.push("Queues every run, even while one is still working"),t.concurrencyPolicy==="skip_if_active"&&s.push("Skips a run while one is still working"),t.catchUpPolicy==="enqueue_missed_with_cap"&&s.push("Catches up on runs missed while paused"),t.activityGatePolicy==="require_external_activity"&&s.push(t.activityGateScope==="project"?"Skips scheduled runs when nothing changed in its project":"Skips scheduled runs when nothing changed"),s}a(ns,"customRunRules");function as(t){const s=t.trim().split(/\n\s*\n/);if(s.length<=1)return{preview:t.trim(),truncated:!1};const n=/^#{1,6}\s/.test(s[0]??"")?2:1;return{preview:s.slice(0,n).join(`
2
2
 
3
3
  `),truncated:s.length>n}}a(as,"instructionsPreview");var At={title:"",description:"",projectId:"",assigneeAgentId:"",responsibleUserId:"",responsibilityId:"",variables:[],env:null,schedule:null},Rt=["America/Los_Angeles","America/Chicago","America/New_York","Europe/London","UTC"];function Ce(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}a(Ce,"localTimezone");function rs({open:t,onOpenChange:s,mode:n="edit",initial:r,agents:i,projects:d,people:m,secrets:c,responsibilities:u,mentions:y,canChangeResponsibleUser:h=!0,saving:f=!1,saveConflict:x=!1,error:N=null,onSave:D,onReloadLatest:L,onCreateSecret:C,webhooks:E=[],onOpenWebhook:k,onRemoveWebhook:S,removedWebhooks:q=[],onRestoreWebhook:o,children:U}){const[j,T]=(0,g.useState)(r),[K,B]=(0,g.useState)(()=>Object.keys(r.env??{}).length>0),[ee,te]=(0,g.useState)(!0),[v,w]=(0,g.useState)(!1),Q=(0,g.useRef)(null),A=(0,g.useRef)(null),[H,fe]=(0,g.useState)(!1),se=(0,g.useId)();(0,g.useEffect)(()=>{t&&(T(r),B(Object.keys(r.env??{}).length>0),w(!1),fe(!1))},[r,t]);const xe=(0,g.useMemo)(()=>JSON.stringify(j)!==JSON.stringify(r),[j,r])||H,R=a(l=>T(p=>({...p,...l})),"patch"),pe=(0,g.useMemo)(()=>new Map(i.map(l=>[l.id,l])),[i]),ie=(0,g.useMemo)(()=>new Map(d.map(l=>[l.id,l])),[d]),Fe=(0,g.useMemo)(()=>new Map(m.map(l=>[l.id,l])),[m]),Pe=(0,g.useMemo)(()=>new Map((u??[]).map(l=>[l.id,l])),[u]),ge=j.projectId?(u??[]).find(l=>l.id!==j.responsibilityId&&l.projectIds?.includes(j.projectId))??null:null,je=j.title.trim().length>0&&ee&&!f&&!x&&(n==="create"||xe),ye=a(()=>{if(!je)return;const l=A.current?.flushPendingDraft();l?.status!=="blocked"&&D(l?.status==="flushed"?{...j,env:Object.keys(l.value).length>0?l.value:null}:j)},"submit"),ve=a(()=>{f||(xe?w(!0):s(!1))},"requestClose"),we=a(l=>{const p=Fe.get(l);return p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(tt,{size:"xs","aria-hidden":"true",children:[p.avatarUrl?(0,e.jsx)(st,{src:p.avatarUrl,alt:""}):null,(0,e.jsx)(Ge,{children:et(p.name)})]}),(0,e.jsx)("span",{className:"truncate",children:p.name})]}):null},"personOption");return(0,e.jsx)(gt,{open:t,onOpenChange:a(l=>l?s(!0):ve(),"onOpenChange"),children:(0,e.jsxs)(ht,{className:"flex max-h-(--sz-calc-18) flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[(0,e.jsxs)(ot,{className:"px-6 pb-4 pt-6",children:[(0,e.jsx)(mt,{children:n==="create"?"New routine":"Edit routine"}),(0,e.jsx)(jt,{className:"sr-only",children:n==="create"?"Describe the work, then choose who does it and when.":"Change what this routine does, who does it, and when."})]}),(0,e.jsxs)("form",{id:`${se}-form`,className:"flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto px-6 pb-6 [&>*]:shrink-0",onSubmit:a(l=>{l.preventDefault(),ye()},"onSubmit"),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(_,{htmlFor:se,children:"Title"}),(0,e.jsx)(W,{id:se,value:j.title,autoFocus:n==="create",placeholder:"Send the weekly digest",onChange:a(l=>R({title:l.target.value}),"onChange")})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(_,{children:"Instructions"}),(0,e.jsx)("div",{className:"h-48 min-h-32 resize-y overflow-y-auto rounded-md border border-border px-3 py-2 focus-within:border-ring",onClick:a(l=>{l.target===l.currentTarget&&Q.current?.focus()},"onClick"),children:(0,e.jsx)(Ze,{ref:Q,bordered:!1,ariaLabel:"Instructions",value:j.description,onChange:a(l=>R({description:l}),"onChange"),placeholder:"What should the agent do each time? Type / for skills and routines, @ to mention, {{name}} to ask for a value.",contentClassName:"text-sm leading-6",mentions:y,submitKey:"mod-enter",onSubmit:ye})})]}),(0,e.jsx)(bt,{title:j.title,description:j.description,value:j.variables,onChange:a(l=>R({variables:l}),"onChange"),variant:"compact"}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(_,{children:"Repeats"}),j.schedule?(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)(Mt,{inline:!0,value:j.schedule.cronExpression,onChange:a(l=>T(p=>p.schedule?{...p,schedule:{...p.schedule,cronExpression:l}}:p),"onChange"),onValidityChange:te,trailing:(0,e.jsxs)(M,{value:j.schedule.timezone,onValueChange:a(l=>T(p=>p.schedule?{...p,schedule:{...p.schedule,timezone:l}}:p),"onValueChange"),children:[(0,e.jsx)(I,{className:"w-48","aria-label":"Time zone",children:(0,e.jsx)(O,{})}),(0,e.jsx)($,{children:Array.from(new Set([j.schedule.timezone,Ce(),...Rt])).map(l=>(0,e.jsx)(b,{value:l,children:l},l))})]})}),(0,e.jsx)(V,{type:"button",variant:"ghost",size:"sm",className:"-mx-2 w-fit text-muted-foreground",onClick:a(()=>{te(!0),R({schedule:null})},"onClick"),children:"Remove schedule"})]}):(0,e.jsxs)(V,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:a(()=>R({schedule:{cronExpression:"0 9 * * 1-5",timezone:Ce()}}),"onClick"),children:[(0,e.jsx)(ue,{className:"h-3.5 w-3.5"}),"Add schedule"]})]}),k?(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(_,{children:"Webhooks"}),q.map(l=>(0,e.jsxs)("p",{role:"status",className:"flex max-w-md items-center gap-2 text-sm text-muted-foreground",children:[(0,e.jsxs)("span",{className:"min-w-0 flex-1 truncate",children:[re(l)," removed."]}),(0,e.jsx)(V,{type:"button",variant:"ghost",size:"xs",onClick:a(()=>o?.(l),"onClick"),children:"Undo"})]},l.id)),E.length>0?(0,e.jsx)("ul",{className:"flex max-w-md flex-col",children:E.map(l=>{const p=Re(l),Ue=l.signingMode==="github_hmac"?Ye:qe;return(0,e.jsxs)("li",{className:"group/webhook -mx-2 flex items-center rounded-md hover:bg-accent/50 focus-within:bg-accent/50",children:[(0,e.jsxs)("button",{type:"button","aria-label":`Configure ${re(l)}`,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:a(()=>k(l),"onClick"),children:[(0,e.jsx)(Ue,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium",children:re(l)}),(0,e.jsx)("span",{className:vt("shrink-0 text-xs",p==="rejected"?"text-destructive":"text-muted-foreground"),children:Dt[p]})]}),S?(0,e.jsx)(V,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove ${re(l)}`,className:"mr-1 text-muted-foreground opacity-0 hover:text-destructive focus-visible:opacity-100 group-hover/webhook:opacity-100 group-focus-within/webhook:opacity-100",onClick:a(()=>S(l),"onClick"),children:(0,e.jsx)(ut,{})}):null]},l.id)})}):null,(0,e.jsxs)(V,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:a(()=>k(null),"onClick"),children:[(0,e.jsx)(ue,{className:"h-3.5 w-3.5"}),"Add webhook"]})]}):null,(0,e.jsxs)("div",{className:"flex max-w-xs flex-col gap-6",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(_,{children:"Default agent"}),(0,e.jsx)(ne,{value:j.assigneeAgentId,options:i.map(l=>({id:l.id,label:l.name})),placeholder:"Choose an agent",noneLabel:"No default agent",searchPlaceholder:"Search agents…",emptyMessage:"No agents found.",disablePortal:!0,className:"h-9 w-full justify-start",onChange:a(l=>R({assigneeAgentId:l}),"onChange"),renderTriggerValue:a(l=>{const p=l?pe.get(l.id):null;return p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(be,{agent:p,size:20,className:"shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:p.name})]}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"Choose an agent"})},"renderTriggerValue"),renderOption:a(l=>{const p=pe.get(l.id);return(0,e.jsxs)(e.Fragment,{children:[p?(0,e.jsx)(be,{agent:p,size:20,className:"shrink-0"}):null,(0,e.jsx)("span",{className:"truncate",children:l.label})]})},"renderOption")})]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(_,{children:"Project"}),(0,e.jsx)(ne,{value:j.projectId,options:d.map(l=>({id:l.id,label:l.name})),placeholder:"No project",noneLabel:"No project",searchPlaceholder:"Search projects…",emptyMessage:"No projects found.",disablePortal:!0,className:"h-9 w-full justify-start",onChange:a(l=>R({projectId:l}),"onChange"),renderTriggerValue:a(l=>{const p=l?ie.get(l.id):null;return p?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:p.color??"var(--project-none)"}}),(0,e.jsx)("span",{className:"truncate",children:p.name})]}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"No project"})},"renderTriggerValue"),renderOption:a(l=>{const p=ie.get(l.id);return(0,e.jsxs)(e.Fragment,{children:[p?(0,e.jsx)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:p.color??"var(--project-none)"}}):null,(0,e.jsx)("span",{className:"truncate",children:l.label})]})},"renderOption")})]}),u?(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(_,{children:"Responsibility"}),(0,e.jsx)(ne,{value:j.responsibilityId,options:u.map(l=>({id:l.id,label:l.title,searchText:l.areaTitle??""})),placeholder:"No responsibility",noneLabel:"No responsibility",searchPlaceholder:"Search responsibilities…",emptyMessage:"No responsibilities found.",disablePortal:!0,className:"h-9 w-full justify-start",onChange:a(l=>R({responsibilityId:l}),"onChange"),renderTriggerValue:a(l=>l?.id?(0,e.jsx)("span",{className:"truncate",children:l.label}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"No responsibility"}),"renderTriggerValue"),renderOption:a(l=>{const p=Pe.get(l.id)?.areaTitle;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l.label}),p?(0,e.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}):null]})},"renderOption")}),ge?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Already under ",ge.title," through ",ie.get(j.projectId)?.name??"its project","."]}):null]}):null,(0,e.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,e.jsx)(_,{children:"Default responsible user"}),(0,e.jsx)(ne,{value:j.responsibleUserId,options:m.map(l=>({id:l.id,label:l.name})),placeholder:"Choose a person",noneLabel:"No one",hideNone:!!r.responsibleUserId,searchPlaceholder:"Find a person…",emptyMessage:"No people found.",disablePortal:!0,disabled:!h,className:"h-9 w-full justify-start",onChange:a(l=>R({responsibleUserId:l}),"onChange"),renderTriggerValue:a(l=>l&&we(l.id)||(0,e.jsx)("span",{className:"text-muted-foreground",children:"Choose a person"}),"renderTriggerValue"),renderOption:a(l=>we(l.id)??(0,e.jsx)("span",{className:"truncate",children:l.label}),"renderOption")})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(_,{children:"Secrets"}),K?(0,e.jsx)(Qe,{ref:A,onDirtyChange:fe,value:j.env??{},secrets:c,onCreateSecret:C,onChange:a(l=>R({env:l&&Object.keys(l).length>0?l:null}),"onChange"),footerHint:null,hideDraftActions:!0,startWithEmptyRow:!0,addLabel:"Add secret"}):(0,e.jsxs)(V,{type:"button",variant:"outline",size:"sm",className:"w-fit",onClick:a(()=>B(!0),"onClick"),children:[(0,e.jsx)(ue,{className:"h-3.5 w-3.5"}),"Add secret"]})]})]}),(0,e.jsx)("footer",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-border px-6 py-4",children:v?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"text-sm",role:"alert",children:"Discard your changes?"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(V,{variant:"ghost",onClick:a(()=>w(!1),"onClick"),children:"Keep editing"}),(0,e.jsx)(V,{variant:"destructive",onClick:a(()=>s(!1),"onClick"),children:"Discard"})]})]}):x?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{className:"min-w-0 flex-1 text-sm",role:"alert",children:"This routine changed while you were editing. Reload to see the latest version."}),(0,e.jsx)(V,{variant:"outline",onClick:L,children:"Reload latest"})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(V,{variant:"ghost",onClick:ve,disabled:f,children:"Cancel"}),(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[N?(0,e.jsx)("p",{className:"min-w-0 text-sm text-destructive",role:"alert",children:N}):null,(0,e.jsx)(V,{type:"submit",form:`${se}-form`,disabled:!je,children:f?"Saving…":n==="create"?"Create routine":"Save changes"})]})]})}),U]})})}a(rs,"RoutineEditDialog");function Ft(t){return t.find(s=>s.kind==="schedule")??null}a(Ft,"primarySchedule");function ls(t,s=""){const n=Ft(t.triggers);return{...At,title:t.title,description:t.description??"",projectId:t.projectId??"",assigneeAgentId:t.assigneeAgentId??"",responsibleUserId:t.responsibleUserId??"",responsibilityId:s,variables:t.variables,env:t.env??null,schedule:n?.cronExpression?{cronExpression:n.cronExpression,timezone:n.timezone??"UTC"}:null}}a(ls,"routineToDraft");function Pt(t){return t&&Object.keys(t).length>0?t:null}a(Pt,"cleanEnv");function Te(t){return{title:t.title.trim(),description:t.description.trim()||null,projectId:t.projectId||null,assigneeAgentId:t.assigneeAgentId||null,variables:t.variables,env:Pt(t.env)}}a(Te,"routineFieldsPayload");function is(t,s){return JSON.stringify(Te(t))!==JSON.stringify(Te(s))}a(is,"routineFieldsChanged");async function os(t,s,n,r){const i=n?s.find(d=>d.id===n)??null:null;return r?i?i.cronExpression===r.cronExpression&&(i.timezone??"UTC")===r.timezone?{changed:!1,scheduleId:i.id}:(await oe.updateTrigger(i.id,{cronExpression:r.cronExpression,timezone:r.timezone}),{changed:!0,scheduleId:i.id}):{changed:!0,scheduleId:(await oe.createTrigger(t,{kind:"schedule",cronExpression:r.cronExpression,timezone:r.timezone})).trigger.id}:i?(await oe.updateTrigger(i.id,{archived:!0}),{changed:!0,scheduleId:null}):{changed:!1,scheduleId:null}}a(os,"syncRoutineSchedule");async function us(t,s,n){if(s===n)return!1;if(n&&await le.link(n,{routineId:t}),s){const r=(await le.get(s)).routines.find(i=>i.id===t&&i.linkId);r?.linkId&&await le.unlink(s,r.linkId)}return!0}a(us,"syncRoutineResponsibility");var Ee={details:"the routine’s details",schedule:"the schedule",responsibility:"the responsibility"},cs=class extends Error{static{a(this,"PartialRoutineSaveError")}constructor(t,s,n){const r=n instanceof Error&&n.message?` (${n.message})`:"",i=t.map(d=>Ee[d]).join(" and ");super(`Saved ${i}, but ${Ee[s]} couldn’t be updated${r}. Save again to finish.`),this.name="PartialRoutineSaveError"}};function ds({links:t,options:s,areaTitles:n,projectId:r}){const i=a(u=>u?n.get(u)??null:null,"areaTitle"),d=new Set(t.filter(u=>u.via==="project").map(u=>u.id)),m=new Set(s.map(u=>u.id)),c=a(u=>r&&d.has(u)?[r]:[],"projectIdsFor");return{onPage:t.map(u=>({id:u.id,title:u.title,areaTitle:i(u.areaId),via:u.via})),choices:[...s.map(u=>({...u,projectIds:c(u.id)})),...t.filter(u=>!m.has(u.id)).map(u=>({id:u.id,title:u.title,areaTitle:i(u.areaId),projectIds:c(u.id)}))]}}a(ds,"buildRoutineResponsibilityChoices");function Ut(t,s="routine"){return s==="routine"?`/routines/${t}`:`/routines/${t}/${s}`}a(Ut,"routinePath");function hs(t){const s=t.legacyTab??t.section??null,n=s==="history"?"history":s==="activity"?"activity":"routine",r=Ut(t.routineId,n),i=t.section?`/routines/${t.routineId}/${t.section}`:`/routines/${t.routineId}`;return{view:n,redirectTo:t.legacyTab||i!==r?r:null}}a(hs,"resolveRoutineAddress");var Wt=[],qt=[],zt=[];function ms(t,{active:s=!0}={}){const n=Xe(),r=!!t&&s,{enabled:i}=at(),{userId:d}=Ke({enabled:r&&i}),m=J({queryKey:Y.agents.list(t??""),queryFn:a(()=>pt.list(t),"queryFn"),enabled:r}),c=J({...yt(t??"",{includeArchived:!0}),enabled:r}),u=J({queryKey:Y.access.companyUserDirectory(t??""),queryFn:a(()=>rt.listUserDirectory(t),"queryFn"),enabled:r}),y=J({queryKey:Y.secrets.list(t??""),queryFn:a(()=>Ne.list(t),"queryFn"),enabled:r}),h=J({queryKey:Y.responsibilities.overview(t??"",{ownerUserId:d}),queryFn:a(()=>le.overview(t),"queryFn"),enabled:r&&i&&!!d}),f=G(m),x=G(c),N=G(u),D=G(y),L=G(h),C=[{action:"load agents",view:f},{action:"load projects",view:x},{action:"load people",view:N},{action:"load secrets",view:D},{action:"load responsibilities",view:L}].filter(({view:v})=>v.kind==="error").map(({action:v,view:w})=>({action:v,error:w.error,retry:w.retry,retrying:w.isFetching})),E=m.data,k=(0,g.useMemo)(()=>(E??[]).filter(v=>v.status!=="terminated"),[E]),S=c.data,q=(0,g.useMemo)(()=>(S??[]).filter(v=>!v.archivedAt),[S]),o=u.data?.users,U=(0,g.useMemo)(()=>{const v=it(o),w=new Set,Q=[];for(const A of o??[]){if(A.status!=="active"||w.has(A.principalId))continue;w.add(A.principalId);const H=v.get(A.principalId);Q.push({id:A.principalId,name:H?.label??"Unnamed person",avatarUrl:H?.image??null})}return Q.sort((A,H)=>A.name.localeCompare(H.name))},[o]),j=(0,g.useMemo)(()=>xt({agents:E,projects:q,members:o}),[E,o,q]),T=h.data,K=(0,g.useMemo)(()=>{if(!i)return;const v=new Map((T?.areas??[]).map(w=>[w.id,w.title]));return[...T?.responsibilities??[],...T?.proposed??[]].map(w=>({id:w.id,title:w.title,areaTitle:w.areaId?v.get(w.areaId)??null:null}))},[T,i]),B=(0,g.useMemo)(()=>new Map((T?.areas??[]).map(v=>[v.id,v.title])),[T]),{mutateAsync:ee}=lt({mutationFn:a(v=>Ne.create(t,v),"mutationFn"),onSuccess:a(()=>n.invalidateQueries({queryKey:Y.secrets.list(t)}),"onSuccess")}),te=(0,g.useCallback)((v,w)=>ee({name:v,value:w}),[ee]);return{agents:k,allAgents:E??Wt,projects:q,allProjects:S??qt,people:U,secrets:y.data??zt,mentions:j,responsibilitiesOn:i,responsibilities:K,areaTitles:B,createSecret:te,loadErrors:C,peopleFailed:N.kind==="error"&&!o}}a(ms,"useRoutineFormOptions");export{Jt as C,re as D,ts as E,Mt as O,Yt as S,Re as T,ns as _,ds as a,as as b,Te as c,os as d,At as f,ss as g,Dt as h,cs as i,ls as l,Gt as m,hs as n,Ft as o,rs as p,Ut as r,is as s,ms as t,us as u,es as v,Zt as w,Xt as x,Ot as y};
@@ -1,3 +1,3 @@
1
- var U=Object.defineProperty;var l=(e,s)=>U(e,"name",{value:s,configurable:!0});import{a as Y}from"./rolldown-runtime-DhZMWcEn.js";import{$ as I,Q as H,X as Q,Y as j,Z as F}from"./issue-detail-4PCbYpdv.js";import{GS as V,Gn as W,Hn as X,Qv as z,nj as J,rS as P,xE as Z,yE as ee}from"./index-Bt31d8ga.js";var c=Y(J(),1),G=/^STATUS:[ \t]?(.*)$/gm,te=/^<<<SUMMARY-DRAFT>>>[ \t]*$/m,ne=/^<<<END-SUMMARY-DRAFT>>>[ \t]*$/m,re={statusLine:null,statusLines:[],draft:null,draftClosed:!1};function se(e){let s="";for(const o of e){const u=ue(o.chunk);if(!u||u.type!=="acpx.text_delta")continue;const r=typeof u.channel=="string"?u.channel:"output";r==="thought"||r==="thinking"||typeof u.text=="string"&&(s+=u.text)}return s}l(se,"extractAssistantOutputText");function ue(e){const s=e.trim();if(!s.startsWith("{"))return null;try{const o=JSON.parse(s);return typeof o=="object"&&o!==null?o:null}catch{return null}}l(ue,"tryParseRecord");function ae(e){if(!e)return re;const s=[];G.lastIndex=0;let o;for(;(o=G.exec(e))!==null;){const f=(o[1]??"").trim();f&&s.push(f)}const u=s.length>0?s[s.length-1]:null,r=e.match(te);let y=null,R=!1;if(r&&r.index!==void 0){const f=e.slice(r.index+r[0].length).replace(/^\r?\n/,""),h=f.match(ne);h&&h.index!==void 0?(y=f.slice(0,h.index).replace(/\r?\n$/,""),R=!0):(y=f,R=!1)}return{statusLine:u,statusLines:s,draft:y,draftClosed:R}}l(ae,"parseSummaryDraftStream");function ce(e){const s=e.match(/^```/gm);return s&&s.length%2===1?`${e}${e.length>0&&!e.endsWith(`
1
+ var U=Object.defineProperty;var l=(e,s)=>U(e,"name",{value:s,configurable:!0});import{a as Y}from"./rolldown-runtime-DhZMWcEn.js";import{$ as I,Q as H,X as Q,Y as j,Z as F}from"./issue-detail-CZfjXs0M.js";import{GS as V,Gn as W,Hn as X,Qv as z,nj as J,rS as P,xE as Z,yE as ee}from"./index-BJtnP7H1.js";var c=Y(J(),1),G=/^STATUS:[ \t]?(.*)$/gm,te=/^<<<SUMMARY-DRAFT>>>[ \t]*$/m,ne=/^<<<END-SUMMARY-DRAFT>>>[ \t]*$/m,re={statusLine:null,statusLines:[],draft:null,draftClosed:!1};function se(e){let s="";for(const o of e){const u=ue(o.chunk);if(!u||u.type!=="acpx.text_delta")continue;const r=typeof u.channel=="string"?u.channel:"output";r==="thought"||r==="thinking"||typeof u.text=="string"&&(s+=u.text)}return s}l(se,"extractAssistantOutputText");function ue(e){const s=e.trim();if(!s.startsWith("{"))return null;try{const o=JSON.parse(s);return typeof o=="object"&&o!==null?o:null}catch{return null}}l(ue,"tryParseRecord");function ae(e){if(!e)return re;const s=[];G.lastIndex=0;let o;for(;(o=G.exec(e))!==null;){const f=(o[1]??"").trim();f&&s.push(f)}const u=s.length>0?s[s.length-1]:null,r=e.match(te);let y=null,R=!1;if(r&&r.index!==void 0){const f=e.slice(r.index+r[0].length).replace(/^\r?\n/,""),h=f.match(ne);h&&h.index!==void 0?(y=f.slice(0,h.index).replace(/\r?\n$/,""),R=!0):(y=f,R=!1)}return{statusLine:u,statusLines:s,draft:y,draftClosed:R}}l(ae,"parseSummaryDraftStream");function ce(e){const s=e.match(/^```/gm);return s&&s.length%2===1?`${e}${e.length>0&&!e.endsWith(`
2
2
  `)?`
3
3
  `:""}\`\`\``:e}l(ce,"closeDanglingCodeFence");var oe=1500,ie=256e3,le=400;function q(){return{seenChunkKeys:new Set,trimmedSeqFloorByRun:new Map}}l(q,"freshMergeRefs");function $(e){return typeof e=="string"&&e.length>0?e:null}l($,"readPayloadString");function pe(e,s){const{visible:o}=ee(),u=s?.id??null,[r,y]=(0,c.useState)(null),[R,f]=(0,c.useState)([]),h=(0,c.useRef)(q()),b=(0,c.useRef)(new Map),L=(0,c.useRef)(0),E=(0,c.useRef)(null),S=(0,c.useRef)(new Set),_=(0,c.useRef)(new I),C=(0,c.useRef)(!1),[N,k]=(0,c.useState)(0),B=l(()=>{C.current||(C.current=!0,k(n=>n+1))},"requestCatchup"),D=l((n,t)=>{if(typeof t!="string"||!t)return"same";const a=`${typeof n=="string"?n:""}:${t}`;if(a===E.current)return"same";if(S.current.has(a))return"stale";const i=E.current;return E.current=a,i?(S.current.add(i),S.current.size>8&&S.current.delete(S.current.values().next().value),L.current=0,b.current.clear(),_.current=new I,h.current=q(),f([]),"changed"):"same"},"bindLog");(0,c.useEffect)(()=>{y(null),f([]),h.current=q(),b.current=new Map,L.current=0},[e,u]);const A=(0,c.useCallback)(n=>{n.length!==0&&f(t=>{const{chunks:a,changed:i}=j("summary-draft",t,n,h.current,le);return i?a:t})},[]);X(n=>{if(!u||n.companyId!==e||n.type!=="heartbeat.run.progress"&&n.type!=="heartbeat.run.queued")return;const t=n.payload??{};if(t.issueId!==u)return;const a=$(t.runId);a&&y(i=>i===a?i:a)});const M=Z({queryKey:V.issues.activeRun(u??"__none__"),queryFn:l(()=>P.activeRunForIssue(u),"queryFn"),enabled:o&&!!e&&!!u&&!r,retry:z(0),refetchInterval:r?!1:4e3}).data?.id??null;(0,c.useEffect)(()=>{M&&y(n=>n??M)},[M]),(0,c.useEffect)(()=>{L.current=0,b.current=new Map,E.current=null,S.current.clear(),_.current=new I,C.current=!1,h.current=q(),f([])},[r,e,u]);const w=W(r?[r]:[],{companyId:e,enabled:o&&!!u},n=>{if(!o||!r)return;if(n.type==="heartbeat.run.status"&&n.payload.runId===r){k(x=>x+1);return}if(n.type!=="heartbeat.run.log")return;const t=n.payload??{};if(t.runId!==r)return;const a=D(t.logStore,t.logRef);if(a==="stale")return;const i=F(t.seq);t.truncated===!0&&_.current.requireHistory(i);const m=_.current.observe(i);if((a==="changed"||t.truncated===!0||m)&&B(),t.truncated===!0)return;const p=$(t.chunk);if(!p)return;const d=$(t.ts)??n.createdAt,T=t.stream==="stderr"?"stderr":t.stream==="system"?"system":"stdout";A([{ts:d,stream:T,chunk:p,seq:F(t.seq),dedupeKey:`log:${r}:${d}:${T}:${p}`}])});(0,c.useEffect)(()=>{if(!o||!r)return;let n=!1;const t=new AbortController;let a;const i=l(async()=>{let m=!1;try{for(;;){const p=L.current,d=await H(v=>P.log(r,p,ie,{signal:v}),t.signal);if(n)return;const T=D(d.store,d.logRef);if(T==="stale"){m=!0;break}if(T==="changed"&&p!==0)continue;const x=Q(r,d.content,b.current);A(x);for(const v of x)_.current.confirm(v.seq);const O=d.nextOffset??p+new TextEncoder().encode(d.content).byteLength;if(L.current=O,d.nextOffset===void 0||!d.content||O<=p)break}m||=_.current.needsCatchup,m||(C.current=!1)}catch{m=!0}!n&&(!w.healthy||m)&&(a=window.setTimeout(()=>{i()},oe))},"read");return i(),()=>{n=!0,t.abort(),a!==void 0&&window.clearTimeout(a)}},[o,e,r,A,w.healthy,w.epoch,N]);const g=(0,c.useMemo)(()=>ae(se(R)),[R]),K=g.draft!==null&&!g.draftClosed?ce(g.draft):g.draft;return{runId:r,statusLine:g.statusLine,draft:K,draftClosed:g.draftClosed,hasStream:g.draft!==null||g.statusLine!==null}}l(pe,"useSummaryDraftStream");export{pe as t};
@@ -1 +1 @@
1
- var o=Object.defineProperty;var s=(e,a)=>o(e,"name",{value:a,configurable:!0});import{GS as l,ay as r,uE as n,xE as t}from"./index-Bt31d8ga.js";var u={list:s(e=>n.get(`/companies/${e}/tailscale-connections`),"list"),connect:s((e,a)=>n.post(`/companies/${e}/tailscale-connections`,{name:"My tailnet",...a?{connectionId:a}:{}}),"connect"),deviceLogin:s((e,a)=>n.post(`/companies/${e}/tailscale-connections/${a}/device-login`,{}),"deviceLogin"),devices:s((e,a)=>n.get(`/companies/${e}/tailscale-connections/${a}/devices`),"devices"),disconnect:s((e,a)=>n.delete(`/companies/${e}/tailscale-connections/${a}`),"disconnect"),pairing:s((e,a,c,i)=>n.post(`/companies/${e}/tailscale-connections/${a}/pairing`,{deviceId:c,port:i}),"pairing")},p=s(e=>["tailscale-connections",e],"tailscaleConnectionsKey");function $(e){const a=t({queryKey:l.access.currentBoardAccess,queryFn:s(()=>r.getCurrentBoardAccess(),"queryFn"),enabled:!!e,staleTime:3e4}),c=a.data?.source==="local_implicit"||a.data?.isInstanceAdmin===!0,i=t({queryKey:p(e),queryFn:s(()=>u.list(e),"queryFn"),enabled:!!e&&c,staleTime:3e4});return{...i,data:c?i.data:void 0,canManage:c,access:a}}s($,"useTailscaleConnections");export{$ as n,u as r,p as t};
1
+ var o=Object.defineProperty;var s=(e,a)=>o(e,"name",{value:a,configurable:!0});import{GS as l,ay as r,uE as n,xE as t}from"./index-BJtnP7H1.js";var u={list:s(e=>n.get(`/companies/${e}/tailscale-connections`),"list"),connect:s((e,a)=>n.post(`/companies/${e}/tailscale-connections`,{name:"My tailnet",...a?{connectionId:a}:{}}),"connect"),deviceLogin:s((e,a)=>n.post(`/companies/${e}/tailscale-connections/${a}/device-login`,{}),"deviceLogin"),devices:s((e,a)=>n.get(`/companies/${e}/tailscale-connections/${a}/devices`),"devices"),disconnect:s((e,a)=>n.delete(`/companies/${e}/tailscale-connections/${a}`),"disconnect"),pairing:s((e,a,c,i)=>n.post(`/companies/${e}/tailscale-connections/${a}/pairing`,{deviceId:c,port:i}),"pairing")},p=s(e=>["tailscale-connections",e],"tailscaleConnectionsKey");function $(e){const a=t({queryKey:l.access.currentBoardAccess,queryFn:s(()=>r.getCurrentBoardAccess(),"queryFn"),enabled:!!e,staleTime:3e4}),c=a.data?.source==="local_implicit"||a.data?.isInstanceAdmin===!0,i=t({queryKey:p(e),queryFn:s(()=>u.list(e),"queryFn"),enabled:!!e&&c,staleTime:3e4});return{...i,data:c?i.data:void 0,canManage:c,access:a}}s($,"useTailscaleConnections");export{$ as n,u as r,p as t};
@@ -1,4 +1,4 @@
1
- var ci=Object.defineProperty;var c=(e,t)=>ci(e,"name",{value:t,configurable:!0});import{n as h}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as hi,p as ui}from"./src-DYjgETqR.js";import{C as di,H as bt,U as _t,_ as Ds,a as fi,b as Fs,f as pi,q as mi,v as Bs,y as Ei,z as Ti}from"./chunk-VPRB5NB3-CfeHjtbb.js";import{_ as gi}from"./chunk-3YJQHVM4-Dj5wEKIw.js";import"./chunk-HJ2JQQFS-MXK0gYSP.js";import{i as Ai}from"./chunk-E2ZNV5FY-cjSf_BTz.js";import"./chunk-4EA7E6EY-5XiUVgzK.js";import{a as Si,i as yi,o as xe,r as Oi}from"./chunk-J5ZVWO5B-ClU583ja.js";import"./chunk-XC4XBNZT-FBCWmi6K.js";import"./chunk-DBDB3WZW-DNqSQPZ0.js";import"./chunk-2BW5OAIV-DFXIyCJy.js";import{t as Ri}from"./chunk-XXDRQBXY-BdWplhUD.js";import{t as Li}from"./chunk-KQW6MTUR-Bfj0tDmO.js";import"./chunk-NTY3LDVX-Bpz5TkVb.js";import{i as Ii,r as Ni}from"./mermaid.core-D1vILTuF.js";function $s(e){const t=new Date().getTime(),s=e();return{time:new Date().getTime()-t,value:s}}c($s,"timer");function js(e){function t(){}c(t,"FakeConstructor"),t.prototype=e;const s=new t;function n(){return typeof s.bar}return c(n,"fakeAccess"),n(),n(),e}c(js,"toFastProperties");function ki(e){return vi(e)?e.LABEL:e.name}c(ki,"tokenLabel$1");function vi(e){return typeof e.LABEL=="string"&&e.LABEL!==""}c(vi,"hasTokenLabel$1");var te=class{static{c(this,"AbstractProduction")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},K=class extends te{static{c(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ie=class extends te{static{c(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}},W=class extends te{static{c(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}},G=class extends te{static{c(this,"Option")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},se=class extends te{static{c(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},ne=class extends te{static{c(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},M=class extends te{static{c(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},q=class extends te{static{c(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},Z=class extends te{static{c(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}},k=class{static{c(this,"Terminal")}constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}};function Ci(e){return e.map(Ye)}c(Ci,"serializeGrammar");function Ye(e){function t(s){return s.map(Ye)}if(c(t,"convertDefinition"),e instanceof K){const s={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return typeof e.label=="string"&&(s.label=e.label),s}else{if(e instanceof W)return{type:"Alternative",definition:t(e.definition)};if(e instanceof G)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof se)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof q)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof M)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Z)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof k){const s={type:"Terminal",name:e.terminalType.name,label:ki(e.terminalType),idx:e.idx};typeof e.label=="string"&&(s.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(s.pattern=n instanceof RegExp?n.source:n),s}else{if(e instanceof Ie)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}c(Ye,"serializeProduction");function ie(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}c(ie,"pickOnlyDefined");var Ne=class{static{c(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case Ie:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function bi(e){return e instanceof W||e instanceof G||e instanceof M||e instanceof se||e instanceof ne||e instanceof q||e instanceof k||e instanceof Ie}c(bi,"isSequenceProd");function rt(e,t=[]){return e instanceof G||e instanceof M||e instanceof q?!0:e instanceof Z?e.definition.some(s=>rt(s,t)):e instanceof K&&t.includes(e)?!1:e instanceof te?(e instanceof K&&t.push(e),e.definition.every(s=>rt(s,t))):!1}c(rt,"isOptionalProd");function _i(e){return e instanceof Z}c(_i,"isBranchingProd");function ee(e){if(e instanceof K)return"SUBRULE";if(e instanceof G)return"OPTION";if(e instanceof Z)return"OR";if(e instanceof se)return"AT_LEAST_ONE";if(e instanceof ne)return"AT_LEAST_ONE_SEP";if(e instanceof q)return"MANY_SEP";if(e instanceof M)return"MANY";if(e instanceof k)return"CONSUME";throw Error("non exhaustive match")}c(ee,"getProductionDslName");var mt=class{static{c(this,"RestWalker")}walk(e,t=[]){e.definition.forEach((s,n)=>{const i=e.definition.slice(n+1);if(s instanceof K)this.walkProdRef(s,i,t);else if(s instanceof k)this.walkTerminal(s,i,t);else if(s instanceof W)this.walkFlat(s,i,t);else if(s instanceof G)this.walkOption(s,i,t);else if(s instanceof se)this.walkAtLeastOne(s,i,t);else if(s instanceof ne)this.walkAtLeastOneSep(s,i,t);else if(s instanceof q)this.walkManySep(s,i,t);else if(s instanceof M)this.walkMany(s,i,t);else if(s instanceof Z)this.walkOr(s,i,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,s){}walkProdRef(e,t,s){}walkFlat(e,t,s){const n=t.concat(s);this.walk(e,n)}walkOption(e,t,s){const n=t.concat(s);this.walk(e,n)}walkAtLeastOne(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkAtLeastOneSep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkMany(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkManySep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkOr(e,t,s){const n=t.concat(s);e.definition.forEach(i=>{const a=new W({definition:[i]});this.walk(a,n)})}};function rs(e,t,s){return[new G({definition:[new k({terminalType:e.separator})].concat(e.definition)})].concat(t,s)}c(rs,"restForRepetitionWithSeparator");function je(e){if(e instanceof K)return je(e.referencedRule);if(e instanceof k)return xi(e);if(bi(e))return wi(e);if(_i(e))return Mi(e);throw Error("non exhaustive match")}c(je,"first");function wi(e){let t=[];const s=e.definition;let n=0,i=s.length>n,a,o=!0;for(;i&&o;)a=s[n],o=rt(a),t=t.concat(je(a)),n=n+1,i=s.length>n;return[...new Set(t)]}c(wi,"firstForSequence");function Mi(e){const t=e.definition.map(s=>je(s));return[...new Set(t.flat())]}c(Mi,"firstForBranching");function xi(e){return[e.terminalType]}c(xi,"firstForTerminal");var Gs="_~IN~_",Ui=class extends mt{static{c(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,s){}walkProdRef(e,t,s){const n=Di(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(s),a=new W({definition:i}),o=je(a);this.follows[n]=o}};function Pi(e){const t={};return e.forEach(s=>{const n=new Ui(s).startWalking();Object.assign(t,n)}),t}c(Pi,"computeAllProdsFollows");function Di(e,t){return e.name+t+Gs}c(Di,"buildBetweenProdsFollowPrefix");function S(e){return e.charCodeAt(0)}c(S,"cc");function It(e,t){Array.isArray(e)?e.forEach(function(s){t.push(s)}):t.push(e)}c(It,"insertToSet");function _e(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}c(_e,"addFlag");function Se(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}c(Se,"ASSERT_EXISTS");function ze(){throw Error("Internal Error - Should never get here!")}c(ze,"ASSERT_NEVER_REACH_HERE");function os(e){return e.type==="Character"}c(os,"isCharacter");var ot=[];for(let e=S("0");e<=S("9");e++)ot.push(e);var lt=[S("_")].concat(ot);for(let e=S("a");e<=S("z");e++)lt.push(e);for(let e=S("A");e<=S("Z");e++)lt.push(e);var ls=[S(" "),S("\f"),S(`
1
+ var ci=Object.defineProperty;var c=(e,t)=>ci(e,"name",{value:t,configurable:!0});import{n as h}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as hi,p as ui}from"./src-DYjgETqR.js";import{C as di,H as bt,U as _t,_ as Ds,a as fi,b as Fs,f as pi,q as mi,v as Bs,y as Ei,z as Ti}from"./chunk-VPRB5NB3-BNz5CtBn.js";import{_ as gi}from"./chunk-3YJQHVM4-C_uoPpLR.js";import"./chunk-HJ2JQQFS-DL4lnpSv.js";import{i as Ai}from"./chunk-E2ZNV5FY-DG8wQ_NS.js";import"./chunk-4EA7E6EY-BeMEfIRS.js";import{a as Si,i as yi,o as xe,r as Oi}from"./chunk-J5ZVWO5B-ClU583ja.js";import"./chunk-XC4XBNZT-CCgIhjYS.js";import"./chunk-DBDB3WZW-B2qouVQO.js";import"./chunk-2BW5OAIV-Ckr4HfBO.js";import{t as Ri}from"./chunk-XXDRQBXY-BdWplhUD.js";import{t as Li}from"./chunk-KQW6MTUR-BsVaJdnu.js";import"./chunk-NTY3LDVX-DyT9N5sM.js";import{i as Ii,r as Ni}from"./mermaid.core-B0t95EIS.js";function $s(e){const t=new Date().getTime(),s=e();return{time:new Date().getTime()-t,value:s}}c($s,"timer");function js(e){function t(){}c(t,"FakeConstructor"),t.prototype=e;const s=new t;function n(){return typeof s.bar}return c(n,"fakeAccess"),n(),n(),e}c(js,"toFastProperties");function ki(e){return vi(e)?e.LABEL:e.name}c(ki,"tokenLabel$1");function vi(e){return typeof e.LABEL=="string"&&e.LABEL!==""}c(vi,"hasTokenLabel$1");var te=class{static{c(this,"AbstractProduction")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},K=class extends te{static{c(this,"NonTerminal")}constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ie=class extends te{static{c(this,"Rule")}constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}},W=class extends te{static{c(this,"Alternative")}constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}},G=class extends te{static{c(this,"Option")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},se=class extends te{static{c(this,"RepetitionMandatory")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},ne=class extends te{static{c(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},M=class extends te{static{c(this,"Repetition")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},q=class extends te{static{c(this,"RepetitionWithSeparator")}constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}},Z=class extends te{static{c(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}},k=class{static{c(this,"Terminal")}constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}};function Ci(e){return e.map(Ye)}c(Ci,"serializeGrammar");function Ye(e){function t(s){return s.map(Ye)}if(c(t,"convertDefinition"),e instanceof K){const s={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return typeof e.label=="string"&&(s.label=e.label),s}else{if(e instanceof W)return{type:"Alternative",definition:t(e.definition)};if(e instanceof G)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof se)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof q)return{type:"RepetitionWithSeparator",idx:e.idx,separator:Ye(new k({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof M)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Z)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof k){const s={type:"Terminal",name:e.terminalType.name,label:ki(e.terminalType),idx:e.idx};typeof e.label=="string"&&(s.terminalLabel=e.label);const n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(s.pattern=n instanceof RegExp?n.source:n),s}else{if(e instanceof Ie)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}c(Ye,"serializeProduction");function ie(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}c(ie,"pickOnlyDefined");var Ne=class{static{c(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case Ie:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function bi(e){return e instanceof W||e instanceof G||e instanceof M||e instanceof se||e instanceof ne||e instanceof q||e instanceof k||e instanceof Ie}c(bi,"isSequenceProd");function rt(e,t=[]){return e instanceof G||e instanceof M||e instanceof q?!0:e instanceof Z?e.definition.some(s=>rt(s,t)):e instanceof K&&t.includes(e)?!1:e instanceof te?(e instanceof K&&t.push(e),e.definition.every(s=>rt(s,t))):!1}c(rt,"isOptionalProd");function _i(e){return e instanceof Z}c(_i,"isBranchingProd");function ee(e){if(e instanceof K)return"SUBRULE";if(e instanceof G)return"OPTION";if(e instanceof Z)return"OR";if(e instanceof se)return"AT_LEAST_ONE";if(e instanceof ne)return"AT_LEAST_ONE_SEP";if(e instanceof q)return"MANY_SEP";if(e instanceof M)return"MANY";if(e instanceof k)return"CONSUME";throw Error("non exhaustive match")}c(ee,"getProductionDslName");var mt=class{static{c(this,"RestWalker")}walk(e,t=[]){e.definition.forEach((s,n)=>{const i=e.definition.slice(n+1);if(s instanceof K)this.walkProdRef(s,i,t);else if(s instanceof k)this.walkTerminal(s,i,t);else if(s instanceof W)this.walkFlat(s,i,t);else if(s instanceof G)this.walkOption(s,i,t);else if(s instanceof se)this.walkAtLeastOne(s,i,t);else if(s instanceof ne)this.walkAtLeastOneSep(s,i,t);else if(s instanceof q)this.walkManySep(s,i,t);else if(s instanceof M)this.walkMany(s,i,t);else if(s instanceof Z)this.walkOr(s,i,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,s){}walkProdRef(e,t,s){}walkFlat(e,t,s){const n=t.concat(s);this.walk(e,n)}walkOption(e,t,s){const n=t.concat(s);this.walk(e,n)}walkAtLeastOne(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkAtLeastOneSep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkMany(e,t,s){const n=[new G({definition:e.definition})].concat(t,s);this.walk(e,n)}walkManySep(e,t,s){const n=rs(e,t,s);this.walk(e,n)}walkOr(e,t,s){const n=t.concat(s);e.definition.forEach(i=>{const a=new W({definition:[i]});this.walk(a,n)})}};function rs(e,t,s){return[new G({definition:[new k({terminalType:e.separator})].concat(e.definition)})].concat(t,s)}c(rs,"restForRepetitionWithSeparator");function je(e){if(e instanceof K)return je(e.referencedRule);if(e instanceof k)return xi(e);if(bi(e))return wi(e);if(_i(e))return Mi(e);throw Error("non exhaustive match")}c(je,"first");function wi(e){let t=[];const s=e.definition;let n=0,i=s.length>n,a,o=!0;for(;i&&o;)a=s[n],o=rt(a),t=t.concat(je(a)),n=n+1,i=s.length>n;return[...new Set(t)]}c(wi,"firstForSequence");function Mi(e){const t=e.definition.map(s=>je(s));return[...new Set(t.flat())]}c(Mi,"firstForBranching");function xi(e){return[e.terminalType]}c(xi,"firstForTerminal");var Gs="_~IN~_",Ui=class extends mt{static{c(this,"ResyncFollowsWalker")}constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,s){}walkProdRef(e,t,s){const n=Di(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(s),a=new W({definition:i}),o=je(a);this.follows[n]=o}};function Pi(e){const t={};return e.forEach(s=>{const n=new Ui(s).startWalking();Object.assign(t,n)}),t}c(Pi,"computeAllProdsFollows");function Di(e,t){return e.name+t+Gs}c(Di,"buildBetweenProdsFollowPrefix");function S(e){return e.charCodeAt(0)}c(S,"cc");function It(e,t){Array.isArray(e)?e.forEach(function(s){t.push(s)}):t.push(e)}c(It,"insertToSet");function _e(e,t){if(e[t]===!0)throw"duplicate flag "+t;e[t],e[t]=!0}c(_e,"addFlag");function Se(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}c(Se,"ASSERT_EXISTS");function ze(){throw Error("Internal Error - Should never get here!")}c(ze,"ASSERT_NEVER_REACH_HERE");function os(e){return e.type==="Character"}c(os,"isCharacter");var ot=[];for(let e=S("0");e<=S("9");e++)ot.push(e);var lt=[S("_")].concat(ot);for(let e=S("a");e<=S("z");e++)lt.push(e);for(let e=S("A");e<=S("Z");e++)lt.push(e);var ls=[S(" "),S("\f"),S(`
2
2
  `),S("\r"),S(" "),S("\v"),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S("\u2028"),S("\u2029"),S(" "),S(" "),S(" "),S("\uFEFF")],Fi=/[0-9a-fA-F]/,He=/[0-9]/,Bi=/[1-9]/,$i=class{static{c(this,"RegExpParser")}constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const s={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":_e(s,"global");break;case"i":_e(s,"ignoreCase");break;case"m":_e(s,"multiLine");break;case"u":_e(s,"unicode");break;case"y":_e(s,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:s,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}}Se(t);const s=this.disjunction();return this.consumeChar(")"),{type:t,value:s,loc:this.loc(e)}}return ze()}quantifier(e=!1){let t;const s=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),t={atLeast:n,atMost:i}):t={atLeast:n,atMost:1/0},this.consumeChar("}")}if(e===!0&&t===void 0)return;Se(t)}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(s),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):ze()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[S(`
3
3
  `),S("\r"),S("\u2028"),S("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=ot;break;case"D":e=ot,t=!0;break;case"s":e=ls;break;case"S":e=ls,t=!0;break;case"w":e=lt;break;case"W":e=lt,t=!0}return Se(e)?{type:"Set",value:e,complement:t}:ze()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=S("\f");break;case"n":e=S(`
4
4
  `);break;case"r":e=S("\r");break;case"t":e=S(" ");break;case"v":e=S("\v")}return Se(e)?{type:"Character",value:e}:ze()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:S("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:S(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -1,4 +1,4 @@
1
- var Ht=Object.defineProperty;var v=(t,n)=>Ht(t,"name",{value:n,configurable:!0});import{n as _}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{p as at}from"./src-DYjgETqR.js";import{C as Yt,H as Xt,U as Zt,_ as Jt,a as Qt,c as $t,f as te,it as ee,nt as ne,q as se,rt as ie,tt as re,v as oe,y as Tt}from"./chunk-VPRB5NB3-CfeHjtbb.js";import{i as ae}from"./chunk-3YJQHVM4-Dj5wEKIw.js";import{t as le}from"./rough.esm-DnC5Tr1g.js";import{a as ce}from"./mermaid.core-D1vILTuF.js";var St=v((t,n)=>ie(t,"a",-n),"transparentize"),Et=1e-10;function it(t,n){const s=fe(t),e=s.filter(c=>ue(c,t));let i=0,r=0;const a=[];if(e.length>1){const c=At(e);for(let l=0;l<e.length;++l){const u=e[l];u.angle=Math.atan2(u.x-c.x,u.y-c.y)}e.sort((l,u)=>u.angle-l.angle);let f=e[e.length-1];for(let l=0;l<e.length;++l){const u=e[l];r+=(f.x+u.x)*(u.y-f.y);const d={x:(u.x+f.x)/2,y:(u.y+f.y)/2};let h=null;for(let b=0;b<u.parentIndex.length;++b)if(f.parentIndex.includes(u.parentIndex[b])){const y=t[u.parentIndex[b]],w=Math.atan2(u.x-y.x,u.y-y.y),E=Math.atan2(f.x-y.x,f.y-y.y);let m=E-w;m<0&&(m+=2*Math.PI);const g=E-m/2;let k=G(d,{x:y.x+y.radius*Math.sin(g),y:y.y+y.radius*Math.cos(g)});k>y.radius*2&&(k=y.radius*2),(h==null||h.width>k)&&(h={circle:y,width:k,p1:u,p2:f,large:k>y.radius,sweep:!0})}h!=null&&(a.push(h),i+=ut(h.circle.radius,h.width),f=u)}}else{let c=t[0];for(let l=1;l<t.length;++l)t[l].radius<c.radius&&(c=t[l]);let f=!1;for(let l=0;l<t.length;++l)if(G(t[l],c)>Math.abs(c.radius-t[l].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-Et,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+r}v(it,"intersectionArea");function ue(t,n){return n.every(s=>G(t,s)<s.radius+Et)}v(ue,"containedInCircles");function fe(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=zt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}v(fe,"getIntersectionPoints");function ut(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}v(ut,"circleArea");function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}v(G,"distance");function pt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ut(t,e)+ut(n,i)}v(pt,"circleOverlap");function zt(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,l=-(n.y-t.y)*(a/s),u=-(n.x-t.x)*(a/s);return[{x:c+l,y:f-u},{x:c-l,y:f+u}]}v(zt,"circleCircleIntersection");function At(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}v(At,"getCenter");function he(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,a=t(n),c=t(s);let f=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let l=0;l<i;++l){f/=2;const u=n+f,d=t(u);if(d*a>=0&&(n=u),Math.abs(f)<r||d===0)return u}return n+f}v(he,"bisect");function ft(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}v(ft,"zeros");function wt(t,n){return ft(t).map(()=>ft(n))}v(wt,"zerosM");function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}v(tt,"dot");function ht(t){return Math.sqrt(tt(t,t))}v(ht,"norm2");function dt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}v(dt,"scale");function Z(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}v(Z,"weightedSum");function Ct(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,l=s.chi!==void 0?s.chi:2,u=s.psi!==void 0?s.psi:-.5,d=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,y=new Array(b+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let p=0;p<b;++p){const x=n.slice();x[p]=x[p]?x[p]*i:r,y[p+1]=x,y[p+1].fx=t(x),y[p+1].id=p+1}function w(p){for(let x=0;x<p.length;x++)y[b][x]=p[x];y[b].fx=p.fx}v(w,"updateSimplex");const E=v((p,x)=>p.fx-x.fx,"sortOrder"),m=n.slice(),g=n.slice(),k=n.slice(),I=n.slice();for(let p=0;p<e;++p){if(y.sort(E),s.history){const o=y.map(T=>{const M=T.slice();return M.fx=T.fx,M.id=T.id,M});o.sort((T,M)=>T.id-M.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:o})}h=0;for(let o=0;o<b;++o)h=Math.max(h,Math.abs(y[0][o]-y[1][o]));if(Math.abs(y[0].fx-y[b].fx)<a&&h<c)break;for(let o=0;o<b;++o){m[o]=0;for(let T=0;T<b;++T)m[o]+=y[T][o];m[o]/=b}const x=y[b];if(Z(g,1+f,m,-f,x),g.fx=t(g),g.fx<y[0].fx)Z(I,1+l,m,-l,x),I.fx=t(I),I.fx<g.fx?w(I):w(g);else if(g.fx>=y[b-1].fx){let o=!1;if(g.fx>x.fx?(Z(k,1+u,m,-u,x),k.fx=t(k),k.fx<x.fx?w(k):o=!0):(Z(k,1-u*f,m,u*f,x),k.fx=t(k),k.fx<g.fx?w(k):o=!0),o){if(d>=1)break;for(let T=1;T<y.length;++T)Z(y[T],1-d,y[0],d,y[T]),y[T].fx=t(y[T])}}else w(g)}return y.sort(E),{fx:y[0].fx,x:y[0]}}v(Ct,"nelderMead");function de(t,n,s,e,i,r,a){const c=s.fx,f=tt(s.fxprime,n);let l=c,u=c,d=f,h=0;i=i||1,r=r||1e-6,a=a||.1;function b(y,w,E){for(let m=0;m<16;++m)if(i=(y+w)/2,Z(e.x,1,s.x,i,n),l=e.fx=t(e.x,e.fxprime),d=tt(e.fxprime,n),l>c+r*i*f||l>=E)w=i;else{if(Math.abs(d)<=-a*f)return i;d*(w-y)>=0&&(w=y),y=i,E=l}return 0}v(b,"zoom");for(let y=0;y<10;++y){if(Z(e.x,1,s.x,i,n),l=e.fx=t(e.x,e.fxprime),d=tt(e.fxprime,n),l>c+r*i*f||y&&l>=u)return b(h,i,u);if(Math.abs(d)<=-a*f)return i;if(d>=0)return b(i,h,l);u=l,h=i,i*=2}return i}v(de,"wolfeLineSearch");function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let a,c,f=1,l;s=s||{},l=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),dt(a,e.fxprime,-1);for(let u=0;u<l;++u){if(f=de(t,a,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)dt(a,e.fxprime,-1);else{Z(r,1,i.fxprime,-1,e.fxprime);const d=tt(e.fxprime,e.fxprime),h=Math.max(0,tt(r,i.fxprime)/d);Z(a,h,a,-1,i.fxprime),c=e,e=i,i=c}if(ht(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}v(ge,"conjugateGradient");function Dt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||me,e=n.lossFunction||et,i=ye(t,n),r=s(i,n),a=Object.keys(r),c=[];for(const l of a)c.push(r[l].x),c.push(r[l].y);const f=Ct(l=>{const u={};for(let d=0;d<a.length;++d){const h=a[d];u[h]={x:l[2*d],y:l[2*d+1],radius:r[h].radius}}return e(u,i)},c,n).x;for(let l=0;l<a.length;++l){const u=a[l];r[u].x=f[2*l],r[u].y=f[2*l+1]}return r}v(Dt,"venn");var Rt=1e-10;function gt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):he(e=>pt(t,n,e)-s,0,t+n)}v(gt,"distanceFromIntersectArea");function ye(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(v(i,"toKey"),s){const c=new Map;for(const f of e)for(let l=0;l<f.sets.length;l++){const u=String(f.sets[l]);c.set(u,f.size+(c.get(u)||0));for(let d=l+1;d<f.sets.length;d++){const h=String(f.sets[d]),b=`${u};${h}`,y=`${h};${u}`;c.set(b,f.size+(c.get(b)||0)),c.set(y,f.size+(c.get(y)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],a=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],l=c.sets[1];a.add(i(c.sets)),a.add(i([l,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let l=c+1;l<r.length;++l){const u=r[l];a.has(i([f,u]))||e.push({sets:[f,u],size:0})}}return e}v(ye,"addMissingAreas");function xe(t,n,s){const e=wt(n.length,n.length),i=wt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const a=s[r.sets[0]],c=s[r.sets[1]],f=gt(Math.sqrt(n[a].size/Math.PI),Math.sqrt(n[c].size/Math.PI),r.size);e[a][c]=e[c][a]=f;let l=0;r.size+1e-10>=Math.min(n[a].size,n[c].size)?l=1:r.size<=1e-10&&(l=-1),i[a][c]=i[c][a]=l}),{distances:e,constraints:i}}v(xe,"getDistanceMatrices");function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const a=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const l=t[2*f],u=t[2*f+1],d=s[r][f],h=e[r][f],b=(l-a)*(l-a)+(u-c)*(u-c),y=Math.sqrt(b),w=b-d*d;h>0&&y<=d||h<0&&y>=d||(i+=2*w*w,n[2*r]+=4*w*(a-l),n[2*r+1]+=4*w*(c-u),n[2*f]+=4*w*(l-a),n[2*f+1]+=4*w*(u-c))}}return i}v(pe,"constrainedMDSGradient");function me(t,n={}){let s=ve(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=be(t,n),r=e(i,t),a=e(s,t);r+1e-8<a&&(s=i)}return s}v(me,"bestInitialLayout");function be(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:r,constraints:a}=xe(t,e,i);const c=ht(r.map(ht))/r.length;r=r.map(h=>h.map(b=>b/c));const f=v((h,b)=>pe(h,b,r,a),"obj");let l=null;for(let h=0;h<s;++h){const b=ge(f,ft(r.length*2).map(Math.random),n);(!l||b.fx<l.fx)&&(l=b)}const u=l.x,d={};for(let h=0;h<e.length;++h){const b=e[h];d[b.sets[0]]={x:u[2*h]*c,y:u[2*h+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)dt(h.x,c);return d}v(be,"constrainedMDSLayout");function ve(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const d of t)if(d.sets.length===1){const h=d.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:d.size,radius:Math.sqrt(d.size/Math.PI)},i[h]=[]}t=t.filter(d=>d.sets.length===2);for(const d of t){let h=d.weight!=null?d.weight:1;const b=d.sets[0],y=d.sets[1];d.size+Rt>=Math.min(e[b].size,e[y].size)&&(h=0),i[b].push({set:y,size:d.size,weight:h}),i[y].push({set:b,size:d.size,weight:h})}const r=[];Object.keys(i).forEach(d=>{let h=0;for(let b=0;b<i[d].length;++b)h+=i[d][b].size*i[d][b].weight;r.push({set:d,size:h})});function a(d,h){return h.size-d.size}v(a,"sortOrder"),r.sort(a);const c={};function f(d){return d.set in c}v(f,"isPositioned");function l(d,h){e[h].x=d.x,e[h].y=d.y,c[h]=!0}v(l,"positionSet"),l({x:0,y:0},r[0].set);for(let d=1;d<r.length;++d){const h=r[d].set,b=i[h].filter(f),y=e[h];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const w=[];for(var u=0;u<b.length;++u){const g=e[b[u].set],k=gt(y.radius,g.radius,b[u].size);w.push({x:g.x+k,y:g.y}),w.push({x:g.x-k,y:g.y}),w.push({y:g.y+k,x:g.x}),w.push({y:g.y-k,x:g.x});for(let I=u+1;I<b.length;++I){const p=e[b[I].set],x=gt(y.radius,p.radius,b[I].size),o=zt({x:g.x,y:g.y,radius:k},{x:p.x,y:p.y,radius:x});w.push(...o)}}let E=1e50,m=w[0];for(const g of w){e[h].x=g.x,e[h].y=g.y;const k=s(e,t);k<E&&(E=k,m=g)}l(m,h)}return e}v(ve,"greedyLayout");function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=pt(a.radius,c.radius,G(a,c))}else i=it(e.sets.map(a=>t[a]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}v(et,"lossFunction");function Nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=pt(c.radius,f.radius,G(c,f))}else i=it(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=r*a*a}return s}v(Nt,"logRatioLossFunction");function ke(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const a of t)a.x-=i,a.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),a=Math.sin(i);for(const c of t){const f=c.x,l=c.y;c.x=r*f-a*l,c.y=a*f+r*l}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+r*a.y)/(1+r*r);a.x=2*e-a.x,a.y=2*e*r-a.y}}}}v(ke,"orientateCircles");function Ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}v(n,"find");function s(i,r){const a=n(i);a.parent=n(r)}v(s,"union");for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const a=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<a&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}v(Ie,"disjointCluster");function yt(t){const n=v(s=>({max:t.reduce((e,i)=>Math.max(e,i[s]+i.radius),Number.NEGATIVE_INFINITY),min:t.reduce((e,i)=>Math.min(e,i[s]-i.radius),Number.POSITIVE_INFINITY)}),"minMax");return{xRange:n("x"),yRange:n("y")}}v(yt,"getBoundingBox");function Ot(t,n,s){n==null&&(n=Math.PI/2);let e=Pt(t).map(l=>Object.assign({},l));const i=Ie(e);for(const l of i){ke(l,n,s);const u=yt(l);l.size=(u.xRange.max-u.xRange.min)*(u.yRange.max-u.yRange.min),l.bounds=u}i.sort((l,u)=>u.size-l.size),e=i[0];let r=e.bounds;const a=(r.xRange.max-r.xRange.min)/50;function c(l,u,d){if(!l)return;const h=l.bounds;let b,y;if(u)b=r.xRange.max-h.xRange.min+a;else{b=r.xRange.max-h.xRange.max;const w=(h.xRange.max-h.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;w<0&&(b+=w)}if(d)y=r.yRange.max-h.yRange.min+a;else{y=r.yRange.max-h.yRange.max;const w=(h.yRange.max-h.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;w<0&&(y+=w)}for(const w of l)w.x+=b,w.y+=y,e.push(w)}v(c,"addCluster");let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=yt(e);return Ft(e)}v(Ot,"normalizeSolution");function jt(t,n,s,e,i){const r=Pt(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=yt(r);if(a.max===a.min||c.max===c.min)return t;let f,l;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,l=s/b}else f=n/(a.max-a.min),l=s/(c.max-c.min);const u=Math.min(l,f),d=(n-(a.max-a.min)*u)/2,h=(s-(c.max-c.min)*u)/2;return Ft(r.map(b=>({radius:u*b.radius,x:e+d+(b.x-a.min)*u,y:e+h+(b.y-c.min)*u,setid:b.setid})))}v(jt,"scaleSolution");function Ft(t){const n={};for(const s of t)n[s.setid]=s;return n}v(Ft,"toObjectNotation");function Pt(t){return Object.keys(t).map(n=>Object.assign(t[n],{setid:n}))}v(Pt,"fromObjectNotation");function Me(t={}){let n=!1,s=600,e=350,i=15,r=1e3,a=Math.PI/2,c=!0,f=null,l=!0,u=!0,d=null,h=null,b=!1,y=null,w=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},m=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],g=0,k=v(function(o){if(o in E)return E[o];var T=E[o]=m[g];return g+=1,g>=m.length&&(g=0),T},"colours"),I=Dt,p=et;function x(o){let T=o.datum();const M=new Set;T.forEach(S=>{S.size==0&&S.sets.length==1&&M.add(S.sets[0])}),T=T.filter(S=>!S.sets.some(O=>M.has(O)));let A={},j={};if(T.length>0){let S=I(T,{lossFunction:p,distinct:b});c&&(S=Ot(S,a,h)),A=jt(S,s,e,i,f),j=Vt(A,T,w)}const K={};T.forEach(S=>{S.label&&(K[S.sets]=S.label)});function U(S){if(S.sets in K)return K[S.sets];if(S.sets.length==1)return""+S.sets[0]}v(U,"label"),o.selectAll("svg").data([A]).enter().append("svg");const C=o.select("svg");n?C.attr("viewBox",`0 0 ${s} ${e}`):C.attr("width",s).attr("height",e);const R={};let z=!1;C.selectAll(".venn-area path").each(function(S){const O=this.getAttribute("d");S.sets.length==1&&O&&!b&&(z=!0,R[S.sets[0]]=_e(O))});function F(S){return O=>_t(S.sets.map($=>{let q=R[$],J=A[$];return q||(q={x:s/2,y:e/2,radius:1}),J||(J={x:s/2,y:e/2,radius:1}),{x:q.x*(1-O)+J.x*O,y:q.y*(1-O)+J.y*O,radius:q.radius*(1-O)+J.radius*O}}),y)}v(F,"pathTween");const N=C.selectAll(".venn-area").data(T,S=>S.sets),L=N.enter().append("g").attr("class",S=>`venn-area venn-${S.sets.length==1?"circle":"intersection"}${S.colour||S.color?" venn-coloured":""}`).attr("data-venn-sets",S=>S.sets.join("_")),V=L.append("path"),X=L.append("text").attr("class","label").text(S=>U(S)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);u&&(V.style("fill-opacity","0").filter(S=>S.sets.length==1).style("fill",S=>S.colour?S.colour:S.color?S.color:k(S.sets)).style("fill-opacity",".25"),X.style("fill",S=>S.colour||S.color?"#FFF":t.textFill?t.textFill:S.sets.length==1?k(S.sets):"#444"));function H(S){return typeof S.transition=="function"?S.transition("venn").duration(r):S}v(H,"asTransition");let D=o;z&&typeof D.transition=="function"?(D=H(o),D.selectAll("path").attrTween("d",F)):D.selectAll("path").attr("d",S=>_t(S.sets.map(O=>A[O])),y);const Y=D.selectAll("text").filter(S=>S.sets in j).text(S=>U(S)).attr("x",S=>Math.floor(j[S.sets].x)).attr("y",S=>Math.floor(j[S.sets].y));l&&(z?"on"in Y?Y.on("end",lt(A,U)):Y.each("end",lt(A,U)):Y.each(lt(A,U)));const B=H(N.exit()).remove();typeof N.transition=="function"&&B.selectAll("path").attrTween("d",F);const P=B.selectAll("text").attr("x",s/2).attr("y",e/2);return d!==null&&(X.style("font-size","0px"),Y.style("font-size",d),P.style("font-size","0px")),{circles:A,textCentres:j,nodes:N,enter:L,update:D,exit:B}}return v(x,"chart"),x.wrap=function(o){return arguments.length?(l=o,x):l},x.useViewBox=function(){return n=!0,x},x.width=function(o){return arguments.length?(s=o,x):s},x.height=function(o){return arguments.length?(e=o,x):e},x.padding=function(o){return arguments.length?(i=o,x):i},x.distinct=function(o){return arguments.length?(b=o,x):b},x.colours=function(o){return arguments.length?(k=o,x):k},x.colors=function(o){return arguments.length?(k=o,x):k},x.fontSize=function(o){return arguments.length?(d=o,x):d},x.round=function(o){return arguments.length?(y=o,x):y},x.duration=function(o){return arguments.length?(r=o,x):r},x.layoutFunction=function(o){return arguments.length?(I=o,x):I},x.normalize=function(o){return arguments.length?(c=o,x):c},x.scaleToFit=function(o){return arguments.length?(f=o,x):f},x.styled=function(o){return arguments.length?(u=o,x):u},x.orientation=function(o){return arguments.length?(a=o,x):a},x.orientationOrder=function(o){return arguments.length?(h=o,x):h},x.lossFunction=function(o){return arguments.length?(p=o==="default"?et:o==="logRatio"?Nt:o,x):p},x}v(Me,"VennDiagram");function lt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",a=r.split(/\s+/).reverse(),c=(r.length+a.length)/3;let f=a.pop(),l=[f],u=0;const d=1.1;e.textContent=null;const h=[];function b(g){const k=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return k.textContent=g,h.push(k),e.append(k),k}v(b,"append");let y=b(f);for(;f=a.pop(),!!f;){l.push(f);const g=l.join(" ");y.textContent=g,g.length>c&&y.getComputedTextLength()>i&&(l.pop(),y.textContent=l.join(" "),l=[f],y=b(f),u++)}const w=.35-u*d/2,E=e.getAttribute("x"),m=e.getAttribute("y");h.forEach((g,k)=>{g.setAttribute("x",E),g.setAttribute("y",m),g.setAttribute("dy",`${w+k*d}em`)})}}v(lt,"wrapText");function ct(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}v(ct,"circleMargin");function Lt(t,n,s){const e=[];for(const u of t)e.push({x:u.x,y:u.y}),e.push({x:u.x+u.radius/2,y:u.y}),e.push({x:u.x-u.radius/2,y:u.y}),e.push({x:u.x,y:u.y+u.radius/2}),e.push({x:u.x,y:u.y-u.radius/2});let i=e[0],r=ct(e[0],t,n);for(let u=1;u<e.length;++u){const d=ct(e[u],t,n);d>=r&&(i=e[u],r=d)}const a=Ct(u=>-1*ct({x:u[0],y:u[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let f=!0;for(const u of t)if(G(c,u)>u.radius){f=!1;break}for(const u of n)if(G(c,u)<u.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const l={};return it(t,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}:n.length?Lt(t,[]):At(l.arcs.map(u=>u.p1))}v(Lt,"computeTextCentre");function Se(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],f=t[c],l=G(r,f);l+f.radius<=r.radius+1e-10?n[c].push(i):l+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}v(Se,"getOverlappingCircles");function Vt(t,n,s){const e={},i=Se(t);for(let r=0;r<n.length;++r){const a=n[r].sets,c={},f={};for(let h=0;h<a.length;++h){c[a[h]]=!0;const b=i[a[h]];for(let y=0;y<b.length;++y)f[b[y]]=!0}const l=[],u=[];for(let h in t)h in c?l.push(t[h]):h in f||u.push(t[h]);const d=Lt(l,u,s);e[a]=d,d.disjoint&&n[r].size>0}return e}v(Vt,"computeTextCentres");function we(t,n,s){const e=[];return e.push(`
1
+ var Ht=Object.defineProperty;var v=(t,n)=>Ht(t,"name",{value:n,configurable:!0});import{n as _}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{p as at}from"./src-DYjgETqR.js";import{C as Yt,H as Xt,U as Zt,_ as Jt,a as Qt,c as $t,f as te,it as ee,nt as ne,q as se,rt as ie,tt as re,v as oe,y as Tt}from"./chunk-VPRB5NB3-BNz5CtBn.js";import{i as ae}from"./chunk-3YJQHVM4-C_uoPpLR.js";import{t as le}from"./rough.esm-DnC5Tr1g.js";import{a as ce}from"./mermaid.core-B0t95EIS.js";var St=v((t,n)=>ie(t,"a",-n),"transparentize"),Et=1e-10;function it(t,n){const s=fe(t),e=s.filter(c=>ue(c,t));let i=0,r=0;const a=[];if(e.length>1){const c=At(e);for(let l=0;l<e.length;++l){const u=e[l];u.angle=Math.atan2(u.x-c.x,u.y-c.y)}e.sort((l,u)=>u.angle-l.angle);let f=e[e.length-1];for(let l=0;l<e.length;++l){const u=e[l];r+=(f.x+u.x)*(u.y-f.y);const d={x:(u.x+f.x)/2,y:(u.y+f.y)/2};let h=null;for(let b=0;b<u.parentIndex.length;++b)if(f.parentIndex.includes(u.parentIndex[b])){const y=t[u.parentIndex[b]],w=Math.atan2(u.x-y.x,u.y-y.y),E=Math.atan2(f.x-y.x,f.y-y.y);let m=E-w;m<0&&(m+=2*Math.PI);const g=E-m/2;let k=G(d,{x:y.x+y.radius*Math.sin(g),y:y.y+y.radius*Math.cos(g)});k>y.radius*2&&(k=y.radius*2),(h==null||h.width>k)&&(h={circle:y,width:k,p1:u,p2:f,large:k>y.radius,sweep:!0})}h!=null&&(a.push(h),i+=ut(h.circle.radius,h.width),f=u)}}else{let c=t[0];for(let l=1;l<t.length;++l)t[l].radius<c.radius&&(c=t[l]);let f=!1;for(let l=0;l<t.length;++l)if(G(t[l],c)>Math.abs(c.radius-t[l].radius)){f=!0;break}f?i=r=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-Et,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return r/=2,n&&(n.area=i+r,n.arcArea=i,n.polygonArea=r,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+r}v(it,"intersectionArea");function ue(t,n){return n.every(s=>G(t,s)<s.radius+Et)}v(ue,"containedInCircles");function fe(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=zt(t[s],t[e]);for(const r of i)r.parentIndex=[s,e],n.push(r)}return n}v(fe,"getIntersectionPoints");function ut(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}v(ut,"circleArea");function G(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}v(G,"distance");function pt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return ut(t,e)+ut(n,i)}v(pt,"circleOverlap");function zt(t,n){const s=G(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const r=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-r*r),c=t.x+r*(n.x-t.x)/s,f=t.y+r*(n.y-t.y)/s,l=-(n.y-t.y)*(a/s),u=-(n.x-t.x)*(a/s);return[{x:c+l,y:f-u},{x:c-l,y:f+u}]}v(zt,"circleCircleIntersection");function At(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}v(At,"getCenter");function he(t,n,s,e){e=e||{};const i=e.maxIterations||100,r=e.tolerance||1e-10,a=t(n),c=t(s);let f=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let l=0;l<i;++l){f/=2;const u=n+f,d=t(u);if(d*a>=0&&(n=u),Math.abs(f)<r||d===0)return u}return n+f}v(he,"bisect");function ft(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}v(ft,"zeros");function wt(t,n){return ft(t).map(()=>ft(n))}v(wt,"zerosM");function tt(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}v(tt,"dot");function ht(t){return Math.sqrt(tt(t,t))}v(ht,"norm2");function dt(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}v(dt,"scale");function Z(t,n,s,e,i){for(let r=0;r<t.length;++r)t[r]=n*s[r]+e*i[r]}v(Z,"weightedSum");function Ct(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,r=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,l=s.chi!==void 0?s.chi:2,u=s.psi!==void 0?s.psi:-.5,d=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,y=new Array(b+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let p=0;p<b;++p){const x=n.slice();x[p]=x[p]?x[p]*i:r,y[p+1]=x,y[p+1].fx=t(x),y[p+1].id=p+1}function w(p){for(let x=0;x<p.length;x++)y[b][x]=p[x];y[b].fx=p.fx}v(w,"updateSimplex");const E=v((p,x)=>p.fx-x.fx,"sortOrder"),m=n.slice(),g=n.slice(),k=n.slice(),I=n.slice();for(let p=0;p<e;++p){if(y.sort(E),s.history){const o=y.map(T=>{const M=T.slice();return M.fx=T.fx,M.id=T.id,M});o.sort((T,M)=>T.id-M.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:o})}h=0;for(let o=0;o<b;++o)h=Math.max(h,Math.abs(y[0][o]-y[1][o]));if(Math.abs(y[0].fx-y[b].fx)<a&&h<c)break;for(let o=0;o<b;++o){m[o]=0;for(let T=0;T<b;++T)m[o]+=y[T][o];m[o]/=b}const x=y[b];if(Z(g,1+f,m,-f,x),g.fx=t(g),g.fx<y[0].fx)Z(I,1+l,m,-l,x),I.fx=t(I),I.fx<g.fx?w(I):w(g);else if(g.fx>=y[b-1].fx){let o=!1;if(g.fx>x.fx?(Z(k,1+u,m,-u,x),k.fx=t(k),k.fx<x.fx?w(k):o=!0):(Z(k,1-u*f,m,u*f,x),k.fx=t(k),k.fx<g.fx?w(k):o=!0),o){if(d>=1)break;for(let T=1;T<y.length;++T)Z(y[T],1-d,y[0],d,y[T]),y[T].fx=t(y[T])}}else w(g)}return y.sort(E),{fx:y[0].fx,x:y[0]}}v(Ct,"nelderMead");function de(t,n,s,e,i,r,a){const c=s.fx,f=tt(s.fxprime,n);let l=c,u=c,d=f,h=0;i=i||1,r=r||1e-6,a=a||.1;function b(y,w,E){for(let m=0;m<16;++m)if(i=(y+w)/2,Z(e.x,1,s.x,i,n),l=e.fx=t(e.x,e.fxprime),d=tt(e.fxprime,n),l>c+r*i*f||l>=E)w=i;else{if(Math.abs(d)<=-a*f)return i;d*(w-y)>=0&&(w=y),y=i,E=l}return 0}v(b,"zoom");for(let y=0;y<10;++y){if(Z(e.x,1,s.x,i,n),l=e.fx=t(e.x,e.fxprime),d=tt(e.fxprime,n),l>c+r*i*f||y&&l>=u)return b(h,i,u);if(Math.abs(d)<=-a*f)return i;if(d>=0)return b(i,h,l);u=l,h=i,i*=2}return i}v(de,"wolfeLineSearch");function ge(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const r=n.slice();let a,c,f=1,l;s=s||{},l=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),dt(a,e.fxprime,-1);for(let u=0;u<l;++u){if(f=de(t,a,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)dt(a,e.fxprime,-1);else{Z(r,1,i.fxprime,-1,e.fxprime);const d=tt(e.fxprime,e.fxprime),h=Math.max(0,tt(r,i.fxprime)/d);Z(a,h,a,-1,i.fxprime),c=e,e=i,i=c}if(ht(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}v(ge,"conjugateGradient");function Dt(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||me,e=n.lossFunction||et,i=ye(t,n),r=s(i,n),a=Object.keys(r),c=[];for(const l of a)c.push(r[l].x),c.push(r[l].y);const f=Ct(l=>{const u={};for(let d=0;d<a.length;++d){const h=a[d];u[h]={x:l[2*d],y:l[2*d+1],radius:r[h].radius}}return e(u,i)},c,n).x;for(let l=0;l<a.length;++l){const u=a[l];r[u].x=f[2*l],r[u].y=f[2*l+1]}return r}v(Dt,"venn");var Rt=1e-10;function gt(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):he(e=>pt(t,n,e)-s,0,t+n)}v(gt,"distanceFromIntersectArea");function ye(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(v(i,"toKey"),s){const c=new Map;for(const f of e)for(let l=0;l<f.sets.length;l++){const u=String(f.sets[l]);c.set(u,f.size+(c.get(u)||0));for(let d=l+1;d<f.sets.length;d++){const h=String(f.sets[d]),b=`${u};${h}`,y=`${h};${u}`;c.set(b,f.size+(c.get(b)||0)),c.set(y,f.size+(c.get(y)||0))}}for(const f of e)f.sets.length<3&&(f.size=c.get(i(f.sets)))}const r=[],a=new Set;for(const c of e)if(c.sets.length===1)r.push(c.sets[0]);else if(c.sets.length===2){const f=c.sets[0],l=c.sets[1];a.add(i(c.sets)),a.add(i([l,f]))}r.sort((c,f)=>c===f?0:c<f?-1:1);for(let c=0;c<r.length;++c){const f=r[c];for(let l=c+1;l<r.length;++l){const u=r[l];a.has(i([f,u]))||e.push({sets:[f,u],size:0})}}return e}v(ye,"addMissingAreas");function xe(t,n,s){const e=wt(n.length,n.length),i=wt(n.length,n.length);return t.filter(r=>r.sets.length===2).forEach(r=>{const a=s[r.sets[0]],c=s[r.sets[1]],f=gt(Math.sqrt(n[a].size/Math.PI),Math.sqrt(n[c].size/Math.PI),r.size);e[a][c]=e[c][a]=f;let l=0;r.size+1e-10>=Math.min(n[a].size,n[c].size)?l=1:r.size<=1e-10&&(l=-1),i[a][c]=i[c][a]=l}),{distances:e,constraints:i}}v(xe,"getDistanceMatrices");function pe(t,n,s,e){for(let r=0;r<n.length;++r)n[r]=0;let i=0;for(let r=0;r<s.length;++r){const a=t[2*r],c=t[2*r+1];for(let f=r+1;f<s.length;++f){const l=t[2*f],u=t[2*f+1],d=s[r][f],h=e[r][f],b=(l-a)*(l-a)+(u-c)*(u-c),y=Math.sqrt(b),w=b-d*d;h>0&&y<=d||h<0&&y>=d||(i+=2*w*w,n[2*r]+=4*w*(a-l),n[2*r+1]+=4*w*(c-u),n[2*f]+=4*w*(l-a),n[2*f+1]+=4*w*(u-c))}}return i}v(pe,"constrainedMDSGradient");function me(t,n={}){let s=ve(t,n);const e=n.lossFunction||et;if(t.length>=8){const i=be(t,n),r=e(i,t),a=e(s,t);r+1e-8<a&&(s=i)}return s}v(me,"bestInitialLayout");function be(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:r,constraints:a}=xe(t,e,i);const c=ht(r.map(ht))/r.length;r=r.map(h=>h.map(b=>b/c));const f=v((h,b)=>pe(h,b,r,a),"obj");let l=null;for(let h=0;h<s;++h){const b=ge(f,ft(r.length*2).map(Math.random),n);(!l||b.fx<l.fx)&&(l=b)}const u=l.x,d={};for(let h=0;h<e.length;++h){const b=e[h];d[b.sets[0]]={x:u[2*h]*c,y:u[2*h+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)dt(h.x,c);return d}v(be,"constrainedMDSLayout");function ve(t,n){const s=n&&n.lossFunction?n.lossFunction:et,e={},i={};for(const d of t)if(d.sets.length===1){const h=d.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:d.size,radius:Math.sqrt(d.size/Math.PI)},i[h]=[]}t=t.filter(d=>d.sets.length===2);for(const d of t){let h=d.weight!=null?d.weight:1;const b=d.sets[0],y=d.sets[1];d.size+Rt>=Math.min(e[b].size,e[y].size)&&(h=0),i[b].push({set:y,size:d.size,weight:h}),i[y].push({set:b,size:d.size,weight:h})}const r=[];Object.keys(i).forEach(d=>{let h=0;for(let b=0;b<i[d].length;++b)h+=i[d][b].size*i[d][b].weight;r.push({set:d,size:h})});function a(d,h){return h.size-d.size}v(a,"sortOrder"),r.sort(a);const c={};function f(d){return d.set in c}v(f,"isPositioned");function l(d,h){e[h].x=d.x,e[h].y=d.y,c[h]=!0}v(l,"positionSet"),l({x:0,y:0},r[0].set);for(let d=1;d<r.length;++d){const h=r[d].set,b=i[h].filter(f),y=e[h];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const w=[];for(var u=0;u<b.length;++u){const g=e[b[u].set],k=gt(y.radius,g.radius,b[u].size);w.push({x:g.x+k,y:g.y}),w.push({x:g.x-k,y:g.y}),w.push({y:g.y+k,x:g.x}),w.push({y:g.y-k,x:g.x});for(let I=u+1;I<b.length;++I){const p=e[b[I].set],x=gt(y.radius,p.radius,b[I].size),o=zt({x:g.x,y:g.y,radius:k},{x:p.x,y:p.y,radius:x});w.push(...o)}}let E=1e50,m=w[0];for(const g of w){e[h].x=g.x,e[h].y=g.y;const k=s(e,t);k<E&&(E=k,m=g)}l(m,h)}return e}v(ve,"greedyLayout");function et(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=pt(a.radius,c.radius,G(a,c))}else i=it(e.sets.map(a=>t[a]));const r=e.weight!=null?e.weight:1;s+=r*(i-e.size)*(i-e.size)}return s}v(et,"lossFunction");function Nt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],f=t[e.sets[1]];i=pt(c.radius,f.radius,G(c,f))}else i=it(e.sets.map(c=>t[c]));const r=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=r*a*a}return s}v(Nt,"logRatioLossFunction");function ke(t,n,s){if(s==null?t.sort((i,r)=>r.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,r=t[0].y;for(const a of t)a.x-=i,a.y-=r}if(t.length===2&&G(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,r=Math.cos(i),a=Math.sin(i);for(const c of t){const f=c.x,l=c.y;c.x=r*f-a*l,c.y=a*f+r*l}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const r=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+r*a.y)/(1+r*r);a.x=2*e-a.x,a.y=2*e*r-a.y}}}}v(ke,"orientateCircles");function Ie(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}v(n,"find");function s(i,r){const a=n(i);a.parent=n(r)}v(s,"union");for(let i=0;i<t.length;++i)for(let r=i+1;r<t.length;++r){const a=t[i].radius+t[r].radius;G(t[i],t[r])+1e-10<a&&s(t[r],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const r=n(t[i]).parent.setid;e.has(r)||e.set(r,[]),e.get(r).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}v(Ie,"disjointCluster");function yt(t){const n=v(s=>({max:t.reduce((e,i)=>Math.max(e,i[s]+i.radius),Number.NEGATIVE_INFINITY),min:t.reduce((e,i)=>Math.min(e,i[s]-i.radius),Number.POSITIVE_INFINITY)}),"minMax");return{xRange:n("x"),yRange:n("y")}}v(yt,"getBoundingBox");function Ot(t,n,s){n==null&&(n=Math.PI/2);let e=Pt(t).map(l=>Object.assign({},l));const i=Ie(e);for(const l of i){ke(l,n,s);const u=yt(l);l.size=(u.xRange.max-u.xRange.min)*(u.yRange.max-u.yRange.min),l.bounds=u}i.sort((l,u)=>u.size-l.size),e=i[0];let r=e.bounds;const a=(r.xRange.max-r.xRange.min)/50;function c(l,u,d){if(!l)return;const h=l.bounds;let b,y;if(u)b=r.xRange.max-h.xRange.min+a;else{b=r.xRange.max-h.xRange.max;const w=(h.xRange.max-h.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;w<0&&(b+=w)}if(d)y=r.yRange.max-h.yRange.min+a;else{y=r.yRange.max-h.yRange.max;const w=(h.yRange.max-h.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;w<0&&(y+=w)}for(const w of l)w.x+=b,w.y+=y,e.push(w)}v(c,"addCluster");let f=1;for(;f<i.length;)c(i[f],!0,!1),c(i[f+1],!1,!0),c(i[f+2],!0,!0),f+=3,r=yt(e);return Ft(e)}v(Ot,"normalizeSolution");function jt(t,n,s,e,i){const r=Pt(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=yt(r);if(a.max===a.min||c.max===c.min)return t;let f,l;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,l=s/b}else f=n/(a.max-a.min),l=s/(c.max-c.min);const u=Math.min(l,f),d=(n-(a.max-a.min)*u)/2,h=(s-(c.max-c.min)*u)/2;return Ft(r.map(b=>({radius:u*b.radius,x:e+d+(b.x-a.min)*u,y:e+h+(b.y-c.min)*u,setid:b.setid})))}v(jt,"scaleSolution");function Ft(t){const n={};for(const s of t)n[s.setid]=s;return n}v(Ft,"toObjectNotation");function Pt(t){return Object.keys(t).map(n=>Object.assign(t[n],{setid:n}))}v(Pt,"fromObjectNotation");function Me(t={}){let n=!1,s=600,e=350,i=15,r=1e3,a=Math.PI/2,c=!0,f=null,l=!0,u=!0,d=null,h=null,b=!1,y=null,w=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},m=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],g=0,k=v(function(o){if(o in E)return E[o];var T=E[o]=m[g];return g+=1,g>=m.length&&(g=0),T},"colours"),I=Dt,p=et;function x(o){let T=o.datum();const M=new Set;T.forEach(S=>{S.size==0&&S.sets.length==1&&M.add(S.sets[0])}),T=T.filter(S=>!S.sets.some(O=>M.has(O)));let A={},j={};if(T.length>0){let S=I(T,{lossFunction:p,distinct:b});c&&(S=Ot(S,a,h)),A=jt(S,s,e,i,f),j=Vt(A,T,w)}const K={};T.forEach(S=>{S.label&&(K[S.sets]=S.label)});function U(S){if(S.sets in K)return K[S.sets];if(S.sets.length==1)return""+S.sets[0]}v(U,"label"),o.selectAll("svg").data([A]).enter().append("svg");const C=o.select("svg");n?C.attr("viewBox",`0 0 ${s} ${e}`):C.attr("width",s).attr("height",e);const R={};let z=!1;C.selectAll(".venn-area path").each(function(S){const O=this.getAttribute("d");S.sets.length==1&&O&&!b&&(z=!0,R[S.sets[0]]=_e(O))});function F(S){return O=>_t(S.sets.map($=>{let q=R[$],J=A[$];return q||(q={x:s/2,y:e/2,radius:1}),J||(J={x:s/2,y:e/2,radius:1}),{x:q.x*(1-O)+J.x*O,y:q.y*(1-O)+J.y*O,radius:q.radius*(1-O)+J.radius*O}}),y)}v(F,"pathTween");const N=C.selectAll(".venn-area").data(T,S=>S.sets),L=N.enter().append("g").attr("class",S=>`venn-area venn-${S.sets.length==1?"circle":"intersection"}${S.colour||S.color?" venn-coloured":""}`).attr("data-venn-sets",S=>S.sets.join("_")),V=L.append("path"),X=L.append("text").attr("class","label").text(S=>U(S)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);u&&(V.style("fill-opacity","0").filter(S=>S.sets.length==1).style("fill",S=>S.colour?S.colour:S.color?S.color:k(S.sets)).style("fill-opacity",".25"),X.style("fill",S=>S.colour||S.color?"#FFF":t.textFill?t.textFill:S.sets.length==1?k(S.sets):"#444"));function H(S){return typeof S.transition=="function"?S.transition("venn").duration(r):S}v(H,"asTransition");let D=o;z&&typeof D.transition=="function"?(D=H(o),D.selectAll("path").attrTween("d",F)):D.selectAll("path").attr("d",S=>_t(S.sets.map(O=>A[O])),y);const Y=D.selectAll("text").filter(S=>S.sets in j).text(S=>U(S)).attr("x",S=>Math.floor(j[S.sets].x)).attr("y",S=>Math.floor(j[S.sets].y));l&&(z?"on"in Y?Y.on("end",lt(A,U)):Y.each("end",lt(A,U)):Y.each(lt(A,U)));const B=H(N.exit()).remove();typeof N.transition=="function"&&B.selectAll("path").attrTween("d",F);const P=B.selectAll("text").attr("x",s/2).attr("y",e/2);return d!==null&&(X.style("font-size","0px"),Y.style("font-size",d),P.style("font-size","0px")),{circles:A,textCentres:j,nodes:N,enter:L,update:D,exit:B}}return v(x,"chart"),x.wrap=function(o){return arguments.length?(l=o,x):l},x.useViewBox=function(){return n=!0,x},x.width=function(o){return arguments.length?(s=o,x):s},x.height=function(o){return arguments.length?(e=o,x):e},x.padding=function(o){return arguments.length?(i=o,x):i},x.distinct=function(o){return arguments.length?(b=o,x):b},x.colours=function(o){return arguments.length?(k=o,x):k},x.colors=function(o){return arguments.length?(k=o,x):k},x.fontSize=function(o){return arguments.length?(d=o,x):d},x.round=function(o){return arguments.length?(y=o,x):y},x.duration=function(o){return arguments.length?(r=o,x):r},x.layoutFunction=function(o){return arguments.length?(I=o,x):I},x.normalize=function(o){return arguments.length?(c=o,x):c},x.scaleToFit=function(o){return arguments.length?(f=o,x):f},x.styled=function(o){return arguments.length?(u=o,x):u},x.orientation=function(o){return arguments.length?(a=o,x):a},x.orientationOrder=function(o){return arguments.length?(h=o,x):h},x.lossFunction=function(o){return arguments.length?(p=o==="default"?et:o==="logRatio"?Nt:o,x):p},x}v(Me,"VennDiagram");function lt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,r=n(s)||"",a=r.split(/\s+/).reverse(),c=(r.length+a.length)/3;let f=a.pop(),l=[f],u=0;const d=1.1;e.textContent=null;const h=[];function b(g){const k=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return k.textContent=g,h.push(k),e.append(k),k}v(b,"append");let y=b(f);for(;f=a.pop(),!!f;){l.push(f);const g=l.join(" ");y.textContent=g,g.length>c&&y.getComputedTextLength()>i&&(l.pop(),y.textContent=l.join(" "),l=[f],y=b(f),u++)}const w=.35-u*d/2,E=e.getAttribute("x"),m=e.getAttribute("y");h.forEach((g,k)=>{g.setAttribute("x",E),g.setAttribute("y",m),g.setAttribute("dy",`${w+k*d}em`)})}}v(lt,"wrapText");function ct(t,n,s){let e=n[0].radius-G(n[0],t);for(let i=1;i<n.length;++i){const r=n[i].radius-G(n[i],t);r<=e&&(e=r)}for(let i=0;i<s.length;++i){const r=G(s[i],t)-s[i].radius;r<=e&&(e=r)}return e}v(ct,"circleMargin");function Lt(t,n,s){const e=[];for(const u of t)e.push({x:u.x,y:u.y}),e.push({x:u.x+u.radius/2,y:u.y}),e.push({x:u.x-u.radius/2,y:u.y}),e.push({x:u.x,y:u.y+u.radius/2}),e.push({x:u.x,y:u.y-u.radius/2});let i=e[0],r=ct(e[0],t,n);for(let u=1;u<e.length;++u){const d=ct(e[u],t,n);d>=r&&(i=e[u],r=d)}const a=Ct(u=>-1*ct({x:u[0],y:u[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let f=!0;for(const u of t)if(G(c,u)>u.radius){f=!1;break}for(const u of n)if(G(c,u)<u.radius){f=!1;break}if(f)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const l={};return it(t,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}:n.length?Lt(t,[]):At(l.arcs.map(u=>u.p1))}v(Lt,"computeTextCentre");function Se(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],r=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],f=t[c],l=G(r,f);l+f.radius<=r.radius+1e-10?n[c].push(i):l+r.radius<=f.radius+1e-10&&n[i].push(c)}}return n}v(Se,"getOverlappingCircles");function Vt(t,n,s){const e={},i=Se(t);for(let r=0;r<n.length;++r){const a=n[r].sets,c={},f={};for(let h=0;h<a.length;++h){c[a[h]]=!0;const b=i[a[h]];for(let y=0;y<b.length;++y)f[b[y]]=!0}const l=[],u=[];for(let h in t)h in c?l.push(t[h]):h in f||u.push(t[h]);const d=Lt(l,u,s);e[a]=d,d.disjoint&&n[r].size>0}return e}v(Vt,"computeTextCentres");function we(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -1 +1 @@
1
- import"./chunk-NGNAAXSQ-e5XI1hSt.js";import{i as a}from"./mermaid-parser.core-DmG0b4S0.js";export{a as createWardleyServices};
1
+ import"./chunk-NGNAAXSQ-e5XI1hSt.js";import{i as a}from"./mermaid-parser.core-BjFu937m.js";export{a as createWardleyServices};
@@ -1,4 +1,4 @@
1
- var Mt=Object.defineProperty;var w=(e,n)=>Mt(e,"name",{value:n,configurable:!0});import{n as Nt}from"./mermaid-parser.core-DmG0b4S0.js";import{n as y}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Q}from"./src-DYjgETqR.js";import{C as zt,E as Lt,H as Tt,U as At,_ as Et,a as Xt,b as V,c as Yt,q as It,v as Bt,y as Ft}from"./chunk-VPRB5NB3-CfeHjtbb.js";import{i as J}from"./chunk-3YJQHVM4-Dj5wEKIw.js";import{t as Ot}from"./chunk-JWPE2WC7--HEGjv3t.js";import{a as Rt}from"./mermaid.core-D1vILTuF.js";var G=y((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=y((e,n,r)=>({x:G(n,`${r} evolution`),y:G(e,`${r} visibility`)}),"toCoordinates"),K=y(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Wt=y(e=>{if(!e?.startsWith("+"))return{};const n=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:n}:e.includes("<")?{flow:"backward",label:n}:e.includes(">")?{flow:"forward",label:n}:{label:n}},"extractFlowFromArrow"),Dt=y((e,n)=>{if(Ot(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),f=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:f})}if(e.anchors.forEach(r=>{const f=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,f.x,f.y,"anchor")}),e.components.forEach(r=>{const f=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,l=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,u=r.decorator?.strategy;n.addNode(r.name,r.name,f.x,f.y,"component",a,l,r.inertia,u)}),e.notes.forEach(r=>{const f=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,f.x,f.y)}),e.pipelines.forEach(r=>{const f=n.getNode(r.parent);if(!f||typeof f.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=f.y;n.startPipeline(r.parent),r.components.forEach(l=>{const u=`${r.parent}_${l.name}`,S=l.label?(l.label.negX?-1:1)*l.label.offsetX:void 0,g=l.label?(l.label.negY?-1:1)*l.label.offsetY:void 0,O=G(l.evolution,`Pipeline component "${l.name}" evolution`);n.addNode(u,l.name,O,a,"pipeline-component",S,g),n.addPipelineComponent(r.parent,u)})}),e.links.forEach(r=>{const f=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=K(r.fromPort)??K(r.toPort);const{flow:l,label:u}=Wt(r.arrow);!a&&l&&(a=l);const S=r.linkLabel,g=u??S;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),f,g,a)}),e.evolves.forEach(r=>{const f=n.getNode(r.component);if(f?.y!==void 0){const a=G(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,f.y)}}),e.annotations.length>0){const r=e.annotations[0],f=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(f.x,f.y)}e.annotation.forEach(r=>{const f=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:f.x,y:f.y}],r.text)}),e.accelerators.forEach(r=>{const f=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,f.x,f.y)}),e.deaccelerators.forEach(r=>{const f=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,f.x,f.y)})},"populateDb"),tt={parser:{yy:void 0},parse:y(async e=>{const n=await Nt("wardley",e);Q.debug(n);const r=tt.parser?.yy;if(!r||typeof r.addNode!="function")throw new 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.");Dt(n,r)},"parse")},Gt=class{static{w(this,"WardleyBuilder")}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{y(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const f=this.nodes.get(n);f&&(f.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,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}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}},b=new Gt;function et(){return V()["wardley-beta"]}w(et,"getConfig3");y(et,"getConfig");function at(e,n,r,f,a,l,u,S,g){b.addNode({id:e,label:n,x:r,y:f,className:a,labelOffsetX:l,labelOffsetY:u,inertia:S,sourceStrategy:g})}w(at,"addNode");y(at,"addNode");function rt(e,n,r=!1,f,a){b.addLink({source:e,target:n,dashed:r,label:f,flow:a})}w(rt,"addLink");y(rt,"addLink");function ot(e,n,r){b.addTrend({nodeId:e,targetX:n,targetY:r})}w(ot,"addTrend");y(ot,"addTrend");function nt(e,n,r){b.addAnnotation({number:e,coordinates:n,text:r})}w(nt,"addAnnotation");y(nt,"addAnnotation");function st(e,n,r){b.addNote({text:e,x:n,y:r})}w(st,"addNote");y(st,"addNote");function it(e,n,r){b.addAccelerator({name:e,x:n,y:r})}w(it,"addAccelerator");y(it,"addAccelerator");function lt(e,n,r){b.addDeaccelerator({name:e,x:n,y:r})}w(lt,"addDeaccelerator");y(lt,"addDeaccelerator");function dt(e,n){b.setAnnotationsBox(e,n)}w(dt,"setAnnotationsBox");y(dt,"setAnnotationsBox");function ct(e,n){b.setSize(e,n)}w(ct,"setSize");y(ct,"setSize");function pt(e){b.startPipeline(e)}w(pt,"startPipeline");y(pt,"startPipeline");function ft(e,n){b.addPipelineComponent(e,n)}w(ft,"addPipelineComponent");y(ft,"addPipelineComponent");function ht(e){b.setAxes(e)}w(ht,"updateAxes");y(ht,"updateAxes");function xt(e){return b.getNode(e)}w(xt,"getNode");y(xt,"getNode");function gt(e){return b.resolveNodeId(e)}w(gt,"resolveNodeId");y(gt,"resolveNodeId");function yt(){return b.build()}w(yt,"getWardleyData");y(yt,"getWardleyData");function ut(){b.clear(),Xt()}w(ut,"clear2");y(ut,"clear");var qt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:lt,setAnnotationsBox:dt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Bt,setDiagramTitle:It,getDiagramTitle:zt,getAccDescription:Et,setAccDescription:Tt},Ht=["Genesis","Custom Built","Product","Commodity"],jt=y(()=>{const{themeVariables:e}=V();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"),Vt=y(()=>{const e=V()["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"),ae={parser:tt,db:qt,renderer:{draw:y((e,n,r,f)=>{Q.debug(`Rendering Wardley map
1
+ var Mt=Object.defineProperty;var w=(e,n)=>Mt(e,"name",{value:n,configurable:!0});import{n as Nt}from"./mermaid-parser.core-BjFu937m.js";import{n as y}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Q}from"./src-DYjgETqR.js";import{C as zt,E as Lt,H as Tt,U as At,_ as Et,a as Xt,b as V,c as Yt,q as It,v as Bt,y as Ft}from"./chunk-VPRB5NB3-BNz5CtBn.js";import{i as J}from"./chunk-3YJQHVM4-C_uoPpLR.js";import{t as Ot}from"./chunk-JWPE2WC7--HEGjv3t.js";import{a as Rt}from"./mermaid.core-B0t95EIS.js";var G=y((e,n)=>{const r=e<=1?e*100:e;if(r<0||r>100)throw new Error(`${n} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return r},"toPercent"),A=y((e,n,r)=>({x:G(n,`${r} evolution`),y:G(e,`${r} visibility`)}),"toCoordinates"),K=y(e=>{if(e){if(e==="+<>")return"bidirectional";if(e==="+<")return"backward";if(e==="+>")return"forward"}},"getFlowFromPort"),Wt=y(e=>{if(!e?.startsWith("+"))return{};const n=/^\+'([^']*)'/.exec(e)?.[1];return e.includes("<>")?{flow:"bidirectional",label:n}:e.includes("<")?{flow:"backward",label:n}:e.includes(">")?{flow:"forward",label:n}:{label:n}},"extractFlowFromArrow"),Dt=y((e,n)=>{if(Ot(e,n),e.size&&n.setSize(e.size.width,e.size.height),e.evolution){const r=e.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),f=e.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);n.updateAxes({stages:r,stageBoundaries:f})}if(e.anchors.forEach(r=>{const f=A(r.visibility,r.evolution,`Anchor "${r.name}"`);n.addNode(r.name,r.name,f.x,f.y,"anchor")}),e.components.forEach(r=>{const f=A(r.visibility,r.evolution,`Component "${r.name}"`),a=r.label?(r.label.negX?-1:1)*r.label.offsetX:void 0,l=r.label?(r.label.negY?-1:1)*r.label.offsetY:void 0,u=r.decorator?.strategy;n.addNode(r.name,r.name,f.x,f.y,"component",a,l,r.inertia,u)}),e.notes.forEach(r=>{const f=A(r.visibility,r.evolution,`Note "${r.text}"`);n.addNote(r.text,f.x,f.y)}),e.pipelines.forEach(r=>{const f=n.getNode(r.parent);if(!f||typeof f.y!="number")throw new Error(`Pipeline "${r.parent}" must reference an existing component with coordinates.`);const a=f.y;n.startPipeline(r.parent),r.components.forEach(l=>{const u=`${r.parent}_${l.name}`,S=l.label?(l.label.negX?-1:1)*l.label.offsetX:void 0,g=l.label?(l.label.negY?-1:1)*l.label.offsetY:void 0,O=G(l.evolution,`Pipeline component "${l.name}" evolution`);n.addNode(u,l.name,O,a,"pipeline-component",S,g),n.addPipelineComponent(r.parent,u)})}),e.links.forEach(r=>{const f=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let a=K(r.fromPort)??K(r.toPort);const{flow:l,label:u}=Wt(r.arrow);!a&&l&&(a=l);const S=r.linkLabel,g=u??S;n.addLink(n.resolveNodeId(r.from),n.resolveNodeId(r.to),f,g,a)}),e.evolves.forEach(r=>{const f=n.getNode(r.component);if(f?.y!==void 0){const a=G(r.target,`Evolve target for "${r.component}"`);n.addTrend(r.component,a,f.y)}}),e.annotations.length>0){const r=e.annotations[0],f=A(r.x,r.y,"Annotations box");n.setAnnotationsBox(f.x,f.y)}e.annotation.forEach(r=>{const f=A(r.x,r.y,`Annotation ${r.number}`);n.addAnnotation(r.number,[{x:f.x,y:f.y}],r.text)}),e.accelerators.forEach(r=>{const f=A(r.x,r.y,`Accelerator "${r.name}"`);n.addAccelerator(r.name,f.x,f.y)}),e.deaccelerators.forEach(r=>{const f=A(r.x,r.y,`Deaccelerator "${r.name}"`);n.addDeaccelerator(r.name,f.x,f.y)})},"populateDb"),tt={parser:{yy:void 0},parse:y(async e=>{const n=await Nt("wardley",e);Q.debug(n);const r=tt.parser?.yy;if(!r||typeof r.addNode!="function")throw new 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.");Dt(n,r)},"parse")},Gt=class{static{w(this,"WardleyBuilder")}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{y(this,"WardleyBuilder")}addNode(e){const n=this.nodes.get(e.id)??{id:e.id,label:e.label},r={...n,...e,className:e.className??n.className,labelOffsetX:e.labelOffsetX??n.labelOffsetX,labelOffsetY:e.labelOffsetY??n.labelOffsetY};this.nodes.set(e.id,r)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const n=this.nodes.get(e);n&&(n.isPipelineParent=!0)}addPipelineComponent(e,n){const r=this.pipelines.get(e);r&&r.componentIds.push(n);const f=this.nodes.get(n);f&&(f.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,n){this.annotationsBox={x:e,y:n}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,n){this.size={width:e,height:n}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(const[n,r]of this.nodes)if(r.label===e)return n;return e}build(){const e=[];for(const n of this.nodes.values()){if(typeof n.x!="number"||typeof n.y!="number")throw new Error(`Node "${n.label}" is missing coordinates`);e.push(n)}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}},b=new Gt;function et(){return V()["wardley-beta"]}w(et,"getConfig3");y(et,"getConfig");function at(e,n,r,f,a,l,u,S,g){b.addNode({id:e,label:n,x:r,y:f,className:a,labelOffsetX:l,labelOffsetY:u,inertia:S,sourceStrategy:g})}w(at,"addNode");y(at,"addNode");function rt(e,n,r=!1,f,a){b.addLink({source:e,target:n,dashed:r,label:f,flow:a})}w(rt,"addLink");y(rt,"addLink");function ot(e,n,r){b.addTrend({nodeId:e,targetX:n,targetY:r})}w(ot,"addTrend");y(ot,"addTrend");function nt(e,n,r){b.addAnnotation({number:e,coordinates:n,text:r})}w(nt,"addAnnotation");y(nt,"addAnnotation");function st(e,n,r){b.addNote({text:e,x:n,y:r})}w(st,"addNote");y(st,"addNote");function it(e,n,r){b.addAccelerator({name:e,x:n,y:r})}w(it,"addAccelerator");y(it,"addAccelerator");function lt(e,n,r){b.addDeaccelerator({name:e,x:n,y:r})}w(lt,"addDeaccelerator");y(lt,"addDeaccelerator");function dt(e,n){b.setAnnotationsBox(e,n)}w(dt,"setAnnotationsBox");y(dt,"setAnnotationsBox");function ct(e,n){b.setSize(e,n)}w(ct,"setSize");y(ct,"setSize");function pt(e){b.startPipeline(e)}w(pt,"startPipeline");y(pt,"startPipeline");function ft(e,n){b.addPipelineComponent(e,n)}w(ft,"addPipelineComponent");y(ft,"addPipelineComponent");function ht(e){b.setAxes(e)}w(ht,"updateAxes");y(ht,"updateAxes");function xt(e){return b.getNode(e)}w(xt,"getNode");y(xt,"getNode");function gt(e){return b.resolveNodeId(e)}w(gt,"resolveNodeId");y(gt,"resolveNodeId");function yt(){return b.build()}w(yt,"getWardleyData");y(yt,"getWardleyData");function ut(){b.clear(),Xt()}w(ut,"clear2");y(ut,"clear");var qt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:lt,setAnnotationsBox:dt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Bt,setDiagramTitle:It,getDiagramTitle:zt,getAccDescription:Et,setAccDescription:Tt},Ht=["Genesis","Custom Built","Product","Commodity"],jt=y(()=>{const{themeVariables:e}=V();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"),Vt=y(()=>{const e=V()["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"),ae={parser:tt,db:qt,renderer:{draw:y((e,n,r,f)=>{Q.debug(`Rendering Wardley map
2
2
  `+e);const a=Vt(),l=jt(),u=a.nodeRadius*1.6,S=f.db,g=S.getWardleyData(),O=S.getDiagramTitle(),M=g.size?.width??a.width,$=g.size?.height??a.height,Y=Rt(n);Y.selectAll("*").remove(),Yt(Y,$,M,a.useMaxWidth),Y.attr("viewBox",`0 0 ${M} ${$}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${n}`).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",l.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${n}`).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",l.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${n}`).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",l.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",M).attr("height",$).attr("fill",l.backgroundColor);const I=M-a.padding*2,B=$-a.padding*2;O&&v.append("text").attr("class","wardley-title").attr("x",M/2).attr("y",a.padding/2).attr("fill",l.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(O);const z=y(t=>a.padding+t/100*I,"projectX"),L=y(t=>$-a.padding-t/100*B,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",M-a.padding).attr("y1",$-a.padding).attr("y2",$-a.padding).attr("stroke",l.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke",l.axisColor).attr("stroke-width",1);const mt=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",$-a.padding/4).attr("fill",l.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(mt),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",l.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(wt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:Ht;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,o=[];if(s&&s.length===F.length){let i=0;s.forEach(d=>{o.push({start:i,end:d}),i=d})}else{const i=1/F.length;F.forEach((d,c)=>{o.push({start:c*i,end:(c+1)*i})})}F.forEach((i,d)=>{const c=o[d],x=a.padding+c.start*I,h=(x+(a.padding+c.end*I))/2;d>0&&t.append("line").attr("x1",x).attr("x2",x).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",h).attr("y",$-a.padding/1.5).attr("fill",l.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=a.padding+I*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",$-a.padding).attr("stroke",l.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",M-a.padding).attr("y1",$-a.padding-B*o).attr("y2",$-a.padding-B*o).attr("stroke",l.gridColor).attr("stroke-dasharray","2 6")}}const p=new Map;if(g.nodes.forEach(t=>{p.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(h=>({id:h,pos:p.get(h),node:g.nodes.find(m=>m.id===h)})).filter(h=>h.pos&&h.node).sort((h,m)=>h.node.x-m.node.x);for(let h=0;h<i.length-1;h++){const m=i[h],k=i[h+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",k.pos.x).attr("y2",k.pos.y).attr("stroke",l.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let d=1/0,c=-1/0,x=0;if(o.componentIds.forEach(h=>{const m=p.get(h);m&&(d=Math.min(d,m.x),c=Math.max(c,m.x),x=m.y)}),d!==1/0&&c!==-1/0){const m=a.nodeRadius*4,k=x-m/2,C=p.get(o.nodeId);C&&(C.x=(d+c)/2,C.y=k-u/6),t.append("rect").attr("class","wardley-pipeline-box").attr("x",d-15).attr("y",k).attr("width",c-d+30).attr("height",m).attr("fill","none").attr("stroke",l.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),U=new Map;g.pipelines.forEach(t=>{U.set(t.nodeId,new Set(t.componentIds))});const Z=g.links.filter(t=>!(!p.has(t.source)||!p.has(t.target)||U.get(t.target)?.has(t.source)));_.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=p.get(t.source),o=p.get(t.target),i=g.nodes.find(h=>h.id===t.source).isPipelineParent?u/Math.sqrt(2):a.nodeRadius,d=o.x-s.x,c=o.y-s.y,x=Math.sqrt(d*d+c*c);return s.x+d/x*i}).attr("y1",t=>{const s=p.get(t.source),o=p.get(t.target),i=g.nodes.find(h=>h.id===t.source).isPipelineParent?u/Math.sqrt(2):a.nodeRadius,d=o.x-s.x,c=o.y-s.y,x=Math.sqrt(d*d+c*c);return s.y+c/x*i}).attr("x2",t=>{const s=p.get(t.source),o=p.get(t.target),i=g.nodes.find(h=>h.id===t.target).isPipelineParent?u/Math.sqrt(2):a.nodeRadius,d=s.x-o.x,c=s.y-o.y,x=Math.sqrt(d*d+c*c);return o.x+d/x*i}).attr("y2",t=>{const s=p.get(t.source),o=p.get(t.target),i=g.nodes.find(h=>h.id===t.target).isPipelineParent?u/Math.sqrt(2):a.nodeRadius,d=s.x-o.x,c=s.y-o.y,x=Math.sqrt(d*d+c*c);return o.y+c/x*i}).attr("stroke",l.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${n})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${n})`:null),_.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=p.get(t.source),o=p.get(t.target),i=(s.x+o.x)/2,d=o.y-s.y,c=o.x-s.x;return i+d/Math.sqrt(c*c+d*d)*8}).attr("y",t=>{const s=p.get(t.source),o=p.get(t.target),i=(s.y+o.y)/2,d=o.x-s.x,c=o.y-s.y,x=Math.sqrt(d*d+c*c);return i+-d/x*8}).attr("fill",l.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=p.get(t.source),o=p.get(t.target),i=(s.x+o.x)/2,d=(s.y+o.y)/2,c=o.x-s.x,x=o.y-s.y,h=Math.sqrt(c*c+x*x),m=8,k=x/h,C=-c/h,E=i+k*m,W=d+C*m;let X=Math.atan2(x,c)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${E} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=p.get(t.nodeId);if(!s)return null;const o=z(t.targetX),i=L(t.targetY),d=o-s.x,c=i-s.y,x=Math.sqrt(d*d+c*c),h=a.nodeRadius+2;return{origin:s,targetX:o,targetY:i,adjustedX2:x>h?o-d/x*h:o,adjustedY2:x>h?i-c/x*h:i}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",l.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${n})`);const N=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));N.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",l.componentStroke).attr("stroke-width",1),N.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",l.componentStroke).attr("stroke-width",1),N.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=N.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",l.componentStroke).attr("stroke-width",1),N.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y).attr("r",a.nodeRadius).attr("fill",l.componentFill).attr("stroke",l.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,P=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>p.get(t.id).x).attr("y1",t=>p.get(t.id).y-P).attr("x2",t=>p.get(t.id).x-P*Math.cos(Math.PI/6)).attr("y2",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("stroke",l.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>p.get(t.id).x-P*Math.cos(Math.PI/6)).attr("y1",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("x2",t=>p.get(t.id).x+P*Math.cos(Math.PI/6)).attr("y2",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("stroke",l.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>p.get(t.id).x+P*Math.cos(Math.PI/6)).attr("y1",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("x2",t=>p.get(t.id).x).attr("y2",t=>p.get(t.id).y-P).attr("stroke",l.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>p.get(t.id).x).attr("cy",t=>p.get(t.id).y-P).attr("r",H).attr("fill","white").attr("stroke",l.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>p.get(t.id).x-P*Math.cos(Math.PI/6)).attr("cy",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",l.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>p.get(t.id).x+P*Math.cos(Math.PI/6)).attr("cy",t=>p.get(t.id).y+P*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",l.componentStroke).attr("stroke-width",2),N.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>p.get(t.id).x-u/2).attr("y",t=>p.get(t.id).y-u/2).attr("width",u).attr("height",u).attr("fill",l.componentFill).attr("stroke",l.componentStroke).attr("stroke-width",1),N.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=p.get(t.id);let o=t.isPipelineParent?u/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=p.get(t.id),o=t.isPipelineParent?u:a.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=p.get(t.id);let o=t.isPipelineParent?u/2+15:a.nodeRadius+15;return t.sourceStrategy&&(o+=a.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=p.get(t.id),o=t.isPipelineParent?u:a.nodeRadius*2;return s.y+o/2}).attr("stroke",l.componentStroke).attr("stroke-width",6),N.append("text").attr("x",t=>{const s=p.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=p.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?l.evolutionStroke:t.className==="anchor"?"#000":l.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(o.length>1)for(let i=0;i<o.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",o[i].x).attr("y1",o[i].y).attr("x2",o[i+1].x).attr("y2",o[i+1].y).attr("stroke",l.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");o.forEach(i=>{const d=t.append("g").attr("class","wardley-annotation");d.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",l.axisColor).attr("stroke-width",1.5),d.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",l.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),o=L(g.annotationsBox.y);const i=10,d=16,c=11,x=t.append("g").attr("class","wardley-annotations-box"),h=[...g.annotations].filter(k=>k.text).sort((k,C)=>k.number-C.number),m=[];if(h.forEach((k,C)=>{const E=x.append("text").attr("x",s+i).attr("y",o+i+(C+1)*d).attr("font-size",c).attr("fill",l.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${k.number}. ${k.text}`);m.push(E)}),m.length>0){let k=0,C=0;m.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();k=Math.max(k,Ct);const St=D.getBBox();C=Math.max(C,St.height)});const E=k+20+105,W=h.length*d+20+C/2,X=a.padding,$t=M-a.padding-E,Pt=a.padding,vt=$-a.padding-W;s=Math.max(X,Math.min(s,$t)),o=Math.max(Pt,Math.min(o,vt)),m.forEach((j,D)=>{j.attr("x",s+i).attr("y",o+i+(D+1)*d)}),x.insert("rect","text").attr("x",s).attr("y",o).attr("width",E).attr("height",W).attr("fill","white").attr("stroke",l.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const o=z(s.x),i=L(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",l.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const o=z(s.x),i=L(s.y),d=60,c=30,x=20,h=`
3
3
  M ${o} ${i-c/2}
4
4
  L ${o+d-x} ${i-c/2}
@@ -1,4 +1,4 @@
1
- var hi=Object.defineProperty;var o=(t,i)=>hi(t,"name",{value:i,configurable:!0});import{n}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Bt}from"./src-DYjgETqR.js";import{C as Ot,E as ri,H as li,U as ci,_ as gi,a as ui,c as di,f as xi,q as fi,v as pi,y as yt,z as mi}from"./chunk-VPRB5NB3-CfeHjtbb.js";import{t as Et}from"./linear-BRQgexd0.js";import{t as yi}from"./ordinal-BJyFM1v8.js";import{t as bi}from"./init-BXPE0p7i.js";import{i as Vt}from"./chunk-3YJQHVM4-Dj5wEKIw.js";import{t as Mt}from"./line-rrKrpB-b.js";import"./chunk-HJ2JQQFS-MXK0gYSP.js";import{t as wi}from"./chunk-E2ZNV5FY-cjSf_BTz.js";import{a as Ai}from"./mermaid.core-D1vILTuF.js";function Ci(t,i,e){t=+t,i=+i,e=(a=arguments.length)<2?(i=t,t=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(a);++s<a;)g[s]=t+s*e;return g}o(Ci,"range");function dt(){var t=yi().unknown(void 0),i=t.domain,e=t.range,s=0,a=1,g,l,x=!1,u=0,y=0,k=.5;delete t.unknown;function _(){var A=i().length,z=a<s,E=z?a:s,M=z?s:a;g=(M-E)/Math.max(1,A-u+y*2),x&&(g=Math.floor(g)),E+=(M-E-g*(A-u))*k,l=g*(1-u),x&&(E=Math.round(E),l=Math.round(l));var B=Ci(A).map(function(b){return E+g*b});return e(z?B.reverse():B)}return o(_,"rescale"),t.domain=function(A){return arguments.length?(i(A),_()):i()},t.range=function(A){return arguments.length?([s,a]=A,s=+s,a=+a,_()):[s,a]},t.rangeRound=function(A){return[s,a]=A,s=+s,a=+a,x=!0,_()},t.bandwidth=function(){return l},t.step=function(){return g},t.round=function(A){return arguments.length?(x=!!A,_()):x},t.padding=function(A){return arguments.length?(u=Math.min(1,y=+A),_()):u},t.paddingInner=function(A){return arguments.length?(u=Math.min(1,A),_()):u},t.paddingOuter=function(A){return arguments.length?(y=+A,_()):y},t.align=function(A){return arguments.length?(k=Math.max(0,Math.min(1,A)),_()):k},t.copy=function(){return dt(i(),[s,a]).round(x).paddingInner(u).paddingOuter(y).align(k)},bi.apply(_(),arguments)}o(dt,"band");var xt=(function(){var t=n(function(h,d,S,f){for(S=S||{},f=h.length;f--;S[h[f]]=d);return S},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],g=[1,6],l=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],y=[1,26],k=[1,28],_=[1,29],A=[1,30],z=[1,31],E=[1,32],M=[1,33],B=[1,34],b=[1,35],P=[1,36],c=[1,37],O=[1,43],X=[1,42],Y=[1,47],N=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],U=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],C=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],R=[1,65],V=[26,28],D={trace:n(o(function(){},"trace"),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(o(function(d,S,f,p,L,r,Z){var m=r.length-1;switch(L){case 5:p.setOrientation(r[m]);break;case 9:p.setDiagramTitle(r[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},r[m]);break;case 13:p.setLineData(r[m-1],r[m]);break;case 14:p.setBarData({text:"",type:"text"},r[m]);break;case 15:p.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:p.setXAxisTitle(r[m]);break;case 25:p.setXAxisTitle(r[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(r[m]);break;case 28:p.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:p.setYAxisTitle(r[m]);break;case 33:p.setYAxisTitle(r[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m]}},"anonymous"),"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,36:a,37:g,38:l}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,36:a,37:g,38:l}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:g,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(x,[2,36]),t(x,[2,37]),t(x,[2,38]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,36:a,37:g,38:l}),{1:[2,3]},t(x,[2,5]),t(i,[2,7],{4:22,36:a,37:g,38:l}),{11:23,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:39,13:38,24:O,29:X,30:u,31:40,32:41,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:45,15:44,29:Y,30:u,35:46,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:49,17:48,24:N,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:52,17:51,24:N,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(U,[2,39],{41:55,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c}),t(U,[2,40]),t(U,[2,41]),t(C,[2,42]),t(C,[2,44]),t(C,[2,45]),t(C,[2,46]),t(C,[2,47]),t(C,[2,48]),t(C,[2,49]),t(C,[2,50]),t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:O,29:X}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:u,34:58,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},t(T,[2,11]),t(T,[2,32],{35:60,29:Y}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:N},{25:63,27:64,29:R},t(T,[2,14]),{17:66,24:N},t(T,[2,16]),t(T,[2,17]),t(C,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(V,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:u,34:74,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:R},t(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(o(function(d,S){if(S.recoverable)this.trace(d);else{var f=new Error(d);throw f.hash=S,f}},"parseError"),"parseError"),parse:n(o(function(d){var S=this,f=[0],p=[],L=[null],r=[],Z=this.table,m="",et=0,Tt=0,Dt=0,si=2,Lt=1,ni=r.slice.call(arguments,1),v=Object.create(this.lexer),q={yy:{}};for(var rt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,rt)&&(q.yy[rt]=this.yy[rt]);v.setInput(d,q.yy),q.yy.lexer=v,q.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var lt=v.yylloc;r.push(lt);var ai=v.options&&v.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oi(F){f.length=f.length-2*F,L.length=L.length-F,r.length=r.length-F}o(oi,"popStack"),n(oi,"popStack");function Pt(){var F=p.pop()||v.lex()||Lt;return typeof F!="number"&&(F instanceof Array&&(p=F,F=p.pop()),F=S.symbols_[F]||F),F}o(Pt,"lex"),n(Pt,"lex");for(var I,ct,G,W,gt,Q={},st,H,vt,nt;;){if(G=f[f.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Pt()),W=Z[G]&&Z[G][I]),typeof W>"u"||!W.length||!W[0]){var ut="";nt=[];for(st in Z[G])this.terminals_[st]&&st>si&&nt.push("'"+this.terminals_[st]+"'");v.showPosition?ut="Parse error on line "+(et+1)+`:
1
+ var hi=Object.defineProperty;var o=(t,i)=>hi(t,"name",{value:i,configurable:!0});import{n}from"./chunk-Y2CYZVJY-OvsAdhaO.js";import{m as Bt}from"./src-DYjgETqR.js";import{C as Ot,E as ri,H as li,U as ci,_ as gi,a as ui,c as di,f as xi,q as fi,v as pi,y as yt,z as mi}from"./chunk-VPRB5NB3-BNz5CtBn.js";import{t as Et}from"./linear-BRQgexd0.js";import{t as yi}from"./ordinal-BJyFM1v8.js";import{t as bi}from"./init-BXPE0p7i.js";import{i as Vt}from"./chunk-3YJQHVM4-C_uoPpLR.js";import{t as Mt}from"./line-Ljt_vfsb.js";import"./chunk-HJ2JQQFS-DL4lnpSv.js";import{t as wi}from"./chunk-E2ZNV5FY-DG8wQ_NS.js";import{a as Ai}from"./mermaid.core-B0t95EIS.js";function Ci(t,i,e){t=+t,i=+i,e=(a=arguments.length)<2?(i=t,t=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((i-t)/e))|0,g=new Array(a);++s<a;)g[s]=t+s*e;return g}o(Ci,"range");function dt(){var t=yi().unknown(void 0),i=t.domain,e=t.range,s=0,a=1,g,l,x=!1,u=0,y=0,k=.5;delete t.unknown;function _(){var A=i().length,z=a<s,E=z?a:s,M=z?s:a;g=(M-E)/Math.max(1,A-u+y*2),x&&(g=Math.floor(g)),E+=(M-E-g*(A-u))*k,l=g*(1-u),x&&(E=Math.round(E),l=Math.round(l));var B=Ci(A).map(function(b){return E+g*b});return e(z?B.reverse():B)}return o(_,"rescale"),t.domain=function(A){return arguments.length?(i(A),_()):i()},t.range=function(A){return arguments.length?([s,a]=A,s=+s,a=+a,_()):[s,a]},t.rangeRound=function(A){return[s,a]=A,s=+s,a=+a,x=!0,_()},t.bandwidth=function(){return l},t.step=function(){return g},t.round=function(A){return arguments.length?(x=!!A,_()):x},t.padding=function(A){return arguments.length?(u=Math.min(1,y=+A),_()):u},t.paddingInner=function(A){return arguments.length?(u=Math.min(1,A),_()):u},t.paddingOuter=function(A){return arguments.length?(y=+A,_()):y},t.align=function(A){return arguments.length?(k=Math.max(0,Math.min(1,A)),_()):k},t.copy=function(){return dt(i(),[s,a]).round(x).paddingInner(u).paddingOuter(y).align(k)},bi.apply(_(),arguments)}o(dt,"band");var xt=(function(){var t=n(function(h,d,S,f){for(S=S||{},f=h.length;f--;S[h[f]]=d);return S},"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],g=[1,6],l=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],y=[1,26],k=[1,28],_=[1,29],A=[1,30],z=[1,31],E=[1,32],M=[1,33],B=[1,34],b=[1,35],P=[1,36],c=[1,37],O=[1,43],X=[1,42],Y=[1,47],N=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],U=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],C=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],R=[1,65],V=[26,28],D={trace:n(o(function(){},"trace"),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(o(function(d,S,f,p,L,r,Z){var m=r.length-1;switch(L){case 5:p.setOrientation(r[m]);break;case 9:p.setDiagramTitle(r[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},r[m]);break;case 13:p.setLineData(r[m-1],r[m]);break;case 14:p.setBarData({text:"",type:"text"},r[m]);break;case 15:p.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:p.setXAxisTitle(r[m]);break;case 25:p.setXAxisTitle(r[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(r[m]);break;case 28:p.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:p.setYAxisTitle(r[m]);break;case 33:p.setYAxisTitle(r[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m]}},"anonymous"),"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,36:a,37:g,38:l}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,36:a,37:g,38:l}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:g,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(x,[2,36]),t(x,[2,37]),t(x,[2,38]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,36:a,37:g,38:l}),{1:[2,3]},t(x,[2,5]),t(i,[2,7],{4:22,36:a,37:g,38:l}),{11:23,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:39,13:38,24:O,29:X,30:u,31:40,32:41,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:45,15:44,29:Y,30:u,35:46,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:49,17:48,24:N,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{11:52,17:51,24:N,30:u,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(U,[2,39],{41:55,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c}),t(U,[2,40]),t(U,[2,41]),t(C,[2,42]),t(C,[2,44]),t(C,[2,45]),t(C,[2,46]),t(C,[2,47]),t(C,[2,48]),t(C,[2,49]),t(C,[2,50]),t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:O,29:X}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:u,34:58,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},t(T,[2,11]),t(T,[2,32],{35:60,29:Y}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:N},{25:63,27:64,29:R},t(T,[2,14]),{17:66,24:N},t(T,[2,16]),t(T,[2,17]),t(C,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(V,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:u,34:74,39:24,40:y,41:27,42:k,43:_,44:A,45:z,46:E,47:M,48:B,49:b,50:P,51:c},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:R},t(V,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(o(function(d,S){if(S.recoverable)this.trace(d);else{var f=new Error(d);throw f.hash=S,f}},"parseError"),"parseError"),parse:n(o(function(d){var S=this,f=[0],p=[],L=[null],r=[],Z=this.table,m="",et=0,Tt=0,Dt=0,si=2,Lt=1,ni=r.slice.call(arguments,1),v=Object.create(this.lexer),q={yy:{}};for(var rt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,rt)&&(q.yy[rt]=this.yy[rt]);v.setInput(d,q.yy),q.yy.lexer=v,q.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var lt=v.yylloc;r.push(lt);var ai=v.options&&v.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oi(F){f.length=f.length-2*F,L.length=L.length-F,r.length=r.length-F}o(oi,"popStack"),n(oi,"popStack");function Pt(){var F=p.pop()||v.lex()||Lt;return typeof F!="number"&&(F instanceof Array&&(p=F,F=p.pop()),F=S.symbols_[F]||F),F}o(Pt,"lex"),n(Pt,"lex");for(var I,ct,G,W,gt,Q={},st,H,vt,nt;;){if(G=f[f.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Pt()),W=Z[G]&&Z[G][I]),typeof W>"u"||!W.length||!W[0]){var ut="";nt=[];for(st in Z[G])this.terminals_[st]&&st>si&&nt.push("'"+this.terminals_[st]+"'");v.showPosition?ut="Parse error on line "+(et+1)+`:
2
2
  `+v.showPosition()+`
3
3
  Expecting `+nt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ut="Parse error on line "+(et+1)+": Unexpected "+(I==Lt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ut,{text:v.match,token:this.terminals_[I]||I,line:v.yylineno,loc:lt,expected:nt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+I);switch(W[0]){case 1:f.push(I),L.push(v.yytext),r.push(v.yylloc),f.push(W[1]),I=null,ct?(I=ct,ct=null):(Tt=v.yyleng,m=v.yytext,et=v.yylineno,lt=v.yylloc,Dt>0&&Dt--);break;case 2:if(H=this.productions_[W[1]][1],Q.$=L[L.length-H],Q._$={first_line:r[r.length-(H||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(H||1)].first_column,last_column:r[r.length-1].last_column},ai&&(Q._$.range=[r[r.length-(H||1)].range[0],r[r.length-1].range[1]]),gt=this.performAction.apply(Q,[m,Tt,et,q.yy,W[1],L,r].concat(ni)),typeof gt<"u")return gt;H&&(f=f.slice(0,-1*H*2),L=L.slice(0,-1*H),r=r.slice(0,-1*H)),f.push(this.productions_[W[1]][0]),L.push(Q.$),r.push(Q._$),vt=Z[f[f.length-2]][f[f.length-1]],f.push(vt);break;case 3:return!0}}return!0},"parse"),"parse")};D.lexer=(function(){return{EOF:1,parseError:n(o(function(d,S){if(this.yy.parser)this.yy.parser.parseError(d,S);else throw new Error(d)},"parseError"),"parseError"),setInput:n(function(h,d){return this.yy=d||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var h=this._input[0];return this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h,h.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n(function(h){var d=h.length,S=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===f.length?this.yylloc.first_column:0)+f[f.length-S.length].length-S[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var h=this.pastInput(),d=new Array(h.length+1).join("-");return h+this.upcomingInput()+`