keating 0.3.6 → 0.3.8

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 (190) hide show
  1. package/dist/src/cli/main.js +3 -0
  2. package/dist/src/core/config.js +4 -1
  3. package/dist/src/core/evolution.js +3 -31
  4. package/dist/src/core/map-elites.js +2 -29
  5. package/dist/src/core/map.js +3 -1
  6. package/dist/src/core/mutation.js +29 -0
  7. package/dist/src/core/policy.js +40 -14
  8. package/dist/src/core/project.js +21 -23
  9. package/dist/src/core/topics.js +6 -1
  10. package/dist/src/pi/hyperteacher-extension.js +1 -1
  11. package/dist/src/runtime/pi.js +6 -1
  12. package/package.json +1 -1
  13. package/web/dist/assets/{anthropic-BT6Vfzb1.js → anthropic-mDOoXVZn.js} +1 -1
  14. package/web/dist/assets/arc-BgYOxBdg.js +1 -0
  15. package/web/dist/assets/architecture-YZFGNWBL-MLoSDt-a.js +1 -0
  16. package/web/dist/assets/architectureDiagram-Q4EWVU46-Yh6i8NsV.js +36 -0
  17. package/web/dist/assets/{azure-openai-responses-CommX3YJ.js → azure-openai-responses-lDjfaDoj.js} +1 -1
  18. package/web/dist/assets/band-mY0qgSES.js +1 -0
  19. package/web/dist/assets/blockDiagram-DXYQGD6D-DUOEnS09.js +132 -0
  20. package/web/dist/assets/{c4Diagram-AHTNJAMY-VFfRZWWA.js → c4Diagram-AHTNJAMY-XzNOUnLt.js} +6 -6
  21. package/web/dist/assets/channel-BumC_1wb.js +1 -0
  22. package/web/dist/assets/{chunk-2KRD3SAO-B-AqvS0u.js → chunk-2KRD3SAO-mLbXjVje.js} +1 -1
  23. package/web/dist/assets/chunk-336JU56O-CQcnUKNW.js +2 -0
  24. package/web/dist/assets/chunk-426QAEUC-AjoT_j_q.js +1 -0
  25. package/web/dist/assets/{chunk-4BX2VUAB-0Z13aFAn.js → chunk-4BX2VUAB-DRZjGMDM.js} +1 -1
  26. package/web/dist/assets/{chunk-4TB4RGXK-DqC0Zwm7.js → chunk-4TB4RGXK-CAwQq2uM.js} +6 -6
  27. package/web/dist/assets/chunk-55IACEB6-C19HKnvd.js +1 -0
  28. package/web/dist/assets/{chunk-5FUZZQ4R-CApli0xX.js → chunk-5FUZZQ4R-Bw3BFJJs.js} +31 -31
  29. package/web/dist/assets/chunk-5PVQY5BW-Ciel-YVc.js +2 -0
  30. package/web/dist/assets/{chunk-67CJDMHE-Cx7uJS4d.js → chunk-67CJDMHE-DNZKE79k.js} +1 -1
  31. package/web/dist/assets/{chunk-7N4EOEYR-CYPNsFus.js → chunk-7N4EOEYR-BGZXIfBD.js} +1 -1
  32. package/web/dist/assets/{chunk-AA7GKIK3-rU0uhR_u.js → chunk-AA7GKIK3-CLWjm_Gk.js} +1 -1
  33. package/web/dist/assets/{chunk-BSJP7CBP-5VmcfR4-.js → chunk-BSJP7CBP-DwT1eVSc.js} +1 -1
  34. package/web/dist/assets/{chunk-CIAEETIT-CHJ-L8H1.js → chunk-CIAEETIT-DaQsGVwH.js} +1 -1
  35. package/web/dist/assets/{chunk-EDXVE4YY-DZHAJjMI.js → chunk-EDXVE4YY-DNeRJTiS.js} +1 -1
  36. package/web/dist/assets/{chunk-ENJZ2VHE-DbUDFa7w.js → chunk-ENJZ2VHE-Crfow0Ab.js} +6 -6
  37. package/web/dist/assets/{chunk-FMBD7UC4-BsYE5e_h.js → chunk-FMBD7UC4-BWSstEYx.js} +1 -1
  38. package/web/dist/assets/{chunk-FOC6F5B3-Cm6aoTv7.js → chunk-FOC6F5B3-BrTsf5ix.js} +1 -1
  39. package/web/dist/assets/{chunk-ICPOFSXX-C5eNZ4L6.js → chunk-ICPOFSXX-C04NFfJk.js} +5 -5
  40. package/web/dist/assets/{chunk-K5T4RW27-R7dAJ4rq.js → chunk-K5T4RW27-C6ErEFB0.js} +1 -1
  41. package/web/dist/assets/{chunk-KGLVRYIC-MO99YZXL.js → chunk-KGLVRYIC-DWgMrjZr.js} +1 -1
  42. package/web/dist/assets/{chunk-LIHQZDEY-DUJ656sT.js → chunk-LIHQZDEY-D3DWGnJT.js} +1 -1
  43. package/web/dist/assets/{chunk-ORNJ4GCN-DXuuEC1n.js → chunk-ORNJ4GCN-D0nhq27e.js} +1 -1
  44. package/web/dist/assets/{chunk-OYMX7WX6-pJlEprWq.js → chunk-OYMX7WX6-CQLx0cU3.js} +5 -5
  45. package/web/dist/assets/chunk-QZHKN3VN-X2zPgEFk.js +1 -0
  46. package/web/dist/assets/{chunk-U2HBQHQK-Mh_l9PLe.js → chunk-U2HBQHQK-FqDOW_Dq.js} +6 -6
  47. package/web/dist/assets/{chunk-X2U36JSP-BOeiJW0w.js → chunk-X2U36JSP-DiSftNGg.js} +1 -1
  48. package/web/dist/assets/{chunk-XPW4576I-fQ9SDvr_.js → chunk-XPW4576I-CTCFDURY.js} +1 -1
  49. package/web/dist/assets/chunk-YZCP3GAM-BhxShnp0.js +1 -0
  50. package/web/dist/assets/chunk-ZZ45TVLE-DMfGJuPz.js +1 -0
  51. package/web/dist/assets/classDiagram-6PBFFD2Q-qESk_xyE.js +1 -0
  52. package/web/dist/assets/classDiagram-v2-HSJHXN6E-BM1nmtfm.js +1 -0
  53. package/web/dist/assets/clone-CVy2b825.js +1 -0
  54. package/web/dist/assets/cose-bilkent-S5V4N54A-BWrDpSLZ.js +1 -0
  55. package/web/dist/assets/custom-tts-DA7XkgNJ.js +1 -0
  56. package/web/dist/assets/dagre-C_Y5Jrtl.js +1 -0
  57. package/web/dist/assets/dagre-KV5264BT-DcrvRRX1.js +4 -0
  58. package/web/dist/assets/diagram-5BDNPKRD-BsChRck6.js +10 -0
  59. package/web/dist/assets/{diagram-G4DWMVQ6-CtICKUFi.js → diagram-G4DWMVQ6-raeAsgoe.js} +12 -12
  60. package/web/dist/assets/diagram-MMDJMWI5-CuKsP84I.js +43 -0
  61. package/web/dist/assets/diagram-TYMM5635-T7ILcS3d.js +24 -0
  62. package/web/dist/assets/dist-DQ41Rxbw.js +1 -0
  63. package/web/dist/assets/dist-oYdMaa1U.js +10 -0
  64. package/web/dist/assets/{erDiagram-SMLLAGMA-uT88sBlT.js → erDiagram-SMLLAGMA-C9z6kYxH.js} +6 -6
  65. package/web/dist/assets/{flatten-C-u5nd5-.js → flatten-n72VCU_F.js} +1 -1
  66. package/web/dist/assets/flowDiagram-DWJPFMVM-BA3HBIvp.js +162 -0
  67. package/web/dist/assets/ganttDiagram-T4ZO3ILL-BXKKRsbk.js +292 -0
  68. package/web/dist/assets/gemini-live-dK40vCc5.js +2 -0
  69. package/web/dist/assets/gitGraph-7Q5UKJZL-Cy0KloCM.js +1 -0
  70. package/web/dist/assets/gitGraphDiagram-UUTBAWPF-CfGAccI8.js +106 -0
  71. package/web/dist/assets/{google-BdYNeCP_.js → google-BdS4iTyC.js} +1 -1
  72. package/web/dist/assets/{google-gemini-cli-DpxAL3K4.js → google-gemini-cli-ECA0sP3z.js} +1 -1
  73. package/web/dist/assets/{google-shared-DyQdgtsI.js → google-shared-DFv4ubOG.js} +1 -1
  74. package/web/dist/assets/{google-vertex-CKRybaXj.js → google-vertex-Duei77qD.js} +1 -1
  75. package/web/dist/assets/graphlib-sK54_wxh.js +1 -0
  76. package/web/dist/assets/index-B_MGHHww.js +3187 -0
  77. package/web/dist/assets/index-C_k9n6xi.css +2 -0
  78. package/web/dist/assets/info-OMHHGYJF-DiTlPM51.js +1 -0
  79. package/web/dist/assets/{infoDiagram-42DDH7IO-BbES7X_c.js → infoDiagram-42DDH7IO-CXoykyfr.js} +1 -1
  80. package/web/dist/assets/init-DugVGdkd.js +1 -0
  81. package/web/dist/assets/{isEmpty-DssUW35f.js → isEmpty-Lz_aOZWI.js} +1 -1
  82. package/web/dist/assets/{ishikawaDiagram-UXIWVN3A-DxQ28rho.js → ishikawaDiagram-UXIWVN3A-BJieXVMt.js} +6 -6
  83. package/web/dist/assets/{journeyDiagram-VCZTEJTY-D0X8qQ0P.js → journeyDiagram-VCZTEJTY-CwCyrnqT.js} +6 -6
  84. package/web/dist/assets/{kanban-definition-6JOO6SKY-DWYfSlpl.js → kanban-definition-6JOO6SKY-8ACmDHsl.js} +1 -1
  85. package/web/dist/assets/line-BqZCcbso.js +1 -0
  86. package/web/dist/assets/linear-CXf5Bx3D.js +1 -0
  87. package/web/dist/assets/math-Csj_9zpx.js +1 -0
  88. package/web/dist/assets/{mermaid-parser.core-Cy4iY_Dy.js → mermaid-parser.core-C8ylgsWV.js} +2 -2
  89. package/web/dist/assets/mermaid.core-BHCT6V24.js +11 -0
  90. package/web/dist/assets/{mindmap-definition-QFDTVHPH-BBnKdtQh.js → mindmap-definition-QFDTVHPH-DrDAZL9Q.js} +1 -1
  91. package/web/dist/assets/{mistral-BWaUMIgd.js → mistral-BCIirCkW.js} +1 -1
  92. package/web/dist/assets/{openai-codex-responses-CHBgKhmb.js → openai-codex-responses-BgRTWVD_.js} +1 -1
  93. package/web/dist/assets/{openai-completions-kcXmmaHI.js → openai-completions-D5AUQEua.js} +1 -1
  94. package/web/dist/assets/openai-realtime-BCZmIToJ.js +1 -0
  95. package/web/dist/assets/{openai-responses-Cqq3H3p3.js → openai-responses-CTlQ1a-G.js} +1 -1
  96. package/web/dist/assets/{openai-responses-shared-CTNuo9ci.js → openai-responses-shared-CLzQyVyy.js} +1 -1
  97. package/web/dist/assets/openai-tts-BRg2goic.js +1 -0
  98. package/web/dist/assets/{ordinal-_K3x1fkz.js → ordinal-CHOvK70a.js} +1 -1
  99. package/web/dist/assets/ort.bundle.min-Drf2fDrC.js +2805 -0
  100. package/web/dist/assets/packet-4T2RLAQJ-EXgAtQjm.js +1 -0
  101. package/web/dist/assets/path-BVVvcbiy.js +1 -0
  102. package/web/dist/assets/pie-ZZUOXDRM-dKU8mzlj.js +1 -0
  103. package/web/dist/assets/pieDiagram-DEJITSTG-CSnulv9o.js +30 -0
  104. package/web/dist/assets/{quadrantDiagram-34T5L4WZ-DfBSEept.js → quadrantDiagram-34T5L4WZ-DiM-1bw4.js} +6 -6
  105. package/web/dist/assets/radar-PYXPWWZC-B4d2wh2H.js +1 -0
  106. package/web/dist/assets/{reduce-836A2NiQ.js → reduce-r7gP4wdg.js} +1 -1
  107. package/web/dist/assets/renderer-BHoCfdWO-BFpsm4dw.js +1 -0
  108. package/web/dist/assets/requirementDiagram-MS252O5E-CunJUnIN.js +84 -0
  109. package/web/dist/assets/{sankeyDiagram-XADWPNL6-He3x9tNT.js → sankeyDiagram-XADWPNL6-DaA_56zq.js} +7 -7
  110. package/web/dist/assets/{sequenceDiagram-FGHM5R23-DfCDpvrT.js → sequenceDiagram-FGHM5R23-CG_SeqVO.js} +13 -13
  111. package/web/dist/assets/speech-ZNExxXBR.js +2 -0
  112. package/web/dist/assets/src-BfaOho0B.js +1 -0
  113. package/web/dist/assets/state-CrA0YVPh-wJ4Rmm6M.js +27 -0
  114. package/web/dist/assets/stateDiagram-FHFEXIEX-CSUigMtP.js +1 -0
  115. package/web/dist/assets/stateDiagram-v2-QKLJ7IA2-CgpYzp7D.js +1 -0
  116. package/web/dist/assets/step-qalMyYGy.js +1 -0
  117. package/web/dist/assets/string-DPssBiak.js +1 -0
  118. package/web/dist/assets/supertonic-hDdNdgtO.js +2 -0
  119. package/web/dist/assets/time-DaCo2z7n.js +1 -0
  120. package/web/dist/assets/{timeline-definition-GMOUNBTQ-BWunHgBC.js → timeline-definition-GMOUNBTQ-DcMiH-gG.js} +7 -7
  121. package/web/dist/assets/transformers.web-R9eWI1xg.js +14 -0
  122. package/web/dist/assets/treeView-SZITEDCU-V29H5f16.js +1 -0
  123. package/web/dist/assets/treemap-W4RFUUIX-DsAU74TP.js +1 -0
  124. package/web/dist/assets/vennDiagram-DHZGUBPP-C6A75Q3q.js +34 -0
  125. package/web/dist/assets/wardley-RL74JXVD-lGAI4Cps.js +1 -0
  126. package/web/dist/assets/{wardleyDiagram-NUSXRM2D-DTcVscPH.js → wardleyDiagram-NUSXRM2D-XmYD0oYm.js} +1 -1
  127. package/web/dist/assets/xychartDiagram-5P7HB3ND-BgSoKcS9.js +7 -0
  128. package/web/dist/index.html +16 -3
  129. package/web/dist/sw.js +647 -1
  130. package/web/dist/workbox-2ae722a1.js +4390 -0
  131. package/web/dist/assets/arc-x2nTilpc.js +0 -1
  132. package/web/dist/assets/architecture-YZFGNWBL-B1hlUWjX.js +0 -1
  133. package/web/dist/assets/architectureDiagram-Q4EWVU46-CMApWFyw.js +0 -36
  134. package/web/dist/assets/blockDiagram-DXYQGD6D-DOQbsNRY.js +0 -132
  135. package/web/dist/assets/channel-KY2Tg8Ba.js +0 -1
  136. package/web/dist/assets/chunk-336JU56O-DlYgPyl6.js +0 -2
  137. package/web/dist/assets/chunk-426QAEUC-CsVoBkfR.js +0 -1
  138. package/web/dist/assets/chunk-55IACEB6-CWE_u-IY.js +0 -1
  139. package/web/dist/assets/chunk-5PVQY5BW-Cbzhfhln.js +0 -2
  140. package/web/dist/assets/chunk-QZHKN3VN-_pQxbbiW.js +0 -1
  141. package/web/dist/assets/chunk-YZCP3GAM-eboO4P5S.js +0 -1
  142. package/web/dist/assets/chunk-ZZ45TVLE-Cky0eqlr.js +0 -1
  143. package/web/dist/assets/classDiagram-6PBFFD2Q-DEPsZSU3.js +0 -1
  144. package/web/dist/assets/classDiagram-v2-HSJHXN6E-DhmIOEpX.js +0 -1
  145. package/web/dist/assets/clone-DeTzYqo8.js +0 -1
  146. package/web/dist/assets/cose-bilkent-S5V4N54A-N4zWUJ7C.js +0 -1
  147. package/web/dist/assets/dagre-IpK1aoMm.js +0 -1
  148. package/web/dist/assets/dagre-KV5264BT-DCytJuju.js +0 -4
  149. package/web/dist/assets/diagram-5BDNPKRD-Cv4miBae.js +0 -10
  150. package/web/dist/assets/diagram-MMDJMWI5-Cn7aGorh.js +0 -43
  151. package/web/dist/assets/diagram-TYMM5635-CCUWDPsC.js +0 -24
  152. package/web/dist/assets/dist-Dm98VvTW.js +0 -1
  153. package/web/dist/assets/flowDiagram-DWJPFMVM-Bl3O7S1m.js +0 -162
  154. package/web/dist/assets/ganttDiagram-T4ZO3ILL-B1FhwV45.js +0 -292
  155. package/web/dist/assets/gitGraph-7Q5UKJZL-Bc_7vzer.js +0 -1
  156. package/web/dist/assets/gitGraphDiagram-UUTBAWPF-DfW6svMS.js +0 -106
  157. package/web/dist/assets/graphlib-CMTVFyOZ.js +0 -1
  158. package/web/dist/assets/index-Bdb7P7gx.css +0 -2
  159. package/web/dist/assets/index-DNxepp8B.js +0 -2891
  160. package/web/dist/assets/info-OMHHGYJF-BGcxeaZt.js +0 -1
  161. package/web/dist/assets/init-DlZdxViB.js +0 -1
  162. package/web/dist/assets/line-CuHce5JG.js +0 -1
  163. package/web/dist/assets/linear-Ca0Vkwuj.js +0 -1
  164. package/web/dist/assets/mermaid.core-6PGkQdYc.js +0 -11
  165. package/web/dist/assets/packet-4T2RLAQJ-D35ZLSBH.js +0 -1
  166. package/web/dist/assets/path-6uRLdFF7.js +0 -1
  167. package/web/dist/assets/pie-ZZUOXDRM-DRoETpJX.js +0 -1
  168. package/web/dist/assets/pieDiagram-DEJITSTG-DfMjfTQz.js +0 -30
  169. package/web/dist/assets/radar-PYXPWWZC-DLKxRJ0V.js +0 -1
  170. package/web/dist/assets/requirementDiagram-MS252O5E-BPkxJQkz.js +0 -84
  171. package/web/dist/assets/src-DdOdIreR.js +0 -1
  172. package/web/dist/assets/stateDiagram-FHFEXIEX-fuww6347.js +0 -1
  173. package/web/dist/assets/stateDiagram-v2-QKLJ7IA2-U6voafO3.js +0 -1
  174. package/web/dist/assets/transformers.web-DKUtmSAi.js +0 -2818
  175. package/web/dist/assets/treeView-SZITEDCU-BCx0xSAm.js +0 -1
  176. package/web/dist/assets/treemap-W4RFUUIX-2CvghWJK.js +0 -1
  177. package/web/dist/assets/vennDiagram-DHZGUBPP-CBXRutSP.js +0 -34
  178. package/web/dist/assets/wardley-RL74JXVD-BkPL_mhd.js +0 -1
  179. package/web/dist/assets/xychartDiagram-5P7HB3ND-CZLgX9Fe.js +0 -7
  180. package/web/dist/workbox-66610c77.js +0 -1
  181. /package/web/dist/assets/{_baseFor-B_cjfMB6.js → _baseFor-2QgQJAzW.js} +0 -0
  182. /package/web/dist/assets/{array-B9UHiPd-.js → array-B4O_ir3H.js} +0 -0
  183. /package/web/dist/assets/{cytoscape.esm-BBMd0vGm.js → cytoscape.esm-CdzdaUMP.js} +0 -0
  184. /package/web/dist/assets/{defaultLocale-5eAKkKJC.js → defaultLocale-Bhb3osZR.js} +0 -0
  185. /package/web/dist/assets/{github-copilot-headers-L39QqneT.js → github-copilot-headers-BuUn5v2j.js} +0 -0
  186. /package/web/dist/assets/{hash-kZ2KD_no.js → hash-CQjDwcjR.js} +0 -0
  187. /package/web/dist/assets/{openai-D4NSaQIs.js → openai-CRGaNv9i.js} +0 -0
  188. /package/web/dist/assets/{rough.esm-Djo4Abte.js → rough.esm-D5NinLFK.js} +0 -0
  189. /package/web/dist/assets/{transform-messages-CqKEdRVp.js → transform-messages-DXDWLrnO.js} +0 -0
  190. /package/web/dist/assets/{web-CMKYLKbT.js → web-jLdm8a1-.js} +0 -0
@@ -0,0 +1,292 @@
1
+ import{s as e,t}from"./chunk-Bj-mKKzh.js";import{h as n}from"./chunk-5PVQY5BW-Ciel-YVc.js";import{t as r}from"./linear-CXf5Bx3D.js";import{D as i,O as a,S as o,T as s,b as c,c as l,d as u,f as d,g as f,h as p,m,n as h,p as g,r as _,u as v,v as y,w as b}from"./time-DaCo2z7n.js";import{a as x,c as S,d as C,f as w,i as T,s as E,u as D}from"./string-DPssBiak.js";import{i as O,o as k,r as A,t as j}from"./src-BfaOho0B.js";import{B as M,C as ee,V as N,W as te,_ as ne,a as re,b as P,c as ie,s as ae,v as oe}from"./chunk-ICPOFSXX-C04NFfJk.js";import{t as se}from"./dist-DQ41Rxbw.js";var ce=Math.PI/180,le=180/Math.PI,F=18,ue=.96422,de=1,fe=.82521,pe=4/29,I=6/29,me=3*I*I,he=I*I*I;function ge(e){if(e instanceof L)return new L(e.l,e.a,e.b,e.opacity);if(e instanceof R)return we(e);e instanceof S||(e=D(e));var t=xe(e.r),n=xe(e.g),r=xe(e.b),i=ve((.2225045*t+.7168786*n+.0606169*r)/de),a,o;return t===n&&n===r?a=o=i:(a=ve((.4360747*t+.3850649*n+.1430804*r)/ue),o=ve((.0139322*t+.0971045*n+.7141733*r)/fe)),new L(116*i-16,500*(a-i),200*(i-o),e.opacity)}function _e(e,t,n,r){return arguments.length===1?ge(e):new L(e,t,n,r??1)}function L(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}C(L,_e,w(E,{brighter(e){return new L(this.l+F*(e??1),this.a,this.b,this.opacity)},darker(e){return new L(this.l-F*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=ue*ye(t),e=de*ye(e),n=fe*ye(n),new S(be(3.1338561*t-1.6168667*e-.4906146*n),be(-.9787684*t+1.9161415*e+.033454*n),be(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function ve(e){return e>he?e**(1/3):e/me+pe}function ye(e){return e>I?e*e*e:me*(e-pe)}function be(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function xe(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Se(e){if(e instanceof R)return new R(e.h,e.c,e.l,e.opacity);if(e instanceof L||(e=ge(e)),e.a===0&&e.b===0)return new R(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*le;return new R(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Ce(e,t,n,r){return arguments.length===1?Se(e):new R(e,t,n,r??1)}function R(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function we(e){if(isNaN(e.h))return new L(e.l,0,0,e.opacity);var t=e.h*ce;return new L(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}C(R,Ce,w(E,{brighter(e){return new R(this.h,this.c,this.l+F*(e??1),this.opacity)},darker(e){return new R(this.h,this.c,this.l-F*(e??1),this.opacity)},rgb(){return we(this).rgb()}}));function Te(e){return function(t,n){var r=e((t=Ce(t)).h,(n=Ce(n)).h),i=x(t.c,n.c),a=x(t.l,n.l),o=x(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var Ee=Te(T);function De(e){return e}var z=1,Oe=2,ke=3,B=4,Ae=1e-6;function je(e){return`translate(`+e+`,0)`}function Me(e){return`translate(0,`+e+`)`}function Ne(e){return t=>+e(t)}function Pe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Fe(){return!this.__axis}function Ie(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===z||e===B?-1:1,u=e===B||e===Oe?`x`:`y`,d=e===z||e===ke?je:Me;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):De),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?Pe:Ne)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===z?`0em`:e===ke?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,Ae).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,Ae).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===B||e===Oe?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(Fe).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===Oe?`start`:e===B?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function Le(e){return Ie(z,e)}function Re(e){return Ie(ke,e)}var ze=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){var e=`day`;return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s,c=i(this),l=(n=this.isoWeekYear(),a=this.$u,o=(a?r.utc:r)().year(n).startOf(`year`),s=4-o.isoWeekday(),o.isoWeekday()>4&&(s+=7),o.add(s,e));return c.diff(l,`week`)+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):o.bind(this)(e,t)}}}))})),Be=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Ve=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),He=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,c=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s,months:c,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(l);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/s),e%=s,this.$d.months=h(e/c),e%=c,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(o,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),Ue=se(),V=e(k(),1),We=e(ze(),1),Ge=e(Be(),1),Ke=e(Ve(),1),qe=e(He(),1),Je=(function(){var e=A(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],c=[1,32],l=[1,33],u=[1,34],d=[1,9],f=[1,10],p=[1,11],m=[1,12],h=[1,13],g=[1,14],_=[1,15],v=[1,16],y=[1,19],b=[1,20],x=[1,21],S=[1,22],C=[1,23],w=[1,25],T=[1,35],E={trace:A(function(){},`trace`),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:`error`,4:`gantt`,6:`EOF`,8:`SPACE`,10:`NL`,12:`weekday_monday`,13:`weekday_tuesday`,14:`weekday_wednesday`,15:`weekday_thursday`,16:`weekday_friday`,17:`weekday_saturday`,18:`weekday_sunday`,20:`weekend_friday`,21:`weekend_saturday`,22:`dateFormat`,23:`inclusiveEndDates`,24:`topAxis`,25:`axisFormat`,26:`tickInterval`,27:`excludes`,28:`includes`,29:`todayMarker`,30:`title`,31:`acc_title`,32:`acc_title_value`,33:`acc_descr`,34:`acc_descr_value`,35:`acc_descr_multiline_value`,36:`section`,38:`taskTxt`,39:`taskData`,40:`click`,41:`callbackname`,42:`callbackargs`,43:`href`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:A(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday(`monday`);break;case 9:r.setWeekday(`tuesday`);break;case 10:r.setWeekday(`wednesday`);break;case 11:r.setWeekday(`thursday`);break;case 12:r.setWeekday(`friday`);break;case 13:r.setWeekday(`saturday`);break;case 14:r.setWeekday(`sunday`);break;case 15:r.setWeekend(`friday`);break;case 16:r.setWeekend(`saturday`);break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$=`task`;break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+` `+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+` `+a[s-1]+` `+a[s];break;case 44:case 46:this.$=a[s-3]+` `+a[s-2]+` `+a[s-1]+` `+a[s];break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:C,37:24,38:w,40:T},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:C,37:24,38:w,40:T},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:A(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:A(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var v=m.options&&m.options.ranges;typeof h.yy.parseError==`function`?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function y(e){n.length-=2*e,i.length-=e,a.length-=e}A(y,`popStack`);function b(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}A(b,`lex`);for(var x,S,C,w,T,E={},D,O,k,j;;){if(C=n[n.length-1],this.defaultActions[C]?w=this.defaultActions[C]:(x??=b(),w=o[C]&&o[C][x]),w===void 0||!w.length||!w[0]){var M=``;for(D in j=[],o[C])this.terminals_[D]&&D>d&&j.push(`'`+this.terminals_[D]+`'`);M=m.showPosition?`Parse error on line `+(c+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[x]||x)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(x==f?`end of input`:`'`+(this.terminals_[x]||x)+`'`),this.parseError(M,{text:m.match,token:this.terminals_[x]||x,line:m.yylineno,loc:_,expected:j})}if(w[0]instanceof Array&&w.length>1)throw Error(`Parse Error: multiple actions possible at state: `+C+`, token: `+x);switch(w[0]){case 1:n.push(x),i.push(m.yytext),a.push(m.yylloc),n.push(w[1]),x=null,S?(x=S,S=null):(l=m.yyleng,s=m.yytext,c=m.yylineno,_=m.yylloc,u>0&&u--);break;case 2:if(O=this.productions_[w[1]][1],E.$=i[i.length-O],E._$={first_line:a[a.length-(O||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(O||1)].first_column,last_column:a[a.length-1].last_column},v&&(E._$.range=[a[a.length-(O||1)].range[0],a[a.length-1].range[1]]),T=this.performAction.apply(E,[s,l,c,h.yy,w[1],i,a].concat(p)),T!==void 0)return T;O&&(n=n.slice(0,-1*O*2),i=i.slice(0,-1*O),a=a.slice(0,-1*O)),n.push(this.productions_[w[1]][0]),i.push(E.$),a.push(E._$),k=o[n[n.length-2]][n[n.length-1]],n.push(k);break;case 3:return!0}}return!0},`parse`)};E.lexer=(function(){return{EOF:1,parseError:A(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:A(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:A(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:A(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:A(function(){return this._more=!0,this},`more`),reject:A(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
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:A(function(e){this.unput(this.match.slice(e))},`less`),pastInput:A(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:A(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:A(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:A(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:A(function(){return this.next()||this.lex()},`lex`),begin:A(function(e){this.conditionStack.push(e)},`begin`),popState:A(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:A(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:A(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:A(function(e){this.begin(e)},`pushState`),stateStackSize:A(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:A(function(e,t,n,r){switch(n){case 0:return this.begin(`open_directive`),`open_directive`;case 1:return this.begin(`acc_title`),31;case 2:return this.popState(),`acc_title_value`;case 3:return this.begin(`acc_descr`),33;case 4:return this.popState(),`acc_descr_value`;case 5:this.begin(`acc_descr_multiline`);break;case 6:this.popState();break;case 7:return`acc_descr_multiline_value`;case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin(`href`);break;case 15:this.popState();break;case 16:return 43;case 17:this.begin(`callbackname`);break;case 18:this.popState();break;case 19:this.popState(),this.begin(`callbackargs`);break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin(`click`);break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return`date`;case 45:return 30;case 46:return`accDescription`;case 47:return 36;case 48:return 38;case 49:return 39;case 50:return`:`;case 51:return 6;case 52:return`INVALID`}},`anonymous`),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:!0}}}})();function D(){this.yy={}}return A(D,`Parser`),D.prototype=E,E.Parser=D,new D})();Je.parser=Je;var Ye=Je;V.default.extend(We.default),V.default.extend(Ge.default),V.default.extend(Ke.default);var Xe={friday:5,saturday:6},H=``,Ze=``,Qe=void 0,$e=``,U=[],W=[],et=new Map,tt=[],G=[],K=``,nt=``,rt=[`active`,`done`,`crit`,`milestone`,`vert`],it=[],q=``,J=!1,at=!1,ot=`sunday`,Y=`saturday`,st=0,ct=A(function(){tt=[],G=[],K=``,it=[],Vt=0,Wt=void 0,Gt=void 0,Z=[],H=``,Ze=``,nt=``,Qe=void 0,$e=``,U=[],W=[],J=!1,at=!1,st=0,et=new Map,q=``,re(),ot=`sunday`,Y=`saturday`},`clear`),lt=A(function(e){q=e},`setDiagramId`),ut=A(function(e){Ze=e},`setAxisFormat`),dt=A(function(){return Ze},`getAxisFormat`),ft=A(function(e){Qe=e},`setTickInterval`),pt=A(function(){return Qe},`getTickInterval`),mt=A(function(e){$e=e},`setTodayMarker`),ht=A(function(){return $e},`getTodayMarker`),gt=A(function(e){H=e},`setDateFormat`),_t=A(function(){J=!0},`enableInclusiveEndDates`),vt=A(function(){return J},`endDatesAreInclusive`),yt=A(function(){at=!0},`enableTopAxis`),bt=A(function(){return at},`topAxisEnabled`),xt=A(function(e){nt=e},`setDisplayMode`),St=A(function(){return nt},`getDisplayMode`),Ct=A(function(){return H},`getDateFormat`),wt=A(function(e){U=e.toLowerCase().split(/[\s,]+/)},`setIncludes`),Tt=A(function(){return U},`getIncludes`),Et=A(function(e){W=e.toLowerCase().split(/[\s,]+/)},`setExcludes`),Dt=A(function(){return W},`getExcludes`),Ot=A(function(){return et},`getLinks`),kt=A(function(e){K=e,tt.push(e)},`addSection`),At=A(function(){return tt},`getSections`),jt=A(function(){let e=Yt(),t=0;for(;!e&&t<10;)e=Yt(),t++;return G=Z,G},`getTasks`),Mt=A(function(e,t,n,r){let i=e.format(t.trim()),a=e.format(`YYYY-MM-DD`);return r.includes(i)||r.includes(a)?!1:n.includes(`weekends`)&&(e.isoWeekday()===Xe[Y]||e.isoWeekday()===Xe[Y]+1)||n.includes(e.format(`dddd`).toLowerCase())?!0:n.includes(i)||n.includes(a)},`isInvalidDate`),Nt=A(function(e){ot=e},`setWeekday`),Pt=A(function(){return ot},`getWeekday`),Ft=A(function(e){Y=e},`setWeekend`),It=A(function(e,t,n,r){if(!n.length||e.manualEndTime)return;let i;i=e.startTime instanceof Date?(0,V.default)(e.startTime):(0,V.default)(e.startTime,t,!0),i=i.add(1,`d`);let a;a=e.endTime instanceof Date?(0,V.default)(e.endTime):(0,V.default)(e.endTime,t,!0);let[o,s]=Lt(i,a,t,n,r);e.endTime=o.toDate(),e.renderEndTime=s},`checkTaskDates`),Lt=A(function(e,t,n,r,i){let a=!1,o=null;for(;e<=t;)a||(o=t.toDate()),a=Mt(e,n,r,i),a&&(t=t.add(1,`d`)),e=e.add(1,`d`);return[t,o]},`fixTaskDates`),Rt=A(function(e,t,n){if(n=n.trim(),A(e=>{let t=e.trim();return t===`x`||t===`X`},`isTimestampFormat`)(t)&&/^\d+$/.test(n))return new Date(Number(n));let r=/^after\s+(?<ids>[\d\w- ]+)/.exec(n);if(r!==null){let e=null;for(let t of r.groups.ids.split(` `)){let n=Q(t);n!==void 0&&(!e||n.endTime>e.endTime)&&(e=n)}if(e)return e.endTime;let t=new Date;return t.setHours(0,0,0,0),t}let i=(0,V.default)(n,t.trim(),!0);if(i.isValid())return i.toDate();{O.debug(`Invalid date:`+n),O.debug(`With date format:`+t.trim());let e=new Date(n);if(e===void 0||isNaN(e.getTime())||e.getFullYear()<-1e4||e.getFullYear()>1e4)throw Error(`Invalid date:`+n);return e}},`getStartDate`),zt=A(function(e){let t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());return t===null?[NaN,`ms`]:[Number.parseFloat(t[1]),t[2]]},`parseDuration`),Bt=A(function(e,t,n,r=!1){n=n.trim();let i=/^until\s+(?<ids>[\d\w- ]+)/.exec(n);if(i!==null){let e=null;for(let t of i.groups.ids.split(` `)){let n=Q(t);n!==void 0&&(!e||n.startTime<e.startTime)&&(e=n)}if(e)return e.startTime;let t=new Date;return t.setHours(0,0,0,0),t}let a=(0,V.default)(n,t.trim(),!0);if(a.isValid())return r&&(a=a.add(1,`d`)),a.toDate();let o=(0,V.default)(e),[s,c]=zt(n);if(!Number.isNaN(s)){let e=o.add(s,c);e.isValid()&&(o=e)}return o.toDate()},`getEndDate`),Vt=0,X=A(function(e){return e===void 0?(Vt+=1,`task`+Vt):e},`parseId`),Ht=A(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};tn(r,i,rt);for(let e=0;e<r.length;e++)r[e]=r[e].trim();let a=``;switch(r.length){case 1:i.id=X(),i.startTime=e.endTime,a=r[0];break;case 2:i.id=X(),i.startTime=Rt(void 0,H,r[0]),a=r[1];break;case 3:i.id=X(r[0]),i.startTime=Rt(void 0,H,r[1]),a=r[2];break;default:}return a&&(i.endTime=Bt(i.startTime,H,a,J),i.manualEndTime=(0,V.default)(a,`YYYY-MM-DD`,!0).isValid(),It(i,H,W,U)),i},`compileData`),Ut=A(function(e,t){let n;n=t.substr(0,1)===`:`?t.substr(1,t.length):t;let r=n.split(`,`),i={};tn(r,i,rt);for(let e=0;e<r.length;e++)r[e]=r[e].trim();switch(r.length){case 1:i.id=X(),i.startTime={type:`prevTaskEnd`,id:e},i.endTime={data:r[0]};break;case 2:i.id=X(),i.startTime={type:`getStartDate`,startData:r[0]},i.endTime={data:r[1]};break;case 3:i.id=X(r[0]),i.startTime={type:`getStartDate`,startData:r[1]},i.endTime={data:r[2]};break;default:}return i},`parseData`),Wt,Gt,Z=[],Kt={},qt=A(function(e,t){let n={section:K,type:K,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:t},task:e,classes:[]},r=Ut(Gt,t);n.raw.startTime=r.startTime,n.raw.endTime=r.endTime,n.id=r.id,n.prevTaskId=Gt,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,n.order=st,st++;let i=Z.push(n);Gt=n.id,Kt[n.id]=i-1},`addTask`),Q=A(function(e){let t=Kt[e];return Z[t]},`findTaskById`),Jt=A(function(e,t){let n={section:K,type:K,description:e,task:e,classes:[]},r=Ht(Wt,t);n.startTime=r.startTime,n.endTime=r.endTime,n.id=r.id,n.active=r.active,n.done=r.done,n.crit=r.crit,n.milestone=r.milestone,n.vert=r.vert,Wt=n,G.push(n)},`addTaskOrg`),Yt=A(function(){let e=A(function(e){let t=Z[e],n=``;switch(Z[e].raw.startTime.type){case`prevTaskEnd`:t.startTime=Q(t.prevTaskId).endTime;break;case`getStartDate`:n=Rt(void 0,H,Z[e].raw.startTime.startData),n&&(Z[e].startTime=n);break}return Z[e].startTime&&(Z[e].endTime=Bt(Z[e].startTime,H,Z[e].raw.endTime.data,J),Z[e].endTime&&(Z[e].processed=!0,Z[e].manualEndTime=(0,V.default)(Z[e].raw.endTime.data,`YYYY-MM-DD`,!0).isValid(),It(Z[e],H,W,U))),Z[e].processed},`compileTask`),t=!0;for(let[n,r]of Z.entries())e(n),t&&=r.processed;return t},`compileTasks`),Xt=A(function(e,t){let n=t;P().securityLevel!==`loose`&&(n=(0,Ue.sanitizeUrl)(t)),e.split(`,`).forEach(function(e){Q(e)!==void 0&&($t(e,()=>{window.open(n,`_self`)}),et.set(e,n))}),Zt(e,`clickable`)},`setLink`),Zt=A(function(e,t){e.split(`,`).forEach(function(e){let n=Q(e);n!==void 0&&n.classes.push(t)})},`setClass`),Qt=A(function(e,t,r){if(P().securityLevel!==`loose`||t===void 0)return;let i=[];if(typeof r==`string`){i=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e<i.length;e++){let t=i[e].trim();t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.substr(1,t.length-2)),i[e]=t}}i.length===0&&i.push(e),Q(e)!==void 0&&$t(e,()=>{n.runFunc(t,...i)})},`setClickFun`),$t=A(function(e,t){it.push(function(){let n=q?`${q}-${e}`:e,r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,function(){t()})},function(){let n=q?`${q}-${e}`:e,r=document.querySelector(`[id="${n}-text"]`);r!==null&&r.addEventListener(`click`,function(){t()})})},`pushFun`),en={getConfig:A(()=>P().gantt,`getConfig`),clear:ct,setDateFormat:gt,getDateFormat:Ct,enableInclusiveEndDates:_t,endDatesAreInclusive:vt,enableTopAxis:yt,topAxisEnabled:bt,setAxisFormat:ut,getAxisFormat:dt,setTickInterval:ft,getTickInterval:pt,setTodayMarker:mt,getTodayMarker:ht,setAccTitle:N,getAccTitle:oe,setDiagramTitle:te,getDiagramTitle:ee,setDiagramId:lt,setDisplayMode:xt,getDisplayMode:St,setAccDescription:M,getAccDescription:ne,addSection:kt,getSections:At,getTasks:jt,addTask:qt,findTaskById:Q,addTaskOrg:Jt,setIncludes:wt,getIncludes:Tt,setExcludes:Et,getExcludes:Dt,setClickEvent:A(function(e,t,n){e.split(`,`).forEach(function(e){Qt(e,t,n)}),Zt(e,`clickable`)},`setClickEvent`),setLink:Xt,getLinks:Ot,bindFunctions:A(function(e){it.forEach(function(t){t(e)})},`bindFunctions`),parseDuration:zt,isInvalidDate:Mt,setWeekday:Nt,getWeekday:Pt,setWeekend:Ft};function tn(e,t,n){let r=!0;for(;r;)r=!1,n.forEach(function(n){let i=`^\\s*`+n+`\\s*$`,a=new RegExp(i);e[0].match(a)&&(t[n]=!0,e.shift(1),r=!0)})}A(tn,`getTaskTags`),V.default.extend(qe.default);var nn=A(function(){O.debug(`Something is calling, setConf, remove the call`)},`setConf`),rn={monday:u,tuesday:p,wednesday:f,thursday:m,friday:v,saturday:d,sunday:g},an=A((e,t)=>{let n=[...e].map(()=>-1/0),r=[...e].sort((e,t)=>e.startTime-t.startTime||e.order-t.order),i=0;for(let e of r)for(let r=0;r<n.length;r++)if(e.startTime>=n[r]){n[r]=e.endTime,e.order=r+t,r>i&&(i=r);break}return i},`getMaxIntersections`),$,on=1e4,sn={parser:Ye,db:en,renderer:{setConf:nn,draw:A(function(e,t,n,u){let d=P().gantt;u.db.setDiagramId(t);let f=P().securityLevel,p;f===`sandbox`&&(p=j(`#i`+t));let m=j(f===`sandbox`?p.nodes()[0].contentDocument.body:`body`),g=f===`sandbox`?p.nodes()[0].contentDocument:document,v=g.getElementById(t);$=v.parentElement.offsetWidth,$===void 0&&($=1200),d.useWidth!==void 0&&($=d.useWidth);let x=u.db.getTasks(),S=[];for(let e of x)S.push(e.type);S=oe(S);let C={},w=2*d.topPadding;if(u.db.getDisplayMode()===`compact`||d.displayMode===`compact`){let e={};for(let t of x)e[t.section]===void 0?e[t.section]=[t]:e[t.section].push(t);let t=0;for(let n of Object.keys(e)){let r=an(e[n],t)+1;t+=r,w+=r*(d.barHeight+d.barGap),C[n]=r}}else{w+=x.length*(d.barHeight+d.barGap);for(let e of S)C[e]=x.filter(t=>t.type===e).length}v.setAttribute(`viewBox`,`0 0 `+$+` `+w);let T=m.select(`[id="${t}"]`),E=h().domain([i(x,function(e){return e.startTime}),a(x,function(e){return e.endTime})]).rangeRound([0,$-d.leftPadding-d.rightPadding]);function D(e,t){let n=e.startTime,r=t.startTime,i=0;return n>r?i=1:n<r&&(i=-1),i}A(D,`taskCompare`),x.sort(D),k(x,$,w),ie(T,w,$,d.useMaxWidth),T.append(`text`).text(u.db.getDiagramTitle()).attr(`x`,$/2).attr(`y`,d.titleTopMargin).attr(`class`,`titleText`);function k(e,t,n){let i=d.barHeight,a=i+d.barGap,o=d.topPadding,s=d.leftPadding,c=r().domain([0,S.length]).range([`#00B9FA`,`#F95002`]).interpolate(Ee);ee(a,o,s,t,n,e,u.db.getExcludes(),u.db.getIncludes()),te(s,o,t,n),M(e,a,o,s,i,c,t,n),ne(a,o,s,i,c),re(s,o,t,n)}A(k,`makeGantt`);function M(e,n,r,i,a,o,s){e.sort((e,t)=>e.vert===t.vert?0:e.vert?1:-1);let c=[...new Set(e.map(e=>e.order))].map(t=>e.find(e=>e.order===t));T.append(`g`).selectAll(`rect`).data(c).enter().append(`rect`).attr(`x`,0).attr(`y`,function(e,t){return t=e.order,t*n+r-2}).attr(`width`,function(){return s-d.rightPadding/2}).attr(`height`,n).attr(`class`,function(e){for(let[t,n]of S.entries())if(e.type===n)return`section section`+t%d.numberSectionStyles;return`section section0`}).enter();let l=T.append(`g`).selectAll(`rect`).data(e).enter(),f=u.db.getLinks();if(l.append(`rect`).attr(`id`,function(e){return t+`-`+e.id}).attr(`rx`,3).attr(`ry`,3).attr(`x`,function(e){return e.milestone?E(e.startTime)+i+.5*(E(e.endTime)-E(e.startTime))-.5*a:E(e.startTime)+i}).attr(`y`,function(e,t){return t=e.order,e.vert?d.gridLineStartPadding:t*n+r}).attr(`width`,function(e){return e.milestone?a:e.vert?.08*a:E(e.renderEndTime||e.endTime)-E(e.startTime)}).attr(`height`,function(e){return e.vert?x.length*(d.barHeight+d.barGap)+d.barHeight*2:a}).attr(`transform-origin`,function(e,t){return t=e.order,(E(e.startTime)+i+.5*(E(e.endTime)-E(e.startTime))).toString()+`px `+(t*n+r+.5*a).toString()+`px`}).attr(`class`,function(e){let t=``;e.classes.length>0&&(t=e.classes.join(` `));let n=0;for(let[t,r]of S.entries())e.type===r&&(n=t%d.numberSectionStyles);let r=``;return e.active?e.crit?r+=` activeCrit`:r=` active`:e.done?r=e.crit?` doneCrit`:` done`:e.crit&&(r+=` crit`),r.length===0&&(r=` task`),e.milestone&&(r=` milestone `+r),e.vert&&(r=` vert `+r),r+=n,r+=` `+t,`task`+r}),l.append(`text`).attr(`id`,function(e){return t+`-`+e.id+`-text`}).text(function(e){return e.task}).attr(`font-size`,d.fontSize).attr(`x`,function(e){let t=E(e.startTime),n=E(e.renderEndTime||e.endTime);if(e.milestone&&(t+=.5*(E(e.endTime)-E(e.startTime))-.5*a,n=t+a),e.vert)return E(e.startTime)+i;let r=this.getBBox().width;return r>n-t?n+r+1.5*d.leftPadding>s?t+i-5:n+i+5:(n-t)/2+t+i}).attr(`y`,function(e,t){return e.vert?d.gridLineStartPadding+x.length*(d.barHeight+d.barGap)+60:(t=e.order,t*n+d.barHeight/2+(d.fontSize/2-2)+r)}).attr(`text-height`,a).attr(`class`,function(e){let t=E(e.startTime),n=E(e.endTime);e.milestone&&(n=t+a);let r=this.getBBox().width,i=``;e.classes.length>0&&(i=e.classes.join(` `));let o=0;for(let[t,n]of S.entries())e.type===n&&(o=t%d.numberSectionStyles);let c=``;return e.active&&(c=e.crit?`activeCritText`+o:`activeText`+o),e.done?c=e.crit?c+` doneCritText`+o:c+` doneText`+o:e.crit&&(c=c+` critText`+o),e.milestone&&(c+=` milestoneText`),e.vert&&(c+=` vertText`),r>n-t?n+r+1.5*d.leftPadding>s?i+` taskTextOutsideLeft taskTextOutside`+o+` `+c:i+` taskTextOutsideRight taskTextOutside`+o+` `+c+` width-`+r:i+` taskText taskText`+o+` `+c+` width-`+r}),P().securityLevel===`sandbox`){let e;e=j(`#i`+t);let n=e.nodes()[0].contentDocument;l.filter(function(e){return f.has(e.id)}).each(function(e){var r=n.querySelector(`#`+CSS.escape(t+`-`+e.id)),i=n.querySelector(`#`+CSS.escape(t+`-`+e.id+`-text`));let a=r.parentNode;var o=n.createElement(`a`);o.setAttribute(`xlink:href`,f.get(e.id)),o.setAttribute(`target`,`_top`),a.appendChild(o),o.appendChild(r),o.appendChild(i)})}}A(M,`drawRects`);function ee(e,n,r,i,a,o,s,c){if(s.length===0&&c.length===0)return;let l,f;for(let{startTime:e,endTime:t}of o)(l===void 0||e<l)&&(l=e),(f===void 0||t>f)&&(f=t);if(!l||!f)return;if((0,V.default)(f).diff((0,V.default)(l),`year`)>5){O.warn(`The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.`);return}let p=u.db.getDateFormat(),m=[],h=null,g=(0,V.default)(l);for(;g.valueOf()<=f;)u.db.isInvalidDate(g,p,s,c)?h?h.end=g:h={start:g,end:g}:h&&=(m.push(h),null),g=g.add(1,`d`);T.append(`g`).selectAll(`rect`).data(m).enter().append(`rect`).attr(`id`,e=>t+`-exclude-`+e.start.format(`YYYY-MM-DD`)).attr(`x`,e=>E(e.start.startOf(`day`))+r).attr(`y`,d.gridLineStartPadding).attr(`width`,e=>E(e.end.endOf(`day`))-E(e.start.startOf(`day`))).attr(`height`,a-n-d.gridLineStartPadding).attr(`transform-origin`,function(t,n){return(E(t.start)+r+.5*(E(t.end)-E(t.start))).toString()+`px `+(n*e+.5*a).toString()+`px`}).attr(`class`,`exclude-range`)}A(ee,`drawExcludeDays`);function N(e,t,n,r){if(n<=0||e>t)return 1/0;let i=t-e,a=V.default.duration({[r??`day`]:n}).asMilliseconds();return a<=0?1/0:Math.ceil(i/a)}A(N,`getEstimatedTickCount`);function te(e,t,n,r){let i=u.db.getDateFormat(),a=u.db.getAxisFormat(),f;f=a||(i===`D`?`%d`:d.axisFormat??`%Y-%m-%d`);let p=Re(E).tickSize(-r+t+d.gridLineStartPadding).tickFormat(_(f)),m=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(u.db.getTickInterval()||d.tickInterval);if(m!==null){let e=parseInt(m[1],10);if(isNaN(e)||e<=0)O.warn(`Invalid tick interval value: "${m[1]}". Skipping custom tick interval.`);else{let t=m[2],n=u.db.getWeekday()||d.weekday,r=E.domain(),i=r[0],a=r[1],f=N(i,a,e,t);if(f>on)O.warn(`The tick interval "${e}${t}" would generate ${f} ticks, which exceeds the maximum allowed (${on}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(t){case`millisecond`:p.ticks(s.every(e));break;case`second`:p.ticks(b.every(e));break;case`minute`:p.ticks(o.every(e));break;case`hour`:p.ticks(c.every(e));break;case`day`:p.ticks(y.every(e));break;case`week`:p.ticks(rn[n].every(e));break;case`month`:p.ticks(l.every(e));break}}}if(T.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+(r-50)+`)`).call(p).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10).attr(`dy`,`1em`),u.db.topAxisEnabled()||d.topAxis){let n=Le(E).tickSize(-r+t+d.gridLineStartPadding).tickFormat(_(f));if(m!==null){let e=parseInt(m[1],10);if(isNaN(e)||e<=0)O.warn(`Invalid tick interval value: "${m[1]}". Skipping custom tick interval.`);else{let t=m[2],r=u.db.getWeekday()||d.weekday,i=E.domain(),a=i[0],f=i[1];if(N(a,f,e,t)<=on)switch(t){case`millisecond`:n.ticks(s.every(e));break;case`second`:n.ticks(b.every(e));break;case`minute`:n.ticks(o.every(e));break;case`hour`:n.ticks(c.every(e));break;case`day`:n.ticks(y.every(e));break;case`week`:n.ticks(rn[r].every(e));break;case`month`:n.ticks(l.every(e));break}}}T.append(`g`).attr(`class`,`grid`).attr(`transform`,`translate(`+e+`, `+t+`)`).call(n).selectAll(`text`).style(`text-anchor`,`middle`).attr(`fill`,`#000`).attr(`stroke`,`none`).attr(`font-size`,10)}}A(te,`makeGrid`);function ne(e,t){let n=0,r=Object.keys(C).map(e=>[e,C[e]]);T.append(`g`).selectAll(`text`).data(r).enter().append(function(e){let t=e[0].split(ae.lineBreakRegex),n=-(t.length-1)/2,r=g.createElementNS(`http://www.w3.org/2000/svg`,`text`);r.setAttribute(`dy`,n+`em`);for(let[e,n]of t.entries()){let t=g.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);t.setAttribute(`alignment-baseline`,`central`),t.setAttribute(`x`,`10`),e>0&&t.setAttribute(`dy`,`1em`),t.textContent=n,r.appendChild(t)}return r}).attr(`x`,10).attr(`y`,function(i,a){if(a>0)for(let o=0;o<a;o++)return n+=r[a-1][1],i[1]*e/2+n*e+t;else return i[1]*e/2+t}).attr(`font-size`,d.sectionFontSize).attr(`class`,function(e){for(let[t,n]of S.entries())if(e[0]===n)return`sectionTitle sectionTitle`+t%d.numberSectionStyles;return`sectionTitle`})}A(ne,`vertLabels`);function re(e,t,n,r){let i=u.db.getTodayMarker();if(i===`off`)return;let a=T.append(`g`).attr(`class`,`today`),o=new Date,s=a.append(`line`);s.attr(`x1`,E(o)+e).attr(`x2`,E(o)+e).attr(`y1`,d.titleTopMargin).attr(`y2`,r-d.titleTopMargin).attr(`class`,`today`),i!==``&&s.attr(`style`,i.replace(/,/g,`;`))}A(re,`drawToday`);function oe(e){let t={},n=[];for(let r=0,i=e.length;r<i;++r)Object.prototype.hasOwnProperty.call(t,e[r])||(t[e[r]]=!0,n.push(e[r]));return n}A(oe,`checkUnique`)},`draw`)},styles:A(e=>`
7
+ .mermaid-main-font {
8
+ font-family: ${e.fontFamily};
9
+ }
10
+
11
+ .exclude-range {
12
+ fill: ${e.excludeBkgColor};
13
+ }
14
+
15
+ .section {
16
+ stroke: none;
17
+ opacity: 0.2;
18
+ }
19
+
20
+ .section0 {
21
+ fill: ${e.sectionBkgColor};
22
+ }
23
+
24
+ .section2 {
25
+ fill: ${e.sectionBkgColor2};
26
+ }
27
+
28
+ .section1,
29
+ .section3 {
30
+ fill: ${e.altSectionBkgColor};
31
+ opacity: 0.2;
32
+ }
33
+
34
+ .sectionTitle0 {
35
+ fill: ${e.titleColor};
36
+ }
37
+
38
+ .sectionTitle1 {
39
+ fill: ${e.titleColor};
40
+ }
41
+
42
+ .sectionTitle2 {
43
+ fill: ${e.titleColor};
44
+ }
45
+
46
+ .sectionTitle3 {
47
+ fill: ${e.titleColor};
48
+ }
49
+
50
+ .sectionTitle {
51
+ text-anchor: start;
52
+ font-family: ${e.fontFamily};
53
+ }
54
+
55
+
56
+ /* Grid and axis */
57
+
58
+ .grid .tick {
59
+ stroke: ${e.gridColor};
60
+ opacity: 0.8;
61
+ shape-rendering: crispEdges;
62
+ }
63
+
64
+ .grid .tick text {
65
+ font-family: ${e.fontFamily};
66
+ fill: ${e.textColor};
67
+ }
68
+
69
+ .grid path {
70
+ stroke-width: 0;
71
+ }
72
+
73
+
74
+ /* Today line */
75
+
76
+ .today {
77
+ fill: none;
78
+ stroke: ${e.todayLineColor};
79
+ stroke-width: 2px;
80
+ }
81
+
82
+
83
+ /* Task styling */
84
+
85
+ /* Default task */
86
+
87
+ .task {
88
+ stroke-width: 2;
89
+ }
90
+
91
+ .taskText {
92
+ text-anchor: middle;
93
+ font-family: ${e.fontFamily};
94
+ }
95
+
96
+ .taskTextOutsideRight {
97
+ fill: ${e.taskTextDarkColor};
98
+ text-anchor: start;
99
+ font-family: ${e.fontFamily};
100
+ }
101
+
102
+ .taskTextOutsideLeft {
103
+ fill: ${e.taskTextDarkColor};
104
+ text-anchor: end;
105
+ }
106
+
107
+
108
+ /* Special case clickable */
109
+
110
+ .task.clickable {
111
+ cursor: pointer;
112
+ }
113
+
114
+ .taskText.clickable {
115
+ cursor: pointer;
116
+ fill: ${e.taskTextClickableColor} !important;
117
+ font-weight: bold;
118
+ }
119
+
120
+ .taskTextOutsideLeft.clickable {
121
+ cursor: pointer;
122
+ fill: ${e.taskTextClickableColor} !important;
123
+ font-weight: bold;
124
+ }
125
+
126
+ .taskTextOutsideRight.clickable {
127
+ cursor: pointer;
128
+ fill: ${e.taskTextClickableColor} !important;
129
+ font-weight: bold;
130
+ }
131
+
132
+
133
+ /* Specific task settings for the sections*/
134
+
135
+ .taskText0,
136
+ .taskText1,
137
+ .taskText2,
138
+ .taskText3 {
139
+ fill: ${e.taskTextColor};
140
+ }
141
+
142
+ .task0,
143
+ .task1,
144
+ .task2,
145
+ .task3 {
146
+ fill: ${e.taskBkgColor};
147
+ stroke: ${e.taskBorderColor};
148
+ }
149
+
150
+ .taskTextOutside0,
151
+ .taskTextOutside2
152
+ {
153
+ fill: ${e.taskTextOutsideColor};
154
+ }
155
+
156
+ .taskTextOutside1,
157
+ .taskTextOutside3 {
158
+ fill: ${e.taskTextOutsideColor};
159
+ }
160
+
161
+
162
+ /* Active task */
163
+
164
+ .active0,
165
+ .active1,
166
+ .active2,
167
+ .active3 {
168
+ fill: ${e.activeTaskBkgColor};
169
+ stroke: ${e.activeTaskBorderColor};
170
+ }
171
+
172
+ .activeText0,
173
+ .activeText1,
174
+ .activeText2,
175
+ .activeText3 {
176
+ fill: ${e.taskTextDarkColor} !important;
177
+ }
178
+
179
+
180
+ /* Completed task */
181
+
182
+ .done0,
183
+ .done1,
184
+ .done2,
185
+ .done3 {
186
+ stroke: ${e.doneTaskBorderColor};
187
+ fill: ${e.doneTaskBkgColor};
188
+ stroke-width: 2;
189
+ }
190
+
191
+ .doneText0,
192
+ .doneText1,
193
+ .doneText2,
194
+ .doneText3 {
195
+ fill: ${e.taskTextDarkColor} !important;
196
+ }
197
+
198
+ /* Done task text displayed outside the bar sits against the diagram background,
199
+ not against the done-task bar, so it must use the outside/contrast color. */
200
+ .doneText0.taskTextOutsideLeft,
201
+ .doneText0.taskTextOutsideRight,
202
+ .doneText1.taskTextOutsideLeft,
203
+ .doneText1.taskTextOutsideRight,
204
+ .doneText2.taskTextOutsideLeft,
205
+ .doneText2.taskTextOutsideRight,
206
+ .doneText3.taskTextOutsideLeft,
207
+ .doneText3.taskTextOutsideRight {
208
+ fill: ${e.taskTextOutsideColor} !important;
209
+ }
210
+
211
+
212
+ /* Tasks on the critical line */
213
+
214
+ .crit0,
215
+ .crit1,
216
+ .crit2,
217
+ .crit3 {
218
+ stroke: ${e.critBorderColor};
219
+ fill: ${e.critBkgColor};
220
+ stroke-width: 2;
221
+ }
222
+
223
+ .activeCrit0,
224
+ .activeCrit1,
225
+ .activeCrit2,
226
+ .activeCrit3 {
227
+ stroke: ${e.critBorderColor};
228
+ fill: ${e.activeTaskBkgColor};
229
+ stroke-width: 2;
230
+ }
231
+
232
+ .doneCrit0,
233
+ .doneCrit1,
234
+ .doneCrit2,
235
+ .doneCrit3 {
236
+ stroke: ${e.critBorderColor};
237
+ fill: ${e.doneTaskBkgColor};
238
+ stroke-width: 2;
239
+ cursor: pointer;
240
+ shape-rendering: crispEdges;
241
+ }
242
+
243
+ .milestone {
244
+ transform: rotate(45deg) scale(0.8,0.8);
245
+ }
246
+
247
+ .milestoneText {
248
+ font-style: italic;
249
+ }
250
+ .doneCritText0,
251
+ .doneCritText1,
252
+ .doneCritText2,
253
+ .doneCritText3 {
254
+ fill: ${e.taskTextDarkColor} !important;
255
+ }
256
+
257
+ /* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */
258
+ .doneCritText0.taskTextOutsideLeft,
259
+ .doneCritText0.taskTextOutsideRight,
260
+ .doneCritText1.taskTextOutsideLeft,
261
+ .doneCritText1.taskTextOutsideRight,
262
+ .doneCritText2.taskTextOutsideLeft,
263
+ .doneCritText2.taskTextOutsideRight,
264
+ .doneCritText3.taskTextOutsideLeft,
265
+ .doneCritText3.taskTextOutsideRight {
266
+ fill: ${e.taskTextOutsideColor} !important;
267
+ }
268
+
269
+ .vert {
270
+ stroke: ${e.vertLineColor};
271
+ }
272
+
273
+ .vertText {
274
+ font-size: 15px;
275
+ text-anchor: middle;
276
+ fill: ${e.vertLineColor} !important;
277
+ }
278
+
279
+ .activeCritText0,
280
+ .activeCritText1,
281
+ .activeCritText2,
282
+ .activeCritText3 {
283
+ fill: ${e.taskTextDarkColor} !important;
284
+ }
285
+
286
+ .titleText {
287
+ text-anchor: middle;
288
+ font-size: 18px;
289
+ fill: ${e.titleColor||e.textColor};
290
+ font-family: ${e.fontFamily};
291
+ }
292
+ `,`getStyles`)};export{sn as diagram};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-jLdm8a1-.js","assets/chunk-Bj-mKKzh.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-DSXbuxSR.js";import{d as t,u as n}from"./speech-ZNExxXBR.js";var r=[`Kore`,`Puck`,`Charon`,`Fenrir`,`Leda`,`Orus`,`Aoede`];function i(e){return Array.isArray(e?.serverContent?.modelTurn?.parts)?e.serverContent.modelTurn.parts:[]}async function a(r){let{utterance:a,settings:o,getApiKey:s,signal:c}=r,l=await s(`google`);if(!l)throw Error(`No Google API key configured. Sign in to Google in Settings → Providers & Models.`);let{GoogleGenAI:u,Modality:d,ThinkingLevel:f}=await e(async()=>{let{GoogleGenAI:e,Modality:t,ThinkingLevel:n}=await import(`./web-jLdm8a1-.js`).then(e=>e.a);return{GoogleGenAI:e,Modality:t,ThinkingLevel:n}},__vite__mapDeps([0,1])),p=new u({apiKey:l}),m=null,h=!1,g=0,_=0,v=``,y=e=>{h||(h=!0,m?.close(),e({audioChunks:g,playedChunks:_,transcript:v.trim()}))};return await new Promise((e,r)=>{let s=setTimeout(()=>{h||(h=!0,m?.close(),r(Error(`Gemini Live speech timed out.`)))},3e4),l=()=>{h||(h=!0,clearTimeout(s),m?.close(),r(Error(`Gemini Live speech aborted.`)))};if(c?.aborted){l();return}c?.addEventListener(`abort`,l,{once:!0}),p.live.connect({model:o.model||`gemini-3.1-flash-live-preview`,callbacks:{onmessage:t=>{for(let e of i(t)){let t=e.inlineData?.data;typeof t==`string`&&t.length>0&&(g+=1,n(t)&&(_+=1)),typeof e.text==`string`&&(v+=e.text)}let r=t?.serverContent?.outputTranscription?.text;typeof r==`string`&&(v+=r),(t?.serverContent?.turnComplete||t?.serverContent?.generationComplete)&&(clearTimeout(s),c?.removeEventListener(`abort`,l),y(e))},onerror:e=>{h||(h=!0,clearTimeout(s),c?.removeEventListener(`abort`,l),r(Error(e.message||`Gemini Live speech failed.`)))},onclose:()=>{h||(clearTimeout(s),c?.removeEventListener(`abort`,l),y(e))}},config:{responseModalities:[d.AUDIO],outputAudioTranscription:{},speechConfig:{voiceConfig:{prebuiltVoiceConfig:{voiceName:a.voice}}},systemInstruction:`You are Keating's voice layer. Speak the provided learner-facing line only. Keep it natural, concise, and conversational. Do not add extra teaching content.`,thinkingConfig:{thinkingLevel:f.MINIMAL}}}).then(e=>{if(h){e.close();return}m=e,m.sendRealtimeInput({text:`${t(a)}\n\nSpeak this line exactly, preserving the teaching intent.`})}).catch(e=>{h||(h=!0,clearTimeout(s),c?.removeEventListener(`abort`,l),r(e))})})}var o={id:`gemini-live`,label:`Gemini Live`,kind:`tts`,status:`stable`,description:`Google Gemini Live audio-out. Best for expressive, low-latency speech with prebuilt voices.`,models:[{value:`gemini-2.0-flash-live-001`,label:`Gemini 2.0 Flash Live`},{value:`gemini-2.5-flash-live-preview`,label:`Gemini 2.5 Flash Live (Preview)`},{value:`gemini-3.0-flash-live-preview`,label:`Gemini 3.0 Flash Live (Preview)`},{value:`gemini-3.1-flash-live-preview`,label:`Gemini 3.1 Flash Live (Preview)`}],voices:r,needsApiKey:`google`,synthesize:a};export{o as geminiLiveProvider};
@@ -0,0 +1 @@
1
+ import"./chunk-K5T4RW27-C6ErEFB0.js";import{n as e}from"./chunk-67CJDMHE-DNZKE79k.js";export{e as createGitGraphServices};
@@ -0,0 +1,106 @@
1
+ import{h as e,p as t,r as n}from"./chunk-5PVQY5BW-Ciel-YVc.js";import{i as r,r as i,t as a}from"./src-BfaOho0B.js";import{B as o,C as s,V as c,W as l,_ as u,a as d,b as f,d as p,q as m,s as h,v as g,y as _}from"./chunk-ICPOFSXX-C04NFfJk.js";import{t as v}from"./chunk-4BX2VUAB-DRZjGMDM.js";import{t as y}from"./mermaid-parser.core-C8ylgsWV.js";import{t as b}from"./chunk-QZHKN3VN-X2zPgEFk.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=p.gitGraph,S=i(()=>n({...ee,..._().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return t({length:7})}i(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}i(T,`uniqBy`);var te=i(function(e){C.records.direction=e},`setDirection`),ne=i(function(e){r.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){r.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=i(function(){return C.records.options},`getOptions`),ie=i(function(e){let t=e.msg,n=e.id,i=e.type,a=e.tags;r.info(`commit`,t,n,i,a),r.debug(`Entering commit:`,t,n,i,a);let o=S();n=h.sanitizeText(n,o),t=h.sanitizeText(t,o),a=a?.map(e=>h.sanitizeText(e,o));let s={id:n||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:i??x.NORMAL,tags:a??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,r.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&r.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),r.debug(`in pushCommit `+s.id)},`commit`),ae=i(function(e){let t=e.name,n=e.order;if(t=h.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:n}),E(t),r.debug(`in createBranch`)},`branch`),oe=i(e=>{let t=e.branch,n=e.id,i=e.type,a=e.tags,o=S();t=h.sanitizeText(t,o),n&&=h.sanitizeText(n,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(t),l=s?C.records.commits.get(s):void 0,u=c?C.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(n&&C.records.commits.has(n)){let e=Error(`Incorrect usage of "merge". Commit with id:`+n+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${n} ${i} ${a?.join(` `)}`,token:`merge ${t} ${n} ${i} ${a?.join(` `)}`,expected:[`merge ${t} ${n}_UNIQUE ${i} ${a?.join(` `)}`]},e}let d=c||``,f={id:n||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,d],branch:C.records.currBranch,type:x.MERGE,customType:i,customId:!!n,tags:a??[]};C.records.head=f,C.records.commits.set(f.id,f),C.records.branches.set(C.records.currBranch,f.id),r.debug(C.records.branches),r.debug(`in mergeBranch`)},`merge`),se=i(function(e){let t=e.id,n=e.targetId,i=e.tags,a=e.parent;r.debug(`Entering cherryPick:`,t,n,i);let o=S();if(t=h.sanitizeText(t,o),n=h.sanitizeText(n,o),i=i?.map(e=>h.sanitizeText(e,o)),a=h.sanitizeText(a,o),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(s.parents)&&s.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!n||!C.records.commits.has(n)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${a}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),r.debug(C.records.branches),r.debug(`in cherryPick`)}},`cherryPick`),E=i(function(e){if(e=h.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}i(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),n=``;e.forEach(function(e){e===t?n+=` *`:n+=` |`});let i=[n,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&i.push(e);if(r.debug(i.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}e=T(e,e=>e.id),O(e)}i(O,`prettyPrintCommitHistory`);var ce=i(function(){r.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=i(function(){C.reset(),d()},`clear`),ue=i(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=i(function(){return C.records.branches},`getBranches`),fe=i(function(){return C.records.commits},`getCommits`),k=i(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){r.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:i(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:i(function(){return C.records.direction},`getDirection`),getHead:i(function(){return C.records.head},`getHead`),setAccTitle:c,getAccTitle:g,getAccDescription:u,setAccDescription:o,setDiagramTitle:l,getDiagramTitle:s},pe=i((e,t)=>{v(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=i((e,t)=>{let n={Commit:i(e=>t.commit(he(e)),`Commit`),Branch:i(e=>t.branch(ge(e)),`Branch`),Merge:i(e=>t.merge(_e(e)),`Merge`),Checkout:i(e=>t.checkout(ve(e)),`Checkout`),CherryPicking:i(e=>t.cherryPick(ye(e)),`CherryPicking`)}[e.$type];n?n(e):r.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),he=i(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=i(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=i(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=i(e=>e.branch,`parseCheckout`),ye=i(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:i(async e=>{let t=await y(`gitGraph`,e);r.debug(t),pe(t,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=i((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,Se=i(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),q=i(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),J=i(e=>{let t,n,r;return K===`BT`?(n=i((e,t)=>e<=t,`comparisonFunc`),r=1/0):(n=i((e,t)=>e>=t,`comparisonFunc`),r=0),e.forEach(e=>{let i=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;i!==void 0&&n(i,r)&&(t=e,r=i)}),t},`findClosestParent`),Ce=i(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),we=i((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Ee(n),i=Math.max(r,i)):a.push(n),De(n,r)}),r=i,a.forEach(e=>{Oe(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Ce(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),Te=i(e=>{let t=J(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Ee=i(e=>Te(e)+M,`calculateCommitPosition`),De=i((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),Oe=i((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),ke=i((e,t,n,r,i,a)=>{let{theme:o}=f(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),Ae=i((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel))if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}},`drawCommitLabel`),je=i((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
2
+ ${r-a/2-N/2},${l+P}
3
+ ${r-a/2-N/2},${l-P}
4
+ ${n.posWithOffset-a/2-N},${l-s-P}
5
+ ${n.posWithOffset+a/2+N},${l-s-P}
6
+ ${n.posWithOffset+a/2+N},${l+s+P}
7
+ ${n.posWithOffset-a/2-N},${l+s+P}`),t.attr(`cy`,l).attr(`cx`,r-a/2+N/2).attr(`r`,1.5).attr(`class`,`tag-hole`),K===`TB`||K===`BT`){let o=r+c;i.attr(`class`,`tag-label-bkg`).attr(`points`,`
8
+ ${n.x},${o+2}
9
+ ${n.x},${o-2}
10
+ ${n.x+j},${o-s-2}
11
+ ${n.x+j+a+4},${o-s-2}
12
+ ${n.x+j+a+4},${o+s+2}
13
+ ${n.x+j},${o+s+2}`).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),t.attr(`cx`,n.x+N/2).attr(`cy`,o).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),e.attr(`x`,n.x+5).attr(`y`,o+3).attr(`transform`,`translate(14,14) rotate(45, `+n.x+`,`+r+`)`)}}}},`drawCommitTags`),Me=i(e=>{switch(e.customType??e.type){case x.NORMAL:return`commit-normal`;case x.REVERSE:return`commit-reverse`;case x.HIGHLIGHT:return`commit-highlight`;case x.MERGE:return`commit-merge`;case x.CHERRY_PICK:return`commit-cherry-pick`;default:return`commit-normal`}},`getCommitClassType`),Ne=i((e,t,n,r)=>{let i={x:0,y:0};if(e.parents.length>0){let n=J(e.parents);if(n){let a=r.get(n)??i;return t===`TB`?a.y+M:t===`BT`?(r.get(e.id)??i).y-M:a.x+M}}else if(t===`TB`)return H;else if(t===`BT`)return(r.get(e.id)??i).y-M;else return 0;return 0},`calculatePosition`),Pe=i((e,t,n)=>{let r=K===`BT`&&n?t:t+j,i=B.get(e.branch)?.pos,a=K===`TB`||K===`BT`?B.get(e.branch)?.pos:r;if(a===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.id}`);let o=I.has(f().theme??``);return{x:a,y:K===`TB`||K===`BT`?r:i+(o?L/2+1:-2),posWithOffset:r}},`getCommitPosition`),Y=i((e,t,n,r)=>{let a=e.append(`g`).attr(`class`,`commit-bullets`),o=e.append(`g`).attr(`class`,`commit-labels`),s=K===`TB`||K===`BT`?H:0,c=[...t.keys()],l=r.parallelCommits??!1,u=i((e,n)=>{let r=t.get(e)?.seq,i=t.get(n)?.seq;return r!==void 0&&i!==void 0?r-i:0},`sortKeys`),d=c.sort(u);K===`BT`&&(l&&we(d,t,s),d=d.reverse()),d.forEach(e=>{let i=t.get(e);if(!i)throw Error(`Commit not found for key ${e}`);l&&(s=Ne(i,K,s,V));let c=Pe(i,s,l);if(n){let e=Me(i),t=i.customType??i.type;ke(a,i,c,e,B.get(i.branch)?.index??0,t),Ae(o,i,c,s,r),je(o,i,c,s)}K===`TB`||K===`BT`?V.set(i.id,{x:c.x,y:c.posWithOffset}):V.set(i.id,{x:c.posWithOffset,y:c.y}),s=K===`BT`&&l?s+M:s+M+j,s>G&&(G=s)})},`drawCommits`),Fe=i((e,t,n,r,a)=>{let o=(K===`TB`||K===`BT`?n.x<r.x:n.y<r.y)?t.branch:e.branch,s=i(e=>e.branch===o,`isOnBranchToGetCurve`),c=i(n=>n.seq>e.seq&&n.seq<t.seq,`isBetweenCommits`);return[...a.values()].some(e=>c(e)&&s(e))},`shouldRerouteArrow`),X=i((e,t,n=0)=>{let r=e+Math.abs(e-t)/2;return n>5?r:W.every(e=>Math.abs(e-r)>=10)?(W.push(r),r):X(e,t-Math.abs(e-t)/5,n+1)},`findLane`),Ie=i((e,t,n,r)=>{let{theme:i}=f(),a=R.has(i??``),o=V.get(t.id),s=V.get(n.id);if(o===void 0||s===void 0)throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);let c=Fe(t,n,o,s,r),l=``,u=``,d=0,p=0,m=B.get(n.branch)?.index;n.type===x.MERGE&&t.id!==n.parents[0]&&(m=B.get(t.branch)?.index);let h;if(c){l=`A 10 10, 0, 0, 0,`,u=`A 10 10, 0, 0, 1,`,d=10,p=10;let e=o.y<s.y?X(o.y,s.y):X(s.y,o.y),n=o.x<s.x?X(o.x,s.x):X(s.x,o.x);K===`TB`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-d} ${o.y} ${u} ${n} ${o.y+p} L ${n} ${s.y-d} ${l} ${n+p} ${s.y} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+d} ${o.y} ${l} ${n} ${o.y+p} L ${n} ${s.y-d} ${u} ${n-p} ${s.y} L ${s.x} ${s.y}`):K===`BT`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-d} ${o.y} ${l} ${n} ${o.y-p} L ${n} ${s.y+d} ${u} ${n+p} ${s.y} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+d} ${o.y} ${u} ${n} ${o.y-p} L ${n} ${s.y+d} ${l} ${n-p} ${s.y} L ${s.x} ${s.y}`):o.y<s.y?h=`M ${o.x} ${o.y} L ${o.x} ${e-d} ${l} ${o.x+p} ${e} L ${s.x-d} ${e} ${u} ${s.x} ${e+p} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${o.x} ${e+d} ${u} ${o.x+p} ${e} L ${s.x-d} ${e} ${l} ${s.x} ${e-p} L ${s.x} ${s.y}`)}else l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,p=20,K===`TB`?(o.x<s.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${l} ${o.x+p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y+p} L ${s.x} ${s.y}`),o.x>s.x&&(l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,p=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${u} ${o.x-p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${l} ${s.x} ${o.y+p} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):K===`BT`?(o.x<s.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x+p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${l} ${s.x} ${o.y-p} L ${s.x} ${s.y}`),o.x>s.x&&(l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,p=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${l} ${o.x-p} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${u} ${s.x} ${o.y-p} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.y<s.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y+p} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${l} ${o.x+p} ${s.y} L ${s.x} ${s.y}`),o.y>s.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${l} ${s.x} ${o.y-p} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x+p} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(h===void 0)throw Error(`Line definition not found`);e.append(`path`).attr(`d`,h).attr(`class`,`arrow arrow`+z(m,F,a))},`drawArrow`),Le=i((e,t)=>{let n=e.append(`g`).attr(`class`,`commit-arrows`);[...t.keys()].forEach(e=>{let r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{Ie(n,t.get(e),r,t)})})},`drawArrows`),Re=i((e,t,n,r)=>{let{look:i,theme:a,themeVariables:o}=f(),{dropShadow:s,THEME_COLOR_LIMIT:c}=o,l=I.has(a??``),u=R.has(a??``),d=e.append(`g`);t.forEach((e,t)=>{let a=z(t,l?c:F,u),o=B.get(e.name)?.pos;if(o===void 0)throw Error(`Position not found for branch ${e.name}`);let f=K===`TB`||K===`BT`?o:l?o+L/2+1:o-2,p=d.append(`line`);p.attr(`x1`,0),p.attr(`y1`,f),p.attr(`x2`,G),p.attr(`y2`,f),p.attr(`class`,`branch branch`+a),K===`TB`?(p.attr(`y1`,H),p.attr(`x1`,o),p.attr(`y2`,G),p.attr(`x2`,o)):K===`BT`&&(p.attr(`y1`,G),p.attr(`x1`,o),p.attr(`y2`,H),p.attr(`x2`,o)),W.push(f);let m=e.name,h=q(m),g=d.insert(`rect`),_=d.insert(`g`).attr(`class`,`branchLabel`).insert(`g`).attr(`class`,`label branch-label`+a);_.node().appendChild(h);let v=h.getBBox(),y=l?0:4,b=l?16:0,x=l?L:0;i===`neo`&&g.attr(`data-look`,`neo`),g.attr(`class`,`branchLabelBkg label`+a).attr(`style`,i===`neo`?`filter:${l?`url(#${r}-drop-shadow)`:s}`:``).attr(`rx`,y).attr(`ry`,y).attr(`x`,-v.width-4-(n.rotateCommitLabel===!0?30:0)).attr(`y`,-v.height/2+10).attr(`width`,v.width+18+b).attr(`height`,v.height+4+x),_.attr(`transform`,`translate(`+(-v.width-14-(n.rotateCommitLabel===!0?30:0)+b/2)+`, `+(f-v.height/2-2)+`)`),K===`TB`?(g.attr(`x`,o-v.width/2-10).attr(`y`,0),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, 0)`),l&&(g.attr(`transform`,`translate(${-b/2-3}, ${-x-10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(-x*2+7)+`)`))):K===`BT`?(g.attr(`x`,o-v.width/2-10).attr(`y`,G),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+G+`)`),l&&(g.attr(`transform`,`translate(${-b/2-3}, ${x+10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(G+x*2+4)+`)`))):g.attr(`transform`,`translate(-19, `+(f-12-x/2)+`)`)})},`drawBranches`),ze=i(function(e,t,n,r,i){return B.set(e,{pos:t,index:n}),t+=50+(i?40:0)+(K===`TB`||K===`BT`?r.width/2:0),t},`setBranchPosition`),Be={draw:i(function(t,n,i,o){Se(),r.debug(`in gitgraph renderer`,t+`
14
+ `,`id:`,n,i);let s=o.db;if(!s.getConfig){r.error(`getConfig method is not available on db`);return}let c=s.getConfig(),l=c.rotateCommitLabel??!1;U=s.getCommits();let u=s.getBranchesAsObjArray();K=s.getDirection();let d=a(`[id="${n}"]`),{look:p,theme:h,themeVariables:g}=f(),{useGradient:_,gradientStart:v,gradientStop:y,filterColor:b}=g;if(_){let e=d.append(`defs`).append(`linearGradient`).attr(`id`,n+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,v).attr(`stop-opacity`,1),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,y).attr(`stop-opacity`,1)}p===`neo`&&I.has(h??``)&&d.append(`defs`).append(`filter`).attr(`id`,n+`-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,b);let x=0;u.forEach((e,t)=>{let n=q(e.name),r=d.append(`g`),i=r.insert(`g`).attr(`class`,`branchLabel`),a=i.insert(`g`).attr(`class`,`label branch-label`);a.node()?.appendChild(n);let o=n.getBBox();x=ze(e.name,x,t,o,l),a.remove(),i.remove(),r.remove()}),Y(d,U,!1,c),c.showBranches&&Re(d,u,c,n),Le(d,U),Y(d,U,!0,c),e.insertTitle(d,`gitTitleText`,c.titleTopMargin??0,s.getDiagramTitle()),m(void 0,d,c.diagramPadding,c.useMaxWidth)},`draw`)},Z=8,Q=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),$=new Set([`redux-color`,`redux-dark-color`]),Ve=new Set([`neo`,`neo-dark`]),He=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),Ue=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`,`neo`,`neo-dark`]),We=i(e=>{let{svgId:t}=e,n=``;if(e.useGradient&&t)for(let r=0;r<e.THEME_COLOR_LIMIT;r++)n+=`
15
+ .label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
16
+ `;return n},`genGitGraphGradient`),Ge=i(e=>{let{theme:t,themeVariables:n}=_(),{borderColorArray:r}=n,i=Q.has(t);if(Ve.has(t)){let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(n===0)t+=`
17
+ .branch-label${n} { fill: ${e.nodeBorder};}
18
+ .commit${n} { stroke: ${e.nodeBorder}; }
19
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
20
+ .arrow${n} { stroke: ${e.nodeBorder}; }
21
+ .commit-bullets { fill: ${e.nodeBorder}; }
22
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
23
+ ${We(e)}`;else{let r=n%Z;t+=`
24
+ .branch-label${n} { fill: ${e[`gitBranchLabel`+r]}; }
25
+ .commit${n} { stroke: ${e[`git`+r]}; fill: ${e[`git`+r]}; }
26
+ .commit-highlight${n} { stroke: ${e[`gitInv`+r]}; fill: ${e[`gitInv`+r]}; }
27
+ .arrow${n} { stroke: ${e[`git`+r]}; }
28
+ `}return t}else if($.has(t)){let n=``;for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
29
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
30
+ .commit${a} { stroke: ${e.nodeBorder}; }
31
+ .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
32
+ .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``} }
33
+ .arrow${a} { stroke: ${e.nodeBorder}; }
34
+ .commit-bullets { fill: ${e.nodeBorder}; }
35
+ `;else{let o=a%r.length;n+=`
36
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
37
+ .commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
38
+ .commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
39
+ .label${a} { fill: ${He.has(t)?e.mainBkg:r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
40
+ .arrow${a} { stroke: ${r[o]}; }
41
+ `}return n}else{let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)t+=`
42
+ .branch-label${n} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
43
+ .commit${n} { stroke: ${e.nodeBorder}; }
44
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
45
+ .label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``}}
46
+ .arrow${n} { stroke: ${e.nodeBorder}; }
47
+ .commit-bullets { fill: ${e.nodeBorder}; }
48
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
49
+ `;return t}},`genColor`),Ke=i(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(e,t)=>t).map(t=>{let n=t%Z;return`
50
+ .branch-label${t} { fill: ${e[`gitBranchLabel`+n]}; }
51
+ .commit${t} { stroke: ${e[`git`+n]}; fill: ${e[`git`+n]}; }
52
+ .commit-highlight${t} { stroke: ${e[`gitInv`+n]}; fill: ${e[`gitInv`+n]}; }
53
+ .label${t} { fill: ${e[`git`+n]}; }
54
+ .arrow${t} { stroke: ${e[`git`+n]}; }
55
+ `}).join(`
56
+ `)}`,`normalTheme`),qe={parser:be,db:A,renderer:Be,styles:i(e=>{let{theme:t}=_(),n=Ue.has(t);return`
57
+ .commit-id,
58
+ .commit-msg,
59
+ .branch-label {
60
+ fill: lightgrey;
61
+ color: lightgrey;
62
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
63
+ font-family: var(--mermaid-font-family);
64
+ }
65
+
66
+ ${n?Ge(e):Ke(e)}
67
+
68
+ .branch {
69
+ stroke-width: ${e.strokeWidth};
70
+ stroke: ${e.commitLineColor??e.lineColor};
71
+ stroke-dasharray: ${n?`4 2`:`2`};
72
+ }
73
+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n?e.nodeBorder:e.commitLabelColor}; ${n?`font-weight:${e.noteFontWeight};`:``}}
74
+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n?`transparent`:e.commitLabelBackground}; opacity: ${n?``:.5}; }
75
+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
76
+ .tag-label-bkg { fill: ${n?e.mainBkg:e.tagLabelBackground}; stroke: ${n?e.nodeBorder:e.tagLabelBorder}; ${n?`filter:${e.dropShadow}`:``} }
77
+ .tag-hole { fill: ${e.textColor}; }
78
+
79
+ .commit-merge {
80
+ stroke: ${n?e.mainBkg:e.primaryColor};
81
+ fill: ${n?e.mainBkg:e.primaryColor};
82
+ }
83
+ .commit-reverse {
84
+ stroke: ${n?e.mainBkg:e.primaryColor};
85
+ fill: ${n?e.mainBkg:e.primaryColor};
86
+ stroke-width: ${n?e.strokeWidth:3};
87
+ }
88
+ .commit-highlight-outer {
89
+ }
90
+ .commit-highlight-inner {
91
+ stroke: ${n?e.mainBkg:e.primaryColor};
92
+ fill: ${n?e.mainBkg:e.primaryColor};
93
+ }
94
+
95
+ .arrow {
96
+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
97
+ stroke-width: ${Q.has(t)?e.strokeWidth:8};
98
+ stroke-linecap: round;
99
+ fill: none
100
+ }
101
+ .gitTitleText {
102
+ text-anchor: middle;
103
+ font-size: 18px;
104
+ fill: ${e.textColor};
105
+ }
106
+ `},`getStyles`)};export{qe as diagram};
@@ -1 +1 @@
1
- import{t as e}from"./env-api-keys-BNlMKqxw.js";import{r as t,t as n}from"./event-stream-D33K9rpL.js";import{r}from"./web-CMKYLKbT.js";import{a as i,i as a,r as o}from"./transform-messages-CqKEdRVp.js";import{i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-DyQdgtsI.js";var p=0,m=(r,i,a)=>{let o=new n;return(async()=>{let n={role:`assistant`,content:[],api:`google-generative-ai`,provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let c=g(r,a?.apiKey||e(r.provider)||``,a?.headers),l=_(r,i,a),f=await a?.onPayload?.(l,r);f!==void 0&&(l=f);let m=await c.models.generateContentStream(l);o.push({type:`start`,partial:n});let h=null,v=n.content,y=()=>v.length-1;for await(let e of m){n.responseId||=e.responseId;let i=e.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let t=u(e);(!h||t&&h.type!==`thinking`||!t&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),t?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},n.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:n})):(h={type:`text`,text:``},n.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:n}))),h.type===`thinking`?(h.thinking+=e.text,h.thinkingSignature=d(h.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:e.text,partial:n})):(h.text+=e.text,h.textSignature=d(h.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:e.text,partial:n}))}if(e.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n}),null);let t=e.functionCall.id,r={type:`toolCall`,id:!t||n.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++p}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};n.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:n}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:n}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:n})}}i?.finishReason&&(n.stopReason=s(i.finishReason),n.content.some(e=>e.type===`toolCall`)&&(n.stopReason=`toolUse`)),e.usageMetadata&&(n.usage={input:(e.usageMetadata.promptTokenCount||0)-(e.usageMetadata.cachedContentTokenCount||0),output:(e.usageMetadata.candidatesTokenCount||0)+(e.usageMetadata.thoughtsTokenCount||0),cacheRead:e.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:e.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(r,n.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),a?.signal?.aborted)throw Error(`Request was aborted`);if(n.stopReason===`aborted`||n.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:n.stopReason,message:n}),o.end()}catch(e){for(let e of n.content)`index`in e&&delete e.index;n.stopReason=a?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:n.stopReason,error:n}),o.end()}})(),o},h=(t,n,r)=>{let i=r?.apiKey||e(t.provider);if(!i)throw Error(`No API key for provider: ${t.provider}`);let s=o(t,r,i);if(!r?.reasoning)return m(t,n,{...s,thinking:{enabled:!1}});let c=a(r.reasoning),l=t;return v(l)||y(l)?m(t,n,{...s,thinking:{enabled:!0,level:x(c,l)}}):m(t,n,{...s,thinking:{enabled:!0,budgetTokens:S(l,c,r.thinkingBudgets)}})};function g(e,t,n){let i={};return e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=``),(e.headers||n)&&(i.headers={...e.headers,...n}),new r({apiKey:t,httpOptions:Object.keys(i).length>0?i:void 0})}function _(e,t,n={}){let r=f(e,t),a={};n.temperature!==void 0&&(a.temperature=n.temperature),n.maxTokens!==void 0&&(a.maxOutputTokens=n.maxTokens);let o={...Object.keys(a).length>0&&a,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=b(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function v(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function b(e){return v(e)?{thinkingLevel:`LOW`}:y(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function x(e,t){if(v(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function S(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{m as streamGoogle,h as streamSimpleGoogle};
1
+ import{t as e}from"./env-api-keys-BNlMKqxw.js";import{r as t,t as n}from"./event-stream-D33K9rpL.js";import{r}from"./web-jLdm8a1-.js";import{a as i,i as a,r as o}from"./transform-messages-DXDWLrnO.js";import{i as s,n as c,o as l,r as u,s as d,t as f}from"./google-shared-DFv4ubOG.js";var p=0,m=(r,i,a)=>{let o=new n;return(async()=>{let n={role:`assistant`,content:[],api:`google-generative-ai`,provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let c=g(r,a?.apiKey||e(r.provider)||``,a?.headers),l=_(r,i,a),f=await a?.onPayload?.(l,r);f!==void 0&&(l=f);let m=await c.models.generateContentStream(l);o.push({type:`start`,partial:n});let h=null,v=n.content,y=()=>v.length-1;for await(let e of m){n.responseId||=e.responseId;let i=e.candidates?.[0];if(i?.content?.parts)for(let e of i.content.parts){if(e.text!==void 0){let t=u(e);(!h||t&&h.type!==`thinking`||!t&&h.type!==`text`)&&(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:v.length-1,content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),t?(h={type:`thinking`,thinking:``,thinkingSignature:void 0},n.content.push(h),o.push({type:`thinking_start`,contentIndex:y(),partial:n})):(h={type:`text`,text:``},n.content.push(h),o.push({type:`text_start`,contentIndex:y(),partial:n}))),h.type===`thinking`?(h.thinking+=e.text,h.thinkingSignature=d(h.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:y(),delta:e.text,partial:n})):(h.text+=e.text,h.textSignature=d(h.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:y(),delta:e.text,partial:n}))}if(e.functionCall){h&&=(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n}),null);let t=e.functionCall.id,r={type:`toolCall`,id:!t||n.content.some(e=>e.type===`toolCall`&&e.id===t)?`${e.functionCall.name}_${Date.now()}_${++p}`:t,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};n.content.push(r),o.push({type:`toolcall_start`,contentIndex:y(),partial:n}),o.push({type:`toolcall_delta`,contentIndex:y(),delta:JSON.stringify(r.arguments),partial:n}),o.push({type:`toolcall_end`,contentIndex:y(),toolCall:r,partial:n})}}i?.finishReason&&(n.stopReason=s(i.finishReason),n.content.some(e=>e.type===`toolCall`)&&(n.stopReason=`toolUse`)),e.usageMetadata&&(n.usage={input:(e.usageMetadata.promptTokenCount||0)-(e.usageMetadata.cachedContentTokenCount||0),output:(e.usageMetadata.candidatesTokenCount||0)+(e.usageMetadata.thoughtsTokenCount||0),cacheRead:e.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:e.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t(r,n.usage))}if(h&&(h.type===`text`?o.push({type:`text_end`,contentIndex:y(),content:h.text,partial:n}):o.push({type:`thinking_end`,contentIndex:y(),content:h.thinking,partial:n})),a?.signal?.aborted)throw Error(`Request was aborted`);if(n.stopReason===`aborted`||n.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:n.stopReason,message:n}),o.end()}catch(e){for(let e of n.content)`index`in e&&delete e.index;n.stopReason=a?.signal?.aborted?`aborted`:`error`,n.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:n.stopReason,error:n}),o.end()}})(),o},h=(t,n,r)=>{let i=r?.apiKey||e(t.provider);if(!i)throw Error(`No API key for provider: ${t.provider}`);let s=o(t,r,i);if(!r?.reasoning)return m(t,n,{...s,thinking:{enabled:!1}});let c=a(r.reasoning),l=t;return v(l)||y(l)?m(t,n,{...s,thinking:{enabled:!0,level:x(c,l)}}):m(t,n,{...s,thinking:{enabled:!0,budgetTokens:S(l,c,r.thinkingBudgets)}})};function g(e,t,n){let i={};return e.baseUrl&&(i.baseUrl=e.baseUrl,i.apiVersion=``),(e.headers||n)&&(i.headers={...e.headers,...n}),new r({apiKey:t,httpOptions:Object.keys(i).length>0?i:void 0})}function _(e,t,n={}){let r=f(e,t),a={};n.temperature!==void 0&&(a.temperature=n.temperature),n.maxTokens!==void 0&&(a.maxOutputTokens=n.maxTokens);let o={...Object.keys(a).length>0&&a,...t.systemPrompt&&{systemInstruction:i(t.systemPrompt)},...t.tools&&t.tools.length>0&&{tools:c(t.tools)}};if(t.tools&&t.tools.length>0&&n.toolChoice?o.toolConfig={functionCallingConfig:{mode:l(n.toolChoice)}}:o.toolConfig=void 0,n.thinking?.enabled&&e.reasoning){let e={includeThoughts:!0};n.thinking.level===void 0?n.thinking.budgetTokens!==void 0&&(e.thinkingBudget=n.thinking.budgetTokens):e.thinkingLevel=n.thinking.level,o.thinkingConfig=e}else e.reasoning&&n.thinking&&!n.thinking.enabled&&(o.thinkingConfig=b(e));if(n.signal){if(n.signal.aborted)throw Error(`Request aborted`);o.abortSignal=n.signal}return{model:e.id,contents:r,config:o}}function v(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-flash/.test(e.id.toLowerCase())}function b(e){return v(e)?{thinkingLevel:`LOW`}:y(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function x(e,t){if(v(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}function S(e,t,n){return n?.[t]===void 0?e.id.includes(`2.5-pro`)?{minimal:128,low:2048,medium:8192,high:32768}[t]:e.id.includes(`2.5-flash`)?{minimal:128,low:2048,medium:8192,high:24576}[t]:-1:n[t]}export{m as streamGoogle,h as streamSimpleGoogle};
@@ -1,2 +1,2 @@
1
- import{r as e,t}from"./event-stream-D33K9rpL.js";import{a as n,i as r,r as i}from"./transform-messages-CqKEdRVp.js";import{a,n as o,o as s,r as c,s as l,t as u}from"./google-shared-DyQdgtsI.js";var d=`https://cloudcode-pa.googleapis.com`,f=[`https://daily-cloudcode-pa.sandbox.googleapis.com`,`https://autopush-cloudcode-pa.sandbox.googleapis.com`,d],p={"User-Agent":`google-cloud-sdk vscode_cloudshelleditor/0.1`,"X-Goog-Api-Client":`gl-node/22.17.0`,"Client-Metadata":JSON.stringify({ideType:`IDE_UNSPECIFIED`,platform:`PLATFORM_UNSPECIFIED`,pluginType:`GEMINI`})},m=`1.18.4`;function h(){return{"User-Agent":`antigravity/${{}.PI_AI_ANTIGRAVITY_VERSION||m} darwin/arm64`}}var g=`You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**`,_=0,v=3,y=1e3,b=2,x=500,S=`interleaved-thinking-2025-05-14`;function C(e,t){let n=e=>e>0?Math.ceil(e+1e3):void 0,r=t instanceof Headers?t:t?.headers;if(r){let e=r.get(`retry-after`);if(e){let t=Number(e);if(Number.isFinite(t)){let e=n(t*1e3);if(e!==void 0)return e}let r=new Date(e).getTime();if(!Number.isNaN(r)){let e=n(r-Date.now());if(e!==void 0)return e}}let t=r.get(`x-ratelimit-reset`);if(t){let e=Number.parseInt(t,10);if(!Number.isNaN(e)){let t=n(e*1e3-Date.now());if(t!==void 0)return t}}let i=r.get(`x-ratelimit-reset-after`);if(i){let e=Number(i);if(Number.isFinite(e)){let t=n(e*1e3);if(t!==void 0)return t}}}let i=e.match(/reset after (?:(\d+)h)?(?:(\d+)m)?(\d+(?:\.\d+)?)s/i);if(i){let e=i[1]?parseInt(i[1],10):0,t=i[2]?parseInt(i[2],10):0,r=parseFloat(i[3]);if(!Number.isNaN(r)){let i=n(((e*60+t)*60+r)*1e3);if(i!==void 0)return i}}let a=e.match(/Please retry in ([0-9.]+)(ms|s)/i);if(a?.[1]){let e=parseFloat(a[1]);if(!Number.isNaN(e)&&e>0){let t=n(a[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}let o=e.match(/"retryDelay":\s*"([0-9.]+)(ms|s)"/i);if(o?.[1]){let e=parseFloat(o[1]);if(!Number.isNaN(e)&&e>0){let t=n(o[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}}function w(e){return e.provider===`google-antigravity`&&e.id.startsWith(`claude-`)&&e.reasoning}function T(e){return/gemini-3(?:\.1)?-pro/.test(e.toLowerCase())}function E(e){return/gemini-3(?:\.1)?-flash/.test(e.toLowerCase())}function D(e){return T(e)||E(e)}function O(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/resource.?exhausted|rate.?limit|overloaded|service.?unavailable|other.?side.?closed/i.test(t)}function k(e){try{let t=JSON.parse(e);if(t.error?.message)return t.error.message}catch{}return e}function A(e,t){return new Promise((n,r)=>{if(t?.aborted){r(Error(`Request was aborted`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Request was aborted`))})})}var j=(n,r,i)=>{let o=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-gemini-cli`,provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let s=i?.apiKey;if(!s)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let u,m;try{let e=JSON.parse(s);u=e.token,m=e.projectId}catch{throw Error(`Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate.`)}if(!u||!m)throw Error(`Missing token or projectId in Google Cloud credentials. Use /login to re-authenticate.`);let g=n.provider===`google-antigravity`,T=n.baseUrl?.trim(),E=T?[T]:g?f:[d],D=N(n,r,m,i,g),j=await i?.onPayload?.(D,n);j!==void 0&&(D=j);let M=g?h():p,P={Authorization:`Bearer ${u}`,"Content-Type":`application/json`,Accept:`text/event-stream`,...M,...w(n)?{"anthropic-beta":S}:{},...i?.headers},F=JSON.stringify(D),I,L,R,z=0;for(let e=0;e<=v;e++){if(i?.signal?.aborted)throw Error(`Request was aborted`);try{if(R=`${E[z]}/v1internal:streamGenerateContent?alt=sse`,I=await fetch(R,{method:`POST`,headers:P,body:F,signal:i?.signal}),I.ok)break;let t=await I.text();if((I.status===403||I.status===404)&&z<E.length-1){z++;continue}if(e<v&&O(I.status,t)){z<E.length-1&&z++;let n=C(t,I),r=n??y*2**e,a=i?.maxRetryDelayMs??6e4;if(a>0&&n&&n>a){let e=Math.ceil(n/1e3);throw Error(`Server requested ${e}s retry delay (max: ${Math.ceil(a/1e3)}s). ${k(t)}`)}await A(r,i?.signal);continue}throw Error(`Cloud Code Assist API error (${I.status}): ${k(t)}`)}catch(t){if(t instanceof Error&&(t.name===`AbortError`||t.message===`Request was aborted`))throw Error(`Request was aborted`);if(L=t instanceof Error?t:Error(String(t)),L.message===`fetch failed`&&L.cause instanceof Error&&(L=Error(`Network error: ${L.cause.message}`)),e<v){await A(y*2**e,i?.signal);continue}throw L}}if(!I||!I.ok)throw L??Error(`Failed to get response after retries`);let B=!1,V=()=>{B||=(o.push({type:`start`,partial:t}),!0)},H=()=>{t.content=[],t.usage={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t.stopReason=`stop`,t.errorMessage=void 0,t.timestamp=Date.now(),B=!1},U=async r=>{if(!r.body)throw Error(`No response body`);let s=!1,u=null,d=t.content,f=()=>d.length-1,p=r.body.getReader(),m=new TextDecoder,h=``,g=()=>{p.cancel().catch(()=>{})};i?.signal?.addEventListener(`abort`,g);try{for(;;){if(i?.signal?.aborted)throw Error(`Request was aborted`);let{done:r,value:g}=await p.read();if(r)break;h+=m.decode(g,{stream:!0});let v=h.split(`
1
+ import{r as e,t}from"./event-stream-D33K9rpL.js";import{a as n,i as r,r as i}from"./transform-messages-DXDWLrnO.js";import{a,n as o,o as s,r as c,s as l,t as u}from"./google-shared-DFv4ubOG.js";var d=`https://cloudcode-pa.googleapis.com`,f=[`https://daily-cloudcode-pa.sandbox.googleapis.com`,`https://autopush-cloudcode-pa.sandbox.googleapis.com`,d],p={"User-Agent":`google-cloud-sdk vscode_cloudshelleditor/0.1`,"X-Goog-Api-Client":`gl-node/22.17.0`,"Client-Metadata":JSON.stringify({ideType:`IDE_UNSPECIFIED`,platform:`PLATFORM_UNSPECIFIED`,pluginType:`GEMINI`})},m=`1.18.4`;function h(){return{"User-Agent":`antigravity/${{}.PI_AI_ANTIGRAVITY_VERSION||m} darwin/arm64`}}var g=`You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**`,_=0,v=3,y=1e3,b=2,x=500,S=`interleaved-thinking-2025-05-14`;function C(e,t){let n=e=>e>0?Math.ceil(e+1e3):void 0,r=t instanceof Headers?t:t?.headers;if(r){let e=r.get(`retry-after`);if(e){let t=Number(e);if(Number.isFinite(t)){let e=n(t*1e3);if(e!==void 0)return e}let r=new Date(e).getTime();if(!Number.isNaN(r)){let e=n(r-Date.now());if(e!==void 0)return e}}let t=r.get(`x-ratelimit-reset`);if(t){let e=Number.parseInt(t,10);if(!Number.isNaN(e)){let t=n(e*1e3-Date.now());if(t!==void 0)return t}}let i=r.get(`x-ratelimit-reset-after`);if(i){let e=Number(i);if(Number.isFinite(e)){let t=n(e*1e3);if(t!==void 0)return t}}}let i=e.match(/reset after (?:(\d+)h)?(?:(\d+)m)?(\d+(?:\.\d+)?)s/i);if(i){let e=i[1]?parseInt(i[1],10):0,t=i[2]?parseInt(i[2],10):0,r=parseFloat(i[3]);if(!Number.isNaN(r)){let i=n(((e*60+t)*60+r)*1e3);if(i!==void 0)return i}}let a=e.match(/Please retry in ([0-9.]+)(ms|s)/i);if(a?.[1]){let e=parseFloat(a[1]);if(!Number.isNaN(e)&&e>0){let t=n(a[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}let o=e.match(/"retryDelay":\s*"([0-9.]+)(ms|s)"/i);if(o?.[1]){let e=parseFloat(o[1]);if(!Number.isNaN(e)&&e>0){let t=n(o[2].toLowerCase()===`ms`?e:e*1e3);if(t!==void 0)return t}}}function w(e){return e.provider===`google-antigravity`&&e.id.startsWith(`claude-`)&&e.reasoning}function T(e){return/gemini-3(?:\.1)?-pro/.test(e.toLowerCase())}function E(e){return/gemini-3(?:\.1)?-flash/.test(e.toLowerCase())}function D(e){return T(e)||E(e)}function O(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/resource.?exhausted|rate.?limit|overloaded|service.?unavailable|other.?side.?closed/i.test(t)}function k(e){try{let t=JSON.parse(e);if(t.error?.message)return t.error.message}catch{}return e}function A(e,t){return new Promise((n,r)=>{if(t?.aborted){r(Error(`Request was aborted`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(Error(`Request was aborted`))})})}var j=(n,r,i)=>{let o=new t;return(async()=>{let t={role:`assistant`,content:[],api:`google-gemini-cli`,provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`stop`,timestamp:Date.now()};try{let s=i?.apiKey;if(!s)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let u,m;try{let e=JSON.parse(s);u=e.token,m=e.projectId}catch{throw Error(`Invalid Google Cloud Code Assist credentials. Use /login to re-authenticate.`)}if(!u||!m)throw Error(`Missing token or projectId in Google Cloud credentials. Use /login to re-authenticate.`);let g=n.provider===`google-antigravity`,T=n.baseUrl?.trim(),E=T?[T]:g?f:[d],D=N(n,r,m,i,g),j=await i?.onPayload?.(D,n);j!==void 0&&(D=j);let M=g?h():p,P={Authorization:`Bearer ${u}`,"Content-Type":`application/json`,Accept:`text/event-stream`,...M,...w(n)?{"anthropic-beta":S}:{},...i?.headers},F=JSON.stringify(D),I,L,R,z=0;for(let e=0;e<=v;e++){if(i?.signal?.aborted)throw Error(`Request was aborted`);try{if(R=`${E[z]}/v1internal:streamGenerateContent?alt=sse`,I=await fetch(R,{method:`POST`,headers:P,body:F,signal:i?.signal}),I.ok)break;let t=await I.text();if((I.status===403||I.status===404)&&z<E.length-1){z++;continue}if(e<v&&O(I.status,t)){z<E.length-1&&z++;let n=C(t,I),r=n??y*2**e,a=i?.maxRetryDelayMs??6e4;if(a>0&&n&&n>a){let e=Math.ceil(n/1e3);throw Error(`Server requested ${e}s retry delay (max: ${Math.ceil(a/1e3)}s). ${k(t)}`)}await A(r,i?.signal);continue}throw Error(`Cloud Code Assist API error (${I.status}): ${k(t)}`)}catch(t){if(t instanceof Error&&(t.name===`AbortError`||t.message===`Request was aborted`))throw Error(`Request was aborted`);if(L=t instanceof Error?t:Error(String(t)),L.message===`fetch failed`&&L.cause instanceof Error&&(L=Error(`Network error: ${L.cause.message}`)),e<v){await A(y*2**e,i?.signal);continue}throw L}}if(!I||!I.ok)throw L??Error(`Failed to get response after retries`);let B=!1,V=()=>{B||=(o.push({type:`start`,partial:t}),!0)},H=()=>{t.content=[],t.usage={input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},t.stopReason=`stop`,t.errorMessage=void 0,t.timestamp=Date.now(),B=!1},U=async r=>{if(!r.body)throw Error(`No response body`);let s=!1,u=null,d=t.content,f=()=>d.length-1,p=r.body.getReader(),m=new TextDecoder,h=``,g=()=>{p.cancel().catch(()=>{})};i?.signal?.addEventListener(`abort`,g);try{for(;;){if(i?.signal?.aborted)throw Error(`Request was aborted`);let{done:r,value:g}=await p.read();if(r)break;h+=m.decode(g,{stream:!0});let v=h.split(`
2
2
  `);h=v.pop()||``;for(let r of v){if(!r.startsWith(`data:`))continue;let i=r.slice(5).trim();if(!i)continue;let p;try{p=JSON.parse(i)}catch{continue}let m=p.response;if(!m)continue;t.responseId||=m.responseId;let h=m.candidates?.[0];if(h?.content?.parts)for(let e of h.content.parts){if(e.text!==void 0){s=!0;let n=c(e);(!u||n&&u.type!==`thinking`||!n&&u.type!==`text`)&&(u&&(u.type===`text`?o.push({type:`text_end`,contentIndex:d.length-1,content:u.text,partial:t}):o.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:t})),n?(u={type:`thinking`,thinking:``,thinkingSignature:void 0},t.content.push(u),V(),o.push({type:`thinking_start`,contentIndex:f(),partial:t})):(u={type:`text`,text:``},t.content.push(u),V(),o.push({type:`text_start`,contentIndex:f(),partial:t}))),u.type===`thinking`?(u.thinking+=e.text,u.thinkingSignature=l(u.thinkingSignature,e.thoughtSignature),o.push({type:`thinking_delta`,contentIndex:f(),delta:e.text,partial:t})):(u.text+=e.text,u.textSignature=l(u.textSignature,e.thoughtSignature),o.push({type:`text_delta`,contentIndex:f(),delta:e.text,partial:t}))}if(e.functionCall){s=!0,u&&=(u.type===`text`?o.push({type:`text_end`,contentIndex:f(),content:u.text,partial:t}):o.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:t}),null);let n=e.functionCall.id,r={type:`toolCall`,id:!n||t.content.some(e=>e.type===`toolCall`&&e.id===n)?`${e.functionCall.name}_${Date.now()}_${++_}`:n,name:e.functionCall.name||``,arguments:e.functionCall.args??{},...e.thoughtSignature&&{thoughtSignature:e.thoughtSignature}};t.content.push(r),V(),o.push({type:`toolcall_start`,contentIndex:f(),partial:t}),o.push({type:`toolcall_delta`,contentIndex:f(),delta:JSON.stringify(r.arguments),partial:t}),o.push({type:`toolcall_end`,contentIndex:f(),toolCall:r,partial:t})}}if(h?.finishReason&&(t.stopReason=a(h.finishReason),t.content.some(e=>e.type===`toolCall`)&&(t.stopReason=`toolUse`)),m.usageMetadata){let r=m.usageMetadata.promptTokenCount||0,i=m.usageMetadata.cachedContentTokenCount||0;t.usage={input:r-i,output:(m.usageMetadata.candidatesTokenCount||0)+(m.usageMetadata.thoughtsTokenCount||0),cacheRead:i,cacheWrite:0,totalTokens:m.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},e(n,t.usage)}}}}finally{i?.signal?.removeEventListener(`abort`,g)}return u&&(u.type===`text`?o.push({type:`text_end`,contentIndex:f(),content:u.text,partial:t}):o.push({type:`thinking_end`,contentIndex:f(),content:u.thinking,partial:t})),s},W=!1,G=I;for(let e=0;e<=b;e++){if(i?.signal?.aborted)throw Error(`Request was aborted`);if(e>0){if(await A(x*2**(e-1),i?.signal),!R)throw Error(`Missing request URL`);if(G=await fetch(R,{method:`POST`,headers:P,body:F,signal:i?.signal}),!G.ok){let e=await G.text();throw Error(`Cloud Code Assist API error (${G.status}): ${e}`)}}if(await U(G)){W=!0;break}e<b&&H()}if(!W)throw Error(`Cloud Code Assist API returned an empty response`);if(i?.signal?.aborted)throw Error(`Request was aborted`);if(t.stopReason===`aborted`||t.stopReason===`error`)throw Error(`An unknown error occurred`);o.push({type:`done`,reason:t.stopReason,message:t}),o.end()}catch(e){for(let e of t.content)`index`in e&&delete e.index;t.stopReason=i?.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),o.push({type:`error`,reason:t.stopReason,error:t}),o.end()}})(),o},M=(e,t,n)=>{let a=n?.apiKey;if(!a)throw Error(`Google Cloud Code Assist requires OAuth authentication. Use /login to authenticate.`);let o=i(e,n,a);if(!n?.reasoning)return j(e,t,{...o,thinking:{enabled:!1}});let s=r(n.reasoning);if(D(e.id))return j(e,t,{...o,thinking:{enabled:!0,level:F(s,e.id)}});let c={minimal:1024,low:2048,medium:8192,high:16384,...n.thinkingBudgets}[s],l=Math.min((o.maxTokens||0)+c,e.maxTokens);return l<=c&&(c=Math.max(0,l-1024)),j(e,t,{...o,maxTokens:l,thinking:{enabled:!0,budgetTokens:c}})};function N(e,t,r,i={},a=!1){let c=u(e,t),l={};i.temperature!==void 0&&(l.temperature=i.temperature),i.maxTokens!==void 0&&(l.maxOutputTokens=i.maxTokens),i.thinking?.enabled&&e.reasoning?(l.thinkingConfig={includeThoughts:!0},i.thinking.level===void 0?i.thinking.budgetTokens!==void 0&&(l.thinkingConfig.thinkingBudget=i.thinking.budgetTokens):l.thinkingConfig.thinkingLevel=i.thinking.level):e.reasoning&&i.thinking&&!i.thinking.enabled&&(l.thinkingConfig=P(e.id));let d={contents:c};if(d.sessionId=i.sessionId,t.systemPrompt&&(d.systemInstruction={parts:[{text:n(t.systemPrompt)}]}),Object.keys(l).length>0&&(d.generationConfig=l),t.tools&&t.tools.length>0){let n=e.id.startsWith(`claude-`);d.tools=o(t.tools,n),i.toolChoice&&(d.toolConfig={functionCallingConfig:{mode:s(i.toolChoice)}})}if(a){let e=d.systemInstruction?.parts??[];d.systemInstruction={role:`user`,parts:[{text:g},{text:`Please ignore following [ignore]${g}[/ignore]`},...e]}}return{project:r,model:e.id,request:d,...a?{requestType:`agent`}:{},userAgent:a?`antigravity`:`pi-coding-agent`,requestId:`${a?`agent`:`pi`}-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}}function P(e){return T(e)?{thinkingLevel:`LOW`}:E(e)?{thinkingLevel:`MINIMAL`}:{thinkingBudget:0}}function F(e,t){if(T(t))switch(e){case`minimal`:case`low`:return`LOW`;case`medium`:case`high`:return`HIGH`}switch(e){case`minimal`:return`MINIMAL`;case`low`:return`LOW`;case`medium`:return`MEDIUM`;case`high`:return`HIGH`}}export{N as buildRequest,C as extractRetryDelay,j as streamGoogleGeminiCli,M as streamSimpleGoogleGeminiCli};